MK25S-RAMBo13a_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 43 51 jmp 0xa286 ; 0xa286 <__dtors_end> 4: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 8: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 10: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 14: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 18: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 1c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 20: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 24: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 28: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 2c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 30: 0c 94 4b 75 jmp 0xea96 ; 0xea96 <__vector_12> 34: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 38: 0d 94 2b 15 jmp 0x22a56 ; 0x22a56 <__vector_14> 3c: 0d 94 6f 12 jmp 0x224de ; 0x224de <__vector_15> 40: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 44: 0d 94 c8 22 jmp 0x24590 ; 0x24590 <__vector_17> 48: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 4c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 50: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 54: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 58: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 5c: 0c 94 c4 6d jmp 0xdb88 ; 0xdb88 <__vector_23> 60: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 64: 0d 94 a5 9a jmp 0x3354a ; 0x3354a <__vector_25> 68: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 6c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 70: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 74: 0c 94 f2 7d jmp 0xfbe4 ; 0xfbe4 <__vector_29> 78: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 7c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 80: 0d 94 79 17 jmp 0x22ef2 ; 0x22ef2 <__vector_32> 84: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 88: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 8c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 90: 0d 94 61 9a jmp 0x334c2 ; 0x334c2 <__vector_36> 94: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 98: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 9c: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> a0: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> a4: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> a8: 0d 94 b7 0d jmp 0x21b6e ; 0x21b6e <__vector_42> ac: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> b0: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> b4: 0d 94 99 0d jmp 0x21b32 ; 0x21b32 <__vector_45> b8: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> bc: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> c0: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> c4: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> c8: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> cc: 0d 94 59 0d jmp 0x21ab2 ; 0x21ab2 <__vector_51> d0: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> d4: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> d8: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> dc: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> e0: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__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 20 43 6f 6e 74 69 6e 75 65 3f level. Continue? ... 000036b5 : 36b5: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36c5: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36d5: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 36e5: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 36f5: 20 61 67 61 69 6e 2e 20 50 72 69 6e 74 20 63 61 again. Print ca 3705: 6e 63 65 6c 6c 65 64 2e 00 ncelled.. 0000370e : 370e: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 371e: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 372e: 77 61 72 65 2e 20 43 6f 6e 74 69 6e 75 65 3f 00 ware. Continue?. 0000373e : 373e: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 374e: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 375e: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 376e: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 377e: 2e 20 50 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 . Print cancelle 378e: 64 2e 00 d.. 00003791 : 3791: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37a1: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37b1: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 43 6f printer type. Co 37c1: 6e 74 69 6e 75 65 3f 00 ntinue?. 000037c9 : 37c9: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37d9: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37e9: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37f9: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 3809: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 20 50 e model again. P 3819: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00003829 : 3829: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 3839: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 3849: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 0000385a : 385a: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 386a: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 387a: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003885 : 3885: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3895: 6b 6e 6f 62 00 knob. 0000389a : 389a: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 38aa: 74 00 t. 000038ac : 38ac: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 38bc: 65 63 74 00 ect. 000038c0 : 38c0: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 38d0: 6f 61 64 65 64 00 oaded. 000038d6 : 38d6: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 38e6: 74 6c 79 00 tly. 000038ea : 38ea: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038fa : 38fa: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 390a: 21 00 !. 0000390c : 390c: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 391c: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 392c: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 393c: 2e 00 .. 0000393e : 393e: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 394e: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 395e: 3f 00 ?. 00003960 : 3960: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 3970: 2e 00 .. 00003972 : 3972: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3982: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3992: 3a 00 :. 00003994 : 3994: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 39a4: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 39b4: 67 00 g. 000039b6 : 39b6: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 000039c4 : 39c4: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 000039cf : 39cf: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 39df: 2e 2e 00 ... 000039e2 : 39e2: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39f2: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 3a02: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 3a12: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 3a22: 65 71 75 69 72 65 64 2e 00 equired.. 00003a2b : 3a2b: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 3a3b: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 3a4b: 73 74 2e 00 st.. 00003a4f : 3a4f: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3a5f: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3a6f: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3a7f: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003a8c : 3a8c: ff ff 43 68 65 63 6b 73 00 ..Checks. 00003a95 : 3a95: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00003aa1 : 3aa1: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 00003aac : 3aac: ff ff 53 6f 72 74 00 ..Sort. 00003ab3 : 3ab3: ff ff 54 69 6d 65 00 ..Time. 00003aba : 3aba: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00003ac3 : 3ac3: ff ff 53 44 20 63 61 72 64 00 ..SD card. 00003acd : 3acd: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 3add: 65 00 e. 00003adf : 3adf: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00003aef : 3aef: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 00003afa : 3afa: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 00003b09 : 3b09: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 3b19: 72 73 00 rs. 00003b1c : 3b1c: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 00003b28 : 3b28: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00003b36 : 3b36: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00003b43 : 3b43: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 3b53: 62 72 2e 00 br.. 00003b57 : 3b57: ff ff 53 68 6f 77 20 65 6e 64 20 73 74 6f 70 73 ..Show end stops ... 00003b68 : 3b68: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 3b78: 6e 00 n. 00003b7a : 3b7a: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 3b8a: 65 63 74 00 ect. 00003b8e : 3b8e: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 3b9e: 69 6e 67 00 ing. 00003ba2 : 3ba2: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00003bb0 : 3bb0: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00003bc0 : 3bc0: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00003bcb : 3bcb: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00003bd4 : 3bd4: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 3be4: 6e 74 00 nt. 00003be7 : 3be7: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00003bf2 : 3bf2: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 3c02: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 3c12: 69 61 74 65 6c 79 00 iately. 00003c19 : 3c19: ff ff 52 65 73 65 74 00 ..Reset. 00003c21 : 3c21: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00003c2a : 3c2a: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 3c3a: 6c 2e 00 l.. 00003c3d : 3c3d: ff ff 53 65 6c 65 63 74 00 ..Select. 00003c46 : 3c46: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00003c55 : 3c55: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00003c5f : 3c5f: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00003c70 : 3c70: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00003c7d : 3c7d: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00003c8a : 3c8a: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00003c98 : 3c98: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 3ca8: 65 6e 74 00 ent. 00003cac : 3cac: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00003cbc : 3cbc: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 3ccc: 74 00 t. 00003cce : 3cce: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00003cdf : 3cdf: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00003cf0 : 3cf0: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00003cfd : 3cfd: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003d0d : 3d0d: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003d1c : 3d1c: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003d2a : 3d2a: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003d36 : 3d36: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003d46 : 3d46: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003d50 : 3d50: ff ff 54 75 6e 65 00 ..Tune. 00003d57 : 3d57: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003d67 : 3d67: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003d71 : 3d71: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003d7f : 3d7f: ff ff 41 73 73 69 73 74 00 ..Assist. 00003d88 : 3d88: ff ff 4f 6e 63 65 00 ..Once. 00003d8f : 3d8f: ff ff 53 6f 75 6e 64 00 ..Sound. 00003d97 : 3d97: ff ff 4c 6f 75 64 00 ..Loud. 00003d9e : 3d9e: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003dac : 3dac: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3dbc: 74 00 t. 00003dbe : 3dbe: ff ff 46 6c 6f 77 00 ..Flow. 00003dc5 : 3dc5: ff ff 53 70 65 65 64 00 ..Speed. 00003dcd : 3dcd: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003ddd : 3ddd: ff ff 4e 2f 41 00 ..N/A. 00003de3 : 3de3: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003df1 : 3df1: ff ff 4d 65 73 68 00 ..Mesh. 00003df8 : 3df8: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003e03 : 3e03: ff ff 59 65 73 00 ..Yes. 00003e09 : 3e09: ff ff 4e 6f 00 ..No. 00003e0e : 3e0e: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003e1b : 3e1b: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003e2b : 3e2b: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3e3b: 65 2e 20 43 6f 6e 74 69 6e 75 65 20 61 6e 79 77 e. Continue anyw 3e4b: 61 79 3f 00 ay?. 00003e4f : 3e4f: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003e5a : 3e5a: ff ff 4d 61 69 6e 00 ..Main. 00003e61 : 3e61: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3e71: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3e81: 6c 69 6e 67 00 ling. 00003e86 : 3e86: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3e96: 74 3a 00 t:. 00003e99 : 3e99: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003ea7 : 3ea7: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003eb8 : 3eb8: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 00003ec2 : 3ec2: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 3ed2: 73 00 s. 00003ed4 : 3ed4: ff ff 41 78 69 73 00 ..Axis. 00003edb : 3edb: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00003ee9 : 3ee9: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00003ef8 : 3ef8: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 3f08: 74 00 t. 00003f0a : 3f0a: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00003f14 : 3f14: ff ff 4d 6f 74 6f 72 00 ..Motor. 00003f1c : 3f1c: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 00003f27 : 3f27: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 00003f36 : 3f36: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 00003f43 : 3f43: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 00003f53 : 3f53: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 3f63: 74 6f 72 00 tor. 00003f67 : 3f67: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 00003f77 : 3f77: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 3f87: 21 00 !. 00003f89 : 3f89: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 3f99: 72 00 r. 00003f9b : 3f9b: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003fa8 : 3fa8: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003fb6 : 3fb6: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3fc6: 6d 65 00 me. 00003fc9 : 3fc9: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 3fd9: 64 00 d. 00003fdb : 3fdb: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003fe9 : 3fe9: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3ff9: 72 73 00 rs. 00003ffc : 3ffc: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 400c: 64 00 d. 0000400e : 400e: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 0000401d : 401d: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 402d: 73 00 s. 0000402f : 402f: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 403f: 73 00 s. 00004041 : 4041: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 4051: 73 00 s. 00004053 : 4053: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4063: 6f 70 73 00 ops. 00004067 : 4067: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004076 : 4076: ff ff 42 61 63 6b 00 ..Back. 0000407d : 407d: ff ff 41 75 74 6f 20 70 6f 77 65 72 00 ..Auto power. 0000408a : 408a: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004093 : 4093: ff ff 4d 6f 64 65 00 ..Mode. 0000409a : 409a: ff ff 48 69 67 68 20 70 6f 77 65 72 00 ..High power. 000040a7 : 40a7: ff ff 53 74 72 69 63 74 00 ..Strict. 000040b0 : 40b0: ff ff 57 61 72 6e 00 ..Warn. 000040b7 : 40b7: ff ff 4e 6f 6e 65 00 ..None. 000040be : 40be: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 40ce: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 40de: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 40ee: 6f 20 73 70 65 63 73 3f 00 o specs?. 000040f7 : 40f7: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 4107: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 4117: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 4127: 65 2d 6d 6b 33 73 00 e-mk3s. 0000412e : 412e: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 413e: 68 65 64 00 hed. 00004142 : 4142: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 0000414d : 414d: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 0000415c : 415c: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 0000416c : 416c: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 417c: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004186 : 4186: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4196: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 41a6: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 41b6: 6e 75 65 3f 00 nue?. 000041bb : 41bb: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 41cb: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 41db: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 41eb: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 41fb: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 420b: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 0000421b : 421b: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 422b: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 423b: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 00004244 : 4244: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4254: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 4264: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004274 : 4274: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4284: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4294: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 42a4: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 42b4: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 42c4: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 42d4: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 42e4: 6e 20 66 6c 6f 77 2e 00 n flow.. 000042ec : 42ec: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 42fc: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 430c: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 431c: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 432c: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 433c: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 434c: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 0000435c : 435c: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 436c: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 437c: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 438c: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 439c: 2e 00 .. 0000439e : 439e: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 43ae: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 43be: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 43ce: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 000043da : 43da: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 43ea: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 43fa: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 440a: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004415 : 4415: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4425: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004436 : 4436: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4446: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4456: 67 65 64 2e 00 ged.. 0000445b : 445b: ff ff 53 68 65 65 74 00 ..Sheet. 00004463 : 4463: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00004472 : 4472: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 0000447d : 447d: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 448d: 6e 3f 00 n?. 00004490 : 4490: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 44a0: 6e 3f 00 n?. 000044a3 : 44a3: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000044ae : 44ae: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 44be: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 44ce: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 44de: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 44ee: 79 2e 00 y.. 000044f1 : 44f1: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4501: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 4511: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 4521: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 4531: 6a 6f 62 21 00 job!. 00004536 : 4536: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4546: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 4556: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 4566: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 4576: 73 21 00 s!. 00004579 : 4579: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4589: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 4599: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 45a9: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 45b9: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 000045c5 : 45c5: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45d5: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 45e5: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 45f5: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 4605: 68 61 62 6c 65 2e 00 hable.. 0000460c : 460c: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 461c: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 462c: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 463c: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 464c: 68 61 62 6c 65 2e 00 hable.. 00004653 : 4653: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4663: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 4673: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4683: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 4693: 2e 00 .. 00004695 : 4695: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46a5: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 46b5: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 46c5: 75 61 6c 2e 00 ual.. 000046ca : 46ca: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46da: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 46ea: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 46fa: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00004709 : 4709: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 4719: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 4729: 61 74 62 65 64 2e 00 atbed.. 00004730 : 4730: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 4740: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 4750: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 4760: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 4770: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 4780: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4790: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 47a0: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 47b0: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 47c0: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 000047cf : 47cf: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 47df: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 47ef: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 47ff: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 480f: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 481f: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 482f: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 483f: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 484f: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 485f: 69 61 74 65 6c 79 2e 00 iately.. 00004867 : 4867: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 4877: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4887: 74 00 t. 00004889 : 4889: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 4899: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 48a9: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 48b9: 74 00 t. 000048bb : 48bb: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 48cb: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 48db: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 48eb: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 000048f7 : 48f7: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00004903 : 4903: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004914 : 4914: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004924 : 4924: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4934: 6e 65 00 ne. 00004937 : 4937: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004947 : 4947: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004952 : 4952: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004960 : 4960: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004970 : 4970: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 0000497a : 497a: ff ff 54 6f 74 61 6c 00 ..Total. 00004982 : 4982: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 0000498f : 498f: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 0000499b : 499b: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 000049ac : 49ac: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 49bc: 73 00 s. 000049be : 49be: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 49ce: 65 73 00 es. 000049d1 : 49d1: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 49e1: 6c 75 72 65 73 00 lures. 000049e7 : 49e7: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 000049f8 : 49f8: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004a07 : 4a07: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004a16 : 4a16: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004a24 : 4a24: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004a34 : 4a34: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4a44: 6c 73 00 ls. 00004a47 : 4a47: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4a57: 72 3a 00 r:. 00004a5a : 4a5a: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004a64 : 4a64: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004a74 : 4a74: ff ff 44 61 74 65 3a 00 ..Date:. 00004a7c : 4a7c: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4a8c: 6d 65 6e 74 00 ment. 00004a91 : 4a91: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4aa1: 6e 74 00 nt. 00004aa4 : 4aa4: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004ab5 : 4ab5: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4ac5: 63 75 74 00 cut. 00004ac9 : 4ac9: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4ad9: 65 6a 65 63 74 00 eject. 00004adf : 4adf: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4aef: 75 6e 6c 6f 61 64 00 unload. 00004af6 : 4af6: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b06: 6c 6f 61 64 00 load. 00004b0b : 4b0b: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004b16 : 4b16: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4b26: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4b36: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004b41 : 4b41: ff ff 45 6a 65 63 74 00 ..Eject. 00004b49 : 4b49: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4b59: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4b69: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4b79: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4b89: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004b96 : 4b96: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004ba7 : 4ba7: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4bb7: 6d 65 00 me. 00004bba : 4bba: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004bca : 4bca: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004bd7 : 4bd7: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4be7: 7a 7a 6c 65 21 00 zzle!. 00004bed : 4bed: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004bf6 : 4bf6: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4c06: 6d 20 6d 69 6e 00 m min. 00004c0c : 4c0c: ff ff 4c 65 66 74 00 ..Left. 00004c13 : 4c13: ff ff 52 69 67 68 74 00 ..Right. 00004c1b : 4c1b: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004c2b : 4c2b: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004c39 : 4c39: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004c47 : 4c47: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4c57: 66 73 65 74 00 fset. 00004c5c : 4c5c: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004c6a : 4c6a: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004c7b : 4c7b: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004c8c : 4c8c: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004c9d : 4c9d: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004cae : 4cae: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4cbe: 65 3a 00 e:. 00004cc1 : 4cc1: ff ff 41 72 65 20 6c 65 66 74 20 61 6e 64 20 72 ..Are left and r 4cd1: 69 67 68 74 20 5a 2d 63 61 72 72 69 61 67 65 73 ight Z-carriages 4ce1: 20 61 6c 6c 20 75 70 3f 00 all up?. 00004cea : 4cea: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 58 59 ..Calibrating XY 4cfa: 5a 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e Z. Rotate the kn 4d0a: 6f 62 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a ob to move the Z 4d1a: 20 63 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 carriage up to 4d2a: 74 68 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 the end stoppers 4d3a: 2e 20 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e . Click when don 4d4a: 65 2e 00 e.. 00004d4d : 4d4d: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 2e ..Calibrating Z. 4d5d: 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f 62 Rotate the knob 4d6d: 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a 20 63 to move the Z c 4d7d: 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 74 68 arriage up to th 4d8d: 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 2e 20 e end stoppers. 4d9d: 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e 65 2e Click when done. ... 00004dae : 4dae: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4dbe: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004dc9 : 4dc9: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4dd9: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4de9: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4df9: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4e09: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4e19: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004e25 : 4e25: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004e30 : 4e30: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004e39 : 4e39: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004e42 : 4e42: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004e4b : 4e4b: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4e5b: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4e6b: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4e7b: 65 74 00 et. 00004e7e : 4e7e: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4e8e: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004e9c : 4e9c: ff ff 3e 43 61 6e 63 65 6c 00 ..>Cancel. 00004ea6 : 4ea6: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4eb6: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4ec6: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4ed6: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 4ee6: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 4ef6: 6e 6e 69 6e 67 2e 20 43 6f 6e 74 69 6e 75 65 3f nning. Continue? ... 00004f07 : 4f07: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 4f17: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 4f27: 2e 00 .. 00004f29 : 4f29: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4f39: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4f49: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 4f59: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 4f69: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00004f75 : 4f75: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4f85: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4f95: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 4fa5: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 4fb5: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 4fc5: 6c 6f 61 64 20 69 74 2e 00 load it.. 00004fce : 4fce: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 4fde: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 4fee: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 4ffe: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 500e: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 501e: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 502e: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 503e: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 504e: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 505e: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 0000506e : 506e: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 507e: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 508e: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 509e: 2e 00 .. 000050a0 : 50a0: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 50b0: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 50c0: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 50d0: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 50e0: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 50f0: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 000050f9 : 50f9: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 5109: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 5119: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 5129: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 5139: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00005148 : 5148: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 5158: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 5168: 20 69 74 20 6e 6f 77 3f 00 it now?. 00005171 : 5171: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 5181: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 5191: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 0000519b : 519b: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 51ab: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 000051b8 : 51b8: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 51c8: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 51d8: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 51e8: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 51f8: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 5208: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 5218: 2e 00 .. 0000521a : 521a: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 522a: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00005239 : 5239: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 5249: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 5259: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 5269: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 00005278 : 5278: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 5288: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 5298: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 52a8: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 52b8: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 52c8: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 52d8: 65 65 74 73 2e 00 eets.. 000052de : 52de: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 52ee: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 52fe: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 0000530e : 530e: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 531e: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 532e: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 533e: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 534e: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 535e: 64 3f 00 d?. 00005361 : 5361: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 5371: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 5381: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 5391: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000053a2 : 53a2: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 53b2: 61 64 65 64 3f 00 aded?. 000053b8 : 53b8: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 53c8: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 53d8: 50 4c 41 2e 00 PLA.. 000053dd : 53dd: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 53ed: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 000053fd : 53fd: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 540d: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 541d: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 0000542b : 542b: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 543b: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 544b: 20 66 69 72 73 74 2e 00 first.. 00005453 : 5453: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 5463: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 5473: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 5483: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00005491 : 5491: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 54a1: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 54b1: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 54c1: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 54d1: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 000054da : 54da: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 54ea: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 54fa: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 550a: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 551a: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 552a: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 553a: 65 73 73 3f 00 ess?. 0000553f : 553f: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 554f: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 555f: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 556f: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 557f: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 558f: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 559f: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 55af: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 55bf: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 55cf: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 55df: 69 6e 74 2e 00 int.. 000055e4 : 55e4: ff ff 50 61 75 73 65 00 ..Pause. 000055ec : 55ec: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 000055f8 : 55f8: ff ff 43 6f 6e 74 2e 00 ..Cont.. 00005600 : 5600: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 0000560e : 560e: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 0000561a : 561a: ff ff 43 75 74 74 65 72 00 ..Cutter. 00005623 : 5623: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 0000562f : 562f: ff ff 42 65 64 00 ..Bed. 00005635 : 5635: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005642 : 5642: ff ff 4d 6f 64 65 6c 00 ..Model. 0000564a : 564a: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 00005653 : 5653: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 5663: 6e 73 6f 72 00 nsor. 00005668 : 5668: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5678: 72 00 r. 0000567a : 567a: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 00005683 : 5683: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5693: 49 4e 44 41 00 INDA. 00005698 : 5698: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 56a8: 65 6e 74 00 ent. 000056ac : 56ac: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 56bc: 6f 72 00 or. 000056bf : 56bf: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 56cf: 63 74 6f 72 00 ctor. 000056d4 : 56d4: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 000056e5 : 56e5: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 56f5: 6e 74 00 nt. 000056f8 : 56f8: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5708: 65 00 e. 0000570a : 570a: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 571a: 20 73 6c 6f 74 00 slot. 00005720 : 5720: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 5730: 6d 65 6e 74 00 ment. 00005735 : 5735: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005746 : 5746: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5756: 65 6e 74 00 ent. 0000575a : 575a: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005769 : 5769: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5779: 73 65 72 00 ser. 0000577d : 577d: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 578d: 6d 65 6e 74 73 00 ments. 00005793 : 5793: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 000057a4 : 57a4: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 57b4: 7a 6c 65 00 zle. 000057b8 : 57b8: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 57c8: 72 75 64 65 72 00 ruder. 000057ce : 57ce: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 57de: 44 41 00 DA. 000057e1 : 57e1: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 57f1: 75 6c 6c 65 79 00 ulley. 000057f7 : 57f7: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5807: 49 4e 44 41 00 INDA. 0000580c : 580c: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 581c: 6c 65 72 00 ler. 00005820 : 5820: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005831 : 5831: ff ff 4f 4b 00 ..OK. 00005836 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.488>: 5836: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005846 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.487>: 5846: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5856: 45 00 E. 00005858 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.486>: 5858: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5868: 45 44 00 ED. 0000586b <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.485>: 586b: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 587b: 59 00 Y. 0000587d <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.484>: 587d: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 588d: 4f 52 00 OR. 00005890 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.483>: 5890: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 58a0: 4e 45 45 44 45 44 00 NEEDED. 000058a7 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.482>: 58a7: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 000058b4 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.481>: 58b4: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 000058c3 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.480>: 58c3: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 58d3: 4f 41 44 45 44 00 OADED. 000058d9 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.479>: 58d9: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 58e9: 45 52 52 4f 52 00 ERROR. 000058ef <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.478>: 58ef: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 58ff: 44 49 4e 47 00 DING. 00005904 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.477>: 5904: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005914 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.476>: 5914: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5924: 41 49 4c 45 44 00 AILED. 0000592a <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.475>: 592a: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 593a: 52 54 45 44 00 RTED. 0000593f <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.474>: 593f: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 594f: 47 45 20 45 52 52 00 GE ERR. 00005956 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.473>: 5956: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5966: 45 54 00 ET. 00005969 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.472>: 5969: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5979: 4f 52 00 OR. 0000597c <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.471>: 597c: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 598c: 52 52 4f 52 00 RROR. 00005991 <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.470>: 5991: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 59a1: 4f 20 48 4f 54 00 O HOT. 000059a7 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.469>: 59a7: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 59b7: 4f 56 45 00 OVE. 000059bb <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.468>: 59bb: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 59cb: 4f 4d 45 00 OME. 000059cf <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.467>: 59cf: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 59df: 54 20 4d 4f 56 45 00 T MOVE. 000059e6 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.466>: 59e6: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 59f6: 54 20 48 4f 4d 45 00 T HOME. 000059fd <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.465>: 59fd: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5a0d: 46 41 49 4c 45 44 00 FAILED. 00005a14 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.464>: 5a14: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005a24 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.463>: 5a24: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5a34: 52 4c 59 00 RLY. 00005a38 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.462>: 5a38: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5a48: 4d 4f 56 45 00 MOVE. 00005a4d <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.461>: 5a4d: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5a5d: 54 55 43 4b 00 TUCK. 00005a62 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.460>: 5a62: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5a72: 54 52 49 47 47 2e 00 TRIGG.. 00005a79 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.459>: 5a79: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5a89: 54 55 43 4b 00 TUCK. 00005a8e <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.458>: 5a8e: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5a9e: 49 47 47 45 52 00 IGGER. 00005aa4 : 5aa4: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005ab3 : 5ab3: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005ac4 : 5ac4: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5ad4: 6e 74 00 nt. 00005ad7 : 5ad7: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5ae7: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5af7: 72 65 2e 2e 2e 00 re.... 00005afd : 5afd: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005b0d : 5b0d: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5b1d: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5b2d: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5b3d: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5b4d: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5b5d: 30 2e 00 0.. 00005b60 : 5b60: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 00005b6b : 5b6b: ff ff 4f 66 66 00 ..Off. 00005b71 : 5b71: ff ff 4f 6e 00 ..On. 00005b76 : 5b76: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5b86: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005b93 : 5b93: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5ba3: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5bb3: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5bc3: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5bd3: 2e 00 .. 00005bd5 : 5bd5: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5be5: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5bf5: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5c05: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005c0e : 5c0e: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5c1e: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5c2e: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5c3e: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5c4e: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5c5e: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005c6c : 5c6c: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5c7c: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5c8c: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5c9c: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5cac: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005cb6 : 5cb6: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5cc6: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5cd6: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5ce6: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5cf6: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005d00 : 5d00: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5d10: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5d20: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5d30: 4d 4d 55 2e 00 MMU.. 00005d35 : 5d35: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5d45: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5d55: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5d65: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5d75: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5d85: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5d95: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5da5: 29 2e 00 ).. 00005da8 : 5da8: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5db8: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5dc8: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5dd8: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5de8: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005df2 : 5df2: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5e02: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5e12: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5e22: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00005e33 : 5e33: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5e43: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 5e53: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 5e63: 63 74 6f 72 73 2e 00 ctors.. 00005e6a : 5e6a: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 5e7a: 6e 6c 69 6e 65 2e 00 nline.. 00005e81 : 5e81: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 5e91: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 5ea1: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 5eb1: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 5ec1: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00005ecd : 5ecd: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 5edd: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00005eed : 5eed: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 5efd: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 5f0d: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 5f1d: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 5f2d: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 00005f3c : 5f3c: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 5f4c: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 5f5c: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 5f6c: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 5f7c: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 5f8c: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 5f9c: 6e 65 65 64 65 64 2e 00 needed.. 00005fa4 : 5fa4: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 5fb4: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 5fc4: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 5fd4: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 5fe4: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 5ff4: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 6004: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 6014: 6f 70 65 72 6c 79 2e 00 operly.. 0000601c : 601c: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 602c: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 603c: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 604c: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 605c: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 606c: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 607c: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 608c: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 609c: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 60ac: 2e 00 .. 000060ae : 60ae: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 60be: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 60ce: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 60de: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 60ee: 20 77 69 72 69 6e 67 2e 00 wiring.. 000060f7 : 60f7: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6107: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 6117: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 6127: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 6137: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 6147: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 6157: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 00006164 : 6164: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6174: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 6184: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 6194: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 61a4: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 61b4: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 61c4: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 61d4: 61 63 68 65 64 20 69 74 2e 00 ached it.. 000061de : 61de: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 61ee: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 61fe: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 620e: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 621e: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 622e: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 623e: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 624e: 6f 72 6b 73 2e 00 orks.. 00006254 : 6254: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 6264: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 6274: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 6284: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 6294: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 62a4: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 000062b5 : 62b5: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 000062bf : 62bf: ff ff 53 74 6f 70 00 ..Stop. 000062c6 : 62c6: ff ff 4c 6f 61 64 00 ..Load. 000062cd : 62cd: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 000062d6 : 62d6: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 000062e1 : 62e1: ff ff 52 65 74 72 79 00 ..Retry. 000062e9 : 62e9: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 62f9: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 6309: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 6319: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 6329: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 6339: 74 2e 00 t.. 0000633c : 633c: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 0000634a : 634a: ff ff 44 6f 6e 65 00 ..Done. 00006351 <__loc_pri_end>: 6351: 65 6e ori r22, 0xE5 ; 229 6353: 71 75 andi r23, 0x51 ; 81 6355: 65 69 ori r22, 0x95 ; 149 6357: 6e 67 ori r22, 0x7E ; 126 6359: 20 22 and r2, r16 ... 0000635c : 635c: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 636c: 6c 65 00 le. 0000636f : 636f: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 637f: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 638f: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006399 : 6399: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 63a9: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 63b9: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000063c3 : 63c3: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 63d3: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 000063e2 : 63e2: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 63f2: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 6402: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 6412: 3a 20 00 : . 00006415 : 6415: 25 75 20 62 79 74 65 73 20 77 72 69 74 74 65 6e %u bytes written 6425: 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 73 to %S at addres 6435: 73 20 30 78 25 30 38 78 0a 00 s 0x%08x.. 0000643f : 643f: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 644f: 20 25 53 0a 00 %S.. 00006454 <__c.2309>: 6454: 3f 3f 00 ??. 00006457 <__c.2307>: 6457: 52 6f 6d 61 6e 61 00 Romana. 0000645e <__c.2304>: 645e: 48 72 76 61 74 73 6b 69 00 Hrvatski. 00006467 <__c.2301>: 6467: 4d 61 67 79 61 72 00 Magyar. 0000646e <__c.2298>: 646e: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006479 <__c.2295>: 6479: 4e 6f 72 73 6b 00 Norsk. 0000647f <__c.2292>: 647f: 53 76 65 6e 73 6b 61 00 Svenska. 00006487 <__c.2289>: 6487: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 00006492 <__c.2286>: 6492: 50 6f 6c 73 6b 69 00 Polski. 00006499 <__c.2283>: 6499: 49 74 61 6c 69 61 6e 6f 00 Italiano. 000064a2 <__c.2280>: 64a2: 46 72 61 6e 63 61 69 73 00 Francais. 000064ab <__c.2277>: 64ab: 45 73 70 61 6e 6f 6c 00 Espanol. 000064b3 <__c.2274>: 64b3: 44 65 75 74 73 63 68 00 Deutsch. 000064bb <__c.2271>: 64bb: 43 65 73 74 69 6e 61 00 Cestina. 000064c3 <__c.2268>: 64c3: 45 6e 67 6c 69 73 68 00 English. 000064cb : 64cb: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000064d6 : 64d6: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 64e6: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 64f6: 31 40 3a 25 75 0a 00 1@:%u.. 000064fd : 64fd: 52 65 73 65 6e 64 00 Resend. 00006504 : 6504: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 00006510 : 6510: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 6520: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 0000652a : 652a: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 653a: 64 65 74 65 63 74 65 64 21 00 detected!. 00006544 : 6544: 64 69 73 61 62 6c 65 64 00 disabled. 0000654d : 654d: 65 6e 61 62 6c 65 64 00 enabled. 00006555 : 6555: 45 45 50 52 4f 4d 00 EEPROM. 0000655c : 655c: 53 52 41 4d 00 SRAM. 00006561 : 6561: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 6571: 6f 70 0a 00 op.. 00006575 : 6575: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 6585: 20 30 00 0. 00006588 : 6588: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 00006599 : 6599: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000065a2 : 65a2: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 65b2: 20 00 . 000065b4 : 65b4: 25 75 00 %u. 000065b7 : 65b7: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 65c7: 20 22 00 ". 000065ca <_ZZ16process_commandsvE3__c__57_>: 65ca: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 65da: 72 75 64 65 72 20 00 ruder . 000065e1 : 65e1: 7a 5f 6d 61 78 3a 20 00 z_max: . 000065e9 : 65e9: 7a 5f 6d 69 6e 3a 20 00 z_min: . 000065f1 <_ZZ16process_commandsvE3__c__56_>: 65f1: 79 5f 6d 69 6e 3a 20 00 y_min: . 000065f9 : 65f9: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006603 : 6603: 6f 70 65 6e 00 open. 00006608 <_ZZ16process_commandsvE3__c__55_>: 6608: 78 5f 6d 69 6e 3a 20 00 x_min: . 00006610 <_ZZ16process_commandsvE3__c__54_>: 6610: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 6620: 70 20 73 74 61 74 75 73 00 p status. 00006629 : 6629: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6639: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006646 : 6646: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6656: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 00006663 <_ZZ16process_commandsvE3__c__37_>: 6663: 53 49 4c 45 4e 54 00 SILENT. 0000666a <_ZZ16process_commandsvE3__c__36_>: 666a: 4e 4f 52 4d 41 4c 00 NORMAL. 00006671 <_ZZ16process_commandsvE3__c__35_>: 6671: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6681: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6691: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 66a1: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 66b1: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 66c1: 64 0a 00 d.. 000066c4 <_ZZ16process_commandsvE3__c__34_>: 66c4: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 66d4: 0a 00 .. 000066d6 <_ZZ16process_commandsvE3__c__30_>: 66d6: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 000066e4 <_ZZ16process_commandsvE3__c__29_>: 66e4: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 000066f4 : 66f4: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6704: 20 25 73 0a 00 %s.. 00006709 <_ZZ16process_commandsvE3__c__27_>: 6709: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6719: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6729: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006735 <_ZZ16process_commandsvE3__c__26_>: 6735: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006742 <_ZZ16process_commandsvE3__c__25_>: 6742: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6752: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6762: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6772: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 0000677e <_ZZ16process_commandsvE3__c__24_>: 677e: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 0000678b <_ZZ16process_commandsvE3__c__23_>: 678b: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 679b: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 000067a4 <_ZZ16process_commandsvE3__c__20_>: 67a4: 25 64 20 20 25 2e 32 66 00 %d %.2f. 000067ad <_ZZ16process_commandsvE3__c__19_>: 67ad: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 67bd: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 000067c9 <_ZZ16process_commandsvE3__c__18_>: 67c9: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 000067d2 : 67d2: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 67e2: 64 20 52 50 4d 0a 00 d RPM.. 000067e9 : 67e9: 4d 31 30 37 00 M107. 000067ee : 67ee: 53 75 70 65 72 50 49 4e 44 41 00 SuperPINDA. 000067f9 : 67f9: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00006806 : 6806: 46 6c 61 73 68 41 69 72 00 FlashAir. 0000680f : 680f: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 681f: 52 52 4f 52 00 RROR. 00006824 : 6824: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006835 : 6835: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006845 : 6845: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006854 : 6854: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6864: 64 79 00 dy. 00006867 : 6867: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006877 : 6877: 4f 4b 00 OK. 0000687a : 687a: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 688a: 65 64 00 ed. 0000688d <_ZZN10CardReader7releaseEvE3__c.lto_priv.497>: 688d: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 0000689e : 689e: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 000068ad : 68ad: 4d 38 34 00 M84. 000068b1 : 68b1: 4d 37 30 32 00 M702. 000068b6 : 68b6: 47 32 38 20 57 00 G28 W. 000068bc : 68bc: 4d 35 30 30 00 M500. 000068c1 : 68c1: 42 61 64 20 69 6e 74 65 72 72 75 70 74 00 Bad interrupt. 000068cf : 68cf: 57 61 74 63 68 64 6f 67 20 74 69 6d 65 6f 75 74 Watchdog timeout ... 000068e0 : 68e0: 53 74 61 74 69 63 20 6d 65 6d 6f 72 79 20 68 61 Static memory ha 68f0: 73 0a 62 65 65 6e 20 6f 76 65 72 77 72 69 74 74 s.been overwritt 6900: 65 6e 00 en. 00006903 : 6903: 46 49 52 4d 57 41 52 45 20 43 52 41 53 48 21 0a FIRMWARE CRASH!. 6913: 43 72 61 73 68 20 72 65 61 73 6f 6e 3a 0a 00 Crash reason:.. 00006922 : 6922: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6932: 79 74 65 73 3a 20 00 ytes: . 00006939 : 6939: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006948 : 6948: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006954 : 6954: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006964 : 6964: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006974 : 6974: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006984 : 6984: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006995 : 6995: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 000069a5 : 69a5: 50 6f 77 65 72 55 70 00 PowerUp. 000069ad : 69ad: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 69bd: 20 66 69 6c 65 00 file. 000069c3 : 69c3: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 69d3: 2e 00 .. 000069d5 : 69d5: 6f 6b 00 ok. 000069d8 : 69d8: 46 69 6c 61 6d 65 6e 74 00 Filament. 000069e1 : 69e1: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 69f1: 25 66 20 25 66 0a 00 %f %f.. 000069f8 : 69f8: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6a08: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6a18: 69 6c 65 64 2e 0a 00 iled... 00006a1f : 6a1f: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6a2f: 65 73 73 2e 0a 00 ess... 00006a35 : 6a35: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6a45: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006a56 : 6a56: 31 2f 34 00 1/4. 00006a5a : 6a5a: 31 2f 34 00 1/4. 00006a5e : 6a5e: 31 2f 39 00 1/9. 00006a62 : 6a62: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6a72: 52 4f 52 00 ROR. 00006a76 : 6a76: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006a80 : 6a80: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006a89 : 6a89: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006a92 : 6a92: 86 25 33 64 25 25 00 .%3d%%. 00006a99 : 6a99: 2d 2d 2d 25 25 00 ---%%. 00006a9f : 6a9f: 25 33 64 25 25 00 %3d%%. 00006aa5 : 6aa5: 20 53 44 00 SD. 00006aa9 : 6aa9: 20 20 20 00 . 00006aad : 6aad: 20 48 4f 00 HO. 00006ab1 : 6ab1: 20 46 52 4d 20 00 FRM . 00006ab7 : 6ab7: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006ac0 : 6ac0: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006acb : 6acb: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006ada : 6ada: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006aea : 6aea: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006af9 <_ZZL16lcd_support_menuvE3__c__16_>: 6af9: 44 75 6d 70 20 74 6f 20 73 65 72 69 61 6c 00 Dump to serial. 00006b08 : 6b08: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006b19 : 6b19: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6b29: 6d 00 m. 00006b2b : 6b2b: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006b37 : 6b37: 4d 37 30 31 00 M701. 00006b3c : 6b3c: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6b4c: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6b5c: 32 64 6d 00 2dm. 00006b60 : 6b60: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6b70: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6b80: 32 64 73 00 2ds. 00006b84 : 6b84: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006b8c : 6b8c: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006b9a : 6b9a: 25 33 2e 32 66 81 00 %3.2f.. 00006ba1 : 6ba1: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6bb1: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 6bc1: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00006bce : 6bce: 20 20 30 00 0. 00006bd2 : 6bd2: 20 20 31 00 1. 00006bd6 : 6bd6: 46 49 4e 44 41 00 FINDA. 00006bdc : 6bdc: 50 49 4e 44 41 00 PINDA. 00006be2 : 6be2: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 6bf2: 3a 20 25 64 0a 00 : %d.. 00006bf8 : 6bf8: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 00006c02 : 6c02: 46 69 72 6d 77 61 72 65 00 Firmware. 00006c0b : 6c0b: 50 72 75 73 61 20 69 33 20 4d 4b 32 2e 35 53 20 Prusa i3 MK2.5S 6c1b: 4f 4b 2e 00 OK.. 00006c1f : 6c1f: 4d 36 30 30 00 M600. 00006c24 : 6c24: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00006c2f : 6c2f: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00006c3f : 6c3f: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 6c4f: 65 64 00 ed. 00006c52 : 6c52: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00006c5f : 6c5f: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 6c6f: 65 3a 20 00 e: . 00006c73 : 6c73: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 6c83: 64 69 72 3a 20 00 dir: . 00006c89 : 6c89: 4d 32 34 00 M24. 00006c8d : 6c8d: 4d 32 33 20 25 73 00 M23 %s. 00006c94 : 6c94: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6ca4: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6cb4: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6cc4: 72 65 64 2e 00 red.. 00006cc9 : 6cc9: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006cd9 : 6cd9: 4d 38 33 00 M83. 00006cdd : 6cdd: 31 2f 39 00 1/9. 00006ce1 : 6ce1: 88 00 .. 00006ce3 : 6ce3: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 6cf3: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00006d01 : 6d01: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 6d11: 70 72 65 76 65 6e 74 65 64 00 prevented. 00006d1b : 6d1b: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00006d28 <__noloc_end>: 6d28: 08 4a sbci r16, 0xA8 ; 168 6d2a: d7 3b cpi r29, 0xB7 ; 183 6d2c: 3b ce rjmp .-906 ; 0x69a4 6d2e: 01 6e ori r16, 0xE1 ; 225 6d30: 84 bc out 0x24, r8 ; 36 6d32: bf fd .word 0xfdbf ; ???? 6d34: c1 2f mov r28, r17 6d36: 3d 6c ori r19, 0xCD ; 205 6d38: 74 31 cpi r23, 0x14 ; 20 6d3a: 9a bd out 0x2a, r25 ; 42 6d3c: 56 83 std Z+6, r21 ; 0x06 6d3e: 3d da rcall .-2950 ; 0x61ba 6d40: 3d 00 .word 0x003d ; ???? 6d42: c7 7f andi r28, 0xF7 ; 247 6d44: 11 be out 0x31, r1 ; 49 6d46: d9 e4 ldi r29, 0x49 ; 73 6d48: bb 4c sbci r27, 0xCB ; 203 6d4a: 3e 91 ld r19, -X 6d4c: 6b aa std Y+51, r6 ; 0x33 6d4e: aa be out 0x3a, r10 ; 58 6d50: 00 00 nop 6d52: 00 80 ld r0, Z 6d54: 3f 05 cpc r19, r15 6d56: a8 4c sbci r26, 0xC8 ; 200 6d58: cd b2 in r12, 0x1d ; 29 6d5a: d4 4e sbci r29, 0xE4 ; 228 6d5c: b9 38 cpi r27, 0x89 ; 137 6d5e: 36 a9 ldd r19, Z+54 ; 0x36 6d60: 02 0c add r0, r2 6d62: 50 b9 out 0x00, r21 ; 0 6d64: 91 86 std Z+9, r9 ; 0x09 6d66: 88 08 sbc r8, r8 6d68: 3c a6 std Y+44, r3 ; 0x2c 6d6a: aa aa std Y+50, r10 ; 0x32 6d6c: 2a be out 0x3a, r2 ; 58 6d6e: 00 00 nop 6d70: 00 80 ld r0, Z 6d72: 3f 07 cpc r19, r31 6d74: 63 42 sbci r22, 0x23 ; 35 6d76: 36 b7 in r19, 0x36 ; 54 6d78: 9b d8 rcall .-3786 ; 0x5eb0 6d7a: a7 1a sub r10, r23 6d7c: 39 68 ori r19, 0x89 ; 137 6d7e: 56 18 sub r5, r6 6d80: ae ba out 0x1e, r10 ; 30 6d82: ab 55 subi r26, 0x5B ; 91 6d84: 8c 1d adc r24, r12 6d86: 3c b7 in r19, 0x3c ; 60 6d88: cc 57 subi r28, 0x7C ; 124 6d8a: 63 bd out 0x23, r22 ; 35 6d8c: 6d ed ldi r22, 0xDD ; 221 6d8e: fd 75 andi r31, 0x5D ; 93 6d90: 3e f6 brtc .-114 ; 0x6d20 6d92: 17 72 andi r17, 0x27 ; 39 6d94: 31 bf out 0x31, r19 ; 49 6d96: 00 00 nop 6d98: 00 80 ld r0, Z 6d9a: 3f 08 sbc r3, r15 6d9c: 00 00 nop 6d9e: 00 be out 0x30, r0 ; 48 6da0: 92 24 eor r9, r2 6da2: 49 12 cpse r4, r25 6da4: 3e ab std Y+54, r19 ; 0x36 6da6: aa aa std Y+50, r10 ; 0x32 6da8: 2a be out 0x3a, r2 ; 58 6daa: cd cc rjmp .-1638 ; 0x6746 <_ZZ16process_commandsvE3__c__25_+0x4> 6dac: cc 4c sbci r28, 0xCC ; 204 6dae: 3e 00 .word 0x003e ; ???? 6db0: 00 00 nop 6db2: 80 be out 0x30, r8 ; 48 6db4: ab aa std Y+51, r10 ; 0x33 6db6: aa aa std Y+50, r10 ; 0x32 6db8: 3e 00 .word 0x003e ; ???? 6dba: 00 00 nop 6dbc: 00 bf out 0x30, r16 ; 48 6dbe: 00 00 nop 6dc0: 00 80 ld r0, Z 6dc2: 3f 00 .word 0x003f ; ???? 6dc4: 00 00 nop 6dc6: 00 00 nop 6dc8: 08 41 sbci r16, 0x18 ; 24 6dca: 78 d3 rcall .+1776 ; 0x74bc 6dcc: bb 43 sbci r27, 0x3B ; 59 6dce: 87 d1 rcall .+782 ; 0x70de <__trampolines_start+0x2e8> 6dd0: 13 3d cpi r17, 0xD3 ; 211 6dd2: 19 0e add r1, r25 6dd4: 3c c3 rjmp .+1656 ; 0x744e 6dd6: bd 42 sbci r27, 0x2D ; 45 6dd8: 82 ad ldd r24, Z+58 ; 0x3a 6dda: 2b 3e cpi r18, 0xEB ; 235 6ddc: 68 ec ldi r22, 0xC8 ; 200 6dde: 82 76 andi r24, 0x62 ; 98 6de0: be d9 rcall .-3204 ; 0x615e 6de2: 8f e1 ldi r24, 0x1F ; 31 6de4: a9 3e cpi r26, 0xE9 ; 233 6de6: 4c 80 ldd r4, Y+4 ; 0x04 6de8: ef ff .word 0xffef ; ???? 6dea: be 01 movw r22, r28 6dec: c4 ff sbrs r28, 4 6dee: 7f 3f cpi r23, 0xFF ; 255 6df0: 00 00 nop 6df2: 00 00 nop ... 00006df6 <__trampolines_start>: 6df6: 0d 94 b7 02 jmp 0x2056e ; 0x2056e 6dfa: 0c 94 33 b3 jmp 0x16666 ; 0x16666 6dfe: 0c 94 1b e3 jmp 0x1c636 ; 0x1c636 6e02: 0d 94 08 30 jmp 0x26010 ; 0x26010 6e06: 0c 94 c3 b0 jmp 0x16186 ; 0x16186 6e0a: 0c 94 c5 ba jmp 0x1758a ; 0x1758a 6e0e: 0c 94 0c b5 jmp 0x16a18 ; 0x16a18 ()> 6e12: 0d 94 d6 1d jmp 0x23bac ; 0x23bac 6e16: 0d 94 e0 04 jmp 0x209c0 ; 0x209c0 6e1a: 0d 94 d0 06 jmp 0x20da0 ; 0x20da0 6e1e: 0c 94 cd b0 jmp 0x1619a ; 0x1619a 6e22: 0c 94 c2 c0 jmp 0x18184 ; 0x18184 6e26: 0d 94 84 2f jmp 0x25f08 ; 0x25f08 6e2a: 0d 94 25 65 jmp 0x2ca4a ; 0x2ca4a 6e2e: 0d 94 dc 11 jmp 0x223b8 ; 0x223b8 6e32: 0c 94 ae b0 jmp 0x1615c ; 0x1615c 6e36: 0d 94 91 07 jmp 0x20f22 ; 0x20f22 6e3a: 0c 94 11 b5 jmp 0x16a22 ; 0x16a22 ()> 6e3e: 0d 94 e8 04 jmp 0x209d0 ; 0x209d0 6e42: 0c 94 fa c3 jmp 0x187f4 ; 0x187f4 6e46: 0c 94 7f bc jmp 0x178fe ; 0x178fe 6e4a: 0d 94 a5 31 jmp 0x2634a ; 0x2634a 6e4e: 0d 94 d9 06 jmp 0x20db2 ; 0x20db2 6e52: 0d 94 84 3a jmp 0x27508 ; 0x27508 6e56: 0c 94 4d b7 jmp 0x16e9a ; 0x16e9a 6e5a: 0c 94 9d fc jmp 0x1f93a ; 0x1f93a 6e5e: 0c 94 8b bb jmp 0x17716 ; 0x17716 6e62: 0c 94 c7 ea jmp 0x1d58e ; 0x1d58e 6e66: 0d 94 71 31 jmp 0x262e2 ; 0x262e2 6e6a: 0c 94 3d fe jmp 0x1fc7a ; 0x1fc7a 6e6e: 0c 94 77 b4 jmp 0x168ee ; 0x168ee 6e72: 0d 94 94 07 jmp 0x20f28 ; 0x20f28 6e76: 0d 94 05 95 jmp 0x32a0a ; 0x32a0a <_menu_edit_P()> 6e7a: 0d 94 fb 31 jmp 0x263f6 ; 0x263f6 6e7e: 0c 94 ef b0 jmp 0x161de ; 0x161de 6e82: 0c 94 e1 fd jmp 0x1fbc2 ; 0x1fbc2 6e86: 0c 94 8c b1 jmp 0x16318 ; 0x16318 6e8a: 0d 94 68 22 jmp 0x244d0 ; 0x244d0 6e8e: 0c 94 64 b5 jmp 0x16ac8 ; 0x16ac8 6e92: 0d 94 0c 31 jmp 0x26218 ; 0x26218 6e96: 0c 94 50 fe jmp 0x1fca0 ; 0x1fca0 6e9a: 0c 94 7a fe jmp 0x1fcf4 ; 0x1fcf4 6e9e: 0c 94 07 b5 jmp 0x16a0e ; 0x16a0e ()> 6ea2: 0c 94 31 c1 jmp 0x18262 ; 0x18262 6ea6: 0c 94 e6 c0 jmp 0x181cc ; 0x181cc 6eaa: 0c 94 35 6e jmp 0xdc6a ; 0xdc6a <__vector_23+0xe2> 6eae: 0d 94 1f 2f jmp 0x25e3e ; 0x25e3e 6eb2: 0c 94 8a e6 jmp 0x1cd14 ; 0x1cd14 6eb6: 0c 94 68 bc jmp 0x178d0 ; 0x178d0 6eba: 0c 94 c7 b5 jmp 0x16b8e ; 0x16b8e 6ebe: 0d 94 bc 01 jmp 0x20378 ; 0x20378 6ec2: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 6ec6: 0d 94 eb 31 jmp 0x263d6 ; 0x263d6 6eca: 0c 94 ed fd jmp 0x1fbda ; 0x1fbda 6ece: 0d 94 fc 01 jmp 0x203f8 ; 0x203f8 6ed2: 0c 94 b4 b0 jmp 0x16168 ; 0x16168 6ed6: 0c 94 0a ff jmp 0x1fe14 ; 0x1fe14 6eda: 0c 94 3f ba jmp 0x1747e ; 0x1747e 6ede: 0c 94 89 fc jmp 0x1f912 ; 0x1f912 6ee2: 0c 94 db b0 jmp 0x161b6 ; 0x161b6 6ee6: 0c 94 ed f6 jmp 0x1edda ; 0x1edda 6eea: 0c 94 45 fc jmp 0x1f88a ; 0x1f88a 6eee: 0d 94 a2 31 jmp 0x26344 ; 0x26344 6ef2: 0d 94 c7 06 jmp 0x20d8e ; 0x20d8e 6ef6: 0c 94 e9 b0 jmp 0x161d2 ; 0x161d2 6efa: 0d 94 74 31 jmp 0x262e8 ; 0x262e8 6efe: 0c 94 d4 c0 jmp 0x181a8 ; 0x181a8 6f02: 0c 94 c3 ea jmp 0x1d586 ; 0x1d586 6f06: 0c 94 a9 b8 jmp 0x17152 ; 0x17152 6f0a: 0c 94 3e b3 jmp 0x1667c ; 0x1667c 6f0e: 0c 94 36 c6 jmp 0x18c6c ; 0x18c6c 6f12: 0c 94 59 b4 jmp 0x168b2 ; 0x168b2 6f16: 0c 94 2c 6e jmp 0xdc58 ; 0xdc58 <__vector_23+0xd0> 6f1a: 0c 94 2d e3 jmp 0x1c65a ; 0x1c65a 6f1e: 0c 94 90 bc jmp 0x17920 ; 0x17920 6f22: 0c 94 4e b5 jmp 0x16a9c ; 0x16a9c 6f26: 0d 94 9f 6b jmp 0x2d73e ; 0x2d73e 6f2a: 0d 94 4f 11 jmp 0x2229e ; 0x2229e 6f2e: 0c 94 0f 6c jmp 0xd81e ; 0xd81e 6f32: 0c 94 dd f7 jmp 0x1efba ; 0x1efba 6f36: 0c 94 16 b5 jmp 0x16a2c ; 0x16a2c ()> 6f3a: 0c 94 92 b1 jmp 0x16324 ; 0x16324 6f3e: 0d 94 73 2f jmp 0x25ee6 ; 0x25ee6 6f42: 0c 94 93 fc jmp 0x1f926 ; 0x1f926 6f46: 0c 94 88 fe jmp 0x1fd10 ; 0x1fd10 6f4a: 0c 94 4a ef jmp 0x1de94 ; 0x1de94 6f4e: 0c 94 c9 b0 jmp 0x16192 ; 0x16192 6f52: 0c 94 0e e8 jmp 0x1d01c ; 0x1d01c 6f56: 0d 94 f3 31 jmp 0x263e6 ; 0x263e6 6f5a: 0c 94 f8 fd jmp 0x1fbf0 ; 0x1fbf0 6f5e: 0c 94 cc c0 jmp 0x18198 ; 0x18198 6f62: 0c 94 5e ef jmp 0x1debc ; 0x1debc 6f66: 0c 94 f7 b0 jmp 0x161ee ; 0x161ee 6f6a: 0c 94 a7 fc jmp 0x1f94e ; 0x1f94e 6f6e: 0c 94 cf ba jmp 0x1759e ; 0x1759e 6f72: 0d 94 cb 11 jmp 0x22396 ; 0x22396 6f76: 0d 94 3e 65 jmp 0x2ca7c ; 0x2ca7c 6f7a: 0d 94 9d 65 jmp 0x2cb3a ; 0x2cb3a 6f7e: 0c 94 50 bc jmp 0x178a0 ; 0x178a0 6f82: 0c 94 cb ea jmp 0x1d596 ; 0x1d596 6f86: 0c 94 d8 5e jmp 0xbdb0 ; 0xbdb0 <_GLOBAL__sub_D_card> 6f8a: 0c 94 96 fe jmp 0x1fd2c ; 0x1fd2c 6f8e: 0c 94 1d c1 jmp 0x1823a ; 0x1823a 6f92: 0c 94 fa ba jmp 0x175f4 ; 0x175f4 6f96: 0c 94 c3 ff jmp 0x1ff86 ; 0x1ff86 6f9a: 0c 94 54 e9 jmp 0x1d2a8 ; 0x1d2a8 6f9e: 0d 94 ab 31 jmp 0x26356 ; 0x26356 6fa2: 0c 94 d7 b0 jmp 0x161ae ; 0x161ae 6fa6: 0d 94 3d 6b jmp 0x2d67a ; 0x2d67a 6faa: 0d 94 80 65 jmp 0x2cb00 ; 0x2cb00 6fae: 0c 94 f0 c0 jmp 0x181e0 ; 0x181e0 6fb2: 0c 94 08 6e jmp 0xdc10 ; 0xdc10 <__vector_23+0x88> 6fb6: 0d 94 a4 65 jmp 0x2cb48 ; 0x2cb48 6fba: 0d 94 e9 2e jmp 0x25dd2 ; 0x25dd2 6fbe: 0d 94 b4 6b jmp 0x2d768 ; 0x2d768 6fc2: 0d 94 0c 01 jmp 0x20218 ; 0x20218 6fc6: 0c 94 bf ea jmp 0x1d57e ; 0x1d57e 6fca: 0d 94 dd 30 jmp 0x261ba ; 0x261ba 6fce: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 6fd2: 0d 94 e3 31 jmp 0x263c6 ; 0x263c6 6fd6: 0c 94 e5 b0 jmp 0x161ca ; 0x161ca 6fda: 0d 94 bb 31 jmp 0x26376 ; 0x26376 6fde: 0c 94 da bb jmp 0x177b4 ; 0x177b4 6fe2: 0d 94 a8 31 jmp 0x26350 ; 0x26350 6fe6: 0c 94 e7 ef jmp 0x1dfce ; 0x1dfce 6fea: 0c 94 44 ea jmp 0x1d488 ; 0x1d488 6fee: 0c 94 bb 6f jmp 0xdf76 ; 0xdf76 6ff2: 0d 94 ce 12 jmp 0x2259c ; 0x2259c 6ff6: 0c 94 c7 fc jmp 0x1f98e ; 0x1f98e 6ffa: 0d 94 a6 6b jmp 0x2d74c ; 0x2d74c 6ffe: 0c 94 db fc jmp 0x1f9b6 ; 0x1f9b6 7002: 0c 94 3c e3 jmp 0x1c678 ; 0x1c678 7006: 0d 94 a5 2f jmp 0x25f4a ; 0x25f4a 700a: 0c 94 58 6e jmp 0xdcb0 ; 0xdcb0 <__vector_23+0x128> 700e: 0d 94 09 2f jmp 0x25e12 ; 0x25e12 7012: 0c 94 bd fc jmp 0x1f97a ; 0x1f97a 7016: 0d 94 23 0d jmp 0x21a46 ; 0x21a46 701a: 0c 94 d4 fe jmp 0x1fda8 ; 0x1fda8 701e: 0c 94 3f eb jmp 0x1d67e ; 0x1d67e 7022: 0d 94 50 02 jmp 0x204a0 ; 0x204a0 7026: 0c 94 e1 ea jmp 0x1d5c2 ; 0x1d5c2 702a: 0d 94 ed 04 jmp 0x209da ; 0x209da 702e: 0d 94 51 04 jmp 0x208a2 ; 0x208a2 7032: 0d 94 0c 97 jmp 0x32e18 ; 0x32e18 7036: 0c 94 58 bc jmp 0x178b0 ; 0x178b0 703a: 0c 94 6a 6e jmp 0xdcd4 ; 0xdcd4 <__vector_23+0x14c> 703e: 0c 94 f3 b0 jmp 0x161e6 ; 0x161e6 7042: 0c 94 27 b3 jmp 0x1664e ; 0x1664e 7046: 0d 94 a2 6b jmp 0x2d744 ; 0x2d744 704a: 0c 94 ce bb jmp 0x1779c ; 0x1779c 704e: 0d 94 3e 07 jmp 0x20e7c ; 0x20e7c 7052: 0d 94 98 11 jmp 0x22330 ; 0x22330 7056: 0d 94 66 0c jmp 0x218cc ; 0x218cc 705a: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 705e: 0c 94 d8 f6 jmp 0x1edb0 ; 0x1edb0 7062: 0c 94 e3 6d jmp 0xdbc6 ; 0xdbc6 <__vector_23+0x3e> 7066: 0d 94 03 32 jmp 0x26406 ; 0x26406 706a: 0c 94 1a fe jmp 0x1fc34 ; 0x1fc34 706e: 0c 94 81 fe jmp 0x1fd02 ; 0x1fd02 7072: 0d 94 32 05 jmp 0x20a64 ; 0x20a64 7076: 0d 94 f6 1c jmp 0x239ec ; 0x239ec 707a: 0c 94 fd b4 jmp 0x169fa ; 0x169fa ()> 707e: 0c 94 20 b5 jmp 0x16a40 ; 0x16a40 ()> 7082: 0c 94 93 bc jmp 0x17926 ; 0x17926 7086: 0d 94 0f 31 jmp 0x2621e ; 0x2621e 708a: 0c 94 fa c0 jmp 0x181f4 ; 0x181f4 708e: 0d 94 c3 31 jmp 0x26386 ; 0x26386 7092: 0c 94 c5 bb jmp 0x1778a ; 0x1778a 7096: 0c 94 c8 bb jmp 0x17790 ; 0x17790 709a: 0c 94 b1 fc jmp 0x1f962 ; 0x1f962 709e: 0d 94 d3 31 jmp 0x263a6 ; 0x263a6 70a2: 0c 94 0c b3 jmp 0x16618 ; 0x16618 70a6: 0d 94 8e 2f jmp 0x25f1c ; 0x25f1c 70aa: 0c 94 d5 fd jmp 0x1fbaa ; 0x1fbaa 70ae: 0d 94 da 0f jmp 0x21fb4 ; 0x21fb4 70b2: 0c 94 b8 c0 jmp 0x18170 ; 0x18170 70b6: 0c 94 f2 fc jmp 0x1f9e4 ; 0x1f9e4 70ba: 0d 94 08 0e jmp 0x21c10 ; 0x21c10 70be: 0c 94 d3 b0 jmp 0x161a6 ; 0x161a6 70c2: 0d 94 45 09 jmp 0x2128a ; 0x2128a 70c6: 0c 94 e1 b0 jmp 0x161c2 ; 0x161c2 70ca: 0d 94 0f 03 jmp 0x2061e ; 0x2061e 70ce: 0c 94 27 e3 jmp 0x1c64e ; 0x1c64e 70d2: 0c 94 b9 ea jmp 0x1d572 ; 0x1d572 70d6: 0c 94 30 e3 jmp 0x1c660 ; 0x1c660 70da: 0c 94 bb e9 jmp 0x1d376 ; 0x1d376 70de: 0c 94 13 c1 jmp 0x18226 ; 0x18226 70e2: 0c 94 a1 c0 jmp 0x18142 ; 0x18142 70e6: 0d 94 9c 2f jmp 0x25f38 ; 0x25f38 70ea: 0d 94 4f 00 jmp 0x2009e ; 0x2009e 70ee: 0c 94 18 b3 jmp 0x16630 ; 0x16630 70f2: 0d 94 6e 31 jmp 0x262dc ; 0x262dc 70f6: 0c 94 bf e9 jmp 0x1d37e ; 0x1d37e 70fa: 0d 94 3c 11 jmp 0x22278 ; 0x22278 70fe: 0c 94 38 ec jmp 0x1d870 ; 0x1d870 7102: 0d 94 42 31 jmp 0x26284 ; 0x26284 7106: 0c 94 c0 b0 jmp 0x16180 ; 0x16180 710a: 0d 94 6d 40 jmp 0x280da ; 0x280da 710e: 0c 94 ae c0 jmp 0x1815c ; 0x1815c 7112: 0c 94 fd 6d jmp 0xdbfa ; 0xdbfa <__vector_23+0x72> 7116: 0c 94 d1 fc jmp 0x1f9a2 ; 0x1f9a2 711a: 0c 94 36 fe jmp 0x1fc6c ; 0x1fc6c 711e: 0d 94 27 3a jmp 0x2744e ; 0x2744e 7122: 0c 94 77 f7 jmp 0x1eeee ; 0x1eeee 7126: 0c 94 b8 b0 jmp 0x16170 ; 0x16170 712a: 0c 94 1b b5 jmp 0x16a36 ; 0x16a36 ()> 712e: 0c 94 d6 e2 jmp 0x1c5ac ; 0x1c5ac 7132: 0c 94 60 bc jmp 0x178c0 ; 0x178c0 7136: 0d 94 9f 0a jmp 0x2153e ; 0x2153e 713a: 0d 94 05 31 jmp 0x2620a ; 0x2620a 713e: 0d 94 83 6b jmp 0x2d706 ; 0x2d706 7142: 0d 94 c5 30 jmp 0x2618a ; 0x2618a 7146: 0d 94 f8 11 jmp 0x223f0 ; 0x223f0 714a: 0c 94 16 6e jmp 0xdc2c ; 0xdc2c <__vector_23+0xa4> 714e: 0c 94 27 c1 jmp 0x1824e ; 0x1824e 7152: 0c 94 8e bc jmp 0x1791c ; 0x1791c 7156: 0d 94 a0 65 jmp 0x2cb40 ; 0x2cb40 715a: 0c 94 f5 f7 jmp 0x1efea ; 0x1efea 715e: 0c 94 d1 bb jmp 0x177a2 ; 0x177a2 7162: 0c 94 cb bb jmp 0x17796 ; 0x17796 7166: 0d 94 af 6b jmp 0x2d75e ; 0x2d75e 716a: 0c 94 fb b0 jmp 0x161f6 ; 0x161f6 716e: 0d 94 b3 31 jmp 0x26366 ; 0x26366 7172: 0c 94 6f b6 jmp 0x16cde ; 0x16cde 7176: 0c 94 c2 bb jmp 0x17784 ; 0x17784 717a: 0c 94 e2 e2 jmp 0x1c5c4 ; 0x1c5c4 717e: 0c 94 3b c1 jmp 0x18276 ; 0x18276 7182: 0d 94 39 0f jmp 0x21e72 ; 0x21e72 7186: 0c 94 03 fd jmp 0x1fa06 ; 0x1fa06 718a: 0c 94 a9 c0 jmp 0x18152 ; 0x18152 718e: 0c 94 ad b3 jmp 0x1675a ; 0x1675a 7192: 0d 94 8a 2f jmp 0x25f14 ; 0x25f14 7196: 0d 94 59 2f jmp 0x25eb2 ; 0x25eb2 719a: 0c 94 d6 f6 jmp 0x1edac ; 0x1edac 719e: 0c 94 31 fd jmp 0x1fa62 ; 0x1fa62 71a2: 0c 94 fa e2 jmp 0x1c5f4 ; 0x1c5f4 71a6: 0c 94 5a b0 jmp 0x160b4 ; 0x160b4 71aa: 0c 94 bc b0 jmp 0x16178 ; 0x16178 71ae: 0c 94 dc c0 jmp 0x181b8 ; 0x181b8 71b2: 0c 94 08 e8 jmp 0x1d010 ; 0x1d010 71b6: 0c 94 ee b0 jmp 0x161dc ; 0x161dc 71ba: 0d 94 76 01 jmp 0x202ec ; 0x202ec 71be: 0d 94 15 2f jmp 0x25e2a ; 0x25e2a 71c2: 0d 94 cb 31 jmp 0x26396 ; 0x26396 71c6: 0c 94 8f b6 jmp 0x16d1e ; 0x16d1e 71ca: 0c 94 2a e3 jmp 0x1c654 ; 0x1c654 71ce: 0d 94 02 31 jmp 0x26204 ; 0x26204 71d2: 0c 94 d6 70 jmp 0xe1ac ; 0xe1ac 71d6: 0c 94 e0 b5 jmp 0x16bc0 ; 0x16bc0 71da: 0c 94 09 c1 jmp 0x18212 ; 0x18212 71de: 0c 94 14 c6 jmp 0x18c28 ; 0x18c28 71e2: 0c 94 02 b5 jmp 0x16a04 ; 0x16a04 ()> 71e6: 0c 94 8f fe jmp 0x1fd1e ; 0x1fd1e 71ea: 0c 94 74 bc jmp 0x178e8 ; 0x178e8 000071ee <__trampolines_end>: 71ee: 6e 61 ori r22, 0x1E ; 30 71f0: 6e 00 .word 0x006e ; ???? 000071f2 <__c.2228>: 71f2: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 7202: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 7212: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 7222: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 7232: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 7242: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 7252: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 7262: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 7272: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 7282: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 7292: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 72a2: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 72b2: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 72c2: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 72d2: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 72e2: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 000072f0 : 72f0: 22 00 ". 000072f2 : ... 000072f3 : 72f3: 20 45 53 50 00 ESP. 000072f8 : 72f8: 20 4e 53 50 00 NSP. 000072fd : 72fd: 20 4f 46 46 00 OFF. 00007302 : 7302: 20 4f 4e 00 ON. 00007306 : 7306: 50 56 30 31 00 PV01. 0000730b : 730b: 20 5b 4d 50 5d 20 00 [MP] . 00007312 : 7312: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 7322: 74 65 73 00 tes. 00007326 : 7326: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 00007331 : 7331: 4d 33 31 30 00 M310. 00007336 : 7336: 4d 31 31 32 00 M112. 0000733b : 733b: 4d 31 31 30 00 M110. 00007340 : 7340: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 0000734f : 734f: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 0000735f : 735f: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 736f: 72 65 74 72 69 65 76 65 64 00 retrieved. 00007379 : 7379: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 7389: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 7399: 64 00 d. 0000739b : 739b: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 73ab: 00 00 05 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 73bb: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 73cb: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 73db: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 73eb: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 73fb: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 740b: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 741b: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 742b: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 2c 43 ......A....?..,C 743b: 00 00 2c 43 00 00 40 41 00 00 f0 42 c0 03 00 00 ..,C..@A...B.... 744b: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 10 ................ 745b: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 0000746c : 746c: 20 30 78 00 0x. 00007470 : 7470: 20 30 78 00 0x. 00007474 : 7474: 65 72 72 6f 72 3a 20 00 error: . 0000747c : 747c: 44 32 33 20 2d 20 65 6d 65 72 67 65 6e 63 79 20 D23 - emergency 748c: 73 65 72 69 61 6c 20 64 75 6d 70 00 serial dump. 00007498 : 7498: 43 75 73 74 6f 6d 00 Custom. 0000749f : 749f: 4e 79 6c 6f 6e 50 41 00 NylonPA. 000074a7 : 74a7: 53 61 74 69 6e 20 20 00 Satin . 000074af : 74af: 54 65 78 74 75 72 00 Textur. 000074b6 : 74b6: 53 6d 6f 6f 74 68 00 Smooth. 000074bd : 74bd: 31 2e 30 00 1.0. 000074c1 : 74c1: 31 2e 35 00 1.5. 000074c5 : 74c5: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 000074cd : 74cd: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 74dd: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 000074ea : 74ea: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 74fa: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007503 <_PRI_LANG_SIGNATURE>: 7503: ff ff ff ff .... 00007507 : 7507: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7517: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7527: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7537: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7547: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7557: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7567: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7577: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7587: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7597: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 75a7: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 75b7: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 75c7: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 75d7: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 75e7: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 75f7: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7607: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7617: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7627: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7637: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7647: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7657: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7667: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7677: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7687: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 76c3: 00 40 14 54 .@.T 000076c7 : 76c7: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 76d7: 95 95 e6 24 1f b1 4f 0a ...$..O. 000076df : 76df: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 76ef: ca 1b 0e 5a ae c5 9d 74 ...Z...t 000076f7 : 76f7: 4e 41 4e NAN 000076fa : 76fa: 49 4e 46 INF 000076fd : 76fd: 00 00 7a 43 00 00 52 43 00 00 52 43 ..zC..RC..RC 00007709 : 7709: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007715 : 7715: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007721 : 7721: 20 50 3a 00 P:. 00007725 : 7725: 20 42 40 3a 00 B@:. 0000772a : 772a: 20 40 3a 00 @:. 0000772e : 772e: 20 2f 00 /. 00007731 : 7731: 20 54 30 3a 00 T0:. 00007736 : 7736: 20 2f 00 /. 00007739 : 7739: 20 42 3a 00 B:. 0000773d : 773d: 20 2f 00 /. 00007740 : 7740: 54 3a 00 T:. 00007743 : 7743: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7753: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7763: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007774 : 7774: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7784: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7794: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 77a4: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 000077ad : 77ad: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 77bd: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 77cd: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 000077dc : 77dc: 20 20 00 . 000077df : 77df: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 000077f0 : 77f0: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7800: 20 35 2e 30 66 00 5.0f. 00007806 : 7806: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007813 : 7813: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7823: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007831 : 7831: 20 45 3a 00 E:. 00007835 : 7835: 20 5a 3a 00 Z:. 00007839 : 7839: 20 59 3a 00 Y:. 0000783d : 783d: 20 45 3a 00 E:. 00007841 : 7841: 20 5a 3a 00 Z:. 00007845 : 7845: 20 59 3a 00 Y:. 00007849 : 7849: 58 3a 00 X:. 0000784c : 784c: 20 2d 3e 20 00 -> . 00007851 : 7851: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 0000785d : 785d: 2c 20 00 , . 00007860 : 7860: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7870: 6f 77 6e 00 own. 00007874 : 7874: 4b 49 4c 4c 45 44 2e 00 KILLED.. 0000787c : 787c: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 788c: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 0000789b : 789b: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 78ab: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 78bb: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 78cb: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 000078d8 : 78d8: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 78e8: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 78f8: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007901 : 7901: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007909 : 7909: 54 3a 00 T:. 0000790c : 790c: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 791c: 20 69 6e 70 75 74 00 input. 00007923 : 7923: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7933: 20 75 73 65 72 00 user. 00007939 : 7939: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 0000794a : 794a: 73 65 72 69 61 6c 20 64 75 6d 70 20 00 serial dump . 00007957 : 7957: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007967 : 7967: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7977: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007981 : 7981: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 0000798c : 798c: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 799c: 20 72 61 6e 67 65 21 00 range!. 000079a4 <_sPrinterName>: 79a4: 4d 4b 32 2e 35 53 00 MK2.5S. 000079ab <_sPrinterMmuName>: 79ab: 4d 4b 32 2e 35 53 4d 4d 55 32 53 00 MK2.5SMMU2S. 000079b7 <_nPrinterMmuType>: 79b7: 1c 4f .O 000079b9 <_nPrinterType>: 79b9: fc 00 .. 000079bb : 79bb: 25 33 64 2f 25 33 64 00 %3d/%3d. 000079c3 : 79c3: 25 33 64 00 %3d. 000079c7 : 79c7: 20 0a 20 0a 20 0a 20 00 . . . . 000079cf : 79cf: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 79df: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 79ef: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 79ff: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7a0f: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7a1f: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 7a2f: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 7a3f: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 7a4f: 0a 00 .. 00007a51 : 7a51: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7a61: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007a70 : 7a70: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7a80: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7a90: 25 2e 32 66 0a 00 %.2f.. 00007a96 : 7a96: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7aa6: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7ab6: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7ac6: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7ad6: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7ae6: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7af6: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7b06: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7b16: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 7b26: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 7b36: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 7b46: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 7b56: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 7b66: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 7b76: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 7b86: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00007b97 : 7b97: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 7ba7: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 7bb7: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 7bc7: 2e 32 66 0a 00 .2f.. 00007bcc : 7bcc: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 7bdc: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 7bec: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00007bf9 : 7bf9: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 7c09: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 7c19: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 7c29: 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 f.%SMaximum feed 7c39: 72 61 74 65 73 20 28 6d 6d 2f 73 29 3a 0a 25 53 rates (mm/s):.%S 7c49: 20 20 4d 32 30 33 20 58 25 2e 32 66 20 59 25 2e M203 X%.2f Y%. 7c59: 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 2f Z%.2f E%.2f.% 7c69: 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 SMaximum acceler 7c79: 61 74 69 6f 6e 20 28 6d 6d 2f 73 32 29 3a 0a 25 ation (mm/s2):.% 7c89: 53 20 20 4d 32 30 31 20 58 25 6c 75 20 59 25 6c S M201 X%lu Y%l 7c99: 75 20 5a 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 u Z%lu E%lu.%SAc 7ca9: 63 65 6c 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 celeration: P=pr 7cb9: 69 6e 74 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 int, R=retract, 7cc9: 54 3d 74 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 T=travel.%S M20 7cd9: 34 20 50 25 2e 32 66 20 52 25 2e 32 66 20 54 25 4 P%.2f R%.2f T% 7ce9: 2e 32 66 0a 25 53 41 64 76 61 6e 63 65 64 20 76 .2f.%SAdvanced v 7cf9: 61 72 69 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 ariables: S=Min 7d09: 66 65 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c feedrate (mm/s), 7d19: 20 54 3d 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 T=Min travel fe 7d29: 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 edrate (mm/s), B 7d39: 3d 6d 69 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 =minimum segment 7d49: 20 74 69 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 time (us), X=ma 7d59: 78 69 6d 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d ximum XY jerk (m 7d69: 6d 2f 73 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d m/s), Z=maximum 7d79: 20 5a 20 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 Z jerk (mm/s), 7d89: 20 45 3d 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 E=maximum E jer 7d99: 6b 20 28 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 k (mm/s).%S M20 7da9: 35 20 53 25 2e 32 66 20 54 25 2e 32 66 20 42 25 5 S%.2f T%.2f B% 7db9: 6c 75 20 58 25 2e 32 66 20 59 25 2e 32 66 20 5a lu X%.2f Y%.2f Z 7dc9: 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d %.2f E%.2f.%SHom 7dd9: 65 20 6f 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 e offset (mm):.% 7de9: 53 20 20 4d 32 30 36 20 58 25 2e 32 66 20 59 25 S M206 X%.2f Y% 7df9: 2e 32 66 20 5a 25 2e 32 66 0a 00 .2f Z%.2f.. 00007e04 : 7e04: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00007e0f : 7e0f: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00007e1a : 7e1a: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00007e27 : 7e27: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 7e37: 49 4f 4e 00 ION. 00007e3b : 7e3b: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00007e4b : 7e4b: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00007e5b : ... 00007e5c : 7e5c: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 7e6c: 20 46 69 6c 65 3a 20 00 File: . 00007e74 : 7e74: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00007e82 : 7e82: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00007e92 : 7e92: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 00007e9e : 7e9e: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 00007eae : 7eae: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007eb6 : 7eb6: 66 76 00 fv. 00007eb9 : 7eb9: 74 68 78 00 thx. 00007ebd : 7ebd: 50 52 4e 00 PRN. 00007ec1 <_ZZ16process_commandsvE3__c__86_>: 7ec1: 22 28 32 29 00 "(2). 00007ec6 <_ZZ16process_commandsvE3__c__85_>: 7ec6: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00007ed7 <_ZZ16process_commandsvE3__c__84_>: 7ed7: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 00007ee1 <_ZZ16process_commandsvE3__c__83_>: 7ee1: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 00007ef2 <_ZZ16process_commandsvE3__c__81_>: 7ef2: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 7f02: 65 70 2c 20 75 6d 00 ep, um. 00007f09 <_ZZ16process_commandsvE3__c__82_>: 7f09: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 7f19: 3a 20 00 : . 00007f1c <_ZZ16process_commandsvE3__c__80_>: 7f1c: 50 3a 00 P:. 00007f1f <_ZZ16process_commandsvE3__c__79_>: 7f1f: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 7f2f: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 7f3f: 65 3a 00 e:. 00007f42 <_ZZ16process_commandsvE3__c__78_>: 7f42: 20 41 00 A. 00007f45 <_ZZ16process_commandsvE3__c__77_>: 7f45: 20 50 00 P. 00007f48 <_ZZ16process_commandsvE3__c__76_>: 7f48: 20 42 00 B. 00007f4b <_ZZ16process_commandsvE3__c__75_>: 7f4b: 20 4c 00 L. 00007f4e <_ZZ16process_commandsvE3__c__74_>: 7f4e: 20 52 00 R. 00007f51 <_ZZ16process_commandsvE3__c__73_>: 7f51: 20 5a 00 Z. 00007f54 <_ZZ16process_commandsvE3__c__72_>: 7f54: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 00007f65 <_ZZ16process_commandsvE3__c__71_>: 7f65: 53 68 65 65 74 20 00 Sheet . 00007f6c <_ZZ16process_commandsvE3__c__70_>: 7f6c: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 7f7c: 52 41 4e 47 45 00 RANGE. 00007f82 <_ZZ16process_commandsvE3__c__69_>: 7f82: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 7f92: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 00007fa1 <_ZZ16process_commandsvE3__c__68_>: 7fa1: 41 55 54 4f 00 AUTO. 00007fa6 <_ZZ16process_commandsvE3__c__67_>: 7fa6: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 00007fb6 <_ZZ16process_commandsvE3__c__66_>: 7fb6: 20 64 3a 00 d:. 00007fba <_ZZ16process_commandsvE3__c__65_>: 7fba: 20 69 3a 00 i:. 00007fbe <_ZZ16process_commandsvE3__c__64_>: 7fbe: 20 70 3a 00 p:. 00007fc2 <_ZZ16process_commandsvE3__c__63_>: 7fc2: 20 64 3a 00 d:. 00007fc6 <_ZZ16process_commandsvE3__c__62_>: 7fc6: 20 69 3a 00 i:. 00007fca <_ZZ16process_commandsvE3__c__61_>: 7fca: 20 70 3a 00 p:. 00007fce <_ZZ16process_commandsvE3__c__60_>: 7fce: 25 69 25 25 0a 00 %i%%.. 00007fd4 <_ZZ16process_commandsvE3__c__59_>: 7fd4: 25 69 25 25 0a 00 %i%%.. 00007fda <_ZZ16process_commandsvE3__c__58_>: 7fda: 22 28 31 29 00 "(1). 00007fdf <_ZZ16process_commandsvE3__c__53_>: 7fdf: 2f 2f 00 //. 00007fe2 <_ZZ16process_commandsvE3__c__52_>: ... 00007fe3 <_ZZ16process_commandsvE3__c__51_>: 7fe3: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 7ff3: 31 00 1. 00007ff5 <_ZZ16process_commandsvE3__c__50_>: 7ff5: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 00008004 <_ZZ16process_commandsvE3__c__49_>: 8004: 31 2e 30 00 1.0. 00008008 <_ZZ16process_commandsvE3__c__48_>: 8008: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 8018: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 8028: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 8038: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8048: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8058: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008062 <_ZZ16process_commandsvE3__c__47_>: 8062: 30 30 30 30 30 30 30 30 30 00 000000000. 0000806c <_ZZ16process_commandsvE3__c__46_>: 806c: 5f 00 _. 0000806e <_ZZ16process_commandsvE3__c__45_>: 806e: 38 32 33 37 00 8237. 00008073 <_ZZ16process_commandsvE3__c__44_>: 8073: 2b 00 +. 00008075 <_ZZ16process_commandsvE3__c__43_>: 8075: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 8085: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 00008093 <_ZZ16process_commandsvE3__c__42_>: 8093: 4d 31 31 33 20 53 00 M113 S. 0000809a <_ZZ16process_commandsvE3__c__41_>: 809a: 6f 6b 20 00 ok . 0000809e <_ZZ16process_commandsvE3__c__40_>: 809e: 20 63 6d 2e 00 cm.. 000080a3 <_ZZ16process_commandsvE3__c__39_>: 80a3: 20 6d 69 6e 20 00 min . 000080a9 <_ZZ16process_commandsvE3__c__38_>: 80a9: 53 54 41 54 53 20 00 STATS . 000080b0 <_ZZ16process_commandsvE3__c__33_>: 80b0: 6e 2f 61 00 n/a. 000080b4 <_ZZ16process_commandsvE3__c__32_>: 80b4: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 80c4: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 000080d4 : 80d4: 00 01 25 30 1d 0c ff 24 31 1c 0b ff 23 2f 1b 0a ..%0...$1...#/.. 80e4: 17 ff 04 06 22 2b 1a 03 36 35 35 38 ...."+..6558 000080f0 <_ZZ16process_commandsvE3__c__31_>: 80f0: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000080ff <_ZZ16process_commandsvE3__c__28_>: 80ff: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 810f: 25 73 0a 00 %s.. 00008113 <_ZZ16process_commandsvE3__c__22_>: 8113: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 8123: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 00008131 <_ZZ16process_commandsvE3__c__21_>: 8131: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 8141: 74 6f 72 00 tor. 00008145 <_ZZ16process_commandsvE3__c__17_>: 8145: 73 65 74 00 set. 00008149 <_ZZ16process_commandsvE3__c__16_>: 8149: 6e 6f 7a 7a 6c 65 00 nozzle. 00008150 <_ZZ16process_commandsvE3__c__15_>: 8150: 4d 42 4c 00 MBL. 00008154 <_ZZ16process_commandsvE3__c__14_>: 8154: 46 52 00 FR. 00008157 <_ZZ16process_commandsvE3__c__13_>: 8157: 4c 7a 00 Lz. 0000815a <_ZZ16process_commandsvE3__c__12_>: 815a: 4c 61 6e 67 00 Lang. 0000815f <_ZZ16process_commandsvE3__c__11_>: 815f: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 53 2d 52 41 4d 1_75mm_MK25S-RAM 816f: 42 6f 31 33 61 2d 45 33 44 76 36 66 75 6c 6c 00 Bo13a-E3Dv6full. 0000817f <_ZZ16process_commandsvE3__c__10_>: 817f: 52 65 76 00 Rev. 00008183 : 8183: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000818f : 818f: 46 69 72 00 Fir. 00008193 : 8193: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 0000819e : 819e: 53 4e 00 SN. 000081a1 : 81a1: 52 45 53 45 54 00 RESET. 000081a7 : 81a7: 4d 4d 55 52 45 53 00 MMURES. 000081ae : 81ae: 75 76 6c 6f 00 uvlo. 000081b3 : 81b3: 46 41 4e 00 FAN. 000081b7 : 81b7: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 000081c1 : 81c1: 50 52 55 53 41 00 PRUSA. 000081c7 : 81c7: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 81d7: 30 00 0. 000081d9 : 81d9: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 000081e6 : 81e6: 4d 31 34 30 20 53 30 00 M140 S0. 000081ee : 81ee: 4d 31 30 34 20 53 30 00 M104 S0. 000081f6 : 81f6: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 00008207 : 8207: 47 31 20 46 34 30 30 30 00 G1 F4000. 00008210 : 8210: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 0000821b : 821b: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008227 : 8227: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008236 : 8236: 47 39 30 00 G90. 0000823a : 823a: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 00008249 : 8249: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008257 : 8257: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008268 : 8268: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 00008275 : 8275: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 8285: 30 30 00 00. 00008288 : 8288: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 00008296 : 8296: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 000082a6 : 82a6: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 000082b6 : 82b6: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 000082c7 : 82c7: 47 39 32 20 45 30 00 G92 E0. 000082ce : 82ce: 47 32 38 00 G28. 000082d2 : 82d2: 4d 31 30 39 00 M109. 000082d7 : 82d7: 4d 31 39 30 00 M190. 000082dc : 82dc: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 82ec: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 82fc: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 830c: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 831c: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 832c: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 833c: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 834c: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 0000835c : 835c: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 00008369 : 8369: 30 2e 38 30 00 0.80. 0000836e : 836e: 30 2e 36 30 00 0.60. 00008373 : 8373: 30 2e 34 30 00 0.40. 00008378 : 8378: 30 2e 32 35 00 0.25. 0000837d : 837d: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 838d: 65 00 e. 0000838f : 838f: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008399 : 8399: 4d 4d 55 00 MMU. 0000839d : 839d: 4d 34 34 00 M44. 000083a1 : 83a1: 47 39 39 00 G99. 000083a5 : 83a5: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 83b5: 65 3f 00 e?. 000083b8 : 83b8: 47 32 38 20 58 59 00 G28 XY. 000083bf : 83bf: 4d 20 38 34 00 M 84. 000083c4 : 83c4: 85 2e 2e 00 .... 000083c8 : 83c8: 25 33 64 2f 30 00 %3d/0. 000083ce : 83ce: 25 33 64 2f 30 00 %3d/0. 000083d4 : 83d4: 6c 63 64 5f 73 65 6c 66 63 68 65 63 6b 5f 61 78 lcd_selfcheck_ax 83e4: 69 73 20 25 64 2c 20 25 64 0a 00 is %d, %d.. 000083ef : 83ef: 48 6f 74 65 6e 64 00 Hotend. 000083f6 : 83f6: 42 65 64 00 Bed. 000083fa : 83fa: 5a 00 Z. 000083fc : 83fc: 59 00 Y. 000083fe : 83fe: 58 00 X. 00008400 <_ZL13STR_SEPARATOR.lto_priv.410>: 8400: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8410: 2d 2d 2d 2d 00 ----. 00008415 : 8415: 53 75 70 65 72 50 49 4e 44 41 3a 00 SuperPINDA:. 00008421 : 8421: e9 67 f6 81 ee 81 e6 81 d9 81 c7 81 .g.......... 0000842d : 842d: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 843d: 66 00 f. 0000843f : 843f: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008448 : 8448: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008458 : 8458: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008464 : 8464: c7 82 36 82 d9 6c 27 82 1b 82 10 82 07 82 ..6..l'....... 00008472 : 8472: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8482: 30 30 30 00 000. 00008486 : 8486: b6 82 a6 82 96 82 88 82 c7 82 75 82 68 82 57 82 ..........u.h.W. 8496: 49 82 3a 82 I.:. 0000849a : 849a: 54 25 64 00 T%d. 0000849e : 849e: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 000084ac : 84ac: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 000084b9 : 84b9: e9 67 d7 82 d2 82 ce 82 c7 82 .g........ 000084c3 : 84c3: 4d 38 34 20 58 59 00 M84 XY. 000084ca : 84ca: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 000084d4 : 84d4: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 84e4: 30 30 00 00. 000084e7 : 84e7: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 84f7: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8507: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008517 : 8517: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8527: 20 44 25 2e 32 66 00 D%.2f. 0000852e : 852e: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 0000853b : 853b: 52 43 00 RC. 0000853e : 853e: 44 45 56 00 DEV. 00008542 : 8542: 42 45 54 41 00 BETA. 00008547 : 8547: 41 4c 50 48 41 00 ALPHA. 0000854d : 854d: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 855d: 01 01 00 00 04 01 07 01 0a 01 .......... 00008567 : 8567: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8577: 02 01 00 00 05 01 08 01 0b 01 .......... 00008581 : 8581: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8591: 00 01 00 00 03 01 06 01 09 01 .......... 0000859b : 859b: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 85ab: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 85bb: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 85cb: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 85db: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 85eb: 05 04 04 04 08 08 ...... 000085f1 : 85f1: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8601: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8611: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8621: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8631: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8641: 80 10 20 40 04 80 .. @.. 00008647 : 8647: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8673: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 0000869d : 869d: 33 2e 31 34 2e 31 00 3.14.1. 000086a4 : 86a4: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 86b4: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 86c4: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 000086d2 : 86d2: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 000086e0 : 86e0: 61 64 63 5f 69 6e 69 74 00 adc_init. 000086e9 : 86e9: 20 0a 20 0a 20 0a 20 00 . . . . 000086f1 : 86f1: 41 6c 6c 20 44 61 74 61 00 All Data. 000086fa : 86fa: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008707 : 8707: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008715 : 8715: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008720 : 8720: 4c 61 6e 67 75 61 67 65 00 Language. 00008729 <_ZZL13factory_resetcE3__c.lto_priv.496>: 8729: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 0000873a : 873a: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008748 : 8748: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008752 : 8752: 03 00 0e 00 01 00 40 00 ......@. 0000875a : 875a: 03 00 02 00 00 00 04 00 ........ 00008762 : 8762: 55 6e 6b 6e 6f 77 6e 00 Unknown. 0000876a : 876a: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 877a: 3a 30 30 00 :00. 0000877e : 877e: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 878e: 30 30 30 30 30 30 00 000000. 00008795 : 8795: 73 74 61 72 74 00 start. 0000879b : 879b: 4d 32 39 00 M29. 0000879f : 879f: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 000087a7 : 87a7: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 000087b7 : 87b7: 20 0a 20 0a 20 00 . . . 000087bd : 87bd: 4d 4d 55 32 3a 00 MMU2:. 000087c3 : 87c3: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 000087d4 : 87d4: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 87e4: 6e 74 65 72 0a 00 nter.. 000087ea : 87ea: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 87fa: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 880a: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 881a: 20 61 64 3d 25 64 0a 00 ad=%d.. 00008822 : 8822: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 8832: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 8842: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000884f : 884f: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 885f: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 886f: 25 64 0a 00 %d.. 00008873 : 8873: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 8883: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 8893: 0a 00 .. 00008895 : 8895: 25 30 32 78 00 %02x. 0000889a : 889a: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 88aa: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 000088b6 : 88b6: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 88c6: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 000088d2 : 88d2: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 88e2: fc 03 f8 01 f0 00 00 00 ........ 000088ea : 88ea: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 88fa: f8 01 f0 00 00 00 00 00 ........ 00008902 : 8902: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 8912: 65 61 76 65 0a 00 eave.. 00008918 : 8918: 20 3c 20 00 < . 0000891c : 891c: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 892c: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 893c: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 894c: 3a 00 :. 0000894e : ... 0000894f : 894f: 00 00 40 41 00 00 80 40 00 00 5c 43 00 00 80 40 ..@A...@..\C...@ 895f: 00 00 5c 43 00 00 44 43 00 00 40 41 00 00 44 43 ..\C..DC..@A..DC 0000896f : 896f: 25 64 2f 34 00 %d/4. 00008974 : 8974: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00008980 : 8980: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 8990: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 89a0: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 89b0: 2e 00 .. 000089b2 : 89b2: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 89c2: 64 00 d. 000089c4 : 89c4: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 89d4: 69 78 65 64 00 ixed. 000089d9 : 89d9: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 89e9: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 89f9: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 8a09: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 8a19: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 8a29: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 8a39: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 8a49: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 8a59: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 8a69: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 8a79: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 8a89: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 8a99: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 8aa9: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 8ab9: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 8ac9: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 8ad9: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 8ae9: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 8af9: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 8b09: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 8b19: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 8b29: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 8b39: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 8b49: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 8b59: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 8b69: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 8b79: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 8b89: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 8b99: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 8ba9: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 8bb9: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 8bc9: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 8bd9: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 8be9: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 8bf9: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 8c09: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 8c19: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 8c29: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 8c39: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 8c49: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 8c59: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 8c69: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 8c79: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 8c89: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 8c99: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 8ca9: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 8cb9: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 8cc9: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 8cd9: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 8ce9: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 8cf9: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 8d09: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 8d19: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 8d29: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 8d39: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 8d49: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 8d59: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 8d69: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 8d79: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 8d89: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 8d99: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 8da9: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 8db9: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 8dc9: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00008dd9 : 8dd9: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 8de9: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 8df9: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 8e09: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 8e19: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 8e29: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 8e39: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 8e49: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 8e59: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 8e69: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 8e79: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 8e89: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 8e99: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 8ea9: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 8eb9: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 8ec9: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 8ed9: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 8ee9: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 8ef9: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 8f09: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 8f19: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 8f29: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 8f39: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 8f49: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 8f59: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 8f69: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 8f79: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 8f89: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 8f99: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 8fa9: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 8fb9: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 8fc9: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 8fd9: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 8fe9: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 8ff9: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 9009: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 9019: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 9029: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 9039: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9049: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9059: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9069: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9079: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9089: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9099: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 90a9: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 90b9: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 90c9: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 90d9: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 90e9: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 90f9: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9109: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9119: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 9129: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9139: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9149: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9159: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9169: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9179: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9189: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9199: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 91a9: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 91b9: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 91c9: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 000091d9 : 91d9: 45 30 3a 20 00 E0: . 000091de : 91de: 5a 3a 20 00 Z: . 000091e2 : 91e2: 59 3a 20 00 Y: . 000091e6 : 91e6: 58 3a 20 00 X: . 000091ea : 91ea: 4d 53 31 2c 4d 53 32 20 50 69 6e 73 00 MS1,MS2 Pins. 000091f7 <_ZZ12PID_autotunefiiE3__c__16_>: 91f7: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9207: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9217: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9227: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9237: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9247: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009253 <_ZZ12PID_autotunefiiE3__c__15_>: 9253: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9263: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009270 <_ZZ12PID_autotunefiiE3__c__14_>: 9270: 20 40 3a 00 @:. 00009274 <_ZZ12PID_autotunefiiE3__c__13_>: 9274: 54 3a 00 T:. 00009277 <_ZZ12PID_autotunefiiE3__c__12_>: 9277: 42 3a 00 B:. 0000927a <_ZZ12PID_autotunefiiE3__c__11_>: 927a: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 928a: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 929a: 20 74 6f 6f 20 68 69 67 68 00 too high. 000092a4 <_ZZ12PID_autotunefiiE3__c__10_>: 92a4: 20 4b 64 3a 20 00 Kd: . 000092aa : 92aa: 20 4b 69 3a 20 00 Ki: . 000092b0 : 92b0: 20 4b 70 3a 20 00 Kp: . 000092b6 : 92b6: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 000092c4 : 92c4: 20 54 75 3a 20 00 Tu: . 000092ca : 92ca: 20 4b 75 3a 20 00 Ku: . 000092d0 : 92d0: 20 6d 61 78 3a 20 00 max: . 000092d7 : 92d7: 20 6d 69 6e 3a 20 00 min: . 000092de : 92de: 20 64 3a 20 00 d: . 000092e3 : 92e3: 20 62 69 61 73 3a 20 00 bias: . 000092eb : 92eb: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 92fb: 72 74 00 rt. 000092fe : 92fe: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 930e: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 931e: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009328 : 9328: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 9338: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 9348: 78 70 65 63 74 65 64 00 xpected. 00009350 : 9350: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 9360: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 9370: 70 65 63 74 65 64 00 pected. 00009377 : 9377: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009383 : 9383: 4d 49 4e 54 45 4d 50 00 MINTEMP. 0000938b : 938b: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009393 : 9393: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 0000939f : 939f: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 93af: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 93bf: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 93cf: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 93df: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 93ef: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 93ff: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 940f: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 941f: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 942f: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 943f: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 944f: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 945f: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 946f: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 947f: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 948f: 00 3f 00 00 .?.. 00009493 : 9493: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 94a3: 52 55 4e 41 57 41 59 00 RUNAWAY. 000094ab : 94ab: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 94bb: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 000094c4 : 94c4: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 000094d4 : 94d4: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 94e4: 57 41 59 00 WAY. 000094e8 : 94e8: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 94f8: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9508: 29 00 ). 0000950a : 950a: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 951a: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 952a: 44 29 00 D). 0000952d : 952d: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 0000953b : 953b: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 954b: 52 00 R. 0000954d : 954d: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009559 : 9559: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9569: 20 6f 66 66 2e 20 00 off. . 00009570 : 9570: 3a 20 00 : . 00009573 : 9573: 45 72 72 3a 20 00 Err: . 00009579 : 9579: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009589 : 9589: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009598 <__c.1906>: 9598: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! 95a8: 21 00 !. 000095aa : 95aa: 3a 20 00 : . 000095ad : 95ad: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 000095bb : 95bb: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 000095c4 : 95c4: 20 3a 20 00 : . 000095c8 : 95c8: 25 33 53 00 %3S. 000095cc : 95cc: 25 2d 37 73 00 %-7s. 000095d1 : 95d1: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 95e1: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 000095ec : 95ec: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 95fc: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000960b : 960b: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 961b: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. 962b: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 00009638 : 9638: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9648: 0a 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 .%S. %-16.16S%-3 9658: 64 0a 00 d.. 0000965b : 965b: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 00009665 : 9665: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 00009671 <_ZZL16lcd_support_menuvE3__c__15_>: 9671: 20 00 . 00009673 <_ZZL16lcd_support_menuvE3__c__14_>: 9673: 20 00 . 00009675 <_ZZL16lcd_support_menuvE3__c__13_>: 9675: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr 9685: 3a 00 :. 00009687 <_ZZL16lcd_support_menuvE3__c__12_>: 9687: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 00009696 <_ZZL16lcd_support_menuvE3__c__11_>: 9696: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000969f <_ZZL16lcd_support_menuvE3__c__10_>: 969f: 20 46 57 3a 00 FW:. 000096a4 : 96a4: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 000096af : 96af: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 000096b9 : 96b9: 52 41 4d 42 6f 31 33 61 00 RAMBo13a. 000096c2 : 96c2: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 53 00 1_75mm_MK25S. 000096cf : 96cf: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 000096df : 96df: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 000096ed : 96ed: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 000096fa : 96fa: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 00009704 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: 9704: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 00009713 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: 9713: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000971f <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: 971f: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000972f <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: 972f: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000973b <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: 973b: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000974b <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: 974b: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 00009757 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: 9757: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 00009767 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: 9767: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 00009773 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: 9773: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 00009782 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: 9782: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000978e <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: 978e: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000979d : 979d: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 000097a9 : 97a9: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 30 35 00 PC - 275/105. 000097b9 : 97b9: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 000097c5 : 97c5: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 000097d5 : 97d5: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 000097e1 : 97e1: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 000097f0 : 97f0: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 000097fc : 97fc: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000980b : 980b: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 00009817 : 9817: 6e 6f 7a 7a 6c 65 20 2d 20 20 32 35 30 2f 30 00 nozzle - 250/0. 00009827 : 9827: 66 61 72 6d 20 20 20 2d 20 20 32 35 30 2f 38 30 farm - 250/80 ... 00009838 : 9838: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 00009847 : 9847: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 00009851 : 9851: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000985c : 985c: 58 3a 00 X:. 0000985f : 985f: 59 3a 00 Y:. 00009862 : 9862: 5a 3a 00 Z:. 00009865 : 9865: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 00009876 : 9876: 25 33 75 00 %3u. 0000987a : 987a: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 988a: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin 989a: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing 98aa: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 000098b5 : 98b5: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 98c5: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue 98d5: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t 98e5: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 000098ee : 98ee: 5a 30 00 Z0. 000098f1 : 98f1: 5a 31 00 Z1. 000098f4 : 98f4: 59 30 00 Y0. 000098f7 : 98f7: 59 31 00 Y1. 000098fa : 98fa: 58 30 00 X0. 000098fd : 98fd: 58 31 00 X1. 00009900 : 9900: 45 6e 64 20 73 74 6f 70 73 20 64 69 61 67 00 End stops diag. 0000990f : 990f: 47 38 30 00 G80. 00009913 : 9913: 4d 34 35 00 M45. 00009917 : 9917: 4d 34 35 20 5a 00 M45 Z. 0000991d : 991d: 47 37 36 00 G76. 00009921 : 9921: 4d 37 30 31 20 50 30 00 M701 P0. 00009929 : 9929: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 9939: 0a 00 .. 0000993b : 993b: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c 994b: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 995b: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 996b: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009973 <_ZL4endl.lto_priv.363>: 9973: 0a 00 .. 00009975 : 9975: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 00009984 : 9984: 25 64 0a 00 %d.. 00009988 : 9988: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 00009999 : 9999: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ 99a9: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f 99b9: 25 25 0a 00 %%.. 000099bd : 99bd: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi 99cd: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 000099d9 : 99d9: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 000099e5 : 99e5: 00 00 7a 43 00 00 56 43 9a d9 51 43 ..zC..VC..QC 000099f1 : 99f1: ff ff ff ... 000099f4 <_ZL16ramming_sequence.lto_priv.364>: 99f4: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A 9a04: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A 9a14: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B 9a24: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB 9a34: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B 9a44: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B 9a54: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A 9a64: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ 9a74: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 00009a84 : 9a84: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st 9a94: 6f 70 70 65 64 00 opped. 00009a9a : 9a9a: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 00009aaa : 9aaa: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout 9aba: 73 74 61 72 74 65 64 00 started. 00009ac2 : 9ac2: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki 9ad2: 6e 67 00 ng. 00009ad5 : 9ad5: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown 9ae5: 70 65 6e 64 69 6e 67 00 pending. 00009aed : 9aed: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 00009afa : 9afa: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% 9b0a: 2d 2e 33 66 00 -.3f. 00009b0f : 9b0f: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: 9b1f: 20 00 . 00009b21 : 9b21: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope 9b31: 6e 65 64 00 ned. 00009b35 : 9b35: 31 58 20 58 0c 58 f7 57 e1 57 ce 57 b8 57 a4 57 1X X.X.W.W.W.W.W 9b45: 93 57 7d 57 0c 58 20 58 69 57 5a 57 46 57 35 57 .W}W.X XiWZWFW5W 9b55: 20 57 c4 5a 0a 57 f8 56 e5 56 d4 56 bf 56 ac 56 W.Z.W.V.V.V.V.V 9b65: 98 56 83 56 7a 56 68 56 53 56 .V.VzVhVSV 00009b6f : 9b6f: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 00009b79 : 9b79: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r 9b89: 75 6e 6f 75 74 21 00 unout!. 00009b90 : 9b90: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti 9ba0: 6d 65 6f 75 74 00 meout. 00009ba6 : 9ba6: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 00009bb5 : 9bb5: 03 00 03 ... 00009bb8 : 9bb8: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 00009bc9 : 9bc9: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 00009bd7 : 9bd7: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 00009be8 : 9be8: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe 9bf8: 64 00 d. 00009bfa : 9bfa: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress 9c0a: 65 64 00 ed. 00009c0d <_ZN4MMU2L11errorTitlesE.lto_priv.452>: 9c0d: 8e 5a 79 5a 62 5a 4d 5a 38 5a 24 5a 14 5a fd 59 .ZyZbZMZ8Z$Z.Z.Y 9c1d: e6 59 cf 59 bb 59 a7 59 91 59 91 59 91 59 7c 59 .Y.Y.Y.Y.Y.Y.Y|Y 9c2d: 7c 59 7c 59 69 59 69 59 69 59 56 59 56 59 56 59 |Y|YiYiYiYVYVYVY 9c3d: 3f 59 3f 59 3f 59 2a 59 2a 59 2a 59 14 59 14 59 ?Y?Y?Y*Y*Y*Y.Y.Y 9c4d: 14 59 04 59 ef 58 d9 58 c3 58 b4 58 a7 58 90 58 .Y.Y.X.X.X.X.X.X 9c5d: 7d 58 6b 58 58 58 46 58 36 58 }XkXXXFX6X 00009c67 : 9c67: 42 75 74 74 6f 6e 00 Button. 00009c6e : 9c6e: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b 9c7e: 74 6e 4c 4d 52 20 00 tnLMR . 00009c85 : 9c85: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp 9c95: 74 73 00 ts. 00009c98 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.451>: 9c98: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . 9ca8: 20 20 20 81 00 .. 00009cad : 9cad: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu 9cbd: 72 65 20 72 65 61 63 68 65 64 00 re reached. 00009cc8 : 9cc8: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 00009cd6 : 9cd6: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl 9ce6: 65 61 72 65 64 00 eared. 00009cec : 9cec: 20 57 3a 00 W:. 00009cf0 : 9cf0: 20 45 3a 00 E:. 00009cf4 : 9cf4: 54 3a 00 T:. 00009cf7 : 9cf7: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 00009d08 : 9d08: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 00009d15 : 9d15: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 00009d23 : 9d23: 20 53 69 7a 65 3a 20 00 Size: . 00009d2b : 9d2b: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 00009d39 : 9d39: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 00009d4a : 9d4a: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 00009d5b : 9d5b: 22 20 70 6f 73 00 " pos. 00009d61 : 9d61: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 00009d6c : 9d6c: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL 9d7c: 74 61 72 67 65 74 3a 22 00 target:". 00009d85 : 9d85: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s 9d95: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w 9da5: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev 9db5: 65 6c 73 2e 00 els.. 00009dba : 9dba: 20 22 25 73 22 00 "%s". 00009dc0 : 9dc0: 20 25 23 6c 78 00 %#lx. 00009dc6 : 9dc6: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 00009dcf : 9dcf: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% 9ddf: 73 22 0a 00 s".. 00009de3 : 9de3: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 00009dec : 9dec: 04 1a .. 00009dee : 9dee: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt 9dfe: 74 65 6d 70 74 73 00 tempts. 00009e05 : 9e05: 08 1b 1c ... 00009e08 : 9e08: 0b 14 .. 00009e0a : 9e0a: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 00009e19 : 9e19: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 00009e28 <_ZL10bufferFull.lto_priv.516>: 9e28: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer 9e38: 20 66 75 6c 6c 21 00 full!. 00009e3f : 9e3f: 22 00 ". 00009e41 : 9e41: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the 9e51: 66 72 6f 6e 74 3a 20 22 00 front: ". 00009e5a : 9e5a: 45 72 72 6f 72 3a 00 Error:. 00009e61 : 9e61: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 00009e6b <_ZL9mmu2Magic.lto_priv.348>: 9e6b: 4d 4d 55 32 3a 00 MMU2:. 00009e71 <_ZL9mmu2Magic.lto_priv.349>: 9e71: 4d 4d 55 32 3a 00 MMU2:. 00009e77 : 9e77: 65 63 68 6f 3a 00 echo:. 00009e7d : 9e7d: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 00009e85 : 9e85: 4d 4d 55 20 69 73 20 00 MMU is . 00009e8d : 9e8d: 25 2e 31 30 53 20 00 %.10S . 00009e94 : 9e94: 25 34 64 00 %4d. 00009e98 : 9e98: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t 9ea8: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 00009eb5 : 9eb5: 25 64 2f 39 00 %d/9. 00009eba : 9eba: 4d 4d 55 32 3a 00 MMU2:. 00009ec0 : 9ec0: 25 33 64 00 %3d. 00009ec4 : 9ec4: 18 01 04 19 02 0a ...... 00009eca : 9eca: 54 62 de 61 64 61 f7 60 ae 60 1c 60 a4 5f 3c 5f Tb.ada.`.`.`._<_ 9eda: ed 5e cd 5e 81 5e cd 5e 6a 5e 6a 5e 6a 5e 6a 5e .^.^.^.^j^j^j^j^ 9eea: 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e j^j^j^j^j^j^j^j^ 9efa: 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e 6a 5e j^j^j^j^j^j^j^j^ 9f0a: 6a 5e 6a 5e 33 5e f2 5d a8 5d 35 5d 00 5d b6 5c j^j^3^.].]5].].\ 9f1a: 6c 5c 0e 5c d5 5b 93 5b 76 5b l\.\.[.[v[ 00009f24 : 9f24: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. 9f34: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ 9f44: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 00009f51 : 9f51: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. 9f61: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... 9f71: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. 9f81: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. 9f91: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. 9fa1: f9 01 fa 01 fb 01 fc 01 84 03 .......... 00009fab : 9fab: e1 62 4a 63 d6 62 cd 62 c6 62 41 4b 50 3d bf 62 .bJc.b.b.bAKP=.b 9fbb: b5 62 .b 00009fbd : 9fbd: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 9fcd: 34 25 68 75 00 4%hu. 00009fd2 : 9fd2: 7b 5b 45 52 52 3a 00 {[ERR:. 00009fd9 <_ZL14FW_VERSION_STR.lto_priv.499>: 9fd9: 33 2e 31 34 2e 31 00 3.14.1. 00009fe0 : 9fe0: 5d 5b 46 57 52 3a 00 ][FWR:. 00009fe7 : 9fe7: 5d 5b 54 49 4d 3a 00 ][TIM:. 00009fee : 9fee: 5d 5b 46 4e 4d 3a 00 ][FNM:. 00009ff5 : 9ff5: 5d 5b 46 45 4d 3a 00 ][FEM:. 00009ffc : 9ffc: 5d 5b 50 43 44 3a 00 ][PCD:. 0000a003 : a003: 5b 54 46 55 3a 00 [TFU:. 0000a009 : a009: 5b 50 52 4e 3a 00 [PRN:. 0000a00f : a00f: 5b 50 46 4e 3a 30 5d 00 [PFN:0]. 0000a017 : a017: 5b 44 49 41 3a 00 [DIA:. 0000a01d : a01d: 5d 5b 41 54 42 3a 00 ][ATB:. 0000a024 : a024: 5d 5b 41 54 30 3a 00 ][AT0:. 0000a02b : a02b: 5d 5b 53 54 42 3a 00 ][STB:. 0000a032 : a032: 5b 53 54 30 3a 00 [ST0:. 0000a038 : a038: 7b 5b 50 52 4e 3a 35 5d 00 {[PRN:5]. 0000a041 : a041: 7b 5b 50 52 4e 3a 30 5d 00 {[PRN:0]. 0000a04a : a04a: 7b 5b 50 52 4e 3a 39 5d 00 {[PRN:9]. 0000a053 : a053: 7b 5b 50 52 4e 3a 38 5d 00 {[PRN:8]. 0000a05c : a05c: 7b 5b 52 45 53 3a 30 5d 5b 46 49 4c 3a 00 {[RES:0][FIL:. 0000a06a : a06a: 7b 5b 52 45 53 3a 31 5d 5b 46 49 4c 3a 00 {[RES:1][FIL:. 0000a078 : a078: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p a088: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... a098: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b a0a8: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... a0b8: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T a0c8: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... a0d8: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F a0e8: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... a0f8: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 a108: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. a118: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* a128: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... a138: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. a148: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. a158: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. a168: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. a178: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. a188: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` a198: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. a1a8: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr a1b8: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... a1c8: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D a1d8: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. a1e8: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V a1f8: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... a208: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( a218: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... a228: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: a238: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... a248: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... a258: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... a268: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000a278 : a278: 7c 3c 3e 3f 2f 2a 22 5c 00 00 |<>?/*"\.. 0000a282 <__ctors_start>: a282: 85 38 cpi r24, 0x85 ; 133 0000a284 <__ctors_end>: a284: d8 5e subi r29, 0xE8 ; 232 0000a286 <__dtors_end>: a286: 11 24 eor r1, r1 a288: 1f be out 0x3f, r1 ; 63 a28a: cf ef ldi r28, 0xFF ; 255 a28c: d1 e2 ldi r29, 0x21 ; 33 a28e: de bf out 0x3e, r29 ; 62 a290: cd bf out 0x3d, r28 ; 61 a292: 00 e0 ldi r16, 0x00 ; 0 a294: 0c bf out 0x3c, r16 ; 60 0000a296 <__do_copy_data>: a296: 13 e0 ldi r17, 0x03 ; 3 a298: a0 e0 ldi r26, 0x00 ; 0 a29a: b2 e0 ldi r27, 0x02 ; 2 a29c: e0 e1 ldi r30, 0x10 ; 16 a29e: f0 e5 ldi r31, 0x50 ; 80 a2a0: 03 e0 ldi r16, 0x03 ; 3 a2a2: 0b bf out 0x3b, r16 ; 59 a2a4: 02 c0 rjmp .+4 ; 0xa2aa <__do_copy_data+0x14> a2a6: 07 90 elpm r0, Z+ a2a8: 0d 92 st X+, r0 a2aa: a4 30 cpi r26, 0x04 ; 4 a2ac: b1 07 cpc r27, r17 a2ae: d9 f7 brne .-10 ; 0xa2a6 <__do_copy_data+0x10> 0000a2b0 <__do_clear_bss>: a2b0: 27 e1 ldi r18, 0x17 ; 23 a2b2: a4 e0 ldi r26, 0x04 ; 4 a2b4: b3 e0 ldi r27, 0x03 ; 3 a2b6: 01 c0 rjmp .+2 ; 0xa2ba <.do_clear_bss_start> 0000a2b8 <.do_clear_bss_loop>: a2b8: 1d 92 st X+, r1 0000a2ba <.do_clear_bss_start>: a2ba: a4 30 cpi r26, 0x04 ; 4 a2bc: b2 07 cpc r27, r18 a2be: e1 f7 brne .-8 ; 0xa2b8 <.do_clear_bss_loop> 0000a2c0 <__do_global_ctors>: a2c0: 11 e5 ldi r17, 0x51 ; 81 a2c2: c2 e4 ldi r28, 0x42 ; 66 a2c4: d1 e5 ldi r29, 0x51 ; 81 a2c6: 00 e0 ldi r16, 0x00 ; 0 a2c8: 06 c0 rjmp .+12 ; 0xa2d6 <__do_global_ctors+0x16> a2ca: 21 97 sbiw r28, 0x01 ; 1 a2cc: 01 09 sbc r16, r1 a2ce: 80 2f mov r24, r16 a2d0: fe 01 movw r30, r28 a2d2: 0f 94 4c a2 call 0x34498 ; 0x34498 <__tablejump2__> a2d6: c1 34 cpi r28, 0x41 ; 65 a2d8: d1 07 cpc r29, r17 a2da: 80 e0 ldi r24, 0x00 ; 0 a2dc: 08 07 cpc r16, r24 a2de: a9 f7 brne .-22 ; 0xa2ca <__do_global_ctors+0xa> a2e0: 0e 94 96 d8 call 0x1b12c ; 0x1b12c
a2e4: 0d 94 f6 a7 jmp 0x34fec ; 0x34fec <__do_global_dtors> 0000a2e8 <__bad_interrupt>: a2e8: 0c 94 43 75 jmp 0xea86 ; 0xea86 <__vector_default> 0000a2ec : a2ec: 2f 92 push r2 a2ee: 3f 92 push r3 a2f0: 4f 92 push r4 a2f2: 5f 92 push r5 a2f4: 6f 92 push r6 a2f6: 7f 92 push r7 a2f8: 8f 92 push r8 a2fa: 9f 92 push r9 a2fc: af 92 push r10 a2fe: bf 92 push r11 a300: cf 92 push r12 a302: df 92 push r13 a304: ef 92 push r14 a306: ff 92 push r15 a308: 0f 93 push r16 a30a: 1f 93 push r17 a30c: cf 93 push r28 a30e: df 93 push r29 a310: cd b7 in r28, 0x3d ; 61 a312: de b7 in r29, 0x3e ; 62 a314: 2f 97 sbiw r28, 0x0f ; 15 a316: 0f b6 in r0, 0x3f ; 63 a318: f8 94 cli a31a: de bf out 0x3e, r29 ; 62 a31c: 0f be out 0x3f, r0 ; 63 a31e: cd bf out 0x3d, r28 ; 61 a320: 6c 01 movw r12, r24 a322: 1b 01 movw r2, r22 a324: 5a 01 movw r10, r20 a326: fc 01 movw r30, r24 a328: 17 82 std Z+7, r1 ; 0x07 a32a: 16 82 std Z+6, r1 ; 0x06 a32c: 83 81 ldd r24, Z+3 ; 0x03 a32e: 9e 01 movw r18, r28 a330: 2f 5f subi r18, 0xFF ; 255 a332: 3f 4f sbci r19, 0xFF ; 255 a334: 49 01 movw r8, r18 a336: 81 fd sbrc r24, 1 a338: d2 c0 rjmp .+420 ; 0xa4de a33a: 8f ef ldi r24, 0xFF ; 255 a33c: 9f ef ldi r25, 0xFF ; 255 a33e: ee c2 rjmp .+1500 ; 0xa91c a340: f1 2c mov r15, r1 a342: 51 2c mov r5, r1 a344: 00 e0 ldi r16, 0x00 ; 0 a346: 00 32 cpi r16, 0x20 ; 32 a348: 38 f4 brcc .+14 ; 0xa358 a34a: 8b 32 cpi r24, 0x2B ; 43 a34c: 09 f1 breq .+66 ; 0xa390 a34e: 90 f4 brcc .+36 ; 0xa374 a350: 80 32 cpi r24, 0x20 ; 32 a352: f9 f0 breq .+62 ; 0xa392 a354: 83 32 cpi r24, 0x23 ; 35 a356: 09 f1 breq .+66 ; 0xa39a a358: 07 fd sbrc r16, 7 a35a: 34 c0 rjmp .+104 ; 0xa3c4 a35c: 20 ed ldi r18, 0xD0 ; 208 a35e: 28 0f add r18, r24 a360: 2a 30 cpi r18, 0x0A ; 10 a362: 20 f5 brcc .+72 ; 0xa3ac a364: 06 ff sbrs r16, 6 a366: 1b c0 rjmp .+54 ; 0xa39e a368: fa e0 ldi r31, 0x0A ; 10 a36a: ff 9e mul r15, r31 a36c: 20 0d add r18, r0 a36e: 11 24 eor r1, r1 a370: f2 2e mov r15, r18 a372: 05 c0 rjmp .+10 ; 0xa37e a374: 8d 32 cpi r24, 0x2D ; 45 a376: 79 f0 breq .+30 ; 0xa396 a378: 80 33 cpi r24, 0x30 ; 48 a37a: 71 f7 brne .-36 ; 0xa358 a37c: 01 60 ori r16, 0x01 ; 1 a37e: f1 01 movw r30, r2 a380: 93 fd sbrc r25, 3 a382: 85 91 lpm r24, Z+ a384: 93 ff sbrs r25, 3 a386: 81 91 ld r24, Z+ a388: 1f 01 movw r2, r30 a38a: 81 11 cpse r24, r1 a38c: dc cf rjmp .-72 ; 0xa346 a38e: 1a c0 rjmp .+52 ; 0xa3c4 a390: 02 60 ori r16, 0x02 ; 2 a392: 04 60 ori r16, 0x04 ; 4 a394: f4 cf rjmp .-24 ; 0xa37e a396: 08 60 ori r16, 0x08 ; 8 a398: f2 cf rjmp .-28 ; 0xa37e a39a: 00 61 ori r16, 0x10 ; 16 a39c: f0 cf rjmp .-32 ; 0xa37e a39e: 3a e0 ldi r19, 0x0A ; 10 a3a0: 53 9e mul r5, r19 a3a2: 20 0d add r18, r0 a3a4: 11 24 eor r1, r1 a3a6: 52 2e mov r5, r18 a3a8: 00 62 ori r16, 0x20 ; 32 a3aa: e9 cf rjmp .-46 ; 0xa37e a3ac: 8e 32 cpi r24, 0x2E ; 46 a3ae: 21 f4 brne .+8 ; 0xa3b8 a3b0: 06 fd sbrc r16, 6 a3b2: b1 c2 rjmp .+1378 ; 0xa916 a3b4: 00 64 ori r16, 0x40 ; 64 a3b6: e3 cf rjmp .-58 ; 0xa37e a3b8: 8c 36 cpi r24, 0x6C ; 108 a3ba: 11 f4 brne .+4 ; 0xa3c0 a3bc: 00 68 ori r16, 0x80 ; 128 a3be: df cf rjmp .-66 ; 0xa37e a3c0: 88 36 cpi r24, 0x68 ; 104 a3c2: e9 f2 breq .-70 ; 0xa37e a3c4: 9b eb ldi r25, 0xBB ; 187 a3c6: 98 0f add r25, r24 a3c8: 93 30 cpi r25, 0x03 ; 3 a3ca: 08 f0 brcs .+2 ; 0xa3ce a3cc: 5f c0 rjmp .+190 ; 0xa48c a3ce: 00 61 ori r16, 0x10 ; 16 a3d0: 80 5e subi r24, 0xE0 ; 224 a3d2: 06 fd sbrc r16, 6 a3d4: 02 c0 rjmp .+4 ; 0xa3da a3d6: 46 e0 ldi r20, 0x06 ; 6 a3d8: f4 2e mov r15, r20 a3da: 10 2f mov r17, r16 a3dc: 1f 73 andi r17, 0x3F ; 63 a3de: 85 36 cpi r24, 0x65 ; 101 a3e0: 09 f0 breq .+2 ; 0xa3e4 a3e2: 5b c0 rjmp .+182 ; 0xa49a a3e4: 10 64 ori r17, 0x40 ; 64 a3e6: 17 ff sbrs r17, 7 a3e8: 61 c0 rjmp .+194 ; 0xa4ac a3ea: 8f 2d mov r24, r15 a3ec: 9b e3 ldi r25, 0x3B ; 59 a3ee: 9f 15 cp r25, r15 a3f0: 08 f4 brcc .+2 ; 0xa3f4 a3f2: 8b e3 ldi r24, 0x3B ; 59 a3f4: 44 24 eor r4, r4 a3f6: 43 94 inc r4 a3f8: 48 0e add r4, r24 a3fa: 27 e0 ldi r18, 0x07 ; 7 a3fc: 35 01 movw r6, r10 a3fe: f4 e0 ldi r31, 0x04 ; 4 a400: 6f 0e add r6, r31 a402: 71 1c adc r7, r1 a404: f5 01 movw r30, r10 a406: 60 81 ld r22, Z a408: 71 81 ldd r23, Z+1 ; 0x01 a40a: 82 81 ldd r24, Z+2 ; 0x02 a40c: 93 81 ldd r25, Z+3 ; 0x03 a40e: 04 2d mov r16, r4 a410: a4 01 movw r20, r8 a412: 0f 94 f5 9d call 0x33bea ; 0x33bea <__ftoa_engine> a416: 5c 01 movw r10, r24 a418: f9 81 ldd r31, Y+1 ; 0x01 a41a: fc 87 std Y+12, r31 ; 0x0c a41c: f0 ff sbrs r31, 0 a41e: 03 c0 rjmp .+6 ; 0xa426 a420: 0d e2 ldi r16, 0x2D ; 45 a422: f3 ff sbrs r31, 3 a424: 07 c0 rjmp .+14 ; 0xa434 a426: 0b e2 ldi r16, 0x2B ; 43 a428: 11 fd sbrc r17, 1 a42a: 04 c0 rjmp .+8 ; 0xa434 a42c: 01 2f mov r16, r17 a42e: 04 70 andi r16, 0x04 ; 4 a430: 12 fd sbrc r17, 2 a432: 00 e2 ldi r16, 0x20 ; 32 a434: 2c 85 ldd r18, Y+12 ; 0x0c a436: 2c 70 andi r18, 0x0C ; 12 a438: e2 2e mov r14, r18 a43a: 09 f4 brne .+2 ; 0xa43e a43c: 6b c0 rjmp .+214 ; 0xa514 a43e: 01 11 cpse r16, r1 a440: d8 c2 rjmp .+1456 ; 0xa9f2 a442: f3 e0 ldi r31, 0x03 ; 3 a444: e1 2c mov r14, r1 a446: f5 15 cp r31, r5 a448: a0 f4 brcc .+40 ; 0xa472 a44a: 83 e0 ldi r24, 0x03 ; 3 a44c: e5 2c mov r14, r5 a44e: e8 1a sub r14, r24 a450: 13 fd sbrc r17, 3 a452: 08 c0 rjmp .+16 ; 0xa464 a454: b6 01 movw r22, r12 a456: 80 e2 ldi r24, 0x20 ; 32 a458: 90 e0 ldi r25, 0x00 ; 0 a45a: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a45e: ea 94 dec r14 a460: e1 10 cpse r14, r1 a462: f8 cf rjmp .-16 ; 0xa454 a464: 00 23 and r16, r16 a466: 29 f0 breq .+10 ; 0xa472 a468: b6 01 movw r22, r12 a46a: 80 2f mov r24, r16 a46c: 90 e0 ldi r25, 0x00 ; 0 a46e: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a472: 3c 85 ldd r19, Y+12 ; 0x0c a474: 2e ee ldi r18, 0xEE ; 238 a476: a2 2e mov r10, r18 a478: 21 e7 ldi r18, 0x71 ; 113 a47a: b2 2e mov r11, r18 a47c: 33 fd sbrc r19, 3 a47e: 04 c0 rjmp .+8 ; 0xa488 a480: 92 ef ldi r25, 0xF2 ; 242 a482: a9 2e mov r10, r25 a484: 91 e7 ldi r25, 0x71 ; 113 a486: b9 2e mov r11, r25 a488: 10 71 andi r17, 0x10 ; 16 a48a: 22 c0 rjmp .+68 ; 0xa4d0 a48c: 9b e9 ldi r25, 0x9B ; 155 a48e: 98 0f add r25, r24 a490: 93 30 cpi r25, 0x03 ; 3 a492: 08 f0 brcs .+2 ; 0xa496 a494: 47 c1 rjmp .+654 ; 0xa724 a496: 0f 7e andi r16, 0xEF ; 239 a498: 9c cf rjmp .-200 ; 0xa3d2 a49a: 86 36 cpi r24, 0x66 ; 102 a49c: 11 f4 brne .+4 ; 0xa4a2 a49e: 10 68 ori r17, 0x80 ; 128 a4a0: a2 cf rjmp .-188 ; 0xa3e6 a4a2: ff 20 and r15, r15 a4a4: 09 f4 brne .+2 ; 0xa4a8 a4a6: 9f cf rjmp .-194 ; 0xa3e6 a4a8: fa 94 dec r15 a4aa: 9d cf rjmp .-198 ; 0xa3e6 a4ac: e7 e0 ldi r30, 0x07 ; 7 a4ae: 2f 2d mov r18, r15 a4b0: ef 15 cp r30, r15 a4b2: 18 f4 brcc .+6 ; 0xa4ba a4b4: 27 e0 ldi r18, 0x07 ; 7 a4b6: 37 e0 ldi r19, 0x07 ; 7 a4b8: f3 2e mov r15, r19 a4ba: 41 2c mov r4, r1 a4bc: 9f cf rjmp .-194 ; 0xa3fc a4be: 11 11 cpse r17, r1 a4c0: 80 52 subi r24, 0x20 ; 32 a4c2: b6 01 movw r22, r12 a4c4: 90 e0 ldi r25, 0x00 ; 0 a4c6: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a4ca: 8f ef ldi r24, 0xFF ; 255 a4cc: a8 1a sub r10, r24 a4ce: b8 0a sbc r11, r24 a4d0: f5 01 movw r30, r10 a4d2: 84 91 lpm r24, Z a4d4: 81 11 cpse r24, r1 a4d6: f3 cf rjmp .-26 ; 0xa4be a4d8: e1 10 cpse r14, r1 a4da: 84 c2 rjmp .+1288 ; 0xa9e4 a4dc: 53 01 movw r10, r6 a4de: f6 01 movw r30, r12 a4e0: 93 81 ldd r25, Z+3 ; 0x03 a4e2: f1 01 movw r30, r2 a4e4: 93 fd sbrc r25, 3 a4e6: 85 91 lpm r24, Z+ a4e8: 93 ff sbrs r25, 3 a4ea: 81 91 ld r24, Z+ a4ec: 1f 01 movw r2, r30 a4ee: 88 23 and r24, r24 a4f0: 09 f4 brne .+2 ; 0xa4f4 a4f2: 11 c2 rjmp .+1058 ; 0xa916 a4f4: 85 32 cpi r24, 0x25 ; 37 a4f6: 41 f4 brne .+16 ; 0xa508 a4f8: 93 fd sbrc r25, 3 a4fa: 85 91 lpm r24, Z+ a4fc: 93 ff sbrs r25, 3 a4fe: 81 91 ld r24, Z+ a500: 1f 01 movw r2, r30 a502: 85 32 cpi r24, 0x25 ; 37 a504: 09 f0 breq .+2 ; 0xa508 a506: 1c cf rjmp .-456 ; 0xa340 a508: b6 01 movw r22, r12 a50a: 90 e0 ldi r25, 0x00 ; 0 a50c: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a510: 35 01 movw r6, r10 a512: e4 cf rjmp .-56 ; 0xa4dc a514: 17 ff sbrs r17, 7 a516: 6f c0 rjmp .+222 ; 0xa5f6 a518: 4a 0c add r4, r10 a51a: fc 85 ldd r31, Y+12 ; 0x0c a51c: f4 ff sbrs r31, 4 a51e: 04 c0 rjmp .+8 ; 0xa528 a520: 8a 81 ldd r24, Y+2 ; 0x02 a522: 81 33 cpi r24, 0x31 ; 49 a524: 09 f4 brne .+2 ; 0xa528 a526: 4a 94 dec r4 a528: 14 14 cp r1, r4 a52a: 0c f0 brlt .+2 ; 0xa52e a52c: 86 c0 rjmp .+268 ; 0xa63a a52e: 28 e0 ldi r18, 0x08 ; 8 a530: 24 15 cp r18, r4 a532: 10 f4 brcc .+4 ; 0xa538 a534: 88 e0 ldi r24, 0x08 ; 8 a536: 48 2e mov r4, r24 a538: 85 e0 ldi r24, 0x05 ; 5 a53a: 90 e0 ldi r25, 0x00 ; 0 a53c: 17 ff sbrs r17, 7 a53e: 06 c0 rjmp .+12 ; 0xa54c a540: c5 01 movw r24, r10 a542: b7 fe sbrs r11, 7 a544: 02 c0 rjmp .+4 ; 0xa54a a546: 90 e0 ldi r25, 0x00 ; 0 a548: 80 e0 ldi r24, 0x00 ; 0 a54a: 01 96 adiw r24, 0x01 ; 1 a54c: 01 11 cpse r16, r1 a54e: 01 96 adiw r24, 0x01 ; 1 a550: ff 20 and r15, r15 a552: 31 f0 breq .+12 ; 0xa560 a554: 2f 2d mov r18, r15 a556: 30 e0 ldi r19, 0x00 ; 0 a558: 2f 5f subi r18, 0xFF ; 255 a55a: 3f 4f sbci r19, 0xFF ; 255 a55c: 82 0f add r24, r18 a55e: 93 1f adc r25, r19 a560: 58 16 cp r5, r24 a562: 19 06 cpc r1, r25 a564: 19 f0 breq .+6 ; 0xa56c a566: 14 f0 brlt .+4 ; 0xa56c a568: e5 2c mov r14, r5 a56a: e8 1a sub r14, r24 a56c: 81 2f mov r24, r17 a56e: 89 70 andi r24, 0x09 ; 9 a570: 11 f4 brne .+4 ; 0xa576 a572: e1 10 cpse r14, r1 a574: 67 c0 rjmp .+206 ; 0xa644 a576: 00 23 and r16, r16 a578: 29 f0 breq .+10 ; 0xa584 a57a: b6 01 movw r22, r12 a57c: 80 2f mov r24, r16 a57e: 90 e0 ldi r25, 0x00 ; 0 a580: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a584: 13 fd sbrc r17, 3 a586: 02 c0 rjmp .+4 ; 0xa58c a588: e1 10 cpse r14, r1 a58a: 63 c0 rjmp .+198 ; 0xa652 a58c: 17 ff sbrs r17, 7 a58e: 7c c0 rjmp .+248 ; 0xa688 a590: 85 01 movw r16, r10 a592: b7 fe sbrs r11, 7 a594: 02 c0 rjmp .+4 ; 0xa59a a596: 10 e0 ldi r17, 0x00 ; 0 a598: 00 e0 ldi r16, 0x00 ; 0 a59a: c5 01 movw r24, r10 a59c: 84 19 sub r24, r4 a59e: 91 09 sbc r25, r1 a5a0: 2c 01 movw r4, r24 a5a2: 6f 2d mov r22, r15 a5a4: 70 e0 ldi r23, 0x00 ; 0 a5a6: ee 27 eor r30, r30 a5a8: ff 27 eor r31, r31 a5aa: e6 1b sub r30, r22 a5ac: f7 0b sbc r31, r23 a5ae: ff 87 std Y+15, r31 ; 0x0f a5b0: ee 87 std Y+14, r30 ; 0x0e a5b2: 0f 3f cpi r16, 0xFF ; 255 a5b4: 10 07 cpc r17, r16 a5b6: 29 f4 brne .+10 ; 0xa5c2 a5b8: b6 01 movw r22, r12 a5ba: 8e e2 ldi r24, 0x2E ; 46 a5bc: 90 e0 ldi r25, 0x00 ; 0 a5be: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a5c2: a0 16 cp r10, r16 a5c4: b1 06 cpc r11, r17 a5c6: 0c f4 brge .+2 ; 0xa5ca a5c8: 4b c0 rjmp .+150 ; 0xa660 a5ca: 40 16 cp r4, r16 a5cc: 51 06 cpc r5, r17 a5ce: 0c f0 brlt .+2 ; 0xa5d2 a5d0: 47 c0 rjmp .+142 ; 0xa660 a5d2: f5 01 movw r30, r10 a5d4: e0 1b sub r30, r16 a5d6: f1 0b sbc r31, r17 a5d8: e8 0d add r30, r8 a5da: f9 1d adc r31, r9 a5dc: 81 81 ldd r24, Z+1 ; 0x01 a5de: 01 50 subi r16, 0x01 ; 1 a5e0: 11 09 sbc r17, r1 a5e2: 2e 85 ldd r18, Y+14 ; 0x0e a5e4: 3f 85 ldd r19, Y+15 ; 0x0f a5e6: 02 17 cp r16, r18 a5e8: 13 07 cpc r17, r19 a5ea: e4 f1 brlt .+120 ; 0xa664 a5ec: b6 01 movw r22, r12 a5ee: 90 e0 ldi r25, 0x00 ; 0 a5f0: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a5f4: de cf rjmp .-68 ; 0xa5b2 a5f6: 16 fd sbrc r17, 6 a5f8: 9f cf rjmp .-194 ; 0xa538 a5fa: ef 2d mov r30, r15 a5fc: f0 e0 ldi r31, 0x00 ; 0 a5fe: ea 15 cp r30, r10 a600: fb 05 cpc r31, r11 a602: 34 f0 brlt .+12 ; 0xa610 a604: 3c ef ldi r19, 0xFC ; 252 a606: a3 16 cp r10, r19 a608: 3f ef ldi r19, 0xFF ; 255 a60a: b3 06 cpc r11, r19 a60c: 0c f0 brlt .+2 ; 0xa610 a60e: 10 68 ori r17, 0x80 ; 128 a610: 32 96 adiw r30, 0x02 ; 2 a612: e8 0d add r30, r8 a614: f9 1d adc r31, r9 a616: 01 c0 rjmp .+2 ; 0xa61a a618: fa 94 dec r15 a61a: ff 20 and r15, r15 a61c: 19 f0 breq .+6 ; 0xa624 a61e: 82 91 ld r24, -Z a620: 80 33 cpi r24, 0x30 ; 48 a622: d1 f3 breq .-12 ; 0xa618 a624: 17 ff sbrs r17, 7 a626: 88 cf rjmp .-240 ; 0xa538 a628: 44 24 eor r4, r4 a62a: 43 94 inc r4 a62c: 4f 0c add r4, r15 a62e: fa 14 cp r15, r10 a630: 1b 04 cpc r1, r11 a632: 31 f0 breq .+12 ; 0xa640 a634: 2c f0 brlt .+10 ; 0xa640 a636: fa 18 sub r15, r10 a638: 7f cf rjmp .-258 ; 0xa538 a63a: 44 24 eor r4, r4 a63c: 43 94 inc r4 a63e: 7c cf rjmp .-264 ; 0xa538 a640: f1 2c mov r15, r1 a642: 7a cf rjmp .-268 ; 0xa538 a644: b6 01 movw r22, r12 a646: 80 e2 ldi r24, 0x20 ; 32 a648: 90 e0 ldi r25, 0x00 ; 0 a64a: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a64e: ea 94 dec r14 a650: 90 cf rjmp .-224 ; 0xa572 a652: b6 01 movw r22, r12 a654: 80 e3 ldi r24, 0x30 ; 48 a656: 90 e0 ldi r25, 0x00 ; 0 a658: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a65c: ea 94 dec r14 a65e: 94 cf rjmp .-216 ; 0xa588 a660: 80 e3 ldi r24, 0x30 ; 48 a662: bd cf rjmp .-134 ; 0xa5de a664: a0 16 cp r10, r16 a666: b1 06 cpc r11, r17 a668: 41 f4 brne .+16 ; 0xa67a a66a: 9a 81 ldd r25, Y+2 ; 0x02 a66c: 96 33 cpi r25, 0x36 ; 54 a66e: 50 f4 brcc .+20 ; 0xa684 a670: 95 33 cpi r25, 0x35 ; 53 a672: 19 f4 brne .+6 ; 0xa67a a674: 3c 85 ldd r19, Y+12 ; 0x0c a676: 34 ff sbrs r19, 4 a678: 05 c0 rjmp .+10 ; 0xa684 a67a: b6 01 movw r22, r12 a67c: 90 e0 ldi r25, 0x00 ; 0 a67e: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a682: 2a cf rjmp .-428 ; 0xa4d8 a684: 81 e3 ldi r24, 0x31 ; 49 a686: f9 cf rjmp .-14 ; 0xa67a a688: 8a 81 ldd r24, Y+2 ; 0x02 a68a: 81 33 cpi r24, 0x31 ; 49 a68c: 19 f0 breq .+6 ; 0xa694 a68e: 9c 85 ldd r25, Y+12 ; 0x0c a690: 9f 7e andi r25, 0xEF ; 239 a692: 9c 87 std Y+12, r25 ; 0x0c a694: b6 01 movw r22, r12 a696: 90 e0 ldi r25, 0x00 ; 0 a698: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a69c: ff 20 and r15, r15 a69e: a9 f0 breq .+42 ; 0xa6ca a6a0: b6 01 movw r22, r12 a6a2: 8e e2 ldi r24, 0x2E ; 46 a6a4: 90 e0 ldi r25, 0x00 ; 0 a6a6: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a6aa: f3 94 inc r15 a6ac: f3 94 inc r15 a6ae: e2 e0 ldi r30, 0x02 ; 2 a6b0: 01 e0 ldi r16, 0x01 ; 1 a6b2: 0e 0f add r16, r30 a6b4: e8 0d add r30, r8 a6b6: f9 2d mov r31, r9 a6b8: f1 1d adc r31, r1 a6ba: 80 81 ld r24, Z a6bc: b6 01 movw r22, r12 a6be: 90 e0 ldi r25, 0x00 ; 0 a6c0: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a6c4: e0 2f mov r30, r16 a6c6: 0f 11 cpse r16, r15 a6c8: f3 cf rjmp .-26 ; 0xa6b0 a6ca: 85 e6 ldi r24, 0x65 ; 101 a6cc: 90 e0 ldi r25, 0x00 ; 0 a6ce: 14 ff sbrs r17, 4 a6d0: 02 c0 rjmp .+4 ; 0xa6d6 a6d2: 85 e4 ldi r24, 0x45 ; 69 a6d4: 90 e0 ldi r25, 0x00 ; 0 a6d6: b6 01 movw r22, r12 a6d8: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a6dc: b7 fc sbrc r11, 7 a6de: 06 c0 rjmp .+12 ; 0xa6ec a6e0: a1 14 cp r10, r1 a6e2: b1 04 cpc r11, r1 a6e4: c1 f4 brne .+48 ; 0xa716 a6e6: ec 85 ldd r30, Y+12 ; 0x0c a6e8: e4 ff sbrs r30, 4 a6ea: 15 c0 rjmp .+42 ; 0xa716 a6ec: b1 94 neg r11 a6ee: a1 94 neg r10 a6f0: b1 08 sbc r11, r1 a6f2: 8d e2 ldi r24, 0x2D ; 45 a6f4: b6 01 movw r22, r12 a6f6: 90 e0 ldi r25, 0x00 ; 0 a6f8: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a6fc: 80 e3 ldi r24, 0x30 ; 48 a6fe: 2a e0 ldi r18, 0x0A ; 10 a700: a2 16 cp r10, r18 a702: b1 04 cpc r11, r1 a704: 54 f4 brge .+20 ; 0xa71a a706: b6 01 movw r22, r12 a708: 90 e0 ldi r25, 0x00 ; 0 a70a: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a70e: b6 01 movw r22, r12 a710: c5 01 movw r24, r10 a712: c0 96 adiw r24, 0x30 ; 48 a714: b4 cf rjmp .-152 ; 0xa67e a716: 8b e2 ldi r24, 0x2B ; 43 a718: ed cf rjmp .-38 ; 0xa6f4 a71a: 8f 5f subi r24, 0xFF ; 255 a71c: fa e0 ldi r31, 0x0A ; 10 a71e: af 1a sub r10, r31 a720: b1 08 sbc r11, r1 a722: ed cf rjmp .-38 ; 0xa6fe a724: 83 36 cpi r24, 0x63 ; 99 a726: c9 f0 breq .+50 ; 0xa75a a728: 83 37 cpi r24, 0x73 ; 115 a72a: 71 f1 breq .+92 ; 0xa788 a72c: 83 35 cpi r24, 0x53 ; 83 a72e: 09 f0 breq .+2 ; 0xa732 a730: 5b c0 rjmp .+182 ; 0xa7e8 a732: 35 01 movw r6, r10 a734: f2 e0 ldi r31, 0x02 ; 2 a736: 6f 0e add r6, r31 a738: 71 1c adc r7, r1 a73a: f5 01 movw r30, r10 a73c: a0 80 ld r10, Z a73e: b1 80 ldd r11, Z+1 ; 0x01 a740: 6f 2d mov r22, r15 a742: 70 e0 ldi r23, 0x00 ; 0 a744: 06 fd sbrc r16, 6 a746: 02 c0 rjmp .+4 ; 0xa74c a748: 6f ef ldi r22, 0xFF ; 255 a74a: 7f ef ldi r23, 0xFF ; 255 a74c: c5 01 movw r24, r10 a74e: 0f 94 38 9f call 0x33e70 ; 0x33e70 a752: 9d 87 std Y+13, r25 ; 0x0d a754: 8c 87 std Y+12, r24 ; 0x0c a756: 00 68 ori r16, 0x80 ; 128 a758: 0d c0 rjmp .+26 ; 0xa774 a75a: 35 01 movw r6, r10 a75c: 32 e0 ldi r19, 0x02 ; 2 a75e: 63 0e add r6, r19 a760: 71 1c adc r7, r1 a762: f5 01 movw r30, r10 a764: 80 81 ld r24, Z a766: 89 83 std Y+1, r24 ; 0x01 a768: 21 e0 ldi r18, 0x01 ; 1 a76a: 30 e0 ldi r19, 0x00 ; 0 a76c: 3d 87 std Y+13, r19 ; 0x0d a76e: 2c 87 std Y+12, r18 ; 0x0c a770: 54 01 movw r10, r8 a772: 0f 77 andi r16, 0x7F ; 127 a774: 03 fd sbrc r16, 3 a776: 06 c0 rjmp .+12 ; 0xa784 a778: 2c 85 ldd r18, Y+12 ; 0x0c a77a: 3d 85 ldd r19, Y+13 ; 0x0d a77c: 52 16 cp r5, r18 a77e: 13 06 cpc r1, r19 a780: 09 f0 breq .+2 ; 0xa784 a782: a8 f4 brcc .+42 ; 0xa7ae a784: e5 2c mov r14, r5 a786: 2b c0 rjmp .+86 ; 0xa7de a788: 35 01 movw r6, r10 a78a: 32 e0 ldi r19, 0x02 ; 2 a78c: 63 0e add r6, r19 a78e: 71 1c adc r7, r1 a790: f5 01 movw r30, r10 a792: a0 80 ld r10, Z a794: b1 80 ldd r11, Z+1 ; 0x01 a796: 6f 2d mov r22, r15 a798: 70 e0 ldi r23, 0x00 ; 0 a79a: 06 fd sbrc r16, 6 a79c: 02 c0 rjmp .+4 ; 0xa7a2 a79e: 6f ef ldi r22, 0xFF ; 255 a7a0: 7f ef ldi r23, 0xFF ; 255 a7a2: c5 01 movw r24, r10 a7a4: 0f 94 5d 9f call 0x33eba ; 0x33eba a7a8: 9d 87 std Y+13, r25 ; 0x0d a7aa: 8c 87 std Y+12, r24 ; 0x0c a7ac: e2 cf rjmp .-60 ; 0xa772 a7ae: b6 01 movw r22, r12 a7b0: 80 e2 ldi r24, 0x20 ; 32 a7b2: 90 e0 ldi r25, 0x00 ; 0 a7b4: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a7b8: 5a 94 dec r5 a7ba: de cf rjmp .-68 ; 0xa778 a7bc: f5 01 movw r30, r10 a7be: 07 fd sbrc r16, 7 a7c0: 85 91 lpm r24, Z+ a7c2: 07 ff sbrs r16, 7 a7c4: 81 91 ld r24, Z+ a7c6: 5f 01 movw r10, r30 a7c8: b6 01 movw r22, r12 a7ca: 90 e0 ldi r25, 0x00 ; 0 a7cc: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a7d0: e1 10 cpse r14, r1 a7d2: ea 94 dec r14 a7d4: 8c 85 ldd r24, Y+12 ; 0x0c a7d6: 9d 85 ldd r25, Y+13 ; 0x0d a7d8: 01 97 sbiw r24, 0x01 ; 1 a7da: 9d 87 std Y+13, r25 ; 0x0d a7dc: 8c 87 std Y+12, r24 ; 0x0c a7de: ec 85 ldd r30, Y+12 ; 0x0c a7e0: fd 85 ldd r31, Y+13 ; 0x0d a7e2: ef 2b or r30, r31 a7e4: 59 f7 brne .-42 ; 0xa7bc a7e6: 78 ce rjmp .-784 ; 0xa4d8 a7e8: 84 36 cpi r24, 0x64 ; 100 a7ea: 19 f0 breq .+6 ; 0xa7f2 a7ec: 89 36 cpi r24, 0x69 ; 105 a7ee: 09 f0 breq .+2 ; 0xa7f2 a7f0: 74 c0 rjmp .+232 ; 0xa8da a7f2: 35 01 movw r6, r10 a7f4: 07 ff sbrs r16, 7 a7f6: 66 c0 rjmp .+204 ; 0xa8c4 a7f8: f4 e0 ldi r31, 0x04 ; 4 a7fa: 6f 0e add r6, r31 a7fc: 71 1c adc r7, r1 a7fe: f5 01 movw r30, r10 a800: 60 81 ld r22, Z a802: 71 81 ldd r23, Z+1 ; 0x01 a804: 82 81 ldd r24, Z+2 ; 0x02 a806: 93 81 ldd r25, Z+3 ; 0x03 a808: 10 2f mov r17, r16 a80a: 1f 76 andi r17, 0x6F ; 111 a80c: 97 ff sbrs r25, 7 a80e: 08 c0 rjmp .+16 ; 0xa820 a810: 90 95 com r25 a812: 80 95 com r24 a814: 70 95 com r23 a816: 61 95 neg r22 a818: 7f 4f sbci r23, 0xFF ; 255 a81a: 8f 4f sbci r24, 0xFF ; 255 a81c: 9f 4f sbci r25, 0xFF ; 255 a81e: 10 68 ori r17, 0x80 ; 128 a820: 2a e0 ldi r18, 0x0A ; 10 a822: 30 e0 ldi r19, 0x00 ; 0 a824: a4 01 movw r20, r8 a826: 0f 94 cb a0 call 0x34196 ; 0x34196 <__ultoa_invert> a82a: a8 2e mov r10, r24 a82c: a8 18 sub r10, r8 a82e: ba 2c mov r11, r10 a830: 01 2f mov r16, r17 a832: 16 ff sbrs r17, 6 a834: 0a c0 rjmp .+20 ; 0xa84a a836: 0e 7f andi r16, 0xFE ; 254 a838: af 14 cp r10, r15 a83a: 38 f4 brcc .+14 ; 0xa84a a83c: 14 ff sbrs r17, 4 a83e: 04 c0 rjmp .+8 ; 0xa848 a840: 12 fd sbrc r17, 2 a842: 02 c0 rjmp .+4 ; 0xa848 a844: 01 2f mov r16, r17 a846: 0e 7e andi r16, 0xEE ; 238 a848: bf 2c mov r11, r15 a84a: 04 ff sbrs r16, 4 a84c: a3 c0 rjmp .+326 ; 0xa994 a84e: fe 01 movw r30, r28 a850: ea 0d add r30, r10 a852: f1 1d adc r31, r1 a854: 80 81 ld r24, Z a856: 80 33 cpi r24, 0x30 ; 48 a858: 09 f0 breq .+2 ; 0xa85c a85a: 95 c0 rjmp .+298 ; 0xa986 a85c: 09 7e andi r16, 0xE9 ; 233 a85e: f0 2f mov r31, r16 a860: f8 70 andi r31, 0x08 ; 8 a862: ef 2e mov r14, r31 a864: 03 fd sbrc r16, 3 a866: a5 c0 rjmp .+330 ; 0xa9b2 a868: 00 ff sbrs r16, 0 a86a: 9f c0 rjmp .+318 ; 0xa9aa a86c: fa 2c mov r15, r10 a86e: b5 14 cp r11, r5 a870: 10 f4 brcc .+4 ; 0xa876 a872: f5 0c add r15, r5 a874: fb 18 sub r15, r11 a876: 04 ff sbrs r16, 4 a878: a2 c0 rjmp .+324 ; 0xa9be a87a: b6 01 movw r22, r12 a87c: 80 e3 ldi r24, 0x30 ; 48 a87e: 90 e0 ldi r25, 0x00 ; 0 a880: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a884: 02 ff sbrs r16, 2 a886: 09 c0 rjmp .+18 ; 0xa89a a888: 88 e7 ldi r24, 0x78 ; 120 a88a: 90 e0 ldi r25, 0x00 ; 0 a88c: 01 ff sbrs r16, 1 a88e: 02 c0 rjmp .+4 ; 0xa894 a890: 88 e5 ldi r24, 0x58 ; 88 a892: 90 e0 ldi r25, 0x00 ; 0 a894: b6 01 movw r22, r12 a896: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a89a: af 14 cp r10, r15 a89c: 08 f4 brcc .+2 ; 0xa8a0 a89e: 9b c0 rjmp .+310 ; 0xa9d6 a8a0: aa 94 dec r10 a8a2: 0a 2d mov r16, r10 a8a4: 10 e0 ldi r17, 0x00 ; 0 a8a6: 0f 5f subi r16, 0xFF ; 255 a8a8: 1f 4f sbci r17, 0xFF ; 255 a8aa: 08 0d add r16, r8 a8ac: 19 1d adc r17, r9 a8ae: f8 01 movw r30, r16 a8b0: 82 91 ld r24, -Z a8b2: 8f 01 movw r16, r30 a8b4: b6 01 movw r22, r12 a8b6: 90 e0 ldi r25, 0x00 ; 0 a8b8: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a8bc: 80 16 cp r8, r16 a8be: 91 06 cpc r9, r17 a8c0: b1 f7 brne .-20 ; 0xa8ae a8c2: 0a ce rjmp .-1004 ; 0xa4d8 a8c4: f2 e0 ldi r31, 0x02 ; 2 a8c6: 6f 0e add r6, r31 a8c8: 71 1c adc r7, r1 a8ca: f5 01 movw r30, r10 a8cc: 60 81 ld r22, Z a8ce: 71 81 ldd r23, Z+1 ; 0x01 a8d0: 07 2e mov r0, r23 a8d2: 00 0c add r0, r0 a8d4: 88 0b sbc r24, r24 a8d6: 99 0b sbc r25, r25 a8d8: 97 cf rjmp .-210 ; 0xa808 a8da: 10 2f mov r17, r16 a8dc: 85 37 cpi r24, 0x75 ; 117 a8de: a9 f4 brne .+42 ; 0xa90a a8e0: 1f 7e andi r17, 0xEF ; 239 a8e2: 2a e0 ldi r18, 0x0A ; 10 a8e4: 30 e0 ldi r19, 0x00 ; 0 a8e6: 35 01 movw r6, r10 a8e8: 17 ff sbrs r17, 7 a8ea: 44 c0 rjmp .+136 ; 0xa974 a8ec: f4 e0 ldi r31, 0x04 ; 4 a8ee: 6f 0e add r6, r31 a8f0: 71 1c adc r7, r1 a8f2: f5 01 movw r30, r10 a8f4: 60 81 ld r22, Z a8f6: 71 81 ldd r23, Z+1 ; 0x01 a8f8: 82 81 ldd r24, Z+2 ; 0x02 a8fa: 93 81 ldd r25, Z+3 ; 0x03 a8fc: a4 01 movw r20, r8 a8fe: 0f 94 cb a0 call 0x34196 ; 0x34196 <__ultoa_invert> a902: a8 2e mov r10, r24 a904: a8 18 sub r10, r8 a906: 1f 77 andi r17, 0x7F ; 127 a908: 92 cf rjmp .-220 ; 0xa82e a90a: 19 7f andi r17, 0xF9 ; 249 a90c: 8f 36 cpi r24, 0x6F ; 111 a90e: 79 f1 breq .+94 ; 0xa96e a910: f0 f4 brcc .+60 ; 0xa94e a912: 88 35 cpi r24, 0x58 ; 88 a914: 39 f1 breq .+78 ; 0xa964 a916: f6 01 movw r30, r12 a918: 86 81 ldd r24, Z+6 ; 0x06 a91a: 97 81 ldd r25, Z+7 ; 0x07 a91c: 2f 96 adiw r28, 0x0f ; 15 a91e: 0f b6 in r0, 0x3f ; 63 a920: f8 94 cli a922: de bf out 0x3e, r29 ; 62 a924: 0f be out 0x3f, r0 ; 63 a926: cd bf out 0x3d, r28 ; 61 a928: df 91 pop r29 a92a: cf 91 pop r28 a92c: 1f 91 pop r17 a92e: 0f 91 pop r16 a930: ff 90 pop r15 a932: ef 90 pop r14 a934: df 90 pop r13 a936: cf 90 pop r12 a938: bf 90 pop r11 a93a: af 90 pop r10 a93c: 9f 90 pop r9 a93e: 8f 90 pop r8 a940: 7f 90 pop r7 a942: 6f 90 pop r6 a944: 5f 90 pop r5 a946: 4f 90 pop r4 a948: 3f 90 pop r3 a94a: 2f 90 pop r2 a94c: 08 95 ret a94e: 80 37 cpi r24, 0x70 ; 112 a950: 39 f0 breq .+14 ; 0xa960 a952: 88 37 cpi r24, 0x78 ; 120 a954: 01 f7 brne .-64 ; 0xa916 a956: 14 fd sbrc r17, 4 a958: 14 60 ori r17, 0x04 ; 4 a95a: 20 e1 ldi r18, 0x10 ; 16 a95c: 30 e0 ldi r19, 0x00 ; 0 a95e: c3 cf rjmp .-122 ; 0xa8e6 a960: 10 61 ori r17, 0x10 ; 16 a962: f9 cf rjmp .-14 ; 0xa956 a964: 04 fd sbrc r16, 4 a966: 16 60 ori r17, 0x06 ; 6 a968: 20 e1 ldi r18, 0x10 ; 16 a96a: 32 e0 ldi r19, 0x02 ; 2 a96c: bc cf rjmp .-136 ; 0xa8e6 a96e: 28 e0 ldi r18, 0x08 ; 8 a970: 30 e0 ldi r19, 0x00 ; 0 a972: b9 cf rjmp .-142 ; 0xa8e6 a974: f2 e0 ldi r31, 0x02 ; 2 a976: 6f 0e add r6, r31 a978: 71 1c adc r7, r1 a97a: f5 01 movw r30, r10 a97c: 60 81 ld r22, Z a97e: 71 81 ldd r23, Z+1 ; 0x01 a980: 90 e0 ldi r25, 0x00 ; 0 a982: 80 e0 ldi r24, 0x00 ; 0 a984: bb cf rjmp .-138 ; 0xa8fc a986: 02 fd sbrc r16, 2 a988: 02 c0 rjmp .+4 ; 0xa98e a98a: b3 94 inc r11 a98c: 68 cf rjmp .-304 ; 0xa85e a98e: b3 94 inc r11 a990: b3 94 inc r11 a992: 65 cf rjmp .-310 ; 0xa85e a994: 80 2f mov r24, r16 a996: 86 78 andi r24, 0x86 ; 134 a998: 09 f4 brne .+2 ; 0xa99c a99a: 61 cf rjmp .-318 ; 0xa85e a99c: f6 cf rjmp .-20 ; 0xa98a a99e: b6 01 movw r22, r12 a9a0: 80 e2 ldi r24, 0x20 ; 32 a9a2: 90 e0 ldi r25, 0x00 ; 0 a9a4: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a9a8: b3 94 inc r11 a9aa: b5 14 cp r11, r5 a9ac: c0 f3 brcs .-16 ; 0xa99e a9ae: e1 2c mov r14, r1 a9b0: 62 cf rjmp .-316 ; 0xa876 a9b2: e5 2c mov r14, r5 a9b4: eb 18 sub r14, r11 a9b6: b5 14 cp r11, r5 a9b8: 08 f4 brcc .+2 ; 0xa9bc a9ba: 5d cf rjmp .-326 ; 0xa876 a9bc: f8 cf rjmp .-16 ; 0xa9ae a9be: 80 2f mov r24, r16 a9c0: 86 78 andi r24, 0x86 ; 134 a9c2: 09 f4 brne .+2 ; 0xa9c6 a9c4: 6a cf rjmp .-300 ; 0xa89a a9c6: 8b e2 ldi r24, 0x2B ; 43 a9c8: 01 ff sbrs r16, 1 a9ca: 80 e2 ldi r24, 0x20 ; 32 a9cc: 07 fd sbrc r16, 7 a9ce: 8d e2 ldi r24, 0x2D ; 45 a9d0: b6 01 movw r22, r12 a9d2: 90 e0 ldi r25, 0x00 ; 0 a9d4: 60 cf rjmp .-320 ; 0xa896 a9d6: b6 01 movw r22, r12 a9d8: 80 e3 ldi r24, 0x30 ; 48 a9da: 90 e0 ldi r25, 0x00 ; 0 a9dc: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a9e0: fa 94 dec r15 a9e2: 5b cf rjmp .-330 ; 0xa89a a9e4: b6 01 movw r22, r12 a9e6: 80 e2 ldi r24, 0x20 ; 32 a9e8: 90 e0 ldi r25, 0x00 ; 0 a9ea: 0f 94 a4 9f call 0x33f48 ; 0x33f48 a9ee: ea 94 dec r14 a9f0: 73 cd rjmp .-1306 ; 0xa4d8 a9f2: 24 e0 ldi r18, 0x04 ; 4 a9f4: e1 2c mov r14, r1 a9f6: 25 15 cp r18, r5 a9f8: 08 f0 brcs .+2 ; 0xa9fc a9fa: 36 cd rjmp .-1428 ; 0xa468 a9fc: 84 e0 ldi r24, 0x04 ; 4 a9fe: 26 cd rjmp .-1460 ; 0xa44c 0000aa00 : 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 ( aa00: 20 e0 ldi r18, 0x00 ; 0 aa02: 30 e0 ldi r19, 0x00 ; 0 aa04: 40 e8 ldi r20, 0x80 ; 128 aa06: 5f eb ldi r21, 0xBF ; 191 aa08: 60 91 7e 02 lds r22, 0x027E ; 0x80027e aa0c: 70 91 7f 02 lds r23, 0x027F ; 0x80027f aa10: 80 91 80 02 lds r24, 0x0280 ; 0x800280 aa14: 90 91 81 02 lds r25, 0x0281 ; 0x800281 aa18: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> aa1c: 88 23 and r24, r24 aa1e: 21 f1 breq .+72 ; 0xaa68 (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || aa20: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb aa24: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc aa28: e2 52 subi r30, 0x22 ; 34 aa2a: 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) && ( aa2c: 80 81 ld r24, Z aa2e: 8b 7f andi r24, 0xFB ; 251 aa30: 82 30 cpi r24, 0x02 ; 2 aa32: d1 f4 brne .+52 ; 0xaa68 (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)); aa34: 80 e1 ldi r24, 0x10 ; 16 aa36: ee e7 ldi r30, 0x7E ; 126 aa38: f2 e0 ldi r31, 0x02 ; 2 aa3a: a5 ef ldi r26, 0xF5 ; 245 aa3c: b1 e1 ldi r27, 0x11 ; 17 aa3e: 01 90 ld r0, Z+ aa40: 0d 92 st X+, r0 aa42: 8a 95 dec r24 aa44: e1 f7 brne .-8 ; 0xaa3e saved_start_position[0] = SAVED_START_POSITION_UNSET; aa46: 80 e0 ldi r24, 0x00 ; 0 aa48: 90 e0 ldi r25, 0x00 ; 0 aa4a: a0 e8 ldi r26, 0x80 ; 128 aa4c: bf eb ldi r27, 0xBF ; 191 aa4e: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e aa52: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f aa56: a0 93 80 02 sts 0x0280, r26 ; 0x800280 aa5a: b0 93 81 02 sts 0x0281, r27 ; 0x800281 return saved_segment_idx; aa5e: 80 91 e0 11 lds r24, 0x11E0 ; 0x8011e0 aa62: 90 91 e1 11 lds r25, 0x11E1 ; 0x8011e1 aa66: 08 95 ret } else return 1; //begin with the first segment aa68: 81 e0 ldi r24, 0x01 ; 1 aa6a: 90 e0 ldi r25, 0x00 ; 0 } aa6c: 08 95 ret 0000aa6e : 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)); } aa6e: 80 e1 ldi r24, 0x10 ; 16 aa70: e3 e9 ldi r30, 0x93 ; 147 aa72: f6 e0 ldi r31, 0x06 ; 6 aa74: a5 ef ldi r26, 0xF5 ; 245 aa76: b1 e1 ldi r27, 0x11 ; 17 aa78: 01 90 ld r0, Z+ aa7a: 0d 92 st X+, r0 aa7c: 8a 95 dec r24 aa7e: e1 f7 brne .-8 ; 0xaa78 aa80: 08 95 ret 0000aa82 : /// @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)); aa82: e6 ec ldi r30, 0xC6 ; 198 aa84: f6 e7 ldi r31, 0x76 ; 118 aa86: 83 30 cpi r24, 0x03 ; 3 aa88: 21 f0 breq .+8 ; 0xaa92 aa8a: e8 2f mov r30, r24 aa8c: f0 e0 ldi r31, 0x00 ; 0 aa8e: ed 53 subi r30, 0x3D ; 61 aa90: f9 48 sbci r31, 0x89 ; 137 aa92: 84 91 lpm r24, Z } aa94: 08 95 ret 0000aa96 : 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; aa96: 80 91 af 05 lds r24, 0x05AF ; 0x8005af aa9a: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 aa9e: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 aaa2: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 aaa6: 82 1b sub r24, r18 aaa8: 93 0b sbc r25, r19 } aaaa: 8f 77 andi r24, 0x7F ; 127 aaac: 99 27 eor r25, r25 aaae: 08 95 ret 0000aab0 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; aab0: 98 2f mov r25, r24 aab2: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); aab4: 83 ff sbrs r24, 3 aab6: 0d c0 rjmp .+26 ; 0xaad2 aab8: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> aabc: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); aabe: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); aac2: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> aac6: 88 7f andi r24, 0xF8 ; 248 aac8: 97 70 andi r25, 0x07 ; 7 aaca: 89 2b or r24, r25 aacc: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } aad0: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); aad2: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> aad6: 87 7f andi r24, 0xF7 ; 247 aad8: f2 cf rjmp .-28 ; 0xaabe 0000aada : // 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; aada: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 aade: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 aae2: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 aae6: 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); aaea: 85 ed ldi r24, 0xD5 ; 213 aaec: 99 e6 ldi r25, 0x69 ; 105 aaee: 9f 93 push r25 aaf0: 8f 93 push r24 aaf2: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 aaf6: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 aafa: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 aafe: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 ab02: 01 96 adiw r24, 0x01 ; 1 ab04: a1 1d adc r26, r1 ab06: b1 1d adc r27, r1 ab08: bf 93 push r27 ab0a: af 93 push r26 ab0c: 9f 93 push r25 ab0e: 8f 93 push r24 ab10: 8d ef ldi r24, 0xFD ; 253 ab12: 94 e6 ldi r25, 0x64 ; 100 ab14: 9f 93 push r25 ab16: 8f 93 push r24 ab18: 84 e0 ldi r24, 0x04 ; 4 ab1a: 95 e6 ldi r25, 0x65 ; 101 ab1c: 9f 93 push r25 ab1e: 8f 93 push r24 ab20: 0f 94 fe 9f call 0x33ffc ; 0x33ffc ab24: 8d b7 in r24, 0x3d ; 61 ab26: 9e b7 in r25, 0x3e ; 62 ab28: 0a 96 adiw r24, 0x0a ; 10 ab2a: 0f b6 in r0, 0x3f ; 63 ab2c: f8 94 cli ab2e: 9e bf out 0x3e, r25 ; 62 ab30: 0f be out 0x3f, r0 ; 63 ab32: 8d bf out 0x3d, r24 ; 61 } ab34: 08 95 ret 0000ab36 : 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) { ab36: 0f 93 push r16 ab38: 1f 93 push r17 ab3a: cf 93 push r28 ab3c: df 93 push r29 ab3e: ec 01 movw r28, r24 ab40: c6 0f add r28, r22 ab42: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { ab44: 8c 17 cp r24, r28 ab46: 9d 07 cpc r25, r29 ab48: 79 f0 breq .+30 ; 0xab68 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) ab4a: 8c 01 movw r16, r24 ab4c: 0f 5f subi r16, 0xFF ; 255 ab4e: 1f 4f sbci r17, 0xFF ; 255 ab50: 0f 94 3c a1 call 0x34278 ; 0x34278 ab54: 8f 3f cpi r24, 0xFF ; 255 ab56: 31 f0 breq .+12 ; 0xab64 return true; ab58: 81 e0 ldi r24, 0x01 ; 1 } return false; } ab5a: df 91 pop r29 ab5c: cf 91 pop r28 ab5e: 1f 91 pop r17 ab60: 0f 91 pop r16 ab62: 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) ab64: c8 01 movw r24, r16 ab66: ee cf rjmp .-36 ; 0xab44 return true; } return false; ab68: 80 e0 ldi r24, 0x00 ; 0 ab6a: f7 cf rjmp .-18 ; 0xab5a 0000ab6c : #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; } ab6c: 68 2f mov r22, r24 ab6e: 88 0f add r24, r24 ab70: 77 0b sbc r23, r23 ab72: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb ab76: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc ab7a: 8f 51 subi r24, 0x1F ; 31 ab7c: 90 4f sbci r25, 0xF0 ; 240 ab7e: 0f 94 93 a7 call 0x34f26 ; 0x34f26 ab82: 9c 01 movw r18, r24 ab84: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 ab88: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 ab8c: 81 e0 ldi r24, 0x01 ; 1 ab8e: 23 2b or r18, r19 ab90: 09 f4 brne .+2 ; 0xab94 ab92: 80 e0 ldi r24, 0x00 ; 0 ab94: 08 95 ret 0000ab96 : 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)); }; ab96: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 ab9a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 ab9e: 4a e0 ldi r20, 0x0A ; 10 aba0: 50 e0 ldi r21, 0x00 ; 0 aba2: 70 e0 ldi r23, 0x00 ; 0 aba4: 60 e0 ldi r22, 0x00 ; 0 aba6: 01 96 adiw r24, 0x01 ; 1 aba8: 0f 94 c7 9c call 0x3398e ; 0x3398e abac: 86 2f mov r24, r22 abae: 08 95 ret 0000abb0 : // 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)); }; abb0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 abb4: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 abb8: 4a e0 ldi r20, 0x0A ; 10 abba: 50 e0 ldi r21, 0x00 ; 0 abbc: 70 e0 ldi r23, 0x00 ; 0 abbe: 60 e0 ldi r22, 0x00 ; 0 abc0: 01 96 adiw r24, 0x01 ; 1 abc2: 0f 94 c7 9c call 0x3398e ; 0x3398e abc6: cb 01 movw r24, r22 abc8: 08 95 ret 0000abca : #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 { abca: 0f 93 push r16 abcc: 1f 93 push r17 abce: cf 93 push r28 abd0: df 93 push r29 abd2: 8c 01 movw r16, r24 abd4: 86 2f mov r24, r22 abd6: ea 01 movw r28, r20 if (code_seen(code)) { abd8: 0e 94 b6 55 call 0xab6c ; 0xab6c abdc: 88 23 and r24, r24 abde: 19 f1 breq .+70 ; 0xac26 // Verify value is within allowed range int16_t temp = code_value_short(); abe0: 0e 94 d8 55 call 0xabb0 ; 0xabb0 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { abe4: 9c 01 movw r18, r24 abe6: 97 ff sbrs r25, 7 abe8: 03 c0 rjmp .+6 ; 0xabf0 abea: 31 95 neg r19 abec: 21 95 neg r18 abee: 31 09 sbc r19, r1 abf0: 25 36 cpi r18, 0x65 ; 101 abf2: 31 05 cpc r19, r1 abf4: 9c f0 brlt .+38 ; 0xac1c printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); abf6: 9f 93 push r25 abf8: 8f 93 push r24 abfa: 8a e5 ldi r24, 0x5A ; 90 abfc: 9e e9 ldi r25, 0x9E ; 158 abfe: 9f 93 push r25 ac00: 8f 93 push r24 ac02: 83 e4 ldi r24, 0x43 ; 67 ac04: 97 e7 ldi r25, 0x77 ; 119 ac06: 9f 93 push r25 ac08: 8f 93 push r24 ac0a: 0f 94 fe 9f call 0x33ffc ; 0x33ffc ac0e: 0f 90 pop r0 ac10: 0f 90 pop r0 ac12: 0f 90 pop r0 ac14: 0f 90 pop r0 ac16: 0f 90 pop r0 ac18: 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; ac1a: 80 e0 ldi r24, 0x00 ; 0 }; ac1c: df 91 pop r29 ac1e: cf 91 pop r28 ac20: 1f 91 pop r17 ac22: 0f 91 pop r16 ac24: 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) { ac26: f8 01 movw r30, r16 ac28: 80 81 ld r24, Z ac2a: 88 23 and r24, r24 ac2c: b1 f3 breq .-20 ; 0xac1a return (int8_t)eeprom_read_byte(eep_address); ac2e: ce 01 movw r24, r28 } return 0; }; ac30: df 91 pop r29 ac32: cf 91 pop r28 ac34: 1f 91 pop r17 ac36: 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); ac38: 0d 94 3c a1 jmp 0x34278 ; 0x34278 0000ac3c : // 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); } ac3c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 ac40: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 ac44: 4a e0 ldi r20, 0x0A ; 10 ac46: 50 e0 ldi r21, 0x00 ; 0 ac48: 70 e0 ldi r23, 0x00 ; 0 ac4a: 60 e0 ldi r22, 0x00 ; 0 ac4c: 01 96 adiw r24, 0x01 ; 1 ac4e: 0d 94 c7 9c jmp 0x3398e ; 0x3398e 0000ac52 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ac52: 60 e0 ldi r22, 0x00 ; 0 ac54: 86 e6 ldi r24, 0x66 ; 102 ac56: 9f e0 ldi r25, 0x0F ; 15 ac58: 0f 94 60 a1 call 0x342c0 ; 0x342c0 ac5c: 60 e0 ldi r22, 0x00 ; 0 ac5e: 88 e6 ldi r24, 0x68 ; 104 ac60: 9f e0 ldi r25, 0x0F ; 15 ac62: 0f 94 60 a1 call 0x342c0 ; 0x342c0 ac66: 60 e0 ldi r22, 0x00 ; 0 ac68: 85 e6 ldi r24, 0x65 ; 101 ac6a: 9f e0 ldi r25, 0x0F ; 15 ac6c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 ac70: 60 e0 ldi r22, 0x00 ; 0 ac72: 84 e6 ldi r24, 0x64 ; 100 ac74: 9f e0 ldi r25, 0x0F ; 15 ac76: 0f 94 60 a1 call 0x342c0 ; 0x342c0 ac7a: 60 e0 ldi r22, 0x00 ; 0 ac7c: 82 ed ldi r24, 0xD2 ; 210 ac7e: 9e e0 ldi r25, 0x0E ; 14 ac80: 0f 94 60 a1 call 0x342c0 ; 0x342c0 ac84: 60 e0 ldi r22, 0x00 ; 0 ac86: 8f ec ldi r24, 0xCF ; 207 ac88: 9e e0 ldi r25, 0x0E ; 14 ac8a: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0000ac8e : // 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) ac8e: 80 36 cpi r24, 0x60 ; 96 ac90: 91 05 cpc r25, r1 ac92: f8 f4 brcc .+62 ; 0xacd2 return false; if (bufindr == bufindw && buflen > 0) ac94: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb ac98: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc ac9c: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> aca0: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> aca4: 42 17 cp r20, r18 aca6: 53 07 cpc r21, r19 aca8: 39 f4 brne .+14 ; 0xacb8 acaa: 60 91 cf 11 lds r22, 0x11CF ; 0x8011cf acae: 70 91 d0 11 lds r23, 0x11D0 ; 0x8011d0 acb2: 16 16 cp r1, r22 acb4: 17 06 cpc r1, r23 acb6: 6c f0 brlt .+26 ; 0xacd2 // 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); acb8: b9 01 movw r22, r18 acba: 68 0f add r22, r24 acbc: 79 1f adc r23, r25 acbe: fb 01 movw r30, r22 acc0: e3 59 subi r30, 0x93 ; 147 acc2: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) acc4: 24 17 cp r18, r20 acc6: 35 07 cpc r19, r21 acc8: 30 f4 brcc .+12 ; 0xacd6 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; acca: 81 e0 ldi r24, 0x01 ; 1 accc: 4e 17 cp r20, r30 acce: 5f 07 cpc r21, r31 acd0: 08 f4 brcc .+2 ; 0xacd4 // 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; acd2: 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; } acd4: 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? acd6: ee 3e cpi r30, 0xEE ; 238 acd8: f1 40 sbci r31, 0x01 ; 1 acda: f8 f0 brcs .+62 ; 0xad1a // 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); acdc: 6c 5f subi r22, 0xFC ; 252 acde: 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) || ace0: 6e 3e cpi r22, 0xEE ; 238 ace2: 71 40 sbci r23, 0x01 ; 1 ace4: 18 f4 brcc .+6 ; 0xacec // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ace6: 49 36 cpi r20, 0x69 ; 105 ace8: 51 05 cpc r21, r1 acea: b8 f4 brcc .+46 ; 0xad1a return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { acec: 83 59 subi r24, 0x93 ; 147 acee: 9f 4f sbci r25, 0xFF ; 255 acf0: 48 17 cp r20, r24 acf2: 59 07 cpc r21, r25 acf4: 70 f3 brcs .-36 ; 0xacd2 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); acf6: 4d ee ldi r20, 0xED ; 237 acf8: 51 e0 ldi r21, 0x01 ; 1 acfa: 42 1b sub r20, r18 acfc: 53 0b sbc r21, r19 acfe: 70 e0 ldi r23, 0x00 ; 0 ad00: 60 e0 ldi r22, 0x00 ; 0 ad02: c9 01 movw r24, r18 ad04: 82 52 subi r24, 0x22 ; 34 ad06: 90 4f sbci r25, 0xF0 ; 240 ad08: 0f 94 6e a7 call 0x34edc ; 0x34edc // 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; } ad0c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ad0e: f8 94 cli ad10: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> ad14: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ad18: 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; ad1a: 81 e0 ldi r24, 0x01 ; 1 ad1c: 08 95 ret 0000ad1e : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ad1e: 2f 92 push r2 ad20: 3f 92 push r3 ad22: 4f 92 push r4 ad24: 5f 92 push r5 ad26: 6f 92 push r6 ad28: 7f 92 push r7 ad2a: 8f 92 push r8 ad2c: 9f 92 push r9 ad2e: af 92 push r10 ad30: bf 92 push r11 ad32: cf 92 push r12 ad34: df 92 push r13 ad36: ef 92 push r14 ad38: ff 92 push r15 ad3a: 0f 93 push r16 ad3c: 1f 93 push r17 ad3e: cf 93 push r28 ad40: df 93 push r29 ad42: cd b7 in r28, 0x3d ; 61 ad44: de b7 in r29, 0x3e ; 62 ad46: cc 58 subi r28, 0x8C ; 140 ad48: d2 40 sbci r29, 0x02 ; 2 ad4a: 0f b6 in r0, 0x3f ; 63 ad4c: f8 94 cli ad4e: de bf out 0x3e, r29 ; 62 ad50: 0f be out 0x3f, r0 ; 63 ad52: cd bf out 0x3d, r28 ; 61 ad54: cb 58 subi r28, 0x8B ; 139 ad56: dd 4f sbci r29, 0xFD ; 253 ad58: 68 83 st Y, r22 ad5a: 79 83 std Y+1, r23 ; 0x01 ad5c: 8a 83 std Y+2, r24 ; 0x02 ad5e: 9b 83 std Y+3, r25 ; 0x03 ad60: c5 57 subi r28, 0x75 ; 117 ad62: 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; ad64: fe 01 movw r30, r28 ad66: e7 54 subi r30, 0x47 ; 71 ad68: fe 4f sbci r31, 0xFE ; 254 ad6a: 88 e2 ldi r24, 0x28 ; 40 ad6c: df 01 movw r26, r30 ad6e: 1d 92 st X+, r1 ad70: 8a 95 dec r24 ad72: e9 f7 brne .-6 ; 0xad6e ad74: e8 5b subi r30, 0xB8 ; 184 ad76: f1 40 sbci r31, 0x01 ; 1 ad78: 1f 01 movw r2, r30 ad7a: 80 e9 ldi r24, 0x90 ; 144 ad7c: 91 e0 ldi r25, 0x01 ; 1 ad7e: df 01 movw r26, r30 ad80: fc 01 movw r30, r24 ad82: 1d 92 st X+, r1 ad84: 31 97 sbiw r30, 0x01 ; 1 ad86: e9 f7 brne .-6 ; 0xad82 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; ad88: c7 5a subi r28, 0xA7 ; 167 ad8a: dd 4f sbci r29, 0xFD ; 253 ad8c: 19 82 std Y+1, r1 ; 0x01 ad8e: 18 82 st Y, r1 ad90: c9 55 subi r28, 0x59 ; 89 ad92: d2 40 sbci r29, 0x02 ; 2 ad94: 9e 01 movw r18, r28 ad96: 2f 51 subi r18, 0x1F ; 31 ad98: 3e 4f sbci r19, 0xFE ; 254 ad9a: c1 59 subi r28, 0x91 ; 145 ad9c: dd 4f sbci r29, 0xFD ; 253 ad9e: 39 83 std Y+1, r19 ; 0x01 ada0: 28 83 st Y, r18 ada2: cf 56 subi r28, 0x6F ; 111 ada4: d2 40 sbci r29, 0x02 ; 2 ada6: 8e 01 movw r16, r28 ada8: 07 5a subi r16, 0xA7 ; 167 adaa: 1d 4f sbci r17, 0xFD ; 253 adac: ce 01 movw r24, r28 adae: 8f 5c subi r24, 0xCF ; 207 adb0: 9d 4f sbci r25, 0xFD ; 253 adb2: c3 59 subi r28, 0x93 ; 147 adb4: dd 4f sbci r29, 0xFD ; 253 adb6: 99 83 std Y+1, r25 ; 0x01 adb8: 88 83 st Y, r24 adba: cd 56 subi r28, 0x6D ; 109 adbc: d2 40 sbci r29, 0x02 ; 2 adbe: 3c 01 movw r6, r24 adc0: 49 01 movw r8, r18 adc2: 40 eb ldi r20, 0xB0 ; 176 adc4: a4 2e mov r10, r20 adc6: 4f e0 ldi r20, 0x0F ; 15 adc8: b4 2e mov r11, r20 adca: 53 e2 ldi r21, 0x23 ; 35 adcc: c5 2e mov r12, r21 adce: d1 2c mov r13, r1 for (i = 0; i < n; i++) { add0: f1 2c mov r15, r1 add2: 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]; add4: b6 01 movw r22, r12 add6: 0d 2c mov r0, r13 add8: 00 0c add r0, r0 adda: 88 0b sbc r24, r24 addc: 99 0b sbc r25, r25 adde: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> ade2: d4 01 movw r26, r8 ade4: 6d 93 st X+, r22 ade6: 7d 93 st X+, r23 ade8: 8d 93 st X+, r24 adea: 9d 93 st X+, r25 adec: 4d 01 movw r8, r26 f[i] = (float)shift[i]; adee: f8 01 movw r30, r16 adf0: 61 91 ld r22, Z+ adf2: 71 91 ld r23, Z+ adf4: 8f 01 movw r16, r30 adf6: 07 2e mov r0, r23 adf8: 00 0c add r0, r0 adfa: 88 0b sbc r24, r24 adfc: 99 0b sbc r25, r25 adfe: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> ae02: d3 01 movw r26, r6 ae04: 6d 93 st X+, r22 ae06: 7d 93 st X+, r23 ae08: 8d 93 st X+, r24 ae0a: 9d 93 st X+, r25 ae0c: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { ae0e: bf ef ldi r27, 0xFF ; 255 ae10: eb 1a sub r14, r27 ae12: fb 0a sbc r15, r27 ae14: e6 e0 ldi r30, 0x06 ; 6 ae16: ee 16 cp r14, r30 ae18: f1 04 cpc r15, r1 ae1a: 09 f0 breq .+2 ; 0xae1e ae1c: 38 c3 rjmp .+1648 ; 0xb48e 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; ae1e: cb 58 subi r28, 0x8B ; 139 ae20: dd 4f sbci r29, 0xFD ; 253 ae22: 28 81 ld r18, Y ae24: 39 81 ldd r19, Y+1 ; 0x01 ae26: 4a 81 ldd r20, Y+2 ; 0x02 ae28: 5b 81 ldd r21, Y+3 ; 0x03 ae2a: c5 57 subi r28, 0x75 ; 117 ae2c: d2 40 sbci r29, 0x02 ; 2 ae2e: c1 59 subi r28, 0x91 ; 145 ae30: dd 4f sbci r29, 0xFD ; 253 ae32: a8 81 ld r26, Y ae34: b9 81 ldd r27, Y+1 ; 0x01 ae36: cf 56 subi r28, 0x6F ; 111 ae38: d2 40 sbci r29, 0x02 ; 2 ae3a: 6d 91 ld r22, X+ ae3c: 7d 91 ld r23, X+ ae3e: 8d 91 ld r24, X+ ae40: 9c 91 ld r25, X ae42: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> ae46: 41 2c mov r4, r1 ae48: 51 2c mov r5, r1 ae4a: 32 01 movw r6, r4 ae4c: 18 16 cp r1, r24 ae4e: 0c f4 brge .+2 ; 0xae52 ae50: 02 c3 rjmp .+1540 ; 0xb456 ae52: c3 59 subi r28, 0x93 ; 147 ae54: dd 4f sbci r29, 0xFD ; 253 ae56: 08 81 ld r16, Y ae58: 19 81 ldd r17, Y+1 ; 0x01 ae5a: cd 56 subi r28, 0x6D ; 109 ae5c: d2 40 sbci r29, 0x02 ; 2 ae5e: 0c 5e subi r16, 0xEC ; 236 ae60: 1f 4f sbci r17, 0xFF ; 255 ae62: c1 59 subi r28, 0x91 ; 145 ae64: dd 4f sbci r29, 0xFD ; 253 ae66: e8 80 ld r14, Y ae68: f9 80 ldd r15, Y+1 ; 0x01 ae6a: cf 56 subi r28, 0x6F ; 111 ae6c: d2 40 sbci r29, 0x02 ; 2 ae6e: b4 e1 ldi r27, 0x14 ; 20 ae70: eb 0e add r14, r27 ae72: f1 1c adc r15, r1 ae74: 6e 01 movw r12, r28 ae76: ef ed ldi r30, 0xDF ; 223 ae78: ce 1a sub r12, r30 ae7a: ed ef ldi r30, 0xFD ; 253 ae7c: de 0a sbc r13, r30 ae7e: 9e 01 movw r18, r28 ae80: 2b 55 subi r18, 0x5B ; 91 ae82: 3e 4f sbci r19, 0xFE ; 254 ae84: cf 58 subi r28, 0x8F ; 143 ae86: dd 4f sbci r29, 0xFD ; 253 ae88: 39 83 std Y+1, r19 ; 0x01 ae8a: 28 83 st Y, r18 ae8c: c1 57 subi r28, 0x71 ; 113 ae8e: 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]); ae90: d8 01 movw r26, r16 ae92: 4d 90 ld r4, X+ ae94: 5d 90 ld r5, X+ ae96: 6d 90 ld r6, X+ ae98: 7c 90 ld r7, X ae9a: f7 01 movw r30, r14 ae9c: 60 81 ld r22, Z ae9e: 71 81 ldd r23, Z+1 ; 0x01 aea0: 82 81 ldd r24, Z+2 ; 0x02 aea2: 93 81 ldd r25, Z+3 ; 0x03 aea4: d7 01 movw r26, r14 aea6: 5e 91 ld r21, -X aea8: 4e 91 ld r20, -X aeaa: 3e 91 ld r19, -X aeac: 2e 91 ld r18, -X aeae: 7d 01 movw r14, r26 aeb0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> aeb4: 4b 01 movw r8, r22 aeb6: 5c 01 movw r10, r24 aeb8: f8 01 movw r30, r16 aeba: 52 91 ld r21, -Z aebc: 42 91 ld r20, -Z aebe: 32 91 ld r19, -Z aec0: 22 91 ld r18, -Z aec2: 8f 01 movw r16, r30 aec4: c3 01 movw r24, r6 aec6: b2 01 movw r22, r4 aec8: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> aecc: a5 01 movw r20, r10 aece: 94 01 movw r18, r8 aed0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> aed4: d6 01 movw r26, r12 aed6: 9e 93 st -X, r25 aed8: 8e 93 st -X, r24 aeda: 7e 93 st -X, r23 aedc: 6e 93 st -X, r22 aede: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; aee0: cf 58 subi r28, 0x8F ; 143 aee2: dd 4f sbci r29, 0xFD ; 253 aee4: e8 81 ld r30, Y aee6: f9 81 ldd r31, Y+1 ; 0x01 aee8: c1 57 subi r28, 0x71 ; 113 aeea: d2 40 sbci r29, 0x02 ; 2 aeec: b2 92 st -Z, r11 aeee: a2 92 st -Z, r10 aef0: 92 92 st -Z, r9 aef2: 82 92 st -Z, r8 aef4: cf 58 subi r28, 0x8F ; 143 aef6: dd 4f sbci r29, 0xFD ; 253 aef8: f9 83 std Y+1, r31 ; 0x01 aefa: e8 83 st Y, r30 aefc: c1 57 subi r28, 0x71 ; 113 aefe: 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--) { af00: c3 59 subi r28, 0x93 ; 147 af02: dd 4f sbci r29, 0xFD ; 253 af04: 28 81 ld r18, Y af06: 39 81 ldd r19, Y+1 ; 0x01 af08: cd 56 subi r28, 0x6D ; 109 af0a: d2 40 sbci r29, 0x02 ; 2 af0c: 02 17 cp r16, r18 af0e: 13 07 cpc r17, r19 af10: 09 f0 breq .+2 ; 0xaf14 af12: be cf rjmp .-132 ; 0xae90 af14: 4e 01 movw r8, r28 af16: 3f e6 ldi r19, 0x6F ; 111 af18: 83 1a sub r8, r19 af1a: 3e ef ldi r19, 0xFE ; 254 af1c: 93 0a sbc r9, r19 af1e: 5e 01 movw r10, r28 af20: 83 ef ldi r24, 0xF3 ; 243 af22: a8 1a sub r10, r24 af24: 8d ef ldi r24, 0xFD ; 253 af26: b8 0a sbc r11, r24 af28: 61 01 movw r12, r2 af2a: 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 af4e: 9b 01 movw r18, r22 af50: ac 01 movw r20, r24 af52: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> af56: f8 01 movw r30, r16 af58: 64 a7 std Z+44, r22 ; 0x2c af5a: 75 a7 std Z+45, r23 ; 0x2d af5c: 86 a7 std Z+46, r24 ; 0x2e af5e: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { af60: f1 e0 ldi r31, 0x01 ; 1 af62: ef 16 cp r14, r31 af64: f1 04 cpc r15, r1 af66: 61 f0 breq .+24 ; 0xaf80 m[i][i - 1] = h[i - 1]; af68: d8 01 movw r26, r16 af6a: 98 96 adiw r26, 0x28 ; 40 af6c: 4d 92 st X+, r4 af6e: 5d 92 st X+, r5 af70: 6d 92 st X+, r6 af72: 7c 92 st X, r7 af74: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; af76: f8 01 movw r30, r16 af78: 44 82 std Z+4, r4 ; 0x04 af7a: 55 82 std Z+5, r5 ; 0x05 af7c: 66 82 std Z+6, r6 ; 0x06 af7e: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); af80: ff ef ldi r31, 0xFF ; 255 af82: ef 1a sub r14, r31 af84: ff 0a sbc r15, r31 af86: f5 01 movw r30, r10 af88: 20 81 ld r18, Z af8a: 31 81 ldd r19, Z+1 ; 0x01 af8c: 42 81 ldd r20, Z+2 ; 0x02 af8e: 53 81 ldd r21, Z+3 ; 0x03 af90: 84 e0 ldi r24, 0x04 ; 4 af92: a8 0e add r10, r24 af94: b1 1c adc r11, r1 af96: 64 81 ldd r22, Z+4 ; 0x04 af98: 75 81 ldd r23, Z+5 ; 0x05 af9a: 86 81 ldd r24, Z+6 ; 0x06 af9c: 97 81 ldd r25, Z+7 ; 0x07 af9e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> afa2: 20 e0 ldi r18, 0x00 ; 0 afa4: 30 e0 ldi r19, 0x00 ; 0 afa6: 40 ec ldi r20, 0xC0 ; 192 afa8: 50 e4 ldi r21, 0x40 ; 64 afaa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> afae: d6 01 movw r26, r12 afb0: dc 96 adiw r26, 0x3c ; 60 afb2: 6d 93 st X+, r22 afb4: 7d 93 st X+, r23 afb6: 8d 93 st X+, r24 afb8: 9c 93 st X, r25 afba: df 97 sbiw r26, 0x3f ; 63 afbc: 04 5d subi r16, 0xD4 ; 212 afbe: 1f 4f sbci r17, 0xFF ; 255 afc0: b8 e2 ldi r27, 0x28 ; 40 afc2: cb 0e add r12, r27 afc4: 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 afce: b1 cf rjmp .-158 ; 0xaf32 afd0: 7e 01 movw r14, r28 afd2: fd e2 ldi r31, 0x2D ; 45 afd4: ef 0e add r14, r31 afd6: f1 1c adc r15, r1 afd8: 28 e2 ldi r18, 0x28 ; 40 afda: a2 2e mov r10, r18 afdc: b1 2c mov r11, r1 afde: 00 eb ldi r16, 0xB0 ; 176 afe0: 1f ef ldi r17, 0xFF ; 255 afe2: 24 e0 ldi r18, 0x04 ; 4 afe4: 22 0e add r2, r18 afe6: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i b004: 2b 01 movw r4, r22 b006: 3c 01 movw r6, r24 b008: 61 01 movw r12, r2 b00a: c0 1a sub r12, r16 b00c: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) b00e: 88 24 eor r8, r8 b010: 83 94 inc r8 b012: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; b014: f6 01 movw r30, r12 b016: e0 0f add r30, r16 b018: f1 1f adc r31, r17 b01a: ea 0d add r30, r10 b01c: fb 1d adc r31, r11 b01e: 20 81 ld r18, Z b020: 31 81 ldd r19, Z+1 ; 0x01 b022: 42 81 ldd r20, Z+2 ; 0x02 b024: 53 81 ldd r21, Z+3 ; 0x03 b026: c3 01 movw r24, r6 b028: b2 01 movw r22, r4 b02a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b02e: 9b 01 movw r18, r22 b030: ac 01 movw r20, r24 b032: f6 01 movw r30, r12 b034: 60 81 ld r22, Z b036: 71 81 ldd r23, Z+1 ; 0x01 b038: 82 81 ldd r24, Z+2 ; 0x02 b03a: 93 81 ldd r25, Z+3 ; 0x03 b03c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b040: d6 01 movw r26, r12 b042: 6d 93 st X+, r22 b044: 7d 93 st X+, r23 b046: 8d 93 st X+, r24 b048: 9d 93 st X+, r25 b04a: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i b05a: 3c e2 ldi r19, 0x2C ; 44 b05c: e3 0e add r14, r19 b05e: f1 1c adc r15, r1 b060: 08 52 subi r16, 0x28 ; 40 b062: 11 09 sbc r17, r1 b064: 88 e2 ldi r24, 0x28 ; 40 b066: a8 0e add r10, r24 b068: 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 b072: ba cf rjmp .-140 ; 0xafe8 b074: 1e 01 movw r2, r28 b076: f5 eb ldi r31, 0xB5 ; 181 b078: 2f 0e add r2, r31 b07a: 31 1c adc r3, r1 b07c: 6e 01 movw r12, r28 b07e: 21 eb ldi r18, 0xB1 ; 177 b080: c2 0e add r12, r18 b082: d1 1c adc r13, r1 b084: 7e 01 movw r14, r28 b086: 37 e3 ldi r19, 0x37 ; 55 b088: e3 1a sub r14, r19 b08a: 3e ef ldi r19, 0xFE ; 254 b08c: 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--) { b08e: 04 e0 ldi r16, 0x04 ; 4 b090: 10 e0 ldi r17, 0x00 ; 0 b092: 48 01 movw r8, r16 b094: b1 2c mov r11, r1 b096: a1 2c mov r10, r1 sum = 0; b098: 41 2c mov r4, r1 b09a: 51 2c mov r5, r1 b09c: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; b09e: f6 01 movw r30, r12 b0a0: ea 0d add r30, r10 b0a2: fb 1d adc r31, r11 b0a4: d7 01 movw r26, r14 b0a6: aa 0d add r26, r10 b0a8: bb 1d adc r27, r11 b0aa: 2d 91 ld r18, X+ b0ac: 3d 91 ld r19, X+ b0ae: 4d 91 ld r20, X+ b0b0: 5c 91 ld r21, X b0b2: 60 81 ld r22, Z b0b4: 71 81 ldd r23, Z+1 ; 0x01 b0b6: 82 81 ldd r24, Z+2 ; 0x02 b0b8: 93 81 ldd r25, Z+3 ; 0x03 b0ba: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b0be: 9b 01 movw r18, r22 b0c0: ac 01 movw r20, r24 b0c2: c3 01 movw r24, r6 b0c4: b2 01 movw r22, r4 b0c6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b0ca: 2b 01 movw r4, r22 b0cc: 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++) b0ce: 8f ef ldi r24, 0xFF ; 255 b0d0: 88 1a sub r8, r24 b0d2: 98 0a sbc r9, r24 b0d4: 94 e0 ldi r25, 0x04 ; 4 b0d6: a9 0e add r10, r25 b0d8: b1 1c adc r11, r1 b0da: a5 e0 ldi r26, 0x05 ; 5 b0dc: 8a 16 cp r8, r26 b0de: 91 04 cpc r9, r1 b0e0: f1 f6 brne .-68 ; 0xb09e sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; b0e2: a3 01 movw r20, r6 b0e4: 92 01 movw r18, r4 b0e6: f1 01 movw r30, r2 b0e8: 60 81 ld r22, Z b0ea: 71 81 ldd r23, Z+1 ; 0x01 b0ec: 82 81 ldd r24, Z+2 ; 0x02 b0ee: 93 81 ldd r25, Z+3 ; 0x03 b0f0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b0f4: d6 01 movw r26, r12 b0f6: 2d 91 ld r18, X+ b0f8: 3d 91 ld r19, X+ b0fa: 4d 91 ld r20, X+ b0fc: 5c 91 ld r21, X b0fe: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> b102: f7 01 movw r30, r14 b104: 60 83 st Z, r22 b106: 71 83 std Z+1, r23 ; 0x01 b108: 82 83 std Z+2, r24 ; 0x02 b10a: 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--) { b10c: 01 50 subi r16, 0x01 ; 1 b10e: 11 09 sbc r17, r1 b110: f8 e2 ldi r31, 0x28 ; 40 b112: 2f 1a sub r2, r31 b114: 31 08 sbc r3, r1 b116: 2c e2 ldi r18, 0x2C ; 44 b118: c2 1a sub r12, r18 b11a: d1 08 sbc r13, r1 b11c: 34 e0 ldi r19, 0x04 ; 4 b11e: e3 1a sub r14, r19 b120: f1 08 sbc r15, r1 b122: 01 15 cp r16, r1 b124: 11 05 cpc r17, r1 b126: 09 f0 breq .+2 ; 0xb12a b128: b4 cf rjmp .-152 ; 0xb092 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { b12a: cb 50 subi r28, 0x0B ; 11 b12c: de 4f sbci r29, 0xFE ; 254 b12e: 88 81 ld r24, Y b130: 99 81 ldd r25, Y+1 ; 0x01 b132: aa 81 ldd r26, Y+2 ; 0x02 b134: bb 81 ldd r27, Y+3 ; 0x03 b136: c5 5f subi r28, 0xF5 ; 245 b138: d1 40 sbci r29, 0x01 ; 1 b13a: cf 57 subi r28, 0x7F ; 127 b13c: dd 4f sbci r29, 0xFD ; 253 b13e: 88 83 st Y, r24 b140: 99 83 std Y+1, r25 ; 0x01 b142: aa 83 std Y+2, r26 ; 0x02 b144: bb 83 std Y+3, r27 ; 0x03 b146: c1 58 subi r28, 0x81 ; 129 b148: d2 40 sbci r29, 0x02 ; 2 b14a: 1e 01 movw r2, r28 b14c: 97 e4 ldi r25, 0x47 ; 71 b14e: 29 1a sub r2, r25 b150: 9e ef ldi r25, 0xFE ; 254 b152: 39 0a sbc r3, r25 b154: 10 e0 ldi r17, 0x00 ; 0 b156: 00 e0 ldi r16, 0x00 ; 0 b158: c1 59 subi r28, 0x91 ; 145 b15a: dd 4f sbci r29, 0xFD ; 253 b15c: a8 81 ld r26, Y b15e: b9 81 ldd r27, Y+1 ; 0x01 b160: cf 56 subi r28, 0x6F ; 111 b162: d2 40 sbci r29, 0x02 ; 2 b164: cd 90 ld r12, X+ b166: dd 90 ld r13, X+ b168: ed 90 ld r14, X+ b16a: fd 90 ld r15, X+ b16c: c1 59 subi r28, 0x91 ; 145 b16e: dd 4f sbci r29, 0xFD ; 253 b170: b9 83 std Y+1, r27 ; 0x01 b172: a8 83 st Y, r26 b174: cf 56 subi r28, 0x6F ; 111 b176: d2 40 sbci r29, 0x02 ; 2 b178: cb 58 subi r28, 0x8B ; 139 b17a: dd 4f sbci r29, 0xFD ; 253 b17c: 28 81 ld r18, Y b17e: 39 81 ldd r19, Y+1 ; 0x01 b180: 4a 81 ldd r20, Y+2 ; 0x02 b182: 5b 81 ldd r21, Y+3 ; 0x03 b184: c5 57 subi r28, 0x75 ; 117 b186: d2 40 sbci r29, 0x02 ; 2 b188: c7 01 movw r24, r14 b18a: b6 01 movw r22, r12 b18c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b190: 18 16 cp r1, r24 b192: b4 f0 brlt .+44 ; 0xb1c0 b194: cb 58 subi r28, 0x8B ; 139 b196: dd 4f sbci r29, 0xFD ; 253 b198: 28 81 ld r18, Y b19a: 39 81 ldd r19, Y+1 ; 0x01 b19c: 4a 81 ldd r20, Y+2 ; 0x02 b19e: 5b 81 ldd r21, Y+3 ; 0x03 b1a0: c5 57 subi r28, 0x75 ; 117 b1a2: d2 40 sbci r29, 0x02 ; 2 b1a4: c1 59 subi r28, 0x91 ; 145 b1a6: dd 4f sbci r29, 0xFD ; 253 b1a8: e8 81 ld r30, Y b1aa: f9 81 ldd r31, Y+1 ; 0x01 b1ac: cf 56 subi r28, 0x6F ; 111 b1ae: d2 40 sbci r29, 0x02 ; 2 b1b0: 60 81 ld r22, Z b1b2: 71 81 ldd r23, Z+1 ; 0x01 b1b4: 82 81 ldd r24, Z+2 ; 0x02 b1b6: 93 81 ldd r25, Z+3 ; 0x03 b1b8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> b1bc: 87 ff sbrs r24, 7 b1be: 18 c0 rjmp .+48 ; 0xb1f0 b1c0: 04 30 cpi r16, 0x04 ; 4 b1c2: 11 05 cpc r17, r1 b1c4: 09 f0 breq .+2 ; 0xb1c8 b1c6: 30 c1 rjmp .+608 ; 0xb428 b1c8: cb 58 subi r28, 0x8B ; 139 b1ca: dd 4f sbci r29, 0xFD ; 253 b1cc: 28 81 ld r18, Y b1ce: 39 81 ldd r19, Y+1 ; 0x01 b1d0: 4a 81 ldd r20, Y+2 ; 0x02 b1d2: 5b 81 ldd r21, Y+3 ; 0x03 b1d4: c5 57 subi r28, 0x75 ; 117 b1d6: d2 40 sbci r29, 0x02 ; 2 b1d8: cf 57 subi r28, 0x7F ; 127 b1da: dd 4f sbci r29, 0xFD ; 253 b1dc: 68 81 ld r22, Y b1de: 79 81 ldd r23, Y+1 ; 0x01 b1e0: 8a 81 ldd r24, Y+2 ; 0x02 b1e2: 9b 81 ldd r25, Y+3 ; 0x03 b1e4: c1 58 subi r28, 0x81 ; 129 b1e6: d2 40 sbci r29, 0x02 ; 2 b1e8: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b1ec: 87 ff sbrs r24, 7 b1ee: 1c c1 rjmp .+568 ; 0xb428 a = (s[i + 1] - s[i]) / (6 * h[i]); b1f0: d1 01 movw r26, r2 b1f2: 14 96 adiw r26, 0x04 ; 4 b1f4: 8d 90 ld r8, X+ b1f6: 9d 90 ld r9, X+ b1f8: ad 90 ld r10, X+ b1fa: bc 90 ld r11, X b1fc: 17 97 sbiw r26, 0x07 ; 7 b1fe: 8d 91 ld r24, X+ b200: 9d 91 ld r25, X+ b202: 0d 90 ld r0, X+ b204: bc 91 ld r27, X b206: a0 2d mov r26, r0 b208: cf 58 subi r28, 0x8F ; 143 b20a: dd 4f sbci r29, 0xFD ; 253 b20c: 88 83 st Y, r24 b20e: 99 83 std Y+1, r25 ; 0x01 b210: aa 83 std Y+2, r26 ; 0x02 b212: bb 83 std Y+3, r27 ; 0x03 b214: c1 57 subi r28, 0x71 ; 113 b216: d2 40 sbci r29, 0x02 ; 2 b218: f8 01 movw r30, r16 b21a: ee 0f add r30, r30 b21c: ff 1f adc r31, r31 b21e: ee 0f add r30, r30 b220: ff 1f adc r31, r31 b222: 21 e9 ldi r18, 0x91 ; 145 b224: 31 e0 ldi r19, 0x01 ; 1 b226: 2c 0f add r18, r28 b228: 3d 1f adc r19, r29 b22a: e2 0f add r30, r18 b22c: f3 1f adc r31, r19 b22e: 40 80 ld r4, Z b230: 51 80 ldd r5, Z+1 ; 0x01 b232: 62 80 ldd r6, Z+2 ; 0x02 b234: 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; b236: c3 59 subi r28, 0x93 ; 147 b238: dd 4f sbci r29, 0xFD ; 253 b23a: a8 81 ld r26, Y b23c: b9 81 ldd r27, Y+1 ; 0x01 b23e: cd 56 subi r28, 0x6D ; 109 b240: d2 40 sbci r29, 0x02 ; 2 b242: 8d 91 ld r24, X+ b244: 9d 91 ld r25, X+ b246: 0d 90 ld r0, X+ b248: bc 91 ld r27, X b24a: a0 2d mov r26, r0 b24c: c3 58 subi r28, 0x83 ; 131 b24e: dd 4f sbci r29, 0xFD ; 253 b250: 88 83 st Y, r24 b252: 99 83 std Y+1, r25 ; 0x01 b254: aa 83 std Y+2, r26 ; 0x02 b256: bb 83 std Y+3, r27 ; 0x03 b258: cd 57 subi r28, 0x7D ; 125 b25a: 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; b25c: a7 01 movw r20, r14 b25e: 96 01 movw r18, r12 b260: cb 58 subi r28, 0x8B ; 139 b262: dd 4f sbci r29, 0xFD ; 253 b264: 68 81 ld r22, Y b266: 79 81 ldd r23, Y+1 ; 0x01 b268: 8a 81 ldd r24, Y+2 ; 0x02 b26a: 9b 81 ldd r25, Y+3 ; 0x03 b26c: c5 57 subi r28, 0x75 ; 117 b26e: d2 40 sbci r29, 0x02 ; 2 b270: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b274: 6b 01 movw r12, r22 b276: 7c 01 movw r14, r24 b278: 20 e0 ldi r18, 0x00 ; 0 b27a: 30 e0 ldi r19, 0x00 ; 0 b27c: 40 e4 ldi r20, 0x40 ; 64 b27e: 50 e4 ldi r21, 0x40 ; 64 b280: 0f 94 d4 a5 call 0x34ba8 ; 0x34ba8 b284: cb 57 subi r28, 0x7B ; 123 b286: dd 4f sbci r29, 0xFD ; 253 b288: 68 83 st Y, r22 b28a: 79 83 std Y+1, r23 ; 0x01 b28c: 8a 83 std Y+2, r24 ; 0x02 b28e: 9b 83 std Y+3, r25 ; 0x03 b290: c5 58 subi r28, 0x85 ; 133 b292: 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; b294: c3 58 subi r28, 0x83 ; 131 b296: dd 4f sbci r29, 0xFD ; 253 b298: 28 81 ld r18, Y b29a: 39 81 ldd r19, Y+1 ; 0x01 b29c: 4a 81 ldd r20, Y+2 ; 0x02 b29e: 5b 81 ldd r21, Y+3 ; 0x03 b2a0: cd 57 subi r28, 0x7D ; 125 b2a2: d2 40 sbci r29, 0x02 ; 2 b2a4: c3 59 subi r28, 0x93 ; 147 b2a6: dd 4f sbci r29, 0xFD ; 253 b2a8: e8 81 ld r30, Y b2aa: f9 81 ldd r31, Y+1 ; 0x01 b2ac: cd 56 subi r28, 0x6D ; 109 b2ae: d2 40 sbci r29, 0x02 ; 2 b2b0: 64 81 ldd r22, Z+4 ; 0x04 b2b2: 75 81 ldd r23, Z+5 ; 0x05 b2b4: 86 81 ldd r24, Z+6 ; 0x06 b2b6: 97 81 ldd r25, Z+7 ; 0x07 b2b8: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b2bc: a3 01 movw r20, r6 b2be: 92 01 movw r18, r4 b2c0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> b2c4: c7 58 subi r28, 0x87 ; 135 b2c6: dd 4f sbci r29, 0xFD ; 253 b2c8: 68 83 st Y, r22 b2ca: 79 83 std Y+1, r23 ; 0x01 b2cc: 8a 83 std Y+2, r24 ; 0x02 b2ce: 9b 83 std Y+3, r25 ; 0x03 b2d0: c9 57 subi r28, 0x79 ; 121 b2d2: d2 40 sbci r29, 0x02 ; 2 b2d4: a3 01 movw r20, r6 b2d6: 92 01 movw r18, r4 b2d8: c3 01 movw r24, r6 b2da: b2 01 movw r22, r4 b2dc: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b2e0: cf 58 subi r28, 0x8F ; 143 b2e2: dd 4f sbci r29, 0xFD ; 253 b2e4: 28 81 ld r18, Y b2e6: 39 81 ldd r19, Y+1 ; 0x01 b2e8: 4a 81 ldd r20, Y+2 ; 0x02 b2ea: 5b 81 ldd r21, Y+3 ; 0x03 b2ec: c1 57 subi r28, 0x71 ; 113 b2ee: d2 40 sbci r29, 0x02 ; 2 b2f0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b2f4: c7 57 subi r28, 0x77 ; 119 b2f6: dd 4f sbci r29, 0xFD ; 253 b2f8: 68 83 st Y, r22 b2fa: 79 83 std Y+1, r23 ; 0x01 b2fc: 8a 83 std Y+2, r24 ; 0x02 b2fe: 9b 83 std Y+3, r25 ; 0x03 b300: c9 58 subi r28, 0x89 ; 137 b302: d2 40 sbci r29, 0x02 ; 2 b304: a3 01 movw r20, r6 b306: 92 01 movw r18, r4 b308: c5 01 movw r24, r10 b30a: b4 01 movw r22, r8 b30c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b310: 9b 01 movw r18, r22 b312: ac 01 movw r20, r24 b314: c7 57 subi r28, 0x77 ; 119 b316: dd 4f sbci r29, 0xFD ; 253 b318: 68 81 ld r22, Y b31a: 79 81 ldd r23, Y+1 ; 0x01 b31c: 8a 81 ldd r24, Y+2 ; 0x02 b31e: 9b 81 ldd r25, Y+3 ; 0x03 b320: c9 58 subi r28, 0x89 ; 137 b322: d2 40 sbci r29, 0x02 ; 2 b324: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b328: 20 e0 ldi r18, 0x00 ; 0 b32a: 30 e0 ldi r19, 0x00 ; 0 b32c: 40 ec ldi r20, 0xC0 ; 192 b32e: 50 e4 ldi r21, 0x40 ; 64 b330: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> b334: 9b 01 movw r18, r22 b336: ac 01 movw r20, r24 b338: c7 58 subi r28, 0x87 ; 135 b33a: dd 4f sbci r29, 0xFD ; 253 b33c: 68 81 ld r22, Y b33e: 79 81 ldd r23, Y+1 ; 0x01 b340: 8a 81 ldd r24, Y+2 ; 0x02 b342: 9b 81 ldd r25, Y+3 ; 0x03 b344: c9 57 subi r28, 0x79 ; 121 b346: d2 40 sbci r29, 0x02 ; 2 b348: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__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; b34c: a7 01 movw r20, r14 b34e: 96 01 movw r18, r12 b350: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b354: c7 58 subi r28, 0x87 ; 135 b356: dd 4f sbci r29, 0xFD ; 253 b358: 68 83 st Y, r22 b35a: 79 83 std Y+1, r23 ; 0x01 b35c: 8a 83 std Y+2, r24 ; 0x02 b35e: 9b 83 std Y+3, r25 ; 0x03 b360: c9 57 subi r28, 0x79 ; 121 b362: 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]); b364: cf 58 subi r28, 0x8F ; 143 b366: dd 4f sbci r29, 0xFD ; 253 b368: 28 81 ld r18, Y b36a: 39 81 ldd r19, Y+1 ; 0x01 b36c: 4a 81 ldd r20, Y+2 ; 0x02 b36e: 5b 81 ldd r21, Y+3 ; 0x03 b370: c1 57 subi r28, 0x71 ; 113 b372: d2 40 sbci r29, 0x02 ; 2 b374: c5 01 movw r24, r10 b376: b4 01 movw r22, r8 b378: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b37c: 4b 01 movw r8, r22 b37e: 5c 01 movw r10, r24 b380: 20 e0 ldi r18, 0x00 ; 0 b382: 30 e0 ldi r19, 0x00 ; 0 b384: 40 ec ldi r20, 0xC0 ; 192 b386: 50 e4 ldi r21, 0x40 ; 64 b388: c3 01 movw r24, r6 b38a: b2 01 movw r22, r4 b38c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b390: 9b 01 movw r18, r22 b392: ac 01 movw r20, r24 b394: c5 01 movw r24, r10 b396: b4 01 movw r22, r8 b398: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__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; b39c: cb 57 subi r28, 0x7B ; 123 b39e: dd 4f sbci r29, 0xFD ; 253 b3a0: 28 81 ld r18, Y b3a2: 39 81 ldd r19, Y+1 ; 0x01 b3a4: 4a 81 ldd r20, Y+2 ; 0x02 b3a6: 5b 81 ldd r21, Y+3 ; 0x03 b3a8: c5 58 subi r28, 0x85 ; 133 b3aa: d2 40 sbci r29, 0x02 ; 2 b3ac: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b3b0: 4b 01 movw r8, r22 b3b2: 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; b3b4: 20 e0 ldi r18, 0x00 ; 0 b3b6: 30 e0 ldi r19, 0x00 ; 0 b3b8: 40 e0 ldi r20, 0x00 ; 0 b3ba: 5f e3 ldi r21, 0x3F ; 63 b3bc: cf 58 subi r28, 0x8F ; 143 b3be: dd 4f sbci r29, 0xFD ; 253 b3c0: 68 81 ld r22, Y b3c2: 79 81 ldd r23, Y+1 ; 0x01 b3c4: 8a 81 ldd r24, Y+2 ; 0x02 b3c6: 9b 81 ldd r25, Y+3 ; 0x03 b3c8: c1 57 subi r28, 0x71 ; 113 b3ca: d2 40 sbci r29, 0x02 ; 2 b3cc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b3d0: 2b 01 movw r4, r22 b3d2: 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; b3d4: a7 01 movw r20, r14 b3d6: 96 01 movw r18, r12 b3d8: c7 01 movw r24, r14 b3da: b6 01 movw r22, r12 b3dc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b3e0: 9b 01 movw r18, r22 b3e2: ac 01 movw r20, r24 b3e4: c3 01 movw r24, r6 b3e6: b2 01 movw r22, r4 b3e8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b3ec: 9b 01 movw r18, r22 b3ee: ac 01 movw r20, r24 b3f0: c5 01 movw r24, r10 b3f2: b4 01 movw r22, r8 b3f4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b3f8: 9b 01 movw r18, r22 b3fa: ac 01 movw r20, r24 b3fc: c7 58 subi r28, 0x87 ; 135 b3fe: dd 4f sbci r29, 0xFD ; 253 b400: 68 81 ld r22, Y b402: 79 81 ldd r23, Y+1 ; 0x01 b404: 8a 81 ldd r24, Y+2 ; 0x02 b406: 9b 81 ldd r25, Y+3 ; 0x03 b408: c9 57 subi r28, 0x79 ; 121 b40a: d2 40 sbci r29, 0x02 ; 2 b40c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b410: c3 58 subi r28, 0x83 ; 131 b412: dd 4f sbci r29, 0xFD ; 253 b414: 28 81 ld r18, Y b416: 39 81 ldd r19, Y+1 ; 0x01 b418: 4a 81 ldd r20, Y+2 ; 0x02 b41a: 5b 81 ldd r21, Y+3 ; 0x03 b41c: cd 57 subi r28, 0x7D ; 125 b41e: d2 40 sbci r29, 0x02 ; 2 b420: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b424: 2b 01 movw r4, r22 b426: 3c 01 movw r6, r24 b428: 0f 5f subi r16, 0xFF ; 255 b42a: 1f 4f sbci r17, 0xFF ; 255 b42c: f4 e0 ldi r31, 0x04 ; 4 b42e: 2f 0e add r2, r31 b430: 31 1c adc r3, r1 b432: c3 59 subi r28, 0x93 ; 147 b434: dd 4f sbci r29, 0xFD ; 253 b436: 28 81 ld r18, Y b438: 39 81 ldd r19, Y+1 ; 0x01 b43a: cd 56 subi r28, 0x6D ; 109 b43c: d2 40 sbci r29, 0x02 ; 2 b43e: 2c 5f subi r18, 0xFC ; 252 b440: 3f 4f sbci r19, 0xFF ; 255 b442: c3 59 subi r28, 0x93 ; 147 b444: dd 4f sbci r29, 0xFD ; 253 b446: 39 83 std Y+1, r19 ; 0x01 b448: 28 83 st Y, r18 b44a: cd 56 subi r28, 0x6D ; 109 b44c: 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 b454: 81 ce rjmp .-766 ; 0xb158 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } b456: c3 01 movw r24, r6 b458: b2 01 movw r22, r4 b45a: c4 57 subi r28, 0x74 ; 116 b45c: dd 4f sbci r29, 0xFD ; 253 b45e: 0f b6 in r0, 0x3f ; 63 b460: f8 94 cli b462: de bf out 0x3e, r29 ; 62 b464: 0f be out 0x3f, r0 ; 63 b466: cd bf out 0x3d, r28 ; 61 b468: df 91 pop r29 b46a: cf 91 pop r28 b46c: 1f 91 pop r17 b46e: 0f 91 pop r16 b470: ff 90 pop r15 b472: ef 90 pop r14 b474: df 90 pop r13 b476: cf 90 pop r12 b478: bf 90 pop r11 b47a: af 90 pop r10 b47c: 9f 90 pop r9 b47e: 8f 90 pop r8 b480: 7f 90 pop r7 b482: 6f 90 pop r6 b484: 5f 90 pop r5 b486: 4f 90 pop r4 b488: 3f 90 pop r3 b48a: 2f 90 pop r2 b48c: 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)); b48e: c5 01 movw r24, r10 b490: 0f 94 4a a1 call 0x34294 ; 0x34294 b494: d8 01 movw r26, r16 b496: 8d 93 st X+, r24 b498: 9c 93 st X, r25 b49a: b5 e0 ldi r27, 0x05 ; 5 b49c: cb 0e add r12, r27 b49e: d1 1c adc r13, r1 b4a0: e2 e0 ldi r30, 0x02 ; 2 b4a2: ae 0e add r10, r30 b4a4: b1 1c adc r11, r1 b4a6: 96 cc rjmp .-1748 ; 0xadd4 0000b4a8 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { b4a8: 0f 93 push r16 b4aa: 1f 93 push r17 b4ac: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) b4ae: 20 91 94 12 lds r18, 0x1294 ; 0x801294 b4b2: 21 30 cpi r18, 0x01 ; 1 b4b4: 79 f5 brne .+94 ; 0xb514 b4b6: 8c 01 movw r16, r24 b4b8: 80 e5 ldi r24, 0x50 ; 80 b4ba: 0e 94 b6 55 call 0xab6c ; 0xab6c b4be: 88 23 and r24, r24 b4c0: 49 f1 breq .+82 ; 0xb514 { mmuSlotIndex = code_value_uint8(); b4c2: 0e 94 cb 55 call 0xab96 ; 0xab96 b4c6: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { b4c8: 85 30 cpi r24, 0x05 ; 5 b4ca: 20 f5 brcc .+72 ; 0xb514 switch (gcode) b4cc: 01 3c cpi r16, 0xC1 ; 193 b4ce: 82 e0 ldi r24, 0x02 ; 2 b4d0: 18 07 cpc r17, r24 b4d2: 49 f0 breq .+18 ; 0xb4e6 b4d4: 02 3c cpi r16, 0xC2 ; 194 b4d6: 12 40 sbci r17, 0x02 ; 2 b4d8: 69 f0 breq .+26 ; 0xb4f4 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b4da: 8c 2f mov r24, r28 default: break; } } } } b4dc: cf 91 pop r28 b4de: 1f 91 pop r17 b4e0: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b4e2: 0d 94 0b 6c jmp 0x2d816 ; 0x2d816 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b4e6: 60 e0 ldi r22, 0x00 ; 0 b4e8: 8c 2f mov r24, r28 default: break; } } } } b4ea: cf 91 pop r28 b4ec: 1f 91 pop r17 b4ee: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b4f0: 0d 94 4e 6c jmp 0x2d89c ; 0x2d89c break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ b4f4: 8e ec ldi r24, 0xCE ; 206 b4f6: 9e e0 ldi r25, 0x0E ; 14 b4f8: 0f 94 3c a1 call 0x34278 ; 0x34278 b4fc: 88 23 and r24, r24 b4fe: 51 f0 breq .+20 ; 0xb514 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { b500: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 b504: 88 23 and r24, r24 b506: 31 f0 breq .+12 ; 0xb514 b508: 8c 2f mov r24, r28 default: break; } } } } b50a: cf 91 pop r28 b50c: 1f 91 pop r17 b50e: 0f 91 pop r16 b510: 0d 94 cb 6c jmp 0x2d996 ; 0x2d996 b514: cf 91 pop r28 b516: 1f 91 pop r17 b518: 0f 91 pop r16 b51a: 08 95 ret 0000b51c : #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);} b51c: 8f 92 push r8 b51e: 9f 92 push r9 b520: af 92 push r10 b522: bf 92 push r11 b524: cf 92 push r12 b526: df 92 push r13 b528: ef 92 push r14 b52a: ff 92 push r15 b52c: 0f 93 push r16 b52e: 1f 93 push r17 b530: cf 93 push r28 b532: df 93 push r29 b534: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 b538: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 b53c: 0f 5f subi r16, 0xFF ; 255 b53e: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b540: 68 01 movw r12, r16 b542: 8f ef ldi r24, 0xFF ; 255 b544: c8 1a sub r12, r24 b546: d8 0a sbc r13, r24 b548: d8 01 movw r26, r16 b54a: dc 91 ld r29, X } while (isspace(c)); b54c: 8d 2f mov r24, r29 b54e: 90 e0 ldi r25, 0x00 ; 0 b550: 0f 94 cd 9e call 0x33d9a ; 0x33d9a b554: 7c 01 movw r14, r24 b556: 89 2b or r24, r25 b558: 01 f5 brne .+64 ; 0xb59a flag = 0; if (c == '-') { b55a: dd 32 cpi r29, 0x2D ; 45 b55c: 01 f5 brne .+64 ; 0xb59e flag = FL_MINUS; c = *nptr++; b55e: 68 01 movw r12, r16 b560: b2 e0 ldi r27, 0x02 ; 2 b562: cb 0e add r12, r27 b564: d1 1c adc r13, r1 b566: f8 01 movw r30, r16 b568: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; b56a: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { b56c: 86 01 movw r16, r12 b56e: 01 50 subi r16, 0x01 ; 1 b570: 11 09 sbc r17, r1 b572: 43 e0 ldi r20, 0x03 ; 3 b574: 50 e0 ldi r21, 0x00 ; 0 b576: 6a ef ldi r22, 0xFA ; 250 b578: 76 e7 ldi r23, 0x76 ; 118 b57a: c8 01 movw r24, r16 b57c: 0f 94 03 9f call 0x33e06 ; 0x33e06 b580: 89 2b or r24, r25 b582: c1 f4 brne .+48 ; 0xb5b4 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; b584: 60 e0 ldi r22, 0x00 ; 0 b586: 70 e0 ldi r23, 0x00 ; 0 b588: 80 e8 ldi r24, 0x80 ; 128 b58a: 9f ef ldi r25, 0xFF ; 255 b58c: c1 11 cpse r28, r1 b58e: db c0 rjmp .+438 ; 0xb746 b590: 60 e0 ldi r22, 0x00 ; 0 b592: 70 e0 ldi r23, 0x00 ; 0 b594: 80 e8 ldi r24, 0x80 ; 128 b596: 9f e7 ldi r25, 0x7F ; 127 b598: d6 c0 rjmp .+428 ; 0xb746 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b59a: 86 01 movw r16, r12 b59c: d1 cf rjmp .-94 ; 0xb540 flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { b59e: db 32 cpi r29, 0x2B ; 43 b5a0: 39 f4 brne .+14 ; 0xb5b0 c = *nptr++; b5a2: 68 01 movw r12, r16 b5a4: f2 e0 ldi r31, 0x02 ; 2 b5a6: cf 0e add r12, r31 b5a8: d1 1c adc r13, r1 b5aa: d8 01 movw r26, r16 b5ac: 11 96 adiw r26, 0x01 ; 1 b5ae: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; b5b0: c0 e0 ldi r28, 0x00 ; 0 b5b2: dc cf rjmp .-72 ; 0xb56c 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)) { b5b4: 43 e0 ldi r20, 0x03 ; 3 b5b6: 50 e0 ldi r21, 0x00 ; 0 b5b8: 67 ef ldi r22, 0xF7 ; 247 b5ba: 76 e7 ldi r23, 0x76 ; 118 b5bc: c8 01 movw r24, r16 b5be: 0f 94 03 9f call 0x33e06 ; 0x33e06 b5c2: 89 2b or r24, r25 b5c4: 09 f4 brne .+2 ; 0xb5c8 b5c6: cc c0 rjmp .+408 ; 0xb760 b5c8: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; b5ca: 10 e0 ldi r17, 0x00 ; 0 b5cc: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; b5ce: 20 e0 ldi r18, 0x00 ; 0 b5d0: 30 e0 ldi r19, 0x00 ; 0 b5d2: a9 01 movw r20, r18 b5d4: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; b5d6: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { b5d8: da 30 cpi r29, 0x0A ; 10 b5da: 60 f5 brcc .+88 ; 0xb634 flag |= FL_ANY; b5dc: bc 2e mov r11, r28 b5de: 68 94 set b5e0: b1 f8 bld r11, 1 b5e2: 8c 2f mov r24, r28 b5e4: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { b5e6: c2 ff sbrs r28, 2 b5e8: 09 c0 rjmp .+18 ; 0xb5fc if (!(flag & FL_DOT)) b5ea: 81 11 cpse r24, r1 b5ec: 02 c0 rjmp .+4 ; 0xb5f2 exp += 1; b5ee: 0f 5f subi r16, 0xFF ; 255 b5f0: 1f 4f sbci r17, 0xFF ; 255 b5f2: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; b5f4: d6 01 movw r26, r12 b5f6: dc 91 ld r29, X b5f8: cb 2d mov r28, r11 b5fa: ec cf rjmp .-40 ; 0xb5d4 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) b5fc: 88 23 and r24, r24 b5fe: 11 f0 breq .+4 ; 0xb604 exp -= 1; b600: 01 50 subi r16, 0x01 ; 1 b602: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; b604: a5 e0 ldi r26, 0x05 ; 5 b606: b0 e0 ldi r27, 0x00 ; 0 b608: 0f 94 d1 a1 call 0x343a2 ; 0x343a2 <__muluhisi3> b60c: 9b 01 movw r18, r22 b60e: ac 01 movw r20, r24 b610: 22 0f add r18, r18 b612: 33 1f adc r19, r19 b614: 44 1f adc r20, r20 b616: 55 1f adc r21, r21 b618: 2d 0f add r18, r29 b61a: 31 1d adc r19, r1 b61c: 41 1d adc r20, r1 b61e: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) b620: 28 39 cpi r18, 0x98 ; 152 b622: b9 e9 ldi r27, 0x99 ; 153 b624: 3b 07 cpc r19, r27 b626: 4b 07 cpc r20, r27 b628: b9 e1 ldi r27, 0x19 ; 25 b62a: 5b 07 cpc r21, r27 b62c: 10 f3 brcs .-60 ; 0xb5f2 flag |= FL_OVFL; b62e: c6 60 ori r28, 0x06 ; 6 b630: bc 2e mov r11, r28 b632: df cf rjmp .-66 ; 0xb5f2 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { b634: de 3f cpi r29, 0xFE ; 254 b636: 31 f4 brne .+12 ; 0xb644 b638: c3 fd sbrc r28, 3 b63a: 33 c0 rjmp .+102 ; 0xb6a2 flag |= FL_DOT; b63c: bc 2e mov r11, r28 b63e: 68 94 set b640: b3 f8 bld r11, 3 b642: d7 cf rjmp .-82 ; 0xb5f2 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) b644: d5 33 cpi r29, 0x35 ; 53 b646: 69 f5 brne .+90 ; 0xb6a2 { int i; c = *nptr++; b648: 80 81 ld r24, Z i = 2; if (c == '-') { b64a: 8d 32 cpi r24, 0x2D ; 45 b64c: 31 f4 brne .+12 ; 0xb65a flag |= FL_MEXP; b64e: c0 61 ori r28, 0x10 ; 16 c = *nptr++; b650: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; b652: 6e 5f subi r22, 0xFE ; 254 b654: 7f 4f sbci r23, 0xFF ; 255 b656: 81 81 ldd r24, Z+1 ; 0x01 b658: 05 c0 rjmp .+10 ; 0xb664 b65a: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { b65c: 8b 32 cpi r24, 0x2B ; 43 b65e: c9 f3 breq .-14 ; 0xb652 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; b660: 6f 5f subi r22, 0xFF ; 255 b662: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; b664: 80 53 subi r24, 0x30 ; 48 if (c > 9) { b666: 8a 30 cpi r24, 0x0A ; 10 b668: e0 f4 brcc .+56 ; 0xb6a2 b66a: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) b66c: b0 e8 ldi r27, 0x80 ; 128 b66e: eb 16 cp r14, r27 b670: bc e0 ldi r27, 0x0C ; 12 b672: fb 06 cpc r15, r27 b674: 5c f4 brge .+22 ; 0xb68c i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ b676: b7 01 movw r22, r14 b678: 66 0f add r22, r22 b67a: 77 1f adc r23, r23 b67c: 66 0f add r22, r22 b67e: 77 1f adc r23, r23 b680: e6 0e add r14, r22 b682: f7 1e adc r15, r23 b684: ee 0c add r14, r14 b686: ff 1c adc r15, r15 b688: e8 0e add r14, r24 b68a: f1 1c adc r15, r1 c = *nptr++ - '0'; b68c: 81 91 ld r24, Z+ b68e: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); b690: 8a 30 cpi r24, 0x0A ; 10 b692: 60 f3 brcs .-40 ; 0xb66c if (flag & FL_MEXP) b694: c4 ff sbrs r28, 4 b696: 03 c0 rjmp .+6 ; 0xb69e i = -i; b698: f1 94 neg r15 b69a: e1 94 neg r14 b69c: f1 08 sbc r15, r1 exp += i; b69e: 0e 0d add r16, r14 b6a0: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ b6a2: ca 01 movw r24, r20 b6a4: b9 01 movw r22, r18 b6a6: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) b6aa: c3 70 andi r28, 0x03 ; 3 b6ac: c3 30 cpi r28, 0x03 ; 3 b6ae: 09 f4 brne .+2 ; 0xb6b2 x.flt = -x.flt; b6b0: 90 58 subi r25, 0x80 ; 128 b6b2: 4b 01 movw r8, r22 b6b4: 5c 01 movw r10, r24 if (x.flt != 0) { b6b6: 20 e0 ldi r18, 0x00 ; 0 b6b8: 30 e0 ldi r19, 0x00 ; 0 b6ba: a9 01 movw r20, r18 b6bc: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b6c0: 88 23 and r24, r24 b6c2: 09 f4 brne .+2 ; 0xb6c6 b6c4: 3e c0 rjmp .+124 ; 0xb742 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b6c6: c3 ef ldi r28, 0xF3 ; 243 b6c8: 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) { b6ca: 17 ff sbrs r17, 7 b6cc: 05 c0 rjmp .+10 ; 0xb6d8 nptr = (void*)(pwr_m10 + 5); exp = -exp; b6ce: 11 95 neg r17 b6d0: 01 95 neg r16 b6d2: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); b6d4: cb ed ldi r28, 0xDB ; 219 b6d6: d6 e7 ldi r29, 0x76 ; 118 b6d8: 6e 01 movw r12, r28 b6da: e8 e1 ldi r30, 0x18 ; 24 b6dc: ce 1a sub r12, r30 b6de: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b6e0: 80 e2 ldi r24, 0x20 ; 32 b6e2: e8 2e mov r14, r24 b6e4: f1 2c mov r15, r1 b6e6: 0d c0 rjmp .+26 ; 0xb702 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); b6e8: fe 01 movw r30, r28 b6ea: 25 91 lpm r18, Z+ b6ec: 35 91 lpm r19, Z+ b6ee: 45 91 lpm r20, Z+ b6f0: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b6f2: 0e 19 sub r16, r14 b6f4: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; b6f6: c5 01 movw r24, r10 b6f8: b4 01 movw r22, r8 b6fa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b6fe: 4b 01 movw r8, r22 b700: 5c 01 movw r10, r24 b702: d5 01 movw r26, r10 b704: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b706: 0e 15 cp r16, r14 b708: 1f 05 cpc r17, r15 b70a: 74 f7 brge .-36 ; 0xb6e8 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); b70c: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { b70e: f5 94 asr r15 b710: e7 94 ror r14 b712: cc 16 cp r12, r28 b714: dd 06 cpc r13, r29 b716: a9 f7 brne .-22 ; 0xb702 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( b718: 8a 2f mov r24, r26 b71a: 88 0f add r24, r24 b71c: 8b 2f mov r24, r27 b71e: 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) b720: 8f 3f cpi r24, 0xFF ; 255 b722: 49 f0 breq .+18 ; 0xb736 b724: 20 e0 ldi r18, 0x00 ; 0 b726: 30 e0 ldi r19, 0x00 ; 0 b728: a9 01 movw r20, r18 b72a: c5 01 movw r24, r10 b72c: b4 01 movw r22, r8 b72e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b732: 81 11 cpse r24, r1 b734: 06 c0 rjmp .+12 ; 0xb742 errno = ERANGE; b736: 82 e2 ldi r24, 0x22 ; 34 b738: 90 e0 ldi r25, 0x00 ; 0 b73a: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 b73e: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 } return x.flt; b742: c5 01 movw r24, r10 b744: b4 01 movw r22, r8 b746: df 91 pop r29 b748: cf 91 pop r28 b74a: 1f 91 pop r17 b74c: 0f 91 pop r16 b74e: ff 90 pop r15 b750: ef 90 pop r14 b752: df 90 pop r13 b754: cf 90 pop r12 b756: bf 90 pop r11 b758: af 90 pop r10 b75a: 9f 90 pop r9 b75c: 8f 90 pop r8 b75e: 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; b760: 60 e0 ldi r22, 0x00 ; 0 b762: 70 e0 ldi r23, 0x00 ; 0 b764: 80 ec ldi r24, 0xC0 ; 192 b766: 9f e7 ldi r25, 0x7F ; 127 b768: ee cf rjmp .-36 ; 0xb746 0000b76a : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { b76a: 2f 92 push r2 b76c: 3f 92 push r3 b76e: 4f 92 push r4 b770: 5f 92 push r5 b772: 6f 92 push r6 b774: 7f 92 push r7 b776: 8f 92 push r8 b778: 9f 92 push r9 b77a: af 92 push r10 b77c: bf 92 push r11 b77e: cf 92 push r12 b780: df 92 push r13 b782: ef 92 push r14 b784: ff 92 push r15 b786: 0f 93 push r16 b788: 1f 93 push r17 b78a: cf 93 push r28 b78c: df 93 push r29 b78e: cd b7 in r28, 0x3d ; 61 b790: de b7 in r29, 0x3e ; 62 b792: a1 97 sbiw r28, 0x21 ; 33 b794: 0f b6 in r0, 0x3f ; 63 b796: f8 94 cli b798: de bf out 0x3e, r29 ; 62 b79a: 0f be out 0x3f, r0 ; 63 b79c: cd bf out 0x3d, r28 ; 61 b79e: 84 ec ldi r24, 0xC4 ; 196 b7a0: 92 e0 ldi r25, 0x02 ; 2 b7a2: 9d 8f std Y+29, r25 ; 0x1d b7a4: 8c 8f std Y+28, r24 ; 0x1c b7a6: 85 ef ldi r24, 0xF5 ; 245 b7a8: 28 2e mov r2, r24 b7aa: 81 e1 ldi r24, 0x11 ; 17 b7ac: 38 2e mov r3, r24 b7ae: 03 e9 ldi r16, 0x93 ; 147 b7b0: 16 e0 ldi r17, 0x06 ; 6 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b7b2: 91 e0 ldi r25, 0x01 ; 1 b7b4: 9a 8f std Y+26, r25 ; 0x1a b7b6: 19 8e std Y+25, r1 ; 0x19 if(code_seen(axis_codes[i])) b7b8: ec 8d ldd r30, Y+28 ; 0x1c b7ba: fd 8d ldd r31, Y+29 ; 0x1d b7bc: 81 91 ld r24, Z+ b7be: fd 8f std Y+29, r31 ; 0x1d b7c0: ec 8f std Y+28, r30 ; 0x1c b7c2: 0e 94 b6 55 call 0xab6c ; 0xab6c b7c6: e8 2e mov r14, r24 b7c8: 88 23 and r24, r24 b7ca: 09 f4 brne .+2 ; 0xb7ce b7cc: 54 c1 rjmp .+680 ; 0xba76 { bool relative = axis_relative_modes & mask; b7ce: f0 90 eb 11 lds r15, 0x11EB ; 0x8011eb b7d2: fa 8d ldd r31, Y+26 ; 0x1a b7d4: ff 22 and r15, r31 destination[i] = code_value(); b7d6: 0e 94 8e 5a call 0xb51c ; 0xb51c b7da: 2b 01 movw r4, r22 b7dc: 3c 01 movw r6, r24 b7de: f8 01 movw r30, r16 b7e0: 40 82 st Z, r4 b7e2: 51 82 std Z+1, r5 ; 0x01 b7e4: 62 82 std Z+2, r6 ; 0x02 b7e6: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { b7e8: f9 8d ldd r31, Y+25 ; 0x19 b7ea: f3 30 cpi r31, 0x03 ; 3 b7ec: 09 f0 breq .+2 ; 0xb7f0 b7ee: 45 c0 rjmp .+138 ; 0xb87a 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; b7f0: dd 24 eor r13, r13 b7f2: d3 94 inc r13 b7f4: f1 10 cpse r15, r1 b7f6: 01 c0 rjmp .+2 ; 0xb7fa b7f8: d1 2c mov r13, r1 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; b7fa: 80 90 10 02 lds r8, 0x0210 ; 0x800210 b7fe: 90 90 11 02 lds r9, 0x0211 ; 0x800211 b802: a0 90 12 02 lds r10, 0x0212 ; 0x800212 b806: b0 90 13 02 lds r11, 0x0213 ; 0x800213 if (emult != 1.) { b80a: 20 e0 ldi r18, 0x00 ; 0 b80c: 30 e0 ldi r19, 0x00 ; 0 b80e: 40 e8 ldi r20, 0x80 ; 128 b810: 5f e3 ldi r21, 0x3F ; 63 b812: c5 01 movw r24, r10 b814: b4 01 movw r22, r8 b816: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b81a: 88 23 and r24, r24 b81c: 59 f1 breq .+86 ; 0xb874 if (! relative) { b81e: f1 10 cpse r15, r1 b820: 15 c0 rjmp .+42 ; 0xb84c destination[i] -= current_position[i]; b822: 20 91 01 12 lds r18, 0x1201 ; 0x801201 b826: 30 91 02 12 lds r19, 0x1202 ; 0x801202 b82a: 40 91 03 12 lds r20, 0x1203 ; 0x801203 b82e: 50 91 04 12 lds r21, 0x1204 ; 0x801204 b832: c3 01 movw r24, r6 b834: b2 01 movw r22, r4 b836: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> b83a: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f b83e: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 b842: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 b846: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 relative = true; b84a: de 2c mov r13, r14 } destination[i] *= emult; b84c: a5 01 movw r20, r10 b84e: 94 01 movw r18, r8 b850: 60 91 9f 06 lds r22, 0x069F ; 0x80069f b854: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 b858: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 b85c: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 b860: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> b864: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f b868: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 b86c: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 b870: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 } } if (relative) b874: d1 10 cpse r13, r1 b876: 03 c0 rjmp .+6 ; 0xb87e b878: 5f c0 rjmp .+190 ; 0xb938 b87a: ff 20 and r15, r15 b87c: 89 f0 breq .+34 ; 0xb8a0 destination[i] += current_position[i]; b87e: f1 01 movw r30, r2 b880: 20 81 ld r18, Z b882: 31 81 ldd r19, Z+1 ; 0x01 b884: 42 81 ldd r20, Z+2 ; 0x02 b886: 53 81 ldd r21, Z+3 ; 0x03 b888: f8 01 movw r30, r16 b88a: 60 81 ld r22, Z b88c: 71 81 ldd r23, Z+1 ; 0x01 b88e: 82 81 ldd r24, Z+2 ; 0x02 b890: 93 81 ldd r25, Z+3 ; 0x03 b892: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> b896: f8 01 movw r30, r16 b898: 60 83 st Z, r22 b89a: 71 83 std Z+1, r23 ; 0x01 b89c: 82 83 std Z+2, r24 ; 0x02 b89e: 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(); b8a0: f9 8d ldd r31, Y+25 ; 0x19 b8a2: f2 30 cpi r31, 0x02 ; 2 b8a4: d9 f5 brne .+118 ; 0xb91c b8a6: 80 91 89 03 lds r24, 0x0389 ; 0x800389 b8aa: 82 30 cpi r24, 0x02 ; 2 b8ac: 09 f0 breq .+2 ; 0xb8b0 b8ae: ee c0 rjmp .+476 ; 0xba8c 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; b8b0: 8c e0 ldi r24, 0x0C ; 12 b8b2: e0 ea ldi r30, 0xA0 ; 160 b8b4: f2 e0 ldi r31, 0x02 ; 2 b8b6: de 01 movw r26, r28 b8b8: 1d 96 adiw r26, 0x0d ; 13 b8ba: 01 90 ld r0, Z+ b8bc: 0d 92 st X+, r0 b8be: 8a 95 dec r24 b8c0: e1 f7 brne .-8 ; 0xb8ba float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT; b8c2: 8c e0 ldi r24, 0x0C ; 12 b8c4: ec ea ldi r30, 0xAC ; 172 b8c6: f2 e0 ldi r31, 0x02 ; 2 b8c8: de 01 movw r26, r28 b8ca: 11 96 adiw r26, 0x01 ; 1 b8cc: 01 90 ld r0, Z+ b8ce: 0d 92 st X+, r0 b8d0: 8a 95 dec r24 b8d2: e1 f7 brne .-8 ; 0xb8cc float tmp_motor[3]; //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { b8d4: c0 90 9b 06 lds r12, 0x069B ; 0x80069b b8d8: d0 90 9c 06 lds r13, 0x069C ; 0x80069c b8dc: e0 90 9d 06 lds r14, 0x069D ; 0x80069d b8e0: f0 90 9e 06 lds r15, 0x069E ; 0x80069e b8e4: 20 e0 ldi r18, 0x00 ; 0 b8e6: 30 e0 ldi r19, 0x00 ; 0 b8e8: a9 01 movw r20, r18 b8ea: c7 01 movw r24, r14 b8ec: b6 01 movw r22, r12 b8ee: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> b8f2: 87 ff sbrs r24, 7 b8f4: 52 c0 rjmp .+164 ; 0xb99a b8f6: ce 01 movw r24, r28 b8f8: 01 96 adiw r24, 0x01 ; 1 b8fa: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b8fc: d1 2c mov r13, r1 st_current_set(i, current_low[i]); b8fe: f7 01 movw r30, r14 b900: 61 91 ld r22, Z+ b902: 71 91 ld r23, Z+ b904: 81 91 ld r24, Z+ b906: 91 91 ld r25, Z+ b908: 7f 01 movw r14, r30 b90a: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> b90e: 8d 2d mov r24, r13 b910: 0f 94 ed 21 call 0x243da ; 0x243da //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b914: d3 94 inc r13 b916: f3 e0 ldi r31, 0x03 ; 3 b918: df 12 cpse r13, r31 b91a: f1 cf rjmp .-30 ; 0xb8fe } } #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) { b91c: f9 8d ldd r31, Y+25 ; 0x19 b91e: ff 5f subi r31, 0xFF ; 255 b920: f9 8f std Y+25, r31 ; 0x19 b922: 8a 8d ldd r24, Y+26 ; 0x1a b924: 88 0f add r24, r24 b926: 8a 8f std Y+26, r24 ; 0x1a b928: 94 e0 ldi r25, 0x04 ; 4 b92a: 29 0e add r2, r25 b92c: 31 1c adc r3, r1 b92e: 0c 5f subi r16, 0xFC ; 252 b930: 1f 4f sbci r17, 0xFF ; 255 b932: f4 30 cpi r31, 0x04 ; 4 b934: 09 f0 breq .+2 ; 0xb938 b936: 40 cf rjmp .-384 ; 0xb7b8 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')) { b938: 86 e4 ldi r24, 0x46 ; 70 b93a: 0e 94 b6 55 call 0xab6c ; 0xab6c b93e: 88 23 and r24, r24 b940: 99 f0 breq .+38 ; 0xb968 const float next_feedrate = code_value(); b942: 0e 94 8e 5a call 0xb51c ; 0xb51c b946: 6b 01 movw r12, r22 b948: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; b94a: 20 e0 ldi r18, 0x00 ; 0 b94c: 30 e0 ldi r19, 0x00 ; 0 b94e: a9 01 movw r20, r18 b950: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> b954: 18 16 cp r1, r24 b956: 44 f4 brge .+16 ; 0xb968 b958: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a b95c: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b b960: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c b964: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d } } b968: a1 96 adiw r28, 0x21 ; 33 b96a: 0f b6 in r0, 0x3f ; 63 b96c: f8 94 cli b96e: de bf out 0x3e, r29 ; 62 b970: 0f be out 0x3f, r0 ; 63 b972: cd bf out 0x3d, r28 ; 61 b974: df 91 pop r29 b976: cf 91 pop r28 b978: 1f 91 pop r17 b97a: 0f 91 pop r16 b97c: ff 90 pop r15 b97e: ef 90 pop r14 b980: df 90 pop r13 b982: cf 90 pop r12 b984: bf 90 pop r11 b986: af 90 pop r10 b988: 9f 90 pop r9 b98a: 8f 90 pop r8 b98c: 7f 90 pop r7 b98e: 6f 90 pop r6 b990: 5f 90 pop r5 b992: 4f 90 pop r4 b994: 3f 90 pop r3 b996: 2f 90 pop r2 b998: 08 95 ret /*MYSERIAL.print(int(i)); SERIAL_ECHOPGM(": "); MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { b99a: 20 e0 ldi r18, 0x00 ; 0 b99c: 30 e0 ldi r19, 0x00 ; 0 b99e: 48 e4 ldi r20, 0x48 ; 72 b9a0: 53 e4 ldi r21, 0x43 ; 67 b9a2: c7 01 movw r24, r14 b9a4: b6 01 movw r22, r12 b9a6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> b9aa: 18 16 cp r1, r24 b9ac: a4 f4 brge .+40 ; 0xb9d6 b9ae: ce 01 movw r24, r28 b9b0: 0d 96 adiw r24, 0x0d ; 13 b9b2: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b9b4: d1 2c mov r13, r1 st_current_set(i, current_high[i]); b9b6: f7 01 movw r30, r14 b9b8: 61 91 ld r22, Z+ b9ba: 71 91 ld r23, Z+ b9bc: 81 91 ld r24, Z+ b9be: 91 91 ld r25, Z+ b9c0: 7f 01 movw r14, r30 b9c2: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> b9c6: 8d 2d mov r24, r13 b9c8: 0f 94 ed 21 call 0x243da ; 0x243da MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b9cc: d3 94 inc r13 b9ce: f3 e0 ldi r31, 0x03 ; 3 b9d0: df 12 cpse r13, r31 b9d2: f1 cf rjmp .-30 ; 0xb9b6 b9d4: a3 cf rjmp .-186 ; 0xb91c b9d6: ce 01 movw r24, r28 b9d8: 01 96 adiw r24, 0x01 ; 1 b9da: 99 a3 std Y+33, r25 ; 0x21 b9dc: 88 a3 std Y+32, r24 ; 0x20 b9de: fe 01 movw r30, r28 b9e0: 3d 96 adiw r30, 0x0d ; 13 b9e2: ff 8f std Y+31, r31 ; 0x1f b9e4: ee 8f std Y+30, r30 ; 0x1e SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { b9e6: 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)); b9e8: e8 a1 ldd r30, Y+32 ; 0x20 b9ea: f9 a1 ldd r31, Y+33 ; 0x21 b9ec: c1 90 ld r12, Z+ b9ee: d1 90 ld r13, Z+ b9f0: e1 90 ld r14, Z+ b9f2: f1 90 ld r15, Z+ b9f4: f9 a3 std Y+33, r31 ; 0x21 b9f6: e8 a3 std Y+32, r30 ; 0x20 b9f8: ee 8d ldd r30, Y+30 ; 0x1e b9fa: ff 8d ldd r31, Y+31 ; 0x1f b9fc: 61 91 ld r22, Z+ b9fe: 71 91 ld r23, Z+ ba00: 81 91 ld r24, Z+ ba02: 91 91 ld r25, Z+ ba04: ff 8f std Y+31, r31 ; 0x1f ba06: ee 8f std Y+30, r30 ; 0x1e ba08: a7 01 movw r20, r14 ba0a: 96 01 movw r18, r12 ba0c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> ba10: 20 e0 ldi r18, 0x00 ; 0 ba12: 30 e0 ldi r19, 0x00 ; 0 ba14: 48 e4 ldi r20, 0x48 ; 72 ba16: 53 e4 ldi r21, 0x43 ; 67 ba18: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> ba1c: 4b 01 movw r8, r22 ba1e: 5c 01 movw r10, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; ba20: 20 91 9b 06 lds r18, 0x069B ; 0x80069b ba24: 30 91 9c 06 lds r19, 0x069C ; 0x80069c ba28: 40 91 9d 06 lds r20, 0x069D ; 0x80069d ba2c: 50 91 9e 06 lds r21, 0x069E ; 0x80069e ba30: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ba34: 2b 01 movw r4, r22 ba36: 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)); ba38: 20 e0 ldi r18, 0x00 ; 0 ba3a: 30 e0 ldi r19, 0x00 ; 0 ba3c: a9 01 movw r20, r18 ba3e: c5 01 movw r24, r10 ba40: b4 01 movw r22, r8 ba42: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ba46: 9b 01 movw r18, r22 ba48: ac 01 movw r20, r24 ba4a: c7 01 movw r24, r14 ba4c: b6 01 movw r22, r12 ba4e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> ba52: 9b 01 movw r18, r22 ba54: ac 01 movw r20, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; ba56: c3 01 movw r24, r6 ba58: b2 01 movw r22, r4 ba5a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> st_current_set(i, tmp_motor[i]); ba5e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> ba62: 8b 8d ldd r24, Y+27 ; 0x1b ba64: 0f 94 ed 21 call 0x243da ; 0x243da SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { ba68: fb 8d ldd r31, Y+27 ; 0x1b ba6a: ff 5f subi r31, 0xFF ; 255 ba6c: fb 8f std Y+27, r31 ; 0x1b ba6e: f3 30 cpi r31, 0x03 ; 3 ba70: 09 f0 breq .+2 ; 0xba74 ba72: ba cf rjmp .-140 ; 0xb9e8 ba74: 53 cf rjmp .-346 ; 0xb91c 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? ba76: f1 01 movw r30, r2 ba78: 80 81 ld r24, Z ba7a: 91 81 ldd r25, Z+1 ; 0x01 ba7c: a2 81 ldd r26, Z+2 ; 0x02 ba7e: b3 81 ldd r27, Z+3 ; 0x03 ba80: f8 01 movw r30, r16 ba82: 80 83 st Z, r24 ba84: 91 83 std Z+1, r25 ; 0x01 ba86: a2 83 std Z+2, r26 ; 0x02 ba88: b3 83 std Z+3, r27 ; 0x03 ba8a: 48 cf rjmp .-368 ; 0xb91c } } #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) { ba8c: ea 8d ldd r30, Y+26 ; 0x1a ba8e: ee 0f add r30, r30 ba90: ea 8f std Y+26, r30 ; 0x1a ba92: f4 e0 ldi r31, 0x04 ; 4 ba94: 2f 0e add r2, r31 ba96: 31 1c adc r3, r1 ba98: 0c 5f subi r16, 0xFC ; 252 ba9a: 1f 4f sbci r17, 0xFF ; 255 ba9c: 83 e0 ldi r24, 0x03 ; 3 ba9e: 89 8f std Y+25, r24 ; 0x19 baa0: 8b ce rjmp .-746 ; 0xb7b8 0000baa2 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); baa2: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> baa6: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> baaa: 90 e0 ldi r25, 0x00 ; 0 baac: 8a 30 cpi r24, 0x0A ; 10 baae: 20 f0 brcs .+8 ; 0xbab8 bab0: 89 5a subi r24, 0xA9 ; 169 bab2: 9f 4f sbci r25, 0xFF ; 255 bab4: 0d 94 a4 9f jmp 0x33f48 ; 0x33f48 bab8: c0 96 adiw r24, 0x30 ; 48 baba: fc cf rjmp .-8 ; 0xbab4 0000babc : 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); babc: 84 ff sbrs r24, 4 babe: 18 c0 rjmp .+48 ; 0xbaf0 bac0: 5a 9a sbi 0x0b, 2 ; 11 WRITE(LCD_PINS_D5, value & 0x20); bac2: 85 ff sbrs r24, 5 bac4: 17 c0 rjmp .+46 ; 0xbaf4 bac6: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); bac8: 2f b7 in r18, 0x3f ; 63 baca: 86 ff sbrs r24, 6 bacc: 15 c0 rjmp .+42 ; 0xbaf8 bace: f8 94 cli bad0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bad4: 90 68 ori r25, 0x80 ; 128 bad6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bada: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); badc: 87 ff sbrs r24, 7 bade: 11 c0 rjmp .+34 ; 0xbb02 bae0: 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); bae2: 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); bae4: 85 e0 ldi r24, 0x05 ; 5 bae6: 8a 95 dec r24 bae8: f1 f7 brne .-4 ; 0xbae6 baea: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); baec: 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(); } baee: 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); baf0: 5a 98 cbi 0x0b, 2 ; 11 baf2: e7 cf rjmp .-50 ; 0xbac2 WRITE(LCD_PINS_D5, value & 0x20); baf4: a4 98 cbi 0x14, 4 ; 20 baf6: e8 cf rjmp .-48 ; 0xbac8 WRITE(LCD_PINS_D6, value & 0x40); baf8: f8 94 cli bafa: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bafe: 9f 77 andi r25, 0x7F ; 127 bb00: ea cf rjmp .-44 ; 0xbad6 WRITE(LCD_PINS_D7, value & 0x80); bb02: a3 98 cbi 0x14, 3 ; 20 bb04: ee cf rjmp .-36 ; 0xbae2 0000bb06 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { bb06: 0f 93 push r16 bb08: 1f 93 push r17 bb0a: cf 93 push r28 bb0c: df 93 push r29 bb0e: c8 2f mov r28, r24 bb10: d6 2f mov r29, r22 bb12: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); bb14: 60 ff sbrs r22, 0 bb16: 15 c0 rjmp .+42 ; 0xbb42 bb18: 5d 9a sbi 0x0b, 5 ; 11 bb1a: 8a e1 ldi r24, 0x1A ; 26 bb1c: 8a 95 dec r24 bb1e: f1 f7 brne .-4 ; 0xbb1c bb20: 00 c0 rjmp .+0 ; 0xbb22 _delay_us(5); lcd_writebits(data); bb22: 8c 2f mov r24, r28 bb24: 0e 94 5e 5d call 0xbabc ; 0xbabc #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { bb28: d1 fd sbrc r29, 1 bb2a: 04 c0 rjmp .+8 ; 0xbb34 // _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 bb2c: 8c 2f mov r24, r28 bb2e: 82 95 swap r24 bb30: 0e 94 5e 5d call 0xbabc ; 0xbabc } #endif delayMicroseconds(duration); bb34: c8 01 movw r24, r16 } bb36: df 91 pop r29 bb38: cf 91 pop r28 bb3a: 1f 91 pop r17 bb3c: 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); bb3e: 0c 94 d6 bf jmp 0x17fac ; 0x17fac 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); bb42: 5d 98 cbi 0x0b, 5 ; 11 bb44: ea cf rjmp .-44 ; 0xbb1a 0000bb46 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { bb46: cf 92 push r12 bb48: df 92 push r13 bb4a: ef 92 push r14 bb4c: ff 92 push r15 bb4e: cf 93 push r28 bb50: df 93 push r29 bb52: ec 01 movw r28, r24 bb54: 6a 01 movw r12, r20 bb56: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) bb58: 0f 94 44 a1 call 0x34288 ; 0x34288 bb5c: 6f 3f cpi r22, 0xFF ; 255 bb5e: 7f 4f sbci r23, 0xFF ; 255 bb60: 8f 4f sbci r24, 0xFF ; 255 bb62: 9f 4f sbci r25, 0xFF ; 255 bb64: 59 f4 brne .+22 ; 0xbb7c 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); bb66: b7 01 movw r22, r14 bb68: a6 01 movw r20, r12 bb6a: 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); } bb6c: df 91 pop r29 bb6e: cf 91 pop r28 bb70: ff 90 pop r15 bb72: ef 90 pop r14 bb74: df 90 pop r13 bb76: 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); bb78: 0d 94 92 a1 jmp 0x34324 ; 0x34324 } 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); } bb7c: df 91 pop r29 bb7e: cf 91 pop r28 bb80: ff 90 pop r15 bb82: ef 90 pop r14 bb84: df 90 pop r13 bb86: cf 90 pop r12 bb88: 08 95 ret 0000bb8a : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { bb8a: 7f 92 push r7 bb8c: 8f 92 push r8 bb8e: 9f 92 push r9 bb90: af 92 push r10 bb92: bf 92 push r11 bb94: cf 92 push r12 bb96: df 92 push r13 bb98: ef 92 push r14 bb9a: ff 92 push r15 bb9c: 0f 93 push r16 bb9e: 1f 93 push r17 bba0: cf 93 push r28 bba2: df 93 push r29 bba4: cd b7 in r28, 0x3d ; 61 bba6: de b7 in r29, 0x3e ; 62 bba8: 60 97 sbiw r28, 0x10 ; 16 bbaa: 0f b6 in r0, 0x3f ; 63 bbac: f8 94 cli bbae: de bf out 0x3e, r29 ; 62 bbb0: 0f be out 0x3f, r0 ; 63 bbb2: cd bf out 0x3d, r28 ; 61 bbb4: 5c 01 movw r10, r24 bbb6: 6b 01 movw r12, r22 bbb8: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bbba: 81 e0 ldi r24, 0x01 ; 1 bbbc: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); bbc0: 1f 93 push r17 bbc2: 0f 93 push r16 bbc4: 1f 92 push r1 bbc6: 2f 93 push r18 bbc8: 8f e3 ldi r24, 0x3F ; 63 bbca: 94 e6 ldi r25, 0x64 ; 100 bbcc: 9f 93 push r25 bbce: 8f 93 push r24 bbd0: 0f 94 fe 9f call 0x33ffc ; 0x33ffc daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bbd4: 81 e4 ldi r24, 0x41 ; 65 bbd6: 0e 94 b6 55 call 0xab6c ; 0xab6c bbda: 0f 90 pop r0 bbdc: 0f 90 pop r0 bbde: 0f 90 pop r0 bbe0: 0f 90 pop r0 bbe2: 0f 90 pop r0 bbe4: 0f 90 pop r0 bbe6: 88 23 and r24, r24 bbe8: 89 f0 breq .+34 ; 0xbc0c addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bbea: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 bbee: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 bbf2: fc 01 movw r30, r24 bbf4: 21 81 ldd r18, Z+1 ; 0x01 bbf6: 28 37 cpi r18, 0x78 ; 120 bbf8: 09 f0 breq .+2 ; 0xbbfc bbfa: 56 c0 rjmp .+172 ; 0xbca8 bbfc: 40 e1 ldi r20, 0x10 ; 16 bbfe: 50 e0 ldi r21, 0x00 ; 0 bc00: 70 e0 ldi r23, 0x00 ; 0 bc02: 60 e0 ldi r22, 0x00 ; 0 bc04: 02 96 adiw r24, 0x02 ; 2 bc06: 0f 94 c7 9c call 0x3398e ; 0x3398e bc0a: 5b 01 movw r10, r22 if (code_seen('C')) bc0c: 83 e4 ldi r24, 0x43 ; 67 bc0e: 0e 94 b6 55 call 0xab6c ; 0xab6c bc12: 88 23 and r24, r24 bc14: 09 f4 brne .+2 ; 0xbc18 bc16: 4d c0 rjmp .+154 ; 0xbcb2 count = code_value_long(); bc18: 0e 94 1e 56 call 0xac3c ; 0xac3c bc1c: 4b 01 movw r8, r22 bc1e: 75 01 movw r14, r10 bc20: ca 14 cp r12, r10 bc22: db 04 cpc r13, r11 bc24: 08 f4 brcc .+2 ; 0xbc28 bc26: 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) bc28: c4 01 movw r24, r8 bc2a: 8e 0d add r24, r14 bc2c: 9f 1d adc r25, r15 bc2e: c8 16 cp r12, r24 bc30: d9 06 cpc r13, r25 bc32: 18 f0 brcs .+6 ; 0xbc3a bc34: 8e 15 cp r24, r14 bc36: 9f 05 cpc r25, r15 bc38: 18 f4 brcc .+6 ; 0xbc40 count = addr_end - addr_start; bc3a: 46 01 movw r8, r12 bc3c: 8e 18 sub r8, r14 bc3e: 9f 08 sbc r9, r15 if (code_seen('X')) bc40: 88 e5 ldi r24, 0x58 ; 88 bc42: 0e 94 b6 55 call 0xab6c ; 0xab6c bc46: 88 23 and r24, r24 bc48: 09 f4 brne .+2 ; 0xbc4c bc4a: 71 c0 rjmp .+226 ; 0xbd2e { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bc4c: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 bc50: 30 91 f6 16 lds r19, 0x16F6 ; 0x8016f6 bc54: 2f 5f subi r18, 0xFF ; 255 bc56: 3f 4f sbci r19, 0xFF ; 255 bc58: ce 01 movw r24, r28 bc5a: 01 96 adiw r24, 0x01 ; 1 bc5c: 5c 01 movw r10, r24 bc5e: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bc60: d1 2c mov r13, r1 bc62: c1 2c mov r12, r1 bc64: f9 01 movw r30, r18 while (*hex) bc66: 80 81 ld r24, Z bc68: 2f 5f subi r18, 0xFF ; 255 bc6a: 3f 4f sbci r19, 0xFF ; 255 bc6c: 88 23 and r24, r24 bc6e: b9 f1 breq .+110 ; 0xbcde { if (count && (parsed >= count)) break; bc70: 90 e1 ldi r25, 0x10 ; 16 bc72: c9 16 cp r12, r25 bc74: d1 04 cpc r13, r1 bc76: 99 f1 breq .+102 ; 0xbcde char c = *(hex++); if (c == ' ') continue; bc78: 80 32 cpi r24, 0x20 ; 32 bc7a: a1 f3 breq .-24 ; 0xbc64 if (c == '\n') break; bc7c: 8a 30 cpi r24, 0x0A ; 10 bc7e: 79 f1 breq .+94 ; 0xbcde uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bc80: 90 ed ldi r25, 0xD0 ; 208 bc82: 98 0f add r25, r24 bc84: 9a 30 cpi r25, 0x0A ; 10 bc86: c8 f4 brcc .+50 ; 0xbcba bc88: 82 95 swap r24 bc8a: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bc8c: 9f 01 movw r18, r30 bc8e: 2e 5f subi r18, 0xFE ; 254 bc90: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bc92: 91 81 ldd r25, Z+1 ; 0x01 bc94: 40 ed ldi r20, 0xD0 ; 208 bc96: 49 0f add r20, r25 bc98: 4a 30 cpi r20, 0x0A ; 10 bc9a: b8 f4 brcc .+46 ; 0xbcca bc9c: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bc9e: 8d 93 st X+, r24 parsed++; bca0: ef ef ldi r30, 0xFF ; 255 bca2: ce 1a sub r12, r30 bca4: de 0a sbc r13, r30 bca6: de cf rjmp .-68 ; 0xbc64 { 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(); bca8: 0e 94 8e 5a call 0xb51c ; 0xb51c bcac: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> bcb0: ac cf rjmp .-168 ; 0xbc0a 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 bcb2: 88 24 eor r8, r8 bcb4: 8a 94 dec r8 bcb6: 98 2c mov r9, r8 bcb8: b2 cf rjmp .-156 ; 0xbc1e 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); bcba: 9f e9 ldi r25, 0x9F ; 159 bcbc: 98 0f add r25, r24 bcbe: 96 30 cpi r25, 0x06 ; 6 bcc0: 58 f4 brcc .+22 ; 0xbcd8 bcc2: 82 95 swap r24 bcc4: 80 7f andi r24, 0xF0 ; 240 bcc6: 80 57 subi r24, 0x70 ; 112 bcc8: e1 cf rjmp .-62 ; 0xbc8c else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bcca: 4f e9 ldi r20, 0x9F ; 159 bccc: 49 0f add r20, r25 bcce: 46 30 cpi r20, 0x06 ; 6 bcd0: 18 f4 brcc .+6 ; 0xbcd8 bcd2: 97 55 subi r25, 0x57 ; 87 bcd4: 89 2b or r24, r25 bcd6: e3 cf rjmp .-58 ; 0xbc9e else return -parsed; bcd8: d1 94 neg r13 bcda: c1 94 neg r12 bcdc: 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++) bcde: 91 2c mov r9, r1 bce0: 81 2c mov r8, r1 bce2: c8 14 cp r12, r8 bce4: d9 04 cpc r13, r9 bce6: 91 f0 breq .+36 ; 0xbd0c bce8: f5 01 movw r30, r10 bcea: 61 91 ld r22, Z+ bcec: 5f 01 movw r10, r30 bcee: c4 01 movw r24, r8 bcf0: 8e 0d add r24, r14 bcf2: 9f 1d adc r25, r15 { switch (type) bcf4: f1 e0 ldi r31, 0x01 ; 1 bcf6: 7f 16 cp r7, r31 bcf8: 31 f0 breq .+12 ; 0xbd06 { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bcfa: fc 01 movw r30, r24 bcfc: 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++) bcfe: ff ef ldi r31, 0xFF ; 255 bd00: 8f 1a sub r8, r31 bd02: 9f 0a sbc r9, r31 bd04: ee cf rjmp .-36 ; 0xbce2 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); bd06: 0f 94 84 a1 call 0x34308 ; 0x34308 bd0a: f9 cf rjmp .-14 ; 0xbcfe 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); bd0c: ff 92 push r15 bd0e: ef 92 push r14 bd10: 1f 93 push r17 bd12: 0f 93 push r16 bd14: 9f 92 push r9 bd16: 8f 92 push r8 bd18: 85 e1 ldi r24, 0x15 ; 21 bd1a: 94 e6 ldi r25, 0x64 ; 100 bd1c: 9f 93 push r25 bd1e: 8f 93 push r24 bd20: 0f 94 fe 9f call 0x33ffc ; 0x33ffc bd24: 0f b6 in r0, 0x3f ; 63 bd26: f8 94 cli bd28: de bf out 0x3e, r29 ; 62 bd2a: 0f be out 0x3f, r0 ; 63 bd2c: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); bd2e: 47 2d mov r20, r7 bd30: b4 01 movw r22, r8 bd32: c7 01 movw r24, r14 } bd34: 60 96 adiw r28, 0x10 ; 16 bd36: 0f b6 in r0, 0x3f ; 63 bd38: f8 94 cli bd3a: de bf out 0x3e, r29 ; 62 bd3c: 0f be out 0x3f, r0 ; 63 bd3e: cd bf out 0x3d, r28 ; 61 bd40: df 91 pop r29 bd42: cf 91 pop r28 bd44: 1f 91 pop r17 bd46: 0f 91 pop r16 bd48: ff 90 pop r15 bd4a: ef 90 pop r14 bd4c: df 90 pop r13 bd4e: cf 90 pop r12 bd50: bf 90 pop r11 bd52: af 90 pop r10 bd54: 9f 90 pop r9 bd56: 8f 90 pop r8 bd58: 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); bd5a: 0d 94 42 53 jmp 0x2a684 ; 0x2a684 0000bd5e : /// 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)); bd5e: 80 e1 ldi r24, 0x10 ; 16 bd60: e5 ef ldi r30, 0xF5 ; 245 bd62: f1 e1 ldi r31, 0x11 ; 17 bd64: a0 e9 ldi r26, 0x90 ; 144 bd66: b2 e0 ldi r27, 0x02 ; 2 bd68: 01 90 ld r0, Z+ bd6a: 0d 92 st X+, r0 bd6c: 8a 95 dec r24 bd6e: e1 f7 brne .-8 ; 0xbd68 saved_feedmultiply2 = feedmultiply; //save feedmultiply bd70: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bd74: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bd78: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> bd7c: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); bd80: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 bd84: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 bd88: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 bd8c: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); bd90: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed bd94: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; bd98: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb bd9c: 83 fb bst r24, 3 bd9e: 88 27 eor r24, r24 bda0: 80 f9 bld r24, 0 bda2: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; bda6: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bdaa: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 isPartialBackupAvailable = true; } bdae: 08 95 ret 0000bdb0 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } bdb0: cf 93 push r28 bdb2: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { bdb4: 8a ef ldi r24, 0xFA ; 250 bdb6: 95 e1 ldi r25, 0x15 ; 21 bdb8: 0e 94 bc 70 call 0xe178 ; 0xe178 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader bdbc: 88 e3 ldi r24, 0x38 ; 56 bdbe: 94 e1 ldi r25, 0x14 ; 20 bdc0: 89 2b or r24, r25 bdc2: 51 f0 breq .+20 ; 0xbdd8 <_GLOBAL__sub_D_card+0x28> bdc4: ca e0 ldi r28, 0x0A ; 10 bdc6: d5 e1 ldi r29, 0x15 ; 21 bdc8: a3 97 sbiw r28, 0x23 ; 35 bdca: ce 01 movw r24, r28 bdcc: 0e 94 bc 70 call 0xe178 ; 0xe178 bdd0: 84 e1 ldi r24, 0x14 ; 20 bdd2: c8 33 cpi r28, 0x38 ; 56 bdd4: d8 07 cpc r29, r24 bdd6: c1 f7 brne .-16 ; 0xbdc8 <_GLOBAL__sub_D_card+0x18> bdd8: 85 e1 ldi r24, 0x15 ; 21 bdda: 94 e1 ldi r25, 0x14 ; 20 bddc: 0e 94 bc 70 call 0xe178 ; 0xe178 bde0: 80 ef ldi r24, 0xF0 ; 240 bde2: 93 e1 ldi r25, 0x13 ; 19 bde4: df 91 pop r29 bde6: cf 91 pop r28 bde8: 0c 94 bc 70 jmp 0xe178 ; 0xe178 0000bdec : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { bdec: cf 93 push r28 bdee: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; bdf0: c5 ef ldi r28, 0xF5 ; 245 bdf2: d1 e1 ldi r29, 0x11 ; 17 bdf4: 20 e0 ldi r18, 0x00 ; 0 bdf6: 30 e0 ldi r19, 0x00 ; 0 bdf8: 48 ec ldi r20, 0xC8 ; 200 bdfa: 51 e4 ldi r21, 0x41 ; 65 bdfc: 6c 85 ldd r22, Y+12 ; 0x0c bdfe: 7d 85 ldd r23, Y+13 ; 0x0d be00: 8e 85 ldd r24, Y+14 ; 0x0e be02: 9f 85 ldd r25, Y+15 ; 0x0f be04: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> be08: 6c 87 std Y+12, r22 ; 0x0c be0a: 7d 87 std Y+13, r23 ; 0x0d be0c: 8e 87 std Y+14, r24 ; 0x0e be0e: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); be10: 63 e3 ldi r22, 0x33 ; 51 be12: 73 e3 ldi r23, 0x33 ; 51 be14: 83 e5 ldi r24, 0x53 ; 83 be16: 90 e4 ldi r25, 0x40 ; 64 } be18: df 91 pop r29 be1a: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); be1c: 0d 94 d0 85 jmp 0x30ba0 ; 0x30ba0 0000be20 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); be20: 60 e0 ldi r22, 0x00 ; 0 be22: 85 ea ldi r24, 0xA5 ; 165 be24: 9f e0 ldi r25, 0x0F ; 15 be26: 0f 94 60 a1 call 0x342c0 ; 0x342c0 be2a: 60 e0 ldi r22, 0x00 ; 0 be2c: 8f e7 ldi r24, 0x7F ; 127 be2e: 9c e0 ldi r25, 0x0C ; 12 be30: 0f 94 60 a1 call 0x342c0 ; 0x342c0 // 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; be34: 80 e0 ldi r24, 0x00 ; 0 be36: 90 e0 ldi r25, 0x00 ; 0 be38: a0 e8 ldi r26, 0x80 ; 128 be3a: bf eb ldi r27, 0xBF ; 191 be3c: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e be40: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f be44: a0 93 80 02 sts 0x0280, r26 ; 0x800280 be48: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; be4c: 82 e0 ldi r24, 0x02 ; 2 be4e: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; be52: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 } be56: 08 95 ret 0000be58 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) be58: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef be5c: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 be60: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 be64: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 be68: 28 17 cp r18, r24 be6a: 39 07 cpc r19, r25 be6c: 71 f0 breq .+28 ; 0xbe8a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; be6e: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 be72: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; be76: 81 e0 ldi r24, 0x01 ; 1 be78: 80 93 99 03 sts 0x0399, r24 ; 0x800399 wait_for_heater(_millis(), active_extruder); be7c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c be80: 0f 94 f5 4e call 0x29dea ; 0x29dea heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; be84: 82 e0 ldi r24, 0x02 ; 2 be86: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } } be8a: 08 95 ret 0000be8c : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { be8c: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 be90: 88 23 and r24, r24 be92: 41 f0 breq .+16 ; 0xbea4 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; be94: 80 91 8e 02 lds r24, 0x028E ; 0x80028e be98: 90 91 8f 02 lds r25, 0x028F ; 0x80028f be9c: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> bea0: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> } bea4: 08 95 ret 0000bea6 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { bea6: cf 92 push r12 bea8: df 92 push r13 beaa: ef 92 push r14 beac: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); beae: c0 90 ca 04 lds r12, 0x04CA ; 0x8004ca beb2: d0 90 cb 04 lds r13, 0x04CB ; 0x8004cb beb6: e0 90 cc 04 lds r14, 0x04CC ; 0x8004cc beba: 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) { bebe: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 bec2: 88 23 and r24, r24 bec4: 09 f4 brne .+2 ; 0xbec8 bec6: 4e c0 rjmp .+156 ; 0xbf64 bec8: 20 e0 ldi r18, 0x00 ; 0 beca: 30 e0 ldi r19, 0x00 ; 0 becc: a9 01 movw r20, r18 bece: c7 01 movw r24, r14 bed0: b6 01 movw r22, r12 bed2: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> bed6: 18 16 cp r1, r24 bed8: 0c f0 brlt .+2 ; 0xbedc beda: 44 c0 rjmp .+136 ; 0xbf64 float area = M_PI * diameter * diameter * 0.25; bedc: 2b ed ldi r18, 0xDB ; 219 bede: 3f e0 ldi r19, 0x0F ; 15 bee0: 49 e4 ldi r20, 0x49 ; 73 bee2: 50 e4 ldi r21, 0x40 ; 64 bee4: c7 01 movw r24, r14 bee6: b6 01 movw r22, r12 bee8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> beec: a7 01 movw r20, r14 beee: 96 01 movw r18, r12 bef0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> bef4: 20 e0 ldi r18, 0x00 ; 0 bef6: 30 e0 ldi r19, 0x00 ; 0 bef8: 40 e8 ldi r20, 0x80 ; 128 befa: 5e e3 ldi r21, 0x3E ; 62 befc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> bf00: 9b 01 movw r18, r22 bf02: ac 01 movw r20, r24 out = 1.f / area; bf04: 60 e0 ldi r22, 0x00 ; 0 bf06: 70 e0 ldi r23, 0x00 ; 0 bf08: 80 e8 ldi r24, 0x80 ; 128 bf0a: 9f e3 ldi r25, 0x3F ; 63 bf0c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> bf10: 6b 01 movw r12, r22 bf12: 7c 01 movw r14, r24 } if (extrudemultiply != 100) bf14: 60 91 59 02 lds r22, 0x0259 ; 0x800259 bf18: 70 91 5a 02 lds r23, 0x025A ; 0x80025a bf1c: 64 36 cpi r22, 0x64 ; 100 bf1e: 71 05 cpc r23, r1 bf20: a1 f0 breq .+40 ; 0xbf4a out *= float(extrudemultiply) * 0.01f; bf22: 07 2e mov r0, r23 bf24: 00 0c add r0, r0 bf26: 88 0b sbc r24, r24 bf28: 99 0b sbc r25, r25 bf2a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> bf2e: 2a e0 ldi r18, 0x0A ; 10 bf30: 37 ed ldi r19, 0xD7 ; 215 bf32: 43 e2 ldi r20, 0x23 ; 35 bf34: 5c e3 ldi r21, 0x3C ; 60 bf36: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> bf3a: 9b 01 movw r18, r22 bf3c: ac 01 movw r20, r24 bf3e: c7 01 movw r24, r14 bf40: b6 01 movw r22, r12 bf42: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> bf46: 6b 01 movw r12, r22 bf48: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); bf4a: c0 92 10 02 sts 0x0210, r12 ; 0x800210 bf4e: d0 92 11 02 sts 0x0211, r13 ; 0x800211 bf52: e0 92 12 02 sts 0x0212, r14 ; 0x800212 bf56: 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 } bf5a: ff 90 pop r15 bf5c: ef 90 pop r14 bf5e: df 90 pop r13 bf60: cf 90 pop r12 bf62: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; bf64: c1 2c mov r12, r1 bf66: d1 2c mov r13, r1 bf68: 80 e8 ldi r24, 0x80 ; 128 bf6a: e8 2e mov r14, r24 bf6c: 8f e3 ldi r24, 0x3F ; 63 bf6e: f8 2e mov r15, r24 bf70: d1 cf rjmp .-94 ; 0xbf14 0000bf72 : } } #endif //FAST_PWM_FAN void save_statistics() { bf72: 8f 92 push r8 bf74: 9f 92 push r9 bf76: af 92 push r10 bf78: bf 92 push r11 bf7a: cf 92 push r12 bf7c: df 92 push r13 bf7e: ef 92 push r14 bf80: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter bf82: 81 ef ldi r24, 0xF1 ; 241 bf84: 9f e0 ldi r25, 0x0F ; 15 bf86: 0f 94 14 49 call 0x29228 ; 0x29228 bf8a: 6b 01 movw r12, r22 bf8c: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min bf8e: 8d ee ldi r24, 0xED ; 237 bf90: 9f e0 ldi r25, 0x0F ; 15 bf92: 0f 94 14 49 call 0x29228 ; 0x29228 bf96: 4b 01 movw r8, r22 bf98: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; bf9a: 0f 94 c4 1c call 0x23988 ; 0x23988 bf9e: 2c e3 ldi r18, 0x3C ; 60 bfa0: 30 e0 ldi r19, 0x00 ; 0 bfa2: 40 e0 ldi r20, 0x00 ; 0 bfa4: 50 e0 ldi r21, 0x00 ; 0 bfa6: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min bfaa: ba 01 movw r22, r20 bfac: a9 01 movw r20, r18 bfae: 48 0d add r20, r8 bfb0: 59 1d adc r21, r9 bfb2: 6a 1d adc r22, r10 bfb4: 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); bfb6: 8d ee ldi r24, 0xED ; 237 bfb8: 9f e0 ldi r25, 0x0F ; 15 bfba: 0f 94 72 a1 call 0x342e4 ; 0x342e4 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); bfbe: 60 91 84 06 lds r22, 0x0684 ; 0x800684 bfc2: 70 91 85 06 lds r23, 0x0685 ; 0x800685 bfc6: 80 91 86 06 lds r24, 0x0686 ; 0x800686 bfca: 90 91 87 06 lds r25, 0x0687 ; 0x800687 bfce: 28 ee ldi r18, 0xE8 ; 232 bfd0: 33 e0 ldi r19, 0x03 ; 3 bfd2: 40 e0 ldi r20, 0x00 ; 0 bfd4: 50 e0 ldi r21, 0x00 ; 0 bfd6: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> bfda: ba 01 movw r22, r20 bfdc: a9 01 movw r20, r18 bfde: 4c 0d add r20, r12 bfe0: 5d 1d adc r21, r13 bfe2: 6e 1d adc r22, r14 bfe4: 7f 1d adc r23, r15 bfe6: 81 ef ldi r24, 0xF1 ; 241 bfe8: 9f e0 ldi r25, 0x0F ; 15 bfea: 0f 94 72 a1 call 0x342e4 ; 0x342e4 print_job_timer.reset(); bfee: 0f 94 99 20 call 0x24132 ; 0x24132 total_filament_used = 0; bff2: 10 92 84 06 sts 0x0684, r1 ; 0x800684 bff6: 10 92 85 06 sts 0x0685, r1 ; 0x800685 bffa: 10 92 86 06 sts 0x0686, r1 ; 0x800686 bffe: 10 92 87 06 sts 0x0687, r1 ; 0x800687 if (MMU2::mmu2.Enabled()) { c002: 80 91 94 12 lds r24, 0x1294 ; 0x801294 c006: 81 30 cpi r24, 0x01 ; 1 c008: 81 f4 brne .+32 ; 0xc02a eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); c00a: 60 91 98 12 lds r22, 0x1298 ; 0x801298 c00e: 70 91 99 12 lds r23, 0x1299 ; 0x801299 c012: 90 e0 ldi r25, 0x00 ; 0 c014: 80 e0 ldi r24, 0x00 ; 0 c016: 0f 94 fc 48 call 0x291f8 ; 0x291f8 /// @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; }; c01a: 10 92 99 12 sts 0x1299, r1 ; 0x801299 c01e: 10 92 98 12 sts 0x1298, r1 ; 0x801298 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } c022: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b c026: 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 } } c02a: ff 90 pop r15 c02c: ef 90 pop r14 c02e: df 90 pop r13 c030: cf 90 pop r12 c032: bf 90 pop r11 c034: af 90 pop r10 c036: 9f 90 pop r9 c038: 8f 90 pop r8 c03a: 08 95 ret 0000c03c : } #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); c03c: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 c040: 1f 92 push r1 c042: 8f 93 push r24 c044: 80 91 40 03 lds r24, 0x0340 ; 0x800340 c048: 1f 92 push r1 c04a: 8f 93 push r24 c04c: e5 e8 ldi r30, 0x85 ; 133 c04e: f3 e0 ldi r31, 0x03 ; 3 c050: 42 81 ldd r20, Z+2 ; 0x02 c052: 53 81 ldd r21, Z+3 ; 0x03 c054: 2c e3 ldi r18, 0x3C ; 60 c056: 24 9f mul r18, r20 c058: c0 01 movw r24, r0 c05a: 25 9f mul r18, r21 c05c: 90 0d add r25, r0 c05e: 11 24 eor r1, r1 c060: 9f 93 push r25 c062: 8f 93 push r24 c064: 40 81 ld r20, Z c066: 51 81 ldd r21, Z+1 ; 0x01 c068: 24 9f mul r18, r20 c06a: c0 01 movw r24, r0 c06c: 25 9f mul r18, r21 c06e: 90 0d add r25, r0 c070: 11 24 eor r1, r1 c072: 9f 93 push r25 c074: 8f 93 push r24 c076: 86 ed ldi r24, 0xD6 ; 214 c078: 94 e6 ldi r25, 0x64 ; 100 c07a: 9f 93 push r25 c07c: 8f 93 push r24 c07e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc c082: 8d b7 in r24, 0x3d ; 61 c084: 9e b7 in r25, 0x3e ; 62 c086: 0a 96 adiw r24, 0x0a ; 10 c088: 0f b6 in r0, 0x3f ; 63 c08a: f8 94 cli c08c: 9e bf out 0x3e, r25 ; 62 c08e: 0f be out 0x3f, r0 ; 63 c090: 8d bf out 0x3d, r24 ; 61 } c092: 08 95 ret 0000c094 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); c094: 8a e4 ldi r24, 0x4A ; 74 c096: 93 e0 ldi r25, 0x03 ; 3 c098: 0d 94 fb 11 jmp 0x223f6 ; 0x223f6 ::start()> 0000c09c : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; c09c: 20 e0 ldi r18, 0x00 ; 0 c09e: 30 e0 ldi r19, 0x00 ; 0 c0a0: 40 e7 ldi r20, 0x70 ; 112 c0a2: 52 e4 ldi r21, 0x42 ; 66 c0a4: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> } c0a8: 08 95 ret 0000c0aa : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; c0aa: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> //! @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; c0ae: 40 91 3b 03 lds r20, 0x033B ; 0x80033b c0b2: 50 91 3c 03 lds r21, 0x033C ; 0x80033c c0b6: 60 91 3d 03 lds r22, 0x033D ; 0x80033d c0ba: 70 91 3e 03 lds r23, 0x033E ; 0x80033e c0be: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a c0c2: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b c0c6: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c c0ca: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; c0ce: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c0d2: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c0d6: 8a e4 ldi r24, 0x4A ; 74 c0d8: 93 e0 ldi r25, 0x03 ; 3 c0da: 0d 94 fb 11 jmp 0x223f6 ; 0x223f6 ::start()> 0000c0de : 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) { c0de: 1f 93 push r17 c0e0: cf 93 push r28 c0e2: df 93 push r29 c0e4: 18 2f mov r17, r24 saved_feedrate = feedrate; c0e6: 80 91 7a 02 lds r24, 0x027A ; 0x80027a c0ea: 90 91 7b 02 lds r25, 0x027B ; 0x80027b c0ee: a0 91 7c 02 lds r26, 0x027C ; 0x80027c c0f2: b0 91 7d 02 lds r27, 0x027D ; 0x80027d c0f6: 80 93 3b 03 sts 0x033B, r24 ; 0x80033b c0fa: 90 93 3c 03 sts 0x033C, r25 ; 0x80033c c0fe: a0 93 3d 03 sts 0x033D, r26 ; 0x80033d c102: b0 93 3e 03 sts 0x033E, r27 ; 0x80033e int l_feedmultiply = feedmultiply; c106: c0 91 8e 02 lds r28, 0x028E ; 0x80028e c10a: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; c10e: 84 e6 ldi r24, 0x64 ; 100 c110: 90 e0 ldi r25, 0x00 ; 0 c112: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c116: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c11a: 8a e4 ldi r24, 0x4A ; 74 c11c: 93 e0 ldi r25, 0x03 ; 3 c11e: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> c122: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(enable_endstops_now); return l_feedmultiply; } c126: ce 01 movw r24, r28 c128: df 91 pop r29 c12a: cf 91 pop r28 c12c: 1f 91 pop r17 c12e: 08 95 ret 0000c130 : 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) { c130: cf 92 push r12 c132: df 92 push r13 c134: ef 92 push r14 c136: ff 92 push r15 c138: 0f 93 push r16 c13a: 1f 93 push r17 c13c: cf 93 push r28 c13e: 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); c140: 90 e0 ldi r25, 0x00 ; 0 c142: ec 01 movw r28, r24 c144: cc 0f add r28, r28 c146: dd 1f adc r29, r29 c148: cc 0f add r28, r28 c14a: dd 1f adc r29, r29 c14c: fe 01 movw r30, r28 c14e: eb 5e subi r30, 0xEB ; 235 c150: f8 48 sbci r31, 0x88 ; 136 #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); c152: 25 91 lpm r18, Z+ c154: 35 91 lpm r19, Z+ c156: 45 91 lpm r20, Z+ c158: 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]; c15a: fe 01 movw r30, r28 c15c: e6 57 subi r30, 0x76 ; 118 c15e: fb 4f sbci r31, 0xFB ; 251 c160: c0 80 ld r12, Z c162: d1 80 ldd r13, Z+1 ; 0x01 c164: e2 80 ldd r14, Z+2 ; 0x02 c166: f3 80 ldd r15, Z+3 ; 0x03 c168: 8e 01 movw r16, r28 c16a: 0b 50 subi r16, 0x0B ; 11 c16c: 1e 4e sbci r17, 0xEE ; 238 c16e: c7 01 movw r24, r14 c170: b6 01 movw r22, r12 c172: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c176: f8 01 movw r30, r16 c178: 60 83 st Z, r22 c17a: 71 83 std Z+1, r23 ; 0x01 c17c: 82 83 std Z+2, r24 ; 0x02 c17e: 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); c180: fe 01 movw r30, r28 c182: e7 5f subi r30, 0xF7 ; 247 c184: f8 48 sbci r31, 0x88 ; 136 #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); c186: 25 91 lpm r18, Z+ c188: 35 91 lpm r19, Z+ c18a: 45 91 lpm r20, Z+ c18c: 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]; c18e: 8e 01 movw r16, r28 c190: 0c 5d subi r16, 0xDC ; 220 c192: 1d 4f sbci r17, 0xFD ; 253 c194: c7 01 movw r24, r14 c196: b6 01 movw r22, r12 c198: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c19c: f8 01 movw r30, r16 c19e: 60 83 st Z, r22 c1a0: 71 83 std Z+1, r23 ; 0x01 c1a2: 82 83 std Z+2, r24 ; 0x02 c1a4: 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); c1a6: fe 01 movw r30, r28 c1a8: e3 50 subi r30, 0x03 ; 3 c1aa: 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); c1ac: 25 91 lpm r18, Z+ c1ae: 35 91 lpm r19, Z+ c1b0: 45 91 lpm r20, Z+ c1b2: 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]; c1b4: c8 5e subi r28, 0xE8 ; 232 c1b6: dd 4f sbci r29, 0xFD ; 253 c1b8: c7 01 movw r24, r14 c1ba: b6 01 movw r22, r12 c1bc: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c1c0: 68 83 st Y, r22 c1c2: 79 83 std Y+1, r23 ; 0x01 c1c4: 8a 83 std Y+2, r24 ; 0x02 c1c6: 9b 83 std Y+3, r25 ; 0x03 } c1c8: df 91 pop r29 c1ca: cf 91 pop r28 c1cc: 1f 91 pop r17 c1ce: 0f 91 pop r16 c1d0: ff 90 pop r15 c1d2: ef 90 pop r14 c1d4: df 90 pop r13 c1d6: cf 90 pop r12 c1d8: 08 95 ret 0000c1da : c1da: 40 e0 ldi r20, 0x00 ; 0 c1dc: 50 e0 ldi r21, 0x00 ; 0 c1de: ba 01 movw r22, r20 c1e0: 8d ee ldi r24, 0xED ; 237 c1e2: 9f e0 ldi r25, 0x0F ; 15 c1e4: 0f 94 72 a1 call 0x342e4 ; 0x342e4 c1e8: 40 e0 ldi r20, 0x00 ; 0 c1ea: 50 e0 ldi r21, 0x00 ; 0 c1ec: ba 01 movw r22, r20 c1ee: 81 ef ldi r24, 0xF1 ; 241 c1f0: 9f e0 ldi r25, 0x0F ; 15 c1f2: 0f 94 72 a1 call 0x342e4 ; 0x342e4 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(); c1f6: 0e 94 29 56 call 0xac52 ; 0xac52 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); c1fa: 70 e0 ldi r23, 0x00 ; 0 c1fc: 60 e0 ldi r22, 0x00 ; 0 c1fe: 85 e0 ldi r24, 0x05 ; 5 c200: 9f e0 ldi r25, 0x0F ; 15 c202: 0f 94 7e a1 call 0x342fc ; 0x342fc c206: 70 e0 ldi r23, 0x00 ; 0 c208: 60 e0 ldi r22, 0x00 ; 0 c20a: 83 e0 ldi r24, 0x03 ; 3 c20c: 9f e0 ldi r25, 0x0F ; 15 c20e: 0f 94 7e a1 call 0x342fc ; 0x342fc c212: 70 e0 ldi r23, 0x00 ; 0 c214: 60 e0 ldi r22, 0x00 ; 0 c216: 81 e0 ldi r24, 0x01 ; 1 c218: 9f e0 ldi r25, 0x0F ; 15 c21a: 0f 94 7e a1 call 0x342fc ; 0x342fc c21e: 70 e0 ldi r23, 0x00 ; 0 c220: 60 e0 ldi r22, 0x00 ; 0 c222: 8f ef ldi r24, 0xFF ; 255 c224: 9e e0 ldi r25, 0x0E ; 14 c226: 0f 94 7e a1 call 0x342fc ; 0x342fc c22a: 70 e0 ldi r23, 0x00 ; 0 c22c: 60 e0 ldi r22, 0x00 ; 0 c22e: 83 ed ldi r24, 0xD3 ; 211 c230: 9e e0 ldi r25, 0x0E ; 14 c232: 0f 94 7e a1 call 0x342fc ; 0x342fc c236: 70 e0 ldi r23, 0x00 ; 0 c238: 60 e0 ldi r22, 0x00 ; 0 c23a: 80 ed ldi r24, 0xD0 ; 208 c23c: 9e e0 ldi r25, 0x0E ; 14 c23e: 0f 94 7e a1 call 0x342fc ; 0x342fc if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); c242: 40 e0 ldi r20, 0x00 ; 0 c244: 50 e0 ldi r21, 0x00 ; 0 c246: ba 01 movw r22, r20 c248: 88 ea ldi r24, 0xA8 ; 168 c24a: 9c e0 ldi r25, 0x0C ; 12 c24c: 0d 94 72 a1 jmp 0x342e4 ; 0x342e4 0000c250 : wdt_disable(); } } void softReset(void) { cli(); c250: 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" ); c252: 88 e1 ldi r24, 0x18 ; 24 c254: 9f e0 ldi r25, 0x0F ; 15 c256: 0f b6 in r0, 0x3f ; 63 c258: f8 94 cli c25a: a8 95 wdr c25c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c260: 0f be out 0x3f, r0 ; 63 c262: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c266: ff cf rjmp .-2 ; 0xc266 0000c268 : } #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); c268: 85 ea ldi r24, 0xA5 ; 165 c26a: 9f e0 ldi r25, 0x0F ; 15 c26c: 0f 94 3c a1 call 0x34278 ; 0x34278 c270: 91 e0 ldi r25, 0x01 ; 1 c272: 81 11 cpse r24, r1 c274: 01 c0 rjmp .+2 ; 0xc278 c276: 90 e0 ldi r25, 0x00 ; 0 } c278: 89 2f mov r24, r25 c27a: 08 95 ret 0000c27c : 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(); c27c: 80 91 9b 03 lds r24, 0x039B ; 0x80039b c280: 81 11 cpse r24, r1 c282: 06 c0 rjmp .+12 ; 0xc290 c284: 81 e0 ldi r24, 0x01 ; 1 c286: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c28a: 92 30 cpi r25, 0x02 ; 2 c28c: 09 f0 breq .+2 ; 0xc290 c28e: 80 e0 ldi r24, 0x00 ; 0 } c290: 08 95 ret 0000c292 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); c292: 80 91 6a 13 lds r24, 0x136A ; 0x80136a c296: 81 11 cpse r24, r1 c298: 0a c0 rjmp .+20 ; 0xc2ae c29a: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 c29e: 81 11 cpse r24, r1 c2a0: 06 c0 rjmp .+12 ; 0xc2ae c2a2: 81 e0 ldi r24, 0x01 ; 1 c2a4: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c2a8: 91 30 cpi r25, 0x01 ; 1 c2aa: 09 f0 breq .+2 ; 0xc2ae c2ac: 80 e0 ldi r24, 0x00 ; 0 } c2ae: 08 95 ret 0000c2b0 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { c2b0: cf 93 push r28 c2b2: df 93 push r29 return ( !homing_flag c2b4: c0 91 05 12 lds r28, 0x1205 ; 0x801205 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c2b8: c1 11 cpse r28, r1 c2ba: 1f c0 rjmp .+62 ; 0xc2fa && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag c2bc: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c2c0: 81 11 cpse r24, r1 c2c2: 1c c0 rjmp .+56 ; 0xc2fc && !printingIsPaused() c2c4: 0e 94 3e 61 call 0xc27c ; 0xc27c c2c8: 81 11 cpse r24, r1 c2ca: 18 c0 rjmp .+48 ; 0xc2fc && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c2cc: d0 91 c8 0d lds r29, 0x0DC8 ; 0x800dc8 c2d0: d4 30 cpi r29, 0x04 ; 4 c2d2: 61 f4 brne .+24 ; 0xc2ec c2d4: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 c2d8: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 c2dc: 89 2b or r24, r25 c2de: 91 f4 brne .+36 ; 0xc304 c2e0: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed c2e4: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee c2e8: 89 2b or r24, r25 c2ea: 61 f4 brne .+24 ; 0xc304 || printJobOngoing() c2ec: 0e 94 49 61 call 0xc292 ; 0xc292 c2f0: c8 2f mov r28, r24 c2f2: 81 11 cpse r24, r1 c2f4: 03 c0 rjmp .+6 ; 0xc2fc || lcd_commands_type == LcdCommands::Idle c2f6: c1 e0 ldi r28, 0x01 ; 1 c2f8: 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) c2fa: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } c2fc: 8c 2f mov r24, r28 c2fe: df 91 pop r29 c300: cf 91 pop r28 c302: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c304: c1 e0 ldi r28, 0x01 ; 1 c306: fa cf rjmp .-12 ; 0xc2fc 0000c308 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); c308: 0e 94 58 61 call 0xc2b0 ; 0xc2b0 c30c: 88 23 and r24, r24 c30e: 89 f0 breq .+34 ; 0xc332 c310: 20 e0 ldi r18, 0x00 ; 0 c312: 30 e0 ldi r19, 0x00 ; 0 c314: 40 e0 ldi r20, 0x00 ; 0 c316: 50 e4 ldi r21, 0x40 ; 64 c318: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd c31c: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe c320: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff c324: 90 91 00 12 lds r25, 0x1200 ; 0x801200 c328: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> c32c: 88 1f adc r24, r24 c32e: 88 27 eor r24, r24 c330: 88 1f adc r24, r24 } c332: 08 95 ret 0000c334 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() c334: 0e 94 49 61 call 0xc292 ; 0xc292 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; c338: 81 11 cpse r24, r1 c33a: 18 c0 rjmp .+48 ; 0xc36c return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() c33c: 0e 94 3e 61 call 0xc27c ; 0xc27c c340: 81 11 cpse r24, r1 c342: 14 c0 rjmp .+40 ; 0xc36c || saved_printing c344: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 c348: 81 11 cpse r24, r1 c34a: 10 c0 rjmp .+32 ; 0xc36c || (lcd_commands_type != LcdCommands::Idle) c34c: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 c350: 81 11 cpse r24, r1 c352: 0b c0 rjmp .+22 ; 0xc36a || MMU2::mmu2.MMU_PRINT_SAVED() c354: 80 91 95 12 lds r24, 0x1295 ; 0x801295 c358: 81 11 cpse r24, r1 c35a: 07 c0 rjmp .+14 ; 0xc36a || homing_flag c35c: 80 91 05 12 lds r24, 0x1205 ; 0x801205 c360: 81 11 cpse r24, r1 c362: 04 c0 rjmp .+8 ; 0xc36c || mesh_bed_leveling_flag; c364: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c368: 08 95 ret c36a: 81 e0 ldi r24, 0x01 ; 1 } c36c: 08 95 ret 0000c36e : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } c36e: 80 e1 ldi r24, 0x10 ; 16 c370: e5 ef ldi r30, 0xF5 ; 245 c372: f1 e1 ldi r31, 0x11 ; 17 c374: a3 e9 ldi r26, 0x93 ; 147 c376: b6 e0 ldi r27, 0x06 ; 6 c378: 01 90 ld r0, Z+ c37a: 0d 92 st X+, r0 c37c: 8a 95 dec r24 c37e: e1 f7 brne .-8 ; 0xc378 c380: 08 95 ret 0000c382 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { c382: 4f 92 push r4 c384: 5f 92 push r5 c386: 6f 92 push r6 c388: 7f 92 push r7 c38a: 8f 92 push r8 c38c: 9f 92 push r9 c38e: af 92 push r10 c390: bf 92 push r11 c392: cf 92 push r12 c394: df 92 push r13 c396: ef 92 push r14 c398: ff 92 push r15 c39a: 0f 93 push r16 c39c: 1f 93 push r17 c39e: cf 93 push r28 c3a0: df 93 push r29 c3a2: 00 d0 rcall .+0 ; 0xc3a4 c3a4: 00 d0 rcall .+0 ; 0xc3a6 c3a6: 1f 92 push r1 c3a8: 1f 92 push r1 c3aa: cd b7 in r28, 0x3d ; 61 c3ac: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; c3ae: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 c3b2: 22 23 and r18, r18 c3b4: 09 f4 brne .+2 ; 0xc3b8 c3b6: 73 c1 rjmp .+742 ; 0xc69e #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; c3b8: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c3bc: 22 30 cpi r18, 0x02 ; 2 c3be: 09 f4 brne .+2 ; 0xc3c2 c3c0: 6e c1 rjmp .+732 ; 0xc69e if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb c3c2: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c3c6: 21 30 cpi r18, 0x01 ; 1 c3c8: 11 f4 brne .+4 ; 0xc3ce c3ca: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c c3ce: 2b 01 movw r4, r22 c3d0: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; c3d2: 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) c3d6: 10 91 ec 11 lds r17, 0x11EC ; 0x8011ec c3da: 60 91 8a 03 lds r22, 0x038A ; 0x80038a c3de: 70 91 8b 03 lds r23, 0x038B ; 0x80038b c3e2: 80 91 8c 03 lds r24, 0x038C ; 0x80038c c3e6: 90 91 8d 03 lds r25, 0x038D ; 0x80038d c3ea: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> c3ee: 61 17 cp r22, r17 c3f0: 31 f0 breq .+12 ; 0xc3fe resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; c3f2: 81 2f mov r24, r17 c3f4: 90 e0 ldi r25, 0x00 ; 0 c3f6: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee c3fa: 80 93 ed 11 sts 0x11ED, r24 ; 0x8011ed setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); c3fe: 0e 94 2c 5f call 0xbe58 ; 0xbe58 // Restore saved fan speed fanSpeed = saved_fan_speed; c402: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 c406: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; c40a: 90 91 eb 11 lds r25, 0x11EB ; 0x8011eb c40e: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea c412: 81 95 neg r24 c414: 89 27 eor r24, r25 c416: 88 70 andi r24, 0x08 ; 8 c418: 89 27 eor r24, r25 c41a: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb float e = saved_pos[E_AXIS] - e_move; c41e: a3 01 movw r20, r6 c420: 92 01 movw r18, r4 c422: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c426: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c42a: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c42e: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c432: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> c436: 6d 83 std Y+5, r22 ; 0x05 c438: 7e 83 std Y+6, r23 ; 0x06 c43a: 8f 83 std Y+7, r24 ; 0x07 c43c: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); c43e: ce 01 movw r24, r28 c440: 05 96 adiw r24, 0x05 ; 5 c442: 0f 94 28 76 call 0x2ec50 ; 0x2ec50 #ifdef FANCHECK fans_check_enabled = false; c446: 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) c44a: 20 e0 ldi r18, 0x00 ; 0 c44c: 30 e0 ldi r19, 0x00 ; 0 c44e: 40 e8 ldi r20, 0x80 ; 128 c450: 5f eb ldi r21, 0xBF ; 191 c452: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c456: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c45a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c45e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c462: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> c466: 81 11 cpse r24, r1 c468: 20 c0 rjmp .+64 ; 0xc4aa { saved_pos[X_AXIS] = current_position[X_AXIS]; c46a: 80 91 f5 11 lds r24, 0x11F5 ; 0x8011f5 c46e: 90 91 f6 11 lds r25, 0x11F6 ; 0x8011f6 c472: a0 91 f7 11 lds r26, 0x11F7 ; 0x8011f7 c476: b0 91 f8 11 lds r27, 0x11F8 ; 0x8011f8 c47a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 c47e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 c482: a0 93 92 02 sts 0x0292, r26 ; 0x800292 c486: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; c48a: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 c48e: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa c492: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb c496: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc c49a: 80 93 94 02 sts 0x0294, r24 ; 0x800294 c49e: 90 93 95 02 sts 0x0295, r25 ; 0x800295 c4a2: a0 93 96 02 sts 0x0296, r26 ; 0x800296 c4a6: 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); c4aa: a3 01 movw r20, r6 c4ac: 92 01 movw r18, r4 c4ae: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c4b2: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c4b6: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c4ba: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c4be: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> c4c2: 69 83 std Y+1, r22 ; 0x01 c4c4: 7a 83 std Y+2, r23 ; 0x02 c4c6: 8b 83 std Y+3, r24 ; 0x03 c4c8: 9c 83 std Y+4, r25 ; 0x04 c4ca: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd c4ce: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe c4d2: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff c4d6: 10 91 00 12 lds r17, 0x1200 ; 0x801200 c4da: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c4de: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c4e2: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c4e6: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c4ea: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c4ee: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c4f2: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c4f6: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c4fa: 1f 92 push r1 c4fc: 1f 92 push r1 c4fe: 1f 92 push r1 c500: 1f 92 push r1 c502: e2 e6 ldi r30, 0x62 ; 98 c504: 8e 2e mov r8, r30 c506: e7 e2 ldi r30, 0x27 ; 39 c508: 9e 2e mov r9, r30 c50a: e6 e7 ldi r30, 0x76 ; 118 c50c: ae 2e mov r10, r30 c50e: e2 e4 ldi r30, 0x42 ; 66 c510: be 2e mov r11, r30 c512: fe 01 movw r30, r28 c514: 31 96 adiw r30, 0x01 ; 1 c516: 6f 01 movw r12, r30 c518: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 //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); c51c: a3 01 movw r20, r6 c51e: 92 01 movw r18, r4 c520: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c524: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c528: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c52c: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c530: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> c534: 69 83 std Y+1, r22 ; 0x01 c536: 7a 83 std Y+2, r23 ; 0x02 c538: 8b 83 std Y+3, r24 ; 0x03 c53a: 9c 83 std Y+4, r25 ; 0x04 c53c: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c540: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c544: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c548: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c54c: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c550: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c554: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c558: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c55c: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c560: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c564: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c568: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c56c: 1f 92 push r1 c56e: 1f 92 push r1 c570: 1f 92 push r1 c572: 1f 92 push r1 c574: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 //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); c578: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c57c: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c580: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c584: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c588: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c58c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c590: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c594: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c598: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c59c: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c5a0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c5a4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c5a8: 1f 92 push r1 c5aa: 1f 92 push r1 c5ac: 1f 92 push r1 c5ae: 1f 92 push r1 c5b0: 81 2c mov r8, r1 c5b2: 91 2c mov r9, r1 c5b4: f8 ee ldi r31, 0xE8 ; 232 c5b6: af 2e mov r10, r31 c5b8: f2 e4 ldi r31, 0x42 ; 66 c5ba: bf 2e mov r11, r31 c5bc: ac e9 ldi r26, 0x9C ; 156 c5be: ca 2e mov r12, r26 c5c0: a2 e0 ldi r26, 0x02 ; 2 c5c2: da 2e mov r13, r26 c5c4: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 st_synchronize(); c5c8: 0f 94 a0 22 call 0x24540 ; 0x24540 #ifdef FANCHECK fans_check_enabled = true; c5cc: 11 e0 ldi r17, 0x01 ; 1 c5ce: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; c5d2: 60 91 e2 11 lds r22, 0x11E2 ; 0x8011e2 c5d6: 70 91 e3 11 lds r23, 0x11E3 ; 0x8011e3 c5da: 90 e0 ldi r25, 0x00 ; 0 c5dc: 80 e0 ldi r24, 0x00 ; 0 c5de: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> c5e2: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a c5e6: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b c5ea: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c c5ee: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; c5f2: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> c5f6: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> c5fa: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c5fe: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); c602: 80 e1 ldi r24, 0x10 ; 16 c604: e0 e9 ldi r30, 0x90 ; 144 c606: f2 e0 ldi r31, 0x02 ; 2 c608: a5 ef ldi r26, 0xF5 ; 245 c60a: b1 e1 ldi r27, 0x11 ; 17 c60c: 01 90 ld r0, Z+ c60e: 0d 92 st X+, r0 c610: 8a 95 dec r24 c612: e1 f7 brne .-8 ; 0xc60c set_destination_to_current(); c614: 0e 94 b7 61 call 0xc36e ; 0xc36e //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing c618: 80 91 79 02 lds r24, 0x0279 ; 0x800279 c61c: 0f b6 in r0, 0x3f ; 63 c61e: f8 94 cli c620: de bf out 0x3e, r29 ; 62 c622: 0f be out 0x3f, r0 ; 63 c624: cd bf out 0x3d, r28 ; 61 c626: 81 11 cpse r24, r1 c628: 51 c0 rjmp .+162 ; 0xc6cc card.setIndex(saved_sdpos); c62a: 60 91 d8 11 lds r22, 0x11D8 ; 0x8011d8 c62e: 70 91 d9 11 lds r23, 0x11D9 ; 0x8011d9 c632: 80 91 da 11 lds r24, 0x11DA ; 0x8011da c636: 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);}; c63a: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e c63e: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f c642: 80 93 80 16 sts 0x1680, r24 ; 0x801680 c646: 90 93 81 16 sts 0x1681, r25 ; 0x801681 c64a: 0f 94 53 44 call 0x288a6 ; 0x288a6 sdpos_atomic = saved_sdpos; c64e: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c652: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c656: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c65a: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c65e: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc c662: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd c666: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de c66a: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df card.sdprinting = true; c66e: 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); c672: 60 e0 ldi r22, 0x00 ; 0 c674: 85 ea ldi r24, 0xA5 ; 165 c676: 9f e0 ldi r25, 0x0F ; 15 c678: 0f 94 60 a1 call 0x342c0 ; 0x342c0 c67c: 60 e0 ldi r22, 0x00 ; 0 c67e: 8f e7 ldi r24, 0x7F ; 127 c680: 9c e0 ldi r25, 0x0C ; 12 c682: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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); c686: 8b e0 ldi r24, 0x0B ; 11 c688: 9c e6 ldi r25, 0x6C ; 108 c68a: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c68e: 82 e0 ldi r24, 0x02 ; 2 c690: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c694: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 planner_aborted = true; // unroll the stack c698: 81 e0 ldi r24, 0x01 ; 1 c69a: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } c69e: 28 96 adiw r28, 0x08 ; 8 c6a0: 0f b6 in r0, 0x3f ; 63 c6a2: f8 94 cli c6a4: de bf out 0x3e, r29 ; 62 c6a6: 0f be out 0x3f, r0 ; 63 c6a8: cd bf out 0x3d, r28 ; 61 c6aa: df 91 pop r29 c6ac: cf 91 pop r28 c6ae: 1f 91 pop r17 c6b0: 0f 91 pop r16 c6b2: ff 90 pop r15 c6b4: ef 90 pop r14 c6b6: df 90 pop r13 c6b8: cf 90 pop r12 c6ba: bf 90 pop r11 c6bc: af 90 pop r10 c6be: 9f 90 pop r9 c6c0: 8f 90 pop r8 c6c2: 7f 90 pop r7 c6c4: 6f 90 pop r6 c6c6: 5f 90 pop r5 c6c8: 4f 90 pop r4 c6ca: 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 c6cc: 81 30 cpi r24, 0x01 ; 1 c6ce: 89 f6 brne .-94 ; 0xc672 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing c6d0: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c6d4: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c6d8: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c6dc: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c6e0: 80 93 d1 11 sts 0x11D1, r24 ; 0x8011d1 c6e4: 90 93 d2 11 sts 0x11D2, r25 ; 0x8011d2 c6e8: a0 93 d3 11 sts 0x11D3, r26 ; 0x8011d3 c6ec: b0 93 d4 11 sts 0x11D4, r27 ; 0x8011d4 serial_count = 0; c6f0: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb c6f4: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda FlushSerialRequestResend(); c6f8: 0e 94 6d 55 call 0xaada ; 0xaada c6fc: ba cf rjmp .-140 ; 0xc672 0000c6fe : 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) { c6fe: 3f 92 push r3 c700: 4f 92 push r4 c702: 5f 92 push r5 c704: 6f 92 push r6 c706: 7f 92 push r7 c708: 8f 92 push r8 c70a: 9f 92 push r9 c70c: af 92 push r10 c70e: bf 92 push r11 c710: cf 92 push r12 c712: df 92 push r13 c714: ef 92 push r14 c716: ff 92 push r15 c718: 0f 93 push r16 c71a: 1f 93 push r17 c71c: cf 93 push r28 c71e: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { c720: 30 90 dc 16 lds r3, 0x16DC ; 0x8016dc c724: 33 20 and r3, r3 c726: 09 f4 brne .+2 ; 0xc72a c728: 80 c0 rjmp .+256 ; 0xc82a c72a: 8b 01 movw r16, r22 c72c: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c72e: 31 fe sbrs r3, 1 c730: 54 c0 rjmp .+168 ; 0xc7da // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; c732: 88 80 ld r8, Y c734: 99 80 ldd r9, Y+1 ; 0x01 c736: aa 80 ldd r10, Y+2 ; 0x02 c738: bb 80 ldd r11, Y+3 ; 0x03 c73a: fb 01 movw r30, r22 c73c: c0 80 ld r12, Z c73e: d1 80 ldd r13, Z+1 ; 0x01 c740: e2 80 ldd r14, Z+2 ; 0x02 c742: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; c744: 20 91 b1 16 lds r18, 0x16B1 ; 0x8016b1 c748: 30 91 b2 16 lds r19, 0x16B2 ; 0x8016b2 c74c: 40 91 b3 16 lds r20, 0x16B3 ; 0x8016b3 c750: 50 91 b4 16 lds r21, 0x16B4 ; 0x8016b4 c754: c5 01 movw r24, r10 c756: b4 01 movw r22, r8 c758: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> c75c: 2b 01 movw r4, r22 c75e: 3c 01 movw r6, r24 c760: 20 91 b5 16 lds r18, 0x16B5 ; 0x8016b5 c764: 30 91 b6 16 lds r19, 0x16B6 ; 0x8016b6 c768: 40 91 b7 16 lds r20, 0x16B7 ; 0x8016b7 c76c: 50 91 b8 16 lds r21, 0x16B8 ; 0x8016b8 c770: c7 01 movw r24, r14 c772: b6 01 movw r22, r12 c774: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> c778: 9b 01 movw r18, r22 c77a: ac 01 movw r20, r24 c77c: c3 01 movw r24, r6 c77e: b2 01 movw r22, r4 c780: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c784: 2b 01 movw r4, r22 c786: 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; c788: 20 91 a9 16 lds r18, 0x16A9 ; 0x8016a9 c78c: 30 91 aa 16 lds r19, 0x16AA ; 0x8016aa c790: 40 91 ab 16 lds r20, 0x16AB ; 0x8016ab c794: 50 91 ac 16 lds r21, 0x16AC ; 0x8016ac c798: c5 01 movw r24, r10 c79a: b4 01 movw r22, r8 c79c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> c7a0: 4b 01 movw r8, r22 c7a2: 5c 01 movw r10, r24 c7a4: 20 91 ad 16 lds r18, 0x16AD ; 0x8016ad c7a8: 30 91 ae 16 lds r19, 0x16AE ; 0x8016ae c7ac: 40 91 af 16 lds r20, 0x16AF ; 0x8016af c7b0: 50 91 b0 16 lds r21, 0x16B0 ; 0x8016b0 c7b4: c7 01 movw r24, r14 c7b6: b6 01 movw r22, r12 c7b8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> c7bc: 9b 01 movw r18, r22 c7be: ac 01 movw r20, r24 c7c0: c5 01 movw r24, r10 c7c2: b4 01 movw r22, r8 c7c4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; c7c8: 68 83 st Y, r22 c7ca: 79 83 std Y+1, r23 ; 0x01 c7cc: 8a 83 std Y+2, r24 ; 0x02 c7ce: 9b 83 std Y+3, r25 ; 0x03 y = out_y; c7d0: f8 01 movw r30, r16 c7d2: 40 82 st Z, r4 c7d4: 51 82 std Z+1, r5 ; 0x01 c7d6: 62 82 std Z+2, r6 ; 0x02 c7d8: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { c7da: 30 fe sbrs r3, 0 c7dc: 26 c0 rjmp .+76 ; 0xc82a // Then add the offset. x += world2machine_shift[0]; c7de: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c7e2: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c7e6: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c7ea: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c7ee: 68 81 ld r22, Y c7f0: 79 81 ldd r23, Y+1 ; 0x01 c7f2: 8a 81 ldd r24, Y+2 ; 0x02 c7f4: 9b 81 ldd r25, Y+3 ; 0x03 c7f6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c7fa: 68 83 st Y, r22 c7fc: 79 83 std Y+1, r23 ; 0x01 c7fe: 8a 83 std Y+2, r24 ; 0x02 c800: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; c802: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c806: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c80a: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c80e: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c812: f8 01 movw r30, r16 c814: 60 81 ld r22, Z c816: 71 81 ldd r23, Z+1 ; 0x01 c818: 82 81 ldd r24, Z+2 ; 0x02 c81a: 93 81 ldd r25, Z+3 ; 0x03 c81c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> c820: f8 01 movw r30, r16 c822: 60 83 st Z, r22 c824: 71 83 std Z+1, r23 ; 0x01 c826: 82 83 std Z+2, r24 ; 0x02 c828: 93 83 std Z+3, r25 ; 0x03 } } } c82a: df 91 pop r29 c82c: cf 91 pop r28 c82e: 1f 91 pop r17 c830: 0f 91 pop r16 c832: ff 90 pop r15 c834: ef 90 pop r14 c836: df 90 pop r13 c838: cf 90 pop r12 c83a: bf 90 pop r11 c83c: af 90 pop r10 c83e: 9f 90 pop r9 c840: 8f 90 pop r8 c842: 7f 90 pop r7 c844: 6f 90 pop r6 c846: 5f 90 pop r5 c848: 4f 90 pop r4 c84a: 3f 90 pop r3 c84c: 08 95 ret 0000c84e : } } } inline bool world2machine_clamp(float &x, float &y) { c84e: 2f 92 push r2 c850: 3f 92 push r3 c852: 4f 92 push r4 c854: 5f 92 push r5 c856: 6f 92 push r6 c858: 7f 92 push r7 c85a: 8f 92 push r8 c85c: 9f 92 push r9 c85e: af 92 push r10 c860: bf 92 push r11 c862: cf 92 push r12 c864: df 92 push r13 c866: ef 92 push r14 c868: ff 92 push r15 c86a: 0f 93 push r16 c86c: 1f 93 push r17 c86e: cf 93 push r28 c870: df 93 push r29 c872: 00 d0 rcall .+0 ; 0xc874 c874: 00 d0 rcall .+0 ; 0xc876 c876: 1f 92 push r1 c878: 1f 92 push r1 c87a: cd b7 in r28, 0x3d ; 61 c87c: de b7 in r29, 0x3e ; 62 c87e: 8c 01 movw r16, r24 c880: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; c882: fc 01 movw r30, r24 c884: 80 81 ld r24, Z c886: 91 81 ldd r25, Z+1 ; 0x01 c888: a2 81 ldd r26, Z+2 ; 0x02 c88a: b3 81 ldd r27, Z+3 ; 0x03 c88c: 89 83 std Y+1, r24 ; 0x01 c88e: 9a 83 std Y+2, r25 ; 0x02 c890: ab 83 std Y+3, r26 ; 0x03 c892: bc 83 std Y+4, r27 ; 0x04 out_y = y; c894: fb 01 movw r30, r22 c896: 80 81 ld r24, Z c898: 91 81 ldd r25, Z+1 ; 0x01 c89a: a2 81 ldd r26, Z+2 ; 0x02 c89c: b3 81 ldd r27, Z+3 ; 0x03 c89e: 8d 83 std Y+5, r24 ; 0x05 c8a0: 9e 83 std Y+6, r25 ; 0x06 c8a2: af 83 std Y+7, r26 ; 0x07 c8a4: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); c8a6: be 01 movw r22, r28 c8a8: 6b 5f subi r22, 0xFB ; 251 c8aa: 7f 4f sbci r23, 0xFF ; 255 c8ac: ce 01 movw r24, r28 c8ae: 01 96 adiw r24, 0x01 ; 1 c8b0: 0e 94 7f 63 call 0xc6fe ; 0xc6fe inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { c8b4: c9 80 ldd r12, Y+1 ; 0x01 c8b6: da 80 ldd r13, Y+2 ; 0x02 c8b8: eb 80 ldd r14, Y+3 ; 0x03 c8ba: fc 80 ldd r15, Y+4 ; 0x04 c8bc: 20 e0 ldi r18, 0x00 ; 0 c8be: 30 e0 ldi r19, 0x00 ; 0 c8c0: a9 01 movw r20, r18 c8c2: c7 01 movw r24, r14 c8c4: b6 01 movw r22, r12 c8c6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> c8ca: 87 ff sbrs r24, 7 c8cc: 35 c0 rjmp .+106 ; 0xc938 tmpx = X_MIN_POS; c8ce: 19 82 std Y+1, r1 ; 0x01 c8d0: 1a 82 std Y+2, r1 ; 0x02 c8d2: 1b 82 std Y+3, r1 ; 0x03 c8d4: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; c8d6: ff 24 eor r15, r15 c8d8: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { c8da: 8d 80 ldd r8, Y+5 ; 0x05 c8dc: 9e 80 ldd r9, Y+6 ; 0x06 c8de: af 80 ldd r10, Y+7 ; 0x07 c8e0: b8 84 ldd r11, Y+8 ; 0x08 c8e2: 20 e0 ldi r18, 0x00 ; 0 c8e4: 30 e0 ldi r19, 0x00 ; 0 c8e6: 40 e8 ldi r20, 0x80 ; 128 c8e8: 50 ec ldi r21, 0xC0 ; 192 c8ea: c5 01 movw r24, r10 c8ec: b4 01 movw r22, r8 c8ee: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> c8f2: 87 ff sbrs r24, 7 c8f4: 35 c0 rjmp .+106 ; 0xc960 tmpy = Y_MIN_POS; c8f6: 80 e0 ldi r24, 0x00 ; 0 c8f8: 90 e0 ldi r25, 0x00 ; 0 c8fa: a0 e8 ldi r26, 0x80 ; 128 c8fc: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; c8fe: 8d 83 std Y+5, r24 ; 0x05 c900: 9e 83 std Y+6, r25 ; 0x06 c902: af 83 std Y+7, r26 ; 0x07 c904: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); c906: cd 80 ldd r12, Y+5 ; 0x05 c908: de 80 ldd r13, Y+6 ; 0x06 c90a: ef 80 ldd r14, Y+7 ; 0x07 c90c: f8 84 ldd r15, Y+8 ; 0x08 c90e: 89 80 ldd r8, Y+1 ; 0x01 c910: 9a 80 ldd r9, Y+2 ; 0x02 c912: ab 80 ldd r10, Y+3 ; 0x03 c914: 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) { c916: 70 90 dc 16 lds r7, 0x16DC ; 0x8016dc c91a: 71 10 cpse r7, r1 c91c: 4c c0 rjmp .+152 ; 0xc9b6 // No correction. out_x = x; c91e: f8 01 movw r30, r16 c920: 80 82 st Z, r8 c922: 91 82 std Z+1, r9 ; 0x01 c924: a2 82 std Z+2, r10 ; 0x02 c926: b3 82 std Z+3, r11 ; 0x03 out_y = y; c928: f1 01 movw r30, r2 c92a: c0 82 st Z, r12 c92c: d1 82 std Z+1, r13 ; 0x01 c92e: e2 82 std Z+2, r14 ; 0x02 c930: 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) { c932: ff 24 eor r15, r15 c934: f3 94 inc r15 c936: 25 c0 rjmp .+74 ; 0xc982 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) { c938: 20 e0 ldi r18, 0x00 ; 0 c93a: 30 e0 ldi r19, 0x00 ; 0 c93c: 4a e7 ldi r20, 0x7A ; 122 c93e: 53 e4 ldi r21, 0x43 ; 67 c940: c7 01 movw r24, r14 c942: b6 01 movw r22, r12 c944: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; c948: 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) { c94a: 18 16 cp r1, r24 c94c: 34 f6 brge .-116 ; 0xc8da tmpx = X_MAX_POS; c94e: 80 e0 ldi r24, 0x00 ; 0 c950: 90 e0 ldi r25, 0x00 ; 0 c952: aa e7 ldi r26, 0x7A ; 122 c954: b3 e4 ldi r27, 0x43 ; 67 c956: 89 83 std Y+1, r24 ; 0x01 c958: 9a 83 std Y+2, r25 ; 0x02 c95a: ab 83 std Y+3, r26 ; 0x03 c95c: bc 83 std Y+4, r27 ; 0x04 c95e: bb cf rjmp .-138 ; 0xc8d6 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { c960: 20 e0 ldi r18, 0x00 ; 0 c962: 30 e0 ldi r19, 0x00 ; 0 c964: 42 e5 ldi r20, 0x52 ; 82 c966: 53 e4 ldi r21, 0x43 ; 67 c968: c5 01 movw r24, r10 c96a: b4 01 movw r22, r8 c96c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> c970: 18 16 cp r1, r24 c972: 2c f4 brge .+10 ; 0xc97e tmpy = Y_MAX_POS; c974: 80 e0 ldi r24, 0x00 ; 0 c976: 90 e0 ldi r25, 0x00 ; 0 c978: a2 e5 ldi r26, 0x52 ; 82 c97a: b3 e4 ldi r27, 0x43 ; 67 c97c: c0 cf rjmp .-128 ; 0xc8fe clamped = true; } if (clamped) c97e: f1 10 cpse r15, r1 c980: c2 cf rjmp .-124 ; 0xc906 machine2world(tmpx, tmpy, x, y); return clamped; } c982: 8f 2d mov r24, r15 c984: 28 96 adiw r28, 0x08 ; 8 c986: 0f b6 in r0, 0x3f ; 63 c988: f8 94 cli c98a: de bf out 0x3e, r29 ; 62 c98c: 0f be out 0x3f, r0 ; 63 c98e: cd bf out 0x3d, r28 ; 61 c990: df 91 pop r29 c992: cf 91 pop r28 c994: 1f 91 pop r17 c996: 0f 91 pop r16 c998: ff 90 pop r15 c99a: ef 90 pop r14 c99c: df 90 pop r13 c99e: cf 90 pop r12 c9a0: bf 90 pop r11 c9a2: af 90 pop r10 c9a4: 9f 90 pop r9 c9a6: 8f 90 pop r8 c9a8: 7f 90 pop r7 c9aa: 6f 90 pop r6 c9ac: 5f 90 pop r5 c9ae: 4f 90 pop r4 c9b0: 3f 90 pop r3 c9b2: 2f 90 pop r2 c9b4: 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) { c9b6: 70 fe sbrs r7, 0 c9b8: 1c c0 rjmp .+56 ; 0xc9f2 // Then add the offset. x -= world2machine_shift[0]; c9ba: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c9be: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c9c2: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c9c6: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c9ca: c5 01 movw r24, r10 c9cc: b4 01 movw r22, r8 c9ce: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> c9d2: 4b 01 movw r8, r22 c9d4: 5c 01 movw r10, r24 y -= world2machine_shift[1]; c9d6: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c9da: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c9de: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c9e2: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c9e6: c7 01 movw r24, r14 c9e8: b6 01 movw r22, r12 c9ea: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> c9ee: 6b 01 movw r12, r22 c9f0: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c9f2: 71 fe sbrs r7, 1 c9f4: 9e cf rjmp .-196 ; 0xc932 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; c9f6: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 c9fa: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 c9fe: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 ca02: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 ca06: c5 01 movw r24, r10 ca08: b4 01 movw r22, r8 ca0a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ca0e: 2b 01 movw r4, r22 ca10: 3c 01 movw r6, r24 ca12: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 ca16: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 ca1a: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca ca1e: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb ca22: c7 01 movw r24, r14 ca24: b6 01 movw r22, r12 ca26: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ca2a: 9b 01 movw r18, r22 ca2c: ac 01 movw r20, r24 ca2e: c3 01 movw r24, r6 ca30: b2 01 movw r22, r4 ca32: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> ca36: f8 01 movw r30, r16 ca38: 60 83 st Z, r22 ca3a: 71 83 std Z+1, r23 ; 0x01 ca3c: 82 83 std Z+2, r24 ; 0x02 ca3e: 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; ca40: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc ca44: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd ca48: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce ca4c: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf ca50: c5 01 movw r24, r10 ca52: b4 01 movw r22, r8 ca54: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ca58: 4b 01 movw r8, r22 ca5a: 5c 01 movw r10, r24 ca5c: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 ca60: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 ca64: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 ca68: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 ca6c: c7 01 movw r24, r14 ca6e: b6 01 movw r22, r12 ca70: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ca74: 9b 01 movw r18, r22 ca76: ac 01 movw r20, r24 ca78: c5 01 movw r24, r10 ca7a: b4 01 movw r22, r8 ca7c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> ca80: f1 01 movw r30, r2 ca82: 60 83 st Z, r22 ca84: 71 83 std Z+1, r23 ; 0x01 ca86: 82 83 std Z+2, r24 ; 0x02 ca88: 93 83 std Z+3, r25 ; 0x03 ca8a: 53 cf rjmp .-346 ; 0xc932 0000ca8c : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { ca8c: cf 92 push r12 ca8e: df 92 push r13 ca90: ef 92 push r14 ca92: ff 92 push r15 ca94: cf 93 push r28 ca96: df 93 push r29 ca98: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); ca9a: bc 01 movw r22, r24 ca9c: 6c 5f subi r22, 0xFC ; 252 ca9e: 7f 4f sbci r23, 0xFF ; 255 caa0: 0e 94 27 64 call 0xc84e ; 0xc84e // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; caa4: c0 90 2c 02 lds r12, 0x022C ; 0x80022c caa8: d0 90 2d 02 lds r13, 0x022D ; 0x80022d caac: e0 90 2e 02 lds r14, 0x022E ; 0x80022e cab0: f0 90 2f 02 lds r15, 0x022F ; 0x80022f cab4: a7 01 movw r20, r14 cab6: 96 01 movw r18, r12 cab8: 68 85 ldd r22, Y+8 ; 0x08 caba: 79 85 ldd r23, Y+9 ; 0x09 cabc: 8a 85 ldd r24, Y+10 ; 0x0a cabe: 9b 85 ldd r25, Y+11 ; 0x0b cac0: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> cac4: 87 ff sbrs r24, 7 cac6: 04 c0 rjmp .+8 ; 0xcad0 cac8: c8 86 std Y+8, r12 ; 0x08 caca: d9 86 std Y+9, r13 ; 0x09 cacc: ea 86 std Y+10, r14 ; 0x0a cace: 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]; cad0: c0 90 20 02 lds r12, 0x0220 ; 0x800220 cad4: d0 90 21 02 lds r13, 0x0221 ; 0x800221 cad8: e0 90 22 02 lds r14, 0x0222 ; 0x800222 cadc: f0 90 23 02 lds r15, 0x0223 ; 0x800223 cae0: a7 01 movw r20, r14 cae2: 96 01 movw r18, r12 cae4: 68 85 ldd r22, Y+8 ; 0x08 cae6: 79 85 ldd r23, Y+9 ; 0x09 cae8: 8a 85 ldd r24, Y+10 ; 0x0a caea: 9b 85 ldd r25, Y+11 ; 0x0b caec: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> caf0: 18 16 cp r1, r24 caf2: 24 f4 brge .+8 ; 0xcafc caf4: c8 86 std Y+8, r12 ; 0x08 caf6: d9 86 std Y+9, r13 ; 0x09 caf8: ea 86 std Y+10, r14 ; 0x0a cafa: fb 86 std Y+11, r15 ; 0x0b } } cafc: df 91 pop r29 cafe: cf 91 pop r28 cb00: ff 90 pop r15 cb02: ef 90 pop r14 cb04: df 90 pop r13 cb06: cf 90 pop r12 cb08: 08 95 ret 0000cb0a : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { cb0a: 2f 92 push r2 cb0c: 3f 92 push r3 cb0e: 4f 92 push r4 cb10: 5f 92 push r5 cb12: 6f 92 push r6 cb14: 7f 92 push r7 cb16: 8f 92 push r8 cb18: 9f 92 push r9 cb1a: af 92 push r10 cb1c: bf 92 push r11 cb1e: cf 92 push r12 cb20: df 92 push r13 cb22: ef 92 push r14 cb24: ff 92 push r15 cb26: 0f 93 push r16 cb28: 1f 93 push r17 cb2a: cf 93 push r28 cb2c: df 93 push r29 cb2e: cd b7 in r28, 0x3d ; 61 cb30: de b7 in r29, 0x3e ; 62 cb32: a2 97 sbiw r28, 0x22 ; 34 cb34: 0f b6 in r0, 0x3f ; 63 cb36: f8 94 cli cb38: de bf out 0x3e, r29 ; 62 cb3a: 0f be out 0x3f, r0 ; 63 cb3c: cd bf out 0x3d, r28 ; 61 cb3e: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); cb40: 83 e9 ldi r24, 0x93 ; 147 cb42: 96 e0 ldi r25, 0x06 ; 6 cb44: 0e 94 46 65 call 0xca8c ; 0xca8c previous_millis_cmd.start(); cb48: 8a e4 ldi r24, 0x4A ; 74 cb4a: 93 e0 ldi r25, 0x03 ; 3 cb4c: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::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])) { cb50: 40 90 f5 11 lds r4, 0x11F5 ; 0x8011f5 cb54: 50 90 f6 11 lds r5, 0x11F6 ; 0x8011f6 cb58: 60 90 f7 11 lds r6, 0x11F7 ; 0x8011f7 cb5c: 70 90 f8 11 lds r7, 0x11F8 ; 0x8011f8 cb60: c0 90 93 06 lds r12, 0x0693 ; 0x800693 cb64: d0 90 94 06 lds r13, 0x0694 ; 0x800694 cb68: e0 90 95 06 lds r14, 0x0695 ; 0x800695 cb6c: f0 90 96 06 lds r15, 0x0696 ; 0x800696 cb70: a7 01 movw r20, r14 cb72: 96 01 movw r18, r12 cb74: c3 01 movw r24, r6 cb76: b2 01 movw r22, r4 cb78: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> cb7c: 81 11 cpse r24, r1 cb7e: 3f c0 rjmp .+126 ; 0xcbfe cb80: 20 91 97 06 lds r18, 0x0697 ; 0x800697 cb84: 30 91 98 06 lds r19, 0x0698 ; 0x800698 cb88: 40 91 99 06 lds r20, 0x0699 ; 0x800699 cb8c: 50 91 9a 06 lds r21, 0x069A ; 0x80069a cb90: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 cb94: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa cb98: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb cb9c: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc cba0: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> cba4: 81 11 cpse r24, r1 cba6: 2b c0 rjmp .+86 ; 0xcbfe plan_buffer_line_destinationXYZE(feedrate/60); cba8: 20 e0 ldi r18, 0x00 ; 0 cbaa: 30 e0 ldi r19, 0x00 ; 0 cbac: 40 e7 ldi r20, 0x70 ; 112 cbae: 52 e4 ldi r21, 0x42 ; 66 cbb0: 60 91 7a 02 lds r22, 0x027A ; 0x80027a cbb4: 70 91 7b 02 lds r23, 0x027B ; 0x80027b cbb8: 80 91 7c 02 lds r24, 0x027C ; 0x80027c cbbc: 90 91 7d 02 lds r25, 0x027D ; 0x80027d cbc0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> cbc4: 0f 94 9d 85 call 0x30b3a ; 0x30b3a #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); cbc8: 0e 94 37 55 call 0xaa6e ; 0xaa6e } cbcc: a2 96 adiw r28, 0x22 ; 34 cbce: 0f b6 in r0, 0x3f ; 63 cbd0: f8 94 cli cbd2: de bf out 0x3e, r29 ; 62 cbd4: 0f be out 0x3f, r0 ; 63 cbd6: cd bf out 0x3d, r28 ; 61 cbd8: df 91 pop r29 cbda: cf 91 pop r28 cbdc: 1f 91 pop r17 cbde: 0f 91 pop r16 cbe0: ff 90 pop r15 cbe2: ef 90 pop r14 cbe4: df 90 pop r13 cbe6: cf 90 pop r12 cbe8: bf 90 pop r11 cbea: af 90 pop r10 cbec: 9f 90 pop r9 cbee: 8f 90 pop r8 cbf0: 7f 90 pop r7 cbf2: 6f 90 pop r6 cbf4: 5f 90 pop r5 cbf6: 4f 90 pop r4 cbf8: 3f 90 pop r3 cbfa: 2f 90 pop r2 cbfc: 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); cbfe: 60 91 8e 02 lds r22, 0x028E ; 0x80028e cc02: 70 91 8f 02 lds r23, 0x028F ; 0x80028f cc06: 07 2e mov r0, r23 cc08: 00 0c add r0, r0 cc0a: 88 0b sbc r24, r24 cc0c: 99 0b sbc r25, r25 cc0e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> cc12: 20 91 7a 02 lds r18, 0x027A ; 0x80027a cc16: 30 91 7b 02 lds r19, 0x027B ; 0x80027b cc1a: 40 91 7c 02 lds r20, 0x027C ; 0x80027c cc1e: 50 91 7d 02 lds r21, 0x027D ; 0x80027d cc22: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> cc26: 2e e3 ldi r18, 0x3E ; 62 cc28: 33 ec ldi r19, 0xC3 ; 195 cc2a: 4e e2 ldi r20, 0x2E ; 46 cc2c: 59 e3 ldi r21, 0x39 ; 57 cc2e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> cc32: 6f 83 std Y+7, r22 ; 0x07 cc34: 78 87 std Y+8, r23 ; 0x08 cc36: 89 87 std Y+9, r24 ; 0x09 cc38: 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) { cc3a: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cc3e: 88 23 and r24, r24 cc40: 09 f4 brne .+2 ; 0xcc44 cc42: 0f c1 rjmp .+542 ; 0xce62 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]; cc44: a3 01 movw r20, r6 cc46: 92 01 movw r18, r4 cc48: c7 01 movw r24, r14 cc4a: b6 01 movw r22, r12 cc4c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cc50: 2b 01 movw r4, r22 cc52: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; cc54: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cc58: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cc5c: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb cc60: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc cc64: 60 91 97 06 lds r22, 0x0697 ; 0x800697 cc68: 70 91 98 06 lds r23, 0x0698 ; 0x800698 cc6c: 80 91 99 06 lds r24, 0x0699 ; 0x800699 cc70: 90 91 9a 06 lds r25, 0x069A ; 0x80069a cc74: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cc78: 6b 87 std Y+11, r22 ; 0x0b cc7a: 7c 87 std Y+12, r23 ; 0x0c cc7c: 8d 87 std Y+13, r24 ; 0x0d cc7e: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); cc80: c3 01 movw r24, r6 cc82: b2 01 movw r22, r4 cc84: 9f 77 andi r25, 0x7F ; 127 cc86: 2b 85 ldd r18, Y+11 ; 0x0b cc88: 3c 85 ldd r19, Y+12 ; 0x0c cc8a: 4d 85 ldd r20, Y+13 ; 0x0d cc8c: 5e 85 ldd r21, Y+14 ; 0x0e cc8e: 5f 77 andi r21, 0x7F ; 127 cc90: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> cc94: 6b 01 movw r12, r22 cc96: 7c 01 movw r14, r24 if (len > 0) cc98: 20 e0 ldi r18, 0x00 ; 0 cc9a: 30 e0 ldi r19, 0x00 ; 0 cc9c: a9 01 movw r20, r18 cc9e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> cca2: 18 16 cp r1, r24 cca4: 0c f0 brlt .+2 ; 0xcca8 cca6: dd c0 rjmp .+442 ; 0xce62 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); cca8: 20 e0 ldi r18, 0x00 ; 0 ccaa: 30 e0 ldi r19, 0x00 ; 0 ccac: 40 ef ldi r20, 0xF0 ; 240 ccae: 51 e4 ldi r21, 0x41 ; 65 ccb0: c7 01 movw r24, r14 ccb2: b6 01 movw r22, r12 ccb4: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> ccb8: 0f 94 42 a3 call 0x34684 ; 0x34684 ccbc: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> ccc0: 7e 83 std Y+6, r23 ; 0x06 ccc2: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { ccc4: 62 30 cpi r22, 0x02 ; 2 ccc6: 71 05 cpc r23, r1 ccc8: 08 f4 brcc .+2 ; 0xcccc ccca: cb c0 rjmp .+406 ; 0xce62 cccc: 21 14 cp r2, r1 ccce: 31 04 cpc r3, r1 ccd0: 09 f4 brne .+2 ; 0xccd4 ccd2: c7 c0 rjmp .+398 ; 0xce62 float dz = z - current_position[Z_AXIS]; ccd4: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd ccd8: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe ccdc: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff cce0: 50 91 00 12 lds r21, 0x1200 ; 0x801200 cce4: 60 91 9b 06 lds r22, 0x069B ; 0x80069b cce8: 70 91 9c 06 lds r23, 0x069C ; 0x80069c ccec: 80 91 9d 06 lds r24, 0x069D ; 0x80069d ccf0: 90 91 9e 06 lds r25, 0x069E ; 0x80069e ccf4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> ccf8: 6f 87 std Y+15, r22 ; 0x0f ccfa: 78 8b std Y+16, r23 ; 0x10 ccfc: 89 8b std Y+17, r24 ; 0x11 ccfe: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; cd00: 20 91 01 12 lds r18, 0x1201 ; 0x801201 cd04: 30 91 02 12 lds r19, 0x1202 ; 0x801202 cd08: 40 91 03 12 lds r20, 0x1203 ; 0x801203 cd0c: 50 91 04 12 lds r21, 0x1204 ; 0x801204 cd10: 60 91 9f 06 lds r22, 0x069F ; 0x80069f cd14: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 cd18: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 cd1c: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 cd20: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cd24: 6b 8b std Y+19, r22 ; 0x13 cd26: 7c 8b std Y+20, r23 ; 0x14 cd28: 8d 8b std Y+21, r24 ; 0x15 cd2a: 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); cd2c: ad 81 ldd r26, Y+5 ; 0x05 cd2e: be 81 ldd r27, Y+6 ; 0x06 cd30: cd 01 movw r24, r26 cd32: b0 e0 ldi r27, 0x00 ; 0 cd34: a0 e0 ldi r26, 0x00 ; 0 cd36: 8f 8f std Y+31, r24 ; 0x1f cd38: 98 a3 std Y+32, r25 ; 0x20 cd3a: a9 a3 std Y+33, r26 ; 0x21 cd3c: 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) { cd3e: 2d 81 ldd r18, Y+5 ; 0x05 cd40: 3e 81 ldd r19, Y+6 ; 0x06 cd42: 22 16 cp r2, r18 cd44: 33 06 cpc r3, r19 cd46: 08 f0 brcs .+2 ; 0xcd4a cd48: 8c c0 rjmp .+280 ; 0xce62 float t = float(i) / float(n_segments); cd4a: b1 01 movw r22, r2 cd4c: 90 e0 ldi r25, 0x00 ; 0 cd4e: 80 e0 ldi r24, 0x00 ; 0 cd50: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> cd54: 6b 01 movw r12, r22 cd56: 7c 01 movw r14, r24 cd58: 6f 8d ldd r22, Y+31 ; 0x1f cd5a: 78 a1 ldd r23, Y+32 ; 0x20 cd5c: 89 a1 ldd r24, Y+33 ; 0x21 cd5e: 9a a1 ldd r25, Y+34 ; 0x22 cd60: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> cd64: 9b 01 movw r18, r22 cd66: ac 01 movw r20, r24 cd68: c7 01 movw r24, r14 cd6a: b6 01 movw r22, r12 cd6c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> cd70: 6b 01 movw r12, r22 cd72: 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, cd74: ac 01 movw r20, r24 cd76: 9b 01 movw r18, r22 cd78: 6b 89 ldd r22, Y+19 ; 0x13 cd7a: 7c 89 ldd r23, Y+20 ; 0x14 cd7c: 8d 89 ldd r24, Y+21 ; 0x15 cd7e: 9e 89 ldd r25, Y+22 ; 0x16 cd80: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> cd84: 9b 01 movw r18, r22 cd86: ac 01 movw r20, r24 cd88: 60 91 01 12 lds r22, 0x1201 ; 0x801201 cd8c: 70 91 02 12 lds r23, 0x1202 ; 0x801202 cd90: 80 91 03 12 lds r24, 0x1203 ; 0x801203 cd94: 90 91 04 12 lds r25, 0x1204 ; 0x801204 cd98: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> cd9c: 69 83 std Y+1, r22 ; 0x01 cd9e: 7a 83 std Y+2, r23 ; 0x02 cda0: 8b 83 std Y+3, r24 ; 0x03 cda2: 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, cda4: a7 01 movw r20, r14 cda6: 96 01 movw r18, r12 cda8: 6f 85 ldd r22, Y+15 ; 0x0f cdaa: 78 89 ldd r23, Y+16 ; 0x10 cdac: 89 89 ldd r24, Y+17 ; 0x11 cdae: 9a 89 ldd r25, Y+18 ; 0x12 cdb0: 0f 94 09 9c call 0x33812 ; 0x33812 <__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, cdb4: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd cdb8: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe cdbc: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff cdc0: 50 91 00 12 lds r21, 0x1200 ; 0x801200 cdc4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> cdc8: 6f 8b std Y+23, r22 ; 0x17 cdca: 78 8f std Y+24, r23 ; 0x18 cdcc: 89 8f std Y+25, r24 ; 0x19 cdce: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, cdd0: a7 01 movw r20, r14 cdd2: 96 01 movw r18, r12 cdd4: 6b 85 ldd r22, Y+11 ; 0x0b cdd6: 7c 85 ldd r23, Y+12 ; 0x0c cdd8: 8d 85 ldd r24, Y+13 ; 0x0d cdda: 9e 85 ldd r25, Y+14 ; 0x0e cddc: 0f 94 09 9c call 0x33812 ; 0x33812 <__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, cde0: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cde4: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cde8: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb cdec: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc cdf0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> cdf4: 6b 8f std Y+27, r22 ; 0x1b cdf6: 7c 8f std Y+28, r23 ; 0x1c cdf8: 8d 8f std Y+29, r24 ; 0x1d cdfa: 9e 8f std Y+30, r25 ; 0x1e cdfc: a7 01 movw r20, r14 cdfe: 96 01 movw r18, r12 ce00: c3 01 movw r24, r6 ce02: b2 01 movw r22, r4 ce04: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> ce08: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 ce0c: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 ce10: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 ce14: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 ce18: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> ce1c: 3f 92 push r3 ce1e: 2f 92 push r2 ce20: a5 ef ldi r26, 0xF5 ; 245 ce22: b1 e1 ldi r27, 0x11 ; 17 ce24: bf 93 push r27 ce26: af 93 push r26 ce28: 8f 80 ldd r8, Y+7 ; 0x07 ce2a: 98 84 ldd r9, Y+8 ; 0x08 ce2c: a9 84 ldd r10, Y+9 ; 0x09 ce2e: ba 84 ldd r11, Y+10 ; 0x0a ce30: de 01 movw r26, r28 ce32: 11 96 adiw r26, 0x01 ; 1 ce34: 6d 01 movw r12, r26 ce36: ef 88 ldd r14, Y+23 ; 0x17 ce38: f8 8c ldd r15, Y+24 ; 0x18 ce3a: 09 8d ldd r16, Y+25 ; 0x19 ce3c: 1a 8d ldd r17, Y+26 ; 0x1a ce3e: 2b 8d ldd r18, Y+27 ; 0x1b ce40: 3c 8d ldd r19, Y+28 ; 0x1c ce42: 4d 8d ldd r20, Y+29 ; 0x1d ce44: 5e 8d ldd r21, Y+30 ; 0x1e ce46: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 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) ce4a: 0f 90 pop r0 ce4c: 0f 90 pop r0 ce4e: 0f 90 pop r0 ce50: 0f 90 pop r0 ce52: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac ce56: 81 11 cpse r24, r1 ce58: b7 ce rjmp .-658 ; 0xcbc8 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) { ce5a: bf ef ldi r27, 0xFF ; 255 ce5c: 2b 1a sub r2, r27 ce5e: 3b 0a sbc r3, r27 ce60: 6e cf rjmp .-292 ; 0xcd3e if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); ce62: e0 90 9b 06 lds r14, 0x069B ; 0x80069b ce66: f0 90 9c 06 lds r15, 0x069C ; 0x80069c ce6a: 00 91 9d 06 lds r16, 0x069D ; 0x80069d ce6e: 10 91 9e 06 lds r17, 0x069E ; 0x80069e ce72: 20 91 97 06 lds r18, 0x0697 ; 0x800697 ce76: 30 91 98 06 lds r19, 0x0698 ; 0x800698 ce7a: 40 91 99 06 lds r20, 0x0699 ; 0x800699 ce7e: 50 91 9a 06 lds r21, 0x069A ; 0x80069a ce82: 60 91 93 06 lds r22, 0x0693 ; 0x800693 ce86: 70 91 94 06 lds r23, 0x0694 ; 0x800694 ce8a: 80 91 95 06 lds r24, 0x0695 ; 0x800695 ce8e: 90 91 96 06 lds r25, 0x0696 ; 0x800696 ce92: 1f 92 push r1 ce94: 1f 92 push r1 ce96: e5 ef ldi r30, 0xF5 ; 245 ce98: f1 e1 ldi r31, 0x11 ; 17 ce9a: ff 93 push r31 ce9c: ef 93 push r30 ce9e: 8f 80 ldd r8, Y+7 ; 0x07 cea0: 98 84 ldd r9, Y+8 ; 0x08 cea2: a9 84 ldd r10, Y+9 ; 0x09 cea4: ba 84 ldd r11, Y+10 ; 0x0a cea6: ef e9 ldi r30, 0x9F ; 159 cea8: ce 2e mov r12, r30 ceaa: e6 e0 ldi r30, 0x06 ; 6 ceac: de 2e mov r13, r30 ceae: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 ceb2: 0f 90 pop r0 ceb4: 0f 90 pop r0 ceb6: 0f 90 pop r0 ceb8: 0f 90 pop r0 ceba: 86 ce rjmp .-756 ; 0xcbc8 0000cebc : /// @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) { cebc: cf 92 push r12 cebe: df 92 push r13 cec0: ef 92 push r14 cec2: ff 92 push r15 cec4: cf 93 push r28 float travel_z = current_position[Z_AXIS]; cec6: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd ceca: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cece: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff ced2: f0 90 00 12 lds r15, 0x1200 ; 0x801200 // Prepare to move Z axis current_position[Z_AXIS] += delta; ced6: a7 01 movw r20, r14 ced8: 96 01 movw r18, r12 ceda: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> cede: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cee2: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cee6: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff ceea: 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); ceee: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) cef0: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 cef4: 91 11 cpse r25, r1 cef6: 02 c0 rjmp .+4 ; 0xcefc cef8: 84 ff sbrs r24, 4 cefa: 26 c0 rjmp .+76 ; 0xcf48 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); cefc: 85 ef ldi r24, 0xF5 ; 245 cefe: 91 e1 ldi r25, 0x11 ; 17 cf00: 0e 94 46 65 call 0xca8c ; 0xca8c plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); cf04: 60 91 4e 04 lds r22, 0x044E ; 0x80044e cf08: 70 91 4f 04 lds r23, 0x044F ; 0x80044f cf0c: 80 91 50 04 lds r24, 0x0450 ; 0x800450 cf10: 90 91 51 04 lds r25, 0x0451 ; 0x800451 cf14: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); cf18: 0f 94 a0 22 call 0x24540 ; 0x24540 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; cf1c: a7 01 movw r20, r14 cf1e: 96 01 movw r18, r12 cf20: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd cf24: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe cf28: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff cf2c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 cf30: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cf34: 6b 01 movw r12, r22 cf36: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } cf38: c7 01 movw r24, r14 cf3a: b6 01 movw r22, r12 cf3c: cf 91 pop r28 cf3e: ff 90 pop r15 cf40: ef 90 pop r14 cf42: df 90 pop r13 cf44: cf 90 pop r12 cf46: 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(); cf48: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); cf4a: 0f 94 a0 22 call 0x24540 ; 0x24540 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); cf4e: 81 e0 ldi r24, 0x01 ; 1 cf50: 0f 94 d8 2c call 0x259b0 ; 0x259b0 cf54: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); cf56: 65 e5 ldi r22, 0x55 ; 85 cf58: 75 e5 ldi r23, 0x55 ; 85 cf5a: 85 e5 ldi r24, 0x55 ; 85 cf5c: 91 e4 ldi r25, 0x41 ; 65 cf5e: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); cf62: 0f 94 a0 22 call 0x24540 ; 0x24540 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; cf66: 82 e0 ldi r24, 0x02 ; 2 cf68: 0f 94 8c 22 call 0x24518 ; 0x24518 cf6c: a7 01 movw r20, r14 cf6e: 96 01 movw r18, r12 cf70: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cf74: 6b 01 movw r12, r22 cf76: 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); cf78: 8c 2f mov r24, r28 cf7a: 0f 94 d8 2c call 0x259b0 ; 0x259b0 cf7e: dc cf rjmp .-72 ; 0xcf38 0000cf80 : // // 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) { cf80: 8f 92 push r8 cf82: 9f 92 push r9 cf84: af 92 push r10 cf86: bf 92 push r11 cf88: cf 92 push r12 cf8a: df 92 push r13 cf8c: ef 92 push r14 cf8e: ff 92 push r15 cf90: 4b 01 movw r8, r22 cf92: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) cf94: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd cf98: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cf9c: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff cfa0: f0 90 00 12 lds r15, 0x1200 ; 0x801200 cfa4: ac 01 movw r20, r24 cfa6: 9b 01 movw r18, r22 cfa8: c7 01 movw r24, r14 cfaa: b6 01 movw r22, r12 cfac: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> cfb0: 87 ff sbrs r24, 7 cfb2: 11 c0 rjmp .+34 ; 0xcfd6 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); cfb4: a5 01 movw r20, r10 cfb6: 94 01 movw r18, r8 cfb8: c7 01 movw r24, r14 cfba: b6 01 movw r22, r12 cfbc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> cfc0: 9f 77 andi r25, 0x7F ; 127 } cfc2: ff 90 pop r15 cfc4: ef 90 pop r14 cfc6: df 90 pop r13 cfc8: cf 90 pop r12 cfca: bf 90 pop r11 cfcc: af 90 pop r10 cfce: 9f 90 pop r9 cfd0: 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)); cfd2: 0c 94 5e 67 jmp 0xcebc ; 0xcebc } cfd6: ff 90 pop r15 cfd8: ef 90 pop r14 cfda: df 90 pop r13 cfdc: cf 90 pop r12 cfde: bf 90 pop r11 cfe0: af 90 pop r10 cfe2: 9f 90 pop r9 cfe4: 8f 90 pop r8 cfe6: 08 95 ret 0000cfe8 : #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 { cfe8: 2f 92 push r2 cfea: 3f 92 push r3 cfec: 4f 92 push r4 cfee: 5f 92 push r5 cff0: 6f 92 push r6 cff2: 7f 92 push r7 cff4: 8f 92 push r8 cff6: 9f 92 push r9 cff8: af 92 push r10 cffa: bf 92 push r11 cffc: cf 92 push r12 cffe: df 92 push r13 d000: ef 92 push r14 d002: ff 92 push r15 d004: 0f 93 push r16 d006: 1f 93 push r17 d008: cf 93 push r28 d00a: df 93 push r29 d00c: 00 d0 rcall .+0 ; 0xd00e d00e: 1f 92 push r1 d010: 1f 92 push r1 d012: cd b7 in r28, 0x3d ; 61 d014: de b7 in r29, 0x3e ; 62 d016: d8 2e mov r13, r24 d018: 2a 01 movw r4, r20 d01a: 3b 01 movw r6, r22 d01c: 32 2e mov r3, r18 d01e: e9 82 std Y+1, r14 ; 0x01 d020: fa 82 std Y+2, r15 ; 0x02 d022: 0b 83 std Y+3, r16 ; 0x03 d024: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); d026: 0f 94 a0 22 call 0x24540 ; 0x24540 homing_flag = true; d02a: 81 e0 ldi r24, 0x01 ; 1 d02c: 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; d030: fc 2c mov r15, r12 d032: e3 2c mov r14, r3 d034: d3 10 cpse r13, r3 d036: 10 c0 rjmp .+32 ; 0xd058 d038: ed 2c mov r14, r13 d03a: dc 10 cpse r13, r12 d03c: 0d c0 rjmp .+26 ; 0xd058 // 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); d03e: 60 e0 ldi r22, 0x00 ; 0 d040: 70 e0 ldi r23, 0x00 ; 0 d042: 80 ea ldi r24, 0xA0 ; 160 d044: 90 e4 ldi r25, 0x40 ; 64 d046: 0e 94 c0 67 call 0xcf80 ; 0xcf80 // 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; d04a: ff 24 eor r15, r15 d04c: f3 94 inc r15 d04e: ee 24 eor r14, r14 d050: e3 94 inc r14 d052: 22 24 eor r2, r2 d054: 23 94 inc r2 d056: 01 c0 rjmp .+2 ; 0xd05a 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; d058: 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(); d05a: 0f 94 bc 90 call 0x32178 ; 0x32178 // 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; d05e: 80 91 9c 12 lds r24, 0x129C ; 0x80129c d062: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; d064: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); d068: 82 e0 ldi r24, 0x02 ; 2 d06a: 0f 94 8c 22 call 0x24518 ; 0x24518 d06e: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d072: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d076: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d07a: 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) d07e: f1 10 cpse r15, r1 babystep_undo(); d080: 0f 94 6b 8c call 0x318d6 ; 0x318d6 int l_feedmultiply = setup_for_endstop_move(); d084: 81 e0 ldi r24, 0x01 ; 1 d086: 0e 94 6f 60 call 0xc0de ; 0xc0de d08a: 8c 01 movw r16, r24 set_destination_to_current(); d08c: 0e 94 b7 61 call 0xc36e ; 0xc36e feedrate = 0.0; d090: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a d094: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b d098: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c d09c: 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); d0a0: 22 20 and r2, r2 d0a2: 19 f0 breq .+6 ; 0xd0aa d0a4: 80 e0 ldi r24, 0x00 ; 0 d0a6: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 if(home_y) homeaxis(Y_AXIS); d0aa: ee 20 and r14, r14 d0ac: 19 f0 breq .+6 ; 0xd0b4 d0ae: 81 e0 ldi r24, 0x01 ; 1 d0b0: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 #endif //TMC2130 if(home_x_axis && home_x_value != 0) d0b4: dd 20 and r13, r13 d0b6: e9 f0 breq .+58 ; 0xd0f2 d0b8: 41 14 cp r4, r1 d0ba: 51 04 cpc r5, r1 d0bc: 61 04 cpc r6, r1 d0be: 71 04 cpc r7, r1 d0c0: c1 f0 breq .+48 ; 0xd0f2 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; d0c2: c3 01 movw r24, r6 d0c4: b2 01 movw r22, r4 d0c6: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> d0ca: 9b 01 movw r18, r22 d0cc: ac 01 movw r20, r24 d0ce: 60 91 8a 04 lds r22, 0x048A ; 0x80048a d0d2: 70 91 8b 04 lds r23, 0x048B ; 0x80048b d0d6: 80 91 8c 04 lds r24, 0x048C ; 0x80048c d0da: 90 91 8d 04 lds r25, 0x048D ; 0x80048d d0de: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> d0e2: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 d0e6: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 d0ea: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 d0ee: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if(home_y_axis && home_y_value != 0) d0f2: 33 20 and r3, r3 d0f4: 01 f1 breq .+64 ; 0xd136 d0f6: 89 81 ldd r24, Y+1 ; 0x01 d0f8: 9a 81 ldd r25, Y+2 ; 0x02 d0fa: ab 81 ldd r26, Y+3 ; 0x03 d0fc: bc 81 ldd r27, Y+4 ; 0x04 d0fe: 00 97 sbiw r24, 0x00 ; 0 d100: a1 05 cpc r26, r1 d102: b1 05 cpc r27, r1 d104: c1 f0 breq .+48 ; 0xd136 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; d106: bc 01 movw r22, r24 d108: cd 01 movw r24, r26 d10a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> d10e: 9b 01 movw r18, r22 d110: ac 01 movw r20, r24 d112: 60 91 8e 04 lds r22, 0x048E ; 0x80048e d116: 70 91 8f 04 lds r23, 0x048F ; 0x80048f d11a: 80 91 90 04 lds r24, 0x0490 ; 0x800490 d11e: 90 91 91 04 lds r25, 0x0491 ; 0x800491 d122: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> d126: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 d12a: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa d12e: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb d132: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { d136: ff 20 and r15, r15 d138: 09 f4 brne .+2 ; 0xd13c d13a: 99 c0 rjmp .+306 ; 0xd26e #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); d13c: 60 e0 ldi r22, 0x00 ; 0 d13e: 70 e0 ldi r23, 0x00 ; 0 d140: 80 ea ldi r24, 0xA0 ; 160 d142: 90 e4 ldi r25, 0x40 ; 64 d144: 0e 94 c0 67 call 0xcf80 ; 0xcf80 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); d148: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 d14c: 81 11 cpse r24, r1 d14e: 02 c0 rjmp .+4 ; 0xd154 d150: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); d154: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 d158: 81 11 cpse r24, r1 d15a: 03 c0 rjmp .+6 ; 0xd162 d15c: 81 e0 ldi r24, 0x01 ; 1 d15e: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); d162: 0f 94 21 91 call 0x32242 ; 0x32242 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); d166: e3 e5 ldi r30, 0x53 ; 83 d168: f9 e8 ldi r31, 0x89 ; 137 d16a: 85 91 lpm r24, Z+ d16c: 95 91 lpm r25, Z+ d16e: a5 91 lpm r26, Z+ d170: b4 91 lpm r27, Z d172: ef e4 ldi r30, 0x4F ; 79 d174: f9 e8 ldi r31, 0x89 ; 137 d176: 45 91 lpm r20, Z+ d178: 55 91 lpm r21, Z+ d17a: 65 91 lpm r22, Z+ d17c: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d17e: 40 93 93 06 sts 0x0693, r20 ; 0x800693 d182: 50 93 94 06 sts 0x0694, r21 ; 0x800694 d186: 60 93 95 06 sts 0x0695, r22 ; 0x800695 d18a: 70 93 96 06 sts 0x0696, r23 ; 0x800696 out_y = y; d18e: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d192: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d196: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d19a: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a world2machine(out_x, out_y); d19e: 67 e9 ldi r22, 0x97 ; 151 d1a0: 76 e0 ldi r23, 0x06 ; 6 d1a2: 83 e9 ldi r24, 0x93 ; 147 d1a4: 96 e0 ldi r25, 0x06 ; 6 d1a6: 0e 94 7f 63 call 0xc6fe ; 0xc6fe world2machine_reset(); d1aa: 0f 94 83 90 call 0x32106 ; 0x32106 if (destination[Y_AXIS] < Y_MIN_POS) d1ae: 20 e0 ldi r18, 0x00 ; 0 d1b0: 30 e0 ldi r19, 0x00 ; 0 d1b2: 40 e8 ldi r20, 0x80 ; 128 d1b4: 50 ec ldi r21, 0xC0 ; 192 d1b6: 60 91 97 06 lds r22, 0x0697 ; 0x800697 d1ba: 70 91 98 06 lds r23, 0x0698 ; 0x800698 d1be: 80 91 99 06 lds r24, 0x0699 ; 0x800699 d1c2: 90 91 9a 06 lds r25, 0x069A ; 0x80069a d1c6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> d1ca: 87 ff sbrs r24, 7 d1cc: 0c c0 rjmp .+24 ; 0xd1e6 destination[Y_AXIS] = Y_MIN_POS; d1ce: 80 e0 ldi r24, 0x00 ; 0 d1d0: 90 e0 ldi r25, 0x00 ; 0 d1d2: a0 e8 ldi r26, 0x80 ; 128 d1d4: b0 ec ldi r27, 0xC0 ; 192 d1d6: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d1da: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d1de: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d1e2: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a feedrate = homing_feedrate[X_AXIS] / 20; d1e6: 80 e0 ldi r24, 0x00 ; 0 d1e8: 90 e0 ldi r25, 0x00 ; 0 d1ea: a6 e1 ldi r26, 0x16 ; 22 d1ec: b3 e4 ldi r27, 0x43 ; 67 d1ee: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a d1f2: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b d1f6: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c d1fa: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d d1fe: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> #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(); d202: 0f 94 90 84 call 0x30920 ; 0x30920 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); d206: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d20a: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d20e: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d212: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d216: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); d21a: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[X_AXIS] = destination[X_AXIS]; d21e: 80 91 93 06 lds r24, 0x0693 ; 0x800693 d222: 90 91 94 06 lds r25, 0x0694 ; 0x800694 d226: a0 91 95 06 lds r26, 0x0695 ; 0x800695 d22a: b0 91 96 06 lds r27, 0x0696 ; 0x800696 d22e: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 d232: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 d236: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 d23a: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = destination[Y_AXIS]; d23e: 80 91 97 06 lds r24, 0x0697 ; 0x800697 d242: 90 91 98 06 lds r25, 0x0698 ; 0x800698 d246: a0 91 99 06 lds r26, 0x0699 ; 0x800699 d24a: b0 91 9a 06 lds r27, 0x069A ; 0x80069a d24e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 d252: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa d256: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb d25a: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc d25e: 81 e0 ldi r24, 0x01 ; 1 d260: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(true); endstops_hit_on_purpose(); d264: 0f 94 f4 2c call 0x259e8 ; 0x259e8 homeaxis(Z_AXIS); d268: 82 e0 ldi r24, 0x02 ; 2 d26a: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) d26e: cc 20 and r12, r12 d270: e9 f0 breq .+58 ; 0xd2ac d272: 81 14 cp r8, r1 d274: 91 04 cpc r9, r1 d276: a1 04 cpc r10, r1 d278: b1 04 cpc r11, r1 d27a: c1 f0 breq .+48 ; 0xd2ac current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; d27c: c5 01 movw r24, r10 d27e: b4 01 movw r22, r8 d280: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> d284: 9b 01 movw r18, r22 d286: ac 01 movw r20, r24 d288: 60 91 92 04 lds r22, 0x0492 ; 0x800492 d28c: 70 91 93 04 lds r23, 0x0493 ; 0x800493 d290: 80 91 94 04 lds r24, 0x0494 ; 0x800494 d294: 90 91 95 04 lds r25, 0x0495 ; 0x800495 d298: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> d29c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d2a0: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d2a4: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d2a8: 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(); d2ac: 0f 94 90 84 call 0x30920 ; 0x30920 clean_up_after_endstop_move(l_feedmultiply); d2b0: c8 01 movw r24, r16 d2b2: 0e 94 55 60 call 0xc0aa ; 0xc0aa endstops_hit_on_purpose(); d2b6: 0f 94 f4 2c call 0x259e8 ; 0x259e8 // Load the machine correction matrix world2machine_initialize(); d2ba: 0f 94 21 91 call 0x32242 ; 0x32242 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); d2be: 0f 94 bf 8e call 0x31d7e ; 0x31d7e #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) d2c2: d1 10 cpse r13, r1 d2c4: 07 c0 rjmp .+14 ; 0xd2d4 d2c6: 31 10 cpse r3, r1 d2c8: 05 c0 rjmp .+10 ; 0xd2d4 d2ca: 8b 8d ldd r24, Y+27 ; 0x1b d2cc: 81 11 cpse r24, r1 d2ce: 02 c0 rjmp .+4 ; 0xd2d4 d2d0: cc 20 and r12, r12 d2d2: 39 f1 breq .+78 ; 0xd322 { if (! home_z && mbl_was_active) { d2d4: f1 10 cpse r15, r1 d2d6: 25 c0 rjmp .+74 ; 0xd322 d2d8: 9d 81 ldd r25, Y+5 ; 0x05 d2da: 99 23 and r25, r25 d2dc: 11 f1 breq .+68 ; 0xd322 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; d2de: 81 e0 ldi r24, 0x01 ; 1 d2e0: 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)); d2e4: 0f 94 8c 22 call 0x24518 ; 0x24518 d2e8: 6b 01 movw r12, r22 d2ea: 7c 01 movw r14, r24 d2ec: 80 e0 ldi r24, 0x00 ; 0 d2ee: 0f 94 8c 22 call 0x24518 ; 0x24518 d2f2: a7 01 movw r20, r14 d2f4: 96 01 movw r18, r12 d2f6: 0f 94 68 61 call 0x2c2d0 ; 0x2c2d0 d2fa: 9b 01 movw r18, r22 d2fc: ac 01 movw r20, r24 d2fe: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd d302: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe d306: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff d30a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 d30e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> d312: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d316: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d31a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d31e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } #endif prusa_statistics(20); d322: 84 e1 ldi r24, 0x14 ; 20 d324: 0f 94 5f 99 call 0x332be ; 0x332be st_synchronize(); d328: 0f 94 a0 22 call 0x24540 ; 0x24540 homing_flag = false; d32c: 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 } d330: 0f 90 pop r0 d332: 0f 90 pop r0 d334: 0f 90 pop r0 d336: 0f 90 pop r0 d338: 0f 90 pop r0 d33a: df 91 pop r29 d33c: cf 91 pop r28 d33e: 1f 91 pop r17 d340: 0f 91 pop r16 d342: ff 90 pop r15 d344: ef 90 pop r14 d346: df 90 pop r13 d348: cf 90 pop r12 d34a: bf 90 pop r11 d34c: af 90 pop r10 d34e: 9f 90 pop r9 d350: 8f 90 pop r8 d352: 7f 90 pop r7 d354: 6f 90 pop r6 d356: 5f 90 pop r5 d358: 4f 90 pop r4 d35a: 3f 90 pop r3 d35c: 2f 90 pop r2 d35e: 08 95 ret 0000d360 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { d360: e3 e3 ldi r30, 0x33 ; 51 d362: 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; d364: 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]; d366: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty d368: 8f 37 cpi r24, 0x7F ; 127 d36a: 31 f0 breq .+12 ; 0xd378 d36c: df 01 movw r26, r30 d36e: 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 d370: 87 ff sbrs r24, 7 d372: 07 c0 rjmp .+14 ; 0xd382 lcd_custom_characters[i] = c & 0x7F; d374: 8f 77 andi r24, 0x7F ; 127 d376: 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++) { d378: 83 e0 ldi r24, 0x03 ; 3 d37a: eb 33 cpi r30, 0x3B ; 59 d37c: f8 07 cpc r31, r24 d37e: 99 f7 brne .-26 ; 0xd366 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } d380: 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; d382: 9c 93 st X, r25 d384: f9 cf rjmp .-14 ; 0xd378 0000d386 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) d386: 90 91 5b 02 lds r25, 0x025B ; 0x80025b d38a: 98 17 cp r25, r24 d38c: 10 f4 brcc .+4 ; 0xd392 lcd_draw_update = lcdDrawUpdateOverride; d38e: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b if (!lcd_update_enabled) return; d392: 80 91 5c 02 lds r24, 0x025C ; 0x80025c d396: 88 23 and r24, r24 d398: 39 f0 breq .+14 ; 0xd3a8 if (lcd_lcdupdate_func) d39a: e0 91 d2 03 lds r30, 0x03D2 ; 0x8003d2 d39e: f0 91 d3 03 lds r31, 0x03D3 ; 0x8003d3 d3a2: 30 97 sbiw r30, 0x00 ; 0 d3a4: 09 f0 breq .+2 ; 0xd3a8 lcd_lcdupdate_func(); d3a6: 19 94 eijmp } d3a8: 08 95 ret 0000d3aa : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { d3aa: cf 93 push r28 d3ac: df 93 push r29 d3ae: cd b7 in r28, 0x3d ; 61 d3b0: de b7 in r29, 0x3e ; 62 d3b2: ae 01 movw r20, r28 d3b4: 4a 5f subi r20, 0xFA ; 250 d3b6: 5f 4f sbci r21, 0xFF ; 255 d3b8: fa 01 movw r30, r20 d3ba: 61 91 ld r22, Z+ d3bc: 71 91 ld r23, Z+ d3be: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); d3c0: 80 ec ldi r24, 0xC0 ; 192 d3c2: 93 e0 ldi r25, 0x03 ; 3 d3c4: 0f 94 83 a0 call 0x34106 ; 0x34106 va_end(args); return ret; } d3c8: df 91 pop r29 d3ca: cf 91 pop r28 d3cc: 08 95 ret 0000d3ce : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); d3ce: 60 ec ldi r22, 0xC0 ; 192 d3d0: 73 e0 ldi r23, 0x03 ; 3 d3d2: 0d 94 d4 9f jmp 0x33fa8 ; 0x33fa8 0000d3d6 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); d3d6: 60 ec ldi r22, 0xC0 ; 192 d3d8: 73 e0 ldi r23, 0x03 ; 3 d3da: 08 2e mov r0, r24 d3dc: 00 0c add r0, r0 d3de: 99 0b sbc r25, r25 d3e0: 0d 94 a4 9f jmp 0x33f48 ; 0x33f48 0000d3e4 : va_end(args); return ret; } void lcd_space(uint8_t n) { d3e4: cf 93 push r28 d3e6: c8 2f mov r28, r24 while (n--) lcd_putc(' '); d3e8: c1 50 subi r28, 0x01 ; 1 d3ea: 20 f0 brcs .+8 ; 0xd3f4 d3ec: 80 e2 ldi r24, 0x20 ; 32 d3ee: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 d3f2: fa cf rjmp .-12 ; 0xd3e8 } d3f4: cf 91 pop r28 d3f6: 08 95 ret 0000d3f8 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { d3f8: cf 93 push r28 d3fa: c8 2f mov r28, r24 d3fc: 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); d3fe: 64 30 cpi r22, 0x04 ; 4 d400: 08 f0 brcs .+2 ; 0xd404 d402: 83 e0 ldi r24, 0x03 ; 3 d404: 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); d408: 0e 94 41 55 call 0xaa82 ; 0xaa82 d40c: 8c 0f add r24, r28 lcd_ddram_address = addr; d40e: 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); d412: 44 e6 ldi r20, 0x64 ; 100 d414: 50 e0 ldi r21, 0x00 ; 0 d416: 60 e0 ldi r22, 0x00 ; 0 d418: 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); } d41a: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d41c: 0c 94 83 5d jmp 0xbb06 ; 0xbb06 0000d420 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { d420: cf 93 push r28 d422: df 93 push r29 d424: ea 01 movw r28, r20 lcd_set_cursor(c, r); d426: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 return fputs_P(str, lcdout); d42a: 60 ec ldi r22, 0xC0 ; 192 d42c: 73 e0 ldi r23, 0x03 ; 3 d42e: ce 01 movw r24, r28 } d430: df 91 pop r29 d432: 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); d434: 0d 94 d4 9f jmp 0x33fa8 ; 0x33fa8 0000d438 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { d438: cf 93 push r28 d43a: c4 2f mov r28, r20 lcd_set_cursor(c, r); d43c: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 return fputc(ch, lcdout); d440: 60 ec ldi r22, 0xC0 ; 192 d442: 73 e0 ldi r23, 0x03 ; 3 d444: 8c 2f mov r24, r28 d446: cc 0f add r28, r28 d448: 99 0b sbc r25, r25 } d44a: 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); d44c: 0d 94 a4 9f jmp 0x33f48 ; 0x33f48 0000d450 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); d450: 60 e0 ldi r22, 0x00 ; 0 d452: 80 e0 ldi r24, 0x00 ; 0 d454: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_ddram_address = 0; d458: 10 92 31 03 sts 0x0331, r1 ; 0x800331 } d45c: 08 95 ret 0000d45e : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d45e: 40 e4 ldi r20, 0x40 ; 64 d460: 56 e0 ldi r21, 0x06 ; 6 d462: 60 e0 ldi r22, 0x00 ; 0 d464: 81 e0 ldi r24, 0x01 ; 1 d466: 0e 94 83 5d call 0xbb06 ; 0xbb06 // 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; d46a: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d46e: 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)); d472: 48 e0 ldi r20, 0x08 ; 8 d474: 50 e0 ldi r21, 0x00 ; 0 d476: 6f e7 ldi r22, 0x7F ; 127 d478: 70 e0 ldi r23, 0x00 ; 0 d47a: 83 e3 ldi r24, 0x33 ; 51 d47c: 93 e0 ldi r25, 0x03 ; 3 d47e: 0d 94 6e a7 jmp 0x34edc ; 0x34edc 0000d482 : } 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) d482: 90 91 5c 02 lds r25, 0x025C ; 0x80025c d486: 98 17 cp r25, r24 d488: 09 f1 breq .+66 ; 0xd4cc { lcd_update_enabled = enabled; d48a: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c if (enabled) d48e: 88 23 and r24, r24 d490: e9 f0 breq .+58 ; 0xd4cc { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; d492: 10 92 07 05 sts 0x0507, r1 ; 0x800507 d496: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_encoder_diff = 0; d49a: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); d49e: 81 eb ldi r24, 0xB1 ; 177 d4a0: 93 e0 ldi r25, 0x03 ; 3 d4a2: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; d4a6: 0f 94 ce 0f call 0x21f9c ; 0x21f9c d4aa: 61 50 subi r22, 0x01 ; 1 d4ac: 71 09 sbc r23, r1 d4ae: 81 09 sbc r24, r1 d4b0: 91 09 sbc r25, r1 d4b2: 60 93 93 03 sts 0x0393, r22 ; 0x800393 d4b6: 70 93 94 03 sts 0x0394, r23 ; 0x800394 d4ba: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d4be: 90 93 96 03 sts 0x0396, r25 ; 0x800396 // Full update. lcd_clear(); d4c2: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_update(2); d4c6: 82 e0 ldi r24, 0x02 ; 2 d4c8: 0c 94 c3 69 jmp 0xd386 ; 0xd386 } else { // Clear the LCD always, or let it to the caller? } } } d4cc: 08 95 ret 0000d4ce : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { d4ce: cf 93 push r28 d4d0: c8 2f mov r28, r24 lcd_currline = 0; d4d2: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d4d6: 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)); d4da: 48 e0 ldi r20, 0x08 ; 8 d4dc: 50 e0 ldi r21, 0x00 ; 0 d4de: 6f e7 ldi r22, 0x7F ; 127 d4e0: 70 e0 ldi r23, 0x00 ; 0 d4e2: 83 e3 ldi r24, 0x33 ; 51 d4e4: 93 e0 ldi r25, 0x03 ; 3 d4e6: 0f 94 6e a7 call 0x34edc ; 0x34edc 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 d4ea: 44 e9 ldi r20, 0x94 ; 148 d4ec: 51 e1 ldi r21, 0x11 ; 17 d4ee: 62 e0 ldi r22, 0x02 ; 2 d4f0: 80 e3 ldi r24, 0x30 ; 48 d4f2: 0e 94 83 5d call 0xbb06 ; 0xbb06 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d4f6: 46 e9 ldi r20, 0x96 ; 150 d4f8: 50 e0 ldi r21, 0x00 ; 0 d4fa: 62 e0 ldi r22, 0x02 ; 2 d4fc: 80 e3 ldi r24, 0x30 ; 48 d4fe: 0e 94 83 5d call 0xbb06 ; 0xbb06 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d502: 46 e9 ldi r20, 0x96 ; 150 d504: 50 e0 ldi r21, 0x00 ; 0 d506: 62 e0 ldi r22, 0x02 ; 2 d508: 80 e3 ldi r24, 0x30 ; 48 d50a: 0e 94 83 5d call 0xbb06 ; 0xbb06 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); d50e: 46 e9 ldi r20, 0x96 ; 150 d510: 50 e0 ldi r21, 0x00 ; 0 d512: 62 e0 ldi r22, 0x02 ; 2 d514: 80 e2 ldi r24, 0x20 ; 32 d516: 0e 94 83 5d call 0xbb06 ; 0xbb06 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); d51a: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.513> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d51e: 44 e6 ldi r20, 0x64 ; 100 d520: 50 e0 ldi r21, 0x00 ; 0 d522: 60 e0 ldi r22, 0x00 ; 0 d524: 80 62 ori r24, 0x20 ; 32 d526: 0e 94 83 5d call 0xbb06 ; 0xbb06 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; d52a: 84 e0 ldi r24, 0x04 ; 4 d52c: 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); d530: 44 e6 ldi r20, 0x64 ; 100 d532: 50 e0 ldi r21, 0x00 ; 0 d534: 60 e0 ldi r22, 0x00 ; 0 d536: 8c e0 ldi r24, 0x0C ; 12 d538: 0e 94 83 5d call 0xbb06 ; 0xbb06 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(); d53c: c1 11 cpse r28, r1 d53e: 0e 94 2f 6a call 0xd45e ; 0xd45e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d542: 44 e6 ldi r20, 0x64 ; 100 d544: 50 e0 ldi r21, 0x00 ; 0 d546: 60 e0 ldi r22, 0x00 ; 0 d548: 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); } d54a: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d54c: 0c 94 83 5d jmp 0xbb06 ; 0xbb06 0000d550 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); d550: 81 e0 ldi r24, 0x01 ; 1 d552: 0c 94 67 6a jmp 0xd4ce ; 0xd4ce 0000d556 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { d556: cf 92 push r12 d558: df 92 push r13 d55a: ff 92 push r15 d55c: 0f 93 push r16 d55e: 1f 93 push r17 d560: cf 93 push r28 d562: df 93 push r29 d564: 00 d0 rcall .+0 ; 0xd566 d566: 00 d0 rcall .+0 ; 0xd568 d568: 1f 92 push r1 d56a: 1f 92 push r1 d56c: cd b7 in r28, 0x3d ; 61 d56e: de b7 in r29, 0x3e ; 62 if (value == '\n') { d570: 8a 30 cpi r24, 0x0A ; 10 d572: d9 f4 brne .+54 ; 0xd5aa if (lcd_currline > 3) lcd_currline = -1; d574: 80 91 32 03 lds r24, 0x0332 ; 0x800332 d578: 84 30 cpi r24, 0x04 ; 4 d57a: 18 f0 brcs .+6 ; 0xd582 d57c: 8f ef ldi r24, 0xFF ; 255 d57e: 80 93 32 03 sts 0x0332, r24 ; 0x800332 lcd_set_cursor(0, lcd_currline + 1); // LF d582: 60 91 32 03 lds r22, 0x0332 ; 0x800332 d586: 6f 5f subi r22, 0xFF ; 255 d588: 80 e0 ldi r24, 0x00 ; 0 d58a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } d58e: 28 96 adiw r28, 0x08 ; 8 d590: 0f b6 in r0, 0x3f ; 63 d592: f8 94 cli d594: de bf out 0x3e, r29 ; 62 d596: 0f be out 0x3f, r0 ; 63 d598: cd bf out 0x3d, r28 ; 61 d59a: df 91 pop r29 d59c: cf 91 pop r28 d59e: 1f 91 pop r17 d5a0: 0f 91 pop r16 d5a2: ff 90 pop r15 d5a4: df 90 pop r13 d5a6: cf 90 pop r12 d5a8: 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))) { d5aa: 90 e8 ldi r25, 0x80 ; 128 d5ac: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); d5ae: 44 e6 ldi r20, 0x64 ; 100 d5b0: 50 e0 ldi r21, 0x00 ; 0 d5b2: 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))) { d5b4: 9a 34 cpi r25, 0x4A ; 74 d5b6: 08 f5 brcc .+66 ; 0xd5fa // 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. d5b8: 48 2f mov r20, r24 d5ba: 40 58 subi r20, 0x80 ; 128 d5bc: 55 0b sbc r21, r21 d5be: 9a 01 movw r18, r20 d5c0: 96 e0 ldi r25, 0x06 ; 6 d5c2: 92 9f mul r25, r18 d5c4: a0 01 movw r20, r0 d5c6: 93 9f mul r25, r19 d5c8: 50 0d add r21, r0 d5ca: 11 24 eor r1, r1 d5cc: fa 01 movw r30, r20 d5ce: e4 5f subi r30, 0xF4 ; 244 d5d0: fa 48 sbci r31, 0x8A ; 138 d5d2: f4 90 lpm r15, Z d5d4: e3 e3 ldi r30, 0x33 ; 51 d5d6: f3 e0 ldi r31, 0x03 ; 3 d5d8: 30 e0 ldi r19, 0x00 ; 0 d5da: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; d5dc: 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)) { d5de: 61 91 ld r22, Z+ d5e0: 78 2f mov r23, r24 d5e2: 76 27 eor r23, r22 d5e4: 7f 77 andi r23, 0x7F ; 127 d5e6: 89 f4 brne .+34 ; 0xd60a lcd_custom_characters[i] = c; // mark the custom character as used d5e8: f9 01 movw r30, r18 d5ea: ed 5c subi r30, 0xCD ; 205 d5ec: fc 4f sbci r31, 0xFC ; 252 d5ee: 80 83 st Z, r24 d5f0: 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); d5f2: 44 e6 ldi r20, 0x64 ; 100 d5f4: 50 e0 ldi r21, 0x00 ; 0 d5f6: 61 e0 ldi r22, 0x01 ; 1 d5f8: 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); d5fa: 0e 94 83 5d call 0xbb06 ; 0xbb06 lcd_ddram_address++; // no need for preventing ddram overflow d5fe: 80 91 31 03 lds r24, 0x0331 ; 0x800331 d602: 8f 5f subi r24, 0xFF ; 255 d604: 80 93 31 03 sts 0x0331, r24 ; 0x800331 d608: c2 cf rjmp .-124 ; 0xd58e 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 d60a: 6f 37 cpi r22, 0x7F ; 127 d60c: 09 f0 breq .+2 ; 0xd610 d60e: 3c c0 rjmp .+120 ; 0xd688 lcd_custom_characters[i] = c; // mark the custom character as used d610: f9 01 movw r30, r18 d612: ed 5c subi r30, 0xCD ; 205 d614: fc 4f sbci r31, 0xFC ; 252 d616: 80 83 st Z, r24 slotToUse = i; d618: 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; d61a: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); d61c: fa 01 movw r30, r20 d61e: e9 5f subi r30, 0xF9 ; 249 d620: fa 48 sbci r31, 0x8A ; 138 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); d622: 8e 01 movw r16, r28 d624: 0f 5f subi r16, 0xFF ; 255 d626: 1f 4f sbci r17, 0xFF ; 255 d628: d8 01 movw r26, r16 d62a: 95 91 lpm r25, Z+ d62c: 88 e0 ldi r24, 0x08 ; 8 d62e: 18 2e mov r1, r24 0000d630 : d630: 10 fe sbrs r1, 0 d632: 05 90 lpm r0, Z+ d634: 02 94 swap r0 d636: 80 2d mov r24, r0 d638: 97 95 ror r25 d63a: 88 1f adc r24, r24 d63c: 8d 93 st X+, r24 d63e: 1a 94 dec r1 d640: b9 f7 brne .-18 ; 0xd630 lcd_command(LCD_SETCGRAMADDR | (location << 3)); d642: bf 2d mov r27, r15 d644: e8 e0 ldi r30, 0x08 ; 8 d646: be 02 muls r27, r30 d648: c0 01 movw r24, r0 d64a: 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); d64c: 44 e6 ldi r20, 0x64 ; 100 d64e: 50 e0 ldi r21, 0x00 ; 0 d650: 60 e0 ldi r22, 0x00 ; 0 d652: 80 64 ori r24, 0x40 ; 64 d654: 0e 94 83 5d call 0xbb06 ; 0xbb06 d658: 6e 01 movw r12, r28 d65a: f9 e0 ldi r31, 0x09 ; 9 d65c: cf 0e add r12, r31 d65e: 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); d660: 44 e6 ldi r20, 0x64 ; 100 d662: 50 e0 ldi r21, 0x00 ; 0 d664: 61 e0 ldi r22, 0x01 ; 1 d666: d8 01 movw r26, r16 d668: 8d 91 ld r24, X+ d66a: 8d 01 movw r16, r26 d66c: 0e 94 83 5d call 0xbb06 ; 0xbb06 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { d670: c0 16 cp r12, r16 d672: d1 06 cpc r13, r17 d674: a9 f7 brne .-22 ; 0xd660 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address d676: 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); d67a: 44 e6 ldi r20, 0x64 ; 100 d67c: 50 e0 ldi r21, 0x00 ; 0 d67e: 60 e0 ldi r22, 0x00 ; 0 d680: 80 68 ori r24, 0x80 ; 128 d682: 0e 94 83 5d call 0xbb06 ; 0xbb06 d686: b5 cf rjmp .-150 ; 0xd5f2 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 d688: 67 ff sbrs r22, 7 slotToUse = i; d68a: 92 2f mov r25, r18 d68c: 2f 5f subi r18, 0xFF ; 255 d68e: 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++) { d690: 28 30 cpi r18, 0x08 ; 8 d692: 31 05 cpc r19, r1 d694: 09 f0 breq .+2 ; 0xd698 d696: a3 cf rjmp .-186 ; 0xd5de } // 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) { d698: 9f 3f cpi r25, 0xFF ; 255 d69a: 09 f0 breq .+2 ; 0xd69e d69c: be cf rjmp .-132 ; 0xd61a d69e: a9 cf rjmp .-174 ; 0xd5f2 0000d6a0 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { d6a0: 8f 92 push r8 d6a2: 9f 92 push r9 d6a4: af 92 push r10 d6a6: bf 92 push r11 d6a8: ef 92 push r14 d6aa: ff 92 push r15 d6ac: 0f 93 push r16 d6ae: 1f 93 push r17 d6b0: cf 93 push r28 d6b2: df 93 push r29 d6b4: cd b7 in r28, 0x3d ; 61 d6b6: de b7 in r29, 0x3e ; 62 d6b8: a0 97 sbiw r28, 0x20 ; 32 d6ba: 0f b6 in r0, 0x3f ; 63 d6bc: f8 94 cli d6be: de bf out 0x3e, r29 ; 62 d6c0: 0f be out 0x3f, r0 ; 63 d6c2: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) d6c4: 61 15 cp r22, r1 d6c6: 71 05 cpc r23, r1 d6c8: 81 05 cpc r24, r1 d6ca: 91 05 cpc r25, r1 d6cc: 99 f4 brne .+38 ; 0xd6f4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d6ce: 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)); } d6d0: a0 96 adiw r28, 0x20 ; 32 d6d2: 0f b6 in r0, 0x3f ; 63 d6d4: f8 94 cli d6d6: de bf out 0x3e, r29 ; 62 d6d8: 0f be out 0x3f, r0 ; 63 d6da: cd bf out 0x3d, r28 ; 61 d6dc: df 91 pop r29 d6de: cf 91 pop r28 d6e0: 1f 91 pop r17 d6e2: 0f 91 pop r16 d6e4: ff 90 pop r15 d6e6: ef 90 pop r14 d6e8: bf 90 pop r11 d6ea: af 90 pop r10 d6ec: 9f 90 pop r9 d6ee: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d6f0: 0c 94 ab 6a jmp 0xd556 ; 0xd556 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; d6f4: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d6f6: 84 2e mov r8, r20 d6f8: 91 2c mov r9, r1 d6fa: b1 2c mov r11, r1 d6fc: a1 2c mov r10, r1 d6fe: 9e 01 movw r18, r28 d700: 2f 5f subi r18, 0xFF ; 255 d702: 3f 4f sbci r19, 0xFF ; 255 d704: 79 01 movw r14, r18 d706: a5 01 movw r20, r10 d708: 94 01 movw r18, r8 d70a: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> d70e: f7 01 movw r30, r14 d710: e0 0f add r30, r16 d712: f1 1d adc r31, r1 d714: 60 83 st Z, r22 n /= base; d716: b9 01 movw r22, r18 d718: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d71a: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) d71c: 61 15 cp r22, r1 d71e: 71 05 cpc r23, r1 d720: 81 05 cpc r24, r1 d722: 91 05 cpc r25, r1 d724: 81 f7 brne .-32 ; 0xd706 d726: 0e 0d add r16, r14 d728: 1f 2d mov r17, r15 d72a: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) d72c: e0 16 cp r14, r16 d72e: f1 06 cpc r15, r17 d730: 59 f0 breq .+22 ; 0xd748 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); d732: f8 01 movw r30, r16 d734: 82 91 ld r24, -Z d736: 8f 01 movw r16, r30 d738: 8a 30 cpi r24, 0x0A ; 10 d73a: 20 f4 brcc .+8 ; 0xd744 d73c: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d73e: 0e 94 ab 6a call 0xd556 ; 0xd556 d742: f4 cf rjmp .-24 ; 0xd72c { 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)); d744: 89 5c subi r24, 0xC9 ; 201 d746: fb cf rjmp .-10 ; 0xd73e } d748: a0 96 adiw r28, 0x20 ; 32 d74a: 0f b6 in r0, 0x3f ; 63 d74c: f8 94 cli d74e: de bf out 0x3e, r29 ; 62 d750: 0f be out 0x3f, r0 ; 63 d752: cd bf out 0x3d, r28 ; 61 d754: df 91 pop r29 d756: cf 91 pop r28 d758: 1f 91 pop r17 d75a: 0f 91 pop r16 d75c: ff 90 pop r15 d75e: ef 90 pop r14 d760: bf 90 pop r11 d762: af 90 pop r10 d764: 9f 90 pop r9 d766: 8f 90 pop r8 d768: 08 95 ret 0000d76a : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) d76a: cf 92 push r12 d76c: df 92 push r13 d76e: ef 92 push r14 d770: ff 92 push r15 d772: 6b 01 movw r12, r22 d774: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) d776: f7 fe sbrs r15, 7 d778: 0b c0 rjmp .+22 ; 0xd790 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d77a: 8d e2 ldi r24, 0x2D ; 45 d77c: 0e 94 ab 6a call 0xd556 ; 0xd556 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; d780: f0 94 com r15 d782: e0 94 com r14 d784: d0 94 com r13 d786: c0 94 com r12 d788: c1 1c adc r12, r1 d78a: d1 1c adc r13, r1 d78c: e1 1c adc r14, r1 d78e: f1 1c adc r15, r1 } lcd_printNumber(n, 10); d790: 4a e0 ldi r20, 0x0A ; 10 d792: c7 01 movw r24, r14 d794: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } d796: ff 90 pop r15 d798: ef 90 pop r14 d79a: df 90 pop r13 d79c: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); d79e: 0c 94 50 6b jmp 0xd6a0 ; 0xd6a0 0000d7a2 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { d7a2: 0f 93 push r16 d7a4: 1f 93 push r17 d7a6: cf 93 push r28 d7a8: 8c 01 movw r16, r24 d7aa: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { d7ac: cc 23 and r28, r28 d7ae: 59 f0 breq .+22 ; 0xd7c6 d7b0: f8 01 movw r30, r16 d7b2: 24 91 lpm r18, Z d7b4: 22 23 and r18, r18 d7b6: 39 f0 breq .+14 ; 0xd7c6 lcd_write(pgm_read_byte(s++)); d7b8: 0f 5f subi r16, 0xFF ; 255 d7ba: 1f 4f sbci r17, 0xFF ; 255 d7bc: 84 91 lpm r24, Z d7be: 0e 94 ab 6a call 0xd556 ; 0xd556 --len; d7c2: c1 50 subi r28, 0x01 ; 1 d7c4: f3 cf rjmp .-26 ; 0xd7ac } lcd_space(len); d7c6: 8c 2f mov r24, r28 d7c8: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 return len; } d7cc: 8c 2f mov r24, r28 d7ce: cf 91 pop r28 d7d0: 1f 91 pop r17 d7d2: 0f 91 pop r16 d7d4: 08 95 ret 0000d7d6 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { d7d6: 0f 93 push r16 d7d8: 1f 93 push r17 d7da: cf 93 push r28 d7dc: 8c 01 movw r16, r24 d7de: c6 2f mov r28, r22 while (len && *s) { d7e0: cc 23 and r28, r28 d7e2: 49 f0 breq .+18 ; 0xd7f6 d7e4: f8 01 movw r30, r16 d7e6: 81 91 ld r24, Z+ d7e8: 8f 01 movw r16, r30 d7ea: 88 23 and r24, r24 d7ec: 21 f0 breq .+8 ; 0xd7f6 lcd_write(*(s++)); d7ee: 0e 94 ab 6a call 0xd556 ; 0xd556 --len; d7f2: c1 50 subi r28, 0x01 ; 1 d7f4: f5 cf rjmp .-22 ; 0xd7e0 } lcd_space(len); d7f6: 8c 2f mov r24, r28 d7f8: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 return len; } d7fc: 8c 2f mov r24, r28 d7fe: cf 91 pop r28 d800: 1f 91 pop r17 d802: 0f 91 pop r16 d804: 08 95 ret 0000d806 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { d806: cf 93 push r28 d808: df 93 push r29 d80a: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); d80c: 89 91 ld r24, Y+ d80e: 88 23 and r24, r24 d810: 19 f0 breq .+6 ; 0xd818 d812: 0e 94 ab 6a call 0xd556 ; 0xd556 d816: fa cf rjmp .-12 ; 0xd80c } d818: df 91 pop r29 d81a: cf 91 pop r28 d81c: 08 95 ret 0000d81e : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); d81e: 0e 94 ab 6a call 0xd556 ; 0xd556 return 0; } d822: 90 e0 ldi r25, 0x00 ; 0 d824: 80 e0 ldi r24, 0x00 ; 0 d826: 08 95 ret 0000d828 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; d828: 10 92 63 03 sts 0x0363, r1 ; 0x800363 lcd_longpress_trigger = 0; d82c: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } d830: 08 95 ret 0000d832 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { d832: cf 93 push r28 bool clicked = LCD_CLICKED; d834: 80 91 63 03 lds r24, 0x0363 ; 0x800363 d838: c1 e0 ldi r28, 0x01 ; 1 d83a: 81 11 cpse r24, r1 d83c: 04 c0 rjmp .+8 ; 0xd846 d83e: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } d840: 8c 2f mov r24, r28 d842: cf 91 pop r28 d844: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); d846: 0e 94 14 6c call 0xd828 ; 0xd828 d84a: fa cf rjmp .-12 ; 0xd840 0000d84c : 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); d84c: 8e ef ldi r24, 0xFE ; 254 d84e: 9f e0 ldi r25, 0x0F ; 15 d850: 0f 94 3c a1 call 0x34278 ; 0x34278 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); d854: 8e 3f cpi r24, 0xFE ; 254 d856: 39 f0 breq .+14 ; 0xd866 d858: 91 e0 ldi r25, 0x01 ; 1 d85a: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d85e: 28 13 cpse r18, r24 d860: 90 e0 ldi r25, 0x00 ; 0 d862: 89 2f mov r24, r25 d864: 08 95 ret d866: 80 e0 ldi r24, 0x00 ; 0 } d868: 08 95 ret 0000d86a : return _n("??"); } void lang_reset(void) { lang_selected = 0; d86a: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); d86e: 6e ef ldi r22, 0xFE ; 254 d870: 8e ef ldi r24, 0xFE ; 254 d872: 9f e0 ldi r25, 0x0F ; 15 d874: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0000d878 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d878: 85 37 cpi r24, 0x75 ; 117 d87a: 28 e6 ldi r18, 0x68 ; 104 d87c: 92 07 cpc r25, r18 d87e: 09 f4 brne .+2 ; 0xd882 d880: 59 c0 rjmp .+178 ; 0xd934 d882: f8 f4 brcc .+62 ; 0xd8c2 d884: 8e 36 cpi r24, 0x6E ; 110 d886: 25 e6 ldi r18, 0x65 ; 101 d888: 92 07 cpc r25, r18 d88a: 09 f4 brne .+2 ; 0xd88e d88c: 59 c0 rjmp .+178 ; 0xd940 d88e: 50 f4 brcc .+20 ; 0xd8a4 d890: 83 37 cpi r24, 0x73 ; 115 d892: 23 e6 ldi r18, 0x63 ; 99 d894: 92 07 cpc r25, r18 d896: b1 f1 breq .+108 ; 0xd904 d898: 85 36 cpi r24, 0x65 ; 101 d89a: 94 46 sbci r25, 0x64 ; 100 d89c: b1 f1 breq .+108 ; 0xd90a //#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("??"); d89e: 84 e5 ldi r24, 0x54 ; 84 d8a0: 94 e6 ldi r25, 0x64 ; 100 d8a2: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8a4: 82 37 cpi r24, 0x72 ; 114 d8a6: 26 e6 ldi r18, 0x66 ; 102 d8a8: 92 07 cpc r25, r18 d8aa: 91 f1 breq .+100 ; 0xd910 d8ac: 82 37 cpi r24, 0x72 ; 114 d8ae: 28 e6 ldi r18, 0x68 ; 104 d8b0: 92 07 cpc r25, r18 d8b2: 09 f4 brne .+2 ; 0xd8b6 d8b4: 42 c0 rjmp .+132 ; 0xd93a d8b6: 83 37 cpi r24, 0x73 ; 115 d8b8: 95 46 sbci r25, 0x65 ; 101 d8ba: 89 f7 brne .-30 ; 0xd89e { 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"); d8bc: 8b ea ldi r24, 0xAB ; 171 d8be: 94 e6 ldi r25, 0x64 ; 100 d8c0: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8c2: 8c 36 cpi r24, 0x6C ; 108 d8c4: 20 e7 ldi r18, 0x70 ; 112 d8c6: 92 07 cpc r25, r18 d8c8: 31 f1 breq .+76 ; 0xd916 d8ca: 70 f4 brcc .+28 ; 0xd8e8 d8cc: 8c 36 cpi r24, 0x6C ; 108 d8ce: 2e e6 ldi r18, 0x6E ; 110 d8d0: 92 07 cpc r25, r18 d8d2: 21 f1 breq .+72 ; 0xd91c d8d4: 8f 36 cpi r24, 0x6F ; 111 d8d6: 2e e6 ldi r18, 0x6E ; 110 d8d8: 92 07 cpc r25, r18 d8da: 31 f1 breq .+76 ; 0xd928 d8dc: 84 37 cpi r24, 0x74 ; 116 d8de: 99 46 sbci r25, 0x69 ; 105 d8e0: f1 f6 brne .-68 ; 0xd89e 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"); d8e2: 89 e9 ldi r24, 0x99 ; 153 d8e4: 94 e6 ldi r25, 0x64 ; 100 d8e6: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8e8: 8b 36 cpi r24, 0x6B ; 107 d8ea: 23 e7 ldi r18, 0x73 ; 115 d8ec: 92 07 cpc r25, r18 d8ee: f9 f0 breq .+62 ; 0xd92e d8f0: 86 37 cpi r24, 0x76 ; 118 d8f2: 23 e7 ldi r18, 0x73 ; 115 d8f4: 92 07 cpc r25, r18 d8f6: a9 f0 breq .+42 ; 0xd922 d8f8: 8f 36 cpi r24, 0x6F ; 111 d8fa: 92 47 sbci r25, 0x72 ; 114 d8fc: 81 f6 brne .-96 ; 0xd89e #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 d8fe: 87 e5 ldi r24, 0x57 ; 87 d900: 94 e6 ldi r25, 0x64 ; 100 d902: 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"); d904: 8b eb ldi r24, 0xBB ; 187 d906: 94 e6 ldi r25, 0x64 ; 100 d908: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); d90a: 83 eb ldi r24, 0xB3 ; 179 d90c: 94 e6 ldi r25, 0x64 ; 100 d90e: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); d910: 82 ea ldi r24, 0xA2 ; 162 d912: 94 e6 ldi r25, 0x64 ; 100 d914: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); d916: 82 e9 ldi r24, 0x92 ; 146 d918: 94 e6 ldi r25, 0x64 ; 100 d91a: 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 d91c: 87 e8 ldi r24, 0x87 ; 135 d91e: 94 e6 ldi r25, 0x64 ; 100 d920: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution d922: 8f e7 ldi r24, 0x7F ; 127 d924: 94 e6 ldi r25, 0x64 ; 100 d926: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution d928: 89 e7 ldi r24, 0x79 ; 121 d92a: 94 e6 ldi r25, 0x64 ; 100 d92c: 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 d92e: 8e e6 ldi r24, 0x6E ; 110 d930: 94 e6 ldi r25, 0x64 ; 100 d932: 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 d934: 87 e6 ldi r24, 0x67 ; 103 d936: 94 e6 ldi r25, 0x64 ; 100 d938: 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 d93a: 8e e5 ldi r24, 0x5E ; 94 d93c: 94 e6 ldi r25, 0x64 ; 100 d93e: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); d940: 83 ec ldi r24, 0xC3 ; 195 d942: 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("??"); } d944: 08 95 ret 0000d946 : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) d946: e3 e0 ldi r30, 0x03 ; 3 d948: f5 e7 ldi r31, 0x75 ; 117 d94a: 85 91 lpm r24, Z+ d94c: 95 91 lpm r25, Z+ d94e: a5 91 lpm r26, Z+ d950: b4 91 lpm r27, Z d952: 8f 3f cpi r24, 0xFF ; 255 d954: 9f 4f sbci r25, 0xFF ; 255 d956: af 4f sbci r26, 0xFF ; 255 d958: bf 4f sbci r27, 0xFF ; 255 d95a: b1 f0 breq .+44 ; 0xd988 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; d95c: 20 e0 ldi r18, 0x00 ; 0 d95e: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) d960: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d962: f9 01 movw r30, r18 d964: 45 91 lpm r20, Z+ d966: 55 91 lpm r21, Z+ d968: 65 91 lpm r22, Z+ d96a: 74 91 lpm r23, Z d96c: 45 3a cpi r20, 0xA5 ; 165 d96e: 5a 45 sbci r21, 0x5A ; 90 d970: 64 4b sbci r22, 0xB4 ; 180 d972: 7b 44 sbci r23, 0x4B ; 75 d974: 09 f0 breq .+2 ; 0xd978 d976: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); d978: f9 01 movw r30, r18 d97a: 34 96 adiw r30, 0x04 ; 4 d97c: 45 91 lpm r20, Z+ d97e: 54 91 lpm r21, Z d980: 24 0f add r18, r20 d982: 35 1f adc r19, r21 count++; d984: 8f 5f subi r24, 0xFF ; 255 d986: ed cf rjmp .-38 ; 0xd962 } 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 d988: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } d98a: 08 95 ret 0000d98c : 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) { d98c: 0f 93 push r16 d98e: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language d990: 81 11 cpse r24, r1 d992: 13 c0 rjmp .+38 ; 0xd9ba { lang_table = 0; d994: 10 92 2e 03 sts 0x032E, r1 ; 0x80032e d998: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; d99c: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) d9a0: 90 91 2f 03 lds r25, 0x032F ; 0x80032f d9a4: 98 13 cpse r25, r24 d9a6: 5c c0 rjmp .+184 ; 0xda60 d9a8: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); d9aa: 8e ef ldi r24, 0xFE ; 254 d9ac: 9f e0 ldi r25, 0x0F ; 15 d9ae: 0f 94 60 a1 call 0x342c0 ; 0x342c0 return 1; d9b2: 81 e0 ldi r24, 0x01 ; 1 } return 0; } d9b4: 1f 91 pop r17 d9b6: 0f 91 pop r16 d9b8: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) d9ba: 81 30 cpi r24, 0x01 ; 1 d9bc: 89 f7 brne .-30 ; 0xd9a0 { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d9be: e0 e0 ldi r30, 0x00 ; 0 d9c0: f1 e0 ldi r31, 0x01 ; 1 d9c2: 45 91 lpm r20, Z+ d9c4: 55 91 lpm r21, Z+ d9c6: 65 91 lpm r22, Z+ d9c8: 74 91 lpm r23, Z d9ca: 45 3a cpi r20, 0xA5 ; 165 d9cc: 5a 45 sbci r21, 0x5A ; 90 d9ce: 64 4b sbci r22, 0xB4 ; 180 d9d0: 7b 44 sbci r23, 0x4B ; 75 d9d2: 31 f7 brne .-52 ; 0xd9a0 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); d9d4: e4 e0 ldi r30, 0x04 ; 4 d9d6: f1 e0 ldi r31, 0x01 ; 1 d9d8: a5 91 lpm r26, Z+ d9da: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); d9dc: e8 e0 ldi r30, 0x08 ; 8 d9de: f1 e0 ldi r31, 0x01 ; 1 d9e0: 65 91 lpm r22, Z+ d9e2: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) d9e4: 50 e0 ldi r21, 0x00 ; 0 d9e6: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; d9e8: 30 e0 ldi r19, 0x00 ; 0 d9ea: 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++) d9ec: a4 17 cp r26, r20 d9ee: b5 07 cpc r27, r21 d9f0: 29 f5 brne .+74 ; 0xda3c sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum d9f2: 26 1b sub r18, r22 d9f4: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes d9f6: 32 27 eor r19, r18 d9f8: 23 27 eor r18, r19 d9fa: 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)) d9fc: 62 17 cp r22, r18 d9fe: 73 07 cpc r23, r19 da00: 09 f0 breq .+2 ; 0xda04 da02: ce cf rjmp .-100 ; 0xd9a0 if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid da04: ec e0 ldi r30, 0x0C ; 12 da06: f1 e0 ldi r31, 0x01 ; 1 da08: 05 91 lpm r16, Z+ da0a: 15 91 lpm r17, Z+ da0c: 25 91 lpm r18, Z+ da0e: 34 91 lpm r19, Z da10: e3 e0 ldi r30, 0x03 ; 3 da12: f5 e7 ldi r31, 0x75 ; 117 da14: 45 91 lpm r20, Z+ da16: 55 91 lpm r21, Z+ da18: 65 91 lpm r22, Z+ da1a: 74 91 lpm r23, Z da1c: 04 17 cp r16, r20 da1e: 15 07 cpc r17, r21 da20: 26 07 cpc r18, r22 da22: 37 07 cpc r19, r23 da24: 09 f0 breq .+2 ; 0xda28 da26: bc cf rjmp .-136 ; 0xd9a0 { lang_table = (lang_table_t*)table; // set table pointer da28: 20 e0 ldi r18, 0x00 ; 0 da2a: 31 e0 ldi r19, 0x01 ; 1 da2c: 30 93 2e 03 sts 0x032E, r19 ; 0x80032e da30: 20 93 2d 03 sts 0x032D, r18 ; 0x80032d lang_selected = lang; // set language id da34: 91 e0 ldi r25, 0x01 ; 1 da36: 90 93 2f 03 sts 0x032F, r25 ; 0x80032f da3a: b2 cf rjmp .-156 ; 0xd9a0 { 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); da3c: fa 01 movw r30, r20 da3e: e0 50 subi r30, 0x00 ; 0 da40: ff 4f sbci r31, 0xFF ; 255 da42: e4 91 lpm r30, Z da44: f0 e0 ldi r31, 0x00 ; 0 da46: 98 e0 ldi r25, 0x08 ; 8 da48: 40 fd sbrc r20, 0 da4a: 90 e0 ldi r25, 0x00 ; 0 da4c: 02 c0 rjmp .+4 ; 0xda52 da4e: ee 0f add r30, r30 da50: ff 1f adc r31, r31 da52: 9a 95 dec r25 da54: e2 f7 brpl .-8 ; 0xda4e da56: 2e 0f add r18, r30 da58: 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++) da5a: 4f 5f subi r20, 0xFF ; 255 da5c: 5f 4f sbci r21, 0xFF ; 255 da5e: c6 cf rjmp .-116 ; 0xd9ec if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; da60: 80 e0 ldi r24, 0x00 ; 0 da62: a8 cf rjmp .-176 ; 0xd9b4 0000da64 : //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. da64: 20 91 2f 03 lds r18, 0x032F ; 0x80032f da68: 21 11 cpse r18, r1 da6a: 04 c0 rjmp .+8 ; 0xda74 da6c: fc 01 movw r30, r24 da6e: 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 } da70: cf 01 movw r24, r30 da72: 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. da74: 40 91 2d 03 lds r20, 0x032D ; 0x80032d da78: 50 91 2e 03 lds r21, 0x032E ; 0x80032e da7c: 41 15 cp r20, r1 da7e: 51 05 cpc r21, r1 da80: a9 f3 breq .-22 ; 0xda6c uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id da82: fc 01 movw r30, r24 da84: 25 91 lpm r18, Z+ da86: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. da88: 2f 3f cpi r18, 0xFF ; 255 da8a: 32 07 cpc r19, r18 da8c: 79 f3 breq .-34 ; 0xda6c ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset da8e: f9 01 movw r30, r18 da90: 38 96 adiw r30, 0x08 ; 8 da92: ee 0f add r30, r30 da94: ff 1f adc r31, r31 da96: e4 0f add r30, r20 da98: f5 1f adc r31, r21 da9a: 25 91 lpm r18, Z+ da9c: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character da9e: fa 01 movw r30, r20 daa0: e2 0f add r30, r18 daa2: f3 1f adc r31, r19 daa4: 24 91 lpm r18, Z daa6: 22 23 and r18, r18 daa8: 09 f3 breq .-62 ; 0xda6c daaa: e2 cf rjmp .-60 ; 0xda70 0000daac : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { daac: cf 93 push r28 daae: df 93 push r29 dab0: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; dab2: 20 e0 ldi r18, 0x00 ; 0 dab4: 30 e0 ldi r19, 0x00 ; 0 dab6: 4c e8 ldi r20, 0x8C ; 140 dab8: 52 e4 ldi r21, 0x42 ; 66 daba: 60 91 01 12 lds r22, 0x1201 ; 0x801201 dabe: 70 91 02 12 lds r23, 0x1202 ; 0x801202 dac2: 80 91 03 12 lds r24, 0x1203 ; 0x801203 dac6: 90 91 04 12 lds r25, 0x1204 ; 0x801204 daca: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> dace: 60 93 01 12 sts 0x1201, r22 ; 0x801201 dad2: 70 93 02 12 sts 0x1202, r23 ; 0x801202 dad6: 80 93 03 12 sts 0x1203, r24 ; 0x801203 dada: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); dade: 60 e0 ldi r22, 0x00 ; 0 dae0: 70 e0 ldi r23, 0x00 ; 0 dae2: 80 ea ldi r24, 0xA0 ; 160 dae4: 91 e4 ldi r25, 0x41 ; 65 dae6: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 load_filament_final_feed(); daea: 0e 94 f6 5e call 0xbdec ; 0xbdec } void lcd_loading_filament(const char* filament_name) { lcd_clear(); daee: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); daf2: 84 ec ldi r24, 0xC4 ; 196 daf4: 9a e5 ldi r25, 0x5A ; 90 daf6: 0e 94 32 6d call 0xda64 ; 0xda64 dafa: ac 01 movw r20, r24 dafc: 60 e0 ldi r22, 0x00 ; 0 dafe: 80 e0 ldi r24, 0x00 ; 0 db00: 0e 94 10 6a call 0xd420 ; 0xd420 if (filament_name[0]) { db04: 88 81 ld r24, Y db06: 88 23 and r24, r24 db08: 39 f0 breq .+14 ; 0xdb18 lcd_set_cursor(0, 1); db0a: 61 e0 ldi r22, 0x01 ; 1 db0c: 80 e0 ldi r24, 0x00 ; 0 db0e: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(filament_name); db12: ce 01 movw r24, r28 db14: 0e 94 03 6c call 0xd806 ; 0xd806 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); db18: 86 eb ldi r24, 0xB6 ; 182 db1a: 99 e3 ldi r25, 0x39 ; 57 db1c: 0e 94 32 6d call 0xda64 ; 0xda64 db20: ac 01 movw r20, r24 db22: 62 e0 ldi r22, 0x02 ; 2 db24: 80 e0 ldi r24, 0x00 ; 0 db26: 0e 94 10 6a call 0xd420 ; 0xd420 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 db2a: 83 e4 ldi r24, 0x43 ; 67 db2c: 9b e2 ldi r25, 0x2B ; 43 db2e: 0f 94 3f 0c call 0x2187e ; 0x2187e lcd_loading_filament(filament_name); st_synchronize(); } db32: df 91 pop r29 db34: 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(); db36: 0d 94 a0 22 jmp 0x24540 ; 0x24540 0000db3a : * 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; db3a: 0f 94 e8 41 call 0x283d0 ; 0x283d0 db3e: 8f 3f cpi r24, 0xFF ; 255 db40: 11 f1 breq .+68 ; 0xdb86 lcd_update_enable(false); db42: 80 e0 ldi r24, 0x00 ; 0 db44: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); db48: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); db4c: 80 e2 ldi r24, 0x20 ; 32 db4e: 97 e5 ldi r25, 0x57 ; 87 db50: 0e 94 32 6d call 0xda64 ; 0xda64 db54: ac 01 movw r20, r24 db56: 61 e0 ldi r22, 0x01 ; 1 db58: 80 e0 ldi r24, 0x00 ; 0 db5a: 0e 94 10 6a call 0xd420 ; 0xd420 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); db5e: 80 e2 ldi r24, 0x20 ; 32 db60: 0e 94 ab 6a call 0xd556 ; 0xd556 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); db64: 0f 94 e8 41 call 0x283d0 ; 0x283d0 db68: 68 2f mov r22, r24 db6a: 70 e0 ldi r23, 0x00 ; 0 db6c: 6f 5f subi r22, 0xFF ; 255 db6e: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); db70: 07 2e mov r0, r23 db72: 00 0c add r0, r0 db74: 88 0b sbc r24, r24 db76: 99 0b sbc r25, r25 db78: 0e 94 b5 6b call 0xd76a ; 0xd76a // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); db7c: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 lcd_update_enable(true); db80: 81 e0 ldi r24, 0x01 ; 1 db82: 0c 94 41 6a jmp 0xd482 ; 0xd482 } db86: 08 95 ret 0000db88 <__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 { db88: 1f 92 push r1 db8a: 0f 92 push r0 db8c: 0f b6 in r0, 0x3f ; 63 db8e: 0f 92 push r0 db90: 11 24 eor r1, r1 db92: 0b b6 in r0, 0x3b ; 59 db94: 0f 92 push r0 db96: 2f 93 push r18 db98: 8f 93 push r24 db9a: 9f 93 push r25 db9c: ef 93 push r30 db9e: ff 93 push r31 switch(state){ dba0: e0 91 28 03 lds r30, 0x0328 ; 0x800328 dba4: e8 30 cpi r30, 0x08 ; 8 dba6: e8 f4 brcc .+58 ; 0xdbe2 <__vector_23+0x5a> dba8: f0 e0 ldi r31, 0x00 ; 0 dbaa: 88 27 eor r24, r24 dbac: e5 52 subi r30, 0x25 ; 37 dbae: f2 49 sbci r31, 0x92 ; 146 dbb0: 8f 4f sbci r24, 0xFF ; 255 dbb2: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> dbb6: e3 6d ori r30, 0xD3 ; 211 dbb8: fd 6d ori r31, 0xDD ; 221 dbba: 08 6e ori r16, 0xE8 ; 232 dbbc: 16 6e ori r17, 0xE6 ; 230 dbbe: 2c 6e ori r18, 0xEC ; 236 dbc0: 35 6e ori r19, 0xE5 ; 229 dbc2: 58 6e ori r21, 0xE8 ; 232 dbc4: 6a 6e ori r22, 0xEA ; 234 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin dbc6: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dbca: 81 11 cpse r24, r1 dbcc: 0a c0 rjmp .+20 ; 0xdbe2 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! dbce: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dbd2: 88 0f add r24, r24 dbd4: 80 93 27 03 sts 0x0327, r24 ; 0x800327 if( pwm != 0 ){ dbd8: 88 23 and r24, r24 dbda: 19 f0 breq .+6 ; 0xdbe2 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period dbdc: 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 dbde: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } dbe2: ff 91 pop r31 dbe4: ef 91 pop r30 dbe6: 9f 91 pop r25 dbe8: 8f 91 pop r24 dbea: 2f 91 pop r18 dbec: 0f 90 pop r0 dbee: 0b be out 0x3b, r0 ; 59 dbf0: 0f 90 pop r0 dbf2: 0f be out 0x3f, r0 ; 63 dbf4: 0f 90 pop r0 dbf6: 1f 90 pop r1 dbf8: 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) dbfa: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dbfe: 8f 5f subi r24, 0xFF ; 255 dc00: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter > pwm ){ dc04: 90 91 27 03 lds r25, 0x0327 ; 0x800327 dc08: 98 17 cp r25, r24 dc0a: 58 f3 brcs .-42 ; 0xdbe2 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 dc0c: 82 e0 ldi r24, 0x02 ; 2 dc0e: e7 cf rjmp .-50 ; 0xdbde <__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 dc10: 83 e0 ldi r24, 0x03 ; 3 dc12: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE dc16: 8f e0 ldi r24, 0x0F ; 15 dc18: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle dc1c: 8f ef ldi r24, 0xFF ; 255 dc1e: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz dc20: 81 e0 ldi r24, 0x01 ; 1 dc22: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) dc24: 84 b5 in r24, 0x24 ; 36 dc26: 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 dc28: 84 bd out 0x24, r24 ; 36 dc2a: db cf rjmp .-74 ; 0xdbe2 <__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; dc2c: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dc30: 82 95 swap r24 dc32: 80 7f andi r24, 0xF0 ; 240 dc34: 81 95 neg r24 dc36: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ dc38: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dc3c: 88 23 and r24, r24 dc3e: 21 f0 breq .+8 ; 0xdc48 <__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; dc40: 81 50 subi r24, 0x01 ; 1 dc42: 80 93 25 03 sts 0x0325, r24 ; 0x800325 dc46: cd cf rjmp .-102 ; 0xdbe2 <__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; dc48: 84 e0 ldi r24, 0x04 ; 4 dc4a: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty dc4e: 8f ef ldi r24, 0xFF ; 255 dc50: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle dc52: 8e ef ldi r24, 0xFE ; 254 dc54: 86 bd out 0x26, r24 ; 38 dc56: c5 cf rjmp .-118 ; 0xdbe2 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; dc58: 85 e0 ldi r24, 0x05 ; 5 dc5a: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty dc5e: 8f ef ldi r24, 0xFF ; 255 dc60: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle dc62: 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 dc64: 82 e0 ldi r24, 0x02 ; 2 dc66: 85 bd out 0x25, r24 ; 37 dc68: bc cf rjmp .-136 ; 0xdbe2 <__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; dc6a: 2f ef ldi r18, 0xFF ; 255 dc6c: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin dc6e: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dc72: 81 11 cpse r24, r1 dc74: b6 cf rjmp .-148 ; 0xdbe2 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less dc76: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dc7a: 8f 5f subi r24, 0xFF ; 255 dc7c: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter < pwm ){ dc80: 90 91 27 03 lds r25, 0x0327 ; 0x800327 dc84: 89 17 cp r24, r25 dc86: 08 f4 brcc .+2 ; 0xdc8a <__vector_23+0x102> dc88: ac cf rjmp .-168 ; 0xdbe2 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain dc8a: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dc8e: 90 e0 ldi r25, 0x00 ; 0 dc90: 8f 37 cpi r24, 0x7F ; 127 dc92: 91 05 cpc r25, r1 dc94: 0c f0 brlt .+2 ; 0xdc98 <__vector_23+0x110> dc96: a5 cf rjmp .-182 ; 0xdbe2 <__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; dc98: 86 e0 ldi r24, 0x06 ; 6 dc9a: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE dc9e: 8f e0 ldi r24, 0x0F ; 15 dca0: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle dca4: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz dca6: 81 e0 ldi r24, 0x01 ; 1 dca8: 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 dcaa: 84 b5 in r24, 0x24 ; 36 dcac: 80 61 ori r24, 0x10 ; 16 dcae: bc cf rjmp .-136 ; 0xdc28 <__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 dcb0: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dcb4: 82 95 swap r24 dcb6: 80 7f andi r24, 0xF0 ; 240 dcb8: 81 95 neg r24 dcba: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ dcbc: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dcc0: 81 11 cpse r24, r1 dcc2: be cf rjmp .-132 ; 0xdc40 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; dcc4: 87 e0 ldi r24, 0x07 ; 7 dcc6: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes dcca: 80 e8 ldi r24, 0x80 ; 128 dccc: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dcce: 8f ef ldi r24, 0xFF ; 255 dcd0: 88 bd out 0x28, r24 ; 40 dcd2: 87 cf rjmp .-242 ; 0xdbe2 <__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 dcd4: 10 92 28 03 sts 0x0328, r1 ; 0x800328 TCNT0 = 128; dcd8: 80 e8 ldi r24, 0x80 ; 128 dcda: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dcdc: 8f ef ldi r24, 0xFF ; 255 dcde: 88 bd out 0x28, r24 ; 40 dce0: c1 cf rjmp .-126 ; 0xdc64 <__vector_23+0xdc> 0000dce2 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { dce2: cf 93 push r28 dce4: df 93 push r29 dce6: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); dce8: 87 e6 ldi r24, 0x67 ; 103 dcea: 9f e0 ldi r25, 0x0F ; 15 dcec: 0f 94 3c a1 call 0x34278 ; 0x34278 dcf0: 91 e0 ldi r25, 0x01 ; 1 dcf2: 81 11 cpse r24, r1 dcf4: 01 c0 rjmp .+2 ; 0xdcf8 dcf6: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { dcf8: 81 e0 ldi r24, 0x01 ; 1 dcfa: 28 81 ld r18, Y dcfc: 21 11 cpse r18, r1 dcfe: 01 c0 rjmp .+2 ; 0xdd02 dd00: 80 e0 ldi r24, 0x00 ; 0 dd02: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; dd04: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); dd06: 87 e0 ldi r24, 0x07 ; 7 dd08: 9f e0 ldi r25, 0x0F ; 15 dd0a: 0f 94 3c a1 call 0x34278 ; 0x34278 dd0e: 91 e0 ldi r25, 0x01 ; 1 dd10: 81 11 cpse r24, r1 dd12: 01 c0 rjmp .+2 ; 0xdd16 dd14: 90 e0 ldi r25, 0x00 ; 0 dd16: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); dd18: 85 ed ldi r24, 0xD5 ; 213 dd1a: 9e e0 ldi r25, 0x0E ; 14 dd1c: 0f 94 3c a1 call 0x34278 ; 0x34278 dd20: 91 e0 ldi r25, 0x01 ; 1 dd22: 81 11 cpse r24, r1 dd24: 01 c0 rjmp .+2 ; 0xdd28 dd26: 90 e0 ldi r25, 0x00 ; 0 dd28: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); dd2a: 87 e4 ldi r24, 0x47 ; 71 dd2c: 9d e0 ldi r25, 0x0D ; 13 dd2e: 0f 94 3c a1 call 0x34278 ; 0x34278 if (sensorActionOnError == SensorActionOnError::_Undef) { dd32: 8f 3f cpi r24, 0xFF ; 255 dd34: 21 f0 breq .+8 ; 0xdd3e 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); dd36: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } dd38: df 91 pop r29 dd3a: cf 91 pop r28 dd3c: 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; dd3e: 18 86 std Y+8, r1 ; 0x08 dd40: fb cf rjmp .-10 ; 0xdd38 0000dd42 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { dd42: cf 93 push r28 dd44: c8 2f mov r28, r24 dd46: 68 2f mov r22, r24 dd48: 87 e6 ldi r24, 0x67 ; 103 dd4a: 9f e0 ldi r25, 0x0F ; 15 dd4c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { dd50: cc 23 and r28, r28 dd52: 19 f0 breq .+6 ; 0xdd5a fsensor.init(); } else { fsensor.deinit(); } } dd54: 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(); dd56: 0d 94 9b 53 jmp 0x2a736 ; 0x2a736 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 dd5a: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup dd5c: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; dd5e: 10 92 84 16 sts 0x1684, r1 ; 0x801684 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } dd62: cf 91 pop r28 dd64: 08 95 ret 0000dd66 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; dd66: 10 92 84 03 sts 0x0384, r1 ; 0x800384 extruder_autofan_last_check = _millis(); dd6a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c dd6e: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d dd72: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e dd76: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f dd7a: 90 93 90 16 sts 0x1690, r25 ; 0x801690 } dd7e: 08 95 ret 0000dd80 : 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; dd80: 80 93 24 03 sts 0x0324, r24 ; 0x800324 newFanSpeed = 0; if (fanState & 0x01) dd84: 80 fd sbrc r24, 0 dd86: 1c c0 rjmp .+56 ; 0xddc0 { //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; dd88: 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); dd8c: 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) dd90: 8f ef ldi r24, 0xFF ; 255 dd92: 82 0f add r24, r18 dd94: 8e 3f cpi r24, 0xFE ; 254 dd96: e8 f0 brcs .+58 ; 0xddd2 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); dd98: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> dd9c: 87 7f andi r24, 0xF7 ; 247 dd9e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; dda2: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> dda6: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); ddaa: 9f b7 in r25, 0x3f ; 63 ddac: 22 23 and r18, r18 ddae: 61 f0 breq .+24 ; 0xddc8 ddb0: f8 94 cli ddb2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ddb6: 80 62 ori r24, 0x20 ; 32 ddb8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ddbc: 9f bf out 0x3f, r25 ; 63 ddbe: 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; ddc0: 8f ef ldi r24, 0xFF ; 255 ddc2: 80 93 40 03 sts 0x0340, r24 ; 0x800340 ddc6: e2 cf rjmp .-60 ; 0xdd8c ddc8: f8 94 cli ddca: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ddce: 8f 7d andi r24, 0xDF ; 223 ddd0: f3 cf rjmp .-26 ; 0xddb8 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; ddd2: ef b7 in r30, 0x3f ; 63 ddd4: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ddd6: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ddda: 88 60 ori r24, 0x08 ; 8 dddc: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; dde0: 30 e0 ldi r19, 0x00 ; 0 dde2: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> dde6: 4f ef ldi r20, 0xFF ; 255 dde8: 50 e0 ldi r21, 0x00 ; 0 ddea: 81 ff sbrs r24, 1 ddec: 04 c0 rjmp .+8 ; 0xddf6 ddee: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ddf2: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ddf6: 24 9f mul r18, r20 ddf8: c0 01 movw r24, r0 ddfa: 25 9f mul r18, r21 ddfc: 90 0d add r25, r0 ddfe: 34 9f mul r19, r20 de00: 90 0d add r25, r0 de02: 11 24 eor r1, r1 de04: 6f ef ldi r22, 0xFF ; 255 de06: 70 e0 ldi r23, 0x00 ; 0 de08: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> de0c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> de10: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; de14: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } de16: 08 95 ret 0000de18 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { de18: 1f 93 push r17 de1a: cf 93 push r28 de1c: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) de1e: d0 91 24 03 lds r29, 0x0324 ; 0x800324 de22: d1 fd sbrc r29, 1 de24: 1d c0 rjmp .+58 ; 0xde60 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; de26: 10 91 9a 03 lds r17, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; de2a: c1 e0 ldi r28, 0x01 ; 1 de2c: 20 e0 ldi r18, 0x00 ; 0 de2e: 30 e0 ldi r19, 0x00 ; 0 de30: 48 e4 ldi r20, 0x48 ; 72 de32: 52 e4 ldi r21, 0x42 ; 66 de34: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 de38: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 de3c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 de40: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 de44: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> de48: 18 16 cp r1, r24 de4a: 0c f0 brlt .+2 ; 0xde4e de4c: 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; de4e: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; de50: cd 2b or r28, r29 de52: 81 e0 ldi r24, 0x01 ; 1 de54: 11 11 cpse r17, r1 de56: 01 c0 rjmp .+2 ; 0xde5a de58: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); de5a: c8 2b or r28, r24 de5c: c0 93 24 03 sts 0x0324, r28 ; 0x800324 } setExtruderAutoFanState(fanState); de60: 80 91 24 03 lds r24, 0x0324 ; 0x800324 #endif } de64: df 91 pop r29 de66: cf 91 pop r28 de68: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); de6a: 0c 94 c0 6e jmp 0xdd80 ; 0xdd80 0000de6e : 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) { de6e: ef 92 push r14 de70: ff 92 push r15 de72: 0f 93 push r16 de74: 1f 93 push r17 de76: cf 93 push r28 de78: df 93 push r29 de7a: ec 01 movw r28, r24 de7c: 8b 01 movw r16, r22 de7e: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) de80: 0e 94 9b 55 call 0xab36 ; 0xab36 de84: 81 11 cpse r24, r1 de86: 0b c0 rjmp .+22 ; 0xde9e #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); de88: a8 01 movw r20, r16 de8a: be 01 movw r22, r28 de8c: 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); } de8e: df 91 pop r29 de90: cf 91 pop r28 de92: 1f 91 pop r17 de94: 0f 91 pop r16 de96: ff 90 pop r15 de98: 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); de9a: 0d 94 50 a1 jmp 0x342a0 ; 0x342a0 } 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); } de9e: df 91 pop r29 dea0: cf 91 pop r28 dea2: 1f 91 pop r17 dea4: 0f 91 pop r16 dea6: ff 90 pop r15 dea8: ef 90 pop r14 deaa: 08 95 ret 0000deac : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { deac: 0f 93 push r16 deae: 1f 93 push r17 deb0: cf 93 push r28 deb2: df 93 push r29 deb4: 8c 01 movw r16, r24 deb6: d6 2f mov r29, r22 deb8: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); deba: 0f 94 4a a1 call 0x34294 ; 0x34294 if (val == EEPROM_EMPTY_VALUE16) { debe: 8f 3f cpi r24, 0xFF ; 255 dec0: 98 07 cpc r25, r24 dec2: 39 f4 brne .+14 ; 0xded2 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); dec4: 6d 2f mov r22, r29 dec6: 7c 2f mov r23, r28 dec8: c8 01 movw r24, r16 deca: 0f 94 9a a1 call 0x34334 ; 0x34334 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; dece: 8d 2f mov r24, r29 ded0: 9c 2f mov r25, r28 } return val; } ded2: df 91 pop r29 ded4: cf 91 pop r28 ded6: 1f 91 pop r17 ded8: 0f 91 pop r16 deda: 08 95 ret 0000dedc : 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) { dedc: 0f 93 push r16 dede: 1f 93 push r17 dee0: cf 93 push r28 dee2: 8c 01 movw r16, r24 dee4: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); dee6: 0f 94 3c a1 call 0x34278 ; 0x34278 if (val == EEPROM_EMPTY_VALUE) { deea: 8f 3f cpi r24, 0xFF ; 255 deec: 29 f4 brne .+10 ; 0xdef8 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); deee: 6c 2f mov r22, r28 def0: c8 01 movw r24, r16 def2: 0f 94 84 a1 call 0x34308 ; 0x34308 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; def6: 8c 2f mov r24, r28 } return val; } def8: cf 91 pop r28 defa: 1f 91 pop r17 defc: 0f 91 pop r16 defe: 08 95 ret 0000df00 : 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) { df00: cf 93 push r28 df02: df 93 push r29 df04: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); df06: 0f 94 4a a1 call 0x34294 ; 0x34294 df0a: bc 01 movw r22, r24 df0c: 6f 5f subi r22, 0xFF ; 255 df0e: 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); df10: 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); } df12: df 91 pop r29 df14: 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); df16: 0d 94 9a a1 jmp 0x34334 ; 0x34334 0000df1a : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { df1a: cf 93 push r28 df1c: df 93 push r29 df1e: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); df20: 0f 94 3c a1 call 0x34278 ; 0x34278 df24: 61 e0 ldi r22, 0x01 ; 1 df26: 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); df28: 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); } df2a: df 91 pop r29 df2c: 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); df2e: 0d 94 84 a1 jmp 0x34308 ; 0x34308 0000df32 : 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); df32: 2b e0 ldi r18, 0x0B ; 11 df34: 82 9f mul r24, r18 df36: c0 01 movw r24, r0 df38: 11 24 eor r1, r1 df3a: 80 5b subi r24, 0xB0 ; 176 df3c: 92 4f sbci r25, 0xF2 ; 242 df3e: 0f 94 4a a1 call 0x34294 ; 0x34294 df42: 21 e0 ldi r18, 0x01 ; 1 df44: 01 96 adiw r24, 0x01 ; 1 df46: 09 f4 brne .+2 ; 0xdf4a df48: 20 e0 ldi r18, 0x00 ; 0 } df4a: 82 2f mov r24, r18 df4c: 08 95 ret 0000df4e : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { df4e: cf 93 push r28 df50: df 93 push r29 df52: c8 2f mov r28, r24 df54: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; df56: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; df58: c8 30 cpi r28, 0x08 ; 8 df5a: 0c f0 brlt .+2 ; 0xdf5e df5c: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; df5e: 8c 2f mov r24, r28 df60: 0e 94 99 6f call 0xdf32 ; 0xdf32 df64: 81 11 cpse r24, r1 df66: 03 c0 rjmp .+6 ; 0xdf6e df68: 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) df6a: a9 f7 brne .-22 ; 0xdf56 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; df6c: cf ef ldi r28, 0xFF ; 255 } df6e: 8c 2f mov r24, r28 df70: df 91 pop r29 df72: cf 91 pop r28 df74: 08 95 ret 0000df76 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); df76: 81 ea ldi r24, 0xA1 ; 161 df78: 9d e0 ldi r25, 0x0D ; 13 df7a: 0f 94 3c a1 call 0x34278 ; 0x34278 sheet = eeprom_next_initialized_sheet(sheet); df7e: 0e 94 a7 6f call 0xdf4e ; 0xdf4e if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); df82: 87 fd sbrc r24, 7 df84: 05 c0 rjmp .+10 ; 0xdf90 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); df86: 68 2f mov r22, r24 df88: 81 ea ldi r24, 0xA1 ; 161 df8a: 9d e0 ldi r25, 0x0D ; 13 df8c: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 { 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); } df90: 08 95 ret 0000df92 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { df92: 0f 93 push r16 df94: 1f 93 push r17 df96: cf 93 push r28 df98: c8 2f mov r28, r24 df9a: 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")); df9c: 66 eb ldi r22, 0xB6 ; 182 df9e: 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) dfa0: 82 30 cpi r24, 0x02 ; 2 dfa2: 70 f0 brcs .+28 ; 0xdfc0 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); dfa4: 6f ea ldi r22, 0xAF ; 175 dfa6: 74 e7 ldi r23, 0x74 ; 116 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) dfa8: 84 30 cpi r24, 0x04 ; 4 dfaa: 50 f0 brcs .+20 ; 0xdfc0 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); dfac: 67 ea ldi r22, 0xA7 ; 167 dfae: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) dfb0: 84 30 cpi r24, 0x04 ; 4 dfb2: 31 f0 breq .+12 ; 0xdfc0 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); dfb4: 6f e9 ldi r22, 0x9F ; 159 dfb6: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) dfb8: 85 30 cpi r24, 0x05 ; 5 dfba: 11 f0 breq .+4 ; 0xdfc0 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); dfbc: 68 e9 ldi r22, 0x98 ; 152 dfbe: 74 e7 ldi r23, 0x74 ; 116 dfc0: c8 01 movw r24, r16 dfc2: 0f 94 f3 9e call 0x33de6 ; 0x33de6 } if (index <4 || index >5) dfc6: 8c ef ldi r24, 0xFC ; 252 dfc8: 8c 0f add r24, r28 dfca: 82 30 cpi r24, 0x02 ; 2 dfcc: 28 f0 brcs .+10 ; 0xdfd8 { sheetName.c[6] = '0' + ((index % 2)+1); dfce: c1 70 andi r28, 0x01 ; 1 dfd0: cf 5c subi r28, 0xCF ; 207 dfd2: f8 01 movw r30, r16 dfd4: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; dfd6: 17 82 std Z+7, r1 ; 0x07 } } dfd8: cf 91 pop r28 dfda: 1f 91 pop r17 dfdc: 0f 91 pop r16 dfde: 08 95 ret 0000dfe0 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); dfe0: 61 e0 ldi r22, 0x01 ; 1 dfe2: 80 ec ldi r24, 0xC0 ; 192 dfe4: 9f e0 ldi r25, 0x0F ; 15 dfe6: 0f 94 60 a1 call 0x342c0 ; 0x342c0 dfea: 60 e0 ldi r22, 0x00 ; 0 dfec: 8f eb ldi r24, 0xBF ; 191 dfee: 9f e0 ldi r25, 0x0F ; 15 dff0: 0f 94 60 a1 call 0x342c0 ; 0x342c0 dff4: 60 e0 ldi r22, 0x00 ; 0 dff6: 8e eb ldi r24, 0xBE ; 190 dff8: 9f e0 ldi r25, 0x0F ; 15 dffa: 0f 94 60 a1 call 0x342c0 ; 0x342c0 dffe: 60 e0 ldi r22, 0x00 ; 0 e000: 8d eb ldi r24, 0xBD ; 189 e002: 9f e0 ldi r25, 0x0F ; 15 e004: 0f 94 60 a1 call 0x342c0 ; 0x342c0 e008: 60 e0 ldi r22, 0x00 ; 0 e00a: 8c eb ldi r24, 0xBC ; 188 e00c: 9f e0 ldi r25, 0x0F ; 15 e00e: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0000e012 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { e012: cf 93 push r28 e014: c8 2f mov r28, r24 print_hex_nibble(val >> 4); e016: 82 95 swap r24 e018: 8f 70 andi r24, 0x0F ; 15 e01a: 0e 94 51 5d call 0xbaa2 ; 0xbaa2 print_hex_nibble(val & 15); e01e: 8c 2f mov r24, r28 e020: 8f 70 andi r24, 0x0F ; 15 } e022: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); e024: 0c 94 51 5d jmp 0xbaa2 ; 0xbaa2 0000e028 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) e028: 40 91 cf 11 lds r20, 0x11CF ; 0x8011cf e02c: 50 91 d0 11 lds r21, 0x11D0 ; 0x8011d0 return 0; e030: 90 e0 ldi r25, 0x00 ; 0 e032: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) e034: 41 15 cp r20, r1 e036: 51 05 cpc r21, r1 e038: b1 f1 breq .+108 ; 0xe0a6 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { e03a: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb e03e: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; e042: 90 e0 ldi r25, 0x00 ; 0 e044: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { e046: f9 01 movw r30, r18 e048: e2 52 subi r30, 0x22 ; 34 e04a: f0 4f sbci r31, 0xF0 ; 240 e04c: a0 81 ld r26, Z e04e: a2 30 cpi r26, 0x02 ; 2 e050: 21 f4 brne .+8 ; 0xe05a sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; e052: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; e054: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; e056: 86 0f add r24, r22 e058: 97 1f adc r25, r23 } if (-- _buflen == 0) e05a: 41 50 subi r20, 0x01 ; 1 e05c: 51 09 sbc r21, r1 e05e: 19 f1 breq .+70 ; 0xe0a6 e060: f9 01 movw r30, r18 e062: ef 51 subi r30, 0x1F ; 31 e064: 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) ; e066: a1 91 ld r26, Z+ e068: 9f 01 movw r18, r30 e06a: 2e 5d subi r18, 0xDE ; 222 e06c: 3f 40 sbci r19, 0x0F ; 15 e06e: a1 11 cpse r26, r1 e070: fa cf rjmp .-12 ; 0xe066 e072: f9 01 movw r30, r18 e074: e2 52 subi r30, 0x22 ; 34 e076: 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) ; e078: 2d 3e cpi r18, 0xED ; 237 e07a: a1 e0 ldi r26, 0x01 ; 1 e07c: 3a 07 cpc r19, r26 e07e: 30 f4 brcc .+12 ; 0xe08c e080: a1 91 ld r26, Z+ e082: a1 11 cpse r26, r1 e084: e0 cf rjmp .-64 ; 0xe046 e086: 2f 5f subi r18, 0xFF ; 255 e088: 3f 4f sbci r19, 0xFF ; 255 e08a: f6 cf rjmp .-20 ; 0xe078 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { e08c: 2d 3e cpi r18, 0xED ; 237 e08e: e1 e0 ldi r30, 0x01 ; 1 e090: 3e 07 cpc r19, r30 e092: c9 f6 brne .-78 ; 0xe046 e094: ee ed ldi r30, 0xDE ; 222 e096: ff e0 ldi r31, 0x0F ; 15 e098: 9f 01 movw r18, r30 e09a: 2e 5d subi r18, 0xDE ; 222 e09c: 3f 40 sbci r19, 0x0F ; 15 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; e09e: a1 91 ld r26, Z+ e0a0: aa 23 and r26, r26 e0a2: d1 f3 breq .-12 ; 0xe098 e0a4: d0 cf rjmp .-96 ; 0xe046 } } return sdlen; } e0a6: 08 95 ret 0000e0a8 : // 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) { e0a8: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e0ac: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e0b0: 18 16 cp r1, r24 e0b2: 19 06 cpc r1, r25 e0b4: 0c f0 brlt .+2 ; 0xe0b8 e0b6: 43 c0 rjmp .+134 ; 0xe13e SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { e0b8: 01 97 sbiw r24, 0x01 ; 1 e0ba: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 e0be: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf e0c2: 89 2b or r24, r25 e0c4: a1 f4 brne .+40 ; 0xe0ee // Empty buffer. if (serial_count == 0) e0c6: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda e0ca: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb e0ce: 89 2b or r24, r25 e0d0: 21 f4 brne .+8 ; 0xe0da // No serial communication is pending. Reset both pointers to zero. bufindw = 0; e0d2: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e0d6: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> bufindr = bufindw; e0da: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> e0de: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e0e2: 90 93 cc 11 sts 0x11CC, r25 ; 0x8011cc e0e6: 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; e0ea: 81 e0 ldi r24, 0x01 ; 1 e0ec: 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) ; e0ee: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb e0f2: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc e0f6: 03 96 adiw r24, 0x03 ; 3 e0f8: fc 01 movw r30, r24 e0fa: e2 52 subi r30, 0x22 ; 34 e0fc: f0 4f sbci r31, 0xF0 ; 240 e0fe: 20 81 ld r18, Z e100: 01 96 adiw r24, 0x01 ; 1 e102: 21 11 cpse r18, r1 e104: f9 cf rjmp .-14 ; 0xe0f8 e106: fc 01 movw r30, r24 e108: e2 52 subi r30, 0x22 ; 34 e10a: 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) ; e10c: 8d 3e cpi r24, 0xED ; 237 e10e: 21 e0 ldi r18, 0x01 ; 1 e110: 92 07 cpc r25, r18 e112: 40 f4 brcc .+16 ; 0xe124 e114: 41 91 ld r20, Z+ e116: 9c 01 movw r18, r24 e118: 2f 5f subi r18, 0xFF ; 255 e11a: 3f 4f sbci r19, 0xFF ; 255 e11c: 41 11 cpse r20, r1 e11e: e1 cf rjmp .-62 ; 0xe0e2 e120: c9 01 movw r24, r18 e122: f4 cf rjmp .-24 ; 0xe10c // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { e124: ee ed ldi r30, 0xDE ; 222 e126: ff e0 ldi r31, 0x0F ; 15 e128: 8d 3e cpi r24, 0xED ; 237 e12a: 21 e0 ldi r18, 0x01 ; 1 e12c: 92 07 cpc r25, r18 e12e: c9 f6 brne .-78 ; 0xe0e2 e130: cf 01 movw r24, r30 e132: 8e 5d subi r24, 0xDE ; 222 e134: 9f 40 sbci r25, 0x0F ; 15 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; e136: 21 91 ld r18, Z+ e138: 22 23 and r18, r18 e13a: d1 f3 breq .-12 ; 0xe130 e13c: d2 cf rjmp .-92 ; 0xe0e2 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; e13e: 80 e0 ldi r24, 0x00 ; 0 } e140: 08 95 ret 0000e142 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; e142: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) e144: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; e146: 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; e148: db 01 movw r26, r22 e14a: 4d 91 ld r20, X+ e14c: bd 01 movw r22, r26 e14e: 40 32 cpi r20, 0x20 ; 32 e150: 49 f0 breq .+18 ; 0xe164 if (i == 8) e152: 28 30 cpi r18, 0x08 ; 8 e154: 11 f4 brne .+4 ; 0xe15a { *pos++='.'; e156: 30 83 st Z, r19 e158: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; e15a: db 01 movw r26, r22 e15c: 11 97 sbiw r26, 0x01 ; 1 e15e: 4c 91 ld r20, X e160: 40 83 st Z, r20 e162: 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++) e164: 2f 5f subi r18, 0xFF ; 255 e166: 2b 30 cpi r18, 0x0B ; 11 e168: 79 f7 brne .-34 ; 0xe148 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; e16a: 10 82 st Z, r1 return buffer; } e16c: 08 95 ret 0000e16e : 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);} e16e: 40 e0 ldi r20, 0x00 ; 0 e170: 50 e0 ldi r21, 0x00 ; 0 e172: ba 01 movw r22, r20 e174: 0d 94 93 39 jmp 0x27326 ; 0x27326 0000e178 : 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();} e178: fc 01 movw r30, r24 e17a: 23 81 ldd r18, Z+3 ; 0x03 e17c: 21 11 cpse r18, r1 e17e: 0d 94 f2 6f jmp 0x2dfe4 ; 0x2dfe4 e182: 08 95 ret 0000e184 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) e184: 90 91 04 05 lds r25, 0x0504 ; 0x800504 e188: 91 11 cpse r25, r1 e18a: 07 c0 rjmp .+14 ; 0xe19a { while (!((M_UCSRxA) & (1 << M_UDREx))); e18c: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> e190: 95 ff sbrs r25, 5 e192: fc cf rjmp .-8 ; 0xe18c M_UDRx = c; e194: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> e198: 08 95 ret } else if (selectedSerialPort == 1) e19a: 91 30 cpi r25, 0x01 ; 1 e19c: 31 f4 brne .+12 ; 0xe1aa { while (!((UCSR1A) & (1 << UDRE1))); e19e: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> e1a2: 95 ff sbrs r25, 5 e1a4: fc cf rjmp .-8 ; 0xe19e UDR1 = c; e1a6: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } e1aa: 08 95 ret 0000e1ac : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); e1ac: 0e 94 c2 70 call 0xe184 ; 0xe184 return 0; } e1b0: 90 e0 ldi r25, 0x00 ; 0 e1b2: 80 e0 ldi r24, 0x00 ; 0 e1b4: 08 95 ret 0000e1b6 : 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) { e1b6: cf 93 push r28 e1b8: df 93 push r29 e1ba: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { e1bc: fe 01 movw r30, r28 e1be: 84 91 lpm r24, Z e1c0: 88 23 and r24, r24 e1c2: 21 f0 breq .+8 ; 0xe1cc MYSERIAL.write((char)ch); e1c4: 0e 94 c2 70 call 0xe184 ; 0xe184 ++str; e1c8: 21 96 adiw r28, 0x01 ; 1 e1ca: f8 cf rjmp .-16 ; 0xe1bc } } e1cc: df 91 pop r29 e1ce: cf 91 pop r28 e1d0: 08 95 ret 0000e1d2 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { e1d2: cf 92 push r12 e1d4: df 92 push r13 e1d6: ef 92 push r14 e1d8: 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]; e1da: c0 90 c4 0d lds r12, 0x0DC4 ; 0x800dc4 e1de: d0 90 c5 0d lds r13, 0x0DC5 ; 0x800dc5 e1e2: e0 90 c6 0d lds r14, 0x0DC6 ; 0x800dc6 e1e6: f0 90 c7 0d lds r15, 0x0DC7 ; 0x800dc7 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); e1ea: 89 e0 ldi r24, 0x09 ; 9 e1ec: 99 e7 ldi r25, 0x79 ; 121 e1ee: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e1f2: 42 e0 ldi r20, 0x02 ; 2 e1f4: c7 01 movw r24, r14 e1f6: b6 01 movw r22, r12 e1f8: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); e1fc: 81 e0 ldi r24, 0x01 ; 1 e1fe: 99 e7 ldi r25, 0x79 ; 121 e200: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e204: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e208: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e20c: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e210: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e214: 41 e0 ldi r20, 0x01 ; 1 e216: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } e21a: ff 90 pop r15 e21c: ef 90 pop r14 e21e: df 90 pop r13 e220: 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(); e222: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 0000e226 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { e226: 4f 92 push r4 e228: 5f 92 push r5 e22a: 6f 92 push r6 e22c: 7f 92 push r7 e22e: 8f 92 push r8 e230: 9f 92 push r9 e232: af 92 push r10 e234: bf 92 push r11 e236: cf 92 push r12 e238: df 92 push r13 e23a: ef 92 push r14 e23c: ff 92 push r15 e23e: 0f 93 push r16 e240: 1f 93 push r17 e242: cf 93 push r28 e244: df 93 push r29 e246: cc 24 eor r12, r12 e248: ca 94 dec r12 e24a: dc 2c mov r13, r12 e24c: 76 01 movw r14, r12 e24e: 0e ea ldi r16, 0xAE ; 174 e250: 1f e0 ldi r17, 0x0F ; 15 e252: 93 e2 ldi r25, 0x23 ; 35 e254: 89 2e mov r8, r25 e256: 91 2c mov r9, r1 e258: a1 2c mov r10, r1 e25a: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; e25c: 41 2c mov r4, r1 e25e: 51 2c mov r5, r1 e260: 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; e262: d0 e0 ldi r29, 0x00 ; 0 e264: 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) { e266: 8f ef ldi r24, 0xFF ; 255 e268: c8 16 cp r12, r24 e26a: 09 f4 brne .+2 ; 0xe26e e26c: 5d c0 rjmp .+186 ; 0xe328 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); e26e: c8 01 movw r24, r16 e270: 0f 94 4a a1 call 0x34294 ; 0x34294 e274: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; e276: bc 01 movw r22, r24 e278: 99 0f add r25, r25 e27a: 88 0b sbc r24, r24 e27c: 99 0b sbc r25, r25 e27e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e282: 20 91 3e 04 lds r18, 0x043E ; 0x80043e e286: 30 91 3f 04 lds r19, 0x043F ; 0x80043f e28a: 40 91 40 04 lds r20, 0x0440 ; 0x800440 e28e: 50 91 41 04 lds r21, 0x0441 ; 0x800441 e292: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> e296: 2b 01 movw r4, r22 e298: 3c 01 movw r6, r24 e29a: c7 01 movw r24, r14 e29c: b6 01 movw r22, r12 e29e: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); e2a2: 8d e5 ldi r24, 0x5D ; 93 e2a4: 98 e7 ldi r25, 0x78 ; 120 e2a6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e2aa: c5 01 movw r24, r10 e2ac: b4 01 movw r22, r8 e2ae: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); e2b2: 8d e5 ldi r24, 0x5D ; 93 e2b4: 98 e7 ldi r25, 0x78 ; 120 e2b6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e2ba: be 01 movw r22, r28 e2bc: 0d 2e mov r0, r29 e2be: 00 0c add r0, r0 e2c0: 88 0b sbc r24, r24 e2c2: 99 0b sbc r25, r25 e2c4: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); e2c8: 8d e5 ldi r24, 0x5D ; 93 e2ca: 98 e7 ldi r25, 0x78 ; 120 e2cc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(mm * 1000); e2d0: 20 e0 ldi r18, 0x00 ; 0 e2d2: 30 e0 ldi r19, 0x00 ; 0 e2d4: 4a e7 ldi r20, 0x7A ; 122 e2d6: 54 e4 ldi r21, 0x44 ; 68 e2d8: c3 01 movw r24, r6 e2da: b2 01 movw r22, r4 e2dc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> e2e0: 0f 94 e3 41 call 0x283c6 ; 0x283c6 e2e4: 85 e0 ldi r24, 0x05 ; 5 e2e6: 88 0e add r8, r24 e2e8: 91 1c adc r9, r1 e2ea: a1 1c adc r10, r1 e2ec: b1 1c adc r11, r1 e2ee: 0e 5f subi r16, 0xFE ; 254 e2f0: 1f 4f sbci r17, 0xFF ; 255 e2f2: 8f ef ldi r24, 0xFF ; 255 e2f4: c8 1a sub r12, r24 e2f6: d8 0a sbc r13, r24 e2f8: e8 0a sbc r14, r24 e2fa: 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++) { e2fc: 0a 3b cpi r16, 0xBA ; 186 e2fe: 8f e0 ldi r24, 0x0F ; 15 e300: 18 07 cpc r17, r24 e302: 09 f0 breq .+2 ; 0xe306 e304: b0 cf rjmp .-160 ; 0xe266 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } e306: df 91 pop r29 e308: cf 91 pop r28 e30a: 1f 91 pop r17 e30c: 0f 91 pop r16 e30e: ff 90 pop r15 e310: ef 90 pop r14 e312: df 90 pop r13 e314: cf 90 pop r12 e316: bf 90 pop r11 e318: af 90 pop r10 e31a: 9f 90 pop r9 e31c: 8f 90 pop r8 e31e: 7f 90 pop r7 e320: 6f 90 pop r6 e322: 5f 90 pop r5 e324: 4f 90 pop r4 e326: 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); e328: 8d ed ldi r24, 0xDD ; 221 e32a: 9d e3 ldi r25, 0x3D ; 61 e32c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e330: b8 cf rjmp .-144 ; 0xe2a2 0000e332 : /// @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) { e332: 88 23 and r24, r24 e334: 71 f1 breq .+92 ; 0xe392 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); e336: 81 e5 ldi r24, 0x51 ; 81 e338: 98 e7 ldi r25, 0x78 ; 120 e33a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e33e: 60 91 23 12 lds r22, 0x1223 ; 0x801223 e342: 70 e0 ldi r23, 0x00 ; 0 e344: 90 e0 ldi r25, 0x00 ; 0 e346: 80 e0 ldi r24, 0x00 ; 0 e348: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; e34c: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e350: 84 30 cpi r24, 0x04 ; 4 e352: d8 f0 brcs .+54 ; 0xe38a e354: 10 92 23 12 sts 0x1223, r1 ; 0x801223 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); e358: 8c e4 ldi r24, 0x4C ; 76 e35a: 98 e7 ldi r25, 0x78 ; 120 e35c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN((int)currentMMUSlot); e360: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e364: 90 e0 ldi r25, 0x00 ; 0 e366: 0f 94 00 42 call 0x28400 ; 0x28400 return currentMMUSlot; e36a: 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; e36e: 20 91 ef 11 lds r18, 0x11EF ; 0x8011ef e372: 30 91 f0 11 lds r19, 0x11F0 ; 0x8011f0 e376: 30 93 f2 11 sts 0x11F2, r19 ; 0x8011f2 e37a: 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); e37e: 0e 94 05 f7 call 0x1ee0a ; 0x1ee0a load_filament_final_feed(); // @@TODO verify e382: 0e 94 f6 5e call 0xbdec ; 0xbdec st_synchronize(); e386: 0d 94 a0 22 jmp 0x24540 ; 0x24540 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; e38a: 8f 5f subi r24, 0xFF ; 255 e38c: 80 93 23 12 sts 0x1223, r24 ; 0x801223 e390: e3 cf rjmp .-58 ; 0xe358 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); e392: 86 e8 ldi r24, 0x86 ; 134 e394: 9e e3 ldi r25, 0x3E ; 62 e396: 0e 94 32 6d call 0xda64 ; 0xda64 e39a: 70 e0 ldi r23, 0x00 ; 0 e39c: 60 e0 ldi r22, 0x00 ; 0 e39e: 0e 94 e2 bc call 0x179c4 ; 0x179c4 e3a2: e5 cf rjmp .-54 ; 0xe36e 0000e3a4 : return final_result; } void gcode_M114() { e3a4: cf 93 push r28 e3a6: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); e3a8: 89 e4 ldi r24, 0x49 ; 73 e3aa: 98 e7 ldi r25, 0x78 ; 120 e3ac: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL(current_position[X_AXIS]); e3b0: c5 ef ldi r28, 0xF5 ; 245 e3b2: d1 e1 ldi r29, 0x11 ; 17 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e3b4: 68 81 ld r22, Y e3b6: 79 81 ldd r23, Y+1 ; 0x01 e3b8: 8a 81 ldd r24, Y+2 ; 0x02 e3ba: 9b 81 ldd r25, Y+3 ; 0x03 e3bc: 42 e0 ldi r20, 0x02 ; 2 e3be: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" Y:"); e3c2: 85 e4 ldi r24, 0x45 ; 69 e3c4: 98 e7 ldi r25, 0x78 ; 120 e3c6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e3ca: 6c 81 ldd r22, Y+4 ; 0x04 e3cc: 7d 81 ldd r23, Y+5 ; 0x05 e3ce: 8e 81 ldd r24, Y+6 ; 0x06 e3d0: 9f 81 ldd r25, Y+7 ; 0x07 e3d2: 42 e0 ldi r20, 0x02 ; 2 e3d4: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); e3d8: 81 e4 ldi r24, 0x41 ; 65 e3da: 98 e7 ldi r25, 0x78 ; 120 e3dc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e3e0: 68 85 ldd r22, Y+8 ; 0x08 e3e2: 79 85 ldd r23, Y+9 ; 0x09 e3e4: 8a 85 ldd r24, Y+10 ; 0x0a e3e6: 9b 85 ldd r25, Y+11 ; 0x0b e3e8: 42 e0 ldi r20, 0x02 ; 2 e3ea: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); e3ee: 8d e3 ldi r24, 0x3D ; 61 e3f0: 98 e7 ldi r25, 0x78 ; 120 e3f2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e3f6: 6c 85 ldd r22, Y+12 ; 0x0c e3f8: 7d 85 ldd r23, Y+13 ; 0x0d e3fa: 8e 85 ldd r24, Y+14 ; 0x0e e3fc: 9f 85 ldd r25, Y+15 ; 0x0f e3fe: 42 e0 ldi r20, 0x02 ; 2 e400: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X e404: 8b ec ldi r24, 0xCB ; 203 e406: 94 e6 ldi r25, 0x64 ; 100 e408: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); e40c: 80 e0 ldi r24, 0x00 ; 0 e40e: 0f 94 7e 22 call 0x244fc ; 0x244fc e412: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e416: c2 e3 ldi r28, 0x32 ; 50 e418: d4 e0 ldi r29, 0x04 ; 4 e41a: 2c 81 ldd r18, Y+4 ; 0x04 e41c: 3d 81 ldd r19, Y+5 ; 0x05 e41e: 4e 81 ldd r20, Y+6 ; 0x06 e420: 5f 81 ldd r21, Y+7 ; 0x07 e422: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> e426: 42 e0 ldi r20, 0x02 ; 2 e428: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" Y:"); e42c: 89 e3 ldi r24, 0x39 ; 57 e42e: 98 e7 ldi r25, 0x78 ; 120 e430: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); e434: 81 e0 ldi r24, 0x01 ; 1 e436: 0f 94 7e 22 call 0x244fc ; 0x244fc e43a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e43e: 28 85 ldd r18, Y+8 ; 0x08 e440: 39 85 ldd r19, Y+9 ; 0x09 e442: 4a 85 ldd r20, Y+10 ; 0x0a e444: 5b 85 ldd r21, Y+11 ; 0x0b e446: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> e44a: 42 e0 ldi r20, 0x02 ; 2 e44c: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" Z:"); e450: 85 e3 ldi r24, 0x35 ; 53 e452: 98 e7 ldi r25, 0x78 ; 120 e454: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); e458: 82 e0 ldi r24, 0x02 ; 2 e45a: 0f 94 7e 22 call 0x244fc ; 0x244fc e45e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e462: 2c 85 ldd r18, Y+12 ; 0x0c e464: 3d 85 ldd r19, Y+13 ; 0x0d e466: 4e 85 ldd r20, Y+14 ; 0x0e e468: 5f 85 ldd r21, Y+15 ; 0x0f e46a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> e46e: 42 e0 ldi r20, 0x02 ; 2 e470: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" E:"); e474: 81 e3 ldi r24, 0x31 ; 49 e476: 98 e7 ldi r25, 0x78 ; 120 e478: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); e47c: 83 e0 ldi r24, 0x03 ; 3 e47e: 0f 94 7e 22 call 0x244fc ; 0x244fc e482: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e486: 28 89 ldd r18, Y+16 ; 0x10 e488: 39 89 ldd r19, Y+17 ; 0x11 e48a: 4a 89 ldd r20, Y+18 ; 0x12 e48c: 5b 89 ldd r21, Y+19 ; 0x13 e48e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> } e492: df 91 pop r29 e494: 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]); e496: 0d 94 e3 41 jmp 0x283c6 ; 0x283c6 0000e49a : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); e49a: 80 e4 ldi r24, 0x40 ; 64 e49c: 97 e7 ldi r25, 0x77 ; 119 e49e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e4a2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e4a6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e4aa: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e4ae: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e4b2: 41 e0 ldi r20, 0x01 ; 1 e4b4: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e4b8: 8d e3 ldi r24, 0x3D ; 61 e4ba: 97 e7 ldi r25, 0x77 ; 119 e4bc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e4c0: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e4c4: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e4c8: 07 2e mov r0, r23 e4ca: 00 0c add r0, r0 e4cc: 88 0b sbc r24, r24 e4ce: 99 0b sbc r25, r25 e4d0: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e4d4: 41 e0 ldi r20, 0x01 ; 1 e4d6: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); e4da: 89 e3 ldi r24, 0x39 ; 57 e4dc: 97 e7 ldi r25, 0x77 ; 119 e4de: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e4e2: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e4e6: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e4ea: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e4ee: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e4f2: 41 e0 ldi r20, 0x01 ; 1 e4f4: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); e4f8: 86 e3 ldi r24, 0x36 ; 54 e4fa: 97 e7 ldi r25, 0x77 ; 119 e4fc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; e500: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed e504: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee e508: 07 2e mov r0, r23 e50a: 00 0c add r0, r0 e50c: 88 0b sbc r24, r24 e50e: 99 0b sbc r25, r25 e510: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e514: 41 e0 ldi r20, 0x01 ; 1 e516: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); e51a: 81 e3 ldi r24, 0x31 ; 49 e51c: 97 e7 ldi r25, 0x77 ; 119 e51e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e522: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e526: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e52a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e52e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e532: 41 e0 ldi r20, 0x01 ; 1 e534: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e538: 8e e2 ldi r24, 0x2E ; 46 e53a: 97 e7 ldi r25, 0x77 ; 119 e53c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e540: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e544: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e548: 07 2e mov r0, r23 e54a: 00 0c add r0, r0 e54c: 88 0b sbc r24, r24 e54e: 99 0b sbc r25, r25 e550: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> e554: 41 e0 ldi r20, 0x01 ; 1 e556: 0f 94 a9 98 call 0x33152 ; 0x33152 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); e55a: 8a e2 ldi r24, 0x2A ; 42 e55c: 97 e7 ldi r25, 0x77 ; 119 e55e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e562: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> e566: 70 e0 ldi r23, 0x00 ; 0 e568: 90 e0 ldi r25, 0x00 ; 0 e56a: 80 e0 ldi r24, 0x00 ; 0 e56c: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); e570: 85 e2 ldi r24, 0x25 ; 37 e572: 97 e7 ldi r25, 0x77 ; 119 e574: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 e578: 60 91 5b 06 lds r22, 0x065B ; 0x80065b e57c: 70 e0 ldi r23, 0x00 ; 0 e57e: 90 e0 ldi r25, 0x00 ; 0 e580: 80 e0 ldi r24, 0x00 ; 0 e582: 0f 94 02 98 call 0x33004 ; 0x33004 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); e586: 81 e2 ldi r24, 0x21 ; 33 e588: 97 e7 ldi r25, 0x77 ; 119 e58a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e58e: 60 91 8e 06 lds r22, 0x068E ; 0x80068e e592: 70 91 8f 06 lds r23, 0x068F ; 0x80068f e596: 80 91 90 06 lds r24, 0x0690 ; 0x800690 e59a: 90 91 91 06 lds r25, 0x0691 ; 0x800691 e59e: 41 e0 ldi r20, 0x01 ; 1 e5a0: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); e5a4: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 0000e5a8 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); e5a8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 MYSERIAL.println(); e5ac: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 0000e5b0 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { e5b0: 8f 92 push r8 e5b2: 9f 92 push r9 e5b4: af 92 push r10 e5b6: bf 92 push r11 e5b8: cf 92 push r12 e5ba: df 92 push r13 e5bc: ef 92 push r14 e5be: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); e5c0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c e5c4: 6b 01 movw r12, r22 e5c6: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { e5c8: 20 91 32 02 lds r18, 0x0232 ; 0x800232 e5cc: 22 23 and r18, r18 e5ce: 09 f1 breq .+66 ; 0xe612 e5d0: 40 91 78 02 lds r20, 0x0278 ; 0x800278 e5d4: 41 30 cpi r20, 0x01 ; 1 e5d6: e9 f0 breq .+58 ; 0xe612 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; e5d8: 80 91 14 02 lds r24, 0x0214 ; 0x800214 e5dc: 90 91 15 02 lds r25, 0x0215 ; 0x800215 e5e0: a0 91 16 02 lds r26, 0x0216 ; 0x800216 e5e4: b0 91 17 02 lds r27, 0x0217 ; 0x800217 e5e8: 46 01 movw r8, r12 e5ea: 57 01 movw r10, r14 e5ec: 88 1a sub r8, r24 e5ee: 99 0a sbc r9, r25 e5f0: aa 0a sbc r10, r26 e5f2: bb 0a sbc r11, r27 e5f4: 30 e0 ldi r19, 0x00 ; 0 e5f6: a8 ee ldi r26, 0xE8 ; 232 e5f8: b3 e0 ldi r27, 0x03 ; 3 e5fa: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> e5fe: 86 16 cp r8, r22 e600: 97 06 cpc r9, r23 e602: a8 06 cpc r10, r24 e604: b9 06 cpc r11, r25 e606: 6c f0 brlt .+26 ; 0xe622 switch (busy_state) { e608: 44 30 cpi r20, 0x04 ; 4 e60a: 31 f1 breq .+76 ; 0xe658 e60c: 9c f4 brge .+38 ; 0xe634 e60e: 42 30 cpi r20, 0x02 ; 2 e610: d4 f4 brge .+52 ; 0xe646 break; default: break; } } prev_busy_signal_ms = ms; e612: c0 92 14 02 sts 0x0214, r12 ; 0x800214 e616: d0 92 15 02 sts 0x0215, r13 ; 0x800215 e61a: e0 92 16 02 sts 0x0216, r14 ; 0x800216 e61e: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } e622: ff 90 pop r15 e624: ef 90 pop r14 e626: df 90 pop r13 e628: cf 90 pop r12 e62a: bf 90 pop r11 e62c: af 90 pop r10 e62e: 9f 90 pop r9 e630: 8f 90 pop r8 e632: 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) { e634: 45 30 cpi r20, 0x05 ; 5 e636: 69 f7 brne .-38 ; 0xe612 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; e638: 87 e7 ldi r24, 0x77 ; 119 e63a: 9e e9 ldi r25, 0x9E ; 158 e63c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("busy: paused for input"); e640: 8c e0 ldi r24, 0x0C ; 12 e642: 99 e7 ldi r25, 0x79 ; 121 e644: 06 c0 rjmp .+12 ; 0xe652 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; e646: 87 e7 ldi r24, 0x77 ; 119 e648: 9e e9 ldi r25, 0x9E ; 158 e64a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("busy: processing"); e64e: 89 e3 ldi r24, 0x39 ; 57 e650: 99 e7 ldi r25, 0x79 ; 121 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); e652: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 e656: dd cf rjmp .-70 ; 0xe612 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; e658: 87 e7 ldi r24, 0x77 ; 119 e65a: 9e e9 ldi r25, 0x9E ; 158 e65c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("busy: paused for user"); e660: 83 e2 ldi r24, 0x23 ; 35 e662: 99 e7 ldi r25, 0x79 ; 121 e664: f6 cf rjmp .-20 ; 0xe652 0000e666 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { e666: 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))); e668: 81 ea ldi r24, 0xA1 ; 161 e66a: 9d e0 ldi r25, 0x0D ; 13 e66c: 0f 94 3c a1 call 0x34278 ; 0x34278 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> e670: cb e0 ldi r28, 0x0B ; 11 e672: 8c 9f mul r24, r28 e674: c0 01 movw r24, r0 e676: 11 24 eor r1, r1 e678: 80 5b subi r24, 0xB0 ; 176 e67a: 92 4f sbci r25, 0xF2 ; 242 e67c: 0f 94 4a a1 call 0x34294 ; 0x34294 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { e680: 81 56 subi r24, 0x61 ; 97 e682: 90 4f sbci r25, 0xF0 ; 240 e684: 80 3a cpi r24, 0xA0 ; 160 e686: 9f 40 sbci r25, 0x0F ; 15 e688: c8 f0 brcs .+50 ; 0xe6bc 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"); e68a: 88 ed ldi r24, 0xD8 ; 216 e68c: 98 e7 ldi r25, 0x78 ; 120 e68e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), e692: 81 ea ldi r24, 0xA1 ; 161 e694: 9d e0 ldi r25, 0x0D ; 13 e696: 0f 94 3c a1 call 0x34278 ; 0x34278 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-> e69a: 8c 9f mul r24, r28 e69c: c0 01 movw r24, r0 e69e: 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); e6a0: 70 e0 ldi r23, 0x00 ; 0 e6a2: 60 e0 ldi r22, 0x00 ; 0 e6a4: 80 5b subi r24, 0xB0 ; 176 e6a6: 92 4f sbci r25, 0xF2 ; 242 e6a8: 0f 94 9a a1 call 0x34334 ; 0x34334 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.")); e6ac: 8b e9 ldi r24, 0x9B ; 155 e6ae: 98 e7 ldi r25, 0x78 ; 120 e6b0: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_update_enable(true); e6b4: 81 e0 ldi r24, 0x01 ; 1 } } e6b6: 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); e6b8: 0c 94 41 6a jmp 0xd482 ; 0xd482 } } e6bc: cf 91 pop r28 e6be: 08 95 ret 0000e6c0 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { e6c0: ec 01 movw r28, r24 cli(); // Stop interrupts e6c2: f8 94 cli disable_heater(); e6c4: 0f 94 b9 12 call 0x22572 ; 0x22572 disable_x(); e6c8: 17 9a sbi 0x02, 7 ; 2 e6ca: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); e6ce: 16 9a sbi 0x02, 6 ; 2 e6d0: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 poweroff_z(); disable_e0(); e6d4: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; e6d6: 8a e5 ldi r24, 0x5A ; 90 e6d8: 9e e9 ldi r25, 0x9E ; 158 e6da: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); e6de: 8c e7 ldi r24, 0x7C ; 124 e6e0: 98 e7 ldi r25, 0x78 ; 120 e6e2: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 if (full_screen_message != NULL) { e6e6: 20 97 sbiw r28, 0x00 ; 0 e6e8: 79 f0 breq .+30 ; 0xe708 SERIAL_ERRORLNRPGM(full_screen_message); e6ea: ce 01 movw r24, r28 e6ec: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 e6f0: be 01 movw r22, r28 e6f2: 85 e9 ldi r24, 0x95 ; 149 e6f4: 9c e0 ldi r25, 0x0C ; 12 e6f6: 0f 94 9a a1 call 0x34334 ; 0x34334 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); e6fa: 62 e4 ldi r22, 0x42 ; 66 e6fc: 84 e9 ldi r24, 0x94 ; 148 e6fe: 9c e0 ldi r25, 0x0C ; 12 e700: 0f 94 84 a1 call 0x34308 ; 0x34308 // 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(); e704: 0e 94 28 61 call 0xc250 ; 0xc250 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); e708: c4 e7 ldi r28, 0x74 ; 116 e70a: d8 e7 ldi r29, 0x78 ; 120 e70c: f1 cf rjmp .-30 ; 0xe6f0 0000e70e : // 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(); e70e: 8a e4 ldi r24, 0x4A ; 74 e710: 93 e0 ldi r25, 0x03 ; 3 e712: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) e716: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e71a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e71e: 89 2b or r24, r25 e720: 79 f0 breq .+30 ; 0xe740 e722: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb e726: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc e72a: e2 52 subi r30, 0x22 ; 34 e72c: f0 4f sbci r31, 0xF0 ; 240 e72e: 80 81 ld r24, Z e730: 81 30 cpi r24, 0x01 ; 1 e732: 11 f0 breq .+4 ; 0xe738 e734: 86 30 cpi r24, 0x06 ; 6 e736: 21 f4 brne .+8 ; 0xe740 SERIAL_PROTOCOLLNRPGM(MSG_OK); e738: 85 ed ldi r24, 0xD5 ; 213 e73a: 99 e6 ldi r25, 0x69 ; 105 e73c: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 } e740: 08 95 ret 0000e742 : void cmdqueue_reset() { while (buflen) e742: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e746: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e74a: 89 2b or r24, r25 e74c: 29 f0 breq .+10 ; 0xe758 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); e74e: 0e 94 87 73 call 0xe70e ; 0xe70e cmdqueue_pop_front(); e752: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 e756: f5 cf rjmp .-22 ; 0xe742 } bufindr = 0; e758: 10 92 cc 11 sts 0x11CC, r1 ; 0x8011cc e75c: 10 92 cb 11 sts 0x11CB, r1 ; 0x8011cb bufindw = 0; e760: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e764: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> //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; e768: 81 e0 ldi r24, 0x01 ; 1 e76a: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } e76e: 08 95 ret 0000e770 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { e770: ef 92 push r14 e772: ff 92 push r15 e774: 0f 93 push r16 e776: 1f 93 push r17 e778: cf 93 push r28 e77a: df 93 push r29 if (mbl.active) { e77c: 80 91 9c 12 lds r24, 0x129C ; 0x80129c e780: 88 23 and r24, r24 e782: 89 f1 breq .+98 ; 0xe7e6 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); e784: 86 e0 ldi r24, 0x06 ; 6 e786: 98 e7 ldi r25, 0x78 ; 120 e788: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); e78c: 80 ef ldi r24, 0xF0 ; 240 e78e: 97 e7 ldi r25, 0x77 ; 119 e790: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLLNPGM("Measured points:"); e794: 8f ed ldi r24, 0xDF ; 223 e796: 97 e7 ldi r25, 0x77 ; 119 e798: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { e79c: c7 e0 ldi r28, 0x07 ; 7 e79e: dc e1 ldi r29, 0x1C ; 28 e7a0: c1 50 subi r28, 0x01 ; 1 e7a2: 58 f1 brcs .+86 ; 0xe7fa e7a4: cd 9f mul r28, r29 e7a6: 70 01 movw r14, r0 e7a8: 11 24 eor r1, r1 e7aa: 01 e0 ldi r16, 0x01 ; 1 e7ac: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); e7ae: 8c ed ldi r24, 0xDC ; 220 e7b0: 97 e7 ldi r25, 0x77 ; 119 e7b2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL_F(z_values[y][x], 5); e7b6: f8 01 movw r30, r16 e7b8: ee 0f add r30, r30 e7ba: ff 1f adc r31, r31 e7bc: ee 0f add r30, r30 e7be: ff 1f adc r31, r31 e7c0: ee 0d add r30, r14 e7c2: ff 1d adc r31, r15 e7c4: e7 56 subi r30, 0x67 ; 103 e7c6: fd 4e sbci r31, 0xED ; 237 e7c8: 60 81 ld r22, Z e7ca: 71 81 ldd r23, Z+1 ; 0x01 e7cc: 82 81 ldd r24, Z+2 ; 0x02 e7ce: 93 81 ldd r25, Z+3 ; 0x03 e7d0: 45 e0 ldi r20, 0x05 ; 5 e7d2: 0f 94 a9 98 call 0x33152 ; 0x33152 e7d6: 0f 5f subi r16, 0xFF ; 255 e7d8: 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++) { e7da: 08 30 cpi r16, 0x08 ; 8 e7dc: 11 05 cpc r17, r1 e7de: 39 f7 brne .-50 ; 0xe7ae SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); e7e0: 0f 94 5c 99 call 0x332b8 ; 0x332b8 e7e4: dd cf rjmp .-70 ; 0xe7a0 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e7e6: 83 e1 ldi r24, 0x13 ; 19 e7e8: 98 e7 ldi r25, 0x78 ; 120 return; } e7ea: df 91 pop r29 e7ec: cf 91 pop r28 e7ee: 1f 91 pop r17 e7f0: 0f 91 pop r16 e7f2: ff 90 pop r15 e7f4: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e7f6: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 return; } e7fa: df 91 pop r29 e7fc: cf 91 pop r28 e7fe: 1f 91 pop r17 e800: 0f 91 pop r16 e802: ff 90 pop r15 e804: ef 90 pop r14 e806: 08 95 ret 0000e808 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { e808: cf 92 push r12 e80a: df 92 push r13 e80c: ef 92 push r14 e80e: ff 92 push r15 e810: 6b 01 movw r12, r22 e812: 7c 01 movw r14, r24 la10c_orig_jerk = j; e814: c0 92 29 03 sts 0x0329, r12 ; 0x800329 e818: d0 92 2a 03 sts 0x032A, r13 ; 0x80032a e81c: e0 92 2b 03 sts 0x032B, r14 ; 0x80032b e820: f0 92 2c 03 sts 0x032C, r15 ; 0x80032c if(la10c_mode != LA10C_LA10) e824: 80 91 45 03 lds r24, 0x0345 ; 0x800345 e828: 82 30 cpi r24, 0x02 ; 2 e82a: b1 f4 brne .+44 ; 0xe858 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) e82c: 20 e0 ldi r18, 0x00 ; 0 e82e: 30 e0 ldi r19, 0x00 ; 0 e830: 40 e9 ldi r20, 0x90 ; 144 e832: 50 e4 ldi r21, 0x40 ; 64 e834: c7 01 movw r24, r14 e836: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> e83a: 87 ff sbrs r24, 7 e83c: 14 c0 rjmp .+40 ; 0xe866 e83e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 e842: 90 91 63 04 lds r25, 0x0463 ; 0x800463 e846: a0 91 64 04 lds r26, 0x0464 ; 0x800464 e84a: b0 91 65 04 lds r27, 0x0465 ; 0x800465 e84e: 80 3d cpi r24, 0xD0 ; 208 e850: 97 40 sbci r25, 0x07 ; 7 e852: a1 05 cpc r26, r1 e854: b1 05 cpc r27, r1 e856: 20 f5 brcc .+72 ; 0xe8a0 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } e858: c7 01 movw r24, r14 e85a: b6 01 movw r22, r12 e85c: ff 90 pop r15 e85e: ef 90 pop r14 e860: df 90 pop r13 e862: cf 90 pop r12 e864: 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: e866: 2a e9 ldi r18, 0x9A ; 154 e868: 39 e9 ldi r19, 0x99 ; 153 e86a: 49 e9 ldi r20, 0x99 ; 153 e86c: 5e e3 ldi r21, 0x3E ; 62 e86e: c7 01 movw r24, r14 e870: b6 01 movw r22, r12 e872: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> e876: 87 ff sbrs r24, 7 e878: 0a c0 rjmp .+20 ; 0xe88e e87a: 20 e0 ldi r18, 0x00 ; 0 e87c: 30 e0 ldi r19, 0x00 ; 0 e87e: 48 e3 ldi r20, 0x38 ; 56 e880: 51 e4 ldi r21, 0x41 ; 65 e882: c7 01 movw r24, r14 e884: b6 01 movw r22, r12 e886: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> e88a: 6b 01 movw r12, r22 e88c: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); e88e: 8a ee ldi r24, 0xEA ; 234 e890: 94 e7 ldi r25, 0x74 ; 116 e892: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(j); e896: c7 01 movw r24, r14 e898: b6 01 movw r22, r12 e89a: 0f 94 e3 41 call 0x283c6 ; 0x283c6 e89e: dc cf rjmp .-72 ; 0xe858 // 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: e8a0: 2a e9 ldi r18, 0x9A ; 154 e8a2: 39 e9 ldi r19, 0x99 ; 153 e8a4: 49 e9 ldi r20, 0x99 ; 153 e8a6: 5e e3 ldi r21, 0x3E ; 62 e8a8: c7 01 movw r24, r14 e8aa: b6 01 movw r22, r12 e8ac: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> e8b0: 87 fd sbrc r24, 7 e8b2: e3 cf rjmp .-58 ; 0xe87a j < 4.5? j * 0.25 + 3.375: e8b4: 20 e0 ldi r18, 0x00 ; 0 e8b6: 30 e0 ldi r19, 0x00 ; 0 e8b8: 40 e8 ldi r20, 0x80 ; 128 e8ba: 5e e3 ldi r21, 0x3E ; 62 e8bc: c7 01 movw r24, r14 e8be: b6 01 movw r22, r12 e8c0: 0f 94 09 9c call 0x33812 ; 0x33812 <__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: e8c4: 20 e0 ldi r18, 0x00 ; 0 e8c6: 30 e0 ldi r19, 0x00 ; 0 e8c8: 48 e5 ldi r20, 0x58 ; 88 e8ca: 50 e4 ldi r21, 0x40 ; 64 e8cc: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> e8d0: dc cf rjmp .-72 ; 0xe88a 0000e8d2 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { e8d2: cf 92 push r12 e8d4: df 92 push r13 e8d6: ef 92 push r14 e8d8: ff 92 push r15 e8da: cf 93 push r28 if(mode == la10c_mode) return; e8dc: 90 91 45 03 lds r25, 0x0345 ; 0x800345 e8e0: 98 17 cp r25, r24 e8e2: b9 f1 breq .+110 ; 0xe952 e8e4: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) e8e6: c0 90 29 03 lds r12, 0x0329 ; 0x800329 e8ea: d0 90 2a 03 lds r13, 0x032A ; 0x80032a e8ee: e0 90 2b 03 lds r14, 0x032B ; 0x80032b e8f2: f0 90 2c 03 lds r15, 0x032C ; 0x80032c e8f6: 20 e0 ldi r18, 0x00 ; 0 e8f8: 30 e0 ldi r19, 0x00 ; 0 e8fa: a9 01 movw r20, r18 e8fc: c7 01 movw r24, r14 e8fe: b6 01 movw r22, r12 e900: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> e904: 88 23 and r24, r24 e906: 41 f0 breq .+16 ; 0xe918 cs.max_jerk[E_AXIS] = la10c_orig_jerk; e908: c0 92 86 04 sts 0x0486, r12 ; 0x800486 e90c: d0 92 87 04 sts 0x0487, r13 ; 0x800487 e910: e0 92 88 04 sts 0x0488, r14 ; 0x800488 e914: f0 92 89 04 sts 0x0489, r15 ; 0x800489 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); e918: 8d ec ldi r24, 0xCD ; 205 e91a: 94 e7 ldi r25, 0x74 ; 116 e91c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 switch(mode) e920: c1 30 cpi r28, 0x01 ; 1 e922: 11 f1 breq .+68 ; 0xe968 e924: e0 f0 brcs .+56 ; 0xe95e e926: c2 30 cpi r28, 0x02 ; 2 e928: 11 f1 breq .+68 ; 0xe96e { 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; e92a: 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]); e92e: 60 91 86 04 lds r22, 0x0486 ; 0x800486 e932: 70 91 87 04 lds r23, 0x0487 ; 0x800487 e936: 80 91 88 04 lds r24, 0x0488 ; 0x800488 e93a: 90 91 89 04 lds r25, 0x0489 ; 0x800489 e93e: 0e 94 04 74 call 0xe808 ; 0xe808 e942: 60 93 86 04 sts 0x0486, r22 ; 0x800486 e946: 70 93 87 04 sts 0x0487, r23 ; 0x800487 e94a: 80 93 88 04 sts 0x0488, r24 ; 0x800488 e94e: 90 93 89 04 sts 0x0489, r25 ; 0x800489 } e952: cf 91 pop r28 e954: ff 90 pop r15 e956: ef 90 pop r14 e958: df 90 pop r13 e95a: cf 90 pop r12 e95c: 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; e95e: 85 ec ldi r24, 0xC5 ; 197 e960: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e962: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 e966: e1 cf rjmp .-62 ; 0xe92a SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; e968: 81 ec ldi r24, 0xC1 ; 193 e96a: 94 e7 ldi r25, 0x74 ; 116 e96c: fa cf rjmp .-12 ; 0xe962 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e96e: 8d eb ldi r24, 0xBD ; 189 e970: 94 e7 ldi r25, 0x74 ; 116 e972: f7 cf rjmp .-18 ; 0xe962 0000e974 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); e974: 0f 94 a0 22 call 0x24540 ; 0x24540 disable_x(); e978: 17 9a sbi 0x02, 7 ; 2 e97a: e3 ea ldi r30, 0xA3 ; 163 e97c: f6 e0 ldi r31, 0x06 ; 6 e97e: 10 82 st Z, r1 disable_y(); e980: 16 9a sbi 0x02, 6 ; 2 e982: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); e984: 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); } e986: 80 e0 ldi r24, 0x00 ; 0 e988: 0e 94 69 74 call 0xe8d2 ; 0xe8d2 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; e98c: 8f ef ldi r24, 0xFF ; 255 e98e: 9f ef ldi r25, 0xFF ; 255 e990: 90 93 75 02 sts 0x0275, r25 ; 0x800275 e994: 80 93 74 02 sts 0x0274, r24 ; 0x800274 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; e998: 2f ef ldi r18, 0xFF ; 255 e99a: 20 93 71 02 sts 0x0271, r18 ; 0x800271 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; e99e: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e e9a2: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; e9a6: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; e9aa: 90 93 73 02 sts 0x0273, r25 ; 0x800273 e9ae: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; e9b2: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c e9b6: 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(); } e9ba: 08 95 ret 0000e9bc : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { e9bc: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); e9be: f8 94 cli // sample SP/PC sp = SP; e9c0: cd b7 in r28, 0x3d ; 61 e9c2: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); e9c4: 00 d0 rcall .+0 ; 0xe9c6 e9c6: cf 90 pop r12 e9c8: df 90 pop r13 e9ca: ef 90 pop r14 e9cc: 88 e1 ldi r24, 0x18 ; 24 e9ce: 99 e2 ldi r25, 0x29 ; 41 e9d0: 0f b6 in r0, 0x3f ; 63 e9d2: f8 94 cli e9d4: a8 95 wdr e9d6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> e9da: 0f be out 0x3f, r0 ; 63 e9dc: 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); e9e0: 9f b7 in r25, 0x3f ; 63 e9e2: f8 94 cli e9e4: e2 e0 ldi r30, 0x02 ; 2 e9e6: f1 e0 ldi r31, 0x01 ; 1 e9e8: 80 81 ld r24, Z e9ea: 88 60 ori r24, 0x08 ; 8 e9ec: 80 83 st Z, r24 e9ee: 9f bf out 0x3f, r25 ; 63 disable_heater(); e9f0: 0f 94 b9 12 call 0x22572 ; 0x22572 // 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"); e9f4: 8c e7 ldi r24, 0x7C ; 124 e9f6: 94 e7 ldi r25, 0x74 ; 116 e9f8: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_ECHOPGM("error: "); e9fc: 84 e7 ldi r24, 0x74 ; 116 e9fe: 94 e7 ldi r25, 0x74 ; 116 ea00: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); ea04: 61 2f mov r22, r17 ea06: 70 e0 ldi r23, 0x00 ; 0 ea08: 90 e0 ldi r25, 0x00 ; 0 ea0a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); ea0c: 4a e0 ldi r20, 0x0A ; 10 ea0e: 0f 94 8c 97 call 0x32f18 ; 0x32f18 MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); ea12: 80 e7 ldi r24, 0x70 ; 112 ea14: 94 e7 ldi r25, 0x74 ; 116 ea16: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); ea1a: 8e 2d mov r24, r14 ea1c: b6 01 movw r22, r12 ea1e: 90 e0 ldi r25, 0x00 ; 0 ea20: 40 e1 ldi r20, 0x10 ; 16 ea22: 0f 94 8c 97 call 0x32f18 ; 0x32f18 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"); ea26: 8c e6 ldi r24, 0x6C ; 108 ea28: 94 e7 ldi r25, 0x74 ; 116 ea2a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); ea2e: be 01 movw r22, r28 ea30: 90 e0 ldi r25, 0x00 ; 0 ea32: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); ea34: 40 e1 ldi r20, 0x10 ; 16 ea36: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); ea3a: 0f 94 5c 99 call 0x332b8 ; 0x332b8 MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); ea3e: 40 e0 ldi r20, 0x00 ; 0 ea40: 60 e0 ldi r22, 0x00 ; 0 ea42: 72 e2 ldi r23, 0x22 ; 34 ea44: 90 e0 ldi r25, 0x00 ; 0 ea46: 80 e0 ldi r24, 0x00 ; 0 ea48: 0f 94 42 53 call 0x2a684 ; 0x2a684 SERIAL_ECHOLNRPGM(MSG_OK); ea4c: 85 ed ldi r24, 0xD5 ; 213 ea4e: 99 e6 ldi r25, 0x69 ; 105 ea50: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // reset soon softReset(); ea54: 0e 94 28 61 call 0xc250 ; 0xc250 0000ea58 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { ea58: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); ea5a: 9f b7 in r25, 0x3f ; 63 ea5c: f8 94 cli ea5e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ea62: 84 60 ori r24, 0x04 ; 4 ea64: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ea68: 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); ea6a: 6c 2f mov r22, r28 ea6c: 83 e0 ldi r24, 0x03 ; 3 ea6e: 9d e0 ldi r25, 0x0D ; 13 ea70: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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) ea74: 80 91 7c 06 lds r24, 0x067C ; 0x80067c ea78: 88 23 and r24, r24 ea7a: 19 f0 breq .+6 ; 0xea82 serial_dump_and_reset(reason); ea7c: 8c 2f mov r24, r28 ea7e: 0e 94 de 74 call 0xe9bc ; 0xe9bc #endif softReset(); ea82: 0e 94 28 61 call 0xc250 ; 0xc250 0000ea86 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { ea86: 1f 92 push r1 ea88: 0f 92 push r0 ea8a: 0f b6 in r0, 0x3f ; 63 ea8c: 0f 92 push r0 ea8e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); ea90: 83 e0 ldi r24, 0x03 ; 3 ea92: 0e 94 2c 75 call 0xea58 ; 0xea58 0000ea96 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { ea96: 1f 92 push r1 ea98: 0f 92 push r0 ea9a: 0f b6 in r0, 0x3f ; 63 ea9c: 0f 92 push r0 ea9e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); eaa0: 82 e0 ldi r24, 0x02 ; 2 eaa2: 0e 94 2c 75 call 0xea58 ; 0xea58 0000eaa6 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); eaa6: 41 ed ldi r20, 0xD1 ; 209 eaa8: 50 e0 ldi r21, 0x00 ; 0 eaaa: 6b e9 ldi r22, 0x9B ; 155 eaac: 73 e7 ldi r23, 0x73 ; 115 eaae: 82 e3 ldi r24, 0x32 ; 50 eab0: 94 e0 ldi r25, 0x04 ; 4 eab2: 0f 94 d6 9e call 0x33dac ; 0x33dac // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); eab6: 0f 94 f5 75 call 0x2ebea ; 0x2ebea #ifdef PIDTEMP updatePID(); eaba: 0f 94 f4 18 call 0x231e8 ; 0x231e8 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); eabe: 0e 94 53 5f call 0xbea6 ; 0xbea6 SERIAL_ECHO_START; eac2: 87 e7 ldi r24, 0x77 ; 119 eac4: 9e e9 ldi r25, 0x9E ; 158 eac6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); eaca: 89 e7 ldi r24, 0x79 ; 121 eacc: 93 e7 ldi r25, 0x73 ; 115 eace: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 0000ead2 : //! @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)); ead2: 44 e0 ldi r20, 0x04 ; 4 ead4: 50 e0 ldi r21, 0x00 ; 0 ead6: 64 e1 ldi r22, 0x14 ; 20 ead8: 70 e0 ldi r23, 0x00 ; 0 eada: 82 e3 ldi r24, 0x32 ; 50 eadc: 94 e0 ldi r25, 0x04 ; 4 eade: 0f 94 2c a1 call 0x34258 ; 0x34258 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match eae2: 43 e0 ldi r20, 0x03 ; 3 eae4: 50 e0 ldi r21, 0x00 ; 0 eae6: 6b e9 ldi r22, 0x9B ; 155 eae8: 73 e7 ldi r23, 0x73 ; 115 eaea: 82 e3 ldi r24, 0x32 ; 50 eaec: 94 e0 ldi r25, 0x04 ; 4 eaee: 0f 94 1b 9f call 0x33e36 ; 0x33e36 eaf2: 89 2b or r24, r25 eaf4: 09 f0 breq .+2 ; 0xeaf8 eaf6: 5d c0 rjmp .+186 ; 0xebb2 { // 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)); eaf8: ef e5 ldi r30, 0x5F ; 95 eafa: f4 e7 ldi r31, 0x74 ; 116 eafc: 45 91 lpm r20, Z+ eafe: 55 91 lpm r21, Z+ eb00: 65 91 lpm r22, Z+ eb02: 74 91 lpm r23, Z eb04: 88 ed ldi r24, 0xD8 ; 216 eb06: 90 e0 ldi r25, 0x00 ; 0 eb08: 0e 94 a3 5d call 0xbb46 ; 0xbb46 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); eb0c: e3 e6 ldi r30, 0x63 ; 99 eb0e: f4 e7 ldi r31, 0x74 ; 116 eb10: 45 91 lpm r20, Z+ eb12: 55 91 lpm r21, Z+ eb14: 65 91 lpm r22, Z+ eb16: 74 91 lpm r23, Z eb18: 8c ed ldi r24, 0xDC ; 220 eb1a: 90 e0 ldi r25, 0x00 ; 0 eb1c: 0e 94 a3 5d call 0xbb46 ; 0xbb46 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); eb20: e7 e6 ldi r30, 0x67 ; 103 eb22: f4 e7 ldi r31, 0x74 ; 116 eb24: 64 91 lpm r22, Z eb26: 80 ee ldi r24, 0xE0 ; 224 eb28: 90 e0 ldi r25, 0x00 ; 0 eb2a: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); eb2e: e8 e6 ldi r30, 0x68 ; 104 eb30: f4 e7 ldi r31, 0x74 ; 116 eb32: 65 91 lpm r22, Z+ eb34: 74 91 lpm r23, Z eb36: 81 ee ldi r24, 0xE1 ; 225 eb38: 90 e0 ldi r25, 0x00 ; 0 eb3a: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); eb3e: ea e6 ldi r30, 0x6A ; 106 eb40: f4 e7 ldi r31, 0x74 ; 116 eb42: 65 91 lpm r22, Z+ eb44: 74 91 lpm r23, Z eb46: 83 ee ldi r24, 0xE3 ; 227 eb48: 90 e0 ldi r25, 0x00 ; 0 eb4a: 0e 94 56 6f call 0xdeac ; 0xdeac // 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)); eb4e: eb e5 ldi r30, 0x5B ; 91 eb50: f4 e7 ldi r31, 0x74 ; 116 eb52: 45 91 lpm r20, Z+ eb54: 55 91 lpm r21, Z+ eb56: 65 91 lpm r22, Z+ eb58: 74 91 lpm r23, Z eb5a: 84 ed ldi r24, 0xD4 ; 212 eb5c: 90 e0 ldi r25, 0x00 ; 0 eb5e: 0e 94 a3 5d call 0xbb46 ; 0xbb46 // 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); eb62: 47 e3 ldi r20, 0x37 ; 55 eb64: 54 e7 ldi r21, 0x74 ; 116 eb66: 60 e1 ldi r22, 0x10 ; 16 eb68: 70 e0 ldi r23, 0x00 ; 0 eb6a: 80 eb ldi r24, 0xB0 ; 176 eb6c: 90 e0 ldi r25, 0x00 ; 0 eb6e: 0e 94 37 6f call 0xde6e ; 0xde6e 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); eb72: 47 e4 ldi r20, 0x47 ; 71 eb74: 54 e7 ldi r21, 0x74 ; 116 eb76: 60 e1 ldi r22, 0x10 ; 16 eb78: 70 e0 ldi r23, 0x00 ; 0 eb7a: 80 ec ldi r24, 0xC0 ; 192 eb7c: 90 e0 ldi r25, 0x00 ; 0 eb7e: 0e 94 37 6f call 0xde6e ; 0xde6e #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)); eb82: 41 ed ldi r20, 0xD1 ; 209 eb84: 50 e0 ldi r21, 0x00 ; 0 eb86: 64 e1 ldi r22, 0x14 ; 20 eb88: 70 e0 ldi r23, 0x00 ; 0 eb8a: 82 e3 ldi r24, 0x32 ; 50 eb8c: 94 e0 ldi r25, 0x04 ; 4 eb8e: 0f 94 2c a1 call 0x34258 ; 0x34258 calculate_extruder_multipliers(); eb92: 0e 94 53 5f call 0xbea6 ; 0xbea6 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(); eb96: 0f 94 f5 75 call 0x2ebea ; 0x2ebea // Call updatePID (similar to when we have processed M301) updatePID(); eb9a: 0f 94 f4 18 call 0x231e8 ; 0x231e8 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; eb9e: 87 e7 ldi r24, 0x77 ; 119 eba0: 9e e9 ldi r25, 0x9E ; 158 eba2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("Stored settings retrieved"); eba6: 8f e5 ldi r24, 0x5F ; 95 eba8: 93 e7 ldi r25, 0x73 ; 115 ebaa: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 ebae: 81 e0 ldi r24, 0x01 ; 1 ebb0: 08 95 ret } else { Config_ResetDefault(); ebb2: 0e 94 53 75 call 0xeaa6 ; 0xeaa6 //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))) { ebb6: 64 e0 ldi r22, 0x04 ; 4 ebb8: 70 e0 ldi r23, 0x00 ; 0 ebba: 84 e1 ldi r24, 0x14 ; 20 ebbc: 90 e0 ldi r25, 0x00 ; 0 ebbe: 0e 94 9b 55 call 0xab36 ; 0xab36 ebc2: 91 e0 ldi r25, 0x01 ; 1 ebc4: 89 27 eor r24, r25 return false; } } return true; } ebc6: 08 95 ret 0000ebc8 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); ebc8: 6b e9 ldi r22, 0x9B ; 155 ebca: 73 e7 ldi r23, 0x73 ; 115 ebcc: 82 e3 ldi r24, 0x32 ; 50 ebce: 94 e0 ldi r25, 0x04 ; 4 ebd0: 0f 94 f3 9e call 0x33de6 ; 0x33de6 #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); ebd4: 41 ed ldi r20, 0xD1 ; 209 ebd6: 50 e0 ldi r21, 0x00 ; 0 ebd8: 64 e1 ldi r22, 0x14 ; 20 ebda: 70 e0 ldi r23, 0x00 ; 0 ebdc: 82 e3 ldi r24, 0x32 ; 50 ebde: 94 e0 ldi r25, 0x04 ; 4 ebe0: 0f 94 50 a1 call 0x342a0 ; 0x342a0 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; ebe4: 87 e7 ldi r24, 0x77 ; 119 ebe6: 9e e9 ldi r25, 0x9E ; 158 ebe8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM("Settings Stored"); ebec: 8f e4 ldi r24, 0x4F ; 79 ebee: 93 e7 ldi r25, 0x73 ; 115 ebf0: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 0000ebf4 : { cmdbuffer_front_already_processed = true; } void get_command() { ebf4: 2f 92 push r2 ebf6: 3f 92 push r3 ebf8: 4f 92 push r4 ebfa: 5f 92 push r5 ebfc: 6f 92 push r6 ebfe: 7f 92 push r7 ec00: 8f 92 push r8 ec02: 9f 92 push r9 ec04: af 92 push r10 ec06: bf 92 push r11 ec08: cf 92 push r12 ec0a: df 92 push r13 ec0c: ef 92 push r14 ec0e: ff 92 push r15 ec10: 0f 93 push r16 ec12: 1f 93 push r17 ec14: cf 93 push r28 ec16: df 93 push r29 ec18: cd b7 in r28, 0x3d ; 61 ec1a: de b7 in r29, 0x3e ; 62 ec1c: a0 97 sbiw r28, 0x20 ; 32 ec1e: 0f b6 in r0, 0x3f ; 63 ec20: f8 94 cli ec22: de bf out 0x3e, r29 ; 62 ec24: 0f be out 0x3f, r0 ; 63 ec26: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) ec28: 8f e5 ldi r24, 0x5F ; 95 ec2a: 90 e0 ldi r25, 0x00 ; 0 ec2c: 0e 94 47 56 call 0xac8e ; 0xac8e ec30: 88 23 and r24, r24 ec32: 09 f4 brne .+2 ; 0xec36 ec34: a1 c0 rjmp .+322 ; 0xed78 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size ec36: 0e 94 4b 55 call 0xaa96 ; 0xaa96 ec3a: 8f 37 cpi r24, 0x7F ; 127 ec3c: 91 05 cpc r25, r1 ec3e: 61 f4 brne .+24 ; 0xec58 // 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; ec40: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 ec44: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 ec48: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 ec4c: 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 ec50: 80 e4 ldi r24, 0x40 ; 64 ec52: 93 e7 ldi r25, 0x73 ; 115 ec54: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 ec58: 6e 01 movw r12, r28 ec5a: 4f e1 ldi r20, 0x1F ; 31 ec5c: c4 0e add r12, r20 ec5e: 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; ec60: 99 24 eor r9, r9 ec62: 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 ec64: 0e 94 4b 55 call 0xaa96 ; 0xaa96 ec68: 18 16 cp r1, r24 ec6a: 19 06 cpc r1, r25 ec6c: 0c f0 brlt .+2 ; 0xec70 ec6e: 78 c0 rjmp .+240 ; 0xed60 ec70: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 ec74: 88 23 and r24, r24 ec76: 29 f0 breq .+10 ; 0xec82 ec78: 0e 94 3e 61 call 0xc27c ; 0xc27c ec7c: 88 23 and r24, r24 ec7e: 09 f4 brne .+2 ; 0xec82 ec80: 6f c0 rjmp .+222 ; 0xed60 ec82: 80 91 61 03 lds r24, 0x0361 ; 0x800361 ec86: 81 11 cpse r24, r1 ec88: 6b c0 rjmp .+214 ; 0xed60 } 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) { ec8a: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 ec8e: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 ec92: 80 91 af 05 lds r24, 0x05AF ; 0x8005af ec96: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 ec9a: 82 17 cp r24, r18 ec9c: 93 07 cpc r25, r19 ec9e: 11 f3 breq .-60 ; 0xec64 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; eca0: f9 01 movw r30, r18 eca2: e1 5d subi r30, 0xD1 ; 209 eca4: fa 4f sbci r31, 0xFA ; 250 eca6: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; eca8: 2f 5f subi r18, 0xFF ; 255 ecaa: 3f 4f sbci r19, 0xFF ; 255 ecac: 2f 77 andi r18, 0x7F ; 127 ecae: 33 27 eor r19, r19 ecb0: 30 93 b2 05 sts 0x05B2, r19 ; 0x8005b2 ecb4: 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)) { ecb8: 8f 3f cpi r24, 0xFF ; 255 ecba: 09 f0 breq .+2 ; 0xecbe ecbc: 79 c0 rjmp .+242 ; 0xedb0 if (mp_cmd_count > 0) { ecbe: 80 91 1b 03 lds r24, 0x031B ; 0x80031b ecc2: 88 23 and r24, r24 ecc4: 09 f4 brne .+2 ; 0xecc8 ecc6: 71 c0 rjmp .+226 ; 0xedaa mp_cmd_active = 1; ecc8: 90 92 1a 03 sts 0x031A, r9 ; 0x80031a mp_cmd_count = 0; eccc: 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}; ecd0: 1f 8e std Y+31, r1 ; 0x1f ecd2: 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) { ecd4: 80 90 1e 03 lds r8, 0x031E ; 0x80031e ecd8: 88 20 and r8, r8 ecda: 21 f2 breq .-120 ; 0xec64 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]; ecdc: 80 91 1c 03 lds r24, 0x031C ; 0x80031c ece0: 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) ece2: f1 e0 ldi r31, 0x01 ; 1 ece4: f8 15 cp r31, r8 ece6: 18 f4 brcc .+6 ; 0xecee out[i] = (char)mp_char_out_buf[i]; ece8: 80 91 1d 03 lds r24, 0x031D ; 0x80031d ecec: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; ecee: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e ecf2: 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]; ecf4: 82 2d mov r24, r2 ecf6: 8c 19 sub r24, r12 ecf8: 88 15 cp r24, r8 ecfa: 08 f0 brcs .+2 ; 0xecfe ecfc: b3 cf rjmp .-154 ; 0xec64 ecfe: f1 01 movw r30, r2 ed00: 11 91 ld r17, Z+ ed02: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); ed04: 81 e2 ldi r24, 0x21 ; 33 ed06: 93 e0 ldi r25, 0x03 ; 3 ed08: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> if (serial_char < 0) ed0c: 17 fd sbrc r17, 7 ed0e: f2 cf rjmp .-28 ; 0xecf4 ed10: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ed14: 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' || ed18: 1a 30 cpi r17, 0x0A ; 10 ed1a: 09 f4 brne .+2 ; 0xed1e ed1c: 4b c1 rjmp .+662 ; 0xefb4 ed1e: 1d 30 cpi r17, 0x0D ; 13 ed20: 09 f4 brne .+2 ; 0xed24 ed22: 48 c1 rjmp .+656 ; 0xefb4 serial_char == '\r' || ed24: 8f 35 cpi r24, 0x5F ; 95 ed26: 91 05 cpc r25, r1 ed28: 0c f0 brlt .+2 ; 0xed2c ed2a: 49 c1 rjmp .+658 ; 0xefbe 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; ed2c: 1b 33 cpi r17, 0x3B ; 59 ed2e: 11 f4 brne .+4 ; 0xed34 ed30: 90 92 20 03 sts 0x0320, r9 ; 0x800320 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; ed34: 20 91 20 03 lds r18, 0x0320 ; 0x800320 ed38: 21 11 cpse r18, r1 ed3a: dc cf rjmp .-72 ; 0xecf4 ed3c: 9c 01 movw r18, r24 ed3e: 2f 5f subi r18, 0xFF ; 255 ed40: 3f 4f sbci r19, 0xFF ; 255 ed42: 30 93 db 0f sts 0x0FDB, r19 ; 0x800fdb ed46: 20 93 da 0f sts 0x0FDA, r18 ; 0x800fda ed4a: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> ed4e: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> ed52: 22 52 subi r18, 0x22 ; 34 ed54: 30 4f sbci r19, 0xF0 ; 240 ed56: 82 0f add r24, r18 ed58: 93 1f adc r25, r19 ed5a: fc 01 movw r30, r24 ed5c: 13 83 std Z+3, r17 ; 0x03 ed5e: ca cf rjmp .-108 ; 0xecf4 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { ed60: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ed64: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb ed68: 18 16 cp r1, r24 ed6a: 19 06 cpc r1, r25 ed6c: 0c f4 brge .+2 ; 0xed70 ed6e: 51 c2 rjmp .+1186 ; 0xf212 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ ed70: 80 91 6a 13 lds r24, 0x136A ; 0x80136a ed74: 81 11 cpse r24, r1 ed76: 67 c2 rjmp .+1230 ; 0xf246 prusa_statistics(6); } } #endif //SDSUPPORT } ed78: a0 96 adiw r28, 0x20 ; 32 ed7a: 0f b6 in r0, 0x3f ; 63 ed7c: f8 94 cli ed7e: de bf out 0x3e, r29 ; 62 ed80: 0f be out 0x3f, r0 ; 63 ed82: cd bf out 0x3d, r28 ; 61 ed84: df 91 pop r29 ed86: cf 91 pop r28 ed88: 1f 91 pop r17 ed8a: 0f 91 pop r16 ed8c: ff 90 pop r15 ed8e: ef 90 pop r14 ed90: df 90 pop r13 ed92: cf 90 pop r12 ed94: bf 90 pop r11 ed96: af 90 pop r10 ed98: 9f 90 pop r9 ed9a: 8f 90 pop r8 ed9c: 7f 90 pop r7 ed9e: 6f 90 pop r6 eda0: 5f 90 pop r5 eda2: 4f 90 pop r4 eda4: 3f 90 pop r3 eda6: 2f 90 pop r2 eda8: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; edaa: 90 92 1b 03 sts 0x031B, r9 ; 0x80031b edae: 90 cf rjmp .-224 ; 0xecd0 return; } if (mp_cmd_active > 0) { edb0: 90 91 1a 03 lds r25, 0x031A ; 0x80031a edb4: 99 23 and r25, r25 edb6: 09 f4 brne .+2 ; 0xedba edb8: 58 c0 rjmp .+176 ; 0xee6a } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { edba: 89 3f cpi r24, 0xF9 ; 249 edbc: e9 f1 breq .+122 ; 0xee38 edbe: 70 f5 brcc .+92 ; 0xee1c edc0: 86 3f cpi r24, 0xF6 ; 246 edc2: 09 f4 brne .+2 ; 0xedc6 edc4: 4a c0 rjmp .+148 ; 0xee5a edc6: 87 3f cpi r24, 0xF7 ; 247 edc8: 09 f4 brne .+2 ; 0xedcc edca: 43 c0 rjmp .+134 ; 0xee52 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. edcc: 8b e0 ldi r24, 0x0B ; 11 edce: 93 e7 ldi r25, 0x73 ; 115 edd0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 // 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); edd4: 86 e0 ldi r24, 0x06 ; 6 edd6: 93 e7 ldi r25, 0x73 ; 115 edd8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 // Echo current state if (mp_config & MPConfig_Active) eddc: 10 91 19 03 lds r17, 0x0319 ; 0x800319 SERIAL_ECHOPGM(" ON"); ede0: 82 e0 ldi r24, 0x02 ; 2 ede2: 93 e7 ldi r25, 0x73 ; 115 // 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) ede4: 10 fd sbrc r17, 0 ede6: 02 c0 rjmp .+4 ; 0xedec SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); ede8: 8d ef ldi r24, 0xFD ; 253 edea: 92 e7 ldi r25, 0x72 ; 114 edec: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (mp_config & MPConfig_NoSpaces) edf0: 01 2f mov r16, r17 edf2: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces edf4: 88 ef ldi r24, 0xF8 ; 248 edf6: 92 e7 ldi r25, 0x72 ; 114 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) edf8: 11 fd sbrc r17, 1 edfa: 02 c0 rjmp .+4 ; 0xee00 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces edfc: 83 ef ldi r24, 0xF3 ; 243 edfe: 92 e7 ldi r25, 0x72 ; 114 ee00: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM(""); ee04: 82 ef ldi r24, 0xF2 ; 242 ee06: 92 e7 ldi r25, 0x72 ; 114 ee08: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) ee0c: 00 23 and r16, r16 ee0e: 49 f1 breq .+82 ; 0xee62 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); ee10: 85 e4 ldi r24, 0x45 ; 69 ee12: 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; ee16: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a ee1a: 5a cf rjmp .-332 ; 0xecd0 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { ee1c: 8a 3f cpi r24, 0xFA ; 250 ee1e: 41 f0 breq .+16 ; 0xee30 ee20: 8b 3f cpi r24, 0xFB ; 251 ee22: a1 f6 brne .-88 ; 0xedcc case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; ee24: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee28: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ee2a: 80 93 19 03 sts 0x0319, r24 ; 0x800319 ee2e: ce cf rjmp .-100 ; 0xedcc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); ee30: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee34: 8e 7f andi r24, 0xFE ; 254 ee36: f9 cf rjmp .-14 ; 0xee2a return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; ee38: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e mp_cmd_active = MPCommand_None; ee3c: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a mp_config = MPConfig_None; ee40: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_char_buf = 0; ee44: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_cmd_count = 0; ee48: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b mp_cmd_active = 0; mp_full_char_queue = 0; ee4c: 10 92 17 03 sts 0x0317, r1 ; 0x800317 ee50: bd cf rjmp .-134 ; 0xedcc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; ee52: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee56: 82 60 ori r24, 0x02 ; 2 ee58: e8 cf rjmp .-48 ; 0xee2a #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ee5a: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee5e: 8d 7f andi r24, 0xFD ; 253 ee60: e4 cf rjmp .-56 ; 0xee2a // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; ee62: 90 e2 ldi r25, 0x20 ; 32 ee64: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> ee68: d6 cf rjmp .-84 ; 0xee16 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { ee6a: 90 91 1b 03 lds r25, 0x031B ; 0x80031b ee6e: 30 91 19 03 lds r19, 0x0319 ; 0x800319 ee72: 99 23 and r25, r25 ee74: 31 f1 breq .+76 ; 0xeec2 ee76: 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) { ee7a: 30 ff sbrs r19, 0 ee7c: 49 c0 rjmp .+146 ; 0xef10 if (mp_full_char_queue > 0) { ee7e: 20 91 17 03 lds r18, 0x0317 ; 0x800317 ee82: 22 23 and r18, r18 ee84: 09 f4 brne .+2 ; 0xee88 ee86: 40 c0 rjmp .+128 ; 0xef08 #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; ee88: 91 e0 ldi r25, 0x01 ; 1 ee8a: 9e 0f add r25, r30 ee8c: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee90: ae 2f mov r26, r30 ee92: b0 e0 ldi r27, 0x00 ; 0 ee94: a4 5e subi r26, 0xE4 ; 228 ee96: bc 4f sbci r27, 0xFC ; 252 ee98: ff ef ldi r31, 0xFF ; 255 ee9a: 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) { ee9c: 40 91 18 03 lds r20, 0x0318 ; 0x800318 eea0: 44 23 and r20, r20 eea2: 51 f0 breq .+20 ; 0xeeb8 #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; eea4: ee 5f subi r30, 0xFE ; 254 eea6: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e eeaa: e9 2f mov r30, r25 eeac: f0 e0 ldi r31, 0x00 ; 0 eeae: e4 5e subi r30, 0xE4 ; 228 eeb0: fc 4f sbci r31, 0xFC ; 252 eeb2: 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; eeb4: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; eeb8: 21 50 subi r18, 0x01 ; 1 eeba: 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; eebe: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b eec2: 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) { eec6: 30 ff sbrs r19, 0 eec8: 6c c0 rjmp .+216 ; 0xefa2 if (mp_full_char_queue > 0) { eeca: 90 91 17 03 lds r25, 0x0317 ; 0x800317 eece: 99 23 and r25, r25 eed0: 49 f1 breq .+82 ; 0xef24 #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; eed2: 21 e0 ldi r18, 0x01 ; 1 eed4: 2e 0f add r18, r30 eed6: 20 93 1e 03 sts 0x031E, r18 ; 0x80031e eeda: ae 2f mov r26, r30 eedc: b0 e0 ldi r27, 0x00 ; 0 eede: a4 5e subi r26, 0xE4 ; 228 eee0: bc 4f sbci r27, 0xFC ; 252 eee2: 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) { eee4: 80 91 18 03 lds r24, 0x0318 ; 0x800318 eee8: 88 23 and r24, r24 eeea: 51 f0 breq .+20 ; 0xef00 #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; eeec: ee 5f subi r30, 0xFE ; 254 eeee: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e eef2: e2 2f mov r30, r18 eef4: f0 e0 ldi r31, 0x00 ; 0 eef6: e4 5e subi r30, 0xE4 ; 228 eef8: fc 4f sbci r31, 0xFC ; 252 eefa: 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; eefc: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; ef00: 91 50 subi r25, 0x01 ; 1 ef02: 90 93 17 03 sts 0x0317, r25 ; 0x800317 ef06: e4 ce rjmp .-568 ; 0xecd0 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; ef08: 42 e0 ldi r20, 0x02 ; 2 ef0a: 40 93 17 03 sts 0x0317, r20 ; 0x800317 ef0e: d7 cf rjmp .-82 ; 0xeebe #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; ef10: 91 e0 ldi r25, 0x01 ; 1 ef12: 9e 0f add r25, r30 ef14: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ef18: f0 e0 ldi r31, 0x00 ; 0 ef1a: e4 5e subi r30, 0xE4 ; 228 ef1c: fc 4f sbci r31, 0xFC ; 252 ef1e: 9f ef ldi r25, 0xFF ; 255 ef20: 90 83 st Z, r25 ef22: cd cf rjmp .-102 ; 0xeebe ef24: a8 2f mov r26, r24 ef26: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; ef28: 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; ef2a: 21 e0 ldi r18, 0x01 ; 1 ef2c: af 30 cpi r26, 0x0F ; 15 ef2e: 29 f0 breq .+10 ; 0xef3a ef30: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char ef32: a0 50 subi r26, 0x00 ; 0 ef34: be 4f sbci r27, 0xFE ; 254 ef36: 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; ef38: 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; ef3a: 48 2f mov r20, r24 ef3c: 40 7f andi r20, 0xF0 ; 240 ef3e: 40 3f cpi r20, 0xF0 ; 240 ef40: 59 f4 brne .+22 ; 0xef58 ef42: 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) { ef44: 20 ff sbrs r18, 0 ef46: 13 c0 rjmp .+38 ; 0xef6e ++mp_full_char_queue; ef48: 90 92 17 03 sts 0x0317, r9 ; 0x800317 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ef4c: 21 ff sbrs r18, 1 ef4e: 0c c0 rjmp .+24 ; 0xef68 ef50: e2 e0 ldi r30, 0x02 ; 2 ef52: e0 93 17 03 sts 0x0317, r30 ; 0x800317 ef56: bc ce rjmp .-648 ; 0xecd0 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 ef58: 82 95 swap r24 ef5a: 8f 70 andi r24, 0x0F ; 15 ef5c: a8 2f mov r26, r24 ef5e: b0 e0 ldi r27, 0x00 ; 0 ef60: a0 50 subi r26, 0x00 ; 0 ef62: be 4f sbci r27, 0xFE ; 254 ef64: 9c 91 ld r25, X ef66: ee cf rjmp .-36 ; 0xef44 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]; ef68: 90 93 18 03 sts 0x0318, r25 ; 0x800318 ef6c: b1 ce rjmp .-670 ; 0xecd0 #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; ef6e: 81 e0 ldi r24, 0x01 ; 1 ef70: 8e 0f add r24, r30 ef72: 80 93 1e 03 sts 0x031E, r24 ; 0x80031e ef76: ae 2f mov r26, r30 ef78: b0 e0 ldi r27, 0x00 ; 0 ef7a: a4 5e subi r26, 0xE4 ; 228 ef7c: bc 4f sbci r27, 0xFC ; 252 ef7e: 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') { ef80: 3a 30 cpi r19, 0x0A ; 10 ef82: 09 f4 brne .+2 ; 0xef86 ef84: a5 ce rjmp .-694 ; 0xecd0 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ef86: 21 ff sbrs r18, 1 ef88: 03 c0 rjmp .+6 ; 0xef90 ef8a: 90 92 17 03 sts 0x0317, r9 ; 0x800317 ef8e: a0 ce rjmp .-704 ; 0xecd0 #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; ef90: ee 5f subi r30, 0xFE ; 254 ef92: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ef96: e8 2f mov r30, r24 ef98: f0 e0 ldi r31, 0x00 ; 0 ef9a: e4 5e subi r30, 0xE4 ; 228 ef9c: fc 4f sbci r31, 0xFC ; 252 ef9e: 90 83 st Z, r25 efa0: 97 ce rjmp .-722 ; 0xecd0 efa2: 91 e0 ldi r25, 0x01 ; 1 efa4: 9e 0f add r25, r30 efa6: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e efaa: f0 e0 ldi r31, 0x00 ; 0 efac: e4 5e subi r30, 0xE4 ; 228 efae: fc 4f sbci r31, 0xFC ; 252 efb0: 80 83 st Z, r24 efb2: 8e ce rjmp .-740 ; 0xecd0 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line efb4: 00 97 sbiw r24, 0x00 ; 0 efb6: 19 f4 brne .+6 ; 0xefbe comment_mode = false; //for new command efb8: 10 92 20 03 sts 0x0320, r1 ; 0x800320 efbc: dd ce rjmp .-582 ; 0xed78 efbe: 00 91 dc 0f lds r16, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> efc2: 10 91 dd 0f lds r17, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string efc6: 0f 51 subi r16, 0x1F ; 31 efc8: 10 4f sbci r17, 0xF0 ; 240 efca: 80 0f add r24, r16 efcc: 91 1f adc r25, r17 efce: fc 01 movw r30, r24 efd0: 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) efd2: 1a 83 std Y+2, r17 ; 0x02 efd4: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ efd6: 80 91 20 03 lds r24, 0x0320 ; 0x800320 efda: 81 11 cpse r24, r1 efdc: fd c0 rjmp .+506 ; 0xf1d8 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { efde: f8 01 movw r30, r16 efe0: 80 81 ld r24, Z efe2: 8e 34 cpi r24, 0x4E ; 78 efe4: 09 f0 breq .+2 ; 0xefe8 efe6: 84 c0 rjmp .+264 ; 0xf0f0 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); efe8: 4a e0 ldi r20, 0x0A ; 10 efea: 50 e0 ldi r21, 0x00 ; 0 efec: be 01 movw r22, r28 efee: 6f 5f subi r22, 0xFF ; 255 eff0: 7f 4f sbci r23, 0xFF ; 255 eff2: c8 01 movw r24, r16 eff4: 01 96 adiw r24, 0x01 ; 1 eff6: 0f 94 c7 9c call 0x3398e ; 0x3398e effa: 2b 01 movw r4, r22 effc: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; effe: e9 80 ldd r14, Y+1 ; 0x01 f000: fa 80 ldd r15, Y+2 ; 0x02 f002: f7 01 movw r30, r14 f004: 80 81 ld r24, Z f006: 80 32 cpi r24, 0x20 ; 32 f008: 31 f4 brne .+12 ; 0xf016 f00a: ff ef ldi r31, 0xFF ; 255 f00c: ef 1a sub r14, r31 f00e: ff 0a sbc r15, r31 f010: fa 82 std Y+2, r15 ; 0x02 f012: e9 82 std Y+1, r14 ; 0x01 f014: f4 cf rjmp .-24 ; 0xeffe // 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)) { f016: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 f01a: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 f01e: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 f022: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 f026: 01 96 adiw r24, 0x01 ; 1 f028: a1 1d adc r26, r1 f02a: b1 1d adc r27, r1 f02c: 84 15 cp r24, r4 f02e: 95 05 cpc r25, r5 f030: a6 05 cpc r26, r6 f032: b7 05 cpc r27, r7 f034: 49 f0 breq .+18 ; 0xf048 f036: 44 e0 ldi r20, 0x04 ; 4 f038: 50 e0 ldi r21, 0x00 ; 0 f03a: 6b e3 ldi r22, 0x3B ; 59 f03c: 73 e7 ldi r23, 0x73 ; 115 f03e: c7 01 movw r24, r14 f040: 0f 94 1b 9f call 0x33e36 ; 0x33e36 f044: 89 2b or r24, r25 f046: a1 f4 brne .+40 ; 0xf070 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) f048: 6a e2 ldi r22, 0x2A ; 42 f04a: 70 e0 ldi r23, 0x00 ; 0 f04c: c7 01 movw r24, r14 f04e: 0f 94 93 a7 call 0x34f26 ; 0x34f26 f052: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 f056: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 f05a: 00 97 sbiw r24, 0x00 ; 0 f05c: 09 f4 brne .+2 ; 0xf060 f05e: 41 c0 rjmp .+130 ; 0xf0e2 f060: f8 01 movw r30, r16 { byte checksum = 0; f062: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) f064: 8e 17 cp r24, r30 f066: 9f 07 cpc r25, r31 f068: f1 f0 breq .+60 ; 0xf0a6 checksum = checksum^(*p++); f06a: 21 91 ld r18, Z+ f06c: f2 26 eor r15, r18 f06e: fa cf rjmp .-12 ; 0xf064 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; f070: 8a e5 ldi r24, 0x5A ; 90 f072: 9e e9 ldi r25, 0x9E ; 158 f074: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO f078: 82 ee ldi r24, 0xE2 ; 226 f07a: 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 f07c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 f080: 60 91 d1 11 lds r22, 0x11D1 ; 0x8011d1 f084: 70 91 d2 11 lds r23, 0x11D2 ; 0x8011d2 f088: 80 91 d3 11 lds r24, 0x11D3 ; 0x8011d3 f08c: 90 91 d4 11 lds r25, 0x11D4 ; 0x8011d4 f090: 0f 94 02 98 call 0x33004 ; 0x33004 } void MarlinSerial::println(long n, int base) { print(n, base); println(); f094: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); f098: 0e 94 6d 55 call 0xaada ; 0xaada serial_count = 0; f09c: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f0a0: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda f0a4: 69 ce rjmp .-814 ; 0xed78 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { f0a6: 0e 94 d8 55 call 0xabb0 ; 0xabb0 f0aa: f8 16 cp r15, r24 f0ac: 19 06 cpc r1, r25 f0ae: 39 f0 breq .+14 ; 0xf0be SERIAL_ERROR_START; f0b0: 8a e5 ldi r24, 0x5A ; 90 f0b2: 9e e9 ldi r25, 0x9E ; 158 f0b4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH f0b8: 83 ec ldi r24, 0xC3 ; 195 f0ba: 93 e6 ldi r25, 0x63 ; 99 f0bc: df cf rjmp .-66 ; 0xf07c FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; f0be: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 f0c2: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 f0c6: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) f0c8: e9 80 ldd r14, Y+1 ; 0x01 f0ca: fa 80 ldd r15, Y+2 ; 0x02 f0cc: 66 e3 ldi r22, 0x36 ; 54 f0ce: 73 e7 ldi r23, 0x73 ; 115 f0d0: c7 01 movw r24, r14 f0d2: 0f 94 ea 9e call 0x33dd4 ; 0x33dd4 f0d6: 89 2b or r24, r25 f0d8: 39 f5 brne .+78 ; 0xf128 kill(MSG_M112_KILL); f0da: 89 e2 ldi r24, 0x29 ; 41 f0dc: 96 e6 ldi r25, 0x66 ; 102 f0de: 0e 94 60 73 call 0xe6c0 ; 0xe6c0 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; f0e2: 8a e5 ldi r24, 0x5A ; 90 f0e4: 9e e9 ldi r25, 0x9E ; 158 f0e6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM f0ea: 89 e9 ldi r24, 0x99 ; 153 f0ec: 93 e6 ldi r25, 0x63 ; 99 f0ee: c6 cf rjmp .-116 ; 0xf07c } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; f0f0: 89 81 ldd r24, Y+1 ; 0x01 f0f2: 9a 81 ldd r25, Y+2 ; 0x02 f0f4: fc 01 movw r30, r24 f0f6: 20 81 ld r18, Z f0f8: 20 32 cpi r18, 0x20 ; 32 f0fa: 21 f4 brne .+8 ; 0xf104 f0fc: 01 96 adiw r24, 0x01 ; 1 f0fe: 9a 83 std Y+2, r25 ; 0x02 f100: 89 83 std Y+1, r24 ; 0x01 f102: f6 cf rjmp .-20 ; 0xf0f0 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) f104: 6a e2 ldi r22, 0x2A ; 42 f106: 70 e0 ldi r23, 0x00 ; 0 f108: 0f 94 93 a7 call 0x34f26 ; 0x34f26 f10c: 89 2b or r24, r25 f10e: 39 f0 breq .+14 ; 0xf11e { SERIAL_ERROR_START; f110: 8a e5 ldi r24, 0x5A ; 90 f112: 9e e9 ldi r25, 0x9E ; 158 f114: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM f118: 8f e6 ldi r24, 0x6F ; 111 f11a: 93 e6 ldi r25, 0x63 ; 99 f11c: af cf rjmp .-162 ; 0xf07c 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 f11e: 44 24 eor r4, r4 f120: 4a 94 dec r4 f122: 54 2c mov r5, r4 f124: 32 01 movw r6, r4 f126: d0 cf rjmp .-96 ; 0xf0c8 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) f128: 44 e0 ldi r20, 0x04 ; 4 f12a: 50 e0 ldi r21, 0x00 ; 0 f12c: 61 e3 ldi r22, 0x31 ; 49 f12e: 73 e7 ldi r23, 0x73 ; 115 f130: c7 01 movw r24, r14 f132: 0f 94 1b 9f call 0x33e36 ; 0x33e36 f136: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { f138: f7 01 movw r30, r14 f13a: 80 81 ld r24, Z f13c: 87 34 cpi r24, 0x47 ; 71 f13e: 81 f4 brne .+32 ; 0xf160 f140: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> f144: 85 30 cpi r24, 0x05 ; 5 f146: 61 f0 breq .+24 ; 0xf160 usb_timer.start(); f148: 85 ed ldi r24, 0xD5 ; 213 f14a: 91 e1 ldi r25, 0x11 ; 17 f14c: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; f150: f6 e0 ldi r31, 0x06 ; 6 f152: f0 93 cb 0d sts 0x0DCB, r31 ; 0x800dcb <_ZL13printer_state.lto_priv.365> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f156: 60 e0 ldi r22, 0x00 ; 0 f158: 85 ea ldi r24, 0xA5 ; 165 f15a: 9f e0 ldi r25, 0x0F ; 15 f15c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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) { f160: ab 28 or r10, r11 f162: 21 f0 breq .+8 ; 0xf16c f164: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce f168: 81 11 cpse r24, r1 f16a: 98 cf rjmp .-208 ; 0xf09c } // 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; f16c: 26 e0 ldi r18, 0x06 ; 6 f16e: 77 fc sbrc r7, 7 f170: 21 e0 ldi r18, 0x01 ; 1 f172: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f176: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f17a: fc 01 movw r30, r24 f17c: e2 52 subi r30, 0x22 ; 34 f17e: f0 4f sbci r31, 0xF0 ; 240 f180: 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) f182: 49 81 ldd r20, Y+1 ; 0x01 f184: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; f186: 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) f188: da 01 movw r26, r20 f18a: 40 17 cp r20, r16 f18c: 51 07 cpc r21, r17 f18e: a1 f5 brne .+104 ; 0xf1f8 cmd_len = strlen(cmd_start) + 1; f190: 01 90 ld r0, Z+ f192: 00 20 and r0, r0 f194: e9 f7 brne .-6 ; 0xf190 f196: 9f 01 movw r18, r30 f198: 20 1b sub r18, r16 f19a: 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; f19c: 03 96 adiw r24, 0x03 ; 3 f19e: 28 0f add r18, r24 f1a0: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) f1a2: 2d 3e cpi r18, 0xED ; 237 f1a4: f1 e0 ldi r31, 0x01 ; 1 f1a6: 3f 07 cpc r19, r31 f1a8: 79 f1 breq .+94 ; 0xf208 // 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; f1aa: 30 93 dd 0f sts 0x0FDD, r19 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f1ae: 20 93 dc 0f sts 0x0FDC, r18 ; 0x800fdc <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f1b2: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f1b6: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f1ba: 01 96 adiw r24, 0x01 ; 1 f1bc: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f1c0: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf // Update the processed gcode line if (gcode_N >= 0) f1c4: 77 fc sbrc r7, 7 f1c6: 08 c0 rjmp .+16 ; 0xf1d8 gcode_LastN = gcode_N; f1c8: 40 92 d1 11 sts 0x11D1, r4 ; 0x8011d1 f1cc: 50 92 d2 11 sts 0x11D2, r5 ; 0x8011d2 f1d0: 60 92 d3 11 sts 0x11D3, r6 ; 0x8011d3 f1d4: 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 f1d8: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f1dc: 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)) f1e0: 0e 94 4b 55 call 0xaa96 ; 0xaa96 f1e4: 89 2b or r24, r25 f1e6: 09 f4 brne .+2 ; 0xf1ea f1e8: c7 cd rjmp .-1138 ; 0xed78 f1ea: 8f e5 ldi r24, 0x5F ; 95 f1ec: 90 e0 ldi r25, 0x00 ; 0 f1ee: 0e 94 47 56 call 0xac8e ; 0xac8e f1f2: 81 11 cpse r24, r1 f1f4: 7f cd rjmp .-1282 ; 0xecf4 f1f6: c0 cd rjmp .-1152 ; 0xed78 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]; } f1f8: 6d 91 ld r22, X+ f1fa: 61 93 st Z+, r22 f1fc: 9d 01 movw r18, r26 f1fe: 24 1b sub r18, r20 f200: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); f202: 61 11 cpse r22, r1 f204: f9 cf rjmp .-14 ; 0xf1f8 f206: ca cf rjmp .-108 ; 0xf19c } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; f208: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f20c: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> f210: d0 cf rjmp .-96 ; 0xf1b2 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { f212: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f216: 60 e2 ldi r22, 0x20 ; 32 f218: 73 e0 ldi r23, 0x03 ; 3 f21a: 81 11 cpse r24, r1 f21c: 02 c0 rjmp .+4 ; 0xf222 f21e: 60 ed ldi r22, 0xD0 ; 208 f220: 77 e0 ldi r23, 0x07 ; 7 f222: 81 e2 ldi r24, 0x21 ; 33 f224: 93 e0 ldi r25, 0x03 ; 3 f226: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> f22a: 88 23 and r24, r24 f22c: 09 f4 brne .+2 ; 0xf230 f22e: a0 cd rjmp .-1216 ; 0xed70 comment_mode = false; f230: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; f234: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f238: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda SERIAL_ECHOLNPGM("RX timeout"); f23c: 86 e2 ldi r24, 0x26 ; 38 f23e: 93 e7 ldi r25, 0x73 ; 115 f240: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 f244: 99 cd rjmp .-1230 ; 0xed78 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ f246: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f24a: 88 23 and r24, r24 f24c: 09 f4 brne .+2 ; 0xf250 f24e: 94 cd rjmp .-1240 ; 0xed78 f250: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda f254: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb f258: 89 2b or r24, r25 f25a: 09 f0 breq .+2 ; 0xf25e f25c: 8d cd rjmp .-1254 ; 0xed78 //'#' 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; f25e: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f262: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f266: 89 2b or r24, r25 f268: 11 f4 brne .+4 ; 0xf26e f26a: 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; f26e: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f270: 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) { f272: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f276: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f27a: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f27e: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f282: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f286: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f28a: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f28e: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f292: 48 17 cp r20, r24 f294: 59 07 cpc r21, r25 f296: 6a 07 cpc r22, r26 f298: 7b 07 cpc r23, r27 f29a: 08 f0 brcs .+2 ; 0xf29e f29c: c1 c0 rjmp .+386 ; 0xf420 f29e: 80 91 1f 03 lds r24, 0x031F ; 0x80031f f2a2: 81 11 cpse r24, r1 f2a4: bd c0 rjmp .+378 ; 0xf420 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); f2a6: 0f 94 2b 49 call 0x29256 ; 0x29256 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_;} f2aa: 40 91 02 16 lds r20, 0x1602 ; 0x801602 f2ae: 50 91 03 16 lds r21, 0x1603 ; 0x801603 f2b2: 60 91 04 16 lds r22, 0x1604 ; 0x801604 f2b6: 70 91 05 16 lds r23, 0x1605 ; 0x801605 sdpos = file.curPosition(); f2ba: 40 93 7e 16 sts 0x167E, r20 ; 0x80167e f2be: 50 93 7f 16 sts 0x167F, r21 ; 0x80167f f2c2: 60 93 80 16 sts 0x1680, r22 ; 0x801680 f2c6: 70 93 81 16 sts 0x1681, r23 ; 0x801681 f2ca: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda f2ce: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' f2d2: 8a 30 cpi r24, 0x0A ; 10 f2d4: 61 f0 breq .+24 ; 0xf2ee || serial_char == '\r' f2d6: 8d 30 cpi r24, 0x0D ; 13 f2d8: 51 f0 breq .+20 ; 0xf2ee || serial_char == '#' f2da: 83 32 cpi r24, 0x23 ; 35 f2dc: 09 f4 brne .+2 ; 0xf2e0 f2de: 87 c0 rjmp .+270 ; 0xf3ee || serial_count >= (MAX_CMD_SIZE - 1) f2e0: 2f 35 cpi r18, 0x5F ; 95 f2e2: 31 05 cpc r19, r1 f2e4: 24 f4 brge .+8 ; 0xf2ee || n==-1 f2e6: 8f 3f cpi r24, 0xFF ; 255 f2e8: 98 07 cpc r25, r24 f2ea: 09 f0 breq .+2 ; 0xf2ee f2ec: 87 c0 rjmp .+270 ; 0xf3fc ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) f2ee: 21 15 cp r18, r1 f2f0: 31 05 cpc r19, r1 f2f2: 09 f4 brne .+2 ; 0xf2f6 f2f4: 41 cd rjmp .-1406 ; 0xed78 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); }; f2f6: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f2fa: 81 11 cpse r24, r1 f2fc: 03 c0 rjmp .+6 ; 0xf304 f2fe: 40 e0 ldi r20, 0x00 ; 0 f300: 50 e0 ldi r21, 0x00 ; 0 f302: 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; f304: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc f308: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd f30c: 48 1b sub r20, r24 f30e: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; f310: a0 91 dc 0f lds r26, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f314: b0 91 dd 0f lds r27, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f318: fd 01 movw r30, r26 f31a: e2 52 subi r30, 0x22 ; 34 f31c: f0 4f sbci r31, 0xF0 ; 240 f31e: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; f320: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; f322: 52 83 std Z+2, r21 ; 0x02 f324: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string f326: 22 52 subi r18, 0x22 ; 34 f328: 30 4f sbci r19, 0xF0 ; 240 f32a: f9 01 movw r30, r18 f32c: ea 0f add r30, r26 f32e: fb 1f adc r31, r27 f330: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); f332: a2 52 subi r26, 0x22 ; 34 f334: b0 4f sbci r27, 0xF0 ; 240 f336: fd 01 movw r30, r26 f338: 01 90 ld r0, Z+ f33a: 00 20 and r0, r0 f33c: e9 f7 brne .-6 ; 0xf338 f33e: 31 97 sbiw r30, 0x01 ; 1 f340: ea 1b sub r30, r26 f342: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); f344: 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; f346: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f34a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f34e: 01 96 adiw r24, 0x01 ; 1 f350: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f354: 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); f358: 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; f35a: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f35e: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f362: e8 0f add r30, r24 f364: f9 2f mov r31, r25 f366: f1 1d adc r31, r1 f368: f0 93 dd 0f sts 0x0FDD, r31 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f36c: e0 93 dc 0f sts 0x0FDC, r30 ; 0x800fdc <_ZL7bufindw.lto_priv.514> f370: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f374: 88 23 and r24, r24 f376: 09 f4 brne .+2 ; 0xf37a f378: 3d c0 rjmp .+122 ; 0xf3f4 f37a: 80 91 7e 16 lds r24, 0x167E ; 0x80167e f37e: 90 91 7f 16 lds r25, 0x167F ; 0x80167f f382: a0 91 80 16 lds r26, 0x1680 ; 0x801680 f386: b0 91 81 16 lds r27, 0x1681 ; 0x801681 sdpos_atomic = card.get_sdpos(); f38a: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc f38e: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd f392: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de f396: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df if (bufindw == sizeof(cmdbuffer)) f39a: ed 3e cpi r30, 0xED ; 237 f39c: f1 40 sbci r31, 0x01 ; 1 f39e: 21 f4 brne .+8 ; 0xf3a8 bufindw = 0; f3a0: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f3a4: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> sei(); f3a8: 78 94 sei comment_mode = false; //for new command f3aa: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; //clear buffer f3ae: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f3b2: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda if(card.eof()) break; f3b6: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f3ba: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f3be: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f3c2: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f3c6: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f3ca: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f3ce: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f3d2: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f3d6: 48 17 cp r20, r24 f3d8: 59 07 cpc r21, r25 f3da: 6a 07 cpc r22, r26 f3dc: 7b 07 cpc r23, r27 f3de: 00 f5 brcc .+64 ; 0xf420 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) f3e0: 8f e5 ldi r24, 0x5F ; 95 f3e2: 90 e0 ldi r25, 0x00 ; 0 f3e4: 0e 94 47 56 call 0xac8e ; 0xac8e f3e8: 81 11 cpse r24, r1 f3ea: 43 cf rjmp .-378 ; 0xf272 f3ec: c5 cc rjmp .-1654 ; 0xed78 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f3ee: 00 93 1f 03 sts 0x031F, r16 ; 0x80031f f3f2: 7d cf rjmp .-262 ; 0xf2ee f3f4: 80 e0 ldi r24, 0x00 ; 0 f3f6: 90 e0 ldi r25, 0x00 ; 0 f3f8: dc 01 movw r26, r24 f3fa: c7 cf rjmp .-114 ; 0xf38a return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; f3fc: a9 01 movw r20, r18 f3fe: 4f 5f subi r20, 0xFF ; 255 f400: 5f 4f sbci r21, 0xFF ; 255 f402: 50 93 db 0f sts 0x0FDB, r21 ; 0x800fdb f406: 40 93 da 0f sts 0x0FDA, r20 ; 0x800fda f40a: 40 91 dc 0f lds r20, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f40e: 50 91 dd 0f lds r21, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f412: 42 52 subi r20, 0x22 ; 34 f414: 50 4f sbci r21, 0xF0 ; 240 f416: 24 0f add r18, r20 f418: 35 1f adc r19, r21 f41a: f9 01 movw r30, r18 f41c: 83 83 std Z+3, r24 ; 0x03 f41e: 29 cf rjmp .-430 ; 0xf272 } } if(card.eof()) f420: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f424: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f428: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f42c: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f430: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f434: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f438: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f43c: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f440: 48 17 cp r20, r24 f442: 59 07 cpc r21, r25 f444: 6a 07 cpc r22, r26 f446: 7b 07 cpc r23, r27 f448: 08 f4 brcc .+2 ; 0xf44c f44a: 96 cc rjmp .-1748 ; 0xed78 { // 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()) f44c: 0e 94 14 70 call 0xe028 ; 0xe028 f450: 89 2b or r24, r25 f452: 09 f0 breq .+2 ; 0xf456 f454: 91 cc rjmp .-1758 ; 0xed78 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); f456: 0f 94 3a 42 call 0x28474 ; 0x28474 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED f45a: 8c e5 ldi r24, 0x5C ; 92 f45c: 93 e6 ldi r25, 0x63 ; 99 f45e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 char time[30]; uint32_t t = print_job_timer.duration() / 60; f462: 0f 94 c4 1c call 0x23988 ; 0x23988 f466: 6b 01 movw r12, r22 f468: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); f46a: 0e 94 b9 5f call 0xbf72 ; 0xbf72 // 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; f46e: 8c e3 ldi r24, 0x3C ; 60 f470: 88 2e mov r8, r24 f472: 91 2c mov r9, r1 f474: a1 2c mov r10, r1 f476: b1 2c mov r11, r1 f478: c7 01 movw r24, r14 f47a: b6 01 movw r22, r12 f47c: a5 01 movw r20, r10 f47e: 94 01 movw r18, r8 f480: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> int hours, minutes; minutes = t % 60; f484: ca 01 movw r24, r20 f486: b9 01 movw r22, r18 f488: a5 01 movw r20, r10 f48a: 94 01 movw r18, r8 f48c: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f490: 7f 93 push r23 f492: 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; f494: c7 01 movw r24, r14 f496: b6 01 movw r22, r12 f498: 20 e1 ldi r18, 0x10 ; 16 f49a: 3e e0 ldi r19, 0x0E ; 14 f49c: 40 e0 ldi r20, 0x00 ; 0 f49e: 50 e0 ldi r21, 0x00 ; 0 f4a0: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f4a4: 3f 93 push r19 f4a6: 2f 93 push r18 f4a8: 82 e1 ldi r24, 0x12 ; 18 f4aa: 93 e7 ldi r25, 0x73 ; 115 f4ac: 9f 93 push r25 f4ae: 8f 93 push r24 f4b0: 8e 01 movw r16, r28 f4b2: 0f 5f subi r16, 0xFF ; 255 f4b4: 1f 4f sbci r17, 0xFF ; 255 f4b6: 1f 93 push r17 f4b8: 0f 93 push r16 f4ba: 0f 94 53 a0 call 0x340a6 ; 0x340a6 SERIAL_ECHO_START; f4be: 87 e7 ldi r24, 0x77 ; 119 f4c0: 9e e9 ldi r25, 0x9E ; 158 f4c2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(time); f4c6: c8 01 movw r24, r16 f4c8: 0f 94 5d 9a call 0x334ba ; 0x334ba lcd_setstatus(time); f4cc: c8 01 movw r24, r16 f4ce: 0e 94 8d ef call 0x1df1a ; 0x1df1a card.printingHasFinished(); f4d2: 0f 94 9b 4d call 0x29b36 ; 0x29b36 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; f4d6: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) f4da: 0f b6 in r0, 0x3f ; 63 f4dc: f8 94 cli f4de: de bf out 0x3e, r29 ; 62 f4e0: 0f be out 0x3f, r0 ; 63 f4e2: cd bf out 0x3d, r28 ; 61 f4e4: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f4e8: 88 23 and r24, r24 f4ea: 59 f0 breq .+22 ; 0xf502 f4ec: 0f 94 6e 44 call 0x288dc ; 0x288dc card.checkautostart(true); if (farm_mode) f4f0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f4f4: 88 23 and r24, r24 f4f6: 09 f4 brne .+2 ; 0xf4fa f4f8: 3f cc rjmp .-1922 ; 0xed78 prusa_statistics(6); f4fa: 86 e0 ldi r24, 0x06 ; 6 f4fc: 0f 94 5f 99 call 0x332be ; 0x332be f500: 3b cc rjmp .-1930 ; 0xed78 { mount(); f502: 81 e0 ldi r24, 0x01 ; 1 f504: 0f 94 da 4d call 0x29bb4 ; 0x29bb4 if(!mounted) //fail f508: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f50c: 81 11 cpse r24, r1 f50e: ee cf rjmp .-36 ; 0xf4ec f510: ef cf rjmp .-34 ; 0xf4f0 0000f512 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { f512: 0f 93 push r16 f514: 1f 93 push r17 f516: cf 93 push r28 f518: df 93 push r29 f51a: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { f51c: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f520: 81 30 cpi r24, 0x01 ; 1 f522: 09 f4 brne .+2 ; 0xf526 f524: 49 c0 rjmp .+146 ; 0xf5b8 f526: 82 30 cpi r24, 0x02 ; 2 f528: 09 f4 brne .+2 ; 0xf52c f52a: 4d c0 rjmp .+154 ; 0xf5c6 * * 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) f52c: 0e 94 9a 61 call 0xc334 ; 0xc334 f530: 81 11 cpse r24, r1 f532: ec c0 rjmp .+472 ; 0xf70c f534: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 f538: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 f53c: 00 97 sbiw r24, 0x00 ; 0 f53e: 39 f4 brne .+14 ; 0xf54e f540: 20 91 ed 11 lds r18, 0x11ED ; 0x8011ed f544: 30 91 ee 11 lds r19, 0x11EE ; 0x8011ee f548: 23 2b or r18, r19 f54a: 09 f4 brne .+2 ; 0xf54e f54c: df c0 rjmp .+446 ; 0xf70c f54e: 40 91 33 02 lds r20, 0x0233 ; 0x800233 f552: 50 91 34 02 lds r21, 0x0234 ; 0x800234 f556: 60 91 35 02 lds r22, 0x0235 ; 0x800235 f55a: 70 91 36 02 lds r23, 0x0236 ; 0x800236 f55e: 41 15 cp r20, r1 f560: 51 05 cpc r21, r1 f562: 61 05 cpc r22, r1 f564: 71 05 cpc r23, r1 f566: 09 f4 brne .+2 ; 0xf56a f568: d1 c0 rjmp .+418 ; 0xf70c { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) f56a: 89 2b or r24, r25 f56c: 31 f4 brne .+12 ; 0xf57a f56e: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed f572: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee f576: 89 2b or r24, r25 f578: 29 f0 breq .+10 ; 0xf584 f57a: 80 91 1a 06 lds r24, 0x061A ; 0x80061a f57e: 88 23 and r24, r24 f580: 09 f4 brne .+2 ; 0xf584 f582: 2c c1 rjmp .+600 ; 0xf7dc { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) f584: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f588: 88 23 and r24, r24 f58a: 21 f0 breq .+8 ; 0xf594 f58c: 40 ee ldi r20, 0xE0 ; 224 f58e: 52 e3 ldi r21, 0x32 ; 50 f590: 69 e2 ldi r22, 0x29 ; 41 f592: 70 e0 ldi r23, 0x00 ; 0 f594: 8a e1 ldi r24, 0x1A ; 26 f596: 96 e0 ldi r25, 0x06 ; 6 f598: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> f59c: 88 23 and r24, r24 f59e: 09 f4 brne .+2 ; 0xf5a2 f5a0: b7 c0 rjmp .+366 ; 0xf710 { disable_heater(); f5a2: 0f 94 b9 12 call 0x22572 ; 0x22572 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); f5a6: 80 e6 ldi r24, 0x60 ; 96 f5a8: 96 e3 ldi r25, 0x36 ; 54 f5aa: 0e 94 32 6d call 0xda64 ; 0xda64 f5ae: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_return_to_status(); f5b2: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e f5b6: ac c0 rjmp .+344 ; 0xf710 case State::initializing: state = State::ready; // the IR sensor gets ready instantly as it's just a gpio read operation. f5b8: 82 e0 ldi r24, 0x02 ; 2 f5ba: 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(); f5be: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 f5c2: 80 93 87 16 sts 0x1687, r24 ; 0x801687 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; f5c6: 10 92 88 16 sts 0x1688, r1 ; 0x801688 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) f5ca: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f5ce: 82 30 cpi r24, 0x02 ; 2 f5d0: 09 f0 breq .+2 ; 0xf5d4 f5d2: ac cf rjmp .-168 ; 0xf52c return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f5d4: 80 91 89 16 lds r24, 0x1689 ; 0x801689 f5d8: 81 11 cpse r24, r1 f5da: 3d c0 rjmp .+122 ; 0xf656 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); f5dc: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 f5e0: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { f5e2: 80 91 87 16 lds r24, 0x1687 ; 0x801687 f5e6: c8 17 cp r28, r24 f5e8: 09 f4 brne .+2 ; 0xf5ec f5ea: a0 cf rjmp .-192 ; 0xf52c oldFilamentPresent = newFilamentPresent; f5ec: c0 93 87 16 sts 0x1687, r28 ; 0x801687 eventBlankingTimer.start(); f5f0: 89 e8 ldi r24, 0x89 ; 137 f5f2: 96 e1 ldi r25, 0x16 ; 22 f5f4: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> if (newFilamentPresent) { // filament insertion f5f8: cc 23 and r28, r28 f5fa: b1 f1 breq .+108 ; 0xf668 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f5fc: 80 91 85 16 lds r24, 0x1685 ; 0x801685 f600: 88 23 and r24, r24 f602: 11 f1 breq .+68 ; 0xf648 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) f604: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f608: 81 11 cpse r24, r1 f60a: 1e c0 rjmp .+60 ; 0xf648 && !( f60c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f610: 81 30 cpi r24, 0x01 ; 1 f612: d1 f0 breq .+52 ; 0xf648 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); f614: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f618: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f61c: 89 1b sub r24, r25 f61e: 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 f620: 99 f4 brne .+38 ; 0xf648 || printJobOngoing() f622: 0e 94 49 61 call 0xc292 ; 0xc292 f626: 81 11 cpse r24, r1 f628: 0f c0 rjmp .+30 ; 0xf648 || (lcd_commands_type == LcdCommands::Layer1Cal) f62a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f62e: 84 30 cpi r24, 0x04 ; 4 f630: 59 f0 breq .+22 ; 0xf648 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f632: 8f e5 ldi r24, 0x5F ; 95 f634: 9f e0 ldi r25, 0x0F ; 15 f636: 0f 94 3c a1 call 0x34278 ; 0x34278 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f63a: 81 11 cpse r24, r1 f63c: 05 c0 rjmp .+10 ; 0xf648 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); f63e: 61 e0 ldi r22, 0x01 ; 1 f640: 87 e7 ldi r24, 0x77 ; 119 f642: 97 e3 ldi r25, 0x37 ; 55 f644: 0f 94 89 95 call 0x32b12 ; 0x32b12 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; f648: 81 e0 ldi r24, 0x01 ; 1 f64a: 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. f64e: 81 e0 ldi r24, 0x01 ; 1 f650: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b f654: 6b cf rjmp .-298 ; 0xf52c } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f656: 64 e6 ldi r22, 0x64 ; 100 f658: 70 e0 ldi r23, 0x00 ; 0 f65a: 89 e8 ldi r24, 0x89 ; 137 f65c: 96 e1 ldi r25, 0x16 ; 22 f65e: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> f662: 81 11 cpse r24, r1 f664: bb cf rjmp .-138 ; 0xf5dc f666: 62 cf rjmp .-316 ; 0xf52c && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f668: 80 91 86 16 lds r24, 0x1686 ; 0x801686 f66c: 88 23 and r24, r24 f66e: 79 f3 breq .-34 ; 0xf64e } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) f670: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f674: 81 11 cpse r24, r1 f676: eb cf rjmp .-42 ; 0xf64e f678: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f67c: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f680: 89 1b sub r24, r25 f682: 8f 70 andi r24, 0x0F ; 15 && ( f684: 21 f4 brne .+8 ; 0xf68e moves_planned() != 0 || printJobOngoing() f686: 0e 94 49 61 call 0xc292 ; 0xc292 f68a: 88 23 and r24, r24 f68c: 01 f3 breq .-64 ; 0xf64e ) && !( f68e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f692: 81 11 cpse r24, r1 f694: dc cf rjmp .-72 ; 0xf64e saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange f696: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f69a: 81 30 cpi r24, 0x01 ; 1 f69c: c1 f2 breq .-80 ; 0xf64e || (lcd_commands_type == LcdCommands::Layer1Cal) f69e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f6a2: 84 30 cpi r24, 0x04 ; 4 f6a4: a1 f2 breq .-88 ; 0xf64e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f6a6: 8f e5 ldi r24, 0x5F ; 95 f6a8: 9f e0 ldi r25, 0x0F ; 15 f6aa: 0f 94 3c a1 call 0x34278 ; 0x34278 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f6ae: 81 11 cpse r24, r1 f6b0: ce cf rjmp .-100 ; 0xf64e } //! @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); f6b2: 8a e2 ldi r24, 0x2A ; 42 f6b4: 95 e6 ldi r25, 0x65 ; 101 f6b6: 9f 93 push r25 f6b8: 8f 93 push r24 f6ba: 80 e1 ldi r24, 0x10 ; 16 f6bc: 95 e6 ldi r25, 0x65 ; 101 f6be: 9f 93 push r25 f6c0: 8f 93 push r24 f6c2: 0f 94 fe 9f call 0x33ffc ; 0x33ffc void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; f6c6: 10 92 86 16 sts 0x1686, r1 ; 0x801686 autoLoadEnabled = false; f6ca: 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; f6ce: 0f 90 pop r0 f6d0: 0f 90 pop r0 f6d2: 0f 90 pop r0 f6d4: 0f 90 pop r0 f6d6: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f6da: 81 11 cpse r24, r1 f6dc: 05 c0 rjmp .+10 ; 0xf6e8 f6de: 60 e0 ldi r22, 0x00 ; 0 f6e0: 70 e0 ldi r23, 0x00 ; 0 f6e2: cb 01 movw r24, r22 f6e4: 0f 94 47 42 call 0x2848e ; 0x2848e stop_and_save_print_to_ram(0, 0); restore_print_from_ram_and_continue(0); f6e8: 60 e0 ldi r22, 0x00 ; 0 f6ea: 70 e0 ldi r23, 0x00 ; 0 f6ec: cb 01 movw r24, r22 f6ee: 0e 94 c1 61 call 0xc382 ; 0xc382 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); f6f2: 85 e6 ldi r24, 0x65 ; 101 f6f4: 9f e0 ldi r25, 0x0F ; 15 f6f6: 0e 94 8d 6f call 0xdf1a ; 0xdf1a eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); f6fa: 81 e0 ldi r24, 0x01 ; 1 f6fc: 9f e0 ldi r25, 0x0F ; 15 f6fe: 0e 94 80 6f call 0xdf00 ; 0xdf00 enquecommand_front_P(MSG_M600); f702: 8f e1 ldi r24, 0x1F ; 31 f704: 9c e6 ldi r25, 0x6C ; 108 f706: 0f 94 b4 43 call 0x28768 ; 0x28768 f70a: a1 cf rjmp .-190 ; 0xf64e inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} f70c: 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)){ f710: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f714: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f718: 03 97 sbiw r24, 0x03 ; 3 f71a: 14 f4 brge .+4 ; 0xf720 get_command(); f71c: 0e 94 fa 75 call 0xebf4 ; 0xebf4 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); f720: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f724: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) f728: 98 17 cp r25, r24 f72a: 81 f0 breq .+32 ; 0xf74c f72c: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> f730: 86 30 cpi r24, 0x06 ; 6 f732: 61 f4 brne .+24 ; 0xf74c f734: 68 e8 ldi r22, 0x88 ; 136 f736: 73 e1 ldi r23, 0x13 ; 19 f738: 85 ed ldi r24, 0xD5 ; 213 f73a: 91 e1 ldi r25, 0x11 ; 17 f73c: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> f740: 88 23 and r24, r24 f742: 21 f0 breq .+8 ; 0xf74c { // 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(); f744: 85 ed ldi r24, 0xD5 ; 213 f746: 91 e1 ldi r25, 0x11 ; 17 f748: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) f74c: 40 91 46 03 lds r20, 0x0346 ; 0x800346 f750: 50 91 47 03 lds r21, 0x0347 ; 0x800347 f754: 60 91 48 03 lds r22, 0x0348 ; 0x800348 f758: 70 91 49 03 lds r23, 0x0349 ; 0x800349 f75c: 41 15 cp r20, r1 f75e: 51 05 cpc r21, r1 f760: 61 05 cpc r22, r1 f762: 71 05 cpc r23, r1 f764: 09 f0 breq .+2 ; 0xf768 f766: 3f c0 rjmp .+126 ; 0xf7e6 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { f768: 40 91 37 02 lds r20, 0x0237 ; 0x800237 f76c: 50 91 38 02 lds r21, 0x0238 ; 0x800238 f770: 60 91 39 02 lds r22, 0x0239 ; 0x800239 f774: 70 91 3a 02 lds r23, 0x023A ; 0x80023a f778: 41 15 cp r20, r1 f77a: 51 05 cpc r21, r1 f77c: 61 05 cpc r22, r1 f77e: 71 05 cpc r23, r1 f780: a9 f0 breq .+42 ; 0xf7ac f782: 8a e4 ldi r24, 0x4A ; 74 f784: 93 e0 ldi r25, 0x03 ; 3 f786: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> f78a: 88 23 and r24, r24 f78c: 79 f0 breq .+30 ; 0xf7ac f78e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f792: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 if(blocks_queued() == false && ignore_stepper_queue == false) { f796: 98 13 cpse r25, r24 f798: 09 c0 rjmp .+18 ; 0xf7ac f79a: d1 11 cpse r29, r1 f79c: 07 c0 rjmp .+14 ; 0xf7ac disable_x(); f79e: 17 9a sbi 0x02, 7 ; 2 f7a0: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); f7a4: 16 9a sbi 0x02, 6 ; 2 f7a6: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); f7aa: 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; f7ac: c0 91 e9 11 lds r28, 0x11E9 ; 0x8011e9 block_t *block; if(block_buffer_tail != block_buffer_head) f7b0: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f7b4: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f7b8: 98 17 cp r25, r24 f7ba: 01 f1 breq .+64 ; 0xf7fc { uint8_t block_index = block_buffer_tail; f7bc: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 tail_fan_speed = block_buffer[block_index].fan_speed; f7c0: 9e e6 ldi r25, 0x6E ; 110 f7c2: 89 9f mul r24, r25 f7c4: f0 01 movw r30, r0 f7c6: 11 24 eor r1, r1 f7c8: e2 5f subi r30, 0xF2 ; 242 f7ca: f8 4f sbci r31, 0xF8 ; 248 f7cc: c0 81 ld r28, Z while(block_index != block_buffer_head) f7ce: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f7d2: 98 17 cp r25, r24 f7d4: 99 f0 breq .+38 ; 0xf7fc 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); f7d6: 8f 5f subi r24, 0xFF ; 255 f7d8: 8f 70 andi r24, 0x0F ; 15 f7da: f9 cf rjmp .-14 ; 0xf7ce { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); f7dc: 8a e1 ldi r24, 0x1A ; 26 f7de: 96 e0 ldi r25, 0x06 ; 6 f7e0: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> f7e4: 95 cf rjmp .-214 ; 0xf710 // 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)) f7e6: 8a e4 ldi r24, 0x4A ; 74 f7e8: 93 e0 ldi r25, 0x03 ; 3 f7ea: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> f7ee: 88 23 and r24, r24 f7f0: 09 f4 brne .+2 ; 0xf7f4 f7f2: ba cf rjmp .-140 ; 0xf768 kill(PSTR("Inactivity Shutdown")); f7f4: 80 e6 ldi r24, 0x60 ; 96 f7f6: 98 e7 ldi r25, 0x78 ; 120 f7f8: 0e 94 60 73 call 0xe6c0 ; 0xe6c0 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) { f7fc: cc 23 and r28, r28 f7fe: 09 f4 brne .+2 ; 0xf802 f800: be c0 rjmp .+380 ; 0xf97e if (fan_kick_end == 0) { f802: 80 91 41 03 lds r24, 0x0341 ; 0x800341 f806: 90 91 42 03 lds r25, 0x0342 ; 0x800342 f80a: a0 91 43 03 lds r26, 0x0343 ; 0x800343 f80e: b0 91 44 03 lds r27, 0x0344 ; 0x800344 f812: 89 2b or r24, r25 f814: 8a 2b or r24, r26 f816: 8b 2b or r24, r27 f818: 81 f4 brne .+32 ; 0xf83a // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; f81a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c f81e: 60 5e subi r22, 0xE0 ; 224 f820: 7c 4f sbci r23, 0xFC ; 252 f822: 8f 4f sbci r24, 0xFF ; 255 f824: 9f 4f sbci r25, 0xFF ; 255 f826: 60 93 41 03 sts 0x0341, r22 ; 0x800341 f82a: 70 93 42 03 sts 0x0342, r23 ; 0x800342 f82e: 80 93 43 03 sts 0x0343, r24 ; 0x800343 f832: 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; f836: cf ef ldi r28, 0xFF ; 255 f838: 0f c0 rjmp .+30 ; 0xf858 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()) f83a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c f83e: 00 91 41 03 lds r16, 0x0341 ; 0x800341 f842: 10 91 42 03 lds r17, 0x0342 ; 0x800342 f846: 20 91 43 03 lds r18, 0x0343 ; 0x800343 f84a: 30 91 44 03 lds r19, 0x0344 ; 0x800344 f84e: 60 17 cp r22, r16 f850: 71 07 cpc r23, r17 f852: 82 07 cpc r24, r18 f854: 93 07 cpc r25, r19 f856: 78 f3 brcs .-34 ; 0xf836 } 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 f858: 80 91 84 03 lds r24, 0x0384 ; 0x800384 f85c: 88 23 and r24, r24 f85e: 09 f4 brne .+2 ; 0xf862 f860: 97 c0 rjmp .+302 ; 0xf990 fanSpeedBckp = tail_fan_speed; f862: 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) { f866: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> f86a: 81 11 cpse r24, r1 f86c: 07 c0 rjmp .+14 ; 0xf87c return; } avoidRecursion = true; f86e: 81 e0 ldi r24, 0x01 ; 1 f870: 80 93 2d 04 sts 0x042D, r24 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); f874: 0f 94 b2 65 call 0x2cb64 ; 0x2cb64 avoidRecursion = false; f878: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { f87c: 80 91 13 06 lds r24, 0x0613 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> f880: 88 23 and r24, r24 f882: c9 f1 breq .+114 ; 0xf8f6 lcd_backlight_wake_trigger = false; f884: 10 92 13 06 sts 0x0613, r1 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> backlight_wake(); bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { f888: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); f88a: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { f88c: 80 91 11 06 lds r24, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> f890: 28 2f mov r18, r24 f892: 08 2e mov r0, r24 f894: 00 0c add r0, r0 f896: 33 0b sbc r19, r19 f898: 37 ff sbrs r19, 7 f89a: 03 c0 rjmp .+6 ; 0xf8a2 f89c: 31 95 neg r19 f89e: 21 95 neg r18 f8a0: 31 09 sbc r19, r1 f8a2: 24 30 cpi r18, 0x04 ; 4 f8a4: 31 05 cpc r19, r1 f8a6: 0c f4 brge .+2 ; 0xf8aa f8a8: 76 c0 rjmp .+236 ; 0xf996 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; f8aa: 98 2f mov r25, r24 f8ac: 87 ff sbrs r24, 7 f8ae: 02 c0 rjmp .+4 ; 0xf8b4 f8b0: 93 e0 ldi r25, 0x03 ; 3 f8b2: 98 0f add r25, r24 f8b4: 95 95 asr r25 f8b6: 95 95 asr r25 f8b8: 20 91 06 05 lds r18, 0x0506 ; 0x800506 f8bc: 30 91 07 05 lds r19, 0x0507 ; 0x800507 f8c0: 29 0f add r18, r25 f8c2: 31 1d adc r19, r1 f8c4: 97 fd sbrc r25, 7 f8c6: 3a 95 dec r19 f8c8: 30 93 07 05 sts 0x0507, r19 ; 0x800507 f8cc: 20 93 06 05 sts 0x0506, r18 ; 0x800506 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; f8d0: 83 78 andi r24, 0x83 ; 131 f8d2: 87 ff sbrs r24, 7 f8d4: 03 c0 rjmp .+6 ; 0xf8dc f8d6: 81 50 subi r24, 0x01 ; 1 f8d8: 8c 6f ori r24, 0xFC ; 252 f8da: 8f 5f subi r24, 0xFF ; 255 f8dc: 80 93 11 06 sts 0x0611, r24 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; f8e0: 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); f8e2: 86 e0 ldi r24, 0x06 ; 6 f8e4: 0f 94 fd 2c call 0x259fa ; 0x259fa if (lcd_draw_update == 0) { f8e8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b f8ec: 81 11 cpse r24, r1 f8ee: 03 c0 rjmp .+6 ; 0xf8f6 // Update LCD rendering at minimum lcd_draw_update = 1; f8f0: 81 e0 ldi r24, 0x01 ; 1 f8f2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) f8f6: 80 91 14 06 lds r24, 0x0614 ; 0x800614 f8fa: 88 23 and r24, r24 f8fc: 61 f0 breq .+24 ; 0xf916 { lcd_consume_click(); // Reset trigger to prevent recursion f8fe: 0e 94 14 6c call 0xd828 ; 0xd828 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) f902: e0 91 d4 03 lds r30, 0x03D4 ; 0x8003d4 f906: f0 91 d5 03 lds r31, 0x03D5 ; 0x8003d5 f90a: 30 97 sbiw r30, 0x00 ; 0 f90c: 21 f0 breq .+8 ; 0xf916 f90e: 80 91 5c 02 lds r24, 0x025C ; 0x80025c f912: 81 11 cpse r24, r1 { lcd_longpress_func(); f914: 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); } f916: 20 91 62 13 lds r18, 0x1362 ; 0x801362 f91a: 30 e0 ldi r19, 0x00 ; 0 f91c: a8 ee ldi r26, 0xE8 ; 232 f91e: b3 e0 ldi r27, 0x03 ; 3 f920: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> f924: ab 01 movw r20, r22 f926: bc 01 movw r22, r24 f928: 83 e6 ldi r24, 0x63 ; 99 f92a: 93 e1 ldi r25, 0x13 ; 19 f92c: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f930: 88 23 and r24, r24 f932: 99 f0 breq .+38 ; 0xf95a f934: 80 91 61 13 lds r24, 0x1361 ; 0x801361 { if(autoReportFeatures.Temp()){ f938: 80 fd sbrc r24, 0 gcode_M105(); f93a: 0e 94 4d 72 call 0xe49a ; 0xe49a f93e: 80 91 61 13 lds r24, 0x1361 ; 0x801361 } if(autoReportFeatures.Pos()){ f942: 82 fd sbrc r24, 2 gcode_M114(); f944: 0e 94 d2 71 call 0xe3a4 ; 0xe3a4 f948: 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()){ f94c: 81 fd sbrc r24, 1 gcode_M123(); f94e: 0e 94 1e 60 call 0xc03c ; 0xc03c } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f952: 83 e6 ldi r24, 0x63 ; 99 f954: 93 e1 ldi r25, 0x13 ; 19 f956: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; f95a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f95e: 81 11 cpse r24, r1 f960: 02 c0 rjmp .+4 ; 0xf966 f962: 0e 94 d8 72 call 0xe5b0 ; 0xe5b0 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); f966: 40 e3 ldi r20, 0x30 ; 48 f968: 55 e7 ldi r21, 0x75 ; 117 f96a: 60 e0 ldi r22, 0x00 ; 0 f96c: 70 e0 ldi r23, 0x00 ; 0 f96e: 8a e5 ldi r24, 0x5A ; 90 f970: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } f972: df 91 pop r29 f974: cf 91 pop r28 f976: 1f 91 pop r17 f978: 0f 91 pop r16 f97a: 0d 94 3c 10 jmp 0x22078 ; 0x22078 ::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; f97e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 f982: 10 92 42 03 sts 0x0342, r1 ; 0x800342 f986: 10 92 43 03 sts 0x0343, r1 ; 0x800343 f98a: 10 92 44 03 sts 0x0344, r1 ; 0x800344 f98e: 64 cf rjmp .-312 ; 0xf858 #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; f990: c0 93 05 05 sts 0x0505, r28 ; 0x800505 f994: 68 cf rjmp .-304 ; 0xf866 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; f996: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> f99a: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); f99c: 80 e0 ldi r24, 0x00 ; 0 f99e: a2 cf rjmp .-188 ; 0xf8e4 0000f9a0 : #endif #endif } void delay_keep_alive(unsigned int ms) { f9a0: cf 93 push r28 f9a2: df 93 push r29 f9a4: ec 01 movw r28, r24 for (;;) { manage_heater(); f9a6: 0f 94 af 32 call 0x2655e ; 0x2655e // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); f9aa: 81 e0 ldi r24, 0x01 ; 1 f9ac: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); f9b0: 80 e0 ldi r24, 0x00 ; 0 f9b2: 0e 94 c3 69 call 0xd386 ; 0xd386 if (ms == 0) f9b6: 20 97 sbiw r28, 0x00 ; 0 f9b8: 99 f0 breq .+38 ; 0xf9e0 break; else if (ms >= 50) { f9ba: c2 33 cpi r28, 0x32 ; 50 f9bc: d1 05 cpc r29, r1 f9be: 40 f0 brcs .+16 ; 0xf9d0 _delay(50); f9c0: 62 e3 ldi r22, 0x32 ; 50 f9c2: 70 e0 ldi r23, 0x00 ; 0 f9c4: 80 e0 ldi r24, 0x00 ; 0 f9c6: 90 e0 ldi r25, 0x00 ; 0 f9c8: 0f 94 d5 0d call 0x21baa ; 0x21baa ms -= 50; f9cc: e2 97 sbiw r28, 0x32 ; 50 f9ce: eb cf rjmp .-42 ; 0xf9a6 } else { _delay(ms); f9d0: be 01 movw r22, r28 f9d2: 90 e0 ldi r25, 0x00 ; 0 f9d4: 80 e0 ldi r24, 0x00 ; 0 f9d6: 0f 94 d5 0d call 0x21baa ; 0x21baa ms = 0; f9da: d0 e0 ldi r29, 0x00 ; 0 f9dc: c0 e0 ldi r28, 0x00 ; 0 f9de: e3 cf rjmp .-58 ; 0xf9a6 } } } f9e0: df 91 pop r29 f9e2: cf 91 pop r28 f9e4: 08 95 ret 0000f9e6 : /// @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) { f9e6: cf 93 push r28 f9e8: df 93 push r29 f9ea: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f9ec: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); f9ee: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); f9f2: 81 e0 ldi r24, 0x01 ; 1 f9f4: 0e 94 89 7a call 0xf512 ; 0xf512 f9f8: 80 91 92 12 lds r24, 0x1292 ; 0x801292 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) f9fc: 8f 3f cpi r24, 0xFF ; 255 f9fe: d9 f4 brne .+54 ; 0xfa36 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { fa00: 80 91 27 12 lds r24, 0x1227 ; 0x801227 fa04: 84 30 cpi r24, 0x04 ; 4 fa06: 21 f4 brne .+8 ; 0xfa10 }; 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 fa08: 80 91 2a 12 lds r24, 0x122A ; 0x80122a fa0c: 81 11 cpse r24, r1 fa0e: ef cf rjmp .-34 ; 0xf9ee 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 fa10: 80 91 65 12 lds r24, 0x1265 ; 0x801265 fa14: 90 91 66 12 lds r25, 0x1266 ; 0x801266 fa18: 01 97 sbiw r24, 0x01 ; 1 fa1a: 49 f7 brne .-46 ; 0xf9ee && lastErrorCode != ec) // The error code is not a duplicate fa1c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c fa20: 90 91 8d 12 lds r25, 0x128D ; 0x80128d fa24: 89 32 cpi r24, 0x29 ; 41 fa26: 90 48 sbci r25, 0x80 ; 128 fa28: 11 f3 breq .-60 ; 0xf9ee { ReportError(ec, ErrorSource::ErrorSourcePrinter); fa2a: 60 e0 ldi r22, 0x00 ; 0 fa2c: 89 e2 ldi r24, 0x29 ; 41 fa2e: 90 e8 ldi r25, 0x80 ; 128 fa30: 0f 94 07 50 call 0x2a00e ; 0x2a00e fa34: dc cf rjmp .-72 ; 0xf9ee inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; fa36: d0 93 92 12 sts 0x1292, r29 ; 0x801292 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { fa3a: 85 30 cpi r24, 0x05 ; 5 fa3c: 39 f4 brne .+14 ; 0xfa4c if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { fa3e: cf 3f cpi r28, 0xFF ; 255 fa40: f9 f2 breq .-66 ; 0xfa00 MMU2::mmu2.eject_filament(eject_slot, true); fa42: 61 e0 ldi r22, 0x01 ; 1 fa44: 8c 2f mov r24, r28 fa46: 0f 94 4e 6c call 0x2d89c ; 0x2d89c fa4a: d1 cf rjmp .-94 ; 0xf9ee // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) fa4c: 84 30 cpi r24, 0x04 ; 4 fa4e: c1 f6 brne .-80 ; 0xfa00 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } fa50: df 91 pop r29 fa52: cf 91 pop r28 fa54: 08 95 ret 0000fa56 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) fa56: cf 93 push r28 fa58: df 93 push r29 fa5a: ec 01 movw r28, r24 { while (*str) fa5c: 89 91 ld r24, Y+ fa5e: 88 23 and r24, r24 fa60: 19 f0 breq .+6 ; 0xfa68 write(*str++); fa62: 0e 94 c2 70 call 0xe184 ; 0xe184 fa66: fa cf rjmp .-12 ; 0xfa5c } fa68: df 91 pop r29 fa6a: cf 91 pop r28 fa6c: 08 95 ret 0000fa6e : //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) { fa6e: ff 92 push r15 fa70: 0f 93 push r16 fa72: 1f 93 push r17 fa74: cf 93 push r28 fa76: df 93 push r29 fa78: ec 01 movw r28, r24 fa7a: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); fa7c: 66 23 and r22, r22 fa7e: 09 f4 brne .+2 ; 0xfa82 fa80: 4b c0 rjmp .+150 ; 0xfb18 #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); fa82: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> fa86: 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)) { fa88: c8 01 movw r24, r16 fa8a: 0e 94 47 56 call 0xac8e ; 0xac8e fa8e: 88 23 and r24, r24 fa90: 09 f4 brne .+2 ; 0xfa94 fa92: 53 c0 rjmp .+166 ; 0xfb3a // 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; fa94: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> fa98: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> fa9c: fc 01 movw r30, r24 fa9e: e2 52 subi r30, 0x22 ; 34 faa0: f0 4f sbci r31, 0xF0 ; 240 faa2: 23 e0 ldi r18, 0x03 ; 3 faa4: 20 83 st Z, r18 faa6: 8f 51 subi r24, 0x1F ; 31 faa8: 90 4f sbci r25, 0xF0 ; 240 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); faaa: 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) faac: ff 20 and r15, r15 faae: e9 f1 breq .+122 ; 0xfb2a strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); fab0: 0f 94 f3 9e call 0x33de6 ; 0x33de6 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; fab4: 87 e7 ldi r24, 0x77 ; 119 fab6: 9e e9 ldi r25, 0x9E ; 158 fab8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(MSG_Enqueing); fabc: 81 e5 ldi r24, 0x51 ; 81 fabe: 93 e6 ldi r25, 0x63 ; 99 fac0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); fac4: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> fac8: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); facc: 8f 51 subi r24, 0x1F ; 31 face: 90 4f sbci r25, 0xF0 ; 240 fad0: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHOLNPGM("\""); fad4: 80 ef ldi r24, 0xF0 ; 240 fad6: 92 e7 ldi r25, 0x72 ; 114 fad8: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 bufindw += len + (CMDHDRSIZE + 1); fadc: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> fae0: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> fae4: 04 96 adiw r24, 0x04 ; 4 fae6: 08 0f add r16, r24 fae8: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) faea: 0d 3e cpi r16, 0xED ; 237 faec: 81 e0 ldi r24, 0x01 ; 1 faee: 18 07 cpc r17, r24 faf0: f9 f0 breq .+62 ; 0xfb30 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); faf2: 10 93 dd 0f sts 0x0FDD, r17 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> faf6: 00 93 dc 0f sts 0x0FDC, r16 ; 0x800fdc <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; fafa: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf fafe: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 fb02: 01 96 adiw r24, 0x01 ; 1 fb04: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 fb08: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fb0c: df 91 pop r29 fb0e: cf 91 pop r28 fb10: 1f 91 pop r17 fb12: 0f 91 pop r16 fb14: ff 90 pop r15 fb16: 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); fb18: fc 01 movw r30, r24 fb1a: 01 90 ld r0, Z+ fb1c: 00 20 and r0, r0 fb1e: e9 f7 brne .-6 ; 0xfb1a fb20: 31 97 sbiw r30, 0x01 ; 1 fb22: 8f 01 movw r16, r30 fb24: 08 1b sub r16, r24 fb26: 19 0b sbc r17, r25 fb28: af cf rjmp .-162 ; 0xfa88 // 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); fb2a: 0f 94 a7 a7 call 0x34f4e ; 0x34f4e fb2e: c2 cf rjmp .-124 ; 0xfab4 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; fb30: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> fb34: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> fb38: e0 cf rjmp .-64 ; 0xfafa ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; fb3a: 8a e5 ldi r24, 0x5A ; 90 fb3c: 9e e9 ldi r25, 0x9E ; 158 fb3e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(MSG_Enqueing); fb42: 81 e5 ldi r24, 0x51 ; 81 fb44: 93 e6 ldi r25, 0x63 ; 99 fb46: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); fb4a: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) fb4c: ff 20 and r15, r15 fb4e: 59 f0 breq .+22 ; 0xfb66 SERIAL_PROTOCOLRPGM(cmd); fb50: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fb54: 88 e2 ldi r24, 0x28 ; 40 fb56: 9e e9 ldi r25, 0x9E ; 158 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fb58: df 91 pop r29 fb5a: cf 91 pop r28 fb5c: 1f 91 pop r17 fb5e: 0f 91 pop r16 fb60: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fb62: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 fb66: 0e 94 2b 7d call 0xfa56 ; 0xfa56 fb6a: f4 cf rjmp .-24 ; 0xfb54 0000fb6c : { 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) { fb6c: 0f 93 push r16 fb6e: 1f 93 push r17 fb70: cf 93 push r28 fb72: df 93 push r29 fb74: d6 2f mov r29, r22 fb76: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) fb78: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); fb7a: f8 01 movw r30, r16 fb7c: 85 91 lpm r24, Z+ fb7e: 94 91 lpm r25, Z fb80: 61 e0 ldi r22, 0x01 ; 1 fb82: 0e 94 37 7d call 0xfa6e ; 0xfa6e 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) fb86: cf 5f subi r28, 0xFF ; 255 fb88: 0e 5f subi r16, 0xFE ; 254 fb8a: 1f 4f sbci r17, 0xFF ; 255 fb8c: dc 13 cpse r29, r28 fb8e: f5 cf rjmp .-22 ; 0xfb7a { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } fb90: df 91 pop r29 fb92: cf 91 pop r28 fb94: 1f 91 pop r17 fb96: 0f 91 pop r16 fb98: 08 95 ret 0000fb9a : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { fb9a: cf 93 push r28 fb9c: df 93 push r29 fb9e: cd b7 in r28, 0x3d ; 61 fba0: de b7 in r29, 0x3e ; 62 fba2: 6e 97 sbiw r28, 0x1e ; 30 fba4: 0f b6 in r0, 0x3f ; 63 fba6: f8 94 cli fba8: de bf out 0x3e, r29 ; 62 fbaa: 0f be out 0x3f, r0 ; 63 fbac: cd bf out 0x3d, r28 ; 61 fbae: 9e 01 movw r18, r28 fbb0: 2c 5d subi r18, 0xDC ; 220 fbb2: 3f 4f sbci r19, 0xFF ; 255 fbb4: f9 01 movw r30, r18 fbb6: 41 91 ld r20, Z+ fbb8: 51 91 ld r21, Z+ fbba: 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); fbbc: 6e e1 ldi r22, 0x1E ; 30 fbbe: 70 e0 ldi r23, 0x00 ; 0 fbc0: ce 01 movw r24, r28 fbc2: 01 96 adiw r24, 0x01 ; 1 fbc4: 0f 94 92 a0 call 0x34124 ; 0x34124 va_end(ap); enquecommand(cmd_buffer, false); fbc8: 60 e0 ldi r22, 0x00 ; 0 fbca: ce 01 movw r24, r28 fbcc: 01 96 adiw r24, 0x01 ; 1 fbce: 0e 94 37 7d call 0xfa6e ; 0xfa6e } fbd2: 6e 96 adiw r28, 0x1e ; 30 fbd4: 0f b6 in r0, 0x3f ; 63 fbd6: f8 94 cli fbd8: de bf out 0x3e, r29 ; 62 fbda: 0f be out 0x3f, r0 ; 63 fbdc: cd bf out 0x3d, r28 ; 61 fbde: df 91 pop r29 fbe0: cf 91 pop r28 fbe2: 08 95 ret 0000fbe4 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { fbe4: 1f 92 push r1 fbe6: 0f 92 push r0 fbe8: 0f b6 in r0, 0x3f ; 63 fbea: 0f 92 push r0 fbec: 11 24 eor r1, r1 fbee: 0b b6 in r0, 0x3b ; 59 fbf0: 0f 92 push r0 fbf2: 2f 93 push r18 fbf4: 3f 93 push r19 fbf6: 4f 93 push r20 fbf8: 5f 93 push r21 fbfa: 6f 93 push r22 fbfc: 7f 93 push r23 fbfe: 8f 93 push r24 fc00: 9f 93 push r25 fc02: af 93 push r26 fc04: bf 93 push r27 fc06: ef 93 push r30 fc08: ff 93 push r31 adc_values[adc_channel] += ADC; fc0a: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> fc0e: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> fc12: e0 91 16 03 lds r30, 0x0316 ; 0x800316 fc16: f0 e0 ldi r31, 0x00 ; 0 fc18: ee 0f add r30, r30 fc1a: ff 1f adc r31, r31 fc1c: ea 5f subi r30, 0xFA ; 250 fc1e: fc 4f sbci r31, 0xFC ; 252 fc20: 80 81 ld r24, Z fc22: 91 81 ldd r25, Z+1 ; 0x01 fc24: 82 0f add r24, r18 fc26: 93 1f adc r25, r19 fc28: 91 83 std Z+1, r25 ; 0x01 fc2a: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) fc2c: 80 91 05 03 lds r24, 0x0305 ; 0x800305 fc30: 8f 5f subi r24, 0xFF ; 255 fc32: 80 93 05 03 sts 0x0305, r24 ; 0x800305 fc36: 80 31 cpi r24, 0x10 ; 16 fc38: e9 f5 brne .+122 ; 0xfcb4 <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { fc3a: 80 91 16 03 lds r24, 0x0316 ; 0x800316 fc3e: 8f 5f subi r24, 0xFF ; 255 fc40: 80 93 16 03 sts 0x0316, r24 ; 0x800316 fc44: 88 30 cpi r24, 0x08 ; 8 fc46: 71 f5 brne .+92 ; 0xfca4 <__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 fc48: 80 91 06 03 lds r24, 0x0306 ; 0x800306 fc4c: 90 91 07 03 lds r25, 0x0307 ; 0x800307 fc50: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a fc54: 80 93 49 06 sts 0x0649, r24 ; 0x800649 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; fc58: 80 91 0a 03 lds r24, 0x030A ; 0x80030a fc5c: 90 91 0b 03 lds r25, 0x030B ; 0x80030b fc60: 90 93 4c 06 sts 0x064C, r25 ; 0x80064c fc64: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; fc68: 80 91 08 03 lds r24, 0x0308 ; 0x800308 fc6c: 90 91 09 03 lds r25, 0x0309 ; 0x800309 fc70: 90 93 48 06 sts 0x0648, r25 ; 0x800648 fc74: 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; fc78: 81 e0 ldi r24, 0x01 ; 1 fc7a: 80 93 63 06 sts 0x0663, r24 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> break; } } } ADCSRA |= (1 << ADSC); //start conversion } fc7e: ff 91 pop r31 fc80: ef 91 pop r30 fc82: bf 91 pop r27 fc84: af 91 pop r26 fc86: 9f 91 pop r25 fc88: 8f 91 pop r24 fc8a: 7f 91 pop r23 fc8c: 6f 91 pop r22 fc8e: 5f 91 pop r21 fc90: 4f 91 pop r20 fc92: 3f 91 pop r19 fc94: 2f 91 pop r18 fc96: 0f 90 pop r0 fc98: 0b be out 0x3b, r0 ; 59 fc9a: 0f 90 pop r0 fc9c: 0f be out 0x3f, r0 ; 63 fc9e: 0f 90 pop r0 fca0: 1f 90 pop r1 fca2: 18 95 reti fca4: 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)) { fca8: 4f e5 ldi r20, 0x5F ; 95 fcaa: 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) { fcac: 8f 5f subi r24, 0xFF ; 255 fcae: 41 f4 brne .+16 ; 0xfcc0 <__vector_29+0xdc> fcb0: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion fcb4: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fcb8: 80 64 ori r24, 0x40 ; 64 fcba: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fcbe: df cf rjmp .-66 ; 0xfc7e <__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)) { fcc0: 9a 01 movw r18, r20 fcc2: 08 2e mov r0, r24 fcc4: 02 c0 rjmp .+4 ; 0xfcca <__vector_29+0xe6> fcc6: 35 95 asr r19 fcc8: 27 95 ror r18 fcca: 0a 94 dec r0 fccc: e2 f7 brpl .-8 ; 0xfcc6 <__vector_29+0xe2> fcce: 20 ff sbrs r18, 0 fcd0: ed cf rjmp .-38 ; 0xfcac <__vector_29+0xc8> fcd2: 80 93 04 03 sts 0x0304, r24 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fcd6: 0e 94 58 55 call 0xaab0 ; 0xaab0 adc_count = 0; fcda: 10 92 05 03 sts 0x0305, r1 ; 0x800305 fcde: ea cf rjmp .-44 ; 0xfcb4 <__vector_29+0xd0> 0000fce0 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { fce0: cf 93 push r28 fce2: 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 fce4: ca e7 ldi r28, 0x7A ; 122 fce6: d0 e0 ldi r29, 0x00 ; 0 fce8: 88 81 ld r24, Y fcea: 8f 7b andi r24, 0xBF ; 191 fcec: 88 83 st Y, r24 adc_count = 0; fcee: 10 92 05 03 sts 0x0305, r1 ; 0x800305 adc_channel = 0; fcf2: 10 92 16 03 sts 0x0316, r1 ; 0x800316 adc_channel_idx = first_channel_idx; fcf6: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fcfa: 80 e0 ldi r24, 0x00 ; 0 fcfc: 0e 94 58 55 call 0xaab0 ; 0xaab0 memset((void*)adc_values, 0, sizeof(adc_values)); fd00: e6 e0 ldi r30, 0x06 ; 6 fd02: f3 e0 ldi r31, 0x03 ; 3 fd04: 80 e1 ldi r24, 0x10 ; 16 fd06: df 01 movw r26, r30 fd08: 1d 92 st X+, r1 fd0a: 8a 95 dec r24 fd0c: e9 f7 brne .-6 ; 0xfd08 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion fd0e: 88 81 ld r24, Y fd10: 80 64 ori r24, 0x40 ; 64 fd12: 88 83 st Y, r24 } fd14: df 91 pop r29 fd16: cf 91 pop r28 fd18: 08 95 ret 0000fd1a : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fd1a: 2f 92 push r2 fd1c: 3f 92 push r3 fd1e: 4f 92 push r4 fd20: 5f 92 push r5 fd22: 6f 92 push r6 fd24: 7f 92 push r7 fd26: 8f 92 push r8 fd28: 9f 92 push r9 fd2a: af 92 push r10 fd2c: bf 92 push r11 fd2e: cf 92 push r12 fd30: df 92 push r13 fd32: ef 92 push r14 fd34: ff 92 push r15 fd36: 0f 93 push r16 fd38: 1f 93 push r17 fd3a: cf 93 push r28 fd3c: df 93 push r29 fd3e: cd b7 in r28, 0x3d ; 61 fd40: de b7 in r29, 0x3e ; 62 fd42: a4 97 sbiw r28, 0x24 ; 36 fd44: 0f b6 in r0, 0x3f ; 63 fd46: f8 94 cli fd48: de bf out 0x3e, r29 ; 62 fd4a: 0f be out 0x3f, r0 ; 63 fd4c: 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(); fd4e: 0f 94 a0 22 call 0x24540 ; 0x24540 if (planner_aborted) fd52: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac fd56: 81 11 cpse r24, r1 fd58: 17 c0 rjmp .+46 ; 0xfd88 return; mesh_bed_leveling_flag = true; fd5a: 81 e0 ldi r24, 0x01 ; 1 fd5c: 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])) { fd60: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 fd64: 88 23 and r24, r24 fd66: 49 f0 breq .+18 ; 0xfd7a fd68: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 fd6c: 88 23 and r24, r24 fd6e: 29 f0 breq .+10 ; 0xfd7a fd70: 20 91 a5 06 lds r18, 0x06A5 ; 0x8006a5 fd74: 2f 83 std Y+7, r18 ; 0x07 fd76: 21 11 cpse r18, r1 fd78: 20 c0 rjmp .+64 ; 0xfdba // 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; fd7a: 81 e0 ldi r24, 0x01 ; 1 fd7c: 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); fd80: 86 eb ldi r24, 0xB6 ; 182 fd82: 98 e6 ldi r25, 0x68 ; 104 fd84: 0f 94 b4 43 call 0x28768 ; 0x28768 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fd88: a4 96 adiw r28, 0x24 ; 36 fd8a: 0f b6 in r0, 0x3f ; 63 fd8c: f8 94 cli fd8e: de bf out 0x3e, r29 ; 62 fd90: 0f be out 0x3f, r0 ; 63 fd92: cd bf out 0x3d, r28 ; 61 fd94: df 91 pop r29 fd96: cf 91 pop r28 fd98: 1f 91 pop r17 fd9a: 0f 91 pop r16 fd9c: ff 90 pop r15 fd9e: ef 90 pop r14 fda0: df 90 pop r13 fda2: cf 90 pop r12 fda4: bf 90 pop r11 fda6: af 90 pop r10 fda8: 9f 90 pop r9 fdaa: 8f 90 pop r8 fdac: 7f 90 pop r7 fdae: 6f 90 pop r6 fdb0: 5f 90 pop r5 fdb2: 4f 90 pop r4 fdb4: 3f 90 pop r3 fdb6: 2f 90 pop r2 fdb8: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fdba: 8b ea ldi r24, 0xAB ; 171 fdbc: 9d e0 ldi r25, 0x0D ; 13 fdbe: 0f 94 3c a1 call 0x34278 ; 0x34278 fdc2: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fdc4: 8e e4 ldi r24, 0x4E ; 78 fdc6: 0e 94 b6 55 call 0xab6c ; 0xab6c fdca: 08 2f mov r16, r24 fdcc: 0e 94 cb 55 call 0xab96 ; 0xab96 fdd0: 8e 83 std Y+6, r24 ; 0x06 fdd2: 00 23 and r16, r16 fdd4: 29 f0 breq .+10 ; 0xfde0 fdd6: 87 30 cpi r24, 0x07 ; 7 fdd8: 09 f4 brne .+2 ; 0xfddc fdda: c9 c0 rjmp .+402 ; 0xff6e fddc: 83 30 cpi r24, 0x03 ; 3 fdde: 29 f0 breq .+10 ; 0xfdea 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; fde0: 13 30 cpi r17, 0x03 ; 3 fde2: 09 f0 breq .+2 ; 0xfde6 fde4: c3 c0 rjmp .+390 ; 0xff6c fde6: 63 e0 ldi r22, 0x03 ; 3 fde8: 6e 83 std Y+6, r22 ; 0x06 fdea: 80 e0 ldi r24, 0x00 ; 0 fdec: 90 e0 ldi r25, 0x00 ; 0 fdee: a0 e8 ldi r26, 0x80 ; 128 fdf0: bf e3 ldi r27, 0x3F ; 63 fdf2: 8a 83 std Y+2, r24 ; 0x02 fdf4: 9b 83 std Y+3, r25 ; 0x03 fdf6: ac 83 std Y+4, r26 ; 0x04 fdf8: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fdfa: 8a ea ldi r24, 0xAA ; 170 fdfc: 9d e0 ldi r25, 0x0D ; 13 fdfe: 0f 94 3c a1 call 0x34278 ; 0x34278 fe02: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fe04: 83 e4 ldi r24, 0x43 ; 67 fe06: 0e 94 b6 55 call 0xab6c ; 0xab6c fe0a: 18 2f mov r17, r24 fe0c: 0e 94 cb 55 call 0xab96 ; 0xab96 fe10: 11 23 and r17, r17 fe12: 29 f0 breq .+10 ; 0xfe1e fe14: 88 23 and r24, r24 fe16: 19 f0 breq .+6 ; 0xfe1e fe18: 8b 30 cpi r24, 0x0B ; 11 fe1a: 08 f4 brcc .+2 ; 0xfe1e fe1c: 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; fe1e: 88 e5 ldi r24, 0x58 ; 88 fe20: 0e 94 b6 55 call 0xab6c ; 0xab6c fe24: 88 23 and r24, r24 fe26: 09 f4 brne .+2 ; 0xfe2a fe28: ab c0 rjmp .+342 ; 0xff80 fe2a: 0e 94 8e 5a call 0xb51c ; 0xb51c fe2e: 20 e0 ldi r18, 0x00 ; 0 fe30: 30 e0 ldi r19, 0x00 ; 0 fe32: 48 e0 ldi r20, 0x08 ; 8 fe34: 52 e4 ldi r21, 0x42 ; 66 fe36: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> fe3a: 20 e0 ldi r18, 0x00 ; 0 fe3c: 30 e0 ldi r19, 0x00 ; 0 fe3e: 48 eb ldi r20, 0xB8 ; 184 fe40: 51 e4 ldi r21, 0x41 ; 65 fe42: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> fe46: 6a 87 std Y+10, r22 ; 0x0a fe48: 7b 87 std Y+11, r23 ; 0x0b fe4a: 8c 87 std Y+12, r24 ; 0x0c fe4c: 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; fe4e: 89 e5 ldi r24, 0x59 ; 89 fe50: 0e 94 b6 55 call 0xab6c ; 0xab6c fe54: 88 23 and r24, r24 fe56: 09 f4 brne .+2 ; 0xfe5a fe58: 9c c0 rjmp .+312 ; 0xff92 fe5a: 0e 94 8e 5a call 0xb51c ; 0xb51c fe5e: 20 e0 ldi r18, 0x00 ; 0 fe60: 30 e0 ldi r19, 0x00 ; 0 fe62: 48 e0 ldi r20, 0x08 ; 8 fe64: 52 e4 ldi r21, 0x42 ; 66 fe66: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> fe6a: 20 e0 ldi r18, 0x00 ; 0 fe6c: 30 e0 ldi r19, 0x00 ; 0 fe6e: 40 ea ldi r20, 0xA0 ; 160 fe70: 50 e4 ldi r21, 0x40 ; 64 fe72: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> fe76: 6c 8b std Y+20, r22 ; 0x14 fe78: 7d 8b std Y+21, r23 ; 0x15 fe7a: 8e 8b std Y+22, r24 ; 0x16 fe7c: 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; fe7e: 87 e5 ldi r24, 0x57 ; 87 fe80: 0e 94 b6 55 call 0xab6c ; 0xab6c fe84: 88 23 and r24, r24 fe86: 09 f4 brne .+2 ; 0xfe8a fe88: 89 c0 rjmp .+274 ; 0xff9c fe8a: 0e 94 8e 5a call 0xb51c ; 0xb51c fe8e: 2a 85 ldd r18, Y+10 ; 0x0a fe90: 3b 85 ldd r19, Y+11 ; 0x0b fe92: 4c 85 ldd r20, Y+12 ; 0x0c fe94: 5d 85 ldd r21, Y+13 ; 0x0d fe96: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> fe9a: 20 e0 ldi r18, 0x00 ; 0 fe9c: 30 e0 ldi r19, 0x00 ; 0 fe9e: 48 e8 ldi r20, 0x88 ; 136 fea0: 52 e4 ldi r21, 0x42 ; 66 fea2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> fea6: 69 8f std Y+25, r22 ; 0x19 fea8: 7a 8f std Y+26, r23 ; 0x1a feaa: 8b 8f std Y+27, r24 ; 0x1b feac: 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; feae: 88 e4 ldi r24, 0x48 ; 72 feb0: 0e 94 b6 55 call 0xab6c ; 0xab6c feb4: 88 23 and r24, r24 feb6: 09 f4 brne .+2 ; 0xfeba feb8: 7a c0 rjmp .+244 ; 0xffae feba: 0e 94 8e 5a call 0xb51c ; 0xb51c febe: 2c 89 ldd r18, Y+20 ; 0x14 fec0: 3d 89 ldd r19, Y+21 ; 0x15 fec2: 4e 89 ldd r20, Y+22 ; 0x16 fec4: 5f 89 ldd r21, Y+23 ; 0x17 fec6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> feca: 20 e0 ldi r18, 0x00 ; 0 fecc: 30 e0 ldi r19, 0x00 ; 0 fece: 48 e8 ldi r20, 0x88 ; 136 fed0: 52 e4 ldi r21, 0x42 ; 66 fed2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> fed6: 6d 8f std Y+29, r22 ; 0x1d fed8: 7e 8f std Y+30, r23 ; 0x1e feda: 8f 8f std Y+31, r24 ; 0x1f fedc: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fede: 0f 94 51 57 call 0x2aea2 ; 0x2aea2 mbl.z_values[0][0] = min_pos[Z_AXIS]; fee2: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fee6: 90 91 2d 02 lds r25, 0x022D ; 0x80022d feea: a0 91 2e 02 lds r26, 0x022E ; 0x80022e feee: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fef2: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d fef6: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e fefa: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f fefe: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); ff02: 0f 94 6b 8c call 0x318d6 ; 0x318d6 ff06: 05 ec ldi r16, 0xC5 ; 197 ff08: 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) ff0a: c8 01 movw r24, r16 ff0c: 0f 94 4a a1 call 0x34294 ; 0x34294 ff10: 01 96 adiw r24, 0x01 ; 1 ff12: 09 f0 breq .+2 ; 0xff16 ff14: 51 c0 rjmp .+162 ; 0xffb8 ff16: 0e 5f subi r16, 0xFE ; 254 ff18: 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) { ff1a: 05 3d cpi r16, 0xD5 ; 213 ff1c: 8f e0 ldi r24, 0x0F ; 15 ff1e: 18 07 cpc r17, r24 ff20: a1 f7 brne .-24 ; 0xff0a if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; ff22: 21 2c mov r2, r1 ff24: ac e9 ldi r26, 0x9C ; 156 ff26: b2 e1 ldi r27, 0x12 ; 18 ff28: ba a3 std Y+34, r27 ; 0x22 ff2a: 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; ff2c: b9 87 std Y+9, r27 ; 0x09 ff2e: a8 87 std Y+8, r26 ; 0x08 ff30: 51 2c mov r5, r1 ff32: 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; ff34: 31 2c mov r3, r1 ff36: 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)); ff38: 84 2d mov r24, r4 ff3a: 63 e0 ldi r22, 0x03 ; 3 ff3c: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> ff40: 98 8b std Y+16, r25 ; 0x10 ff42: 68 84 ldd r6, Y+8 ; 0x08 ff44: 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++) { ff46: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); ff48: f8 89 ldd r31, Y+16 ; 0x10 ff4a: f1 11 cpse r31, r1 ff4c: 37 c0 rjmp .+110 ; 0xffbc ff4e: 81 2f mov r24, r17 ff50: 63 e0 ldi r22, 0x03 ; 3 ff52: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> ff56: 91 11 cpse r25, r1 ff58: 31 c0 rjmp .+98 ; 0xffbc if (isOn3x3Mesh) { if (has_z && (row || col)) { ff5a: 21 10 cpse r2, r1 ff5c: 3f c1 rjmp .+638 ; 0x101dc } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { ff5e: 7e 81 ldd r23, Y+6 ; 0x06 ff60: 73 30 cpi r23, 0x03 ; 3 ff62: 09 f4 brne .+2 ; 0xff66 ff64: 70 c0 rjmp .+224 ; 0x10046 ff66: 8f 81 ldd r24, Y+7 ; 0x07 ff68: 8e 87 std Y+14, r24 ; 0x0e ff6a: 37 c0 rjmp .+110 ; 0xffda 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; ff6c: 1e 83 std Y+6, r17 ; 0x06 ff6e: 6a e9 ldi r22, 0x9A ; 154 ff70: 79 e9 ldi r23, 0x99 ; 153 ff72: 89 e1 ldi r24, 0x19 ; 25 ff74: 9f e3 ldi r25, 0x3F ; 63 ff76: 6a 83 std Y+2, r22 ; 0x02 ff78: 7b 83 std Y+3, r23 ; 0x03 ff7a: 8c 83 std Y+4, r24 ; 0x04 ff7c: 9d 83 std Y+5, r25 ; 0x05 ff7e: 3d cf rjmp .-390 ; 0xfdfa 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; ff80: 80 e0 ldi r24, 0x00 ; 0 ff82: 90 e0 ldi r25, 0x00 ; 0 ff84: a0 e8 ldi r26, 0x80 ; 128 ff86: bf ef ldi r27, 0xFF ; 255 ff88: 8a 87 std Y+10, r24 ; 0x0a ff8a: 9b 87 std Y+11, r25 ; 0x0b ff8c: ac 87 std Y+12, r26 ; 0x0c ff8e: bd 87 std Y+13, r27 ; 0x0d ff90: 5e cf rjmp .-324 ; 0xfe4e const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; ff92: 60 e0 ldi r22, 0x00 ; 0 ff94: 70 e0 ldi r23, 0x00 ; 0 ff96: 80 e8 ldi r24, 0x80 ; 128 ff98: 9f ef ldi r25, 0xFF ; 255 ff9a: 6d cf rjmp .-294 ; 0xfe76 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; ff9c: 80 e0 ldi r24, 0x00 ; 0 ff9e: 90 e0 ldi r25, 0x00 ; 0 ffa0: a0 e8 ldi r26, 0x80 ; 128 ffa2: bf e7 ldi r27, 0x7F ; 127 ffa4: 89 8f std Y+25, r24 ; 0x19 ffa6: 9a 8f std Y+26, r25 ; 0x1a ffa8: ab 8f std Y+27, r26 ; 0x1b ffaa: bc 8f std Y+28, r27 ; 0x1c ffac: 80 cf rjmp .-256 ; 0xfeae const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; ffae: 60 e0 ldi r22, 0x00 ; 0 ffb0: 70 e0 ldi r23, 0x00 ; 0 ffb2: 80 e8 ldi r24, 0x80 ; 128 ffb4: 9f e7 ldi r25, 0x7F ; 127 ffb6: 8f cf rjmp .-226 ; 0xfed6 ffb8: 2f 80 ldd r2, Y+7 ; 0x07 ffba: b4 cf rjmp .-152 ; 0xff24 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; } ffbc: 60 e0 ldi r22, 0x00 ; 0 ffbe: 70 e0 ldi r23, 0x00 ; 0 ffc0: 80 ec ldi r24, 0xC0 ; 192 ffc2: 9f e7 ldi r25, 0x7F ; 127 ffc4: d3 01 movw r26, r6 ffc6: 11 96 adiw r26, 0x01 ; 1 ffc8: 6d 93 st X+, r22 ffca: 7d 93 st X+, r23 ffcc: 8d 93 st X+, r24 ffce: 9c 93 st X, r25 ffd0: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { ffd2: be 81 ldd r27, Y+6 ; 0x06 ffd4: b3 30 cpi r27, 0x03 ; 3 ffd6: c1 f1 breq .+112 ; 0x10048 ffd8: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); ffda: 81 2f mov r24, r17 ffdc: 0f 94 c5 8c call 0x3198a ; 0x3198a ffe0: 4b 01 movw r8, r22 ffe2: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); ffe4: 80 2f mov r24, r16 ffe6: 0f 94 c5 8c call 0x3198a ; 0x3198a ffea: 6b 01 movw r12, r22 ffec: 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)) { ffee: a5 01 movw r20, r10 fff0: 94 01 movw r18, r8 fff2: 6a 85 ldd r22, Y+10 ; 0x0a fff4: 7b 85 ldd r23, Y+11 ; 0x0b fff6: 8c 85 ldd r24, Y+12 ; 0x0c fff8: 9d 85 ldd r25, Y+13 ; 0x0d fffa: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> fffe: 18 16 cp r1, r24 10000: 0c f4 brge .+2 ; 0x10004 10002: 1c c1 rjmp .+568 ; 0x1023c 10004: 29 8d ldd r18, Y+25 ; 0x19 10006: 3a 8d ldd r19, Y+26 ; 0x1a 10008: 4b 8d ldd r20, Y+27 ; 0x1b 1000a: 5c 8d ldd r21, Y+28 ; 0x1c 1000c: c5 01 movw r24, r10 1000e: b4 01 movw r22, r8 10010: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 10014: 18 16 cp r1, r24 10016: 0c f4 brge .+2 ; 0x1001a 10018: 11 c1 rjmp .+546 ; 0x1023c 1001a: a7 01 movw r20, r14 1001c: 96 01 movw r18, r12 1001e: 6c 89 ldd r22, Y+20 ; 0x14 10020: 7d 89 ldd r23, Y+21 ; 0x15 10022: 8e 89 ldd r24, Y+22 ; 0x16 10024: 9f 89 ldd r25, Y+23 ; 0x17 10026: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1002a: 18 16 cp r1, r24 1002c: 0c f4 brge .+2 ; 0x10030 1002e: 06 c1 rjmp .+524 ; 0x1023c 10030: 2d 8d ldd r18, Y+29 ; 0x1d 10032: 3e 8d ldd r19, Y+30 ; 0x1e 10034: 4f 8d ldd r20, Y+31 ; 0x1f 10036: 58 a1 ldd r21, Y+32 ; 0x20 10038: c7 01 movw r24, r14 1003a: b6 01 movw r22, r12 1003c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 10040: 18 16 cp r1, r24 10042: 0c f4 brge .+2 ; 0x10046 10044: fb c0 rjmp .+502 ; 0x1023c continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 10046: 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++) { 10048: 1f 5f subi r17, 0xFF ; 255 1004a: 24 e0 ldi r18, 0x04 ; 4 1004c: 62 0e add r6, r18 1004e: 71 1c adc r7, r1 10050: 17 30 cpi r17, 0x07 ; 7 10052: 09 f0 breq .+2 ; 0x10056 10054: 79 cf rjmp .-270 ; 0xff48 10056: 6f ef ldi r22, 0xFF ; 255 10058: 46 1a sub r4, r22 1005a: 56 0a sbc r5, r22 1005c: 88 85 ldd r24, Y+8 ; 0x08 1005e: 99 85 ldd r25, Y+9 ; 0x09 10060: 4c 96 adiw r24, 0x1c ; 28 10062: 99 87 std Y+9, r25 ; 0x09 10064: 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++) { 10066: 97 e0 ldi r25, 0x07 ; 7 10068: 49 16 cp r4, r25 1006a: 51 04 cpc r5, r1 1006c: 09 f0 breq .+2 ; 0x10070 1006e: 63 cf rjmp .-314 ; 0xff36 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 10070: 0e 94 08 f1 call 0x1e210 ; 0x1e210 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 10074: a0 91 c7 06 lds r26, 0x06C7 ; 0x8006c7 10078: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 1007a: b0 91 ac 03 lds r27, 0x03AC ; 0x8003ac 1007e: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 10080: 81 e0 ldi r24, 0x01 ; 1 10082: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = meshPointsToProbe + 10; 10086: 8a e0 ldi r24, 0x0A ; 10 10088: 83 0d add r24, r3 1008a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_update(1); 1008e: 81 e0 ldi r24, 0x01 ; 1 10090: 0e 94 c3 69 call 0xd386 ; 0xd386 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10094: 80 e0 ldi r24, 0x00 ; 0 10096: 90 e0 ldi r25, 0x00 ; 0 10098: a0 ea ldi r26, 0xA0 ; 160 1009a: b0 e4 ldi r27, 0x40 ; 64 1009c: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 100a0: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 100a4: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 100a8: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 100ac: 65 e5 ldi r22, 0x55 ; 85 100ae: 75 e5 ldi r23, 0x55 ; 85 100b0: 85 e5 ldi r24, 0x55 ; 85 100b2: 91 e4 ldi r25, 0x41 ; 65 100b4: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 100b8: 80 e0 ldi r24, 0x00 ; 0 100ba: 0e 94 6f 60 call 0xc0de ; 0xc0de 100be: 9c a3 std Y+36, r25 ; 0x24 100c0: 8b a3 std Y+35, r24 ; 0x23 100c2: 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 100c4: 83 2d mov r24, r3 100c6: 67 e0 ldi r22, 0x07 ; 7 100c8: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 100cc: f8 2e mov r15, r24 100ce: 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 100d0: 68 2f mov r22, r24 100d2: 70 e0 ldi r23, 0x00 ; 0 100d4: 7f 87 std Y+15, r23 ; 0x0f 100d6: 6e 87 std Y+14, r22 ; 0x0e 100d8: 80 ff sbrs r24, 0 100da: 03 c0 rjmp .+6 ; 0x100e2 100dc: 76 e0 ldi r23, 0x06 ; 6 100de: 79 1b sub r23, r25 100e0: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 100e2: 80 2f mov r24, r16 100e4: 63 e0 ldi r22, 0x03 ; 3 100e6: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 100ea: 91 11 cpse r25, r1 100ec: 05 c0 rjmp .+10 ; 0x100f8 100ee: 8f 2d mov r24, r15 100f0: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 100f4: 11 e0 ldi r17, 0x01 ; 1 100f6: 91 11 cpse r25, r1 100f8: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 100fa: 80 2f mov r24, r16 100fc: 0f 94 c5 8c call 0x3198a ; 0x3198a 10100: 68 8b std Y+16, r22 ; 0x10 10102: 79 8b std Y+17, r23 ; 0x11 10104: 8a 8b std Y+18, r24 ; 0x12 10106: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 10108: 8f 2d mov r24, r15 1010a: 0f 94 c5 8c call 0x3198a ; 0x3198a 1010e: 4b 01 movw r8, r22 10110: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 10112: 8e 81 ldd r24, Y+6 ; 0x06 10114: 83 30 cpi r24, 0x03 ; 3 10116: 09 f0 breq .+2 ; 0x1011a 10118: 99 c0 rjmp .+306 ; 0x1024c if (!isOn3x3Mesh) { 1011a: 11 11 cpse r17, r1 1011c: c8 c0 rjmp .+400 ; 0x102ae 1011e: 27 e0 ldi r18, 0x07 ; 7 10120: ae 85 ldd r26, Y+14 ; 0x0e 10122: bf 85 ldd r27, Y+15 ; 0x0f 10124: 2a 9f mul r18, r26 10126: f0 01 movw r30, r0 10128: 2b 9f mul r18, r27 1012a: f0 0d add r31, r0 1012c: 11 24 eor r1, r1 1012e: e0 0f add r30, r16 10130: f1 1d adc r31, r1 10132: ee 0f add r30, r30 10134: ff 1f adc r31, r31 10136: ee 0f add r30, r30 10138: ff 1f adc r31, r31 1013a: e4 56 subi r30, 0x64 ; 100 1013c: fd 4e sbci r31, 0xED ; 237 1013e: 60 e0 ldi r22, 0x00 ; 0 10140: 70 e0 ldi r23, 0x00 ; 0 10142: 80 ec ldi r24, 0xC0 ; 192 10144: 9f e7 ldi r25, 0x7F ; 127 10146: 61 83 std Z+1, r22 ; 0x01 10148: 72 83 std Z+2, r23 ; 0x02 1014a: 83 83 std Z+3, r24 ; 0x03 1014c: 94 83 std Z+4, r25 ; 0x04 1014e: 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) { 10150: e1 e3 ldi r30, 0x31 ; 49 10152: 3e 12 cpse r3, r30 10154: b7 cf rjmp .-146 ; 0x100c4 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10156: 80 e0 ldi r24, 0x00 ; 0 10158: 90 e0 ldi r25, 0x00 ; 0 1015a: a0 ea ldi r26, 0xA0 ; 160 1015c: b0 e4 ldi r27, 0x40 ; 64 1015e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 10162: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 10166: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1016a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1016e: 65 e5 ldi r22, 0x55 ; 85 10170: 75 e5 ldi r23, 0x55 ; 85 10172: 85 e5 ldi r24, 0x55 ; 85 10174: 91 e4 ldi r25, 0x41 ; 65 10176: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1017a: 0f 94 a0 22 call 0x24540 ; 0x24540 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 1017e: b1 e3 ldi r27, 0x31 ; 49 10180: 3b 16 cp r3, r27 10182: 09 f4 brne .+2 ; 0x10186 10184: 3c c2 rjmp .+1144 ; 0x105fe if (g80_fail_cnt++ >= 1) { 10186: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 1018a: 91 e0 ldi r25, 0x01 ; 1 1018c: 98 0f add r25, r24 1018e: 90 93 3f 03 sts 0x033F, r25 ; 0x80033f 10192: 88 23 and r24, r24 10194: 09 f4 brne .+2 ; 0x10198 10196: d3 c1 rjmp .+934 ; 0x1053e print_stop(); 10198: 60 e0 ldi r22, 0x00 ; 0 1019a: 80 e0 ldi r24, 0x00 ; 0 1019c: 0e 94 9e ef call 0x1df3c ; 0x1df3c lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 101a0: 84 e3 ldi r24, 0x34 ; 52 101a2: 96 e3 ldi r25, 0x36 ; 54 101a4: 0e 94 32 6d call 0xda64 ; 0xda64 101a8: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_z_calibration_prompt(false); 101ac: 80 e0 ldi r24, 0x00 ; 0 101ae: 0f 94 f7 2f call 0x25fee ; 0x25fee current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 101b2: 81 e0 ldi r24, 0x01 ; 1 101b4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 101b8: 8b e0 ldi r24, 0x0B ; 11 101ba: 9c e6 ldi r25, 0x6C ; 108 101bc: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = custom_message_type_old; 101c0: 2f 81 ldd r18, Y+7 ; 0x07 101c2: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 custom_message_state = custom_message_state_old; 101c6: 68 85 ldd r22, Y+8 ; 0x08 101c8: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac lcd_update(2); 101cc: 82 e0 ldi r24, 0x02 ; 2 101ce: 0e 94 c3 69 call 0xd386 ; 0xd386 st_synchronize(); 101d2: 0f 94 a0 22 call 0x24540 ; 0x24540 mesh_bed_leveling_flag = false; 101d6: 10 92 06 12 sts 0x1206, r1 ; 0x801206 101da: d6 cd rjmp .-1108 ; 0xfd88 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)) { 101dc: 01 11 cpse r16, r1 101de: 03 c0 rjmp .+6 ; 0x101e6 101e0: 11 23 and r17, r17 101e2: 09 f4 brne .+2 ; 0x101e6 101e4: bc ce rjmp .-648 ; 0xff5e // 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))); 101e6: 81 2f mov r24, r17 101e8: 63 e0 ldi r22, 0x03 ; 3 101ea: 0f 94 f7 a1 call 0x343ee ; 0x343ee <__divmodqi4> 101ee: 84 0d add r24, r4 101f0: 95 2d mov r25, r5 101f2: 91 1d adc r25, r1 101f4: 88 0f add r24, r24 101f6: 99 1f adc r25, r25 101f8: 8d 53 subi r24, 0x3D ; 61 101fa: 90 4f sbci r25, 0xF0 ; 240 101fc: 0f 94 4a a1 call 0x34294 ; 0x34294 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 10200: bc 01 movw r22, r24 10202: 99 0f add r25, r25 10204: 88 0b sbc r24, r24 10206: 99 0b sbc r25, r25 10208: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1020c: 2a e0 ldi r18, 0x0A ; 10 1020e: 37 ed ldi r19, 0xD7 ; 215 10210: 43 e2 ldi r20, 0x23 ; 35 10212: 5c e3 ldi r21, 0x3C ; 60 10214: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10218: 9b 01 movw r18, r22 1021a: ac 01 movw r20, r24 1021c: 60 91 9d 12 lds r22, 0x129D ; 0x80129d 10220: 70 91 9e 12 lds r23, 0x129E ; 0x80129e 10224: 80 91 9f 12 lds r24, 0x129F ; 0x80129f 10228: 90 91 a0 12 lds r25, 0x12A0 ; 0x8012a0 1022c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10230: f3 01 movw r30, r6 10232: 61 83 std Z+1, r22 ; 0x01 10234: 72 83 std Z+2, r23 ; 0x02 10236: 83 83 std Z+3, r24 ; 0x03 10238: 94 83 std Z+4, r25 ; 0x04 1023a: 91 ce rjmp .-734 ; 0xff5e 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)) { 1023c: fe 85 ldd r31, Y+14 ; 0x0e 1023e: ff 23 and r31, r31 10240: 09 f4 brne .+2 ; 0x10244 10242: 02 cf rjmp .-508 ; 0x10048 10244: 22 20 and r2, r2 10246: 09 f4 brne .+2 ; 0x1024a 10248: fe ce rjmp .-516 ; 0x10046 1024a: fe ce rjmp .-516 ; 0x10048 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)) { 1024c: 28 89 ldd r18, Y+16 ; 0x10 1024e: 39 89 ldd r19, Y+17 ; 0x11 10250: 4a 89 ldd r20, Y+18 ; 0x12 10252: 5b 89 ldd r21, Y+19 ; 0x13 10254: 6a 85 ldd r22, Y+10 ; 0x0a 10256: 7b 85 ldd r23, Y+11 ; 0x0b 10258: 8c 85 ldd r24, Y+12 ; 0x0c 1025a: 9d 85 ldd r25, Y+13 ; 0x0d 1025c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 10260: 18 16 cp r1, r24 10262: 04 f1 brlt .+64 ; 0x102a4 10264: 28 89 ldd r18, Y+16 ; 0x10 10266: 39 89 ldd r19, Y+17 ; 0x11 10268: 4a 89 ldd r20, Y+18 ; 0x12 1026a: 5b 89 ldd r21, Y+19 ; 0x13 1026c: 69 8d ldd r22, Y+25 ; 0x19 1026e: 7a 8d ldd r23, Y+26 ; 0x1a 10270: 8b 8d ldd r24, Y+27 ; 0x1b 10272: 9c 8d ldd r25, Y+28 ; 0x1c 10274: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 10278: 87 fd sbrc r24, 7 1027a: 14 c0 rjmp .+40 ; 0x102a4 1027c: a5 01 movw r20, r10 1027e: 94 01 movw r18, r8 10280: 6c 89 ldd r22, Y+20 ; 0x14 10282: 7d 89 ldd r23, Y+21 ; 0x15 10284: 8e 89 ldd r24, Y+22 ; 0x16 10286: 9f 89 ldd r25, Y+23 ; 0x17 10288: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1028c: 18 16 cp r1, r24 1028e: 54 f0 brlt .+20 ; 0x102a4 10290: a5 01 movw r20, r10 10292: 94 01 movw r18, r8 10294: 6d 8d ldd r22, Y+29 ; 0x1d 10296: 7e 8d ldd r23, Y+30 ; 0x1e 10298: 8f 8d ldd r24, Y+31 ; 0x1f 1029a: 98 a1 ldd r25, Y+32 ; 0x20 1029c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 102a0: 87 ff sbrs r24, 7 102a2: 05 c0 rjmp .+10 ; 0x102ae 102a4: 11 23 and r17, r17 102a6: 09 f4 brne .+2 ; 0x102aa 102a8: 52 cf rjmp .-348 ; 0x1014e 102aa: 21 10 cpse r2, r1 102ac: 50 cf rjmp .-352 ; 0x1014e mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 102ae: 10 e0 ldi r17, 0x00 ; 0 102b0: a7 e0 ldi r26, 0x07 ; 7 102b2: 8e 85 ldd r24, Y+14 ; 0x0e 102b4: 9f 85 ldd r25, Y+15 ; 0x0f 102b6: a8 9f mul r26, r24 102b8: f0 01 movw r30, r0 102ba: a9 9f mul r26, r25 102bc: f0 0d add r31, r0 102be: 11 24 eor r1, r1 102c0: e0 0f add r30, r16 102c2: f1 1f adc r31, r17 102c4: ee 0f add r30, r30 102c6: ff 1f adc r31, r31 102c8: ee 0f add r30, r30 102ca: ff 1f adc r31, r31 102cc: e4 56 subi r30, 0x64 ; 100 102ce: fd 4e sbci r31, 0xED ; 237 102d0: 41 80 ldd r4, Z+1 ; 0x01 102d2: 52 80 ldd r5, Z+2 ; 0x02 102d4: 63 80 ldd r6, Z+3 ; 0x03 102d6: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 102d8: c1 2c mov r12, r1 102da: d1 2c mov r13, r1 102dc: e0 ea ldi r30, 0xA0 ; 160 102de: ee 2e mov r14, r30 102e0: e0 e4 ldi r30, 0x40 ; 64 102e2: fe 2e mov r15, r30 102e4: 22 20 and r2, r2 102e6: 51 f0 breq .+20 ; 0x102fc 102e8: 23 e3 ldi r18, 0x33 ; 51 102ea: 33 e3 ldi r19, 0x33 ; 51 102ec: 43 eb ldi r20, 0xB3 ; 179 102ee: 5e e3 ldi r21, 0x3E ; 62 102f0: c3 01 movw r24, r6 102f2: b2 01 movw r22, r4 102f4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 102f8: 6b 01 movw r12, r22 102fa: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 102fc: a7 01 movw r20, r14 102fe: 96 01 movw r18, r12 10300: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 10304: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 10308: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1030c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 10310: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 10314: 87 ff sbrs r24, 7 10316: 10 c0 rjmp .+32 ; 0x10338 current_position[Z_AXIS] = init_z_bckp; 10318: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 1031c: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 10320: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 10324: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10328: 65 e5 ldi r22, 0x55 ; 85 1032a: 75 e5 ldi r23, 0x55 ; 85 1032c: 85 e5 ldi r24, 0x55 ; 85 1032e: 91 e4 ldi r25, 0x41 ; 65 10330: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 10334: 0f 94 a0 22 call 0x24540 ; 0x24540 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10338: 68 89 ldd r22, Y+16 ; 0x10 1033a: 79 89 ldd r23, Y+17 ; 0x11 1033c: 8a 89 ldd r24, Y+18 ; 0x12 1033e: 9b 89 ldd r25, Y+19 ; 0x13 10340: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 10344: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 10348: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1034c: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = y_pos; 10350: 80 92 f9 11 sts 0x11F9, r8 ; 0x8011f9 10354: 90 92 fa 11 sts 0x11FA, r9 ; 0x8011fa 10358: a0 92 fb 11 sts 0x11FB, r10 ; 0x8011fb 1035c: b0 92 fc 11 sts 0x11FC, r11 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 10360: 69 ef ldi r22, 0xF9 ; 249 10362: 71 e1 ldi r23, 0x11 ; 17 10364: 85 ef ldi r24, 0xF5 ; 245 10366: 91 e1 ldi r25, 0x11 ; 17 10368: 0e 94 27 64 call 0xc84e ; 0xc84e plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1036c: 60 e0 ldi r22, 0x00 ; 0 1036e: 70 e0 ldi r23, 0x00 ; 0 10370: 86 e1 ldi r24, 0x16 ; 22 10372: 93 e4 ldi r25, 0x43 ; 67 10374: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 10378: 0f 94 a0 22 call 0x24540 ; 0x24540 if (planner_aborted) 1037c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 10380: 88 23 and r24, r24 10382: 39 f0 breq .+14 ; 0x10392 { custom_message_type = custom_message_type_old; 10384: 7f 81 ldd r23, Y+7 ; 0x07 10386: 70 93 c7 06 sts 0x06C7, r23 ; 0x8006c7 custom_message_state = custom_message_state_old; 1038a: 88 85 ldd r24, Y+8 ; 0x08 1038c: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 10390: fb cc rjmp .-1546 ; 0xfd88 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 10392: 81 2c mov r8, r1 10394: 91 2c mov r9, r1 10396: 70 e2 ldi r23, 0x20 ; 32 10398: a7 2e mov r10, r23 1039a: 71 ec ldi r23, 0xC1 ; 193 1039c: b7 2e mov r11, r23 1039e: 22 20 and r2, r2 103a0: 51 f0 breq .+20 ; 0x103b6 103a2: 2a 81 ldd r18, Y+2 ; 0x02 103a4: 3b 81 ldd r19, Y+3 ; 0x03 103a6: 4c 81 ldd r20, Y+4 ; 0x04 103a8: 5d 81 ldd r21, Y+5 ; 0x05 103aa: c3 01 movw r24, r6 103ac: b2 01 movw r22, r4 103ae: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 103b2: 4b 01 movw r8, r22 103b4: 5c 01 movw r10, r24 103b6: 48 8d ldd r20, Y+24 ; 0x18 103b8: c5 01 movw r24, r10 103ba: b4 01 movw r22, r8 103bc: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 103c0: 81 11 cpse r24, r1 103c2: 0b c0 rjmp .+22 ; 0x103da 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)); 103c4: 89 ee ldi r24, 0xE9 ; 233 103c6: 92 e6 ldi r25, 0x62 ; 98 103c8: 0e 94 32 6d call 0xda64 ; 0xda64 103cc: 9f 93 push r25 103ce: 8f 93 push r24 103d0: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 103d4: 0f 90 pop r0 103d6: 0f 90 pop r0 103d8: be ce rjmp .-644 ; 0x10156 // 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. 103da: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 103de: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 103e2: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 103e6: 50 91 00 12 lds r21, 0x1200 ; 0x801200 103ea: c7 01 movw r24, r14 103ec: b6 01 movw r22, r12 103ee: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 103f2: 20 e0 ldi r18, 0x00 ; 0 103f4: 30 e0 ldi r19, 0x00 ; 0 103f6: a9 01 movw r20, r18 103f8: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 103fc: 87 ff sbrs r24, 7 103fe: 36 c0 rjmp .+108 ; 0x1046c current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10400: 60 e0 ldi r22, 0x00 ; 0 10402: 70 e0 ldi r23, 0x00 ; 0 10404: 80 ea ldi r24, 0xA0 ; 160 10406: 90 e4 ldi r25, 0x40 ; 64 10408: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1040c: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 10410: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 10414: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10418: 65 e5 ldi r22, 0x55 ; 85 1041a: 75 e5 ldi r23, 0x55 ; 85 1041c: 85 e5 ldi r24, 0x55 ; 85 1041e: 91 e4 ldi r25, 0x41 ; 65 10420: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 10424: 0f 94 a0 22 call 0x24540 ; 0x24540 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 10428: 48 8d ldd r20, Y+24 ; 0x18 1042a: c5 01 movw r24, r10 1042c: b4 01 movw r22, r8 1042e: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 10432: 88 23 and r24, r24 10434: 39 f2 breq .-114 ; 0x103c4 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 10436: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 1043a: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 1043e: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 10442: 50 91 00 12 lds r21, 0x1200 ; 0x801200 10446: 60 e0 ldi r22, 0x00 ; 0 10448: 70 e0 ldi r23, 0x00 ; 0 1044a: 80 ea ldi r24, 0xA0 ; 160 1044c: 90 e4 ldi r25, 0x40 ; 64 1044e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 10452: 2d ec ldi r18, 0xCD ; 205 10454: 3c ec ldi r19, 0xCC ; 204 10456: 4c ec ldi r20, 0xCC ; 204 10458: 5d e3 ldi r21, 0x3D ; 61 1045a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1045e: 87 ff sbrs r24, 7 10460: 05 c0 rjmp .+10 ; 0x1046c puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 10462: 8d ea ldi r24, 0xAD ; 173 10464: 97 e7 ldi r25, 0x77 ; 119 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")); 10466: 0f 94 25 a0 call 0x3404a ; 0x3404a 1046a: 75 ce rjmp .-790 ; 0x10156 1046c: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 10470: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 10474: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 10478: 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 1047c: 22 20 and r2, r2 1047e: a1 f0 breq .+40 ; 0x104a8 10480: a7 01 movw r20, r14 10482: 96 01 movw r18, r12 10484: c3 01 movw r24, r6 10486: b2 01 movw r22, r4 10488: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1048c: 9b 01 movw r18, r22 1048e: ac 01 movw r20, r24 10490: 5f 77 andi r21, 0x7F ; 127 10492: 6a 81 ldd r22, Y+2 ; 0x02 10494: 7b 81 ldd r23, Y+3 ; 0x03 10496: 8c 81 ldd r24, Y+4 ; 0x04 10498: 9d 81 ldd r25, Y+5 ; 0x05 1049a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1049e: 87 ff sbrs r24, 7 104a0: 03 c0 rjmp .+6 ; 0x104a8 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 104a2: 84 e7 ldi r24, 0x74 ; 116 104a4: 97 e7 ldi r25, 0x77 ; 119 104a6: df cf rjmp .-66 ; 0x10466 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 104a8: 8f ea ldi r24, 0xAF ; 175 104aa: 9f e0 ldi r25, 0x0F ; 15 104ac: 0f 94 3c a1 call 0x34278 ; 0x34278 104b0: 88 23 and r24, r24 104b2: 09 f4 brne .+2 ; 0x104b6 104b4: 40 c0 rjmp .+128 ; 0x10536 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); } 104b6: 86 ea ldi r24, 0xA6 ; 166 104b8: 9f e0 ldi r25, 0x0F ; 15 104ba: 0f 94 3c a1 call 0x34278 ; 0x34278 if (!calibration_status_pinda()) return 0; 104be: 88 23 and r24, r24 104c0: d1 f1 breq .+116 ; 0x10536 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 104c2: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 104c6: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 104ca: 80 91 90 06 lds r24, 0x0690 ; 0x800690 104ce: 90 91 91 06 lds r25, 0x0691 ; 0x800691 104d2: 0e 94 8f 56 call 0xad1e ; 0xad1e 104d6: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 104da: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 104de: 40 91 40 04 lds r20, 0x0440 ; 0x800440 104e2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 104e6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 104ea: 9b 01 movw r18, r22 104ec: ac 01 movw r20, r24 104ee: e7 e0 ldi r30, 0x07 ; 7 104f0: ae 85 ldd r26, Y+14 ; 0x0e 104f2: bf 85 ldd r27, Y+15 ; 0x0f 104f4: ea 9f mul r30, r26 104f6: c0 01 movw r24, r0 104f8: eb 9f mul r30, r27 104fa: 90 0d add r25, r0 104fc: 11 24 eor r1, r1 104fe: 08 0f add r16, r24 10500: 19 1f adc r17, r25 10502: 00 0f add r16, r16 10504: 11 1f adc r17, r17 10506: 00 0f add r16, r16 10508: 11 1f adc r17, r17 1050a: 04 56 subi r16, 0x64 ; 100 1050c: 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; 1050e: c7 01 movw r24, r14 10510: b6 01 movw r22, r12 10512: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 10516: d8 01 movw r26, r16 10518: 11 96 adiw r26, 0x01 ; 1 1051a: 6d 93 st X+, r22 1051c: 7d 93 st X+, r23 1051e: 8d 93 st X+, r24 10520: 9c 93 st X, r25 10522: 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--; 10524: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 10528: 81 50 subi r24, 0x01 ; 1 1052a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac mesh_point++; lcd_update(1); 1052e: 81 e0 ldi r24, 0x01 ; 1 10530: 0e 94 c3 69 call 0xd386 ; 0xd386 10534: 0c ce rjmp .-1000 ; 0x1014e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 10536: 20 e0 ldi r18, 0x00 ; 0 10538: 30 e0 ldi r19, 0x00 ; 0 1053a: a9 01 movw r20, r18 1053c: d8 cf rjmp .-80 ; 0x104ee 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); 1053e: 85 e0 ldi r24, 0x05 ; 5 10540: 0f 94 fd 2c call 0x259fa ; 0x259fa 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; 10544: c1 2c mov r12, r1 10546: d1 2c mov r13, r1 10548: 90 ea ldi r25, 0xA0 ; 160 1054a: e9 2e mov r14, r25 1054c: 90 e4 ldi r25, 0x40 ; 64 1054e: 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)); 10550: 80 e0 ldi r24, 0x00 ; 0 10552: 96 e3 ldi r25, 0x36 ; 54 10554: 0e 94 32 6d call 0xda64 ; 0xda64 10558: 0f 94 f4 0a call 0x215e8 ; 0x215e8 #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 1055c: 90 e0 ldi r25, 0x00 ; 0 1055e: 80 e0 ldi r24, 0x00 ; 0 10560: 0f 94 f5 34 call 0x269ea ; 0x269ea lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 10564: 81 e0 ldi r24, 0x01 ; 1 10566: 0f 94 51 35 call 0x26aa2 ; 0x26aa2 #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); 1056a: 80 e0 ldi r24, 0x00 ; 0 1056c: 0f 94 d8 2c call 0x259b0 ; 0x259b0 10570: 18 2f mov r17, r24 raise_z(-1); 10572: 60 e0 ldi r22, 0x00 ; 0 10574: 70 e0 ldi r23, 0x00 ; 0 10576: 80 e8 ldi r24, 0x80 ; 128 10578: 9f eb ldi r25, 0xBF ; 191 1057a: 0e 94 5e 67 call 0xcebc ; 0xcebc enable_z_endstop(true); 1057e: 81 e0 ldi r24, 0x01 ; 1 10580: 0f 94 d8 2c call 0x259b0 ; 0x259b0 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10584: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 10588: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 1058c: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 10590: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10594: 65 e5 ldi r22, 0x55 ; 85 10596: 75 e5 ldi r23, 0x55 ; 85 10598: 85 e5 ldi r24, 0x55 ; 85 1059a: 91 e4 ldi r25, 0x41 ; 65 1059c: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 105a0: 0f 94 a0 22 call 0x24540 ; 0x24540 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 105a4: 81 2f mov r24, r17 105a6: 0f 94 d8 2c call 0x259b0 ; 0x259b0 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 105aa: 82 e0 ldi r24, 0x02 ; 2 105ac: 0f 94 8c 22 call 0x24518 ; 0x24518 105b0: 20 e0 ldi r18, 0x00 ; 0 105b2: 30 e0 ldi r19, 0x00 ; 0 105b4: 40 ea ldi r20, 0xA0 ; 160 105b6: 50 e4 ldi r21, 0x40 ; 64 105b8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 105bc: 18 16 cp r1, r24 105be: 44 f2 brlt .-112 ; 0x10550 custom_message_type = custom_message_type_old; 105c0: ef 81 ldd r30, Y+7 ; 0x07 105c2: e0 93 c7 06 sts 0x06C7, r30 ; 0x8006c7 custom_message_state = custom_message_state_old; 105c6: f8 85 ldd r31, Y+8 ; 0x08 105c8: f0 93 ac 03 sts 0x03AC, r31 ; 0x8003ac lcd_update_enable(true); // display / status-line recovery 105cc: 81 e0 ldi r24, 0x01 ; 1 105ce: 0e 94 41 6a call 0xd482 ; 0xd482 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); 105d2: dd 24 eor r13, r13 105d4: d3 94 inc r13 105d6: df 92 push r13 105d8: 81 2c mov r8, r1 105da: 91 2c mov r9, r1 105dc: 54 01 movw r10, r8 105de: cc 24 eor r12, r12 105e0: c3 94 inc r12 105e2: e1 2c mov r14, r1 105e4: f1 2c mov r15, r1 105e6: 87 01 movw r16, r14 105e8: 21 e0 ldi r18, 0x01 ; 1 105ea: 40 e0 ldi r20, 0x00 ; 0 105ec: 50 e0 ldi r21, 0x00 ; 0 105ee: ba 01 movw r22, r20 105f0: 81 e0 ldi r24, 0x01 ; 1 105f2: 0e 94 f4 67 call 0xcfe8 ; 0xcfe8 105f6: d0 92 e6 11 sts 0x11E6, r13 ; 0x8011e6 105fa: 0f 90 pop r0 105fc: c5 cb rjmp .-2166 ; 0xfd88 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. 105fe: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f clean_up_after_endstop_move(l_feedmultiply); 10602: 8b a1 ldd r24, Y+35 ; 0x23 10604: 9c a1 ldd r25, Y+36 ; 0x24 10606: 0e 94 55 60 call 0xc0aa ; 0xc0aa // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 1060a: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 1060e: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 10612: 80 e1 ldi r24, 0x10 ; 16 10614: 0e 94 4c d8 call 0x1b098 ; 0x1b098 10618: 88 23 and r24, r24 1061a: 91 f0 breq .+36 ; 0x10640 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 1061c: 0e 94 33 73 call 0xe666 ; 0xe666 // 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))); 10620: 81 ea ldi r24, 0xA1 ; 161 10622: 9d e0 ldi r25, 0x0D ; 13 10624: 0f 94 3c a1 call 0x34278 ; 0x34278 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-> 10628: 2b e0 ldi r18, 0x0B ; 11 1062a: 82 9f mul r24, r18 1062c: c0 01 movw r24, r0 1062e: 11 24 eor r1, r1 10630: 80 5b subi r24, 0xB0 ; 176 10632: 92 4f sbci r25, 0xF2 ; 242 10634: 0f 94 4a a1 call 0x34294 ; 0x34294 10638: 90 93 2a 05 sts 0x052A, r25 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 1063c: 80 93 29 05 sts 0x0529, r24 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> } void babystep_apply() { babystep_load(); shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 10640: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> 10644: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 10648: 07 2e mov r0, r23 1064a: 00 0c add r0, r0 1064c: 88 0b sbc r24, r24 1064e: 99 0b sbc r25, r25 10650: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 10654: 90 58 subi r25, 0x80 ; 128 10656: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 1065a: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 1065e: 40 91 40 04 lds r20, 0x0440 ; 0x800440 10662: 50 91 41 04 lds r21, 0x0441 ; 0x800441 10666: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1066a: 0f 94 31 8c call 0x31862 ; 0x31862 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; 1066e: 80 ec ldi r24, 0xC0 ; 192 10670: 9f e0 ldi r25, 0x0F ; 15 10672: 0f 94 3c a1 call 0x34278 ; 0x34278 10676: 91 e0 ldi r25, 0x01 ; 1 10678: 81 30 cpi r24, 0x01 ; 1 1067a: 09 f0 breq .+2 ; 0x1067e 1067c: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 1067e: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 10680: 4f eb ldi r20, 0xBF ; 191 10682: 5f e0 ldi r21, 0x0F ; 15 10684: 6c e4 ldi r22, 0x4C ; 76 10686: ce 01 movw r24, r28 10688: 01 96 adiw r24, 0x01 ; 1 1068a: 0e 94 e5 55 call 0xabca ; 0xabca 1068e: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 10690: 4e eb ldi r20, 0xBE ; 190 10692: 5f e0 ldi r21, 0x0F ; 15 10694: 62 e5 ldi r22, 0x52 ; 82 10696: ce 01 movw r24, r28 10698: 01 96 adiw r24, 0x01 ; 1 1069a: 0e 94 e5 55 call 0xabca ; 0xabca 1069e: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 106a0: 4d eb ldi r20, 0xBD ; 189 106a2: 5f e0 ldi r21, 0x0F ; 15 106a4: 66 e4 ldi r22, 0x46 ; 70 106a6: ce 01 movw r24, r28 106a8: 01 96 adiw r24, 0x01 ; 1 106aa: 0e 94 e5 55 call 0xabca ; 0xabca 106ae: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 106b0: 4c eb ldi r20, 0xBC ; 188 106b2: 5f e0 ldi r21, 0x0F ; 15 106b4: 62 e4 ldi r22, 0x42 ; 66 106b6: ce 01 movw r24, r28 106b8: 01 96 adiw r24, 0x01 ; 1 106ba: 0e 94 e5 55 call 0xabca ; 0xabca 106be: 21 2f mov r18, r17 106c0: 11 0f add r17, r17 106c2: 33 0b sbc r19, r19 106c4: 08 2e mov r0, r24 106c6: 00 0c add r0, r0 106c8: 99 0b sbc r25, r25 106ca: 5c 01 movw r10, r24 106cc: a2 1a sub r10, r18 106ce: b3 0a sbc r11, r19 106d0: 8f 2d mov r24, r15 106d2: ff 0c add r15, r15 106d4: 99 0b sbc r25, r25 106d6: 28 0f add r18, r24 106d8: 39 1f adc r19, r25 106da: 46 e0 ldi r20, 0x06 ; 6 106dc: 42 9f mul r20, r18 106de: 60 01 movw r12, r0 106e0: 43 9f mul r20, r19 106e2: d0 0c add r13, r0 106e4: 11 24 eor r1, r1 106e6: f1 2c mov r15, r1 106e8: e1 2c mov r14, r1 106ea: 00 2e mov r0, r16 106ec: 00 0c add r0, r0 106ee: 11 0b sbc r17, r17 106f0: 08 1b sub r16, r24 106f2: 19 0b sbc r17, r25 106f4: b7 01 movw r22, r14 106f6: 63 56 subi r22, 0x63 ; 99 106f8: 7d 4e sbci r23, 0xED ; 237 106fa: 3b 01 movw r6, r22 106fc: 46 01 movw r8, r12 106fe: 77 e0 ldi r23, 0x07 ; 7 10700: 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 * ( 10702: d3 01 movw r26, r6 10704: 2d 90 ld r2, X+ 10706: 3d 90 ld r3, X+ 10708: 4d 90 ld r4, X+ 1070a: 5d 90 ld r5, X+ 1070c: 3d 01 movw r6, r26 1070e: fd 01 movw r30, r26 10710: 34 97 sbiw r30, 0x04 ; 4 10712: fb 87 std Y+11, r31 ; 0x0b 10714: ea 87 std Y+10, r30 ; 0x0a 10716: b4 01 movw r22, r8 10718: 09 2c mov r0, r9 1071a: 00 0c add r0, r0 1071c: 88 0b sbc r24, r24 1071e: 99 0b sbc r25, r25 10720: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 10724: 2f e3 ldi r18, 0x3F ; 63 10726: 33 ec ldi r19, 0xC3 ; 195 10728: 4e e2 ldi r20, 0x2E ; 46 1072a: 59 e3 ldi r21, 0x39 ; 57 1072c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10730: a2 01 movw r20, r4 10732: 91 01 movw r18, r2 10734: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10738: aa 85 ldd r26, Y+10 ; 0x0a 1073a: bb 85 ldd r27, Y+11 ; 0x0b 1073c: 6d 93 st X+, r22 1073e: 7d 93 st X+, r23 10740: 8d 93 st X+, r24 10742: 9c 93 st X, r25 10744: 13 97 sbiw r26, 0x03 ; 3 10746: ba 81 ldd r27, Y+2 ; 0x02 10748: b1 50 subi r27, 0x01 ; 1 1074a: ba 83 std Y+2, r27 ; 0x02 1074c: 80 0e add r8, r16 1074e: 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++) { 10750: b1 11 cpse r27, r1 10752: d7 cf rjmp .-82 ; 0x10702 10754: ca 0c add r12, r10 10756: db 1c adc r13, r11 10758: ec e1 ldi r30, 0x1C ; 28 1075a: ee 0e add r14, r30 1075c: 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++) { 1075e: f4 ec ldi r31, 0xC4 ; 196 10760: ef 16 cp r14, r31 10762: f1 04 cpc r15, r1 10764: 39 f6 brne .-114 ; 0x106f4 + 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) 10766: 0e 94 08 f1 call 0x1e210 ; 0x1e210 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 1076a: 8d e4 ldi r24, 0x4D ; 77 1076c: 0e 94 b6 55 call 0xab6c ; 0xab6c 10770: 88 23 and r24, r24 10772: 09 f4 brne .+2 ; 0x10776 10774: 84 c0 rjmp .+264 ; 0x1087e 10776: 0e 94 cb 55 call 0xab96 ; 0xab96 if (nMeasPoints == 7 && useMagnetCompensation) { 1077a: 2e 81 ldd r18, Y+6 ; 0x06 1077c: 27 30 cpi r18, 0x07 ; 7 1077e: 09 f0 breq .+2 ; 0x10782 10780: 94 c0 rjmp .+296 ; 0x108aa 10782: 88 23 and r24, r24 10784: 09 f4 brne .+2 ; 0x10788 10786: 91 c0 rjmp .+290 ; 0x108aa 10788: bb 24 eor r11, r11 1078a: b3 94 inc r11 1078c: aa 24 eor r10, r10 1078e: aa 94 dec r10 10790: ab 0c add r10, r11 10792: 09 a1 ldd r16, Y+33 ; 0x21 10794: 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++) { 10796: 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++; } 10798: 8e ef ldi r24, 0xFE ; 254 1079a: 88 2e mov r8, r24 1079c: 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)) { 1079e: 6a 2d mov r22, r10 107a0: 86 2d mov r24, r6 107a2: 0f 94 fc 8b call 0x317f8 ; 0x317f8 107a6: 99 24 eor r9, r9 107a8: 93 94 inc r9 107aa: 96 0c add r9, r6 107ac: 81 11 cpse r24, r1 107ae: 6e c0 rjmp .+220 ; 0x1088c 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++; } 107b0: 6b 2d mov r22, r11 107b2: 86 2d mov r24, r6 107b4: 0f 94 fc 8b call 0x317f8 ; 0x317f8 } 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; 107b8: c1 2c mov r12, r1 107ba: d1 2c mov r13, r1 107bc: 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; 107be: 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++; } 107c0: 88 23 and r24, r24 107c2: 81 f0 breq .+32 ; 0x107e4 107c4: 20 e0 ldi r18, 0x00 ; 0 107c6: 30 e0 ldi r19, 0x00 ; 0 107c8: a9 01 movw r20, r18 107ca: d8 01 movw r26, r16 107cc: 5d 96 adiw r26, 0x1d ; 29 107ce: 6d 91 ld r22, X+ 107d0: 7d 91 ld r23, X+ 107d2: 8d 91 ld r24, X+ 107d4: 9c 91 ld r25, X 107d6: 90 97 sbiw r26, 0x20 ; 32 107d8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 107dc: 6b 01 movw r12, r22 107de: 7c 01 movw r14, r24 107e0: 77 24 eor r7, r7 107e2: 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++; } 107e4: 68 2d mov r22, r8 107e6: 86 2d mov r24, r6 107e8: 0f 94 fc 8b call 0x317f8 ; 0x317f8 107ec: 88 23 and r24, r24 107ee: 69 f0 breq .+26 ; 0x1080a 107f0: f8 01 movw r30, r16 107f2: 7b 97 sbiw r30, 0x1b ; 27 107f4: 20 81 ld r18, Z 107f6: 31 81 ldd r19, Z+1 ; 0x01 107f8: 42 81 ldd r20, Z+2 ; 0x02 107fa: 53 81 ldd r21, Z+3 ; 0x03 107fc: c7 01 movw r24, r14 107fe: b6 01 movw r22, r12 10800: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10804: 6b 01 movw r12, r22 10806: 7c 01 movw r14, r24 10808: 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++; } 1080a: 6a 2d mov r22, r10 1080c: 89 2d mov r24, r9 1080e: 0f 94 fc 8b call 0x317f8 ; 0x317f8 10812: 88 23 and r24, r24 10814: 61 f0 breq .+24 ; 0x1082e 10816: f8 01 movw r30, r16 10818: 25 81 ldd r18, Z+5 ; 0x05 1081a: 36 81 ldd r19, Z+6 ; 0x06 1081c: 47 81 ldd r20, Z+7 ; 0x07 1081e: 50 85 ldd r21, Z+8 ; 0x08 10820: c7 01 movw r24, r14 10822: b6 01 movw r22, r12 10824: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10828: 6b 01 movw r12, r22 1082a: 7c 01 movw r14, r24 1082c: 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++; } 1082e: 6a 2d mov r22, r10 10830: 8f ef ldi r24, 0xFF ; 255 10832: 86 0d add r24, r6 10834: 0f 94 fc 8b call 0x317f8 ; 0x317f8 10838: 88 23 and r24, r24 1083a: 31 f1 breq .+76 ; 0x10888 1083c: f8 01 movw r30, r16 1083e: 33 97 sbiw r30, 0x03 ; 3 10840: 20 81 ld r18, Z 10842: 31 81 ldd r19, Z+1 ; 0x01 10844: 42 81 ldd r20, Z+2 ; 0x02 10846: 53 81 ldd r21, Z+3 ; 0x03 10848: c7 01 movw r24, r14 1084a: b6 01 movw r22, r12 1084c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10850: 6b 01 movw r12, r22 10852: 7c 01 movw r14, r24 10854: 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 10856: 67 2d mov r22, r7 10858: 70 e0 ldi r23, 0x00 ; 0 1085a: 90 e0 ldi r25, 0x00 ; 0 1085c: 80 e0 ldi r24, 0x00 ; 0 1085e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 10862: 9b 01 movw r18, r22 10864: ac 01 movw r20, r24 10866: c7 01 movw r24, r14 10868: b6 01 movw r22, r12 1086a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1086e: d8 01 movw r26, r16 10870: 11 96 adiw r26, 0x01 ; 1 10872: 6d 93 st X+, r22 10874: 7d 93 st X+, r23 10876: 8d 93 st X+, r24 10878: 9c 93 st X, r25 1087a: 14 97 sbiw r26, 0x04 ; 4 1087c: 07 c0 rjmp .+14 ; 0x1088c } 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); 1087e: 8c ea ldi r24, 0xAC ; 172 10880: 9d e0 ldi r25, 0x0D ; 13 10882: 0f 94 3c a1 call 0x34278 ; 0x34278 10886: 79 cf rjmp .-270 ; 0x1077a 10888: 71 10 cpse r7, r1 1088a: e5 cf rjmp .-54 ; 0x10856 //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++) { 1088c: 69 2c mov r6, r9 1088e: 0c 5f subi r16, 0xFC ; 252 10890: 1f 4f sbci r17, 0xFF ; 255 10892: b7 e0 ldi r27, 0x07 ; 7 10894: 9b 12 cpse r9, r27 10896: 83 cf rjmp .-250 ; 0x1079e 10898: b3 94 inc r11 1089a: e9 a1 ldd r30, Y+33 ; 0x21 1089c: fa a1 ldd r31, Y+34 ; 0x22 1089e: 7c 96 adiw r30, 0x1c ; 28 108a0: fa a3 std Y+34, r31 ; 0x22 108a2: 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++) { 108a4: f8 e0 ldi r31, 0x08 ; 8 108a6: bf 12 cpse r11, r31 108a8: 71 cf rjmp .-286 ; 0x1078c if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 108aa: 81 e0 ldi r24, 0x01 ; 1 108ac: 80 93 9c 12 sts 0x129C, r24 ; 0x80129c if (code_seen('O') && !code_value_uint8()) { 108b0: 8f e4 ldi r24, 0x4F ; 79 108b2: 0e 94 b6 55 call 0xab6c ; 0xab6c 108b6: 81 11 cpse r24, r1 108b8: 03 c0 rjmp .+6 ; 0x108c0 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 108ba: 0f 94 86 8c call 0x3190c ; 0x3190c 108be: 79 cc rjmp .-1806 ; 0x101b2 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 108c0: 0e 94 cb 55 call 0xab96 ; 0xab96 108c4: 81 11 cpse r24, r1 108c6: f9 cf rjmp .-14 ; 0x108ba // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 108c8: 0e 94 4a 60 call 0xc094 ; 0xc094 108cc: 72 cc rjmp .-1820 ; 0x101b2 000108ce : 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() 108ce: 2f 92 push r2 108d0: 3f 92 push r3 108d2: 4f 92 push r4 108d4: 5f 92 push r5 108d6: 6f 92 push r6 108d8: 7f 92 push r7 108da: 8f 92 push r8 108dc: 9f 92 push r9 108de: af 92 push r10 108e0: bf 92 push r11 108e2: cf 92 push r12 108e4: df 92 push r13 108e6: ef 92 push r14 108e8: ff 92 push r15 108ea: 0f 93 push r16 108ec: 1f 93 push r17 108ee: cf 93 push r28 108f0: df 93 push r29 108f2: cd b7 in r28, 0x3d ; 61 108f4: de b7 in r29, 0x3e ; 62 108f6: c3 56 subi r28, 0x63 ; 99 108f8: d1 09 sbc r29, r1 108fa: 0f b6 in r0, 0x3f ; 63 108fc: f8 94 cli 108fe: de bf out 0x3e, r29 ; 62 10900: 0f be out 0x3f, r0 ; 63 10902: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 10904: 82 e0 ldi r24, 0x02 ; 2 10906: 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) { 1090a: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1090e: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 10912: 0f 51 subi r16, 0x1F ; 31 10914: 10 4f sbci r17, 0xF0 ; 240 10916: 45 e0 ldi r20, 0x05 ; 5 10918: 50 e0 ldi r21, 0x00 ; 0 1091a: 61 ec ldi r22, 0xC1 ; 193 1091c: 71 e8 ldi r23, 0x81 ; 129 1091e: c8 01 movw r24, r16 10920: 0f 94 1b 9f call 0x33e36 ; 0x33e36 10924: 89 2b or r24, r25 10926: 09 f0 breq .+2 ; 0x1092a 10928: 9b c1 rjmp .+822 ; 0x10c60 eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 1092a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1092e: 88 23 and r24, r24 10930: 09 f4 brne .+2 ; 0x10934 10932: 4d c0 rjmp .+154 ; 0x109ce return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 10934: 8d eb ldi r24, 0xBD ; 189 10936: 9e e7 ldi r25, 0x7E ; 126 10938: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 1093c: 88 23 and r24, r24 1093e: 79 f0 breq .+30 ; 0x1095e printf_P(_N("%u"), status_number); 10940: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 10944: 1f 92 push r1 10946: 8f 93 push r24 10948: 84 eb ldi r24, 0xB4 ; 180 1094a: 95 e6 ldi r25, 0x65 ; 101 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); 1094c: 9f 93 push r25 1094e: 8f 93 push r24 10950: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 10954: 0f 90 pop r0 10956: 0f 90 pop r0 10958: 0f 90 pop r0 1095a: 0f 90 pop r0 1095c: 08 c0 rjmp .+16 ; 0x1096e } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 1095e: 89 eb ldi r24, 0xB9 ; 185 10960: 9e e7 ldi r25, 0x7E ; 126 10962: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10966: 88 23 and r24, r24 10968: 41 f0 breq .+16 ; 0x1097a no_response = false; 1096a: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 <_ZL11no_response.lto_priv.495> SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 1096e: 81 e0 ldi r24, 0x01 ; 1 10970: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 10974: 0e 94 87 73 call 0xe70e ; 0xe70e 10978: 3a c2 rjmp .+1140 ; 0x10dee trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 1097a: 86 eb ldi r24, 0xB6 ; 182 1097c: 9e e7 ldi r25, 0x7E ; 126 1097e: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10982: 88 23 and r24, r24 10984: 21 f1 breq .+72 ; 0x109ce // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 10986: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 1098a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1098e: 61 e0 ldi r22, 0x01 ; 1 10990: 03 96 adiw r24, 0x03 ; 3 10992: 0f 94 63 4c call 0x298c6 ; 0x298c6 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 10996: 0f 94 2b 49 call 0x29256 ; 0x29256 1099a: 8c 01 movw r16, r24 sdpos = file.curPosition(); 1099c: 80 91 02 16 lds r24, 0x1602 ; 0x801602 109a0: 90 91 03 16 lds r25, 0x1603 ; 0x801603 109a4: a0 91 04 16 lds r26, 0x1604 ; 0x801604 109a8: b0 91 05 16 lds r27, 0x1605 ; 0x801605 109ac: 80 93 7e 16 sts 0x167E, r24 ; 0x80167e 109b0: 90 93 7f 16 sts 0x167F, r25 ; 0x80167f 109b4: a0 93 80 16 sts 0x1680, r26 ; 0x801680 109b8: b0 93 81 16 sts 0x1681, r27 ; 0x801681 while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 109bc: 80 2f mov r24, r16 109be: 0e 94 c2 70 call 0xe184 ; 0xe184 if (readByte == '\n') { 109c2: 0a 30 cpi r16, 0x0A ; 10 109c4: 11 05 cpc r17, r1 109c6: 39 f7 brne .-50 ; 0x10996 break; } } card.closefile(); 109c8: 0f 94 3a 42 call 0x28474 ; 0x28474 109cc: d0 cf rjmp .-96 ; 0x1096e - `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"))) { 109ce: 87 eb ldi r24, 0xB7 ; 183 109d0: 91 e8 ldi r25, 0x81 ; 129 109d2: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 109d6: 81 11 cpse r24, r1 109d8: ca cf rjmp .-108 ; 0x1096e gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 109da: 83 eb ldi r24, 0xB3 ; 179 109dc: 91 e8 ldi r25, 0x81 ; 129 109de: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 109e2: 88 23 and r24, r24 109e4: 21 f1 breq .+72 ; 0x10a2e printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 109e6: 40 91 87 03 lds r20, 0x0387 ; 0x800387 109ea: 50 91 88 03 lds r21, 0x0388 ; 0x800388 109ee: 2c e3 ldi r18, 0x3C ; 60 109f0: 24 9f mul r18, r20 109f2: c0 01 movw r24, r0 109f4: 25 9f mul r18, r21 109f6: 90 0d add r25, r0 109f8: 11 24 eor r1, r1 109fa: 9f 93 push r25 109fc: 8f 93 push r24 109fe: 40 91 85 03 lds r20, 0x0385 ; 0x800385 10a02: 50 91 86 03 lds r21, 0x0386 ; 0x800386 10a06: 24 9f mul r18, r20 10a08: c0 01 movw r24, r0 10a0a: 25 9f mul r18, r21 10a0c: 90 0d add r25, r0 10a0e: 11 24 eor r1, r1 10a10: 9f 93 push r25 10a12: 8f 93 push r24 10a14: 82 ed ldi r24, 0xD2 ; 210 10a16: 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); 10a18: 9f 93 push r25 10a1a: 8f 93 push r24 10a1c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 10a20: 0f 90 pop r0 10a22: 0f 90 pop r0 10a24: 0f 90 pop r0 10a26: 0f 90 pop r0 10a28: 0f 90 pop r0 10a2a: 0f 90 pop r0 10a2c: a0 cf rjmp .-192 ; 0x1096e 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 10a2e: 8e ea ldi r24, 0xAE ; 174 10a30: 91 e8 ldi r25, 0x81 ; 129 10a32: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10a36: 88 23 and r24, r24 10a38: 11 f1 breq .+68 ; 0x10a7e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 10a3a: 8c e8 ldi r24, 0x8C ; 140 10a3c: 9f e0 ldi r25, 0x0F ; 15 10a3e: 0f 94 3c a1 call 0x34278 ; 0x34278 10a42: 81 11 cpse r24, r1 10a44: 10 c0 rjmp .+32 ; 0x10a66 // M24 - Start SD print enquecommand_P(MSG_M24); 10a46: 61 e0 ldi r22, 0x01 ; 1 10a48: 89 e8 ldi r24, 0x89 ; 137 10a4a: 9c e6 ldi r25, 0x6C ; 108 10a4c: 0e 94 37 7d call 0xfa6e ; 0xfa6e 10a50: 60 e0 ldi r22, 0x00 ; 0 10a52: 85 ea ldi r24, 0xA5 ; 165 10a54: 9f e0 ldi r25, 0x0F ; 15 10a56: 0f 94 60 a1 call 0x342c0 ; 0x342c0 10a5a: 60 e0 ldi r22, 0x00 ; 0 10a5c: 8f e7 ldi r24, 0x7F ; 127 10a5e: 9c e0 ldi r25, 0x0C ; 12 10a60: 0f 94 60 a1 call 0x342c0 ; 0x342c0 10a64: 84 cf rjmp .-248 ; 0x1096e // 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) { 10a66: 81 30 cpi r24, 0x01 ; 1 10a68: 09 f0 breq .+2 ; 0x10a6c 10a6a: 81 cf rjmp .-254 ; 0x1096e // 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(); 10a6c: 0f 94 b4 20 call 0x24168 ; 0x24168 usb_timer.start(); 10a70: 85 ed ldi r24, 0xD5 ; 213 10a72: 91 e1 ldi r25, 0x11 ; 17 10a74: 0f 94 30 10 call 0x22060 ; 0x22060 ::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(); 10a78: 0f 94 da 0f call 0x21fb4 ; 0x21fb4 10a7c: 78 cf rjmp .-272 ; 0x1096e } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 10a7e: 87 ea ldi r24, 0xA7 ; 167 10a80: 91 e8 ldi r25, 0x81 ; 129 10a82: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10a86: 88 23 and r24, r24 10a88: 21 f0 breq .+8 ; 0x10a92 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 10a8a: 80 e0 ldi r24, 0x00 ; 0 10a8c: 0f 94 bd 63 call 0x2c77a ; 0x2c77a 10a90: 6e cf rjmp .-292 ; 0x1096e MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 10a92: 81 ea ldi r24, 0xA1 ; 161 10a94: 91 e8 ldi r25, 0x81 ; 129 10a96: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10a9a: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 10a9c: 0e 94 28 61 call 0xc250 ; 0xc250 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 10aa0: 8e e9 ldi r24, 0x9E ; 158 10aa2: 91 e8 ldi r25, 0x81 ; 129 10aa4: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10aa8: 88 23 and r24, r24 10aaa: a9 f0 breq .+42 ; 0x10ad6 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 10aac: 44 e1 ldi r20, 0x14 ; 20 10aae: 50 e0 ldi r21, 0x00 ; 0 10ab0: 65 e1 ldi r22, 0x15 ; 21 10ab2: 7d e0 ldi r23, 0x0D ; 13 10ab4: ce 01 movw r24, r28 10ab6: 01 96 adiw r24, 0x01 ; 1 10ab8: 0f 94 2c a1 call 0x34258 ; 0x34258 if (SN[19]) 10abc: 8c 89 ldd r24, Y+20 ; 0x14 10abe: 88 23 and r24, r24 10ac0: 29 f0 breq .+10 ; 0x10acc puts_P(PSTR("SN invalid")); 10ac2: 83 e9 ldi r24, 0x93 ; 147 10ac4: 91 e8 ldi r25, 0x81 ; 129 10ac6: 0f 94 25 a0 call 0x3404a ; 0x3404a 10aca: 51 cf rjmp .-350 ; 0x1096e else puts(SN); 10acc: ce 01 movw r24, r28 10ace: 01 96 adiw r24, 0x01 ; 1 10ad0: 0f 94 cb a7 call 0x34f96 ; 0x34f96 10ad4: 4c cf rjmp .-360 ; 0x1096e } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 10ad6: 8f e8 ldi r24, 0x8F ; 143 10ad8: 91 e8 ldi r25, 0x81 ; 129 10ada: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10ade: 88 23 and r24, r24 10ae0: 29 f0 breq .+10 ; 0x10aec SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 10ae2: 83 e8 ldi r24, 0x83 ; 131 10ae4: 91 e8 ldi r25, 0x81 ; 129 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 10ae6: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 10aea: 41 cf rjmp .-382 ; 0x1096e 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 10aec: 8f e7 ldi r24, 0x7F ; 127 10aee: 91 e8 ldi r25, 0x81 ; 129 10af0: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10af4: 88 23 and r24, r24 10af6: 19 f0 breq .+6 ; 0x10afe SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 10af8: 8f e5 ldi r24, 0x5F ; 95 10afa: 91 e8 ldi r25, 0x81 ; 129 10afc: f4 cf rjmp .-24 ; 0x10ae6 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 10afe: 8a e5 ldi r24, 0x5A ; 90 10b00: 91 e8 ldi r25, 0x81 ; 129 10b02: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10b06: 88 23 and r24, r24 10b08: 19 f0 breq .+6 ; 0x10b10 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 10b0a: 0e 94 35 6c call 0xd86a ; 0xd86a 10b0e: 2f cf rjmp .-418 ; 0x1096e 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 10b10: 87 e5 ldi r24, 0x57 ; 87 10b12: 91 e8 ldi r25, 0x81 ; 129 10b14: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10b18: 88 23 and r24, r24 10b1a: 79 f0 breq .+30 ; 0x10b3a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 10b1c: 81 ea ldi r24, 0xA1 ; 161 10b1e: 9d e0 ldi r25, 0x0D ; 13 10b20: 0f 94 3c a1 call 0x34278 ; 0x34278 10b24: 2b e0 ldi r18, 0x0B ; 11 10b26: 82 9f mul r24, r18 10b28: c0 01 movw r24, r0 10b2a: 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); 10b2c: 70 e0 ldi r23, 0x00 ; 0 10b2e: 60 e0 ldi r22, 0x00 ; 0 10b30: 80 5b subi r24, 0xB0 ; 176 10b32: 92 4f sbci r25, 0xF2 ; 242 10b34: 0f 94 7e a1 call 0x342fc ; 0x342fc 10b38: 1a cf rjmp .-460 ; 0x1096e } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 10b3a: 84 e5 ldi r24, 0x54 ; 84 10b3c: 91 e8 ldi r25, 0x81 ; 129 10b3e: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10b42: 88 23 and r24, r24 10b44: 51 f0 breq .+20 ; 0x10b5a // 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(); 10b46: 0e 94 2f 6a call 0xd45e ; 0xd45e Sound_MakeCustom(100,0,false); 10b4a: 40 e0 ldi r20, 0x00 ; 0 10b4c: 70 e0 ldi r23, 0x00 ; 0 10b4e: 60 e0 ldi r22, 0x00 ; 0 10b50: 84 e6 ldi r24, 0x64 ; 100 10b52: 90 e0 ldi r25, 0x00 ; 0 10b54: 0f 94 0b 32 call 0x26416 ; 0x26416 10b58: d8 cf rjmp .-80 ; 0x10b0a 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 10b5a: 80 e5 ldi r24, 0x50 ; 80 10b5c: 91 e8 ldi r25, 0x81 ; 129 10b5e: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10b62: 88 23 and r24, r24 10b64: e1 f0 breq .+56 ; 0x10b9e // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 10b66: 86 e5 ldi r24, 0x56 ; 86 10b68: 0e 94 b6 55 call 0xab6c ; 0xab6c 10b6c: 88 23 and r24, r24 10b6e: 09 f4 brne .+2 ; 0x10b72 10b70: fe ce rjmp .-516 ; 0x1096e bool value = code_value_short(); 10b72: 0e 94 d8 55 call 0xabb0 ; 0xabb0 10b76: 11 e0 ldi r17, 0x01 ; 1 10b78: 89 2b or r24, r25 10b7a: 09 f4 brne .+2 ; 0x10b7e 10b7c: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 10b7e: 0f 94 a0 22 call 0x24540 ; 0x24540 if(value != mbl.active) { 10b82: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 10b86: 90 e0 ldi r25, 0x00 ; 0 10b88: 18 17 cp r17, r24 10b8a: 19 06 cpc r1, r25 10b8c: 09 f4 brne .+2 ; 0x10b90 10b8e: ef ce rjmp .-546 ; 0x1096e mbl.active = value; 10b90: 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]); 10b94: 8d ef ldi r24, 0xFD ; 253 10b96: 91 e1 ldi r25, 0x11 ; 17 10b98: 0f 94 5b 76 call 0x2ecb6 ; 0x2ecb6 10b9c: e8 ce rjmp .-560 ; 0x1096e } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 10b9e: 89 e4 ldi r24, 0x49 ; 73 10ba0: 91 e8 ldi r25, 0x81 ; 129 10ba2: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10ba6: 88 23 and r24, r24 10ba8: 09 f4 brne .+2 ; 0x10bac 10baa: e1 ce rjmp .-574 ; 0x1096e uint16_t nDiameter; if(code_seen('D')) { 10bac: 84 e4 ldi r24, 0x44 ; 68 10bae: 0e 94 b6 55 call 0xab6c ; 0xab6c 10bb2: 88 23 and r24, r24 10bb4: a1 f0 breq .+40 ; 0x10bde nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10bb6: 0e 94 8e 5a call 0xb51c ; 0xb51c 10bba: 20 e0 ldi r18, 0x00 ; 0 10bbc: 30 e0 ldi r19, 0x00 ; 0 10bbe: 4a e7 ldi r20, 0x7A ; 122 10bc0: 54 e4 ldi r21, 0x44 ; 68 10bc2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10bc6: 20 e0 ldi r18, 0x00 ; 0 10bc8: 30 e0 ldi r19, 0x00 ; 0 10bca: 40 e0 ldi r20, 0x00 ; 0 10bcc: 5f e3 ldi r21, 0x3F ; 63 10bce: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10bd2: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 10bd6: cb 01 movw r24, r22 10bd8: 0e 94 2a f0 call 0x1e054 ; 0x1e054 10bdc: c8 ce rjmp .-624 ; 0x1096e } else if(code_seen_P(PSTR("set")) && farm_mode) { 10bde: 85 e4 ldi r24, 0x45 ; 69 10be0: 91 e8 ldi r25, 0x81 ; 129 10be2: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 10be6: 88 23 and r24, r24 10be8: 49 f1 breq .+82 ; 0x10c3c 10bea: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10bee: 88 23 and r24, r24 10bf0: 29 f1 breq .+74 ; 0x10c3c strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 10bf2: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10bf6: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10bfa: 02 96 adiw r24, 0x02 ; 2 10bfc: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 10c00: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10c04: 0e 94 8e 5a call 0xb51c ; 0xb51c 10c08: 6b 01 movw r12, r22 10c0a: 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); 10c0c: 6f ef ldi r22, 0xFF ; 255 10c0e: 87 ea ldi r24, 0xA7 ; 167 10c10: 9d e0 ldi r25, 0x0D ; 13 10c12: 0f 94 60 a1 call 0x342c0 ; 0x342c0 10c16: 20 e0 ldi r18, 0x00 ; 0 10c18: 30 e0 ldi r19, 0x00 ; 0 10c1a: 4a e7 ldi r20, 0x7A ; 122 10c1c: 54 e4 ldi r21, 0x44 ; 68 10c1e: c7 01 movw r24, r14 10c20: b6 01 movw r22, r12 10c22: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10c26: 20 e0 ldi r18, 0x00 ; 0 10c28: 30 e0 ldi r19, 0x00 ; 0 10c2a: 40 e0 ldi r20, 0x00 ; 0 10c2c: 5f e3 ldi r21, 0x3F ; 63 10c2e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10c32: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10c36: 85 ea ldi r24, 0xA5 ; 165 10c38: 9d e0 ldi r25, 0x0D ; 13 10c3a: 7c cf rjmp .-264 ; 0x10b34 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); 10c3c: 85 ea ldi r24, 0xA5 ; 165 10c3e: 9d e0 ldi r25, 0x0D ; 13 10c40: 0f 94 4a a1 call 0x34294 ; 0x34294 10c44: bc 01 movw r22, r24 10c46: 90 e0 ldi r25, 0x00 ; 0 10c48: 80 e0 ldi r24, 0x00 ; 0 10c4a: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 10c4e: 20 e0 ldi r18, 0x00 ; 0 10c50: 30 e0 ldi r19, 0x00 ; 0 10c52: 4a e7 ldi r20, 0x7A ; 122 10c54: 54 e4 ldi r21, 0x44 ; 68 10c56: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 10c5a: 0f 94 e3 41 call 0x283c6 ; 0x283c6 10c5e: 87 ce rjmp .-754 ; 0x1096e } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 10c60: d8 01 movw r26, r16 10c62: 8c 91 ld r24, X 10c64: 87 34 cpi r24, 0x47 ; 71 10c66: 11 f0 breq .+4 ; 0x10c6c 10c68: 0c 94 5b 91 jmp 0x122b6 ; 0x122b6 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 10c6c: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 10c70: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 gcode_in_progress = code_value_short(); 10c74: 0e 94 d8 55 call 0xabb0 ; 0xabb0 10c78: 90 93 58 03 sts 0x0358, r25 ; 0x800358 10c7c: 80 93 57 03 sts 0x0357, r24 ; 0x800357 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10c80: 8b 34 cpi r24, 0x4B ; 75 10c82: 91 05 cpc r25, r1 10c84: 09 f4 brne .+2 ; 0x10c88 10c86: 45 c6 rjmp .+3210 ; 0x11912 10c88: 0c f0 brlt .+2 ; 0x10c8c 10c8a: 4b c1 rjmp .+662 ; 0x10f22 10c8c: 84 30 cpi r24, 0x04 ; 4 10c8e: 91 05 cpc r25, r1 10c90: 09 f4 brne .+2 ; 0x10c94 10c92: aa c5 rjmp .+2900 ; 0x117e8 10c94: 0c f0 brlt .+2 ; 0x10c98 10c96: c5 c0 rjmp .+394 ; 0x10e22 10c98: 97 fd sbrc r25, 7 10c9a: cf c0 rjmp .+414 ; 0x10e3a 10c9c: 02 97 sbiw r24, 0x02 ; 2 10c9e: 0c f0 brlt .+2 ; 0x10ca2 10ca0: a2 c1 rjmp .+836 ; 0x10fe6 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 10ca2: 0e 94 00 55 call 0xaa00 ; 0xaa00 10ca6: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 10ca8: 0e 94 b5 5b call 0xb76a ; 0xb76a if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 10cac: 60 91 84 06 lds r22, 0x0684 ; 0x800684 10cb0: 70 91 85 06 lds r23, 0x0685 ; 0x800685 10cb4: 80 91 86 06 lds r24, 0x0686 ; 0x800686 10cb8: 90 91 87 06 lds r25, 0x0687 ; 0x800687 10cbc: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 10cc0: 6b 01 movw r12, r22 10cc2: 7c 01 movw r14, r24 10cc4: 40 90 01 12 lds r4, 0x1201 ; 0x801201 10cc8: 50 90 02 12 lds r5, 0x1202 ; 0x801202 10ccc: 60 90 03 12 lds r6, 0x1203 ; 0x801203 10cd0: 70 90 04 12 lds r7, 0x1204 ; 0x801204 10cd4: 80 90 9f 06 lds r8, 0x069F ; 0x80069f 10cd8: 90 90 a0 06 lds r9, 0x06A0 ; 0x8006a0 10cdc: a0 90 a1 06 lds r10, 0x06A1 ; 0x8006a1 10ce0: b0 90 a2 06 lds r11, 0x06A2 ; 0x8006a2 10ce4: a5 01 movw r20, r10 10ce6: 94 01 movw r18, r8 10ce8: c3 01 movw r24, r6 10cea: b2 01 movw r22, r4 10cec: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 10cf0: 20 e0 ldi r18, 0x00 ; 0 10cf2: 30 e0 ldi r19, 0x00 ; 0 10cf4: 48 ec ldi r20, 0xC8 ; 200 10cf6: 52 e4 ldi r21, 0x42 ; 66 10cf8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10cfc: 9b 01 movw r18, r22 10cfe: ac 01 movw r20, r24 10d00: c7 01 movw r24, r14 10d02: b6 01 movw r22, r12 10d04: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 10d08: 18 16 cp r1, r24 10d0a: d4 f4 brge .+52 ; 0x10d40 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 10d0c: a3 01 movw r20, r6 10d0e: 92 01 movw r18, r4 10d10: c5 01 movw r24, r10 10d12: b4 01 movw r22, r8 10d14: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 10d18: 20 e0 ldi r18, 0x00 ; 0 10d1a: 30 e0 ldi r19, 0x00 ; 0 10d1c: 48 ec ldi r20, 0xC8 ; 200 10d1e: 52 e4 ldi r21, 0x42 ; 66 10d20: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 10d24: a7 01 movw r20, r14 10d26: 96 01 movw r18, r12 10d28: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 10d2c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 10d30: 60 93 84 06 sts 0x0684, r22 ; 0x800684 10d34: 70 93 85 06 sts 0x0685, r23 ; 0x800685 10d38: 80 93 86 06 sts 0x0686, r24 ; 0x800686 10d3c: 90 93 87 06 sts 0x0687, r25 ; 0x800687 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 10d40: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 10d44: 88 23 and r24, r24 10d46: 09 f4 brne .+2 ; 0x10d4a 10d48: 46 c1 rjmp .+652 ; 0x10fd6 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 10d4a: 88 e5 ldi r24, 0x58 ; 88 10d4c: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d50: 81 11 cpse r24, r1 10d52: 41 c1 rjmp .+642 ; 0x10fd6 10d54: 89 e5 ldi r24, 0x59 ; 89 10d56: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d5a: 81 11 cpse r24, r1 10d5c: 3c c1 rjmp .+632 ; 0x10fd6 10d5e: 8a e5 ldi r24, 0x5A ; 90 10d60: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d64: 81 11 cpse r24, r1 10d66: 37 c1 rjmp .+622 ; 0x10fd6 10d68: 85 e4 ldi r24, 0x45 ; 69 10d6a: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d6e: 88 23 and r24, r24 10d70: 09 f4 brne .+2 ; 0x10d74 10d72: 31 c1 rjmp .+610 ; 0x10fd6 float echange=destination[E_AXIS]-current_position[E_AXIS]; 10d74: 20 91 01 12 lds r18, 0x1201 ; 0x801201 10d78: 30 91 02 12 lds r19, 0x1202 ; 0x801202 10d7c: 40 91 03 12 lds r20, 0x1203 ; 0x801203 10d80: 50 91 04 12 lds r21, 0x1204 ; 0x801204 10d84: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 10d88: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 10d8c: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 10d90: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 10d94: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 10d98: 6b 01 movw r12, r22 10d9a: 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 10d9c: 2d ec ldi r18, 0xCD ; 205 10d9e: 3c ec ldi r19, 0xCC ; 204 10da0: 4c ec ldi r20, 0xCC ; 204 10da2: 5d eb ldi r21, 0xBD ; 189 10da4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 10da8: 87 ff sbrs r24, 7 10daa: 07 c1 rjmp .+526 ; 0x10fba 10dac: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10db0: 81 11 cpse r24, r1 10db2: 0c 94 16 b0 jmp 0x1602c ; 0x1602c st_synchronize(); 10db6: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 10dba: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 10dbe: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 10dc2: a0 91 a1 06 lds r26, 0x06A1 ; 0x8006a1 10dc6: b0 91 a2 06 lds r27, 0x06A2 ; 0x8006a2 10dca: 80 93 01 12 sts 0x1201, r24 ; 0x801201 10dce: 90 93 02 12 sts 0x1202, r25 ; 0x801202 10dd2: a0 93 03 12 sts 0x1203, r26 ; 0x801203 10dd6: b0 93 04 12 sts 0x1204, r27 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 10dda: 81 e0 ldi r24, 0x01 ; 1 10ddc: 92 e1 ldi r25, 0x12 ; 18 10dde: 0f 94 28 76 call 0x2ec50 ; 0x2ec50 retract(!retracted[active_extruder]); 10de2: 90 91 03 05 lds r25, 0x0503 ; 0x800503 10de6: 81 e0 ldi r24, 0x01 ; 1 10de8: 89 27 eor r24, r25 10dea: 0e 94 4b be call 0x17c96 ; 0x17c96 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 10dee: cd 59 subi r28, 0x9D ; 157 10df0: df 4f sbci r29, 0xFF ; 255 10df2: 0f b6 in r0, 0x3f ; 63 10df4: f8 94 cli 10df6: de bf out 0x3e, r29 ; 62 10df8: 0f be out 0x3f, r0 ; 63 10dfa: cd bf out 0x3d, r28 ; 61 10dfc: df 91 pop r29 10dfe: cf 91 pop r28 10e00: 1f 91 pop r17 10e02: 0f 91 pop r16 10e04: ff 90 pop r15 10e06: ef 90 pop r14 10e08: df 90 pop r13 10e0a: cf 90 pop r12 10e0c: bf 90 pop r11 10e0e: af 90 pop r10 10e10: 9f 90 pop r9 10e12: 8f 90 pop r8 10e14: 7f 90 pop r7 10e16: 6f 90 pop r6 10e18: 5f 90 pop r5 10e1a: 4f 90 pop r4 10e1c: 3f 90 pop r3 10e1e: 2f 90 pop r2 10e20: 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) 10e22: 85 31 cpi r24, 0x15 ; 21 10e24: 91 05 cpc r25, r1 10e26: 09 f4 brne .+2 ; 0x10e2a 10e28: d9 c0 rjmp .+434 ; 0x10fdc 10e2a: fc f4 brge .+62 ; 0x10e6a 10e2c: 8a 30 cpi r24, 0x0A ; 10 10e2e: 91 05 cpc r25, r1 10e30: 09 f4 brne .+2 ; 0x10e34 10e32: 23 c5 rjmp .+2630 ; 0x1187a 10e34: 0b 97 sbiw r24, 0x0b ; 11 10e36: 09 f4 brne .+2 ; 0x10e3a 10e38: 24 c5 rjmp .+2632 ; 0x11882 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 10e3a: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 10e3e: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 10e42: 8f 51 subi r24, 0x1F ; 31 10e44: 90 4f sbci r25, 0xF0 ; 240 10e46: 9f 93 push r25 10e48: 8f 93 push r24 10e4a: 1f 92 push r1 10e4c: 87 e4 ldi r24, 0x47 ; 71 10e4e: 8f 93 push r24 10e50: 84 ef ldi r24, 0xF4 ; 244 10e52: 96 e6 ldi r25, 0x66 ; 102 10e54: 9f 93 push r25 10e56: 8f 93 push r24 10e58: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 10e5c: 0f 90 pop r0 10e5e: 0f 90 pop r0 10e60: 0f 90 pop r0 10e62: 0f 90 pop r0 10e64: 0f 90 pop r0 10e66: 0f 90 pop r0 10e68: b9 c0 rjmp .+370 ; 0x10fdc 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) 10e6a: 8c 31 cpi r24, 0x1C ; 28 10e6c: 91 05 cpc r25, r1 10e6e: 09 f4 brne .+2 ; 0x10e72 10e70: 0a c5 rjmp .+2580 ; 0x11886 10e72: 4e 97 sbiw r24, 0x1e ; 30 10e74: 11 f7 brne .-60 ; 0x10e3a Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 10e76: 0f 94 a0 22 call 0x24540 ; 0x24540 homing_flag = true; 10e7a: 81 e0 ldi r24, 0x01 ; 1 10e7c: 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(); 10e80: 0e 94 6f 60 call 0xc0de ; 0xc0de 10e84: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 10e86: 80 e0 ldi r24, 0x00 ; 0 10e88: 90 e0 ldi r25, 0x00 ; 0 10e8a: a8 e4 ldi r26, 0x48 ; 72 10e8c: b4 e4 ldi r27, 0x44 ; 68 10e8e: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 10e92: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 10e96: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 10e9a: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 10e9e: 43 e0 ldi r20, 0x03 ; 3 10ea0: 60 e0 ldi r22, 0x00 ; 0 10ea2: 70 e0 ldi r23, 0x00 ; 0 10ea4: 80 e2 ldi r24, 0x20 ; 32 10ea6: 91 ec ldi r25, 0xC1 ; 193 10ea8: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 10eac: 70 90 fd 11 lds r7, 0x11FD ; 0x8011fd 10eb0: 60 90 fe 11 lds r6, 0x11FE ; 0x8011fe 10eb4: 50 90 ff 11 lds r5, 0x11FF ; 0x8011ff 10eb8: 40 90 00 12 lds r4, 0x1200 ; 0x801200 10ebc: b0 90 f9 11 lds r11, 0x11F9 ; 0x8011f9 10ec0: a0 90 fa 11 lds r10, 0x11FA ; 0x8011fa 10ec4: 90 90 fb 11 lds r9, 0x11FB ; 0x8011fb 10ec8: 80 90 fc 11 lds r8, 0x11FC ; 0x8011fc 10ecc: f0 90 f5 11 lds r15, 0x11F5 ; 0x8011f5 10ed0: e0 90 f6 11 lds r14, 0x11F6 ; 0x8011f6 10ed4: d0 90 f7 11 lds r13, 0x11F7 ; 0x8011f7 10ed8: c0 90 f8 11 lds r12, 0x11F8 ; 0x8011f8 10edc: 8f e2 ldi r24, 0x2F ; 47 10ede: 96 e5 ldi r25, 0x56 ; 86 10ee0: 0e 94 32 6d call 0xda64 ; 0xda64 10ee4: 4f 92 push r4 10ee6: 5f 92 push r5 10ee8: 6f 92 push r6 10eea: 7f 92 push r7 10eec: 8f 92 push r8 10eee: 9f 92 push r9 10ef0: af 92 push r10 10ef2: bf 92 push r11 10ef4: cf 92 push r12 10ef6: df 92 push r13 10ef8: ef 92 push r14 10efa: ff 92 push r15 10efc: 9f 93 push r25 10efe: 8f 93 push r24 10f00: 8d ea ldi r24, 0xAD ; 173 10f02: 97 e6 ldi r25, 0x67 ; 103 10f04: 9f 93 push r25 10f06: 8f 93 push r24 10f08: 0f 94 fe 9f call 0x33ffc ; 0x33ffc clean_up_after_endstop_move(l_feedmultiply); 10f0c: c8 01 movw r24, r16 10f0e: 0e 94 55 60 call 0xc0aa ; 0xc0aa homing_flag = false; 10f12: 10 92 05 12 sts 0x1205, r1 ; 0x801205 10f16: 0f b6 in r0, 0x3f ; 63 10f18: f8 94 cli 10f1a: de bf out 0x3e, r29 ; 62 10f1c: 0f be out 0x3f, r0 ; 63 10f1e: cd bf out 0x3d, r28 ; 61 10f20: 5d c0 rjmp .+186 ; 0x10fdc 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) 10f22: 88 35 cpi r24, 0x58 ; 88 10f24: 91 05 cpc r25, r1 10f26: 09 f4 brne .+2 ; 0x10f2a 10f28: 59 c0 rjmp .+178 ; 0x10fdc 10f2a: f4 f4 brge .+60 ; 0x10f68 10f2c: 81 35 cpi r24, 0x51 ; 81 10f2e: 91 05 cpc r25, r1 10f30: 11 f4 brne .+4 ; 0x10f36 10f32: 0c 94 a1 90 jmp 0x12142 ; 0x12142 10f36: 5c f4 brge .+22 ; 0x10f4e 10f38: 8c 34 cpi r24, 0x4C ; 76 10f3a: 91 05 cpc r25, r1 10f3c: 09 f4 brne .+2 ; 0x10f40 10f3e: 0c c5 rjmp .+2584 ; 0x11958 10f40: 80 35 cpi r24, 0x50 ; 80 10f42: 91 05 cpc r25, r1 10f44: 09 f0 breq .+2 ; 0x10f48 10f46: 79 cf rjmp .-270 ; 0x10e3a - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 10f48: 0e 94 8d 7e call 0xfd1a ; 0xfd1a 10f4c: 47 c0 rjmp .+142 ; 0x10fdc 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) 10f4e: 86 35 cpi r24, 0x56 ; 86 10f50: 91 05 cpc r25, r1 10f52: 11 f4 brne .+4 ; 0x10f58 10f54: 0c 94 a5 90 jmp 0x1214a ; 0x1214a 10f58: 87 35 cpi r24, 0x57 ; 87 10f5a: 91 05 cpc r25, r1 10f5c: 09 f0 breq .+2 ; 0x10f60 10f5e: 6d cf rjmp .-294 ; 0x10e3a This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 10f60: 80 e1 ldi r24, 0x10 ; 16 10f62: 0e 94 7d c6 call 0x18cfa ; 0x18cfa 10f66: 3a c0 rjmp .+116 ; 0x10fdc 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) 10f68: 8c 35 cpi r24, 0x5C ; 92 10f6a: 91 05 cpc r25, r1 10f6c: 11 f4 brne .+4 ; 0x10f72 10f6e: 0c 94 b1 90 jmp 0x12162 ; 0x12162 10f72: 74 f4 brge .+28 ; 0x10f90 10f74: 8a 35 cpi r24, 0x5A ; 90 10f76: 91 05 cpc r25, r1 10f78: 11 f4 brne .+4 ; 0x10f7e 10f7a: 0c 94 aa 90 jmp 0x12154 ; 0x12154 10f7e: 8b 35 cpi r24, 0x5B ; 91 10f80: 91 05 cpc r25, r1 10f82: 09 f0 breq .+2 ; 0x10f86 10f84: 5a cf rjmp .-332 ; 0x10e3a /*! ### 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; 10f86: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 10f8a: 87 60 ori r24, 0x07 ; 7 10f8c: 0c 94 ad 90 jmp 0x1215a ; 0x1215a 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) 10f90: 82 36 cpi r24, 0x62 ; 98 10f92: 91 05 cpc r25, r1 10f94: 11 f4 brne .+4 ; 0x10f9a 10f96: 0c 94 48 91 jmp 0x12290 ; 0x12290 10f9a: 83 36 cpi r24, 0x63 ; 99 10f9c: 91 05 cpc r25, r1 10f9e: 09 f0 breq .+2 ; 0x10fa2 10fa0: 4c cf rjmp .-360 ; 0x10e3a lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 10fa2: 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); 10fa6: 60 e0 ldi r22, 0x00 ; 0 10fa8: 84 ec ldi r24, 0xC4 ; 196 10faa: 9f e0 ldi r25, 0x0F ; 15 10fac: 0f 94 60 a1 call 0x342c0 ; 0x342c0 fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 10fb0: 82 e0 ldi r24, 0x02 ; 2 10fb2: 0e 94 c3 69 call 0xd386 ; 0xd386 10fb6: 0c 94 57 91 jmp 0x122ae ; 0x122ae #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 10fba: 2d ec ldi r18, 0xCD ; 205 10fbc: 3c ec ldi r19, 0xCC ; 204 10fbe: 4c ec ldi r20, 0xCC ; 204 10fc0: 5d e3 ldi r21, 0x3D ; 61 10fc2: c7 01 movw r24, r14 10fc4: b6 01 movw r22, r12 10fc6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 10fca: 18 16 cp r1, r24 10fcc: 24 f4 brge .+8 ; 0x10fd6 10fce: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10fd2: 81 11 cpse r24, r1 10fd4: f0 ce rjmp .-544 ; 0x10db6 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 10fd6: c8 01 movw r24, r16 10fd8: 0e 94 85 65 call 0xcb0a ; 0xcb0a #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; 10fdc: 10 92 58 03 sts 0x0358, r1 ; 0x800358 10fe0: 10 92 57 03 sts 0x0357, r1 ; 0x800357 10fe4: c4 cc rjmp .-1656 ; 0x1096e */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 10fe6: 0e 94 00 55 call 0xaa00 ; 0xaa00 10fea: 2e 96 adiw r28, 0x0e ; 14 10fec: 9f af std Y+63, r25 ; 0x3f 10fee: 8e af std Y+62, r24 ; 0x3e 10ff0: 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 10ff2: 0e 94 b5 5b call 0xb76a ; 0xb76a #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 10ff6: 89 e4 ldi r24, 0x49 ; 73 10ff8: 0e 94 b6 55 call 0xab6c ; 0xab6c 10ffc: 88 23 and r24, r24 10ffe: 09 f4 brne .+2 ; 0x11002 11000: a0 c3 rjmp .+1856 ; 0x11742 11002: 0e 94 8e 5a call 0xb51c ; 0xb51c 11006: 60 93 4f 03 sts 0x034F, r22 ; 0x80034f 1100a: 70 93 50 03 sts 0x0350, r23 ; 0x800350 1100e: 80 93 51 03 sts 0x0351, r24 ; 0x800351 11012: 90 93 52 03 sts 0x0352, r25 ; 0x800352 offset[1] = code_seen('J') ? code_value() : 0.f; 11016: 8a e4 ldi r24, 0x4A ; 74 11018: 0e 94 b6 55 call 0xab6c ; 0xab6c 1101c: c1 2c mov r12, r1 1101e: d1 2c mov r13, r1 11020: 76 01 movw r14, r12 11022: 88 23 and r24, r24 11024: 21 f0 breq .+8 ; 0x1102e 11026: 0e 94 8e 5a call 0xb51c ; 0xb51c 1102a: 6b 01 movw r12, r22 1102c: 7c 01 movw r14, r24 1102e: c0 92 53 03 sts 0x0353, r12 ; 0x800353 11032: d0 92 54 03 sts 0x0354, r13 ; 0x800354 11036: e0 92 55 03 sts 0x0355, r14 ; 0x800355 1103a: f0 92 56 03 sts 0x0356, r15 ; 0x800356 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1103e: e0 91 57 03 lds r30, 0x0357 ; 0x800357 11042: f0 91 58 03 lds r31, 0x0358 ; 0x800358 11046: a4 96 adiw r28, 0x24 ; 36 11048: ff af std Y+63, r31 ; 0x3f 1104a: ee af std Y+62, r30 ; 0x3e 1104c: 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 1104e: 80 90 4f 03 lds r8, 0x034F ; 0x80034f 11052: 90 90 50 03 lds r9, 0x0350 ; 0x800350 11056: a0 90 51 03 lds r10, 0x0351 ; 0x800351 1105a: b0 90 52 03 lds r11, 0x0352 ; 0x800352 1105e: a7 01 movw r20, r14 11060: 96 01 movw r18, r12 11062: c5 01 movw r24, r10 11064: b4 01 movw r22, r8 11066: 0f 94 00 a5 call 0x34a00 ; 0x34a00 1106a: 24 96 adiw r28, 0x04 ; 4 1106c: 6c af std Y+60, r22 ; 0x3c 1106e: 7d af std Y+61, r23 ; 0x3d 11070: 8e af std Y+62, r24 ; 0x3e 11072: 9f af std Y+63, r25 ; 0x3f 11074: 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); 11076: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 1107a: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 1107e: 07 2e mov r0, r23 11080: 00 0c add r0, r0 11082: 88 0b sbc r24, r24 11084: 99 0b sbc r25, r25 11086: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1108a: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 1108e: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 11092: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 11096: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 1109a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1109e: 2e e3 ldi r18, 0x3E ; 62 110a0: 33 ec ldi r19, 0xC3 ; 195 110a2: 4e e2 ldi r20, 0x2E ; 46 110a4: 59 e3 ldi r21, 0x39 ; 57 110a6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 110aa: 68 af std Y+56, r22 ; 0x38 110ac: 79 af std Y+57, r23 ; 0x39 110ae: 8a af std Y+58, r24 ; 0x3a 110b0: 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)); 110b2: 80 e1 ldi r24, 0x10 ; 16 110b4: e5 ef ldi r30, 0xF5 ; 245 110b6: f1 e1 ldi r31, 0x11 ; 17 110b8: de 01 movw r26, r28 110ba: 11 96 adiw r26, 0x01 ; 1 110bc: 01 90 ld r0, Z+ 110be: 0d 92 st X+, r0 110c0: 8a 95 dec r24 110c2: e1 f7 brne .-8 ; 0x110bc float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 110c4: a5 01 movw r20, r10 110c6: 94 01 movw r18, r8 110c8: 50 58 subi r21, 0x80 ; 128 110ca: 28 a7 std Y+40, r18 ; 0x28 110cc: 39 a7 std Y+41, r19 ; 0x29 110ce: 4a a7 std Y+42, r20 ; 0x2a 110d0: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 110d2: d7 01 movw r26, r14 110d4: c6 01 movw r24, r12 110d6: b0 58 subi r27, 0x80 ; 128 110d8: 8c a7 std Y+44, r24 ; 0x2c 110da: 9d a7 std Y+45, r25 ; 0x2d 110dc: ae a7 std Y+46, r26 ; 0x2e 110de: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 110e0: 29 81 ldd r18, Y+1 ; 0x01 110e2: 3a 81 ldd r19, Y+2 ; 0x02 110e4: 4b 81 ldd r20, Y+3 ; 0x03 110e6: 5c 81 ldd r21, Y+4 ; 0x04 110e8: 28 96 adiw r28, 0x08 ; 8 110ea: 2c af std Y+60, r18 ; 0x3c 110ec: 3d af std Y+61, r19 ; 0x3d 110ee: 4e af std Y+62, r20 ; 0x3e 110f0: 5f af std Y+63, r21 ; 0x3f 110f2: 28 97 sbiw r28, 0x08 ; 8 110f4: c5 01 movw r24, r10 110f6: b4 01 movw r22, r8 110f8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 110fc: 62 96 adiw r28, 0x12 ; 18 110fe: 6c af std Y+60, r22 ; 0x3c 11100: 7d af std Y+61, r23 ; 0x3d 11102: 8e af std Y+62, r24 ; 0x3e 11104: 9f af std Y+63, r25 ; 0x3f 11106: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 11108: 8d 81 ldd r24, Y+5 ; 0x05 1110a: 9e 81 ldd r25, Y+6 ; 0x06 1110c: af 81 ldd r26, Y+7 ; 0x07 1110e: b8 85 ldd r27, Y+8 ; 0x08 11110: 2c 96 adiw r28, 0x0c ; 12 11112: 8c af std Y+60, r24 ; 0x3c 11114: 9d af std Y+61, r25 ; 0x3d 11116: ae af std Y+62, r26 ; 0x3e 11118: bf af std Y+63, r27 ; 0x3f 1111a: 2c 97 sbiw r28, 0x0c ; 12 1111c: 9c 01 movw r18, r24 1111e: ad 01 movw r20, r26 11120: c7 01 movw r24, r14 11122: b6 01 movw r22, r12 11124: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11128: 66 96 adiw r28, 0x16 ; 22 1112a: 6c af std Y+60, r22 ; 0x3c 1112c: 7d af std Y+61, r23 ; 0x3d 1112e: 8e af std Y+62, r24 ; 0x3e 11130: 9f af std Y+63, r25 ; 0x3f 11132: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 11134: 29 85 ldd r18, Y+9 ; 0x09 11136: 3a 85 ldd r19, Y+10 ; 0x0a 11138: 4b 85 ldd r20, Y+11 ; 0x0b 1113a: 5c 85 ldd r21, Y+12 ; 0x0c 1113c: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 11140: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 11144: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 11148: 90 91 9e 06 lds r25, 0x069E ; 0x80069e 1114c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 11150: 6a 96 adiw r28, 0x1a ; 26 11152: 6c af std Y+60, r22 ; 0x3c 11154: 7d af std Y+61, r23 ; 0x3d 11156: 8e af std Y+62, r24 ; 0x3e 11158: 9f af std Y+63, r25 ; 0x3f 1115a: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 1115c: 20 91 93 06 lds r18, 0x0693 ; 0x800693 11160: 30 91 94 06 lds r19, 0x0694 ; 0x800694 11164: 40 91 95 06 lds r20, 0x0695 ; 0x800695 11168: 50 91 96 06 lds r21, 0x0696 ; 0x800696 1116c: 6e 96 adiw r28, 0x1e ; 30 1116e: 2c af std Y+60, r18 ; 0x3c 11170: 3d af std Y+61, r19 ; 0x3d 11172: 4e af std Y+62, r20 ; 0x3e 11174: 5f af std Y+63, r21 ; 0x3f 11176: 6e 97 sbiw r28, 0x1e ; 30 11178: 62 96 adiw r28, 0x12 ; 18 1117a: 2c ad ldd r18, Y+60 ; 0x3c 1117c: 3d ad ldd r19, Y+61 ; 0x3d 1117e: 4e ad ldd r20, Y+62 ; 0x3e 11180: 5f ad ldd r21, Y+63 ; 0x3f 11182: 62 97 sbiw r28, 0x12 ; 18 11184: 6e 96 adiw r28, 0x1e ; 30 11186: 6c ad ldd r22, Y+60 ; 0x3c 11188: 7d ad ldd r23, Y+61 ; 0x3d 1118a: 8e ad ldd r24, Y+62 ; 0x3e 1118c: 9f ad ldd r25, Y+63 ; 0x3f 1118e: 6e 97 sbiw r28, 0x1e ; 30 11190: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 11194: 6b 01 movw r12, r22 11196: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 11198: 80 91 97 06 lds r24, 0x0697 ; 0x800697 1119c: 90 91 98 06 lds r25, 0x0698 ; 0x800698 111a0: a0 91 99 06 lds r26, 0x0699 ; 0x800699 111a4: b0 91 9a 06 lds r27, 0x069A ; 0x80069a 111a8: a2 96 adiw r28, 0x22 ; 34 111aa: 8c af std Y+60, r24 ; 0x3c 111ac: 9d af std Y+61, r25 ; 0x3d 111ae: ae af std Y+62, r26 ; 0x3e 111b0: bf af std Y+63, r27 ; 0x3f 111b2: a2 97 sbiw r28, 0x22 ; 34 111b4: 66 96 adiw r28, 0x16 ; 22 111b6: 2c ad ldd r18, Y+60 ; 0x3c 111b8: 3d ad ldd r19, Y+61 ; 0x3d 111ba: 4e ad ldd r20, Y+62 ; 0x3e 111bc: 5f ad ldd r21, Y+63 ; 0x3f 111be: 66 97 sbiw r28, 0x16 ; 22 111c0: bc 01 movw r22, r24 111c2: cd 01 movw r24, r26 111c4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 111c8: 4b 01 movw r8, r22 111ca: 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; 111cc: 30 90 f6 04 lds r3, 0x04F6 ; 0x8004f6 111d0: 20 90 f7 04 lds r2, 0x04F7 ; 0x8004f7 111d4: 90 91 f8 04 lds r25, 0x04F8 ; 0x8004f8 111d8: 9c ab std Y+52, r25 ; 0x34 111da: a0 91 f9 04 lds r26, 0x04F9 ; 0x8004f9 111de: 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; 111e0: b0 91 fe 04 lds r27, 0x04FE ; 0x8004fe 111e4: 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); 111e6: a7 01 movw r20, r14 111e8: 96 01 movw r18, r12 111ea: 68 a5 ldd r22, Y+40 ; 0x28 111ec: 79 a5 ldd r23, Y+41 ; 0x29 111ee: 8a a5 ldd r24, Y+42 ; 0x2a 111f0: 9b a5 ldd r25, Y+43 ; 0x2b 111f2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 111f6: 2b 01 movw r4, r22 111f8: 3c 01 movw r6, r24 111fa: a5 01 movw r20, r10 111fc: 94 01 movw r18, r8 111fe: 6c a5 ldd r22, Y+44 ; 0x2c 11200: 7d a5 ldd r23, Y+45 ; 0x2d 11202: 8e a5 ldd r24, Y+46 ; 0x2e 11204: 9f a5 ldd r25, Y+47 ; 0x2f 11206: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1120a: 9b 01 movw r18, r22 1120c: ac 01 movw r20, r24 1120e: c3 01 movw r24, r6 11210: b2 01 movw r22, r4 11212: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11216: 2b 01 movw r4, r22 11218: 3c 01 movw r6, r24 1121a: a5 01 movw r20, r10 1121c: 94 01 movw r18, r8 1121e: 68 a5 ldd r22, Y+40 ; 0x28 11220: 79 a5 ldd r23, Y+41 ; 0x29 11222: 8a a5 ldd r24, Y+42 ; 0x2a 11224: 9b a5 ldd r25, Y+43 ; 0x2b 11226: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1122a: 4b 01 movw r8, r22 1122c: 5c 01 movw r10, r24 1122e: a7 01 movw r20, r14 11230: 96 01 movw r18, r12 11232: 6c a5 ldd r22, Y+44 ; 0x2c 11234: 7d a5 ldd r23, Y+45 ; 0x2d 11236: 8e a5 ldd r24, Y+46 ; 0x2e 11238: 9f a5 ldd r25, Y+47 ; 0x2f 1123a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1123e: 9b 01 movw r18, r22 11240: ac 01 movw r20, r24 11242: c5 01 movw r24, r10 11244: b4 01 movw r22, r8 11246: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1124a: a3 01 movw r20, r6 1124c: 92 01 movw r18, r4 1124e: 0f 94 e3 a2 call 0x345c6 ; 0x345c6 11252: 6b 01 movw r12, r22 11254: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 11256: 20 e0 ldi r18, 0x00 ; 0 11258: 30 e0 ldi r19, 0x00 ; 0 1125a: a9 01 movw r20, r18 1125c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 11260: 87 ff sbrs r24, 7 11262: 0a c0 rjmp .+20 ; 0x11278 11264: 2b ed ldi r18, 0xDB ; 219 11266: 3f e0 ldi r19, 0x0F ; 15 11268: 49 ec ldi r20, 0xC9 ; 201 1126a: 50 e4 ldi r21, 0x40 ; 64 1126c: c7 01 movw r24, r14 1126e: b6 01 movw r22, r12 11270: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11274: 6b 01 movw r12, r22 11276: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 11278: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 1127c: 70 91 00 05 lds r23, 0x0500 ; 0x800500 11280: 61 15 cp r22, r1 11282: 71 05 cpc r23, r1 11284: 09 f4 brne .+2 ; 0x11288 11286: 61 c2 rjmp .+1218 ; 0x1174a { // 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); 11288: 90 e0 ldi r25, 0x00 ; 0 1128a: 80 e0 ldi r24, 0x00 ; 0 1128c: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 11290: 9b 01 movw r18, r22 11292: ac 01 movw r20, r24 11294: 6b ed ldi r22, 0xDB ; 219 11296: 7f e0 ldi r23, 0x0F ; 15 11298: 89 ec ldi r24, 0xC9 ; 201 1129a: 90 e4 ldi r25, 0x40 ; 64 1129c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 112a0: 24 96 adiw r28, 0x04 ; 4 112a2: 2c ad ldd r18, Y+60 ; 0x3c 112a4: 3d ad ldd r19, Y+61 ; 0x3d 112a6: 4e ad ldd r20, Y+62 ; 0x3e 112a8: 5f ad ldd r21, Y+63 ; 0x3f 112aa: 24 97 sbiw r28, 0x04 ; 4 112ac: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 112b0: 5b 01 movw r10, r22 112b2: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 112b4: 60 91 01 05 lds r22, 0x0501 ; 0x800501 112b8: 70 91 02 05 lds r23, 0x0502 ; 0x800502 112bc: 61 15 cp r22, r1 112be: 71 05 cpc r23, r1 112c0: e1 f0 breq .+56 ; 0x112fa { // 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)); 112c2: 90 e0 ldi r25, 0x00 ; 0 112c4: 80 e0 ldi r24, 0x00 ; 0 112c6: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 112ca: 20 e0 ldi r18, 0x00 ; 0 112cc: 30 e0 ldi r19, 0x00 ; 0 112ce: 40 e7 ldi r20, 0x70 ; 112 112d0: 52 e4 ldi r21, 0x42 ; 66 112d2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 112d6: 9b 01 movw r18, r22 112d8: ac 01 movw r20, r24 112da: 68 ad ldd r22, Y+56 ; 0x38 112dc: 79 ad ldd r23, Y+57 ; 0x39 112de: 8a ad ldd r24, Y+58 ; 0x3a 112e0: 9b ad ldd r25, Y+59 ; 0x3b 112e2: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 112e6: 3b 01 movw r6, r22 112e8: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 112ea: 95 01 movw r18, r10 112ec: a8 01 movw r20, r16 112ee: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 112f2: 87 ff sbrs r24, 7 112f4: 02 c0 rjmp .+4 ; 0x112fa mm_per_arc_segment = mm_per_arc_segment_sec; 112f6: 53 01 movw r10, r6 112f8: 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) 112fa: 40 90 fa 04 lds r4, 0x04FA ; 0x8004fa 112fe: 50 90 fb 04 lds r5, 0x04FB ; 0x8004fb 11302: 60 90 fc 04 lds r6, 0x04FC ; 0x8004fc 11306: 70 90 fd 04 lds r7, 0x04FD ; 0x8004fd 1130a: 95 01 movw r18, r10 1130c: a8 01 movw r20, r16 1130e: b2 01 movw r22, r4 11310: c3 01 movw r24, r6 11312: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 11316: 18 16 cp r1, r24 11318: 84 f0 brlt .+32 ; 0x1133a { // 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) { 1131a: 95 01 movw r18, r10 1131c: a8 01 movw r20, r16 1131e: 63 2d mov r22, r3 11320: 72 2d mov r23, r2 11322: 8c a9 ldd r24, Y+52 ; 0x34 11324: 9c ad ldd r25, Y+60 ; 0x3c 11326: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1132a: 25 01 movw r4, r10 1132c: 38 01 movw r6, r16 1132e: 87 ff sbrs r24, 7 11330: 04 c0 rjmp .+8 ; 0x1133a // 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; 11332: 43 2c mov r4, r3 11334: 52 2c mov r5, r2 11336: 6c a8 ldd r6, Y+52 ; 0x34 11338: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 1133a: a4 96 adiw r28, 0x24 ; 36 1133c: ee ad ldd r30, Y+62 ; 0x3e 1133e: ff ad ldd r31, Y+63 ; 0x3f 11340: a4 97 sbiw r28, 0x24 ; 36 11342: 32 97 sbiw r30, 0x02 ; 2 11344: 51 f4 brne .+20 ; 0x1135a 11346: 2b ed ldi r18, 0xDB ; 219 11348: 3f e0 ldi r19, 0x0F ; 15 1134a: 49 ec ldi r20, 0xC9 ; 201 1134c: 50 e4 ldi r21, 0x40 ; 64 1134e: c7 01 movw r24, r14 11350: b6 01 movw r22, r12 11352: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 11356: 6b 01 movw r12, r22 11358: 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) 1135a: 6e 96 adiw r28, 0x1e ; 30 1135c: 2c ad ldd r18, Y+60 ; 0x3c 1135e: 3d ad ldd r19, Y+61 ; 0x3d 11360: 4e ad ldd r20, Y+62 ; 0x3e 11362: 5f ad ldd r21, Y+63 ; 0x3f 11364: 6e 97 sbiw r28, 0x1e ; 30 11366: 28 96 adiw r28, 0x08 ; 8 11368: 6c ad ldd r22, Y+60 ; 0x3c 1136a: 7d ad ldd r23, Y+61 ; 0x3d 1136c: 8e ad ldd r24, Y+62 ; 0x3e 1136e: 9f ad ldd r25, Y+63 ; 0x3f 11370: 28 97 sbiw r28, 0x08 ; 8 11372: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 11376: 81 11 cpse r24, r1 11378: 23 c0 rjmp .+70 ; 0x113c0 1137a: a2 96 adiw r28, 0x22 ; 34 1137c: 2c ad ldd r18, Y+60 ; 0x3c 1137e: 3d ad ldd r19, Y+61 ; 0x3d 11380: 4e ad ldd r20, Y+62 ; 0x3e 11382: 5f ad ldd r21, Y+63 ; 0x3f 11384: a2 97 sbiw r28, 0x22 ; 34 11386: 2c 96 adiw r28, 0x0c ; 12 11388: 6c ad ldd r22, Y+60 ; 0x3c 1138a: 7d ad ldd r23, Y+61 ; 0x3d 1138c: 8e ad ldd r24, Y+62 ; 0x3e 1138e: 9f ad ldd r25, Y+63 ; 0x3f 11390: 2c 97 sbiw r28, 0x0c ; 12 11392: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 11396: 81 11 cpse r24, r1 11398: 13 c0 rjmp .+38 ; 0x113c0 1139a: 20 e0 ldi r18, 0x00 ; 0 1139c: 30 e0 ldi r19, 0x00 ; 0 1139e: a9 01 movw r20, r18 113a0: c7 01 movw r24, r14 113a2: b6 01 movw r22, r12 113a4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 113a8: 81 11 cpse r24, r1 113aa: 0a c0 rjmp .+20 ; 0x113c0 { angular_travel_total += 2 * M_PI; 113ac: 2b ed ldi r18, 0xDB ; 219 113ae: 3f e0 ldi r19, 0x0F ; 15 113b0: 49 ec ldi r20, 0xC9 ; 201 113b2: 50 e4 ldi r21, 0x40 ; 64 113b4: c7 01 movw r24, r14 113b6: b6 01 movw r22, r12 113b8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 113bc: 6b 01 movw r12, r22 113be: 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)); 113c0: a7 01 movw r20, r14 113c2: 96 01 movw r18, r12 113c4: 24 96 adiw r28, 0x04 ; 4 113c6: 6c ad ldd r22, Y+60 ; 0x3c 113c8: 7d ad ldd r23, Y+61 ; 0x3d 113ca: 8e ad ldd r24, Y+62 ; 0x3e 113cc: 9f ad ldd r25, Y+63 ; 0x3f 113ce: 24 97 sbiw r28, 0x04 ; 4 113d0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 113d4: 6a 96 adiw r28, 0x1a ; 26 113d6: 2c ad ldd r18, Y+60 ; 0x3c 113d8: 3d ad ldd r19, Y+61 ; 0x3d 113da: 4e ad ldd r20, Y+62 ; 0x3e 113dc: 5f ad ldd r21, Y+63 ; 0x3f 113de: 6a 97 sbiw r28, 0x1a ; 26 113e0: 0f 94 00 a5 call 0x34a00 ; 0x34a00 113e4: 4b 01 movw r8, r22 113e6: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 113e8: 2f e6 ldi r18, 0x6F ; 111 113ea: 32 e1 ldi r19, 0x12 ; 18 113ec: 43 e8 ldi r20, 0x83 ; 131 113ee: 5a e3 ldi r21, 0x3A ; 58 113f0: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 113f4: 87 fd sbrc r24, 7 113f6: 9e c1 rjmp .+828 ; 0x11734 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 113f8: 92 01 movw r18, r4 113fa: a3 01 movw r20, r6 113fc: c5 01 movw r24, r10 113fe: b4 01 movw r22, r8 11400: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 11404: 0f 94 42 a3 call 0x34684 ; 0x34684 11408: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 1140c: 7d ab std Y+53, r23 ; 0x35 1140e: 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) 11410: 62 30 cpi r22, 0x02 ; 2 11412: 71 05 cpc r23, r1 11414: 08 f4 brcc .+2 ; 0x11418 11416: 5e c1 rjmp .+700 ; 0x116d4 11418: 2e 96 adiw r28, 0x0e ; 14 1141a: 4e ad ldd r20, Y+62 ; 0x3e 1141c: 5f ad ldd r21, Y+63 ; 0x3f 1141e: 2e 97 sbiw r28, 0x0e ; 14 11420: 45 2b or r20, r21 11422: 09 f4 brne .+2 ; 0x11426 11424: 57 c1 rjmp .+686 ; 0x116d4 { // 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, 11426: 90 e0 ldi r25, 0x00 ; 0 11428: 80 e0 ldi r24, 0x00 ; 0 1142a: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 1142e: 4b 01 movw r8, r22 11430: 5c 01 movw r10, r24 11432: ac 01 movw r20, r24 11434: 9b 01 movw r18, r22 11436: c7 01 movw r24, r14 11438: b6 01 movw r22, r12 1143a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1143e: 2b 01 movw r4, r22 11440: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 11442: a5 01 movw r20, r10 11444: 94 01 movw r18, r8 11446: 6a 96 adiw r28, 0x1a ; 26 11448: 6c ad ldd r22, Y+60 ; 0x3c 1144a: 7d ad ldd r23, Y+61 ; 0x3d 1144c: 8e ad ldd r24, Y+62 ; 0x3e 1144e: 9f ad ldd r25, Y+63 ; 0x3f 11450: 6a 97 sbiw r28, 0x1a ; 26 11452: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 11456: 28 96 adiw r28, 0x08 ; 8 11458: 6c af std Y+60, r22 ; 0x3c 1145a: 7d af std Y+61, r23 ; 0x3d 1145c: 8e af std Y+62, r24 ; 0x3e 1145e: 9f af std Y+63, r25 ; 0x3f 11460: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 11462: 2d 85 ldd r18, Y+13 ; 0x0d 11464: 3e 85 ldd r19, Y+14 ; 0x0e 11466: 4f 85 ldd r20, Y+15 ; 0x0f 11468: 58 89 ldd r21, Y+16 ; 0x10 1146a: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 1146e: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 11472: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 11476: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 1147a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1147e: a5 01 movw r20, r10 11480: 94 01 movw r18, r8 11482: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 11486: 2c 96 adiw r28, 0x0c ; 12 11488: 6c af std Y+60, r22 ; 0x3c 1148a: 7d af std Y+61, r23 ; 0x3d 1148c: 8e af std Y+62, r24 ; 0x3e 1148e: 9f af std Y+63, r25 ; 0x3f 11490: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 11492: a3 01 movw r20, r6 11494: 92 01 movw r18, r4 11496: c3 01 movw r24, r6 11498: b2 01 movw r22, r4 1149a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1149e: 6b 01 movw r12, r22 114a0: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 114a2: ac 01 movw r20, r24 114a4: 9b 01 movw r18, r22 114a6: c3 01 movw r24, r6 114a8: b2 01 movw r22, r4 114aa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 114ae: 20 e0 ldi r18, 0x00 ; 0 114b0: 30 e0 ldi r19, 0x00 ; 0 114b2: 40 ec ldi r20, 0xC0 ; 192 114b4: 50 e4 ldi r21, 0x40 ; 64 114b6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 114ba: 9b 01 movw r18, r22 114bc: ac 01 movw r20, r24 114be: c3 01 movw r24, r6 114c0: b2 01 movw r22, r4 114c2: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 114c6: 6c af std Y+60, r22 ; 0x3c 114c8: 7d af std Y+61, r23 ; 0x3d 114ca: 8e af std Y+62, r24 ; 0x3e 114cc: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 114ce: 20 e0 ldi r18, 0x00 ; 0 114d0: 30 e0 ldi r19, 0x00 ; 0 114d2: 40 e0 ldi r20, 0x00 ; 0 114d4: 5f e3 ldi r21, 0x3F ; 63 114d6: c7 01 movw r24, r14 114d8: b6 01 movw r22, r12 114da: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 114de: 9b 01 movw r18, r22 114e0: ac 01 movw r20, r24 114e2: 60 e0 ldi r22, 0x00 ; 0 114e4: 70 e0 ldi r23, 0x00 ; 0 114e6: 80 e8 ldi r24, 0x80 ; 128 114e8: 9f e3 ldi r25, 0x3F ; 63 114ea: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 114ee: 24 96 adiw r28, 0x04 ; 4 114f0: 6c af std Y+60, r22 ; 0x3c 114f2: 7d af std Y+61, r23 ; 0x3d 114f4: 8e af std Y+62, r24 ; 0x3e 114f6: 9f af std Y+63, r25 ; 0x3f 114f8: 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++) { 114fa: 22 24 eor r2, r2 114fc: 23 94 inc r2 114fe: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 11500: d8 a8 ldd r13, Y+48 ; 0x30 11502: da 94 dec r13 11504: 58 a9 ldd r21, Y+48 ; 0x30 11506: 51 11 cpse r21, r1 11508: 25 c1 rjmp .+586 ; 0x11754 // 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); 1150a: b1 01 movw r22, r2 1150c: 90 e0 ldi r25, 0x00 ; 0 1150e: 80 e0 ldi r24, 0x00 ; 0 11510: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 11514: a3 01 movw r20, r6 11516: 92 01 movw r18, r4 11518: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1151c: 6b 01 movw r12, r22 1151e: 7c 01 movw r14, r24 11520: 0f 94 5e a3 call 0x346bc ; 0x346bc 11524: 6c a7 std Y+44, r22 ; 0x2c 11526: 7d a7 std Y+45, r23 ; 0x2d 11528: 8e a7 std Y+46, r24 ; 0x2e 1152a: 9f a7 std Y+47, r25 ; 0x2f 1152c: c7 01 movw r24, r14 1152e: b6 01 movw r22, r12 11530: 0f 94 24 a6 call 0x34c48 ; 0x34c48 11534: 4b 01 movw r8, r22 11536: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 11538: c0 90 4f 03 lds r12, 0x034F ; 0x80034f 1153c: d0 90 50 03 lds r13, 0x0350 ; 0x800350 11540: e0 90 51 03 lds r14, 0x0351 ; 0x800351 11544: f0 90 52 03 lds r15, 0x0352 ; 0x800352 11548: f7 fa bst r15, 7 1154a: f0 94 com r15 1154c: f7 f8 bld r15, 7 1154e: f0 94 com r15 11550: 80 91 53 03 lds r24, 0x0353 ; 0x800353 11554: 90 91 54 03 lds r25, 0x0354 ; 0x800354 11558: a0 91 55 03 lds r26, 0x0355 ; 0x800355 1155c: b0 91 56 03 lds r27, 0x0356 ; 0x800356 11560: 88 ab std Y+48, r24 ; 0x30 11562: 99 ab std Y+49, r25 ; 0x31 11564: aa ab std Y+50, r26 ; 0x32 11566: bb ab std Y+51, r27 ; 0x33 11568: a7 01 movw r20, r14 1156a: 96 01 movw r18, r12 1156c: 6c a5 ldd r22, Y+44 ; 0x2c 1156e: 7d a5 ldd r23, Y+45 ; 0x2d 11570: 8e a5 ldd r24, Y+46 ; 0x2e 11572: 9f a5 ldd r25, Y+47 ; 0x2f 11574: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 11578: 68 a7 std Y+40, r22 ; 0x28 1157a: 79 a7 std Y+41, r23 ; 0x29 1157c: 8a a7 std Y+42, r24 ; 0x2a 1157e: 9b a7 std Y+43, r25 ; 0x2b 11580: 28 a9 ldd r18, Y+48 ; 0x30 11582: 39 a9 ldd r19, Y+49 ; 0x31 11584: 4a a9 ldd r20, Y+50 ; 0x32 11586: 5b a9 ldd r21, Y+51 ; 0x33 11588: c5 01 movw r24, r10 1158a: b4 01 movw r22, r8 1158c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 11590: 9b 01 movw r18, r22 11592: ac 01 movw r20, r24 11594: 68 a5 ldd r22, Y+40 ; 0x28 11596: 79 a5 ldd r23, Y+41 ; 0x29 11598: 8a a5 ldd r24, Y+42 ; 0x2a 1159a: 9b a5 ldd r25, Y+43 ; 0x2b 1159c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 115a0: 68 a7 std Y+40, r22 ; 0x28 115a2: 79 a7 std Y+41, r23 ; 0x29 115a4: 8a a7 std Y+42, r24 ; 0x2a 115a6: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 115a8: a7 01 movw r20, r14 115aa: 96 01 movw r18, r12 115ac: c5 01 movw r24, r10 115ae: b4 01 movw r22, r8 115b0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 115b4: 6b 01 movw r12, r22 115b6: 7c 01 movw r14, r24 115b8: 28 a9 ldd r18, Y+48 ; 0x30 115ba: 39 a9 ldd r19, Y+49 ; 0x31 115bc: 4a a9 ldd r20, Y+50 ; 0x32 115be: 5b a9 ldd r21, Y+51 ; 0x33 115c0: 6c a5 ldd r22, Y+44 ; 0x2c 115c2: 7d a5 ldd r23, Y+45 ; 0x2d 115c4: 8e a5 ldd r24, Y+46 ; 0x2e 115c6: 9f a5 ldd r25, Y+47 ; 0x2f 115c8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 115cc: 9b 01 movw r18, r22 115ce: ac 01 movw r20, r24 115d0: c7 01 movw r24, r14 115d2: b6 01 movw r22, r12 115d4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 115d8: 6c a7 std Y+44, r22 ; 0x2c 115da: 7d a7 std Y+45, r23 ; 0x2d 115dc: 8e a7 std Y+46, r24 ; 0x2e 115de: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 115e0: 90 91 fe 04 lds r25, 0x04FE ; 0x8004fe 115e4: 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; 115e6: 28 a5 ldd r18, Y+40 ; 0x28 115e8: 39 a5 ldd r19, Y+41 ; 0x29 115ea: 4a a5 ldd r20, Y+42 ; 0x2a 115ec: 5b a5 ldd r21, Y+43 ; 0x2b 115ee: 62 96 adiw r28, 0x12 ; 18 115f0: 6c ad ldd r22, Y+60 ; 0x3c 115f2: 7d ad ldd r23, Y+61 ; 0x3d 115f4: 8e ad ldd r24, Y+62 ; 0x3e 115f6: 9f ad ldd r25, Y+63 ; 0x3f 115f8: 62 97 sbiw r28, 0x12 ; 18 115fa: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 115fe: 69 83 std Y+1, r22 ; 0x01 11600: 7a 83 std Y+2, r23 ; 0x02 11602: 8b 83 std Y+3, r24 ; 0x03 11604: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 11606: 2c a5 ldd r18, Y+44 ; 0x2c 11608: 3d a5 ldd r19, Y+45 ; 0x2d 1160a: 4e a5 ldd r20, Y+46 ; 0x2e 1160c: 5f a5 ldd r21, Y+47 ; 0x2f 1160e: 66 96 adiw r28, 0x16 ; 22 11610: 6c ad ldd r22, Y+60 ; 0x3c 11612: 7d ad ldd r23, Y+61 ; 0x3d 11614: 8e ad ldd r24, Y+62 ; 0x3e 11616: 9f ad ldd r25, Y+63 ; 0x3f 11618: 66 97 sbiw r28, 0x16 ; 22 1161a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1161e: 6d 83 std Y+5, r22 ; 0x05 11620: 7e 83 std Y+6, r23 ; 0x06 11622: 8f 83 std Y+7, r24 ; 0x07 11624: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 11626: 28 96 adiw r28, 0x08 ; 8 11628: 2c ad ldd r18, Y+60 ; 0x3c 1162a: 3d ad ldd r19, Y+61 ; 0x3d 1162c: 4e ad ldd r20, Y+62 ; 0x3e 1162e: 5f ad ldd r21, Y+63 ; 0x3f 11630: 28 97 sbiw r28, 0x08 ; 8 11632: 69 85 ldd r22, Y+9 ; 0x09 11634: 7a 85 ldd r23, Y+10 ; 0x0a 11636: 8b 85 ldd r24, Y+11 ; 0x0b 11638: 9c 85 ldd r25, Y+12 ; 0x0c 1163a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1163e: 69 87 std Y+9, r22 ; 0x09 11640: 7a 87 std Y+10, r23 ; 0x0a 11642: 8b 87 std Y+11, r24 ; 0x0b 11644: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 11646: 2c 96 adiw r28, 0x0c ; 12 11648: 2c ad ldd r18, Y+60 ; 0x3c 1164a: 3d ad ldd r19, Y+61 ; 0x3d 1164c: 4e ad ldd r20, Y+62 ; 0x3e 1164e: 5f ad ldd r21, Y+63 ; 0x3f 11650: 2c 97 sbiw r28, 0x0c ; 12 11652: 6d 85 ldd r22, Y+13 ; 0x0d 11654: 7e 85 ldd r23, Y+14 ; 0x0e 11656: 8f 85 ldd r24, Y+15 ; 0x0f 11658: 98 89 ldd r25, Y+16 ; 0x10 1165a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1165e: 6d 87 std Y+13, r22 ; 0x0d 11660: 7e 87 std Y+14, r23 ; 0x0e 11662: 8f 87 std Y+15, r24 ; 0x0f 11664: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 11666: ce 01 movw r24, r28 11668: 01 96 adiw r24, 0x01 ; 1 1166a: 0e 94 46 65 call 0xca8c ; 0xca8c // Insert the segment into the buffer if (i >= start_segment_idx) 1166e: 2e 96 adiw r28, 0x0e ; 14 11670: ae ad ldd r26, Y+62 ; 0x3e 11672: bf ad ldd r27, Y+63 ; 0x3f 11674: 2e 97 sbiw r28, 0x0e ; 14 11676: 2a 16 cp r2, r26 11678: 3b 06 cpc r3, r27 1167a: f8 f0 brcs .+62 ; 0x116ba plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1167c: e9 84 ldd r14, Y+9 ; 0x09 1167e: fa 84 ldd r15, Y+10 ; 0x0a 11680: 0b 85 ldd r16, Y+11 ; 0x0b 11682: 1c 85 ldd r17, Y+12 ; 0x0c 11684: 2d 81 ldd r18, Y+5 ; 0x05 11686: 3e 81 ldd r19, Y+6 ; 0x06 11688: 4f 81 ldd r20, Y+7 ; 0x07 1168a: 58 85 ldd r21, Y+8 ; 0x08 1168c: 69 81 ldd r22, Y+1 ; 0x01 1168e: 7a 81 ldd r23, Y+2 ; 0x02 11690: 8b 81 ldd r24, Y+3 ; 0x03 11692: 9c 81 ldd r25, Y+4 ; 0x04 11694: 3f 92 push r3 11696: 2f 92 push r2 11698: e5 ef ldi r30, 0xF5 ; 245 1169a: f1 e1 ldi r31, 0x11 ; 17 1169c: ff 93 push r31 1169e: ef 93 push r30 116a0: 88 ac ldd r8, Y+56 ; 0x38 116a2: 99 ac ldd r9, Y+57 ; 0x39 116a4: aa ac ldd r10, Y+58 ; 0x3a 116a6: bb ac ldd r11, Y+59 ; 0x3b 116a8: fe 01 movw r30, r28 116aa: 3d 96 adiw r30, 0x0d ; 13 116ac: 6f 01 movw r12, r30 116ae: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 116b2: 0f 90 pop r0 116b4: 0f 90 pop r0 116b6: 0f 90 pop r0 116b8: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 116ba: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 116be: 81 11 cpse r24, r1 116c0: 39 c0 rjmp .+114 ; 0x11734 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++) { 116c2: ff ef ldi r31, 0xFF ; 255 116c4: 2f 1a sub r2, r31 116c6: 3f 0a sbc r3, r31 116c8: 2c a9 ldd r18, Y+52 ; 0x34 116ca: 3d a9 ldd r19, Y+53 ; 0x35 116cc: 22 15 cp r18, r2 116ce: 33 05 cpc r19, r3 116d0: 09 f0 breq .+2 ; 0x116d4 116d2: 16 cf rjmp .-468 ; 0x11500 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 116d4: 83 e9 ldi r24, 0x93 ; 147 116d6: 96 e0 ldi r25, 0x06 ; 6 116d8: 0e 94 46 65 call 0xca8c ; 0xca8c // 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); 116dc: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 116e0: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 116e4: 00 91 9d 06 lds r16, 0x069D ; 0x80069d 116e8: 10 91 9e 06 lds r17, 0x069E ; 0x80069e 116ec: 20 91 97 06 lds r18, 0x0697 ; 0x800697 116f0: 30 91 98 06 lds r19, 0x0698 ; 0x800698 116f4: 40 91 99 06 lds r20, 0x0699 ; 0x800699 116f8: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 116fc: 60 91 93 06 lds r22, 0x0693 ; 0x800693 11700: 70 91 94 06 lds r23, 0x0694 ; 0x800694 11704: 80 91 95 06 lds r24, 0x0695 ; 0x800695 11708: 90 91 96 06 lds r25, 0x0696 ; 0x800696 1170c: 1f 92 push r1 1170e: 1f 92 push r1 11710: e5 ef ldi r30, 0xF5 ; 245 11712: f1 e1 ldi r31, 0x11 ; 17 11714: ff 93 push r31 11716: ef 93 push r30 11718: 88 ac ldd r8, Y+56 ; 0x38 1171a: 99 ac ldd r9, Y+57 ; 0x39 1171c: aa ac ldd r10, Y+58 ; 0x3a 1171e: bb ac ldd r11, Y+59 ; 0x3b 11720: ef e9 ldi r30, 0x9F ; 159 11722: ce 2e mov r12, r30 11724: e6 e0 ldi r30, 0x06 ; 6 11726: de 2e mov r13, r30 11728: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 1172c: 0f 90 pop r0 1172e: 0f 90 pop r0 11730: 0f 90 pop r0 11732: 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(); 11734: 0e 94 37 55 call 0xaa6e ; 0xaa6e previous_millis_cmd.start(); 11738: 8a e4 ldi r24, 0x4A ; 74 1173a: 93 e0 ldi r25, 0x03 ; 3 1173c: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> 11740: 4d cc rjmp .-1894 ; 0x10fdc 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; 11742: 60 e0 ldi r22, 0x00 ; 0 11744: 70 e0 ldi r23, 0x00 ; 0 11746: cb 01 movw r24, r22 11748: 5e cc rjmp .-1860 ; 0x11006 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; 1174a: a3 2c mov r10, r3 1174c: b2 2c mov r11, r2 1174e: 0c a9 ldd r16, Y+52 ; 0x34 11750: 1c ad ldd r17, Y+60 ; 0x3c 11752: b0 cd rjmp .-1184 ; 0x112b4 // 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; 11754: 28 a5 ldd r18, Y+40 ; 0x28 11756: 39 a5 ldd r19, Y+41 ; 0x29 11758: 4a a5 ldd r20, Y+42 ; 0x2a 1175a: 5b a5 ldd r21, Y+43 ; 0x2b 1175c: 6c ad ldd r22, Y+60 ; 0x3c 1175e: 7d ad ldd r23, Y+61 ; 0x3d 11760: 8e ad ldd r24, Y+62 ; 0x3e 11762: 9f ad ldd r25, Y+63 ; 0x3f 11764: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 11768: 4b 01 movw r8, r22 1176a: 5c 01 movw r10, r24 1176c: 2c a5 ldd r18, Y+44 ; 0x2c 1176e: 3d a5 ldd r19, Y+45 ; 0x2d 11770: 4e a5 ldd r20, Y+46 ; 0x2e 11772: 5f a5 ldd r21, Y+47 ; 0x2f 11774: 24 96 adiw r28, 0x04 ; 4 11776: 6c ad ldd r22, Y+60 ; 0x3c 11778: 7d ad ldd r23, Y+61 ; 0x3d 1177a: 8e ad ldd r24, Y+62 ; 0x3e 1177c: 9f ad ldd r25, Y+63 ; 0x3f 1177e: 24 97 sbiw r28, 0x04 ; 4 11780: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 11784: 9b 01 movw r18, r22 11786: ac 01 movw r20, r24 11788: c5 01 movw r24, r10 1178a: b4 01 movw r22, r8 1178c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11790: 7b 01 movw r14, r22 11792: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 11794: 28 a5 ldd r18, Y+40 ; 0x28 11796: 39 a5 ldd r19, Y+41 ; 0x29 11798: 4a a5 ldd r20, Y+42 ; 0x2a 1179a: 5b a5 ldd r21, Y+43 ; 0x2b 1179c: 24 96 adiw r28, 0x04 ; 4 1179e: 6c ad ldd r22, Y+60 ; 0x3c 117a0: 7d ad ldd r23, Y+61 ; 0x3d 117a2: 8e ad ldd r24, Y+62 ; 0x3e 117a4: 9f ad ldd r25, Y+63 ; 0x3f 117a6: 24 97 sbiw r28, 0x04 ; 4 117a8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 117ac: 4b 01 movw r8, r22 117ae: 5c 01 movw r10, r24 117b0: 2c a5 ldd r18, Y+44 ; 0x2c 117b2: 3d a5 ldd r19, Y+45 ; 0x2d 117b4: 4e a5 ldd r20, Y+46 ; 0x2e 117b6: 5f a5 ldd r21, Y+47 ; 0x2f 117b8: 6c ad ldd r22, Y+60 ; 0x3c 117ba: 7d ad ldd r23, Y+61 ; 0x3d 117bc: 8e ad ldd r24, Y+62 ; 0x3e 117be: 9f ad ldd r25, Y+63 ; 0x3f 117c0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 117c4: 9b 01 movw r18, r22 117c6: ac 01 movw r20, r24 117c8: c5 01 movw r24, r10 117ca: b4 01 movw r22, r8 117cc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 117d0: 68 a7 std Y+40, r22 ; 0x28 117d2: 79 a7 std Y+41, r23 ; 0x29 117d4: 8a a7 std Y+42, r24 ; 0x2a 117d6: 9b a7 std Y+43, r25 ; 0x2b 117d8: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 117da: c7 01 movw r24, r14 117dc: d8 01 movw r26, r16 117de: 8c a7 std Y+44, r24 ; 0x2c 117e0: 9d a7 std Y+45, r25 ; 0x2d 117e2: ae a7 std Y+46, r26 ; 0x2e 117e4: bf a7 std Y+47, r27 ; 0x2f 117e6: ff ce rjmp .-514 ; 0x115e6 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 117e8: 80 e5 ldi r24, 0x50 ; 80 117ea: 0e 94 b6 55 call 0xab6c ; 0xab6c - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 117ee: c1 2c mov r12, r1 117f0: d1 2c mov r13, r1 117f2: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 117f4: 88 23 and r24, r24 117f6: 31 f0 breq .+12 ; 0x11804 117f8: 0e 94 8e 5a call 0xb51c ; 0xb51c 117fc: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 11800: 6b 01 movw r12, r22 11802: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 11804: 83 e5 ldi r24, 0x53 ; 83 11806: 0e 94 b6 55 call 0xab6c ; 0xab6c 1180a: 88 23 and r24, r24 1180c: 61 f0 breq .+24 ; 0x11826 1180e: 0e 94 8e 5a call 0xb51c ; 0xb51c 11812: 20 e0 ldi r18, 0x00 ; 0 11814: 30 e0 ldi r19, 0x00 ; 0 11816: 4a e7 ldi r20, 0x7A ; 122 11818: 54 e4 ldi r21, 0x44 ; 68 1181a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1181e: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 11822: 6b 01 movw r12, r22 11824: 7c 01 movw r14, r24 if(codenum != 0) 11826: c1 14 cp r12, r1 11828: d1 04 cpc r13, r1 1182a: e1 04 cpc r14, r1 1182c: f1 04 cpc r15, r1 1182e: 41 f0 breq .+16 ; 0x11840 { if(custom_message_type != CustomMsg::M117) 11830: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 11834: 87 30 cpi r24, 0x07 ; 7 11836: 21 f0 breq .+8 ; 0x11840 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 11838: 89 ec ldi r24, 0xC9 ; 201 1183a: 97 e6 ldi r25, 0x67 ; 103 1183c: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 } } st_synchronize(); 11840: 0f 94 a0 22 call 0x24540 ; 0x24540 codenum += _millis(); // keep track of when we started waiting 11844: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 11848: c6 0e add r12, r22 1184a: d7 1e adc r13, r23 1184c: e8 1e adc r14, r24 1184e: f9 1e adc r15, r25 previous_millis_cmd.start(); 11850: 8a e4 ldi r24, 0x4A ; 74 11852: 93 e0 ldi r25, 0x03 ; 3 11854: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> while(_millis() < codenum) { 11858: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1185c: 6c 15 cp r22, r12 1185e: 7d 05 cpc r23, r13 11860: 8e 05 cpc r24, r14 11862: 9f 05 cpc r25, r15 11864: 08 f0 brcs .+2 ; 0x11868 11866: ba cb rjmp .-2188 ; 0x10fdc manage_heater(); 11868: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 1186c: 80 e0 ldi r24, 0x00 ; 0 1186e: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); 11872: 80 e0 ldi r24, 0x00 ; 0 11874: 0e 94 c3 69 call 0xd386 ; 0xd386 11878: ef cf rjmp .-34 ; 0x11858 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); 1187a: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 1187c: 0e 94 4b be call 0x17c96 ; 0x17c96 11880: ad cb rjmp .-2214 ; 0x10fdc 11882: 80 e0 ldi r24, 0x00 ; 0 11884: fb cf rjmp .-10 ; 0x1187c { 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]); 11886: 88 e5 ldi r24, 0x58 ; 88 11888: 0e 94 b6 55 call 0xab6c ; 0xab6c 1188c: 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; 1188e: 41 2c mov r4, r1 11890: 51 2c mov r5, r1 11892: 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(); 11894: 88 23 and r24, r24 11896: 21 f0 breq .+8 ; 0x118a0 11898: 0e 94 1e 56 call 0xac3c ; 0xac3c 1189c: 2b 01 movw r4, r22 1189e: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 118a0: 89 e5 ldi r24, 0x59 ; 89 118a2: 0e 94 b6 55 call 0xab6c ; 0xab6c 118a6: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 118a8: 88 23 and r24, r24 118aa: 71 f1 breq .+92 ; 0x11908 118ac: 0e 94 1e 56 call 0xac3c ; 0xac3c 118b0: 6c a7 std Y+44, r22 ; 0x2c 118b2: 7d a7 std Y+45, r23 ; 0x2d 118b4: 8e a7 std Y+46, r24 ; 0x2e 118b6: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 118b8: 8a e5 ldi r24, 0x5A ; 90 118ba: 0e 94 b6 55 call 0xab6c ; 0xab6c 118be: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 118c0: 81 2c mov r8, r1 118c2: 91 2c mov r9, r1 118c4: 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(); 118c6: 88 23 and r24, r24 118c8: 21 f0 breq .+8 ; 0x118d2 118ca: 0e 94 1e 56 call 0xac3c ; 0xac3c 118ce: 4b 01 movw r8, r22 118d0: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 118d2: 87 e5 ldi r24, 0x57 ; 87 118d4: 0e 94 b6 55 call 0xab6c ; 0xab6c 118d8: 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); 118da: 8f 93 push r24 118dc: cd 2c mov r12, r13 118de: ec a4 ldd r14, Y+44 ; 0x2c 118e0: fd a4 ldd r15, Y+45 ; 0x2d 118e2: 0e a5 ldd r16, Y+46 ; 0x2e 118e4: 1f a5 ldd r17, Y+47 ; 0x2f 118e6: 22 2d mov r18, r2 118e8: b3 01 movw r22, r6 118ea: a2 01 movw r20, r4 118ec: 83 2d mov r24, r3 118ee: 0e 94 f4 67 call 0xcfe8 ; 0xcfe8 #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 118f2: 0f 90 pop r0 118f4: 31 10 cpse r3, r1 118f6: 72 cb rjmp .-2332 ; 0x10fdc 118f8: 21 10 cpse r2, r1 118fa: 70 cb rjmp .-2336 ; 0x10fdc 118fc: 38 a5 ldd r19, Y+40 ; 0x28 118fe: 31 11 cpse r19, r1 11900: 6d cb rjmp .-2342 ; 0x10fdc 11902: d1 10 cpse r13, r1 11904: 6b cb rjmp .-2346 ; 0x10fdc 11906: 20 cb rjmp .-2496 ; 0x10f48 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 11908: 1c a6 std Y+44, r1 ; 0x2c 1190a: 1d a6 std Y+45, r1 ; 0x2d 1190c: 1e a6 std Y+46, r1 ; 0x2e 1190e: 1f a6 std Y+47, r1 ; 0x2f 11910: d3 cf rjmp .-90 ; 0x118b8 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) 11912: 08 e2 ldi r16, 0x28 ; 40 11914: 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)); 11916: 94 ea ldi r25, 0xA4 ; 164 11918: e9 2e mov r14, r25 1191a: 97 e6 ldi r25, 0x67 ; 103 1191c: f9 2e mov r15, r25 1191e: 60 2f mov r22, r16 11920: 70 e0 ldi r23, 0x00 ; 0 11922: 90 e0 ldi r25, 0x00 ; 0 11924: 80 e0 ldi r24, 0x00 ; 0 11926: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 1192a: 0e 94 8f 56 call 0xad1e ; 0xad1e 1192e: 9f 93 push r25 11930: 8f 93 push r24 11932: 7f 93 push r23 11934: 6f 93 push r22 11936: 1f 93 push r17 11938: 0f 93 push r16 1193a: ff 92 push r15 1193c: ef 92 push r14 1193e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 11942: 0f 5f subi r16, 0xFF ; 255 11944: 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++) 11946: 0f b6 in r0, 0x3f ; 63 11948: f8 94 cli 1194a: de bf out 0x3e, r29 ; 62 1194c: 0f be out 0x3f, r0 ; 63 1194e: cd bf out 0x3d, r28 ; 61 11950: 0f 36 cpi r16, 0x6F ; 111 11952: 11 05 cpc r17, r1 11954: 21 f7 brne .-56 ; 0x1191e 11956: 42 cb rjmp .-2428 ; 0x10fdc ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 11958: 0f 94 0c 15 call 0x22a18 ; 0x22a18 1195c: 81 11 cpse r24, r1 1195e: 05 c0 rjmp .+10 ; 0x1196a { SERIAL_ECHOLNPGM("No PINDA thermistor"); 11960: 81 e3 ldi r24, 0x31 ; 49 11962: 91 e8 ldi r25, 0x81 ; 129 11964: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 11968: 39 cb rjmp .-2446 ; 0x10fdc break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1196a: 82 e0 ldi r24, 0x02 ; 2 1196c: 0e 94 4c d8 call 0x1b098 ; 0x1b098 11970: 81 11 cpse r24, r1 11972: 07 c0 rjmp .+14 ; 0x11982 //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)); 11974: 8b e2 ldi r24, 0x2B ; 43 11976: 9a e3 ldi r25, 0x3A ; 58 11978: 0e 94 32 6d call 0xda64 ; 0xda64 1197c: 0f 94 7b 0b call 0x216f6 ; 0x216f6 11980: 2d cb rjmp .-2470 ; 0x10fdc break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 11982: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 11986: 88 23 and r24, r24 11988: 41 f0 breq .+16 ; 0x1199a 1198a: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1198e: 88 23 and r24, r24 11990: 21 f0 breq .+8 ; 0x1199a 11992: d0 90 a5 06 lds r13, 0x06A5 ; 0x8006a5 11996: d1 10 cpse r13, r1 11998: 08 c0 rjmp .+16 ; 0x119aa 1199a: 81 e0 ldi r24, 0x01 ; 1 1199c: 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); 119a0: 86 eb ldi r24, 0xB6 ; 182 119a2: 98 e6 ldi r25, 0x68 ; 104 119a4: 0f 94 b4 43 call 0x28768 ; 0x28768 119a8: 19 cb rjmp .-2510 ; 0x10fdc break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 119aa: 82 ee ldi r24, 0xE2 ; 226 119ac: 99 e3 ldi r25, 0x39 ; 57 119ae: 0e 94 32 6d call 0xda64 ; 0xda64 119b2: 0f 94 7b 0b call 0x216f6 ; 0x216f6 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 119b6: 8b e9 ldi r24, 0x9B ; 155 119b8: 91 e5 ldi r25, 0x51 ; 81 119ba: 0e 94 32 6d call 0xda64 ; 0xda64 119be: 41 e0 ldi r20, 0x01 ; 1 119c0: 60 e0 ldi r22, 0x00 ; 0 119c2: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (result == LCD_LEFT_BUTTON_CHOICE) 119c6: 81 11 cpse r24, r1 119c8: 6e c0 rjmp .+220 ; 0x11aa6 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 119ca: 80 e0 ldi r24, 0x00 ; 0 119cc: 90 e0 ldi r25, 0x00 ; 0 119ce: a0 ea ldi r26, 0xA0 ; 160 119d0: b0 e4 ldi r27, 0x40 ; 64 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 d0 85 call 0x30ba0 ; 0x30ba0 current_position[Z_AXIS] = 50; 119ee: 80 e0 ldi r24, 0x00 ; 0 119f0: 90 e0 ldi r25, 0x00 ; 0 119f2: a8 e4 ldi r26, 0x48 ; 72 119f4: b2 e4 ldi r27, 0x42 ; 66 119f6: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 119fa: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 119fe: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11a02: b0 93 00 12 sts 0x1200, r27 ; 0x801200 current_position[Y_AXIS] = 180; 11a06: 80 e0 ldi r24, 0x00 ; 0 11a08: 90 e0 ldi r25, 0x00 ; 0 11a0a: a4 e3 ldi r26, 0x34 ; 52 11a0c: b3 e4 ldi r27, 0x43 ; 67 11a0e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11a12: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11a16: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11a1a: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11a1e: 60 e0 ldi r22, 0x00 ; 0 11a20: 70 e0 ldi r23, 0x00 ; 0 11a22: 88 e4 ldi r24, 0x48 ; 72 11a24: 92 e4 ldi r25, 0x42 ; 66 11a26: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 11a2a: 0f 94 a0 22 call 0x24540 ; 0x24540 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 11a2e: 81 e7 ldi r24, 0x71 ; 113 11a30: 91 e5 ldi r25, 0x51 ; 81 11a32: 0e 94 32 6d call 0xda64 ; 0xda64 11a36: 0f 94 7b 0b call 0x216f6 ; 0x216f6 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11a3a: e3 e5 ldi r30, 0x53 ; 83 11a3c: f9 e8 ldi r31, 0x89 ; 137 11a3e: 85 91 lpm r24, Z+ 11a40: 95 91 lpm r25, Z+ 11a42: a5 91 lpm r26, Z+ 11a44: b4 91 lpm r27, Z 11a46: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11a4a: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11a4e: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11a52: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11a56: ef e4 ldi r30, 0x4F ; 79 11a58: f9 e8 ldi r31, 0x89 ; 137 11a5a: 85 91 lpm r24, Z+ 11a5c: 95 91 lpm r25, Z+ 11a5e: a5 91 lpm r26, Z+ 11a60: b4 91 lpm r27, Z 11a62: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11a66: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11a6a: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11a6e: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(3000 / 60); 11a72: 60 e0 ldi r22, 0x00 ; 0 11a74: 70 e0 ldi r23, 0x00 ; 0 11a76: 88 e4 ldi r24, 0x48 ; 72 11a78: 92 e4 ldi r25, 0x42 ; 66 11a7a: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 11a7e: 0f 94 a0 22 call 0x24540 ; 0x24540 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); 11a82: 81 e0 ldi r24, 0x01 ; 1 11a84: 8f 93 push r24 11a86: 81 2c mov r8, r1 11a88: 91 2c mov r9, r1 11a8a: 54 01 movw r10, r8 11a8c: cc 24 eor r12, r12 11a8e: c3 94 inc r12 11a90: e1 2c mov r14, r1 11a92: f1 2c mov r15, r1 11a94: 87 01 movw r16, r14 11a96: 20 e0 ldi r18, 0x00 ; 0 11a98: 40 e0 ldi r20, 0x00 ; 0 11a9a: 50 e0 ldi r21, 0x00 ; 0 11a9c: ba 01 movw r22, r20 11a9e: 80 e0 ldi r24, 0x00 ; 0 11aa0: 0e 94 f4 67 call 0xcfe8 ; 0xcfe8 11aa4: 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)) { 11aa6: 20 e0 ldi r18, 0x00 ; 0 11aa8: 30 e0 ldi r19, 0x00 ; 0 11aaa: 4c e0 ldi r20, 0x0C ; 12 11aac: 52 e4 ldi r21, 0x42 ; 66 11aae: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11ab2: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11ab6: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11aba: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11abe: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 11ac2: 18 16 cp r1, r24 11ac4: 0c f0 brlt .+2 ; 0x11ac8 11ac6: 76 c0 rjmp .+236 ; 0x11bb4 11ac8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 11acc: 81 11 cpse r24, r1 11ace: 72 c0 rjmp .+228 ; 0x11bb4 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 11ad0: 80 e0 ldi r24, 0x00 ; 0 11ad2: 90 e0 ldi r25, 0x00 ; 0 11ad4: a8 ec ldi r26, 0xC8 ; 200 11ad6: b2 e4 ldi r27, 0x42 ; 66 11ad8: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11adc: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11ae0: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11ae4: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11ae8: 60 e0 ldi r22, 0x00 ; 0 11aea: 70 e0 ldi r23, 0x00 ; 0 11aec: 88 e4 ldi r24, 0x48 ; 72 11aee: 92 e4 ldi r25, 0x42 ; 66 11af0: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 11af4: 0f 94 b9 12 call 0x22572 ; 0x22572 LongTimer pinda_timeout; 11af8: 19 82 std Y+1, r1 ; 0x01 11afa: 1a 82 std Y+2, r1 ; 0x02 11afc: 1b 82 std Y+3, r1 ; 0x03 11afe: 1c 82 std Y+4, r1 ; 0x04 11b00: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 11b02: ce 01 movw r24, r28 11b04: 01 96 adiw r24, 0x01 ; 1 11b06: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::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); 11b0a: 83 e2 ldi r24, 0x23 ; 35 11b0c: f8 2e mov r15, r24 11b0e: 0e ea ldi r16, 0xAE ; 174 11b10: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 11b12: 20 e0 ldi r18, 0x00 ; 0 11b14: 30 e0 ldi r19, 0x00 ; 0 11b16: 4c e0 ldi r20, 0x0C ; 12 11b18: 52 e4 ldi r21, 0x42 ; 66 11b1a: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11b1e: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11b22: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11b26: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11b2a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 11b2e: 18 16 cp r1, r24 11b30: c4 f5 brge .+112 ; 0x11ba2 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 11b32: 84 e9 ldi r24, 0x94 ; 148 11b34: 99 e3 ldi r25, 0x39 ; 57 11b36: 0e 94 32 6d call 0xda64 ; 0xda64 11b3a: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 11b3e: 42 e8 ldi r20, 0x82 ; 130 11b40: 64 e0 ldi r22, 0x04 ; 4 11b42: 80 e0 ldi r24, 0x00 ; 0 11b44: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 11b48: 1f 92 push r1 11b4a: ff 92 push r15 11b4c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11b50: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11b54: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11b58: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11b5c: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 11b60: 7f 93 push r23 11b62: 6f 93 push r22 11b64: 1f 93 push r17 11b66: 0f 93 push r16 11b68: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_putc(LCD_STR_DEGREE[0]); 11b6c: 81 e8 ldi r24, 0x81 ; 129 11b6e: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 delay_keep_alive(1000); 11b72: 88 ee ldi r24, 0xE8 ; 232 11b74: 93 e0 ldi r25, 0x03 ; 3 11b76: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 serialecho_temperatures(); 11b7a: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 11b7e: 40 e0 ldi r20, 0x00 ; 0 11b80: 53 e5 ldi r21, 0x53 ; 83 11b82: 67 e0 ldi r22, 0x07 ; 7 11b84: 70 e0 ldi r23, 0x00 ; 0 11b86: ce 01 movw r24, r28 11b88: 01 96 adiw r24, 0x01 ; 1 11b8a: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> 11b8e: 0f 90 pop r0 11b90: 0f 90 pop r0 11b92: 0f 90 pop r0 11b94: 0f 90 pop r0 11b96: 0f 90 pop r0 11b98: 0f 90 pop r0 11b9a: 88 23 and r24, r24 11b9c: 09 f4 brne .+2 ; 0x11ba0 11b9e: b9 cf rjmp .-142 ; 0x11b12 target_temp_reached = false; 11ba0: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 11ba2: 81 e0 ldi r24, 0x01 ; 1 11ba4: 0e 94 41 6a call 0xd482 ; 0xd482 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 11ba8: d1 10 cpse r13, r1 11baa: 04 c0 rjmp .+8 ; 0x11bb4 lcd_temp_cal_show_result(false); 11bac: 80 e0 ldi r24, 0x00 ; 0 11bae: 0f 94 0c 0c call 0x21818 ; 0x21818 11bb2: 14 ca rjmp .-3032 ; 0x10fdc break; } } st_synchronize(); 11bb4: 0f 94 a0 22 call 0x24540 ; 0x24540 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 11bb8: 81 e0 ldi r24, 0x01 ; 1 11bba: 80 93 05 12 sts 0x1205, r24 ; 0x801205 lcd_update_enable(true); 11bbe: 0e 94 41 6a call 0xd482 ; 0xd482 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 11bc2: 83 e1 ldi r24, 0x13 ; 19 11bc4: 91 e8 ldi r25, 0x81 ; 129 11bc6: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 11bca: 80 90 8e 06 lds r8, 0x068E ; 0x80068e 11bce: 90 90 8f 06 lds r9, 0x068F ; 0x80068f 11bd2: a0 90 90 06 lds r10, 0x0690 ; 0x800690 11bd6: b0 90 91 06 lds r11, 0x0691 ; 0x800691 11bda: 20 e0 ldi r18, 0x00 ; 0 11bdc: 30 e0 ldi r19, 0x00 ; 0 11bde: 40 ea ldi r20, 0xA0 ; 160 11be0: 50 e4 ldi r21, 0x40 ; 64 11be2: c5 01 movw r24, r10 11be4: b4 01 movw r22, r8 11be6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 11bea: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 11bee: 25 e0 ldi r18, 0x05 ; 5 11bf0: 26 9f mul r18, r22 11bf2: a0 01 movw r20, r0 11bf4: 27 9f mul r18, r23 11bf6: 50 0d add r21, r0 11bf8: 11 24 eor r1, r1 11bfa: ba 01 movw r22, r20 11bfc: 55 0f add r21, r21 11bfe: 88 0b sbc r24, r24 11c00: 99 0b sbc r25, r25 11c02: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 11c06: 1b 01 movw r2, r22 11c08: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 11c0a: 20 e0 ldi r18, 0x00 ; 0 11c0c: 30 e0 ldi r19, 0x00 ; 0 11c0e: 4c e0 ldi r20, 0x0C ; 12 11c10: 52 e4 ldi r21, 0x42 ; 66 11c12: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 11c16: 87 ff sbrs r24, 7 11c18: 06 c0 rjmp .+12 ; 0x11c26 11c1a: 21 2c mov r2, r1 11c1c: 31 2c mov r3, r1 11c1e: 1c e0 ldi r17, 0x0C ; 12 11c20: e1 2e mov r14, r17 11c22: 02 e4 ldi r16, 0x42 ; 66 11c24: f0 2e mov r15, r16 if (start_temp < current_temperature_pinda) start_temp += 5; 11c26: 22 2d mov r18, r2 11c28: 33 2d mov r19, r3 11c2a: 4e 2d mov r20, r14 11c2c: 5f 2d mov r21, r15 11c2e: c5 01 movw r24, r10 11c30: b4 01 movw r22, r8 11c32: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 11c36: 18 16 cp r1, r24 11c38: 64 f4 brge .+24 ; 0x11c52 11c3a: 20 e0 ldi r18, 0x00 ; 0 11c3c: 30 e0 ldi r19, 0x00 ; 0 11c3e: 40 ea ldi r20, 0xA0 ; 160 11c40: 50 e4 ldi r21, 0x40 ; 64 11c42: 62 2d mov r22, r2 11c44: 73 2d mov r23, r3 11c46: 8e 2d mov r24, r14 11c48: 9f 2d mov r25, r15 11c4a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11c4e: 1b 01 movw r2, r22 11c50: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 11c52: ff 92 push r15 11c54: ef 92 push r14 11c56: 3f 92 push r3 11c58: 2f 92 push r2 11c5a: 8b e8 ldi r24, 0x8B ; 139 11c5c: 97 e6 ldi r25, 0x67 ; 103 11c5e: 9f 93 push r25 11c60: 8f 93 push r24 11c62: 0f 94 fe 9f call 0x33ffc ; 0x33ffc setTargetBed(70 + (start_temp - 30)); 11c66: 20 e0 ldi r18, 0x00 ; 0 11c68: 30 e0 ldi r19, 0x00 ; 0 11c6a: 40 ef ldi r20, 0xF0 ; 240 11c6c: 51 e4 ldi r21, 0x41 ; 65 11c6e: 62 2d mov r22, r2 11c70: 73 2d mov r23, r3 11c72: 8e 2d mov r24, r14 11c74: 9f 2d mov r25, r15 11c76: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 11c7a: 20 e0 ldi r18, 0x00 ; 0 11c7c: 30 e0 ldi r19, 0x00 ; 0 11c7e: 4c e8 ldi r20, 0x8C ; 140 11c80: 52 e4 ldi r21, 0x42 ; 66 11c82: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 11c86: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 11c8a: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11c8e: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed custom_message_type = CustomMsg::TempCal; 11c92: 84 e0 ldi r24, 0x04 ; 4 11c94: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 11c98: 81 e0 ldi r24, 0x01 ; 1 11c9a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 11c9e: 86 e3 ldi r24, 0x36 ; 54 11ca0: 9b e3 ldi r25, 0x3B ; 59 11ca2: 0e 94 32 6d call 0xda64 ; 0xda64 11ca6: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11caa: 80 e0 ldi r24, 0x00 ; 0 11cac: 90 e0 ldi r25, 0x00 ; 0 11cae: a0 ea ldi r26, 0xA0 ; 160 11cb0: b0 e4 ldi r27, 0x40 ; 64 11cb2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11cb6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11cba: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11cbe: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11cc2: 60 e0 ldi r22, 0x00 ; 0 11cc4: 70 e0 ldi r23, 0x00 ; 0 11cc6: 88 e4 ldi r24, 0x48 ; 72 11cc8: 92 e4 ldi r25, 0x42 ; 66 11cca: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[X_AXIS] = PINDA_PREHEAT_X; 11cce: 80 e0 ldi r24, 0x00 ; 0 11cd0: 90 e0 ldi r25, 0x00 ; 0 11cd2: a0 ea ldi r26, 0xA0 ; 160 11cd4: b1 e4 ldi r27, 0x41 ; 65 11cd6: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11cda: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11cde: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11ce2: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11ce6: 80 e0 ldi r24, 0x00 ; 0 11ce8: 90 e0 ldi r25, 0x00 ; 0 11cea: a0 e7 ldi r26, 0x70 ; 112 11cec: b2 e4 ldi r27, 0x42 ; 66 11cee: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11cf2: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11cf6: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11cfa: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11cfe: 60 e0 ldi r22, 0x00 ; 0 11d00: 70 e0 ldi r23, 0x00 ; 0 11d02: 88 e4 ldi r24, 0x48 ; 72 11d04: 92 e4 ldi r25, 0x42 ; 66 11d06: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11d0a: 8a e9 ldi r24, 0x9A ; 154 11d0c: 99 e9 ldi r25, 0x99 ; 153 11d0e: a9 e1 ldi r26, 0x19 ; 25 11d10: be e3 ldi r27, 0x3E ; 62 11d12: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11d16: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11d1a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11d1e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11d22: 60 e0 ldi r22, 0x00 ; 0 11d24: 70 e0 ldi r23, 0x00 ; 0 11d26: 88 e4 ldi r24, 0x48 ; 72 11d28: 92 e4 ldi r25, 0x42 ; 66 11d2a: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 11d2e: 0f 94 a0 22 call 0x24540 ; 0x24540 11d32: 0f 90 pop r0 11d34: 0f 90 pop r0 11d36: 0f 90 pop r0 11d38: 0f 90 pop r0 11d3a: 0f 90 pop r0 11d3c: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 11d3e: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11d42: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11d46: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11d4a: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11d4e: 62 2d mov r22, r2 11d50: 73 2d mov r23, r3 11d52: 8e 2d mov r24, r14 11d54: 9f 2d mov r25, r15 11d56: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 11d5a: 18 16 cp r1, r24 11d5c: 3c f4 brge .+14 ; 0x11d6c { delay_keep_alive(1000); 11d5e: 88 ee ldi r24, 0xE8 ; 232 11d60: 93 e0 ldi r25, 0x03 ; 3 11d62: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 serialecho_temperatures(); 11d66: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 11d6a: e9 cf rjmp .-46 ; 0x11d3e 11d6c: 60 e0 ldi r22, 0x00 ; 0 11d6e: 86 ea ldi r24, 0xA6 ; 166 11d70: 9f e0 ldi r25, 0x0F ; 15 11d72: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } 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; 11d76: 80 e0 ldi r24, 0x00 ; 0 11d78: 90 e0 ldi r25, 0x00 ; 0 11d7a: a0 ea ldi r26, 0xA0 ; 160 11d7c: b0 e4 ldi r27, 0x40 ; 64 11d7e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11d82: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11d86: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11d8a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11d8e: 60 e0 ldi r22, 0x00 ; 0 11d90: 70 e0 ldi r23, 0x00 ; 0 11d92: 88 e4 ldi r24, 0x48 ; 72 11d94: 92 e4 ldi r25, 0x42 ; 66 11d96: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11d9a: ef e4 ldi r30, 0x4F ; 79 11d9c: f9 e8 ldi r31, 0x89 ; 137 11d9e: 85 91 lpm r24, Z+ 11da0: 95 91 lpm r25, Z+ 11da2: a5 91 lpm r26, Z+ 11da4: b4 91 lpm r27, Z 11da6: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11daa: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11dae: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11db2: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11db6: e3 e5 ldi r30, 0x53 ; 83 11db8: f9 e8 ldi r31, 0x89 ; 137 11dba: 85 91 lpm r24, Z+ 11dbc: 95 91 lpm r25, Z+ 11dbe: a5 91 lpm r26, Z+ 11dc0: b4 91 lpm r27, Z 11dc2: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11dc6: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11dca: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11dce: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11dd2: 60 e0 ldi r22, 0x00 ; 0 11dd4: 70 e0 ldi r23, 0x00 ; 0 11dd6: 88 e4 ldi r24, 0x48 ; 72 11dd8: 92 e4 ldi r25, 0x42 ; 66 11dda: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 11dde: 0f 94 a0 22 call 0x24540 ; 0x24540 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 11de2: 43 e0 ldi r20, 0x03 ; 3 11de4: 60 e0 ldi r22, 0x00 ; 0 11de6: 70 e0 ldi r23, 0x00 ; 0 11de8: 80 e8 ldi r24, 0x80 ; 128 11dea: 9f eb ldi r25, 0xBF ; 191 11dec: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 if (find_z_result == false) { 11df0: 81 11 cpse r24, r1 11df2: 05 c0 rjmp .+10 ; 0x11dfe 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); 11df4: 0f 94 0c 0c call 0x21818 ; 0x21818 homing_flag = false; 11df8: 10 92 05 12 sts 0x1205, r1 ; 0x801205 11dfc: ef c8 rjmp .-3618 ; 0x10fdc if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 11dfe: 90 91 fd 11 lds r25, 0x11FD ; 0x8011fd 11e02: 98 a7 std Y+40, r25 ; 0x28 11e04: a0 91 fe 11 lds r26, 0x11FE ; 0x8011fe 11e08: ac a7 std Y+44, r26 ; 0x2c 11e0a: b0 91 ff 11 lds r27, 0x11FF ; 0x8011ff 11e0e: b8 ab std Y+48, r27 ; 0x30 11e10: e0 91 00 12 lds r30, 0x1200 ; 0x801200 11e14: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 11e16: ef 93 push r30 11e18: bf 93 push r27 11e1a: af 93 push r26 11e1c: 9f 93 push r25 11e1e: 8e e7 ldi r24, 0x7E ; 126 11e20: 97 e6 ldi r25, 0x67 ; 103 11e22: 9f 93 push r25 11e24: 8f 93 push r24 11e26: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 11e2a: 0f 90 pop r0 11e2c: 0f 90 pop r0 11e2e: 0f 90 pop r0 11e30: 0f 90 pop r0 11e32: 0f 90 pop r0 11e34: 0f 90 pop r0 11e36: ae ea ldi r26, 0xAE ; 174 11e38: 8a 2e mov r8, r26 11e3a: af e0 ldi r26, 0x0F ; 15 11e3c: 9a 2e mov r9, r26 11e3e: b3 e2 ldi r27, 0x23 ; 35 11e40: cb 2e mov r12, r27 11e42: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 11e44: 0f ef ldi r16, 0xFF ; 255 11e46: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 11e48: b6 01 movw r22, r12 11e4a: 0d 2c mov r0, r13 11e4c: 00 0c add r0, r0 11e4e: 88 0b sbc r24, r24 11e50: 99 0b sbc r25, r25 11e52: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 11e56: 2b 01 movw r4, r22 11e58: 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)); 11e5a: df 92 push r13 11e5c: cf 92 push r12 11e5e: c8 01 movw r24, r16 11e60: 02 96 adiw r24, 0x02 ; 2 11e62: 9f 93 push r25 11e64: 8f 93 push r24 11e66: 22 e4 ldi r18, 0x42 ; 66 11e68: 37 e6 ldi r19, 0x67 ; 103 11e6a: 3f 93 push r19 11e6c: 2f 93 push r18 11e6e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 11e72: 58 01 movw r10, r16 11e74: 5f ef ldi r21, 0xFF ; 255 11e76: a5 1a sub r10, r21 11e78: b5 0a sbc r11, r21 if (i >= 0) { 11e7a: 0f 90 pop r0 11e7c: 0f 90 pop r0 11e7e: 0f 90 pop r0 11e80: 0f 90 pop r0 11e82: 0f 90 pop r0 11e84: 0f 90 pop r0 11e86: 11 f4 brne .+4 ; 0x11e8c 11e88: 0c 94 24 b0 jmp 0x16048 ; 0x16048 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11e8c: 70 e0 ldi r23, 0x00 ; 0 11e8e: 60 e0 ldi r22, 0x00 ; 0 11e90: c4 01 movw r24, r8 11e92: 0f 94 7e a1 call 0x342fc ; 0x342fc eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 11e96: a3 01 movw r20, r6 11e98: 92 01 movw r18, r4 11e9a: 62 2d mov r22, r2 11e9c: 73 2d mov r23, r3 11e9e: 8e 2d mov r24, r14 11ea0: 9f 2d mov r25, r15 11ea2: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 11ea6: 18 16 cp r1, r24 11ea8: 44 f4 brge .+16 ; 0x11eba } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 11eaa: 85 e0 ldi r24, 0x05 ; 5 11eac: a8 16 cp r10, r24 11eae: b1 04 cpc r11, r1 11eb0: 11 f0 breq .+4 ; 0x11eb6 11eb2: 0c 94 30 b0 jmp 0x16060 ; 0x16060 11eb6: 05 e0 ldi r16, 0x05 ; 5 11eb8: 10 e0 ldi r17, 0x00 ; 0 11eba: 58 01 movw r10, r16 11ebc: 97 e2 ldi r25, 0x27 ; 39 11ebe: a9 1a sub r10, r25 11ec0: 98 ef ldi r25, 0xF8 ; 248 11ec2: b9 0a sbc r11, r25 11ec4: aa 0c add r10, r10 11ec6: bb 1c adc r11, r11 11ec8: 85 e0 ldi r24, 0x05 ; 5 11eca: 80 9f mul r24, r16 11ecc: 10 01 movw r2, r0 11ece: 81 9f mul r24, r17 11ed0: 30 0c add r3, r0 11ed2: 11 24 eor r1, r1 11ed4: 0d 5f subi r16, 0xFD ; 253 11ed6: 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; 11ed8: ea e9 ldi r30, 0x9A ; 154 11eda: 4e 2e mov r4, r30 11edc: e9 e9 ldi r30, 0x99 ; 153 11ede: 5e 2e mov r5, r30 11ee0: e9 e1 ldi r30, 0x19 ; 25 11ee2: 6e 2e mov r6, r30 11ee4: ee e3 ldi r30, 0x3E ; 62 11ee6: 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); 11ee8: f9 e0 ldi r31, 0x09 ; 9 11eea: 8f 2e mov r8, r31 11eec: f7 e6 ldi r31, 0x67 ; 103 11eee: 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++) 11ef0: c8 01 movw r24, r16 11ef2: 02 97 sbiw r24, 0x02 ; 2 11ef4: 05 97 sbiw r24, 0x05 ; 5 11ef6: 0c f0 brlt .+2 ; 0x11efa 11ef8: d4 c0 rjmp .+424 ; 0x120a2 { float temp = (40 + i * 5); 11efa: b1 01 movw r22, r2 11efc: 63 5d subi r22, 0xD3 ; 211 11efe: 7f 4f sbci r23, 0xFF ; 255 11f00: 07 2e mov r0, r23 11f02: 00 0c add r0, r0 11f04: 88 0b sbc r24, r24 11f06: 99 0b sbc r25, r25 11f08: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 11f0c: 6b 01 movw r12, r22 11f0e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 11f10: 1f 93 push r17 11f12: 0f 93 push r16 11f14: a5 e3 ldi r26, 0x35 ; 53 11f16: b7 e6 ldi r27, 0x67 ; 103 11f18: bf 93 push r27 11f1a: af 93 push r26 11f1c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc custom_message_state = i + 2; 11f20: 00 93 ac 03 sts 0x03AC, r16 ; 0x8003ac setTargetBed(50 + 10 * (temp - 30) / 5); 11f24: 20 e0 ldi r18, 0x00 ; 0 11f26: 30 e0 ldi r19, 0x00 ; 0 11f28: 40 ef ldi r20, 0xF0 ; 240 11f2a: 51 e4 ldi r21, 0x41 ; 65 11f2c: c7 01 movw r24, r14 11f2e: b6 01 movw r22, r12 11f30: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 11f34: 20 e0 ldi r18, 0x00 ; 0 11f36: 30 e0 ldi r19, 0x00 ; 0 11f38: 40 e2 ldi r20, 0x20 ; 32 11f3a: 51 e4 ldi r21, 0x41 ; 65 11f3c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 11f40: 20 e0 ldi r18, 0x00 ; 0 11f42: 30 e0 ldi r19, 0x00 ; 0 11f44: 40 ea ldi r20, 0xA0 ; 160 11f46: 50 e4 ldi r21, 0x40 ; 64 11f48: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 11f4c: 20 e0 ldi r18, 0x00 ; 0 11f4e: 30 e0 ldi r19, 0x00 ; 0 11f50: 48 e4 ldi r20, 0x48 ; 72 11f52: 52 e4 ldi r21, 0x42 ; 66 11f54: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 11f58: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 11f5c: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11f60: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f64: 80 e0 ldi r24, 0x00 ; 0 11f66: 90 e0 ldi r25, 0x00 ; 0 11f68: a0 ea ldi r26, 0xA0 ; 160 11f6a: b0 e4 ldi r27, 0x40 ; 64 11f6c: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11f70: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11f74: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11f78: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11f7c: 60 e0 ldi r22, 0x00 ; 0 11f7e: 70 e0 ldi r23, 0x00 ; 0 11f80: 88 e4 ldi r24, 0x48 ; 72 11f82: 92 e4 ldi r25, 0x42 ; 66 11f84: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[X_AXIS] = PINDA_PREHEAT_X; 11f88: 20 e0 ldi r18, 0x00 ; 0 11f8a: 30 e0 ldi r19, 0x00 ; 0 11f8c: 40 ea ldi r20, 0xA0 ; 160 11f8e: 51 e4 ldi r21, 0x41 ; 65 11f90: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 11f94: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 11f98: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 11f9c: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11fa0: 80 e0 ldi r24, 0x00 ; 0 11fa2: 90 e0 ldi r25, 0x00 ; 0 11fa4: a0 e7 ldi r26, 0x70 ; 112 11fa6: b2 e4 ldi r27, 0x42 ; 66 11fa8: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11fac: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11fb0: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11fb4: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11fb8: 60 e0 ldi r22, 0x00 ; 0 11fba: 70 e0 ldi r23, 0x00 ; 0 11fbc: 88 e4 ldi r24, 0x48 ; 72 11fbe: 92 e4 ldi r25, 0x42 ; 66 11fc0: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11fc4: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 11fc8: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 11fcc: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 11fd0: 70 92 00 12 sts 0x1200, r7 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11fd4: 60 e0 ldi r22, 0x00 ; 0 11fd6: 70 e0 ldi r23, 0x00 ; 0 11fd8: 88 e4 ldi r24, 0x48 ; 72 11fda: 92 e4 ldi r25, 0x42 ; 66 11fdc: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 11fe0: 0f 94 a0 22 call 0x24540 ; 0x24540 11fe4: 0f 90 pop r0 11fe6: 0f 90 pop r0 11fe8: 0f 90 pop r0 11fea: 0f 90 pop r0 while (current_temperature_pinda < temp) 11fec: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11ff0: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11ff4: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11ff8: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11ffc: c7 01 movw r24, r14 11ffe: b6 01 movw r22, r12 12000: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 12004: 18 16 cp r1, r24 12006: 3c f4 brge .+14 ; 0x12016 { delay_keep_alive(1000); 12008: 88 ee ldi r24, 0xE8 ; 232 1200a: 93 e0 ldi r25, 0x03 ; 3 1200c: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 serialecho_temperatures(); 12010: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 12014: eb cf rjmp .-42 ; 0x11fec } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12016: 80 e0 ldi r24, 0x00 ; 0 12018: 90 e0 ldi r25, 0x00 ; 0 1201a: a0 ea ldi r26, 0xA0 ; 160 1201c: b0 e4 ldi r27, 0x40 ; 64 1201e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 12022: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 12026: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1202a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 1202e: 60 e0 ldi r22, 0x00 ; 0 12030: 70 e0 ldi r23, 0x00 ; 0 12032: 88 e4 ldi r24, 0x48 ; 72 12034: 92 e4 ldi r25, 0x42 ; 66 12036: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1203a: ef e4 ldi r30, 0x4F ; 79 1203c: f9 e8 ldi r31, 0x89 ; 137 1203e: 85 91 lpm r24, Z+ 12040: 95 91 lpm r25, Z+ 12042: a5 91 lpm r26, Z+ 12044: b4 91 lpm r27, Z 12046: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1204a: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1204e: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 12052: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 12056: e3 e5 ldi r30, 0x53 ; 83 12058: f9 e8 ldi r31, 0x89 ; 137 1205a: 85 91 lpm r24, Z+ 1205c: 95 91 lpm r25, Z+ 1205e: a5 91 lpm r26, Z+ 12060: b4 91 lpm r27, Z 12062: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 12066: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1206a: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1206e: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 12072: 60 e0 ldi r22, 0x00 ; 0 12074: 70 e0 ldi r23, 0x00 ; 0 12076: 88 e4 ldi r24, 0x48 ; 72 12078: 92 e4 ldi r25, 0x42 ; 66 1207a: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1207e: 0f 94 a0 22 call 0x24540 ; 0x24540 find_z_result = find_bed_induction_sensor_point_z(-1.f); 12082: 43 e0 ldi r20, 0x03 ; 3 12084: 60 e0 ldi r22, 0x00 ; 0 12086: 70 e0 ldi r23, 0x00 ; 0 12088: 80 e8 ldi r24, 0x80 ; 128 1208a: 9f eb ldi r25, 0xBF ; 191 1208c: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 12090: 95 e0 ldi r25, 0x05 ; 5 12092: 29 0e add r2, r25 12094: 31 1c adc r3, r1 12096: 0f 5f subi r16, 0xFF ; 255 12098: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 1209a: 81 11 cpse r24, r1 1209c: 04 c0 rjmp .+8 ; 0x120a6 lcd_temp_cal_show_result(find_z_result); 1209e: 0f 94 0c 0c call 0x21818 ; 0x21818 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); 120a2: 81 e0 ldi r24, 0x01 ; 1 120a4: a7 ce rjmp .-690 ; 0x11df4 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]); 120a6: 78 a5 ldd r23, Y+40 ; 0x28 120a8: 6c a5 ldd r22, Y+44 ; 0x2c 120aa: 98 a9 ldd r25, Y+48 ; 0x30 120ac: 88 ad ldd r24, Y+56 ; 0x38 120ae: 27 2f mov r18, r23 120b0: 36 2f mov r19, r22 120b2: 49 2f mov r20, r25 120b4: 58 2f mov r21, r24 120b6: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 120ba: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 120be: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 120c2: 90 91 00 12 lds r25, 0x1200 ; 0x801200 120c6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 120ca: f6 2e mov r15, r22 120cc: e7 2e mov r14, r23 120ce: d8 2e mov r13, r24 120d0: c9 2e mov r12, r25 120d2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 120d6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 120da: 40 91 40 04 lds r20, 0x0440 ; 0x800440 120de: 50 91 41 04 lds r21, 0x0441 ; 0x800441 120e2: d7 01 movw r26, r14 120e4: f6 01 movw r30, r12 120e6: 6b 2f mov r22, r27 120e8: 7a 2f mov r23, r26 120ea: 8f 2f mov r24, r31 120ec: 9e 2f mov r25, r30 120ee: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 120f2: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 120f6: 6c ab std Y+52, r22 ; 0x34 120f8: 7d ab std Y+53, r23 ; 0x35 120fa: 8e ab std Y+54, r24 ; 0x36 120fc: 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); 120fe: cf 92 push r12 12100: df 92 push r13 12102: ef 92 push r14 12104: ff 92 push r15 12106: 80 91 91 06 lds r24, 0x0691 ; 0x800691 1210a: 8f 93 push r24 1210c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 12110: 8f 93 push r24 12112: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 12116: 8f 93 push r24 12118: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 1211c: 8f 93 push r24 1211e: 9f 92 push r9 12120: 8f 92 push r8 12122: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 12126: 6c a9 ldd r22, Y+52 ; 0x34 12128: 7d a9 ldd r23, Y+53 ; 0x35 1212a: c5 01 movw r24, r10 1212c: 0f 94 7e a1 call 0x342fc ; 0x342fc 12130: a2 e0 ldi r26, 0x02 ; 2 12132: aa 0e add r10, r26 12134: b1 1c adc r11, r1 12136: 0f b6 in r0, 0x3f ; 63 12138: f8 94 cli 1213a: de bf out 0x3e, r29 ; 62 1213c: 0f be out 0x3f, r0 ; 63 1213e: cd bf out 0x3d, r28 ; 61 12140: d7 ce rjmp .-594 ; 0x11ef0 /*! ### 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(); 12142: 0e 94 b8 73 call 0xe770 ; 0xe770 12146: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1214a: 80 e1 ldi r24, 0x10 ; 16 1214c: 0e 94 28 c6 call 0x18c50 ; 0x18c50 12150: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc /*! ### 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); 12154: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 12158: 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; 1215a: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 1215e: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc 12162: 54 ec ldi r21, 0xC4 ; 196 12164: c5 2e mov r12, r21 12166: 52 e0 ldi r21, 0x02 ; 2 12168: d5 2e mov r13, r21 1216a: 8e 01 movw r16, r28 1216c: 0c 5d subi r16, 0xDC ; 220 1216e: 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) 12170: 58 01 movw r10, r16 12172: ee 24 eor r14, r14 12174: e3 94 inc r14 12176: 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]); 12178: d6 01 movw r26, r12 1217a: 8d 91 ld r24, X+ 1217c: 6d 01 movw r12, r26 1217e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12182: f5 01 movw r30, r10 12184: 81 93 st Z+, r24 12186: 5f 01 movw r10, r30 if(codes[i]) 12188: 88 23 and r24, r24 1218a: 91 f0 breq .+36 ; 0x121b0 values[i] = code_value(); 1218c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12190: f7 01 movw r30, r14 12192: ee 0f add r30, r30 12194: ff 1f adc r31, r31 12196: ee 0f add r30, r30 12198: ff 1f adc r31, r31 1219a: 34 97 sbiw r30, 0x04 ; 4 1219c: 21 e0 ldi r18, 0x01 ; 1 1219e: 30 e0 ldi r19, 0x00 ; 0 121a0: 2c 0f add r18, r28 121a2: 3d 1f adc r19, r29 121a4: e2 0f add r30, r18 121a6: f3 1f adc r31, r19 121a8: 60 83 st Z, r22 121aa: 71 83 std Z+1, r23 ; 0x01 121ac: 82 83 std Z+2, r24 ; 0x02 121ae: 93 83 std Z+3, r25 ; 0x03 121b0: 3f ef ldi r19, 0xFF ; 255 121b2: e3 1a sub r14, r19 121b4: 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) 121b6: 45 e0 ldi r20, 0x05 ; 5 121b8: e4 16 cp r14, r20 121ba: f1 04 cpc r15, r1 121bc: e9 f6 brne .-70 ; 0x12178 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 121be: 9f a0 ldd r9, Y+39 ; 0x27 121c0: fc a0 ldd r15, Y+36 ; 0x24 121c2: 99 20 and r9, r9 121c4: 01 f1 breq .+64 ; 0x12206 121c6: 20 e0 ldi r18, 0x00 ; 0 121c8: 30 e0 ldi r19, 0x00 ; 0 121ca: a9 01 movw r20, r18 121cc: 6d 85 ldd r22, Y+13 ; 0x0d 121ce: 7e 85 ldd r23, Y+14 ; 0x0e 121d0: 8f 85 ldd r24, Y+15 ; 0x0f 121d2: 98 89 ldd r25, Y+16 ; 0x10 121d4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 121d8: 81 11 cpse r24, r1 121da: 15 c0 rjmp .+42 ; 0x12206 121dc: f1 10 cpse r15, r1 121de: 13 c0 rjmp .+38 ; 0x12206 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 121e0: 8d a1 ldd r24, Y+37 ; 0x25 121e2: 81 11 cpse r24, r1 121e4: 10 c0 rjmp .+32 ; 0x12206 121e6: 8e a1 ldd r24, Y+38 ; 0x26 121e8: 81 11 cpse r24, r1 121ea: 0d c0 rjmp .+26 ; 0x12206 { // 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; 121ec: 10 92 01 12 sts 0x1201, r1 ; 0x801201 121f0: 10 92 02 12 sts 0x1202, r1 ; 0x801202 121f4: 10 92 03 12 sts 0x1203, r1 ; 0x801203 121f8: 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; 121fc: 81 e0 ldi r24, 0x01 ; 1 121fe: 80 93 ef 03 sts 0x03EF, r24 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> 12202: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 12206: 0f 94 a0 22 call 0x24540 ; 0x24540 1220a: ce 01 movw r24, r28 1220c: 01 96 adiw r24, 0x01 ; 1 1220e: 5c 01 movw r10, r24 12210: 2a e8 ldi r18, 0x8A ; 138 12212: c2 2e mov r12, r18 12214: 24 e0 ldi r18, 0x04 ; 4 12216: d2 2e mov r13, r18 12218: 35 ef ldi r19, 0xF5 ; 245 1221a: e3 2e mov r14, r19 1221c: 31 e1 ldi r19, 0x11 ; 17 1221e: f3 2e mov r15, r19 12220: 38 01 movw r6, r16 12222: 93 e0 ldi r25, 0x03 ; 3 12224: 69 0e add r6, r25 12226: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 12228: d8 01 movw r26, r16 1222a: 8d 91 ld r24, X+ 1222c: 8d 01 movw r16, r26 1222e: 88 23 and r24, r24 12230: 89 f0 breq .+34 ; 0x12254 current_position[i] = values[i] + cs.add_homing[i]; 12232: f6 01 movw r30, r12 12234: 20 81 ld r18, Z 12236: 31 81 ldd r19, Z+1 ; 0x01 12238: 42 81 ldd r20, Z+2 ; 0x02 1223a: 53 81 ldd r21, Z+3 ; 0x03 1223c: d5 01 movw r26, r10 1223e: 6d 91 ld r22, X+ 12240: 7d 91 ld r23, X+ 12242: 8d 91 ld r24, X+ 12244: 9c 91 ld r25, X 12246: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1224a: f7 01 movw r30, r14 1224c: 60 83 st Z, r22 1224e: 71 83 std Z+1, r23 ; 0x01 12250: 82 83 std Z+2, r24 ; 0x02 12252: 93 83 std Z+3, r25 ; 0x03 12254: f4 e0 ldi r31, 0x04 ; 4 12256: af 0e add r10, r31 12258: b1 1c adc r11, r1 1225a: 24 e0 ldi r18, 0x04 ; 4 1225c: c2 0e add r12, r18 1225e: d1 1c adc r13, r1 12260: 34 e0 ldi r19, 0x04 ; 4 12262: e3 0e add r14, r19 12264: 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) 12266: 60 16 cp r6, r16 12268: 71 06 cpc r7, r17 1226a: f1 f6 brne .-68 ; 0x12228 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 1226c: 99 20 and r9, r9 1226e: 61 f0 breq .+24 ; 0x12288 current_position[E_AXIS] = values[E_AXIS]; 12270: 8d 85 ldd r24, Y+13 ; 0x0d 12272: 9e 85 ldd r25, Y+14 ; 0x0e 12274: af 85 ldd r26, Y+15 ; 0x0f 12276: b8 89 ldd r27, Y+16 ; 0x10 12278: 80 93 01 12 sts 0x1201, r24 ; 0x801201 1227c: 90 93 02 12 sts 0x1202, r25 ; 0x801202 12280: a0 93 03 12 sts 0x1203, r26 ; 0x801203 12284: b0 93 04 12 sts 0x1204, r27 ; 0x801204 // Set all at once plan_set_position_curposXYZE(); 12288: 0f 94 90 84 call 0x30920 ; 0x30920 1228c: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc return true; } void farm_gcode_g98() { farm_mode = 1; 12290: 81 e0 ldi r24, 0x01 ; 1 12292: 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); 12296: 61 e0 ldi r22, 0x01 ; 1 12298: 84 ec ldi r24, 0xC4 ; 196 1229a: 9f e0 ldi r25, 0x0F ; 15 1229c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 122a0: 10 92 89 03 sts 0x0389, r1 ; 0x800389 122a4: 60 e0 ldi r22, 0x00 ; 0 122a6: 8f ef ldi r24, 0xFF ; 255 122a8: 9f e0 ldi r25, 0x0F ; 15 122aa: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 122ae: 0e 94 59 d8 call 0x1b0b2 ; 0x1b0b2 122b2: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 122b6: 8d 34 cpi r24, 0x4D ; 77 122b8: 11 f0 breq .+4 ; 0x122be 122ba: 0c 94 26 af jmp 0x15e4c ; 0x15e4c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 122be: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 122c2: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 122c6: f8 01 movw r30, r16 122c8: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 122ca: 81 91 ld r24, Z+ 122cc: 80 32 cpi r24, 0x20 ; 32 122ce: e9 f3 breq .-6 ; 0x122ca 122d0: 89 30 cpi r24, 0x09 ; 9 122d2: d9 f3 breq .-10 ; 0x122ca /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 122d4: 80 53 subi r24, 0x30 ; 48 122d6: 8a 30 cpi r24, 0x0A ; 10 122d8: 30 f0 brcs .+12 ; 0x122e6 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 122da: 1f 93 push r17 122dc: 0f 93 push r16 122de: 8f ef ldi r24, 0xFF ; 255 122e0: 90 e8 ldi r25, 0x80 ; 128 122e2: 0c 94 a6 84 jmp 0x1094c ; 0x1094c } else { mcode_in_progress = code_value_short(); 122e6: 0e 94 d8 55 call 0xabb0 ; 0xabb0 122ea: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 122ee: 80 93 aa 0d sts 0x0DAA, r24 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.491> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 122f2: 8e 3b cpi r24, 0xBE ; 190 122f4: 91 05 cpc r25, r1 122f6: 11 f4 brne .+4 ; 0x122fc 122f8: 0c 94 33 9c jmp 0x13866 ; 0x13866 122fc: 0c f0 brlt .+2 ; 0x12300 122fe: 07 c3 rjmp .+1550 ; 0x1290e 12300: 8c 34 cpi r24, 0x4C ; 76 12302: 91 05 cpc r25, r1 12304: 11 f4 brne .+4 ; 0x1230a 12306: 0c 94 4c 9b jmp 0x13698 ; 0x13698 1230a: 0c f0 brlt .+2 ; 0x1230e 1230c: de c1 rjmp .+956 ; 0x126ca 1230e: 8c 31 cpi r24, 0x1C ; 28 12310: 91 05 cpc r25, r1 12312: 11 f4 brne .+4 ; 0x12318 12314: 0c 94 83 99 jmp 0x13306 ; 0x13306 12318: 0c f0 brlt .+2 ; 0x1231c 1231a: f4 c0 rjmp .+488 ; 0x12504 1231c: 85 31 cpi r24, 0x15 ; 21 1231e: 91 05 cpc r25, r1 12320: 09 f4 brne .+2 ; 0x12324 12322: 0a c7 rjmp .+3604 ; 0x13138 12324: 0c f0 brlt .+2 ; 0x12328 12326: 5a c0 rjmp .+180 ; 0x123dc 12328: 81 31 cpi r24, 0x11 ; 17 1232a: 91 05 cpc r25, r1 1232c: 09 f4 brne .+2 ; 0x12330 1232e: f9 c6 rjmp .+3570 ; 0x13122 12330: dc f4 brge .+54 ; 0x12368 12332: 02 97 sbiw r24, 0x02 ; 2 12334: 08 f4 brcc .+2 ; 0x12338 12336: 5d c6 rjmp .+3258 ; 0x12ff2 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 12338: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 1233c: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 12340: 8f 51 subi r24, 0x1F ; 31 12342: 90 4f sbci r25, 0xF0 ; 240 12344: 9f 93 push r25 12346: 8f 93 push r24 12348: 1f 92 push r1 1234a: 8d e4 ldi r24, 0x4D ; 77 1234c: 8f 93 push r24 1234e: 84 ef ldi r24, 0xF4 ; 244 12350: 96 e6 ldi r25, 0x66 ; 102 12352: 9f 93 push r25 12354: 8f 93 push r24 12356: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1235a: 0f 90 pop r0 1235c: 0f 90 pop r0 1235e: 0f 90 pop r0 12360: 0f 90 pop r0 12362: 0f 90 pop r0 12364: 0f 90 pop r0 12366: a8 c6 rjmp .+3408 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12368: 82 31 cpi r24, 0x12 ; 18 1236a: 91 05 cpc r25, r1 1236c: 11 f4 brne .+4 ; 0x12372 1236e: 0c 94 de 9c jmp 0x139bc ; 0x139bc 12372: 44 97 sbiw r24, 0x14 ; 20 12374: 09 f7 brne .-62 ; 0x12338 #### 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() 12376: 81 e0 ldi r24, 0x01 ; 1 12378: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 1237c: 84 ee ldi r24, 0xE4 ; 228 1237e: 96 e6 ldi r25, 0x66 ; 102 12380: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 12384: 84 e5 ldi r24, 0x54 ; 84 12386: 0e 94 b6 55 call 0xab6c ; 0xab6c 1238a: 18 2f mov r17, r24 1238c: 8c e4 ldi r24, 0x4C ; 76 1238e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12392: 00 e0 ldi r16, 0x00 ; 0 12394: 80 fb bst r24, 0 12396: 00 f9 bld r16, 0 12398: 10 fb bst r17, 0 1239a: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 1239c: 80 ef ldi r24, 0xF0 ; 240 1239e: 93 e1 ldi r25, 0x13 ; 19 123a0: 0e 94 b7 70 call 0xe16e ; 0xe16e lsDive("",root, NULL, LS_SerialPrint, params); 123a4: 83 e2 ldi r24, 0x23 ; 35 123a6: e0 ef ldi r30, 0xF0 ; 240 123a8: f3 e1 ldi r31, 0x13 ; 19 123aa: de 01 movw r26, r28 123ac: 11 96 adiw r26, 0x01 ; 1 123ae: 01 90 ld r0, Z+ 123b0: 0d 92 st X+, r0 123b2: 8a 95 dec r24 123b4: e1 f7 brne .-8 ; 0x123ae 123b6: 20 e0 ldi r18, 0x00 ; 0 123b8: 50 e0 ldi r21, 0x00 ; 0 123ba: 40 e0 ldi r20, 0x00 ; 0 123bc: be 01 movw r22, r28 123be: 6f 5f subi r22, 0xFF ; 255 123c0: 7f 4f sbci r23, 0xFF ; 255 123c2: 8a ed ldi r24, 0xDA ; 218 123c4: 92 e0 ldi r25, 0x02 ; 2 123c6: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 123ca: ce 01 movw r24, r28 123cc: 01 96 adiw r24, 0x01 ; 1 123ce: 0e 94 bc 70 call 0xe178 ; 0xe178 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 123d2: 86 ed ldi r24, 0xD6 ; 214 123d4: 96 e6 ldi r25, 0x66 ; 102 123d6: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 123da: 6e c6 rjmp .+3292 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 123dc: 88 31 cpi r24, 0x18 ; 24 123de: 91 05 cpc r25, r1 123e0: 09 f4 brne .+2 ; 0x123e4 123e2: bb c6 rjmp .+3446 ; 0x1315a 123e4: 84 f4 brge .+32 ; 0x12406 123e6: 86 31 cpi r24, 0x16 ; 22 123e8: 91 05 cpc r25, r1 123ea: 09 f4 brne .+2 ; 0x123ee 123ec: a9 c6 rjmp .+3410 ; 0x13140 123ee: 47 97 sbiw r24, 0x17 ; 23 123f0: 09 f0 breq .+2 ; 0x123f4 123f2: a2 cf rjmp .-188 ; 0x12338 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 123f4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 123f8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 123fc: 61 e0 ldi r22, 0x01 ; 1 123fe: 04 96 adiw r24, 0x04 ; 4 12400: 0f 94 63 4c call 0x298c6 ; 0x298c6 12404: 59 c6 rjmp .+3250 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12406: 8a 31 cpi r24, 0x1A ; 26 12408: 91 05 cpc r25, r1 1240a: 09 f4 brne .+2 ; 0x1240e 1240c: ec c6 rjmp .+3544 ; 0x131e6 1240e: 0c f0 brlt .+2 ; 0x12412 12410: 0c c7 rjmp .+3608 ; 0x1322a 12412: 04 ec ldi r16, 0xC4 ; 196 12414: 12 e0 ldi r17, 0x02 ; 2 12416: f2 e4 ldi r31, 0x42 ; 66 12418: af 2e mov r10, r31 1241a: f2 e0 ldi r31, 0x02 ; 2 1241c: bf 2e mov r11, r31 1241e: a4 e2 ldi r26, 0x24 ; 36 12420: ca 2e mov r12, r26 12422: a2 e0 ldi r26, 0x02 ; 2 12424: da 2e mov r13, r26 12426: b8 e1 ldi r27, 0x18 ; 24 12428: eb 2e mov r14, r27 1242a: b2 e0 ldi r27, 0x02 ; 2 1242c: fb 2e mov r15, r27 1242e: 87 ec ldi r24, 0xC7 ; 199 12430: 88 2e mov r8, r24 12432: 82 e0 ldi r24, 0x02 ; 2 12434: 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])) { 12436: f8 01 movw r30, r16 12438: 81 91 ld r24, Z+ 1243a: 8f 01 movw r16, r30 1243c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12440: 88 23 and r24, r24 12442: 21 f1 breq .+72 ; 0x1248c //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 12444: 0e 94 8e 5a call 0xb51c ; 0xb51c 12448: d6 01 movw r26, r12 1244a: 4d 90 ld r4, X+ 1244c: 5d 90 ld r5, X+ 1244e: 6d 90 ld r6, X+ 12450: 7c 90 ld r7, X 12452: a3 01 movw r20, r6 12454: 92 01 movw r18, r4 12456: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1245a: 87 fd sbrc r24, 7 1245c: 11 c0 rjmp .+34 ; 0x12480 1245e: 0e 94 8e 5a call 0xb51c ; 0xb51c 12462: f7 01 movw r30, r14 12464: 40 80 ld r4, Z 12466: 51 80 ldd r5, Z+1 ; 0x01 12468: 62 80 ldd r6, Z+2 ; 0x02 1246a: 73 80 ldd r7, Z+3 ; 0x03 1246c: a3 01 movw r20, r6 1246e: 92 01 movw r18, r4 12470: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 12474: 18 16 cp r1, r24 12476: 24 f0 brlt .+8 ; 0x12480 12478: 0e 94 8e 5a call 0xb51c ; 0xb51c 1247c: 2b 01 movw r4, r22 1247e: 3c 01 movw r6, r24 12480: d5 01 movw r26, r10 12482: 4d 92 st X+, r4 12484: 5d 92 st X+, r5 12486: 6d 92 st X+, r6 12488: 7c 92 st X, r7 1248a: 13 97 sbiw r26, 0x03 ; 3 1248c: b4 e0 ldi r27, 0x04 ; 4 1248e: ab 0e add r10, r27 12490: b1 1c adc r11, r1 12492: e4 e0 ldi r30, 0x04 ; 4 12494: ce 0e add r12, r30 12496: d1 1c adc r13, r1 12498: f4 e0 ldi r31, 0x04 ; 4 1249a: ef 0e add r14, r31 1249c: 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++) { 1249e: 80 16 cp r8, r16 124a0: 91 06 cpc r9, r17 124a2: 49 f6 brne .-110 ; 0x12436 //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')) { 124a4: 83 e5 ldi r24, 0x53 ; 83 124a6: 0e 94 b6 55 call 0xab6c ; 0xab6c 124aa: 88 23 and r24, r24 124ac: 11 f4 brne .+4 ; 0x124b2 124ae: 0c 94 fc a8 jmp 0x151f8 ; 0x151f8 if ( code_value_uint8() == 0 ) { 124b2: 0e 94 cb 55 call 0xab96 ; 0xab96 124b6: 81 11 cpse r24, r1 124b8: ff c5 rjmp .+3070 ; 0x130b8 pause_position[X_AXIS] = X_PAUSE_POS; 124ba: 80 e0 ldi r24, 0x00 ; 0 124bc: 90 e0 ldi r25, 0x00 ; 0 124be: a8 e4 ldi r26, 0x48 ; 72 124c0: b2 e4 ldi r27, 0x42 ; 66 124c2: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.493> 124c6: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.493+0x1> 124ca: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.493+0x2> 124ce: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.493+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 124d2: 80 e0 ldi r24, 0x00 ; 0 124d4: 90 e0 ldi r25, 0x00 ; 0 124d6: ae e3 ldi r26, 0x3E ; 62 124d8: b3 e4 ldi r27, 0x43 ; 67 124da: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.493+0x4> 124de: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.493+0x5> 124e2: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.493+0x6> 124e6: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.493+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 124ea: 80 e0 ldi r24, 0x00 ; 0 124ec: 90 e0 ldi r25, 0x00 ; 0 124ee: a0 ea ldi r26, 0xA0 ; 160 124f0: b1 e4 ldi r27, 0x41 ; 65 124f2: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.493+0x8> 124f6: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.493+0x9> 124fa: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.493+0xa> 124fe: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.493+0xb> 12502: da c5 rjmp .+2996 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12504: 8c 32 cpi r24, 0x2C ; 44 12506: 91 05 cpc r25, r1 12508: 09 f4 brne .+2 ; 0x1250c 1250a: ce c7 rjmp .+3996 ; 0x134a8 1250c: 0c f0 brlt .+2 ; 0x12510 1250e: 8f c0 rjmp .+286 ; 0x1262e 12510: 8f 31 cpi r24, 0x1F ; 31 12512: 91 05 cpc r25, r1 12514: 09 f4 brne .+2 ; 0x12518 12516: 9e c7 rjmp .+3900 ; 0x13454 12518: 0c f0 brlt .+2 ; 0x1251c 1251a: 52 c0 rjmp .+164 ; 0x125c0 1251c: 8d 31 cpi r24, 0x1D ; 29 1251e: 91 05 cpc r25, r1 12520: 09 f4 brne .+2 ; 0x12524 12522: ca c5 rjmp .+2964 ; 0x130b8 12524: 4e 97 sbiw r24, 0x1e ; 30 12526: 09 f0 breq .+2 ; 0x1252a 12528: 07 cf rjmp .-498 ; 0x12338 M30 [filename] */ case 30: if (card.mounted){ 1252a: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1252e: 88 23 and r24, r24 12530: 09 f4 brne .+2 ; 0x12534 12532: c2 c5 rjmp .+2948 ; 0x130b8 card.closefile(); 12534: 0f 94 3a 42 call 0x28474 ; 0x28474 card.removeFile(strchr_pointer + 4); 12538: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 1253c: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12540: 0c 5f subi r16, 0xFC ; 252 12542: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 12544: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 12548: 88 23 and r24, r24 1254a: 09 f4 brne .+2 ; 0x1254e 1254c: b5 c5 rjmp .+2922 ; 0x130b8 file.close(); 1254e: 8a ef ldi r24, 0xFA ; 250 12550: 95 e1 ldi r25, 0x15 ; 21 12552: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 sdprinting = false; 12556: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 1255a: 1d a3 std Y+37, r17 ; 0x25 1255c: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 1255e: ce 01 movw r24, r28 12560: 84 96 adiw r24, 0x24 ; 36 12562: 0f 94 de 4b call 0x297bc ; 0x297bc 12566: 88 23 and r24, r24 12568: 09 f4 brne .+2 ; 0x1256c 1256a: a6 c5 rjmp .+2892 ; 0x130b8 return; if (file.remove(curDir, fname)) 1256c: 4c a1 ldd r20, Y+36 ; 0x24 1256e: 5d a1 ldd r21, Y+37 ; 0x25 12570: 60 91 13 14 lds r22, 0x1413 ; 0x801413 12574: 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) {} 12578: 19 82 std Y+1, r1 ; 0x01 1257a: 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; 1257c: 22 e0 ldi r18, 0x02 ; 2 1257e: ce 01 movw r24, r28 12580: 01 96 adiw r24, 0x01 ; 1 12582: 0f 94 e9 9a call 0x335d2 ; 0x335d2 12586: 81 11 cpse r24, r1 12588: c6 c6 rjmp .+3468 ; 0x13316 return file.remove(); fail: // can't set iostate - static function return false; 1258a: 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; 1258c: ce 01 movw r24, r28 1258e: 01 96 adiw r24, 0x01 ; 1 12590: 0e 94 bc 70 call 0xe178 ; 0xe178 12594: 11 23 and r17, r17 12596: 09 f4 brne .+2 ; 0x1259a 12598: d5 c6 rjmp .+3498 ; 0x13344 { SERIAL_PROTOCOLPGM("File deleted:"); 1259a: 84 e7 ldi r24, 0x74 ; 116 1259c: 9e e7 ldi r25, 0x7E ; 126 1259e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(fname); 125a2: 8c a1 ldd r24, Y+36 ; 0x24 125a4: 9d a1 ldd r25, Y+37 ; 0x25 125a6: 0f 94 5d 9a call 0x334ba ; 0x334ba sdpos = 0; 125aa: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 125ae: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 125b2: 10 92 80 16 sts 0x1680, r1 ; 0x801680 125b6: 10 92 81 16 sts 0x1681, r1 ; 0x801681 #ifdef SDCARD_SORT_ALPHA presort(); 125ba: 0f 94 a2 49 call 0x29344 ; 0x29344 125be: 7c c5 rjmp .+2808 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 125c0: 80 32 cpi r24, 0x20 ; 32 125c2: 91 05 cpc r25, r1 125c4: 09 f4 brne .+2 ; 0x125c8 125c6: cc c6 rjmp .+3480 ; 0x13360 125c8: 8a 97 sbiw r24, 0x2a ; 42 125ca: 09 f0 breq .+2 ; 0x125ce 125cc: b5 ce rjmp .-662 ; 0x12338 #### 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')) 125ce: 83 e5 ldi r24, 0x53 ; 83 125d0: 0e 94 b6 55 call 0xab6c ; 0xab6c 125d4: 88 23 and r24, r24 125d6: 09 f4 brne .+2 ; 0x125da 125d8: 6f c5 rjmp .+2782 ; 0x130b8 { uint8_t pin_status = code_value_uint8(); 125da: 0e 94 cb 55 call 0xab96 ; 0xab96 125de: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 125e0: 80 e5 ldi r24, 0x50 ; 80 125e2: 0e 94 b6 55 call 0xab6c ; 0xab6c */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 125e6: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 125e8: 88 23 and r24, r24 125ea: 19 f0 breq .+6 ; 0x125f2 pin_number = code_value_uint8(); 125ec: 0e 94 cb 55 call 0xab96 ; 0xab96 125f0: 18 2f mov r17, r24 125f2: e4 ed ldi r30, 0xD4 ; 212 125f4: 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) 125f6: 84 91 lpm r24, Z 125f8: 81 17 cp r24, r17 125fa: 09 f4 brne .+2 ; 0x125fe 125fc: 5d c5 rjmp .+2746 ; 0x130b8 125fe: 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++) 12600: 30 e8 ldi r19, 0x80 ; 128 12602: e0 3f cpi r30, 0xF0 ; 240 12604: f3 07 cpc r31, r19 12606: b9 f7 brne .-18 ; 0x125f6 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 12608: 16 30 cpi r17, 0x06 ; 6 1260a: 09 f0 breq .+2 ; 0x1260e 1260c: 4a c7 rjmp .+3732 ; 0x134a2 fanSpeed = pin_status; 1260e: 00 93 e9 11 sts 0x11E9, r16 ; 0x8011e9 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 12612: 61 e0 ldi r22, 0x01 ; 1 12614: 81 2f mov r24, r17 12616: 0e 94 38 c0 call 0x18070 ; 0x18070 digitalWrite(pin_number, pin_status); 1261a: 60 2f mov r22, r16 1261c: 81 2f mov r24, r17 1261e: 0e 94 0a c0 call 0x18014 ; 0x18014 analogWrite(pin_number, pin_status); 12622: 60 2f mov r22, r16 12624: 70 e0 ldi r23, 0x00 ; 0 12626: 81 2f mov r24, r17 12628: 0e 94 69 c0 call 0x180d2 ; 0x180d2 1262c: 45 c5 rjmp .+2698 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1262e: 8f 32 cpi r24, 0x2F ; 47 12630: 91 05 cpc r25, r1 12632: 09 f4 brne .+2 ; 0x12636 12634: 62 c7 rjmp .+3780 ; 0x134fa 12636: 5c f5 brge .+86 ; 0x1268e 12638: 8d 32 cpi r24, 0x2D ; 45 1263a: 91 05 cpc r25, r1 1263c: 09 f4 brne .+2 ; 0x12640 1263e: 4d c7 rjmp .+3738 ; 0x134da 12640: 8e 97 sbiw r24, 0x2e ; 46 12642: 09 f0 breq .+2 ; 0x12646 12644: 79 ce rjmp .-782 ; 0x12338 ### 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()) { 12646: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1264a: 88 23 and r24, r24 1264c: 09 f4 brne .+2 ; 0x12650 1264e: 50 c7 rjmp .+3744 ; 0x134f0 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 12650: ce 01 movw r24, r28 12652: 01 96 adiw r24, 0x01 ; 1 12654: 0f 94 e7 52 call 0x2a5ce ; 0x2a5ce 12658: 88 23 and r24, r24 1265a: 09 f4 brne .+2 ; 0x1265e 1265c: 44 c7 rjmp .+3720 ; 0x134e6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1265e: 89 81 ldd r24, Y+1 ; 0x01 12660: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12664: 8e e2 ldi r24, 0x2E ; 46 12666: 0e 94 c2 70 call 0xe184 ; 0xe184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1266a: 8a 81 ldd r24, Y+2 ; 0x02 1266c: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12670: 8e e2 ldi r24, 0x2E ; 46 12672: 0e 94 c2 70 call 0xe184 ; 0xe184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12676: 8b 81 ldd r24, Y+3 ; 0x03 12678: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1267c: 8e e2 ldi r24, 0x2E ; 46 1267e: 0e 94 c2 70 call 0xe184 ; 0xe184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12682: 8c 81 ldd r24, Y+4 ; 0x04 12684: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 12688: 0f 94 5c 99 call 0x332b8 ; 0x332b8 1268c: 15 c5 rjmp .+2602 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1268e: 89 34 cpi r24, 0x49 ; 73 12690: 91 05 cpc r25, r1 12692: 09 f4 brne .+2 ; 0x12696 12694: 5b c7 rjmp .+3766 ; 0x1354c 12696: 8b 34 cpi r24, 0x4B ; 75 12698: 91 05 cpc r25, r1 1269a: 11 f4 brne .+4 ; 0x126a0 1269c: 0c 94 46 9b jmp 0x1368c ; 0x1368c 126a0: 88 34 cpi r24, 0x48 ; 72 126a2: 91 05 cpc r25, r1 126a4: 09 f0 breq .+2 ; 0x126a8 126a6: 48 ce rjmp .-880 ; 0x12338 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 126a8: 83 e5 ldi r24, 0x53 ; 83 126aa: 0e 94 b6 55 call 0xab6c ; 0xab6c 126ae: 88 23 and r24, r24 126b0: 09 f4 brne .+2 ; 0x126b4 126b2: 3d c7 rjmp .+3706 ; 0x1352e switch (code_value_uint8()){ 126b4: 0e 94 cb 55 call 0xab96 ; 0xab96 126b8: 88 23 and r24, r24 126ba: 09 f4 brne .+2 ; 0x126be 126bc: 35 c7 rjmp .+3690 ; 0x13528 126be: 81 30 cpi r24, 0x01 ; 1 126c0: 09 f0 breq .+2 ; 0x126c4 126c2: fa c4 rjmp .+2548 ; 0x130b8 126c4: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 126c8: f7 c4 rjmp .+2542 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 126ca: 8b 36 cpi r24, 0x6B ; 107 126cc: 91 05 cpc r25, r1 126ce: 11 f4 brne .+4 ; 0x126d4 126d0: 0c 94 d5 9c jmp 0x139aa ; 0x139aa 126d4: 0c f0 brlt .+2 ; 0x126d8 126d6: 83 c0 rjmp .+262 ; 0x127de 126d8: 84 35 cpi r24, 0x54 ; 84 126da: 91 05 cpc r25, r1 126dc: 11 f4 brne .+4 ; 0x126e2 126de: 0c 94 de 9c jmp 0x139bc ; 0x139bc 126e2: bc f5 brge .+110 ; 0x12752 126e4: 8f 34 cpi r24, 0x4F ; 79 126e6: 91 05 cpc r25, r1 126e8: 09 f4 brne .+2 ; 0x126ec 126ea: ee c7 rjmp .+4060 ; 0x136c8 126ec: 1c f5 brge .+70 ; 0x12734 126ee: 8d 34 cpi r24, 0x4D ; 77 126f0: 91 05 cpc r25, r1 126f2: 09 f4 brne .+2 ; 0x126f6 126f4: e4 c7 rjmp .+4040 ; 0x136be 126f6: 8e 34 cpi r24, 0x4E ; 78 126f8: 91 05 cpc r25, r1 126fa: 09 f0 breq .+2 ; 0x126fe 126fc: 1d ce rjmp .-966 ; 0x12338 ### M78 - Show statistical information about the print jobs M78: Show statistical information about the print jobs */ case 78: { // @todo useful for maintenance notifications SERIAL_ECHOPGM("STATS "); 126fe: 89 ea ldi r24, 0xA9 ; 169 12700: 90 e8 ldi r25, 0x80 ; 128 12702: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 12706: 8d ee ldi r24, 0xED ; 237 12708: 9f e0 ldi r25, 0x0F ; 15 1270a: 0f 94 44 a1 call 0x34288 ; 0x34288 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1270e: 4a e0 ldi r20, 0x0A ; 10 12710: 0f 94 8c 97 call 0x32f18 ; 0x32f18 SERIAL_ECHOPGM(" min "); 12714: 83 ea ldi r24, 0xA3 ; 163 12716: 90 e8 ldi r25, 0x80 ; 128 12718: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 1271c: 81 ef ldi r24, 0xF1 ; 241 1271e: 9f e0 ldi r25, 0x0F ; 15 12720: 0f 94 44 a1 call 0x34288 ; 0x34288 12724: 4a e0 ldi r20, 0x0A ; 10 12726: 0f 94 8c 97 call 0x32f18 ; 0x32f18 SERIAL_ECHOLNPGM(" cm."); 1272a: 8e e9 ldi r24, 0x9E ; 158 1272c: 90 e8 ldi r25, 0x80 ; 128 1272e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 12732: c2 c4 rjmp .+2436 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12734: 82 35 cpi r24, 0x52 ; 82 12736: 91 05 cpc r25, r1 12738: 11 f4 brne .+4 ; 0x1273e 1273a: 0c 94 d8 9c jmp 0x139b0 ; 0x139b0 1273e: 83 35 cpi r24, 0x53 ; 83 12740: 91 05 cpc r25, r1 12742: 09 f0 breq .+2 ; 0x12746 12744: f9 cd rjmp .-1038 ; 0x12338 /*! ### 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; 12746: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 1274a: 88 60 ori r24, 0x08 ; 8 1274c: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 12750: b3 c4 rjmp .+2406 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12752: 8c 35 cpi r24, 0x5C ; 92 12754: 91 05 cpc r25, r1 12756: 11 f4 brne .+4 ; 0x1275c 12758: 0c 94 47 9d jmp 0x13a8e ; 0x13a8e 1275c: 34 f5 brge .+76 ; 0x127aa 1275e: 85 35 cpi r24, 0x55 ; 85 12760: 91 05 cpc r25, r1 12762: 11 f4 brne .+4 ; 0x12768 12764: 0c 94 2e 9d jmp 0x13a5c ; 0x13a5c 12768: 86 35 cpi r24, 0x56 ; 86 1276a: 91 05 cpc r25, r1 1276c: 09 f0 breq .+2 ; 0x12770 1276e: e4 cd rjmp .-1080 ; 0x12338 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 12770: 83 e5 ldi r24, 0x53 ; 83 12772: 0e 94 b6 55 call 0xab6c ; 0xab6c 12776: 88 23 and r24, r24 12778: 09 f4 brne .+2 ; 0x1277c 1277a: 9e c4 rjmp .+2364 ; 0x130b8 safetytimer_inactive_time = code_value() * 1000; 1277c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12780: 20 e0 ldi r18, 0x00 ; 0 12782: 30 e0 ldi r19, 0x00 ; 0 12784: 4a e7 ldi r20, 0x7A ; 122 12786: 54 e4 ldi r21, 0x44 ; 68 12788: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1278c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12790: 60 93 33 02 sts 0x0233, r22 ; 0x800233 12794: 70 93 34 02 sts 0x0234, r23 ; 0x800234 12798: 80 93 35 02 sts 0x0235, r24 ; 0x800235 1279c: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 127a0: 8a e1 ldi r24, 0x1A ; 26 127a2: 96 e0 ldi r25, 0x06 ; 6 127a4: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> 127a8: 87 c4 rjmp .+2318 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127aa: 89 36 cpi r24, 0x69 ; 105 127ac: 91 05 cpc r25, r1 127ae: 09 f4 brne .+2 ; 0x127b2 127b0: de c7 rjmp .+4028 ; 0x1376e 127b2: 14 f0 brlt .+4 ; 0x127b8 127b4: 0c 94 c7 9c jmp 0x1398e ; 0x1398e 127b8: 88 36 cpi r24, 0x68 ; 104 127ba: 91 05 cpc r25, r1 127bc: 09 f0 breq .+2 ; 0x127c0 127be: bc cd rjmp .-1160 ; 0x12338 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 127c0: 83 e5 ldi r24, 0x53 ; 83 127c2: 0e 94 b6 55 call 0xab6c ; 0xab6c 127c6: 88 23 and r24, r24 127c8: 09 f4 brne .+2 ; 0x127cc 127ca: 76 c4 rjmp .+2284 ; 0x130b8 { setTargetHotend(code_value()); 127cc: 0e 94 8e 5a call 0xb51c ; 0xb51c return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 127d0: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 127d4: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 127d8: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 127dc: 6d c4 rjmp .+2266 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127de: 85 37 cpi r24, 0x75 ; 117 127e0: 91 05 cpc r25, r1 127e2: 11 f4 brne .+4 ; 0x127e8 127e4: 0c 94 c5 9e jmp 0x13d8a ; 0x13d8a 127e8: b4 f5 brge .+108 ; 0x12856 127ea: 80 37 cpi r24, 0x70 ; 112 127ec: 91 05 cpc r25, r1 127ee: 09 f4 brne .+2 ; 0x127f2 127f0: ab c7 rjmp .+3926 ; 0x13748 127f2: cc f4 brge .+50 ; 0x12826 127f4: 8d 36 cpi r24, 0x6D ; 109 127f6: 91 05 cpc r25, r1 127f8: 09 f4 brne .+2 ; 0x127fc 127fa: e5 c7 rjmp .+4042 ; 0x137c6 127fc: 8e 36 cpi r24, 0x6E ; 110 127fe: 91 05 cpc r25, r1 12800: 09 f0 breq .+2 ; 0x12804 12802: 9a cd rjmp .-1228 ; 0x12338 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 12804: 8e e4 ldi r24, 0x4E ; 78 12806: 0e 94 b6 55 call 0xab6c ; 0xab6c 1280a: 88 23 and r24, r24 1280c: 09 f4 brne .+2 ; 0x12810 1280e: 54 c4 rjmp .+2216 ; 0x130b8 gcode_LastN = code_value_long(); 12810: 0e 94 1e 56 call 0xac3c ; 0xac3c 12814: 60 93 d1 11 sts 0x11D1, r22 ; 0x8011d1 12818: 70 93 d2 11 sts 0x11D2, r23 ; 0x8011d2 1281c: 80 93 d3 11 sts 0x11D3, r24 ; 0x8011d3 12820: 90 93 d4 11 sts 0x11D4, r25 ; 0x8011d4 12824: 49 c4 rjmp .+2194 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12826: 82 37 cpi r24, 0x72 ; 114 12828: 91 05 cpc r25, r1 1282a: 11 f4 brne .+4 ; 0x12830 1282c: 0c 94 c2 9e jmp 0x13d84 ; 0x13d84 12830: 14 f4 brge .+4 ; 0x12836 12832: 0c 94 cf 9d jmp 0x13b9e ; 0x13b9e 12836: 83 37 cpi r24, 0x73 ; 115 12838: 91 05 cpc r25, r1 1283a: 09 f0 breq .+2 ; 0x1283e 1283c: 7d cd rjmp .-1286 ; 0x12338 #### 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')) { 1283e: 86 e5 ldi r24, 0x56 ; 86 12840: 0e 94 b6 55 call 0xab6c ; 0xab6c 12844: 88 23 and r24, r24 12846: 11 f4 brne .+4 ; 0x1284c 12848: 0c 94 ee 9d jmp 0x13bdc ; 0x13bdc // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 1284c: 89 ed ldi r24, 0xD9 ; 217 1284e: 9f e9 ldi r25, 0x9F ; 159 12850: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 12854: 31 c4 rjmp .+2146 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12856: 8b 37 cpi r24, 0x7B ; 123 12858: 91 05 cpc r25, r1 1285a: 11 f4 brne .+4 ; 0x12860 1285c: 0c 94 1d 9f jmp 0x13e3a ; 0x13e3a 12860: 0c f0 brlt .+2 ; 0x12864 12862: 48 c0 rjmp .+144 ; 0x128f4 12864: 86 37 cpi r24, 0x76 ; 118 12866: 91 05 cpc r25, r1 12868: 11 f4 brne .+4 ; 0x1286e 1286a: 0c 94 d5 9e jmp 0x13daa ; 0x13daa 1286e: 87 37 cpi r24, 0x77 ; 119 12870: 91 05 cpc r25, r1 12872: 09 f0 breq .+2 ; 0x12876 12874: 61 cd rjmp .-1342 ; 0x12338 /*! ### 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 12876: 80 e1 ldi r24, 0x10 ; 16 12878: 96 e6 ldi r25, 0x66 ; 102 1287a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(); 1287e: 0f 94 5c 99 call 0x332b8 ; 0x332b8 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 12882: 88 e0 ldi r24, 0x08 ; 8 12884: 96 e6 ldi r25, 0x66 ; 102 12886: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 1288a: 1e 9b sbis 0x03, 6 ; 3 1288c: 02 c0 rjmp .+4 ; 0x12892 1288e: 0c 94 0d 9f jmp 0x13e1a ; 0x13e1a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 12892: 83 e0 ldi r24, 0x03 ; 3 12894: 96 e6 ldi r25, 0x66 ; 102 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); 12896: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1289a: 0f 94 5c 99 call 0x332b8 ; 0x332b8 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 1289e: 81 ef ldi r24, 0xF1 ; 241 128a0: 95 e6 ldi r25, 0x65 ; 101 128a2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 128a6: 1d 9b sbis 0x03, 5 ; 3 128a8: 02 c0 rjmp .+4 ; 0x128ae 128aa: 0c 94 11 9f jmp 0x13e22 ; 0x13e22 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128ae: 83 e0 ldi r24, 0x03 ; 3 128b0: 96 e6 ldi r25, 0x66 ; 102 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); 128b2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128b6: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 128ba: 89 ee ldi r24, 0xE9 ; 233 128bc: 95 e6 ldi r25, 0x65 ; 101 128be: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 128c2: 1c 9b sbis 0x03, 4 ; 3 128c4: 02 c0 rjmp .+4 ; 0x128ca 128c6: 0c 94 15 9f jmp 0x13e2a ; 0x13e2a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128ca: 83 e0 ldi r24, 0x03 ; 3 128cc: 96 e6 ldi r25, 0x66 ; 102 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); 128ce: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128d2: 0f 94 5c 99 call 0x332b8 ; 0x332b8 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 128d6: 81 ee ldi r24, 0xE1 ; 225 128d8: 95 e6 ldi r25, 0x65 ; 101 128da: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 128de: 01 99 sbic 0x00, 1 ; 0 128e0: 02 c0 rjmp .+4 ; 0x128e6 128e2: 0c 94 19 9f jmp 0x13e32 ; 0x13e32 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128e6: 83 e0 ldi r24, 0x03 ; 3 128e8: 96 e6 ldi r25, 0x66 ; 102 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); 128ea: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128ee: 0f 94 5c 99 call 0x332b8 ; 0x332b8 128f2: e2 c3 rjmp .+1988 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 128f4: 8c 38 cpi r24, 0x8C ; 140 128f6: 91 05 cpc r25, r1 128f8: 09 f4 brne .+2 ; 0x128fc 128fa: 2a c7 rjmp .+3668 ; 0x13750 128fc: 8b 39 cpi r24, 0x9B ; 155 128fe: 91 05 cpc r25, r1 12900: 09 f4 brne .+2 ; 0x12904 12902: 41 c7 rjmp .+3714 ; 0x13786 12904: 8d 37 cpi r24, 0x7D ; 125 12906: 91 05 cpc r25, r1 12908: 09 f0 breq .+2 ; 0x1290c 1290a: 16 cd rjmp .-1492 ; 0x12338 1290c: 82 cd rjmp .-1276 ; 0x12412 1290e: 84 3a cpi r24, 0xA4 ; 164 12910: 41 e0 ldi r20, 0x01 ; 1 12912: 94 07 cpc r25, r20 12914: 11 f4 brne .+4 ; 0x1291a 12916: 0c 94 3c a2 jmp 0x14478 ; 0x14478 1291a: 0c f0 brlt .+2 ; 0x1291e 1291c: 38 c2 rjmp .+1136 ; 0x12d8e 1291e: 82 3e cpi r24, 0xE2 ; 226 12920: 91 05 cpc r25, r1 12922: 11 f4 brne .+4 ; 0x12928 12924: 0c 94 c6 a0 jmp 0x1418c ; 0x1418c 12928: 0c f0 brlt .+2 ; 0x1292c 1292a: 6b c1 rjmp .+726 ; 0x12c02 1292c: 8e 3c cpi r24, 0xCE ; 206 1292e: 91 05 cpc r25, r1 12930: 11 f4 brne .+4 ; 0x12936 12932: 0c 94 d9 9f jmp 0x13fb2 ; 0x13fb2 12936: 0c f0 brlt .+2 ; 0x1293a 12938: b1 c0 rjmp .+354 ; 0x12a9c 1293a: 8b 3c cpi r24, 0xCB ; 203 1293c: 91 05 cpc r25, r1 1293e: 11 f4 brne .+4 ; 0x12944 12940: 0c 94 63 9f jmp 0x13ec6 ; 0x13ec6 12944: 5c f5 brge .+86 ; 0x1299c 12946: 88 3c cpi r24, 0xC8 ; 200 12948: 91 05 cpc r25, r1 1294a: 11 f4 brne .+4 ; 0x12950 1294c: 0c 94 20 9f jmp 0x13e40 ; 0x13e40 12950: 04 ec ldi r16, 0xC4 ; 196 12952: 12 e0 ldi r17, 0x02 ; 2 12954: a2 e3 ldi r26, 0x32 ; 50 12956: ea 2e mov r14, r26 12958: a4 e0 ldi r26, 0x04 ; 4 1295a: fa 2e mov r15, r26 1295c: b8 ec ldi r27, 0xC8 ; 200 1295e: cb 2e mov r12, r27 12960: b2 e0 ldi r27, 0x02 ; 2 12962: db 2e mov r13, r27 12964: 89 3c cpi r24, 0xC9 ; 201 12966: 91 05 cpc r25, r1 12968: 09 f0 breq .+2 ; 0x1296c 1296a: e6 cc rjmp .-1588 ; 0x12338 - `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])) 1296c: d8 01 movw r26, r16 1296e: 8d 91 ld r24, X+ 12970: 8d 01 movw r16, r26 12972: 0e 94 b6 55 call 0xab6c ; 0xab6c 12976: 88 23 and r24, r24 12978: 49 f0 breq .+18 ; 0x1298c { unsigned long val = code_value(); 1297a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1297e: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12982: f7 01 movw r30, r14 12984: 64 a3 std Z+36, r22 ; 0x24 12986: 75 a3 std Z+37, r23 ; 0x25 12988: 86 a3 std Z+38, r24 ; 0x26 1298a: 97 a3 std Z+39, r25 ; 0x27 1298c: f4 e0 ldi r31, 0x04 ; 4 1298e: ef 0e add r14, r31 12990: 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++) 12992: c0 16 cp r12, r16 12994: d1 06 cpc r13, r17 12996: 51 f7 brne .-44 ; 0x1296c 12998: 0c 94 c4 9d jmp 0x13b88 ; 0x13b88 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1299c: 8c 3c cpi r24, 0xCC ; 204 1299e: 91 05 cpc r25, r1 129a0: 11 f4 brne .+4 ; 0x129a6 129a2: 0c 94 82 9f jmp 0x13f04 ; 0x13f04 129a6: 8d 3c cpi r24, 0xCD ; 205 129a8: 91 05 cpc r25, r1 129aa: 09 f0 breq .+2 ; 0x129ae 129ac: c5 cc rjmp .-1654 ; 0x12338 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 129ae: 83 e5 ldi r24, 0x53 ; 83 129b0: 0e 94 b6 55 call 0xab6c ; 0xab6c 129b4: 88 23 and r24, r24 129b6: 51 f0 breq .+20 ; 0x129cc 129b8: 0e 94 8e 5a call 0xb51c ; 0xb51c 129bc: 60 93 6e 04 sts 0x046E, r22 ; 0x80046e 129c0: 70 93 6f 04 sts 0x046F, r23 ; 0x80046f 129c4: 80 93 70 04 sts 0x0470, r24 ; 0x800470 129c8: 90 93 71 04 sts 0x0471, r25 ; 0x800471 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 129cc: 84 e5 ldi r24, 0x54 ; 84 129ce: 0e 94 b6 55 call 0xab6c ; 0xab6c 129d2: 88 23 and r24, r24 129d4: 51 f0 breq .+20 ; 0x129ea 129d6: 0e 94 8e 5a call 0xb51c ; 0xb51c 129da: 60 93 72 04 sts 0x0472, r22 ; 0x800472 129de: 70 93 73 04 sts 0x0473, r23 ; 0x800473 129e2: 80 93 74 04 sts 0x0474, r24 ; 0x800474 129e6: 90 93 75 04 sts 0x0475, r25 ; 0x800475 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 129ea: 82 e4 ldi r24, 0x42 ; 66 129ec: 0e 94 b6 55 call 0xab6c ; 0xab6c 129f0: 88 23 and r24, r24 129f2: 61 f0 breq .+24 ; 0x12a0c 129f4: 0e 94 8e 5a call 0xb51c ; 0xb51c 129f8: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 129fc: 60 93 76 04 sts 0x0476, r22 ; 0x800476 12a00: 70 93 77 04 sts 0x0477, r23 ; 0x800477 12a04: 80 93 78 04 sts 0x0478, r24 ; 0x800478 12a08: 90 93 79 04 sts 0x0479, r25 ; 0x800479 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 12a0c: 88 e5 ldi r24, 0x58 ; 88 12a0e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a12: 88 23 and r24, r24 12a14: 91 f0 breq .+36 ; 0x12a3a 12a16: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a1a: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 12a1e: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12a22: 80 93 80 04 sts 0x0480, r24 ; 0x800480 12a26: 90 93 81 04 sts 0x0481, r25 ; 0x800481 12a2a: 60 93 7a 04 sts 0x047A, r22 ; 0x80047a 12a2e: 70 93 7b 04 sts 0x047B, r23 ; 0x80047b 12a32: 80 93 7c 04 sts 0x047C, r24 ; 0x80047c 12a36: 90 93 7d 04 sts 0x047D, r25 ; 0x80047d if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 12a3a: 89 e5 ldi r24, 0x59 ; 89 12a3c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a40: 88 23 and r24, r24 12a42: 51 f0 breq .+20 ; 0x12a58 12a44: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a48: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 12a4c: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12a50: 80 93 80 04 sts 0x0480, r24 ; 0x800480 12a54: 90 93 81 04 sts 0x0481, r25 ; 0x800481 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 12a58: 8a e5 ldi r24, 0x5A ; 90 12a5a: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a5e: 88 23 and r24, r24 12a60: 51 f0 breq .+20 ; 0x12a76 12a62: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a66: 60 93 82 04 sts 0x0482, r22 ; 0x800482 12a6a: 70 93 83 04 sts 0x0483, r23 ; 0x800483 12a6e: 80 93 84 04 sts 0x0484, r24 ; 0x800484 12a72: 90 93 85 04 sts 0x0485, r25 ; 0x800485 if(code_seen('E')) 12a76: 85 e4 ldi r24, 0x45 ; 69 12a78: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a7c: 88 23 and r24, r24 12a7e: 09 f4 brne .+2 ; 0x12a82 12a80: 1b c3 rjmp .+1590 ; 0x130b8 { float e = code_value(); 12a82: 0e 94 8e 5a call 0xb51c ; 0xb51c #ifndef LA_NOCOMPAT e = la10c_jerk(e); 12a86: 0e 94 04 74 call 0xe808 ; 0xe808 #endif cs.max_jerk[E_AXIS] = e; 12a8a: 60 93 86 04 sts 0x0486, r22 ; 0x800486 12a8e: 70 93 87 04 sts 0x0487, r23 ; 0x800487 12a92: 80 93 88 04 sts 0x0488, r24 ; 0x800488 12a96: 90 93 89 04 sts 0x0489, r25 ; 0x800489 12a9a: 0e c3 rjmp .+1564 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12a9c: 81 3d cpi r24, 0xD1 ; 209 12a9e: 91 05 cpc r25, r1 12aa0: 11 f4 brne .+4 ; 0x12aa6 12aa2: 0c 94 26 a0 jmp 0x1404c ; 0x1404c 12aa6: 5c f5 brge .+86 ; 0x12afe 12aa8: 8f 3c cpi r24, 0xCF ; 207 12aaa: 91 05 cpc r25, r1 12aac: 11 f4 brne .+4 ; 0x12ab2 12aae: 0c 94 f5 9f jmp 0x13fea ; 0x13fea 12ab2: 80 3d cpi r24, 0xD0 ; 208 12ab4: 91 05 cpc r25, r1 12ab6: 09 f0 breq .+2 ; 0x12aba 12ab8: 3f cc rjmp .-1922 ; 0x12338 - `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')) 12aba: 83 e5 ldi r24, 0x53 ; 83 12abc: 0e 94 b6 55 call 0xab6c ; 0xab6c 12ac0: 88 23 and r24, r24 12ac2: 51 f0 breq .+20 ; 0x12ad8 { cs.retract_recover_length = code_value() ; 12ac4: 0e 94 8e 5a call 0xb51c ; 0xb51c 12ac8: 60 93 c1 04 sts 0x04C1, r22 ; 0x8004c1 12acc: 70 93 c2 04 sts 0x04C2, r23 ; 0x8004c2 12ad0: 80 93 c3 04 sts 0x04C3, r24 ; 0x8004c3 12ad4: 90 93 c4 04 sts 0x04C4, r25 ; 0x8004c4 } if(code_seen('F')) 12ad8: 86 e4 ldi r24, 0x46 ; 70 12ada: 0e 94 b6 55 call 0xab6c ; 0xab6c 12ade: 88 23 and r24, r24 12ae0: 09 f4 brne .+2 ; 0x12ae4 12ae2: ea c2 rjmp .+1492 ; 0x130b8 { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 12ae4: 0e 94 8e 5a call 0xb51c ; 0xb51c 12ae8: 0e 94 4e 60 call 0xc09c ; 0xc09c 12aec: 60 93 c5 04 sts 0x04C5, r22 ; 0x8004c5 12af0: 70 93 c6 04 sts 0x04C6, r23 ; 0x8004c6 12af4: 80 93 c7 04 sts 0x04C7, r24 ; 0x8004c7 12af8: 90 93 c8 04 sts 0x04C8, r25 ; 0x8004c8 12afc: dd c2 rjmp .+1466 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12afe: 8c 3d cpi r24, 0xDC ; 220 12b00: 91 05 cpc r25, r1 12b02: 11 f4 brne .+4 ; 0x12b08 12b04: 0c 94 66 a0 jmp 0x140cc ; 0x140cc 12b08: 8d 3d cpi r24, 0xDD ; 221 12b0a: 91 05 cpc r25, r1 12b0c: 11 f4 brne .+4 ; 0x12b12 12b0e: 0c 94 a5 a0 jmp 0x1414a ; 0x1414a 12b12: 86 3d cpi r24, 0xD6 ; 214 12b14: 91 05 cpc r25, r1 12b16: 09 f0 breq .+2 ; 0x12b1a 12b18: 0f cc rjmp .-2018 ; 0x12338 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; 12b1a: 80 e5 ldi r24, 0x50 ; 80 12b1c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b20: 88 23 and r24, r24 12b22: 11 f4 brne .+4 ; 0x12b28 12b24: 0c 94 52 a0 jmp 0x140a4 ; 0x140a4 12b28: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b2c: 2b 01 movw r4, r22 12b2e: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 12b30: 83 e5 ldi r24, 0x53 ; 83 12b32: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b36: 88 23 and r24, r24 12b38: 11 f4 brne .+4 ; 0x12b3e 12b3a: 0c 94 5c a0 jmp 0x140b8 ; 0x140b8 12b3e: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b42: 4b 01 movw r8, r22 12b44: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 12b46: 8e e4 ldi r24, 0x4E ; 78 12b48: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b4c: d0 90 fe 04 lds r13, 0x04FE ; 0x8004fe 12b50: 88 23 and r24, r24 12b52: 29 f0 breq .+10 ; 0x12b5e 12b54: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b58: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12b5c: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 12b5e: 82 e5 ldi r24, 0x52 ; 82 12b60: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b64: e0 90 ff 04 lds r14, 0x04FF ; 0x8004ff 12b68: f0 90 00 05 lds r15, 0x0500 ; 0x800500 12b6c: 88 23 and r24, r24 12b6e: 29 f0 breq .+10 ; 0x12b7a 12b70: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b74: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12b78: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 12b7a: 86 e4 ldi r24, 0x46 ; 70 12b7c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b80: 00 91 01 05 lds r16, 0x0501 ; 0x800501 12b84: 10 91 02 05 lds r17, 0x0502 ; 0x800502 12b88: 88 23 and r24, r24 12b8a: 29 f0 breq .+10 ; 0x12b96 12b8c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b90: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12b94: 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) 12b96: 20 e0 ldi r18, 0x00 ; 0 12b98: 30 e0 ldi r19, 0x00 ; 0 12b9a: a9 01 movw r20, r18 12b9c: c3 01 movw r24, r6 12b9e: b2 01 movw r22, r4 12ba0: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 12ba4: 18 16 cp r1, r24 12ba6: 0c f0 brlt .+2 ; 0x12baa 12ba8: 87 c2 rjmp .+1294 ; 0x130b8 12baa: 20 e0 ldi r18, 0x00 ; 0 12bac: 30 e0 ldi r19, 0x00 ; 0 12bae: a9 01 movw r20, r18 12bb0: c5 01 movw r24, r10 12bb2: b4 01 movw r22, r8 12bb4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 12bb8: 87 fd sbrc r24, 7 12bba: 7e c2 rjmp .+1276 ; 0x130b8 12bbc: a5 01 movw r20, r10 12bbe: 94 01 movw r18, r8 12bc0: c3 01 movw r24, r6 12bc2: b2 01 movw r22, r4 12bc4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 12bc8: 87 fd sbrc r24, 7 12bca: 76 c2 rjmp .+1260 ; 0x130b8 { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 12bcc: 40 92 f6 04 sts 0x04F6, r4 ; 0x8004f6 12bd0: 50 92 f7 04 sts 0x04F7, r5 ; 0x8004f7 12bd4: 60 92 f8 04 sts 0x04F8, r6 ; 0x8004f8 12bd8: 70 92 f9 04 sts 0x04F9, r7 ; 0x8004f9 cs.min_mm_per_arc_segment = s; 12bdc: 80 92 fa 04 sts 0x04FA, r8 ; 0x8004fa 12be0: 90 92 fb 04 sts 0x04FB, r9 ; 0x8004fb 12be4: a0 92 fc 04 sts 0x04FC, r10 ; 0x8004fc 12be8: b0 92 fd 04 sts 0x04FD, r11 ; 0x8004fd cs.n_arc_correction = n; 12bec: d0 92 fe 04 sts 0x04FE, r13 ; 0x8004fe cs.min_arc_segments = r; 12bf0: f0 92 00 05 sts 0x0500, r15 ; 0x800500 12bf4: e0 92 ff 04 sts 0x04FF, r14 ; 0x8004ff cs.arc_segments_per_sec = f; 12bf8: 10 93 02 05 sts 0x0502, r17 ; 0x800502 12bfc: 00 93 01 05 sts 0x0501, r16 ; 0x800501 12c00: 5b c2 rjmp .+1206 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c02: 80 33 cpi r24, 0x30 ; 48 12c04: a1 e0 ldi r26, 0x01 ; 1 12c06: 9a 07 cpc r25, r26 12c08: 11 f4 brne .+4 ; 0x12c0e 12c0a: 0c 94 a1 a1 jmp 0x14342 ; 0x14342 12c0e: 0c f0 brlt .+2 ; 0x12c12 12c10: 6c c0 rjmp .+216 ; 0x12cea 12c12: 8d 32 cpi r24, 0x2D ; 45 12c14: e1 e0 ldi r30, 0x01 ; 1 12c16: 9e 07 cpc r25, r30 12c18: 11 f4 brne .+4 ; 0x12c1e 12c1a: 0c 94 28 a1 jmp 0x14250 ; 0x14250 12c1e: 54 f5 brge .+84 ; 0x12c74 12c20: 80 3f cpi r24, 0xF0 ; 240 12c22: 91 05 cpc r25, r1 12c24: 09 f4 brne .+2 ; 0x12c28 12c26: 48 c2 rjmp .+1168 ; 0x130b8 12c28: 8c 32 cpi r24, 0x2C ; 44 12c2a: 91 40 sbci r25, 0x01 ; 1 12c2c: 09 f0 breq .+2 ; 0x12c30 12c2e: 84 cb rjmp .-2296 ; 0x12338 - `S` - frequency in Hz. Not all firmware versions support this parameter - `P` - duration in milliseconds */ case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; 12c30: 80 e5 ldi r24, 0x50 ; 80 12c32: 0e 94 b6 55 call 0xab6c ; 0xab6c 12c36: 08 ee ldi r16, 0xE8 ; 232 12c38: 13 e0 ldi r17, 0x03 ; 3 12c3a: 88 23 and r24, r24 12c3c: 29 f0 breq .+10 ; 0x12c48 12c3e: 0e 94 8e 5a call 0xb51c ; 0xb51c 12c42: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12c46: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 12c48: 83 e5 ldi r24, 0x53 ; 83 12c4a: 0e 94 b6 55 call 0xab6c ; 0xab6c 12c4e: 88 23 and r24, r24 12c50: 11 f4 brne .+4 ; 0x12c56 12c52: 0c 94 20 a1 jmp 0x14240 ; 0x14240 beepS = 0; else { beepS = code_value(); 12c56: 0e 94 8e 5a call 0xb51c ; 0xb51c 12c5a: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> if (!beepS) { 12c5e: 61 15 cp r22, r1 12c60: 71 05 cpc r23, r1 12c62: 11 f0 breq .+4 ; 0x12c68 12c64: 0c 94 22 a1 jmp 0x14244 ; 0x14244 // handle S0 as a pause _delay(beepP); 12c68: b8 01 movw r22, r16 12c6a: 90 e0 ldi r25, 0x00 ; 0 12c6c: 80 e0 ldi r24, 0x00 ; 0 12c6e: 0f 94 d5 0d call 0x21baa ; 0x21baa 12c72: 22 c2 rjmp .+1092 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c74: 8e 32 cpi r24, 0x2E ; 46 12c76: 31 e0 ldi r19, 0x01 ; 1 12c78: 93 07 cpc r25, r19 12c7a: 11 f4 brne .+4 ; 0x12c80 12c7c: 0c 94 1a a2 jmp 0x14434 ; 0x14434 12c80: 8f 32 cpi r24, 0x2F ; 47 12c82: 91 40 sbci r25, 0x01 ; 1 12c84: 09 f0 breq .+2 ; 0x12c88 12c86: 58 cb rjmp .-2384 ; 0x12338 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 12c88: 85 e4 ldi r24, 0x45 ; 69 12c8a: 0e 94 b6 55 call 0xab6c ; 0xab6c - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 12c8e: 10 e0 ldi r17, 0x00 ; 0 12c90: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 12c92: 88 23 and r24, r24 12c94: 59 f0 breq .+22 ; 0x12cac 12c96: 0e 94 d8 55 call 0xabb0 ; 0xabb0 12c9a: 8c 01 movw r16, r24 if (e < 0) temp = 70; 12c9c: c1 2c mov r12, r1 12c9e: d1 2c mov r13, r1 12ca0: 5c e8 ldi r21, 0x8C ; 140 12ca2: e5 2e mov r14, r21 12ca4: 52 e4 ldi r21, 0x42 ; 66 12ca6: 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) 12ca8: 97 fd sbrc r25, 7 12caa: 06 c0 rjmp .+12 ; 0x12cb8 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 12cac: c1 2c mov r12, r1 12cae: d1 2c mov r13, r1 12cb0: 66 e1 ldi r22, 0x16 ; 22 12cb2: e6 2e mov r14, r22 12cb4: 63 e4 ldi r22, 0x43 ; 67 12cb6: 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(); 12cb8: 83 e5 ldi r24, 0x53 ; 83 12cba: 0e 94 b6 55 call 0xab6c ; 0xab6c 12cbe: 88 23 and r24, r24 12cc0: 21 f0 breq .+8 ; 0x12cca 12cc2: 0e 94 8e 5a call 0xb51c ; 0xb51c 12cc6: 6b 01 movw r12, r22 12cc8: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 12cca: 83 e4 ldi r24, 0x43 ; 67 12ccc: 0e 94 b6 55 call 0xab6c ; 0xab6c 12cd0: 88 23 and r24, r24 12cd2: 11 f4 brne .+4 ; 0x12cd8 12cd4: 0c 94 2a a2 jmp 0x14454 ; 0x14454 12cd8: 0e 94 d8 55 call 0xabb0 ; 0xabb0 PID_autotune(temp, e, c); 12cdc: 9c 01 movw r18, r24 12cde: a8 01 movw r20, r16 12ce0: c7 01 movw r24, r14 12ce2: b6 01 movw r22, r12 12ce4: 0f 94 21 19 call 0x23242 ; 0x23242 12ce8: e7 c1 rjmp .+974 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12cea: 80 39 cpi r24, 0x90 ; 144 12cec: 51 e0 ldi r21, 0x01 ; 1 12cee: 95 07 cpc r25, r21 12cf0: 11 f4 brne .+4 ; 0x12cf6 12cf2: 0c 94 2e a2 jmp 0x1445c ; 0x1445c 12cf6: 04 f5 brge .+64 ; 0x12d38 12cf8: 8e 35 cpi r24, 0x5E ; 94 12cfa: b1 e0 ldi r27, 0x01 ; 1 12cfc: 9b 07 cpc r25, r27 12cfe: 11 f4 brne .+4 ; 0x12d04 12d00: 0c 94 52 ad jmp 0x15aa4 ; 0x15aa4 12d04: 8f 35 cpi r24, 0x5F ; 95 12d06: 91 40 sbci r25, 0x01 ; 1 12d08: 09 f0 breq .+2 ; 0x12d0c 12d0a: 16 cb rjmp .-2516 ; 0x12338 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 12d0c: 83 e5 ldi r24, 0x53 ; 83 12d0e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d12: 88 23 and r24, r24 12d14: 71 f0 breq .+28 ; 0x12d32 12d16: 0e 94 8e 5a call 0xb51c ; 0xb51c 12d1a: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 12d1e: 61 30 cpi r22, 0x01 ; 1 12d20: 71 05 cpc r23, r1 12d22: 11 f4 brne .+4 ; 0x12d28 12d24: 0c 94 88 ad jmp 0x15b10 ; 0x15b10 12d28: 62 30 cpi r22, 0x02 ; 2 12d2a: 71 05 cpc r23, r1 12d2c: 11 f4 brne .+4 ; 0x12d32 12d2e: 0c 94 aa ad jmp 0x15b54 ; 0x15b54 case 2: for(int i=0;i 12d36: c0 c1 rjmp .+896 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d38: 85 39 cpi r24, 0x95 ; 149 12d3a: f1 e0 ldi r31, 0x01 ; 1 12d3c: 9f 07 cpc r25, r31 12d3e: 11 f4 brne .+4 ; 0x12d44 12d40: 0c 94 32 a2 jmp 0x14464 ; 0x14464 12d44: 86 39 cpi r24, 0x96 ; 150 12d46: 21 e0 ldi r18, 0x01 ; 1 12d48: 92 07 cpc r25, r18 12d4a: 11 f4 brne .+4 ; 0x12d50 12d4c: 0c 94 37 a2 jmp 0x1446e ; 0x1446e 12d50: 83 39 cpi r24, 0x93 ; 147 12d52: 91 40 sbci r25, 0x01 ; 1 12d54: 09 f0 breq .+2 ; 0x12d58 12d56: f0 ca rjmp .-2592 ; 0x12338 */ 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()) 12d58: 80 91 94 12 lds r24, 0x1294 ; 0x801294 12d5c: 81 30 cpi r24, 0x01 ; 1 12d5e: 09 f0 breq .+2 ; 0x12d62 12d60: ab c1 rjmp .+854 ; 0x130b8 { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 12d62: 85 e4 ldi r24, 0x45 ; 69 12d64: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d68: 81 11 cpse r24, r1 12d6a: 0e 94 cb 55 call 0xab96 ; 0xab96 if(code_seen('F')) filament = code_value_uint8(); 12d6e: 86 e4 ldi r24, 0x46 ; 70 12d70: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d74: 81 11 cpse r24, r1 12d76: 0e 94 cb 55 call 0xab96 ; 0xab96 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 12d7a: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 12d7e: 88 23 and r24, r24 12d80: 09 f4 brne .+2 ; 0x12d84 12d82: 9a c1 rjmp .+820 ; 0x130b8 // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 12d84: 60 e0 ldi r22, 0x00 ; 0 12d86: 80 e0 ldi r24, 0x00 ; 0 12d88: 0f 94 28 6b call 0x2d650 ; 0x2d650 12d8c: 95 c1 rjmp .+810 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d8e: 80 3c cpi r24, 0xC0 ; 192 12d90: 42 e0 ldi r20, 0x02 ; 2 12d92: 94 07 cpc r25, r20 12d94: 11 f4 brne .+4 ; 0x12d9a 12d96: 0c 94 99 ae jmp 0x15d32 ; 0x15d32 12d9a: 0c f0 brlt .+2 ; 0x12d9e 12d9c: 57 c0 rjmp .+174 ; 0x12e4c 12d9e: 88 32 cpi r24, 0x28 ; 40 12da0: a2 e0 ldi r26, 0x02 ; 2 12da2: 9a 07 cpc r25, r26 12da4: 11 f4 brne .+4 ; 0x12daa 12da6: 0c 94 dd a4 jmp 0x149ba ; 0x149ba 12daa: 4c f5 brge .+82 ; 0x12dfe 12dac: 86 3f cpi r24, 0xF6 ; 246 12dae: e1 e0 ldi r30, 0x01 ; 1 12db0: 9e 07 cpc r25, r30 12db2: 11 f4 brne .+4 ; 0x12db8 12db4: 0c 94 44 a2 jmp 0x14488 ; 0x14488 12db8: 6c f4 brge .+26 ; 0x12dd4 12dba: 84 3f cpi r24, 0xF4 ; 244 12dbc: 21 e0 ldi r18, 0x01 ; 1 12dbe: 92 07 cpc r25, r18 12dc0: 11 f4 brne .+4 ; 0x12dc6 12dc2: 0c 94 40 a2 jmp 0x14480 ; 0x14480 12dc6: 85 3f cpi r24, 0xF5 ; 245 12dc8: 91 40 sbci r25, 0x01 ; 1 12dca: 09 f0 breq .+2 ; 0x12dce 12dcc: b5 ca rjmp .-2710 ; 0x12338 M501 */ case 501: { Config_RetrieveSettings(); 12dce: 0e 94 69 75 call 0xead2 ; 0xead2 12dd2: 72 c1 rjmp .+740 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12dd4: 87 3f cpi r24, 0xF7 ; 247 12dd6: 41 e0 ldi r20, 0x01 ; 1 12dd8: 94 07 cpc r25, r20 12dda: 11 f4 brne .+4 ; 0x12de0 12ddc: 0c 94 48 a2 jmp 0x14490 ; 0x14490 12de0: 8d 3f cpi r24, 0xFD ; 253 12de2: 91 40 sbci r25, 0x01 ; 1 12de4: 09 f0 breq .+2 ; 0x12de8 12de6: a8 ca rjmp .-2736 ; 0x12338 M509 */ case 509: { lang_reset(); 12de8: 0e 94 35 6c call 0xd86a ; 0xd86a SERIAL_ECHO_START; 12dec: 87 e7 ldi r24, 0x77 ; 119 12dee: 9e e9 ldi r25, 0x9E ; 158 12df0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 12df4: 86 ea ldi r24, 0xA6 ; 166 12df6: 9f e7 ldi r25, 0x7F ; 127 12df8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 12dfc: 5d c1 rjmp .+698 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12dfe: 8a 35 cpi r24, 0x5A ; 90 12e00: a2 e0 ldi r26, 0x02 ; 2 12e02: 9a 07 cpc r25, r26 12e04: 11 f4 brne .+4 ; 0x12e0a 12e06: 0c 94 0b a9 jmp 0x15216 ; 0x15216 12e0a: 5c f4 brge .+22 ; 0x12e22 12e0c: 88 35 cpi r24, 0x58 ; 88 12e0e: e2 e0 ldi r30, 0x02 ; 2 12e10: 9e 07 cpc r25, r30 12e12: 11 f4 brne .+4 ; 0x12e18 12e14: 0c 94 12 a5 jmp 0x14a24 ; 0x14a24 12e18: 89 35 cpi r24, 0x59 ; 89 12e1a: 92 40 sbci r25, 0x02 ; 2 12e1c: 09 f4 brne .+2 ; 0x12e20 12e1e: f9 ca rjmp .-2574 ; 0x12412 12e20: 8b ca rjmp .-2794 ; 0x12338 12e22: 8d 3b cpi r24, 0xBD ; 189 12e24: 22 e0 ldi r18, 0x02 ; 2 12e26: 92 07 cpc r25, r18 12e28: 11 f4 brne .+4 ; 0x12e2e 12e2a: 0c 94 c3 ad jmp 0x15b86 ; 0x15b86 12e2e: 8e 3b cpi r24, 0xBE ; 190 12e30: 32 e0 ldi r19, 0x02 ; 2 12e32: 93 07 cpc r25, r19 12e34: 11 f4 brne .+4 ; 0x12e3a 12e36: 0c 94 65 ae jmp 0x15cca ; 0x15cca 12e3a: 8b 35 cpi r24, 0x5B ; 91 12e3c: 92 40 sbci r25, 0x02 ; 2 12e3e: 09 f0 breq .+2 ; 0x12e42 12e40: 7b ca rjmp .-2826 ; 0x12338 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 12e42: 60 e0 ldi r22, 0x00 ; 0 12e44: 80 e0 ldi r24, 0x00 ; 0 12e46: 0e 94 9e ef call 0x1df3c ; 0x1df3c 12e4a: 36 c1 rjmp .+620 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e4c: 8c 35 cpi r24, 0x5C ; 92 12e4e: 53 e0 ldi r21, 0x03 ; 3 12e50: 95 07 cpc r25, r21 12e52: 11 f4 brne .+4 ; 0x12e58 12e54: 0c 94 2d aa jmp 0x1545a ; 0x1545a 12e58: 0c f0 brlt .+2 ; 0x12e5c 12e5a: 42 c0 rjmp .+132 ; 0x12ee0 12e5c: 83 3c cpi r24, 0xC3 ; 195 12e5e: b2 e0 ldi r27, 0x02 ; 2 12e60: 9b 07 cpc r25, r27 12e62: 11 f4 brne .+4 ; 0x12e68 12e64: 0c 94 a5 ae jmp 0x15d4a ; 0x15d4a 12e68: 7c f4 brge .+30 ; 0x12e88 12e6a: 81 3c cpi r24, 0xC1 ; 193 12e6c: f2 e0 ldi r31, 0x02 ; 2 12e6e: 9f 07 cpc r25, r31 12e70: 11 f4 brne .+4 ; 0x12e76 12e72: 0c 94 9f ae jmp 0x15d3e ; 0x15d3e 12e76: 82 3c cpi r24, 0xC2 ; 194 12e78: 92 40 sbci r25, 0x02 ; 2 12e7a: 09 f0 breq .+2 ; 0x12e7e 12e7c: 5d ca rjmp .-2886 ; 0x12338 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 12e7e: 82 ec ldi r24, 0xC2 ; 194 12e80: 92 e0 ldi r25, 0x02 ; 2 12e82: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 12e86: 18 c1 rjmp .+560 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e88: 85 3c cpi r24, 0xC5 ; 197 12e8a: 32 e0 ldi r19, 0x02 ; 2 12e8c: 93 07 cpc r25, r19 12e8e: 11 f4 brne .+4 ; 0x12e94 12e90: 0c 94 ee ae jmp 0x15ddc ; 0x15ddc 12e94: 14 f4 brge .+4 ; 0x12e9a 12e96: 0c 94 c2 ae jmp 0x15d84 ; 0x15d84 12e9a: 82 35 cpi r24, 0x52 ; 82 12e9c: 93 40 sbci r25, 0x03 ; 3 12e9e: 09 f0 breq .+2 ; 0x12ea2 12ea0: 4b ca rjmp .-2922 ; 0x12338 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 12ea2: 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')) { 12ea4: 83 e5 ldi r24, 0x53 ; 83 12ea6: 0e 94 b6 55 call 0xab6c ; 0xab6c 12eaa: 88 23 and r24, r24 12eac: 11 f4 brne .+4 ; 0x12eb2 12eae: 0c 94 13 a9 jmp 0x15226 ; 0x15226 iSel = code_value_uint8(); 12eb2: 0e 94 cb 55 call 0xab96 ; 0xab96 12eb6: 18 2f mov r17, r24 if (iSel>=max_sheets) 12eb8: 88 30 cpi r24, 0x08 ; 8 12eba: 10 f4 brcc .+4 ; 0x12ec0 12ebc: 0c 94 18 a9 jmp 0x15230 ; 0x15230 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 12ec0: 82 e8 ldi r24, 0x82 ; 130 12ec2: 9f e7 ldi r25, 0x7F ; 127 12ec4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 12ec8: 4a e0 ldi r20, 0x0A ; 10 12eca: 67 e0 ldi r22, 0x07 ; 7 12ecc: 70 e0 ldi r23, 0x00 ; 0 12ece: 80 e0 ldi r24, 0x00 ; 0 12ed0: 90 e0 ldi r25, 0x00 ; 0 12ed2: 0f 94 8c 97 call 0x32f18 ; 0x32f18 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 12ed6: 8a ed ldi r24, 0xDA ; 218 12ed8: 92 e0 ldi r25, 0x02 ; 2 12eda: 0f 94 5d 9a call 0x334ba ; 0x334ba 12ede: ec c0 rjmp .+472 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12ee0: 84 38 cpi r24, 0x84 ; 132 12ee2: a3 e0 ldi r26, 0x03 ; 3 12ee4: 9a 07 cpc r25, r26 12ee6: 11 f4 brne .+4 ; 0x12eec 12ee8: 0c 94 a3 ac jmp 0x15946 ; 0x15946 12eec: 0c f0 brlt .+2 ; 0x12ef0 12eee: 4d c0 rjmp .+154 ; 0x12f8a 12ef0: 8d 35 cpi r24, 0x5D ; 93 12ef2: e3 e0 ldi r30, 0x03 ; 3 12ef4: 9e 07 cpc r25, r30 12ef6: 11 f4 brne .+4 ; 0x12efc 12ef8: 0c 94 b7 aa jmp 0x1556e ; 0x1556e 12efc: 8e 35 cpi r24, 0x5E ; 94 12efe: 93 40 sbci r25, 0x03 ; 3 12f00: 09 f0 breq .+2 ; 0x12f04 12f02: 1a ca rjmp .-3020 ; 0x12338 */ 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); 12f04: 0e 94 8e 5a call 0xb51c ; 0xb51c 12f08: 20 e0 ldi r18, 0x00 ; 0 12f0a: 30 e0 ldi r19, 0x00 ; 0 12f0c: 40 e2 ldi r20, 0x20 ; 32 12f0e: 51 e4 ldi r21, 0x41 ; 65 12f10: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 12f14: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 12f18: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 12f1a: 63 30 cpi r22, 0x03 ; 3 12f1c: 11 f4 brne .+4 ; 0x12f22 12f1e: 0c 94 bd ab jmp 0x1577a ; 0x1577a 12f22: 10 f0 brcs .+4 ; 0x12f28 12f24: 0c 94 4f ab jmp 0x1569e ; 0x1569e 12f28: 61 30 cpi r22, 0x01 ; 1 12f2a: 11 f4 brne .+4 ; 0x12f30 12f2c: 0c 94 78 ab jmp 0x156f0 ; 0x156f0 12f30: 62 30 cpi r22, 0x02 ; 2 12f32: 09 f0 breq .+2 ; 0x12f36 12f34: c1 c0 rjmp .+386 ; 0x130b8 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12f36: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return pgm_read_word(&_nPrinterMmuType); 12f3a: e7 eb ldi r30, 0xB7 ; 183 12f3c: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12f3e: 81 30 cpi r24, 0x01 ; 1 12f40: 11 f0 breq .+4 ; 0x12f46 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 12f42: e9 eb ldi r30, 0xB9 ; 185 12f44: f9 e7 ldi r31, 0x79 ; 121 12f46: 05 91 lpm r16, Z+ 12f48: 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')) 12f4a: 80 e5 ldi r24, 0x50 ; 80 12f4c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12f50: 88 23 and r24, r24 12f52: 11 f4 brne .+4 ; 0x12f58 12f54: 0c 94 ac ab jmp 0x15758 ; 0x15758 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 12f58: 0e 94 1e 56 call 0xac3c ; 0xac3c menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 12f5c: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 12f60: ff 20 and r15, r15 12f62: 09 f4 brne .+2 ; 0x12f66 12f64: a9 c0 rjmp .+338 ; 0x130b8 return; if (nPrinterModel == actualPrinterModel) 12f66: 60 17 cp r22, r16 12f68: 71 07 cpc r23, r17 12f6a: 09 f4 brne .+2 ; 0x12f6e 12f6c: a5 c0 rjmp .+330 ; 0x130b8 // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 12f6e: 89 ec ldi r24, 0xC9 ; 201 12f70: 97 e3 ldi r25, 0x37 ; 55 12f72: 0e 94 32 6d call 0xda64 ; 0xda64 12f76: 8c 01 movw r16, r24 12f78: 81 e9 ldi r24, 0x91 ; 145 12f7a: 97 e3 ldi r25, 0x37 ; 55 12f7c: 0e 94 32 6d call 0xda64 ; 0xda64 12f80: 4f 2d mov r20, r15 12f82: b8 01 movw r22, r16 12f84: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 12f88: 97 c0 rjmp .+302 ; 0x130b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12f8a: 8c 38 cpi r24, 0x8C ; 140 12f8c: 23 e0 ldi r18, 0x03 ; 3 12f8e: 92 07 cpc r25, r18 12f90: 09 f4 brne .+2 ; 0x12f94 12f92: 92 c0 rjmp .+292 ; 0x130b8 12f94: 80 3a cpi r24, 0xA0 ; 160 12f96: 33 e0 ldi r19, 0x03 ; 3 12f98: 93 07 cpc r25, r19 12f9a: 09 f4 brne .+2 ; 0x12f9e 12f9c: 50 c2 rjmp .+1184 ; 0x1343e 12f9e: 8b 38 cpi r24, 0x8B ; 139 12fa0: 93 40 sbci r25, 0x03 ; 3 12fa2: 09 f0 breq .+2 ; 0x12fa6 12fa4: c9 c9 rjmp .-3182 ; 0x12338 for(int i=0;i 12fac: 88 23 and r24, r24 12fae: 39 f0 breq .+14 ; 0x12fbe 12fb0: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fb4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 12fb8: 80 e0 ldi r24, 0x00 ; 0 12fba: 0f 94 ed 21 call 0x243da ; 0x243da #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 12fbe: 8a e5 ldi r24, 0x5A ; 90 12fc0: 0e 94 b6 55 call 0xab6c ; 0xab6c 12fc4: 88 23 and r24, r24 12fc6: 39 f0 breq .+14 ; 0x12fd6 12fc8: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fcc: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 12fd0: 81 e0 ldi r24, 0x01 ; 1 12fd2: 0f 94 ed 21 call 0x243da ; 0x243da #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 12fd6: 85 e4 ldi r24, 0x45 ; 69 12fd8: 0e 94 b6 55 call 0xab6c ; 0xab6c 12fdc: 88 23 and r24, r24 12fde: 09 f4 brne .+2 ; 0x12fe2 12fe0: 6b c0 rjmp .+214 ; 0x130b8 12fe2: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fe6: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 12fea: cb 01 movw r24, r22 12fec: 0f 94 ed 20 call 0x241da ; 0x241da 12ff0: 63 c0 rjmp .+198 ; 0x130b8 - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 12ff2: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12ff6: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12ffa: 0e 5f subi r16, 0xFE ; 254 12ffc: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 12ffe: 80 e5 ldi r24, 0x50 ; 80 13000: 0e 94 b6 55 call 0xab6c ; 0xab6c */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 13004: c1 2c mov r12, r1 13006: d1 2c mov r13, r1 13008: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1300a: 88 23 and r24, r24 1300c: 21 f0 breq .+8 ; 0x13016 1300e: 0e 94 1e 56 call 0xac3c ; 0xac3c 13012: 6b 01 movw r12, r22 13014: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 13016: 83 e5 ldi r24, 0x53 ; 83 13018: 0e 94 b6 55 call 0xab6c ; 0xab6c 1301c: 88 23 and r24, r24 1301e: 51 f0 breq .+20 ; 0x13034 13020: 0e 94 1e 56 call 0xac3c ; 0xac3c 13024: 9b 01 movw r18, r22 13026: ac 01 movw r20, r24 13028: a8 ee ldi r26, 0xE8 ; 232 1302a: b3 e0 ldi r27, 0x03 ; 3 1302c: 0f 94 d1 a1 call 0x343a2 ; 0x343a2 <__muluhisi3> 13030: 6b 01 movw r12, r22 13032: 7c 01 movw r14, r24 13034: c8 01 movw r24, r16 13036: 0f 5f subi r16, 0xFF ; 255 13038: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 1303a: dc 01 movw r26, r24 1303c: 4c 91 ld r20, X 1303e: 40 32 cpi r20, 0x20 ; 32 13040: c9 f3 breq .-14 ; 0x13034 custom_message_type = CustomMsg::M0Wait; 13042: 26 e0 ldi r18, 0x06 ; 6 13044: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 if (!expiration_time_set && *src != '\0') { 13048: c1 14 cp r12, r1 1304a: d1 04 cpc r13, r1 1304c: e1 04 cpc r14, r1 1304e: f1 04 cpc r15, r1 13050: c9 f5 brne .+114 ; 0x130c4 13052: 2c 91 ld r18, X 13054: 22 23 and r18, r18 13056: b1 f1 breq .+108 ; 0x130c4 lcd_setstatus(src); 13058: 0e 94 8d ef call 0x1df1a ; 0x1df1a 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(); 1305c: 0f 94 a0 22 call 0x24540 ; 0x24540 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 13060: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 13064: 84 60 ori r24, 0x04 ; 4 13066: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd previous_millis_cmd.start(); 1306a: 8a e4 ldi r24, 0x4A ; 74 1306c: 93 e0 ldi r25, 0x03 ; 3 1306e: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> if (expiration_time_set) { 13072: c1 14 cp r12, r1 13074: d1 04 cpc r13, r1 13076: e1 04 cpc r14, r1 13078: f1 04 cpc r15, r1 1307a: d9 f1 breq .+118 ; 0x130f2 codenum += _millis(); // keep track of when we started waiting 1307c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 13080: c6 0e add r12, r22 13082: d7 1e adc r13, r23 13084: e8 1e adc r14, r24 13086: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 13088: 84 e0 ldi r24, 0x04 ; 4 1308a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 1308e: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 13092: 6c 15 cp r22, r12 13094: 7d 05 cpc r23, r13 13096: 8e 05 cpc r24, r14 13098: 9f 05 cpc r25, r15 1309a: 10 f1 brcs .+68 ; 0x130e0 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 1309c: 82 e0 ldi r24, 0x02 ; 2 1309e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 130a2: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 130a6: 8b 7f andi r24, 0xFB ; 251 130a8: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd if (IS_SD_PRINTING) 130ac: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 130b0: 88 23 and r24, r24 130b2: 91 f1 breq .+100 ; 0x13118 custom_message_type = CustomMsg::Status; 130b4: 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; 130b8: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 130bc: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.491> 130c0: 0c 94 b7 84 jmp 0x1096e ; 0x1096e 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){ 130c4: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 130c8: 81 11 cpse r24, r1 130ca: 07 c0 rjmp .+14 ; 0x130da LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 130cc: 8f ec ldi r24, 0xCF ; 207 130ce: 99 e3 ldi r25, 0x39 ; 57 130d0: 0e 94 32 6d call 0xda64 ; 0xda64 130d4: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 130d8: c1 cf rjmp .-126 ; 0x1305c } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 130da: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 130de: be cf rjmp .-132 ; 0x1305c 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()) { 130e0: 0e 94 19 6c call 0xd832 ; 0xd832 130e4: 81 11 cpse r24, r1 130e6: da cf rjmp .-76 ; 0x1309c delay_keep_alive(0); 130e8: 90 e0 ldi r25, 0x00 ; 0 130ea: 80 e0 ldi r24, 0x00 ; 0 130ec: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 130f0: ce cf rjmp .-100 ; 0x1308e //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 130f2: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 130f6: 84 e0 ldi r24, 0x04 ; 4 130f8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 130fc: 0e 94 14 6c call 0xd828 ; 0xd828 while(!lcd_clicked()) 13100: 0e 94 19 6c call 0xd832 ; 0xd832 13104: 81 11 cpse r24, r1 13106: 05 c0 rjmp .+10 ; 0x13112 { delay_keep_alive(0); 13108: 90 e0 ldi r25, 0x00 ; 0 1310a: 80 e0 ldi r24, 0x00 ; 0 1310c: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 13110: f7 cf rjmp .-18 ; 0x13100 } KEEPALIVE_STATE(busy_state_backup); 13112: 10 93 78 02 sts 0x0278, r17 ; 0x800278 13116: c5 cf rjmp .-118 ; 0x130a2 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 13118: 8b e0 ldi r24, 0x0B ; 11 1311a: 9c e6 ldi r25, 0x6C ; 108 1311c: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 13120: cb cf rjmp .-106 ; 0x130b8 /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 13122: 84 ec ldi r24, 0xC4 ; 196 13124: 99 e3 ldi r25, 0x39 ; 57 13126: 0e 94 32 6d call 0xda64 ; 0xda64 1312a: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 enable_x(); 1312e: 17 98 cbi 0x02, 7 ; 2 enable_y(); 13130: 16 98 cbi 0x02, 6 ; 2 enable_z(); 13132: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 13134: 14 98 cbi 0x02, 4 ; 2 13136: c0 cf rjmp .-128 ; 0x130b8 /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 13138: 81 e0 ldi r24, 0x01 ; 1 1313a: 0f 94 da 4d call 0x29bb4 ; 0x29bb4 1313e: bc cf rjmp .-136 ; 0x130b8 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 13140: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 13144: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 13148: 87 e7 ldi r24, 0x77 ; 119 1314a: 9e e9 ldi r25, 0x9E ; 158 1314c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 13150: 8d e8 ldi r24, 0x8D ; 141 13152: 98 e6 ldi r25, 0x68 ; 104 13154: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 13158: af cf rjmp .-162 ; 0x130b8 /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 1315a: 0e 94 3e 61 call 0xc27c ; 0xc27c 1315e: 88 23 and r24, r24 13160: 19 f0 breq .+6 ; 0x13168 lcd_resume_print(); 13162: 0e 94 5e ef call 0x1debc ; 0x1debc 13166: a8 cf rjmp .-176 ; 0x130b8 else { if (!filament_presence_check()) { 13168: 0e 94 fc ef call 0x1dff8 ; 0x1dff8 1316c: 88 23 and r24, r24 1316e: 09 f4 brne .+2 ; 0x13172 13170: a3 cf rjmp .-186 ; 0x130b8 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); }; 13172: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 13176: 88 23 and r24, r24 13178: 61 f0 breq .+24 ; 0x13192 // Print was aborted break; } if (!card.get_sdpos()) 1317a: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1317e: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 13182: a0 91 80 16 lds r26, 0x1680 ; 0x801680 13186: b0 91 81 16 lds r27, 0x1681 ; 0x801681 1318a: 89 2b or r24, r25 1318c: 8a 2b or r24, r26 1318e: 8b 2b or r24, r27 13190: 69 f4 brne .+26 ; 0x131ac { // A new print has started from scratch, reset stats failstats_reset_print(); 13192: 0e 94 29 56 call 0xac52 ; 0xac52 sdpos_atomic = 0; 13196: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 1319a: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 1319e: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 131a2: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 131a6: 80 e0 ldi r24, 0x00 ; 0 131a8: 0e 94 69 74 call 0xe8d2 ; 0xe8d2 } void CardReader::startFileprint() { if(mounted) 131ac: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 131b0: 88 23 and r24, r24 131b2: 31 f0 breq .+12 ; 0x131c0 { sdprinting = true; 131b4: 81 e0 ldi r24, 0x01 ; 1 131b6: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 131ba: 85 e0 ldi r24, 0x05 ; 5 131bc: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 131c0: 0f 94 b4 20 call 0x24168 ; 0x24168 if (MMU2::mmu2.Enabled()) 131c4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 131c8: 81 30 cpi r24, 0x01 ; 1 131ca: 09 f0 breq .+2 ; 0x131ce 131cc: 75 cf rjmp .-278 ; 0x130b8 { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 131ce: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 131d2: 88 23 and r24, r24 131d4: 09 f4 brne .+2 ; 0x131d8 131d6: 70 cf rjmp .-288 ; 0x130b8 131d8: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 131dc: 81 11 cpse r24, r1 131de: 6c cf rjmp .-296 ; 0x130b8 { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 131e0: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 131e4: 69 cf rjmp .-302 ; 0x130b8 #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 131e6: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 131ea: 88 23 and r24, r24 131ec: 09 f4 brne .+2 ; 0x131f0 131ee: 64 cf rjmp .-312 ; 0x130b8 131f0: 83 e5 ldi r24, 0x53 ; 83 131f2: 0e 94 b6 55 call 0xab6c ; 0xab6c 131f6: 88 23 and r24, r24 131f8: 09 f4 brne .+2 ; 0x131fc 131fa: 5e cf rjmp .-324 ; 0x130b8 long index = code_value_long(); 131fc: 0e 94 1e 56 call 0xac3c ; 0xac3c 13200: 6b 01 movw r12, r22 13202: 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);}; 13204: c0 92 7e 16 sts 0x167E, r12 ; 0x80167e 13208: d0 92 7f 16 sts 0x167F, r13 ; 0x80167f 1320c: e0 92 80 16 sts 0x1680, r14 ; 0x801680 13210: f0 92 81 16 sts 0x1681, r15 ; 0x801681 13214: 0f 94 53 44 call 0x288a6 ; 0x288a6 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; 13218: c0 92 dc 11 sts 0x11DC, r12 ; 0x8011dc 1321c: d0 92 dd 11 sts 0x11DD, r13 ; 0x8011dd 13220: e0 92 de 11 sts 0x11DE, r14 ; 0x8011de 13224: f0 92 df 11 sts 0x11DF, r15 ; 0x8011df 13228: 47 cf rjmp .-370 ; 0x130b8 #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 1322a: 80 e5 ldi r24, 0x50 ; 80 1322c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13230: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 13232: 0e 94 3e 61 call 0xc27c ; 0xc27c 13236: 88 23 and r24, r24 13238: 91 f0 breq .+36 ; 0x1325e { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 1323a: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 1323e: 88 23 and r24, r24 13240: 49 f0 breq .+18 ; 0x13254 13242: 80 91 79 02 lds r24, 0x0279 ; 0x800279 13246: 81 11 cpse r24, r1 13248: 05 c0 rjmp .+10 ; 0x13254 SERIAL_PROTOCOLLNPGM("SD print paused"); 1324a: 8e e9 ldi r24, 0x9E ; 158 1324c: 9e e7 ldi r25, 0x7E ; 126 1324e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 13252: 32 cf rjmp .-412 ; 0x130b8 else SERIAL_PROTOCOLLNPGM("Print saved"); 13254: 82 e9 ldi r24, 0x92 ; 146 13256: 9e e7 ldi r25, 0x7E ; 126 13258: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1325c: 2d cf rjmp .-422 ; 0x130b8 } else if (sdprinting) 1325e: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 13262: 88 23 and r24, r24 13264: 09 f4 brne .+2 ; 0x13268 13266: 4a c0 rjmp .+148 ; 0x132fc { if (arg_P) 13268: 11 23 and r17, r17 1326a: e1 f1 breq .+120 ; 0x132e4 { printAbsFilenameFast(); 1326c: 0f 94 d8 48 call 0x291b0 ; 0x291b0 SERIAL_PROTOCOLLN(); 13270: 0f 94 5c 99 call 0x332b8 ; 0x332b8 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 13274: 82 ea ldi r24, 0xA2 ; 162 13276: 95 e6 ldi r25, 0x65 ; 101 13278: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 1327c: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 13280: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 13284: 80 91 80 16 lds r24, 0x1680 ; 0x801680 13288: 90 91 81 16 lds r25, 0x1681 ; 0x801681 1328c: 4a e0 ldi r20, 0x0A ; 10 1328e: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13292: 8f e2 ldi r24, 0x2F ; 47 13294: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13298: 60 91 77 16 lds r22, 0x1677 ; 0x801677 1329c: 70 91 78 16 lds r23, 0x1678 ; 0x801678 132a0: 80 91 79 16 lds r24, 0x1679 ; 0x801679 132a4: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 132a8: 4a e0 ldi r20, 0x0A ; 10 132aa: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 132ae: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 132b2: 0f 94 c4 1c call 0x23988 ; 0x23988 132b6: 2c e3 ldi r18, 0x3C ; 60 132b8: 30 e0 ldi r19, 0x00 ; 0 132ba: 40 e0 ldi r20, 0x00 ; 0 132bc: 50 e0 ldi r21, 0x00 ; 0 132be: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 132c2: c9 01 movw r24, r18 132c4: 6c e3 ldi r22, 0x3C ; 60 132c6: 70 e0 ldi r23, 0x00 ; 0 132c8: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 132cc: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 132ce: 90 e0 ldi r25, 0x00 ; 0 132d0: 80 e0 ldi r24, 0x00 ; 0 132d2: 0f 94 02 98 call 0x33004 ; 0x33004 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 132d6: 8a e3 ldi r24, 0x3A ; 58 132d8: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 132dc: c8 01 movw r24, r16 132de: 0f 94 00 42 call 0x28400 ; 0x28400 132e2: ea ce rjmp .-556 ; 0x130b8 { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 132e4: 80 91 81 13 lds r24, 0x1381 ; 0x801381 132e8: 88 23 and r24, r24 132ea: 29 f0 breq .+10 ; 0x132f6 132ec: 81 e8 ldi r24, 0x81 ; 129 132ee: 93 e1 ldi r25, 0x13 ; 19 132f0: 0f 94 5d 9a call 0x334ba ; 0x334ba 132f4: bf cf rjmp .-130 ; 0x13274 132f6: 8c e6 ldi r24, 0x6C ; 108 132f8: 93 e1 ldi r25, 0x13 ; 19 132fa: fa cf rjmp .-12 ; 0x132f0 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 132fc: 82 e8 ldi r24, 0x82 ; 130 132fe: 9e e7 ldi r25, 0x7E ; 126 13300: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 13304: d9 ce rjmp .-590 ; 0x130b8 /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 13306: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 1330a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1330e: 04 96 adiw r24, 0x04 ; 4 13310: 0f 94 7f 52 call 0x2a4fe ; 0x2a4fe 13314: d1 ce rjmp .-606 ; 0x130b8 * 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; 13316: ce 01 movw r24, r28 13318: 01 96 adiw r24, 0x01 ; 1 1331a: 0f 94 34 45 call 0x28a68 ; 0x28a68 1331e: 88 23 and r24, r24 13320: 09 f4 brne .+2 ; 0x13324 13322: 33 c9 rjmp .-3482 ; 0x1258a // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 13324: 61 e0 ldi r22, 0x01 ; 1 13326: ce 01 movw r24, r28 13328: 01 96 adiw r24, 0x01 ; 1 1332a: 0f 94 fb 6f call 0x2dff6 ; 0x2dff6 if (!d) goto fail; 1332e: 00 97 sbiw r24, 0x00 ; 0 13330: 09 f4 brne .+2 ; 0x13334 13332: 2b c9 rjmp .-3498 ; 0x1258a // mark entry deleted d->name[0] = DIR_NAME_DELETED; 13334: 25 ee ldi r18, 0xE5 ; 229 13336: fc 01 movw r30, r24 13338: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 1333a: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 1333c: 0f 94 82 36 call 0x26d04 ; 0x26d04 13340: 18 2f mov r17, r24 13342: 24 c9 rjmp .-3512 ; 0x1258c presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 13344: 8c e5 ldi r24, 0x5C ; 92 13346: 9e e7 ldi r25, 0x7E ; 126 13348: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 1334c: 8c a1 ldd r24, Y+36 ; 0x24 1334e: 9d a1 ldd r25, Y+37 ; 0x25 13350: 0e 94 2b 7d call 0xfa56 ; 0xfa56 13354: 8e e2 ldi r24, 0x2E ; 46 13356: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 1335a: 0f 94 5c 99 call 0x332b8 ; 0x332b8 1335e: ac ce rjmp .-680 ; 0x130b8 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 13360: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 13364: 81 11 cpse r24, r1 st_synchronize(); 13366: 0f 94 a0 22 call 0x24540 ; 0x24540 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 1336a: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 1336e: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13372: 0c 5f subi r16, 0xFC ; 252 13374: 1f 4f sbci r17, 0xFF ; 255 13376: 61 e2 ldi r22, 0x21 ; 33 13378: 70 e0 ldi r23, 0x00 ; 0 1337a: c8 01 movw r24, r16 1337c: 0f 94 93 a7 call 0x34f26 ; 0x34f26 if(namestartpos==NULL) 13380: 00 97 sbiw r24, 0x00 ; 0 13382: 19 f0 breq .+6 ; 0x1338a { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 13384: 8c 01 movw r16, r24 13386: 0f 5f subi r16, 0xFF ; 255 13388: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 1338a: 80 e5 ldi r24, 0x50 ; 80 1338c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13390: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 13392: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13396: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1339a: 08 17 cp r16, r24 1339c: 19 07 cpc r17, r25 1339e: 08 f4 brcc .+2 ; 0x133a2 call_procedure=false; //false alert, 'P' found within filename 133a0: f1 2c mov r15, r1 if( card.mounted ) 133a2: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 133a6: 88 23 and r24, r24 133a8: 09 f4 brne .+2 ; 0x133ac 133aa: 86 ce rjmp .-756 ; 0x130b8 { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 133ac: 61 e0 ldi r22, 0x01 ; 1 133ae: 6f 25 eor r22, r15 133b0: c8 01 movw r24, r16 133b2: 0f 94 63 4c call 0x298c6 ; 0x298c6 if(code_seen('S')) 133b6: 83 e5 ldi r24, 0x53 ; 83 133b8: 0e 94 b6 55 call 0xab6c ; 0xab6c 133bc: 88 23 and r24, r24 133be: 99 f0 breq .+38 ; 0x133e6 if(strchr_pointer 133c4: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 133c8: 80 17 cp r24, r16 133ca: 91 07 cpc r25, r17 133cc: 60 f4 brcc .+24 ; 0x133e6 card.setIndex(code_value_long()); 133ce: 0e 94 1e 56 call 0xac3c ; 0xac3c 133d2: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 133d6: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 133da: 80 93 80 16 sts 0x1680, r24 ; 0x801680 133de: 90 93 81 16 sts 0x1681, r25 ; 0x801681 133e2: 0f 94 53 44 call 0x288a6 ; 0x288a6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 133e6: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 133ea: 88 23 and r24, r24 133ec: 31 f0 breq .+12 ; 0x133fa { sdprinting = true; 133ee: 81 e0 ldi r24, 0x01 ; 1 133f0: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 133f4: 85 e0 ldi r24, 0x05 ; 5 133f6: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> card.startFileprint(); if(!call_procedure) 133fa: f1 10 cpse r15, r1 133fc: 5d ce rjmp .-838 ; 0x130b8 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); }; 133fe: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 13402: 88 23 and r24, r24 13404: 61 f0 breq .+24 ; 0x1341e { if(!card.get_sdpos()) 13406: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1340a: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1340e: a0 91 80 16 lds r26, 0x1680 ; 0x801680 13412: b0 91 81 16 lds r27, 0x1681 ; 0x801681 13416: 89 2b or r24, r25 13418: 8a 2b or r24, r26 1341a: 8b 2b or r24, r27 1341c: 69 f4 brne .+26 ; 0x13438 { // A new print has started from scratch, reset stats failstats_reset_print(); 1341e: 0e 94 29 56 call 0xac52 ; 0xac52 sdpos_atomic = 0; 13422: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 13426: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 1342a: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 1342e: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 13432: 80 e0 ldi r24, 0x00 ; 0 13434: 0e 94 69 74 call 0xe8d2 ; 0xe8d2 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 13438: 0f 94 b4 20 call 0x24168 ; 0x24168 1343c: 3d ce rjmp .-902 ; 0x130b8 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1343e: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13442: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 } } void CardReader::openLogFile(const char* name) { logging = true; 13446: 21 e0 ldi r18, 0x01 ; 1 13448: 20 93 69 13 sts 0x1369, r18 ; 0x801369 openFileWrite(name); 1344c: 05 96 adiw r24, 0x05 ; 5 1344e: 0f 94 7f 52 call 0x2a4fe ; 0x2a4fe 13452: 32 ce rjmp .-924 ; 0x130b8 ### 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(); 13454: 0f 94 c4 1c call 0x23988 ; 0x23988 int16_t sec, min; min = t / 60; sec = t % 60; 13458: 2c e3 ldi r18, 0x3C ; 60 1345a: 30 e0 ldi r19, 0x00 ; 0 1345c: 40 e0 ldi r20, 0x00 ; 0 1345e: 50 e0 ldi r21, 0x00 ; 0 13460: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 13464: 7f 93 push r23 13466: 6f 93 push r22 13468: 3f 93 push r19 1346a: 2f 93 push r18 1346c: 80 ef ldi r24, 0xF0 ; 240 1346e: 90 e8 ldi r25, 0x80 ; 128 13470: 9f 93 push r25 13472: 8f 93 push r24 13474: 8e 01 movw r16, r28 13476: 0f 5f subi r16, 0xFF ; 255 13478: 1f 4f sbci r17, 0xFF ; 255 1347a: 1f 93 push r17 1347c: 0f 93 push r16 1347e: 0f 94 53 a0 call 0x340a6 ; 0x340a6 SERIAL_ECHO_START; 13482: 87 e7 ldi r24, 0x77 ; 119 13484: 9e e9 ldi r25, 0x9E ; 158 13486: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(time); 1348a: c8 01 movw r24, r16 1348c: 0f 94 5d 9a call 0x334ba ; 0x334ba lcd_setstatus(time); 13490: c8 01 movw r24, r16 13492: 0e 94 8d ef call 0x1df1a ; 0x1df1a autotempShutdown(); 13496: 0f b6 in r0, 0x3f ; 63 13498: f8 94 cli 1349a: de bf out 0x3e, r29 ; 62 1349c: 0f be out 0x3f, r0 ; 63 1349e: cd bf out 0x3d, r28 ; 61 134a0: 0b ce rjmp .-1002 ; 0x130b8 } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 134a2: 17 fd sbrc r17, 7 134a4: 09 ce rjmp .-1006 ; 0x130b8 134a6: b5 c8 rjmp .-3734 ; 0x12612 ### 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); 134a8: 80 e1 ldi r24, 0x10 ; 16 134aa: 0e 94 28 c6 call 0x18c50 ; 0x18c50 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 134ae: 81 ea ldi r24, 0xA1 ; 161 134b0: 9d e0 ldi r25, 0x0D ; 13 134b2: 0f 94 3c a1 call 0x34278 ; 0x34278 134b6: 4b e0 ldi r20, 0x0B ; 11 134b8: 84 9f mul r24, r20 134ba: c0 01 movw r24, r0 134bc: 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); 134be: 70 e0 ldi r23, 0x00 ; 0 134c0: 60 e0 ldi r22, 0x00 ; 0 134c2: 80 5b subi r24, 0xB0 ; 176 134c4: 92 4f sbci r25, 0xF2 ; 242 134c6: 0f 94 7e a1 call 0x342fc ; 0x342fc // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 134ca: 82 e0 ldi r24, 0x02 ; 2 134cc: 0e 94 28 c6 call 0x18c50 ; 0x18c50 reset_bed_offset_and_skew(); 134d0: 0f 94 db 90 call 0x321b6 ; 0x321b6 // 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(); 134d4: 0f 94 bc 90 call 0x32178 ; 0x32178 134d8: ef cd rjmp .-1058 ; 0x130b8 */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 134da: 8a e5 ldi r24, 0x5A ; 90 134dc: 0e 94 b6 55 call 0xab6c ; 0xab6c // 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); 134e0: 0e 94 8a c6 call 0x18d14 ; 0x18d14 134e4: e9 cd rjmp .-1070 ; 0x130b8 SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 134e6: 84 eb ldi r24, 0xB4 ; 180 134e8: 90 e8 ldi r25, 0x80 ; 128 134ea: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 134ee: e4 cd rjmp .-1080 ; 0x130b8 } } else { SERIAL_PROTOCOLLNPGM("n/a"); 134f0: 80 eb ldi r24, 0xB0 ; 176 134f2: 90 e8 ldi r25, 0x80 ; 128 134f4: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 134f8: df cd rjmp .-1090 ; 0x130b8 /*! ### 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); 134fa: 84 e0 ldi r24, 0x04 ; 4 134fc: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 13500: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_consume_click(); 13504: 0e 94 14 6c call 0xd828 ; 0xd828 for (;;) { manage_heater(); 13508: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1350c: 81 e0 ldi r24, 0x01 ; 1 1350e: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_show_end_stops(); 13512: 0f 94 78 0a call 0x214f0 ; 0x214f0 if (lcd_clicked()) { 13516: 0e 94 19 6c call 0xd832 ; 0xd832 1351a: 88 23 and r24, r24 1351c: a9 f3 breq .-22 ; 0x13508 break; } } lcd_clear(); 1351e: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_return_to_status(); 13522: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e 13526: c8 cd rjmp .-1136 ; 0x130b8 13528: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 1352c: c5 cd rjmp .-1142 ; 0x130b8 break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 1352e: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 13532: 1f 92 push r1 13534: 8f 93 push r24 13536: 84 ec ldi r24, 0xC4 ; 196 13538: 96 e6 ldi r25, 0x66 ; 102 1353a: 9f 93 push r25 1353c: 8f 93 push r24 1353e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13542: 0f 90 pop r0 13544: 0f 90 pop r0 13546: 0f 90 pop r0 13548: 0f 90 pop r0 1354a: b6 cd rjmp .-1172 ; 0x130b8 - `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(); 1354c: 80 e5 ldi r24, 0x50 ; 80 1354e: 0e 94 b6 55 call 0xab6c ; 0xab6c 13552: 88 23 and r24, r24 13554: 21 f0 breq .+8 ; 0x1355e 13556: 0e 94 cb 55 call 0xab96 ; 0xab96 1355a: 80 93 71 02 sts 0x0271, r24 ; 0x800271 if(code_seen('R')) print_time_remaining_normal = code_value(); 1355e: 82 e5 ldi r24, 0x52 ; 82 13560: 0e 94 b6 55 call 0xab6c ; 0xab6c 13564: 88 23 and r24, r24 13566: 41 f0 breq .+16 ; 0x13578 13568: 0e 94 8e 5a call 0xb51c ; 0xb51c 1356c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 13570: 70 93 75 02 sts 0x0275, r23 ; 0x800275 13574: 60 93 74 02 sts 0x0274, r22 ; 0x800274 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 13578: 81 e5 ldi r24, 0x51 ; 81 1357a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1357e: 88 23 and r24, r24 13580: 21 f0 breq .+8 ; 0x1358a 13582: 0e 94 cb 55 call 0xab96 ; 0xab96 13586: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 1358a: 83 e5 ldi r24, 0x53 ; 83 1358c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13590: 88 23 and r24, r24 13592: 41 f0 breq .+16 ; 0x135a4 13594: 0e 94 8e 5a call 0xb51c ; 0xb51c 13598: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 1359c: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 135a0: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 135a4: 83 e4 ldi r24, 0x43 ; 67 135a6: 0e 94 b6 55 call 0xab6c ; 0xab6c 135aa: 88 23 and r24, r24 135ac: a9 f0 breq .+42 ; 0x135d8 float print_time_to_change_normal_f = code_value(); 135ae: 0e 94 8e 5a call 0xb51c ; 0xb51c 135b2: 6b 01 movw r12, r22 135b4: 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; 135b6: 20 e0 ldi r18, 0x00 ; 0 135b8: 30 e0 ldi r19, 0x00 ; 0 135ba: a9 01 movw r20, r18 135bc: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 135c0: 6f ef ldi r22, 0xFF ; 255 135c2: 7f ef ldi r23, 0xFF ; 255 135c4: 18 16 cp r1, r24 135c6: 24 f4 brge .+8 ; 0x135d0 135c8: c7 01 movw r24, r14 135ca: b6 01 movw r22, r12 135cc: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 135d0: 70 93 73 02 sts 0x0273, r23 ; 0x800273 135d4: 60 93 72 02 sts 0x0272, r22 ; 0x800272 } if(code_seen('D')){ 135d8: 84 e4 ldi r24, 0x44 ; 68 135da: 0e 94 b6 55 call 0xab6c ; 0xab6c 135de: 88 23 and r24, r24 135e0: a9 f0 breq .+42 ; 0x1360c float print_time_to_change_silent_f = code_value(); 135e2: 0e 94 8e 5a call 0xb51c ; 0xb51c 135e6: 6b 01 movw r12, r22 135e8: 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; 135ea: 20 e0 ldi r18, 0x00 ; 0 135ec: 30 e0 ldi r19, 0x00 ; 0 135ee: a9 01 movw r20, r18 135f0: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 135f4: 6f ef ldi r22, 0xFF ; 255 135f6: 7f ef ldi r23, 0xFF ; 255 135f8: 18 16 cp r1, r24 135fa: 24 f4 brge .+8 ; 0x13604 135fc: c7 01 movw r24, r14 135fe: b6 01 movw r22, r12 13600: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 13604: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 13608: 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); 1360c: 80 91 73 02 lds r24, 0x0273 ; 0x800273 13610: 8f 93 push r24 13612: 80 91 72 02 lds r24, 0x0272 ; 0x800272 13616: 8f 93 push r24 13618: 80 91 75 02 lds r24, 0x0275 ; 0x800275 1361c: 8f 93 push r24 1361e: 80 91 74 02 lds r24, 0x0274 ; 0x800274 13622: 8f 93 push r24 13624: 80 91 71 02 lds r24, 0x0271 ; 0x800271 13628: 28 2f mov r18, r24 1362a: 08 2e mov r0, r24 1362c: 00 0c add r0, r0 1362e: 33 0b sbc r19, r19 13630: 3f 93 push r19 13632: 8f 93 push r24 13634: 8a e6 ldi r24, 0x6A ; 106 13636: 96 e6 ldi r25, 0x66 ; 102 13638: 9f 93 push r25 1363a: 8f 93 push r24 1363c: 01 e7 ldi r16, 0x71 ; 113 1363e: 16 e6 ldi r17, 0x66 ; 102 13640: 1f 93 push r17 13642: 0f 93 push r16 13644: 0f 94 fe 9f call 0x33ffc ; 0x33ffc printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 13648: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 1364c: 8f 93 push r24 1364e: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 13652: 8f 93 push r24 13654: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 13658: 8f 93 push r24 1365a: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 1365e: 8f 93 push r24 13660: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 13664: 28 2f mov r18, r24 13666: 08 2e mov r0, r24 13668: 00 0c add r0, r0 1366a: 33 0b sbc r19, r19 1366c: 3f 93 push r19 1366e: 8f 93 push r24 13670: 83 e6 ldi r24, 0x63 ; 99 13672: 96 e6 ldi r25, 0x66 ; 102 13674: 9f 93 push r25 13676: 8f 93 push r24 13678: 1f 93 push r17 1367a: 0f 93 push r16 1367c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13680: 0f b6 in r0, 0x3f ; 63 13682: f8 94 cli 13684: de bf out 0x3e, r29 ; 62 13686: 0f be out 0x3f, r0 ; 63 13688: cd bf out 0x3d, r28 ; 61 1368a: 16 cd rjmp .-1492 ; 0x130b8 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 1368c: 0e 94 fc ef call 0x1dff8 ; 0x1dff8 13690: 88 23 and r24, r24 13692: 09 f4 brne .+2 ; 0x13696 13694: 11 cd rjmp .-1502 ; 0x130b8 13696: d0 ce rjmp .-608 ; 0x13438 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 13698: 80 91 59 03 lds r24, 0x0359 ; 0x800359 1369c: 81 30 cpi r24, 0x01 ; 1 1369e: 09 f0 breq .+2 ; 0x136a2 136a0: 0b cd rjmp .-1514 ; 0x130b8 state = PAUSED; 136a2: 82 e0 ldi r24, 0x02 ; 2 136a4: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 136a8: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 136ac: 60 93 78 06 sts 0x0678, r22 ; 0x800678 136b0: 70 93 79 06 sts 0x0679, r23 ; 0x800679 136b4: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 136b8: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 136bc: fd cc rjmp .-1542 ; 0x130b8 /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 136be: 0f 94 d8 20 call 0x241b0 ; 0x241b0 save_statistics(); 136c2: 0e 94 b9 5f call 0xbf72 ; 0xbf72 136c6: f8 cc rjmp .-1552 ; 0x130b8 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 136c8: 8a e5 ldi r24, 0x5A ; 90 136ca: 93 e0 ldi r25, 0x03 ; 3 136cc: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 136d0: 83 e5 ldi r24, 0x53 ; 83 136d2: 0e 94 b6 55 call 0xab6c ; 0xab6c 136d6: 88 23 and r24, r24 136d8: 09 f1 breq .+66 ; 0x1371c , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 136da: 62 e2 ldi r22, 0x22 ; 34 136dc: 70 e0 ldi r23, 0x00 ; 0 136de: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 136e2: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 136e6: 0f 94 93 a7 call 0x34f26 ; 0x34f26 136ea: 8c 01 movw r16, r24 if (!this->ptr) { 136ec: 89 2b or r24, r25 136ee: b1 f0 breq .+44 ; 0x1371c // First quote not found return; } // Skip the leading quote this->ptr++; 136f0: 0f 5f subi r16, 0xFF ; 255 136f2: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 136f4: 62 e2 ldi r22, 0x22 ; 34 136f6: 70 e0 ldi r23, 0x00 ; 0 136f8: c8 01 movw r24, r16 136fa: 0f 94 93 a7 call 0x34f26 ; 0x34f26 if(!pStrEnd) { 136fe: 89 2b or r24, r25 13700: 69 f0 breq .+26 ; 0x1371c char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 13702: e2 e7 ldi r30, 0x72 ; 114 13704: f6 e0 ldi r31, 0x06 ; 6 13706: 83 e0 ldi r24, 0x03 ; 3 13708: df 01 movw r26, r30 1370a: 1d 92 st X+, r1 1370c: 8a 95 dec r24 1370e: e9 f7 brne .-6 ; 0x1370a static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 13710: 42 e0 ldi r20, 0x02 ; 2 13712: 50 e0 ldi r21, 0x00 ; 0 13714: b8 01 movw r22, r16 13716: cf 01 movw r24, r30 13718: 0f 94 bc a7 call 0x34f78 ; 0x34f78 } #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 1371c: 8c e8 ldi r24, 0x8C ; 140 1371e: 9f e0 ldi r25, 0x0F ; 15 13720: 0f 94 3c a1 call 0x34278 ; 0x34278 && printer_recovering() && printingIsPaused()) { 13724: 81 30 cpi r24, 0x01 ; 1 13726: 09 f0 breq .+2 ; 0x1372a 13728: c7 cc rjmp .-1650 ; 0x130b8 #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() 1372a: 0e 94 34 61 call 0xc268 ; 0xc268 1372e: 88 23 and r24, r24 13730: 09 f4 brne .+2 ; 0x13734 13732: c2 cc rjmp .-1660 ; 0x130b8 && printingIsPaused()) { 13734: 0e 94 3e 61 call 0xc27c ; 0xc27c 13738: 88 23 and r24, r24 1373a: 09 f4 brne .+2 ; 0x1373e 1373c: bd cc rjmp .-1670 ; 0x130b8 // 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); 1373e: 86 e4 ldi r24, 0x46 ; 70 13740: 96 e6 ldi r25, 0x66 ; 102 13742: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 13746: b8 cc rjmp .-1680 ; 0x130b8 /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 13748: 89 e2 ldi r24, 0x29 ; 41 1374a: 96 e6 ldi r25, 0x66 ; 102 1374c: 0e 94 60 73 call 0xe6c0 ; 0xe6c0 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 13750: 83 e5 ldi r24, 0x53 ; 83 13752: 0e 94 b6 55 call 0xab6c ; 0xab6c 13756: 88 23 and r24, r24 13758: 09 f4 brne .+2 ; 0x1375c 1375a: ae cc rjmp .-1700 ; 0x130b8 1375c: 0e 94 8e 5a call 0xb51c ; 0xb51c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13760: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 13764: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 13768: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 1376c: a5 cc rjmp .-1718 ; 0x130b8 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 "); 1376e: 8a e9 ldi r24, 0x9A ; 154 13770: 90 e8 ldi r25, 0x80 ; 128 13772: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 gcode_M105(); 13776: 0e 94 4d 72 call 0xe49a ; 0xe49a cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 1377a: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 cmdbuffer_front_already_processed = true; 1377e: 81 e0 ldi r24, 0x01 ; 1 13780: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 13784: 99 cc rjmp .-1742 ; 0x130b8 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 13786: 83 e5 ldi r24, 0x53 ; 83 13788: 0e 94 b6 55 call 0xab6c ; 0xab6c 1378c: 88 23 and r24, r24 1378e: 51 f0 breq .+20 ; 0x137a4 autoReportFeatures.SetPeriod( code_value_uint8() ); 13790: 0e 94 cb 55 call 0xab96 ; 0xab96 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; 13794: 80 93 62 13 sts 0x1362, r24 ; 0x801362 if (auto_report_period != 0){ 13798: 88 23 and r24, r24 1379a: 71 f0 breq .+28 ; 0x137b8 auto_report_timer.start(); 1379c: 83 e6 ldi r24, 0x63 ; 99 1379e: 93 e1 ldi r25, 0x13 ; 19 137a0: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 137a4: 83 e4 ldi r24, 0x43 ; 67 137a6: 0e 94 b6 55 call 0xab6c ; 0xab6c 137aa: 88 23 and r24, r24 137ac: 41 f0 breq .+16 ; 0x137be autoReportFeatures.SetMask(code_value_uint8()); 137ae: 0e 94 cb 55 call 0xab96 ; 0xab96 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; } 137b2: 80 93 61 13 sts 0x1361, r24 ; 0x801361 137b6: 80 cc rjmp .-1792 ; 0x130b8 137b8: 10 92 63 13 sts 0x1363, r1 ; 0x801363 137bc: f3 cf rjmp .-26 ; 0x137a4 137be: 81 e0 ldi r24, 0x01 ; 1 137c0: 80 93 61 13 sts 0x1361, r24 ; 0x801361 137c4: 79 cc rjmp .-1806 ; 0x130b8 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)); 137c6: 80 e7 ldi r24, 0x70 ; 112 137c8: 99 e4 ldi r25, 0x49 ; 73 137ca: 0e 94 32 6d call 0xda64 ; 0xda64 137ce: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 heating_status = HeatingStatus::EXTRUDER_HEATING; 137d2: 81 e0 ldi r24, 0x01 ; 1 137d4: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 137d8: 0f 94 5f 99 call 0x332be ; 0x332be #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 137dc: 83 e5 ldi r24, 0x53 ; 83 137de: 0e 94 b6 55 call 0xab6c ; 0xab6c 137e2: 88 23 and r24, r24 137e4: 49 f0 breq .+18 ; 0x137f8 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 137e6: 0e 94 8e 5a call 0xb51c ; 0xb51c return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 137ea: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 137ee: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 137f2: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 137f6: 05 c0 rjmp .+10 ; 0x13802 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 137f8: 82 e5 ldi r24, 0x52 ; 82 137fa: 0e 94 b6 55 call 0xab6c ; 0xab6c 137fe: 81 11 cpse r24, r1 13800: f2 cf rjmp .-28 ; 0x137e6 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 13802: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 13806: 6b 01 movw r12, r22 13808: 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]; 1380a: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 1380e: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 13812: 07 2e mov r0, r23 13814: 00 0c add r0, r0 13816: 88 0b sbc r24, r24 13818: 99 0b sbc r25, r25 1381a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1381e: 11 e0 ldi r17, 0x01 ; 1 13820: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 13824: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 13828: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 1382c: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 13830: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 13834: 18 16 cp r1, r24 13836: 0c f0 brlt .+2 ; 0x1383a 13838: 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 1383a: 10 93 c3 0d sts 0x0DC3, r17 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 1383e: c7 01 movw r24, r14 13840: b6 01 movw r22, r12 13842: 0f 94 f5 4e call 0x29dea ; 0x29dea LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 13846: 80 e6 ldi r24, 0x60 ; 96 13848: 99 e4 ldi r25, 0x49 ; 73 1384a: 0e 94 32 6d call 0xda64 ; 0xda64 1384e: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 13852: 82 e0 ldi r24, 0x02 ; 2 13854: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(2); 13858: 0f 94 5f 99 call 0x332be ; 0x332be previous_millis_cmd.start(); 1385c: 8a e4 ldi r24, 0x4A ; 74 1385e: 93 e0 ldi r25, 0x03 ; 3 13860: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> 13864: 29 cc rjmp .-1966 ; 0x130b8 */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 13866: 82 e5 ldi r24, 0x52 ; 82 13868: 99 e4 ldi r25, 0x49 ; 73 1386a: 0e 94 32 6d call 0xda64 ; 0xda64 1386e: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 heating_status = HeatingStatus::BED_HEATING; 13872: 83 e0 ldi r24, 0x03 ; 3 13874: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 13878: 81 e0 ldi r24, 0x01 ; 1 1387a: 0f 94 5f 99 call 0x332be ; 0x332be if (code_seen('S')) 1387e: 83 e5 ldi r24, 0x53 ; 83 13880: 0e 94 b6 55 call 0xab6c ; 0xab6c 13884: 18 2f mov r17, r24 13886: 88 23 and r24, r24 13888: 49 f0 breq .+18 ; 0x1389c setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 1388a: 0e 94 8e 5a call 0xb51c ; 0xb51c target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1388e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 13892: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 13896: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 1389a: 05 c0 rjmp .+10 ; 0x138a6 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 1389c: 82 e5 ldi r24, 0x52 ; 82 1389e: 0e 94 b6 55 call 0xab6c ; 0xab6c 138a2: 81 11 cpse r24, r1 138a4: f2 cf rjmp .-28 ; 0x1388a { setTargetBed(code_value()); } codenum = _millis(); 138a6: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 138aa: 6b 01 movw r12, r22 138ac: 7c 01 movw r14, r24 cancel_heatup = false; 138ae: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 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; 138b2: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138b6: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138ba: 07 2e mov r0, r23 138bc: 00 0c add r0, r0 138be: 88 0b sbc r24, r24 138c0: 99 0b sbc r25, r25 138c2: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 138c6: 01 e0 ldi r16, 0x01 ; 1 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: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 138dc: 18 16 cp r1, r24 138de: 0c f0 brlt .+2 ; 0x138e2 138e0: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 138e2: 00 93 c3 0d sts 0x0DC3, r16 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 138e6: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 138ea: 81 11 cpse r24, r1 138ec: 1a c0 rjmp .+52 ; 0x13922 138ee: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138f2: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138f6: 07 2e mov r0, r23 138f8: 00 0c add r0, r0 138fa: 88 0b sbc r24, r24 138fc: 99 0b sbc r25, r25 138fe: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 13902: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 13906: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 1390a: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 1390e: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 13912: e0 91 c3 0d lds r30, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> 13916: ee 23 and r30, r30 13918: 91 f0 breq .+36 ; 0x1393e 1391a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1391e: 18 16 cp r1, r24 13920: a4 f0 brlt .+40 ; 0x1394a } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 13922: 87 e4 ldi r24, 0x47 ; 71 13924: 99 e4 ldi r25, 0x49 ; 73 13926: 0e 94 32 6d call 0xda64 ; 0xda64 1392a: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 1392e: 84 e0 ldi r24, 0x04 ; 4 13930: 80 93 99 03 sts 0x0399, r24 ; 0x800399 previous_millis_cmd.start(); 13934: 8a e4 ldi r24, 0x4A ; 74 13936: 93 e0 ldi r25, 0x03 ; 3 13938: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> 1393c: bd cb rjmp .-2182 ; 0x130b8 codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 1393e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 13942: 87 ff sbrs r24, 7 13944: ee cf rjmp .-36 ; 0x13922 13946: 11 11 cpse r17, r1 13948: ec cf rjmp .-40 ; 0x13922 { if (lcd_commands_type == LcdCommands::LongPause) { 1394a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1394e: 82 30 cpi r24, 0x02 ; 2 13950: 41 f3 breq .-48 ; 0x13922 // 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. 13952: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 13956: 6c 19 sub r22, r12 13958: 7d 09 sbc r23, r13 1395a: 8e 09 sbc r24, r14 1395c: 9f 09 sbc r25, r15 1395e: 69 3e cpi r22, 0xE9 ; 233 13960: 73 40 sbci r23, 0x03 ; 3 13962: 81 05 cpc r24, r1 13964: 91 05 cpc r25, r1 13966: 50 f0 brcs .+20 ; 0x1397c { if (!farm_mode) { 13968: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1396c: 81 11 cpse r24, r1 1396e: 02 c0 rjmp .+4 ; 0x13974 serialecho_temperatures(); 13970: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 } codenum = _millis(); 13974: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 13978: 6b 01 movw r12, r22 1397a: 7c 01 movw r14, r24 } manage_heater(); 1397c: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 13980: 80 e0 ldi r24, 0x00 ; 0 13982: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); 13986: 80 e0 ldi r24, 0x00 ; 0 13988: 0e 94 c3 69 call 0xd386 ; 0xd386 1398c: ac cf rjmp .-168 ; 0x138e6 #### 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')){ 1398e: 83 e5 ldi r24, 0x53 ; 83 13990: 0e 94 b6 55 call 0xab6c ; 0xab6c 13994: 88 23 and r24, r24 13996: 29 f0 breq .+10 ; 0x139a2 fanSpeed = code_value_uint8(); 13998: 0e 94 cb 55 call 0xab96 ; 0xab96 1399c: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 139a0: 8b cb rjmp .-2282 ; 0x130b8 } else { fanSpeed = 255; 139a2: 8f ef ldi r24, 0xFF ; 255 139a4: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 139a8: 87 cb rjmp .-2290 ; 0x130b8 /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 139aa: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 139ae: 84 cb rjmp .-2296 ; 0x130b8 /*! ### 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; 139b0: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 139b4: 87 7f andi r24, 0xF7 ; 247 139b6: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 139ba: 7e cb rjmp .-2308 ; 0x130b8 ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 139bc: 83 e5 ldi r24, 0x53 ; 83 139be: 0e 94 b6 55 call 0xab6c ; 0xab6c 139c2: 88 23 and r24, r24 139c4: 99 f0 breq .+38 ; 0x139ec stepper_inactive_time = code_value() * 1000; 139c6: 0e 94 8e 5a call 0xb51c ; 0xb51c 139ca: 20 e0 ldi r18, 0x00 ; 0 139cc: 30 e0 ldi r19, 0x00 ; 0 139ce: 4a e7 ldi r20, 0x7A ; 122 139d0: 54 e4 ldi r21, 0x44 ; 68 139d2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 139d6: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 139da: 60 93 37 02 sts 0x0237, r22 ; 0x800237 139de: 70 93 38 02 sts 0x0238, r23 ; 0x800238 139e2: 80 93 39 02 sts 0x0239, r24 ; 0x800239 139e6: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 139ea: 66 cb rjmp .-2356 ; 0x130b8 } 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]))); 139ec: 88 e5 ldi r24, 0x58 ; 88 139ee: 0e 94 b6 55 call 0xab6c ; 0xab6c 139f2: 88 23 and r24, r24 139f4: d1 f0 breq .+52 ; 0x13a2a disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 139f6: 0f 94 a0 22 call 0x24540 ; 0x24540 if (code_seen('X')) disable_x(); 139fa: 88 e5 ldi r24, 0x58 ; 88 139fc: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a00: 81 11 cpse r24, r1 13a02: 28 c0 rjmp .+80 ; 0x13a54 if (code_seen('Y')) disable_y(); 13a04: 89 e5 ldi r24, 0x59 ; 89 13a06: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a0a: 88 23 and r24, r24 13a0c: 19 f0 breq .+6 ; 0x13a14 13a0e: 16 9a sbi 0x02, 6 ; 2 13a10: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 if (code_seen('Z')) disable_z(); 13a14: 8a e5 ldi r24, 0x5A ; 90 13a16: 0e 94 b6 55 call 0xab6c ; 0xab6c #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 13a1a: 85 e4 ldi r24, 0x45 ; 69 13a1c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a20: 88 23 and r24, r24 13a22: 09 f4 brne .+2 ; 0x13a26 13a24: 49 cb rjmp .-2414 ; 0x130b8 13a26: 14 9a sbi 0x02, 4 ; 2 13a28: 47 cb rjmp .-2418 ; 0x130b8 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]))); 13a2a: 89 e5 ldi r24, 0x59 ; 89 13a2c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a30: 81 11 cpse r24, r1 13a32: e1 cf rjmp .-62 ; 0x139f6 13a34: 8a e5 ldi r24, 0x5A ; 90 13a36: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a3a: 81 11 cpse r24, r1 13a3c: dc cf rjmp .-72 ; 0x139f6 13a3e: 85 e4 ldi r24, 0x45 ; 69 13a40: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a44: 81 11 cpse r24, r1 13a46: d7 cf rjmp .-82 ; 0x139f6 if(all_axis) { st_synchronize(); 13a48: 0f 94 a0 22 call 0x24540 ; 0x24540 disable_e0(); 13a4c: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 13a4e: 0e 94 ba 74 call 0xe974 ; 0xe974 13a52: 32 cb rjmp .-2460 ; 0x130b8 } else { st_synchronize(); if (code_seen('X')) disable_x(); 13a54: 17 9a sbi 0x02, 7 ; 2 13a56: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 13a5a: d4 cf rjmp .-88 ; 0x13a04 #### 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')) { 13a5c: 83 e5 ldi r24, 0x53 ; 83 13a5e: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a62: 88 23 and r24, r24 13a64: 09 f4 brne .+2 ; 0x13a68 13a66: 28 cb rjmp .-2480 ; 0x130b8 max_inactive_time = code_value() * 1000; 13a68: 0e 94 8e 5a call 0xb51c ; 0xb51c 13a6c: 20 e0 ldi r18, 0x00 ; 0 13a6e: 30 e0 ldi r19, 0x00 ; 0 13a70: 4a e7 ldi r20, 0x7A ; 122 13a72: 54 e4 ldi r21, 0x44 ; 68 13a74: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 13a78: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 13a7c: 60 93 46 03 sts 0x0346, r22 ; 0x800346 13a80: 70 93 47 03 sts 0x0347, r23 ; 0x800347 13a84: 80 93 48 03 sts 0x0348, r24 ; 0x800348 13a88: 90 93 49 03 sts 0x0349, r25 ; 0x800349 13a8c: 15 cb rjmp .-2518 ; 0x130b8 13a8e: 84 ec ldi r24, 0xC4 ; 196 13a90: 88 2e mov r8, r24 13a92: 82 e0 ldi r24, 0x02 ; 2 13a94: 98 2e mov r9, r24 13a96: 92 e3 ldi r25, 0x32 ; 50 13a98: a9 2e mov r10, r25 13a9a: 94 e0 ldi r25, 0x04 ; 4 13a9c: 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++) 13a9e: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 13aa0: f4 01 movw r30, r8 13aa2: 81 91 ld r24, Z+ 13aa4: 4f 01 movw r8, r30 13aa6: 0e 94 b6 55 call 0xab6c ; 0xab6c 13aaa: 88 23 and r24, r24 13aac: 09 f4 brne .+2 ; 0x13ab0 13aae: 65 c0 rjmp .+202 ; 0x13b7a { float value = code_value(); 13ab0: 0e 94 8e 5a call 0xb51c ; 0xb51c 13ab4: 6b 01 movw r12, r22 13ab6: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 13ab8: 13 30 cpi r17, 0x03 ; 3 13aba: 09 f0 breq .+2 ; 0x13abe 13abc: 68 c0 rjmp .+208 ; 0x13b8e if(value < 20.0) { 13abe: 20 e0 ldi r18, 0x00 ; 0 13ac0: 30 e0 ldi r19, 0x00 ; 0 13ac2: 40 ea ldi r20, 0xA0 ; 160 13ac4: 51 e4 ldi r21, 0x41 ; 65 13ac6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 13aca: 87 ff sbrs r24, 7 13acc: 4e c0 rjmp .+156 ; 0x13b6a const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 13ace: a7 01 movw r20, r14 13ad0: 96 01 movw r18, r12 13ad2: 60 91 42 04 lds r22, 0x0442 ; 0x800442 13ad6: 70 91 43 04 lds r23, 0x0443 ; 0x800443 13ada: 80 91 44 04 lds r24, 0x0444 ; 0x800444 13ade: 90 91 45 04 lds r25, 0x0445 ; 0x800445 13ae2: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 13ae6: 2b 01 movw r4, r22 13ae8: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 13aea: ac 01 movw r20, r24 13aec: 9b 01 movw r18, r22 13aee: 60 91 86 04 lds r22, 0x0486 ; 0x800486 13af2: 70 91 87 04 lds r23, 0x0487 ; 0x800487 13af6: 80 91 88 04 lds r24, 0x0488 ; 0x800488 13afa: 90 91 89 04 lds r25, 0x0489 ; 0x800489 13afe: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 13b02: 60 93 86 04 sts 0x0486, r22 ; 0x800486 13b06: 70 93 87 04 sts 0x0487, r23 ; 0x800487 13b0a: 80 93 88 04 sts 0x0488, r24 ; 0x800488 13b0e: 90 93 89 04 sts 0x0489, r25 ; 0x800489 max_feedrate[E_AXIS] *= factor; 13b12: a3 01 movw r20, r6 13b14: 92 01 movw r18, r4 13b16: 60 91 52 04 lds r22, 0x0452 ; 0x800452 13b1a: 70 91 53 04 lds r23, 0x0453 ; 0x800453 13b1e: 80 91 54 04 lds r24, 0x0454 ; 0x800454 13b22: 90 91 55 04 lds r25, 0x0455 ; 0x800455 13b26: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 13b2a: 60 93 52 04 sts 0x0452, r22 ; 0x800452 13b2e: 70 93 53 04 sts 0x0453, r23 ; 0x800453 13b32: 80 93 54 04 sts 0x0454, r24 ; 0x800454 13b36: 90 93 55 04 sts 0x0455, r25 ; 0x800455 max_acceleration_steps_per_s2[E_AXIS] *= factor; 13b3a: 60 91 f1 16 lds r22, 0x16F1 ; 0x8016f1 13b3e: 70 91 f2 16 lds r23, 0x16F2 ; 0x8016f2 13b42: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 13b46: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 13b4a: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 13b4e: a3 01 movw r20, r6 13b50: 92 01 movw r18, r4 13b52: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 13b56: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 13b5a: 60 93 f1 16 sts 0x16F1, r22 ; 0x8016f1 13b5e: 70 93 f2 16 sts 0x16F2, r23 ; 0x8016f2 13b62: 80 93 f3 16 sts 0x16F3, r24 ; 0x8016f3 13b66: 90 93 f4 16 sts 0x16F4, r25 ; 0x8016f4 } cs.axis_steps_per_mm[E_AXIS] = value; 13b6a: c0 92 42 04 sts 0x0442, r12 ; 0x800442 13b6e: d0 92 43 04 sts 0x0443, r13 ; 0x800443 13b72: e0 92 44 04 sts 0x0444, r14 ; 0x800444 13b76: f0 92 45 04 sts 0x0445, r15 ; 0x800445 13b7a: b4 e0 ldi r27, 0x04 ; 4 13b7c: ab 0e add r10, r27 13b7e: b1 1c adc r11, r1 13b80: 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++) 13b82: 14 30 cpi r17, 0x04 ; 4 13b84: 09 f0 breq .+2 ; 0x13b88 13b86: 8c cf rjmp .-232 ; 0x13aa0 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 13b88: 0f 94 f5 75 call 0x2ebea ; 0x2ebea 13b8c: 95 ca rjmp .-2774 ; 0x130b8 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; 13b8e: d5 01 movw r26, r10 13b90: 14 96 adiw r26, 0x04 ; 4 13b92: cd 92 st X+, r12 13b94: dd 92 st X+, r13 13b96: ed 92 st X+, r14 13b98: fc 92 st X, r15 13b9a: 17 97 sbiw r26, 0x07 ; 7 13b9c: ee cf rjmp .-36 ; 0x13b7a #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 13b9e: 83 e5 ldi r24, 0x53 ; 83 13ba0: 0e 94 b6 55 call 0xab6c ; 0xab6c 13ba4: 88 23 and r24, r24 13ba6: 29 f0 breq .+10 ; 0x13bb2 host_keepalive_interval = code_value_uint8(); 13ba8: 0e 94 cb 55 call 0xab96 ; 0xab96 13bac: 80 93 32 02 sts 0x0232, r24 ; 0x800232 13bb0: 83 ca rjmp .-2810 ; 0x130b8 } else { SERIAL_ECHO_START; 13bb2: 87 e7 ldi r24, 0x77 ; 119 13bb4: 9e e9 ldi r25, 0x9E ; 158 13bb6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 13bba: c0 90 32 02 lds r12, 0x0232 ; 0x800232 13bbe: d1 2c mov r13, r1 13bc0: f1 2c mov r15, r1 13bc2: 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); } 13bc4: 83 e9 ldi r24, 0x93 ; 147 13bc6: 90 e8 ldi r25, 0x80 ; 128 13bc8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13bcc: 4a e0 ldi r20, 0x0A ; 10 13bce: c7 01 movw r24, r14 13bd0: b6 01 movw r22, r12 13bd2: 0f 94 8c 97 call 0x32f18 ; 0x32f18 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 13bd6: 0f 94 5c 99 call 0x332b8 ; 0x332b8 13bda: 6e ca rjmp .-2852 ; 0x130b8 */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 13bdc: 85 e5 ldi r24, 0x55 ; 85 13bde: 0e 94 b6 55 call 0xab6c ; 0xab6c 13be2: 88 23 and r24, r24 13be4: 09 f4 brne .+2 ; 0x13be8 13be6: 5a c0 rjmp .+180 ; 0x13c9c // 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); 13be8: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13bec: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13bf0: 0f 5f subi r16, 0xFF ; 255 13bf2: 1f 4f sbci r17, 0xFF ; 255 13bf4: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 13bf8: 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) 13bfc: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 13c00: 88 23 and r24, r24 13c02: 09 f4 brne .+2 ; 0x13c06 13c04: 59 ca rjmp .-2894 ; 0x130b8 // 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)) 13c06: be 01 movw r22, r28 13c08: 6f 5f subi r22, 0xFF ; 255 13c0a: 7f 4f sbci r23, 0xFF ; 255 13c0c: c8 01 movw r24, r16 13c0e: 0e 94 45 e1 call 0x1c28a ; 0x1c28a 13c12: 88 23 and r24, r24 13c14: 09 f4 brne .+2 ; 0x13c18 13c16: 50 ca rjmp .-2912 ; 0x130b8 13c18: 82 e5 ldi r24, 0x52 ; 82 13c1a: 97 e8 ldi r25, 0x87 ; 135 13c1c: de 01 movw r26, r28 13c1e: 11 96 adiw r26, 0x01 ; 1 13c20: be 01 movw r22, r28 13c22: 67 5f subi r22, 0xF7 ; 247 13c24: 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]); 13c26: fc 01 movw r30, r24 13c28: 45 91 lpm r20, Z+ 13c2a: 54 91 lpm r21, Z if (ver_gcode[i] > v) 13c2c: 2d 91 ld r18, X+ 13c2e: 3d 91 ld r19, X+ 13c30: 42 17 cp r20, r18 13c32: 53 07 cpc r21, r19 13c34: 10 f4 brcc .+4 ; 0x13c3a 13c36: 0c 94 39 b0 jmp 0x16072 ; 0x16072 return 1; else if (ver_gcode[i] < v) 13c3a: 24 17 cp r18, r20 13c3c: 35 07 cpc r19, r21 13c3e: 08 f4 brcc .+2 ; 0x13c42 13c40: 3b ca rjmp .-2954 ; 0x130b8 13c42: 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) 13c44: a6 17 cp r26, r22 13c46: b7 07 cpc r27, r23 13c48: 71 f7 brne .-36 ; 0x13c26 13c4a: 36 ca rjmp .-2964 ; 0x130b8 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)); 13c4c: 80 e6 ldi r24, 0x60 ; 96 13c4e: 99 e3 ldi r25, 0x39 ; 57 13c50: 0e 94 32 6d call 0xda64 ; 0xda64 13c54: ac 01 movw r20, r24 13c56: 63 e0 ldi r22, 0x03 ; 3 13c58: 80 e0 ldi r24, 0x00 ; 0 13c5a: 0e 94 10 6a call 0xd420 ; 0xd420 Sound_MakeCustom(50,1000,false); 13c5e: 40 e0 ldi r20, 0x00 ; 0 13c60: 68 ee ldi r22, 0xE8 ; 232 13c62: 73 e0 ldi r23, 0x03 ; 3 13c64: 82 e3 ldi r24, 0x32 ; 50 13c66: 90 e0 ldi r25, 0x00 ; 0 13c68: 0f 94 0b 32 call 0x26416 ; 0x26416 delay_keep_alive(500); 13c6c: 84 ef ldi r24, 0xF4 ; 244 13c6e: 91 e0 ldi r25, 0x01 ; 1 13c70: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 Sound_MakeCustom(50,1000,false); 13c74: 40 e0 ldi r20, 0x00 ; 0 13c76: 68 ee ldi r22, 0xE8 ; 232 13c78: 73 e0 ldi r23, 0x03 ; 3 13c7a: 82 e3 ldi r24, 0x32 ; 50 13c7c: 90 e0 ldi r25, 0x00 ; 0 13c7e: 0f 94 0b 32 call 0x26416 ; 0x26416 lcd_wait_for_click_delay(30); 13c82: 8e e1 ldi r24, 0x1E ; 30 13c84: 90 e0 ldi r25, 0x00 ; 0 13c86: 0f 94 f5 34 call 0x269ea ; 0x269ea lcd_update_enable(true); 13c8a: 81 e0 ldi r24, 0x01 ; 1 13c8c: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 13c90: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_update(0); 13c94: 80 e0 ldi r24, 0x00 ; 0 13c96: 0e 94 c3 69 call 0xd386 ; 0xd386 13c9a: 0e ca rjmp .-3044 ; 0x130b8 } 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); 13c9c: 41 e1 ldi r20, 0x11 ; 17 13c9e: 50 e0 ldi r21, 0x00 ; 0 13ca0: 60 e8 ldi r22, 0x80 ; 128 13ca2: 7c e0 ldi r23, 0x0C ; 12 13ca4: ce 01 movw r24, r28 13ca6: 01 96 adiw r24, 0x01 ; 1 13ca8: 0f 94 2c a1 call 0x34258 ; 0x34258 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 13cac: 85 e7 ldi r24, 0x75 ; 117 13cae: 90 e8 ldi r25, 0x80 ; 128 13cb0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 13cb4: 89 ed ldi r24, 0xD9 ; 217 13cb6: 9f e9 ldi r25, 0x9F ; 159 13cb8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM("+"); 13cbc: 83 e7 ldi r24, 0x73 ; 115 13cbe: 90 e8 ldi r25, 0x80 ; 128 13cc0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 13cc4: 8e e6 ldi r24, 0x6E ; 110 13cc6: 90 e8 ldi r25, 0x80 ; 128 13cc8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM("_"); 13ccc: 8c e6 ldi r24, 0x6C ; 108 13cce: 90 e8 ldi r25, 0x80 ; 128 13cd0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(FW_COMMIT_HASH); 13cd4: 82 e6 ldi r24, 0x62 ; 98 13cd6: 90 e8 ldi r25, 0x80 ; 128 13cd8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 13cdc: 88 e0 ldi r24, 0x08 ; 8 13cde: 90 e8 ldi r25, 0x80 ; 128 13ce0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(PROTOCOL_VERSION); 13ce4: 84 e0 ldi r24, 0x04 ; 4 13ce6: 90 e8 ldi r25, 0x80 ; 128 13ce8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 13cec: 85 ef ldi r24, 0xF5 ; 245 13cee: 9f e7 ldi r25, 0x7F ; 127 13cf0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 13cf4: ce 01 movw r24, r28 13cf6: 01 96 adiw r24, 0x01 ; 1 13cf8: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 13cfc: 83 ee ldi r24, 0xE3 ; 227 13cfe: 9f e7 ldi r25, 0x7F ; 127 13d00: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 13d04: 82 ee ldi r24, 0xE2 ; 226 13d06: 9f e7 ldi r25, 0x7F ; 127 13d08: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 } #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'); 13d0c: 1f 92 push r1 13d0e: 01 e3 ldi r16, 0x31 ; 49 13d10: f0 2e mov r15, r16 13d12: ff 92 push r15 13d14: 8b e4 ldi r24, 0x4B ; 75 13d16: 9e e7 ldi r25, 0x7E ; 126 13d18: 9f 93 push r25 13d1a: 8f 93 push r24 13d1c: 04 e0 ldi r16, 0x04 ; 4 13d1e: 1e e7 ldi r17, 0x7E ; 126 13d20: 1f 93 push r17 13d22: 0f 93 push r16 13d24: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13d28: 1f 92 push r1 13d2a: ff 92 push r15 13d2c: 8b e3 ldi r24, 0x3B ; 59 13d2e: 9e e7 ldi r25, 0x7E ; 126 13d30: 9f 93 push r25 13d32: 8f 93 push r24 13d34: 1f 93 push r17 13d36: 0f 93 push r16 13d38: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13d3c: 1f 92 push r1 13d3e: ff 92 push r15 13d40: 87 e2 ldi r24, 0x27 ; 39 13d42: 9e e7 ldi r25, 0x7E ; 126 13d44: 9f 93 push r25 13d46: 8f 93 push r24 13d48: 1f 93 push r17 13d4a: 0f 93 push r16 13d4c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13d50: 1f 92 push r1 13d52: ff 92 push r15 13d54: 8a e1 ldi r24, 0x1A ; 26 13d56: 9e e7 ldi r25, 0x7E ; 126 13d58: 9f 93 push r25 13d5a: 8f 93 push r24 13d5c: 1f 93 push r17 13d5e: 0f 93 push r16 13d60: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13d64: 1f 92 push r1 13d66: ff 92 push r15 13d68: 8f e0 ldi r24, 0x0F ; 15 13d6a: 9e e7 ldi r25, 0x7E ; 126 13d6c: 9f 93 push r25 13d6e: 8f 93 push r24 13d70: 1f 93 push r17 13d72: 0f 93 push r16 13d74: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 13d78: 0f b6 in r0, 0x3f ; 63 13d7a: f8 94 cli 13d7c: de bf out 0x3e, r29 ; 62 13d7e: 0f be out 0x3f, r0 ; 63 13d80: cd bf out 0x3d, r28 ; 61 13d82: 9a c9 rjmp .-3276 ; 0x130b8 /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 13d84: 0e 94 d2 71 call 0xe3a4 ; 0xe3a4 13d88: 97 c9 rjmp .-3282 ; 0x130b8 /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 13d8a: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 13d8e: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 13d92: cf 01 movw r24, r30 13d94: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 13d96: 24 81 ldd r18, Z+4 ; 0x04 13d98: 20 32 cpi r18, 0x20 ; 32 13d9a: 09 f4 brne .+2 ; 0x13d9e 13d9c: 01 96 adiw r24, 0x01 ; 1 13d9e: 0e 94 8d ef call 0x1df1a ; 0x1df1a custom_message_type = CustomMsg::M117; 13da2: 87 e0 ldi r24, 0x07 ; 7 13da4: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 13da8: 87 c9 rjmp .-3314 ; 0x130b8 - `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; 13daa: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13dae: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13db2: 0b 5f subi r16, 0xFB ; 251 13db4: 1f 4f sbci r17, 0xFF ; 255 13db6: 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; 13db8: f1 2c mov r15, r1 13dba: 40 e0 ldi r20, 0x00 ; 0 13dbc: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 13dbe: e9 f0 breq .+58 ; 0x13dfa // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 13dc0: d8 01 movw r26, r16 13dc2: 9c 91 ld r25, X 13dc4: 29 2f mov r18, r25 13dc6: 2b 7f andi r18, 0xFB ; 251 13dc8: 21 34 cpi r18, 0x41 ; 65 13dca: b9 f4 brne .+46 ; 0x13dfa 13dcc: 11 96 adiw r26, 0x01 ; 1 13dce: 2c 91 ld r18, X 13dd0: 21 33 cpi r18, 0x31 ; 49 13dd2: 99 f4 brne .+38 ; 0x13dfa switch (p[0]) { 13dd4: 91 34 cpi r25, 0x41 ; 65 13dd6: 71 f0 breq .+28 ; 0x13df4 13dd8: 95 34 cpi r25, 0x45 ; 69 13dda: 09 f4 brne .+2 ; 0x13dde case 'A': hasA = true; break; case 'E': hasE = true; break; 13ddc: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 13dde: 98 01 movw r18, r16 13de0: 2e 5f subi r18, 0xFE ; 254 13de2: 3f 4f sbci r19, 0xFF ; 255 13de4: 89 01 movw r16, r18 13de6: 2f 5f subi r18, 0xFF ; 255 13de8: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 13dea: f8 01 movw r30, r16 13dec: 90 81 ld r25, Z 13dee: 90 32 cpi r25, 0x20 ; 32 13df0: c9 f3 breq .-14 ; 0x13de4 13df2: e4 cf rjmp .-56 ; 0x13dbc 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; 13df4: ff 24 eor r15, r15 13df6: f3 94 inc r15 13df8: f2 cf rjmp .-28 ; 0x13dde } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 13dfa: 44 23 and r20, r20 13dfc: 21 f0 breq .+8 ; 0x13e06 13dfe: 87 e7 ldi r24, 0x77 ; 119 13e00: 9e e9 ldi r25, 0x9E ; 158 13e02: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (hasA) SERIAL_ECHOPGM("//"); 13e06: ff 20 and r15, r15 13e08: 21 f0 breq .+8 ; 0x13e12 13e0a: 8f ed ldi r24, 0xDF ; 223 13e0c: 9f e7 ldi r25, 0x7F ; 127 13e0e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(p); 13e12: c8 01 movw r24, r16 13e14: 0f 94 5d 9a call 0x334ba ; 0x334ba 13e18: 4f c9 rjmp .-3426 ; 0x130b8 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); 13e1a: 89 ef ldi r24, 0xF9 ; 249 13e1c: 95 e6 ldi r25, 0x65 ; 101 13e1e: 0c 94 4b 94 jmp 0x12896 ; 0x12896 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); 13e22: 89 ef ldi r24, 0xF9 ; 249 13e24: 95 e6 ldi r25, 0x65 ; 101 13e26: 0c 94 59 94 jmp 0x128b2 ; 0x128b2 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); 13e2a: 89 ef ldi r24, 0xF9 ; 249 13e2c: 95 e6 ldi r25, 0x65 ; 101 13e2e: 0c 94 67 94 jmp 0x128ce ; 0x128ce 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); 13e32: 89 ef ldi r24, 0xF9 ; 249 13e34: 95 e6 ldi r25, 0x65 ; 101 13e36: 0c 94 75 94 jmp 0x128ea ; 0x128ea E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 13e3a: 0e 94 1e 60 call 0xc03c ; 0xc03c 13e3e: 3c c9 rjmp .-3464 ; 0x130b8 */ 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')) { 13e40: 84 e5 ldi r24, 0x54 ; 84 13e42: 0e 94 b6 55 call 0xab6c ; 0xab6c 13e46: 88 23 and r24, r24 13e48: 69 f0 breq .+26 ; 0x13e64 extruder = code_value_uint8(); 13e4a: 0e 94 cb 55 call 0xab96 ; 0xab96 if(extruder >= EXTRUDERS) { 13e4e: 88 23 and r24, r24 13e50: 49 f0 breq .+18 ; 0x13e64 SERIAL_ECHO_START; 13e52: 87 e7 ldi r24, 0x77 ; 119 13e54: 9e e9 ldi r25, 0x9E ; 158 13e56: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 13e5a: 8a ec ldi r24, 0xCA ; 202 13e5c: 95 e6 ldi r25, 0x65 ; 101 13e5e: 0e 94 2b 7d call 0xfa56 ; 0xfa56 13e62: 2a c9 rjmp .-3500 ; 0x130b8 SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 13e64: 84 e4 ldi r24, 0x44 ; 68 13e66: 0e 94 b6 55 call 0xab6c ; 0xab6c 13e6a: 88 23 and r24, r24 13e6c: 09 f4 brne .+2 ; 0x13e70 13e6e: 24 c9 rjmp .-3512 ; 0x130b8 float diameter = code_value(); 13e70: 0e 94 8e 5a call 0xb51c ; 0xb51c if (diameter == 0.0) { 13e74: 20 e0 ldi r18, 0x00 ; 0 13e76: 30 e0 ldi r19, 0x00 ; 0 13e78: a9 01 movw r20, r18 13e7a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 13e7e: 81 11 cpse r24, r1 13e80: 05 c0 rjmp .+10 ; 0x13e8c // 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; 13e82: 10 92 c9 04 sts 0x04C9, r1 ; 0x8004c9 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 13e86: 0e 94 53 5f call 0xbea6 ; 0xbea6 13e8a: 16 c9 rjmp .-3540 ; 0x130b8 // 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(); 13e8c: 0e 94 8e 5a call 0xb51c ; 0xb51c 13e90: 6b 01 movw r12, r22 13e92: 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]); 13e94: 20 e0 ldi r18, 0x00 ; 0 13e96: 30 e0 ldi r19, 0x00 ; 0 13e98: a9 01 movw r20, r18 13e9a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 13e9e: 81 11 cpse r24, r1 13ea0: 06 c0 rjmp .+12 ; 0x13eae 13ea2: c1 2c mov r12, r1 13ea4: d1 2c mov r13, r1 13ea6: 10 ee ldi r17, 0xE0 ; 224 13ea8: e1 2e mov r14, r17 13eaa: 1f e3 ldi r17, 0x3F ; 63 13eac: f1 2e mov r15, r17 13eae: c0 92 ca 04 sts 0x04CA, r12 ; 0x8004ca 13eb2: d0 92 cb 04 sts 0x04CB, r13 ; 0x8004cb 13eb6: e0 92 cc 04 sts 0x04CC, r14 ; 0x8004cc 13eba: 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; 13ebe: 81 e0 ldi r24, 0x01 ; 1 13ec0: 80 93 c9 04 sts 0x04C9, r24 ; 0x8004c9 13ec4: e0 cf rjmp .-64 ; 0x13e86 13ec6: 04 ec ldi r16, 0xC4 ; 196 13ec8: 12 e0 ldi r17, 0x02 ; 2 13eca: e2 e3 ldi r30, 0x32 ; 50 13ecc: ee 2e mov r14, r30 13ece: e4 e0 ldi r30, 0x04 ; 4 13ed0: fe 2e mov r15, r30 13ed2: f8 ec ldi r31, 0xC8 ; 200 13ed4: cf 2e mov r12, r31 13ed6: f2 e0 ldi r31, 0x02 ; 2 13ed8: 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])) 13eda: d8 01 movw r26, r16 13edc: 8d 91 ld r24, X+ 13ede: 8d 01 movw r16, r26 13ee0: 0e 94 b6 55 call 0xab6c ; 0xab6c 13ee4: 88 23 and r24, r24 13ee6: 39 f0 breq .+14 ; 0x13ef6 { float val = code_value(); 13ee8: 0e 94 8e 5a call 0xb51c ; 0xb51c 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; 13eec: f7 01 movw r30, r14 13eee: 64 8b std Z+20, r22 ; 0x14 13ef0: 75 8b std Z+21, r23 ; 0x15 13ef2: 86 8b std Z+22, r24 ; 0x16 13ef4: 97 8b std Z+23, r25 ; 0x17 13ef6: f4 e0 ldi r31, 0x04 ; 4 13ef8: ef 0e add r14, r31 13efa: 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++) 13efc: c0 16 cp r12, r16 13efe: d1 06 cpc r13, r17 13f00: 61 f7 brne .-40 ; 0x13eda 13f02: da c8 rjmp .-3660 ; 0x130b8 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 13f04: 83 e5 ldi r24, 0x53 ; 83 13f06: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f0a: 88 23 and r24, r24 13f0c: 19 f1 breq .+70 ; 0x13f54 // 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(); 13f0e: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f12: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13f16: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13f1a: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13f1e: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13f22: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f26: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f2a: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f2e: 90 93 69 04 sts 0x0469, r25 ; 0x800469 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 13f32: 84 e5 ldi r24, 0x54 ; 84 13f34: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f38: 88 23 and r24, r24 13f3a: 09 f4 brne .+2 ; 0x13f3e 13f3c: bd c8 rjmp .-3718 ; 0x130b8 cs.retract_acceleration = code_value(); 13f3e: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f42: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f46: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f4a: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f4e: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d 13f52: b2 c8 rjmp .-3740 ; 0x130b8 } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 13f54: 80 e5 ldi r24, 0x50 ; 80 13f56: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f5a: 88 23 and r24, r24 13f5c: 51 f0 breq .+20 ; 0x13f72 cs.acceleration = code_value(); 13f5e: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f62: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f66: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f6a: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f6e: 90 93 69 04 sts 0x0469, r25 ; 0x800469 if(code_seen('R')) 13f72: 82 e5 ldi r24, 0x52 ; 82 13f74: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f78: 88 23 and r24, r24 13f7a: 51 f0 breq .+20 ; 0x13f90 cs.retract_acceleration = code_value(); 13f7c: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f80: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f84: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f88: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f8c: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d if(code_seen('T')) 13f90: 84 e5 ldi r24, 0x54 ; 84 13f92: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f96: 88 23 and r24, r24 13f98: 09 f4 brne .+2 ; 0x13f9c 13f9a: 8e c8 rjmp .-3812 ; 0x130b8 cs.travel_acceleration = code_value(); 13f9c: 0e 94 8e 5a call 0xb51c ; 0xb51c 13fa0: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13fa4: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13fa8: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13fac: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13fb0: 83 c8 rjmp .-3834 ; 0x130b8 13fb2: 04 ec ldi r16, 0xC4 ; 196 13fb4: 12 e0 ldi r17, 0x02 ; 2 13fb6: 7a e8 ldi r23, 0x8A ; 138 13fb8: e7 2e mov r14, r23 13fba: 74 e0 ldi r23, 0x04 ; 4 13fbc: 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(); 13fbe: d8 01 movw r26, r16 13fc0: 8d 91 ld r24, X+ 13fc2: 8d 01 movw r16, r26 13fc4: 0e 94 b6 55 call 0xab6c ; 0xab6c 13fc8: 88 23 and r24, r24 13fca: 39 f0 breq .+14 ; 0x13fda 13fcc: 0e 94 8e 5a call 0xb51c ; 0xb51c 13fd0: f7 01 movw r30, r14 13fd2: 60 83 st Z, r22 13fd4: 71 83 std Z+1, r23 ; 0x01 13fd6: 82 83 std Z+2, r24 ; 0x02 13fd8: 93 83 std Z+3, r25 ; 0x03 13fda: f4 e0 ldi r31, 0x04 ; 4 13fdc: ef 0e add r14, r31 13fde: 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++) 13fe0: 22 e0 ldi r18, 0x02 ; 2 13fe2: 07 3c cpi r16, 0xC7 ; 199 13fe4: 12 07 cpc r17, r18 13fe6: 59 f7 brne .-42 ; 0x13fbe 13fe8: 67 c8 rjmp .-3890 ; 0x130b8 - `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')) 13fea: 83 e5 ldi r24, 0x53 ; 83 13fec: 0e 94 b6 55 call 0xab6c ; 0xab6c 13ff0: 88 23 and r24, r24 13ff2: 51 f0 breq .+20 ; 0x14008 { cs.retract_length = code_value() ; 13ff4: 0e 94 8e 5a call 0xb51c ; 0xb51c 13ff8: 60 93 b5 04 sts 0x04B5, r22 ; 0x8004b5 13ffc: 70 93 b6 04 sts 0x04B6, r23 ; 0x8004b6 14000: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 14004: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 } if(code_seen('F')) 14008: 86 e4 ldi r24, 0x46 ; 70 1400a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1400e: 88 23 and r24, r24 14010: 61 f0 breq .+24 ; 0x1402a { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 14012: 0e 94 8e 5a call 0xb51c ; 0xb51c 14016: 0e 94 4e 60 call 0xc09c ; 0xc09c 1401a: 60 93 b9 04 sts 0x04B9, r22 ; 0x8004b9 1401e: 70 93 ba 04 sts 0x04BA, r23 ; 0x8004ba 14022: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 14026: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc } if(code_seen('Z')) 1402a: 8a e5 ldi r24, 0x5A ; 90 1402c: 0e 94 b6 55 call 0xab6c ; 0xab6c 14030: 88 23 and r24, r24 14032: 09 f4 brne .+2 ; 0x14036 14034: 41 c8 rjmp .-3966 ; 0x130b8 { cs.retract_zlift = code_value() ; 14036: 0e 94 8e 5a call 0xb51c ; 0xb51c 1403a: 60 93 bd 04 sts 0x04BD, r22 ; 0x8004bd 1403e: 70 93 be 04 sts 0x04BE, r23 ; 0x8004be 14042: 80 93 bf 04 sts 0x04BF, r24 ; 0x8004bf 14046: 90 93 c0 04 sts 0x04C0, r25 ; 0x8004c0 1404a: 36 c8 rjmp .-3988 ; 0x130b8 #### 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')) 1404c: 83 e5 ldi r24, 0x53 ; 83 1404e: 0e 94 b6 55 call 0xab6c ; 0xab6c 14052: 88 23 and r24, r24 14054: 09 f4 brne .+2 ; 0x14058 14056: 30 c8 rjmp .-4000 ; 0x130b8 { switch(code_value_uint8()) 14058: 0e 94 cb 55 call 0xab96 ; 0xab96 1405c: 88 23 and r24, r24 1405e: b9 f0 breq .+46 ; 0x1408e 14060: 81 30 cpi r24, 0x01 ; 1 14062: d1 f0 breq .+52 ; 0x14098 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 14064: 87 e7 ldi r24, 0x77 ; 119 14066: 9e e9 ldi r25, 0x9E ; 158 14068: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1406c: 87 eb ldi r24, 0xB7 ; 183 1406e: 95 e6 ldi r25, 0x65 ; 101 14070: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 14074: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 14078: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 1407c: 8f 51 subi r24, 0x1F ; 31 1407e: 90 4f sbci r25, 0xF0 ; 240 14080: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHOLNPGM("\"(1)"); 14084: 8a ed ldi r24, 0xDA ; 218 14086: 9f e7 ldi r25, 0x7F ; 127 14088: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1408c: 15 c8 rjmp .-4054 ; 0x130b8 { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1408e: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 retracted[0]=false; 14092: 10 92 03 05 sts 0x0503, r1 ; 0x800503 14096: 10 c8 rjmp .-4064 ; 0x130b8 retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 14098: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 retracted[0]=false; 1409c: 10 92 03 05 sts 0x0503, r1 ; 0x800503 140a0: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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; 140a4: 40 90 f6 04 lds r4, 0x04F6 ; 0x8004f6 140a8: 50 90 f7 04 lds r5, 0x04F7 ; 0x8004f7 140ac: 60 90 f8 04 lds r6, 0x04F8 ; 0x8004f8 140b0: 70 90 f9 04 lds r7, 0x04F9 ; 0x8004f9 140b4: 0c 94 98 95 jmp 0x12b30 ; 0x12b30 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 140b8: 80 90 fa 04 lds r8, 0x04FA ; 0x8004fa 140bc: 90 90 fb 04 lds r9, 0x04FB ; 0x8004fb 140c0: a0 90 fc 04 lds r10, 0x04FC ; 0x8004fc 140c4: b0 90 fd 04 lds r11, 0x04FD ; 0x8004fd 140c8: 0c 94 a3 95 jmp 0x12b46 ; 0x12b46 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 140cc: 82 e4 ldi r24, 0x42 ; 66 140ce: 0e 94 b6 55 call 0xab6c ; 0xab6c 140d2: 18 2f mov r17, r24 140d4: 88 23 and r24, r24 140d6: 41 f0 breq .+16 ; 0x140e8 { saved_feedmultiply_mm = feedmultiply; 140d8: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 140dc: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 140e0: 90 93 31 02 sts 0x0231, r25 ; 0x800231 140e4: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 140e8: 83 e5 ldi r24, 0x53 ; 83 140ea: 0e 94 b6 55 call 0xab6c ; 0xab6c 140ee: 08 2f mov r16, r24 140f0: 88 23 and r24, r24 140f2: 39 f0 breq .+14 ; 0x14102 { feedmultiply = code_value_short(); 140f4: 0e 94 d8 55 call 0xabb0 ; 0xabb0 140f8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 140fc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 14100: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 14102: 82 e5 ldi r24, 0x52 ; 82 14104: 0e 94 b6 55 call 0xab6c ; 0xab6c 14108: 88 23 and r24, r24 1410a: 51 f0 breq .+20 ; 0x14120 { feedmultiply = saved_feedmultiply_mm; 1410c: 80 91 30 02 lds r24, 0x0230 ; 0x800230 14110: 90 91 31 02 lds r25, 0x0231 ; 0x800231 14114: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 14118: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 1411c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 codesWereSeen = true; } if (!codesWereSeen) 14120: 11 11 cpse r17, r1 14122: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 { printf_P(PSTR("%i%%\n"), feedmultiply); 14126: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 1412a: 8f 93 push r24 1412c: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 14130: 8f 93 push r24 14132: 84 ed ldi r24, 0xD4 ; 212 14134: 9f e7 ldi r25, 0x7F ; 127 14136: 9f 93 push r25 14138: 8f 93 push r24 1413a: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1413e: 0f 90 pop r0 14140: 0f 90 pop r0 14142: 0f 90 pop r0 14144: 0f 90 pop r0 14146: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1414a: 83 e5 ldi r24, 0x53 ; 83 1414c: 0e 94 b6 55 call 0xab6c ; 0xab6c 14150: 88 23 and r24, r24 14152: 51 f0 breq .+20 ; 0x14168 { extrudemultiply = code_value_short(); 14154: 0e 94 d8 55 call 0xabb0 ; 0xabb0 14158: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a 1415c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 calculate_extruder_multipliers(); 14160: 0e 94 53 5f call 0xbea6 ; 0xbea6 14164: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 14168: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1416c: 8f 93 push r24 1416e: 80 91 59 02 lds r24, 0x0259 ; 0x800259 14172: 8f 93 push r24 14174: 8e ec ldi r24, 0xCE ; 206 14176: 9f e7 ldi r25, 0x7F ; 127 14178: 9f 93 push r25 1417a: 8f 93 push r24 1417c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 14180: 0f 90 pop r0 14182: 0f 90 pop r0 14184: 0f 90 pop r0 14186: 0f 90 pop r0 14188: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1418c: 80 e5 ldi r24, 0x50 ; 80 1418e: 0e 94 b6 55 call 0xab6c ; 0xab6c 14192: 88 23 and r24, r24 14194: 11 f4 brne .+4 ; 0x1419a 14196: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 int pin_number = code_value_short(); // pin number 1419a: 0e 94 d8 55 call 0xabb0 ; 0xabb0 1419e: 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 141a0: 83 e5 ldi r24, 0x53 ; 83 141a2: 0e 94 b6 55 call 0xab6c ; 0xab6c */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 141a6: 0f ef ldi r16, 0xFF ; 255 141a8: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 141aa: 88 23 and r24, r24 141ac: 19 f0 breq .+6 ; 0x141b4 141ae: 0e 94 d8 55 call 0xabb0 ; 0xabb0 141b2: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 141b4: c8 01 movw r24, r16 141b6: 01 96 adiw r24, 0x01 ; 1 141b8: 03 97 sbiw r24, 0x03 ; 3 141ba: 10 f0 brcs .+4 ; 0x141c0 141bc: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 141c0: e4 ed ldi r30, 0xD4 ; 212 141c2: f0 e8 ldi r31, 0x80 ; 128 141c4: 20 ef ldi r18, 0xF0 ; 240 141c6: 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)) 141c8: 84 91 lpm r24, Z 141ca: 08 2e mov r0, r24 141cc: 00 0c add r0, r0 141ce: 99 0b sbc r25, r25 141d0: e8 16 cp r14, r24 141d2: f9 06 cpc r15, r25 141d4: 11 f4 brne .+4 ; 0x141da 141d6: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 141da: 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++) 141dc: 2e 17 cp r18, r30 141de: 3f 07 cpc r19, r31 141e0: 99 f7 brne .-26 ; 0x141c8 pin_number = -1; break; } } if (pin_number > -1) 141e2: f7 fe sbrs r15, 7 141e4: 02 c0 rjmp .+4 ; 0x141ea 141e6: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 { int target = LOW; st_synchronize(); 141ea: 0f 94 a0 22 call 0x24540 ; 0x24540 pinMode(pin_number, INPUT); 141ee: de 2c mov r13, r14 141f0: 60 e0 ldi r22, 0x00 ; 0 141f2: 8e 2d mov r24, r14 141f4: 0e 94 38 c0 call 0x18070 ; 0x18070 switch(pin_state){ 141f8: 0f 3f cpi r16, 0xFF ; 255 141fa: 10 07 cpc r17, r16 141fc: b1 f0 breq .+44 ; 0x1422a 141fe: 01 30 cpi r16, 0x01 ; 1 14200: 11 05 cpc r17, r1 14202: 11 f0 breq .+4 ; 0x14208 } } if (pin_number > -1) { int target = LOW; 14204: 10 e0 ldi r17, 0x00 ; 0 14206: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 14208: 8d 2d mov r24, r13 1420a: 0e 94 e1 bf call 0x17fc2 ; 0x17fc2 1420e: 80 17 cp r24, r16 14210: 91 07 cpc r25, r17 14212: 11 f4 brne .+4 ; 0x14218 14214: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 manage_heater(); 14218: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 1421c: 80 e0 ldi r24, 0x00 ; 0 1421e: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); 14222: 80 e0 ldi r24, 0x00 ; 0 14224: 0e 94 c3 69 call 0xd386 ; 0xd386 14228: ef cf rjmp .-34 ; 0x14208 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 1422a: 8e 2d mov r24, r14 1422c: 0e 94 e1 bf call 0x17fc2 ; 0x17fc2 14230: 31 e0 ldi r19, 0x01 ; 1 14232: 20 e0 ldi r18, 0x00 ; 0 14234: 89 2b or r24, r25 14236: 09 f0 breq .+2 ; 0x1423a 14238: 30 e0 ldi r19, 0x00 ; 0 1423a: 03 2f mov r16, r19 1423c: 12 2f mov r17, r18 1423e: e4 cf rjmp .-56 ; 0x14208 case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 14240: 70 e0 ldi r23, 0x00 ; 0 14242: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 14244: 40 e0 ldi r20, 0x00 ; 0 14246: c8 01 movw r24, r16 14248: 0f 94 0b 32 call 0x26416 ; 0x26416 1424c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 14250: 80 e5 ldi r24, 0x50 ; 80 14252: 0e 94 b6 55 call 0xab6c ; 0xab6c 14256: 88 23 and r24, r24 14258: 51 f0 breq .+20 ; 0x1426e 1425a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1425e: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a 14262: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b 14266: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c 1426a: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 1426e: 89 e4 ldi r24, 0x49 ; 73 14270: 0e 94 b6 55 call 0xab6c ; 0xab6c 14274: 88 23 and r24, r24 14276: 81 f0 breq .+32 ; 0x14298 14278: 0e 94 8e 5a call 0xb51c ; 0xb51c #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1427c: 2c ea ldi r18, 0xAC ; 172 1427e: 35 ec ldi r19, 0xC5 ; 197 14280: 47 e2 ldi r20, 0x27 ; 39 14282: 5e e3 ldi r21, 0x3E ; 62 14284: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 14288: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e 1428c: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f 14290: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 14294: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 14298: 84 e4 ldi r24, 0x44 ; 68 1429a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1429e: 88 23 and r24, r24 142a0: 81 f0 breq .+32 ; 0x142c2 142a2: 0e 94 8e 5a call 0xb51c ; 0xb51c } float unscalePID_i(float i) { return i/PID_dT; 142a6: 2c ea ldi r18, 0xAC ; 172 142a8: 35 ec ldi r19, 0xC5 ; 197 142aa: 47 e2 ldi r20, 0x27 ; 39 142ac: 5e e3 ldi r21, 0x3E ; 62 142ae: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 142b2: 60 93 a2 04 sts 0x04A2, r22 ; 0x8004a2 142b6: 70 93 a3 04 sts 0x04A3, r23 ; 0x8004a3 142ba: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 142be: 90 93 a5 04 sts 0x04A5, r25 ; 0x8004a5 updatePID(); 142c2: 0f 94 f4 18 call 0x231e8 ; 0x231e8 SERIAL_PROTOCOLRPGM(MSG_OK); 142c6: 85 ed ldi r24, 0xD5 ; 213 142c8: 99 e6 ldi r25, 0x69 ; 105 142ca: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLPGM(" p:"); 142ce: 8a ec ldi r24, 0xCA ; 202 142d0: 9f e7 ldi r25, 0x7F ; 127 142d2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 142d6: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 142da: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 142de: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 142e2: 90 91 9d 04 lds r25, 0x049D ; 0x80049d 142e6: 42 e0 ldi r20, 0x02 ; 2 142e8: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 142ec: 86 ec ldi r24, 0xC6 ; 198 142ee: 9f e7 ldi r25, 0x7F ; 127 142f0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 142f4: 2c ea ldi r18, 0xAC ; 172 142f6: 35 ec ldi r19, 0xC5 ; 197 142f8: 47 e2 ldi r20, 0x27 ; 39 142fa: 5e e3 ldi r21, 0x3E ; 62 142fc: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14300: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 14304: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 14308: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 1430c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 14310: 42 e0 ldi r20, 0x02 ; 2 14312: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 14316: 82 ec ldi r24, 0xC2 ; 194 14318: 9f e7 ldi r25, 0x7F ; 127 1431a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1431e: 2c ea ldi r18, 0xAC ; 172 14320: 35 ec ldi r19, 0xC5 ; 197 14322: 47 e2 ldi r20, 0x27 ; 39 14324: 5e e3 ldi r21, 0x3E ; 62 14326: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 1432a: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 1432e: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14332: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 14336: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 1433a: 0f 94 e3 41 call 0x283c6 ; 0x283c6 1433e: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 14342: 80 e5 ldi r24, 0x50 ; 80 14344: 0e 94 b6 55 call 0xab6c ; 0xab6c 14348: 88 23 and r24, r24 1434a: 51 f0 breq .+20 ; 0x14360 1434c: 0e 94 8e 5a call 0xb51c ; 0xb51c 14350: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 14354: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 14358: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 1435c: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 14360: 89 e4 ldi r24, 0x49 ; 73 14362: 0e 94 b6 55 call 0xab6c ; 0xab6c 14366: 88 23 and r24, r24 14368: 81 f0 breq .+32 ; 0x1438a 1436a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1436e: 2c ea ldi r18, 0xAC ; 172 14370: 35 ec ldi r19, 0xC5 ; 197 14372: 47 e2 ldi r20, 0x27 ; 39 14374: 5e e3 ldi r21, 0x3E ; 62 14376: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1437a: 60 93 aa 04 sts 0x04AA, r22 ; 0x8004aa 1437e: 70 93 ab 04 sts 0x04AB, r23 ; 0x8004ab 14382: 80 93 ac 04 sts 0x04AC, r24 ; 0x8004ac 14386: 90 93 ad 04 sts 0x04AD, r25 ; 0x8004ad if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 1438a: 84 e4 ldi r24, 0x44 ; 68 1438c: 0e 94 b6 55 call 0xab6c ; 0xab6c 14390: 88 23 and r24, r24 14392: 81 f0 breq .+32 ; 0x143b4 14394: 0e 94 8e 5a call 0xb51c ; 0xb51c } float unscalePID_i(float i) { return i/PID_dT; 14398: 2c ea ldi r18, 0xAC ; 172 1439a: 35 ec ldi r19, 0xC5 ; 197 1439c: 47 e2 ldi r20, 0x27 ; 39 1439e: 5e e3 ldi r21, 0x3E ; 62 143a0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 143a4: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae 143a8: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af 143ac: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 143b0: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 updatePID(); 143b4: 0f 94 f4 18 call 0x231e8 ; 0x231e8 SERIAL_PROTOCOLRPGM(MSG_OK); 143b8: 85 ed ldi r24, 0xD5 ; 213 143ba: 99 e6 ldi r25, 0x69 ; 105 143bc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLPGM(" p:"); 143c0: 8e eb ldi r24, 0xBE ; 190 143c2: 9f e7 ldi r25, 0x7F ; 127 143c4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 143c8: 60 91 a6 04 lds r22, 0x04A6 ; 0x8004a6 143cc: 70 91 a7 04 lds r23, 0x04A7 ; 0x8004a7 143d0: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 143d4: 90 91 a9 04 lds r25, 0x04A9 ; 0x8004a9 143d8: 42 e0 ldi r20, 0x02 ; 2 143da: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 143de: 8a eb ldi r24, 0xBA ; 186 143e0: 9f e7 ldi r25, 0x7F ; 127 143e2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 143e6: 2c ea ldi r18, 0xAC ; 172 143e8: 35 ec ldi r19, 0xC5 ; 197 143ea: 47 e2 ldi r20, 0x27 ; 39 143ec: 5e e3 ldi r21, 0x3E ; 62 143ee: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 143f2: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 143f6: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 143fa: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 143fe: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 14402: 42 e0 ldi r20, 0x02 ; 2 14404: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 14408: 86 eb ldi r24, 0xB6 ; 182 1440a: 9f e7 ldi r25, 0x7F ; 127 1440c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 14410: 2c ea ldi r18, 0xAC ; 172 14412: 35 ec ldi r19, 0xC5 ; 197 14414: 47 e2 ldi r20, 0x27 ; 39 14416: 5e e3 ldi r21, 0x3E ; 62 14418: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 1441c: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 14420: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 14424: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 14428: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 1442c: 0f 94 e3 41 call 0x283c6 ; 0x283c6 14430: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 14434: 83 e5 ldi r24, 0x53 ; 83 14436: 0e 94 b6 55 call 0xab6c ; 0xab6c 1443a: 88 23 and r24, r24 1443c: 41 f0 breq .+16 ; 0x1444e 1443e: 0e 94 d8 55 call 0xabb0 ; 0xabb0 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 14442: 90 93 58 02 sts 0x0258, r25 ; 0x800258 14446: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1444a: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 1444e: 90 e0 ldi r25, 0x00 ; 0 14450: 80 e0 ldi r24, 0x00 ; 0 14452: f7 cf rjmp .-18 ; 0x14442 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 14454: 85 e0 ldi r24, 0x05 ; 5 14456: 90 e0 ldi r25, 0x00 ; 0 14458: 0c 94 6e 96 jmp 0x12cdc ; 0x12cdc M400 */ case 400: { st_synchronize(); 1445c: 0f 94 a0 22 call 0x24540 ; 0x24540 14460: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 14464: 81 e0 ldi r24, 0x01 ; 1 14466: 0e 94 a1 6e call 0xdd42 ; 0xdd42 1446a: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 1446e: 80 e0 ldi r24, 0x00 ; 0 14470: 0e 94 a1 6e call 0xdd42 ; 0xdd42 14474: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 14478: 0e 94 b8 73 call 0xe770 ; 0xe770 1447c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 M500 */ case 500: { Config_StoreSettings(); 14480: 0e 94 e4 75 call 0xebc8 ; 0xebc8 14484: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 M502 */ case 502: { Config_ResetDefault(); 14488: 0e 94 53 75 call 0xeaa6 ; 0xeaa6 1448c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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( 14490: 80 91 95 04 lds r24, 0x0495 ; 0x800495 14494: 8f 93 push r24 14496: 80 91 94 04 lds r24, 0x0494 ; 0x800494 1449a: 8f 93 push r24 1449c: 80 91 93 04 lds r24, 0x0493 ; 0x800493 144a0: 8f 93 push r24 144a2: 80 91 92 04 lds r24, 0x0492 ; 0x800492 144a6: 8f 93 push r24 144a8: 80 91 91 04 lds r24, 0x0491 ; 0x800491 144ac: 8f 93 push r24 144ae: 80 91 90 04 lds r24, 0x0490 ; 0x800490 144b2: 8f 93 push r24 144b4: 80 91 8f 04 lds r24, 0x048F ; 0x80048f 144b8: 8f 93 push r24 144ba: 80 91 8e 04 lds r24, 0x048E ; 0x80048e 144be: 8f 93 push r24 144c0: 80 91 8d 04 lds r24, 0x048D ; 0x80048d 144c4: 8f 93 push r24 144c6: 80 91 8c 04 lds r24, 0x048C ; 0x80048c 144ca: 8f 93 push r24 144cc: 80 91 8b 04 lds r24, 0x048B ; 0x80048b 144d0: 8f 93 push r24 144d2: 80 91 8a 04 lds r24, 0x048A ; 0x80048a 144d6: 8f 93 push r24 144d8: 07 e7 ldi r16, 0x77 ; 119 144da: 1e e9 ldi r17, 0x9E ; 158 144dc: 1f 93 push r17 144de: 0f 93 push r16 144e0: 1f 93 push r17 144e2: 0f 93 push r16 144e4: 80 91 89 04 lds r24, 0x0489 ; 0x800489 144e8: 8f 93 push r24 144ea: 80 91 88 04 lds r24, 0x0488 ; 0x800488 144ee: 8f 93 push r24 144f0: 80 91 87 04 lds r24, 0x0487 ; 0x800487 144f4: 8f 93 push r24 144f6: 80 91 86 04 lds r24, 0x0486 ; 0x800486 144fa: 8f 93 push r24 144fc: 80 91 85 04 lds r24, 0x0485 ; 0x800485 14500: 8f 93 push r24 14502: 80 91 84 04 lds r24, 0x0484 ; 0x800484 14506: 8f 93 push r24 14508: 80 91 83 04 lds r24, 0x0483 ; 0x800483 1450c: 8f 93 push r24 1450e: 80 91 82 04 lds r24, 0x0482 ; 0x800482 14512: 8f 93 push r24 14514: 80 91 81 04 lds r24, 0x0481 ; 0x800481 14518: 8f 93 push r24 1451a: 80 91 80 04 lds r24, 0x0480 ; 0x800480 1451e: 8f 93 push r24 14520: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 14524: 8f 93 push r24 14526: 80 91 7e 04 lds r24, 0x047E ; 0x80047e 1452a: 8f 93 push r24 1452c: 80 91 7d 04 lds r24, 0x047D ; 0x80047d 14530: 8f 93 push r24 14532: 80 91 7c 04 lds r24, 0x047C ; 0x80047c 14536: 8f 93 push r24 14538: 80 91 7b 04 lds r24, 0x047B ; 0x80047b 1453c: 8f 93 push r24 1453e: 80 91 7a 04 lds r24, 0x047A ; 0x80047a 14542: 8f 93 push r24 14544: 80 91 79 04 lds r24, 0x0479 ; 0x800479 14548: 8f 93 push r24 1454a: 80 91 78 04 lds r24, 0x0478 ; 0x800478 1454e: 8f 93 push r24 14550: 80 91 77 04 lds r24, 0x0477 ; 0x800477 14554: 8f 93 push r24 14556: 80 91 76 04 lds r24, 0x0476 ; 0x800476 1455a: 8f 93 push r24 1455c: 80 91 75 04 lds r24, 0x0475 ; 0x800475 14560: 8f 93 push r24 14562: 80 91 74 04 lds r24, 0x0474 ; 0x800474 14566: 8f 93 push r24 14568: 80 91 73 04 lds r24, 0x0473 ; 0x800473 1456c: 8f 93 push r24 1456e: 80 91 72 04 lds r24, 0x0472 ; 0x800472 14572: 8f 93 push r24 14574: 80 91 71 04 lds r24, 0x0471 ; 0x800471 14578: 8f 93 push r24 1457a: 80 91 70 04 lds r24, 0x0470 ; 0x800470 1457e: 8f 93 push r24 14580: 80 91 6f 04 lds r24, 0x046F ; 0x80046f 14584: 8f 93 push r24 14586: 80 91 6e 04 lds r24, 0x046E ; 0x80046e 1458a: 8f 93 push r24 1458c: 1f 93 push r17 1458e: 0f 93 push r16 14590: 1f 93 push r17 14592: 0f 93 push r16 14594: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 14598: 8f 93 push r24 1459a: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 1459e: 8f 93 push r24 145a0: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 145a4: 8f 93 push r24 145a6: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 145aa: 8f 93 push r24 145ac: 80 91 6d 04 lds r24, 0x046D ; 0x80046d 145b0: 8f 93 push r24 145b2: 80 91 6c 04 lds r24, 0x046C ; 0x80046c 145b6: 8f 93 push r24 145b8: 80 91 6b 04 lds r24, 0x046B ; 0x80046b 145bc: 8f 93 push r24 145be: 80 91 6a 04 lds r24, 0x046A ; 0x80046a 145c2: 8f 93 push r24 145c4: 80 91 69 04 lds r24, 0x0469 ; 0x800469 145c8: 8f 93 push r24 145ca: 80 91 68 04 lds r24, 0x0468 ; 0x800468 145ce: 8f 93 push r24 145d0: 80 91 67 04 lds r24, 0x0467 ; 0x800467 145d4: 8f 93 push r24 145d6: 80 91 66 04 lds r24, 0x0466 ; 0x800466 145da: 8f 93 push r24 145dc: 1f 93 push r17 145de: 0f 93 push r16 145e0: 1f 93 push r17 145e2: 0f 93 push r16 145e4: 80 91 65 04 lds r24, 0x0465 ; 0x800465 145e8: 8f 93 push r24 145ea: 80 91 64 04 lds r24, 0x0464 ; 0x800464 145ee: 8f 93 push r24 145f0: 80 91 63 04 lds r24, 0x0463 ; 0x800463 145f4: 8f 93 push r24 145f6: 80 91 62 04 lds r24, 0x0462 ; 0x800462 145fa: 8f 93 push r24 145fc: 80 91 61 04 lds r24, 0x0461 ; 0x800461 14600: 8f 93 push r24 14602: 80 91 60 04 lds r24, 0x0460 ; 0x800460 14606: 8f 93 push r24 14608: 80 91 5f 04 lds r24, 0x045F ; 0x80045f 1460c: 8f 93 push r24 1460e: 80 91 5e 04 lds r24, 0x045E ; 0x80045e 14612: 8f 93 push r24 14614: 80 91 5d 04 lds r24, 0x045D ; 0x80045d 14618: 8f 93 push r24 1461a: 80 91 5c 04 lds r24, 0x045C ; 0x80045c 1461e: 8f 93 push r24 14620: 80 91 5b 04 lds r24, 0x045B ; 0x80045b 14624: 8f 93 push r24 14626: 80 91 5a 04 lds r24, 0x045A ; 0x80045a 1462a: 8f 93 push r24 1462c: 80 91 59 04 lds r24, 0x0459 ; 0x800459 14630: 8f 93 push r24 14632: 80 91 58 04 lds r24, 0x0458 ; 0x800458 14636: 8f 93 push r24 14638: 80 91 57 04 lds r24, 0x0457 ; 0x800457 1463c: 8f 93 push r24 1463e: 80 91 56 04 lds r24, 0x0456 ; 0x800456 14642: 8f 93 push r24 14644: 1f 93 push r17 14646: 0f 93 push r16 14648: 1f 93 push r17 1464a: 0f 93 push r16 1464c: 80 91 55 04 lds r24, 0x0455 ; 0x800455 14650: 8f 93 push r24 14652: 80 91 54 04 lds r24, 0x0454 ; 0x800454 14656: 8f 93 push r24 14658: 80 91 53 04 lds r24, 0x0453 ; 0x800453 1465c: 8f 93 push r24 1465e: 80 91 52 04 lds r24, 0x0452 ; 0x800452 14662: 8f 93 push r24 14664: 80 91 51 04 lds r24, 0x0451 ; 0x800451 14668: 8f 93 push r24 1466a: 80 91 50 04 lds r24, 0x0450 ; 0x800450 1466e: 8f 93 push r24 14670: 80 91 4f 04 lds r24, 0x044F ; 0x80044f 14674: 8f 93 push r24 14676: 80 91 4e 04 lds r24, 0x044E ; 0x80044e 1467a: 8f 93 push r24 1467c: 80 91 4d 04 lds r24, 0x044D ; 0x80044d 14680: 8f 93 push r24 14682: 80 91 4c 04 lds r24, 0x044C ; 0x80044c 14686: 8f 93 push r24 14688: 80 91 4b 04 lds r24, 0x044B ; 0x80044b 1468c: 8f 93 push r24 1468e: 80 91 4a 04 lds r24, 0x044A ; 0x80044a 14692: 8f 93 push r24 14694: 80 91 49 04 lds r24, 0x0449 ; 0x800449 14698: 8f 93 push r24 1469a: 80 91 48 04 lds r24, 0x0448 ; 0x800448 1469e: 8f 93 push r24 146a0: 80 91 47 04 lds r24, 0x0447 ; 0x800447 146a4: 8f 93 push r24 146a6: 80 91 46 04 lds r24, 0x0446 ; 0x800446 146aa: 8f 93 push r24 146ac: 1f 93 push r17 146ae: 0f 93 push r16 146b0: 1f 93 push r17 146b2: 0f 93 push r16 146b4: 80 91 45 04 lds r24, 0x0445 ; 0x800445 146b8: 8f 93 push r24 146ba: 80 91 44 04 lds r24, 0x0444 ; 0x800444 146be: 8f 93 push r24 146c0: 80 91 43 04 lds r24, 0x0443 ; 0x800443 146c4: 8f 93 push r24 146c6: 80 91 42 04 lds r24, 0x0442 ; 0x800442 146ca: 8f 93 push r24 146cc: 80 91 41 04 lds r24, 0x0441 ; 0x800441 146d0: 8f 93 push r24 146d2: 80 91 40 04 lds r24, 0x0440 ; 0x800440 146d6: 8f 93 push r24 146d8: 80 91 3f 04 lds r24, 0x043F ; 0x80043f 146dc: 8f 93 push r24 146de: 80 91 3e 04 lds r24, 0x043E ; 0x80043e 146e2: 8f 93 push r24 146e4: 80 91 3d 04 lds r24, 0x043D ; 0x80043d 146e8: 8f 93 push r24 146ea: 80 91 3c 04 lds r24, 0x043C ; 0x80043c 146ee: 8f 93 push r24 146f0: 80 91 3b 04 lds r24, 0x043B ; 0x80043b 146f4: 8f 93 push r24 146f6: 80 91 3a 04 lds r24, 0x043A ; 0x80043a 146fa: 8f 93 push r24 146fc: 80 91 39 04 lds r24, 0x0439 ; 0x800439 14700: 8f 93 push r24 14702: 80 91 38 04 lds r24, 0x0438 ; 0x800438 14706: 8f 93 push r24 14708: 80 91 37 04 lds r24, 0x0437 ; 0x800437 1470c: 8f 93 push r24 1470e: 80 91 36 04 lds r24, 0x0436 ; 0x800436 14712: 8f 93 push r24 14714: 1f 93 push r17 14716: 0f 93 push r16 14718: 1f 93 push r17 1471a: 0f 93 push r16 1471c: 89 ef ldi r24, 0xF9 ; 249 1471e: 9b e7 ldi r25, 0x7B ; 123 14720: 9f 93 push r25 14722: 8f 93 push r24 14724: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 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"), 14728: 0f b6 in r0, 0x3f ; 63 1472a: f8 94 cli 1472c: de bf out 0x3e, r29 ; 62 1472e: 0f be out 0x3f, r0 ; 63 14730: cd bf out 0x3d, r28 ; 61 14732: 2c ea ldi r18, 0xAC ; 172 14734: 35 ec ldi r19, 0xC5 ; 197 14736: 47 e2 ldi r20, 0x27 ; 39 14738: 5e e3 ldi r21, 0x3E ; 62 1473a: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 1473e: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14742: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14746: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 1474a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1474e: 9f 93 push r25 14750: 8f 93 push r24 14752: 7f 93 push r23 14754: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 14756: 2c ea ldi r18, 0xAC ; 172 14758: 35 ec ldi r19, 0xC5 ; 197 1475a: 47 e2 ldi r20, 0x27 ; 39 1475c: 5e e3 ldi r21, 0x3E ; 62 1475e: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14762: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 14766: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 1476a: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 1476e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 14772: 9f 93 push r25 14774: 8f 93 push r24 14776: 7f 93 push r23 14778: 6f 93 push r22 1477a: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 1477e: 8f 93 push r24 14780: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 14784: 8f 93 push r24 14786: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1478a: 8f 93 push r24 1478c: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 14790: 8f 93 push r24 14792: 1f 93 push r17 14794: 0f 93 push r16 14796: 1f 93 push r17 14798: 0f 93 push r16 1479a: 8c ec ldi r24, 0xCC ; 204 1479c: 9b e7 ldi r25, 0x7B ; 123 1479e: 9f 93 push r25 147a0: 8f 93 push r24 147a2: 0f 94 fe 9f call 0x33ffc ; 0x33ffc #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 147a6: 2c ea ldi r18, 0xAC ; 172 147a8: 35 ec ldi r19, 0xC5 ; 197 147aa: 47 e2 ldi r20, 0x27 ; 39 147ac: 5e e3 ldi r21, 0x3E ; 62 147ae: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 147b2: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 147b6: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 147ba: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 147be: 0f 94 09 9c call 0x33812 ; 0x33812 <__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"), 147c2: 9f 93 push r25 147c4: 8f 93 push r24 147c6: 7f 93 push r23 147c8: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 147ca: 2c ea ldi r18, 0xAC ; 172 147cc: 35 ec ldi r19, 0xC5 ; 197 147ce: 47 e2 ldi r20, 0x27 ; 39 147d0: 5e e3 ldi r21, 0x3E ; 62 147d2: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 147d6: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 147da: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 147de: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 147e2: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 147e6: 9f 93 push r25 147e8: 8f 93 push r24 147ea: 7f 93 push r23 147ec: 6f 93 push r22 147ee: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 147f2: 8f 93 push r24 147f4: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 147f8: 8f 93 push r24 147fa: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 147fe: 8f 93 push r24 14800: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 14804: 8f 93 push r24 14806: 1f 93 push r17 14808: 0f 93 push r16 1480a: 1f 93 push r17 1480c: 0f 93 push r16 1480e: 87 e9 ldi r24, 0x97 ; 151 14810: 9b e7 ldi r25, 0x7B ; 123 14812: 9f 93 push r25 14814: 8f 93 push r24 14816: 0f 94 fe 9f call 0x33ffc ; 0x33ffc echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 1481a: 0f b6 in r0, 0x3f ; 63 1481c: f8 94 cli 1481e: de bf out 0x3e, r29 ; 62 14820: 0f be out 0x3f, r0 ; 63 14822: cd bf out 0x3d, r28 ; 61 14824: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 14828: 1f 92 push r1 1482a: 8f 93 push r24 1482c: 1f 93 push r17 1482e: 0f 93 push r16 14830: 1f 93 push r17 14832: 0f 93 push r16 14834: 20 e0 ldi r18, 0x00 ; 0 14836: 30 e0 ldi r19, 0x00 ; 0 14838: 40 e7 ldi r20, 0x70 ; 112 1483a: 52 e4 ldi r21, 0x42 ; 66 1483c: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 14840: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 14844: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 14848: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 1484c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 14850: 9f 93 push r25 14852: 8f 93 push r24 14854: 7f 93 push r23 14856: 6f 93 push r22 14858: 80 91 c4 04 lds r24, 0x04C4 ; 0x8004c4 1485c: 8f 93 push r24 1485e: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 14862: 8f 93 push r24 14864: 80 91 c2 04 lds r24, 0x04C2 ; 0x8004c2 14868: 8f 93 push r24 1486a: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 1486e: 8f 93 push r24 14870: 1f 93 push r17 14872: 0f 93 push r16 14874: 1f 93 push r17 14876: 0f 93 push r16 14878: 80 91 c0 04 lds r24, 0x04C0 ; 0x8004c0 1487c: 8f 93 push r24 1487e: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 14882: 8f 93 push r24 14884: 80 91 be 04 lds r24, 0x04BE ; 0x8004be 14888: 8f 93 push r24 1488a: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd 1488e: 8f 93 push r24 14890: 20 e0 ldi r18, 0x00 ; 0 14892: 30 e0 ldi r19, 0x00 ; 0 14894: 40 e7 ldi r20, 0x70 ; 112 14896: 52 e4 ldi r21, 0x42 ; 66 14898: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 1489c: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 148a0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 148a4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 148a8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 148ac: 9f 93 push r25 148ae: 8f 93 push r24 148b0: 7f 93 push r23 148b2: 6f 93 push r22 148b4: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 148b8: 8f 93 push r24 148ba: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 148be: 8f 93 push r24 148c0: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 148c4: 8f 93 push r24 148c6: 80 91 b5 04 lds r24, 0x04B5 ; 0x8004b5 148ca: 8f 93 push r24 148cc: 1f 93 push r17 148ce: 0f 93 push r16 148d0: 1f 93 push r17 148d2: 0f 93 push r16 148d4: 86 e9 ldi r24, 0x96 ; 150 148d6: 9a e7 ldi r25, 0x7A ; 122 148d8: 9f 93 push r25 148da: 8f 93 push r24 148dc: 0f 94 fe 9f call 0x33ffc ; 0x33ffc ); #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) { 148e0: 0f b6 in r0, 0x3f ; 63 148e2: f8 94 cli 148e4: de bf out 0x3e, r29 ; 62 148e6: 0f be out 0x3f, r0 ; 63 148e8: cd bf out 0x3d, r28 ; 61 148ea: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 148ee: 88 23 and r24, r24 148f0: 09 f4 brne .+2 ; 0x148f4 148f2: 56 c0 rjmp .+172 ; 0x149a0 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 148f4: 80 91 cd 04 lds r24, 0x04CD ; 0x8004cd 148f8: 8f 93 push r24 148fa: 80 91 cc 04 lds r24, 0x04CC ; 0x8004cc 148fe: 8f 93 push r24 14900: 80 91 cb 04 lds r24, 0x04CB ; 0x8004cb 14904: 8f 93 push r24 14906: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca 1490a: 8f 93 push r24 1490c: 1f 93 push r17 1490e: 0f 93 push r16 14910: 1f 93 push r17 14912: 0f 93 push r16 14914: 80 e7 ldi r24, 0x70 ; 112 14916: 9a e7 ldi r25, 0x7A ; 122 14918: 9f 93 push r25 1491a: 8f 93 push r24 1491c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 14920: 0f b6 in r0, 0x3f ; 63 14922: f8 94 cli 14924: de bf out 0x3e, r29 ; 62 14926: 0f be out 0x3f, r0 ; 63 14928: 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( 1492a: 80 91 02 05 lds r24, 0x0502 ; 0x800502 1492e: 8f 93 push r24 14930: 80 91 01 05 lds r24, 0x0501 ; 0x800501 14934: 8f 93 push r24 14936: 80 91 00 05 lds r24, 0x0500 ; 0x800500 1493a: 8f 93 push r24 1493c: 80 91 ff 04 lds r24, 0x04FF ; 0x8004ff 14940: 8f 93 push r24 14942: 80 91 fe 04 lds r24, 0x04FE ; 0x8004fe 14946: 1f 92 push r1 14948: 8f 93 push r24 1494a: 80 91 fd 04 lds r24, 0x04FD ; 0x8004fd 1494e: 8f 93 push r24 14950: 80 91 fc 04 lds r24, 0x04FC ; 0x8004fc 14954: 8f 93 push r24 14956: 80 91 fb 04 lds r24, 0x04FB ; 0x8004fb 1495a: 8f 93 push r24 1495c: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 14960: 8f 93 push r24 14962: 80 91 f9 04 lds r24, 0x04F9 ; 0x8004f9 14966: 8f 93 push r24 14968: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 1496c: 8f 93 push r24 1496e: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 14972: 8f 93 push r24 14974: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 14978: 8f 93 push r24 1497a: 87 e7 ldi r24, 0x77 ; 119 1497c: 9e e9 ldi r25, 0x9E ; 158 1497e: 9f 93 push r25 14980: 8f 93 push r24 14982: 9f 93 push r25 14984: 8f 93 push r24 14986: 8f ec ldi r24, 0xCF ; 207 14988: 99 e7 ldi r25, 0x79 ; 121 1498a: 9f 93 push r25 1498c: 8f 93 push r24 1498e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 14992: 0f b6 in r0, 0x3f ; 63 14994: f8 94 cli 14996: de bf out 0x3e, r29 ; 62 14998: 0f be out 0x3f, r0 ; 63 1499a: cd bf out 0x3d, r28 ; 61 1499c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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); 149a0: 1f 93 push r17 149a2: 0f 93 push r16 149a4: 81 e5 ldi r24, 0x51 ; 81 149a6: 9a e7 ldi r25, 0x7A ; 122 149a8: 9f 93 push r25 149aa: 8f 93 push r24 149ac: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 149b0: 0f 90 pop r0 149b2: 0f 90 pop r0 149b4: 0f 90 pop r0 149b6: 0f 90 pop r0 149b8: b8 cf rjmp .-144 ; 0x1492a #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 149ba: 80 e5 ldi r24, 0x50 ; 80 149bc: 0e 94 b6 55 call 0xab6c ; 0xab6c 149c0: 88 23 and r24, r24 149c2: 11 f4 brne .+4 ; 0x149c8 149c4: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 { uint8_t valCnt = 0; IP_address = 0; 149c8: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 149cc: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 149d0: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 149d4: 10 92 80 06 sts 0x0680, r1 ; 0x800680 149d8: 0d e7 ldi r16, 0x7D ; 125 149da: 16 e0 ldi r17, 0x06 ; 6 149dc: 31 e8 ldi r19, 0x81 ; 129 149de: e3 2e mov r14, r19 149e0: 36 e0 ldi r19, 0x06 ; 6 149e2: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 149e4: 4a e2 ldi r20, 0x2A ; 42 149e6: d4 2e mov r13, r20 149e8: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 149ec: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 149f0: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 149f2: 0e 94 d8 55 call 0xabb0 ; 0xabb0 149f6: d8 01 movw r26, r16 149f8: 8d 93 st X+, r24 149fa: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 149fc: ea 16 cp r14, r26 149fe: fb 06 cpc r15, r27 14a00: 11 f4 brne .+4 ; 0x14a06 14a02: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 14a06: 8e e2 ldi r24, 0x2E ; 46 14a08: 0e 94 b6 55 call 0xab6c ; 0xab6c 14a0c: 81 11 cpse r24, r1 14a0e: ec cf rjmp .-40 ; 0x149e8 if (valCnt != 4) IP_address = 0; 14a10: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 14a14: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 14a18: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 14a1c: 10 92 80 06 sts 0x0680, r1 ; 0x800680 14a20: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 - `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(); 14a24: 0f 94 a0 22 call 0x24540 ; 0x24540 /// 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; 14a28: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 14a2c: 81 11 cpse r24, r1 14a2e: 02 c0 rjmp .+4 ; 0x14a34 14a30: 0e 94 af 5e call 0xbd5e ; 0xbd5e 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(); 14a34: 85 e4 ldi r24, 0x45 ; 69 14a36: 0e 94 b6 55 call 0xab6c ; 0xab6c 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; 14a3a: 81 2c mov r8, r1 14a3c: 91 2c mov r9, r1 14a3e: a1 2c mov r10, r1 14a40: 20 ec ldi r18, 0xC0 ; 192 14a42: 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(); 14a44: 88 23 and r24, r24 14a46: 21 f0 breq .+8 ; 0x14a50 14a48: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a4c: 4b 01 movw r8, r22 14a4e: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 14a50: 8c e4 ldi r24, 0x4C ; 76 14a52: 0e 94 b6 55 call 0xab6c ; 0xab6c 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; 14a56: c1 2c mov r12, r1 14a58: d1 2c mov r13, r1 14a5a: 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(); 14a5c: 88 23 and r24, r24 14a5e: 21 f0 breq .+8 ; 0x14a68 14a60: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a64: 6b 01 movw r12, r22 14a66: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 14a68: 8a e5 ldi r24, 0x5A ; 90 14a6a: 0e 94 b6 55 call 0xab6c ; 0xab6c // 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; 14a6e: 41 2c mov r4, r1 14a70: 51 2c mov r5, r1 14a72: 98 ed ldi r25, 0xD8 ; 216 14a74: 69 2e mov r6, r25 14a76: 91 e4 ldi r25, 0x41 ; 65 14a78: 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()); 14a7a: 88 23 and r24, r24 14a7c: 31 f0 breq .+12 ; 0x14a8a 14a7e: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a82: 2b 01 movw r4, r22 14a84: 3c 01 movw r6, r24 14a86: e8 94 clt 14a88: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 14a8a: 88 e5 ldi r24, 0x58 ; 88 14a8c: 0e 94 b6 55 call 0xab6c ; 0xab6c 14a90: 88 23 and r24, r24 14a92: 09 f4 brne .+2 ; 0x14a96 14a94: b5 c1 rjmp .+874 ; 0x14e00 14a96: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a9a: 68 a7 std Y+40, r22 ; 0x28 14a9c: 79 a7 std Y+41, r23 ; 0x29 14a9e: 8a a7 std Y+42, r24 ; 0x2a 14aa0: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 14aa2: 89 e5 ldi r24, 0x59 ; 89 14aa4: 0e 94 b6 55 call 0xab6c ; 0xab6c 14aa8: 88 23 and r24, r24 14aaa: 09 f4 brne .+2 ; 0x14aae 14aac: b2 c1 rjmp .+868 ; 0x14e12 14aae: 0e 94 8e 5a call 0xb51c ; 0xb51c 14ab2: 6c a7 std Y+44, r22 ; 0x2c 14ab4: 7d a7 std Y+45, r23 ; 0x2d 14ab6: 8e a7 std Y+46, r24 ; 0x2e 14ab8: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 14aba: 1a 82 std Y+2, r1 ; 0x02 14abc: 19 82 std Y+1, r1 ; 0x01 14abe: fe 01 movw r30, r28 14ac0: 33 96 adiw r30, 0x03 ; 3 14ac2: 83 e1 ldi r24, 0x13 ; 19 14ac4: df 01 movw r26, r30 14ac6: 1d 92 st X+, r1 14ac8: 8a 95 dec r24 14aca: e9 f7 brne .-6 ; 0x14ac6 if (code_seen('C')) { 14acc: 83 e4 ldi r24, 0x43 ; 67 14ace: 0e 94 b6 55 call 0xab6c ; 0xab6c 14ad2: 88 23 and r24, r24 14ad4: f9 f0 breq .+62 ; 0x14b14 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14ad6: 62 e2 ldi r22, 0x22 ; 34 14ad8: 70 e0 ldi r23, 0x00 ; 0 14ada: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 14ade: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 14ae2: 0f 94 93 a7 call 0x34f26 ; 0x34f26 14ae6: 8c 01 movw r16, r24 if (!this->ptr) { 14ae8: 89 2b or r24, r25 14aea: a1 f0 breq .+40 ; 0x14b14 // First quote not found return; } // Skip the leading quote this->ptr++; 14aec: 0f 5f subi r16, 0xFF ; 255 14aee: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14af0: 62 e2 ldi r22, 0x22 ; 34 14af2: 70 e0 ldi r23, 0x00 ; 0 14af4: c8 01 movw r24, r16 14af6: 0f 94 93 a7 call 0x34f26 ; 0x34f26 if(!pStrEnd) { 14afa: 00 97 sbiw r24, 0x00 ; 0 14afc: 59 f0 breq .+22 ; 0x14b14 // Second quote not found return; } this->len = pStrEnd - this->ptr; 14afe: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 14b00: 84 31 cpi r24, 0x14 ; 20 14b02: 08 f0 brcs .+2 ; 0x14b06 14b04: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 14b06: 48 2f mov r20, r24 14b08: 50 e0 ldi r21, 0x00 ; 0 14b0a: b8 01 movw r22, r16 14b0c: ce 01 movw r24, r28 14b0e: 01 96 adiw r24, 0x01 ; 1 14b10: 0f 94 65 a7 call 0x34eca ; 0x34eca } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 14b14: 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; 14b18: 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"))) 14b1a: 81 30 cpi r24, 0x01 ; 1 14b1c: 29 f4 brne .+10 ; 0x14b28 14b1e: 81 ea ldi r24, 0xA1 ; 161 14b20: 9f e7 ldi r25, 0x7F ; 127 14b22: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 14b26: 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(); 14b28: 0f 94 a0 22 call 0x24540 ; 0x24540 // 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); 14b2c: 86 e1 ldi r24, 0x16 ; 22 14b2e: 0f 94 5f 99 call 0x332be ; 0x332be // Turn off the fan fanSpeed = 0; 14b32: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 // Retract E if (!printingIsPaused()) 14b36: 0e 94 3e 61 call 0xc27c ; 0xc27c 14b3a: 81 11 cpse r24, r1 14b3c: 6f c1 rjmp .+734 ; 0x14e1c { current_position[E_AXIS] += e_shift; 14b3e: a5 01 movw r20, r10 14b40: 94 01 movw r18, r8 14b42: 60 91 01 12 lds r22, 0x1201 ; 0x801201 14b46: 70 91 02 12 lds r23, 0x1202 ; 0x801202 14b4a: 80 91 03 12 lds r24, 0x1203 ; 0x801203 14b4e: 90 91 04 12 lds r25, 0x1204 ; 0x801204 14b52: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 14b56: 60 93 01 12 sts 0x1201, r22 ; 0x801201 14b5a: 70 93 02 12 sts 0x1202, r23 ; 0x801202 14b5e: 80 93 03 12 sts 0x1203, r24 ; 0x801203 14b62: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 14b66: 60 e0 ldi r22, 0x00 ; 0 14b68: 70 e0 ldi r23, 0x00 ; 0 14b6a: 88 ee ldi r24, 0xE8 ; 232 14b6c: 92 e4 ldi r25, 0x42 ; 66 14b6e: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 14b72: 0f 94 a0 22 call 0x24540 ; 0x24540 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 14b76: 8a ed ldi r24, 0xDA ; 218 14b78: 9a e6 ldi r25, 0x6A ; 106 14b7a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 14b7e: c3 01 movw r24, r6 14b80: b2 01 movw r22, r4 14b82: 0e 94 5e 67 call 0xcebc ; 0xcebc // Move XY to side current_position[X_AXIS] = x_position; 14b86: 28 a5 ldd r18, Y+40 ; 0x28 14b88: 39 a5 ldd r19, Y+41 ; 0x29 14b8a: 4a a5 ldd r20, Y+42 ; 0x2a 14b8c: 5b a5 ldd r21, Y+43 ; 0x2b 14b8e: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 14b92: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 14b96: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 14b9a: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = y_position; 14b9e: 8c a5 ldd r24, Y+44 ; 0x2c 14ba0: 9d a5 ldd r25, Y+45 ; 0x2d 14ba2: ae a5 ldd r26, Y+46 ; 0x2e 14ba4: bf a5 ldd r27, Y+47 ; 0x2f 14ba6: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 14baa: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 14bae: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 14bb2: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14bb6: 60 e0 ldi r22, 0x00 ; 0 14bb8: 70 e0 ldi r23, 0x00 ; 0 14bba: 88 e4 ldi r24, 0x48 ; 72 14bbc: 92 e4 ldi r25, 0x42 ; 66 14bbe: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 14bc2: 0f 94 a0 22 call 0x24540 ; 0x24540 bool repeat = false; 14bc6: 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; 14bc8: 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)); 14bca: 0b eb ldi r16, 0xBB ; 187 14bcc: 20 2e mov r2, r16 14bce: 09 e7 ldi r16, 0x79 ; 121 14bd0: 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)); 14bd2: 83 ec ldi r24, 0xC3 ; 195 14bd4: 88 2e mov r8, r24 14bd6: 89 e7 ldi r24, 0x79 ; 121 14bd8: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 14bda: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14bde: 81 30 cpi r24, 0x01 ; 1 14be0: 09 f0 breq .+2 ; 0x14be4 14be2: 1f c1 rjmp .+574 ; 0x14e22 eject_slot = MMU2::mmu2.get_current_tool(); 14be4: 0f 94 e8 41 call 0x283d0 ; 0x283d0 14be8: a8 2e mov r10, r24 mmu_M600_unload_filament(); 14bea: 0e 94 9d 6d call 0xdb3a ; 0xdb3a } 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 14bee: 0f 94 a0 22 call 0x24540 ; 0x24540 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 14bf2: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 14bf6: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 14bfa: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14bfe: 81 30 cpi r24, 0x01 ; 1 14c00: 09 f4 brne .+2 ; 0x14c04 14c02: d9 c1 rjmp .+946 ; 0x14fb6 { KEEPALIVE_STATE(PAUSED_FOR_USER); 14c04: 84 e0 ldi r24, 0x04 ; 4 14c06: 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); 14c0a: 8e e3 ldi r24, 0x3E ; 62 14c0c: 99 e3 ldi r25, 0x39 ; 57 14c0e: 0e 94 32 6d call 0xda64 ; 0xda64 14c12: 40 e0 ldi r20, 0x00 ; 0 14c14: 60 e0 ldi r22, 0x00 ; 0 14c16: 0f 94 33 2e call 0x25c66 ; 0x25c66 14c1a: 08 2f mov r16, r24 lcd_update_enable(false); 14c1c: 80 e0 ldi r24, 0x00 ; 0 14c1e: 0e 94 41 6a call 0xd482 ; 0xd482 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 14c22: 01 30 cpi r16, 0x01 ; 1 14c24: 29 f5 brne .+74 ; 0x14c70 lcd_clear(); 14c26: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 14c2a: 86 eb ldi r24, 0xB6 ; 182 14c2c: 99 e3 ldi r25, 0x39 ; 57 14c2e: 0e 94 32 6d call 0xda64 ; 0xda64 14c32: ac 01 movw r20, r24 14c34: 62 e0 ldi r22, 0x02 ; 2 14c36: 80 e0 ldi r24, 0x00 ; 0 14c38: 0e 94 10 6a call 0xd420 ; 0xd420 current_position[X_AXIS] = 100; 14c3c: 80 e0 ldi r24, 0x00 ; 0 14c3e: 90 e0 ldi r25, 0x00 ; 0 14c40: a8 ec ldi r26, 0xC8 ; 200 14c42: b2 e4 ldi r27, 0x42 ; 66 14c44: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 14c48: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 14c4c: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 14c50: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14c54: 60 e0 ldi r22, 0x00 ; 0 14c56: 70 e0 ldi r23, 0x00 ; 0 14c58: 88 e4 ldi r24, 0x48 ; 72 14c5a: 92 e4 ldi r25, 0x42 ; 66 14c5c: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 14c60: 0f 94 a0 22 call 0x24540 ; 0x24540 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 14c64: 8c e0 ldi r24, 0x0C ; 12 14c66: 99 e3 ldi r25, 0x39 ; 57 14c68: 0e 94 32 6d call 0xda64 ; 0xda64 14c6c: 0f 94 7b 0b call 0x216f6 ; 0x216f6 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 14c70: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 14c74: 8a e9 ldi r24, 0x9A ; 154 14c76: 98 e3 ldi r25, 0x38 ; 56 14c78: 0e 94 32 6d call 0xda64 ; 0xda64 14c7c: ac 01 movw r20, r24 14c7e: 60 e0 ldi r22, 0x00 ; 0 14c80: 80 e0 ldi r24, 0x00 ; 0 14c82: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(0, 1); 14c86: 61 e0 ldi r22, 0x01 ; 1 14c88: 80 e0 ldi r24, 0x00 ; 0 14c8a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 if (filament_name[0]) { 14c8e: 89 81 ldd r24, Y+1 ; 0x01 14c90: 88 23 and r24, r24 14c92: 41 f0 breq .+16 ; 0x14ca4 lcd_print(filament_name); 14c94: ce 01 movw r24, r28 14c96: 01 96 adiw r24, 0x01 ; 1 14c98: 0e 94 03 6c call 0xd806 ; 0xd806 lcd_set_cursor(0, 2); 14c9c: 62 e0 ldi r22, 0x02 ; 2 14c9e: 80 e0 ldi r24, 0x00 ; 0 14ca0: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 14ca4: 80 91 85 16 lds r24, 0x1685 ; 0x801685 14ca8: 81 11 cpse r24, r1 14caa: 06 c0 rjmp .+12 ; 0x14cb8 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 14cac: 85 e8 ldi r24, 0x85 ; 133 14cae: 98 e3 ldi r25, 0x38 ; 56 14cb0: 0e 94 32 6d call 0xda64 ; 0xda64 14cb4: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 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); 14cb8: 84 e0 ldi r24, 0x04 ; 4 14cba: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 14cbe: 0e 94 19 6c call 0xd832 ; 0xd832 14cc2: 81 11 cpse r24, r1 14cc4: 10 c0 rjmp .+32 ; 0x14ce6 { manage_heater(); 14cc6: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 14cca: 81 e0 ldi r24, 0x01 ; 1 14ccc: 0e 94 89 7a call 0xf512 ; 0xf512 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 14cd0: 80 91 88 16 lds r24, 0x1688 ; 0x801688 14cd4: 88 23 and r24, r24 14cd6: 99 f3 breq .-26 ; 0x14cbe Sound_MakeCustom(50,1000,false); 14cd8: 40 e0 ldi r20, 0x00 ; 0 14cda: 68 ee ldi r22, 0xE8 ; 232 14cdc: 73 e0 ldi r23, 0x03 ; 3 14cde: 82 e3 ldi r24, 0x32 ; 50 14ce0: 90 e0 ldi r25, 0x00 ; 0 14ce2: 0f 94 0b 32 call 0x26416 ; 0x26416 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 14ce6: 32 e0 ldi r19, 0x02 ; 2 14ce8: 30 93 78 02 sts 0x0278, r19 ; 0x800278 M600_load_filament_movements(filament_name); 14cec: ce 01 movw r24, r28 14cee: 01 96 adiw r24, 0x01 ; 1 14cf0: 0e 94 56 6d call 0xdaac ; 0xdaac Sound_MakeCustom(50,1000,false); 14cf4: 40 e0 ldi r20, 0x00 ; 0 14cf6: 68 ee ldi r22, 0xE8 ; 232 14cf8: 73 e0 ldi r23, 0x03 ; 3 14cfa: 82 e3 ldi r24, 0x32 ; 50 14cfc: 90 e0 ldi r25, 0x00 ; 0 14cfe: 0f 94 0b 32 call 0x26416 ; 0x26416 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 14d02: 11 11 cpse r17, r1 14d04: 9e c1 rjmp .+828 ; 0x15042 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); 14d06: b4 e0 ldi r27, 0x04 ; 4 14d08: bb 2e mov r11, r27 14d0a: b0 92 78 02 sts 0x0278, r11 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 14d0e: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 14d12: 86 ed ldi r24, 0xD6 ; 214 14d14: 98 e3 ldi r25, 0x38 ; 56 14d16: 0e 94 32 6d call 0xda64 ; 0xda64 14d1a: ac 01 movw r20, r24 14d1c: 60 e0 ldi r22, 0x00 ; 0 14d1e: 81 e0 ldi r24, 0x01 ; 1 14d20: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 14d24: 80 ec ldi r24, 0xC0 ; 192 14d26: 98 e3 ldi r25, 0x38 ; 56 14d28: 0e 94 32 6d call 0xda64 ; 0xda64 14d2c: ac 01 movw r20, r24 14d2e: 61 e0 ldi r22, 0x01 ; 1 14d30: 81 e0 ldi r24, 0x01 ; 1 14d32: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 14d36: 8c ea ldi r24, 0xAC ; 172 14d38: 98 e3 ldi r25, 0x38 ; 56 14d3a: 0e 94 32 6d call 0xda64 ; 0xda64 14d3e: ac 01 movw r20, r24 14d40: 62 e0 ldi r22, 0x02 ; 2 14d42: 81 e0 ldi r24, 0x01 ; 1 14d44: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 14d48: 8c eb ldi r24, 0xBC ; 188 14d4a: 9c e3 ldi r25, 0x3C ; 60 14d4c: 0e 94 32 6d call 0xda64 ; 0xda64 14d50: ac 01 movw r20, r24 14d52: 63 e0 ldi r22, 0x03 ; 3 14d54: 81 e0 ldi r24, 0x01 ; 1 14d56: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc_at(0, cursor_pos, '>'); 14d5a: 4e e3 ldi r20, 0x3E ; 62 14d5c: 60 e0 ldi r22, 0x00 ; 0 14d5e: 80 e0 ldi r24, 0x00 ; 0 14d60: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_consume_click(); 14d64: 0e 94 14 6c call 0xd828 ; 0xd828 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 14d68: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 14d6a: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 14d6e: 81 e0 ldi r24, 0x01 ; 1 14d70: 0e 94 89 7a call 0xf512 ; 0xf512 if (lcd_encoder) 14d74: 80 91 06 05 lds r24, 0x0506 ; 0x800506 14d78: 90 91 07 05 lds r25, 0x0507 ; 0x800507 14d7c: 00 97 sbiw r24, 0x00 ; 0 14d7e: d9 f0 breq .+54 ; 0x14db6 { if (lcd_encoder < 0 ) { 14d80: 97 ff sbrs r25, 7 14d82: 22 c1 rjmp .+580 ; 0x14fc8 // Rotating knob counter clockwise if (cursor_pos > 0) 14d84: 00 23 and r16, r16 14d86: 09 f4 brne .+2 ; 0x14d8a 14d88: 23 c1 rjmp .+582 ; 0x14fd0 cursor_pos--; 14d8a: 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 ")); 14d8c: 47 ec ldi r20, 0xC7 ; 199 14d8e: 59 e7 ldi r21, 0x79 ; 121 14d90: 60 e0 ldi r22, 0x00 ; 0 14d92: 80 e0 ldi r24, 0x00 ; 0 14d94: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc_at(0, cursor_pos, '>'); 14d98: 4e e3 ldi r20, 0x3E ; 62 14d9a: 60 2f mov r22, r16 14d9c: 80 e0 ldi r24, 0x00 ; 0 14d9e: 0e 94 1c 6a call 0xd438 ; 0xd438 // Consume rotation event and make feedback sound lcd_encoder = 0; 14da2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 14da6: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 14daa: 64 e6 ldi r22, 0x64 ; 100 14dac: 70 e0 ldi r23, 0x00 ; 0 14dae: 80 e0 ldi r24, 0x00 ; 0 14db0: 90 e0 ldi r25, 0x00 ; 0 14db2: 0f 94 d5 0d call 0x21baa ; 0x21baa } if (lcd_clicked()) 14db6: 0e 94 19 6c call 0xd832 ; 0xd832 14dba: 88 23 and r24, r24 14dbc: b1 f2 breq .-84 ; 0x14d6a { lcd_clear(); 14dbe: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_return_to_status(); 14dc2: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 14dc6: 42 e0 ldi r20, 0x02 ; 2 14dc8: 40 93 78 02 sts 0x0278, r20 ; 0x800278 switch(lcd_change_filament_state) 14dcc: 02 30 cpi r16, 0x02 ; 2 14dce: 09 f4 brne .+2 ; 0x14dd2 14dd0: 08 c1 rjmp .+528 ; 0x14fe2 14dd2: 03 30 cpi r16, 0x03 ; 3 14dd4: 09 f4 brne .+2 ; 0x14dd8 14dd6: ed c1 rjmp .+986 ; 0x151b2 14dd8: 01 30 cpi r16, 0x01 ; 1 14dda: 09 f0 breq .+2 ; 0x14dde 14ddc: 21 c1 rjmp .+578 ; 0x15020 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 14dde: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14de2: 81 30 cpi r24, 0x01 ; 1 14de4: 09 f0 breq .+2 ; 0x14de8 14de6: f8 c0 rjmp .+496 ; 0x14fd8 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 14de8: 0f 94 e8 41 call 0x283d0 ; 0x283d0 14dec: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 14dee: 0e 94 9d 6d call 0xdb3a ; 0xdb3a // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 14df2: 80 2f mov r24, r16 14df4: 0e 94 f3 7c call 0xf9e6 ; 0xf9e6 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 14df8: 80 e0 ldi r24, 0x00 ; 0 14dfa: 0e 94 99 71 call 0xe332 ; 0xe332 14dfe: 85 cf rjmp .-246 ; 0x14d0a // 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; 14e00: 20 e0 ldi r18, 0x00 ; 0 14e02: 30 e0 ldi r19, 0x00 ; 0 14e04: 43 e5 ldi r20, 0x53 ; 83 14e06: 53 e4 ldi r21, 0x43 ; 67 14e08: 28 a7 std Y+40, r18 ; 0x28 14e0a: 39 a7 std Y+41, r19 ; 0x29 14e0c: 4a a7 std Y+42, r20 ; 0x2a 14e0e: 5b a7 std Y+43, r21 ; 0x2b 14e10: 48 ce rjmp .-880 ; 0x14aa2 float y_position = FILAMENTCHANGE_YPOS; 14e12: 1c a6 std Y+44, r1 ; 0x2c 14e14: 1d a6 std Y+45, r1 ; 0x2d 14e16: 1e a6 std Y+46, r1 ; 0x2e 14e18: 1f a6 std Y+47, r1 ; 0x2f 14e1a: 4f ce rjmp .-866 ; 0x14aba 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(); 14e1c: 0e 94 2c 5f call 0xbe58 ; 0xbe58 14e20: ae ce rjmp .-676 ; 0x14b7e //! //! 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); 14e22: 84 e0 ldi r24, 0x04 ; 4 14e24: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 14e28: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 14e2c: 2b 01 movw r4, r22 14e2e: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14e30: 8a e5 ldi r24, 0x5A ; 90 14e32: 98 e3 ldi r25, 0x38 ; 56 14e34: 0e 94 32 6d call 0xda64 ; 0xda64 14e38: 0f 94 f4 0a call 0x215e8 ; 0x215e8 while (!(wait_for_user_state == 0 && lcd_clicked())){ 14e3c: 0e 94 19 6c call 0xd832 ; 0xd832 14e40: 08 2f mov r16, r24 14e42: 81 11 cpse r24, r1 14e44: 34 c0 rjmp .+104 ; 0x14eae 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) { 14e46: a3 01 movw r20, r6 14e48: 92 01 movw r18, r4 14e4a: 20 54 subi r18, 0x40 ; 64 14e4c: 38 4d sbci r19, 0xD8 ; 216 14e4e: 46 4f sbci r20, 0xF6 ; 246 14e50: 5f 4f sbci r21, 0xFF ; 255 14e52: 28 a7 std Y+40, r18 ; 0x28 14e54: 39 a7 std Y+41, r19 ; 0x29 14e56: 4a a7 std Y+42, r20 ; 0x2a 14e58: 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(); 14e5a: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 14e5e: 81 e0 ldi r24, 0x01 ; 1 14e60: 0e 94 89 7a call 0xf512 ; 0xf512 if (wait_for_user_state != 2) sound_wait_for_user(); 14e64: 02 30 cpi r16, 0x02 ; 2 14e66: 09 f4 brne .+2 ; 0x14e6a 14e68: 65 c0 rjmp .+202 ; 0x14f34 14e6a: 0f 94 1f 36 call 0x26c3e ; 0x26c3e 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); 14e6e: 84 e0 ldi r24, 0x04 ; 4 14e70: 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) { 14e72: 01 30 cpi r16, 0x01 ; 1 14e74: 29 f1 breq .+74 ; 0x14ec0 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 14e76: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 14e7a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 14e7e: 28 a5 ldd r18, Y+40 ; 0x28 14e80: 39 a5 ldd r19, Y+41 ; 0x29 14e82: 4a a5 ldd r20, Y+42 ; 0x2a 14e84: 5b a5 ldd r21, Y+43 ; 0x2b 14e86: 26 17 cp r18, r22 14e88: 37 07 cpc r19, r23 14e8a: 48 07 cpc r20, r24 14e8c: 59 07 cpc r21, r25 14e8e: b0 f6 brcc .-84 ; 0x14e3c lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 14e90: 89 e2 ldi r24, 0x29 ; 41 14e92: 98 e3 ldi r25, 0x38 ; 56 14e94: 0e 94 32 6d call 0xda64 ; 0xda64 14e98: 0f 94 f4 0a call 0x215e8 ; 0x215e8 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14e9c: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 14ea0: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 14ea4: 0f 94 a0 22 call 0x24540 ; 0x24540 disable_e0(); 14ea8: 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; 14eaa: 01 e0 ldi r16, 0x01 ; 1 14eac: d6 cf rjmp .-84 ; 0x14e5a 14eae: 10 92 2b 05 sts 0x052B, r1 ; 0x80052b <_ZL10beep_timer.lto_priv.454> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 14eb2: 10 92 2e 05 sts 0x052E, r1 ; 0x80052e <_ZL6bFirst.lto_priv.455> 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); 14eb6: c7 01 movw r24, r14 14eb8: b6 01 movw r22, r12 14eba: 0e 94 58 f0 call 0x1e0b0 ; 0x1e0b0 14ebe: 97 ce rjmp .-722 ; 0x14bee 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); 14ec0: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (lcd_clicked()) { 14ec4: 0e 94 19 6c call 0xd832 ; 0xd832 14ec8: 88 23 and r24, r24 14eca: 39 f2 breq .-114 ; 0x14e5a 14ecc: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef 14ed0: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 14ed4: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 14ed8: 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)); 14edc: 87 e0 ldi r24, 0x07 ; 7 14ede: 9f e4 ldi r25, 0x4F ; 79 14ee0: 0e 94 32 6d call 0xda64 ; 0xda64 14ee4: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14ee8: 42 e8 ldi r20, 0x82 ; 130 14eea: 64 e0 ldi r22, 0x04 ; 4 14eec: 80 e0 ldi r24, 0x00 ; 0 14eee: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 14ef2: 80 91 f2 11 lds r24, 0x11F2 ; 0x8011f2 14ef6: 8f 93 push r24 14ef8: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 14efc: 8f 93 push r24 14efe: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f02: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f06: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f0a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14f0e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 14f12: 7f 93 push r23 14f14: 6f 93 push r22 14f16: 3f 92 push r3 14f18: 2f 92 push r2 14f1a: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_putc(LCD_STR_DEGREE[0]); 14f1e: 81 e8 ldi r24, 0x81 ; 129 14f20: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 14f24: 0f 90 pop r0 14f26: 0f 90 pop r0 14f28: 0f 90 pop r0 14f2a: 0f 90 pop r0 14f2c: 0f 90 pop r0 14f2e: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 14f30: 02 e0 ldi r16, 0x02 ; 2 14f32: 93 cf rjmp .-218 ; 0x14e5a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 14f34: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 14f38: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 14f3c: 07 2e mov r0, r23 14f3e: 00 0c add r0, r0 14f40: 88 0b sbc r24, r24 14f42: 99 0b sbc r25, r25 14f44: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 14f48: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 14f4c: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 14f50: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 14f54: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 14f58: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 14f5c: 9f 77 andi r25, 0x7F ; 127 14f5e: 20 e0 ldi r18, 0x00 ; 0 14f60: 30 e0 ldi r19, 0x00 ; 0 14f62: 40 ea ldi r20, 0xA0 ; 160 14f64: 50 e4 ldi r21, 0x40 ; 64 14f66: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 14f6a: 87 ff sbrs r24, 7 14f6c: 0b c0 rjmp .+22 ; 0x14f84 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14f6e: 8a e5 ldi r24, 0x5A ; 90 14f70: 98 e3 ldi r25, 0x38 ; 56 14f72: 0e 94 32 6d call 0xda64 ; 0xda64 14f76: 0f 94 f4 0a call 0x215e8 ; 0x215e8 waiting_start_time = _millis(); 14f7a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 14f7e: 2b 01 movw r4, r22 14f80: 3c 01 movw r6, r24 14f82: 5c cf rjmp .-328 ; 0x14e3c wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 14f84: 64 e0 ldi r22, 0x04 ; 4 14f86: 81 e0 ldi r24, 0x01 ; 1 14f88: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 14f8c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f90: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f94: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f98: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14f9c: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 14fa0: 7f 93 push r23 14fa2: 6f 93 push r22 14fa4: 9f 92 push r9 14fa6: 8f 92 push r8 14fa8: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 14fac: 0f 90 pop r0 14fae: 0f 90 pop r0 14fb0: 0f 90 pop r0 14fb2: 0f 90 pop r0 14fb4: 52 cf rjmp .-348 ; 0x14e5a } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 14fb6: 11 11 cpse r17, r1 14fb8: 03 c0 rjmp .+6 ; 0x14fc0 14fba: 8a 2d mov r24, r10 14fbc: 0e 94 f3 7c call 0xf9e6 ; 0xf9e6 mmu_M600_load_filament(automatic); 14fc0: 81 2f mov r24, r17 14fc2: 0e 94 99 71 call 0xe332 ; 0xe332 14fc6: 9d ce rjmp .-710 ; 0x14d02 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 14fc8: 03 30 cpi r16, 0x03 ; 3 14fca: 10 f4 brcc .+4 ; 0x14fd0 cursor_pos++; 14fcc: 0f 5f subi r16, 0xFF ; 255 14fce: de ce rjmp .-580 ; 0x14d8c else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 14fd0: 87 e0 ldi r24, 0x07 ; 7 14fd2: 0f 94 fd 2c call 0x259fa ; 0x259fa 14fd6: da ce rjmp .-588 ; 0x14d8c 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); 14fd8: ce 01 movw r24, r28 14fda: 01 96 adiw r24, 0x01 ; 1 14fdc: 0e 94 56 6d call 0xdaac ; 0xdaac 14fe0: 94 ce rjmp .-728 ; 0x14d0a } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 14fe2: 0f 94 a0 22 call 0x24540 ; 0x24540 load_filament_final_feed(); 14fe6: 0e 94 f6 5e call 0xbdec ; 0xbdec 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(); 14fea: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 14fee: 8a ee ldi r24, 0xEA ; 234 14ff0: 98 e3 ldi r25, 0x38 ; 56 14ff2: 0e 94 32 6d call 0xda64 ; 0xda64 14ff6: ac 01 movw r20, r24 14ff8: 60 e0 ldi r22, 0x00 ; 0 14ffa: 80 e0 ldi r24, 0x00 ; 0 14ffc: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 15000: 86 eb ldi r24, 0xB6 ; 182 15002: 99 e3 ldi r25, 0x39 ; 57 15004: 0e 94 32 6d call 0xda64 ; 0xda64 15008: ac 01 movw r20, r24 1500a: 62 e0 ldi r22, 0x02 ; 2 1500c: 80 e0 ldi r24, 0x00 ; 0 1500e: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 15012: 87 e9 ldi r24, 0x97 ; 151 15014: 9d e1 ldi r25, 0x1D ; 29 15016: 0f 94 3f 0c call 0x2187e ; 0x2187e lcd_loading_color(); st_synchronize(); 1501a: 0f 94 a0 22 call 0x24540 ; 0x24540 1501e: 75 ce rjmp .-790 ; 0x14d0a } void lcd_change_success() { lcd_clear(); 15020: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 15024: 8a ef ldi r24, 0xFA ; 250 15026: 98 e3 ldi r25, 0x38 ; 56 15028: 0e 94 32 6d call 0xda64 ; 0xda64 1502c: ac 01 movw r20, r24 1502e: 62 e0 ldi r22, 0x02 ; 2 15030: 80 e0 ldi r24, 0x00 ; 0 15032: 0e 94 10 6a call 0xd420 ; 0xd420 //! @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) 15036: 00 23 and r16, r16 15038: 19 f0 breq .+6 ; 0x15040 1503a: 03 30 cpi r16, 0x03 ; 3 1503c: 09 f0 breq .+2 ; 0x15040 1503e: 65 ce rjmp .-822 ; 0x14d0a default: lcd_change_success(); break; } } return false; 15040: 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(); } 15042: 84 e8 ldi r24, 0x84 ; 132 15044: 96 e1 ldi r25, 0x16 ; 22 15046: 0e 94 71 6e call 0xdce2 ; 0xdce2 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 1504a: b1 10 cpse r11, r1 1504c: c6 cd rjmp .-1140 ; 0x14bda if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 1504e: 81 e0 ldi r24, 0x01 ; 1 15050: 0e 94 41 6a call 0xd482 ; 0xd482 // Not let's go back to print fanSpeed = saved_fan_speed; 15054: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 15058: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 // Feed a little of filament to stabilize pressure if (!automatic) { 1505c: 11 11 cpse r17, r1 1505e: 27 c0 rjmp .+78 ; 0x150ae if (printingIsPaused()) 15060: 0e 94 3e 61 call 0xc27c ; 0xc27c 15064: c0 90 01 12 lds r12, 0x1201 ; 0x801201 15068: d0 90 02 12 lds r13, 0x1202 ; 0x801202 1506c: e0 90 03 12 lds r14, 0x1203 ; 0x801203 15070: f0 90 04 12 lds r15, 0x1204 ; 0x801204 15074: 88 23 and r24, r24 15076: 09 f4 brne .+2 ; 0x1507a 15078: 9f c0 rjmp .+318 ; 0x151b8 { // 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; 1507a: 20 e0 ldi r18, 0x00 ; 0 1507c: 30 e0 ldi r19, 0x00 ; 0 1507e: 40 e8 ldi r20, 0x80 ; 128 15080: 5f e3 ldi r21, 0x3F ; 63 15082: c7 01 movw r24, r14 15084: b6 01 movw r22, r12 15086: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1508a: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1508e: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15092: 80 93 03 12 sts 0x1203, r24 ; 0x801203 15096: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1509a: 60 e0 ldi r22, 0x00 ; 0 1509c: 70 e0 ldi r23, 0x00 ; 0 1509e: 88 ee ldi r24, 0xE8 ; 232 150a0: 92 e4 ldi r25, 0x42 ; 66 150a2: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 150a6: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 150aa: 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); 150ae: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd 150b2: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe 150b6: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff 150ba: 10 91 00 12 lds r17, 0x1200 ; 0x801200 150be: 20 91 94 02 lds r18, 0x0294 ; 0x800294 150c2: 30 91 95 02 lds r19, 0x0295 ; 0x800295 150c6: 40 91 96 02 lds r20, 0x0296 ; 0x800296 150ca: 50 91 97 02 lds r21, 0x0297 ; 0x800297 150ce: 60 91 90 02 lds r22, 0x0290 ; 0x800290 150d2: 70 91 91 02 lds r23, 0x0291 ; 0x800291 150d6: 80 91 92 02 lds r24, 0x0292 ; 0x800292 150da: 90 91 93 02 lds r25, 0x0293 ; 0x800293 150de: 1f 92 push r1 150e0: 1f 92 push r1 150e2: 1f 92 push r1 150e4: 1f 92 push r1 150e6: 81 2c mov r8, r1 150e8: 91 2c mov r9, r1 150ea: e8 e4 ldi r30, 0x48 ; 72 150ec: ae 2e mov r10, r30 150ee: e2 e4 ldi r30, 0x42 ; 66 150f0: be 2e mov r11, r30 150f2: f1 e0 ldi r31, 0x01 ; 1 150f4: cf 2e mov r12, r31 150f6: f2 e1 ldi r31, 0x12 ; 18 150f8: df 2e mov r13, r31 150fa: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 st_synchronize(); 150fe: 0f 94 a0 22 call 0x24540 ; 0x24540 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 15102: e0 90 98 02 lds r14, 0x0298 ; 0x800298 15106: f0 90 99 02 lds r15, 0x0299 ; 0x800299 1510a: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 1510e: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 15112: 20 91 94 02 lds r18, 0x0294 ; 0x800294 15116: 30 91 95 02 lds r19, 0x0295 ; 0x800295 1511a: 40 91 96 02 lds r20, 0x0296 ; 0x800296 1511e: 50 91 97 02 lds r21, 0x0297 ; 0x800297 15122: 60 91 90 02 lds r22, 0x0290 ; 0x800290 15126: 70 91 91 02 lds r23, 0x0291 ; 0x800291 1512a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 1512e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 15132: 1f 92 push r1 15134: 1f 92 push r1 15136: 1f 92 push r1 15138: 1f 92 push r1 1513a: 81 2c mov r8, r1 1513c: 91 2c mov r9, r1 1513e: a0 e7 ldi r26, 0x70 ; 112 15140: aa 2e mov r10, r26 15142: a1 e4 ldi r26, 0x41 ; 65 15144: ba 2e mov r11, r26 15146: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 st_synchronize(); 1514a: 0f 94 a0 22 call 0x24540 ; 0x24540 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 1514e: 8c e9 ldi r24, 0x9C ; 156 15150: 92 e0 ldi r25, 0x02 ; 2 15152: 0f 94 28 76 call 0x2ec50 ; 0x2ec50 memcpy(current_position, saved_pos, sizeof(saved_pos)); 15156: 80 e1 ldi r24, 0x10 ; 16 15158: e0 e9 ldi r30, 0x90 ; 144 1515a: f2 e0 ldi r31, 0x02 ; 2 1515c: a5 ef ldi r26, 0xF5 ; 245 1515e: b1 e1 ldi r27, 0x11 ; 17 15160: 01 90 ld r0, Z+ 15162: 0d 92 st X+, r0 15164: 8a 95 dec r24 15166: e1 f7 brne .-8 ; 0x15160 set_destination_to_current(); 15168: 0e 94 b7 61 call 0xc36e ; 0xc36e // Recover feed rate feedmultiply = saved_feedmultiply2; 1516c: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> 15170: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> 15174: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 15178: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 1517c: 9f 93 push r25 1517e: 8f 93 push r24 15180: 89 e9 ldi r24, 0x99 ; 153 15182: 95 e6 ldi r25, 0x65 ; 101 15184: 9f 93 push r25 15186: 8f 93 push r24 15188: 0e 94 cd 7d call 0xfb9a ; 0xfb9a if (printingIsPaused()) { 1518c: 0e 94 3e 61 call 0xc27c ; 0xc27c 15190: 0f b6 in r0, 0x3f ; 63 15192: f8 94 cli 15194: de bf out 0x3e, r29 ; 62 15196: 0f be out 0x3f, r0 ; 63 15198: cd bf out 0x3d, r28 ; 61 1519a: 88 23 and r24, r24 1519c: 21 f1 breq .+72 ; 0x151e6 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1519e: 8d e4 ldi r24, 0x4D ; 77 151a0: 91 e4 ldi r25, 0x41 ; 65 151a2: 0e 94 32 6d call 0xda64 ; 0xda64 151a6: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 151aa: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 151ae: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 st_synchronize(); break; // Unload filament case 3: return true; 151b2: bb 24 eor r11, r11 151b4: b3 94 inc r11 151b6: 45 cf rjmp .-374 ; 0x15042 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 151b8: 20 e0 ldi r18, 0x00 ; 0 151ba: 30 e0 ldi r19, 0x00 ; 0 151bc: 40 ea ldi r20, 0xA0 ; 160 151be: 50 e4 ldi r21, 0x40 ; 64 151c0: c7 01 movw r24, r14 151c2: b6 01 movw r22, r12 151c4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 151c8: 60 93 01 12 sts 0x1201, r22 ; 0x801201 151cc: 70 93 02 12 sts 0x1202, r23 ; 0x801202 151d0: 80 93 03 12 sts 0x1203, r24 ; 0x801203 151d4: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 151d8: 60 e0 ldi r22, 0x00 ; 0 151da: 70 e0 ldi r23, 0x00 ; 0 151dc: 80 e0 ldi r24, 0x00 ; 0 151de: 90 e4 ldi r25, 0x40 ; 64 151e0: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 151e4: 64 cf rjmp .-312 ; 0x150ae if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 151e6: 8b e0 ldi r24, 0x0B ; 11 151e8: 9c e6 ldi r25, 0x6C ; 108 151ea: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 151ee: 84 e2 ldi r24, 0x24 ; 36 151f0: 98 e6 ldi r25, 0x68 ; 104 151f2: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 151f6: d9 cf rjmp .-78 ; 0x151aa SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 151f8: 0e 94 3e 61 call 0xc27c ; 0xc27c 151fc: 81 11 cpse r24, r1 151fe: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 st_synchronize(); 15202: 0f 94 a0 22 call 0x24540 ; 0x24540 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 15206: 0e 94 87 73 call 0xe70e ; 0xe70e cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 1520a: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 lcd_pause_print(); 1520e: 0f 94 da 0f call 0x21fb4 ; 0x21fb4 15212: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 15216: 0e 94 3e 61 call 0xc27c ; 0xc27c 1521a: 88 23 and r24, r24 1521c: 11 f4 brne .+4 ; 0x15222 1521e: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 15222: 0c 94 b1 98 jmp 0x13162 ; 0x13162 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 15226: 81 ea ldi r24, 0xA1 ; 161 15228: 9d e0 ldi r25, 0x0D ; 13 1522a: 0f 94 3c a1 call 0x34278 ; 0x34278 1522e: 18 2f mov r17, r24 } if (code_seen('Z')){ 15230: 8a e5 ldi r24, 0x5A ; 90 15232: 0e 94 b6 55 call 0xab6c ; 0xab6c 15236: 88 23 and r24, r24 15238: 09 f4 brne .+2 ; 0x1523c 1523a: d7 c0 rjmp .+430 ; 0x153ea z_val = code_value(); 1523c: 0e 94 8e 5a call 0xb51c ; 0xb51c 15240: 2b 01 movw r4, r22 15242: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 15244: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 15248: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 1524c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 15250: 50 91 41 04 lds r21, 0x0441 ; 0x800441 15254: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 15258: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1525c: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 1525e: 9b 01 movw r18, r22 15260: 21 56 subi r18, 0x61 ; 97 15262: 30 4f sbci r19, 0xF0 ; 240 15264: 20 3a cpi r18, 0xA0 ; 160 15266: 3f 40 sbci r19, 0x0F ; 15 15268: 30 f0 brcs .+12 ; 0x15276 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1526a: 8c e6 ldi r24, 0x6C ; 108 1526c: 9f e7 ldi r25, 0x7F ; 127 1526e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 15272: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 15276: 5b e0 ldi r21, 0x0B ; 11 15278: 15 9f mul r17, r21 1527a: 90 01 movw r18, r0 1527c: 11 24 eor r1, r1 1527e: c9 01 movw r24, r18 15280: 80 5b subi r24, 0xB0 ; 176 15282: 92 4f sbci r25, 0xF2 ; 242 15284: 0f 94 7e a1 call 0x342fc ; 0x342fc { 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')) 15288: 8c e4 ldi r24, 0x4C ; 76 1528a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1528e: bb e0 ldi r27, 0x0B ; 11 15290: 1b 9f mul r17, r27 15292: 70 01 movw r14, r0 15294: 11 24 eor r1, r1 15296: 57 01 movw r10, r14 15298: e7 eb ldi r30, 0xB7 ; 183 1529a: ae 1a sub r10, r30 1529c: e2 ef ldi r30, 0xF2 ; 242 1529e: be 0a sbc r11, r30 152a0: 88 23 and r24, r24 152a2: 09 f4 brne .+2 ; 0x152a6 152a4: be c0 rjmp .+380 ; 0x15422 { char *src = strchr_pointer + 1; 152a6: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 152aa: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 152ae: 31 96 adiw r30, 0x01 ; 1 152b0: bf 01 movw r22, r30 while (*src == ' ') ++src; 152b2: 81 91 ld r24, Z+ 152b4: 80 32 cpi r24, 0x20 ; 32 152b6: e1 f3 breq .-8 ; 0x152b0 if (*src != '\0') 152b8: 88 23 and r24, r24 152ba: 31 f0 breq .+12 ; 0x152c8 { strncpy(strLabel,src,7); 152bc: 47 e0 ldi r20, 0x07 ; 7 152be: 50 e0 ldi r21, 0x00 ; 0 152c0: ce 01 movw r24, r28 152c2: 01 96 adiw r24, 0x01 ; 1 152c4: 0f 94 bc a7 call 0x34f78 ; 0x34f78 #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); 152c8: 47 e0 ldi r20, 0x07 ; 7 152ca: 50 e0 ldi r21, 0x00 ; 0 152cc: b5 01 movw r22, r10 152ce: ce 01 movw r24, r28 152d0: 01 96 adiw r24, 0x01 ; 1 152d2: 0f 94 50 a1 call 0x342a0 ; 0x342a0 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 152d6: 82 e4 ldi r24, 0x42 ; 66 152d8: 0e 94 b6 55 call 0xab6c ; 0xab6c 152dc: 57 01 movw r10, r14 152de: fe ea ldi r31, 0xAE ; 174 152e0: af 1a sub r10, r31 152e2: f2 ef ldi r31, 0xF2 ; 242 152e4: bf 0a sbc r11, r31 152e6: 88 23 and r24, r24 152e8: 09 f4 brne .+2 ; 0x152ec 152ea: a3 c0 rjmp .+326 ; 0x15432 { iBedC = code_value_uint8(); 152ec: 0e 94 cb 55 call 0xab96 ; 0xab96 152f0: 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); 152f2: 68 2f mov r22, r24 152f4: c5 01 movw r24, r10 152f6: 0f 94 60 a1 call 0x342c0 ; 0x342c0 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 152fa: 80 e5 ldi r24, 0x50 ; 80 152fc: 0e 94 b6 55 call 0xab6c ; 0xab6c 15300: 2d ea ldi r18, 0xAD ; 173 15302: e2 1a sub r14, r18 15304: 22 ef ldi r18, 0xF2 ; 242 15306: f2 0a sbc r15, r18 15308: 88 23 and r24, r24 1530a: 09 f4 brne .+2 ; 0x1530e 1530c: 97 c0 rjmp .+302 ; 0x1543c { iPindaC = code_value_uint8(); 1530e: 0e 94 cb 55 call 0xab96 ; 0xab96 15312: b8 2e mov r11, r24 15314: 68 2f mov r22, r24 15316: c7 01 movw r24, r14 15318: 0f 94 60 a1 call 0x342c0 ; 0x342c0 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 1531c: 81 e4 ldi r24, 0x41 ; 65 1531e: 0e 94 b6 55 call 0xab6c ; 0xab6c 15322: 88 23 and r24, r24 15324: 09 f4 brne .+2 ; 0x15328 15326: 8f c0 rjmp .+286 ; 0x15446 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15328: 0e 94 cb 55 call 0xab96 ; 0xab96 1532c: 81 11 cpse r24, r1 1532e: 06 c0 rjmp .+12 ; 0x1533c 15330: 81 ea ldi r24, 0xA1 ; 161 15332: 9d e0 ldi r25, 0x0D ; 13 15334: 0f 94 3c a1 call 0x34278 ; 0x34278 15338: 18 13 cpse r17, r24 1533a: 8d c0 rjmp .+282 ; 0x15456 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 1533c: 81 2f mov r24, r17 1533e: 0e 94 99 6f call 0xdf32 ; 0xdf32 15342: 08 2f mov r16, r24 15344: 88 23 and r24, r24 15346: 29 f0 breq .+10 ; 0x15352 15348: 61 2f mov r22, r17 1534a: 81 ea ldi r24, 0xA1 ; 161 1534c: 9d e0 ldi r25, 0x0D ; 13 1534e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 15352: 85 e6 ldi r24, 0x65 ; 101 15354: 9f e7 ldi r25, 0x7F ; 127 15356: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1535a: 61 2f mov r22, r17 1535c: 70 e0 ldi r23, 0x00 ; 0 1535e: 90 e0 ldi r25, 0x00 ; 0 15360: 80 e0 ldi r24, 0x00 ; 0 15362: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 15366: 81 2f mov r24, r17 15368: 0e 94 99 6f call 0xdf32 ; 0xdf32 1536c: 81 11 cpse r24, r1 1536e: 04 c0 rjmp .+8 ; 0x15378 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 15370: 84 e5 ldi r24, 0x54 ; 84 15372: 9f e7 ldi r25, 0x7F ; 127 15374: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLPGM(" Z"); 15378: 81 e5 ldi r24, 0x51 ; 81 1537a: 9f e7 ldi r25, 0x7F ; 127 1537c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15380: 44 e0 ldi r20, 0x04 ; 4 15382: c3 01 movw r24, r6 15384: b2 01 movw r22, r4 15386: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1538a: 8e e4 ldi r24, 0x4E ; 78 1538c: 9f e7 ldi r25, 0x7F ; 127 1538e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15392: b6 01 movw r22, r12 15394: dd 0c add r13, r13 15396: 88 0b sbc r24, r24 15398: 99 0b sbc r25, r25 1539a: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 1539e: 8b e4 ldi r24, 0x4B ; 75 153a0: 9f e7 ldi r25, 0x7F ; 127 153a2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 153a6: ce 01 movw r24, r28 153a8: 01 96 adiw r24, 0x01 ; 1 153aa: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 153ae: 88 e4 ldi r24, 0x48 ; 72 153b0: 9f e7 ldi r25, 0x7F ; 127 153b2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 153b6: 69 2d mov r22, r9 153b8: 70 e0 ldi r23, 0x00 ; 0 153ba: 90 e0 ldi r25, 0x00 ; 0 153bc: 80 e0 ldi r24, 0x00 ; 0 153be: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 153c2: 85 e4 ldi r24, 0x45 ; 69 153c4: 9f e7 ldi r25, 0x7F ; 127 153c6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 153ca: 6b 2d mov r22, r11 153cc: 70 e0 ldi r23, 0x00 ; 0 153ce: 90 e0 ldi r25, 0x00 ; 0 153d0: 80 e0 ldi r24, 0x00 ; 0 153d2: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 153d6: 82 e4 ldi r24, 0x42 ; 66 153d8: 9f e7 ldi r25, 0x7F ; 127 153da: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN((int)bIsActive); 153de: 80 2f mov r24, r16 153e0: 90 e0 ldi r25, 0x00 ; 0 153e2: 0f 94 00 42 call 0x28400 ; 0x28400 153e6: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } 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))); 153ea: ab e0 ldi r26, 0x0B ; 11 153ec: 1a 9f mul r17, r26 153ee: c0 01 movw r24, r0 153f0: 11 24 eor r1, r1 153f2: 80 5b subi r24, 0xB0 ; 176 153f4: 92 4f sbci r25, 0xF2 ; 242 153f6: 0f 94 4a a1 call 0x34294 ; 0x34294 153fa: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 153fc: bc 01 movw r22, r24 153fe: 99 0f add r25, r25 15400: 88 0b sbc r24, r24 15402: 99 0b sbc r25, r25 15404: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 15408: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 1540c: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 15410: 40 91 40 04 lds r20, 0x0440 ; 0x800440 15414: 50 91 41 04 lds r21, 0x0441 ; 0x800441 15418: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1541c: 2b 01 movw r4, r22 1541e: 3c 01 movw r6, r24 15420: 33 cf rjmp .-410 ; 0x15288 } 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)); 15422: 47 e0 ldi r20, 0x07 ; 7 15424: 50 e0 ldi r21, 0x00 ; 0 15426: b5 01 movw r22, r10 15428: ce 01 movw r24, r28 1542a: 01 96 adiw r24, 0x01 ; 1 1542c: 0f 94 2c a1 call 0x34258 ; 0x34258 15430: 52 cf rjmp .-348 ; 0x152d6 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); 15432: c5 01 movw r24, r10 15434: 0f 94 3c a1 call 0x34278 ; 0x34278 15438: 98 2e mov r9, r24 1543a: 5f cf rjmp .-322 ; 0x152fa 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); 1543c: c7 01 movw r24, r14 1543e: 0f 94 3c a1 call 0x34278 ; 0x34278 15442: b8 2e mov r11, r24 15444: 6b cf rjmp .-298 ; 0x1531c bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15446: 81 ea ldi r24, 0xA1 ; 161 15448: 9d e0 ldi r25, 0x0D ; 13 1544a: 0f 94 3c a1 call 0x34278 ; 0x34278 1544e: 01 e0 ldi r16, 0x01 ; 1 15450: 18 17 cp r17, r24 15452: 09 f4 brne .+2 ; 0x15456 15454: 7e cf rjmp .-260 ; 0x15352 { 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; 15456: 00 e0 ldi r16, 0x00 ; 0 15458: 7c cf rjmp .-264 ; 0x15352 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1545a: 83 e5 ldi r24, 0x53 ; 83 1545c: 0e 94 b6 55 call 0xab6c ; 0xab6c 15460: 88 23 and r24, r24 15462: 11 f4 brne .+4 ; 0x15468 15464: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 set_target_pinda = code_value_short(); 15468: 0e 94 d8 55 call 0xabb0 ; 0xabb0 1546c: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1546e: 86 eb ldi r24, 0xB6 ; 182 15470: 99 e3 ldi r25, 0x39 ; 57 15472: 0e 94 32 6d call 0xda64 ; 0xda64 15476: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1547a: 8f e1 ldi r24, 0x1F ; 31 1547c: 9f e7 ldi r25, 0x7F ; 127 1547e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(set_target_pinda); 15482: c8 01 movw r24, r16 15484: 0f 94 00 42 call 0x28400 ; 0x28400 codenum = _millis(); 15488: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1548c: 4b 01 movw r8, r22 1548e: 5c 01 movw r10, r24 cancel_heatup = false; 15490: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 15494: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 15498: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 1549c: 89 2b or r24, r25 1549e: 41 f4 brne .+16 ; 0x154b0 154a0: ff 24 eor r15, r15 154a2: f3 94 inc r15 154a4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 154a8: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 154ac: 89 2b or r24, r25 154ae: 09 f0 breq .+2 ; 0x154b2 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 154b0: 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)) ) { 154b2: 28 01 movw r4, r16 154b4: 01 2e mov r0, r17 154b6: 00 0c add r0, r0 154b8: 66 08 sbc r6, r6 154ba: 77 08 sbc r7, r7 154bc: f1 10 cpse r15, r1 154be: 1a c0 rjmp .+52 ; 0x154f4 154c0: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 154c4: 81 11 cpse r24, r1 154c6: 10 c0 rjmp .+32 ; 0x154e8 154c8: c3 01 movw r24, r6 154ca: b2 01 movw r22, r4 154cc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 154d0: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 154d4: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 154d8: 40 91 90 06 lds r20, 0x0690 ; 0x800690 154dc: 50 91 91 06 lds r21, 0x0691 ; 0x800691 154e0: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 154e4: 18 16 cp r1, r24 154e6: b4 f0 brlt .+44 ; 0x15514 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 154e8: 85 ed ldi r24, 0xD5 ; 213 154ea: 99 e6 ldi r25, 0x69 ; 105 154ec: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 154f0: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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)) ) { 154f4: c3 01 movw r24, r6 154f6: b2 01 movw r22, r4 154f8: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 154fc: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 15500: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 15504: 40 91 90 06 lds r20, 0x0690 ; 0x800690 15508: 50 91 91 06 lds r21, 0x0691 ; 0x800691 1550c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 15510: 87 ff sbrs r24, 7 15512: ea cf rjmp .-44 ; 0x154e8 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 15514: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 15518: 68 19 sub r22, r8 1551a: 79 09 sbc r23, r9 1551c: 8a 09 sbc r24, r10 1551e: 9b 09 sbc r25, r11 15520: 69 3e cpi r22, 0xE9 ; 233 15522: 73 40 sbci r23, 0x03 ; 3 15524: 81 05 cpc r24, r1 15526: 91 05 cpc r25, r1 15528: c8 f0 brcs .+50 ; 0x1555c { SERIAL_PROTOCOLPGM("P:"); 1552a: 8c e1 ldi r24, 0x1C ; 28 1552c: 9f e7 ldi r25, 0x7F ; 127 1552e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15532: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 15536: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 1553a: 80 91 90 06 lds r24, 0x0690 ; 0x800690 1553e: 90 91 91 06 lds r25, 0x0691 ; 0x800691 15542: 41 e0 ldi r20, 0x01 ; 1 15544: 0f 94 a9 98 call 0x33152 ; 0x33152 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15548: 8f e2 ldi r24, 0x2F ; 47 1554a: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 1554e: c8 01 movw r24, r16 15550: 0f 94 00 42 call 0x28400 ; 0x28400 codenum = _millis(); 15554: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 15558: 4b 01 movw r8, r22 1555a: 5c 01 movw r10, r24 } manage_heater(); 1555c: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 15560: 80 e0 ldi r24, 0x00 ; 0 15562: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); 15566: 80 e0 ldi r24, 0x00 ; 0 15568: 0e 94 c3 69 call 0xd386 ; 0xd386 1556c: a7 cf rjmp .-178 ; 0x154bc - `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 1556e: 8f e3 ldi r24, 0x3F ; 63 15570: 0e 94 b6 55 call 0xab6c ; 0xab6c 15574: 88 23 and r24, r24 15576: c9 f0 breq .+50 ; 0x155aa SERIAL_PROTOCOLPGM("PINDA cal status: "); 15578: 89 e0 ldi r24, 0x09 ; 9 1557a: 9f e7 ldi r25, 0x7F ; 127 1557c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 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); } 15580: 86 ea ldi r24, 0xA6 ; 166 15582: 9f e0 ldi r25, 0x0F ; 15 15584: 0f 94 3c a1 call 0x34278 ; 0x34278 15588: 21 e0 ldi r18, 0x01 ; 1 1558a: 30 e0 ldi r19, 0x00 ; 0 1558c: 81 11 cpse r24, r1 1558e: 02 c0 rjmp .+4 ; 0x15594 15590: 30 e0 ldi r19, 0x00 ; 0 15592: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 15594: c9 01 movw r24, r18 15596: 0f 94 00 42 call 0x28400 ; 0x28400 SERIAL_PROTOCOLLNRPGM(_header); 1559a: 82 ef ldi r24, 0xF2 ; 242 1559c: 9e e7 ldi r25, 0x7E ; 126 1559e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 gcode_M861_print_pinda_cal_eeprom(); 155a2: 0e 94 13 71 call 0xe226 ; 0xe226 155a6: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } else if (code_seen('!')) { // ! - Set factory default values 155aa: 81 e2 ldi r24, 0x21 ; 33 155ac: 0e 94 b6 55 call 0xab6c ; 0xab6c 155b0: 88 23 and r24, r24 155b2: 49 f1 breq .+82 ; 0x15606 155b4: 61 e0 ldi r22, 0x01 ; 1 155b6: 86 ea ldi r24, 0xA6 ; 166 155b8: 9f e0 ldi r25, 0x0F ; 15 155ba: 0f 94 60 a1 call 0x342c0 ; 0x342c0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 155be: 68 e0 ldi r22, 0x08 ; 8 155c0: 70 e0 ldi r23, 0x00 ; 0 155c2: 80 eb ldi r24, 0xB0 ; 176 155c4: 9f e0 ldi r25, 0x0F ; 15 155c6: 0f 94 7e a1 call 0x342fc ; 0x342fc 155ca: 68 e1 ldi r22, 0x18 ; 24 155cc: 70 e0 ldi r23, 0x00 ; 0 155ce: 82 eb ldi r24, 0xB2 ; 178 155d0: 9f e0 ldi r25, 0x0F ; 15 155d2: 0f 94 7e a1 call 0x342fc ; 0x342fc 155d6: 60 e3 ldi r22, 0x30 ; 48 155d8: 70 e0 ldi r23, 0x00 ; 0 155da: 84 eb ldi r24, 0xB4 ; 180 155dc: 9f e0 ldi r25, 0x0F ; 15 155de: 0f 94 7e a1 call 0x342fc ; 0x342fc 155e2: 60 e5 ldi r22, 0x50 ; 80 155e4: 70 e0 ldi r23, 0x00 ; 0 155e6: 86 eb ldi r24, 0xB6 ; 182 155e8: 9f e0 ldi r25, 0x0F ; 15 155ea: 0f 94 7e a1 call 0x342fc ; 0x342fc 155ee: 68 e7 ldi r22, 0x78 ; 120 155f0: 70 e0 ldi r23, 0x00 ; 0 155f2: 88 eb ldi r24, 0xB8 ; 184 155f4: 9f e0 ldi r25, 0x0F ; 15 155f6: 0f 94 7e a1 call 0x342fc ; 0x342fc 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"); 155fa: 81 ee ldi r24, 0xE1 ; 225 155fc: 9e e7 ldi r25, 0x7E ; 126 155fe: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 15602: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 15606: 8a e5 ldi r24, 0x5A ; 90 15608: 0e 94 b6 55 call 0xab6c ; 0xab6c 1560c: 88 23 and r24, r24 1560e: c1 f0 breq .+48 ; 0x15640 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15610: 61 e0 ldi r22, 0x01 ; 1 15612: 86 ea ldi r24, 0xA6 ; 166 15614: 9f e0 ldi r25, 0x0F ; 15 15616: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1561a: 00 eb ldi r16, 0xB0 ; 176 1561c: 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); 1561e: 70 e0 ldi r23, 0x00 ; 0 15620: 60 e0 ldi r22, 0x00 ; 0 15622: c8 01 movw r24, r16 15624: 0f 94 7e a1 call 0x342fc ; 0x342fc 15628: 0e 5f subi r16, 0xFE ; 254 1562a: 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++) { 1562c: 0a 3b cpi r16, 0xBA ; 186 1562e: 4f e0 ldi r20, 0x0F ; 15 15630: 14 07 cpc r17, r20 15632: a9 f7 brne .-22 ; 0x1561e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 15634: 87 ed ldi r24, 0xD7 ; 215 15636: 9e e7 ldi r25, 0x7E ; 126 15638: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1563c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 15640: 83 e5 ldi r24, 0x53 ; 83 15642: 0e 94 b6 55 call 0xab6c ; 0xab6c 15646: 88 23 and r24, r24 15648: 21 f1 breq .+72 ; 0x15692 int16_t usteps = code_value_short(); 1564a: 0e 94 d8 55 call 0xabb0 ; 0xabb0 1564e: 8c 01 movw r16, r24 if (code_seen('I')) { 15650: 89 e4 ldi r24, 0x49 ; 73 15652: 0e 94 b6 55 call 0xab6c ; 0xab6c 15656: 88 23 and r24, r24 15658: 11 f4 brne .+4 ; 0x1565e 1565a: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 uint8_t index = code_value_uint8(); 1565e: 0e 94 cb 55 call 0xab96 ; 0xab96 if (index < 5) { 15662: 85 30 cpi r24, 0x05 ; 5 15664: 10 f0 brcs .+4 ; 0x1566a 15666: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 1566a: 90 e0 ldi r25, 0x00 ; 0 1566c: 88 52 subi r24, 0x28 ; 40 1566e: 98 4f sbci r25, 0xF8 ; 248 15670: b8 01 movw r22, r16 15672: 88 0f add r24, r24 15674: 99 1f adc r25, r25 15676: 0f 94 7e a1 call 0x342fc ; 0x342fc SERIAL_PROTOCOLLNRPGM(MSG_OK); 1567a: 85 ed ldi r24, 0xD5 ; 213 1567c: 99 e6 ldi r25, 0x69 ; 105 1567e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLLNRPGM(_header); 15682: 82 ef ldi r24, 0xF2 ; 242 15684: 9e e7 ldi r25, 0x7E ; 126 15686: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 gcode_M861_print_pinda_cal_eeprom(); 1568a: 0e 94 13 71 call 0xe226 ; 0xe226 1568e: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 15692: 86 ec ldi r24, 0xC6 ; 198 15694: 9e e7 ldi r25, 0x7E ; 126 15696: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1569a: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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) 1569e: 64 30 cpi r22, 0x04 ; 4 156a0: 09 f4 brne .+2 ; 0x156a4 156a2: be c0 rjmp .+380 ; 0x15820 156a4: 65 30 cpi r22, 0x05 ; 5 156a6: 11 f0 breq .+4 ; 0x156ac 156a8: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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')) 156ac: 80 e5 ldi r24, 0x50 ; 80 156ae: 0e 94 b6 55 call 0xab6c ; 0xab6c 156b2: 88 23 and r24, r24 156b4: 09 f4 brne .+2 ; 0x156b8 156b6: 3a c1 rjmp .+628 ; 0x1592c { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 156b8: 0e 94 1e 56 call 0xac3c ; 0xac3c done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 156bc: 10 91 b6 03 lds r17, 0x03B6 ; 0x8003b6 156c0: 11 23 and r17, r17 156c2: 11 f4 brne .+4 ; 0x156c8 156c4: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 156c8: 62 30 cpi r22, 0x02 ; 2 156ca: 71 05 cpc r23, r1 156cc: 10 f4 brcc .+4 ; 0x156d2 156ce: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 156d2: 85 eb ldi r24, 0xB5 ; 181 156d4: 96 e3 ldi r25, 0x36 ; 54 156d6: 0e 94 32 6d call 0xda64 ; 0xda64 156da: 7c 01 movw r14, r24 156dc: 84 e8 ldi r24, 0x84 ; 132 156de: 96 e3 ldi r25, 0x36 ; 54 156e0: 0e 94 32 6d call 0xda64 ; 0xda64 156e4: 41 2f mov r20, r17 156e6: b7 01 movw r22, r14 156e8: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 156ec: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 156f0: 80 e5 ldi r24, 0x50 ; 80 156f2: 0e 94 b6 55 call 0xab6c ; 0xab6c 156f6: 88 23 and r24, r24 156f8: a9 f0 breq .+42 ; 0x15724 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 156fa: 0e 94 8e 5a call 0xb51c ; 0xb51c 156fe: 20 e0 ldi r18, 0x00 ; 0 15700: 30 e0 ldi r19, 0x00 ; 0 15702: 4a e7 ldi r20, 0x7A ; 122 15704: 54 e4 ldi r21, 0x44 ; 68 15706: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1570a: 20 e0 ldi r18, 0x00 ; 0 1570c: 30 e0 ldi r19, 0x00 ; 0 1570e: 40 e0 ldi r20, 0x00 ; 0 15710: 5f e3 ldi r21, 0x3F ; 63 15712: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 15716: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 1571a: cb 01 movw r24, r22 1571c: 0e 94 2a f0 call 0x1e054 ; 0x1e054 15720: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } else if(code_seen('Q')) 15724: 81 e5 ldi r24, 0x51 ; 81 15726: 0e 94 b6 55 call 0xab6c ; 0xab6c 1572a: 88 23 and r24, r24 1572c: 11 f4 brne .+4 ; 0x15732 1572e: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 15732: 85 ea ldi r24, 0xA5 ; 165 15734: 9d e0 ldi r25, 0x0D ; 13 15736: 0f 94 4a a1 call 0x34294 ; 0x34294 1573a: bc 01 movw r22, r24 1573c: 90 e0 ldi r25, 0x00 ; 0 1573e: 80 e0 ldi r24, 0x00 ; 0 15740: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 15744: 20 e0 ldi r18, 0x00 ; 0 15746: 30 e0 ldi r19, 0x00 ; 0 15748: 4a e7 ldi r20, 0x7A ; 122 1574a: 54 e4 ldi r21, 0x44 ; 68 1574c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 15750: 0f 94 e3 41 call 0x283c6 ; 0x283c6 15754: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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')) 15758: 81 e5 ldi r24, 0x51 ; 81 1575a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1575e: 88 23 and r24, r24 15760: 11 f4 brne .+4 ; 0x15766 15762: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 15766: b8 01 movw r22, r16 15768: 90 e0 ldi r25, 0x00 ; 0 1576a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1576c: 4a e0 ldi r20, 0x0A ; 10 1576e: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 15772: 0f 94 5c 99 call 0x332b8 ; 0x332b8 15776: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1577a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return _sPrinterMmuName; 1577e: 7b ea ldi r23, 0xAB ; 171 15780: e7 2e mov r14, r23 15782: 79 e7 ldi r23, 0x79 ; 121 15784: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 15786: 81 30 cpi r24, 0x01 ; 1 15788: 21 f0 breq .+8 ; 0x15792 return _sPrinterMmuName; } else { return _sPrinterName; 1578a: 64 ea ldi r22, 0xA4 ; 164 1578c: e6 2e mov r14, r22 1578e: 69 e7 ldi r22, 0x79 ; 121 15790: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 15792: 80 e5 ldi r24, 0x50 ; 80 15794: 0e 94 b6 55 call 0xab6c ; 0xab6c 15798: 88 23 and r24, r24 1579a: b1 f1 breq .+108 ; 0x15808 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 1579c: 62 e2 ldi r22, 0x22 ; 34 1579e: 70 e0 ldi r23, 0x00 ; 0 157a0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 157a4: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 157a8: 0f 94 93 a7 call 0x34f26 ; 0x34f26 157ac: 8c 01 movw r16, r24 if (!this->ptr) { 157ae: 89 2b or r24, r25 157b0: d1 f0 breq .+52 ; 0x157e6 // First quote not found return; } // Skip the leading quote this->ptr++; 157b2: 0f 5f subi r16, 0xFF ; 255 157b4: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 157b6: 62 e2 ldi r22, 0x22 ; 34 157b8: 70 e0 ldi r23, 0x00 ; 0 157ba: c8 01 movw r24, r16 157bc: 0f 94 93 a7 call 0x34f26 ; 0x34f26 if(!pStrEnd) { 157c0: 00 97 sbiw r24, 0x00 ; 0 157c2: 89 f0 breq .+34 ; 0x157e6 // Second quote not found return; } this->len = pStrEnd - this->ptr; 157c4: d8 2e mov r13, r24 157c6: d0 1a sub r13, r16 157c8: c7 01 movw r24, r14 157ca: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 157ce: d8 12 cpse r13, r24 157d0: 0a c0 rjmp .+20 ; 0x157e6 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 157d2: ac 01 movw r20, r24 157d4: 55 27 eor r21, r21 157d6: b7 01 movw r22, r14 157d8: c8 01 movw r24, r16 157da: 0f 94 1b 9f call 0x33e36 ; 0x33e36 157de: 89 2b or r24, r25 157e0: 11 f4 brne .+4 ; 0x157e6 157e2: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } } render_M862_warnings( 157e6: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 157ea: 89 ec ldi r24, 0xC9 ; 201 157ec: 97 e3 ldi r25, 0x37 ; 55 157ee: 0e 94 32 6d call 0xda64 ; 0xda64 157f2: 8c 01 movw r16, r24 157f4: 81 e9 ldi r24, 0x91 ; 145 157f6: 97 e3 ldi r25, 0x37 ; 55 157f8: 0e 94 32 6d call 0xda64 ; 0xda64 157fc: 4f 2d mov r20, r15 157fe: b8 01 movw r22, r16 15800: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 15804: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 15808: 81 e5 ldi r24, 0x51 ; 81 1580a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1580e: 88 23 and r24, r24 15810: 11 f4 brne .+4 ; 0x15816 15812: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 SERIAL_PROTOCOLLNRPGM(type); 15816: c7 01 movw r24, r14 15818: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1581c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 15820: 80 e5 ldi r24, 0x50 ; 80 15822: 0e 94 b6 55 call 0xab6c ; 0xab6c 15826: 88 23 and r24, r24 15828: 09 f4 brne .+2 ; 0x1582c 1582a: 77 c0 rjmp .+238 ; 0x1591a fw_version_check(++strchr_pointer); 1582c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15830: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15834: 01 96 adiw r24, 0x01 ; 1 15836: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 1583a: 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) 1583e: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 15842: 22 23 and r18, r18 15844: 11 f4 brne .+4 ; 0x1584a 15846: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 1584a: be 01 movw r22, r28 1584c: 6f 5f subi r22, 0xFF ; 255 1584e: 7f 4f sbci r23, 0xFF ; 255 15850: 0e 94 45 e1 call 0x1c28a ; 0x1c28a nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 15854: 8a e0 ldi r24, 0x0A ; 10 15856: 90 e0 ldi r25, 0x00 ; 0 15858: 0f 94 4a a1 call 0x34294 ; 0x34294 1585c: 29 81 ldd r18, Y+1 ; 0x01 1585e: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15860: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 15862: 82 17 cp r24, r18 15864: 93 07 cpc r25, r19 15866: 28 f0 brcs .+10 ; 0x15872 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 15868: 11 e0 ldi r17, 0x01 ; 1 1586a: 28 17 cp r18, r24 1586c: 39 07 cpc r19, r25 1586e: 08 f4 brcc .+2 ; 0x15872 15870: 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; 15872: 12 95 swap r17 15874: 11 0f add r17, r17 15876: 11 0f add r17, r17 15878: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 1587a: 8c e0 ldi r24, 0x0C ; 12 1587c: 90 e0 ldi r25, 0x00 ; 0 1587e: 0f 94 4a a1 call 0x34294 ; 0x34294 15882: ac 01 movw r20, r24 15884: 2b 81 ldd r18, Y+3 ; 0x03 15886: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15888: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1588a: 42 17 cp r20, r18 1588c: 53 07 cpc r21, r19 1588e: 28 f0 brcs .+10 ; 0x1589a return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 15890: 81 e0 ldi r24, 0x01 ; 1 15892: 24 17 cp r18, r20 15894: 35 07 cpc r19, r21 15896: 08 f4 brcc .+2 ; 0x1589a 15898: 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; 1589a: 50 e1 ldi r21, 0x10 ; 16 1589c: 85 9f mul r24, r21 1589e: c0 01 movw r24, r0 158a0: 11 24 eor r1, r1 158a2: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 158a4: 8e e0 ldi r24, 0x0E ; 14 158a6: 90 e0 ldi r25, 0x00 ; 0 158a8: 0f 94 4a a1 call 0x34294 ; 0x34294 158ac: ac 01 movw r20, r24 158ae: 2d 81 ldd r18, Y+5 ; 0x05 158b0: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158b2: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158b4: 42 17 cp r20, r18 158b6: 53 07 cpc r21, r19 158b8: 28 f0 brcs .+10 ; 0x158c4 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158ba: 81 e0 ldi r24, 0x01 ; 1 158bc: 24 17 cp r18, r20 158be: 35 07 cpc r19, r21 158c0: 08 f4 brcc .+2 ; 0x158c4 158c2: 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; 158c4: a4 e0 ldi r26, 0x04 ; 4 158c6: 8a 9f mul r24, r26 158c8: c0 01 movw r24, r0 158ca: 11 24 eor r1, r1 158cc: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 158ce: 80 e1 ldi r24, 0x10 ; 16 158d0: 90 e0 ldi r25, 0x00 ; 0 158d2: 0f 94 4a a1 call 0x34294 ; 0x34294 158d6: ac 01 movw r20, r24 158d8: 2f 81 ldd r18, Y+7 ; 0x07 158da: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158dc: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158de: 42 17 cp r20, r18 158e0: 53 07 cpc r21, r19 158e2: 28 f0 brcs .+10 ; 0x158ee return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158e4: 91 e0 ldi r25, 0x01 ; 1 158e6: 24 17 cp r18, r20 158e8: 35 07 cpc r19, r21 158ea: 08 f4 brcc .+2 ; 0x158ee 158ec: 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)); 158ee: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 158f0: 16 35 cpi r17, 0x56 ; 86 158f2: 10 f4 brcc .+4 ; 0x158f8 158f4: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 158f8: f0 90 b7 03 lds r15, 0x03B7 ; 0x8003b7 158fc: 8e e3 ldi r24, 0x3E ; 62 158fe: 97 e3 ldi r25, 0x37 ; 55 15900: 0e 94 32 6d call 0xda64 ; 0xda64 15904: 8c 01 movw r16, r24 15906: 8e e0 ldi r24, 0x0E ; 14 15908: 97 e3 ldi r25, 0x37 ; 55 1590a: 0e 94 32 6d call 0xda64 ; 0xda64 1590e: 4f 2d mov r20, r15 15910: b8 01 movw r22, r16 15912: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 15916: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 else if(code_seen('Q')) 1591a: 81 e5 ldi r24, 0x51 ; 81 1591c: 0e 94 b6 55 call 0xab6c ; 0xab6c 15920: 88 23 and r24, r24 15922: 11 f4 brne .+4 ; 0x15928 15924: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 15928: 0c 94 26 94 jmp 0x1284c ; 0x1284c { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 1592c: 81 e5 ldi r24, 0x51 ; 81 1592e: 0e 94 b6 55 call 0xab6c ; 0xab6c 15932: 88 23 and r24, r24 15934: 11 f4 brne .+4 ; 0x1593a 15936: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 SERIAL_PROTOCOLLN(GCODE_LEVEL); 1593a: 81 e0 ldi r24, 0x01 ; 1 1593c: 90 e0 ldi r25, 0x00 ; 0 1593e: 0f 94 00 42 call 0x28400 ; 0x28400 15942: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 * 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; 15946: 8b e4 ldi r24, 0x4B ; 75 15948: 0e 94 b6 55 call 0xab6c ; 0xab6c 1594c: c1 2c mov r12, r1 1594e: d1 2c mov r13, r1 15950: e1 2c mov r14, r1 15952: 50 ec ldi r21, 0xC0 ; 192 15954: f5 2e mov r15, r21 15956: 88 23 and r24, r24 15958: 49 f1 breq .+82 ; 0x159ac 1595a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1595e: 6b 01 movw r12, r22 15960: 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) 15962: 20 e0 ldi r18, 0x00 ; 0 15964: 30 e0 ldi r19, 0x00 ; 0 15966: a9 01 movw r20, r18 15968: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1596c: 81 11 cpse r24, r1 1596e: 1e c0 rjmp .+60 ; 0x159ac { extruder_advance_K = 0; 15970: 10 92 e1 16 sts 0x16E1, r1 ; 0x8016e1 15974: 10 92 e2 16 sts 0x16E2, r1 ; 0x8016e2 15978: 10 92 e3 16 sts 0x16E3, r1 ; 0x8016e3 1597c: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 15980: 0e 94 69 74 call 0xe8d2 ; 0xe8d2 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 15984: 87 e7 ldi r24, 0x77 ; 119 15986: 9e e9 ldi r25, 0x9E ; 158 15988: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM("Advance K="); 1598c: 81 e8 ldi r24, 0x81 ; 129 1598e: 99 e7 ldi r25, 0x79 ; 121 15990: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(extruder_advance_K); 15994: 60 91 e1 16 lds r22, 0x16E1 ; 0x8016e1 15998: 70 91 e2 16 lds r23, 0x16E2 ; 0x8016e2 1599c: 80 91 e3 16 lds r24, 0x16E3 ; 0x8016e3 159a0: 90 91 e4 16 lds r25, 0x16E4 ; 0x8016e4 159a4: 0f 94 e3 41 call 0x283c6 ; 0x283c6 159a8: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 159ac: 80 91 45 03 lds r24, 0x0345 ; 0x800345 159b0: 81 11 cpse r24, r1 159b2: 1b c0 rjmp .+54 ; 0x159ea { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 159b4: 20 e0 ldi r18, 0x00 ; 0 159b6: 30 e0 ldi r19, 0x00 ; 0 159b8: a9 01 movw r20, r18 159ba: c7 01 movw r24, r14 159bc: b6 01 movw r22, r12 159be: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 159c2: 87 ff sbrs r24, 7 159c4: 05 c0 rjmp .+10 ; 0x159d0 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 159c6: 8c e8 ldi r24, 0x8C ; 140 159c8: 99 e7 ldi r25, 0x79 ; 121 159ca: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 159ce: da cf rjmp .-76 ; 0x15984 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 159d0: 20 e0 ldi r18, 0x00 ; 0 159d2: 30 e0 ldi r19, 0x00 ; 0 159d4: 40 e2 ldi r20, 0x20 ; 32 159d6: 51 e4 ldi r21, 0x41 ; 65 159d8: c7 01 movw r24, r14 159da: b6 01 movw r22, r12 159dc: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 159e0: 87 ff sbrs r24, 7 159e2: 2c c0 rjmp .+88 ; 0x15a3c 159e4: 81 e0 ldi r24, 0x01 ; 1 159e6: 0e 94 69 74 call 0xe8d2 ; 0xe8d2 } if(la10c_mode == LA10C_LA15) 159ea: 80 91 45 03 lds r24, 0x0345 ; 0x800345 return (k >= 0 && k < LA_K_MAX? k: -1); 159ee: 20 e0 ldi r18, 0x00 ; 0 159f0: 30 e0 ldi r19, 0x00 ; 0 159f2: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 159f4: 81 30 cpi r24, 0x01 ; 1 159f6: 21 f5 brne .+72 ; 0x15a40 return (k >= 0 && k < LA_K_MAX? k: -1); 159f8: c7 01 movw r24, r14 159fa: b6 01 movw r22, r12 159fc: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 15a00: 87 fd sbrc r24, 7 15a02: e1 cf rjmp .-62 ; 0x159c6 15a04: 20 e0 ldi r18, 0x00 ; 0 15a06: 30 e0 ldi r19, 0x00 ; 0 15a08: 40 e2 ldi r20, 0x20 ; 32 15a0a: 51 e4 ldi r21, 0x41 ; 65 15a0c: c7 01 movw r24, r14 15a0e: b6 01 movw r22, r12 15a10: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 15a14: 87 ff sbrs r24, 7 15a16: d7 cf rjmp .-82 ; 0x159c6 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 15a18: 20 e0 ldi r18, 0x00 ; 0 15a1a: 30 e0 ldi r19, 0x00 ; 0 15a1c: a9 01 movw r20, r18 15a1e: c7 01 movw r24, r14 15a20: b6 01 movw r22, r12 15a22: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 15a26: 87 fd sbrc r24, 7 15a28: ce cf rjmp .-100 ; 0x159c6 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 15a2a: c0 92 e1 16 sts 0x16E1, r12 ; 0x8016e1 15a2e: d0 92 e2 16 sts 0x16E2, r13 ; 0x8016e2 15a32: e0 92 e3 16 sts 0x16E3, r14 ; 0x8016e3 15a36: f0 92 e4 16 sts 0x16E4, r15 ; 0x8016e4 15a3a: a4 cf rjmp .-184 ; 0x15984 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 15a3c: 82 e0 ldi r24, 0x02 ; 2 15a3e: d3 cf rjmp .-90 ; 0x159e6 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 15a40: c7 01 movw r24, r14 15a42: b6 01 movw r22, r12 15a44: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 15a48: 87 fd sbrc r24, 7 15a4a: bd cf rjmp .-134 ; 0x159c6 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 15a4c: 2f e6 ldi r18, 0x6F ; 111 15a4e: 32 e1 ldi r19, 0x12 ; 18 15a50: 43 e0 ldi r20, 0x03 ; 3 15a52: 5b e3 ldi r21, 0x3B ; 59 15a54: c7 01 movw r24, r14 15a56: b6 01 movw r22, r12 15a58: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 15a5c: 2a e0 ldi r18, 0x0A ; 10 15a5e: 37 ed ldi r19, 0xD7 ; 215 15a60: 43 e2 ldi r20, 0x23 ; 35 15a62: 5c e3 ldi r21, 0x3C ; 60 15a64: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 15a68: 6b 01 movw r12, r22 15a6a: 7c 01 movw r14, r24 return new_K < 0? 0: 15a6c: 20 e0 ldi r18, 0x00 ; 0 15a6e: 30 e0 ldi r19, 0x00 ; 0 15a70: a9 01 movw r20, r18 15a72: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 15a76: 87 fd sbrc r24, 7 15a78: 11 c0 rjmp .+34 ; 0x15a9c new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 15a7a: 20 e0 ldi r18, 0x00 ; 0 15a7c: 30 e0 ldi r19, 0x00 ; 0 15a7e: 40 e2 ldi r20, 0x20 ; 32 15a80: 51 e4 ldi r21, 0x41 ; 65 15a82: c7 01 movw r24, r14 15a84: b6 01 movw r22, r12 15a86: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 15a8a: 18 16 cp r1, r24 15a8c: 2c f6 brge .-118 ; 0x15a18 15a8e: c1 2c mov r12, r1 15a90: d1 2c mov r13, r1 15a92: 40 e2 ldi r20, 0x20 ; 32 15a94: e4 2e mov r14, r20 15a96: 41 e4 ldi r20, 0x41 ; 65 15a98: f4 2e mov r15, r20 15a9a: c7 cf rjmp .-114 ; 0x15a2a // 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: 15a9c: c1 2c mov r12, r1 15a9e: d1 2c mov r13, r1 15aa0: 76 01 movw r14, r12 15aa2: c3 cf rjmp .-122 ; 0x15a2a } } 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()); 15aa4: 83 e5 ldi r24, 0x53 ; 83 15aa6: 0e 94 b6 55 call 0xab6c ; 0xab6c 15aaa: 88 23 and r24, r24 15aac: 59 f0 breq .+22 ; 0x15ac4 15aae: 10 e0 ldi r17, 0x00 ; 0 15ab0: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ab4: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 15ab8: 81 2f mov r24, r17 15aba: 0f 94 d6 21 call 0x243ac ; 0x243ac 15abe: 1f 5f subi r17, 0xFF ; 255 15ac0: 15 30 cpi r17, 0x05 ; 5 15ac2: b1 f7 brne .-20 ; 0x15ab0 15ac4: 34 ec ldi r19, 0xC4 ; 196 15ac6: e3 2e mov r14, r19 15ac8: 32 e0 ldi r19, 0x02 ; 2 15aca: f3 2e mov r15, r19 15acc: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 15ad8: 88 23 and r24, r24 15ada: 39 f0 breq .+14 ; 0x15aea 15adc: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ae0: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 15ae4: 81 2f mov r24, r17 15ae6: 0f 94 d6 21 call 0x243ac ; 0x243ac 15aea: 1f 5f subi r17, 0xFF ; 255 15aec: 14 30 cpi r17, 0x04 ; 4 15aee: 79 f7 brne .-34 ; 0x15ace if(code_seen('B')) microstep_mode(4,code_value()); 15af0: 82 e4 ldi r24, 0x42 ; 66 15af2: 0e 94 b6 55 call 0xab6c ; 0xab6c 15af6: 88 23 and r24, r24 15af8: 39 f0 breq .+14 ; 0x15b08 15afa: 0e 94 8e 5a call 0xb51c ; 0xb51c 15afe: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 15b02: 84 e0 ldi r24, 0x04 ; 4 15b04: 0f 94 d6 21 call 0x243ac ; 0x243ac microstep_readings(); 15b08: 0f 94 fc 20 call 0x241f8 ; 0x241f8 15b0c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 15b10: 24 ec ldi r18, 0xC4 ; 196 15b12: e2 2e mov r14, r18 15b14: 22 e0 ldi r18, 0x02 ; 2 15b16: 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()) 15b18: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 15b24: 88 23 and r24, r24 15b26: 41 f0 breq .+16 ; 0x15b38 15b28: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b2c: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 15b30: 4f ef ldi r20, 0xFF ; 255 15b32: 81 2f mov r24, r17 15b34: 0f 94 57 21 call 0x242ae ; 0x242ae 15b38: 1f 5f subi r17, 0xFF ; 255 15b3a: 14 30 cpi r17, 0x04 ; 4 15b3c: 71 f7 brne .-36 ; 0x15b1a if(code_seen('B')) microstep_ms(4,code_value(),-1); 15b3e: 82 e4 ldi r24, 0x42 ; 66 15b40: 0e 94 b6 55 call 0xab6c ; 0xab6c 15b44: 88 23 and r24, r24 15b46: 11 f4 brne .+4 ; 0x15b4c 15b48: 0c 94 99 96 jmp 0x12d32 ; 0x12d32 15b4c: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b50: 0c 94 99 96 jmp 0x12d32 ; 0x12d32 15b54: 94 ec ldi r25, 0xC4 ; 196 15b56: e9 2e mov r14, r25 15b58: 92 e0 ldi r25, 0x02 ; 2 15b5a: 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()) 15b5c: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 15b68: 88 23 and r24, r24 15b6a: 49 f0 breq .+18 ; 0x15b7e 15b6c: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b70: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 15b74: 46 2f mov r20, r22 15b76: 6f ef ldi r22, 0xFF ; 255 15b78: 81 2f mov r24, r17 15b7a: 0f 94 57 21 call 0x242ae ; 0x242ae 15b7e: 1f 5f subi r17, 0xFF ; 255 15b80: 14 30 cpi r17, 0x04 ; 4 15b82: 69 f7 brne .-38 ; 0x15b5e 15b84: dc cf rjmp .-72 ; 0x15b3e case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15b86: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15b8a: 81 30 cpi r24, 0x01 ; 1 15b8c: c1 f1 breq .+112 ; 0x15bfe - `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; 15b8e: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15b90: 8c e4 ldi r24, 0x4C ; 76 15b92: 0e 94 b6 55 call 0xab6c ; 0xab6c 15b96: 88 23 and r24, r24 15b98: 09 f4 brne .+2 ; 0x15b9c 15b9a: 40 c0 rjmp .+128 ; 0x15c1c 15b9c: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ba0: 6b 01 movw r12, r22 15ba2: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15ba4: 8a e5 ldi r24, 0x5A ; 90 15ba6: 0e 94 b6 55 call 0xab6c ; 0xab6c 15baa: 88 23 and r24, r24 15bac: f1 f1 breq .+124 ; 0x15c2a 15bae: 0e 94 8e 5a call 0xb51c ; 0xb51c 15bb2: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15bb4: 0e 94 5e 67 call 0xcebc ; 0xcebc 15bb8: 4b 01 movw r8, r22 15bba: 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 15bbc: 8a e5 ldi r24, 0x5A ; 90 15bbe: 0e 94 b6 55 call 0xab6c ; 0xab6c 15bc2: 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; 15bc4: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15bc8: 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); 15bcc: 86 e1 ldi r24, 0x16 ; 22 15bce: 0f 94 5f 99 call 0x332be ; 0x332be if (MMU2::mmu2.Enabled()) { 15bd2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15bd6: 81 30 cpi r24, 0x01 ; 1 15bd8: 61 f5 brne .+88 ; 0x15c32 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15bda: 15 30 cpi r17, 0x05 ; 5 15bdc: 18 f4 brcc .+6 ; 0x15be4 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 15bde: 81 2f mov r24, r17 15be0: 0e 94 05 f7 call 0x1ee0a ; 0x1ee0a lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15be4: 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(); } 15be8: 84 e8 ldi r24, 0x84 ; 132 15bea: 96 e1 ldi r25, 0x16 ; 22 15bec: 0e 94 71 6e call 0xdce2 ; 0xdce2 // 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); 15bf0: c5 01 movw r24, r10 15bf2: b4 01 movw r22, r8 15bf4: 90 58 subi r25, 0x80 ; 128 15bf6: 0e 94 5e 67 call 0xcebc ; 0xcebc 15bfa: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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') ) { 15bfe: 80 e5 ldi r24, 0x50 ; 80 15c00: 0e 94 b6 55 call 0xab6c ; 0xab6c 15c04: 88 23 and r24, r24 15c06: 21 f0 breq .+8 ; 0x15c10 mmuSlotIndex = code_value_uint8(); 15c08: 0e 94 cb 55 call 0xab96 ; 0xab96 15c0c: 18 2f mov r17, r24 15c0e: c0 cf rjmp .-128 ; 0x15b90 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') ) { 15c10: 84 e5 ldi r24, 0x54 ; 84 15c12: 0e 94 b6 55 call 0xab6c ; 0xab6c 15c16: 81 11 cpse r24, r1 15c18: f7 cf rjmp .-18 ; 0x15c08 15c1a: b9 cf rjmp .-142 ; 0x15b8e - `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 15c1c: c1 2c mov r12, r1 15c1e: d1 2c mov r13, r1 15c20: 8c e8 ldi r24, 0x8C ; 140 15c22: e8 2e mov r14, r24 15c24: 82 e4 ldi r24, 0x42 ; 66 15c26: f8 2e mov r15, r24 15c28: bd cf rjmp .-134 ; 0x15ba4 float z_target = 0; 15c2a: 60 e0 ldi r22, 0x00 ; 0 15c2c: 70 e0 ldi r23, 0x00 ; 0 15c2e: cb 01 movw r24, r22 15c30: c1 cf rjmp .-126 ; 0x15bb4 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; 15c32: 82 e0 ldi r24, 0x02 ; 2 15c34: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 15c38: 84 ec ldi r24, 0xC4 ; 196 15c3a: 9a e5 ldi r25, 0x5A ; 90 15c3c: 0e 94 32 6d call 0xda64 ; 0xda64 15c40: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 current_position[E_AXIS] += fastLoadLength; 15c44: a7 01 movw r20, r14 15c46: 96 01 movw r18, r12 15c48: 60 91 01 12 lds r22, 0x1201 ; 0x801201 15c4c: 70 91 02 12 lds r23, 0x1202 ; 0x801202 15c50: 80 91 03 12 lds r24, 0x1203 ; 0x801203 15c54: 90 91 04 12 lds r25, 0x1204 ; 0x801204 15c58: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 15c5c: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15c60: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15c64: 80 93 03 12 sts 0x1203, r24 ; 0x801203 15c68: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 15c6c: 60 e0 ldi r22, 0x00 ; 0 15c6e: 70 e0 ldi r23, 0x00 ; 0 15c70: 80 ea ldi r24, 0xA0 ; 160 15c72: 91 e4 ldi r25, 0x41 ; 65 15c74: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 15c78: 01 11 cpse r16, r1 15c7a: 06 c0 rjmp .+12 ; 0x15c88 raise_z_above(MIN_Z_FOR_LOAD); 15c7c: 60 e0 ldi r22, 0x00 ; 0 15c7e: 70 e0 ldi r23, 0x00 ; 0 15c80: 88 e4 ldi r24, 0x48 ; 72 15c82: 92 e4 ldi r25, 0x42 ; 66 15c84: 0e 94 c0 67 call 0xcf80 ; 0xcf80 } load_filament_final_feed(); // slow sequence 15c88: 0e 94 f6 5e call 0xbdec ; 0xbdec st_synchronize(); 15c8c: 0f 94 a0 22 call 0x24540 ; 0x24540 Sound_MakeCustom(50, 500, false); 15c90: 40 e0 ldi r20, 0x00 ; 0 15c92: 64 ef ldi r22, 0xF4 ; 244 15c94: 71 e0 ldi r23, 0x01 ; 1 15c96: 82 e3 ldi r24, 0x32 ; 50 15c98: 90 e0 ldi r25, 0x00 ; 0 15c9a: 0f 94 0b 32 call 0x26416 ; 0x26416 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 15c9e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15ca2: 81 11 cpse r24, r1 15ca4: 05 c0 rjmp .+10 ; 0x15cb0 15ca6: 80 91 62 03 lds r24, 0x0362 ; 0x800362 15caa: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 15cac: 0f 94 25 30 call 0x2604a ; 0x2604a #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 15cb0: 81 e0 ldi r24, 0x01 ; 1 15cb2: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_update(2); 15cb6: 82 e0 ldi r24, 0x02 ; 2 15cb8: 0e 94 c3 69 call 0xd386 ; 0xd386 lcd_setstatuspgm(MSG_WELCOME); 15cbc: 8b e0 ldi r24, 0x0B ; 11 15cbe: 9c e6 ldi r25, 0x6C ; 108 15cc0: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = CustomMsg::Status; 15cc4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 15cc8: 8d cf rjmp .-230 ; 0x15be4 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 15cca: 85 e5 ldi r24, 0x55 ; 85 15ccc: 0e 94 b6 55 call 0xab6c ; 0xab6c - `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; 15cd0: c1 2c mov r12, r1 15cd2: d1 2c mov r13, r1 15cd4: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 15cd6: 88 23 and r24, r24 15cd8: 21 f0 breq .+8 ; 0x15ce2 15cda: 0e 94 8e 5a call 0xb51c ; 0xb51c 15cde: 6b 01 movw r12, r22 15ce0: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15ce2: 8a e5 ldi r24, 0x5A ; 90 15ce4: 0e 94 b6 55 call 0xab6c ; 0xab6c 15ce8: 88 23 and r24, r24 15cea: a1 f0 breq .+40 ; 0x15d14 15cec: 0e 94 8e 5a call 0xb51c ; 0xb51c 15cf0: 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); 15cf2: 0e 94 5e 67 call 0xcebc ; 0xcebc 15cf6: 4b 01 movw r8, r22 15cf8: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 15cfa: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15cfe: 81 30 cpi r24, 0x01 ; 1 15d00: 99 f4 brne .+38 ; 0x15d28 15d02: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 15d06: c5 01 movw r24, r10 15d08: b4 01 movw r22, r8 15d0a: 90 58 subi r25, 0x80 ; 128 15d0c: 0e 94 5e 67 call 0xcebc ; 0xcebc 15d10: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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 15d14: 60 e0 ldi r22, 0x00 ; 0 15d16: 70 e0 ldi r23, 0x00 ; 0 15d18: 80 ea ldi r24, 0xA0 ; 160 15d1a: 91 e4 ldi r25, 0x41 ; 65 15d1c: 0e 94 c0 67 call 0xcf80 ; 0xcf80 - `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; 15d20: 60 e0 ldi r22, 0x00 ; 0 15d22: 70 e0 ldi r23, 0x00 ; 0 15d24: cb 01 movw r24, r22 15d26: e5 cf rjmp .-54 ; 0x15cf2 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 15d28: c7 01 movw r24, r14 15d2a: b6 01 movw r22, r12 15d2c: 0e 94 58 f0 call 0x1e0b0 ; 0x1e0b0 15d30: ea cf rjmp .-44 ; 0x15d06 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15d32: 80 ec ldi r24, 0xC0 ; 192 15d34: 92 e0 ldi r25, 0x02 ; 2 15d36: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 15d3a: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 15d3e: 81 ec ldi r24, 0xC1 ; 193 15d40: 92 e0 ldi r25, 0x02 ; 2 15d42: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 15d46: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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() ) { 15d4a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d4e: 81 30 cpi r24, 0x01 ; 1 15d50: 11 f0 breq .+4 ; 0x15d56 15d52: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 if( code_seen('A') ) { 15d56: 81 e4 ldi r24, 0x41 ; 65 15d58: 0e 94 b6 55 call 0xab6c ; 0xab6c 15d5c: 88 23 and r24, r24 15d5e: 11 f4 brne .+4 ; 0x15d64 15d60: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 15d64: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15d68: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15d6c: 40 e1 ldi r20, 0x10 ; 16 15d6e: 50 e0 ldi r21, 0x00 ; 0 15d70: 70 e0 ldi r23, 0x00 ; 0 15d72: 60 e0 ldi r22, 0x00 ; 0 15d74: 01 96 adiw r24, 0x01 ; 1 15d76: 0f 94 c7 9c call 0x3398e ; 0x3398e 15d7a: 86 2f mov r24, r22 15d7c: 0e 94 89 f7 call 0x1ef12 ; 0x1ef12 15d80: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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() ){ 15d84: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d88: 81 30 cpi r24, 0x01 ; 1 15d8a: 11 f0 breq .+4 ; 0x15d90 15d8c: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 uint8_t addr = 0; if( code_seen('A') ) { 15d90: 81 e4 ldi r24, 0x41 ; 65 15d92: 0e 94 b6 55 call 0xab6c ; 0xab6c Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 15d96: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 15d98: 88 23 and r24, r24 15d9a: 61 f0 breq .+24 ; 0x15db4 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 15d9c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15da0: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15da4: 40 e1 ldi r20, 0x10 ; 16 15da6: 50 e0 ldi r21, 0x00 ; 0 15da8: 70 e0 ldi r23, 0x00 ; 0 15daa: 60 e0 ldi r22, 0x00 ; 0 15dac: 01 96 adiw r24, 0x01 ; 1 15dae: 0f 94 c7 9c call 0x3398e ; 0x3398e 15db2: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 15db4: 88 e5 ldi r24, 0x58 ; 88 15db6: 0e 94 b6 55 call 0xab6c ; 0xab6c 15dba: 88 23 and r24, r24 15dbc: 61 f0 breq .+24 ; 0x15dd6 data = code_value_short(); 15dbe: 0e 94 d8 55 call 0xabb0 ; 0xabb0 } if(addr){ 15dc2: 11 23 and r17, r17 15dc4: 11 f4 brne .+4 ; 0x15dca 15dc6: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 MMU2::mmu2.WriteRegister(addr, data); 15dca: bc 01 movw r22, r24 15dcc: 81 2f mov r24, r17 15dce: 0e 94 97 bf call 0x17f2e ; 0x17f2e 15dd2: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 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; 15dd6: 90 e0 ldi r25, 0x00 ; 0 15dd8: 80 e0 ldi r24, 0x00 ; 0 15dda: f3 cf rjmp .-26 ; 0x15dc2 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15ddc: 83 e5 ldi r24, 0x53 ; 83 15dde: 0e 94 b6 55 call 0xab6c ; 0xab6c 15de2: 88 23 and r24, r24 15de4: 31 f0 breq .+12 ; 0x15df2 { switch (code_value_uint8()) 15de6: 0e 94 cb 55 call 0xab96 ; 0xab96 15dea: 88 23 and r24, r24 15dec: a9 f0 breq .+42 ; 0x15e18 15dee: 81 30 cpi r24, 0x01 ; 1 15df0: f9 f0 breq .+62 ; 0x15e30 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 15df2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15df6: 81 30 cpi r24, 0x01 ; 1 15df8: 59 f4 brne .+22 ; 0x15e10 15dfa: 88 e5 ldi r24, 0x58 ; 88 15dfc: 0e 94 b6 55 call 0xab6c ; 0xab6c 15e00: 88 23 and r24, r24 15e02: 31 f0 breq .+12 ; 0x15e10 { switch (code_value_uint8()) 15e04: 0e 94 cb 55 call 0xab96 ; 0xab96 15e08: 82 30 cpi r24, 0x02 ; 2 15e0a: d0 f0 brcs .+52 ; 0x15e40 15e0c: 8a 32 cpi r24, 0x2A ; 42 15e0e: e1 f0 breq .+56 ; 0x15e48 break; default: break; } } MMU2::mmu2.Status(); 15e10: 0f 94 ee 41 call 0x283dc ; 0x283dc 15e14: 0c 94 5c 98 jmp 0x130b8 ; 0x130b8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15e18: 60 e0 ldi r22, 0x00 ; 0 15e1a: 8c ea ldi r24, 0xAC ; 172 15e1c: 9c e0 ldi r25, 0x0C ; 12 15e1e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 15e22: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 15e26: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 15e2a: 10 92 27 12 sts 0x1227, r1 ; 0x801227 15e2e: e1 cf rjmp .-62 ; 0x15df2 15e30: 61 e0 ldi r22, 0x01 ; 1 15e32: 8c ea ldi r24, 0xAC ; 172 15e34: 9c e0 ldi r25, 0x0C ; 12 15e36: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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(); 15e3a: 0f 94 fa 63 call 0x2c7f4 ; 0x2c7f4 15e3e: d9 cf rjmp .-78 ; 0x15df2 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 15e40: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 15e42: 0f 94 bd 63 call 0x2c77a ; 0x2c77a 15e46: e4 cf rjmp .-56 ; 0x15e10 15e48: 8a e2 ldi r24, 0x2A ; 42 15e4a: fb cf rjmp .-10 ; 0x15e42 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') { 15e4c: 84 35 cpi r24, 0x54 ; 84 15e4e: 09 f0 breq .+2 ; 0x15e52 15e50: 79 c0 rjmp .+242 ; 0x15f44 strchr_pointer = CMDBUFFER_CURRENT_STRING; 15e52: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15e56: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 processing_tcode = true; 15e5a: 81 e0 ldi r24, 0x01 ; 1 15e5c: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f TCodes(strchr_pointer, code_value_uint8()); 15e60: 0e 94 cb 55 call 0xab96 ; 0xab96 15e64: 18 2f mov r17, r24 15e66: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 15e6a: 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; 15e6e: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 15e70: 79 01 movw r14, r18 15e72: e9 0e add r14, r25 15e74: f1 1c adc r15, r1 15e76: d7 01 movw r26, r14 15e78: 8c 91 ld r24, X 15e7a: 80 32 cpi r24, 0x20 ; 32 15e7c: 11 f0 breq .+4 ; 0x15e82 15e7e: 89 30 cpi r24, 0x09 ; 9 15e80: 11 f4 brne .+4 ; 0x15e86 15e82: 9f 5f subi r25, 0xFF ; 255 15e84: f5 cf rjmp .-22 ; 0x15e70 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 15e86: 08 2e mov r0, r24 15e88: 00 0c add r0, r0 15e8a: 99 0b sbc r25, r25 15e8c: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 15e90: f7 01 movw r30, r14 15e92: 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'); 15e94: 90 ed ldi r25, 0xD0 ; 208 15e96: 98 0f add r25, r24 15e98: 95 30 cpi r25, 0x05 ; 5 15e9a: 58 f0 brcs .+22 ; 0x15eb2 15e9c: 8f 33 cpi r24, 0x3F ; 63 15e9e: 69 f0 breq .+26 ; 0x15eba 15ea0: 88 37 cpi r24, 0x78 ; 120 15ea2: 59 f0 breq .+22 ; 0x15eba 15ea4: 83 36 cpi r24, 0x63 ; 99 15ea6: 01 f1 breq .+64 ; 0x15ee8 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 15ea8: 87 e5 ldi r24, 0x57 ; 87 15eaa: 99 e7 ldi r25, 0x79 ; 121 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15eac: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 15eb0: 15 c0 rjmp .+42 ; 0x15edc 15eb2: 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] == '?'){ 15eb6: 8f 33 cpi r24, 0x3F ; 63 15eb8: a9 f4 brne .+42 ; 0x15ee4 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 15eba: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ebe: 81 30 cpi r24, 0x01 ; 1 15ec0: 69 f4 brne .+26 ; 0x15edc MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 15ec2: 86 e8 ldi r24, 0x86 ; 134 15ec4: 9e e3 ldi r25, 0x3E ; 62 15ec6: 0e 94 32 6d call 0xda64 ; 0xda64 15eca: 70 e0 ldi r23, 0x00 ; 0 15ecc: 60 e0 ldi r22, 0x00 ; 0 15ece: 0e 94 e2 bc call 0x179c4 ; 0x179c4 15ed2: 68 2f mov r22, r24 15ed4: d7 01 movw r26, r14 15ed6: 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()); 15ed8: 0e 94 3e f7 call 0x1ee7c ; 0x1ee7c processing_tcode = false; 15edc: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f 15ee0: 0c 94 b7 84 jmp 0x1096e ; 0x1096e } 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'){ 15ee4: 83 36 cpi r24, 0x63 ; 99 15ee6: 49 f4 brne .+18 ; 0x15efa // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 15ee8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15eec: 81 30 cpi r24, 0x01 ; 1 15eee: b1 f7 brne .-20 ; 0x15edc MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 15ef0: 0f 94 e8 41 call 0x283d0 ; 0x283d0 15ef4: 68 2f mov r22, r24 15ef6: 83 e6 ldi r24, 0x63 ; 99 15ef8: ef cf rjmp .-34 ; 0x15ed8 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 15efa: 91 30 cpi r25, 0x01 ; 1 15efc: 69 f4 brne .+26 ; 0x15f18 if (codeValue == MMU2::mmu2.get_current_tool()){ 15efe: 0f 94 e8 41 call 0x283d0 ; 0x283d0 15f02: 18 13 cpse r17, r24 15f04: 05 c0 rjmp .+10 ; 0x15f10 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 15f06: 87 e6 ldi r24, 0x67 ; 103 15f08: 99 e7 ldi r25, 0x79 ; 121 15f0a: 0f 94 25 a0 call 0x3404a ; 0x3404a 15f0e: e6 cf rjmp .-52 ; 0x15edc #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); 15f10: 81 2f mov r24, r17 15f12: 0e 94 d6 f3 call 0x1e7ac ; 0x1e7ac 15f16: e2 cf rjmp .-60 ; 0x15edc } } else { SERIAL_ECHO_START; 15f18: 87 e7 ldi r24, 0x77 ; 119 15f1a: 9e e9 ldi r25, 0x9E ; 158 15f1c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (codeValue >= EXTRUDERS) { 15f20: 11 23 and r17, r17 15f22: 59 f0 breq .+22 ; 0x15f3a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15f24: 84 e5 ldi r24, 0x54 ; 84 15f26: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 15f2a: 81 2f mov r24, r17 15f2c: 90 e0 ldi r25, 0x00 ; 0 15f2e: c0 96 adiw r24, 0x30 ; 48 15f30: 0f 94 00 42 call 0x28400 ; 0x28400 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15f34: 88 e8 ldi r24, 0x88 ; 136 15f36: 95 e6 ldi r25, 0x65 ; 101 15f38: b9 cf rjmp .-142 ; 0x15eac // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 15f3a: 85 e7 ldi r24, 0x75 ; 117 15f3c: 95 e6 ldi r25, 0x65 ; 101 15f3e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 15f42: cc cf rjmp .-104 ; 0x15edc /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 15f44: 84 34 cpi r24, 0x44 ; 68 15f46: 09 f0 breq .+2 ; 0x15f4a 15f48: 5d c0 rjmp .+186 ; 0x16004 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 15f4a: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15f4e: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 switch(code_value_short()) 15f52: 0e 94 d8 55 call 0xabb0 ; 0xabb0 15f56: 82 30 cpi r24, 0x02 ; 2 15f58: 91 05 cpc r25, r1 15f5a: 41 f1 breq .+80 ; 0x15fac 15f5c: 8c f4 brge .+34 ; 0x15f80 15f5e: 01 96 adiw r24, 0x01 ; 1 15f60: e1 f0 breq .+56 ; 0x15f9a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 15f62: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 15f66: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 15f6a: 8f 51 subi r24, 0x1F ; 31 15f6c: 90 4f sbci r25, 0xF0 ; 240 15f6e: 9f 93 push r25 15f70: 8f 93 push r24 15f72: 1f 92 push r1 15f74: 84 e4 ldi r24, 0x44 ; 68 15f76: 8f 93 push r24 15f78: 84 ef ldi r24, 0xF4 ; 244 15f7a: 96 e6 ldi r25, 0x66 ; 102 15f7c: 0c 94 0c 85 jmp 0x10a18 ; 0x10a18 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 15f80: 83 30 cpi r24, 0x03 ; 3 15f82: 91 05 cpc r25, r1 15f84: f9 f0 breq .+62 ; 0x15fc4 15f86: 47 97 sbiw r24, 0x17 ; 23 15f88: 61 f7 brne .-40 ; 0x15f62 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 15f8a: 85 e4 ldi r24, 0x45 ; 69 15f8c: 0e 94 b6 55 call 0xab6c ; 0xab6c 15f90: 88 23 and r24, r24 15f92: 09 f1 breq .+66 ; 0x15fd6 serial_dump_and_reset(dump_crash_reason::manual); 15f94: 80 e0 ldi r24, 0x00 ; 0 15f96: 0e 94 de 74 call 0xe9bc ; 0xe9bc * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 15f9a: 81 e6 ldi r24, 0x61 ; 97 15f9c: 95 e6 ldi r25, 0x65 ; 101 15f9e: 9f 93 push r25 15fa0: 8f 93 push r24 15fa2: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 15fa6: 0f 90 pop r0 15fa8: 0f 90 pop r0 15faa: ff cf rjmp .-2 ; 0x15faa - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 15fac: 0c e5 ldi r16, 0x5C ; 92 15fae: 15 e6 ldi r17, 0x65 ; 101 15fb0: 22 e0 ldi r18, 0x02 ; 2 15fb2: 40 e0 ldi r20, 0x00 ; 0 15fb4: 60 e0 ldi r22, 0x00 ; 0 15fb6: 72 e2 ldi r23, 0x22 ; 34 15fb8: 80 e0 ldi r24, 0x00 ; 0 15fba: 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")); 15fbc: 0e 94 c5 5d call 0xbb8a ; 0xbb8a 15fc0: 0c 94 b7 84 jmp 0x1096e ; 0x1096e 15fc4: 05 e5 ldi r16, 0x55 ; 85 15fc6: 15 e6 ldi r17, 0x65 ; 101 15fc8: 23 e0 ldi r18, 0x03 ; 3 15fca: 41 e0 ldi r20, 0x01 ; 1 15fcc: 60 e0 ldi r22, 0x00 ; 0 15fce: 70 e1 ldi r23, 0x10 ; 16 15fd0: 90 e0 ldi r25, 0x00 ; 0 15fd2: 80 e0 ldi r24, 0x00 ; 0 15fd4: f3 cf rjmp .-26 ; 0x15fbc { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 15fd6: 82 e5 ldi r24, 0x52 ; 82 15fd8: 0e 94 b6 55 call 0xab6c ; 0xab6c 15fdc: 91 e0 ldi r25, 0x01 ; 1 15fde: 89 27 eor r24, r25 15fe0: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c SERIAL_ECHOPGM("serial dump "); 15fe4: 8a e4 ldi r24, 0x4A ; 74 15fe6: 99 e7 ldi r25, 0x79 ; 121 15fe8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 15fec: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15ff0: 88 23 and r24, r24 15ff2: 21 f0 breq .+8 ; 0x15ffc 15ff4: 8d e4 ldi r24, 0x4D ; 77 15ff6: 95 e6 ldi r25, 0x65 ; 101 15ff8: 0c 94 73 85 jmp 0x10ae6 ; 0x10ae6 15ffc: 84 e4 ldi r24, 0x44 ; 68 15ffe: 95 e6 ldi r25, 0x65 ; 101 16000: 0c 94 73 85 jmp 0x10ae6 ; 0x10ae6 } } else { SERIAL_ECHO_START; 16004: 87 e7 ldi r24, 0x77 ; 119 16006: 9e e9 ldi r25, 0x9E ; 158 16008: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1600c: 87 eb ldi r24, 0xB7 ; 183 1600e: 95 e6 ldi r25, 0x65 ; 101 16010: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 16014: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 16018: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 1601c: 8f 51 subi r24, 0x1F ; 31 1601e: 90 4f sbci r25, 0xF0 ; 240 16020: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHOLNPGM("\"(2)"); 16024: 81 ec ldi r24, 0xC1 ; 193 16026: 9e e7 ldi r25, 0x7E ; 126 16028: 0c 94 73 85 jmp 0x10ae6 ; 0x10ae6 #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 1602c: 2d ec ldi r18, 0xCD ; 205 1602e: 3c ec ldi r19, 0xCC ; 204 16030: 4c ec ldi r20, 0xCC ; 204 16032: 5d e3 ldi r21, 0x3D ; 61 16034: c7 01 movw r24, r14 16036: b6 01 movw r22, r12 16038: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1603c: 18 16 cp r1, r24 1603e: 14 f4 brge .+4 ; 0x16044 16040: 0c 94 db 86 jmp 0x10db6 ; 0x10db6 16044: 0c 94 eb 87 jmp 0x10fd6 ; 0x10fd6 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; 16048: a3 01 movw r20, r6 1604a: 92 01 movw r18, r4 1604c: 62 2d mov r22, r2 1604e: 73 2d mov r23, r3 16050: 8e 2d mov r24, r14 16052: 9f 2d mov r25, r15 16054: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 16058: 18 16 cp r1, r24 1605a: 14 f0 brlt .+4 ; 0x16060 1605c: 0c 94 5d 8f jmp 0x11eba ; 0x11eba 16060: e5 e0 ldi r30, 0x05 ; 5 16062: ce 0e add r12, r30 16064: d1 1c adc r13, r1 16066: f2 e0 ldi r31, 0x02 ; 2 16068: 8f 0e add r8, r31 1606a: 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; 1606c: 85 01 movw r16, r10 1606e: 0c 94 24 8f jmp 0x11e48 ; 0x11e48 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)); 16072: 82 e7 ldi r24, 0x72 ; 114 16074: 99 e3 ldi r25, 0x39 ; 57 16076: 0e 94 32 6d call 0xda64 ; 0xda64 1607a: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_puts_at_P(0, 2, PSTR("")); 1607e: 4b e5 ldi r20, 0x5B ; 91 16080: 5e e7 ldi r21, 0x7E ; 126 16082: 62 e0 ldi r22, 0x02 ; 2 16084: 80 e0 ldi r24, 0x00 ; 0 16086: 0e 94 10 6a call 0xd420 ; 0xd420 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 1608a: f8 01 movw r30, r16 1608c: 81 91 ld r24, Z+ 1608e: 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'; 16090: 98 2f mov r25, r24 16092: 9f 7d andi r25, 0xDF ; 223 16094: 11 f4 brne .+4 ; 0x1609a 16096: 0c 94 26 9e jmp 0x13c4c ; 0x13c4c 1609a: 97 ef ldi r25, 0xF7 ; 247 1609c: 98 0f add r25, r24 1609e: 92 30 cpi r25, 0x02 ; 2 160a0: 10 f4 brcc .+4 ; 0x160a6 160a2: 0c 94 26 9e jmp 0x13c4c ; 0x13c4c 160a6: 8d 30 cpi r24, 0x0D ; 13 160a8: 11 f4 brne .+4 ; 0x160ae 160aa: 0c 94 26 9e jmp 0x13c4c ; 0x13c4c 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); 160ae: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 160b2: eb cf rjmp .-42 ; 0x1608a 000160b4 : uint8_t check_pinda_0() { return _PINDA?0:1; } 160b4: 80 91 bd 03 lds r24, 0x03BD ; 0x8003bd 160b8: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 160bc: 08 95 ret 000160be : 160be: 22 e0 ldi r18, 0x02 ; 2 160c0: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 160c4: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 160c8: 90 e1 ldi r25, 0x10 ; 16 160ca: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 160ce: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160d2: 80 61 ori r24, 0x10 ; 16 160d4: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160d8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160dc: 88 60 ori r24, 0x08 ; 8 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: 80 68 ori r24, 0x80 ; 128 160e8: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160ec: 80 91 04 05 lds r24, 0x0504 ; 0x800504 160f0: 81 30 cpi r24, 0x01 ; 1 160f2: a9 f4 brne .+42 ; 0x1611e 160f4: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 160f8: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 160fc: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 16100: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16104: 80 61 ori r24, 0x10 ; 16 16106: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1610a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1610e: 88 60 ori r24, 0x08 ; 8 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: 80 68 ori r24, 0x80 ; 128 1611a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611e: 08 95 ret 00016120 : 16120: 81 50 subi r24, 0x01 ; 1 16122: 82 31 cpi r24, 0x12 ; 18 16124: 08 f0 brcs .+2 ; 0x16128 16126: 5a c0 rjmp .+180 ; 0x161dc 16128: e8 2f mov r30, r24 1612a: f0 e0 ldi r31, 0x00 ; 0 1612c: 88 27 eor r24, r24 1612e: e4 56 subi r30, 0x64 ; 100 16130: ff 44 sbci r31, 0x4F ; 79 16132: 8f 4f sbci r24, 0xFF ; 255 16134: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 16138: bc b0 in r11, 0x0c ; 12 1613a: c0 b0 in r12, 0x00 ; 0 1613c: ae b0 in r10, 0x0e ; 14 1613e: b4 b0 in r11, 0x04 ; 4 16140: b8 b0 in r11, 0x08 ; 8 16142: ee b0 in r14, 0x0e ; 14 16144: c3 b0 in r12, 0x03 ; 3 16146: c9 b0 in r12, 0x09 ; 9 16148: cd b0 in r12, 0x0d ; 13 1614a: d3 b0 in r13, 0x03 ; 3 1614c: d7 b0 in r13, 0x07 ; 7 1614e: db b0 in r13, 0x0b ; 11 16150: e1 b0 in r14, 0x01 ; 1 16152: e5 b0 in r14, 0x05 ; 5 16154: ee b0 in r14, 0x0e ; 14 16156: e9 b0 in r14, 0x09 ; 9 16158: ef b0 in r14, 0x0f ; 15 1615a: f3 b0 in r15, 0x03 ; 3 1615c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16160: 8f 77 andi r24, 0x7F ; 127 16162: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16166: 08 95 ret 16168: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1616c: 8f 7d andi r24, 0xDF ; 223 1616e: f9 cf rjmp .-14 ; 0x16162 16170: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16174: 87 7f andi r24, 0xF7 ; 247 16176: f5 cf rjmp .-22 ; 0x16162 16178: 84 b5 in r24, 0x24 ; 36 1617a: 8f 77 andi r24, 0x7F ; 127 1617c: 84 bd out 0x24, r24 ; 36 1617e: 08 95 ret 16180: 84 b5 in r24, 0x24 ; 36 16182: 8f 7d andi r24, 0xDF ; 223 16184: fb cf rjmp .-10 ; 0x1617c 16186: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1618a: 8f 77 andi r24, 0x7F ; 127 1618c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 16190: 08 95 ret 16192: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 16196: 8f 7d andi r24, 0xDF ; 223 16198: f9 cf rjmp .-14 ; 0x1618c 1619a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1619e: 8f 77 andi r24, 0x7F ; 127 161a0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161a4: 08 95 ret 161a6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161aa: 8f 7d andi r24, 0xDF ; 223 161ac: f9 cf rjmp .-14 ; 0x161a0 161ae: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161b2: 87 7f andi r24, 0xF7 ; 247 161b4: f5 cf rjmp .-22 ; 0x161a0 161b6: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161ba: 8f 77 andi r24, 0x7F ; 127 161bc: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161c0: 08 95 ret 161c2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161c6: 8f 7d andi r24, 0xDF ; 223 161c8: f9 cf rjmp .-14 ; 0x161bc 161ca: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161ce: 87 7f andi r24, 0xF7 ; 247 161d0: f5 cf rjmp .-22 ; 0x161bc 161d2: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161d6: 8f 77 andi r24, 0x7F ; 127 161d8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161dc: 08 95 ret 161de: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e2: 8f 7d andi r24, 0xDF ; 223 161e4: f9 cf rjmp .-14 ; 0x161d8 161e6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161ea: 87 7f andi r24, 0xF7 ; 247 161ec: f5 cf rjmp .-22 ; 0x161d8 000161ee : 161ee: 83 b1 in r24, 0x03 ; 3 161f0: 82 95 swap r24 161f2: 81 70 andi r24, 0x01 ; 1 161f4: 08 95 ret 000161f6 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 161f6: cf 92 push r12 161f8: df 92 push r13 161fa: ef 92 push r14 161fc: 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; 161fe: 20 91 bf 03 lds r18, 0x03BF ; 0x8003bf 16202: b0 e0 ldi r27, 0x00 ; 0 16204: a0 e0 ldi r26, 0x00 ; 0 16206: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 1620a: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 1620e: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 16212: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 16216: 20 ff sbrs r18, 0 16218: 42 c0 rjmp .+132 ; 0x1629e 1621a: c8 1a sub r12, r24 1621c: d9 0a sbc r13, r25 1621e: ea 0a sbc r14, r26 16220: fb 0a sbc r15, r27 16222: c0 92 b6 06 sts 0x06B6, r12 ; 0x8006b6 16226: d0 92 b7 06 sts 0x06B7, r13 ; 0x8006b7 1622a: e0 92 b8 06 sts 0x06B8, r14 ; 0x8006b8 1622e: f0 92 b9 06 sts 0x06B9, r15 ; 0x8006b9 16232: cb 01 movw r24, r22 16234: b0 e0 ldi r27, 0x00 ; 0 16236: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 16238: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 1623c: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 16240: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 16244: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 16248: 21 ff sbrs r18, 1 1624a: 36 c0 rjmp .+108 ; 0x162b8 1624c: c8 1a sub r12, r24 1624e: d9 0a sbc r13, r25 16250: ea 0a sbc r14, r26 16252: fb 0a sbc r15, r27 16254: c0 92 ba 06 sts 0x06BA, r12 ; 0x8006ba 16258: d0 92 bb 06 sts 0x06BB, r13 ; 0x8006bb 1625c: e0 92 bc 06 sts 0x06BC, r14 ; 0x8006bc 16260: f0 92 bd 06 sts 0x06BD, r15 ; 0x8006bd 16264: 70 e0 ldi r23, 0x00 ; 0 16266: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 16268: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 1626c: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 16270: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 16274: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 16278: 22 ff sbrs r18, 2 1627a: 2b c0 rjmp .+86 ; 0x162d2 1627c: 84 1b sub r24, r20 1627e: 95 0b sbc r25, r21 16280: a6 0b sbc r26, r22 16282: b7 0b sbc r27, r23 16284: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 16288: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 1628c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 16290: 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]); } 16294: ff 90 pop r15 16296: ef 90 pop r14 16298: df 90 pop r13 1629a: cf 90 pop r12 1629c: 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; 1629e: 8c 0d add r24, r12 162a0: 9d 1d adc r25, r13 162a2: ae 1d adc r26, r14 162a4: bf 1d adc r27, r15 162a6: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 162aa: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 162ae: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 162b2: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 162b6: bd cf rjmp .-134 ; 0x16232 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 162b8: 8c 0d add r24, r12 162ba: 9d 1d adc r25, r13 162bc: ae 1d adc r26, r14 162be: bf 1d adc r27, r15 162c0: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 162c4: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 162c8: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 162cc: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 162d0: c9 cf rjmp .-110 ; 0x16264 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 162d2: 84 0f add r24, r20 162d4: 95 1f adc r25, r21 162d6: a6 1f adc r26, r22 162d8: b7 1f adc r27, r23 162da: d4 cf rjmp .-88 ; 0x16284 000162dc : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 162dc: fb 01 movw r30, r22 *v = 0; 162de: 11 82 std Z+1, r1 ; 0x01 162e0: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 162e2: 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'; 162e4: dc 01 movw r26, r24 162e6: 2c 91 ld r18, X 162e8: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 162ea: 2a 30 cpi r18, 0x0A ; 10 162ec: a0 f4 brcc .+40 ; 0x16316 *v *= 10; 162ee: 40 81 ld r20, Z 162f0: 51 81 ldd r21, Z+1 ; 0x01 162f2: 64 9f mul r22, r20 162f4: 90 01 movw r18, r0 162f6: 65 9f mul r22, r21 162f8: 30 0d add r19, r0 162fa: 11 24 eor r1, r1 162fc: 31 83 std Z+1, r19 ; 0x01 162fe: 20 83 st Z, r18 *v += *str - '0'; 16300: 4d 91 ld r20, X+ 16302: cd 01 movw r24, r26 16304: 20 53 subi r18, 0x30 ; 48 16306: 31 09 sbc r19, r1 16308: 24 0f add r18, r20 1630a: 31 1d adc r19, r1 1630c: 47 fd sbrc r20, 7 1630e: 3a 95 dec r19 16310: 31 83 std Z+1, r19 ; 0x01 16312: 20 83 st Z, r18 16314: e7 cf rjmp .-50 ; 0x162e4 ++str; } return str; } 16316: 08 95 ret 00016318 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 16318: 8e e9 ldi r24, 0x9E ; 158 1631a: 98 e6 ldi r25, 0x68 ; 104 1631c: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_return_to_status(); 16320: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 00016324 : //! 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) { 16324: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 16328: 81 30 cpi r24, 0x01 ; 1 1632a: 21 f4 brne .+8 ; 0x16334 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 1632c: 84 e5 ldi r24, 0x54 ; 84 1632e: 98 e6 ldi r25, 0x68 ; 104 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 16330: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 16334: 85 e4 ldi r24, 0x45 ; 69 16336: 98 e6 ldi r25, 0x68 ; 104 16338: fb cf rjmp .-10 ; 0x16330 0001633a : 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, 1633a: 1f 93 push r17 1633c: cf 93 push r28 1633e: df 93 push r29 16340: c8 2f mov r28, r24 16342: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 16344: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 16348: 83 ea ldi r24, 0xA3 ; 163 1634a: 94 e4 ldi r25, 0x44 ; 68 1634c: 0e 94 32 6d call 0xda64 ; 0xda64 16350: ac 01 movw r20, r24 16352: 60 e0 ldi r22, 0x00 ; 0 16354: 80 e0 ldi r24, 0x00 ; 0 16356: 0e 94 10 6a call 0xd420 ; 0xd420 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)); 1635a: 8d e7 ldi r24, 0x7D ; 125 1635c: 94 e4 ldi r25, 0x44 ; 68 1635e: c1 11 cpse r28, r1 16360: 02 c0 rjmp .+4 ; 0x16366 16362: 80 e9 ldi r24, 0x90 ; 144 16364: 94 e4 ldi r25, 0x44 ; 68 16366: 0e 94 32 6d call 0xda64 ; 0xda64 1636a: ac 01 movw r20, r24 1636c: 61 e0 ldi r22, 0x01 ; 1 1636e: 80 e0 ldi r24, 0x00 ; 0 16370: 0e 94 10 6a call 0xd420 ; 0xd420 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 16374: 8f ef ldi r24, 0xFF ; 255 16376: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1637a: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1637e: 0f 94 af 32 call 0x2655e ; 0x2655e // 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); 16382: 64 ef ldi r22, 0xF4 ; 244 16384: 71 e0 ldi r23, 0x01 ; 1 16386: 80 e0 ldi r24, 0x00 ; 0 16388: 90 e0 ldi r25, 0x00 ; 0 1638a: 0f 94 d5 0d call 0x21baa ; 0x21baa lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 1638e: 82 e7 ldi r24, 0x72 ; 114 16390: 94 e4 ldi r25, 0x44 ; 68 16392: 0e 94 32 6d call 0xda64 ; 0xda64 16396: ac 01 movw r20, r24 16398: 62 e0 ldi r22, 0x02 ; 2 1639a: 81 e0 ldi r24, 0x01 ; 1 1639c: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc_at(0, 3, '>'); 163a0: 4e e3 ldi r20, 0x3E ; 62 163a2: 63 e0 ldi r22, 0x03 ; 3 163a4: 80 e0 ldi r24, 0x00 ; 0 163a6: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 163aa: 83 e6 ldi r24, 0x63 ; 99 163ac: 94 e4 ldi r25, 0x44 ; 68 163ae: 0e 94 32 6d call 0xda64 ; 0xda64 163b2: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_encoder = _default; 163b6: 6d 2f mov r22, r29 163b8: 70 e0 ldi r23, 0x00 ; 0 163ba: 70 93 07 05 sts 0x0507, r23 ; 0x800507 163be: 60 93 06 05 sts 0x0506, r22 ; 0x800506 KEEPALIVE_STATE(PAUSED_FOR_USER); 163c2: 84 e0 ldi r24, 0x04 ; 4 163c4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 163c8: 0e 94 14 6c call 0xd828 ; 0xd828 163cc: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 163ce: 11 e0 ldi r17, 0x01 ; 1 163d0: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 163d2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 163d6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 163da: 00 97 sbiw r24, 0x00 ; 0 163dc: 19 f1 breq .+70 ; 0x16424 if (lcd_encoder < 0) { 163de: 97 ff sbrs r25, 7 163e0: 0b c0 rjmp .+22 ; 0x163f8 _result = !check_opposite; 163e2: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 163e4: 4e e3 ldi r20, 0x3E ; 62 163e6: 62 e0 ldi r22, 0x02 ; 2 163e8: 80 e0 ldi r24, 0x00 ; 0 163ea: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc_at(0, 3, ' '); 163ee: 40 e2 ldi r20, 0x20 ; 32 163f0: 63 e0 ldi r22, 0x03 ; 3 163f2: 80 e0 ldi r24, 0x00 ; 0 163f4: 0e 94 1c 6a call 0xd438 ; 0xd438 } if (lcd_encoder > 0) { 163f8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 163fc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 16400: 18 16 cp r1, r24 16402: 19 06 cpc r1, r25 16404: 5c f4 brge .+22 ; 0x1641c _result = check_opposite; lcd_putc_at(0, 2, ' '); 16406: 40 e2 ldi r20, 0x20 ; 32 16408: 62 e0 ldi r22, 0x02 ; 2 1640a: 80 e0 ldi r24, 0x00 ; 0 1640c: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc_at(0, 3, '>'); 16410: 4e e3 ldi r20, 0x3E ; 62 16412: 63 e0 ldi r22, 0x03 ; 3 16414: 80 e0 ldi r24, 0x00 ; 0 16416: 0e 94 1c 6a call 0xd438 ; 0xd438 1641a: dc 2f mov r29, r28 } lcd_encoder = 0; 1641c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 16420: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } manage_heater(); 16424: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 16428: 81 e0 ldi r24, 0x01 ; 1 1642a: 0e 94 89 7a call 0xf512 ; 0xf512 _delay(100); 1642e: 64 e6 ldi r22, 0x64 ; 100 16430: 70 e0 ldi r23, 0x00 ; 0 16432: 80 e0 ldi r24, 0x00 ; 0 16434: 90 e0 ldi r25, 0x00 ; 0 16436: 0f 94 d5 0d call 0x21baa ; 0x21baa } while (!lcd_clicked()); 1643a: 0e 94 19 6c call 0xd832 ; 0xd832 1643e: 88 23 and r24, r24 16440: 41 f2 breq .-112 ; 0x163d2 KEEPALIVE_STATE(IN_HANDLER); 16442: 82 e0 ldi r24, 0x02 ; 2 16444: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 16448: 80 e0 ldi r24, 0x00 ; 0 1644a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1644e: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 16452: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 16456: 0f 94 af 32 call 0x2655e ; 0x2655e KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 1645a: 8d 2f mov r24, r29 1645c: df 91 pop r29 1645e: cf 91 pop r28 16460: 1f 91 pop r17 16462: 08 95 ret 00016464 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 16464: cf 93 push r28 16466: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 16468: 0f 94 a0 22 call 0x24540 ; 0x24540 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1646c: c5 ef ldi r28, 0xF5 ; 245 1646e: 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)); 16470: 60 91 71 12 lds r22, 0x1271 ; 0x801271 16474: 70 e0 ldi r23, 0x00 ; 0 16476: 90 e0 ldi r25, 0x00 ; 0 16478: 80 e0 ldi r24, 0x00 ; 0 1647a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1647e: 9b 01 movw r18, r22 16480: ac 01 movw r20, r24 16482: 6c 85 ldd r22, Y+12 ; 0x0c 16484: 7d 85 ldd r23, Y+13 ; 0x0d 16486: 8e 85 ldd r24, Y+14 ; 0x0e 16488: 9f 85 ldd r25, Y+15 ; 0x0f 1648a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1648e: 6c 87 std Y+12, r22 ; 0x0c 16490: 7d 87 std Y+13, r23 ; 0x0d 16492: 8e 87 std Y+14, r24 ; 0x0e 16494: 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])); 16496: 62 e0 ldi r22, 0x02 ; 2 16498: 87 ea ldi r24, 0xA7 ; 167 1649a: 97 e8 ldi r25, 0x87 ; 135 } 1649c: df 91 pop r29 1649e: 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])); 164a0: 0d 94 eb 54 jmp 0x2a9d6 ; 0x2a9d6 000164a4 : 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) { 164a4: 0f 93 push r16 164a6: 1f 93 push r17 164a8: cf 93 push r28 164aa: df 93 push r29 164ac: 98 2f mov r25, r24 164ae: 86 2f mov r24, r22 164b0: 14 2f mov r17, r20 164b2: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 164b4: 69 2f mov r22, r25 164b6: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 switch (_state) 164ba: 11 30 cpi r17, 0x01 ; 1 164bc: 21 f0 breq .+8 ; 0x164c6 164be: 12 30 cpi r17, 0x02 ; 2 164c0: 79 f0 breq .+30 ; 0x164e0 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164c2: ce 01 movw r24, r28 164c4: 15 c0 rjmp .+42 ; 0x164f0 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 164c6: ce 01 movw r24, r28 164c8: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_putc(':'); 164cc: 8a e3 ldi r24, 0x3A ; 58 164ce: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_putc(_indicator); 164d2: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 164d4: df 91 pop r29 164d6: cf 91 pop r28 164d8: 1f 91 pop r17 164da: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 164dc: 0c 94 eb 69 jmp 0xd3d6 ; 0xd3d6 break; case 2: lcd_puts_P(_name_PROGMEM); 164e0: ce 01 movw r24, r28 164e2: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_putc(':'); 164e6: 8a e3 ldi r24, 0x3A ; 58 164e8: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_puts_P(MSG_OK_CAPS); 164ec: 87 e7 ldi r24, 0x77 ; 119 164ee: 98 e6 ldi r25, 0x68 ; 104 break; default: lcd_puts_P(_name_PROGMEM); } } 164f0: df 91 pop r29 164f2: cf 91 pop r28 164f4: 1f 91 pop r17 164f6: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164f8: 0c 94 e7 69 jmp 0xd3ce ; 0xd3ce 000164fc : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 164fc: df 92 push r13 164fe: ef 92 push r14 16500: ff 92 push r15 16502: 0f 93 push r16 16504: 1f 93 push r17 16506: cf 93 push r28 16508: df 93 push r29 1650a: cd b7 in r28, 0x3d ; 61 1650c: de b7 in r29, 0x3e ; 62 1650e: 63 97 sbiw r28, 0x13 ; 19 16510: 0f b6 in r0, 0x3f ; 63 16512: f8 94 cli 16514: de bf out 0x3e, r29 ; 62 16516: 0f be out 0x3f, r0 ; 63 16518: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1651a: 30 91 31 04 lds r19, 0x0431 ; 0x800431 1651e: 20 91 30 04 lds r18, 0x0430 ; 0x800430 16522: 32 13 cpse r19, r18 16524: 73 c0 rjmp .+230 ; 0x1660c 16526: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 16528: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1652c: 88 23 and r24, r24 1652e: 09 f4 brne .+2 ; 0x16532 16530: 45 c0 rjmp .+138 ; 0x165bc //! //! @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)); 16532: 8b e5 ldi r24, 0x5B ; 91 16534: 94 e4 ldi r25, 0x44 ; 68 16536: 0e 94 32 6d call 0xda64 ; 0xda64 1653a: 9f 93 push r25 1653c: 8f 93 push r24 1653e: 8f e9 ldi r24, 0x9F ; 159 16540: 97 e8 ldi r25, 0x87 ; 135 16542: 9f 93 push r25 16544: 8f 93 push r24 16546: 8e 01 movw r16, r28 16548: 0f 5f subi r16, 0xFF ; 255 1654a: 1f 4f sbci r17, 0xFF ; 255 1654c: 1f 93 push r17 1654e: 0f 93 push r16 16550: 0f 94 53 a0 call 0x340a6 ; 0x340a6 16554: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 16556: 47 e0 ldi r20, 0x07 ; 7 16558: 50 e0 ldi r21, 0x00 ; 0 1655a: b7 01 movw r22, r14 1655c: 80 0f add r24, r16 1655e: 91 2f mov r25, r17 16560: 91 1d adc r25, r1 16562: 0f 94 2c a1 call 0x34258 ; 0x34258 16566: 0f 90 pop r0 16568: 0f 90 pop r0 1656a: 0f 90 pop r0 1656c: 0f 90 pop r0 1656e: 0f 90 pop r0 16570: 0f 90 pop r0 16572: 20 e0 ldi r18, 0x00 ; 0 16574: 82 2f mov r24, r18 16576: 8d 0d add r24, r13 16578: 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) 1657a: 27 30 cpi r18, 0x07 ; 7 1657c: 39 f0 breq .+14 ; 0x1658c 1657e: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 16580: f8 01 movw r30, r16 16582: e8 0f add r30, r24 16584: f9 1f adc r31, r25 16586: 30 81 ld r19, Z 16588: 31 11 cpse r19, r1 1658a: f4 cf rjmp .-24 ; 0x16574 } buffer.c[index] = ']'; 1658c: f8 01 movw r30, r16 1658e: e8 0f add r30, r24 16590: f9 1f adc r31, r25 16592: 2d e5 ldi r18, 0x5D ; 93 16594: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 16596: 8c 0f add r24, r28 16598: 9d 1f adc r25, r29 1659a: fc 01 movw r30, r24 1659c: 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()); 1659e: 0f 94 de 92 call 0x325bc ; 0x325bc 165a2: 48 2f mov r20, r24 165a4: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 165a8: 80 e0 ldi r24, 0x00 ; 0 165aa: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 165ae: 62 e1 ldi r22, 0x12 ; 18 165b0: c8 01 movw r24, r16 165b2: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 lcd_putc(type_char); 165b6: 80 e2 ldi r24, 0x20 ; 32 165b8: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 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)) 165bc: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 165c0: 88 23 and r24, r24 165c2: 21 f1 breq .+72 ; 0x1660c 165c4: 20 91 31 04 lds r18, 0x0431 ; 0x800431 165c8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 165cc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 165d0: 28 17 cp r18, r24 165d2: 19 06 cpc r1, r25 165d4: d9 f4 brne .+54 ; 0x1660c { lcd_update_enabled = 0; 165d6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 165da: 8b eb ldi r24, 0xBB ; 187 165dc: 9f e6 ldi r25, 0x6F ; 111 165de: 89 2b or r24, r25 165e0: 11 f0 breq .+4 ; 0x165e6 165e2: 0e 94 bb 6f call 0xdf76 ; 0xdf76 lcd_update_enabled = 1; 165e6: 81 e0 ldi r24, 0x01 ; 1 165e8: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); 165ec: 0f 94 02 93 call 0x32604 ; 0x32604 return; } } menu_item++; } 165f0: 63 96 adiw r28, 0x13 ; 19 165f2: 0f b6 in r0, 0x3f ; 63 165f4: f8 94 cli 165f6: de bf out 0x3e, r29 ; 62 165f8: 0f be out 0x3f, r0 ; 63 165fa: cd bf out 0x3d, r28 ; 61 165fc: df 91 pop r29 165fe: cf 91 pop r28 16600: 1f 91 pop r17 16602: 0f 91 pop r16 16604: ff 90 pop r15 16606: ef 90 pop r14 16608: df 90 pop r13 1660a: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1660c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 16610: 8f 5f subi r24, 0xFF ; 255 16612: 80 93 31 04 sts 0x0431, r24 ; 0x800431 16616: ec cf rjmp .-40 ; 0x165f0 00016618 : } #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); 16618: 87 ea ldi r24, 0xA7 ; 167 1661a: 9c e0 ldi r25, 0x0C ; 12 1661c: 0f 94 3c a1 call 0x34278 ; 0x34278 if (value > 1) value = 1; 16620: 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) 16622: 82 30 cpi r24, 0x02 ; 2 16624: 08 f4 brcc .+2 ; 0x16628 16626: 68 27 eor r22, r24 16628: 87 ea ldi r24, 0xA7 ; 167 1662a: 9c e0 ldi r25, 0x0C ; 12 1662c: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 00016630 : 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); 16630: 8a ea ldi r24, 0xAA ; 170 16632: 9d e0 ldi r25, 0x0D ; 13 16634: 0f 94 3c a1 call 0x34278 ; 0x34278 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 16638: 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) { 1663a: 83 30 cpi r24, 0x03 ; 3 1663c: 21 f0 breq .+8 ; 0x16646 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1663e: 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) { 16640: 85 30 cpi r24, 0x05 ; 5 16642: 09 f0 breq .+2 ; 0x16646 case 1: mbl_z_probe_nr = 3; break; 16644: 63 e0 ldi r22, 0x03 ; 3 16646: 8a ea ldi r24, 0xAA ; 170 16648: 9d e0 ldi r25, 0x0D ; 13 1664a: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001664e : 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); 1664e: 8b ea ldi r24, 0xAB ; 171 16650: 9d e0 ldi r25, 0x0D ; 13 16652: 0f 94 3c a1 call 0x34278 ; 0x34278 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 16656: 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; 16658: 83 30 cpi r24, 0x03 ; 3 1665a: 09 f4 brne .+2 ; 0x1665e 1665c: 67 e0 ldi r22, 0x07 ; 7 1665e: 8b ea ldi r24, 0xAB ; 171 16660: 9d e0 ldi r25, 0x0D ; 13 16662: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 00016666 : #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); 16666: 8c ea ldi r24, 0xAC ; 172 16668: 9d e0 ldi r25, 0x0D ; 13 1666a: 0f 94 3c a1 call 0x34278 ; 0x34278 magnet_elimination = !magnet_elimination; 1666e: 61 e0 ldi r22, 0x01 ; 1 16670: 81 11 cpse r24, r1 16672: 60 e0 ldi r22, 0x00 ; 0 16674: 8c ea ldi r24, 0xAC ; 172 16676: 9d e0 ldi r25, 0x0D ; 13 16678: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001667c : 1667c: 60 91 98 03 lds r22, 0x0398 ; 0x800398 16680: 81 ea ldi r24, 0xA1 ; 161 16682: 9d e0 ldi r25, 0x0D ; 13 16684: 0f 94 60 a1 call 0x342c0 ; 0x342c0 //! @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(); 16688: 0d 94 4f 00 jmp 0x2009e ; 0x2009e 0001668c : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1668c: 0f 93 push r16 1668e: 1f 93 push r17 16690: cf 93 push r28 16692: df 93 push r29 16694: 00 d0 rcall .+0 ; 0x16696 16696: 00 d0 rcall .+0 ; 0x16698 16698: 1f 92 push r1 1669a: 1f 92 push r1 1669c: cd b7 in r28, 0x3d ; 61 1669e: de b7 in r29, 0x3e ; 62 166a0: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 166a2: 8a e0 ldi r24, 0x0A ; 10 166a4: 90 e0 ldi r25, 0x00 ; 0 166a6: 0f 94 4a a1 call 0x34294 ; 0x34294 166aa: 9a 83 std Y+2, r25 ; 0x02 166ac: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 166ae: 8c e0 ldi r24, 0x0C ; 12 166b0: 90 e0 ldi r25, 0x00 ; 0 166b2: 0f 94 4a a1 call 0x34294 ; 0x34294 166b6: 9c 83 std Y+4, r25 ; 0x04 166b8: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 166ba: 8e e0 ldi r24, 0x0E ; 14 166bc: 90 e0 ldi r25, 0x00 ; 0 166be: 0f 94 4a a1 call 0x34294 ; 0x34294 166c2: 9e 83 std Y+6, r25 ; 0x06 166c4: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 166c6: 80 e1 ldi r24, 0x10 ; 16 166c8: 90 e0 ldi r25, 0x00 ; 0 166ca: 0f 94 4a a1 call 0x34294 ; 0x34294 166ce: 98 87 std Y+8, r25 ; 0x08 166d0: 8f 83 std Y+7, r24 ; 0x07 166d2: c8 01 movw r24, r16 166d4: de 01 movw r26, r28 166d6: 11 96 adiw r26, 0x01 ; 1 166d8: be 01 movw r22, r28 166da: 67 5f subi r22, 0xF7 ; 247 166dc: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 166de: fc 01 movw r30, r24 166e0: 25 91 lpm r18, Z+ 166e2: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 166e4: 4d 91 ld r20, X+ 166e6: 5d 91 ld r21, X+ 166e8: 42 17 cp r20, r18 166ea: 53 07 cpc r21, r19 166ec: 48 f0 brcs .+18 ; 0x16700 return true; else if (v < ver_eeprom[i]) 166ee: 24 17 cp r18, r20 166f0: 35 07 cpc r19, r21 166f2: 20 f0 brcs .+8 ; 0x166fc 166f4: 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) { 166f6: a6 17 cp r26, r22 166f8: b7 07 cpc r27, r23 166fa: 89 f7 brne .-30 ; 0x166de return true; else if (v < ver_eeprom[i]) break; } return false; 166fc: 80 e0 ldi r24, 0x00 ; 0 166fe: 01 c0 rjmp .+2 ; 0x16702 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; 16700: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 16702: 28 96 adiw r28, 0x08 ; 8 16704: 0f b6 in r0, 0x3f ; 63 16706: f8 94 cli 16708: de bf out 0x3e, r29 ; 62 1670a: 0f be out 0x3f, r0 ; 63 1670c: cd bf out 0x3d, r28 ; 61 1670e: df 91 pop r29 16710: cf 91 pop r28 16712: 1f 91 pop r17 16714: 0f 91 pop r16 16716: 08 95 ret 00016718 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 16718: cf 93 push r28 1671a: 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)) 1671c: 8f ef ldi r24, 0xFF ; 255 1671e: 9f e0 ldi r25, 0x0F ; 15 16720: 0f 94 3c a1 call 0x34278 ; 0x34278 16724: 81 30 cpi r24, 0x01 ; 1 16726: 99 f0 breq .+38 ; 0x1674e 16728: 82 30 cpi r24, 0x02 ; 2 1672a: a1 f0 breq .+40 ; 0x16754 { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 1672c: 8a e9 ldi r24, 0x9A ; 154 1672e: 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); 16730: 0e 94 32 6d call 0xda64 ; 0xda64 16734: ec 01 movw r28, r24 16736: 83 e9 ldi r24, 0x93 ; 147 16738: 90 e4 ldi r25, 0x40 ; 64 1673a: 0e 94 32 6d call 0xda64 ; 0xda64 1673e: 22 e0 ldi r18, 0x02 ; 2 16740: 45 e4 ldi r20, 0x45 ; 69 16742: 57 e3 ldi r21, 0x37 ; 55 16744: 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 } } 16746: df 91 pop r29 16748: 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); 1674a: 0d 94 ab 95 jmp 0x32b56 ; 0x32b56 { 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); 1674e: 8a e8 ldi r24, 0x8A ; 138 16750: 90 e4 ldi r25, 0x40 ; 64 16752: ee cf rjmp .-36 ; 0x16730 break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 16754: 8d e7 ldi r24, 0x7D ; 125 16756: 90 e4 ldi r25, 0x40 ; 64 16758: eb cf rjmp .-42 ; 0x16730 0001675a : 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) 1675a: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1675e: 88 23 and r24, r24 16760: 21 f0 breq .+8 ; 0x1676a 16762: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 16766: 88 23 and r24, r24 16768: 51 f0 breq .+20 ; 0x1677e { _md->status = 1; 1676a: 81 e0 ldi r24, 0x01 ; 1 1676c: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 16770: 60 e0 ldi r22, 0x00 ; 0 16772: 8a e2 ldi r24, 0x2A ; 42 16774: 9d e0 ldi r25, 0x0D ; 13 16776: 0e 94 6e 6f call 0xdedc ; 0xdedc 1677a: 80 93 65 03 sts 0x0365, r24 ; 0x800365 } MENU_BEGIN(); 1677e: 0f 94 1c 94 call 0x32838 ; 0x32838 16782: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16786: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1678a: 84 30 cpi r24, 0x04 ; 4 1678c: 08 f0 brcs .+2 ; 0x16790 1678e: 90 c0 rjmp .+288 ; 0x168b0 16790: 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 16794: 80 91 ba 03 lds r24, 0x03BA ; 0x8003ba 16798: 81 11 cpse r24, r1 1679a: 55 c0 rjmp .+170 ; 0x16846 1679c: 86 e7 ldi r24, 0x76 ; 118 1679e: 90 e4 ldi r25, 0x40 ; 64 167a0: 0e 94 32 6d call 0xda64 ; 0xda64 167a4: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 167a8: 86 e4 ldi r24, 0x46 ; 70 167aa: 9c e3 ldi r25, 0x3C ; 60 167ac: 0e 94 32 6d call 0xda64 ; 0xda64 167b0: 63 e9 ldi r22, 0x93 ; 147 167b2: 7c eb ldi r23, 0xBC ; 188 167b4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 SETTINGS_NOZZLE; 167b8: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 167bc: 8c 33 cpi r24, 0x3C ; 60 167be: 09 f4 brne .+2 ; 0x167c2 167c0: 60 c0 rjmp .+192 ; 0x16882 167c2: 08 f0 brcs .+2 ; 0x167c6 167c4: 43 c0 rjmp .+134 ; 0x1684c 167c6: 89 31 cpi r24, 0x19 ; 25 167c8: 09 f4 brne .+2 ; 0x167cc 167ca: 4f c0 rjmp .+158 ; 0x1686a 167cc: 88 32 cpi r24, 0x28 ; 40 167ce: 09 f4 brne .+2 ; 0x167d2 167d0: 42 c0 rjmp .+132 ; 0x16856 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 167d2: 8f ed ldi r24, 0xDF ; 223 167d4: 9a e3 ldi r25, 0x3A ; 58 167d6: 0e 94 32 6d call 0xda64 ; 0xda64 167da: 64 e1 ldi r22, 0x14 ; 20 167dc: 76 ec ldi r23, 0xC6 ; 198 167de: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 167e2: 8c e8 ldi r24, 0x8C ; 140 167e4: 9a e3 ldi r25, 0x3A ; 58 167e6: 0e 94 32 6d call 0xda64 ; 0xda64 167ea: 65 e4 ldi r22, 0x45 ; 69 167ec: 7c ef ldi r23, 0xFC ; 252 167ee: 0f 94 9a 96 call 0x32d34 ; 0x32d34 //! 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) 167f2: 80 91 65 03 lds r24, 0x0365 ; 0x800365 167f6: 88 23 and r24, r24 167f8: 31 f0 breq .+12 ; 0x16806 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 167fa: 69 e5 ldi r22, 0x59 ; 89 167fc: 74 eb ldi r23, 0xB4 ; 180 167fe: 8c e5 ldi r24, 0x5C ; 92 16800: 93 e8 ldi r25, 0x83 ; 131 16802: 0f 94 9a 96 call 0x32d34 ; 0x32d34 //! 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); 16806: 89 e2 ldi r24, 0x29 ; 41 16808: 9d e0 ldi r25, 0x0D ; 13 1680a: 0f 94 3c a1 call 0x34278 ; 0x34278 1680e: 88 23 and r24, r24 16810: 09 f4 brne .+2 ; 0x16814 16812: 4b c0 rjmp .+150 ; 0x168aa 16814: 83 e0 ldi r24, 0x03 ; 3 16816: 9e e3 ldi r25, 0x3E ; 62 16818: 0e 94 32 6d call 0xda64 ; 0xda64 1681c: 22 e0 ldi r18, 0x02 ; 2 1681e: 47 ec ldi r20, 0xC7 ; 199 16820: 55 eb ldi r21, 0xB5 ; 181 16822: bc 01 movw r22, r24 16824: 8e ee ldi r24, 0xEE ; 238 16826: 97 e6 ldi r25, 0x67 ; 103 16828: 0f 94 ab 95 call 0x32b56 ; 0x32b56 #endif //PINDA_TEMP_COMP MENU_END(); 1682c: 0f 94 f0 93 call 0x327e0 ; 0x327e0 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 16830: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16834: 8f 5f subi r24, 0xFF ; 255 16836: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1683a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1683e: 8f 5f subi r24, 0xFF ; 255 16840: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16844: a0 cf rjmp .-192 ; 0x16786 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 16846: 88 ef ldi r24, 0xF8 ; 248 16848: 9d e3 ldi r25, 0x3D ; 61 1684a: aa cf rjmp .-172 ; 0x167a0 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1684c: 80 35 cpi r24, 0x50 ; 80 1684e: 19 f1 breq .+70 ; 0x16896 16850: 8f 3f cpi r24, 0xFF ; 255 16852: 09 f0 breq .+2 ; 0x16856 16854: be cf rjmp .-132 ; 0x167d2 16856: 85 e9 ldi r24, 0x95 ; 149 16858: 9a e3 ldi r25, 0x3A ; 58 1685a: 0e 94 32 6d call 0xda64 ; 0xda64 1685e: 22 e0 ldi r18, 0x02 ; 2 16860: 43 e0 ldi r20, 0x03 ; 3 16862: 5d ef ldi r21, 0xFD ; 253 16864: 63 e7 ldi r22, 0x73 ; 115 16866: 73 e8 ldi r23, 0x83 ; 131 16868: 09 c0 rjmp .+18 ; 0x1687c 1686a: 85 e9 ldi r24, 0x95 ; 149 1686c: 9a e3 ldi r25, 0x3A ; 58 1686e: 0e 94 32 6d call 0xda64 ; 0xda64 16872: 22 e0 ldi r18, 0x02 ; 2 16874: 43 e0 ldi r20, 0x03 ; 3 16876: 5d ef ldi r21, 0xFD ; 253 16878: 68 e7 ldi r22, 0x78 ; 120 1687a: 73 e8 ldi r23, 0x83 ; 131 1687c: 0f 94 ab 95 call 0x32b56 ; 0x32b56 16880: a8 cf rjmp .-176 ; 0x167d2 16882: 85 e9 ldi r24, 0x95 ; 149 16884: 9a e3 ldi r25, 0x3A ; 58 16886: 0e 94 32 6d call 0xda64 ; 0xda64 1688a: 22 e0 ldi r18, 0x02 ; 2 1688c: 43 e0 ldi r20, 0x03 ; 3 1688e: 5d ef ldi r21, 0xFD ; 253 16890: 6e e6 ldi r22, 0x6E ; 110 16892: 73 e8 ldi r23, 0x83 ; 131 16894: f3 cf rjmp .-26 ; 0x1687c 16896: 85 e9 ldi r24, 0x95 ; 149 16898: 9a e3 ldi r25, 0x3A ; 58 1689a: 0e 94 32 6d call 0xda64 ; 0xda64 1689e: 22 e0 ldi r18, 0x02 ; 2 168a0: 43 e0 ldi r20, 0x03 ; 3 168a2: 5d ef ldi r21, 0xFD ; 253 168a4: 69 e6 ldi r22, 0x69 ; 105 168a6: 73 e8 ldi r23, 0x83 ; 131 168a8: e9 cf rjmp .-46 ; 0x1687c //! 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); 168aa: 89 e0 ldi r24, 0x09 ; 9 168ac: 9e e3 ldi r25, 0x3E ; 62 168ae: b4 cf rjmp .-152 ; 0x16818 #endif //PINDA_TEMP_COMP MENU_END(); } 168b0: 08 95 ret 000168b2 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168b2: 0f 94 1c 94 call 0x32838 ; 0x32838 168b6: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 168ba: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168be: 84 30 cpi r24, 0x04 ; 4 168c0: a8 f4 brcc .+42 ; 0x168ec 168c2: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 168c6: 86 e7 ldi r24, 0x76 ; 118 168c8: 90 e4 ldi r25, 0x40 ; 64 168ca: 0e 94 32 6d call 0xda64 ; 0xda64 168ce: 0f 94 e7 96 call 0x32dce ; 0x32dce #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(); 168d2: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168d6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168da: 8f 5f subi r24, 0xFF ; 255 168dc: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 168e0: 80 91 30 04 lds r24, 0x0430 ; 0x800430 168e4: 8f 5f subi r24, 0xFF ; 255 168e6: 80 93 30 04 sts 0x0430, r24 ; 0x800430 168ea: e7 cf rjmp .-50 ; 0x168ba #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(); } 168ec: 08 95 ret 000168ee : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 168ee: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 168f0: 8e e0 ldi r24, 0x0E ; 14 168f2: 9e e3 ldi r25, 0x3E ; 62 168f4: 0e 94 32 6d call 0xda64 ; 0xda64 168f8: ac 01 movw r20, r24 168fa: 60 e0 ldi r22, 0x00 ; 0 168fc: 80 e0 ldi r24, 0x00 ; 0 168fe: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc_at(0, 1, '\n'); 16902: 4a e0 ldi r20, 0x0A ; 10 16904: 61 e0 ldi r22, 0x01 ; 1 16906: 80 e0 ldi r24, 0x00 ; 0 16908: 0e 94 1c 6a call 0xd438 ; 0xd438 MENU_BEGIN(); 1690c: 0f 94 1c 94 call 0x32838 ; 0x32838 16910: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 16914: 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(); 16916: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1691a: 84 30 cpi r24, 0x04 ; 4 1691c: 18 f5 brcc .+70 ; 0x16964 1691e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 16922: 81 11 cpse r24, r1 16924: 02 c0 rjmp .+4 ; 0x1692a 16926: 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); 1692a: 89 e0 ldi r24, 0x09 ; 9 1692c: 9e e3 ldi r25, 0x3E ; 62 1692e: 0e 94 32 6d call 0xda64 ; 0xda64 16932: 6f e3 ldi r22, 0x3F ; 63 16934: 7e ef ldi r23, 0xFE ; 254 16936: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1693a: 83 e0 ldi r24, 0x03 ; 3 1693c: 9e e3 ldi r25, 0x3E ; 62 1693e: 0e 94 32 6d call 0xda64 ; 0xda64 16942: 67 ee ldi r22, 0xE7 ; 231 16944: 7f ee ldi r23, 0xEF ; 239 16946: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_END(); 1694a: 0f 94 f0 93 call 0x327e0 ; 0x327e0 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1694e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16952: 8f 5f subi r24, 0xFF ; 255 16954: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16958: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1695c: 8f 5f subi r24, 0xFF ; 255 1695e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16962: d9 cf rjmp .-78 ; 0x16916 // 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(); } 16964: cf 91 pop r28 16966: 08 95 ret 00016968 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 16968: 0f 94 1c 94 call 0x32838 ; 0x32838 1696c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16970: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16974: 84 30 cpi r24, 0x04 ; 4 16976: 08 f0 brcs .+2 ; 0x1697a 16978: 3f c0 rjmp .+126 ; 0x169f8 1697a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1697e: 86 e4 ldi r24, 0x46 ; 70 16980: 9c e3 ldi r25, 0x3C ; 60 16982: 0e 94 32 6d call 0xda64 ; 0xda64 16986: 0f 94 e7 96 call 0x32dce ; 0x32dce if(eeprom_is_sheet_initialized(selected_sheet)){ 1698a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1698e: 0e 94 99 6f call 0xdf32 ; 0xdf32 16992: 88 23 and r24, r24 16994: 41 f0 breq .+16 ; 0x169a6 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 16996: 8d e3 ldi r24, 0x3D ; 61 16998: 9c e3 ldi r25, 0x3C ; 60 1699a: 0e 94 32 6d call 0xda64 ; 0xda64 1699e: 61 ed ldi r22, 0xD1 ; 209 169a0: 7b eb ldi r23, 0xBB ; 187 169a2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } if (lcd_commands_type == LcdCommands::Idle) 169a6: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 169aa: 81 11 cpse r24, r1 169ac: 08 c0 rjmp .+16 ; 0x169be { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 169ae: 8a e2 ldi r24, 0x2A ; 42 169b0: 9c e3 ldi r25, 0x3C ; 60 169b2: 0e 94 32 6d call 0xda64 ; 0xda64 169b6: 6e e3 ldi r22, 0x3E ; 62 169b8: 73 eb ldi r23, 0xB3 ; 179 169ba: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 169be: 81 e2 ldi r24, 0x21 ; 33 169c0: 9c e3 ldi r25, 0x3C ; 60 169c2: 0e 94 32 6d call 0xda64 ; 0xda64 169c6: 6f e3 ldi r22, 0x3F ; 63 169c8: 7a eb ldi r23, 0xBA ; 186 169ca: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 169ce: 89 e1 ldi r24, 0x19 ; 25 169d0: 9c e3 ldi r25, 0x3C ; 60 169d2: 0e 94 32 6d call 0xda64 ; 0xda64 169d6: 66 e3 ldi r22, 0x36 ; 54 169d8: 76 ec ldi r23, 0xC6 ; 198 169da: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_END(); 169de: 0f 94 f0 93 call 0x327e0 ; 0x327e0 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 169e2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 169e6: 8f 5f subi r24, 0xFF ; 255 169e8: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 169ec: 80 91 30 04 lds r24, 0x0430 ; 0x800430 169f0: 8f 5f subi r24, 0xFF ; 255 169f2: 80 93 30 04 sts 0x0430, r24 ; 0x800430 169f6: bc cf rjmp .-136 ; 0x16970 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 169f8: 08 95 ret 000169fa ()>: } template static void select_sheet_menu() { selected_sheet = number; 169fa: 87 e0 ldi r24, 0x07 ; 7 169fc: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a00: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a04 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a04: 86 e0 ldi r24, 0x06 ; 6 16a06: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a0a: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a0e ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a0e: 85 e0 ldi r24, 0x05 ; 5 16a10: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a14: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a18 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a18: 84 e0 ldi r24, 0x04 ; 4 16a1a: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a1e: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a22 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a22: 83 e0 ldi r24, 0x03 ; 3 16a24: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a28: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a2c ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a2c: 82 e0 ldi r24, 0x02 ; 2 16a2e: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a32: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a36 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a36: 81 e0 ldi r24, 0x01 ; 1 16a38: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a3c: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a40 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a40: 10 92 98 03 sts 0x0398, r1 ; 0x800398 lcd_sheet_menu(); 16a44: 0c 94 b4 b4 jmp 0x16968 ; 0x16968 00016a48 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 16a48: cf 92 push r12 16a4a: df 92 push r13 16a4c: ef 92 push r14 16a4e: ff 92 push r15 16a50: 0f 93 push r16 16a52: 1f 93 push r17 16a54: cf 93 push r28 16a56: df 93 push r29 16a58: 6c 01 movw r12, r24 16a5a: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 16a5c: c4 2f mov r28, r20 16a5e: d0 e0 ldi r29, 0x00 ; 0 16a60: ae 01 movw r20, r28 16a62: 0f 94 1b 9f call 0x33e36 ; 0x33e36 16a66: 89 2b or r24, r25 16a68: b9 f4 brne .+46 ; 0x16a98 Number(str + tagSize, v); 16a6a: b8 01 movw r22, r16 16a6c: c6 01 movw r24, r12 16a6e: 8c 0f add r24, r28 16a70: 9d 1f adc r25, r29 16a72: 0e 94 6e b1 call 0x162dc ; 0x162dc *v |= tagMask; 16a76: f8 01 movw r30, r16 16a78: 20 81 ld r18, Z 16a7a: 31 81 ldd r19, Z+1 ; 0x01 16a7c: 2e 29 or r18, r14 16a7e: 3f 29 or r19, r15 16a80: 31 83 std Z+1, r19 ; 0x01 16a82: 20 83 st Z, r18 return true; 16a84: 81 e0 ldi r24, 0x01 ; 1 } return false; } 16a86: df 91 pop r29 16a88: cf 91 pop r28 16a8a: 1f 91 pop r17 16a8c: 0f 91 pop r16 16a8e: ff 90 pop r15 16a90: ef 90 pop r14 16a92: df 90 pop r13 16a94: cf 90 pop r12 16a96: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 16a98: 80 e0 ldi r24, 0x00 ; 0 16a9a: f5 cf rjmp .-22 ; 0x16a86 00016a9c : } 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 16a9c: 41 e0 ldi r20, 0x01 ; 1 16a9e: 61 e0 ldi r22, 0x01 ; 1 16aa0: 85 ea ldi r24, 0xA5 ; 165 16aa2: 93 e8 ldi r25, 0x83 ; 131 16aa4: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (disable == LCD_LEFT_BUTTON_CHOICE) 16aa8: 81 11 cpse r24, r1 16aaa: 07 c0 rjmp .+14 ; 0x16aba { enquecommand_P(PSTR("G99")); 16aac: 61 e0 ldi r22, 0x01 ; 1 16aae: 81 ea ldi r24, 0xA1 ; 161 16ab0: 93 e8 ldi r25, 0x83 ; 131 16ab2: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 16ab6: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e } lcd_update_enable(true); 16aba: 81 e0 ldi r24, 0x01 ; 1 16abc: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_draw_update = 2; 16ac0: 82 e0 ldi r24, 0x02 ; 2 16ac2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 16ac6: 08 95 ret 00016ac8 : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 16ac8: ef 92 push r14 16aca: ff 92 push r15 16acc: 0f 93 push r16 16ace: 1f 93 push r17 16ad0: cf 93 push r28 16ad2: df 93 push r29 16ad4: cd b7 in r28, 0x3d ; 61 16ad6: de b7 in r29, 0x3e ; 62 16ad8: 6b 97 sbiw r28, 0x1b ; 27 16ada: 0f b6 in r0, 0x3f ; 63 16adc: f8 94 cli 16ade: de bf out 0x3e, r29 ; 62 16ae0: 0f be out 0x3f, r0 ; 63 16ae2: 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); 16ae4: 8a e5 ldi r24, 0x5A ; 90 16ae6: 9f e0 ldi r25, 0x0F ; 15 16ae8: 0f 94 3c a1 call 0x34278 ; 0x34278 16aec: e8 2e mov r14, r24 16aee: 0a e0 ldi r16, 0x0A ; 10 16af0: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 16af2: 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); 16af4: 48 e0 ldi r20, 0x08 ; 8 16af6: 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++) { 16af8: ef 14 cp r14, r15 16afa: 79 f0 breq .+30 ; 0x16b1a eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 16afc: b8 01 movw r22, r16 16afe: ce 01 movw r24, r28 16b00: 0e 96 adiw r24, 0x0e ; 14 16b02: 0f 94 2c a1 call 0x34258 ; 0x34258 dir_name[8] = '\0'; 16b06: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 16b08: 60 e0 ldi r22, 0x00 ; 0 16b0a: ce 01 movw r24, r28 16b0c: 0e 96 adiw r24, 0x0e ; 14 16b0e: 0f 94 2c 4b call 0x29658 ; 0x29658 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++) { 16b12: f3 94 inc r15 16b14: 08 5f subi r16, 0xF8 ; 248 16b16: 1f 4f sbci r17, 0xFF ; 255 16b18: ed cf rjmp .-38 ; 0x16af4 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); 16b1a: 65 e9 ldi r22, 0x95 ; 149 16b1c: 7f e0 ldi r23, 0x0F ; 15 16b1e: 8e 01 movw r16, r28 16b20: 0f 5f subi r16, 0xFF ; 255 16b22: 1f 4f sbci r17, 0xFF ; 255 16b24: c8 01 movw r24, r16 16b26: 0f 94 2c a1 call 0x34258 ; 0x34258 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 16b2a: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 16b2c: 8e e2 ldi r24, 0x2E ; 46 16b2e: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 16b30: 43 e0 ldi r20, 0x03 ; 3 16b32: 50 e0 ldi r21, 0x00 ; 0 16b34: 61 e9 ldi r22, 0x91 ; 145 16b36: 7c e0 ldi r23, 0x0C ; 12 16b38: ce 01 movw r24, r28 16b3a: 48 96 adiw r24, 0x18 ; 24 16b3c: 0f 94 2c a1 call 0x34258 ; 0x34258 extension_ptr[4] = '\0'; 16b40: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 16b42: be 01 movw r22, r28 16b44: 69 5e subi r22, 0xE9 ; 233 16b46: 7f 4f sbci r23, 0xFF ; 255 16b48: c8 01 movw r24, r16 16b4a: 0f 94 88 a7 call 0x34f10 ; 0x34f10 enquecommandf_P(MSG_M23, filename); 16b4e: 1f 93 push r17 16b50: 0f 93 push r16 16b52: 8d e8 ldi r24, 0x8D ; 141 16b54: 9c e6 ldi r25, 0x6C ; 108 16b56: 9f 93 push r25 16b58: 8f 93 push r24 16b5a: 0e 94 cd 7d call 0xfb9a ; 0xfb9a restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 16b5e: 61 e0 ldi r22, 0x01 ; 1 16b60: 89 e8 ldi r24, 0x89 ; 137 16b62: 9c e6 ldi r25, 0x6C ; 108 16b64: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 16b68: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e 16b6c: 0f 90 pop r0 16b6e: 0f 90 pop r0 16b70: 0f 90 pop r0 16b72: 0f 90 pop r0 } 16b74: 6b 96 adiw r28, 0x1b ; 27 16b76: 0f b6 in r0, 0x3f ; 63 16b78: f8 94 cli 16b7a: de bf out 0x3e, r29 ; 62 16b7c: 0f be out 0x3f, r0 ; 63 16b7e: cd bf out 0x3d, r28 ; 61 16b80: df 91 pop r29 16b82: cf 91 pop r28 16b84: 1f 91 pop r17 16b86: 0f 91 pop r16 16b88: ff 90 pop r15 16b8a: ef 90 pop r14 16b8c: 08 95 ret 00016b8e : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 16b8e: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 16b90: 89 e2 ldi r24, 0x29 ; 41 16b92: 9d e0 ldi r25, 0x0D ; 13 16b94: 0f 94 3c a1 call 0x34278 ; 0x34278 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; 16b98: 81 50 subi r24, 0x01 ; 1 16b9a: c1 e0 ldi r28, 0x01 ; 1 16b9c: 8e 3f cpi r24, 0xFE ; 254 16b9e: 08 f4 brcc .+2 ; 0x16ba2 16ba0: c0 e0 ldi r28, 0x00 ; 0 16ba2: 6c 2f mov r22, r28 16ba4: 89 e2 ldi r24, 0x29 ; 41 16ba6: 9d e0 ldi r25, 0x0D ; 13 16ba8: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 16bac: 85 e1 ldi r24, 0x15 ; 21 16bae: 94 e8 ldi r25, 0x84 ; 132 16bb0: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16bb4: 8c 2f mov r24, r28 16bb6: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_ECHOLN(pinda_temp_compensation); } 16bba: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 16bbc: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 00016bc0 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 16bc0: cf 93 push r28 16bc2: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 16bc4: 81 eb ldi r24, 0xB1 ; 177 16bc6: 93 e0 ldi r25, 0x03 ; 3 16bc8: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 16bcc: 80 91 05 12 lds r24, 0x1205 ; 0x801205 16bd0: 81 11 cpse r24, r1 16bd2: 18 c0 rjmp .+48 ; 0x16c04 16bd4: 80 91 06 12 lds r24, 0x1206 ; 0x801206 16bd8: 81 11 cpse r24, r1 16bda: 14 c0 rjmp .+40 ; 0x16c04 16bdc: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 16be0: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 16be4: 88 e3 ldi r24, 0x38 ; 56 16be6: cd 35 cpi r28, 0x5D ; 93 16be8: d8 07 cpc r29, r24 16bea: 61 f0 breq .+24 ; 0x16c04 16bec: 87 e3 ldi r24, 0x37 ; 55 16bee: c7 32 cpi r28, 0x27 ; 39 16bf0: d8 07 cpc r29, r24 16bf2: 41 f0 breq .+16 ; 0x16c04 16bf4: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 16bf8: 81 11 cpse r24, r1 16bfa: 04 c0 rjmp .+8 ; 0x16c04 16bfc: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 16c00: 88 23 and r24, r24 16c02: 31 f0 breq .+12 ; 0x16c10 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 16c04: 82 e0 ldi r24, 0x02 ; 2 16c06: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c0a: df 91 pop r29 16c0c: cf 91 pop r28 16c0e: 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) 16c10: 83 eb ldi r24, 0xB3 ; 179 16c12: cd 3a cpi r28, 0xAD ; 173 16c14: d8 07 cpc r29, r24 16c16: 81 f4 brne .+32 ; 0x16c38 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 16c18: 82 e0 ldi r24, 0x02 ; 2 16c1a: 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)); 16c1e: 8a e2 ldi r24, 0x2A ; 42 16c20: 9d e0 ldi r25, 0x0D ; 13 16c22: 0f 94 3c a1 call 0x34278 ; 0x34278 16c26: 61 e0 ldi r22, 0x01 ; 1 16c28: 81 11 cpse r24, r1 16c2a: 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); 16c2c: 8a e2 ldi r24, 0x2A ; 42 16c2e: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c30: df 91 pop r29 16c32: cf 91 pop r28 16c34: 0d 94 84 a1 jmp 0x34308 ; 0x34308 16c38: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 16c3c: 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 16c40: 98 13 cpse r25, r24 16c42: 04 c0 rjmp .+8 ; 0x16c4c 16c44: 0e 94 49 61 call 0xc292 ; 0xc292 16c48: 88 23 and r24, r24 16c4a: 61 f0 breq .+24 ; 0x16c64 if ( babystep_allowed_strict() 16c4c: 0e 94 84 61 call 0xc308 ; 0xc308 && (menu_menu == lcd_status_screen // and in listed menus... 16c50: 81 11 cpse r24, r1 16c52: 10 c0 rjmp .+32 ; 0x16c74 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 16c54: 82 e0 ldi r24, 0x02 ; 2 16c56: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 16c5a: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c5c: df 91 pop r29 16c5e: cf 91 pop r28 16c60: 0d 94 fd 2c jmp 0x259fa ; 0x259fa menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 16c64: 87 e3 ldi r24, 0x37 ; 55 16c66: c9 30 cpi r28, 0x09 ; 9 16c68: d8 07 cpc r29, r24 16c6a: e1 f4 brne .+56 ; 0x16ca4 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16c6c: 60 e0 ldi r22, 0x00 ; 0 16c6e: 87 e2 ldi r24, 0x27 ; 39 16c70: 97 e3 ldi r25, 0x37 ; 55 16c72: 14 c0 rjmp .+40 ; 0x16c9c // 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... 16c74: 87 e3 ldi r24, 0x37 ; 55 16c76: c9 30 cpi r28, 0x09 ; 9 16c78: d8 07 cpc r29, r24 16c7a: 59 f0 breq .+22 ; 0x16c92 || menu_menu == lcd_main_menu 16c7c: 83 ec ldi r24, 0xC3 ; 195 16c7e: ca 3f cpi r28, 0xFA ; 250 16c80: d8 07 cpc r29, r24 16c82: 39 f0 breq .+14 ; 0x16c92 || menu_menu == lcd_tune_menu 16c84: 86 eb ldi r24, 0xB6 ; 182 16c86: cf 38 cpi r28, 0x8F ; 143 16c88: d8 07 cpc r29, r24 16c8a: 19 f0 breq .+6 ; 0x16c92 || menu_menu == lcd_support_menu 16c8c: c9 53 subi r28, 0x39 ; 57 16c8e: d7 43 sbci r29, 0x37 ; 55 16c90: 09 f7 brne .-62 ; 0x16c54 ) ){ lcd_clear(); 16c92: 0e 94 2f 6a call 0xd45e ; 0xd45e menu_submenu(lcd_babystep_z); 16c96: 60 e0 ldi r22, 0x00 ; 0 16c98: 8d e5 ldi r24, 0x5D ; 93 16c9a: 98 e3 ldi r25, 0x38 ; 56 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c9c: df 91 pop r29 16c9e: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16ca0: 0d 94 89 95 jmp 0x32b12 ; 0x32b12 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 16ca4: 83 ec ldi r24, 0xC3 ; 195 16ca6: ca 3f cpi r28, 0xFA ; 250 16ca8: d8 07 cpc r29, r24 16caa: 01 f3 breq .-64 ; 0x16c6c || menu_menu == lcd_preheat_menu 16cac: 88 e3 ldi r24, 0x38 ; 56 16cae: cb 30 cpi r28, 0x0B ; 11 16cb0: d8 07 cpc r29, r24 16cb2: e1 f2 breq .-72 ; 0x16c6c || menu_menu == lcd_sdcard_menu 16cb4: 8c ee ldi r24, 0xEC ; 236 16cb6: c8 33 cpi r28, 0x38 ; 56 16cb8: d8 07 cpc r29, r24 16cba: c1 f2 breq .-80 ; 0x16c6c || menu_menu == lcd_settings_menu 16cbc: 87 eb ldi r24, 0xB7 ; 183 16cbe: cd 34 cpi r28, 0x4D ; 77 16cc0: d8 07 cpc r29, r24 16cc2: a1 f2 breq .-88 ; 0x16c6c || menu_menu == lcd_control_temperature_menu 16cc4: 86 eb ldi r24, 0xB6 ; 182 16cc6: cf 36 cpi r28, 0x6F ; 111 16cc8: d8 07 cpc r29, r24 16cca: 81 f2 breq .-96 ; 0x16c6c #if (LANG_MODE != 0) || menu_menu == lcd_language 16ccc: 8e ef ldi r24, 0xFE ; 254 16cce: c0 35 cpi r28, 0x50 ; 80 16cd0: d8 07 cpc r29, r24 16cd2: 61 f2 breq .-104 ; 0x16c6c #endif || menu_menu == lcd_support_menu 16cd4: c9 53 subi r28, 0x39 ; 57 16cd6: d7 43 sbci r29, 0x37 ; 55 16cd8: 09 f0 breq .+2 ; 0x16cdc 16cda: bc cf rjmp .-136 ; 0x16c54 16cdc: c7 cf rjmp .-114 ; 0x16c6c 00016cde : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16cde: 0f 94 1c 94 call 0x32838 ; 0x32838 16ce2: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16ce6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16cea: 84 30 cpi r24, 0x04 ; 4 16cec: b8 f4 brcc .+46 ; 0x16d1c 16cee: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 16cf2: 88 ef ldi r24, 0xF8 ; 248 16cf4: 9d e3 ldi r25, 0x3D ; 61 16cf6: 0e 94 32 6d call 0xda64 ; 0xda64 16cfa: 0f 94 e7 96 call 0x32dce ; 0x32dce menuitems_temperature_common(); 16cfe: 0f 94 0e 0a call 0x2141c ; 0x2141c MENU_END(); 16d02: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16d06: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d0a: 8f 5f subi r24, 0xFF ; 255 16d0c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16d10: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16d14: 8f 5f subi r24, 0xFF ; 255 16d16: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16d1a: e5 cf rjmp .-54 ; 0x16ce6 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 16d1c: 08 95 ret 00016d1e : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 16d1e: ef 92 push r14 16d20: ff 92 push r15 16d22: 0f 93 push r16 16d24: 1f 93 push r17 16d26: cf 93 push r28 16d28: df 93 push r29 16d2a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 16d2e: 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) 16d32: 20 91 71 03 lds r18, 0x0371 ; 0x800371 16d36: 21 11 cpse r18, r1 16d38: 91 c0 rjmp .+290 ; 0x16e5c { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 16d3a: 21 e0 ldi r18, 0x01 ; 1 16d3c: 20 93 71 03 sts 0x0371, r18 ; 0x800371 _md->extrudemultiply = extrudemultiply; 16d40: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16d44: 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); 16d48: 8f ef ldi r24, 0xFF ; 255 16d4a: 9f e0 ldi r25, 0x0F ; 15 16d4c: 0f 94 3c a1 call 0x34278 ; 0x34278 16d50: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16d54: 0f 94 1c 94 call 0x32838 ; 0x32838 16d58: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16d5c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d60: 84 30 cpi r24, 0x04 ; 4 16d62: 08 f0 brcs .+2 ; 0x16d66 16d64: 93 c0 rjmp .+294 ; 0x16e8c 16d66: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 16d6a: 0f 94 9c 92 call 0x32538 ; 0x32538 16d6e: 81 11 cpse r24, r1 16d70: 0e 94 46 5f call 0xbe8c ; 0xbe8c refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16d74: 8a e5 ldi r24, 0x5A ; 90 16d76: 9e e3 ldi r25, 0x3E ; 62 16d78: 0e 94 32 6d call 0xda64 ; 0xda64 16d7c: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 16d80: 85 ec ldi r24, 0xC5 ; 197 16d82: 9d e3 ldi r25, 0x3D ; 61 16d84: 0e 94 32 6d call 0xda64 ; 0xda64 16d88: f1 2c mov r15, r1 16d8a: e1 2c mov r14, r1 16d8c: 07 ee ldi r16, 0xE7 ; 231 16d8e: 13 e0 ldi r17, 0x03 ; 3 16d90: 2a e0 ldi r18, 0x0A ; 10 16d92: 30 e0 ldi r19, 0x00 ; 0 16d94: 40 e1 ldi r20, 0x10 ; 16 16d96: 6e e8 ldi r22, 0x8E ; 142 16d98: 72 e0 ldi r23, 0x02 ; 2 16d9a: 0f 94 6c 94 call 0x328d8 ; 0x328d8 menuitems_temperature_common(); 16d9e: 0f 94 0e 0a call 0x2141c ; 0x2141c MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 16da2: 8e eb ldi r24, 0xBE ; 190 16da4: 9d e3 ldi r25, 0x3D ; 61 16da6: 0e 94 32 6d call 0xda64 ; 0xda64 16daa: 2a e0 ldi r18, 0x0A ; 10 16dac: 30 e0 ldi r19, 0x00 ; 0 16dae: 40 e1 ldi r20, 0x10 ; 16 16db0: 69 e5 ldi r22, 0x59 ; 89 16db2: 72 e0 ldi r23, 0x02 ; 2 16db4: 0f 94 6c 94 call 0x328d8 ; 0x328d8 #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 16db8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16dbc: 81 11 cpse r24, r1 16dbe: 08 c0 rjmp .+16 ; 0x16dd0 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 16dc0: 8c ea ldi r24, 0xAC ; 172 16dc2: 9d e3 ldi r25, 0x3D ; 61 16dc4: 0e 94 32 6d call 0xda64 ; 0xda64 16dc8: 6a e4 ldi r22, 0x4A ; 74 16dca: 7f ee ldi r23, 0xEF ; 239 16dcc: 0f 94 99 93 call 0x32732 ; 0x32732 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 16dd0: 0e 94 3e 61 call 0xc27c ; 0xc27c 16dd4: 88 23 and r24, r24 16dd6: 41 f0 breq .+16 ; 0x16de8 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 16dd8: 87 ef ldi r24, 0xF7 ; 247 16dda: 98 e4 ldi r25, 0x48 ; 72 16ddc: 0e 94 32 6d call 0xda64 ; 0xda64 16de0: 68 eb ldi r22, 0xB8 ; 184 16de2: 73 e8 ldi r23, 0x83 ; 131 16de4: 0f 94 12 93 call 0x32624 ; 0x32624 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16de8: 8e e9 ldi r24, 0x9E ; 158 16dea: 9d e3 ldi r25, 0x3D ; 61 16dec: 0e 94 32 6d call 0xda64 ; 0xda64 16df0: 61 e3 ldi r22, 0x31 ; 49 16df2: 7d ef ldi r23, 0xFD ; 253 16df4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 16df8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16dfc: 81 30 cpi r24, 0x01 ; 1 16dfe: 11 f4 brne .+4 ; 0x16e04 { menuitems_MMU_settings_common(); 16e00: 0f 94 47 0a call 0x2148e ; 0x2148e } SETTINGS_FANS_CHECK(); 16e04: 0f 94 f4 09 call 0x213e8 ; 0x213e8 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16e08: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16e0c: 81 11 cpse r24, r1 16e0e: 02 c0 rjmp .+4 ; 0x16e14 16e10: 0e 94 8c b3 call 0x16718 ; 0x16718 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e14: 80 91 15 04 lds r24, 0x0415 ; 0x800415 16e18: 82 30 cpi r24, 0x02 ; 2 16e1a: 91 f1 breq .+100 ; 0x16e80 16e1c: 83 30 cpi r24, 0x03 ; 3 16e1e: 99 f1 breq .+102 ; 0x16e86 16e20: 81 30 cpi r24, 0x01 ; 1 16e22: 59 f1 breq .+86 ; 0x16e7a 16e24: 87 e9 ldi r24, 0x97 ; 151 16e26: 9d e3 ldi r25, 0x3D ; 61 16e28: 0e 94 32 6d call 0xda64 ; 0xda64 16e2c: ec 01 movw r28, r24 16e2e: 8f e8 ldi r24, 0x8F ; 143 16e30: 9d e3 ldi r25, 0x3D ; 61 16e32: 0e 94 32 6d call 0xda64 ; 0xda64 16e36: 22 e0 ldi r18, 0x02 ; 2 16e38: 4b ed ldi r20, 0xDB ; 219 16e3a: 5c ef ldi r21, 0xFC ; 252 16e3c: be 01 movw r22, r28 16e3e: 0f 94 ab 95 call 0x32b56 ; 0x32b56 if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 16e42: 0f 94 f0 93 call 0x327e0 ; 0x327e0 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16e46: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16e4a: 8f 5f subi r24, 0xFF ; 255 16e4c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16e50: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16e54: 8f 5f subi r24, 0xFF ; 255 16e56: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16e5a: 80 cf rjmp .-256 ; 0x16d5c { // 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) 16e5c: 20 91 72 03 lds r18, 0x0372 ; 0x800372 16e60: 30 91 73 03 lds r19, 0x0373 ; 0x800373 16e64: 28 17 cp r18, r24 16e66: 39 07 cpc r19, r25 16e68: 09 f4 brne .+2 ; 0x16e6c 16e6a: 6e cf rjmp .-292 ; 0x16d48 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 16e6c: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16e70: 80 93 72 03 sts 0x0372, r24 ; 0x800372 calculate_extruder_multipliers(); 16e74: 0e 94 53 5f call 0xbea6 ; 0xbea6 16e78: 67 cf rjmp .-306 ; 0x16d48 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e7a: 88 e8 ldi r24, 0x88 ; 136 16e7c: 9d e3 ldi r25, 0x3D ; 61 16e7e: d4 cf rjmp .-88 ; 0x16e28 16e80: 8a e8 ldi r24, 0x8A ; 138 16e82: 90 e4 ldi r25, 0x40 ; 64 16e84: d1 cf rjmp .-94 ; 0x16e28 16e86: 8f e7 ldi r24, 0x7F ; 127 16e88: 9d e3 ldi r25, 0x3D ; 61 16e8a: ce cf rjmp .-100 ; 0x16e28 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 16e8c: df 91 pop r29 16e8e: cf 91 pop r28 16e90: 1f 91 pop r17 16e92: 0f 91 pop r16 16e94: ff 90 pop r15 16e96: ef 90 pop r14 16e98: 08 95 ret 00016e9a : MENU_END(); } static void lcd_settings_menu() { 16e9a: 1f 93 push r17 16e9c: cf 93 push r28 16e9e: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 16ea0: 8f ef ldi r24, 0xFF ; 255 16ea2: 9f e0 ldi r25, 0x0F ; 15 16ea4: 0f 94 3c a1 call 0x34278 ; 0x34278 16ea8: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16eac: 0f 94 1c 94 call 0x32838 ; 0x32838 16eb0: 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 16eb4: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16eb6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16eba: 84 30 cpi r24, 0x04 ; 4 16ebc: 08 f0 brcs .+2 ; 0x16ec0 16ebe: 45 c1 rjmp .+650 ; 0x1714a 16ec0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16ec4: 8a e5 ldi r24, 0x5A ; 90 16ec6: 9e e3 ldi r25, 0x3E ; 62 16ec8: 0e 94 32 6d call 0xda64 ; 0xda64 16ecc: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 16ed0: 88 e2 ldi r24, 0x28 ; 40 16ed2: 9b e3 ldi r25, 0x3B ; 59 16ed4: 0e 94 32 6d call 0xda64 ; 0xda64 16ed8: 6f e6 ldi r22, 0x6F ; 111 16eda: 76 eb ldi r23, 0xB6 ; 182 16edc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 if (!printer_active() || printingIsPaused()) 16ee0: 0e 94 9a 61 call 0xc334 ; 0xc334 16ee4: 88 23 and r24, r24 16ee6: 21 f0 breq .+8 ; 0x16ef0 16ee8: 0e 94 3e 61 call 0xc27c ; 0xc27c 16eec: 88 23 and r24, r24 16eee: 81 f0 breq .+32 ; 0x16f10 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 16ef0: 8c e1 ldi r24, 0x1C ; 28 16ef2: 9b e3 ldi r25, 0x3B ; 59 16ef4: 0e 94 32 6d call 0xda64 ; 0xda64 16ef8: 66 e9 ldi r22, 0x96 ; 150 16efa: 7e ef ldi r23, 0xFE ; 254 16efc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 16f00: 89 e0 ldi r24, 0x09 ; 9 16f02: 9b e3 ldi r25, 0x3B ; 59 16f04: 0e 94 32 6d call 0xda64 ; 0xda64 16f08: 6d ea ldi r22, 0xAD ; 173 16f0a: 78 e6 ldi r23, 0x68 ; 104 16f0c: 0f 94 12 93 call 0x32624 ; 0x32624 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16f10: 8e e9 ldi r24, 0x9E ; 158 16f12: 9d e3 ldi r25, 0x3D ; 61 16f14: 0e 94 32 6d call 0xda64 ; 0xda64 16f18: 61 e3 ldi r22, 0x31 ; 49 16f1a: 7d ef ldi r23, 0xFD ; 253 16f1c: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #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); 16f20: 8c ea ldi r24, 0xAC ; 172 16f22: 9c e0 ldi r25, 0x0C ; 12 16f24: 0f 94 3c a1 call 0x34278 ; 0x34278 16f28: 88 23 and r24, r24 16f2a: 09 f4 brne .+2 ; 0x16f2e 16f2c: 91 c0 rjmp .+290 ; 0x17050 16f2e: 81 e7 ldi r24, 0x71 ; 113 16f30: 9b e5 ldi r25, 0x5B ; 91 16f32: 0e 94 32 6d call 0xda64 ; 0xda64 16f36: 22 e0 ldi r18, 0x02 ; 2 16f38: 4a e1 ldi r20, 0x1A ; 26 16f3a: 5e ef ldi r21, 0xFE ; 254 16f3c: bc 01 movw r22, r24 16f3e: 89 e9 ldi r24, 0x99 ; 153 16f40: 93 e8 ldi r25, 0x83 ; 131 16f42: 0f 94 ab 95 call 0x32b56 ; 0x32b56 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 16f46: 8c ea ldi r24, 0xAC ; 172 16f48: 9c e0 ldi r25, 0x0C ; 12 16f4a: 0f 94 3c a1 call 0x34278 ; 0x34278 16f4e: 88 23 and r24, r24 16f50: 31 f0 breq .+12 ; 0x16f5e { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 16f52: 60 e9 ldi r22, 0x90 ; 144 16f54: 7c eb ldi r23, 0xBC ; 188 16f56: 8f e8 ldi r24, 0x8F ; 143 16f58: 93 e8 ldi r25, 0x83 ; 131 16f5a: 0f 94 99 93 call 0x32732 ; 0x32732 } if (MMU2::mmu2.Enabled()) 16f5e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16f62: 81 30 cpi r24, 0x01 ; 1 16f64: 51 f4 brne .+20 ; 0x16f7a { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 16f66: 0f 94 47 0a call 0x2148e ; 0x2148e MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 16f6a: 8a ef ldi r24, 0xFA ; 250 16f6c: 9a e3 ldi r25, 0x3A ; 58 16f6e: 0e 94 32 6d call 0xda64 ; 0xda64 16f72: 6e ec ldi r22, 0xCE ; 206 16f74: 7b eb ldi r23, 0xBB ; 187 16f76: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } SETTINGS_FANS_CHECK(); 16f7a: 0f 94 f4 09 call 0x213e8 ; 0x213e8 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16f7e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f82: 81 11 cpse r24, r1 16f84: 02 c0 rjmp .+4 ; 0x16f8a 16f86: 0e 94 8c b3 call 0x16718 ; 0x16718 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 16f8a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f8e: 81 11 cpse r24, r1 16f90: 62 c0 rjmp .+196 ; 0x17056 { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 16f92: 10 93 ba 03 sts 0x03BA, r17 ; 0x8003ba MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 16f96: 8f ee ldi r24, 0xEF ; 239 16f98: 9a e3 ldi r25, 0x3A ; 58 16f9a: 0e 94 32 6d call 0xda64 ; 0xda64 16f9e: 6d ea ldi r22, 0xAD ; 173 16fa0: 73 eb ldi r23, 0xB3 ; 179 16fa2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } 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); 16fa6: 8e e8 ldi r24, 0x8E ; 142 16fa8: 9b e3 ldi r25, 0x3B ; 59 16faa: 0e 94 32 6d call 0xda64 ; 0xda64 16fae: 6a ef ldi r22, 0xFA ; 250 16fb0: 7a eb ldi r23, 0xBA ; 186 16fb2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #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()) 16fb6: 0f 94 0c 15 call 0x22a18 ; 0x22a18 16fba: 88 23 and r24, r24 16fbc: b1 f0 breq .+44 ; 0x16fea 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); 16fbe: 8f ea ldi r24, 0xAF ; 175 16fc0: 9f e0 ldi r25, 0x0F ; 15 16fc2: 0f 94 3c a1 call 0x34278 ; 0x34278 16fc6: 88 23 and r24, r24 16fc8: 09 f4 brne .+2 ; 0x16fcc 16fca: 4e c0 rjmp .+156 ; 0x17068 16fcc: 81 e7 ldi r24, 0x71 ; 113 16fce: 9b e5 ldi r25, 0x5B ; 91 16fd0: 0e 94 32 6d call 0xda64 ; 0xda64 16fd4: ec 01 movw r28, r24 16fd6: 86 e3 ldi r24, 0x36 ; 54 16fd8: 9b e3 ldi r25, 0x3B ; 59 16fda: 0e 94 32 6d call 0xda64 ; 0xda64 16fde: 22 e0 ldi r18, 0x02 ; 2 16fe0: 4d ee ldi r20, 0xED ; 237 16fe2: 5d ef ldi r21, 0xFD ; 253 16fe4: be 01 movw r22, r28 16fe6: 0f 94 ab 95 call 0x32b56 ; 0x32b56 #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); 16fea: 0e 94 3e 61 call 0xc27c ; 0xc27c 16fee: 81 11 cpse r24, r1 16ff0: 08 c0 rjmp .+16 ; 0x17002 16ff2: 87 e5 ldi r24, 0x57 ; 87 16ff4: 9d e3 ldi r25, 0x3D ; 61 16ff6: 0e 94 32 6d call 0xda64 ; 0xda64 16ffa: 6d e5 ldi r22, 0x5D ; 93 16ffc: 78 e3 ldi r23, 0x38 ; 56 16ffe: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 17002: 8d ec ldi r24, 0xCD ; 205 17004: 9a e3 ldi r25, 0x3A ; 58 17006: 0e 94 32 6d call 0xda64 ; 0xda64 1700a: 61 ee ldi r22, 0xE1 ; 225 1700c: 77 e3 ldi r23, 0x37 ; 55 1700e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 17012: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17016: 81 11 cpse r24, r1 17018: 47 c0 rjmp .+142 ; 0x170a8 if (card.ToshibaFlashAir_isEnabled()) 1701a: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1701e: 88 23 and r24, r24 17020: 31 f1 breq .+76 ; 0x1706e MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 17022: 83 ec ldi r24, 0xC3 ; 195 17024: 9a e3 ldi r25, 0x3A ; 58 17026: 0e 94 32 6d call 0xda64 ; 0xda64 1702a: 22 e0 ldi r18, 0x02 ; 2 1702c: 41 ed ldi r20, 0xD1 ; 209 1702e: 5c ef ldi r21, 0xFC ; 252 17030: 66 e0 ldi r22, 0x06 ; 6 17032: 78 e6 ldi r23, 0x68 ; 104 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 17034: 0f 94 ab 95 call 0x32b56 ; 0x32b56 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 17038: 89 e0 ldi r24, 0x09 ; 9 1703a: 9f e0 ldi r25, 0x0F ; 15 1703c: 0f 94 3c a1 call 0x34278 ; 0x34278 17040: 88 23 and r24, r24 17042: 19 f1 breq .+70 ; 0x1708a 17044: 81 30 cpi r24, 0x01 ; 1 17046: 09 f4 brne .+2 ; 0x1704a 17048: 71 c0 rjmp .+226 ; 0x1712c 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); 1704a: 87 eb ldi r24, 0xB7 ; 183 1704c: 90 e4 ldi r25, 0x40 ; 64 1704e: 1f c0 rjmp .+62 ; 0x1708e #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); 17050: 8b e6 ldi r24, 0x6B ; 107 17052: 9b e5 ldi r25, 0x5B ; 91 17054: 6e cf rjmp .-292 ; 0x16f32 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); 17056: 8f ed ldi r24, 0xDF ; 223 17058: 9a e3 ldi r25, 0x3A ; 58 1705a: 0e 94 32 6d call 0xda64 ; 0xda64 1705e: 64 e1 ldi r22, 0x14 ; 20 17060: 76 ec ldi r23, 0xC6 ; 198 17062: 0f 94 99 93 call 0x32732 ; 0x32732 17066: 9f cf rjmp .-194 ; 0x16fa6 #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); 17068: 8b e6 ldi r24, 0x6B ; 107 1706a: 9b e5 ldi r25, 0x5B ; 91 1706c: b1 cf rjmp .-158 ; 0x16fd0 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); 1706e: 8a eb ldi r24, 0xBA ; 186 17070: 9a e3 ldi r25, 0x3A ; 58 17072: 0e 94 32 6d call 0xda64 ; 0xda64 17076: ec 01 movw r28, r24 17078: 83 ec ldi r24, 0xC3 ; 195 1707a: 9a e3 ldi r25, 0x3A ; 58 1707c: 0e 94 32 6d call 0xda64 ; 0xda64 17080: 22 e0 ldi r18, 0x02 ; 2 17082: 41 ed ldi r20, 0xD1 ; 209 17084: 5c ef ldi r21, 0xFC ; 252 17086: be 01 movw r22, r28 17088: d5 cf rjmp .-86 ; 0x17034 #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; 1708a: 83 eb ldi r24, 0xB3 ; 179 1708c: 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); 1708e: 0e 94 32 6d call 0xda64 ; 0xda64 17092: ec 01 movw r28, r24 17094: 8c ea ldi r24, 0xAC ; 172 17096: 9a e3 ldi r25, 0x3A ; 58 17098: 0e 94 32 6d call 0xda64 ; 0xda64 1709c: 22 e0 ldi r18, 0x02 ; 2 1709e: 48 ef ldi r20, 0xF8 ; 248 170a0: 5d ef ldi r21, 0xFD ; 253 170a2: be 01 movw r22, r28 170a4: 0f 94 ab 95 call 0x32b56 ; 0x32b56 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 170a8: 80 91 15 04 lds r24, 0x0415 ; 0x800415 170ac: 82 30 cpi r24, 0x02 ; 2 170ae: 09 f4 brne .+2 ; 0x170b2 170b0: 43 c0 rjmp .+134 ; 0x17138 170b2: 83 30 cpi r24, 0x03 ; 3 170b4: 09 f4 brne .+2 ; 0x170b8 170b6: 43 c0 rjmp .+134 ; 0x1713e 170b8: 81 30 cpi r24, 0x01 ; 1 170ba: d9 f1 breq .+118 ; 0x17132 170bc: 87 e9 ldi r24, 0x97 ; 151 170be: 9d e3 ldi r25, 0x3D ; 61 170c0: 0e 94 32 6d call 0xda64 ; 0xda64 170c4: ec 01 movw r28, r24 170c6: 8f e8 ldi r24, 0x8F ; 143 170c8: 9d e3 ldi r25, 0x3D ; 61 170ca: 0e 94 32 6d call 0xda64 ; 0xda64 170ce: 22 e0 ldi r18, 0x02 ; 2 170d0: 4b ed ldi r20, 0xDB ; 219 170d2: 5c ef ldi r21, 0xFC ; 252 170d4: be 01 movw r22, r28 170d6: 0f 94 ab 95 call 0x32b56 ; 0x32b56 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 170da: 87 ea ldi r24, 0xA7 ; 167 170dc: 9c e0 ldi r25, 0x0C ; 12 170de: 0f 94 3c a1 call 0x34278 ; 0x34278 170e2: 88 23 and r24, r24 170e4: 79 f1 breq .+94 ; 0x17144 170e6: 83 e0 ldi r24, 0x03 ; 3 170e8: 9e e3 ldi r25, 0x3E ; 62 170ea: 0e 94 32 6d call 0xda64 ; 0xda64 170ee: 22 e0 ldi r18, 0x02 ; 2 170f0: 4c e0 ldi r20, 0x0C ; 12 170f2: 53 eb ldi r21, 0xB3 ; 179 170f4: bc 01 movw r22, r24 170f6: 89 ef ldi r24, 0xF9 ; 249 170f8: 97 e6 ldi r25, 0x67 ; 103 170fa: 0f 94 ab 95 call 0x32b56 ; 0x32b56 if (farm_mode) 170fe: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17102: 88 23 and r24, r24 17104: 31 f0 breq .+12 ; 0x17112 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 17106: 6e e4 ldi r22, 0x4E ; 78 17108: 75 eb ldi r23, 0xB5 ; 181 1710a: 8d e7 ldi r24, 0x7D ; 125 1710c: 93 e8 ldi r25, 0x83 ; 131 1710e: 0f 94 99 93 call 0x32732 ; 0x32732 } MENU_END(); 17112: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 17116: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1711a: 8f 5f subi r24, 0xFF ; 255 1711c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17120: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17124: 8f 5f subi r24, 0xFF ; 255 17126: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1712a: c5 ce rjmp .-630 ; 0x16eb6 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; 1712c: 81 ea ldi r24, 0xA1 ; 161 1712e: 9a e3 ldi r25, 0x3A ; 58 17130: ae cf rjmp .-164 ; 0x1708e default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 17132: 88 e8 ldi r24, 0x88 ; 136 17134: 9d e3 ldi r25, 0x3D ; 61 17136: c4 cf rjmp .-120 ; 0x170c0 17138: 8a e8 ldi r24, 0x8A ; 138 1713a: 90 e4 ldi r25, 0x40 ; 64 1713c: c1 cf rjmp .-126 ; 0x170c0 1713e: 8f e7 ldi r24, 0x7F ; 127 17140: 9d e3 ldi r25, 0x3D ; 61 17142: be cf rjmp .-132 ; 0x170c0 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 17144: 89 e0 ldi r24, 0x09 ; 9 17146: 9e e3 ldi r25, 0x3E ; 62 17148: d0 cf rjmp .-96 ; 0x170ea { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1714a: df 91 pop r29 1714c: cf 91 pop r28 1714e: 1f 91 pop r17 17150: 08 95 ret 00017152 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17152: 0f 94 1c 94 call 0x32838 ; 0x32838 17156: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1715a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1715e: 84 30 cpi r24, 0x04 ; 4 17160: 08 f0 brcs .+2 ; 0x17164 17162: 7d c0 rjmp .+250 ; 0x1725e 17164: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17168: 8a e5 ldi r24, 0x5A ; 90 1716a: 9e e3 ldi r25, 0x3E ; 62 1716c: 0e 94 32 6d call 0xda64 ; 0xda64 17170: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 17174: 8b ec ldi r24, 0xCB ; 203 17176: 9b e3 ldi r25, 0x3B ; 59 17178: 0e 94 32 6d call 0xda64 ; 0xda64 1717c: 61 e0 ldi r22, 0x01 ; 1 1717e: 77 e3 ldi r23, 0x37 ; 55 17180: 0f 94 99 93 call 0x32732 ; 0x32732 if (lcd_commands_type == LcdCommands::Idle) 17184: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17188: 81 11 cpse r24, r1 1718a: 08 c0 rjmp .+16 ; 0x1719c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1718c: 8a e2 ldi r24, 0x2A ; 42 1718e: 9c e3 ldi r25, 0x3C ; 60 17190: 0e 94 32 6d call 0xda64 ; 0xda64 17194: 65 e7 ldi r22, 0x75 ; 117 17196: 78 e3 ldi r23, 0x38 ; 56 17198: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1719c: 87 ef ldi r24, 0xF7 ; 247 1719e: 98 e4 ldi r25, 0x48 ; 72 171a0: 0e 94 32 6d call 0xda64 ; 0xda64 171a4: 66 eb ldi r22, 0xB6 ; 182 171a6: 78 e6 ldi r23, 0x68 ; 104 171a8: 0f 94 12 93 call 0x32624 ; 0x32624 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 171ac: 80 ec ldi r24, 0xC0 ; 192 171ae: 9b e3 ldi r25, 0x3B ; 59 171b0: 0e 94 32 6d call 0xda64 ; 0xda64 171b4: 66 ed ldi r22, 0xD6 ; 214 171b6: 76 ef ldi r23, 0xF6 ; 246 171b8: 0f 94 99 93 call 0x32732 ; 0x32732 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 171bc: 80 eb ldi r24, 0xB0 ; 176 171be: 9b e3 ldi r25, 0x3B ; 59 171c0: 0e 94 32 6d call 0xda64 ; 0xda64 171c4: 68 e8 ldi r22, 0x88 ; 136 171c6: 7e ef ldi r23, 0xFE ; 254 171c8: 0f 94 99 93 call 0x32732 ; 0x32732 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 171cc: 82 ea ldi r24, 0xA2 ; 162 171ce: 9b e3 ldi r25, 0x3B ; 59 171d0: 0e 94 32 6d call 0xda64 ; 0xda64 171d4: 61 e8 ldi r22, 0x81 ; 129 171d6: 7e ef ldi r23, 0xFE ; 254 171d8: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 171dc: 8e e8 ldi r24, 0x8E ; 142 171de: 9b e3 ldi r25, 0x3B ; 59 171e0: 0e 94 32 6d call 0xda64 ; 0xda64 171e4: 6f e8 ldi r22, 0x8F ; 143 171e6: 7e ef ldi r23, 0xFE ; 254 171e8: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 171ec: 8a e7 ldi r24, 0x7A ; 122 171ee: 9b e3 ldi r25, 0x3B ; 59 171f0: 0e 94 32 6d call 0xda64 ; 0xda64 171f4: 6a e0 ldi r22, 0x0A ; 10 171f6: 7f ef ldi r23, 0xFF ; 255 171f8: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 171fc: 88 e6 ldi r24, 0x68 ; 104 171fe: 9b e3 ldi r25, 0x3B ; 59 17200: 0e 94 32 6d call 0xda64 ; 0xda64 17204: 63 ec ldi r22, 0xC3 ; 195 17206: 7f ef ldi r23, 0xFF ; 255 17208: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 1720c: 87 e5 ldi r24, 0x57 ; 87 1720e: 9b e3 ldi r25, 0x3B ; 59 17210: 0e 94 32 6d call 0xda64 ; 0xda64 17214: 6b e9 ldi r22, 0x9B ; 155 17216: 78 e3 ldi r23, 0x38 ; 56 17218: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 1721c: 83 e4 ldi r24, 0x43 ; 67 1721e: 9b e3 ldi r25, 0x3B ; 59 17220: 0e 94 32 6d call 0xda64 ; 0xda64 17224: 6d e9 ldi r22, 0x9D ; 157 17226: 73 e8 ldi r23, 0x83 ; 131 17228: 0f 94 12 93 call 0x32624 ; 0x32624 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1722c: 0f 94 0c 15 call 0x22a18 ; 0x22a18 17230: 88 23 and r24, r24 17232: 41 f0 breq .+16 ; 0x17244 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 17234: 86 e3 ldi r24, 0x36 ; 54 17236: 9b e3 ldi r25, 0x3B ; 59 17238: 0e 94 32 6d call 0xda64 ; 0xda64 1723c: 6a e7 ldi r22, 0x7A ; 122 1723e: 7e ef ldi r23, 0xFE ; 254 17240: 0f 94 99 93 call 0x32732 ; 0x32732 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 17244: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17248: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1724c: 8f 5f subi r24, 0xFF ; 255 1724e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17252: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17256: 8f 5f subi r24, 0xFF ; 255 17258: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1725c: 7e cf rjmp .-260 ; 0x1715a #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1725e: 08 95 ret 00017260 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 17260: bf 92 push r11 17262: cf 92 push r12 17264: df 92 push r13 17266: ef 92 push r14 17268: ff 92 push r15 1726a: 0f 93 push r16 1726c: 1f 93 push r17 1726e: cf 93 push r28 17270: df 93 push r29 17272: c8 2f mov r28, r24 17274: f6 2e mov r15, r22 17276: e4 2e mov r14, r20 17278: b2 2e mov r11, r18 1727a: 68 01 movw r12, r16 lcd_update_enable(false); 1727c: 80 e0 ldi r24, 0x00 ; 0 1727e: 0e 94 41 6a call 0xd482 ; 0xd482 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 17282: dc e7 ldi r29, 0x7C ; 124 17284: fe 14 cp r15, r14 17286: 08 f0 brcs .+2 ; 0x1728a 17288: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1728a: bb 20 and r11, r11 1728c: 09 f1 breq .+66 ; 0x172d0 lcd_clear(); 1728e: 0e 94 2f 6a call 0xd45e ; 0xd45e else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 17292: c1 11 cpse r28, r1 17294: 20 c0 rjmp .+64 ; 0x172d6 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 17296: 83 ea ldi r24, 0xA3 ; 163 17298: 94 e4 ldi r25, 0x44 ; 68 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)); 1729a: 0e 94 32 6d call 0xda64 ; 0xda64 1729e: 0e 94 e7 69 call 0xd3ce ; 0xd3ce if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172a2: 88 ef ldi r24, 0xF8 ; 248 172a4: 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 172a6: 82 30 cpi r24, 0x02 ; 2 172a8: 78 f5 brcc .+94 ; 0x17308 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172aa: 8c ef ldi r24, 0xFC ; 252 172ac: 9f e3 ldi r25, 0x3F ; 63 172ae: 0e 94 32 6d call 0xda64 ; 0xda64 172b2: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 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)); 172b6: 8b ed ldi r24, 0xDB ; 219 172b8: 9f e3 ldi r25, 0x3F ; 63 172ba: cc 30 cpi r28, 0x0C ; 12 172bc: 49 f1 breq .+82 ; 0x17310 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 172be: 89 ec ldi r24, 0xC9 ; 201 172c0: 9f e3 ldi r25, 0x3F ; 63 172c2: cd 30 cpi r28, 0x0D ; 13 172c4: 29 f1 breq .+74 ; 0x17310 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 172c6: ce 30 cpi r28, 0x0E ; 14 172c8: 39 f5 brne .+78 ; 0x17318 172ca: 86 eb ldi r24, 0xB6 ; 182 172cc: 9f e3 ldi r25, 0x3F ; 63 172ce: 20 c0 rjmp .+64 ; 0x17310 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 172d0: 0e 94 28 6a call 0xd450 ; 0xd450 172d4: de cf rjmp .-68 ; 0x17292 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172d6: c1 30 cpi r28, 0x01 ; 1 172d8: f1 f2 breq .-68 ; 0x17296 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172da: c2 30 cpi r28, 0x02 ; 2 172dc: e1 f2 breq .-72 ; 0x17296 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 172de: 83 e5 ldi r24, 0x53 ; 83 172e0: 90 e4 ldi r25, 0x40 ; 64 172e2: c3 30 cpi r28, 0x03 ; 3 172e4: d1 f2 breq .-76 ; 0x1729a if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 172e6: 81 e4 ldi r24, 0x41 ; 65 172e8: 90 e4 ldi r25, 0x40 ; 64 172ea: c4 30 cpi r28, 0x04 ; 4 172ec: b1 f2 breq .-84 ; 0x1729a if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 172ee: 8f e2 ldi r24, 0x2F ; 47 172f0: 90 e4 ldi r25, 0x40 ; 64 172f2: c5 30 cpi r28, 0x05 ; 5 172f4: 91 f2 breq .-92 ; 0x1729a if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 172f6: 8d e1 ldi r24, 0x1D ; 29 172f8: 90 e4 ldi r25, 0x40 ; 64 172fa: c6 30 cpi r28, 0x06 ; 6 172fc: 71 f2 breq .-100 ; 0x1729a if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 172fe: c7 30 cpi r28, 0x07 ; 7 17300: 81 f6 brne .-96 ; 0x172a2 17302: 8e e0 ldi r24, 0x0E ; 14 17304: 90 e4 ldi r25, 0x40 ; 64 17306: c9 cf rjmp .-110 ; 0x1729a 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)); 17308: ca 30 cpi r28, 0x0A ; 10 1730a: 99 f5 brne .+102 ; 0x17372 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1730c: 89 ee ldi r24, 0xE9 ; 233 1730e: 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)); 17310: 0e 94 32 6d call 0xda64 ; 0xda64 17314: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_puts_at_P(0, 1, STR_SEPARATOR); 17318: 40 e0 ldi r20, 0x00 ; 0 1731a: 54 e8 ldi r21, 0x84 ; 132 1731c: 61 e0 ldi r22, 0x01 ; 1 1731e: 80 e0 ldi r24, 0x00 ; 0 17320: 0e 94 10 6a call 0xd420 ; 0xd420 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 17324: c3 30 cpi r28, 0x03 ; 3 17326: 70 f5 brcc .+92 ; 0x17384 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 17328: 88 ea ldi r24, 0xA8 ; 168 1732a: 9f e3 ldi r25, 0x3F ; 63 1732c: 0e 94 32 6d call 0xda64 ; 0xda64 17330: ac 01 movw r20, r24 17332: 62 e0 ldi r22, 0x02 ; 2 17334: 80 e0 ldi r24, 0x00 ; 0 17336: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(18, 2); 1733a: 62 e0 ldi r22, 0x02 ; 2 1733c: 82 e1 ldi r24, 0x12 ; 18 1733e: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17342: c1 11 cpse r28, r1 17344: 1a c0 rjmp .+52 ; 0x1737a 17346: 8d 2f mov r24, r29 17348: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1734c: 8b e9 ldi r24, 0x9B ; 155 1734e: 9f e3 ldi r25, 0x3F ; 63 17350: 0e 94 32 6d call 0xda64 ; 0xda64 17354: ac 01 movw r20, r24 17356: 63 e0 ldi r22, 0x03 ; 3 17358: 80 e0 ldi r24, 0x00 ; 0 1735a: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(18, 3); 1735e: 63 e0 ldi r22, 0x03 ; 3 17360: 82 e1 ldi r24, 0x12 ; 18 17362: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17366: c2 30 cpi r28, 0x02 ; 2 17368: 19 f1 breq .+70 ; 0x173b0 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); 1736a: 8d 2f mov r24, r29 1736c: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 17370: 23 c0 rjmp .+70 ; 0x173b8 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)); 17372: cb 30 cpi r28, 0x0B ; 11 17374: 09 f0 breq .+2 ; 0x17378 17376: 9f cf rjmp .-194 ; 0x172b6 17378: c9 cf rjmp .-110 ; 0x1730c 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); 1737a: 87 e7 ldi r24, 0x77 ; 119 1737c: 98 e6 ldi r25, 0x68 ; 104 1737e: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 17382: e4 cf rjmp .-56 ; 0x1734c 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) 17384: 86 ef ldi r24, 0xF6 ; 246 17386: 8c 0f add r24, r28 17388: 82 30 cpi r24, 0x02 ; 2 1738a: 80 f5 brcc .+96 ; 0x173ec { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1738c: 89 e8 ldi r24, 0x89 ; 137 1738e: 9f e3 ldi r25, 0x3F ; 63 17390: 0e 94 32 6d call 0xda64 ; 0xda64 17394: ac 01 movw r20, r24 17396: 62 e0 ldi r22, 0x02 ; 2 17398: 80 e0 ldi r24, 0x00 ; 0 1739a: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc(':'); 1739e: 8a e3 ldi r24, 0x3A ; 58 173a0: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_set_cursor(18, 2); 173a4: 62 e0 ldi r22, 0x02 ; 2 173a6: 82 e1 ldi r24, 0x12 ; 18 173a8: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 173ac: ca 30 cpi r28, 0x0A ; 10 173ae: e9 f2 breq .-70 ; 0x1736a 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); 173b0: 87 e7 ldi r24, 0x77 ; 119 173b2: 98 e6 ldi r25, 0x68 ; 104 173b4: 0e 94 e7 69 call 0xd3ce ; 0xd3ce _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); 173b8: c1 14 cp r12, r1 173ba: d1 04 cpc r13, r1 173bc: 19 f0 breq .+6 ; 0x173c4 173be: c6 01 movw r24, r12 173c0: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 _progress++; 173c4: 81 e0 ldi r24, 0x01 ; 1 173c6: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 173c8: 4e 2d mov r20, r14 173ca: 50 e0 ldi r21, 0x00 ; 0 173cc: 44 0f add r20, r20 173ce: 55 1f adc r21, r21 173d0: 84 17 cp r24, r20 173d2: 15 06 cpc r1, r21 173d4: 0c f0 brlt .+2 ; 0x173d8 173d6: 80 e0 ldi r24, 0x00 ; 0 } 173d8: df 91 pop r29 173da: cf 91 pop r28 173dc: 1f 91 pop r17 173de: 0f 91 pop r16 173e0: ff 90 pop r15 173e2: ef 90 pop r14 173e4: df 90 pop r13 173e6: cf 90 pop r12 173e8: bf 90 pop r11 173ea: 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) 173ec: ca 30 cpi r28, 0x0A ; 10 173ee: 20 f7 brcc .-56 ; 0x173b8 { //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); 173f0: 41 e0 ldi r20, 0x01 ; 1 173f2: c4 30 cpi r28, 0x04 ; 4 173f4: 21 f0 breq .+8 ; 0x173fe 173f6: 42 e0 ldi r20, 0x02 ; 2 173f8: c3 30 cpi r28, 0x03 ; 3 173fa: 09 f4 brne .+2 ; 0x173fe 173fc: 40 e0 ldi r20, 0x00 ; 0 173fe: 0d 2f mov r16, r29 17400: 2e ef ldi r18, 0xFE ; 254 17402: 33 e8 ldi r19, 0x83 ; 131 17404: 62 e0 ldi r22, 0x02 ; 2 17406: 82 e0 ldi r24, 0x02 ; 2 17408: 0e 94 52 b2 call 0x164a4 ; 0x164a4 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1740c: 41 e0 ldi r20, 0x01 ; 1 1740e: c5 30 cpi r28, 0x05 ; 5 17410: 21 f0 breq .+8 ; 0x1741a 17412: 42 e0 ldi r20, 0x02 ; 2 17414: c5 30 cpi r28, 0x05 ; 5 17416: 08 f4 brcc .+2 ; 0x1741a 17418: 40 e0 ldi r20, 0x00 ; 0 1741a: 0d 2f mov r16, r29 1741c: 2c ef ldi r18, 0xFC ; 252 1741e: 33 e8 ldi r19, 0x83 ; 131 17420: 68 e0 ldi r22, 0x08 ; 8 17422: 82 e0 ldi r24, 0x02 ; 2 17424: 0e 94 52 b2 call 0x164a4 ; 0x164a4 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 17428: 41 e0 ldi r20, 0x01 ; 1 1742a: c6 30 cpi r28, 0x06 ; 6 1742c: 21 f0 breq .+8 ; 0x17436 1742e: 42 e0 ldi r20, 0x02 ; 2 17430: c6 30 cpi r28, 0x06 ; 6 17432: 08 f4 brcc .+2 ; 0x17436 17434: 40 e0 ldi r20, 0x00 ; 0 17436: 0d 2f mov r16, r29 17438: 2a ef ldi r18, 0xFA ; 250 1743a: 33 e8 ldi r19, 0x83 ; 131 1743c: 6e e0 ldi r22, 0x0E ; 14 1743e: 82 e0 ldi r24, 0x02 ; 2 17440: 0e 94 52 b2 call 0x164a4 ; 0x164a4 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 17444: 41 e0 ldi r20, 0x01 ; 1 17446: c7 30 cpi r28, 0x07 ; 7 17448: 21 f0 breq .+8 ; 0x17452 1744a: 42 e0 ldi r20, 0x02 ; 2 1744c: c7 30 cpi r28, 0x07 ; 7 1744e: 08 f4 brcc .+2 ; 0x17452 17450: 40 e0 ldi r20, 0x00 ; 0 17452: 0d 2f mov r16, r29 17454: 26 ef ldi r18, 0xF6 ; 246 17456: 33 e8 ldi r19, 0x83 ; 131 17458: 60 e0 ldi r22, 0x00 ; 0 1745a: 83 e0 ldi r24, 0x03 ; 3 1745c: 0e 94 52 b2 call 0x164a4 ; 0x164a4 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 17460: 41 e0 ldi r20, 0x01 ; 1 17462: c8 30 cpi r28, 0x08 ; 8 17464: 21 f0 breq .+8 ; 0x1746e 17466: 42 e0 ldi r20, 0x02 ; 2 17468: c8 30 cpi r28, 0x08 ; 8 1746a: 08 f4 brcc .+2 ; 0x1746e 1746c: 40 e0 ldi r20, 0x00 ; 0 1746e: 0d 2f mov r16, r29 17470: 2f ee ldi r18, 0xEF ; 239 17472: 33 e8 ldi r19, 0x83 ; 131 17474: 69 e0 ldi r22, 0x09 ; 9 17476: 83 e0 ldi r24, 0x03 ; 3 17478: 0e 94 52 b2 call 0x164a4 ; 0x164a4 1747c: 9d cf rjmp .-198 ; 0x173b8 0001747e : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1747e: cf 93 push r28 17480: 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) 17482: 80 91 64 03 lds r24, 0x0364 ; 0x800364 17486: 81 11 cpse r24, r1 17488: 18 c0 rjmp .+48 ; 0x174ba { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1748a: 60 91 98 03 lds r22, 0x0398 ; 0x800398 1748e: 8b e0 ldi r24, 0x0B ; 11 17490: 68 9f mul r22, r24 17492: b0 01 movw r22, r0 17494: 11 24 eor r1, r1 17496: 67 5b subi r22, 0xB7 ; 183 17498: 72 4f sbci r23, 0xF2 ; 242 1749a: 47 e0 ldi r20, 0x07 ; 7 1749c: 50 e0 ldi r21, 0x00 ; 0 1749e: 86 e6 ldi r24, 0x66 ; 102 174a0: 93 e0 ldi r25, 0x03 ; 3 174a2: 0f 94 2c a1 call 0x34258 ; 0x34258 lcd_encoder = menuData->name[0]; 174a6: 80 91 66 03 lds r24, 0x0366 ; 0x800366 174aa: 90 e0 ldi r25, 0x00 ; 0 174ac: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174b0: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->initialized = true; 174b4: 81 e0 ldi r24, 0x01 ; 1 174b6: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 174ba: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174be: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174c2: 80 97 sbiw r24, 0x20 ; 32 174c4: 34 f4 brge .+12 ; 0x174d2 174c6: 80 e2 ldi r24, 0x20 ; 32 174c8: 90 e0 ldi r25, 0x00 ; 0 174ca: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174ce: 80 93 06 05 sts 0x0506, r24 ; 0x800506 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 174d2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174d6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174da: 8f 3f cpi r24, 0xFF ; 255 174dc: 91 05 cpc r25, r1 174de: 39 f0 breq .+14 ; 0x174ee 174e0: 34 f0 brlt .+12 ; 0x174ee 174e2: 8f ef ldi r24, 0xFF ; 255 174e4: 90 e0 ldi r25, 0x00 ; 0 174e6: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174ea: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->name[menuData->selected] = lcd_encoder; 174ee: e0 91 65 03 lds r30, 0x0365 ; 0x800365 174f2: f0 e0 ldi r31, 0x00 ; 0 174f4: ec 59 subi r30, 0x9C ; 156 174f6: fc 4f sbci r31, 0xFC ; 252 174f8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174fc: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 174fe: 0e 94 28 6a call 0xd450 ; 0xd450 17502: c6 e6 ldi r28, 0x66 ; 102 17504: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 17506: 89 91 ld r24, Y+ 17508: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 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) 1750c: 83 e0 ldi r24, 0x03 ; 3 1750e: cd 36 cpi r28, 0x6D ; 109 17510: d8 07 cpc r29, r24 17512: c9 f7 brne .-14 ; 0x17506 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 17514: 4e e5 ldi r20, 0x5E ; 94 17516: 61 e0 ldi r22, 0x01 ; 1 17518: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1751c: 0e 94 1c 6a call 0xd438 ; 0xd438 if (menuData->selected > 0) 17520: 80 91 65 03 lds r24, 0x0365 ; 0x800365 17524: 88 23 and r24, r24 17526: 29 f0 breq .+10 ; 0x17532 { lcd_putc_at(menuData->selected-1, 1, ' '); 17528: 40 e2 ldi r20, 0x20 ; 32 1752a: 61 e0 ldi r22, 0x01 ; 1 1752c: 81 50 subi r24, 0x01 ; 1 1752e: 0e 94 1c 6a call 0xd438 ; 0xd438 } if (lcd_clicked()) 17532: 0e 94 19 6c call 0xd832 ; 0xd832 17536: 88 23 and r24, r24 17538: 99 f0 breq .+38 ; 0x17560 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1753a: e0 91 65 03 lds r30, 0x0365 ; 0x800365 1753e: 8e 2f mov r24, r30 17540: 90 e0 ldi r25, 0x00 ; 0 17542: 01 96 adiw r24, 0x01 ; 1 17544: 07 97 sbiw r24, 0x07 ; 7 17546: 78 f4 brcc .+30 ; 0x17566 { lcd_encoder = menuData->name[++(menuData->selected)]; 17548: ef 5f subi r30, 0xFF ; 255 1754a: e0 93 65 03 sts 0x0365, r30 ; 0x800365 1754e: f0 e0 ldi r31, 0x00 ; 0 17550: ec 59 subi r30, 0x9C ; 156 17552: fc 4f sbci r31, 0xFC ; 252 17554: 82 81 ldd r24, Z+2 ; 0x02 17556: 90 e0 ldi r25, 0x00 ; 0 17558: 90 93 07 05 sts 0x0507, r25 ; 0x800507 1755c: 80 93 06 05 sts 0x0506, r24 ; 0x800506 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17560: df 91 pop r29 17562: cf 91 pop r28 17564: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 17566: 60 91 98 03 lds r22, 0x0398 ; 0x800398 1756a: 8b e0 ldi r24, 0x0B ; 11 1756c: 68 9f mul r22, r24 1756e: b0 01 movw r22, r0 17570: 11 24 eor r1, r1 17572: 67 5b subi r22, 0xB7 ; 183 17574: 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); 17576: 47 e0 ldi r20, 0x07 ; 7 17578: 50 e0 ldi r21, 0x00 ; 0 1757a: 86 e6 ldi r24, 0x66 ; 102 1757c: 93 e0 ldi r25, 0x03 ; 3 1757e: 0f 94 50 a1 call 0x342a0 ; 0x342a0 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17582: df 91 pop r29 17584: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 17586: 0d 94 e4 96 jmp 0x32dc8 ; 0x32dc8 0001758a : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1758a: 0f 94 a2 49 call 0x29344 ; 0x29344 #endif menu_top = 0; 1758e: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 17592: 10 92 07 05 sts 0x0507, r1 ; 0x800507 17596: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 1759a: 0d 94 3e 94 jmp 0x3287c ; 0x3287c 0001759e : } } void CardReader::updir() { if(workDirDepth > 0) 1759e: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 175a2: 88 23 and r24, r24 175a4: f9 f0 breq .+62 ; 0x175e4 { --workDirDepth; 175a6: 81 50 subi r24, 0x01 ; 1 175a8: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDir = workDirParents[0]; 175ac: 93 e2 ldi r25, 0x23 ; 35 175ae: e8 e3 ldi r30, 0x38 ; 56 175b0: f4 e1 ldi r31, 0x14 ; 20 175b2: a5 e1 ldi r26, 0x15 ; 21 175b4: b4 e1 ldi r27, 0x14 ; 20 175b6: 01 90 ld r0, Z+ 175b8: 0d 92 st X+, r0 175ba: 9a 95 dec r25 175bc: e1 f7 brne .-8 ; 0x175b6 175be: 28 e3 ldi r18, 0x38 ; 56 175c0: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 175c2: 90 e0 ldi r25, 0x00 ; 0 175c4: 98 17 cp r25, r24 175c6: 60 f4 brcc .+24 ; 0x175e0 { workDirParents[d] = workDirParents[d+1]; 175c8: 43 e2 ldi r20, 0x23 ; 35 175ca: f9 01 movw r30, r18 175cc: b3 96 adiw r30, 0x23 ; 35 175ce: d9 01 movw r26, r18 175d0: 01 90 ld r0, Z+ 175d2: 0d 92 st X+, r0 175d4: 4a 95 dec r20 175d6: e1 f7 brne .-8 ; 0x175d0 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 175d8: 9f 5f subi r25, 0xFF ; 255 175da: 2d 5d subi r18, 0xDD ; 221 175dc: 3f 4f sbci r19, 0xFF ; 255 175de: f2 cf rjmp .-28 ; 0x175c4 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 175e0: 0f 94 a2 49 call 0x29344 ; 0x29344 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 175e4: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 175e8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175ec: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175f0: 0d 94 3e 94 jmp 0x3287c ; 0x3287c 000175f4 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 175f4: bf 92 push r11 175f6: cf 92 push r12 175f8: df 92 push r13 175fa: ef 92 push r14 175fc: ff 92 push r15 175fe: 0f 93 push r16 17600: 1f 93 push r17 17602: cf 93 push r28 17604: df 93 push r29 17606: 00 d0 rcall .+0 ; 0x17608 17608: 1f 92 push r1 1760a: cd b7 in r28, 0x3d ; 61 1760c: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1760e: 8c ea ldi r24, 0xAC ; 172 17610: 9d e0 ldi r25, 0x0D ; 13 17612: 0f 94 3c a1 call 0x34278 ; 0x34278 17616: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 17618: 8b ea ldi r24, 0xAB ; 171 1761a: 9d e0 ldi r25, 0x0D ; 13 1761c: 0f 94 3c a1 call 0x34278 ; 0x34278 17620: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 17622: 8a ea ldi r24, 0xAA ; 170 17624: 9d e0 ldi r25, 0x0D ; 13 17626: 0f 94 3c a1 call 0x34278 ; 0x34278 1762a: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1762c: 0f 94 1c 94 call 0x32838 ; 0x32838 17630: 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'; 17634: 80 e3 ldi r24, 0x30 ; 48 17636: d8 2e mov r13, r24 17638: df 0c add r13, r15 sToggle[1] = 'x'; 1763a: 98 e7 ldi r25, 0x78 ; 120 1763c: 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'; 1763e: 20 e3 ldi r18, 0x30 ; 48 17640: e2 2e mov r14, r18 17642: 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(); 17644: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17648: 84 30 cpi r24, 0x04 ; 4 1764a: 08 f0 brcs .+2 ; 0x1764e 1764c: 56 c0 rjmp .+172 ; 0x176fa 1764e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 17652: 0f 94 9c 92 call 0x32538 ; 0x32538 17656: 88 23 and r24, r24 17658: 31 f0 breq .+12 ; 0x17666 1765a: 87 e0 ldi r24, 0x07 ; 7 1765c: f8 12 cpse r15, r24 1765e: 03 c0 rjmp .+6 ; 0x17666 17660: 81 e0 ldi r24, 0x01 ; 1 17662: 0f 94 f7 2f call 0x25fee ; 0x25fee // 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)); 17666: 88 ef ldi r24, 0xF8 ; 248 17668: 9d e3 ldi r25, 0x3D ; 61 1766a: 0e 94 32 6d call 0xda64 ; 0xda64 1766e: 0f 94 e7 96 call 0x32dce ; 0x32dce sToggle[0] = points_nr + '0'; 17672: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 17674: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 17676: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 17678: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1767a: 81 ef ldi r24, 0xF1 ; 241 1767c: 9d e3 ldi r25, 0x3D ; 61 1767e: 0e 94 32 6d call 0xda64 ; 0xda64 17682: 20 e0 ldi r18, 0x00 ; 0 17684: 47 e2 ldi r20, 0x27 ; 39 17686: 53 eb ldi r21, 0xB3 ; 179 17688: be 01 movw r22, r28 1768a: 6f 5f subi r22, 0xFF ; 255 1768c: 7f 4f sbci r23, 0xFF ; 255 1768e: 0f 94 ab 95 call 0x32b56 ; 0x32b56 sToggle[0] = mbl_z_probe_nr + '0'; 17692: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 17694: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 17696: 83 ee ldi r24, 0xE3 ; 227 17698: 9d e3 ldi r25, 0x3D ; 61 1769a: 0e 94 32 6d call 0xda64 ; 0xda64 1769e: 20 e0 ldi r18, 0x00 ; 0 176a0: 48 e1 ldi r20, 0x18 ; 24 176a2: 53 eb ldi r21, 0xB3 ; 179 176a4: be 01 movw r22, r28 176a6: 6f 5f subi r22, 0xFF ; 255 176a8: 7f 4f sbci r23, 0xFF ; 255 176aa: 0f 94 ab 95 call 0x32b56 ; 0x32b56 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); 176ae: 87 e0 ldi r24, 0x07 ; 7 176b0: f8 12 cpse r15, r24 176b2: 20 c0 rjmp .+64 ; 0x176f4 176b4: 81 e7 ldi r24, 0x71 ; 113 176b6: 9b e5 ldi r25, 0x5B ; 91 176b8: c1 10 cpse r12, r1 176ba: 02 c0 rjmp .+4 ; 0x176c0 176bc: 8b e6 ldi r24, 0x6B ; 107 176be: 9b e5 ldi r25, 0x5B ; 91 176c0: 0e 94 32 6d call 0xda64 ; 0xda64 176c4: 8c 01 movw r16, r24 176c6: 8d ec ldi r24, 0xCD ; 205 176c8: 9d e3 ldi r25, 0x3D ; 61 176ca: 0e 94 32 6d call 0xda64 ; 0xda64 176ce: 22 e0 ldi r18, 0x02 ; 2 176d0: 43 e3 ldi r20, 0x33 ; 51 176d2: 53 eb ldi r21, 0xB3 ; 179 176d4: b8 01 movw r22, r16 176d6: 0f 94 ab 95 call 0x32b56 ; 0x32b56 MENU_END(); 176da: 0f 94 f0 93 call 0x327e0 ; 0x327e0 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(); 176de: 90 91 2e 04 lds r25, 0x042E ; 0x80042e 176e2: 9f 5f subi r25, 0xFF ; 255 176e4: 90 93 2e 04 sts 0x042E, r25 ; 0x80042e 176e8: 90 91 30 04 lds r25, 0x0430 ; 0x800430 176ec: 9f 5f subi r25, 0xFF ; 255 176ee: 90 93 30 04 sts 0x0430, r25 ; 0x800430 176f2: a8 cf rjmp .-176 ; 0x17644 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); 176f4: 8d ed ldi r24, 0xDD ; 221 176f6: 9d e3 ldi r25, 0x3D ; 61 176f8: e3 cf rjmp .-58 ; 0x176c0 MENU_END(); } 176fa: 0f 90 pop r0 176fc: 0f 90 pop r0 176fe: 0f 90 pop r0 17700: 0f 90 pop r0 17702: df 91 pop r29 17704: cf 91 pop r28 17706: 1f 91 pop r17 17708: 0f 91 pop r16 1770a: ff 90 pop r15 1770c: ef 90 pop r14 1770e: df 90 pop r13 17710: cf 90 pop r12 17712: bf 90 pop r11 17714: 08 95 ret 00017716 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 17716: cf 93 push r28 MENU_BEGIN(); 17718: 0f 94 1c 94 call 0x32838 ; 0x32838 1771c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17720: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17724: 84 30 cpi r24, 0x04 ; 4 17726: 60 f5 brcc .+88 ; 0x17780 17728: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1772c: 8a e5 ldi r24, 0x5A ; 90 1772e: 9e e3 ldi r25, 0x3E ; 62 17730: 0e 94 32 6d call 0xda64 ; 0xda64 17734: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 17738: 87 ee ldi r24, 0xE7 ; 231 1773a: 9b e3 ldi r25, 0x3B ; 59 1773c: 0e 94 32 6d call 0xda64 ; 0xda64 17740: 6f e7 ldi r22, 0x7F ; 127 17742: 7c eb ldi r23, 0xBC ; 188 17744: 0f 94 99 93 call 0x32732 ; 0x32732 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17748: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1774a: 8c ea ldi r24, 0xAC ; 172 1774c: 9c e3 ldi r25, 0x3C ; 60 1774e: 0e 94 32 6d call 0xda64 ; 0xda64 17752: 61 e3 ldi r22, 0x31 ; 49 17754: 6c 0f add r22, r28 17756: 2c 2f mov r18, r28 17758: 4e e8 ldi r20, 0x8E ; 142 1775a: 5c eb ldi r21, 0xBC ; 188 1775c: 0f 94 42 93 call 0x32684 ; 0x32684 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++) 17760: cf 5f subi r28, 0xFF ; 255 17762: c5 30 cpi r28, 0x05 ; 5 17764: 91 f7 brne .-28 ; 0x1774a MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 17766: 0f 94 f0 93 call 0x327e0 ; 0x327e0 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1776a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1776e: 8f 5f subi r24, 0xFF ; 255 17770: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17774: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17778: 8f 5f subi r24, 0xFF ; 255 1777a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1777e: d0 cf rjmp .-96 ; 0x17720 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(); } 17780: cf 91 pop r28 17782: 08 95 ret 00017784 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 17784: 84 e0 ldi r24, 0x04 ; 4 17786: 0d 94 77 31 jmp 0x262ee ; 0x262ee 0001778a : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1778a: 85 e0 ldi r24, 0x05 ; 5 1778c: 0d 94 77 31 jmp 0x262ee ; 0x262ee 00017790 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 17790: 86 e0 ldi r24, 0x06 ; 6 17792: 0d 94 77 31 jmp 0x262ee ; 0x262ee 00017796 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 17796: 87 e0 ldi r24, 0x07 ; 7 17798: 0d 94 77 31 jmp 0x262ee ; 0x262ee 0001779c : 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); 1779c: 88 e0 ldi r24, 0x08 ; 8 1779e: 0d 94 77 31 jmp 0x262ee ; 0x262ee 000177a2 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 177a2: 60 91 98 03 lds r22, 0x0398 ; 0x800398 177a6: 81 ea ldi r24, 0xA1 ; 161 177a8: 9d e0 ldi r25, 0x0D ; 13 177aa: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 177ae: 83 e0 ldi r24, 0x03 ; 3 177b0: 0d 94 c8 96 jmp 0x32d90 ; 0x32d90 000177b4 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 177b4: cf 93 push r28 MENU_BEGIN(); 177b6: 0f 94 1c 94 call 0x32838 ; 0x32838 177ba: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 177be: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 177c2: 84 30 cpi r24, 0x04 ; 4 177c4: 88 f5 brcc .+98 ; 0x17828 177c6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 177ca: 0f 94 9c 92 call 0x32538 ; 0x32538 177ce: 81 11 cpse r24, r1 177d0: 0f 94 63 0c call 0x218c6 ; 0x218c6 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 177d4: 8a e5 ldi r24, 0x5A ; 90 177d6: 9e e3 ldi r25, 0x3E ; 62 177d8: 0e 94 32 6d call 0xda64 ; 0xda64 177dc: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 177e0: 87 ee ldi r24, 0xE7 ; 231 177e2: 9b e3 ldi r25, 0x3B ; 59 177e4: 0e 94 32 6d call 0xda64 ; 0xda64 177e8: 6d ee ldi r22, 0xED ; 237 177ea: 76 ef ldi r23, 0xF6 ; 246 177ec: 0f 94 99 93 call 0x32732 ; 0x32732 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 177f0: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 177f2: 8c ea ldi r24, 0xAC ; 172 177f4: 9c e3 ldi r25, 0x3C ; 60 177f6: 0e 94 32 6d call 0xda64 ; 0xda64 177fa: 61 e3 ldi r22, 0x31 ; 49 177fc: 6c 0f add r22, r28 177fe: 2c 2f mov r18, r28 17800: 48 ed ldi r20, 0xD8 ; 216 17802: 56 ef ldi r21, 0xF6 ; 246 17804: 0f 94 42 93 call 0x32684 ; 0x32684 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++) 17808: cf 5f subi r28, 0xFF ; 255 1780a: c5 30 cpi r28, 0x05 ; 5 1780c: 91 f7 brne .-28 ; 0x177f2 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1780e: 0f 94 f0 93 call 0x327e0 ; 0x327e0 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 17812: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17816: 8f 5f subi r24, 0xFF ; 255 17818: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1781c: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17820: 8f 5f subi r24, 0xFF ; 255 17822: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17826: cb cf rjmp .-106 ; 0x177be 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(); } 17828: cf 91 pop r28 1782a: 08 95 ret 0001782c : } // 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)) { 1782c: ef 92 push r14 1782e: ff 92 push r15 17830: 0f 93 push r16 17832: 1f 93 push r17 17834: cf 93 push r28 17836: 8c 01 movw r16, r24 17838: 7b 01 movw r14, r22 MENU_BEGIN(); 1783a: 0f 94 1c 94 call 0x32838 ; 0x32838 1783e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17842: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17846: 84 30 cpi r24, 0x04 ; 4 17848: 28 f5 brcc .+74 ; 0x17894 1784a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 1784e: 0f 94 9c 92 call 0x32538 ; 0x32538 17852: 81 11 cpse r24, r1 17854: 0f 94 63 0c call 0x218c6 ; 0x218c6 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17858: 8a e5 ldi r24, 0x5A ; 90 1785a: 9e e3 ldi r25, 0x3E ; 62 1785c: 0e 94 32 6d call 0xda64 ; 0xda64 17860: 0f 94 e7 96 call 0x32dce ; 0x32dce for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17864: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 17866: 61 e3 ldi r22, 0x31 ; 49 17868: 6c 0f add r22, r28 1786a: 2c 2f mov r18, r28 1786c: a7 01 movw r20, r14 1786e: c8 01 movw r24, r16 17870: 0f 94 42 93 call 0x32684 ; 0x32684 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17874: cf 5f subi r28, 0xFF ; 255 17876: c5 30 cpi r28, 0x05 ; 5 17878: b1 f7 brne .-20 ; 0x17866 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1787a: 0f 94 f0 93 call 0x327e0 ; 0x327e0 // 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(); 1787e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17882: 8f 5f subi r24, 0xFF ; 255 17884: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17888: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1788c: 8f 5f subi r24, 0xFF ; 255 1788e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17892: d7 cf rjmp .-82 ; 0x17842 ); 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(); } 17894: cf 91 pop r28 17896: 1f 91 pop r17 17898: 0f 91 pop r16 1789a: ff 90 pop r15 1789c: ef 90 pop r14 1789e: 08 95 ret 000178a0 : 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); 178a0: 84 ea ldi r24, 0xA4 ; 164 178a2: 9a e5 ldi r25, 0x5A ; 90 178a4: 0e 94 32 6d call 0xda64 ; 0xda64 178a8: 68 e6 ldi r22, 0x68 ; 104 178aa: 7c eb ldi r23, 0xBC ; 188 178ac: 0c 94 16 bc jmp 0x1782c ; 0x1782c 000178b0 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 178b0: 83 eb ldi r24, 0xB3 ; 179 178b2: 9a e5 ldi r25, 0x5A ; 90 178b4: 0e 94 32 6d call 0xda64 ; 0xda64 178b8: 64 e7 ldi r22, 0x74 ; 116 178ba: 7c eb ldi r23, 0xBC ; 188 178bc: 0c 94 16 bc jmp 0x1782c ; 0x1782c 000178c0 : 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); 178c0: 8c ea ldi r24, 0xAC ; 172 178c2: 9c e3 ldi r25, 0x3C ; 60 178c4: 0e 94 32 6d call 0xda64 ; 0xda64 178c8: 67 e7 ldi r22, 0x77 ; 119 178ca: 77 ef ldi r23, 0xF7 ; 247 178cc: 0c 94 16 bc jmp 0x1782c ; 0x1782c 000178d0 : 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){ 178d0: cf 93 push r28 178d2: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 178d4: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 178d8: 88 23 and r24, r24 178da: 21 f0 breq .+8 ; 0x178e4 178dc: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 178de: cf 91 pop r28 178e0: 0d 94 cb 6c jmp 0x2d996 ; 0x2d996 178e4: cf 91 pop r28 178e6: 08 95 ret 000178e8 : 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) { 178e8: cf 93 push r28 178ea: c8 2f mov r28, r24 menu_back(); 178ec: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 MMU2::mmu2.eject_filament(filament, true); 178f0: 61 e0 ldi r22, 0x01 ; 1 178f2: 8c 2f mov r24, r28 178f4: 0f 94 4e 6c call 0x2d89c ; 0x2d89c // Clear the filament action clearFilamentAction(); } 178f8: 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(); 178fa: 0d 94 63 0c jmp 0x218c6 ; 0x218c6 000178fe : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 178fe: 80 e0 ldi r24, 0x00 ; 0 17900: 0f 94 0b 6c call 0x2d816 ; 0x2d816 17904: 81 e0 ldi r24, 0x01 ; 1 17906: 0f 94 0b 6c call 0x2d816 ; 0x2d816 1790a: 82 e0 ldi r24, 0x02 ; 2 1790c: 0f 94 0b 6c call 0x2d816 ; 0x2d816 17910: 83 e0 ldi r24, 0x03 ; 3 17912: 0f 94 0b 6c call 0x2d816 ; 0x2d816 17916: 84 e0 ldi r24, 0x04 ; 4 17918: 0d 94 0b 6c jmp 0x2d816 ; 0x2d816 0001791c : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1791c: 0d 94 0b 6c jmp 0x2d816 ; 0x2d816 00017920 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17920: 80 e0 ldi r24, 0x00 ; 0 17922: 0d 94 bd 63 jmp 0x2c77a ; 0x2c77a 00017926 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 17926: 0f 94 1c 94 call 0x32838 ; 0x32838 1792a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1792e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17932: 84 30 cpi r24, 0x04 ; 4 17934: 08 f0 brcs .+2 ; 0x17938 17936: 45 c0 rjmp .+138 ; 0x179c2 17938: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1793c: 8f ee ldi r24, 0xEF ; 239 1793e: 9a e3 ldi r25, 0x3A ; 58 17940: 0e 94 32 6d call 0xda64 ; 0xda64 17944: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 17948: 60 e2 ldi r22, 0x20 ; 32 1794a: 75 eb ldi r23, 0xB5 ; 181 1794c: 89 e4 ldi r24, 0x49 ; 73 1794e: 9d e0 ldi r25, 0x0D ; 13 17950: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 17954: 6b e1 ldi r22, 0x1B ; 27 17956: 75 eb ldi r23, 0xB5 ; 181 17958: 84 e5 ldi r24, 0x54 ; 84 1795a: 9d e0 ldi r25, 0x0D ; 13 1795c: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 17960: 66 e1 ldi r22, 0x16 ; 22 17962: 75 eb ldi r23, 0xB5 ; 181 17964: 8f e5 ldi r24, 0x5F ; 95 17966: 9d e0 ldi r25, 0x0D ; 13 17968: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1796c: 61 e1 ldi r22, 0x11 ; 17 1796e: 75 eb ldi r23, 0xB5 ; 181 17970: 8a e6 ldi r24, 0x6A ; 106 17972: 9d e0 ldi r25, 0x0D ; 13 17974: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 17978: 6c e0 ldi r22, 0x0C ; 12 1797a: 75 eb ldi r23, 0xB5 ; 181 1797c: 85 e7 ldi r24, 0x75 ; 117 1797e: 9d e0 ldi r25, 0x0D ; 13 17980: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 17984: 67 e0 ldi r22, 0x07 ; 7 17986: 75 eb ldi r23, 0xB5 ; 181 17988: 80 e8 ldi r24, 0x80 ; 128 1798a: 9d e0 ldi r25, 0x0D ; 13 1798c: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 17990: 62 e0 ldi r22, 0x02 ; 2 17992: 75 eb ldi r23, 0xB5 ; 181 17994: 8b e8 ldi r24, 0x8B ; 139 17996: 9d e0 ldi r25, 0x0D ; 13 17998: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 1799c: 6d ef ldi r22, 0xFD ; 253 1799e: 74 eb ldi r23, 0xB4 ; 180 179a0: 86 e9 ldi r24, 0x96 ; 150 179a2: 9d e0 ldi r25, 0x0D ; 13 179a4: 0f 94 4a 96 call 0x32c94 ; 0x32c94 MENU_END(); 179a8: 0f 94 f0 93 call 0x327e0 ; 0x327e0 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 179ac: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 179b0: 8f 5f subi r24, 0xFF ; 255 179b2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 179b6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 179ba: 8f 5f subi r24, 0xFF ; 255 179bc: 80 93 30 04 sts 0x0430, r24 ; 0x800430 179c0: b6 cf rjmp .-148 ; 0x1792e 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(); } 179c2: 08 95 ret 000179c4 : //! //! @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) 179c4: 4f 92 push r4 179c6: 5f 92 push r5 179c8: 6f 92 push r6 179ca: 7f 92 push r7 179cc: 8f 92 push r8 179ce: 9f 92 push r9 179d0: af 92 push r10 179d2: bf 92 push r11 179d4: cf 92 push r12 179d6: df 92 push r13 179d8: ef 92 push r14 179da: ff 92 push r15 179dc: 0f 93 push r16 179de: 1f 93 push r17 179e0: cf 93 push r28 179e2: df 93 push r29 179e4: 6c 01 movw r12, r24 179e6: 7b 01 movw r14, r22 179e8: 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); 179ec: 67 2b or r22, r23 179ee: 29 f0 breq .+10 ; 0x179fa 179f0: 06 e0 ldi r16, 0x06 ; 6 179f2: 81 30 cpi r24, 0x01 ; 1 179f4: 29 f0 breq .+10 ; 0x17a00 179f6: 05 e0 ldi r16, 0x05 ; 5 179f8: 03 c0 rjmp .+6 ; 0x17a00 179fa: 04 e0 ldi r16, 0x04 ; 4 179fc: 81 30 cpi r24, 0x01 ; 1 179fe: d9 f3 breq .-10 ; 0x179f6 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 17a00: 0e 94 2f 6a call 0xd45e ; 0xd45e KEEPALIVE_STATE(PAUSED_FOR_USER); 17a04: 84 e0 ldi r24, 0x04 ; 4 17a06: 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; 17a0a: 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; 17a0c: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 17a0e: 03 50 subi r16, 0x03 ; 3 17a10: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 17a12: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 17a16: 81 e0 ldi r24, 0x01 ; 1 17a18: 0e 94 89 7a call 0xf512 ; 0xf512 if (lcd_encoder) 17a1c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17a20: 90 91 07 05 lds r25, 0x0507 ; 0x800507 17a24: 00 97 sbiw r24, 0x00 ; 0 17a26: 09 f4 brne .+2 ; 0x17a2a 17a28: 9d c0 rjmp .+314 ; 0x17b64 { if (lcd_encoder < 0) 17a2a: 97 ff sbrs r25, 7 17a2c: 88 c0 rjmp .+272 ; 0x17b3e { cursor_pos--; 17a2e: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 17a30: 10 92 07 05 sts 0x0507, r1 ; 0x800507 17a34: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } if (cursor_pos > 3) 17a38: c4 30 cpi r28, 0x04 ; 4 17a3a: 0c f4 brge .+2 ; 0x17a3e 17a3c: 86 c0 rjmp .+268 ; 0x17b4a { cursor_pos = 3; if (first < items_no - 3) 17a3e: 88 2d mov r24, r8 17a40: 08 2c mov r0, r8 17a42: 00 0c add r0, r0 17a44: 99 0b sbc r25, r25 17a46: 80 17 cp r24, r16 17a48: 91 07 cpc r25, r17 17a4a: 0c f0 brlt .+2 ; 0x17a4e 17a4c: 7a c0 rjmp .+244 ; 0x17b42 { first++; 17a4e: 83 94 inc r8 lcd_clear(); 17a50: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 17a54: 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); 17a56: c1 14 cp r12, r1 17a58: d1 04 cpc r13, r1 17a5a: 29 f0 breq .+10 ; 0x17a66 17a5c: a6 01 movw r20, r12 17a5e: 60 e0 ldi r22, 0x00 ; 0 17a60: 80 e0 ldi r24, 0x00 ; 0 17a62: 0e 94 10 6a call 0xd420 ; 0xd420 const bool last_visible = (first == items_no - 3); 17a66: a8 2c mov r10, r8 17a68: 08 2c mov r0, r8 17a6a: 00 0c add r0, r0 17a6c: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 17a6e: e1 14 cp r14, r1 17a70: f1 04 cpc r15, r1 17a72: 29 f0 breq .+10 ; 0x17a7e 17a74: 82 e0 ldi r24, 0x02 ; 2 17a76: 98 2e mov r9, r24 17a78: a0 16 cp r10, r16 17a7a: b1 06 cpc r11, r17 17a7c: 11 f0 breq .+4 ; 0x17a82 17a7e: 93 e0 ldi r25, 0x03 ; 3 17a80: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 17a82: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 17a84: df 5f subi r29, 0xFF ; 255 17a86: 48 ed ldi r20, 0xD8 ; 216 17a88: 59 e6 ldi r21, 0x69 ; 105 17a8a: 6d 2f mov r22, r29 17a8c: 81 e0 ldi r24, 0x01 ; 1 17a8e: 0e 94 10 6a call 0xd420 ; 0xd420 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++) 17a92: 9d 12 cpse r9, r29 17a94: f7 cf rjmp .-18 ; 0x17a84 17a96: 48 2c mov r4, r8 17a98: 08 2c mov r0, r8 17a9a: 00 0c add r0, r0 17a9c: 55 08 sbc r5, r5 17a9e: 66 08 sbc r6, r6 17aa0: 77 08 sbc r7, r7 17aa2: 8f ef ldi r24, 0xFF ; 255 17aa4: 48 1a sub r4, r24 17aa6: 58 0a sbc r5, r24 17aa8: 68 0a sbc r6, r24 17aaa: 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++) 17aac: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 17aae: 93 94 inc r9 17ab0: 69 2d mov r22, r9 17ab2: 8a e0 ldi r24, 0x0A ; 10 17ab4: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 17ab8: c3 01 movw r24, r6 17aba: b2 01 movw r22, r4 17abc: 0e 94 b5 6b call 0xd76a ; 0xd76a 17ac0: 8f ef ldi r24, 0xFF ; 255 17ac2: 48 1a sub r4, r24 17ac4: 58 0a sbc r5, r24 17ac6: 68 0a sbc r6, r24 17ac8: 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++) 17aca: d9 11 cpse r29, r9 17acc: f0 cf rjmp .-32 ; 0x17aae { 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); 17ace: e1 14 cp r14, r1 17ad0: f1 04 cpc r15, r1 17ad2: 41 f0 breq .+16 ; 0x17ae4 17ad4: a0 16 cp r10, r16 17ad6: b1 06 cpc r11, r17 17ad8: 29 f4 brne .+10 ; 0x17ae4 17ada: a7 01 movw r20, r14 17adc: 63 e0 ldi r22, 0x03 ; 3 17ade: 81 e0 ldi r24, 0x01 ; 1 17ae0: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 17ae4: 47 eb ldi r20, 0xB7 ; 183 17ae6: 57 e8 ldi r21, 0x87 ; 135 17ae8: 61 e0 ldi r22, 0x01 ; 1 17aea: 80 e0 ldi r24, 0x00 ; 0 17aec: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_putc_at(0, cursor_pos, '>'); 17af0: 4e e3 ldi r20, 0x3E ; 62 17af2: 6c 2f mov r22, r28 17af4: 80 e0 ldi r24, 0x00 ; 0 17af6: 0e 94 1c 6a call 0xd438 ; 0xd438 _delay(100); 17afa: 64 e6 ldi r22, 0x64 ; 100 17afc: 70 e0 ldi r23, 0x00 ; 0 17afe: 80 e0 ldi r24, 0x00 ; 0 17b00: 90 e0 ldi r25, 0x00 ; 0 17b02: 0f 94 d5 0d call 0x21baa ; 0x21baa if (lcd_clicked()) 17b06: 0e 94 19 6c call 0xd832 ; 0xd832 17b0a: 88 23 and r24, r24 17b0c: 09 f4 brne .+2 ; 0x17b10 17b0e: 81 cf rjmp .-254 ; 0x17a12 { KEEPALIVE_STATE(IN_HANDLER); 17b10: 82 e0 ldi r24, 0x02 ; 2 17b12: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 17b16: 8f ef ldi r24, 0xFF ; 255 17b18: 8c 0f add r24, r28 17b1a: 88 0d add r24, r8 } } } 17b1c: df 91 pop r29 17b1e: cf 91 pop r28 17b20: 1f 91 pop r17 17b22: 0f 91 pop r16 17b24: ff 90 pop r15 17b26: ef 90 pop r14 17b28: df 90 pop r13 17b2a: cf 90 pop r12 17b2c: bf 90 pop r11 17b2e: af 90 pop r10 17b30: 9f 90 pop r9 17b32: 8f 90 pop r8 17b34: 7f 90 pop r7 17b36: 6f 90 pop r6 17b38: 5f 90 pop r5 17b3a: 4f 90 pop r4 17b3c: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 17b3e: cf 5f subi r28, 0xFF ; 255 17b40: 77 cf rjmp .-274 ; 0x17a30 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); 17b42: 87 e0 ldi r24, 0x07 ; 7 17b44: 0f 94 fd 2c call 0x259fa ; 0x259fa 17b48: 85 cf rjmp .-246 ; 0x17a54 } } if (cursor_pos < 1) 17b4a: c1 11 cpse r28, r1 17b4c: 84 cf rjmp .-248 ; 0x17a56 { cursor_pos = 1; if (first > 0) 17b4e: 18 14 cp r1, r8 17b50: 2c f4 brge .+10 ; 0x17b5c { first--; 17b52: 8a 94 dec r8 lcd_clear(); 17b54: 0e 94 2f 6a call 0xd45e ; 0xd45e } } if (cursor_pos < 1) { cursor_pos = 1; 17b58: c1 e0 ldi r28, 0x01 ; 1 17b5a: 7d cf rjmp .-262 ; 0x17a56 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 17b5c: 87 e0 ldi r24, 0x07 ; 7 17b5e: 0f 94 fd 2c call 0x259fa ; 0x259fa 17b62: fa cf rjmp .-12 ; 0x17b58 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 17b64: c4 30 cpi r28, 0x04 ; 4 17b66: 0c f0 brlt .+2 ; 0x17b6a 17b68: 6a cf rjmp .-300 ; 0x17a3e 17b6a: 75 cf rjmp .-278 ; 0x17a56 00017b6c : } #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) { 17b6c: 4f 92 push r4 17b6e: 5f 92 push r5 17b70: 6f 92 push r6 17b72: 7f 92 push r7 17b74: af 92 push r10 17b76: bf 92 push r11 17b78: cf 92 push r12 17b7a: df 92 push r13 17b7c: ef 92 push r14 17b7e: ff 92 push r15 17b80: 0f 93 push r16 17b82: 1f 93 push r17 17b84: cf 93 push r28 17b86: df 93 push r29 17b88: 24 e0 ldi r18, 0x04 ; 4 17b8a: 30 e0 ldi r19, 0x00 ; 0 17b8c: 41 e0 ldi r20, 0x01 ; 1 17b8e: 50 e0 ldi r21, 0x00 ; 0 17b90: d9 01 movw r26, r18 17b92: a4 52 subi r26, 0x24 ; 36 17b94: bd 47 sbci r27, 0x7D ; 125 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 17b96: fd 01 movw r30, r26 17b98: 65 91 lpm r22, Z+ 17b9a: 74 91 lpm r23, Z 17b9c: 86 17 cp r24, r22 17b9e: 97 07 cpc r25, r23 17ba0: 0c f0 brlt .+2 ; 0x17ba4 17ba2: 66 c0 rjmp .+204 ; 0x17c70 { celsius = PGM_RD_W((*tt)[i-1][1]) + 17ba4: 41 50 subi r20, 0x01 ; 1 17ba6: 51 09 sbc r21, r1 17ba8: 44 0f add r20, r20 17baa: 55 1f adc r21, r21 17bac: 44 0f add r20, r20 17bae: 55 1f adc r21, r21 17bb0: ea 01 movw r28, r20 17bb2: c2 52 subi r28, 0x22 ; 34 17bb4: dd 47 sbci r29, 0x7D ; 125 17bb6: fe 01 movw r30, r28 17bb8: 05 91 lpm r16, Z+ 17bba: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 17bbc: 44 52 subi r20, 0x24 ; 36 17bbe: 5d 47 sbci r21, 0x7D ; 125 17bc0: fa 01 movw r30, r20 17bc2: 65 91 lpm r22, Z+ 17bc4: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bc6: f9 01 movw r30, r18 17bc8: e2 52 subi r30, 0x22 ; 34 17bca: fd 47 sbci r31, 0x7D ; 125 17bcc: e5 90 lpm r14, Z+ 17bce: f4 90 lpm r15, Z 17bd0: fe 01 movw r30, r28 17bd2: c5 90 lpm r12, Z+ 17bd4: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 17bd6: fd 01 movw r30, r26 17bd8: c5 91 lpm r28, Z+ 17bda: d4 91 lpm r29, Z 17bdc: fa 01 movw r30, r20 17bde: a5 90 lpm r10, Z+ 17be0: 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])) * 17be2: 86 1b sub r24, r22 17be4: 97 0b sbc r25, r23 17be6: bc 01 movw r22, r24 17be8: 99 0f add r25, r25 17bea: 88 0b sbc r24, r24 17bec: 99 0b sbc r25, r25 17bee: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17bf2: 2b 01 movw r4, r22 17bf4: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bf6: b7 01 movw r22, r14 17bf8: 6c 19 sub r22, r12 17bfa: 7d 09 sbc r23, r13 17bfc: 07 2e mov r0, r23 17bfe: 00 0c add r0, r0 17c00: 88 0b sbc r24, r24 17c02: 99 0b sbc r25, r25 17c04: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17c08: 9b 01 movw r18, r22 17c0a: 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])) * 17c0c: c3 01 movw r24, r6 17c0e: b2 01 movw r22, r4 17c10: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17c14: 6b 01 movw r12, r22 17c16: 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])); 17c18: be 01 movw r22, r28 17c1a: 6a 19 sub r22, r10 17c1c: 7b 09 sbc r23, r11 17c1e: 07 2e mov r0, r23 17c20: 00 0c add r0, r0 17c22: 88 0b sbc r24, r24 17c24: 99 0b sbc r25, r25 17c26: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17c2a: 9b 01 movw r18, r22 17c2c: 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])) / 17c2e: c7 01 movw r24, r14 17c30: b6 01 movw r22, r12 17c32: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 17c36: 6b 01 movw r12, r22 17c38: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 17c3a: b8 01 movw r22, r16 17c3c: 11 0f add r17, r17 17c3e: 88 0b sbc r24, r24 17c40: 99 0b sbc r25, r25 17c42: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17c46: 9b 01 movw r18, r22 17c48: ac 01 movw r20, r24 17c4a: c7 01 movw r24, r14 17c4c: b6 01 movw r22, r12 17c4e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__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; } 17c52: df 91 pop r29 17c54: cf 91 pop r28 17c56: 1f 91 pop r17 17c58: 0f 91 pop r16 17c5a: ff 90 pop r15 17c5c: ef 90 pop r14 17c5e: df 90 pop r13 17c60: cf 90 pop r12 17c62: bf 90 pop r11 17c64: af 90 pop r10 17c66: 7f 90 pop r7 17c68: 6f 90 pop r6 17c6a: 5f 90 pop r5 17c6c: 4f 90 pop r4 17c6e: 08 95 ret 17c70: 4f 5f subi r20, 0xFF ; 255 17c72: 5f 4f sbci r21, 0xFF ; 255 17c74: 2c 5f subi r18, 0xFC ; 252 17c76: 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 17c7e: 88 cf rjmp .-240 ; 0x17b90 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 17c80: ea e5 ldi r30, 0x5A ; 90 17c82: f3 e8 ldi r31, 0x83 ; 131 17c84: 65 91 lpm r22, Z+ 17c86: 74 91 lpm r23, Z 17c88: 07 2e mov r0, r23 17c8a: 00 0c add r0, r0 17c8c: 88 0b sbc r24, r24 17c8e: 99 0b sbc r25, r25 17c90: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17c94: de cf rjmp .-68 ; 0x17c52 00017c96 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 17c96: 8f 92 push r8 17c98: 9f 92 push r9 17c9a: af 92 push r10 17c9c: bf 92 push r11 17c9e: cf 92 push r12 17ca0: df 92 push r13 17ca2: ef 92 push r14 17ca4: ff 92 push r15 17ca6: 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]) { 17caa: 88 23 and r24, r24 17cac: 09 f4 brne .+2 ; 0x17cb0 17cae: 9d c0 rjmp .+314 ; 0x17dea 17cb0: 91 11 cpse r25, r1 17cb2: 92 c0 rjmp .+292 ; 0x17dd8 st_synchronize(); 17cb4: 0f 94 a0 22 call 0x24540 ; 0x24540 set_destination_to_current(); 17cb8: 0e 94 b7 61 call 0xc36e ; 0xc36e current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 17cbc: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17cc0: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17cc4: 07 2e mov r0, r23 17cc6: 00 0c add r0, r0 17cc8: 88 0b sbc r24, r24 17cca: 99 0b sbc r25, r25 17ccc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17cd0: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 17cd4: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 17cd8: 40 91 b7 04 lds r20, 0x04B7 ; 0x8004b7 17cdc: 50 91 b8 04 lds r21, 0x04B8 ; 0x8004b8 17ce0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17ce4: 2a e0 ldi r18, 0x0A ; 10 17ce6: 37 ed ldi r19, 0xD7 ; 215 17ce8: 43 e2 ldi r20, 0x23 ; 35 17cea: 5c e3 ldi r21, 0x3C ; 60 17cec: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17cf0: 20 91 01 12 lds r18, 0x1201 ; 0x801201 17cf4: 30 91 02 12 lds r19, 0x1202 ; 0x801202 17cf8: 40 91 03 12 lds r20, 0x1203 ; 0x801203 17cfc: 50 91 04 12 lds r21, 0x1204 ; 0x801204 17d00: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 17d04: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17d08: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17d0c: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17d10: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17d14: 81 e0 ldi r24, 0x01 ; 1 17d16: 92 e1 ldi r25, 0x12 ; 18 17d18: 0f 94 28 76 call 0x2ec50 ; 0x2ec50 float oldFeedrate = feedrate; 17d1c: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 17d20: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 17d24: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 17d28: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 17d2c: 20 e0 ldi r18, 0x00 ; 0 17d2e: 30 e0 ldi r19, 0x00 ; 0 17d30: 40 e7 ldi r20, 0x70 ; 112 17d32: 52 e4 ldi r21, 0x42 ; 66 17d34: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 17d38: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 17d3c: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17d40: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17d44: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17d48: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17d4c: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17d50: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17d54: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 17d58: 81 e0 ldi r24, 0x01 ; 1 17d5a: 80 93 03 05 sts 0x0503, r24 ; 0x800503 prepare_move(); 17d5e: 90 e0 ldi r25, 0x00 ; 0 17d60: 80 e0 ldi r24, 0x00 ; 0 17d62: 0e 94 85 65 call 0xcb0a ; 0xcb0a if(cs.retract_zlift) { 17d66: 20 e0 ldi r18, 0x00 ; 0 17d68: 30 e0 ldi r19, 0x00 ; 0 17d6a: a9 01 movw r20, r18 17d6c: 60 91 bd 04 lds r22, 0x04BD ; 0x8004bd 17d70: 70 91 be 04 lds r23, 0x04BE ; 0x8004be 17d74: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 17d78: 90 91 c0 04 lds r25, 0x04C0 ; 0x8004c0 17d7c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 17d80: 88 23 and r24, r24 17d82: 11 f1 breq .+68 ; 0x17dc8 st_synchronize(); 17d84: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[Z_AXIS]-=cs.retract_zlift; 17d88: 20 91 bd 04 lds r18, 0x04BD ; 0x8004bd 17d8c: 30 91 be 04 lds r19, 0x04BE ; 0x8004be 17d90: 40 91 bf 04 lds r20, 0x04BF ; 0x8004bf 17d94: 50 91 c0 04 lds r21, 0x04C0 ; 0x8004c0 17d98: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17d9c: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17da0: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17da4: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17da8: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 17dac: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17db0: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17db4: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17db8: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17dbc: 0f 94 90 84 call 0x30920 ; 0x30920 prepare_move(); 17dc0: 90 e0 ldi r25, 0x00 ; 0 17dc2: 80 e0 ldi r24, 0x00 ; 0 17dc4: 0e 94 85 65 call 0xcb0a ; 0xcb0a } feedrate = oldFeedrate; 17dc8: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 17dcc: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 17dd0: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 17dd4: 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 17dd8: ff 90 pop r15 17dda: ef 90 pop r14 17ddc: df 90 pop r13 17dde: cf 90 pop r12 17de0: bf 90 pop r11 17de2: af 90 pop r10 17de4: 9f 90 pop r9 17de6: 8f 90 pop r8 17de8: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 17dea: 99 23 and r25, r25 17dec: a9 f3 breq .-22 ; 0x17dd8 st_synchronize(); 17dee: 0f 94 a0 22 call 0x24540 ; 0x24540 set_destination_to_current(); 17df2: 0e 94 b7 61 call 0xc36e ; 0xc36e float oldFeedrate = feedrate; 17df6: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 17dfa: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 17dfe: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 17e02: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 17e06: 20 e0 ldi r18, 0x00 ; 0 17e08: 30 e0 ldi r19, 0x00 ; 0 17e0a: 40 e7 ldi r20, 0x70 ; 112 17e0c: 52 e4 ldi r21, 0x42 ; 66 17e0e: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 17e12: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 17e16: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 17e1a: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 17e1e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17e22: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17e26: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17e2a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17e2e: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 17e32: c0 90 bd 04 lds r12, 0x04BD ; 0x8004bd 17e36: d0 90 be 04 lds r13, 0x04BE ; 0x8004be 17e3a: e0 90 bf 04 lds r14, 0x04BF ; 0x8004bf 17e3e: f0 90 c0 04 lds r15, 0x04C0 ; 0x8004c0 17e42: 20 e0 ldi r18, 0x00 ; 0 17e44: 30 e0 ldi r19, 0x00 ; 0 17e46: a9 01 movw r20, r18 17e48: c7 01 movw r24, r14 17e4a: b6 01 movw r22, r12 17e4c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 17e50: 88 23 and r24, r24 17e52: e1 f0 breq .+56 ; 0x17e8c current_position[Z_AXIS]+=cs.retract_zlift; 17e54: a7 01 movw r20, r14 17e56: 96 01 movw r18, r12 17e58: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17e5c: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17e60: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17e64: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17e68: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 17e6c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17e70: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17e74: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17e78: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17e7c: 0f 94 90 84 call 0x30920 ; 0x30920 prepare_move(); 17e80: 90 e0 ldi r25, 0x00 ; 0 17e82: 80 e0 ldi r24, 0x00 ; 0 17e84: 0e 94 85 65 call 0xcb0a ; 0xcb0a st_synchronize(); 17e88: 0f 94 a0 22 call 0x24540 ; 0x24540 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 17e8c: 20 91 c1 04 lds r18, 0x04C1 ; 0x8004c1 17e90: 30 91 c2 04 lds r19, 0x04C2 ; 0x8004c2 17e94: 40 91 c3 04 lds r20, 0x04C3 ; 0x8004c3 17e98: 50 91 c4 04 lds r21, 0x04C4 ; 0x8004c4 17e9c: 60 91 b5 04 lds r22, 0x04B5 ; 0x8004b5 17ea0: 70 91 b6 04 lds r23, 0x04B6 ; 0x8004b6 17ea4: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 17ea8: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 17eac: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 17eb0: 6b 01 movw r12, r22 17eb2: 7c 01 movw r14, r24 17eb4: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17eb8: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17ebc: 07 2e mov r0, r23 17ebe: 00 0c add r0, r0 17ec0: 88 0b sbc r24, r24 17ec2: 99 0b sbc r25, r25 17ec4: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 17ec8: 9b 01 movw r18, r22 17eca: ac 01 movw r20, r24 17ecc: c7 01 movw r24, r14 17ece: b6 01 movw r22, r12 17ed0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17ed4: 2a e0 ldi r18, 0x0A ; 10 17ed6: 37 ed ldi r19, 0xD7 ; 215 17ed8: 43 e2 ldi r20, 0x23 ; 35 17eda: 5c e3 ldi r21, 0x3C ; 60 17edc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 17ee0: 9b 01 movw r18, r22 17ee2: ac 01 movw r20, r24 17ee4: 60 91 01 12 lds r22, 0x1201 ; 0x801201 17ee8: 70 91 02 12 lds r23, 0x1202 ; 0x801202 17eec: 80 91 03 12 lds r24, 0x1203 ; 0x801203 17ef0: 90 91 04 12 lds r25, 0x1204 ; 0x801204 17ef4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 17ef8: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17efc: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17f00: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17f04: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17f08: 81 e0 ldi r24, 0x01 ; 1 17f0a: 92 e1 ldi r25, 0x12 ; 18 17f0c: 0f 94 28 76 call 0x2ec50 ; 0x2ec50 retracted[active_extruder]=false; 17f10: 10 92 03 05 sts 0x0503, r1 ; 0x800503 prepare_move(); 17f14: 90 e0 ldi r25, 0x00 ; 0 17f16: 80 e0 ldi r24, 0x00 ; 0 17f18: 0e 94 85 65 call 0xcb0a ; 0xcb0a feedrate = oldFeedrate; 17f1c: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 17f20: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 17f24: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 17f28: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 17f2c: 55 cf rjmp .-342 ; 0x17dd8 00017f2e : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 17f2e: ef 92 push r14 17f30: ff 92 push r15 17f32: 0f 93 push r16 17f34: 1f 93 push r17 17f36: cf 93 push r28 17f38: df 93 push r29 17f3a: 00 d0 rcall .+0 ; 0x17f3c 17f3c: 1f 92 push r1 17f3e: 1f 92 push r1 17f40: cd b7 in r28, 0x3d ; 61 17f42: de b7 in r29, 0x3e ; 62 17f44: 08 2f mov r16, r24 17f46: 16 2f mov r17, r22 17f48: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 17f4a: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 17f4e: 88 23 and r24, r24 17f50: d9 f0 breq .+54 ; 0x17f88 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) { 17f52: 0b 30 cpi r16, 0x0B ; 11 17f54: 29 f1 breq .+74 ; 0x17fa0 17f56: 04 31 cpi r16, 0x14 ; 20 17f58: 31 f1 breq .+76 ; 0x17fa6 /// @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()) { 17f5a: 87 e5 ldi r24, 0x57 ; 87 17f5c: e8 2e mov r14, r24 17f5e: e9 82 std Y+1, r14 ; 0x01 17f60: 0a 83 std Y+2, r16 ; 0x02 17f62: 1b 83 std Y+3, r17 ; 0x03 17f64: fc 82 std Y+4, r15 ; 0x04 17f66: ce 01 movw r24, r28 17f68: 01 96 adiw r24, 0x01 ; 1 17f6a: 0f 94 2f 88 call 0x3105e ; 0x3105e 17f6e: 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)); 17f70: 47 e5 ldi r20, 0x57 ; 87 17f72: 50 2f mov r21, r16 17f74: 61 2f mov r22, r17 17f76: 7f 2d mov r23, r15 17f78: 0f 94 93 63 call 0x2c726 ; 0x2c726 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)); 17f7c: 60 e0 ldi r22, 0x00 ; 0 17f7e: 80 e0 ldi r24, 0x00 ; 0 17f80: 0f 94 28 6b call 0x2d650 ; 0x2d650 17f84: 88 23 and r24, r24 17f86: 59 f3 breq .-42 ; 0x17f5e return true; } 17f88: 0f 90 pop r0 17f8a: 0f 90 pop r0 17f8c: 0f 90 pop r0 17f8e: 0f 90 pop r0 17f90: 0f 90 pop r0 17f92: df 91 pop r29 17f94: cf 91 pop r28 17f96: 1f 91 pop r17 17f98: 0f 91 pop r16 17f9a: ff 90 pop r15 17f9c: ef 90 pop r14 17f9e: 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); 17fa0: 10 93 71 12 sts 0x1271, r17 ; 0x801271 17fa4: da cf rjmp .-76 ; 0x17f5a break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 17fa6: 10 93 72 12 sts 0x1272, r17 ; 0x801272 17faa: d7 cf rjmp .-82 ; 0x17f5a 00017fac : #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) 17fac: 82 30 cpi r24, 0x02 ; 2 17fae: 91 05 cpc r25, r1 17fb0: 38 f0 brcs .+14 ; 0x17fc0 // 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 17fb2: 88 0f add r24, r24 17fb4: 99 1f adc r25, r25 17fb6: 88 0f add r24, r24 17fb8: 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, 17fba: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 17fbc: 01 97 sbiw r24, 0x01 ; 1 17fbe: f1 f7 brne .-4 ; 0x17fbc "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 17fc0: 08 95 ret 00017fc2 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 17fc2: cf 93 push r28 17fc4: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 17fc6: 28 2f mov r18, r24 17fc8: 30 e0 ldi r19, 0x00 ; 0 17fca: f9 01 movw r30, r18 17fcc: e9 5b subi r30, 0xB9 ; 185 17fce: f9 47 sbci r31, 0x79 ; 121 17fd0: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 17fd2: f9 01 movw r30, r18 17fd4: ef 50 subi r30, 0x0F ; 15 17fd6: fa 47 sbci r31, 0x7A ; 122 17fd8: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 17fda: f9 01 movw r30, r18 17fdc: e5 56 subi r30, 0x65 ; 101 17fde: fa 47 sbci r31, 0x7A ; 122 17fe0: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 17fe2: cc 23 and r28, r28 17fe4: a1 f0 breq .+40 ; 0x1800e // 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); 17fe6: 81 11 cpse r24, r1 17fe8: 0e 94 90 b0 call 0x16120 ; 0x16120 if (*portInputRegister(port) & bit) return HIGH; 17fec: ec 2f mov r30, r28 17fee: f0 e0 ldi r31, 0x00 ; 0 17ff0: ee 0f add r30, r30 17ff2: ff 1f adc r31, r31 17ff4: ef 57 subi r30, 0x7F ; 127 17ff6: fa 47 sbci r31, 0x7A ; 122 17ff8: a5 91 lpm r26, Z+ 17ffa: b4 91 lpm r27, Z 17ffc: ec 91 ld r30, X 17ffe: ed 23 and r30, r29 18000: 81 e0 ldi r24, 0x01 ; 1 18002: 90 e0 ldi r25, 0x00 ; 0 18004: 09 f4 brne .+2 ; 0x18008 18006: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 18008: df 91 pop r29 1800a: cf 91 pop r28 1800c: 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; 1800e: 80 e0 ldi r24, 0x00 ; 0 18010: 90 e0 ldi r25, 0x00 ; 0 18012: fa cf rjmp .-12 ; 0x18008 00018014 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 18014: 1f 93 push r17 18016: cf 93 push r28 18018: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1801a: 28 2f mov r18, r24 1801c: 30 e0 ldi r19, 0x00 ; 0 1801e: f9 01 movw r30, r18 18020: e9 5b subi r30, 0xB9 ; 185 18022: f9 47 sbci r31, 0x79 ; 121 18024: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 18026: f9 01 movw r30, r18 18028: ef 50 subi r30, 0x0F ; 15 1802a: fa 47 sbci r31, 0x7A ; 122 1802c: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1802e: f9 01 movw r30, r18 18030: e5 56 subi r30, 0x65 ; 101 18032: fa 47 sbci r31, 0x7A ; 122 18034: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 18036: cc 23 and r28, r28 18038: a9 f0 breq .+42 ; 0x18064 1803a: 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); 1803c: 81 11 cpse r24, r1 1803e: 0e 94 90 b0 call 0x16120 ; 0x16120 out = portOutputRegister(port); 18042: ec 2f mov r30, r28 18044: f0 e0 ldi r31, 0x00 ; 0 18046: ee 0f add r30, r30 18048: ff 1f adc r31, r31 1804a: e9 59 subi r30, 0x99 ; 153 1804c: fa 47 sbci r31, 0x7A ; 122 1804e: a5 91 lpm r26, Z+ 18050: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 18052: 8f b7 in r24, 0x3f ; 63 cli(); 18054: f8 94 cli if (val == LOW) { *out &= ~bit; 18056: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 18058: 11 11 cpse r17, r1 1805a: 08 c0 rjmp .+16 ; 0x1806c *out &= ~bit; 1805c: d0 95 com r29 1805e: de 23 and r29, r30 } else { *out |= bit; 18060: dc 93 st X, r29 } SREG = oldSREG; 18062: 8f bf out 0x3f, r24 ; 63 } 18064: df 91 pop r29 18066: cf 91 pop r28 18068: 1f 91 pop r17 1806a: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1806c: de 2b or r29, r30 1806e: f8 cf rjmp .-16 ; 0x18060 00018070 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 18070: cf 93 push r28 18072: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 18074: 90 e0 ldi r25, 0x00 ; 0 18076: fc 01 movw r30, r24 18078: ef 50 subi r30, 0x0F ; 15 1807a: fa 47 sbci r31, 0x7A ; 122 1807c: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1807e: 85 56 subi r24, 0x65 ; 101 18080: 9a 47 sbci r25, 0x7A ; 122 18082: fc 01 movw r30, r24 18084: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 18086: 88 23 and r24, r24 18088: d1 f0 breq .+52 ; 0x180be // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1808a: 90 e0 ldi r25, 0x00 ; 0 1808c: 88 0f add r24, r24 1808e: 99 1f adc r25, r25 18090: fc 01 movw r30, r24 18092: e3 5b subi r30, 0xB3 ; 179 18094: fa 47 sbci r31, 0x7A ; 122 18096: a5 91 lpm r26, Z+ 18098: b4 91 lpm r27, Z out = portOutputRegister(port); 1809a: fc 01 movw r30, r24 1809c: e9 59 subi r30, 0x99 ; 153 1809e: fa 47 sbci r31, 0x7A ; 122 180a0: c5 91 lpm r28, Z+ 180a2: d4 91 lpm r29, Z if (mode == INPUT) { 180a4: 61 11 cpse r22, r1 180a6: 0e c0 rjmp .+28 ; 0x180c4 uint8_t oldSREG = SREG; 180a8: 9f b7 in r25, 0x3f ; 63 cli(); 180aa: f8 94 cli *reg &= ~bit; 180ac: 8c 91 ld r24, X 180ae: e2 2f mov r30, r18 180b0: e0 95 com r30 180b2: 8e 23 and r24, r30 180b4: 8c 93 st X, r24 *out &= ~bit; 180b6: 28 81 ld r18, Y 180b8: e2 23 and r30, r18 180ba: e8 83 st Y, r30 SREG = oldSREG; 180bc: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 180be: df 91 pop r29 180c0: cf 91 pop r28 180c2: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 180c4: 8f b7 in r24, 0x3f ; 63 cli(); 180c6: f8 94 cli *reg |= bit; 180c8: ec 91 ld r30, X 180ca: e2 2b or r30, r18 180cc: ec 93 st X, r30 SREG = oldSREG; 180ce: 8f bf out 0x3f, r24 ; 63 180d0: f6 cf rjmp .-20 ; 0x180be 000180d2 : // 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) { 180d2: 1f 93 push r17 180d4: cf 93 push r28 180d6: df 93 push r29 180d8: 18 2f mov r17, r24 180da: 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); 180dc: 61 e0 ldi r22, 0x01 ; 1 180de: 0e 94 38 c0 call 0x18070 ; 0x18070 if (val == 0) 180e2: 20 97 sbiw r28, 0x00 ; 0 180e4: 39 f4 brne .+14 ; 0x180f4 { digitalWrite(pin, LOW); 180e6: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 180e8: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 180ea: df 91 pop r29 180ec: cf 91 pop r28 180ee: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 180f0: 0c 94 0a c0 jmp 0x18014 ; 0x18014 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 180f4: cf 3f cpi r28, 0xFF ; 255 180f6: d1 05 cpc r29, r1 180f8: 11 f4 brne .+4 ; 0x180fe { digitalWrite(pin, HIGH); 180fa: 61 e0 ldi r22, 0x01 ; 1 180fc: f5 cf rjmp .-22 ; 0x180e8 } else { switch(digitalPinToTimer(pin)) 180fe: e1 2f mov r30, r17 18100: f0 e0 ldi r31, 0x00 ; 0 18102: e9 5b subi r30, 0xB9 ; 185 18104: f9 47 sbci r31, 0x79 ; 121 18106: e4 91 lpm r30, Z 18108: e1 50 subi r30, 0x01 ; 1 1810a: e2 31 cpi r30, 0x12 ; 18 1810c: 08 f0 brcs .+2 ; 0x18110 1810e: b3 c0 rjmp .+358 ; 0x18276 18110: f0 e0 ldi r31, 0x00 ; 0 18112: 88 27 eor r24, r24 18114: e1 57 subi r30, 0x71 ; 113 18116: ff 43 sbci r31, 0x3F ; 63 18118: 8f 4f sbci r24, 0xFF ; 255 1811a: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 1811e: a1 c0 rjmp .+322 ; 0x18262 18120: a9 c0 rjmp .+338 ; 0x18274 18122: ae c0 rjmp .+348 ; 0x18280 18124: b8 c0 rjmp .+368 ; 0x18296 18126: c2 c0 rjmp .+388 ; 0x182ac 18128: 3b c1 rjmp .+630 ; 0x183a0 1812a: cc c0 rjmp .+408 ; 0x182c4 1812c: d4 c0 rjmp .+424 ; 0x182d6 1812e: dc c0 rjmp .+440 ; 0x182e8 18130: e6 c0 rjmp .+460 ; 0x182fe 18132: f0 c0 rjmp .+480 ; 0x18314 18134: fa c0 rjmp .+500 ; 0x1832a 18136: 09 c1 rjmp .+530 ; 0x1834a 18138: 13 c1 rjmp .+550 ; 0x18360 1813a: 3b c1 rjmp .+630 ; 0x183b2 1813c: 1d c1 rjmp .+570 ; 0x18378 1813e: 27 c1 rjmp .+590 ; 0x1838e 18140: 31 c1 rjmp .+610 ; 0x183a4 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 18142: 84 b5 in r24, 0x24 ; 36 18144: 80 68 ori r24, 0x80 ; 128 18146: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 18148: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1814a: df 91 pop r29 1814c: cf 91 pop r28 1814e: 1f 91 pop r17 18150: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 18152: 84 b5 in r24, 0x24 ; 36 18154: 80 62 ori r24, 0x20 ; 32 18156: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 18158: c8 bd out 0x28, r28 ; 40 1815a: f7 cf rjmp .-18 ; 0x1814a #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1815c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18160: 80 68 ori r24, 0x80 ; 128 18162: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 18166: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1816a: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1816e: ed cf rjmp .-38 ; 0x1814a #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 18170: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18174: 80 62 ori r24, 0x20 ; 32 18176: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1817a: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1817e: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 18182: e3 cf rjmp .-58 ; 0x1814a #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 18184: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18188: 88 60 ori r24, 0x08 ; 8 1818a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1818e: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 18192: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 18196: d9 cf rjmp .-78 ; 0x1814a #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 18198: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1819c: 80 68 ori r24, 0x80 ; 128 1819e: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 181a2: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 181a6: d1 cf rjmp .-94 ; 0x1814a #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 181a8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181ac: 80 62 ori r24, 0x20 ; 32 181ae: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 181b2: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 181b6: c9 cf rjmp .-110 ; 0x1814a #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 181b8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181bc: 80 68 ori r24, 0x80 ; 128 181be: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 181c2: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 181c6: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 181ca: bf cf rjmp .-130 ; 0x1814a #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 181cc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181d0: 80 62 ori r24, 0x20 ; 32 181d2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 181d6: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 181da: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 181de: b5 cf rjmp .-150 ; 0x1814a #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 181e0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181e4: 88 60 ori r24, 0x08 ; 8 181e6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 181ea: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 181ee: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 181f2: ab cf rjmp .-170 ; 0x1814a #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 181f4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 181f8: 80 68 ori r24, 0x80 ; 128 181fa: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 181fe: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18202: 8f 7b andi r24, 0xBF ; 191 18204: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 18208: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1820c: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 18210: 9c cf rjmp .-200 ; 0x1814a #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 18212: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18216: 80 62 ori r24, 0x20 ; 32 18218: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1821c: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 18220: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 18224: 92 cf rjmp .-220 ; 0x1814a #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 18226: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1822a: 88 60 ori r24, 0x08 ; 8 1822c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 18230: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 18234: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 18238: 88 cf rjmp .-240 ; 0x1814a #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1823a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1823e: 80 68 ori r24, 0x80 ; 128 18240: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 18244: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 18248: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1824c: 7e cf rjmp .-260 ; 0x1814a #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1824e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18252: 80 62 ori r24, 0x20 ; 32 18254: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 18258: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1825c: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 18260: 74 cf rjmp .-280 ; 0x1814a #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 18262: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18266: 88 60 ori r24, 0x08 ; 8 18268: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1826c: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 18270: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 18274: 6a cf rjmp .-300 ; 0x1814a break; #endif case NOT_ON_TIMER: default: if (val < 128) { 18276: c0 38 cpi r28, 0x80 ; 128 18278: d1 05 cpc r29, r1 1827a: 0c f0 brlt .+2 ; 0x1827e 1827c: 3e cf rjmp .-388 ; 0x180fa 1827e: 33 cf rjmp .-410 ; 0x180e6 00018280 : } } /// 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){ 18280: 4f 92 push r4 18282: 5f 92 push r5 18284: 6f 92 push r6 18286: 7f 92 push r7 18288: 8f 92 push r8 1828a: 9f 92 push r9 1828c: af 92 push r10 1828e: bf 92 push r11 18290: cf 92 push r12 18292: df 92 push r13 18294: ef 92 push r14 18296: ff 92 push r15 18298: 0f 93 push r16 1829a: 1f 93 push r17 1829c: cf 93 push r28 1829e: df 93 push r29 182a0: eb 01 movw r28, r22 182a2: 6a 01 movw r12, r20 182a4: 79 01 movw r14, r18 sm4_do_step(axes); 182a6: 0f 94 51 36 call 0x26ca2 ; 0x26ca2 182aa: f6 01 movw r30, r12 182ac: 00 81 ld r16, Z 182ae: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 182b0: 1c 16 cp r1, r28 182b2: 1d 06 cpc r1, r29 182b4: b4 f4 brge .+44 ; 0x182e2 182b6: 0e 15 cp r16, r14 182b8: 1f 05 cpc r17, r15 182ba: 99 f4 brne .+38 ; 0x182e2 delayMicroseconds(delay_us); 182bc: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 182be: df 91 pop r29 182c0: cf 91 pop r28 182c2: 1f 91 pop r17 182c4: 0f 91 pop r16 182c6: ff 90 pop r15 182c8: ef 90 pop r14 182ca: df 90 pop r13 182cc: cf 90 pop r12 182ce: bf 90 pop r11 182d0: af 90 pop r10 182d2: 9f 90 pop r9 182d4: 8f 90 pop r8 182d6: 7f 90 pop r7 182d8: 6f 90 pop r6 182da: 5f 90 pop r5 182dc: 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); 182de: 0c 94 d6 bf jmp 0x17fac ; 0x17fac return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 182e2: b8 01 movw r22, r16 182e4: 90 e0 ldi r25, 0x00 ; 0 182e6: 80 e0 ldi r24, 0x00 ; 0 182e8: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 182ec: 2d eb ldi r18, 0xBD ; 189 182ee: 37 e3 ldi r19, 0x37 ; 55 182f0: 46 e8 ldi r20, 0x86 ; 134 182f2: 55 e3 ldi r21, 0x35 ; 53 182f4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 182f8: 4b 01 movw r8, r22 182fa: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 182fc: be 01 movw r22, r28 182fe: 0d 2e mov r0, r29 18300: 00 0c add r0, r0 18302: 88 0b sbc r24, r24 18304: 99 0b sbc r25, r25 18306: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1830a: a5 01 movw r20, r10 1830c: 94 01 movw r18, r8 1830e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 18312: 2b 01 movw r4, r22 18314: 3c 01 movw r6, r24 18316: a5 01 movw r20, r10 18318: 94 01 movw r18, r8 1831a: 6a e0 ldi r22, 0x0A ; 10 1831c: 77 ed ldi r23, 0xD7 ; 215 1831e: 83 e2 ldi r24, 0x23 ; 35 18320: 9c e3 ldi r25, 0x3C ; 60 18322: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 18326: 9b 01 movw r18, r22 18328: ac 01 movw r20, r24 1832a: c3 01 movw r24, r6 1832c: b2 01 movw r22, r4 1832e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 18332: 4b 01 movw r8, r22 18334: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 18336: 2a e0 ldi r18, 0x0A ; 10 18338: 37 ed ldi r19, 0xD7 ; 215 1833a: 43 e2 ldi r20, 0x23 ; 35 1833c: 5e e3 ldi r21, 0x3E ; 62 1833e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 18342: 18 16 cp r1, r24 18344: dc f5 brge .+118 ; 0x183bc 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)); 18346: a5 01 movw r20, r10 18348: 94 01 movw r18, r8 1834a: 6a e0 ldi r22, 0x0A ; 10 1834c: 77 ed ldi r23, 0xD7 ; 215 1834e: 83 e2 ldi r24, 0x23 ; 35 18350: 9c e3 ldi r25, 0x3C ; 60 18352: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 18356: 20 e0 ldi r18, 0x00 ; 0 18358: 34 e2 ldi r19, 0x24 ; 36 1835a: 44 e7 ldi r20, 0x74 ; 116 1835c: 59 e4 ldi r21, 0x49 ; 73 1835e: 0f 94 09 9c call 0x33812 ; 0x33812 <__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); 18362: 20 e0 ldi r18, 0x00 ; 0 18364: 30 e0 ldi r19, 0x00 ; 0 18366: 40 e0 ldi r20, 0x00 ; 0 18368: 5f e3 ldi r21, 0x3F ; 63 1836a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1836e: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 18372: 5b 01 movw r10, r22 18374: 6e 15 cp r22, r14 18376: 7f 05 cpc r23, r15 18378: 08 f4 brcc .+2 ; 0x1837c 1837a: 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){ 1837c: 0a 15 cp r16, r10 1837e: 1b 05 cpc r17, r11 18380: 31 f4 brne .+12 ; 0x1838e 18382: 20 97 sbiw r28, 0x00 ; 0 18384: 21 f0 breq .+8 ; 0x1838e if (acc > 0) 18386: fc f0 brlt .+62 ; 0x183c6 t1--; 18388: f1 e0 ldi r31, 0x01 ; 1 1838a: af 1a sub r10, r31 1838c: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1838e: c5 01 movw r24, r10 18390: 0e 94 d6 bf call 0x17fac ; 0x17fac delay_us = t1; 18394: f6 01 movw r30, r12 18396: b1 82 std Z+1, r11 ; 0x01 18398: a0 82 st Z, r10 } 1839a: df 91 pop r29 1839c: cf 91 pop r28 1839e: 1f 91 pop r17 183a0: 0f 91 pop r16 183a2: ff 90 pop r15 183a4: ef 90 pop r14 183a6: df 90 pop r13 183a8: cf 90 pop r12 183aa: bf 90 pop r11 183ac: af 90 pop r10 183ae: 9f 90 pop r9 183b0: 8f 90 pop r8 183b2: 7f 90 pop r7 183b4: 6f 90 pop r6 183b6: 5f 90 pop r5 183b8: 4f 90 pop r4 183ba: 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 183bc: 80 e1 ldi r24, 0x10 ; 16 183be: a8 2e mov r10, r24 183c0: 87 e2 ldi r24, 0x27 ; 39 183c2: b8 2e mov r11, r24 183c4: db cf rjmp .-74 ; 0x1837c /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 183c6: 8f ef ldi r24, 0xFF ; 255 183c8: a8 1a sub r10, r24 183ca: b8 0a sbc r11, r24 183cc: e0 cf rjmp .-64 ; 0x1838e 000183ce : /// 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){ 183ce: 2f 92 push r2 183d0: 3f 92 push r3 183d2: 4f 92 push r4 183d4: 5f 92 push r5 183d6: 6f 92 push r6 183d8: 7f 92 push r7 183da: 8f 92 push r8 183dc: 9f 92 push r9 183de: af 92 push r10 183e0: bf 92 push r11 183e2: cf 92 push r12 183e4: df 92 push r13 183e6: ef 92 push r14 183e8: ff 92 push r15 183ea: 0f 93 push r16 183ec: 1f 93 push r17 183ee: cf 93 push r28 183f0: df 93 push r29 183f2: 00 d0 rcall .+0 ; 0x183f4 183f4: cd b7 in r28, 0x3d ; 61 183f6: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 183f8: f9 01 movw r30, r18 183fa: e0 80 ld r14, Z 183fc: f1 80 ldd r15, Z+1 ; 0x01 183fe: e1 14 cp r14, r1 18400: f1 04 cpc r15, r1 18402: 09 f4 brne .+2 ; 0x18406 18404: 6c c0 rjmp .+216 ; 0x184de 18406: 16 16 cp r1, r22 18408: 17 06 cpc r1, r23 1840a: 0c f0 brlt .+2 ; 0x1840e 1840c: 68 c0 rjmp .+208 ; 0x184de 1840e: 19 01 movw r2, r18 18410: 5b 83 std Y+3, r21 ; 0x03 18412: 4a 83 std Y+2, r20 ; 0x02 18414: 6b 01 movw r12, r22 18416: 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)); 18418: fa 01 movw r30, r20 1841a: 00 81 ld r16, Z 1841c: 11 81 ldd r17, Z+1 ; 0x01 1841e: b8 01 movw r22, r16 18420: 90 e0 ldi r25, 0x00 ; 0 18422: 80 e0 ldi r24, 0x00 ; 0 18424: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 18428: 4b 01 movw r8, r22 1842a: 5c 01 movw r10, r24 1842c: b6 01 movw r22, r12 1842e: 0d 2c mov r0, r13 18430: 00 0c add r0, r0 18432: 88 0b sbc r24, r24 18434: 99 0b sbc r25, r25 18436: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1843a: 2b 01 movw r4, r22 1843c: 3c 01 movw r6, r24 1843e: a5 01 movw r20, r10 18440: 94 01 movw r18, r8 18442: c5 01 movw r24, r10 18444: b4 01 movw r22, r8 18446: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1844a: 9b 01 movw r18, r22 1844c: ac 01 movw r20, r24 1844e: c3 01 movw r24, r6 18450: b2 01 movw r22, r4 18452: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 18456: 9b 01 movw r18, r22 18458: ac 01 movw r20, r24 1845a: 6a e0 ldi r22, 0x0A ; 10 1845c: 77 ed ldi r23, 0xD7 ; 215 1845e: 83 ea ldi r24, 0xA3 ; 163 18460: 9b e3 ldi r25, 0x3B ; 59 18462: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__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); 18466: 20 e0 ldi r18, 0x00 ; 0 18468: 30 e0 ldi r19, 0x00 ; 0 1846a: 40 e0 ldi r20, 0x00 ; 0 1846c: 5f e3 ldi r21, 0x3F ; 63 1846e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 18472: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__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){ 18476: 6e 15 cp r22, r14 18478: 7f 05 cpc r23, r15 1847a: 30 f5 brcc .+76 ; 0x184c8 /// go steady sm4_do_step(axes); 1847c: 89 81 ldd r24, Y+1 ; 0x01 1847e: 0f 94 51 36 call 0x26ca2 ; 0x26ca2 delayMicroseconds(delay_us); 18482: ea 81 ldd r30, Y+2 ; 0x02 18484: fb 81 ldd r31, Y+3 ; 0x03 18486: 80 81 ld r24, Z 18488: 91 81 ldd r25, Z+1 ; 0x01 1848a: 0e 94 d6 bf call 0x17fac ; 0x17fac } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1848e: f1 01 movw r30, r2 18490: 80 81 ld r24, Z 18492: 91 81 ldd r25, Z+1 ; 0x01 18494: 01 97 sbiw r24, 0x01 ; 1 18496: 91 83 std Z+1, r25 ; 0x01 18498: 80 83 st Z, r24 return true; 1849a: 81 e0 ldi r24, 0x01 ; 1 } 1849c: 0f 90 pop r0 1849e: 0f 90 pop r0 184a0: 0f 90 pop r0 184a2: df 91 pop r29 184a4: cf 91 pop r28 184a6: 1f 91 pop r17 184a8: 0f 91 pop r16 184aa: ff 90 pop r15 184ac: ef 90 pop r14 184ae: df 90 pop r13 184b0: cf 90 pop r12 184b2: bf 90 pop r11 184b4: af 90 pop r10 184b6: 9f 90 pop r9 184b8: 8f 90 pop r8 184ba: 7f 90 pop r7 184bc: 6f 90 pop r6 184be: 5f 90 pop r5 184c0: 4f 90 pop r4 184c2: 3f 90 pop r3 184c4: 2f 90 pop r2 184c6: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 184c8: 66 27 eor r22, r22 184ca: 77 27 eor r23, r23 184cc: 6c 19 sub r22, r12 184ce: 7d 09 sbc r23, r13 184d0: 98 01 movw r18, r16 184d2: 4a 81 ldd r20, Y+2 ; 0x02 184d4: 5b 81 ldd r21, Y+3 ; 0x03 184d6: 89 81 ldd r24, Y+1 ; 0x01 184d8: 0e 94 40 c1 call 0x18280 ; 0x18280 184dc: d8 cf rjmp .-80 ; 0x1848e /// 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; 184de: 80 e0 ldi r24, 0x00 ; 0 184e0: dd cf rjmp .-70 ; 0x1849c 000184e2 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 184e2: 0f 93 push r16 184e4: 1f 93 push r17 184e6: cf 93 push r28 184e8: df 93 push r29 184ea: 18 2f mov r17, r24 184ec: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 184ee: d1 e0 ldi r29, 0x01 ; 1 184f0: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 184f2: 81 2f mov r24, r17 184f4: 8d 23 and r24, r29 184f6: 29 f0 breq .+10 ; 0x18502 sm4_set_dir(i, dir & mask); 184f8: 60 2f mov r22, r16 184fa: 6d 23 and r22, r29 184fc: 8c 2f mov r24, r28 184fe: 0f 94 59 36 call 0x26cb2 ; 0x26cb2 } } } 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) { 18502: cf 5f subi r28, 0xFF ; 255 18504: dd 0f add r29, r29 18506: c3 30 cpi r28, 0x03 ; 3 18508: a1 f7 brne .-24 ; 0x184f2 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1850a: df 91 pop r29 1850c: cf 91 pop r28 1850e: 1f 91 pop r17 18510: 0f 91 pop r16 18512: 08 95 ret 00018514 : //@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) { 18514: 8f 92 push r8 18516: 9f 92 push r9 18518: af 92 push r10 1851a: bf 92 push r11 1851c: cf 92 push r12 1851e: df 92 push r13 18520: ef 92 push r14 18522: ff 92 push r15 18524: 30 e0 ldi r19, 0x00 ; 0 18526: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 18528: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1852a: 48 2f mov r20, r24 1852c: 49 23 and r20, r25 1852e: 19 f1 breq .+70 ; 0x18576 count_position[i] += dir & mask ? -1L : 1L; 18530: a9 01 movw r20, r18 18532: 44 0f add r20, r20 18534: 55 1f adc r21, r21 18536: 44 0f add r20, r20 18538: 55 1f adc r21, r21 1853a: fa 01 movw r30, r20 1853c: ea 54 subi r30, 0x4A ; 74 1853e: f9 4f sbci r31, 0xF9 ; 249 18540: c0 80 ld r12, Z 18542: d1 80 ldd r13, Z+1 ; 0x01 18544: e2 80 ldd r14, Z+2 ; 0x02 18546: f3 80 ldd r15, Z+3 ; 0x03 18548: 76 2f mov r23, r22 1854a: 79 23 and r23, r25 1854c: 81 2c mov r8, r1 1854e: 91 2c mov r9, r1 18550: 54 01 movw r10, r8 18552: 83 94 inc r8 18554: 77 23 and r23, r23 18556: 21 f0 breq .+8 ; 0x18560 18558: 88 24 eor r8, r8 1855a: 8a 94 dec r8 1855c: 98 2c mov r9, r8 1855e: 54 01 movw r10, r8 18560: c8 0c add r12, r8 18562: d9 1c adc r13, r9 18564: ea 1c adc r14, r10 18566: fb 1c adc r15, r11 18568: 4a 54 subi r20, 0x4A ; 74 1856a: 59 4f sbci r21, 0xF9 ; 249 1856c: fa 01 movw r30, r20 1856e: c0 82 st Z, r12 18570: d1 82 std Z+1, r13 ; 0x01 18572: e2 82 std Z+2, r14 ; 0x02 18574: 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) { 18576: 99 0f add r25, r25 18578: 2f 5f subi r18, 0xFF ; 255 1857a: 3f 4f sbci r19, 0xFF ; 255 1857c: 23 30 cpi r18, 0x03 ; 3 1857e: 31 05 cpc r19, r1 18580: a1 f6 brne .-88 ; 0x1852a if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 18582: ff 90 pop r15 18584: ef 90 pop r14 18586: df 90 pop r13 18588: cf 90 pop r12 1858a: bf 90 pop r11 1858c: af 90 pop r10 1858e: 9f 90 pop r9 18590: 8f 90 pop r8 18592: 08 95 ret 00018594 : /// 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) { 18594: 2f 92 push r2 18596: 3f 92 push r3 18598: 4f 92 push r4 1859a: 5f 92 push r5 1859c: 6f 92 push r6 1859e: 7f 92 push r7 185a0: 8f 92 push r8 185a2: 9f 92 push r9 185a4: af 92 push r10 185a6: bf 92 push r11 185a8: cf 92 push r12 185aa: df 92 push r13 185ac: ef 92 push r14 185ae: ff 92 push r15 185b0: 0f 93 push r16 185b2: 1f 93 push r17 185b4: cf 93 push r28 185b6: df 93 push r29 185b8: 00 d0 rcall .+0 ; 0x185ba 185ba: 00 d0 rcall .+0 ; 0x185bc 185bc: cd b7 in r28, 0x3d ; 61 185be: 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]; 185c0: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 185c4: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 185c8: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 185cc: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 185d0: 7c 01 movw r14, r24 185d2: ec 18 sub r14, r12 185d4: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 185d6: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 185da: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 185de: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 185e2: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 185e6: 68 1b sub r22, r24 185e8: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 185ea: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 185ee: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 185f2: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 185f6: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 185fa: fa 01 movw r30, r20 185fc: e8 1b sub r30, r24 185fe: f9 0b sbc r31, r25 18600: fa 83 std Y+2, r31 ; 0x02 18602: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 18604: fb 01 movw r30, r22 18606: ff 0f add r31, r31 18608: ee 0b sbc r30, r30 1860a: ff 0f add r31, r31 1860c: fe 2f mov r31, r30 1860e: ee 1f adc r30, r30 18610: e2 70 andi r30, 0x02 ; 2 18612: 89 81 ldd r24, Y+1 ; 0x01 18614: 9a 81 ldd r25, Y+2 ; 0x02 18616: 88 e0 ldi r24, 0x08 ; 8 18618: 98 02 muls r25, r24 1861a: 81 2d mov r24, r1 1861c: 99 0b sbc r25, r25 1861e: 11 24 eor r1, r1 18620: 84 70 andi r24, 0x04 ; 4 18622: e8 2b or r30, r24 18624: 8f 2d mov r24, r15 18626: 88 1f adc r24, r24 18628: 88 27 eor r24, r24 1862a: 88 1f adc r24, r24 1862c: e8 2b or r30, r24 1862e: e0 93 bf 03 sts 0x03BF, r30 ; 0x8003bf asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 18632: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 18636: 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; 18638: 87 e0 ldi r24, 0x07 ; 7 1863a: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 1863c: e0 fd sbrc r30, 0 1863e: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 18640: e1 fd sbrc r30, 1 18642: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 18644: e4 70 andi r30, 0x04 ; 4 18646: 09 f0 breq .+2 ; 0x1864a 18648: 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; 1864a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1864e: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 18650: 87 ef ldi r24, 0xF7 ; 247 18652: 90 eb ldi r25, 0xB0 ; 176 18654: 01 11 cpse r16, r1 18656: 02 c0 rjmp .+4 ; 0x1865c 18658: 90 e0 ldi r25, 0x00 ; 0 1865a: 80 e0 ldi r24, 0x00 ; 0 1865c: 90 93 28 05 sts 0x0528, r25 ; 0x800528 18660: 80 93 27 05 sts 0x0527, r24 ; 0x800527 xyzcal_sm4_delay = delay_us; 18664: 30 93 be 03 sts 0x03BE, r19 ; 0x8003be 18668: 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; 1866c: 29 81 ldd r18, Y+1 ; 0x01 1866e: 3a 81 ldd r19, Y+2 ; 0x02 18670: 3e 83 std Y+6, r19 ; 0x06 18672: 2d 83 std Y+5, r18 ; 0x05 18674: 37 ff sbrs r19, 7 18676: 05 c0 rjmp .+10 ; 0x18682 18678: 31 95 neg r19 1867a: 21 95 neg r18 1867c: 31 09 sbc r19, r1 1867e: 3e 83 std Y+6, r19 ; 0x06 18680: 2d 83 std Y+5, r18 ; 0x05 18682: 8b 01 movw r16, r22 18684: 77 ff sbrs r23, 7 18686: 03 c0 rjmp .+6 ; 0x1868e 18688: 11 95 neg r17 1868a: 01 95 neg r16 1868c: 11 09 sbc r17, r1 1868e: f7 fe sbrs r15, 7 18690: 03 c0 rjmp .+6 ; 0x18698 18692: f1 94 neg r15 18694: e1 94 neg r14 18696: 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); 18698: 98 01 movw r18, r16 1869a: d8 01 movw r26, r16 1869c: 0f 94 54 a2 call 0x344a8 ; 0x344a8 <__mulhisi3> 186a0: 4b 01 movw r8, r22 186a2: 5c 01 movw r10, r24 186a4: 2d 81 ldd r18, Y+5 ; 0x05 186a6: 3e 81 ldd r19, Y+6 ; 0x06 186a8: d9 01 movw r26, r18 186aa: 0f 94 54 a2 call 0x344a8 ; 0x344a8 <__mulhisi3> 186ae: 86 0e add r8, r22 186b0: 97 1e adc r9, r23 186b2: a8 1e adc r10, r24 186b4: b9 1e adc r11, r25 186b6: 97 01 movw r18, r14 186b8: d7 01 movw r26, r14 186ba: 0f 94 54 a2 call 0x344a8 ; 0x344a8 <__mulhisi3> 186be: 68 0d add r22, r8 186c0: 79 1d adc r23, r9 186c2: 8a 1d adc r24, r10 186c4: 9b 1d adc r25, r11 186c6: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 186ca: 0f 94 32 a6 call 0x34c64 ; 0x34c64 186ce: 20 e0 ldi r18, 0x00 ; 0 186d0: 30 e0 ldi r19, 0x00 ; 0 186d2: 40 e0 ldi r20, 0x00 ; 0 186d4: 5f e3 ldi r21, 0x3F ; 63 186d6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 186da: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 186de: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 186e0: 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; 186e2: 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; 186e4: 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; 186e6: 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; 186e8: 1c 82 std Y+4, r1 ; 0x04 186ea: 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; 186ec: 31 2c mov r3, r1 186ee: 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; 186f0: 1a 82 std Y+2, r1 ; 0x02 186f2: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 186f4: 61 14 cp r6, r1 186f6: 71 04 cpc r7, r1 186f8: 09 f4 brne .+2 ; 0x186fc 186fa: 48 c0 rjmp .+144 ; 0x1878c if (sm4_stop_cb && (*sm4_stop_cb)()) break; 186fc: e0 91 27 05 lds r30, 0x0527 ; 0x800527 18700: f0 91 28 05 lds r31, 0x0528 ; 0x800528 18704: 30 97 sbiw r30, 0x00 ; 0 18706: f1 f5 brne .+124 ; 0x18784 uint8_t sm = 0; //step mask 18708: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1870a: ec 14 cp r14, r12 1870c: fd 04 cpc r15, r13 1870e: 40 f0 brcs .+16 ; 0x18720 sm |= 1; cx += dd; 18710: c4 0c add r12, r4 18712: d5 1c adc r13, r5 x++; 18714: 89 81 ldd r24, Y+1 ; 0x01 18716: 9a 81 ldd r25, Y+2 ; 0x02 18718: 01 96 adiw r24, 0x01 ; 1 1871a: 9a 83 std Y+2, r25 ; 0x02 1871c: 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; 1871e: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 18720: 0a 15 cp r16, r10 18722: 1b 05 cpc r17, r11 18724: 30 f0 brcs .+12 ; 0x18732 sm |= 2; 18726: 82 60 ori r24, 0x02 ; 2 cy += dd; 18728: a4 0c add r10, r4 1872a: b5 1c adc r11, r5 y++; 1872c: 9f ef ldi r25, 0xFF ; 255 1872e: 29 1a sub r2, r25 18730: 39 0a sbc r3, r25 } if (cz <= dz){ 18732: ed 81 ldd r30, Y+5 ; 0x05 18734: fe 81 ldd r31, Y+6 ; 0x06 18736: e8 15 cp r30, r8 18738: f9 05 cpc r31, r9 1873a: 48 f0 brcs .+18 ; 0x1874e sm |= 4; 1873c: 84 60 ori r24, 0x04 ; 4 cz += dd; 1873e: 84 0c add r8, r4 18740: 95 1c adc r9, r5 z++; 18742: 2b 81 ldd r18, Y+3 ; 0x03 18744: 3c 81 ldd r19, Y+4 ; 0x04 18746: 2f 5f subi r18, 0xFF ; 255 18748: 3f 4f sbci r19, 0xFF ; 255 1874a: 3c 83 std Y+4, r19 ; 0x04 1874c: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1874e: ce 18 sub r12, r14 18750: df 08 sbc r13, r15 cy -= dy; 18752: a0 1a sub r10, r16 18754: b1 0a sbc r11, r17 cz -= dz; 18756: ed 81 ldd r30, Y+5 ; 0x05 18758: fe 81 ldd r31, Y+6 ; 0x06 1875a: 8e 1a sub r8, r30 1875c: 9f 0a sbc r9, r31 sm4_do_step(sm); 1875e: 0f 94 51 36 call 0x26ca2 ; 0x26ca2 uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 18762: e0 91 23 05 lds r30, 0x0523 ; 0x800523 18766: f0 91 24 05 lds r31, 0x0524 ; 0x800524 1876a: 30 97 sbiw r30, 0x00 ; 0 1876c: d1 f1 breq .+116 ; 0x187e2 1876e: b2 01 movw r22, r4 18770: c3 01 movw r24, r6 18772: 19 95 eicall if (delay) delayMicroseconds(delay); 18774: 00 97 sbiw r24, 0x00 ; 0 18776: 11 f0 breq .+4 ; 0x1877c 18778: 0e 94 d6 bf call 0x17fac ; 0x17fac nd--; 1877c: f1 e0 ldi r31, 0x01 ; 1 1877e: 6f 1a sub r6, r31 18780: 71 08 sbc r7, r1 18782: b8 cf rjmp .-144 ; 0x186f4 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; 18784: 19 95 eicall 18786: 88 23 and r24, r24 18788: 09 f4 brne .+2 ; 0x1878c 1878a: be cf rjmp .-132 ; 0x18708 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) 1878c: e0 91 25 05 lds r30, 0x0525 ; 0x800525 18790: f0 91 26 05 lds r31, 0x0526 ; 0x800526 18794: 30 97 sbiw r30, 0x00 ; 0 18796: 41 f0 breq .+16 ; 0x187a8 (*sm4_update_pos_cb)(x, y, z, 0); 18798: 30 e0 ldi r19, 0x00 ; 0 1879a: 20 e0 ldi r18, 0x00 ; 0 1879c: 4b 81 ldd r20, Y+3 ; 0x03 1879e: 5c 81 ldd r21, Y+4 ; 0x04 187a0: b1 01 movw r22, r2 187a2: 89 81 ldd r24, Y+1 ; 0x01 187a4: 9a 81 ldd r25, Y+2 ; 0x02 187a6: 19 95 eicall 187a8: 81 e0 ldi r24, 0x01 ; 1 187aa: 67 28 or r6, r7 187ac: 09 f4 brne .+2 ; 0x187b0 187ae: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 187b0: 26 96 adiw r28, 0x06 ; 6 187b2: 0f b6 in r0, 0x3f ; 63 187b4: f8 94 cli 187b6: de bf out 0x3e, r29 ; 62 187b8: 0f be out 0x3f, r0 ; 63 187ba: cd bf out 0x3d, r28 ; 61 187bc: df 91 pop r29 187be: cf 91 pop r28 187c0: 1f 91 pop r17 187c2: 0f 91 pop r16 187c4: ff 90 pop r15 187c6: ef 90 pop r14 187c8: df 90 pop r13 187ca: cf 90 pop r12 187cc: bf 90 pop r11 187ce: af 90 pop r10 187d0: 9f 90 pop r9 187d2: 8f 90 pop r8 187d4: 7f 90 pop r7 187d6: 6f 90 pop r6 187d8: 5f 90 pop r5 187da: 4f 90 pop r4 187dc: 3f 90 pop r3 187de: 2f 90 pop r2 187e0: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 187e2: 84 ef ldi r24, 0xF4 ; 244 187e4: 91 e0 ldi r25, 0x01 ; 1 187e6: c8 cf rjmp .-112 ; 0x18778 000187e8 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 187e8: 89 b1 in r24, 0x09 ; 9 187ea: 86 95 lsr r24 187ec: 81 70 andi r24, 0x01 ; 1 187ee: 91 e0 ldi r25, 0x01 ; 1 187f0: 89 27 eor r24, r25 187f2: 08 95 ret 000187f4 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 187f4: 1f 93 push r17 187f6: cf 93 push r28 187f8: df 93 push r29 MENU_BEGIN(); 187fa: 0f 94 1c 94 call 0x32838 ; 0x32838 187fe: 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); 18802: 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 18804: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18806: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1880a: 84 30 cpi r24, 0x04 ; 4 1880c: 08 f0 brcs .+2 ; 0x18810 1880e: 08 c2 rjmp .+1040 ; 0x18c20 18810: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 18814: 81 e7 ldi r24, 0x71 ; 113 18816: 9d e3 ldi r25, 0x3D ; 61 18818: 0e 94 32 6d call 0xda64 ; 0xda64 1881c: 0f 94 e7 96 call 0x32dce ; 0x32dce 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)) { 18820: 0e 94 9a 61 call 0xc334 ; 0xc334 18824: 81 11 cpse r24, r1 18826: 19 c0 rjmp .+50 ; 0x1885a 18828: 0e 94 34 61 call 0xc268 ; 0xc268 1882c: 81 11 cpse r24, r1 1882e: 15 c0 rjmp .+42 ; 0x1885a 18830: 80 91 99 03 lds r24, 0x0399 ; 0x800399 18834: 81 11 cpse r24, r1 18836: 11 c0 rjmp .+34 ; 0x1885a #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18838: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1883c: 83 30 cpi r24, 0x03 ; 3 1883e: 09 f0 breq .+2 ; 0x18842 18840: 5d c0 rjmp .+186 ; 0x188fc 18842: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18846: 88 23 and r24, r24 18848: 41 f0 breq .+16 ; 0x1885a MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1884a: 87 e6 ldi r24, 0x67 ; 103 1884c: 9d e3 ldi r25, 0x3D ; 61 1884e: 0e 94 32 6d call 0xda64 ; 0xda64 18852: 64 e6 ldi r22, 0x64 ; 100 18854: 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); 18856: 0f 94 99 93 call 0x32732 ; 0x32732 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1885a: 0e 94 84 61 call 0xc308 ; 0xc308 1885e: 88 23 and r24, r24 18860: 81 f0 breq .+32 ; 0x18882 18862: 0e 94 49 61 call 0xc292 ; 0xc292 18866: 81 11 cpse r24, r1 18868: 04 c0 rjmp .+8 ; 0x18872 1886a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1886e: 84 30 cpi r24, 0x04 ; 4 18870: 41 f4 brne .+16 ; 0x18882 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18872: 87 e5 ldi r24, 0x57 ; 87 18874: 9d e3 ldi r25, 0x3D ; 61 18876: 0e 94 32 6d call 0xda64 ; 0xda64 1887a: 6d e5 ldi r22, 0x5D ; 93 1887c: 78 e3 ldi r23, 0x38 ; 56 1887e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 if (farm_mode) 18882: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18886: 88 23 and r24, r24 18888: 41 f0 breq .+16 ; 0x1889a MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 1888a: 8c ea ldi r24, 0xAC ; 172 1888c: 9d e3 ldi r25, 0x3D ; 61 1888e: 0e 94 32 6d call 0xda64 ; 0xda64 18892: 6a e4 ldi r22, 0x4A ; 74 18894: 7f ee ldi r23, 0xEF ; 239 18896: 0f 94 99 93 call 0x32732 ; 0x32732 if (!printer_recovering()) { 1889a: 0e 94 34 61 call 0xc268 ; 0xc268 1889e: 81 11 cpse r24, r1 188a0: 61 c0 rjmp .+194 ; 0x18964 } //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); 188a2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 188a6: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 188aa: 89 1b sub r24, r25 188ac: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188ae: a9 f5 brne .+106 ; 0x1891a if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 188b0: 0e 94 9a 61 call 0xc334 ; 0xc334 188b4: 81 11 cpse r24, r1 188b6: 31 c0 rjmp .+98 ; 0x1891a #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188b8: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 188bc: 82 30 cpi r24, 0x02 ; 2 188be: 69 f1 breq .+90 ; 0x1891a #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 188c0: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 188c4: 81 11 cpse r24, r1 188c6: 31 c0 rjmp .+98 ; 0x1892a MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 188c8: 86 e4 ldi r24, 0x46 ; 70 188ca: 9d e3 ldi r25, 0x3D ; 61 188cc: 0e 94 32 6d call 0xda64 ; 0xda64 188d0: 6b e0 ldi r22, 0x0B ; 11 188d2: 78 e3 ldi r23, 0x38 ; 56 188d4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 if (M79_timer_get_status()) { 188d8: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 188dc: 88 23 and r24, r24 188de: 29 f1 breq .+74 ; 0x1892a #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 188e0: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 188e4: 81 30 cpi r24, 0x01 ; 1 188e6: 09 f0 breq .+2 ; 0x188ea 188e8: 45 c1 rjmp .+650 ; 0x18b74 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 188ea: 86 e3 ldi r24, 0x36 ; 54 188ec: 9d e3 ldi r25, 0x3D ; 61 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 188ee: 0e 94 32 6d call 0xda64 ; 0xda64 188f2: 62 e9 ldi r22, 0x92 ; 146 188f4: 71 eb ldi r23, 0xB1 ; 177 188f6: 0f 94 99 93 call 0x32732 ; 0x32732 188fa: 17 c0 rjmp .+46 ; 0x1892a // 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()) { 188fc: 84 30 cpi r24, 0x04 ; 4 188fe: 09 f0 breq .+2 ; 0x18902 18900: ac cf rjmp .-168 ; 0x1885a 18902: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 18906: 88 23 and r24, r24 18908: 09 f4 brne .+2 ; 0x1890c 1890a: a7 cf rjmp .-178 ; 0x1885a MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1890c: 87 e6 ldi r24, 0x67 ; 103 1890e: 9d e3 ldi r25, 0x3D ; 61 18910: 0e 94 32 6d call 0xda64 ; 0xda64 18914: 6c e8 ldi r22, 0x8C ; 140 18916: 71 eb ldi r23, 0xB1 ; 177 18918: 9e cf rjmp .-196 ; 0x18856 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); 1891a: 80 e5 ldi r24, 0x50 ; 80 1891c: 9d e3 ldi r25, 0x3D ; 61 1891e: 0e 94 32 6d call 0xda64 ; 0xda64 18922: 6f e8 ldi r22, 0x8F ; 143 18924: 76 eb ldi r23, 0xB6 ; 182 18926: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #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) { 1892a: c0 91 06 12 lds r28, 0x1206 ; 0x801206 1892e: 0e 94 3e 61 call 0xc27c ; 0xc27c 18932: c1 11 cpse r28, r1 18934: 17 c0 rjmp .+46 ; 0x18964 18936: 90 91 05 12 lds r25, 0x1205 ; 0x801205 1893a: 91 11 cpse r25, r1 1893c: 13 c0 rjmp .+38 ; 0x18964 1893e: 81 11 cpse r24, r1 18940: 15 c0 rjmp .+42 ; 0x1896c 18942: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 18946: 81 11 cpse r24, r1 18948: 0d c0 rjmp .+26 ; 0x18964 if (usb_timer.running()) { 1894a: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 1894e: 88 23 and r24, r24 18950: 09 f4 brne .+2 ; 0x18954 18952: 13 c1 rjmp .+550 ; 0x18b7a MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 18954: 8c e1 ldi r24, 0x1C ; 28 18956: 9d e3 ldi r25, 0x3D ; 61 18958: 0e 94 32 6d call 0xda64 ; 0xda64 1895c: 67 e1 ldi r22, 0x17 ; 23 1895e: 78 e3 ldi r23, 0x38 ; 56 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18960: 0f 94 99 93 call 0x32732 ; 0x32732 } } } if (printingIsPaused() 18964: 0e 94 3e 61 call 0xc27c ; 0xc27c && !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) { 18968: 88 23 and r24, r24 1896a: f1 f0 breq .+60 ; 0x189a8 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1896c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 18970: 81 11 cpse r24, r1 18972: 1a c0 rjmp .+52 ; 0x189a8 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18974: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18978: 82 30 cpi r24, 0x02 ; 2 1897a: b1 f0 breq .+44 ; 0x189a8 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1897c: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18980: 82 30 cpi r24, 0x02 ; 2 18982: 21 f4 brne .+8 ; 0x1898c 18984: 90 91 e7 11 lds r25, 0x11E7 ; 0x8011e7 18988: 99 23 and r25, r25 1898a: 71 f0 breq .+28 ; 0x189a8 && custom_message_type != CustomMsg::Resuming) { 1898c: 90 91 c7 06 lds r25, 0x06C7 ; 0x8006c7 18990: 98 30 cpi r25, 0x08 ; 8 18992: 51 f0 breq .+20 ; 0x189a8 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 18994: 81 11 cpse r24, r1 18996: fd c0 rjmp .+506 ; 0x18b92 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 18998: 8d e0 ldi r24, 0x0D ; 13 1899a: 9d e3 ldi r25, 0x3D ; 61 1899c: 0e 94 32 6d call 0xda64 ; 0xda64 189a0: 6e e5 ldi r22, 0x5E ; 94 189a2: 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); 189a4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 189a8: 0e 94 49 61 call 0xc292 ; 0xc292 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189ac: 81 11 cpse r24, r1 189ae: 08 c0 rjmp .+16 ; 0x189c0 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())) 189b0: 0e 94 3e 61 call 0xc27c ; 0xc27c 189b4: 81 11 cpse r24, r1 189b6: 04 c0 rjmp .+8 ; 0x189c0 189b8: 0e 94 34 61 call 0xc268 ; 0xc268 189bc: 88 23 and r24, r24 189be: 81 f0 breq .+32 ; 0x189e0 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189c0: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 189c4: 81 30 cpi r24, 0x01 ; 1 189c6: 61 f0 breq .+24 ; 0x189e0 189c8: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 189cc: 81 11 cpse r24, r1 189ce: 08 c0 rjmp .+16 ; 0x189e0 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 189d0: 8e e0 ldi r24, 0x0E ; 14 189d2: 9e e3 ldi r25, 0x3E ; 62 189d4: 0e 94 32 6d call 0xda64 ; 0xda64 189d8: 67 e7 ldi r22, 0x77 ; 119 189da: 74 eb ldi r23, 0xB4 ; 180 189dc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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() 189e0: 0e 94 34 61 call 0xc268 ; 0xc268 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189e4: 81 11 cpse r24, r1 189e6: 95 c0 rjmp .+298 ; 0x18b12 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() 189e8: 0e 94 9a 61 call 0xc334 ; 0xc334 189ec: 81 11 cpse r24, r1 189ee: 91 c0 rjmp .+290 ; 0x18b12 189f0: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 189f4: 81 11 cpse r24, r1 189f6: 8d c0 rjmp .+282 ; 0x18b12 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189f8: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 189fc: 82 30 cpi r24, 0x02 ; 2 189fe: 09 f4 brne .+2 ; 0x18a02 18a00: 88 c0 rjmp .+272 ; 0x18b12 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18a02: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18a06: 81 11 cpse r24, r1 18a08: 05 c0 rjmp .+10 ; 0x18a14 || lcd_commands_type != LcdCommands::Idle) { 18a0a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a0e: 88 23 and r24, r24 18a10: 09 f4 brne .+2 ; 0x18a14 18a12: ce c0 rjmp .+412 ; 0x18bb0 if (!card.isFileOpen()) { 18a14: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 18a18: 81 11 cpse r24, r1 18a1a: 12 c0 rjmp .+36 ; 0x18a40 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18a1c: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18a20: 81 11 cpse r24, r1 18a22: 0e c0 rjmp .+28 ; 0x18a40 18a24: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a28: 81 11 cpse r24, r1 18a2a: 0a c0 rjmp .+20 ; 0x18a40 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18a2c: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 18a30: 8d ef ldi r24, 0xFD ; 253 18a32: 9c e3 ldi r25, 0x3C ; 60 18a34: 0e 94 32 6d call 0xda64 ; 0xda64 18a38: 68 e3 ldi r22, 0x38 ; 56 18a3a: 7c ee ldi r23, 0xEC ; 236 18a3c: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #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) { 18a40: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18a44: 81 11 cpse r24, r1 18a46: 12 c0 rjmp .+36 ; 0x18a6c const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18a48: 81 ea ldi r24, 0xA1 ; 161 18a4a: 9d e0 ldi r25, 0x0D ; 13 18a4c: 0f 94 3c a1 call 0x34278 ; 0x34278 18a50: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 18a52: 0e 94 a7 6f call 0xdf4e ; 0xdf4e if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 18a56: 87 fd sbrc r24, 7 18a58: 09 c0 rjmp .+18 ; 0x18a6c 18a5a: c8 17 cp r28, r24 18a5c: 39 f0 breq .+14 ; 0x18a6c MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 18a5e: c1 02 muls r28, r17 18a60: c0 01 movw r24, r0 18a62: 11 24 eor r1, r1 18a64: 87 5b subi r24, 0xB7 ; 183 18a66: 92 4f sbci r25, 0xF2 ; 242 18a68: 0e 94 7e b2 call 0x164fc ; 0x164fc SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 18a6c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 18a70: 81 11 cpse r24, r1 18a72: 4f c0 rjmp .+158 ; 0x18b12 18a74: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 18a78: 81 11 cpse r24, r1 18a7a: 4b c0 rjmp .+150 ; 0x18b12 if (MMU2::mmu2.Enabled()) { 18a7c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18a80: 81 30 cpi r24, 0x01 ; 1 18a82: 09 f0 breq .+2 ; 0x18a86 18a84: 9e c0 rjmp .+316 ; 0x18bc2 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 18a86: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 18a8a: 81 11 cpse r24, r1 18a8c: 0c c0 rjmp .+24 ; 0x18aa6 18a8e: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 18a92: 81 11 cpse r24, r1 18a94: 08 c0 rjmp .+16 ; 0x18aa6 // 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); 18a96: 8f ed ldi r24, 0xDF ; 223 18a98: 9c e3 ldi r25, 0x3C ; 60 18a9a: 0e 94 32 6d call 0xda64 ; 0xda64 18a9e: 6b e8 ldi r22, 0x8B ; 139 18aa0: 7b eb ldi r23, 0xBB ; 187 18aa2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 18aa6: 8e ec ldi r24, 0xCE ; 206 18aa8: 9c e3 ldi r25, 0x3C ; 60 18aaa: 0e 94 32 6d call 0xda64 ; 0xda64 18aae: 62 ec ldi r22, 0xC2 ; 194 18ab0: 7b eb ldi r23, 0xBB ; 187 18ab2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 18ab6: 8c eb ldi r24, 0xBC ; 188 18ab8: 9c e3 ldi r25, 0x3C ; 60 18aba: 0e 94 32 6d call 0xda64 ; 0xda64 18abe: 65 ec ldi r22, 0xC5 ; 197 18ac0: 7b eb ldi r23, 0xBB ; 187 18ac2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 18ac6: 83 eb ldi r24, 0xB3 ; 179 18ac8: 9a e5 ldi r25, 0x5A ; 90 18aca: 0e 94 32 6d call 0xda64 ; 0xda64 18ace: 68 ec ldi r22, 0xC8 ; 200 18ad0: 7b eb ldi r23, 0xBB ; 187 18ad2: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 18ad6: 8e ec ldi r24, 0xCE ; 206 18ad8: 9e e0 ldi r25, 0x0E ; 14 18ada: 0f 94 3c a1 call 0x34278 ; 0x34278 18ade: 88 23 and r24, r24 18ae0: 41 f0 breq .+16 ; 0x18af2 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 18ae2: 84 ea ldi r24, 0xA4 ; 164 18ae4: 9a e5 ldi r25, 0x5A ; 90 18ae6: 0e 94 32 6d call 0xda64 ; 0xda64 18aea: 6b ec ldi r22, 0xCB ; 203 18aec: 7b eb ldi r23, 0xBB ; 187 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 18aee: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 18af2: 88 ef ldi r24, 0xF8 ; 248 18af4: 9d e3 ldi r25, 0x3D ; 61 18af6: 0e 94 32 6d call 0xda64 ; 0xda64 18afa: 6d e4 ldi r22, 0x4D ; 77 18afc: 77 eb ldi r23, 0xB7 ; 183 18afe: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 18b02: 8a e8 ldi r24, 0x8A ; 138 18b04: 9c e3 ldi r25, 0x3C ; 60 18b06: 0e 94 32 6d call 0xda64 ; 0xda64 18b0a: 69 ea ldi r22, 0xA9 ; 169 18b0c: 78 eb ldi r23, 0xB8 ; 184 18b0e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 18b12: 8d e7 ldi r24, 0x7D ; 125 18b14: 9c e3 ldi r25, 0x3C ; 60 18b16: 0e 94 32 6d call 0xda64 ; 0xda64 18b1a: 6b e3 ldi r22, 0x3B ; 59 18b1c: 78 e3 ldi r23, 0x38 ; 56 18b1e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 18b22: 80 e7 ldi r24, 0x70 ; 112 18b24: 9c e3 ldi r25, 0x3C ; 60 18b26: 0e 94 32 6d call 0xda64 ; 0xda64 18b2a: 67 e6 ldi r22, 0x67 ; 103 18b2c: 77 e3 ldi r23, 0x37 ; 55 18b2e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #endif if (MMU2::mmu2.Enabled()) { 18b32: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18b36: 81 30 cpi r24, 0x01 ; 1 18b38: 41 f4 brne .+16 ; 0x18b4a MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 18b3a: 8f e5 ldi r24, 0x5F ; 95 18b3c: 9c e3 ldi r25, 0x3C ; 60 18b3e: 0e 94 32 6d call 0xda64 ; 0xda64 18b42: 64 ed ldi r22, 0xD4 ; 212 18b44: 7e ef ldi r23, 0xFE ; 254 18b46: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 18b4a: 85 e5 ldi r24, 0x55 ; 85 18b4c: 9c e3 ldi r25, 0x3C ; 60 18b4e: 0e 94 32 6d call 0xda64 ; 0xda64 18b52: 69 e3 ldi r22, 0x39 ; 57 18b54: 77 e3 ldi r23, 0x37 ; 55 18b56: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_END(); 18b5a: 0f 94 f0 93 call 0x327e0 ; 0x327e0 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18b5e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18b62: 8f 5f subi r24, 0xFF ; 255 18b64: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 18b68: 80 91 30 04 lds r24, 0x0430 ; 0x800430 18b6c: 8f 5f subi r24, 0xFF ; 255 18b6e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 18b72: 49 ce rjmp .-878 ; 0x18806 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); 18b74: 8a e2 ldi r24, 0x2A ; 42 18b76: 9d e3 ldi r25, 0x3D ; 61 18b78: ba ce rjmp .-652 ; 0x188ee } } 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) { 18b7a: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 18b7e: 88 23 and r24, r24 18b80: 09 f4 brne .+2 ; 0x18b84 18b82: f0 ce rjmp .-544 ; 0x18964 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18b84: 8c e1 ldi r24, 0x1C ; 28 18b86: 9d e3 ldi r25, 0x3D ; 61 18b88: 0e 94 32 6d call 0xda64 ; 0xda64 18b8c: 67 e5 ldi r22, 0x57 ; 87 18b8e: 78 e3 ldi r23, 0x38 ; 56 18b90: e7 ce rjmp .-562 ; 0x18960 #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())) { 18b92: 81 30 cpi r24, 0x01 ; 1 18b94: 09 f0 breq .+2 ; 0x18b98 18b96: 08 cf rjmp .-496 ; 0x189a8 18b98: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 18b9c: 88 23 and r24, r24 18b9e: 09 f4 brne .+2 ; 0x18ba2 18ba0: 03 cf rjmp .-506 ; 0x189a8 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 18ba2: 8d e0 ldi r24, 0x0D ; 13 18ba4: 9d e3 ldi r25, 0x3D ; 61 18ba6: 0e 94 32 6d call 0xda64 ; 0xda64 18baa: 6a e8 ldi r22, 0x8A ; 138 18bac: 76 ee ldi r23, 0xE6 ; 230 18bae: fa ce rjmp .-524 ; 0x189a4 #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 18bb0: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 18bb4: 80 ef ldi r24, 0xF0 ; 240 18bb6: 9c e3 ldi r25, 0x3C ; 60 18bb8: 0e 94 32 6d call 0xda64 ; 0xda64 18bbc: 0f 94 e7 96 call 0x32dce ; 0x32dce 18bc0: 3f cf rjmp .-386 ; 0x18a40 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 18bc2: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18bc6: 88 23 and r24, r24 18bc8: e1 f0 breq .+56 ; 0x18c02 if (!fsensor.getAutoLoadEnabled()) { 18bca: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bce: 81 11 cpse r24, r1 18bd0: 08 c0 rjmp .+16 ; 0x18be2 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18bd2: 8c ea ldi r24, 0xAC ; 172 18bd4: 9c e3 ldi r25, 0x3C ; 60 18bd6: 0e 94 32 6d call 0xda64 ; 0xda64 18bda: 65 e2 ldi r22, 0x25 ; 37 18bdc: 77 e3 ldi r23, 0x37 ; 55 18bde: 0f 94 9a 96 call 0x32d34 ; 0x32d34 } if (!fsensor.getFilamentPresent()) { 18be2: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 18be6: 81 11 cpse r24, r1 18be8: 14 c0 rjmp .+40 ; 0x18c12 if (fsensor.getAutoLoadEnabled()) { 18bea: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bee: 88 23 and r24, r24 18bf0: 09 f4 brne .+2 ; 0x18bf4 18bf2: 7f cf rjmp .-258 ; 0x18af2 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 18bf4: 88 e9 ldi r24, 0x98 ; 152 18bf6: 9c e3 ldi r25, 0x3C ; 60 18bf8: 0e 94 32 6d call 0xda64 ; 0xda64 18bfc: 6b e0 ldi r22, 0x0B ; 11 18bfe: 77 e3 ldi r23, 0x37 ; 55 18c00: 76 cf rjmp .-276 ; 0x18aee } else { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18c02: 8c ea ldi r24, 0xAC ; 172 18c04: 9c e3 ldi r25, 0x3C ; 60 18c06: 0e 94 32 6d call 0xda64 ; 0xda64 18c0a: 65 e2 ldi r22, 0x25 ; 37 18c0c: 77 e3 ldi r23, 0x37 ; 55 18c0e: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 18c12: 8c eb ldi r24, 0xBC ; 188 18c14: 9c e3 ldi r25, 0x3C ; 60 18c16: 0e 94 32 6d call 0xda64 ; 0xda64 18c1a: 61 ef ldi r22, 0xF1 ; 241 18c1c: 77 e3 ldi r23, 0x37 ; 55 18c1e: 67 cf rjmp .-306 ; 0x18aee #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 18c20: df 91 pop r29 18c22: cf 91 pop r28 18c24: 1f 91 pop r17 18c26: 08 95 ret 00018c28 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 18c28: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18c2c: 88 23 and r24, r24 18c2e: 61 f0 breq .+24 ; 0x18c48 18c30: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 18c34: 88 23 and r24, r24 18c36: 41 f0 breq .+16 ; 0x18c48 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 18c38: 8f e4 ldi r24, 0x4F ; 79 18c3a: 9a e3 ldi r25, 0x3A ; 58 18c3c: 0e 94 32 6d call 0xda64 ; 0xda64 18c40: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 18c44: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 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; 18c48: 85 e0 ldi r24, 0x05 ; 5 18c4a: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 18c4e: fa cf rjmp .-12 ; 0x18c44 00018c50 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 18c50: cf 93 push r28 18c52: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18c54: 86 ea ldi r24, 0xA6 ; 166 18c56: 9c e0 ldi r25, 0x0C ; 12 18c58: 0f 94 3c a1 call 0x34278 ; 0x34278 status &= ~components; 18c5c: c0 95 com r28 18c5e: 6c 2f mov r22, r28 18c60: 68 23 and r22, r24 18c62: 86 ea ldi r24, 0xA6 ; 166 18c64: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18c66: cf 91 pop r28 18c68: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 00018c6c : } } } static void lcd_reset_sheet() { 18c6c: 1f 93 push r17 18c6e: cf 93 push r28 18c70: df 93 push r29 18c72: 00 d0 rcall .+0 ; 0x18c74 18c74: 00 d0 rcall .+0 ; 0x18c76 18c76: 1f 92 push r1 18c78: 1f 92 push r1 18c7a: cd b7 in r28, 0x3d ; 61 18c7c: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 18c7e: be 01 movw r22, r28 18c80: 6f 5f subi r22, 0xFF ; 255 18c82: 7f 4f sbci r23, 0xFF ; 255 18c84: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c88: 0e 94 c9 6f call 0xdf92 ; 0xdf92 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 18c8c: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c90: 1b e0 ldi r17, 0x0B ; 11 18c92: 81 9f mul r24, r17 18c94: c0 01 movw r24, r0 18c96: 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); 18c98: 6f ef ldi r22, 0xFF ; 255 18c9a: 7f ef ldi r23, 0xFF ; 255 18c9c: 80 5b subi r24, 0xB0 ; 176 18c9e: 92 4f sbci r25, 0xF2 ; 242 18ca0: 0f 94 7e a1 call 0x342fc ; 0x342fc eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 18ca4: 60 91 98 03 lds r22, 0x0398 ; 0x800398 18ca8: 61 9f mul r22, r17 18caa: b0 01 movw r22, r0 18cac: 11 24 eor r1, r1 18cae: 67 5b subi r22, 0xB7 ; 183 18cb0: 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); 18cb2: 47 e0 ldi r20, 0x07 ; 7 18cb4: 50 e0 ldi r21, 0x00 ; 0 18cb6: ce 01 movw r24, r28 18cb8: 01 96 adiw r24, 0x01 ; 1 18cba: 0f 94 50 a1 call 0x342a0 ; 0x342a0 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 18cbe: 81 ea ldi r24, 0xA1 ; 161 18cc0: 9d e0 ldi r25, 0x0D ; 13 18cc2: 0f 94 3c a1 call 0x34278 ; 0x34278 18cc6: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18cca: 89 13 cpse r24, r25 18ccc: 0a c0 rjmp .+20 ; 0x18ce2 { eeprom_switch_to_next_sheet(); 18cce: 0e 94 bb 6f call 0xdf76 ; 0xdf76 if (-1 == eeprom_next_initialized_sheet(0)) 18cd2: 80 e0 ldi r24, 0x00 ; 0 18cd4: 0e 94 a7 6f call 0xdf4e ; 0xdf4e 18cd8: 8f 3f cpi r24, 0xFF ; 255 18cda: 19 f4 brne .+6 ; 0x18ce2 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18cdc: 80 e1 ldi r24, 0x10 ; 16 18cde: 0e 94 28 c6 call 0x18c50 ; 0x18c50 } menu_back(); 18ce2: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 } 18ce6: 28 96 adiw r28, 0x08 ; 8 18ce8: 0f b6 in r0, 0x3f ; 63 18cea: f8 94 cli 18cec: de bf out 0x3e, r29 ; 62 18cee: 0f be out 0x3f, r0 ; 63 18cf0: cd bf out 0x3d, r28 ; 61 18cf2: df 91 pop r29 18cf4: cf 91 pop r28 18cf6: 1f 91 pop r17 18cf8: 08 95 ret 00018cfa : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 18cfa: cf 93 push r28 18cfc: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18cfe: 86 ea ldi r24, 0xA6 ; 166 18d00: 9c e0 ldi r25, 0x0C ; 12 18d02: 0f 94 3c a1 call 0x34278 ; 0x34278 status |= components; 18d06: 68 2f mov r22, r24 18d08: 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); 18d0a: 86 ea ldi r24, 0xA6 ; 166 18d0c: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18d0e: cf 91 pop r28 18d10: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 00018d14 : //! @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) 18d14: 2f 92 push r2 18d16: 3f 92 push r3 18d18: 4f 92 push r4 18d1a: 5f 92 push r5 18d1c: 6f 92 push r6 18d1e: 7f 92 push r7 18d20: 8f 92 push r8 18d22: 9f 92 push r9 18d24: af 92 push r10 18d26: bf 92 push r11 18d28: cf 92 push r12 18d2a: df 92 push r13 18d2c: ef 92 push r14 18d2e: ff 92 push r15 18d30: 0f 93 push r16 18d32: 1f 93 push r17 18d34: cf 93 push r28 18d36: df 93 push r29 18d38: cd b7 in r28, 0x3d ; 61 18d3a: de b7 in r29, 0x3e ; 62 18d3c: ce 5c subi r28, 0xCE ; 206 18d3e: d1 09 sbc r29, r1 18d40: 0f b6 in r0, 0x3f ; 63 18d42: f8 94 cli 18d44: de bf out 0x3e, r29 ; 62 18d46: 0f be out 0x3f, r0 ; 63 18d48: cd bf out 0x3d, r28 ; 61 18d4a: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 18d4c: 81 11 cpse r24, r1 18d4e: 04 c0 rjmp .+8 ; 0x18d58 { disable_heater(); 18d50: 0f 94 b9 12 call 0x22572 ; 0x22572 eeprom_adjust_bed_reset(); //reset bed level correction 18d54: 0e 94 f0 6f call 0xdfe0 ; 0xdfe0 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 18d58: 80 e0 ldi r24, 0x00 ; 0 18d5a: 0e 94 41 6a call 0xd482 ; 0xd482 // Let the planner use the uncorrected coordinates. mbl.reset(); 18d5e: 0f 94 51 57 call 0x2aea2 ; 0x2aea2 // 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(); 18d62: 0f 94 bc 90 call 0x32178 ; 0x32178 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 18d66: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 18d6a: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> // 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)); 18d6e: e3 ea ldi r30, 0xA3 ; 163 18d70: f6 e0 ldi r31, 0x06 ; 6 18d72: 83 e0 ldi r24, 0x03 ; 3 18d74: df 01 movw r26, r30 18d76: 1d 92 st X+, r1 18d78: 8a 95 dec r24 18d7a: e9 f7 brne .-6 ; 0x18d76 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 18d7c: 81 e0 ldi r24, 0x01 ; 1 18d7e: 0e 94 6f 60 call 0xc0de ; 0xc0de 18d82: c7 55 subi r28, 0x57 ; 87 18d84: df 4f sbci r29, 0xFF ; 255 18d86: 99 83 std Y+1, r25 ; 0x01 18d88: 88 83 st Y, r24 18d8a: c9 5a subi r28, 0xA9 ; 169 18d8c: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 18d8e: 87 ef ldi r24, 0xF7 ; 247 18d90: 98 e4 ldi r25, 0x48 ; 72 18d92: 0e 94 32 6d call 0xda64 ; 0xda64 18d96: 0f 94 f4 0a call 0x215e8 ; 0x215e8 raise_z_above(MESH_HOME_Z_SEARCH); 18d9a: 60 e0 ldi r22, 0x00 ; 0 18d9c: 70 e0 ldi r23, 0x00 ; 0 18d9e: 80 ea ldi r24, 0xA0 ; 160 18da0: 90 e4 ldi r25, 0x40 ; 64 18da2: 0e 94 c0 67 call 0xcf80 ; 0xcf80 } /**/ void home_xy() { set_destination_to_current(); 18da6: 0e 94 b7 61 call 0xc36e ; 0xc36e homeaxis(X_AXIS); 18daa: 80 e0 ldi r24, 0x00 ; 0 18dac: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 homeaxis(Y_AXIS); 18db0: 81 e0 ldi r24, 0x01 ; 1 18db2: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 plan_set_position_curposXYZE(); 18db6: 0f 94 90 84 call 0x30920 ; 0x30920 endstops_hit_on_purpose(); 18dba: 0f 94 f4 2c call 0x259e8 ; 0x259e8 18dbe: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 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; 18dc2: 20 e0 ldi r18, 0x00 ; 0 18dc4: 30 e0 ldi r19, 0x00 ; 0 18dc6: 40 ea ldi r20, 0xA0 ; 160 18dc8: 50 e4 ldi r21, 0x40 ; 64 18dca: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 18dce: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 18dd2: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 18dd6: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 18dda: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 18dde: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 18de2: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 18de6: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 18dea: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] += 5; 18dee: 20 e0 ldi r18, 0x00 ; 0 18df0: 30 e0 ldi r19, 0x00 ; 0 18df2: 40 ea ldi r20, 0xA0 ; 160 18df4: 50 e4 ldi r21, 0x40 ; 64 18df6: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 18dfa: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 18dfe: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 18e02: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 18e06: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 18e0a: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 18e0e: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 18e12: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 18e16: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18e1a: 60 e0 ldi r22, 0x00 ; 0 18e1c: 70 e0 ldi r23, 0x00 ; 0 18e1e: 80 ea ldi r24, 0xA0 ; 160 18e20: 91 e4 ldi r25, 0x41 ; 65 18e22: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 18e26: 0f 94 a0 22 call 0x24540 ; 0x24540 // 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)) 18e2a: 81 2f mov r24, r17 18e2c: 0f 94 51 35 call 0x26aa2 ; 0x26aa2 18e30: e5 96 adiw r28, 0x35 ; 53 18e32: 8f af std Y+63, r24 ; 0x3f 18e34: e5 97 sbiw r28, 0x35 ; 53 18e36: 81 11 cpse r24, r1 18e38: 04 c0 rjmp .+8 ; 0x18e42 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 18e3a: e5 96 adiw r28, 0x35 ; 53 18e3c: 1f ae std Y+63, r1 ; 0x3f 18e3e: e5 97 sbiw r28, 0x35 ; 53 18e40: 08 c3 rjmp .+1552 ; 0x19452 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 18e42: 8b eb ldi r24, 0xBB ; 187 18e44: 98 e4 ldi r25, 0x48 ; 72 18e46: 0e 94 32 6d call 0xda64 ; 0xda64 18e4a: 0f 94 7b 0b call 0x216f6 ; 0x216f6 if(onlyZ){ 18e4e: 11 23 and r17, r17 18e50: 09 f4 brne .+2 ; 0x18e54 18e52: da c2 rjmp .+1460 ; 0x19408 prompt_steel_sheet_on_bed(true); 18e54: 81 e0 ldi r24, 0x01 ; 1 18e56: 0f 94 da 2f call 0x25fb4 ; 0x25fb4 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 18e5a: 89 e8 ldi r24, 0x89 ; 137 18e5c: 98 e4 ldi r25, 0x48 ; 72 18e5e: 0e 94 32 6d call 0xda64 ; 0xda64 18e62: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_puts_at_P(0,3,_n("1/9")); 18e66: 4e e5 ldi r20, 0x5E ; 94 18e68: 5a e6 ldi r21, 0x6A ; 106 }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")); 18e6a: 63 e0 ldi r22, 0x03 ; 3 18e6c: 80 e0 ldi r24, 0x00 ; 0 18e6e: 0e 94 10 6a call 0xd420 ; 0xd420 } refresh_cmd_timeout(); 18e72: 0e 94 4a 60 call 0xc094 ; 0xc094 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 18e76: 11 11 cpse r17, r1 18e78: 1b c0 rjmp .+54 ; 0x18eb0 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18e7a: 84 e0 ldi r24, 0x04 ; 4 18e7c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 18e80: 80 e0 ldi r24, 0x00 ; 0 18e82: 0f 94 da 2f call 0x25fb4 ; 0x25fb4 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 18e86: 8f ec ldi r24, 0xCF ; 207 18e88: 97 e4 ldi r25, 0x47 ; 71 18e8a: 0e 94 32 6d call 0xda64 ; 0xda64 18e8e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 KEEPALIVE_STATE(IN_HANDLER); 18e92: 82 e0 ldi r24, 0x02 ; 2 18e94: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 18e98: 87 e6 ldi r24, 0x67 ; 103 18e9a: 98 e4 ldi r25, 0x48 ; 72 18e9c: 0e 94 32 6d call 0xda64 ; 0xda64 18ea0: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_puts_at_P(0,3,_n("1/4")); 18ea4: 46 e5 ldi r20, 0x56 ; 86 18ea6: 5a e6 ldi r21, 0x6A ; 106 18ea8: 63 e0 ldi r22, 0x03 ; 3 18eaa: 80 e0 ldi r24, 0x00 ; 0 18eac: 0e 94 10 6a call 0xd420 ; 0xd420 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 18eb0: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> check_endstops = check; 18eb4: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 18eb8: 60 e0 ldi r22, 0x00 ; 0 18eba: 70 e0 ldi r23, 0x00 ; 0 18ebc: 80 e8 ldi r24, 0x80 ; 128 18ebe: 9f eb ldi r25, 0xBF ; 191 18ec0: 0e 94 5e 67 call 0xcebc ; 0xcebc // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 18ec4: c1 2c mov r12, r1 18ec6: d1 2c mov r13, r1 18ec8: b0 ea ldi r27, 0xA0 ; 160 18eca: eb 2e mov r14, r27 18ecc: b0 e4 ldi r27, 0x40 ; 64 18ece: fb 2e mov r15, r27 18ed0: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18ed4: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18ed8: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18edc: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18ee0: 81 e0 ldi r24, 0x01 ; 1 18ee2: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18ee6: 60 e0 ldi r22, 0x00 ; 0 18ee8: 70 e0 ldi r23, 0x00 ; 0 18eea: 80 ea ldi r24, 0xA0 ; 160 18eec: 91 e4 ldi r25, 0x41 ; 65 18eee: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 18ef2: 0f 94 a0 22 call 0x24540 ; 0x24540 18ef6: 00 93 77 02 sts 0x0277, r16 ; 0x800277 <_ZL14check_endstops.lto_priv.362> #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)) && 18efa: 82 e0 ldi r24, 0x02 ; 2 18efc: 0f 94 8c 22 call 0x24518 ; 0x24518 18f00: 2d ec ldi r18, 0xCD ; 205 18f02: 3c ec ldi r19, 0xCC ; 204 18f04: 44 ea ldi r20, 0xA4 ; 164 18f06: 50 e4 ldi r21, 0x40 ; 64 18f08: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 18f0c: 18 16 cp r1, r24 18f0e: 0c f4 brge .+2 ; 0x18f12 18f10: 84 c2 rjmp .+1288 ; 0x1941a (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 18f12: 82 e0 ldi r24, 0x02 ; 2 18f14: 0f 94 8c 22 call 0x24518 ; 0x24518 #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)) && 18f18: 23 e3 ldi r18, 0x33 ; 51 18f1a: 33 e3 ldi r19, 0x33 ; 51 18f1c: 4b e9 ldi r20, 0x9B ; 155 18f1e: 50 e4 ldi r21, 0x40 ; 64 18f20: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 18f24: 87 fd sbrc r24, 7 18f26: 79 c2 rjmp .+1266 ; 0x1941a (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 18f28: 11 11 cpse r17, r1 18f2a: 7c c2 rjmp .+1272 ; 0x19424 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18f2c: 80 e1 ldi r24, 0x10 ; 16 18f2e: 0e 94 28 c6 call 0x18c50 ; 0x18c50 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 18f32: 81 ea ldi r24, 0xA1 ; 161 18f34: 9d e0 ldi r25, 0x0D ; 13 18f36: 0f 94 3c a1 call 0x34278 ; 0x34278 18f3a: bb e0 ldi r27, 0x0B ; 11 18f3c: 8b 9f mul r24, r27 18f3e: c0 01 movw r24, r0 18f40: 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); 18f42: 70 e0 ldi r23, 0x00 ; 0 18f44: 60 e0 ldi r22, 0x00 ; 0 18f46: 80 5b subi r24, 0xB0 ; 176 18f48: 92 4f sbci r25, 0xF2 ; 242 18f4a: 0f 94 7e a1 call 0x342fc ; 0x342fc } 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(); 18f4e: 0e 94 4a 60 call 0xc094 ; 0xc094 // 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); 18f52: ed e9 ldi r30, 0x9D ; 157 18f54: f2 e1 ldi r31, 0x12 ; 18 18f56: 84 ec ldi r24, 0xC4 ; 196 18f58: df 01 movw r26, r30 18f5a: 1d 92 st X+, r1 18f5c: 8a 95 dec r24 18f5e: e9 f7 brne .-6 ; 0x18f5a { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 18f60: 84 e7 ldi r24, 0x74 ; 116 18f62: 99 e8 ldi r25, 0x89 ; 137 18f64: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 MYSERIAL.println(int(iteration + 1)); 18f68: 81 e0 ldi r24, 0x01 ; 1 18f6a: 90 e0 ldi r25, 0x00 ; 0 18f6c: 0f 94 00 42 call 0x28400 ; 0x28400 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)); 18f70: 87 e6 ldi r24, 0x67 ; 103 18f72: 98 e4 ldi r25, 0x48 ; 72 18f74: 0e 94 32 6d call 0xda64 ; 0xda64 18f78: 0f 94 f4 0a call 0x215e8 ; 0x215e8 #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; 18f7c: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18f80: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18f84: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18f88: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18f8c: b2 e0 ldi r27, 0x02 ; 2 18f8e: e1 96 adiw r28, 0x31 ; 49 18f90: bf af std Y+63, r27 ; 0x3f 18f92: e1 97 sbiw r28, 0x31 ; 49 18f94: 2f e4 ldi r18, 0x4F ; 79 18f96: 39 e8 ldi r19, 0x89 ; 137 18f98: cd 56 subi r28, 0x6D ; 109 18f9a: df 4f sbci r29, 0xFF ; 255 18f9c: 39 83 std Y+1, r19 ; 0x01 18f9e: 28 83 st Y, r18 18fa0: c3 59 subi r28, 0x93 ; 147 18fa2: d0 40 sbci r29, 0x00 ; 0 18fa4: 4c e9 ldi r20, 0x9C ; 156 18fa6: 52 e1 ldi r21, 0x12 ; 18 18fa8: cf 56 subi r28, 0x6F ; 111 18faa: df 4f sbci r29, 0xFF ; 255 18fac: 59 83 std Y+1, r21 ; 0x01 18fae: 48 83 st Y, r20 18fb0: c1 59 subi r28, 0x91 ; 145 18fb2: d0 40 sbci r29, 0x00 ; 0 18fb4: a0 96 adiw r28, 0x20 ; 32 18fb6: 5f af std Y+63, r21 ; 0x3f 18fb8: 4e af std Y+62, r20 ; 0x3e 18fba: a0 97 sbiw r28, 0x20 ; 32 18fbc: e0 96 adiw r28, 0x30 ; 48 18fbe: 3f af std Y+63, r19 ; 0x3f 18fc0: 2e af std Y+62, r18 ; 0x3e 18fc2: 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; 18fc4: a7 96 adiw r28, 0x27 ; 39 18fc6: 1f ae std Y+63, r1 ; 0x3f 18fc8: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 18fca: 31 2c mov r3, r1 18fcc: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 18fce: 0e 94 4a 60 call 0xc094 ; 0xc094 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 18fd2: 63 e0 ldi r22, 0x03 ; 3 18fd4: 80 e0 ldi r24, 0x00 ; 0 18fd6: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%d/4"),(k+1)); 18fda: bf ef ldi r27, 0xFF ; 255 18fdc: 2b 1a sub r2, r27 18fde: 3b 0a sbc r3, r27 18fe0: 3f 92 push r3 18fe2: 2f 92 push r2 18fe4: ef e6 ldi r30, 0x6F ; 111 18fe6: f9 e8 ldi r31, 0x89 ; 137 18fe8: ff 93 push r31 18fea: ef 93 push r30 18fec: 0e 94 d5 69 call 0xd3aa ; 0xd3aa } #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); 18ff0: 65 e5 ldi r22, 0x55 ; 85 18ff2: 75 e5 ldi r23, 0x55 ; 85 18ff4: 85 e5 ldi r24, 0x55 ; 85 18ff6: 91 e4 ldi r25, 0x41 ; 65 18ff8: 0f 94 82 88 call 0x31104 ; 0x31104 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); 18ffc: e0 96 adiw r28, 0x30 ; 48 18ffe: ee ad ldd r30, Y+62 ; 0x3e 19000: ff ad ldd r31, Y+63 ; 0x3f 19002: e0 97 sbiw r28, 0x30 ; 48 19004: 85 91 lpm r24, Z+ 19006: 95 91 lpm r25, Z+ 19008: a5 91 lpm r26, Z+ 1900a: b4 91 lpm r27, Z 1900c: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 19010: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 19014: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 19018: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1901c: e0 96 adiw r28, 0x30 ; 48 1901e: ee ad ldd r30, Y+62 ; 0x3e 19020: ff ad ldd r31, Y+63 ; 0x3f 19022: e0 97 sbiw r28, 0x30 ; 48 19024: 34 96 adiw r30, 0x04 ; 4 19026: 85 91 lpm r24, Z+ 19028: 95 91 lpm r25, Z+ 1902a: a5 91 lpm r26, Z+ 1902c: b4 91 lpm r27, Z 1902e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 19032: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19036: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1903a: 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); 1903e: 60 e0 ldi r22, 0x00 ; 0 19040: 70 e0 ldi r23, 0x00 ; 0 19042: 88 e4 ldi r24, 0x48 ; 72 19044: 92 e4 ldi r25, 0x42 ; 66 19046: 0f 94 82 88 call 0x31104 ; 0x31104 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1904a: 44 ed ldi r20, 0xD4 ; 212 1904c: 57 e8 ldi r21, 0x87 ; 135 1904e: 5f 93 push r21 19050: 4f 93 push r20 19052: 0f 94 fe 9f call 0x33ffc ; 0x33ffc lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 19056: 43 ec ldi r20, 0xC3 ; 195 19058: 57 e8 ldi r21, 0x87 ; 135 1905a: 63 e0 ldi r22, 0x03 ; 3 1905c: 84 e0 ldi r24, 0x04 ; 4 1905e: 0e 94 10 6a call 0xd420 ; 0xd420 // disable heaters and stop motion before we initialize sm4 disable_heater(); 19062: 0f 94 b9 12 call 0x22572 ; 0x22572 st_synchronize(); 19066: 0f 94 a0 22 call 0x24540 ; 0x24540 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1906a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1906e: 8d 7f andi r24, 0xFD ; 253 19070: 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" ); 19074: 0f b6 in r0, 0x3f ; 63 19076: f8 94 cli 19078: a8 95 wdr 1907a: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1907e: 88 61 ori r24, 0x18 ; 24 19080: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19084: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19088: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1908a: 10 92 28 05 sts 0x0528, r1 ; 0x800528 1908e: 10 92 27 05 sts 0x0527, r1 ; 0x800527 sm4_update_pos_cb = xyzcal_update_pos; 19092: 8b ef ldi r24, 0xFB ; 251 19094: 90 eb ldi r25, 0xB0 ; 176 19096: 90 93 26 05 sts 0x0526, r25 ; 0x800526 1909a: 80 93 25 05 sts 0x0525, r24 ; 0x800525 sm4_calc_delay_cb = xyzcal_calc_delay; 1909e: aa e5 ldi r26, 0x5A ; 90 190a0: b0 eb ldi r27, 0xB0 ; 176 190a2: b0 93 24 05 sts 0x0524, r27 ; 0x800524 190a6: 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]); 190aa: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 190ae: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 190b2: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 190b6: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 190ba: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 190be: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 190c2: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 190c6: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 190ca: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 190ce: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 190d2: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 190d6: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 190da: 3f 93 push r19 190dc: 2f 93 push r18 190de: 1f 93 push r17 190e0: 0f 93 push r16 190e2: 7f 93 push r23 190e4: 6f 93 push r22 190e6: 5f 93 push r21 190e8: 4f 93 push r20 190ea: bf 93 push r27 190ec: af 93 push r26 190ee: 9f 93 push r25 190f0: 8f 93 push r24 190f2: e3 e7 ldi r30, 0x73 ; 115 190f4: f8 e8 ldi r31, 0x88 ; 136 190f6: ff 93 push r31 190f8: ef 93 push r30 190fa: 0f 94 fe 9f call 0x33ffc ; 0x33ffc int16_t x0 = _X; 190fe: 40 90 b6 06 lds r4, 0x06B6 ; 0x8006b6 19102: 50 90 b7 06 lds r5, 0x06B7 ; 0x8006b7 19106: 60 90 b8 06 lds r6, 0x06B8 ; 0x8006b8 1910a: 70 90 b9 06 lds r7, 0x06B9 ; 0x8006b9 1910e: b4 2c mov r11, r4 19110: a5 2c mov r10, r5 int16_t y0 = _Y; 19112: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19116: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 1911a: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 1911e: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19122: a6 96 adiw r28, 0x26 ; 38 19124: 8c af std Y+60, r24 ; 0x3c 19126: 9d af std Y+61, r25 ; 0x3d 19128: ae af std Y+62, r26 ; 0x3e 1912a: bf af std Y+63, r27 ; 0x3f 1912c: a6 97 sbiw r28, 0x26 ; 38 1912e: a3 96 adiw r28, 0x23 ; 35 19130: 9f ac ldd r9, Y+63 ; 0x3f 19132: a3 97 sbiw r28, 0x23 ; 35 19134: a4 96 adiw r28, 0x24 ; 36 19136: 8f ac ldd r8, Y+63 ; 0x3f 19138: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1913a: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 1913e: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 19142: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 19146: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 1914a: 0f b6 in r0, 0x3f ; 63 1914c: f8 94 cli 1914e: de bf out 0x3e, r29 ; 62 19150: 0f be out 0x3f, r0 ; 63 19152: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 19154: b5 e0 ldi r27, 0x05 ; 5 19156: cb 16 cp r12, r27 19158: b7 ef ldi r27, 0xF7 ; 247 1915a: db 06 cpc r13, r27 1915c: 0c f4 brge .+2 ; 0x19160 1915e: d3 c1 rjmp .+934 ; 0x19506 } 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; 19160: 1a 82 std Y+2, r1 ; 0x02 19162: 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); 19164: 1f 92 push r1 19166: 1f 92 push r1 19168: e3 e0 ldi r30, 0x03 ; 3 1916a: ef 93 push r30 1916c: f4 e8 ldi r31, 0x84 ; 132 1916e: ff 93 push r31 19170: 1f 92 push r1 19172: 24 e6 ldi r18, 0x64 ; 100 19174: 2f 93 push r18 19176: df 92 push r13 19178: cf 92 push r12 1917a: 8f 92 push r8 1917c: 9f 92 push r9 1917e: af 92 push r10 19180: bf 92 push r11 19182: 4a ee ldi r20, 0xEA ; 234 19184: 57 e8 ldi r21, 0x87 ; 135 19186: 5f 93 push r21 19188: 4f 93 push r20 1918a: 0f 94 fe 9f call 0x33ffc ; 0x33ffc if (!ret && (ad < 720)) 1918e: 0f b6 in r0, 0x3f ; 63 19190: f8 94 cli 19192: de bf out 0x3e, r29 ; 62 19194: 0f be out 0x3f, r0 ; 63 19196: cd bf out 0x3d, r28 ; 61 19198: 89 81 ldd r24, Y+1 ; 0x01 1919a: 9a 81 ldd r25, Y+2 ; 0x02 1919c: 80 3d cpi r24, 0xD0 ; 208 1919e: 92 40 sbci r25, 0x02 ; 2 191a0: 08 f4 brcc .+2 ; 0x191a4 191a2: 7c c1 rjmp .+760 ; 0x1949c if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 191a4: 89 81 ldd r24, Y+1 ; 0x01 191a6: 9a 81 ldd r25, Y+2 ; 0x02 191a8: 80 3a cpi r24, 0xA0 ; 160 191aa: 95 40 sbci r25, 0x05 ; 5 191ac: 10 f0 brcs .+4 ; 0x191b2 191ae: 0c 94 ce d7 jmp 0x1af9c ; 0x1af9c if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 191b2: 9e 01 movw r18, r28 191b4: 2f 5f subi r18, 0xFF ; 255 191b6: 3f 4f sbci r19, 0xFF ; 255 191b8: 79 01 movw r14, r18 191ba: 10 e0 ldi r17, 0x00 ; 0 191bc: 00 e0 ldi r16, 0x00 ; 0 191be: 2c e7 ldi r18, 0x7C ; 124 191c0: 3c ef ldi r19, 0xFC ; 252 191c2: a6 01 movw r20, r12 191c4: 44 56 subi r20, 0x64 ; 100 191c6: 51 09 sbc r21, r1 191c8: 69 2d mov r22, r9 191ca: 78 2d mov r23, r8 191cc: 8b 2d mov r24, r11 191ce: 9a 2d mov r25, r10 191d0: 0f 94 2c 60 call 0x2c058 ; 0x2c058 191d4: 88 23 and r24, r24 191d6: 11 f4 brne .+4 ; 0x191dc 191d8: 0c 94 ce d7 jmp 0x1af9c ; 0x1af9c ad += 720; 191dc: 89 81 ldd r24, Y+1 ; 0x01 191de: 9a 81 ldd r25, Y+2 ; 0x02 191e0: 80 53 subi r24, 0x30 ; 48 191e2: 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); 191e4: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 191e8: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 191ec: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 191f0: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 191f4: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 191f8: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 191fc: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 19200: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 19204: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 19208: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 1920c: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 19210: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 19214: 9f 93 push r25 19216: 8f 93 push r24 19218: df 92 push r13 1921a: cf 92 push r12 1921c: 1f 93 push r17 1921e: 0f 93 push r16 19220: 5f 93 push r21 19222: 4f 93 push r20 19224: 8f e4 ldi r24, 0x4F ; 79 19226: 98 e8 ldi r25, 0x88 ; 136 19228: 9f 93 push r25 1922a: 8f 93 push r24 1922c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc /// 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); 19230: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 19234: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 19238: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 1923c: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 19240: 48 54 subi r20, 0x48 ; 72 19242: 51 09 sbc r21, r1 19244: 00 e0 ldi r16, 0x00 ; 0 19246: 28 ec ldi r18, 0xC8 ; 200 19248: 30 e0 ldi r19, 0x00 ; 0 1924a: a3 96 adiw r28, 0x23 ; 35 1924c: 6f ad ldd r22, Y+63 ; 0x3f 1924e: a3 97 sbiw r28, 0x23 ; 35 19250: a4 96 adiw r28, 0x24 ; 36 19252: 7f ad ldd r23, Y+63 ; 0x3f 19254: a4 97 sbiw r28, 0x24 ; 36 19256: c2 01 movw r24, r4 19258: 0e 94 ca c2 call 0x18594 ; 0x18594 /// 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; 1925c: 20 91 b6 06 lds r18, 0x06B6 ; 0x8006b6 19260: 30 91 b7 06 lds r19, 0x06B7 ; 0x8006b7 19264: 40 91 b8 06 lds r20, 0x06B8 ; 0x8006b8 19268: 50 91 b9 06 lds r21, 0x06B9 ; 0x8006b9 1926c: 6e 96 adiw r28, 0x1e ; 30 1926e: 2c af std Y+60, r18 ; 0x3c 19270: 3d af std Y+61, r19 ; 0x3d 19272: 4e af std Y+62, r20 ; 0x3e 19274: 5f af std Y+63, r21 ; 0x3f 19276: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 19278: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 1927c: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19280: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19284: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19288: ae 96 adiw r28, 0x2e ; 46 1928a: 8c af std Y+60, r24 ; 0x3c 1928c: 9d af std Y+61, r25 ; 0x3d 1928e: ae af std Y+62, r26 ; 0x3e 19290: bf af std Y+63, r27 ; 0x3f 19292: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 19294: 20 91 be 06 lds r18, 0x06BE ; 0x8006be 19298: 30 91 bf 06 lds r19, 0x06BF ; 0x8006bf 1929c: 40 91 c0 06 lds r20, 0x06C0 ; 0x8006c0 192a0: 50 91 c1 06 lds r21, 0x06C1 ; 0x8006c1 192a4: e9 96 adiw r28, 0x39 ; 57 192a6: 2c af std Y+60, r18 ; 0x3c 192a8: 3d af std Y+61, r19 ; 0x3d 192aa: 4e af std Y+62, r20 ; 0x3e 192ac: 5f af std Y+63, r21 ; 0x3f 192ae: e9 97 sbiw r28, 0x39 ; 57 192b0: a8 ec ldi r26, 0xC8 ; 200 192b2: ba e0 ldi r27, 0x0A ; 10 192b4: 0f b6 in r0, 0x3f ; 63 192b6: f8 94 cli 192b8: de bf out 0x3e, r29 ; 62 192ba: 0f be out 0x3f, r0 ; 63 192bc: cd bf out 0x3d, r28 ; 61 192be: 90 e0 ldi r25, 0x00 ; 0 192c0: 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)); 192c2: fc 01 movw r30, r24 192c4: e6 51 subi r30, 0x16 ; 22 192c6: f7 47 sbci r31, 0x77 ; 119 192c8: 25 91 lpm r18, Z+ 192ca: 34 91 lpm r19, Z 192cc: 2d 93 st X+, r18 192ce: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 192d0: fc 01 movw r30, r24 192d2: ee 52 subi r30, 0x2E ; 46 192d4: f7 47 sbci r31, 0x77 ; 119 192d6: 25 91 lpm r18, Z+ 192d8: 34 91 lpm r19, Z 192da: 57 96 adiw r26, 0x17 ; 23 192dc: 3c 93 st X, r19 192de: 2e 93 st -X, r18 192e0: 56 97 sbiw r26, 0x16 ; 22 192e2: 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++){ 192e4: 88 31 cpi r24, 0x18 ; 24 192e6: 91 05 cpc r25, r1 192e8: 61 f7 brne .-40 ; 0x192c2 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); 192ea: e7 96 adiw r28, 0x37 ; 55 192ec: 4e ad ldd r20, Y+62 ; 0x3e 192ee: 5f ad ldd r21, Y+63 ; 0x3f 192f0: e7 97 sbiw r28, 0x37 ; 55 192f2: ac 96 adiw r28, 0x2c ; 44 192f4: 6e ad ldd r22, Y+62 ; 0x3e 192f6: 7f ad ldd r23, Y+63 ; 0x3f 192f8: ac 97 sbiw r28, 0x2c ; 44 192fa: 6c 96 adiw r28, 0x1c ; 28 192fc: 8e ad ldd r24, Y+62 ; 0x3e 192fe: 9f ad ldd r25, Y+63 ; 0x3f 19300: 6c 97 sbiw r28, 0x1c ; 28 19302: 0f 94 b4 5c call 0x2b968 ; 0x2b968 19306: 28 ec ldi r18, 0xC8 ; 200 19308: 36 e0 ldi r19, 0x06 ; 6 1930a: a4 96 adiw r28, 0x24 ; 36 1930c: 3f af std Y+63, r19 ; 0x3f 1930e: 2e af std Y+62, r18 ; 0x3e 19310: a4 97 sbiw r28, 0x24 ; 36 19312: 79 01 movw r14, r18 19314: f0 e2 ldi r31, 0x20 ; 32 19316: 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]); 19318: a5 e9 ldi r26, 0x95 ; 149 1931a: ca 2e mov r12, r26 1931c: a8 e8 ldi r26, 0x88 ; 136 1931e: da 2e mov r13, r26 } DBG(endl); 19320: 03 e7 ldi r16, 0x73 ; 115 19322: 19 e9 ldi r17, 0x99 ; 153 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); 19324: 57 01 movw r10, r14 19326: e0 e2 ldi r30, 0x20 ; 32 19328: 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]); 1932a: d5 01 movw r26, r10 1932c: 8d 91 ld r24, X+ 1932e: 5d 01 movw r10, r26 19330: 1f 92 push r1 19332: 8f 93 push r24 19334: df 92 push r13 19336: cf 92 push r12 19338: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1933c: 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){ 1933e: 0f 90 pop r0 19340: 0f 90 pop r0 19342: 0f 90 pop r0 19344: 0f 90 pop r0 19346: 81 10 cpse r8, r1 19348: f0 cf rjmp .-32 ; 0x1932a DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1934a: 1f 93 push r17 1934c: 0f 93 push r16 1934e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 19352: 9a 94 dec r9 19354: b0 e2 ldi r27, 0x20 ; 32 19356: eb 0e add r14, r27 19358: 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){ 1935a: 0f 90 pop r0 1935c: 0f 90 pop r0 1935e: 91 10 cpse r9, r1 19360: e1 cf rjmp .-62 ; 0x19324 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 19362: 1f 93 push r17 19364: 0f 93 push r16 19366: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1936a: 68 ec ldi r22, 0xC8 ; 200 1936c: 7a e0 ldi r23, 0x0A ; 10 1936e: 0f 90 pop r0 19370: 0f 90 pop r0 19372: e8 ec ldi r30, 0xC8 ; 200 19374: 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; 19376: 90 e0 ldi r25, 0x00 ; 0 19378: 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; 1937a: 50 e0 ldi r21, 0x00 ; 0 1937c: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1937e: 21 91 ld r18, Z+ 19380: 21 11 cpse r18, r1 19382: 01 c3 rjmp .+1538 ; 0x19986 ++mins; 19384: 4f 5f subi r20, 0xFF ; 255 19386: 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){ 19388: 6e 17 cp r22, r30 1938a: 7f 07 cpc r23, r31 1938c: c1 f7 brne .-16 ; 0x1937e ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1938e: 9a 01 movw r18, r20 19390: 28 0f add r18, r24 19392: 39 1f adc r19, r25 19394: 25 38 cpi r18, 0x85 ; 133 19396: 33 40 sbci r19, 0x03 ; 3 19398: a4 f0 brlt .+40 ; 0x193c2 && mins > threshold_extreme 1939a: 43 33 cpi r20, 0x33 ; 51 1939c: 51 05 cpc r21, r1 1939e: 8c f0 brlt .+34 ; 0x193c2 && maxs > threshold_extreme 193a0: 83 33 cpi r24, 0x33 ; 51 193a2: 91 05 cpc r25, r1 193a4: 74 f0 brlt .+28 ; 0x193c2 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 193a6: 20 e0 ldi r18, 0x00 ; 0 193a8: 34 e0 ldi r19, 0x04 ; 4 193aa: 24 1b sub r18, r20 193ac: 35 0b sbc r19, r21 193ae: 28 1b sub r18, r24 193b0: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 193b2: 24 17 cp r18, r20 193b4: 35 07 cpc r19, r21 193b6: 2c f4 brge .+10 ; 0x193c2 } 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; 193b8: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 193ba: 28 17 cp r18, r24 193bc: 39 07 cpc r19, r25 193be: 0c f4 brge .+2 ; 0x193c2 193c0: d2 c0 rjmp .+420 ; 0x19566 } /// 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; 193c2: 66 96 adiw r28, 0x16 ; 22 193c4: 1f ae std Y+63, r1 ; 0x3f 193c6: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 193c8: 62 96 adiw r28, 0x12 ; 18 193ca: 1f ae std Y+63, r1 ; 0x3f 193cc: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 193ce: 22 96 adiw r28, 0x02 ; 2 193d0: 1f ae std Y+63, r1 ; 0x3f 193d2: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 193d4: 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) 193d6: 88 ec ldi r24, 0xC8 ; 200 193d8: 96 e0 ldi r25, 0x06 ; 6 193da: 89 2b or r24, r25 193dc: 99 f0 breq .+38 ; 0x19404 193de: 88 ec ldi r24, 0xC8 ; 200 193e0: 9a e0 ldi r25, 0x0A ; 10 return -1; 193e2: 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) 193e4: 00 97 sbiw r24, 0x00 ; 0 193e6: 49 f0 breq .+18 ; 0x193fa 193e8: ae 01 movw r20, r28 193ea: 4f 5a subi r20, 0xAF ; 175 193ec: 5f 4f sbci r21, 0xFF ; 255 193ee: be 01 movw r22, r28 193f0: 6b 5a subi r22, 0xAB ; 171 193f2: 7f 4f sbci r23, 0xFF ; 255 193f4: 0f 94 d7 5b call 0x2b7ae ; 0x2b7ae 193f8: 08 2f mov r16, r24 193fa: 80 ee ldi r24, 0xE0 ; 224 193fc: 9a e0 ldi r25, 0x0A ; 10 193fe: 89 2b or r24, r25 19400: 09 f0 breq .+2 ; 0x19404 19402: c6 c2 rjmp .+1420 ; 0x19990 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; 19404: 8f ef ldi r24, 0xFF ; 255 19406: d6 c2 rjmp .+1452 ; 0x199b4 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)); 19408: 87 e6 ldi r24, 0x67 ; 103 1940a: 98 e4 ldi r25, 0x48 ; 72 1940c: 0e 94 32 6d call 0xda64 ; 0xda64 19410: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_puts_at_P(0,3,_n("1/4")); 19414: 4a e5 ldi r20, 0x5A ; 90 19416: 5a e6 ldi r21, 0x6A ; 106 19418: 28 cd rjmp .-1456 ; 0x18e6a } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1941a: 80 e8 ldi r24, 0x80 ; 128 1941c: 99 e8 ldi r25, 0x89 ; 137 // 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); 1941e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 19422: 0b cd rjmp .-1514 ; 0x18e3a 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); 19424: c7 55 subi r28, 0x57 ; 87 19426: df 4f sbci r29, 0xFF ; 255 19428: 88 81 ld r24, Y 1942a: 99 81 ldd r25, Y+1 ; 0x01 1942c: c9 5a subi r28, 0xA9 ; 169 1942e: d0 40 sbci r29, 0x00 ; 0 19430: 0e 94 55 60 call 0xc0aa ; 0xc0aa // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 19434: 0f 94 21 91 call 0x32242 ; 0x32242 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 19438: 0f 94 bf 8e call 0x31d7e ; 0x31d7e //FIXME bool result = sample_mesh_and_store_reference(); 1943c: 0f 94 d8 8c call 0x319b0 ; 0x319b0 19440: e5 96 adiw r28, 0x35 ; 53 19442: 8f af std Y+63, r24 ; 0x3f 19444: e5 97 sbiw r28, 0x35 ; 53 if (result) 19446: 88 23 and r24, r24 19448: 09 f4 brne .+2 ; 0x1944c 1944a: f7 cc rjmp .-1554 ; 0x18e3a { calibration_status_set(CALIBRATION_STATUS_Z); 1944c: 84 e0 ldi r24, 0x04 ; 4 1944e: 0e 94 7d c6 call 0x18cfa ; 0x18cfa } else { // Timeouted. } lcd_update_enable(true); 19452: 81 e0 ldi r24, 0x01 ; 1 19454: 0e 94 41 6a call 0xd482 ; 0xd482 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 19458: e5 96 adiw r28, 0x35 ; 53 1945a: 8f ad ldd r24, Y+63 ; 0x3f 1945c: e5 97 sbiw r28, 0x35 ; 53 1945e: c2 53 subi r28, 0x32 ; 50 19460: df 4f sbci r29, 0xFF ; 255 19462: 0f b6 in r0, 0x3f ; 63 19464: f8 94 cli 19466: de bf out 0x3e, r29 ; 62 19468: 0f be out 0x3f, r0 ; 63 1946a: cd bf out 0x3d, r28 ; 61 1946c: df 91 pop r29 1946e: cf 91 pop r28 19470: 1f 91 pop r17 19472: 0f 91 pop r16 19474: ff 90 pop r15 19476: ef 90 pop r14 19478: df 90 pop r13 1947a: cf 90 pop r12 1947c: bf 90 pop r11 1947e: af 90 pop r10 19480: 9f 90 pop r9 19482: 8f 90 pop r8 19484: 7f 90 pop r7 19486: 6f 90 pop r6 19488: 5f 90 pop r5 1948a: 4f 90 pop r4 1948c: 3f 90 pop r3 1948e: 2f 90 pop r2 19490: 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) { 19492: e1 e0 ldi r30, 0x01 ; 1 19494: e1 96 adiw r28, 0x31 ; 49 19496: ef af std Y+63, r30 ; 0x3f 19498: e1 97 sbiw r28, 0x31 ; 49 1949a: 7c cd rjmp .-1288 ; 0x18f94 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) 1949c: fe 01 movw r30, r28 1949e: 31 96 adiw r30, 0x01 ; 1 194a0: 7f 01 movw r14, r30 194a2: 10 e0 ldi r17, 0x00 ; 0 194a4: 00 e0 ldi r16, 0x00 ; 0 194a6: 24 e8 ldi r18, 0x84 ; 132 194a8: 33 e0 ldi r19, 0x03 ; 3 194aa: a6 01 movw r20, r12 194ac: 69 2d mov r22, r9 194ae: 78 2d mov r23, r8 194b0: 8b 2d mov r24, r11 194b2: 9a 2d mov r25, r10 194b4: 0f 94 2c 60 call 0x2c058 ; 0x2c058 ad += 0; if (!ret && (ad < 1440)) 194b8: 88 23 and r24, r24 194ba: 09 f4 brne .+2 ; 0x194be 194bc: 73 ce rjmp .-794 ; 0x191a4 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; 194be: 89 81 ldd r24, Y+1 ; 0x01 194c0: 9a 81 ldd r25, Y+2 ; 0x02 194c2: 90 ce rjmp .-736 ; 0x191e4 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)) 194c4: 89 81 ldd r24, Y+1 ; 0x01 194c6: 9a 81 ldd r25, Y+2 ; 0x02 194c8: 80 34 cpi r24, 0x40 ; 64 194ca: 9b 40 sbci r25, 0x0B ; 11 194cc: b8 f4 brcc .+46 ; 0x194fc if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 194ce: ce 01 movw r24, r28 194d0: 01 96 adiw r24, 0x01 ; 1 194d2: 7c 01 movw r14, r24 194d4: 04 eb ldi r16, 0xB4 ; 180 194d6: 10 e0 ldi r17, 0x00 ; 0 194d8: 2c e7 ldi r18, 0x7C ; 124 194da: 3c ef ldi r19, 0xFC ; 252 194dc: a6 01 movw r20, r12 194de: 4c 52 subi r20, 0x2C ; 44 194e0: 51 40 sbci r21, 0x01 ; 1 194e2: 69 2d mov r22, r9 194e4: 78 2d mov r23, r8 194e6: 8b 2d mov r24, r11 194e8: 9a 2d mov r25, r10 194ea: 0f 94 2c 60 call 0x2c058 ; 0x2c058 194ee: 88 23 and r24, r24 194f0: 29 f0 breq .+10 ; 0x194fc ad += 2160; 194f2: 89 81 ldd r24, Y+1 ; 0x01 194f4: 9a 81 ldd r25, Y+2 ; 0x02 194f6: 80 59 subi r24, 0x90 ; 144 194f8: 97 4f sbci r25, 0xF7 ; 247 194fa: 74 ce rjmp .-792 ; 0x191e4 /// 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; 194fc: 90 e9 ldi r25, 0x90 ; 144 194fe: c9 1a sub r12, r25 19500: 91 e0 ldi r25, 0x01 ; 1 19502: d9 0a sbc r13, r25 19504: 27 ce rjmp .-946 ; 0x19154 } //@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]); 19506: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 1950a: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 1950e: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 19512: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 19516: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 1951a: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 1951e: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 19522: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 19526: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 1952a: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 1952e: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 19532: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 19536: 3f 93 push r19 19538: 2f 93 push r18 1953a: 1f 93 push r17 1953c: 0f 93 push r16 1953e: 7f 93 push r23 19540: 6f 93 push r22 19542: 5f 93 push r21 19544: 4f 93 push r20 19546: bf 93 push r27 19548: af 93 push r26 1954a: 9f 93 push r25 1954c: 8f 93 push r24 1954e: 82 e2 ldi r24, 0x22 ; 34 19550: 98 e8 ldi r25, 0x88 ; 136 19552: 9f 93 push r25 19554: 8f 93 push r24 19556: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1955a: 0f b6 in r0, 0x3f ; 63 1955c: f8 94 cli 1955e: de bf out 0x3e, r29 ; 62 19560: 0f be out 0x3f, r0 ; 63 19562: 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; 19564: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 19566: 82 e0 ldi r24, 0x02 ; 2 19568: 99 e8 ldi r25, 0x89 ; 137 1956a: 9f 93 push r25 1956c: 8f 93 push r24 1956e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc lcd_set_cursor(4,3); 19572: 63 e0 ldi r22, 0x03 ; 3 19574: 84 e0 ldi r24, 0x04 ; 4 19576: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_space(16); 1957a: 80 e1 ldi r24, 0x10 ; 16 1957c: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 19580: 0f 94 03 86 call 0x30c06 ; 0x30c06 : "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" ); 19584: 88 e1 ldi r24, 0x18 ; 24 19586: 98 e2 ldi r25, 0x28 ; 40 19588: 0f b6 in r0, 0x3f ; 63 1958a: f8 94 cli 1958c: a8 95 wdr 1958e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19592: 0f be out 0x3f, r0 ; 63 19594: 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); 19598: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1959c: 80 64 ori r24, 0x40 ; 64 1959e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 195a2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 195a6: 82 60 ori r24, 0x02 ; 2 195a8: 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){ 195ac: 0f 90 pop r0 195ae: 0f 90 pop r0 195b0: 1d 3f cpi r17, 0xFD ; 253 195b2: 09 f4 brne .+2 ; 0x195b6 195b4: 64 c3 rjmp .+1736 ; 0x19c7e 195b6: 1f 3f cpi r17, 0xFF ; 255 195b8: 11 f4 brne .+4 ; 0x195be 195ba: 0c 94 8a d7 jmp 0x1af14 ; 0x1af14 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); 195be: 20 e0 ldi r18, 0x00 ; 0 195c0: 30 e0 ldi r19, 0x00 ; 0 195c2: a9 01 movw r20, r18 195c4: a0 96 adiw r28, 0x20 ; 32 195c6: ee ad ldd r30, Y+62 ; 0x3e 195c8: ff ad ldd r31, Y+63 ; 0x3f 195ca: a0 97 sbiw r28, 0x20 ; 32 195cc: 61 81 ldd r22, Z+1 ; 0x01 195ce: 72 81 ldd r23, Z+2 ; 0x02 195d0: 83 81 ldd r24, Z+3 ; 0x03 195d2: 94 81 ldd r25, Z+4 ; 0x04 195d4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 195d8: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 195dc: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 195e0: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 195e4: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 195e8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 195ec: a0 96 adiw r28, 0x20 ; 32 195ee: ae ad ldd r26, Y+62 ; 0x3e 195f0: bf ad ldd r27, Y+63 ; 0x3f 195f2: a0 97 sbiw r28, 0x20 ; 32 195f4: 11 96 adiw r26, 0x01 ; 1 195f6: 6d 93 st X+, r22 195f8: 7d 93 st X+, r23 195fa: 8d 93 st X+, r24 195fc: 9c 93 st X, r25 195fe: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19600: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 19604: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 19608: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 1960c: 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); 19610: 20 e0 ldi r18, 0x00 ; 0 19612: 30 e0 ldi r19, 0x00 ; 0 19614: a9 01 movw r20, r18 19616: 15 96 adiw r26, 0x05 ; 5 19618: 6d 91 ld r22, X+ 1961a: 7d 91 ld r23, X+ 1961c: 8d 91 ld r24, X+ 1961e: 9c 91 ld r25, X 19620: 18 97 sbiw r26, 0x08 ; 8 19622: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19626: a7 01 movw r20, r14 19628: 96 01 movw r18, r12 1962a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1962e: a0 96 adiw r28, 0x20 ; 32 19630: ee ad ldd r30, Y+62 ; 0x3e 19632: ff ad ldd r31, Y+63 ; 0x3f 19634: a0 97 sbiw r28, 0x20 ; 32 19636: 65 83 std Z+5, r22 ; 0x05 19638: 76 83 std Z+6, r23 ; 0x06 1963a: 87 83 std Z+7, r24 ; 0x07 1963c: 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) 1963e: 20 e0 ldi r18, 0x00 ; 0 19640: 30 e0 ldi r19, 0x00 ; 0 19642: 40 e8 ldi r20, 0x80 ; 128 19644: 50 ec ldi r21, 0xC0 ; 192 19646: c7 01 movw r24, r14 19648: b6 01 movw r22, r12 1964a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1964e: 87 ff sbrs r24, 7 19650: 0c c0 rjmp .+24 ; 0x1966a current_position[Y_AXIS] = Y_MIN_POS; 19652: 80 e0 ldi r24, 0x00 ; 0 19654: 90 e0 ldi r25, 0x00 ; 0 19656: a0 e8 ldi r26, 0x80 ; 128 19658: b0 ec ldi r27, 0xC0 ; 192 1965a: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1965e: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19662: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 19666: 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; 1966a: 20 e0 ldi r18, 0x00 ; 0 1966c: 30 e0 ldi r19, 0x00 ; 0 1966e: 40 e4 ldi r20, 0x40 ; 64 19670: 50 e4 ldi r21, 0x40 ; 64 19672: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 19676: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1967a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1967e: 90 91 00 12 lds r25, 0x1200 ; 0x801200 19682: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19686: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1968a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1968e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 19692: 90 93 00 12 sts 0x1200, r25 ; 0x801200 19696: e0 96 adiw r28, 0x30 ; 48 19698: 2e ad ldd r18, Y+62 ; 0x3e 1969a: 3f ad ldd r19, Y+63 ; 0x3f 1969c: e0 97 sbiw r28, 0x30 ; 48 1969e: 28 5f subi r18, 0xF8 ; 248 196a0: 3f 4f sbci r19, 0xFF ; 255 196a2: e0 96 adiw r28, 0x30 ; 48 196a4: 3f af std Y+63, r19 ; 0x3f 196a6: 2e af std Y+62, r18 ; 0x3e 196a8: e0 97 sbiw r28, 0x30 ; 48 196aa: a0 96 adiw r28, 0x20 ; 32 196ac: 4e ad ldd r20, Y+62 ; 0x3e 196ae: 5f ad ldd r21, Y+63 ; 0x3f 196b0: a0 97 sbiw r28, 0x20 ; 32 196b2: 48 5f subi r20, 0xF8 ; 248 196b4: 5f 4f sbci r21, 0xFF ; 255 196b6: a0 96 adiw r28, 0x20 ; 32 196b8: 5f af std Y+63, r21 ; 0x3f 196ba: 4e af std Y+62, r20 ; 0x3e 196bc: 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) { 196be: 54 e0 ldi r21, 0x04 ; 4 196c0: 25 16 cp r2, r21 196c2: 31 04 cpc r3, r1 196c4: 09 f0 breq .+2 ; 0x196c8 196c6: 83 cc rjmp .-1786 ; 0x18fce go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 196c8: a7 96 adiw r28, 0x27 ; 39 196ca: 6f ad ldd r22, Y+63 ; 0x3f 196cc: a7 97 sbiw r28, 0x27 ; 39 196ce: 66 23 and r22, r22 196d0: 31 f0 breq .+12 ; 0x196de 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) { 196d2: e1 96 adiw r28, 0x31 ; 49 196d4: 8f ad ldd r24, Y+63 ; 0x3f 196d6: e1 97 sbiw r28, 0x31 ; 49 196d8: 81 30 cpi r24, 0x01 ; 1 196da: 09 f0 breq .+2 ; 0x196de 196dc: da ce rjmp .-588 ; 0x19492 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 196de: 85 e3 ldi r24, 0x35 ; 53 196e0: 9a e6 ldi r25, 0x6A ; 106 196e2: 9f 93 push r25 196e4: 8f 93 push r24 196e6: 0f 94 fe 9f call 0x33ffc ; 0x33ffc delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 196ea: 90 e0 ldi r25, 0x00 ; 0 196ec: 80 e0 ldi r24, 0x00 ; 0 196ee: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 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) { 196f2: 0f 90 pop r0 196f4: 0f 90 pop r0 196f6: 20 e0 ldi r18, 0x00 ; 0 196f8: 30 e0 ldi r19, 0x00 ; 0 196fa: 40 e9 ldi r20, 0x90 ; 144 196fc: 50 ec ldi r21, 0xC0 ; 192 196fe: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 19702: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 19706: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 1970a: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 1970e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 19712: 87 ff sbrs r24, 7 19714: bb c2 rjmp .+1398 ; 0x19c8c too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 19716: 8e e4 ldi r24, 0x4E ; 78 19718: 99 e8 ldi r25, 0x89 ; 137 1971a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1971e: 8c e1 ldi r24, 0x1C ; 28 19720: 99 e8 ldi r25, 0x89 ; 137 19722: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 19726: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 1972a: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 1972e: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 19732: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 19736: 42 e0 ldi r20, 0x02 ; 2 19738: 0f 94 a9 98 call 0x33152 ; 0x33152 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1973c: 88 e1 ldi r24, 0x18 ; 24 1973e: 99 e8 ldi r25, 0x89 ; 137 19740: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 19744: 60 e0 ldi r22, 0x00 ; 0 19746: 70 e0 ldi r23, 0x00 ; 0 19748: 80 e9 ldi r24, 0x90 ; 144 1974a: 90 ec ldi r25, 0xC0 ; 192 1974c: 0f 94 e3 41 call 0x283c6 ; 0x283c6 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 19750: 92 e0 ldi r25, 0x02 ; 2 19752: af 96 adiw r28, 0x2f ; 47 19754: 9f af std Y+63, r25 ; 0x3f 19756: 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; 19758: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1975c: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 19760: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 19764: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 19768: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1976c: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 19770: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 19774: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 19778: a4 e6 ldi r26, 0x64 ; 100 1977a: e6 96 adiw r28, 0x36 ; 54 1977c: af af std Y+63, r26 ; 0x3f 1977e: 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; 19780: a2 96 adiw r28, 0x22 ; 34 19782: 1c ae std Y+60, r1 ; 0x3c 19784: 1d ae std Y+61, r1 ; 0x3d 19786: 1e ae std Y+62, r1 ; 0x3e 19788: 1f ae std Y+63, r1 ; 0x3f 1978a: 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; 1978c: a6 96 adiw r28, 0x26 ; 38 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: 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 }; 19798: fe 01 movw r30, r28 1979a: 31 96 adiw r30, 0x01 ; 1 1979c: 68 96 adiw r28, 0x18 ; 24 1979e: ff af std Y+63, r31 ; 0x3f 197a0: ee af std Y+62, r30 ; 0x3e 197a2: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 197a4: 9e 01 movw r18, r28 197a6: 2f 5b subi r18, 0xBF ; 191 197a8: 3f 4f sbci r19, 0xFF ; 255 197aa: 6a 96 adiw r28, 0x1a ; 26 197ac: 3f af std Y+63, r19 ; 0x3f 197ae: 2e af std Y+62, r18 ; 0x3e 197b0: 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; 197b2: a6 96 adiw r28, 0x26 ; 38 197b4: 6c ad ldd r22, Y+60 ; 0x3c 197b6: 7d ad ldd r23, Y+61 ; 0x3d 197b8: 8e ad ldd r24, Y+62 ; 0x3e 197ba: 9f ad ldd r25, Y+63 ; 0x3f 197bc: a6 97 sbiw r28, 0x26 ; 38 197be: 0f 94 5e a3 call 0x346bc ; 0x346bc 197c2: 6e 96 adiw r28, 0x1e ; 30 197c4: 6c af std Y+60, r22 ; 0x3c 197c6: 7d af std Y+61, r23 ; 0x3d 197c8: 8e af std Y+62, r24 ; 0x3e 197ca: 9f af std Y+63, r25 ; 0x3f 197cc: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 197ce: a6 96 adiw r28, 0x26 ; 38 197d0: 6c ad ldd r22, Y+60 ; 0x3c 197d2: 7d ad ldd r23, Y+61 ; 0x3d 197d4: 8e ad ldd r24, Y+62 ; 0x3e 197d6: 9f ad ldd r25, Y+63 ; 0x3f 197d8: a6 97 sbiw r28, 0x26 ; 38 197da: 0f 94 24 a6 call 0x34c48 ; 0x34c48 197de: cb 57 subi r28, 0x7B ; 123 197e0: df 4f sbci r29, 0xFF ; 255 197e2: 68 83 st Y, r22 197e4: 79 83 std Y+1, r23 ; 0x01 197e6: 8a 83 std Y+2, r24 ; 0x02 197e8: 9b 83 std Y+3, r25 ; 0x03 197ea: c5 58 subi r28, 0x85 ; 133 197ec: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 197ee: a2 96 adiw r28, 0x22 ; 34 197f0: 6c ad ldd r22, Y+60 ; 0x3c 197f2: 7d ad ldd r23, Y+61 ; 0x3d 197f4: 8e ad ldd r24, Y+62 ; 0x3e 197f6: 9f ad ldd r25, Y+63 ; 0x3f 197f8: a2 97 sbiw r28, 0x22 ; 34 197fa: 0f 94 5e a3 call 0x346bc ; 0x346bc 197fe: c7 57 subi r28, 0x77 ; 119 19800: df 4f sbci r29, 0xFF ; 255 19802: 68 83 st Y, r22 19804: 79 83 std Y+1, r23 ; 0x01 19806: 8a 83 std Y+2, r24 ; 0x02 19808: 9b 83 std Y+3, r25 ; 0x03 1980a: c9 58 subi r28, 0x89 ; 137 1980c: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1980e: a2 96 adiw r28, 0x22 ; 34 19810: 6c ad ldd r22, Y+60 ; 0x3c 19812: 7d ad ldd r23, Y+61 ; 0x3d 19814: 8e ad ldd r24, Y+62 ; 0x3e 19816: 9f ad ldd r25, Y+63 ; 0x3f 19818: a2 97 sbiw r28, 0x22 ; 34 1981a: 0f 94 24 a6 call 0x34c48 ; 0x34c48 1981e: cb 56 subi r28, 0x6B ; 107 19820: df 4f sbci r29, 0xFF ; 255 19822: 68 83 st Y, r22 19824: 79 83 std Y+1, r23 ; 0x01 19826: 8a 83 std Y+2, r24 ; 0x02 19828: 9b 83 std Y+3, r25 ; 0x03 1982a: c5 59 subi r28, 0x95 ; 149 1982c: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1982e: 68 96 adiw r28, 0x18 ; 24 19830: ae ad ldd r26, Y+62 ; 0x3e 19832: bf ad ldd r27, Y+63 ; 0x3f 19834: 68 97 sbiw r28, 0x18 ; 24 19836: e0 e4 ldi r30, 0x40 ; 64 19838: 1d 92 st X+, r1 1983a: ea 95 dec r30 1983c: e9 f7 brne .-6 ; 0x19838 float b[4] = { 0.f }; 1983e: 80 e1 ldi r24, 0x10 ; 16 19840: 6a 96 adiw r28, 0x1a ; 26 19842: ae ad ldd r26, Y+62 ; 0x3e 19844: bf ad ldd r27, Y+63 ; 0x3f 19846: 6a 97 sbiw r28, 0x1a ; 26 19848: 1d 92 st X+, r1 1984a: 8a 95 dec r24 1984c: e9 f7 brne .-6 ; 0x19848 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1984e: 90 e0 ldi r25, 0x00 ; 0 19850: 80 e0 ldi r24, 0x00 ; 0 19852: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 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); 19856: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1985a: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1985e: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 19862: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 19866: c5 55 subi r28, 0x55 ; 85 19868: df 4f sbci r29, 0xFF ; 255 1986a: 28 83 st Y, r18 1986c: 39 83 std Y+1, r19 ; 0x01 1986e: 4a 83 std Y+2, r20 ; 0x02 19870: 5b 83 std Y+3, r21 ; 0x03 19872: cb 5a subi r28, 0xAB ; 171 19874: 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); 19876: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1987a: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1987e: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 19882: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 19886: c1 55 subi r28, 0x51 ; 81 19888: df 4f sbci r29, 0xFF ; 255 1988a: 88 83 st Y, r24 1988c: 99 83 std Y+1, r25 ; 0x01 1988e: aa 83 std Y+2, r26 ; 0x02 19890: bb 83 std Y+3, r27 ; 0x03 19892: cf 5a subi r28, 0xAF ; 175 19894: d0 40 sbci r29, 0x00 ; 0 19896: de 01 movw r26, r28 19898: af 5b subi r26, 0xBF ; 191 1989a: bf 4f sbci r27, 0xFF ; 255 1989c: c7 56 subi r28, 0x67 ; 103 1989e: df 4f sbci r29, 0xFF ; 255 198a0: b9 83 std Y+1, r27 ; 0x01 198a2: a8 83 st Y, r26 198a4: c9 59 subi r28, 0x99 ; 153 198a6: d0 40 sbci r29, 0x00 ; 0 198a8: fe 01 movw r30, r28 198aa: 31 96 adiw r30, 0x01 ; 1 198ac: ac 96 adiw r28, 0x2c ; 44 198ae: ff af std Y+63, r31 ; 0x3f 198b0: ee af std Y+62, r30 ; 0x3e 198b2: 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) { 198b4: 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])); 198b6: cb 56 subi r28, 0x6B ; 107 198b8: df 4f sbci r29, 0xFF ; 255 198ba: 28 81 ld r18, Y 198bc: 39 81 ldd r19, Y+1 ; 0x01 198be: 4a 81 ldd r20, Y+2 ; 0x02 198c0: 5b 81 ldd r21, Y+3 ; 0x03 198c2: c5 59 subi r28, 0x95 ; 149 198c4: d0 40 sbci r29, 0x00 ; 0 198c6: 50 58 subi r21, 0x80 ; 128 198c8: ed 96 adiw r28, 0x3d ; 61 198ca: 2c af std Y+60, r18 ; 0x3c 198cc: 3d af std Y+61, r19 ; 0x3d 198ce: 4e af std Y+62, r20 ; 0x3e 198d0: 5f af std Y+63, r21 ; 0x3f 198d2: 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])); 198d4: c7 57 subi r28, 0x77 ; 119 198d6: df 4f sbci r29, 0xFF ; 255 198d8: 88 81 ld r24, Y 198da: 99 81 ldd r25, Y+1 ; 0x01 198dc: aa 81 ldd r26, Y+2 ; 0x02 198de: bb 81 ldd r27, Y+3 ; 0x03 198e0: c9 58 subi r28, 0x89 ; 137 198e2: d0 40 sbci r29, 0x00 ; 0 198e4: b0 58 subi r27, 0x80 ; 128 198e6: c3 58 subi r28, 0x83 ; 131 198e8: df 4f sbci r29, 0xFF ; 255 198ea: 88 83 st Y, r24 198ec: 99 83 std Y+1, r25 ; 0x01 198ee: aa 83 std Y+2, r26 ; 0x02 198f0: bb 83 std Y+3, r27 ; 0x03 198f2: cd 57 subi r28, 0x7D ; 125 198f4: 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]) : 198f6: cb 57 subi r28, 0x7B ; 123 198f8: df 4f sbci r29, 0xFF ; 255 198fa: 28 81 ld r18, Y 198fc: 39 81 ldd r19, Y+1 ; 0x01 198fe: 4a 81 ldd r20, Y+2 ; 0x02 19900: 5b 81 ldd r21, Y+3 ; 0x03 19902: c5 58 subi r28, 0x85 ; 133 19904: d0 40 sbci r29, 0x00 ; 0 19906: 50 58 subi r21, 0x80 ; 128 19908: cf 57 subi r28, 0x7F ; 127 1990a: df 4f sbci r29, 0xFF ; 255 1990c: 28 83 st Y, r18 1990e: 39 83 std Y+1, r19 ; 0x01 19910: 4a 83 std Y+2, r20 ; 0x02 19912: 5b 83 std Y+3, r21 ; 0x03 19914: c1 58 subi r28, 0x81 ; 129 19916: 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) { 19918: ac 96 adiw r28, 0x2c ; 44 1991a: 2e ac ldd r2, Y+62 ; 0x3e 1991c: 3f ac ldd r3, Y+63 ; 0x3f 1991e: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 19920: 10 e0 ldi r17, 0x00 ; 0 19922: 6c e9 ldi r22, 0x9C ; 156 19924: 46 2e mov r4, r22 19926: 62 e1 ldi r22, 0x12 ; 18 19928: 56 2e mov r5, r22 1992a: 74 e0 ldi r23, 0x04 ; 4 1992c: 77 2e mov r7, r23 acc = 0; 1992e: c1 2c mov r12, r1 19930: d1 2c mov r13, r1 19932: 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) { 19934: 01 30 cpi r16, 0x01 ; 1 19936: 11 f4 brne .+4 ; 0x1993c 19938: 0c 94 42 d8 jmp 0x1b084 ; 0x1b084 1993c: 11 30 cpi r17, 0x01 ; 1 1993e: 11 f4 brne .+4 ; 0x19944 19940: 0c 94 f0 d7 jmp 0x1afe0 ; 0x1afe0 float a = (r == 0) ? 1.f : 19944: 00 23 and r16, r16 19946: 11 f4 brne .+4 ; 0x1994c 19948: 0c 94 30 d8 jmp 0x1b060 ; 0x1b060 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1994c: 02 30 cpi r16, 0x02 ; 2 1994e: 09 f0 breq .+2 ; 0x19952 19950: a1 c1 rjmp .+834 ; 0x19c94 19952: d2 01 movw r26, r4 19954: 11 96 adiw r26, 0x01 ; 1 19956: 2d 91 ld r18, X+ 19958: 3d 91 ld r19, X+ 1995a: 4d 91 ld r20, X+ 1995c: 5c 91 ld r21, X 1995e: 14 97 sbiw r26, 0x04 ; 4 19960: cf 57 subi r28, 0x7F ; 127 19962: df 4f sbci r29, 0xFF ; 255 19964: 68 81 ld r22, Y 19966: 79 81 ldd r23, Y+1 ; 0x01 19968: 8a 81 ldd r24, Y+2 ; 0x02 1996a: 9b 81 ldd r25, Y+3 ; 0x03 1996c: c1 58 subi r28, 0x81 ; 129 1996e: d0 40 sbci r29, 0x00 ; 0 19970: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19974: 4b 01 movw r8, r22 19976: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 19978: 11 11 cpse r17, r1 1997a: 9a c1 rjmp .+820 ; 0x19cb0 1997c: 60 e0 ldi r22, 0x00 ; 0 1997e: 70 e0 ldi r23, 0x00 ; 0 19980: 80 e8 ldi r24, 0x80 ; 128 19982: 9f e3 ldi r25, 0x3F ; 63 19984: aa c1 rjmp .+852 ; 0x19cda int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 19986: 2f 3f cpi r18, 0xFF ; 255 19988: 09 f0 breq .+2 ; 0x1998c 1998a: fe cc rjmp .-1540 ; 0x19388 ++maxs; 1998c: 01 96 adiw r24, 0x01 ; 1 1998e: fc cc rjmp .-1544 ; 0x19388 19990: ae 01 movw r20, r28 19992: 4f 5f subi r20, 0xFF ; 255 19994: 5f 4f sbci r21, 0xFF ; 255 19996: be 01 movw r22, r28 19998: 6f 5b subi r22, 0xBF ; 191 1999a: 7f 4f sbci r23, 0xFF ; 255 1999c: 80 ee ldi r24, 0xE0 ; 224 1999e: 9a e0 ldi r25, 0x0A ; 10 199a0: 0f 94 d7 5b call 0x2b7ae ; 0x2b7ae 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; 199a4: 66 96 adiw r28, 0x16 ; 22 199a6: 6f ad ldd r22, Y+63 ; 0x3f 199a8: 66 97 sbiw r28, 0x16 ; 22 row = r08; 199aa: 62 96 adiw r28, 0x12 ; 18 199ac: 1f ad ldd r17, Y+63 ; 0x3f 199ae: 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){ 199b0: 80 17 cp r24, r16 199b2: 28 f0 brcs .+10 ; 0x199be col = c08; row = r08; return match08; } col = c10; 199b4: 22 96 adiw r28, 0x02 ; 2 199b6: 6f ad ldd r22, Y+63 ; 0x3f 199b8: 22 97 sbiw r28, 0x02 ; 2 row = r10; 199ba: 19 81 ldd r17, Y+1 ; 0x01 199bc: 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){ 199be: 08 35 cpi r16, 0x58 ; 88 199c0: 08 f4 brcc .+2 ; 0x199c4 199c2: 5b c1 rjmp .+694 ; 0x19c7a /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 199c4: 70 e0 ldi r23, 0x00 ; 0 199c6: 90 e0 ldi r25, 0x00 ; 0 199c8: 80 e0 ldi r24, 0x00 ; 0 199ca: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 199ce: 20 e0 ldi r18, 0x00 ; 0 199d0: 30 e0 ldi r19, 0x00 ; 0 199d2: 40 eb ldi r20, 0xB0 ; 176 199d4: 50 e4 ldi r21, 0x40 ; 64 199d6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 199da: 2b 01 movw r4, r22 199dc: 3c 01 movw r6, r24 199de: 65 96 adiw r28, 0x15 ; 21 199e0: 4c ae std Y+60, r4 ; 0x3c 199e2: 5d ae std Y+61, r5 ; 0x3d 199e4: 6e ae std Y+62, r6 ; 0x3e 199e6: 7f ae std Y+63, r7 ; 0x3f 199e8: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 199ea: 61 2f mov r22, r17 199ec: 70 e0 ldi r23, 0x00 ; 0 199ee: 90 e0 ldi r25, 0x00 ; 0 199f0: 80 e0 ldi r24, 0x00 ; 0 199f2: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 199f6: 20 e0 ldi r18, 0x00 ; 0 199f8: 30 e0 ldi r19, 0x00 ; 0 199fa: 40 eb ldi r20, 0xB0 ; 176 199fc: 50 e4 ldi r21, 0x40 ; 64 199fe: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19a02: 4b 01 movw r8, r22 19a04: 5c 01 movw r10, r24 19a06: 25 96 adiw r28, 0x05 ; 5 19a08: 8c ae std Y+60, r8 ; 0x3c 19a0a: 9d ae std Y+61, r9 ; 0x3d 19a0c: ae ae std Y+62, r10 ; 0x3e 19a0e: bf ae std Y+63, r11 ; 0x3f 19a10: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 19a12: 20 e0 ldi r18, 0x00 ; 0 19a14: 30 e0 ldi r19, 0x00 ; 0 19a16: 40 e9 ldi r20, 0x90 ; 144 19a18: 50 e4 ldi r21, 0x40 ; 64 19a1a: 29 83 std Y+1, r18 ; 0x01 19a1c: 3a 83 std Y+2, r19 ; 0x02 19a1e: 4b 83 std Y+3, r20 ; 0x03 19a20: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 19a22: ae 01 movw r20, r28 19a24: 4f 5f subi r20, 0xFF ; 255 19a26: 5f 4f sbci r21, 0xFF ; 255 19a28: be 01 movw r22, r28 19a2a: 6f 5b subi r22, 0xBF ; 191 19a2c: 7f 4f sbci r23, 0xFF ; 255 19a2e: ce 01 movw r24, r28 19a30: 8f 5a subi r24, 0xAF ; 175 19a32: 9f 4f sbci r25, 0xFF ; 255 19a34: 0f 94 8c 58 call 0x2b118 ; 0x2b118 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 19a38: a3 01 movw r20, r6 19a3a: 92 01 movw r18, r4 19a3c: 65 96 adiw r28, 0x15 ; 21 19a3e: 6c ad ldd r22, Y+60 ; 0x3c 19a40: 7d ad ldd r23, Y+61 ; 0x3d 19a42: 8e ad ldd r24, Y+62 ; 0x3e 19a44: 9f ad ldd r25, Y+63 ; 0x3f 19a46: 65 97 sbiw r28, 0x15 ; 21 19a48: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19a4c: 6b 01 movw r12, r22 19a4e: 7c 01 movw r14, r24 19a50: 9f 77 andi r25, 0x7F ; 127 19a52: 20 e0 ldi r18, 0x00 ; 0 19a54: 30 e0 ldi r19, 0x00 ; 0 19a56: 40 e4 ldi r20, 0x40 ; 64 19a58: 50 e4 ldi r21, 0x40 ; 64 19a5a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 19a5e: 18 16 cp r1, r24 19a60: 34 f1 brlt .+76 ; 0x19aae 19a62: a5 01 movw r20, r10 19a64: 94 01 movw r18, r8 19a66: 25 96 adiw r28, 0x05 ; 5 19a68: 6c ad ldd r22, Y+60 ; 0x3c 19a6a: 7d ad ldd r23, Y+61 ; 0x3d 19a6c: 8e ad ldd r24, Y+62 ; 0x3e 19a6e: 9f ad ldd r25, Y+63 ; 0x3f 19a70: 25 97 sbiw r28, 0x05 ; 5 19a72: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19a76: 9f 77 andi r25, 0x7F ; 127 19a78: 20 e0 ldi r18, 0x00 ; 0 19a7a: 30 e0 ldi r19, 0x00 ; 0 19a7c: 40 e4 ldi r20, 0x40 ; 64 19a7e: 50 e4 ldi r21, 0x40 ; 64 19a80: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 19a84: 18 16 cp r1, r24 19a86: 9c f0 brlt .+38 ; 0x19aae 19a88: 20 e0 ldi r18, 0x00 ; 0 19a8a: 30 e0 ldi r19, 0x00 ; 0 19a8c: 40 ea ldi r20, 0xA0 ; 160 19a8e: 50 e4 ldi r21, 0x40 ; 64 19a90: 69 81 ldd r22, Y+1 ; 0x01 19a92: 7a 81 ldd r23, Y+2 ; 0x02 19a94: 8b 81 ldd r24, Y+3 ; 0x03 19a96: 9c 81 ldd r25, Y+4 ; 0x04 19a98: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19a9c: 9f 77 andi r25, 0x7F ; 127 19a9e: 20 e0 ldi r18, 0x00 ; 0 19aa0: 30 e0 ldi r19, 0x00 ; 0 19aa2: 40 e4 ldi r20, 0x40 ; 64 19aa4: 50 e4 ldi r21, 0x40 ; 64 19aa6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 19aaa: 18 16 cp r1, r24 19aac: bc f5 brge .+110 ; 0x19b1c //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 19aae: 20 e0 ldi r18, 0x00 ; 0 19ab0: 30 e0 ldi r19, 0x00 ; 0 19ab2: 40 ea ldi r20, 0xA0 ; 160 19ab4: 50 e4 ldi r21, 0x40 ; 64 19ab6: 69 81 ldd r22, Y+1 ; 0x01 19ab8: 7a 81 ldd r23, Y+2 ; 0x02 19aba: 8b 81 ldd r24, Y+3 ; 0x03 19abc: 9c 81 ldd r25, Y+4 ; 0x04 19abe: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19ac2: 9f 93 push r25 19ac4: 8f 93 push r24 19ac6: 7f 93 push r23 19ac8: 6f 93 push r22 19aca: a5 01 movw r20, r10 19acc: 94 01 movw r18, r8 19ace: 25 96 adiw r28, 0x05 ; 5 19ad0: 6c ad ldd r22, Y+60 ; 0x3c 19ad2: 7d ad ldd r23, Y+61 ; 0x3d 19ad4: 8e ad ldd r24, Y+62 ; 0x3e 19ad6: 9f ad ldd r25, Y+63 ; 0x3f 19ad8: 25 97 sbiw r28, 0x05 ; 5 19ada: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19ade: 9f 93 push r25 19ae0: 8f 93 push r24 19ae2: 7f 93 push r23 19ae4: 6f 93 push r22 19ae6: ff 92 push r15 19ae8: ef 92 push r14 19aea: df 92 push r13 19aec: cf 92 push r12 19aee: 86 eb ldi r24, 0xB6 ; 182 19af0: 98 e8 ldi r25, 0x88 ; 136 19af2: 9f 93 push r25 19af4: 8f 93 push r24 19af6: 0f 94 fe 9f call 0x33ffc ; 0x33ffc /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 19afa: 65 96 adiw r28, 0x15 ; 21 19afc: 4c ae std Y+60, r4 ; 0x3c 19afe: 5d ae std Y+61, r5 ; 0x3d 19b00: 6e ae std Y+62, r6 ; 0x3e 19b02: 7f ae std Y+63, r7 ; 0x3f 19b04: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 19b06: 25 96 adiw r28, 0x05 ; 5 19b08: 8c ae std Y+60, r8 ; 0x3c 19b0a: 9d ae std Y+61, r9 ; 0x3d 19b0c: ae ae std Y+62, r10 ; 0x3e 19b0e: bf ae std Y+63, r11 ; 0x3f 19b10: 25 97 sbiw r28, 0x05 ; 5 19b12: 0f b6 in r0, 0x3f ; 63 19b14: f8 94 cli 19b16: de bf out 0x3e, r29 ; 62 19b18: 0f be out 0x3f, r0 ; 63 19b1a: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 19b1c: 20 e0 ldi r18, 0x00 ; 0 19b1e: 30 e0 ldi r19, 0x00 ; 0 19b20: 48 e7 ldi r20, 0x78 ; 120 19b22: 51 e4 ldi r21, 0x41 ; 65 19b24: 65 96 adiw r28, 0x15 ; 21 19b26: 6c ad ldd r22, Y+60 ; 0x3c 19b28: 7d ad ldd r23, Y+61 ; 0x3d 19b2a: 8e ad ldd r24, Y+62 ; 0x3e 19b2c: 9f ad ldd r25, Y+63 ; 0x3f 19b2e: 65 97 sbiw r28, 0x15 ; 21 19b30: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19b34: 20 e0 ldi r18, 0x00 ; 0 19b36: 30 e0 ldi r19, 0x00 ; 0 19b38: 40 e8 ldi r20, 0x80 ; 128 19b3a: 52 e4 ldi r21, 0x42 ; 66 19b3c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19b40: 6b 01 movw r12, r22 19b42: 7c 01 movw r14, r24 19b44: 6c 96 adiw r28, 0x1c ; 28 19b46: ae ad ldd r26, Y+62 ; 0x3e 19b48: bf ad ldd r27, Y+63 ; 0x3f 19b4a: 6c 97 sbiw r28, 0x1c ; 28 19b4c: bd 01 movw r22, r26 19b4e: bb 0f add r27, r27 19b50: 88 0b sbc r24, r24 19b52: 99 0b sbc r25, r25 19b54: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 19b58: 9b 01 movw r18, r22 19b5a: ac 01 movw r20, r24 19b5c: c7 01 movw r24, r14 19b5e: b6 01 movw r22, r12 19b60: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19b64: 6b 01 movw r12, r22 19b66: 7c 01 movw r14, r24 19b68: 65 96 adiw r28, 0x15 ; 21 19b6a: cc ae std Y+60, r12 ; 0x3c 19b6c: dd ae std Y+61, r13 ; 0x3d 19b6e: ee ae std Y+62, r14 ; 0x3e 19b70: ff ae std Y+63, r15 ; 0x3f 19b72: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 19b74: 20 e0 ldi r18, 0x00 ; 0 19b76: 30 e0 ldi r19, 0x00 ; 0 19b78: 48 e7 ldi r20, 0x78 ; 120 19b7a: 51 e4 ldi r21, 0x41 ; 65 19b7c: 25 96 adiw r28, 0x05 ; 5 19b7e: 6c ad ldd r22, Y+60 ; 0x3c 19b80: 7d ad ldd r23, Y+61 ; 0x3d 19b82: 8e ad ldd r24, Y+62 ; 0x3e 19b84: 9f ad ldd r25, Y+63 ; 0x3f 19b86: 25 97 sbiw r28, 0x05 ; 5 19b88: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19b8c: 20 e0 ldi r18, 0x00 ; 0 19b8e: 30 e0 ldi r19, 0x00 ; 0 19b90: 40 e8 ldi r20, 0x80 ; 128 19b92: 52 e4 ldi r21, 0x42 ; 66 19b94: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19b98: 4b 01 movw r8, r22 19b9a: 5c 01 movw r10, r24 19b9c: ac 96 adiw r28, 0x2c ; 44 19b9e: ee ad ldd r30, Y+62 ; 0x3e 19ba0: ff ad ldd r31, Y+63 ; 0x3f 19ba2: ac 97 sbiw r28, 0x2c ; 44 19ba4: bf 01 movw r22, r30 19ba6: ff 0f add r31, r31 19ba8: 88 0b sbc r24, r24 19baa: 99 0b sbc r25, r25 19bac: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 19bb0: 9b 01 movw r18, r22 19bb2: ac 01 movw r20, r24 19bb4: c5 01 movw r24, r10 19bb6: b4 01 movw r22, r8 19bb8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19bbc: 25 96 adiw r28, 0x05 ; 5 19bbe: 6c af std Y+60, r22 ; 0x3c 19bc0: 7d af std Y+61, r23 ; 0x3d 19bc2: 8e af std Y+62, r24 ; 0x3e 19bc4: 9f af std Y+63, r25 ; 0x3f 19bc6: 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; 19bc8: 2a e0 ldi r18, 0x0A ; 10 19bca: 37 ed ldi r19, 0xD7 ; 215 19bcc: 43 e2 ldi r20, 0x23 ; 35 19bce: 5c e3 ldi r21, 0x3C ; 60 19bd0: 0f 94 09 9c call 0x33812 ; 0x33812 <__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)); 19bd4: 9f 93 push r25 19bd6: 8f 93 push r24 19bd8: 7f 93 push r23 19bda: 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; 19bdc: 2a e0 ldi r18, 0x0A ; 10 19bde: 37 ed ldi r19, 0xD7 ; 215 19be0: 43 e2 ldi r20, 0x23 ; 35 19be2: 5c e3 ldi r21, 0x3C ; 60 19be4: c7 01 movw r24, r14 19be6: b6 01 movw r22, r12 19be8: 0f 94 09 9c call 0x33812 ; 0x33812 <__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)); 19bec: 9f 93 push r25 19bee: 8f 93 push r24 19bf0: 7f 93 push r23 19bf2: 6f 93 push r22 19bf4: 8a e9 ldi r24, 0x9A ; 154 19bf6: 98 e8 ldi r25, 0x88 ; 136 19bf8: 9f 93 push r25 19bfa: 8f 93 push r24 19bfc: 0f 94 fe 9f call 0x33ffc ; 0x33ffc uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 19c00: 20 e0 ldi r18, 0x00 ; 0 19c02: 30 e0 ldi r19, 0x00 ; 0 19c04: 40 e0 ldi r20, 0x00 ; 0 19c06: 5f e3 ldi r21, 0x3F ; 63 19c08: 25 96 adiw r28, 0x05 ; 5 19c0a: 6c ad ldd r22, Y+60 ; 0x3c 19c0c: 7d ad ldd r23, Y+61 ; 0x3d 19c0e: 8e ad ldd r24, Y+62 ; 0x3e 19c10: 9f ad ldd r25, Y+63 ; 0x3f 19c12: 25 97 sbiw r28, 0x05 ; 5 19c14: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19c18: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 19c1c: 6b 01 movw r12, r22 19c1e: 20 e0 ldi r18, 0x00 ; 0 19c20: 30 e0 ldi r19, 0x00 ; 0 19c22: 40 e0 ldi r20, 0x00 ; 0 19c24: 5f e3 ldi r21, 0x3F ; 63 19c26: 65 96 adiw r28, 0x15 ; 21 19c28: 6c ad ldd r22, Y+60 ; 0x3c 19c2a: 7d ad ldd r23, Y+61 ; 0x3d 19c2c: 8e ad ldd r24, Y+62 ; 0x3e 19c2e: 9f ad ldd r25, Y+63 ; 0x3f 19c30: 65 97 sbiw r28, 0x15 ; 21 19c32: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19c36: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 19c3a: 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); 19c3c: 00 e0 ldi r16, 0x00 ; 0 19c3e: 28 ec ldi r18, 0xC8 ; 200 19c40: 30 e0 ldi r19, 0x00 ; 0 19c42: e7 96 adiw r28, 0x37 ; 55 19c44: 4e ad ldd r20, Y+62 ; 0x3e 19c46: 5f ad ldd r21, Y+63 ; 0x3f 19c48: e7 97 sbiw r28, 0x37 ; 55 19c4a: b6 01 movw r22, r12 19c4c: 0e 94 ca c2 call 0x18594 ; 0x18594 19c50: 0f b6 in r0, 0x3f ; 63 19c52: f8 94 cli 19c54: de bf out 0x3e, r29 ; 62 19c56: 0f be out 0x3f, r0 ; 63 19c58: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 19c5a: 10 e0 ldi r17, 0x00 ; 0 19c5c: 88 ea ldi r24, 0xA8 ; 168 19c5e: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 19c60: a4 96 adiw r28, 0x24 ; 36 19c62: ae ad ldd r26, Y+62 ; 0x3e 19c64: bf ad ldd r27, Y+63 ; 0x3f 19c66: a4 97 sbiw r28, 0x24 ; 36 19c68: 1d 92 st X+, r1 19c6a: a4 96 adiw r28, 0x24 ; 36 19c6c: bf af std Y+63, r27 ; 0x3f 19c6e: ae af std Y+62, r26 ; 0x3e 19c70: 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++) 19c72: 8a 17 cp r24, r26 19c74: 9b 07 cpc r25, r27 19c76: a1 f7 brne .-24 ; 0x19c60 19c78: 76 cc rjmp .-1812 ; 0x19566 /// 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; 19c7a: 1f ef ldi r17, 0xFF ; 255 19c7c: ef cf rjmp .-34 ; 0x19c5c 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; 19c7e: e5 96 adiw r28, 0x35 ; 53 19c80: bf ad ldd r27, Y+63 ; 0x3f 19c82: e5 97 sbiw r28, 0x35 ; 53 19c84: a7 96 adiw r28, 0x27 ; 39 19c86: bf af std Y+63, r27 ; 0x3f 19c88: a7 97 sbiw r28, 0x27 ; 39 19c8a: 99 cc rjmp .-1742 ; 0x195be // 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; 19c8c: af 96 adiw r28, 0x2f ; 47 19c8e: 1f ae std Y+63, r1 ; 0x3f 19c90: af 97 sbiw r28, 0x2f ; 47 19c92: 62 cd rjmp .-1340 ; 0x19758 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]) : 19c94: f2 01 movw r30, r4 19c96: 25 81 ldd r18, Z+5 ; 0x05 19c98: 36 81 ldd r19, Z+6 ; 0x06 19c9a: 47 81 ldd r20, Z+7 ; 0x07 19c9c: 50 85 ldd r21, Z+8 ; 0x08 19c9e: c3 58 subi r28, 0x83 ; 131 19ca0: df 4f sbci r29, 0xFF ; 255 19ca2: 68 81 ld r22, Y 19ca4: 79 81 ldd r23, Y+1 ; 0x01 19ca6: 8a 81 ldd r24, Y+2 ; 0x02 19ca8: 9b 81 ldd r25, Y+3 ; 0x03 19caa: cd 57 subi r28, 0x7D ; 125 19cac: d0 40 sbci r29, 0x00 ; 0 19cae: 60 ce rjmp .-832 ; 0x19970 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 19cb0: 12 30 cpi r17, 0x02 ; 2 19cb2: 11 f0 breq .+4 ; 0x19cb8 19cb4: 0c 94 31 d7 jmp 0x1ae62 ; 0x1ae62 19cb8: d2 01 movw r26, r4 19cba: 11 96 adiw r26, 0x01 ; 1 19cbc: 2d 91 ld r18, X+ 19cbe: 3d 91 ld r19, X+ 19cc0: 4d 91 ld r20, X+ 19cc2: 5c 91 ld r21, X 19cc4: 14 97 sbiw r26, 0x04 ; 4 19cc6: cf 57 subi r28, 0x7F ; 127 19cc8: df 4f sbci r29, 0xFF ; 255 19cca: 68 81 ld r22, Y 19ccc: 79 81 ldd r23, Y+1 ; 0x01 19cce: 8a 81 ldd r24, Y+2 ; 0x02 19cd0: 9b 81 ldd r25, Y+3 ; 0x03 19cd2: c1 58 subi r28, 0x81 ; 129 19cd4: d0 40 sbci r29, 0x00 ; 0 19cd6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 19cda: 9b 01 movw r18, r22 19cdc: ac 01 movw r20, r24 19cde: c5 01 movw r24, r10 19ce0: b4 01 movw r22, r8 19ce2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19ce6: 9b 01 movw r18, r22 19ce8: ac 01 movw r20, r24 19cea: c7 01 movw r24, r14 19cec: b6 01 movw r22, r12 19cee: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19cf2: 6b 01 movw r12, r22 19cf4: 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) { 19cf6: 01 11 cpse r16, r1 19cf8: 0c 94 3e d8 jmp 0x1b07c ; 0x1b07c 19cfc: 7a 94 dec r7 19cfe: f8 e0 ldi r31, 0x08 ; 8 19d00: 4f 0e add r4, r31 19d02: 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) { 19d04: 71 10 cpse r7, r1 19d06: 16 ce rjmp .-980 ; 0x19934 (-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; 19d08: d1 01 movw r26, r2 19d0a: cd 92 st X+, r12 19d0c: dd 92 st X+, r13 19d0e: ed 92 st X+, r14 19d10: fd 92 st X+, r15 19d12: 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) { 19d14: 1f 5f subi r17, 0xFF ; 255 19d16: 14 30 cpi r17, 0x04 ; 4 19d18: 09 f0 breq .+2 ; 0x19d1c 19d1a: 03 ce rjmp .-1018 ; 0x19922 19d1c: 3f e4 ldi r19, 0x4F ; 79 19d1e: 23 2e mov r2, r19 19d20: 39 e8 ldi r19, 0x89 ; 137 19d22: 33 2e mov r3, r19 19d24: ec e9 ldi r30, 0x9C ; 156 19d26: f2 e1 ldi r31, 0x12 ; 18 19d28: a8 96 adiw r28, 0x28 ; 40 19d2a: ff af std Y+63, r31 ; 0x3f 19d2c: ee af std Y+62, r30 ; 0x3e 19d2e: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 19d30: c3 57 subi r28, 0x73 ; 115 19d32: df 4f sbci r29, 0xFF ; 255 19d34: 18 82 st Y, r1 19d36: cd 58 subi r28, 0x8D ; 141 19d38: d0 40 sbci r29, 0x00 ; 0 19d3a: c3 56 subi r28, 0x63 ; 99 19d3c: df 4f sbci r29, 0xFF ; 255 19d3e: 18 82 st Y, r1 19d40: cd 59 subi r28, 0x9D ; 157 19d42: d0 40 sbci r29, 0x00 ; 0 19d44: cf 55 subi r28, 0x5F ; 95 19d46: df 4f sbci r29, 0xFF ; 255 19d48: 18 82 st Y, r1 19d4a: c1 5a subi r28, 0xA1 ; 161 19d4c: d0 40 sbci r29, 0x00 ; 0 19d4e: 10 e0 ldi r17, 0x00 ; 0 19d50: a8 96 adiw r28, 0x28 ; 40 19d52: ae ad ldd r26, Y+62 ; 0x3e 19d54: bf ad ldd r27, Y+63 ; 0x3f 19d56: a8 97 sbiw r28, 0x28 ; 40 19d58: 11 96 adiw r26, 0x01 ; 1 19d5a: 2d 91 ld r18, X+ 19d5c: 3d 91 ld r19, X+ 19d5e: 4d 91 ld r20, X+ 19d60: 5c 91 ld r21, X 19d62: 14 97 sbiw r26, 0x04 ; 4 19d64: e4 96 adiw r28, 0x34 ; 52 19d66: 2c af std Y+60, r18 ; 0x3c 19d68: 3d af std Y+61, r19 ; 0x3d 19d6a: 4e af std Y+62, r20 ; 0x3e 19d6c: 5f af std Y+63, r21 ; 0x3f 19d6e: e4 97 sbiw r28, 0x34 ; 52 19d70: 15 96 adiw r26, 0x05 ; 5 19d72: 4d 90 ld r4, X+ 19d74: 5d 90 ld r5, X+ 19d76: 6d 90 ld r6, X+ 19d78: 7c 90 ld r7, X 19d7a: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 19d7c: 00 23 and r16, r16 19d7e: 11 f4 brne .+4 ; 0x19d84 19d80: 0c 94 64 d7 jmp 0x1aec8 ; 0x1aec8 ((r == 1) ? 0.f : 19d84: 81 2c mov r8, r1 19d86: 91 2c mov r9, r1 19d88: 54 01 movw r10, r8 19d8a: 01 30 cpi r16, 0x01 ; 1 19d8c: 81 f0 breq .+32 ; 0x19dae ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19d8e: 02 30 cpi r16, 0x02 ; 2 19d90: 11 f0 breq .+4 ; 0x19d96 19d92: 0c 94 58 d7 jmp 0x1aeb0 ; 0x1aeb0 19d96: cf 57 subi r28, 0x7F ; 127 19d98: df 4f sbci r29, 0xFF ; 255 19d9a: 68 81 ld r22, Y 19d9c: 79 81 ldd r23, Y+1 ; 0x01 19d9e: 8a 81 ldd r24, Y+2 ; 0x02 19da0: 9b 81 ldd r25, Y+3 ; 0x03 19da2: c1 58 subi r28, 0x81 ; 129 19da4: d0 40 sbci r29, 0x00 ; 0 19da6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19daa: 4b 01 movw r8, r22 19dac: 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); 19dae: e4 96 adiw r28, 0x34 ; 52 19db0: 2c ad ldd r18, Y+60 ; 0x3c 19db2: 3d ad ldd r19, Y+61 ; 0x3d 19db4: 4e ad ldd r20, Y+62 ; 0x3e 19db6: 5f ad ldd r21, Y+63 ; 0x3f 19db8: e4 97 sbiw r28, 0x34 ; 52 19dba: 6e 96 adiw r28, 0x1e ; 30 19dbc: 6c ad ldd r22, Y+60 ; 0x3c 19dbe: 7d ad ldd r23, Y+61 ; 0x3d 19dc0: 8e ad ldd r24, Y+62 ; 0x3e 19dc2: 9f ad ldd r25, Y+63 ; 0x3f 19dc4: 6e 97 sbiw r28, 0x1e ; 30 19dc6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19dca: 6b 01 movw r12, r22 19dcc: 7c 01 movw r14, r24 19dce: f1 01 movw r30, r2 19dd0: 25 91 lpm r18, Z+ 19dd2: 35 91 lpm r19, Z+ 19dd4: 45 91 lpm r20, Z+ 19dd6: 54 91 lpm r21, Z 19dd8: cb 55 subi r28, 0x5B ; 91 19dda: df 4f sbci r29, 0xFF ; 255 19ddc: 28 83 st Y, r18 19dde: 39 83 std Y+1, r19 ; 0x01 19de0: 4a 83 std Y+2, r20 ; 0x02 19de2: 5b 83 std Y+3, r21 ; 0x03 19de4: c5 5a subi r28, 0xA5 ; 165 19de6: d0 40 sbci r29, 0x00 ; 0 19de8: a3 01 movw r20, r6 19dea: 92 01 movw r18, r4 19dec: cb 56 subi r28, 0x6B ; 107 19dee: df 4f sbci r29, 0xFF ; 255 19df0: 68 81 ld r22, Y 19df2: 79 81 ldd r23, Y+1 ; 0x01 19df4: 8a 81 ldd r24, Y+2 ; 0x02 19df6: 9b 81 ldd r25, Y+3 ; 0x03 19df8: c5 59 subi r28, 0x95 ; 149 19dfa: d0 40 sbci r29, 0x00 ; 0 19dfc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19e00: 9b 01 movw r18, r22 19e02: ac 01 movw r20, r24 19e04: c7 01 movw r24, r14 19e06: b6 01 movw r22, r12 19e08: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 19e0c: c5 55 subi r28, 0x55 ; 85 19e0e: df 4f sbci r29, 0xFF ; 255 19e10: 28 81 ld r18, Y 19e12: 39 81 ldd r19, Y+1 ; 0x01 19e14: 4a 81 ldd r20, Y+2 ; 0x02 19e16: 5b 81 ldd r21, Y+3 ; 0x03 19e18: cb 5a subi r28, 0xAB ; 171 19e1a: d0 40 sbci r29, 0x00 ; 0 19e1c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19e20: cb 55 subi r28, 0x5B ; 91 19e22: df 4f sbci r29, 0xFF ; 255 19e24: 28 81 ld r18, Y 19e26: 39 81 ldd r19, Y+1 ; 0x01 19e28: 4a 81 ldd r20, Y+2 ; 0x02 19e2a: 5b 81 ldd r21, Y+3 ; 0x03 19e2c: c5 5a subi r28, 0xA5 ; 165 19e2e: d0 40 sbci r29, 0x00 ; 0 19e30: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 19e34: a5 01 movw r20, r10 19e36: 94 01 movw r18, r8 19e38: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19e3c: c3 57 subi r28, 0x73 ; 115 19e3e: df 4f sbci r29, 0xFF ; 255 19e40: 28 81 ld r18, Y 19e42: cd 58 subi r28, 0x8D ; 141 19e44: d0 40 sbci r29, 0x00 ; 0 19e46: c3 56 subi r28, 0x63 ; 99 19e48: df 4f sbci r29, 0xFF ; 255 19e4a: 38 81 ld r19, Y 19e4c: cd 59 subi r28, 0x9D ; 157 19e4e: d0 40 sbci r29, 0x00 ; 0 19e50: cf 55 subi r28, 0x5F ; 95 19e52: df 4f sbci r29, 0xFF ; 255 19e54: 48 81 ld r20, Y 19e56: c1 5a subi r28, 0xA1 ; 161 19e58: d0 40 sbci r29, 0x00 ; 0 19e5a: 51 2f mov r21, r17 19e5c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19e60: c3 57 subi r28, 0x73 ; 115 19e62: df 4f sbci r29, 0xFF ; 255 19e64: 68 83 st Y, r22 19e66: 79 83 std Y+1, r23 ; 0x01 19e68: 8a 83 std Y+2, r24 ; 0x02 19e6a: 9b 83 std Y+3, r25 ; 0x03 19e6c: cd 58 subi r28, 0x8D ; 141 19e6e: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 19e70: 00 23 and r16, r16 19e72: 11 f4 brne .+4 ; 0x19e78 19e74: 0c 94 6c d7 jmp 0x1aed8 ; 0x1aed8 ((r == 1) ? 1.f : 19e78: 01 30 cpi r16, 0x01 ; 1 19e7a: 11 f4 brne .+4 ; 0x19e80 19e7c: 0c 94 71 d7 jmp 0x1aee2 ; 0x1aee2 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 19e80: 02 30 cpi r16, 0x02 ; 2 19e82: 61 f0 breq .+24 ; 0x19e9c 19e84: a3 01 movw r20, r6 19e86: 92 01 movw r18, r4 19e88: ed 96 adiw r28, 0x3d ; 61 19e8a: 6c ad ldd r22, Y+60 ; 0x3c 19e8c: 7d ad ldd r23, Y+61 ; 0x3d 19e8e: 8e ad ldd r24, Y+62 ; 0x3e 19e90: 9f ad ldd r25, Y+63 ; 0x3f 19e92: ed 97 sbiw r28, 0x3d ; 61 19e94: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19e98: 6b 01 movw r12, r22 19e9a: 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); 19e9c: f1 01 movw r30, r2 19e9e: 34 96 adiw r30, 0x04 ; 4 19ea0: 85 90 lpm r8, Z+ 19ea2: 95 90 lpm r9, Z+ 19ea4: a5 90 lpm r10, Z+ 19ea6: b4 90 lpm r11, Z 19ea8: e4 96 adiw r28, 0x34 ; 52 19eaa: 2c ad ldd r18, Y+60 ; 0x3c 19eac: 3d ad ldd r19, Y+61 ; 0x3d 19eae: 4e ad ldd r20, Y+62 ; 0x3e 19eb0: 5f ad ldd r21, Y+63 ; 0x3f 19eb2: e4 97 sbiw r28, 0x34 ; 52 19eb4: cb 57 subi r28, 0x7B ; 123 19eb6: df 4f sbci r29, 0xFF ; 255 19eb8: 68 81 ld r22, Y 19eba: 79 81 ldd r23, Y+1 ; 0x01 19ebc: 8a 81 ldd r24, Y+2 ; 0x02 19ebe: 9b 81 ldd r25, Y+3 ; 0x03 19ec0: c5 58 subi r28, 0x85 ; 133 19ec2: d0 40 sbci r29, 0x00 ; 0 19ec4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19ec8: e4 96 adiw r28, 0x34 ; 52 19eca: 6c af std Y+60, r22 ; 0x3c 19ecc: 7d af std Y+61, r23 ; 0x3d 19ece: 8e af std Y+62, r24 ; 0x3e 19ed0: 9f af std Y+63, r25 ; 0x3f 19ed2: e4 97 sbiw r28, 0x34 ; 52 19ed4: a3 01 movw r20, r6 19ed6: 92 01 movw r18, r4 19ed8: c7 57 subi r28, 0x77 ; 119 19eda: df 4f sbci r29, 0xFF ; 255 19edc: 68 81 ld r22, Y 19ede: 79 81 ldd r23, Y+1 ; 0x01 19ee0: 8a 81 ldd r24, Y+2 ; 0x02 19ee2: 9b 81 ldd r25, Y+3 ; 0x03 19ee4: c9 58 subi r28, 0x89 ; 137 19ee6: d0 40 sbci r29, 0x00 ; 0 19ee8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19eec: 9b 01 movw r18, r22 19eee: ac 01 movw r20, r24 19ef0: e4 96 adiw r28, 0x34 ; 52 19ef2: 6c ad ldd r22, Y+60 ; 0x3c 19ef4: 7d ad ldd r23, Y+61 ; 0x3d 19ef6: 8e ad ldd r24, Y+62 ; 0x3e 19ef8: 9f ad ldd r25, Y+63 ; 0x3f 19efa: e4 97 sbiw r28, 0x34 ; 52 19efc: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19f00: c1 55 subi r28, 0x51 ; 81 19f02: df 4f sbci r29, 0xFF ; 255 19f04: 28 81 ld r18, Y 19f06: 39 81 ldd r19, Y+1 ; 0x01 19f08: 4a 81 ldd r20, Y+2 ; 0x02 19f0a: 5b 81 ldd r21, Y+3 ; 0x03 19f0c: cf 5a subi r28, 0xAF ; 175 19f0e: d0 40 sbci r29, 0x00 ; 0 19f10: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19f14: a5 01 movw r20, r10 19f16: 94 01 movw r18, r8 19f18: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 19f1c: a7 01 movw r20, r14 19f1e: 96 01 movw r18, r12 19f20: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 19f24: c3 57 subi r28, 0x73 ; 115 19f26: df 4f sbci r29, 0xFF ; 255 19f28: 28 81 ld r18, Y 19f2a: 39 81 ldd r19, Y+1 ; 0x01 19f2c: 4a 81 ldd r20, Y+2 ; 0x02 19f2e: 5b 81 ldd r21, Y+3 ; 0x03 19f30: cd 58 subi r28, 0x8D ; 141 19f32: d0 40 sbci r29, 0x00 ; 0 19f34: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 19f38: c3 57 subi r28, 0x73 ; 115 19f3a: df 4f sbci r29, 0xFF ; 255 19f3c: 68 83 st Y, r22 19f3e: cd 58 subi r28, 0x8D ; 141 19f40: d0 40 sbci r29, 0x00 ; 0 19f42: c3 56 subi r28, 0x63 ; 99 19f44: df 4f sbci r29, 0xFF ; 255 19f46: 78 83 st Y, r23 19f48: cd 59 subi r28, 0x9D ; 157 19f4a: d0 40 sbci r29, 0x00 ; 0 19f4c: cf 55 subi r28, 0x5F ; 95 19f4e: df 4f sbci r29, 0xFF ; 255 19f50: 88 83 st Y, r24 19f52: c1 5a subi r28, 0xA1 ; 161 19f54: d0 40 sbci r29, 0x00 ; 0 19f56: 19 2f mov r17, r25 19f58: a8 96 adiw r28, 0x28 ; 40 19f5a: 4e ad ldd r20, Y+62 ; 0x3e 19f5c: 5f ad ldd r21, Y+63 ; 0x3f 19f5e: a8 97 sbiw r28, 0x28 ; 40 19f60: 48 5f subi r20, 0xF8 ; 248 19f62: 5f 4f sbci r21, 0xFF ; 255 19f64: a8 96 adiw r28, 0x28 ; 40 19f66: 5f af std Y+63, r21 ; 0x3f 19f68: 4e af std Y+62, r20 ; 0x3e 19f6a: a8 97 sbiw r28, 0x28 ; 40 19f6c: 58 e0 ldi r21, 0x08 ; 8 19f6e: 25 0e add r2, r21 19f70: 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) { 19f72: ac eb ldi r26, 0xBC ; 188 19f74: b2 e1 ldi r27, 0x12 ; 18 19f76: a8 96 adiw r28, 0x28 ; 40 19f78: ee ad ldd r30, Y+62 ; 0x3e 19f7a: ff ad ldd r31, Y+63 ; 0x3f 19f7c: a8 97 sbiw r28, 0x28 ; 40 19f7e: ae 17 cp r26, r30 19f80: bf 07 cpc r27, r31 19f82: 09 f0 breq .+2 ; 0x19f86 19f84: e5 ce rjmp .-566 ; 0x19d50 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; 19f86: 90 58 subi r25, 0x80 ; 128 19f88: c7 56 subi r28, 0x67 ; 103 19f8a: df 4f sbci r29, 0xFF ; 255 19f8c: a8 81 ld r26, Y 19f8e: b9 81 ldd r27, Y+1 ; 0x01 19f90: c9 59 subi r28, 0x99 ; 153 19f92: d0 40 sbci r29, 0x00 ; 0 19f94: 6d 93 st X+, r22 19f96: 7d 93 st X+, r23 19f98: 8d 93 st X+, r24 19f9a: 9d 93 st X+, r25 19f9c: c7 56 subi r28, 0x67 ; 103 19f9e: df 4f sbci r29, 0xFF ; 255 19fa0: b9 83 std Y+1, r27 ; 0x01 19fa2: a8 83 st Y, r26 19fa4: c9 59 subi r28, 0x99 ; 153 19fa6: 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) { 19fa8: 0f 5f subi r16, 0xFF ; 255 19faa: ac 96 adiw r28, 0x2c ; 44 19fac: ee ad ldd r30, Y+62 ; 0x3e 19fae: ff ad ldd r31, Y+63 ; 0x3f 19fb0: ac 97 sbiw r28, 0x2c ; 44 19fb2: 70 96 adiw r30, 0x10 ; 16 19fb4: ac 96 adiw r28, 0x2c ; 44 19fb6: ff af std Y+63, r31 ; 0x3f 19fb8: ee af std Y+62, r30 ; 0x3e 19fba: ac 97 sbiw r28, 0x2c ; 44 19fbc: 04 30 cpi r16, 0x04 ; 4 19fbe: 09 f0 breq .+2 ; 0x19fc2 19fc0: ab cc rjmp .-1706 ; 0x19918 } // 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]; 19fc2: 25 96 adiw r28, 0x05 ; 5 19fc4: 2c ad ldd r18, Y+60 ; 0x3c 19fc6: 3d ad ldd r19, Y+61 ; 0x3d 19fc8: 4e ad ldd r20, Y+62 ; 0x3e 19fca: 5f ad ldd r21, Y+63 ; 0x3f 19fcc: 25 97 sbiw r28, 0x05 ; 5 19fce: ae 96 adiw r28, 0x2e ; 46 19fd0: 2c af std Y+60, r18 ; 0x3c 19fd2: 3d af std Y+61, r19 ; 0x3d 19fd4: 4e af std Y+62, r20 ; 0x3e 19fd6: 5f af std Y+63, r21 ; 0x3f 19fd8: ae 97 sbiw r28, 0x2e ; 46 19fda: 8d 81 ldd r24, Y+5 ; 0x05 19fdc: 9e 81 ldd r25, Y+6 ; 0x06 19fde: af 81 ldd r26, Y+7 ; 0x07 19fe0: b8 85 ldd r27, Y+8 ; 0x08 19fe2: e4 96 adiw r28, 0x34 ; 52 19fe4: 8c af std Y+60, r24 ; 0x3c 19fe6: 9d af std Y+61, r25 ; 0x3d 19fe8: ae af std Y+62, r26 ; 0x3e 19fea: bf af std Y+63, r27 ; 0x3f 19fec: e4 97 sbiw r28, 0x34 ; 52 19fee: 29 85 ldd r18, Y+9 ; 0x09 19ff0: 3a 85 ldd r19, Y+10 ; 0x0a 19ff2: 4b 85 ldd r20, Y+11 ; 0x0b 19ff4: 5c 85 ldd r21, Y+12 ; 0x0c 19ff6: ed 96 adiw r28, 0x3d ; 61 19ff8: 2c af std Y+60, r18 ; 0x3c 19ffa: 3d af std Y+61, r19 ; 0x3d 19ffc: 4e af std Y+62, r20 ; 0x3e 19ffe: 5f af std Y+63, r21 ; 0x3f 1a000: ed 97 sbiw r28, 0x3d ; 61 1a002: 8d 85 ldd r24, Y+13 ; 0x0d 1a004: 9e 85 ldd r25, Y+14 ; 0x0e 1a006: af 85 ldd r26, Y+15 ; 0x0f 1a008: b8 89 ldd r27, Y+16 ; 0x10 1a00a: c3 58 subi r28, 0x83 ; 131 1a00c: df 4f sbci r29, 0xFF ; 255 1a00e: 88 83 st Y, r24 1a010: 99 83 std Y+1, r25 ; 0x01 1a012: aa 83 std Y+2, r26 ; 0x02 1a014: bb 83 std Y+3, r27 ; 0x03 1a016: cd 57 subi r28, 0x7D ; 125 1a018: d0 40 sbci r29, 0x00 ; 0 1a01a: 29 81 ldd r18, Y+1 ; 0x01 1a01c: 3a 81 ldd r19, Y+2 ; 0x02 1a01e: 4b 81 ldd r20, Y+3 ; 0x03 1a020: 5c 81 ldd r21, Y+4 ; 0x04 1a022: cf 57 subi r28, 0x7F ; 127 1a024: df 4f sbci r29, 0xFF ; 255 1a026: 28 83 st Y, r18 1a028: 39 83 std Y+1, r19 ; 0x01 1a02a: 4a 83 std Y+2, r20 ; 0x02 1a02c: 5b 83 std Y+3, r21 ; 0x03 1a02e: c1 58 subi r28, 0x81 ; 129 1a030: 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]; 1a032: 29 96 adiw r28, 0x09 ; 9 1a034: 8c ad ldd r24, Y+60 ; 0x3c 1a036: 9d ad ldd r25, Y+61 ; 0x3d 1a038: ae ad ldd r26, Y+62 ; 0x3e 1a03a: bf ad ldd r27, Y+63 ; 0x3f 1a03c: 29 97 sbiw r28, 0x09 ; 9 1a03e: cb 57 subi r28, 0x7B ; 123 1a040: df 4f sbci r29, 0xFF ; 255 1a042: 88 83 st Y, r24 1a044: 99 83 std Y+1, r25 ; 0x01 1a046: aa 83 std Y+2, r26 ; 0x02 1a048: bb 83 std Y+3, r27 ; 0x03 1a04a: c5 58 subi r28, 0x85 ; 133 1a04c: d0 40 sbci r29, 0x00 ; 0 1a04e: 29 89 ldd r18, Y+17 ; 0x11 1a050: 3a 89 ldd r19, Y+18 ; 0x12 1a052: 4b 89 ldd r20, Y+19 ; 0x13 1a054: 5c 89 ldd r21, Y+20 ; 0x14 1a056: c7 57 subi r28, 0x77 ; 119 1a058: df 4f sbci r29, 0xFF ; 255 1a05a: 28 83 st Y, r18 1a05c: 39 83 std Y+1, r19 ; 0x01 1a05e: 4a 83 std Y+2, r20 ; 0x02 1a060: 5b 83 std Y+3, r21 ; 0x03 1a062: c9 58 subi r28, 0x89 ; 137 1a064: d0 40 sbci r29, 0x00 ; 0 1a066: 89 8d ldd r24, Y+25 ; 0x19 1a068: 9a 8d ldd r25, Y+26 ; 0x1a 1a06a: ab 8d ldd r26, Y+27 ; 0x1b 1a06c: bc 8d ldd r27, Y+28 ; 0x1c 1a06e: cb 56 subi r28, 0x6B ; 107 1a070: df 4f sbci r29, 0xFF ; 255 1a072: 88 83 st Y, r24 1a074: 99 83 std Y+1, r25 ; 0x01 1a076: aa 83 std Y+2, r26 ; 0x02 1a078: bb 83 std Y+3, r27 ; 0x03 1a07a: c5 59 subi r28, 0x95 ; 149 1a07c: d0 40 sbci r29, 0x00 ; 0 1a07e: 2d 8d ldd r18, Y+29 ; 0x1d 1a080: 3e 8d ldd r19, Y+30 ; 0x1e 1a082: 4f 8d ldd r20, Y+31 ; 0x1f 1a084: 58 a1 ldd r21, Y+32 ; 0x20 1a086: c7 56 subi r28, 0x67 ; 103 1a088: df 4f sbci r29, 0xFF ; 255 1a08a: 28 83 st Y, r18 1a08c: 39 83 std Y+1, r19 ; 0x01 1a08e: 4a 83 std Y+2, r20 ; 0x02 1a090: 5b 83 std Y+3, r21 ; 0x03 1a092: c9 59 subi r28, 0x99 ; 153 1a094: d0 40 sbci r29, 0x00 ; 0 1a096: 8d 89 ldd r24, Y+21 ; 0x15 1a098: 9e 89 ldd r25, Y+22 ; 0x16 1a09a: af 89 ldd r26, Y+23 ; 0x17 1a09c: b8 8d ldd r27, Y+24 ; 0x18 1a09e: c3 57 subi r28, 0x73 ; 115 1a0a0: df 4f sbci r29, 0xFF ; 255 1a0a2: 88 83 st Y, r24 1a0a4: 99 83 std Y+1, r25 ; 0x01 1a0a6: aa 83 std Y+2, r26 ; 0x02 1a0a8: bb 83 std Y+3, r27 ; 0x03 1a0aa: cd 58 subi r28, 0x8D ; 141 1a0ac: 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]; 1a0ae: 2d 96 adiw r28, 0x0d ; 13 1a0b0: 2c ad ldd r18, Y+60 ; 0x3c 1a0b2: 3d ad ldd r19, Y+61 ; 0x3d 1a0b4: 4e ad ldd r20, Y+62 ; 0x3e 1a0b6: 5f ad ldd r21, Y+63 ; 0x3f 1a0b8: 2d 97 sbiw r28, 0x0d ; 13 1a0ba: c3 56 subi r28, 0x63 ; 99 1a0bc: df 4f sbci r29, 0xFF ; 255 1a0be: 28 83 st Y, r18 1a0c0: 39 83 std Y+1, r19 ; 0x01 1a0c2: 4a 83 std Y+2, r20 ; 0x02 1a0c4: 5b 83 std Y+3, r21 ; 0x03 1a0c6: cd 59 subi r28, 0x9D ; 157 1a0c8: d0 40 sbci r29, 0x00 ; 0 1a0ca: 89 a1 ldd r24, Y+33 ; 0x21 1a0cc: 9a a1 ldd r25, Y+34 ; 0x22 1a0ce: ab a1 ldd r26, Y+35 ; 0x23 1a0d0: bc a1 ldd r27, Y+36 ; 0x24 1a0d2: cf 55 subi r28, 0x5F ; 95 1a0d4: df 4f sbci r29, 0xFF ; 255 1a0d6: 88 83 st Y, r24 1a0d8: 99 83 std Y+1, r25 ; 0x01 1a0da: aa 83 std Y+2, r26 ; 0x02 1a0dc: bb 83 std Y+3, r27 ; 0x03 1a0de: c1 5a subi r28, 0xA1 ; 161 1a0e0: d0 40 sbci r29, 0x00 ; 0 1a0e2: 2d a1 ldd r18, Y+37 ; 0x25 1a0e4: 3e a1 ldd r19, Y+38 ; 0x26 1a0e6: 4f a1 ldd r20, Y+39 ; 0x27 1a0e8: 58 a5 ldd r21, Y+40 ; 0x28 1a0ea: cb 55 subi r28, 0x5B ; 91 1a0ec: df 4f sbci r29, 0xFF ; 255 1a0ee: 28 83 st Y, r18 1a0f0: 39 83 std Y+1, r19 ; 0x01 1a0f2: 4a 83 std Y+2, r20 ; 0x02 1a0f4: 5b 83 std Y+3, r21 ; 0x03 1a0f6: c5 5a subi r28, 0xA5 ; 165 1a0f8: d0 40 sbci r29, 0x00 ; 0 1a0fa: 8d a5 ldd r24, Y+45 ; 0x2d 1a0fc: 9e a5 ldd r25, Y+46 ; 0x2e 1a0fe: af a5 ldd r26, Y+47 ; 0x2f 1a100: b8 a9 ldd r27, Y+48 ; 0x30 1a102: cd 54 subi r28, 0x4D ; 77 1a104: df 4f sbci r29, 0xFF ; 255 1a106: 88 83 st Y, r24 1a108: 99 83 std Y+1, r25 ; 0x01 1a10a: aa 83 std Y+2, r26 ; 0x02 1a10c: bb 83 std Y+3, r27 ; 0x03 1a10e: c3 5b subi r28, 0xB3 ; 179 1a110: d0 40 sbci r29, 0x00 ; 0 1a112: 29 a5 ldd r18, Y+41 ; 0x29 1a114: 3a a5 ldd r19, Y+42 ; 0x2a 1a116: 4b a5 ldd r20, Y+43 ; 0x2b 1a118: 5c a5 ldd r21, Y+44 ; 0x2c 1a11a: c9 54 subi r28, 0x49 ; 73 1a11c: df 4f sbci r29, 0xFF ; 255 1a11e: 28 83 st Y, r18 1a120: 39 83 std Y+1, r19 ; 0x01 1a122: 4a 83 std Y+2, r20 ; 0x02 1a124: 5b 83 std Y+3, r21 ; 0x03 1a126: c7 5b subi r28, 0xB7 ; 183 1a128: 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]; 1a12a: 61 96 adiw r28, 0x11 ; 17 1a12c: 8c ad ldd r24, Y+60 ; 0x3c 1a12e: 9d ad ldd r25, Y+61 ; 0x3d 1a130: ae ad ldd r26, Y+62 ; 0x3e 1a132: bf ad ldd r27, Y+63 ; 0x3f 1a134: 61 97 sbiw r28, 0x11 ; 17 1a136: c5 54 subi r28, 0x45 ; 69 1a138: df 4f sbci r29, 0xFF ; 255 1a13a: 88 83 st Y, r24 1a13c: 99 83 std Y+1, r25 ; 0x01 1a13e: aa 83 std Y+2, r26 ; 0x02 1a140: bb 83 std Y+3, r27 ; 0x03 1a142: cb 5b subi r28, 0xBB ; 187 1a144: d0 40 sbci r29, 0x00 ; 0 1a146: 29 a9 ldd r18, Y+49 ; 0x31 1a148: 3a a9 ldd r19, Y+50 ; 0x32 1a14a: 4b a9 ldd r20, Y+51 ; 0x33 1a14c: 5c a9 ldd r21, Y+52 ; 0x34 1a14e: c1 54 subi r28, 0x41 ; 65 1a150: df 4f sbci r29, 0xFF ; 255 1a152: 28 83 st Y, r18 1a154: 39 83 std Y+1, r19 ; 0x01 1a156: 4a 83 std Y+2, r20 ; 0x02 1a158: 5b 83 std Y+3, r21 ; 0x03 1a15a: cf 5b subi r28, 0xBF ; 191 1a15c: d0 40 sbci r29, 0x00 ; 0 1a15e: 8d a9 ldd r24, Y+53 ; 0x35 1a160: 9e a9 ldd r25, Y+54 ; 0x36 1a162: af a9 ldd r26, Y+55 ; 0x37 1a164: b8 ad ldd r27, Y+56 ; 0x38 1a166: cd 53 subi r28, 0x3D ; 61 1a168: df 4f sbci r29, 0xFF ; 255 1a16a: 88 83 st Y, r24 1a16c: 99 83 std Y+1, r25 ; 0x01 1a16e: aa 83 std Y+2, r26 ; 0x02 1a170: bb 83 std Y+3, r27 ; 0x03 1a172: c3 5c subi r28, 0xC3 ; 195 1a174: d0 40 sbci r29, 0x00 ; 0 1a176: 29 ad ldd r18, Y+57 ; 0x39 1a178: 3a ad ldd r19, Y+58 ; 0x3a 1a17a: 4b ad ldd r20, Y+59 ; 0x3b 1a17c: 5c ad ldd r21, Y+60 ; 0x3c 1a17e: c9 53 subi r28, 0x39 ; 57 1a180: df 4f sbci r29, 0xFF ; 255 1a182: 28 83 st Y, r18 1a184: 39 83 std Y+1, r19 ; 0x01 1a186: 4a 83 std Y+2, r20 ; 0x02 1a188: 5b 83 std Y+3, r21 ; 0x03 1a18a: c7 5c subi r28, 0xC7 ; 199 1a18c: d0 40 sbci r29, 0x00 ; 0 1a18e: 21 96 adiw r28, 0x01 ; 1 1a190: 8c ad ldd r24, Y+60 ; 0x3c 1a192: 9d ad ldd r25, Y+61 ; 0x3d 1a194: ae ad ldd r26, Y+62 ; 0x3e 1a196: bf ad ldd r27, Y+63 ; 0x3f 1a198: 21 97 sbiw r28, 0x01 ; 1 1a19a: c5 53 subi r28, 0x35 ; 53 1a19c: df 4f sbci r29, 0xFF ; 255 1a19e: 88 83 st Y, r24 1a1a0: 99 83 std Y+1, r25 ; 0x01 1a1a2: aa 83 std Y+2, r26 ; 0x02 1a1a4: bb 83 std Y+3, r27 ; 0x03 1a1a6: cb 5c subi r28, 0xCB ; 203 1a1a8: d0 40 sbci r29, 0x00 ; 0 1a1aa: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1a1ac: c1 2c mov r12, r1 1a1ae: d1 2c mov r13, r1 1a1b0: 76 01 movw r14, r12 1a1b2: 46 01 movw r8, r12 1a1b4: 57 01 movw r10, r14 1a1b6: 26 01 movw r4, r12 1a1b8: 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]; 1a1ba: a3 01 movw r20, r6 1a1bc: 92 01 movw r18, r4 1a1be: e4 96 adiw r28, 0x34 ; 52 1a1c0: 6c ad ldd r22, Y+60 ; 0x3c 1a1c2: 7d ad ldd r23, Y+61 ; 0x3d 1a1c4: 8e ad ldd r24, Y+62 ; 0x3e 1a1c6: 9f ad ldd r25, Y+63 ; 0x3f 1a1c8: e4 97 sbiw r28, 0x34 ; 52 1a1ca: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a1ce: 9b 01 movw r18, r22 1a1d0: ac 01 movw r20, r24 1a1d2: ae 96 adiw r28, 0x2e ; 46 1a1d4: 6c ad ldd r22, Y+60 ; 0x3c 1a1d6: 7d ad ldd r23, Y+61 ; 0x3d 1a1d8: 8e ad ldd r24, Y+62 ; 0x3e 1a1da: 9f ad ldd r25, Y+63 ; 0x3f 1a1dc: ae 97 sbiw r28, 0x2e ; 46 1a1de: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a1e2: 2b 01 movw r4, r22 1a1e4: 3c 01 movw r6, r24 1a1e6: a5 01 movw r20, r10 1a1e8: 94 01 movw r18, r8 1a1ea: ed 96 adiw r28, 0x3d ; 61 1a1ec: 6c ad ldd r22, Y+60 ; 0x3c 1a1ee: 7d ad ldd r23, Y+61 ; 0x3d 1a1f0: 8e ad ldd r24, Y+62 ; 0x3e 1a1f2: 9f ad ldd r25, Y+63 ; 0x3f 1a1f4: ed 97 sbiw r28, 0x3d ; 61 1a1f6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a1fa: 9b 01 movw r18, r22 1a1fc: ac 01 movw r20, r24 1a1fe: c3 01 movw r24, r6 1a200: b2 01 movw r22, r4 1a202: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a206: 2b 01 movw r4, r22 1a208: 3c 01 movw r6, r24 1a20a: a7 01 movw r20, r14 1a20c: 96 01 movw r18, r12 1a20e: c3 58 subi r28, 0x83 ; 131 1a210: df 4f sbci r29, 0xFF ; 255 1a212: 68 81 ld r22, Y 1a214: 79 81 ldd r23, Y+1 ; 0x01 1a216: 8a 81 ldd r24, Y+2 ; 0x02 1a218: 9b 81 ldd r25, Y+3 ; 0x03 1a21a: cd 57 subi r28, 0x7D ; 125 1a21c: d0 40 sbci r29, 0x00 ; 0 1a21e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a222: 9b 01 movw r18, r22 1a224: ac 01 movw r20, r24 1a226: c3 01 movw r24, r6 1a228: b2 01 movw r22, r4 1a22a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a22e: cf 57 subi r28, 0x7F ; 127 1a230: df 4f sbci r29, 0xFF ; 255 1a232: 28 81 ld r18, Y 1a234: 39 81 ldd r19, Y+1 ; 0x01 1a236: 4a 81 ldd r20, Y+2 ; 0x02 1a238: 5b 81 ldd r21, Y+3 ; 0x03 1a23a: c1 58 subi r28, 0x81 ; 129 1a23c: d0 40 sbci r29, 0x00 ; 0 1a23e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1a242: 6e 96 adiw r28, 0x1e ; 30 1a244: 6c af std Y+60, r22 ; 0x3c 1a246: 7d af std Y+61, r23 ; 0x3d 1a248: 8e af std Y+62, r24 ; 0x3e 1a24a: 9f af std Y+63, r25 ; 0x3f 1a24c: 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]; 1a24e: c7 57 subi r28, 0x77 ; 119 1a250: df 4f sbci r29, 0xFF ; 255 1a252: 28 81 ld r18, Y 1a254: 39 81 ldd r19, Y+1 ; 0x01 1a256: 4a 81 ldd r20, Y+2 ; 0x02 1a258: 5b 81 ldd r21, Y+3 ; 0x03 1a25a: c9 58 subi r28, 0x89 ; 137 1a25c: d0 40 sbci r29, 0x00 ; 0 1a25e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a262: 9b 01 movw r18, r22 1a264: ac 01 movw r20, r24 1a266: cb 57 subi r28, 0x7B ; 123 1a268: df 4f sbci r29, 0xFF ; 255 1a26a: 68 81 ld r22, Y 1a26c: 79 81 ldd r23, Y+1 ; 0x01 1a26e: 8a 81 ldd r24, Y+2 ; 0x02 1a270: 9b 81 ldd r25, Y+3 ; 0x03 1a272: c5 58 subi r28, 0x85 ; 133 1a274: d0 40 sbci r29, 0x00 ; 0 1a276: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a27a: 2b 01 movw r4, r22 1a27c: 3c 01 movw r6, r24 1a27e: a5 01 movw r20, r10 1a280: 94 01 movw r18, r8 1a282: cb 56 subi r28, 0x6B ; 107 1a284: df 4f sbci r29, 0xFF ; 255 1a286: 68 81 ld r22, Y 1a288: 79 81 ldd r23, Y+1 ; 0x01 1a28a: 8a 81 ldd r24, Y+2 ; 0x02 1a28c: 9b 81 ldd r25, Y+3 ; 0x03 1a28e: c5 59 subi r28, 0x95 ; 149 1a290: d0 40 sbci r29, 0x00 ; 0 1a292: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a296: 9b 01 movw r18, r22 1a298: ac 01 movw r20, r24 1a29a: c3 01 movw r24, r6 1a29c: b2 01 movw r22, r4 1a29e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a2a2: 4b 01 movw r8, r22 1a2a4: 5c 01 movw r10, r24 1a2a6: a7 01 movw r20, r14 1a2a8: 96 01 movw r18, r12 1a2aa: c7 56 subi r28, 0x67 ; 103 1a2ac: df 4f sbci r29, 0xFF ; 255 1a2ae: 68 81 ld r22, Y 1a2b0: 79 81 ldd r23, Y+1 ; 0x01 1a2b2: 8a 81 ldd r24, Y+2 ; 0x02 1a2b4: 9b 81 ldd r25, Y+3 ; 0x03 1a2b6: c9 59 subi r28, 0x99 ; 153 1a2b8: d0 40 sbci r29, 0x00 ; 0 1a2ba: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a2be: 9b 01 movw r18, r22 1a2c0: ac 01 movw r20, r24 1a2c2: c5 01 movw r24, r10 1a2c4: b4 01 movw r22, r8 1a2c6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a2ca: c3 57 subi r28, 0x73 ; 115 1a2cc: df 4f sbci r29, 0xFF ; 255 1a2ce: 28 81 ld r18, Y 1a2d0: 39 81 ldd r19, Y+1 ; 0x01 1a2d2: 4a 81 ldd r20, Y+2 ; 0x02 1a2d4: 5b 81 ldd r21, Y+3 ; 0x03 1a2d6: cd 58 subi r28, 0x8D ; 141 1a2d8: d0 40 sbci r29, 0x00 ; 0 1a2da: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1a2de: 2b 01 movw r4, r22 1a2e0: 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]; 1a2e2: cf 55 subi r28, 0x5F ; 95 1a2e4: df 4f sbci r29, 0xFF ; 255 1a2e6: 28 81 ld r18, Y 1a2e8: 39 81 ldd r19, Y+1 ; 0x01 1a2ea: 4a 81 ldd r20, Y+2 ; 0x02 1a2ec: 5b 81 ldd r21, Y+3 ; 0x03 1a2ee: c1 5a subi r28, 0xA1 ; 161 1a2f0: d0 40 sbci r29, 0x00 ; 0 1a2f2: 6e 96 adiw r28, 0x1e ; 30 1a2f4: 6c ad ldd r22, Y+60 ; 0x3c 1a2f6: 7d ad ldd r23, Y+61 ; 0x3d 1a2f8: 8e ad ldd r24, Y+62 ; 0x3e 1a2fa: 9f ad ldd r25, Y+63 ; 0x3f 1a2fc: 6e 97 sbiw r28, 0x1e ; 30 1a2fe: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a302: 9b 01 movw r18, r22 1a304: ac 01 movw r20, r24 1a306: c3 56 subi r28, 0x63 ; 99 1a308: df 4f sbci r29, 0xFF ; 255 1a30a: 68 81 ld r22, Y 1a30c: 79 81 ldd r23, Y+1 ; 0x01 1a30e: 8a 81 ldd r24, Y+2 ; 0x02 1a310: 9b 81 ldd r25, Y+3 ; 0x03 1a312: cd 59 subi r28, 0x9D ; 157 1a314: d0 40 sbci r29, 0x00 ; 0 1a316: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a31a: 4b 01 movw r8, r22 1a31c: 5c 01 movw r10, r24 1a31e: cb 55 subi r28, 0x5B ; 91 1a320: df 4f sbci r29, 0xFF ; 255 1a322: 28 81 ld r18, Y 1a324: 39 81 ldd r19, Y+1 ; 0x01 1a326: 4a 81 ldd r20, Y+2 ; 0x02 1a328: 5b 81 ldd r21, Y+3 ; 0x03 1a32a: c5 5a subi r28, 0xA5 ; 165 1a32c: d0 40 sbci r29, 0x00 ; 0 1a32e: c3 01 movw r24, r6 1a330: b2 01 movw r22, r4 1a332: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a336: 9b 01 movw r18, r22 1a338: ac 01 movw r20, r24 1a33a: c5 01 movw r24, r10 1a33c: b4 01 movw r22, r8 1a33e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a342: 4b 01 movw r8, r22 1a344: 5c 01 movw r10, r24 1a346: a7 01 movw r20, r14 1a348: 96 01 movw r18, r12 1a34a: cd 54 subi r28, 0x4D ; 77 1a34c: df 4f sbci r29, 0xFF ; 255 1a34e: 68 81 ld r22, Y 1a350: 79 81 ldd r23, Y+1 ; 0x01 1a352: 8a 81 ldd r24, Y+2 ; 0x02 1a354: 9b 81 ldd r25, Y+3 ; 0x03 1a356: c3 5b subi r28, 0xB3 ; 179 1a358: d0 40 sbci r29, 0x00 ; 0 1a35a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a35e: 9b 01 movw r18, r22 1a360: ac 01 movw r20, r24 1a362: c5 01 movw r24, r10 1a364: b4 01 movw r22, r8 1a366: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a36a: c9 54 subi r28, 0x49 ; 73 1a36c: df 4f sbci r29, 0xFF ; 255 1a36e: 28 81 ld r18, Y 1a370: 39 81 ldd r19, Y+1 ; 0x01 1a372: 4a 81 ldd r20, Y+2 ; 0x02 1a374: 5b 81 ldd r21, Y+3 ; 0x03 1a376: c7 5b subi r28, 0xB7 ; 183 1a378: d0 40 sbci r29, 0x00 ; 0 1a37a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1a37e: 4b 01 movw r8, r22 1a380: 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]; 1a382: c1 54 subi r28, 0x41 ; 65 1a384: df 4f sbci r29, 0xFF ; 255 1a386: 28 81 ld r18, Y 1a388: 39 81 ldd r19, Y+1 ; 0x01 1a38a: 4a 81 ldd r20, Y+2 ; 0x02 1a38c: 5b 81 ldd r21, Y+3 ; 0x03 1a38e: cf 5b subi r28, 0xBF ; 191 1a390: d0 40 sbci r29, 0x00 ; 0 1a392: 6e 96 adiw r28, 0x1e ; 30 1a394: 6c ad ldd r22, Y+60 ; 0x3c 1a396: 7d ad ldd r23, Y+61 ; 0x3d 1a398: 8e ad ldd r24, Y+62 ; 0x3e 1a39a: 9f ad ldd r25, Y+63 ; 0x3f 1a39c: 6e 97 sbiw r28, 0x1e ; 30 1a39e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a3a2: 9b 01 movw r18, r22 1a3a4: ac 01 movw r20, r24 1a3a6: c5 54 subi r28, 0x45 ; 69 1a3a8: df 4f sbci r29, 0xFF ; 255 1a3aa: 68 81 ld r22, Y 1a3ac: 79 81 ldd r23, Y+1 ; 0x01 1a3ae: 8a 81 ldd r24, Y+2 ; 0x02 1a3b0: 9b 81 ldd r25, Y+3 ; 0x03 1a3b2: cb 5b subi r28, 0xBB ; 187 1a3b4: d0 40 sbci r29, 0x00 ; 0 1a3b6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a3ba: 6b 01 movw r12, r22 1a3bc: 7c 01 movw r14, r24 1a3be: cd 53 subi r28, 0x3D ; 61 1a3c0: df 4f sbci r29, 0xFF ; 255 1a3c2: 28 81 ld r18, Y 1a3c4: 39 81 ldd r19, Y+1 ; 0x01 1a3c6: 4a 81 ldd r20, Y+2 ; 0x02 1a3c8: 5b 81 ldd r21, Y+3 ; 0x03 1a3ca: c3 5c subi r28, 0xC3 ; 195 1a3cc: d0 40 sbci r29, 0x00 ; 0 1a3ce: c3 01 movw r24, r6 1a3d0: b2 01 movw r22, r4 1a3d2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a3d6: 9b 01 movw r18, r22 1a3d8: ac 01 movw r20, r24 1a3da: c7 01 movw r24, r14 1a3dc: b6 01 movw r22, r12 1a3de: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a3e2: 6b 01 movw r12, r22 1a3e4: 7c 01 movw r14, r24 1a3e6: c9 53 subi r28, 0x39 ; 57 1a3e8: df 4f sbci r29, 0xFF ; 255 1a3ea: 28 81 ld r18, Y 1a3ec: 39 81 ldd r19, Y+1 ; 0x01 1a3ee: 4a 81 ldd r20, Y+2 ; 0x02 1a3f0: 5b 81 ldd r21, Y+3 ; 0x03 1a3f2: c7 5c subi r28, 0xC7 ; 199 1a3f4: d0 40 sbci r29, 0x00 ; 0 1a3f6: c5 01 movw r24, r10 1a3f8: b4 01 movw r22, r8 1a3fa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a3fe: 9b 01 movw r18, r22 1a400: ac 01 movw r20, r24 1a402: c7 01 movw r24, r14 1a404: b6 01 movw r22, r12 1a406: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a40a: c5 53 subi r28, 0x35 ; 53 1a40c: df 4f sbci r29, 0xFF ; 255 1a40e: 28 81 ld r18, Y 1a410: 39 81 ldd r19, Y+1 ; 0x01 1a412: 4a 81 ldd r20, Y+2 ; 0x02 1a414: 5b 81 ldd r21, Y+3 ; 0x03 1a416: cb 5c subi r28, 0xCB ; 203 1a418: d0 40 sbci r29, 0x00 ; 0 1a41a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1a41e: 6b 01 movw r12, r22 1a420: 7c 01 movw r14, r24 1a422: 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) { 1a424: 09 f0 breq .+2 ; 0x1a428 1a426: c9 ce rjmp .-622 ; 0x1a1ba // 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]; 1a428: 6e 96 adiw r28, 0x1e ; 30 1a42a: 2c ad ldd r18, Y+60 ; 0x3c 1a42c: 3d ad ldd r19, Y+61 ; 0x3d 1a42e: 4e ad ldd r20, Y+62 ; 0x3e 1a430: 5f ad ldd r21, Y+63 ; 0x3f 1a432: 6e 97 sbiw r28, 0x1e ; 30 1a434: c5 55 subi r28, 0x55 ; 85 1a436: df 4f sbci r29, 0xFF ; 255 1a438: 68 81 ld r22, Y 1a43a: 79 81 ldd r23, Y+1 ; 0x01 1a43c: 8a 81 ldd r24, Y+2 ; 0x02 1a43e: 9b 81 ldd r25, Y+3 ; 0x03 1a440: cb 5a subi r28, 0xAB ; 171 1a442: d0 40 sbci r29, 0x00 ; 0 1a444: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a448: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1a44c: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1a450: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1a454: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] += h[1]; 1a458: a3 01 movw r20, r6 1a45a: 92 01 movw r18, r4 1a45c: c1 55 subi r28, 0x51 ; 81 1a45e: df 4f sbci r29, 0xFF ; 255 1a460: 68 81 ld r22, Y 1a462: 79 81 ldd r23, Y+1 ; 0x01 1a464: 8a 81 ldd r24, Y+2 ; 0x02 1a466: 9b 81 ldd r25, Y+3 ; 0x03 1a468: cf 5a subi r28, 0xAF ; 175 1a46a: d0 40 sbci r29, 0x00 ; 0 1a46c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a470: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1a474: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1a478: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1a47c: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 a1 += h[2]; 1a480: a5 01 movw r20, r10 1a482: 94 01 movw r18, r8 1a484: a6 96 adiw r28, 0x26 ; 38 1a486: 6c ad ldd r22, Y+60 ; 0x3c 1a488: 7d ad ldd r23, Y+61 ; 0x3d 1a48a: 8e ad ldd r24, Y+62 ; 0x3e 1a48c: 9f ad ldd r25, Y+63 ; 0x3f 1a48e: a6 97 sbiw r28, 0x26 ; 38 1a490: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a494: a6 96 adiw r28, 0x26 ; 38 1a496: 6c af std Y+60, r22 ; 0x3c 1a498: 7d af std Y+61, r23 ; 0x3d 1a49a: 8e af std Y+62, r24 ; 0x3e 1a49c: 9f af std Y+63, r25 ; 0x3f 1a49e: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1a4a0: a7 01 movw r20, r14 1a4a2: 96 01 movw r18, r12 1a4a4: a2 96 adiw r28, 0x22 ; 34 1a4a6: 6c ad ldd r22, Y+60 ; 0x3c 1a4a8: 7d ad ldd r23, Y+61 ; 0x3d 1a4aa: 8e ad ldd r24, Y+62 ; 0x3e 1a4ac: 9f ad ldd r25, Y+63 ; 0x3f 1a4ae: a2 97 sbiw r28, 0x22 ; 34 1a4b0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a4b4: a2 96 adiw r28, 0x22 ; 34 1a4b6: 6c af std Y+60, r22 ; 0x3c 1a4b8: 7d af std Y+61, r23 ; 0x3d 1a4ba: 8e af std Y+62, r24 ; 0x3e 1a4bc: 9f af std Y+63, r25 ; 0x3f 1a4be: a2 97 sbiw r28, 0x22 ; 34 1a4c0: e6 96 adiw r28, 0x36 ; 54 1a4c2: 9f ad ldd r25, Y+63 ; 0x3f 1a4c4: e6 97 sbiw r28, 0x36 ; 54 1a4c6: 91 50 subi r25, 0x01 ; 1 1a4c8: e6 96 adiw r28, 0x36 ; 54 1a4ca: 9f af std Y+63, r25 ; 0x3f 1a4cc: 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) { 1a4ce: 91 11 cpse r25, r1 1a4d0: 70 c9 rjmp .-3360 ; 0x197b2 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a4d2: a6 96 adiw r28, 0x26 ; 38 1a4d4: 6c ad ldd r22, Y+60 ; 0x3c 1a4d6: 7d ad ldd r23, Y+61 ; 0x3d 1a4d8: 8e ad ldd r24, Y+62 ; 0x3e 1a4da: 9f ad ldd r25, Y+63 ; 0x3f 1a4dc: a6 97 sbiw r28, 0x26 ; 38 1a4de: 0f 94 5e a3 call 0x346bc ; 0x346bc 1a4e2: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a4e6: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a4ea: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a4ee: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a4f2: a6 96 adiw r28, 0x26 ; 38 1a4f4: 6c ad ldd r22, Y+60 ; 0x3c 1a4f6: 7d ad ldd r23, Y+61 ; 0x3d 1a4f8: 8e ad ldd r24, Y+62 ; 0x3e 1a4fa: 9f ad ldd r25, Y+63 ; 0x3f 1a4fc: a6 97 sbiw r28, 0x26 ; 38 1a4fe: 0f 94 24 a6 call 0x34c48 ; 0x34c48 1a502: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a506: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a50a: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a50e: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1a512: a2 96 adiw r28, 0x22 ; 34 1a514: 6c ad ldd r22, Y+60 ; 0x3c 1a516: 7d ad ldd r23, Y+61 ; 0x3d 1a518: 8e ad ldd r24, Y+62 ; 0x3e 1a51a: 9f ad ldd r25, Y+63 ; 0x3f 1a51c: a2 97 sbiw r28, 0x22 ; 34 1a51e: 0f 94 24 a6 call 0x34c48 ; 0x34c48 1a522: 90 58 subi r25, 0x80 ; 128 1a524: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 1a528: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 1a52c: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 1a530: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1a534: a2 96 adiw r28, 0x22 ; 34 1a536: 6c ad ldd r22, Y+60 ; 0x3c 1a538: 7d ad ldd r23, Y+61 ; 0x3d 1a53a: 8e ad ldd r24, Y+62 ; 0x3e 1a53c: 9f ad ldd r25, Y+63 ; 0x3f 1a53e: a2 97 sbiw r28, 0x22 ; 34 1a540: 0f 94 5e a3 call 0x346bc ; 0x346bc 1a544: 60 93 c9 12 sts 0x12C9, r22 ; 0x8012c9 1a548: 70 93 ca 12 sts 0x12CA, r23 ; 0x8012ca 1a54c: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb 1a550: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1a554: a6 96 adiw r28, 0x26 ; 38 1a556: 2c ad ldd r18, Y+60 ; 0x3c 1a558: 3d ad ldd r19, Y+61 ; 0x3d 1a55a: 4e ad ldd r20, Y+62 ; 0x3e 1a55c: 5f ad ldd r21, Y+63 ; 0x3f 1a55e: a6 97 sbiw r28, 0x26 ; 38 1a560: a2 96 adiw r28, 0x22 ; 34 1a562: 6c ad ldd r22, Y+60 ; 0x3c 1a564: 7d ad ldd r23, Y+61 ; 0x3d 1a566: 8e ad ldd r24, Y+62 ; 0x3e 1a568: 9f ad ldd r25, Y+63 ; 0x3f 1a56a: a2 97 sbiw r28, 0x22 ; 34 1a56c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a570: 4b 01 movw r8, r22 1a572: 5c 01 movw r10, r24 1a574: 7c 01 movw r14, r24 1a576: 6b 01 movw r12, r22 1a578: e8 94 clt 1a57a: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1a57c: 21 ee ldi r18, 0xE1 ; 225 1a57e: 3e e2 ldi r19, 0x2E ; 46 1a580: 45 e6 ldi r20, 0x65 ; 101 1a582: 52 e4 ldi r21, 0x42 ; 66 1a584: a2 96 adiw r28, 0x22 ; 34 1a586: 6c ad ldd r22, Y+60 ; 0x3c 1a588: 7d ad ldd r23, Y+61 ; 0x3d 1a58a: 8e ad ldd r24, Y+62 ; 0x3e 1a58c: 9f ad ldd r25, Y+63 ; 0x3f 1a58e: a2 97 sbiw r28, 0x22 ; 34 1a590: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a594: 9f 93 push r25 1a596: 8f 93 push r24 1a598: 7f 93 push r23 1a59a: 6f 93 push r22 1a59c: 21 ee ldi r18, 0xE1 ; 225 1a59e: 3e e2 ldi r19, 0x2E ; 46 1a5a0: 45 e6 ldi r20, 0x65 ; 101 1a5a2: 52 e4 ldi r21, 0x42 ; 66 1a5a4: c5 01 movw r24, r10 1a5a6: b4 01 movw r22, r8 1a5a8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a5ac: 9f 93 push r25 1a5ae: 8f 93 push r24 1a5b0: 7f 93 push r23 1a5b2: 6f 93 push r22 1a5b4: 81 ee ldi r24, 0xE1 ; 225 1a5b6: 99 e6 ldi r25, 0x69 ; 105 1a5b8: 9f 93 push r25 1a5ba: 8f 93 push r24 1a5bc: 0f 94 fe 9f call 0x33ffc ; 0x33ffc if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1a5c0: b7 01 movw r22, r14 1a5c2: a6 01 movw r20, r12 1a5c4: 80 e6 ldi r24, 0x60 ; 96 1a5c6: 9f e0 ldi r25, 0x0F ; 15 1a5c8: 0f 94 72 a1 call 0x342e4 ; 0x342e4 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) 1a5cc: 0f b6 in r0, 0x3f ; 63 1a5ce: f8 94 cli 1a5d0: de bf out 0x3e, r29 ; 62 1a5d2: 0f be out 0x3f, r0 ; 63 1a5d4: cd bf out 0x3d, r28 ; 61 1a5d6: 2f e1 ldi r18, 0x1F ; 31 1a5d8: 32 e4 ldi r19, 0x42 ; 66 1a5da: 49 e0 ldi r20, 0x09 ; 9 1a5dc: 5b e3 ldi r21, 0x3B ; 59 1a5de: c7 01 movw r24, r14 1a5e0: b6 01 movw r22, r12 1a5e2: 0f 94 ed a4 call 0x349da ; 0x349da <__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; 1a5e6: 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) 1a5e8: 18 16 cp r1, r24 1a5ea: 64 f4 brge .+24 ; 0x1a604 result = (angleDiff > bed_skew_angle_extreme) ? 1a5ec: 25 e3 ldi r18, 0x35 ; 53 1a5ee: 3a ef ldi r19, 0xFA ; 250 1a5f0: 4e e8 ldi r20, 0x8E ; 142 1a5f2: 5b e3 ldi r21, 0x3B ; 59 1a5f4: c7 01 movw r24, r14 1a5f6: b6 01 movw r22, r12 1a5f8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1a5fc: 12 e0 ldi r17, 0x02 ; 2 1a5fe: 18 16 cp r1, r24 1a600: 0c f0 brlt .+2 ; 0x1a604 1a602: 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 || 1a604: 25 e3 ldi r18, 0x35 ; 53 1a606: 3a ef ldi r19, 0xFA ; 250 1a608: 4e e8 ldi r20, 0x8E ; 142 1a60a: 5b e3 ldi r21, 0x3B ; 59 1a60c: a6 96 adiw r28, 0x26 ; 38 1a60e: 6c ad ldd r22, Y+60 ; 0x3c 1a610: 7d ad ldd r23, Y+61 ; 0x3d 1a612: 8e ad ldd r24, Y+62 ; 0x3e 1a614: 9f ad ldd r25, Y+63 ; 0x3f 1a616: a6 97 sbiw r28, 0x26 ; 38 1a618: 9f 77 andi r25, 0x7F ; 127 1a61a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1a61e: 18 16 cp r1, r24 1a620: 0c f4 brge .+2 ; 0x1a624 1a622: 67 c4 rjmp .+2254 ; 0x1aef2 1a624: 25 e3 ldi r18, 0x35 ; 53 1a626: 3a ef ldi r19, 0xFA ; 250 1a628: 4e e8 ldi r20, 0x8E ; 142 1a62a: 5b e3 ldi r21, 0x3B ; 59 1a62c: a2 96 adiw r28, 0x22 ; 34 1a62e: 6c ad ldd r22, Y+60 ; 0x3c 1a630: 7d ad ldd r23, Y+61 ; 0x3d 1a632: 8e ad ldd r24, Y+62 ; 0x3e 1a634: 9f ad ldd r25, Y+63 ; 0x3f 1a636: a2 97 sbiw r28, 0x22 ; 34 1a638: 9f 77 andi r25, 0x7F ; 127 1a63a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1a63e: 18 16 cp r1, r24 1a640: 0c f4 brge .+2 ; 0x1a644 1a642: 57 c4 rjmp .+2222 ; 0x1aef2 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]; 1a644: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 1a648: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 1a64c: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf 1a650: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 1a654: ae 96 adiw r28, 0x2e ; 46 1a656: 2c af std Y+60, r18 ; 0x3c 1a658: 3d af std Y+61, r19 ; 0x3d 1a65a: 4e af std Y+62, r20 ; 0x3e 1a65c: 5f af std Y+63, r21 ; 0x3f 1a65e: ae 97 sbiw r28, 0x2e ; 46 1a660: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1a664: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1a668: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1a66c: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1a670: e9 96 adiw r28, 0x39 ; 57 1a672: 8c af std Y+60, r24 ; 0x3c 1a674: 9d af std Y+61, r25 ; 0x3d 1a676: ae af std Y+62, r26 ; 0x3e 1a678: bf af std Y+63, r27 ; 0x3f 1a67a: e9 97 sbiw r28, 0x39 ; 57 1a67c: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a680: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a684: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a688: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a68c: e4 96 adiw r28, 0x34 ; 52 1a68e: 2c af std Y+60, r18 ; 0x3c 1a690: 3d af std Y+61, r19 ; 0x3d 1a692: 4e af std Y+62, r20 ; 0x3e 1a694: 5f af std Y+63, r21 ; 0x3f 1a696: 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]; 1a698: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 1a69c: 90 91 c2 12 lds r25, 0x12C2 ; 0x8012c2 1a6a0: a0 91 c3 12 lds r26, 0x12C3 ; 0x8012c3 1a6a4: b0 91 c4 12 lds r27, 0x12C4 ; 0x8012c4 1a6a8: ed 96 adiw r28, 0x3d ; 61 1a6aa: 8c af std Y+60, r24 ; 0x3c 1a6ac: 9d af std Y+61, r25 ; 0x3d 1a6ae: ae af std Y+62, r26 ; 0x3e 1a6b0: bf af std Y+63, r27 ; 0x3f 1a6b2: ed 97 sbiw r28, 0x3d ; 61 1a6b4: 20 91 c9 12 lds r18, 0x12C9 ; 0x8012c9 1a6b8: 30 91 ca 12 lds r19, 0x12CA ; 0x8012ca 1a6bc: 40 91 cb 12 lds r20, 0x12CB ; 0x8012cb 1a6c0: 50 91 cc 12 lds r21, 0x12CC ; 0x8012cc 1a6c4: c3 58 subi r28, 0x83 ; 131 1a6c6: df 4f sbci r29, 0xFF ; 255 1a6c8: 28 83 st Y, r18 1a6ca: 39 83 std Y+1, r19 ; 0x01 1a6cc: 4a 83 std Y+2, r20 ; 0x02 1a6ce: 5b 83 std Y+3, r21 ; 0x03 1a6d0: cd 57 subi r28, 0x7D ; 125 1a6d2: d0 40 sbci r29, 0x00 ; 0 1a6d4: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1a6d8: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1a6dc: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 1a6e0: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 1a6e4: cf 57 subi r28, 0x7F ; 127 1a6e6: df 4f sbci r29, 0xFF ; 255 1a6e8: 88 83 st Y, r24 1a6ea: 99 83 std Y+1, r25 ; 0x01 1a6ec: aa 83 std Y+2, r26 ; 0x02 1a6ee: bb 83 std Y+3, r27 ; 0x03 1a6f0: c1 58 subi r28, 0x81 ; 129 1a6f2: d0 40 sbci r29, 0x00 ; 0 1a6f4: af e4 ldi r26, 0x4F ; 79 1a6f6: b9 e8 ldi r27, 0x89 ; 137 1a6f8: 6c 96 adiw r28, 0x1c ; 28 1a6fa: bf af std Y+63, r27 ; 0x3f 1a6fc: ae af std Y+62, r26 ; 0x3e 1a6fe: 6c 97 sbiw r28, 0x1c ; 28 1a700: 8c e9 ldi r24, 0x9C ; 156 1a702: 28 2e mov r2, r24 1a704: 82 e1 ldi r24, 0x12 ; 18 1a706: 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]; 1a708: f1 01 movw r30, r2 1a70a: c1 80 ldd r12, Z+1 ; 0x01 1a70c: d2 80 ldd r13, Z+2 ; 0x02 1a70e: e3 80 ldd r14, Z+3 ; 0x03 1a710: f4 80 ldd r15, Z+4 ; 0x04 1a712: 45 80 ldd r4, Z+5 ; 0x05 1a714: 56 80 ldd r5, Z+6 ; 0x06 1a716: 67 80 ldd r6, Z+7 ; 0x07 1a718: 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; 1a71a: 6c 96 adiw r28, 0x1c ; 28 1a71c: ee ad ldd r30, Y+62 ; 0x3e 1a71e: ff ad ldd r31, Y+63 ; 0x3f 1a720: 6c 97 sbiw r28, 0x1c ; 28 1a722: 25 91 lpm r18, Z+ 1a724: 35 91 lpm r19, Z+ 1a726: 45 91 lpm r20, Z+ 1a728: 54 91 lpm r21, Z 1a72a: cb 57 subi r28, 0x7B ; 123 1a72c: df 4f sbci r29, 0xFF ; 255 1a72e: 28 83 st Y, r18 1a730: 39 83 std Y+1, r19 ; 0x01 1a732: 4a 83 std Y+2, r20 ; 0x02 1a734: 5b 83 std Y+3, r21 ; 0x03 1a736: c5 58 subi r28, 0x85 ; 133 1a738: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1a73a: 6c 96 adiw r28, 0x1c ; 28 1a73c: ee ad ldd r30, Y+62 ; 0x3e 1a73e: ff ad ldd r31, Y+63 ; 0x3f 1a740: 6c 97 sbiw r28, 0x1c ; 28 1a742: 34 96 adiw r30, 0x04 ; 4 1a744: 85 90 lpm r8, Z+ 1a746: 95 90 lpm r9, Z+ 1a748: a5 90 lpm r10, Z+ 1a74a: 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]; 1a74c: ed 96 adiw r28, 0x3d ; 61 1a74e: 2c ad ldd r18, Y+60 ; 0x3c 1a750: 3d ad ldd r19, Y+61 ; 0x3d 1a752: 4e ad ldd r20, Y+62 ; 0x3e 1a754: 5f ad ldd r21, Y+63 ; 0x3f 1a756: ed 97 sbiw r28, 0x3d ; 61 1a758: c7 01 movw r24, r14 1a75a: b6 01 movw r22, r12 1a75c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a760: c7 57 subi r28, 0x77 ; 119 1a762: df 4f sbci r29, 0xFF ; 255 1a764: 68 83 st Y, r22 1a766: 79 83 std Y+1, r23 ; 0x01 1a768: 8a 83 std Y+2, r24 ; 0x02 1a76a: 9b 83 std Y+3, r25 ; 0x03 1a76c: c9 58 subi r28, 0x89 ; 137 1a76e: d0 40 sbci r29, 0x00 ; 0 1a770: c3 58 subi r28, 0x83 ; 131 1a772: df 4f sbci r29, 0xFF ; 255 1a774: 28 81 ld r18, Y 1a776: 39 81 ldd r19, Y+1 ; 0x01 1a778: 4a 81 ldd r20, Y+2 ; 0x02 1a77a: 5b 81 ldd r21, Y+3 ; 0x03 1a77c: cd 57 subi r28, 0x7D ; 125 1a77e: d0 40 sbci r29, 0x00 ; 0 1a780: c3 01 movw r24, r6 1a782: b2 01 movw r22, r4 1a784: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a788: 9b 01 movw r18, r22 1a78a: ac 01 movw r20, r24 1a78c: c7 57 subi r28, 0x77 ; 119 1a78e: df 4f sbci r29, 0xFF ; 255 1a790: 68 81 ld r22, Y 1a792: 79 81 ldd r23, Y+1 ; 0x01 1a794: 8a 81 ldd r24, Y+2 ; 0x02 1a796: 9b 81 ldd r25, Y+3 ; 0x03 1a798: c9 58 subi r28, 0x89 ; 137 1a79a: d0 40 sbci r29, 0x00 ; 0 1a79c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a7a0: cf 57 subi r28, 0x7F ; 127 1a7a2: df 4f sbci r29, 0xFF ; 255 1a7a4: 28 81 ld r18, Y 1a7a6: 39 81 ldd r19, Y+1 ; 0x01 1a7a8: 4a 81 ldd r20, Y+2 ; 0x02 1a7aa: 5b 81 ldd r21, Y+3 ; 0x03 1a7ac: c1 58 subi r28, 0x81 ; 129 1a7ae: d0 40 sbci r29, 0x00 ; 0 1a7b0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a7b4: 9b 01 movw r18, r22 1a7b6: 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; 1a7b8: c5 01 movw r24, r10 1a7ba: b4 01 movw r22, r8 1a7bc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a7c0: 4b 01 movw r8, r22 1a7c2: 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]; 1a7c4: a7 01 movw r20, r14 1a7c6: 96 01 movw r18, r12 1a7c8: ae 96 adiw r28, 0x2e ; 46 1a7ca: 6c ad ldd r22, Y+60 ; 0x3c 1a7cc: 7d ad ldd r23, Y+61 ; 0x3d 1a7ce: 8e ad ldd r24, Y+62 ; 0x3e 1a7d0: 9f ad ldd r25, Y+63 ; 0x3f 1a7d2: ae 97 sbiw r28, 0x2e ; 46 1a7d4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a7d8: 6b 01 movw r12, r22 1a7da: 7c 01 movw r14, r24 1a7dc: a3 01 movw r20, r6 1a7de: 92 01 movw r18, r4 1a7e0: e9 96 adiw r28, 0x39 ; 57 1a7e2: 6c ad ldd r22, Y+60 ; 0x3c 1a7e4: 7d ad ldd r23, Y+61 ; 0x3d 1a7e6: 8e ad ldd r24, Y+62 ; 0x3e 1a7e8: 9f ad ldd r25, Y+63 ; 0x3f 1a7ea: e9 97 sbiw r28, 0x39 ; 57 1a7ec: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a7f0: 9b 01 movw r18, r22 1a7f2: ac 01 movw r20, r24 1a7f4: c7 01 movw r24, r14 1a7f6: b6 01 movw r22, r12 1a7f8: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a7fc: e4 96 adiw r28, 0x34 ; 52 1a7fe: 2c ad ldd r18, Y+60 ; 0x3c 1a800: 3d ad ldd r19, Y+61 ; 0x3d 1a802: 4e ad ldd r20, Y+62 ; 0x3e 1a804: 5f ad ldd r21, Y+63 ; 0x3f 1a806: e4 97 sbiw r28, 0x34 ; 52 1a808: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a80c: 9b 01 movw r18, r22 1a80e: 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; 1a810: cb 57 subi r28, 0x7B ; 123 1a812: df 4f sbci r29, 0xFF ; 255 1a814: 68 81 ld r22, Y 1a816: 79 81 ldd r23, Y+1 ; 0x01 1a818: 8a 81 ldd r24, Y+2 ; 0x02 1a81a: 9b 81 ldd r25, Y+3 ; 0x03 1a81c: c5 58 subi r28, 0x85 ; 133 1a81e: d0 40 sbci r29, 0x00 ; 0 1a820: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1a824: a5 01 movw r20, r10 1a826: 94 01 movw r18, r8 1a828: 0f 94 00 a5 call 0x34a00 ; 0x34a00 } 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) { 1a82c: 2d ec ldi r18, 0xCD ; 205 1a82e: 3c ec ldi r19, 0xCC ; 204 1a830: 4c e4 ldi r20, 0x4C ; 76 1a832: 5f e3 ldi r21, 0x3F ; 63 1a834: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1a838: 18 16 cp r1, r24 1a83a: 0c f4 brge .+2 ; 0x1a83e result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1a83c: 1e ef ldi r17, 0xFE ; 254 1a83e: 38 e0 ldi r19, 0x08 ; 8 1a840: 23 0e add r2, r19 1a842: 31 1c adc r3, r1 1a844: 6c 96 adiw r28, 0x1c ; 28 1a846: 4e ad ldd r20, Y+62 ; 0x3e 1a848: 5f ad ldd r21, Y+63 ; 0x3f 1a84a: 6c 97 sbiw r28, 0x1c ; 28 1a84c: 48 5f subi r20, 0xF8 ; 248 1a84e: 5f 4f sbci r21, 0xFF ; 255 1a850: 6c 96 adiw r28, 0x1c ; 28 1a852: 5f af std Y+63, r21 ; 0x3f 1a854: 4e af std Y+62, r20 ; 0x3e 1a856: 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) { 1a858: a8 96 adiw r28, 0x28 ; 40 1a85a: 8e ad ldd r24, Y+62 ; 0x3e 1a85c: 9f ad ldd r25, Y+63 ; 0x3f 1a85e: a8 97 sbiw r28, 0x28 ; 40 1a860: 82 15 cp r24, r2 1a862: 93 05 cpc r25, r3 1a864: 09 f0 breq .+2 ; 0x1a868 1a866: 50 cf rjmp .-352 ; 0x1a708 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1a868: 11 11 cpse r17, r1 1a86a: 62 c1 rjmp .+708 ; 0x1ab30 #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); 1a86c: a2 96 adiw r28, 0x22 ; 34 1a86e: 2c ad ldd r18, Y+60 ; 0x3c 1a870: 3d ad ldd r19, Y+61 ; 0x3d 1a872: 4e ad ldd r20, Y+62 ; 0x3e 1a874: 5f ad ldd r21, Y+63 ; 0x3f 1a876: a2 97 sbiw r28, 0x22 ; 34 1a878: a6 96 adiw r28, 0x26 ; 38 1a87a: 6c ad ldd r22, Y+60 ; 0x3c 1a87c: 7d ad ldd r23, Y+61 ; 0x3d 1a87e: 8e ad ldd r24, Y+62 ; 0x3e 1a880: 9f ad ldd r25, Y+63 ; 0x3f 1a882: a6 97 sbiw r28, 0x26 ; 38 1a884: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a888: 20 e0 ldi r18, 0x00 ; 0 1a88a: 30 e0 ldi r19, 0x00 ; 0 1a88c: 40 e0 ldi r20, 0x00 ; 0 1a88e: 5f e3 ldi r21, 0x3F ; 63 1a890: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a894: 6b 01 movw r12, r22 1a896: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a898: 0f 94 5e a3 call 0x346bc ; 0x346bc 1a89c: a2 96 adiw r28, 0x22 ; 34 1a89e: 6c af std Y+60, r22 ; 0x3c 1a8a0: 7d af std Y+61, r23 ; 0x3d 1a8a2: 8e af std Y+62, r24 ; 0x3e 1a8a4: 9f af std Y+63, r25 ; 0x3f 1a8a6: a2 97 sbiw r28, 0x22 ; 34 1a8a8: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a8ac: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a8b0: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a8b4: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a8b8: c7 01 movw r24, r14 1a8ba: b6 01 movw r22, r12 1a8bc: 0f 94 24 a6 call 0x34c48 ; 0x34c48 1a8c0: a6 96 adiw r28, 0x26 ; 38 1a8c2: 6c af std Y+60, r22 ; 0x3c 1a8c4: 7d af std Y+61, r23 ; 0x3d 1a8c6: 8e af std Y+62, r24 ; 0x3e 1a8c8: 9f af std Y+63, r25 ; 0x3f 1a8ca: a6 97 sbiw r28, 0x26 ; 38 1a8cc: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a8d0: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a8d4: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a8d8: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1a8dc: 9b 01 movw r18, r22 1a8de: ac 01 movw r20, r24 1a8e0: 50 58 subi r21, 0x80 ; 128 1a8e2: aa 96 adiw r28, 0x2a ; 42 1a8e4: 2c af std Y+60, r18 ; 0x3c 1a8e6: 3d af std Y+61, r19 ; 0x3d 1a8e8: 4e af std Y+62, r20 ; 0x3e 1a8ea: 5f af std Y+63, r21 ; 0x3f 1a8ec: aa 97 sbiw r28, 0x2a ; 42 1a8ee: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1a8f2: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1a8f6: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1a8fa: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1a8fe: a2 96 adiw r28, 0x22 ; 34 1a900: 8c ad ldd r24, Y+60 ; 0x3c 1a902: 9d ad ldd r25, Y+61 ; 0x3d 1a904: ae ad ldd r26, Y+62 ; 0x3e 1a906: bf ad ldd r27, Y+63 ; 0x3f 1a908: a2 97 sbiw r28, 0x22 ; 34 1a90a: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 1a90e: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca 1a912: a0 93 cb 12 sts 0x12CB, r26 ; 0x8012cb 1a916: b0 93 cc 12 sts 0x12CC, r27 ; 0x8012cc // Refresh the offset. cntr[0] = 0.f; 1a91a: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1a91e: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 1a922: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 1a926: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1a92a: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1a92e: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 1a932: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 1a936: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 float wx = 0.f; 1a93a: 41 2c mov r4, r1 1a93c: 51 2c mov r5, r1 1a93e: 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]; 1a940: cf 56 subi r28, 0x6F ; 111 1a942: df 4f sbci r29, 0xFF ; 255 1a944: a8 81 ld r26, Y 1a946: b9 81 ldd r27, Y+1 ; 0x01 1a948: c1 59 subi r28, 0x91 ; 145 1a94a: d0 40 sbci r29, 0x00 ; 0 1a94c: 11 96 adiw r26, 0x01 ; 1 1a94e: 8d 90 ld r8, X+ 1a950: 9d 90 ld r9, X+ 1a952: ad 90 ld r10, X+ 1a954: bc 90 ld r11, X 1a956: 14 97 sbiw r26, 0x04 ; 4 1a958: 15 96 adiw r26, 0x05 ; 5 1a95a: 2d 91 ld r18, X+ 1a95c: 3d 91 ld r19, X+ 1a95e: 4d 91 ld r20, X+ 1a960: 5c 91 ld r21, X 1a962: 18 97 sbiw r26, 0x08 ; 8 1a964: 6e 96 adiw r28, 0x1e ; 30 1a966: 2c af std Y+60, r18 ; 0x3c 1a968: 3d af std Y+61, r19 ; 0x3d 1a96a: 4e af std Y+62, r20 ; 0x3e 1a96c: 5f af std Y+63, r21 ; 0x3f 1a96e: 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); 1a970: cd 56 subi r28, 0x6D ; 109 1a972: df 4f sbci r29, 0xFF ; 255 1a974: e8 81 ld r30, Y 1a976: f9 81 ldd r31, Y+1 ; 0x01 1a978: c3 59 subi r28, 0x93 ; 147 1a97a: d0 40 sbci r29, 0x00 ; 0 1a97c: c5 90 lpm r12, Z+ 1a97e: d5 90 lpm r13, Z+ 1a980: e5 90 lpm r14, Z+ 1a982: 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]; 1a984: a5 01 movw r20, r10 1a986: 94 01 movw r18, r8 1a988: a2 96 adiw r28, 0x22 ; 34 1a98a: 6c ad ldd r22, Y+60 ; 0x3c 1a98c: 7d ad ldd r23, Y+61 ; 0x3d 1a98e: 8e ad ldd r24, Y+62 ; 0x3e 1a990: 9f ad ldd r25, Y+63 ; 0x3f 1a992: a2 97 sbiw r28, 0x22 ; 34 1a994: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a998: ae 96 adiw r28, 0x2e ; 46 1a99a: 6c af std Y+60, r22 ; 0x3c 1a99c: 7d af std Y+61, r23 ; 0x3d 1a99e: 8e af std Y+62, r24 ; 0x3e 1a9a0: 9f af std Y+63, r25 ; 0x3f 1a9a2: ae 97 sbiw r28, 0x2e ; 46 1a9a4: 6e 96 adiw r28, 0x1e ; 30 1a9a6: 2c ad ldd r18, Y+60 ; 0x3c 1a9a8: 3d ad ldd r19, Y+61 ; 0x3d 1a9aa: 4e ad ldd r20, Y+62 ; 0x3e 1a9ac: 5f ad ldd r21, Y+63 ; 0x3f 1a9ae: 6e 97 sbiw r28, 0x1e ; 30 1a9b0: aa 96 adiw r28, 0x2a ; 42 1a9b2: 6c ad ldd r22, Y+60 ; 0x3c 1a9b4: 7d ad ldd r23, Y+61 ; 0x3d 1a9b6: 8e ad ldd r24, Y+62 ; 0x3e 1a9b8: 9f ad ldd r25, Y+63 ; 0x3f 1a9ba: aa 97 sbiw r28, 0x2a ; 42 1a9bc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1a9c0: 9b 01 movw r18, r22 1a9c2: ac 01 movw r20, r24 1a9c4: ae 96 adiw r28, 0x2e ; 46 1a9c6: 6c ad ldd r22, Y+60 ; 0x3c 1a9c8: 7d ad ldd r23, Y+61 ; 0x3d 1a9ca: 8e ad ldd r24, Y+62 ; 0x3e 1a9cc: 9f ad ldd r25, Y+63 ; 0x3f 1a9ce: ae 97 sbiw r28, 0x2e ; 46 1a9d0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a9d4: 9b 01 movw r18, r22 1a9d6: 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); 1a9d8: c7 01 movw r24, r14 1a9da: b6 01 movw r22, r12 1a9dc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1a9e0: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a9e4: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a9e8: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a9ec: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a9f0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1a9f4: 6b 01 movw r12, r22 1a9f6: 7c 01 movw r14, r24 1a9f8: c0 92 cd 12 sts 0x12CD, r12 ; 0x8012cd 1a9fc: d0 92 ce 12 sts 0x12CE, r13 ; 0x8012ce 1aa00: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf 1aa04: f0 92 d0 12 sts 0x12D0, r15 ; 0x8012d0 wx += w; 1aa08: 20 e0 ldi r18, 0x00 ; 0 1aa0a: 30 e0 ldi r19, 0x00 ; 0 1aa0c: 40 e8 ldi r20, 0x80 ; 128 1aa0e: 5f e3 ldi r21, 0x3F ; 63 1aa10: c3 01 movw r24, r6 1aa12: b2 01 movw r22, r4 1aa14: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1aa18: 2b 01 movw r4, r22 1aa1a: 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); 1aa1c: cd 56 subi r28, 0x6D ; 109 1aa1e: df 4f sbci r29, 0xFF ; 255 1aa20: e8 81 ld r30, Y 1aa22: f9 81 ldd r31, Y+1 ; 0x01 1aa24: c3 59 subi r28, 0x93 ; 147 1aa26: d0 40 sbci r29, 0x00 ; 0 1aa28: 34 96 adiw r30, 0x04 ; 4 1aa2a: 25 91 lpm r18, Z+ 1aa2c: 35 91 lpm r19, Z+ 1aa2e: 45 91 lpm r20, Z+ 1aa30: 54 91 lpm r21, Z 1aa32: ae 96 adiw r28, 0x2e ; 46 1aa34: 2c af std Y+60, r18 ; 0x3c 1aa36: 3d af std Y+61, r19 ; 0x3d 1aa38: 4e af std Y+62, r20 ; 0x3e 1aa3a: 5f af std Y+63, r21 ; 0x3f 1aa3c: 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]; 1aa3e: a5 01 movw r20, r10 1aa40: 94 01 movw r18, r8 1aa42: a6 96 adiw r28, 0x26 ; 38 1aa44: 6c ad ldd r22, Y+60 ; 0x3c 1aa46: 7d ad ldd r23, Y+61 ; 0x3d 1aa48: 8e ad ldd r24, Y+62 ; 0x3e 1aa4a: 9f ad ldd r25, Y+63 ; 0x3f 1aa4c: a6 97 sbiw r28, 0x26 ; 38 1aa4e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1aa52: 4b 01 movw r8, r22 1aa54: 5c 01 movw r10, r24 1aa56: 6e 96 adiw r28, 0x1e ; 30 1aa58: 2c ad ldd r18, Y+60 ; 0x3c 1aa5a: 3d ad ldd r19, Y+61 ; 0x3d 1aa5c: 4e ad ldd r20, Y+62 ; 0x3e 1aa5e: 5f ad ldd r21, Y+63 ; 0x3f 1aa60: 6e 97 sbiw r28, 0x1e ; 30 1aa62: a2 96 adiw r28, 0x22 ; 34 1aa64: 6c ad ldd r22, Y+60 ; 0x3c 1aa66: 7d ad ldd r23, Y+61 ; 0x3d 1aa68: 8e ad ldd r24, Y+62 ; 0x3e 1aa6a: 9f ad ldd r25, Y+63 ; 0x3f 1aa6c: a2 97 sbiw r28, 0x22 ; 34 1aa6e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1aa72: 9b 01 movw r18, r22 1aa74: ac 01 movw r20, r24 1aa76: c5 01 movw r24, r10 1aa78: b4 01 movw r22, r8 1aa7a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1aa7e: 9b 01 movw r18, r22 1aa80: 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); 1aa82: ae 96 adiw r28, 0x2e ; 46 1aa84: 6c ad ldd r22, Y+60 ; 0x3c 1aa86: 7d ad ldd r23, Y+61 ; 0x3d 1aa88: 8e ad ldd r24, Y+62 ; 0x3e 1aa8a: 9f ad ldd r25, Y+63 ; 0x3f 1aa8c: ae 97 sbiw r28, 0x2e ; 46 1aa8e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1aa92: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1aa96: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1aa9a: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1aa9e: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1aaa2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1aaa6: 4b 01 movw r8, r22 1aaa8: 5c 01 movw r10, r24 1aaaa: 80 92 d1 12 sts 0x12D1, r8 ; 0x8012d1 1aaae: 90 92 d2 12 sts 0x12D2, r9 ; 0x8012d2 1aab2: a0 92 d3 12 sts 0x12D3, r10 ; 0x8012d3 1aab6: b0 92 d4 12 sts 0x12D4, r11 ; 0x8012d4 1aaba: cf 56 subi r28, 0x6F ; 111 1aabc: df 4f sbci r29, 0xFF ; 255 1aabe: 48 81 ld r20, Y 1aac0: 59 81 ldd r21, Y+1 ; 0x01 1aac2: c1 59 subi r28, 0x91 ; 145 1aac4: d0 40 sbci r29, 0x00 ; 0 1aac6: 48 5f subi r20, 0xF8 ; 248 1aac8: 5f 4f sbci r21, 0xFF ; 255 1aaca: cf 56 subi r28, 0x6F ; 111 1aacc: df 4f sbci r29, 0xFF ; 255 1aace: 59 83 std Y+1, r21 ; 0x01 1aad0: 48 83 st Y, r20 1aad2: c1 59 subi r28, 0x91 ; 145 1aad4: d0 40 sbci r29, 0x00 ; 0 1aad6: cd 56 subi r28, 0x6D ; 109 1aad8: df 4f sbci r29, 0xFF ; 255 1aada: 88 81 ld r24, Y 1aadc: 99 81 ldd r25, Y+1 ; 0x01 1aade: c3 59 subi r28, 0x93 ; 147 1aae0: d0 40 sbci r29, 0x00 ; 0 1aae2: 08 96 adiw r24, 0x08 ; 8 1aae4: cd 56 subi r28, 0x6D ; 109 1aae6: df 4f sbci r29, 0xFF ; 255 1aae8: 99 83 std Y+1, r25 ; 0x01 1aaea: 88 83 st Y, r24 1aaec: c3 59 subi r28, 0x93 ; 147 1aaee: 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) { 1aaf0: 24 16 cp r2, r20 1aaf2: 35 06 cpc r3, r21 1aaf4: 09 f0 breq .+2 ; 0x1aaf8 1aaf6: 24 cf rjmp .-440 ; 0x1a940 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1aaf8: a3 01 movw r20, r6 1aafa: 92 01 movw r18, r4 1aafc: c7 01 movw r24, r14 1aafe: b6 01 movw r22, r12 1ab00: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1ab04: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1ab08: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1ab0c: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1ab10: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] /= wy; 1ab14: a3 01 movw r20, r6 1ab16: 92 01 movw r18, r4 1ab18: c5 01 movw r24, r10 1ab1a: b4 01 movw r22, r8 1ab1c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1ab20: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ab24: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ab28: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ab2c: 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]; 1ab30: 40 90 bd 12 lds r4, 0x12BD ; 0x8012bd 1ab34: 50 90 be 12 lds r5, 0x12BE ; 0x8012be 1ab38: 60 90 bf 12 lds r6, 0x12BF ; 0x8012bf 1ab3c: 70 90 c0 12 lds r7, 0x12C0 ; 0x8012c0 1ab40: c0 90 c9 12 lds r12, 0x12C9 ; 0x8012c9 1ab44: d0 90 ca 12 lds r13, 0x12CA ; 0x8012ca 1ab48: e0 90 cb 12 lds r14, 0x12CB ; 0x8012cb 1ab4c: f0 90 cc 12 lds r15, 0x12CC ; 0x8012cc 1ab50: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 1ab54: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 1ab58: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 1ab5c: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 1ab60: a2 96 adiw r28, 0x22 ; 34 1ab62: 2c af std Y+60, r18 ; 0x3c 1ab64: 3d af std Y+61, r19 ; 0x3d 1ab66: 4e af std Y+62, r20 ; 0x3e 1ab68: 5f af std Y+63, r21 ; 0x3f 1ab6a: a2 97 sbiw r28, 0x22 ; 34 1ab6c: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1ab70: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1ab74: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1ab78: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1ab7c: a6 96 adiw r28, 0x26 ; 38 1ab7e: 8c af std Y+60, r24 ; 0x3c 1ab80: 9d af std Y+61, r25 ; 0x3d 1ab82: ae af std Y+62, r26 ; 0x3e 1ab84: bf af std Y+63, r27 ; 0x3f 1ab86: a6 97 sbiw r28, 0x26 ; 38 1ab88: a7 01 movw r20, r14 1ab8a: 96 01 movw r18, r12 1ab8c: c3 01 movw r24, r6 1ab8e: b2 01 movw r22, r4 1ab90: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1ab94: 4b 01 movw r8, r22 1ab96: 5c 01 movw r10, r24 1ab98: a6 96 adiw r28, 0x26 ; 38 1ab9a: 2c ad ldd r18, Y+60 ; 0x3c 1ab9c: 3d ad ldd r19, Y+61 ; 0x3d 1ab9e: 4e ad ldd r20, Y+62 ; 0x3e 1aba0: 5f ad ldd r21, Y+63 ; 0x3f 1aba2: a6 97 sbiw r28, 0x26 ; 38 1aba4: a2 96 adiw r28, 0x22 ; 34 1aba6: 6c ad ldd r22, Y+60 ; 0x3c 1aba8: 7d ad ldd r23, Y+61 ; 0x3d 1abaa: 8e ad ldd r24, Y+62 ; 0x3e 1abac: 9f ad ldd r25, Y+63 ; 0x3f 1abae: a2 97 sbiw r28, 0x22 ; 34 1abb0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1abb4: 9b 01 movw r18, r22 1abb6: ac 01 movw r20, r24 1abb8: c5 01 movw r24, r10 1abba: b4 01 movw r22, r8 1abbc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1abc0: 4b 01 movw r8, r22 1abc2: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1abc4: ac 01 movw r20, r24 1abc6: 9b 01 movw r18, r22 1abc8: c7 01 movw r24, r14 1abca: b6 01 movw r22, r12 1abcc: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1abd0: 6b 01 movw r12, r22 1abd2: 7c 01 movw r14, r24 1abd4: a6 96 adiw r28, 0x26 ; 38 1abd6: 6c ad ldd r22, Y+60 ; 0x3c 1abd8: 7d ad ldd r23, Y+61 ; 0x3d 1abda: 8e ad ldd r24, Y+62 ; 0x3e 1abdc: 9f ad ldd r25, Y+63 ; 0x3f 1abde: a6 97 sbiw r28, 0x26 ; 38 1abe0: 90 58 subi r25, 0x80 ; 128 1abe2: a5 01 movw r20, r10 1abe4: 94 01 movw r18, r8 1abe6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1abea: a6 96 adiw r28, 0x26 ; 38 1abec: 6c af std Y+60, r22 ; 0x3c 1abee: 7d af std Y+61, r23 ; 0x3d 1abf0: 8e af std Y+62, r24 ; 0x3e 1abf2: 9f af std Y+63, r25 ; 0x3f 1abf4: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1abf6: a2 96 adiw r28, 0x22 ; 34 1abf8: 6c ad ldd r22, Y+60 ; 0x3c 1abfa: 7d ad ldd r23, Y+61 ; 0x3d 1abfc: 8e ad ldd r24, Y+62 ; 0x3e 1abfe: 9f ad ldd r25, Y+63 ; 0x3f 1ac00: a2 97 sbiw r28, 0x22 ; 34 1ac02: 90 58 subi r25, 0x80 ; 128 1ac04: a5 01 movw r20, r10 1ac06: 94 01 movw r18, r8 1ac08: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1ac0c: aa 96 adiw r28, 0x2a ; 42 1ac0e: 6c af std Y+60, r22 ; 0x3c 1ac10: 7d af std Y+61, r23 ; 0x3d 1ac12: 8e af std Y+62, r24 ; 0x3e 1ac14: 9f af std Y+63, r25 ; 0x3f 1ac16: aa 97 sbiw r28, 0x2a ; 42 1ac18: a5 01 movw r20, r10 1ac1a: 94 01 movw r18, r8 1ac1c: c3 01 movw r24, r6 1ac1e: b2 01 movw r22, r4 1ac20: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1ac24: 4b 01 movw r8, r22 1ac26: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ac28: 40 90 cd 12 lds r4, 0x12CD ; 0x8012cd 1ac2c: 50 90 ce 12 lds r5, 0x12CE ; 0x8012ce 1ac30: 60 90 cf 12 lds r6, 0x12CF ; 0x8012cf 1ac34: 70 90 d0 12 lds r7, 0x12D0 ; 0x8012d0 1ac38: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1ac3c: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1ac40: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1ac44: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1ac48: a2 96 adiw r28, 0x22 ; 34 1ac4a: 2c af std Y+60, r18 ; 0x3c 1ac4c: 3d af std Y+61, r19 ; 0x3d 1ac4e: 4e af std Y+62, r20 ; 0x3e 1ac50: 5f af std Y+63, r21 ; 0x3f 1ac52: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ac54: c0 92 bd 12 sts 0x12BD, r12 ; 0x8012bd 1ac58: d0 92 be 12 sts 0x12BE, r13 ; 0x8012be 1ac5c: e0 92 bf 12 sts 0x12BF, r14 ; 0x8012bf 1ac60: f0 92 c0 12 sts 0x12C0, r15 ; 0x8012c0 vec_x[1] = Ainv[1][0]; 1ac64: aa 96 adiw r28, 0x2a ; 42 1ac66: 8c ad ldd r24, Y+60 ; 0x3c 1ac68: 9d ad ldd r25, Y+61 ; 0x3d 1ac6a: ae ad ldd r26, Y+62 ; 0x3e 1ac6c: bf ad ldd r27, Y+63 ; 0x3f 1ac6e: aa 97 sbiw r28, 0x2a ; 42 1ac70: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 1ac74: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 1ac78: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 1ac7c: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 vec_y[0] = Ainv[0][1]; 1ac80: a6 96 adiw r28, 0x26 ; 38 1ac82: 2c ad ldd r18, Y+60 ; 0x3c 1ac84: 3d ad ldd r19, Y+61 ; 0x3d 1ac86: 4e ad ldd r20, Y+62 ; 0x3e 1ac88: 5f ad ldd r21, Y+63 ; 0x3f 1ac8a: a6 97 sbiw r28, 0x26 ; 38 1ac8c: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1ac90: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1ac94: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1ac98: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = Ainv[1][1]; 1ac9c: 80 92 c9 12 sts 0x12C9, r8 ; 0x8012c9 1aca0: 90 92 ca 12 sts 0x12CA, r9 ; 0x8012ca 1aca4: a0 92 cb 12 sts 0x12CB, r10 ; 0x8012cb 1aca8: 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], 1acac: c7 01 movw r24, r14 1acae: b6 01 movw r22, r12 1acb0: 90 58 subi r25, 0x80 ; 128 1acb2: a3 01 movw r20, r6 1acb4: 92 01 movw r18, r4 1acb6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1acba: 6b 01 movw r12, r22 1acbc: 7c 01 movw r14, r24 1acbe: a2 96 adiw r28, 0x22 ; 34 1acc0: 2c ad ldd r18, Y+60 ; 0x3c 1acc2: 3d ad ldd r19, Y+61 ; 0x3d 1acc4: 4e ad ldd r20, Y+62 ; 0x3e 1acc6: 5f ad ldd r21, Y+63 ; 0x3f 1acc8: a2 97 sbiw r28, 0x22 ; 34 1acca: a6 96 adiw r28, 0x26 ; 38 1accc: 6c ad ldd r22, Y+60 ; 0x3c 1acce: 7d ad ldd r23, Y+61 ; 0x3d 1acd0: 8e ad ldd r24, Y+62 ; 0x3e 1acd2: 9f ad ldd r25, Y+63 ; 0x3f 1acd4: a6 97 sbiw r28, 0x26 ; 38 1acd6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1acda: 9b 01 movw r18, r22 1acdc: ac 01 movw r20, r24 1acde: c7 01 movw r24, r14 1ace0: b6 01 movw r22, r12 1ace2: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__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]; 1ace6: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1acea: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1acee: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1acf2: 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] 1acf6: aa 96 adiw r28, 0x2a ; 42 1acf8: 6c ad ldd r22, Y+60 ; 0x3c 1acfa: 7d ad ldd r23, Y+61 ; 0x3d 1acfc: 8e ad ldd r24, Y+62 ; 0x3e 1acfe: 9f ad ldd r25, Y+63 ; 0x3f 1ad00: aa 97 sbiw r28, 0x2a ; 42 1ad02: 90 58 subi r25, 0x80 ; 128 1ad04: a3 01 movw r20, r6 1ad06: 92 01 movw r18, r4 1ad08: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1ad0c: 6b 01 movw r12, r22 1ad0e: 7c 01 movw r14, r24 1ad10: a2 96 adiw r28, 0x22 ; 34 1ad12: 2c ad ldd r18, Y+60 ; 0x3c 1ad14: 3d ad ldd r19, Y+61 ; 0x3d 1ad16: 4e ad ldd r20, Y+62 ; 0x3e 1ad18: 5f ad ldd r21, Y+63 ; 0x3f 1ad1a: a2 97 sbiw r28, 0x22 ; 34 1ad1c: c5 01 movw r24, r10 1ad1e: b4 01 movw r22, r8 1ad20: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1ad24: 9b 01 movw r18, r22 1ad26: ac 01 movw r20, r24 1ad28: c7 01 movw r24, r14 1ad2a: b6 01 movw r22, r12 1ad2c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__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]; 1ad30: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ad34: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ad38: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ad3c: 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 1ad40: 90 e0 ldi r25, 0x00 ; 0 1ad42: 80 e0 ldi r24, 0x00 ; 0 1ad44: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (result >= 0) { 1ad48: 17 fd sbrc r17, 7 1ad4a: d5 c0 rjmp .+426 ; 0x1aef6 DBG(_n("Calibration success.\n")); 1ad4c: 8f e1 ldi r24, 0x1F ; 31 1ad4e: 9a e6 ldi r25, 0x6A ; 106 1ad50: 9f 93 push r25 1ad52: 8f 93 push r24 1ad54: 0f 94 fe 9f call 0x33ffc ; 0x33ffc world2machine_update(vec_x, vec_y, cntr); 1ad58: 4d ec ldi r20, 0xCD ; 205 1ad5a: 52 e1 ldi r21, 0x12 ; 18 1ad5c: 65 ec ldi r22, 0xC5 ; 197 1ad5e: 72 e1 ldi r23, 0x12 ; 18 1ad60: 8d eb ldi r24, 0xBD ; 189 1ad62: 92 e1 ldi r25, 0x12 ; 18 1ad64: 0f 94 3a 8f call 0x31e74 ; 0x31e74 #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); 1ad68: 48 e0 ldi r20, 0x08 ; 8 1ad6a: 50 e0 ldi r21, 0x00 ; 0 1ad6c: 65 ee ldi r22, 0xE5 ; 229 1ad6e: 7f e0 ldi r23, 0x0F ; 15 1ad70: 8d ec ldi r24, 0xCD ; 205 1ad72: 92 e1 ldi r25, 0x12 ; 18 1ad74: 0f 94 50 a1 call 0x342a0 ; 0x342a0 1ad78: 48 e0 ldi r20, 0x08 ; 8 1ad7a: 50 e0 ldi r21, 0x00 ; 0 1ad7c: 6d ed ldi r22, 0xDD ; 221 1ad7e: 7f e0 ldi r23, 0x0F ; 15 1ad80: 8d eb ldi r24, 0xBD ; 189 1ad82: 92 e1 ldi r25, 0x12 ; 18 1ad84: 0f 94 50 a1 call 0x342a0 ; 0x342a0 1ad88: 48 e0 ldi r20, 0x08 ; 8 1ad8a: 50 e0 ldi r21, 0x00 ; 0 1ad8c: 65 ed ldi r22, 0xD5 ; 213 1ad8e: 7f e0 ldi r23, 0x0F ; 15 1ad90: 85 ec ldi r24, 0xC5 ; 197 1ad92: 92 e1 ldi r25, 0x12 ; 18 1ad94: 0f 94 50 a1 call 0x342a0 ; 0x342a0 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(); 1ad98: 0f 94 bf 8e call 0x31d7e ; 0x31d7e } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ad9c: 0f 90 pop r0 1ad9e: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ada0: c7 55 subi r28, 0x57 ; 87 1ada2: df 4f sbci r29, 0xFF ; 255 1ada4: 88 81 ld r24, Y 1ada6: 99 81 ldd r25, Y+1 ; 0x01 1ada8: c9 5a subi r28, 0xA9 ; 169 1adaa: d0 40 sbci r29, 0x00 ; 0 1adac: 0e 94 55 60 call 0xc0aa ; 0xc0aa // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1adb0: 80 e0 ldi r24, 0x00 ; 0 1adb2: 90 e0 ldi r25, 0x00 ; 0 1adb4: a0 ea ldi r26, 0xA0 ; 160 1adb6: b0 e4 ldi r27, 0x40 ; 64 1adb8: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 1adbc: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1adc0: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1adc4: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1adc8: 60 e0 ldi r22, 0x00 ; 0 1adca: 70 e0 ldi r23, 0x00 ; 0 1adcc: 80 ea ldi r24, 0xA0 ; 160 1adce: 91 e4 ldi r25, 0x41 ; 65 1add0: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1add4: 0f 94 a0 22 call 0x24540 ; 0x24540 //#ifndef NEW_XYZCAL if (result >= 0) 1add8: 17 fd sbrc r17, 7 1adda: 22 c0 rjmp .+68 ; 0x1ae20 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; 1addc: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 1ade0: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 1ade4: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 1ade8: 10 92 00 12 sts 0x1200, r1 ; 0x801200 destination[Z_AXIS] = 150.F; 1adec: 80 e0 ldi r24, 0x00 ; 0 1adee: 90 e0 ldi r25, 0x00 ; 0 1adf0: a6 e1 ldi r26, 0x16 ; 22 1adf2: b3 e4 ldi r27, 0x43 ; 67 1adf4: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 1adf8: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 1adfc: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 1ae00: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1ae04: 65 e5 ldi r22, 0x55 ; 85 1ae06: 75 e5 ldi r23, 0x55 ; 85 1ae08: 85 e5 ldi r24, 0x55 ; 85 1ae0a: 91 e4 ldi r25, 0x41 ; 65 1ae0c: 0f 94 9d 85 call 0x30b3a ; 0x30b3a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1ae10: 89 e0 ldi r24, 0x09 ; 9 1ae12: 97 e4 ldi r25, 0x47 ; 71 1ae14: 0e 94 32 6d call 0xda64 ; 0xda64 1ae18: 0f 94 7b 0b call 0x216f6 ; 0x216f6 // 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()) 1ae1c: 0f 94 d8 8c call 0x319b0 ; 0x319b0 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ae20: 81 e0 ldi r24, 0x01 ; 1 1ae22: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_update(2); 1ae26: 82 e0 ldi r24, 0x02 ; 2 1ae28: 0e 94 c3 69 call 0xd386 ; 0xd386 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)); 1ae2c: 8a ec ldi r24, 0xCA ; 202 1ae2e: 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) { 1ae30: 1f 3f cpi r17, 0xFF ; 255 1ae32: 99 f0 breq .+38 ; 0x1ae5a 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) { 1ae34: 1e 3f cpi r17, 0xFE ; 254 1ae36: 09 f0 breq .+2 ; 0x1ae3a 1ae38: 73 c0 rjmp .+230 ; 0x1af20 if (point_too_far_mask == 0) 1ae3a: af 96 adiw r28, 0x2f ; 47 1ae3c: 4f ad ldd r20, Y+63 ; 0x3f 1ae3e: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ae40: 85 e9 ldi r24, 0x95 ; 149 1ae42: 96 e4 ldi r25, 0x46 ; 70 { 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) 1ae44: 44 23 and r20, r20 1ae46: 49 f0 breq .+18 ; 0x1ae5a msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ae48: af 96 adiw r28, 0x2f ; 47 1ae4a: 5f ad ldd r21, Y+63 ; 0x3f 1ae4c: 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); 1ae4e: 83 e5 ldi r24, 0x53 ; 83 1ae50: 96 e4 ldi r25, 0x46 ; 70 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) 1ae52: 52 30 cpi r21, 0x02 ; 2 1ae54: 11 f0 breq .+4 ; 0x1ae5a // 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); 1ae56: 8c e0 ldi r24, 0x0C ; 12 1ae58: 96 e4 ldi r25, 0x46 ; 70 1ae5a: 0e 94 32 6d call 0xda64 ; 0xda64 1ae5e: 0c 94 0f ca jmp 0x1941e ; 0x1941e (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]) : 1ae62: f2 01 movw r30, r4 1ae64: 25 81 ldd r18, Z+5 ; 0x05 1ae66: 36 81 ldd r19, Z+6 ; 0x06 1ae68: 47 81 ldd r20, Z+7 ; 0x07 1ae6a: 50 85 ldd r21, Z+8 ; 0x08 1ae6c: c3 58 subi r28, 0x83 ; 131 1ae6e: df 4f sbci r29, 0xFF ; 255 1ae70: 68 81 ld r22, Y 1ae72: 79 81 ldd r23, Y+1 ; 0x01 1ae74: 8a 81 ldd r24, Y+2 ; 0x02 1ae76: 9b 81 ldd r25, Y+3 ; 0x03 1ae78: cd 57 subi r28, 0x7D ; 125 1ae7a: d0 40 sbci r29, 0x00 ; 0 1ae7c: 0c 94 6b ce jmp 0x19cd6 ; 0x19cd6 // 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]) : 1ae80: f2 01 movw r30, r4 1ae82: 25 81 ldd r18, Z+5 ; 0x05 1ae84: 36 81 ldd r19, Z+6 ; 0x06 1ae86: 47 81 ldd r20, Z+7 ; 0x07 1ae88: 50 85 ldd r21, Z+8 ; 0x08 1ae8a: ed 96 adiw r28, 0x3d ; 61 1ae8c: 6c ad ldd r22, Y+60 ; 0x3c 1ae8e: 7d ad ldd r23, Y+61 ; 0x3d 1ae90: 8e ad ldd r24, Y+62 ; 0x3e 1ae92: 9f ad ldd r25, Y+63 ; 0x3f 1ae94: ed 97 sbiw r28, 0x3d ; 61 1ae96: b8 c0 rjmp .+368 ; 0x1b008 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1ae98: f2 01 movw r30, r4 1ae9a: 25 81 ldd r18, Z+5 ; 0x05 1ae9c: 36 81 ldd r19, Z+6 ; 0x06 1ae9e: 47 81 ldd r20, Z+7 ; 0x07 1aea0: 50 85 ldd r21, Z+8 ; 0x08 1aea2: ed 96 adiw r28, 0x3d ; 61 1aea4: 6c ad ldd r22, Y+60 ; 0x3c 1aea6: 7d ad ldd r23, Y+61 ; 0x3d 1aea8: 8e ad ldd r24, Y+62 ; 0x3e 1aeaa: 9f ad ldd r25, Y+63 ; 0x3f 1aeac: ed 97 sbiw r28, 0x3d ; 61 1aeae: c6 c0 rjmp .+396 ; 0x1b03c 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]) : 1aeb0: a3 01 movw r20, r6 1aeb2: 92 01 movw r18, r4 1aeb4: c3 58 subi r28, 0x83 ; 131 1aeb6: df 4f sbci r29, 0xFF ; 255 1aeb8: 68 81 ld r22, Y 1aeba: 79 81 ldd r23, Y+1 ; 0x01 1aebc: 8a 81 ldd r24, Y+2 ; 0x02 1aebe: 9b 81 ldd r25, Y+3 ; 0x03 1aec0: cd 57 subi r28, 0x7D ; 125 1aec2: d0 40 sbci r29, 0x00 ; 0 1aec4: 0c 94 d3 ce jmp 0x19da6 ; 0x19da6 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1aec8: 81 2c mov r8, r1 1aeca: 91 2c mov r9, r1 1aecc: 20 e8 ldi r18, 0x80 ; 128 1aece: a2 2e mov r10, r18 1aed0: 2f e3 ldi r18, 0x3F ; 63 1aed2: b2 2e mov r11, r18 1aed4: 0c 94 d7 ce jmp 0x19dae ; 0x19dae float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1aed8: c1 2c mov r12, r1 1aeda: d1 2c mov r13, r1 1aedc: 76 01 movw r14, r12 1aede: 0c 94 4e cf jmp 0x19e9c ; 0x19e9c ((r == 1) ? 1.f : 1aee2: c1 2c mov r12, r1 1aee4: d1 2c mov r13, r1 1aee6: 90 e8 ldi r25, 0x80 ; 128 1aee8: e9 2e mov r14, r25 1aeea: 9f e3 ldi r25, 0x3F ; 63 1aeec: f9 2e mov r15, r25 1aeee: 0c 94 4e cf jmp 0x19e9c ; 0x19e9c 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; 1aef2: 12 e0 ldi r17, 0x02 ; 2 1aef4: a7 cb rjmp .-2226 ; 0x1a644 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1aef6: 1e 3f cpi r17, 0xFE ; 254 1aef8: 89 f4 brne .+34 ; 0x1af1c 1aefa: af 96 adiw r28, 0x2f ; 47 1aefc: 3f ad ldd r19, Y+63 ; 0x3f 1aefe: af 97 sbiw r28, 0x2f ; 47 1af00: 32 30 cpi r19, 0x02 ; 2 1af02: 09 f0 breq .+2 ; 0x1af06 1af04: 4d cf rjmp .-358 ; 0x1ada0 DBG(_n("Fitting failed => calibration failed.\n")); 1af06: 88 ef ldi r24, 0xF8 ; 248 1af08: 99 e6 ldi r25, 0x69 ; 105 1af0a: 9f 93 push r25 1af0c: 8f 93 push r24 1af0e: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1af12: 44 cf rjmp .-376 ; 0x1ad9c // 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; 1af14: af 96 adiw r28, 0x2f ; 47 1af16: 1f ae std Y+63, r1 ; 0x3f 1af18: af 97 sbiw r28, 0x2f ; 47 1af1a: 42 cf rjmp .-380 ; 0x1ada0 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af1c: 1f ef ldi r17, 0xFF ; 255 1af1e: 40 cf rjmp .-384 ; 0x1ada0 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) { 1af20: af 96 adiw r28, 0x2f ; 47 1af22: 6f ad ldd r22, Y+63 ; 0x3f 1af24: af 97 sbiw r28, 0x2f ; 47 1af26: 61 11 cpse r22, r1 1af28: 13 c0 rjmp .+38 ; 0x1af50 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); 1af2a: 81 ef ldi r24, 0xF1 ; 241 1af2c: 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) { 1af2e: 11 30 cpi r17, 0x01 ; 1 1af30: 51 f0 breq .+20 ; 0x1af46 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); 1af32: 8e ea ldi r24, 0xAE ; 174 1af34: 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) { 1af36: 12 30 cpi r17, 0x02 ; 2 1af38: 31 f0 breq .+12 ; 0x1af46 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1af3a: 85 e9 ldi r24, 0x95 ; 149 1af3c: 96 e4 ldi r25, 0x46 ; 70 // 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) { 1af3e: 11 11 cpse r17, r1 1af40: 02 c0 rjmp .+4 ; 0x1af46 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); 1af42: 86 e3 ldi r24, 0x36 ; 54 1af44: 95 e4 ldi r25, 0x45 ; 69 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); 1af46: 0e 94 32 6d call 0xda64 ; 0xda64 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1af4a: 0f 94 7b 0b call 0x216f6 ; 0x216f6 1af4e: 0d c0 rjmp .+26 ; 0x1af6a // 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) 1af50: af 96 adiw r28, 0x2f ; 47 1af52: 8f ad ldd r24, Y+63 ; 0x3f 1af54: af 97 sbiw r28, 0x2f ; 47 1af56: 82 30 cpi r24, 0x02 ; 2 1af58: f1 f4 brne .+60 ; 0x1af96 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1af5a: 85 ec ldi r24, 0xC5 ; 197 1af5c: 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); 1af5e: 0e 94 32 6d call 0xda64 ; 0xda64 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); 1af62: 0f 94 7b 0b call 0x216f6 ; 0x216f6 } if (point_too_far_mask == 0 || result > 0) { 1af66: 11 16 cp r1, r17 1af68: 04 f3 brlt .-64 ; 0x1af2a //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1af6a: 1f 3f cpi r17, 0xFF ; 255 1af6c: 11 f4 brne .+4 ; 0x1af72 1af6e: 0c 94 1d c7 jmp 0x18e3a ; 0x18e3a { // 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); 1af72: 86 e0 ldi r24, 0x06 ; 6 1af74: 0e 94 7d c6 call 0x18cfa ; 0x18cfa if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1af78: 8f e5 ldi r24, 0x5F ; 95 1af7a: 9f e0 ldi r25, 0x0F ; 15 1af7c: 0f 94 3c a1 call 0x34278 ; 0x34278 1af80: 81 11 cpse r24, r1 1af82: 0c 94 29 ca jmp 0x19452 ; 0x19452 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1af86: 80 e3 ldi r24, 0x30 ; 48 1af88: 97 e4 ldi r25, 0x47 ; 71 1af8a: 0e 94 32 6d call 0xda64 ; 0xda64 1af8e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 1af92: 0c 94 29 ca jmp 0x19452 ; 0x19452 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); 1af96: 89 e7 ldi r24, 0x79 ; 121 1af98: 95 e4 ldi r25, 0x45 ; 69 1af9a: e1 cf rjmp .-62 ; 0x1af5e 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)) 1af9c: 89 81 ldd r24, Y+1 ; 0x01 1af9e: 9a 81 ldd r25, Y+2 ; 0x02 1afa0: 80 37 cpi r24, 0x70 ; 112 1afa2: 98 40 sbci r25, 0x08 ; 8 1afa4: 10 f0 brcs .+4 ; 0x1afaa 1afa6: 0c 94 62 ca jmp 0x194c4 ; 0x194c4 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1afaa: ae 01 movw r20, r28 1afac: 4f 5f subi r20, 0xFF ; 255 1afae: 5f 4f sbci r21, 0xFF ; 255 1afb0: 7a 01 movw r14, r20 1afb2: 04 eb ldi r16, 0xB4 ; 180 1afb4: 10 e0 ldi r17, 0x00 ; 0 1afb6: 24 e8 ldi r18, 0x84 ; 132 1afb8: 33 e0 ldi r19, 0x03 ; 3 1afba: a6 01 movw r20, r12 1afbc: 48 5c subi r20, 0xC8 ; 200 1afbe: 51 09 sbc r21, r1 1afc0: 69 2d mov r22, r9 1afc2: 78 2d mov r23, r8 1afc4: 8b 2d mov r24, r11 1afc6: 9a 2d mov r25, r10 1afc8: 0f 94 2c 60 call 0x2c058 ; 0x2c058 1afcc: 88 23 and r24, r24 1afce: 11 f4 brne .+4 ; 0x1afd4 1afd0: 0c 94 62 ca jmp 0x194c4 ; 0x194c4 ad += 1440; 1afd4: 89 81 ldd r24, Y+1 ; 0x01 1afd6: 9a 81 ldd r25, Y+2 ; 0x02 1afd8: 80 56 subi r24, 0x60 ; 96 1afda: 9a 4f sbci r25, 0xFA ; 250 1afdc: 0c 94 f2 c8 jmp 0x191e4 ; 0x191e4 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) { 1afe0: 00 23 and r16, r16 1afe2: 11 f4 brne .+4 ; 0x1afe8 1afe4: 0c 94 7e ce jmp 0x19cfc ; 0x19cfc float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1afe8: 02 30 cpi r16, 0x02 ; 2 1afea: 09 f0 breq .+2 ; 0x1afee 1afec: 49 cf rjmp .-366 ; 0x1ae80 1afee: d2 01 movw r26, r4 1aff0: 11 96 adiw r26, 0x01 ; 1 1aff2: 2d 91 ld r18, X+ 1aff4: 3d 91 ld r19, X+ 1aff6: 4d 91 ld r20, X+ 1aff8: 5c 91 ld r21, X 1affa: 14 97 sbiw r26, 0x04 ; 4 1affc: 6e 96 adiw r28, 0x1e ; 30 1affe: 6c ad ldd r22, Y+60 ; 0x3c 1b000: 7d ad ldd r23, Y+61 ; 0x3d 1b002: 8e ad ldd r24, Y+62 ; 0x3e 1b004: 9f ad ldd r25, Y+63 ; 0x3f 1b006: 6e 97 sbiw r28, 0x1e ; 30 1b008: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1b00c: 4b 01 movw r8, r22 1b00e: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1b010: 60 e0 ldi r22, 0x00 ; 0 1b012: 70 e0 ldi r23, 0x00 ; 0 1b014: 80 e8 ldi r24, 0x80 ; 128 1b016: 9f e3 ldi r25, 0x3F ; 63 1b018: 11 30 cpi r17, 0x01 ; 1 1b01a: 91 f0 breq .+36 ; 0x1b040 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1b01c: 12 30 cpi r17, 0x02 ; 2 1b01e: 09 f0 breq .+2 ; 0x1b022 1b020: 3b cf rjmp .-394 ; 0x1ae98 1b022: d2 01 movw r26, r4 1b024: 11 96 adiw r26, 0x01 ; 1 1b026: 2d 91 ld r18, X+ 1b028: 3d 91 ld r19, X+ 1b02a: 4d 91 ld r20, X+ 1b02c: 5c 91 ld r21, X 1b02e: 14 97 sbiw r26, 0x04 ; 4 1b030: 6e 96 adiw r28, 0x1e ; 30 1b032: 6c ad ldd r22, Y+60 ; 0x3c 1b034: 7d ad ldd r23, Y+61 ; 0x3d 1b036: 8e ad ldd r24, Y+62 ; 0x3e 1b038: 9f ad ldd r25, Y+63 ; 0x3f 1b03a: 6e 97 sbiw r28, 0x1e ; 30 1b03c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1b040: 9b 01 movw r18, r22 1b042: ac 01 movw r20, r24 1b044: c5 01 movw r24, r10 1b046: b4 01 movw r22, r8 1b048: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1b04c: 9b 01 movw r18, r22 1b04e: ac 01 movw r20, r24 1b050: c7 01 movw r24, r14 1b052: b6 01 movw r22, r12 1b054: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1b058: 6b 01 movw r12, r22 1b05a: 7c 01 movw r14, r24 1b05c: 0c 94 7e ce jmp 0x19cfc ; 0x19cfc // 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 : 1b060: 81 2c mov r8, r1 1b062: 91 2c mov r9, r1 1b064: 50 e8 ldi r21, 0x80 ; 128 1b066: a5 2e mov r10, r21 1b068: 5f e3 ldi r21, 0x3F ; 63 1b06a: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1b06c: 11 11 cpse r17, r1 1b06e: 0c 94 58 ce jmp 0x19cb0 ; 0x19cb0 ((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; 1b072: 20 e0 ldi r18, 0x00 ; 0 1b074: 30 e0 ldi r19, 0x00 ; 0 1b076: 40 e8 ldi r20, 0x80 ; 128 1b078: 5f e3 ldi r21, 0x3F ; 63 1b07a: ea cf rjmp .-44 ; 0x1b050 } // 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) { 1b07c: 11 11 cpse r17, r1 1b07e: b4 cf rjmp .-152 ; 0x1afe8 1b080: 0c 94 7e ce jmp 0x19cfc ; 0x19cfc float a = (r == 1) ? 1.f : 1b084: 81 2c mov r8, r1 1b086: 91 2c mov r9, r1 1b088: 40 e8 ldi r20, 0x80 ; 128 1b08a: a4 2e mov r10, r20 1b08c: 4f e3 ldi r20, 0x3F ; 63 1b08e: 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) { 1b090: 11 11 cpse r17, r1 1b092: be cf rjmp .-132 ; 0x1b010 1b094: 0c 94 7e ce jmp 0x19cfc ; 0x19cfc 0001b098 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1b098: cf 93 push r28 1b09a: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1b09c: 86 ea ldi r24, 0xA6 ; 166 1b09e: 9c e0 ldi r25, 0x0C ; 12 1b0a0: 0f 94 3c a1 call 0x34278 ; 0x34278 return ((status & components) == components); 1b0a4: 98 2f mov r25, r24 1b0a6: 9c 23 and r25, r28 1b0a8: 81 e0 ldi r24, 0x01 ; 1 1b0aa: 9c 13 cpse r25, r28 1b0ac: 80 e0 ldi r24, 0x00 ; 0 } 1b0ae: cf 91 pop r28 1b0b0: 08 95 ret 0001b0b2 : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1b0b2: 61 e0 ldi r22, 0x01 ; 1 1b0b4: 88 ea ldi r24, 0xA8 ; 168 1b0b6: 9d e0 ldi r25, 0x0D ; 13 1b0b8: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b0bc: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (farm_mode) { 1b0c0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1b0c4: 88 23 and r24, r24 1b0c6: 41 f0 breq .+16 ; 0x1b0d8 oCheckMode = ClCheckMode::_Strict; 1b0c8: 82 e0 ldi r24, 0x02 ; 2 1b0ca: 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); 1b0ce: 62 e0 ldi r22, 0x02 ; 2 1b0d0: 88 ea ldi r24, 0xA8 ; 168 1b0d2: 9d e0 ldi r25, 0x0D ; 13 1b0d4: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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); 1b0d8: 68 e2 ldi r22, 0x28 ; 40 1b0da: 87 ea ldi r24, 0xA7 ; 167 1b0dc: 9d e0 ldi r25, 0x0D ; 13 1b0de: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b0e2: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1b0e6: 60 e9 ldi r22, 0x90 ; 144 1b0e8: 71 e0 ldi r23, 0x01 ; 1 1b0ea: 85 ea ldi r24, 0xA5 ; 165 1b0ec: 9d e0 ldi r25, 0x0D ; 13 1b0ee: 0e 94 56 6f call 0xdeac ; 0xdeac oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1b0f2: 61 e0 ldi r22, 0x01 ; 1 1b0f4: 84 ea ldi r24, 0xA4 ; 164 1b0f6: 9d e0 ldi r25, 0x0D ; 13 1b0f8: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b0fc: 80 93 b8 03 sts 0x03B8, r24 ; 0x8003b8 oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1b100: 61 e0 ldi r22, 0x01 ; 1 1b102: 83 ea ldi r24, 0xA3 ; 163 1b104: 9d e0 ldi r25, 0x0D ; 13 1b106: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b10a: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1b10e: 61 e0 ldi r22, 0x01 ; 1 1b110: 82 ea ldi r24, 0xA2 ; 162 1b112: 9d e0 ldi r25, 0x0D ; 13 1b114: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b118: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1b11c: 61 e0 ldi r22, 0x01 ; 1 1b11e: 80 e2 ldi r24, 0x20 ; 32 1b120: 9c e0 ldi r25, 0x0C ; 12 1b122: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b126: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc } 1b12a: 08 95 ret 0001b12c
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1b12c: cf 93 push r28 1b12e: df 93 push r29 1b130: 00 d0 rcall .+0 ; 0x1b132 1b132: 00 d0 rcall .+0 ; 0x1b134 1b134: 00 d0 rcall .+0 ; 0x1b136 1b136: 1f 92 push r1 1b138: cd b7 in r28, 0x3d ; 61 1b13a: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1b13c: 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); 1b13e: 84 b5 in r24, 0x24 ; 36 1b140: 82 60 ori r24, 0x02 ; 2 1b142: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1b144: 84 b5 in r24, 0x24 ; 36 1b146: 81 60 ori r24, 0x01 ; 1 1b148: 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); 1b14a: 85 b5 in r24, 0x25 ; 37 1b14c: 82 60 ori r24, 0x02 ; 2 1b14e: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1b150: 85 b5 in r24, 0x25 ; 37 1b152: 81 60 ori r24, 0x01 ; 1 1b154: 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); 1b156: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b15a: 81 60 ori r24, 0x01 ; 1 1b15c: 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; 1b160: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1b164: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b168: 82 60 ori r24, 0x02 ; 2 1b16a: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1b16e: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b172: 81 60 ori r24, 0x01 ; 1 1b174: 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); 1b178: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1b17c: 81 60 ori r24, 0x01 ; 1 1b17e: 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); 1b182: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1b186: 84 60 ori r24, 0x04 ; 4 1b188: 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); 1b18c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1b190: 81 60 ori r24, 0x01 ; 1 1b192: 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 1b196: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b19a: 82 60 ori r24, 0x02 ; 2 1b19c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1b1a0: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1a4: 81 60 ori r24, 0x01 ; 1 1b1a6: 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 1b1aa: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1b1ae: 81 60 ori r24, 0x01 ; 1 1b1b0: 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 1b1b4: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1b8: 82 60 ori r24, 0x02 ; 2 1b1ba: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1b1be: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1c2: 81 60 ori r24, 0x01 ; 1 1b1c4: 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 1b1c8: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1b1cc: 81 60 ori r24, 0x01 ; 1 1b1ce: 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 1b1d2: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1d6: 82 60 ori r24, 0x02 ; 2 1b1d8: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1b1dc: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1e0: 81 60 ori r24, 0x01 ; 1 1b1e2: 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 1b1e6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1b1ea: 81 60 ori r24, 0x01 ; 1 1b1ec: 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); 1b1f0: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b1f4: 84 60 ori r24, 0x04 ; 4 1b1f6: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1b1fa: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b1fe: 82 60 ori r24, 0x02 ; 2 1b200: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1b204: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b208: 81 60 ori r24, 0x01 ; 1 1b20a: 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); 1b20e: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b212: 80 68 ori r24, 0x80 ; 128 1b214: 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; 1b218: 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) { 1b21c: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b21e: f8 94 cli wdt_reset(); 1b220: a8 95 wdr MCUSR &= ~_BV(WDRF); 1b222: 84 b7 in r24, 0x34 ; 52 1b224: 87 7f andi r24, 0xF7 ; 247 1b226: 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" ); 1b228: 0f b6 in r0, 0x3f ; 63 1b22a: f8 94 cli 1b22c: a8 95 wdr 1b22e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b232: 88 61 ori r24, 0x18 ; 24 1b234: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b238: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b23c: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b23e: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1b240: 9f b7 in r25, 0x3f ; 63 1b242: 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 1b244: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1b248: 84 e0 ldi r24, 0x04 ; 4 1b24a: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1b252: 81 60 ori r24, 0x01 ; 1 1b254: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b25c: 8d 7f andi r24, 0xFD ; 253 1b25e: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b266: 8b 7f andi r24, 0xFB ; 251 1b268: 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; 1b26c: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1b270: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1b272: 5b 98 cbi 0x0b, 3 ; 11 SET_OUTPUT(LCD_PINS_RS); 1b274: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1b276: 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); 1b278: 52 9a sbi 0x0a, 2 ; 10 SET_OUTPUT(LCD_PINS_D5); 1b27a: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1b27c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b280: 80 68 ori r24, 0x80 ; 128 1b282: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1b286: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1b288: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.513> 1b28c: 88 60 ori r24, 0x08 ; 8 1b28e: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.513> 1b292: 2f ef ldi r18, 0xFF ; 255 1b294: 30 e7 ldi r19, 0x70 ; 112 1b296: 82 e0 ldi r24, 0x02 ; 2 1b298: 21 50 subi r18, 0x01 ; 1 1b29a: 30 40 sbci r19, 0x00 ; 0 1b29c: 80 40 sbci r24, 0x00 ; 0 1b29e: e1 f7 brne .-8 ; 0x1b298 1b2a0: 00 c0 rjmp .+0 ; 0x1b2a2 1b2a2: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1b2a4: 81 e0 ldi r24, 0x01 ; 1 1b2a6: 0e 94 67 6a call 0xd4ce ; 0xd4ce fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1b2aa: 8f e0 ldi r24, 0x0F ; 15 1b2ac: 9c e6 ldi r25, 0x6C ; 108 1b2ae: 90 93 c9 03 sts 0x03C9, r25 ; 0x8003c9 <_lcdout+0x9> 1b2b2: 80 93 c8 03 sts 0x03C8, r24 ; 0x8003c8 <_lcdout+0x8> 1b2b6: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_lcdout+0xb> 1b2ba: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_lcdout+0xa> 1b2be: 12 e0 ldi r17, 0x02 ; 2 1b2c0: 10 93 c3 03 sts 0x03C3, r17 ; 0x8003c3 <_lcdout+0x3> 1b2c4: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_lcdout+0xd> 1b2c8: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1b2cc: 0e 94 a8 6a call 0xd550 ; 0xd550 lcd_longpress_func = menu_lcd_longpress_func; 1b2d0: 80 ee ldi r24, 0xE0 ; 224 1b2d2: 95 eb ldi r25, 0xB5 ; 181 1b2d4: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 1b2d8: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1b2dc: 8f e3 ldi r24, 0x3F ; 63 1b2de: 9b ee ldi r25, 0xEB ; 235 1b2e0: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 1b2e4: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 menu_menu = lcd_status_screen; 1b2e8: 89 e0 ldi r24, 0x09 ; 9 1b2ea: 97 e3 ldi r25, 0x37 ; 55 1b2ec: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 1b2f0: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 SET_INPUT(BTN_EN1); 1b2f4: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b2f8: 8b 7f andi r24, 0xFB ; 251 1b2fa: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1b2fe: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b302: 8d 7f andi r24, 0xFD ; 253 1b304: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1b308: 9f b7 in r25, 0x3f ; 63 1b30a: f8 94 cli 1b30c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b310: 84 60 ori r24, 0x04 ; 4 1b312: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b316: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1b318: 9f b7 in r25, 0x3f ; 63 1b31a: f8 94 cli 1b31c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b320: 82 60 ori r24, 0x02 ; 2 1b322: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b326: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1b328: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b32c: 8f 7b andi r24, 0xBF ; 191 1b32e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1b332: 9f b7 in r25, 0x3f ; 63 1b334: f8 94 cli 1b336: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b33a: 80 64 ori r24, 0x40 ; 64 1b33c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b340: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1b342: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b346: 8e 7f andi r24, 0xFE ; 254 1b348: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1b34c: 9f b7 in r25, 0x3f ; 63 1b34e: f8 94 cli 1b350: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b354: 81 60 ori r24, 0x01 ; 1 1b356: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b35a: 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); 1b35c: af e9 ldi r26, 0x9F ; 159 1b35e: bf e0 ldi r27, 0x0F ; 15 1b360: 11 97 sbiw r26, 0x01 ; 1 1b362: f1 f7 brne .-4 ; 0x1b360 1b364: 00 c0 rjmp .+0 ; 0x1b366 1b366: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1b368: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1b36c: 80 95 com r24 1b36e: 81 70 andi r24, 0x01 ; 1 1b370: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1b374: 44 e1 ldi r20, 0x14 ; 20 1b376: 50 e0 ldi r21, 0x00 ; 0 1b378: 6b e0 ldi r22, 0x0B ; 11 1b37a: 7c e6 ldi r23, 0x6C ; 108 1b37c: 89 e0 ldi r24, 0x09 ; 9 1b37e: 95 e0 ldi r25, 0x05 ; 5 1b380: 0f 94 29 9f call 0x33e52 ; 0x33e52 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b384: 84 b1 in r24, 0x04 ; 4 1b386: 81 7f andi r24, 0xF1 ; 241 1b388: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1b38a: 84 b1 in r24, 0x04 ; 4 1b38c: 87 60 ori r24, 0x07 ; 7 1b38e: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b390: 85 b1 in r24, 0x05 ; 5 1b392: 81 7f andi r24, 0xF1 ; 241 1b394: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1b396: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1b398: 80 e5 ldi r24, 0x50 ; 80 1b39a: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1b39c: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1b39e: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1b3a2: 8d e9 ldi r24, 0x9D ; 157 1b3a4: 96 e8 ldi r25, 0x86 ; 134 1b3a6: 9f 93 push r25 1b3a8: 8f 93 push r24 1b3aa: 84 ea ldi r24, 0xA4 ; 164 1b3ac: 96 e8 ldi r25, 0x86 ; 134 1b3ae: 9f 93 push r25 1b3b0: 8f 93 push r24 1b3b2: 0e 94 d5 69 call 0xd3aa ; 0xd3aa static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1b3b6: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b3ba: 84 60 ori r24, 0x04 ; 4 1b3bc: 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)); 1b3c0: 60 e0 ldi r22, 0x00 ; 0 1b3c2: 87 ed ldi r24, 0xD7 ; 215 1b3c4: 9e e0 ldi r25, 0x0E ; 14 1b3c6: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b3ca: 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); 1b3ce: 60 e0 ldi r22, 0x00 ; 0 1b3d0: 88 e0 ldi r24, 0x08 ; 8 1b3d2: 9f e0 ldi r25, 0x0F ; 15 1b3d4: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b3d8: 80 93 04 05 sts 0x0504, r24 ; 0x800504 MYSERIAL.begin(BAUDRATE); 1b3dc: 0e 94 5f b0 call 0x160be ; 0x160be fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1b3e0: 86 ed ldi r24, 0xD6 ; 214 1b3e2: 90 e7 ldi r25, 0x70 ; 112 1b3e4: 90 93 27 04 sts 0x0427, r25 ; 0x800427 <_uartout+0x9> 1b3e8: 80 93 26 04 sts 0x0426, r24 ; 0x800426 <_uartout+0x8> 1b3ec: 10 92 29 04 sts 0x0429, r1 ; 0x800429 <_uartout+0xb> 1b3f0: 10 92 28 04 sts 0x0428, r1 ; 0x800428 <_uartout+0xa> 1b3f4: 10 93 21 04 sts 0x0421, r17 ; 0x800421 <_uartout+0x3> 1b3f8: 10 92 2b 04 sts 0x042B, r1 ; 0x80042b <_uartout+0xd> 1b3fc: 10 92 2a 04 sts 0x042A, r1 ; 0x80042a <_uartout+0xc> stdout = uartout; 1b400: 8e e1 ldi r24, 0x1E ; 30 1b402: 94 e0 ldi r25, 0x04 ; 4 1b404: 90 93 01 17 sts 0x1701, r25 ; 0x801701 <__iob+0x3> 1b408: 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); 1b40c: 60 e0 ldi r22, 0x00 ; 0 1b40e: 84 ec ldi r24, 0xC4 ; 196 1b410: 9f e0 ldi r25, 0x0F ; 15 1b412: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b416: 80 93 ca 0d sts 0x0DCA, r24 ; 0x800dca if (farm_mode) { 1b41a: 0f 90 pop r0 1b41c: 0f 90 pop r0 1b41e: 0f 90 pop r0 1b420: 0f 90 pop r0 1b422: 88 23 and r24, r24 1b424: 79 f0 breq .+30 ; 0x1b444 no_response = true; //we need confirmation by recieving PRUSA thx 1b426: 81 e0 ldi r24, 0x01 ; 1 1b428: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 <_ZL11no_response.lto_priv.495> prusa_statistics(8); 1b42c: 88 e0 ldi r24, 0x08 ; 8 1b42e: 0f 94 5f 99 call 0x332be ; 0x332be #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1b432: 0e 94 5f b0 call 0x160be ; 0x160be fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1b436: 10 92 85 16 sts 0x1685, r1 ; 0x801685 1b43a: 61 e0 ldi r22, 0x01 ; 1 1b43c: 87 e8 ldi r24, 0x87 ; 135 1b43e: 9f e0 ldi r25, 0x0F ; 15 1b440: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1b444: 85 e9 ldi r24, 0x95 ; 149 1b446: 97 e8 ldi r25, 0x87 ; 135 1b448: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1b44c: 87 e7 ldi r24, 0x77 ; 119 1b44e: 9e e9 ldi r25, 0x9E ; 158 1b450: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1b454: 8e e7 ldi r24, 0x7E ; 126 1b456: 97 e8 ldi r25, 0x87 ; 135 1b458: 0f 94 25 a0 call 0x3404a ; 0x3404a // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1b45c: 60 e0 ldi r22, 0x00 ; 0 1b45e: 8c ea ldi r24, 0xAC ; 172 1b460: 9c e0 ldi r25, 0x0C ; 12 1b462: 0e 94 6e 6f call 0xdedc ; 0xdedc 1b466: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1b468: 0f 94 fa 63 call 0x2c7f4 ; 0x2c7f4 } MMU2::mmu2.Status(); 1b46c: 0f 94 ee 41 call 0x283dc ; 0x283dc } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1b470: 82 ed ldi r24, 0xD2 ; 210 1b472: 96 e8 ldi r25, 0x86 ; 134 1b474: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1b478: 62 e0 ldi r22, 0x02 ; 2 1b47a: 86 ed ldi r24, 0xD6 ; 214 1b47c: 9e e0 ldi r25, 0x0E ; 14 1b47e: 0e 94 6e 6f call 0xdedc ; 0xdedc if (status == (uint8_t)EEPROM::Enabled) 1b482: 81 30 cpi r24, 0x01 ; 1 1b484: 09 f0 breq .+2 ; 0x1b488 1b486: 74 c0 rjmp .+232 ; 0x1b570 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1b488: 83 e7 ldi r24, 0x73 ; 115 1b48a: 9b e5 ldi r25, 0x5B ; 91 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1b48c: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1b490: 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); 1b492: 10 ff sbrs r17, 0 1b494: 04 c0 rjmp .+8 ; 0x1b49e 1b496: 85 ea ldi r24, 0xA5 ; 165 1b498: 99 e6 ldi r25, 0x69 ; 105 1b49a: 0f 94 25 a0 call 0x3404a ; 0x3404a if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1b49e: 11 ff sbrs r17, 1 1b4a0: 04 c0 rjmp .+8 ; 0x1b4aa 1b4a2: 85 e9 ldi r24, 0x95 ; 149 1b4a4: 99 e6 ldi r25, 0x69 ; 105 1b4a6: 0f 94 25 a0 call 0x3404a ; 0x3404a if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1b4aa: 12 ff sbrs r17, 2 1b4ac: 04 c0 rjmp .+8 ; 0x1b4b6 1b4ae: 84 e8 ldi r24, 0x84 ; 132 1b4b0: 99 e6 ldi r25, 0x69 ; 105 1b4b2: 0f 94 25 a0 call 0x3404a ; 0x3404a if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1b4b6: 13 ff sbrs r17, 3 1b4b8: 04 c0 rjmp .+8 ; 0x1b4c2 1b4ba: 84 e7 ldi r24, 0x74 ; 116 1b4bc: 99 e6 ldi r25, 0x69 ; 105 1b4be: 0f 94 25 a0 call 0x3404a ; 0x3404a if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1b4c2: 15 ff sbrs r17, 5 1b4c4: 04 c0 rjmp .+8 ; 0x1b4ce 1b4c6: 84 e6 ldi r24, 0x64 ; 100 1b4c8: 99 e6 ldi r25, 0x69 ; 105 1b4ca: 0f 94 25 a0 call 0x3404a ; 0x3404a MCUSR = 0; 1b4ce: 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; 1b4d0: 87 e7 ldi r24, 0x77 ; 119 1b4d2: 9e e9 ldi r25, 0x9E ; 158 1b4d4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1b4d8: 84 e5 ldi r24, 0x54 ; 84 1b4da: 99 e6 ldi r25, 0x69 ; 105 1b4dc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1b4e0: 8a e6 ldi r24, 0x6A ; 106 1b4e2: 97 e8 ldi r25, 0x87 ; 135 1b4e4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1b4e8: 88 e4 ldi r24, 0x48 ; 72 1b4ea: 99 e6 ldi r25, 0x69 ; 105 1b4ec: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1b4f0: 82 e6 ldi r24, 0x62 ; 98 1b4f2: 97 e8 ldi r25, 0x87 ; 135 1b4f4: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 #endif #endif SERIAL_ECHO_START; 1b4f8: 87 e7 ldi r24, 0x77 ; 119 1b4fa: 9e e9 ldi r25, 0x9E ; 158 1b4fc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1b500: 89 e3 ldi r24, 0x39 ; 57 1b502: 99 e6 ldi r25, 0x69 ; 105 1b504: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1b508: 80 91 fa 16 lds r24, 0x16FA ; 0x8016fa <__brkval> 1b50c: 90 91 fb 16 lds r25, 0x16FB ; 0x8016fb <__brkval+0x1> 1b510: fe 01 movw r30, r28 1b512: 31 96 adiw r30, 0x01 ; 1 1b514: 7f 01 movw r14, r30 1b516: bf 01 movw r22, r30 1b518: 00 97 sbiw r24, 0x00 ; 0 1b51a: 69 f1 breq .+90 ; 0x1b576 1b51c: 68 1b sub r22, r24 1b51e: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1b520: 07 2e mov r0, r23 1b522: 00 0c add r0, r0 1b524: 88 0b sbc r24, r24 1b526: 99 0b sbc r25, r25 1b528: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1b52c: 82 e2 ldi r24, 0x22 ; 34 1b52e: 99 e6 ldi r25, 0x69 ; 105 1b530: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1b534: 80 ee ldi r24, 0xE0 ; 224 1b536: 96 e0 ldi r25, 0x06 ; 6 1b538: 0f 94 00 42 call 0x28400 ; 0x28400 #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); 1b53c: 6c ef ldi r22, 0xFC ; 252 1b53e: 70 e0 ldi r23, 0x00 ; 0 1b540: 8e ee ldi r24, 0xEE ; 238 1b542: 9e e0 ldi r25, 0x0E ; 14 1b544: 0e 94 56 6f call 0xdeac ; 0xdeac 1b548: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1b54a: 6b ec ldi r22, 0xCB ; 203 1b54c: 70 e0 ldi r23, 0x00 ; 0 1b54e: 8c ee ldi r24, 0xEC ; 236 1b550: 9e e0 ldi r25, 0x0E ; 14 1b552: 0e 94 56 6f call 0xdeac ; 0xdeac if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1b556: 0c 3f cpi r16, 0xFC ; 252 1b558: 11 05 cpc r17, r1 1b55a: 09 f0 breq .+2 ; 0x1b55e 1b55c: 18 c6 rjmp .+3120 ; 0x1c18e if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1b55e: 01 e0 ldi r16, 0x01 ; 1 1b560: 8b 3c cpi r24, 0xCB ; 203 1b562: 91 05 cpc r25, r1 1b564: 09 f4 brne .+2 ; 0x1b568 1b566: 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(); 1b568: 0e 94 69 75 call 0xead2 ; 0xead2 1b56c: b8 2e mov r11, r24 1b56e: 17 c6 rjmp .+3118 ; 0x1c19e 1b570: 8d e6 ldi r24, 0x6D ; 109 1b572: 9b e5 ldi r25, 0x5B ; 91 1b574: 8b cf rjmp .-234 ; 0x1b48c 1b576: 64 50 subi r22, 0x04 ; 4 1b578: 77 41 sbci r23, 0x17 ; 23 1b57a: d2 cf rjmp .-92 ; 0x1b520 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1b57c: 81 e3 ldi r24, 0x31 ; 49 1b57e: 91 e0 ldi r25, 0x01 ; 1 1b580: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.431+0x1> 1b584: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.431> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1b588: c0 90 d9 03 lds r12, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 1b58c: d0 90 da 03 lds r13, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 1b590: c6 01 movw r24, r12 1b592: 0e 94 b6 bd call 0x17b6c ; 0x17b6c 1b596: 20 e0 ldi r18, 0x00 ; 0 1b598: 30 e8 ldi r19, 0x80 ; 128 1b59a: 48 e9 ldi r20, 0x98 ; 152 1b59c: 53 e4 ldi r21, 0x43 ; 67 1b59e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1b5a2: 18 16 cp r1, r24 1b5a4: 44 f4 brge .+16 ; 0x1b5b6 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1b5a6: 20 e1 ldi r18, 0x10 ; 16 1b5a8: c2 0e add r12, r18 1b5aa: d1 1c adc r13, r1 1b5ac: d0 92 da 03 sts 0x03DA, r13 ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 1b5b0: c0 92 d9 03 sts 0x03D9, r12 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 1b5b4: e9 cf rjmp .-46 ; 0x1b588 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1b5b6: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b5ba: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b5be: 0f 94 76 16 call 0x22cec ; 0x22cec 1b5c2: 20 e0 ldi r18, 0x00 ; 0 1b5c4: 30 e0 ldi r19, 0x00 ; 0 1b5c6: 40 ef ldi r20, 0xF0 ; 240 1b5c8: 51 e4 ldi r21, 0x41 ; 65 1b5ca: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1b5ce: 87 ff sbrs r24, 7 1b5d0: 0a c0 rjmp .+20 ; 0x1b5e6 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1b5d2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b5d6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b5da: 40 97 sbiw r24, 0x10 ; 16 1b5dc: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b5e0: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b5e4: e8 cf rjmp .-48 ; 0x1b5b6 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1b5e6: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b5ea: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b5ee: 0f 94 76 16 call 0x22cec ; 0x22cec 1b5f2: 20 e0 ldi r18, 0x00 ; 0 1b5f4: 30 e0 ldi r19, 0x00 ; 0 1b5f6: 4a ef ldi r20, 0xFA ; 250 1b5f8: 52 e4 ldi r21, 0x42 ; 66 1b5fa: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1b5fe: 18 16 cp r1, r24 1b600: 54 f4 brge .+20 ; 0x1b616 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1b602: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b606: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b60a: 40 96 adiw r24, 0x10 ; 16 1b60c: 90 93 d8 03 sts 0x03D8, r25 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b610: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b614: e8 cf rjmp .-48 ; 0x1b5e6 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1b616: 9f b7 in r25, 0x3f ; 63 1b618: f8 94 cli TCNT0 = 0; 1b61a: 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; 1b61c: 8f ef ldi r24, 0xFF ; 255 1b61e: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1b620: 83 e3 ldi r24, 0x33 ; 51 1b622: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1b624: 12 e0 ldi r17, 0x02 ; 2 1b626: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1b628: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b62c: 81 60 ori r24, 0x01 ; 1 1b62e: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1b632: 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; 1b634: 80 e8 ldi r24, 0x80 ; 128 1b636: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1b63a: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1b63e: 84 60 ori r24, 0x04 ; 4 1b640: 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; 1b644: 2f b7 in r18, 0x3f ; 63 1b646: f8 94 cli SET_OUTPUT(BEEPER); 1b648: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b64c: 84 60 ori r24, 0x04 ; 4 1b64e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1b652: 9f b7 in r25, 0x3f ; 63 1b654: f8 94 cli 1b656: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b65a: 8b 7f andi r24, 0xFB ; 251 1b65c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b660: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1b662: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b666: 80 62 ori r24, 0x20 ; 32 1b668: 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); 1b66c: 81 e0 ldi r24, 0x01 ; 1 1b66e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1b672: 85 e1 ldi r24, 0x15 ; 21 1b674: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1b678: 8f ef ldi r24, 0xFF ; 255 1b67a: 90 e0 ldi r25, 0x00 ; 0 1b67c: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1b680: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1b684: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1b688: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1b68c: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1b690: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1b694: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1b698: 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")); 1b69a: 80 ee ldi r24, 0xE0 ; 224 1b69c: 96 e8 ldi r25, 0x86 ; 134 1b69e: 0f 94 25 a0 call 0x3404a ; 0x3404a DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1b6a2: 8f e5 ldi r24, 0x5F ; 95 1b6a4: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1b6a8: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1b6ac: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1b6b0: 80 64 ori r24, 0x40 ; 64 1b6b2: 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); 1b6b6: 8f e9 ldi r24, 0x9F ; 159 1b6b8: 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(); 1b6bc: 0e 94 70 7e call 0xfce0 ; 0xfce0 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1b6c0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b6c2: f8 94 cli // CTC TCCRxB &= ~(1< 1b6c8: 8f 7e andi r24, 0xEF ; 239 1b6ca: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1b6d2: 88 60 ori r24, 0x08 ; 8 1b6d4: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1b6dc: 8d 7f andi r24, 0xFD ; 253 1b6de: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1b6e6: 8e 7f andi r24, 0xFE ; 254 1b6e8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1b6f0: 8f 73 andi r24, 0x3F ; 63 1b6f2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1b6fa: 8f 7c andi r24, 0xCF ; 207 1b6fc: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1b704: 84 60 ori r24, 0x04 ; 4 1b706: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b70e: 8d 7f andi r24, 0xFD ; 253 1b710: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b718: 8e 7f andi r24, 0xFE ; 254 1b71a: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1b71e: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1b722: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1b726: 2b ee ldi r18, 0xEB ; 235 1b728: 31 e4 ldi r19, 0x41 ; 65 1b72a: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1b72e: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1b732: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1b734: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1b738: 82 60 ori r24, 0x02 ; 2 1b73a: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b73e: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1b740: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 block_buffer_tail = 0; 1b744: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 memset(position, 0, sizeof(position)); // clear position 1b748: 80 e1 ldi r24, 0x10 ; 16 1b74a: e6 ea ldi r30, 0xA6 ; 166 1b74c: f6 e0 ldi r31, 0x06 ; 6 1b74e: df 01 movw r26, r30 1b750: 28 2f mov r18, r24 1b752: 1d 92 st X+, r1 1b754: 2a 95 dec r18 1b756: e9 f7 brne .-6 ; 0x1b752 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1b758: e4 e0 ldi r30, 0x04 ; 4 1b75a: f4 e0 ldi r31, 0x04 ; 4 1b75c: df 01 movw r26, r30 1b75e: 28 2f mov r18, r24 1b760: 1d 92 st X+, r1 1b762: 2a 95 dec r18 1b764: e9 f7 brne .-6 ; 0x1b760 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1b766: e4 ef ldi r30, 0xF4 ; 244 1b768: f3 e0 ldi r31, 0x03 ; 3 1b76a: df 01 movw r26, r30 1b76c: 1d 92 st X+, r1 1b76e: 8a 95 dec r24 1b770: e9 f7 brne .-6 ; 0x1b76c previous_nominal_speed = 0.0; 1b772: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 1b776: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 1b77a: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 1b77e: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> plan_reset_next_e_queue = false; 1b782: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = false; 1b786: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1b78a: 84 e0 ldi r24, 0x04 ; 4 1b78c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1b790: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b794: 86 fd sbrc r24, 6 1b796: c6 c0 rjmp .+396 ; 0x1b924 1b798: bf ef ldi r27, 0xFF ; 255 1b79a: e3 ed ldi r30, 0xD3 ; 211 1b79c: f0 e3 ldi r31, 0x30 ; 48 1b79e: b1 50 subi r27, 0x01 ; 1 1b7a0: e0 40 sbci r30, 0x00 ; 0 1b7a2: f0 40 sbci r31, 0x00 ; 0 1b7a4: e1 f7 brne .-8 ; 0x1b79e 1b7a6: 00 c0 rjmp .+0 ; 0x1b7a8 1b7a8: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1b7aa: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b7ae: 86 fd sbrc r24, 6 1b7b0: b9 c0 rjmp .+370 ; 0x1b924 { lcd_clear(); 1b7b2: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_P(PSTR("Factory RESET")); 1b7b6: 8a e3 ldi r24, 0x3A ; 58 1b7b8: 97 e8 ldi r25, 0x87 ; 135 1b7ba: 0e 94 e7 69 call 0xd3ce ; 0xd3ce SET_OUTPUT(BEEPER); 1b7be: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b7c2: 84 60 ori r24, 0x04 ; 4 1b7c4: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1b7c8: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1b7cc: 82 30 cpi r24, 0x02 ; 2 1b7ce: 41 f0 breq .+16 ; 0x1b7e0 WRITE(BEEPER, HIGH); 1b7d0: 9f b7 in r25, 0x3f ; 63 1b7d2: f8 94 cli 1b7d4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7d8: 84 60 ori r24, 0x04 ; 4 1b7da: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7de: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1b7e0: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b7e4: 86 ff sbrs r24, 6 1b7e6: fc cf rjmp .-8 ; 0x1b7e0 WRITE(BEEPER, LOW); 1b7e8: 9f b7 in r25, 0x3f ; 63 1b7ea: f8 94 cli 1b7ec: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7f0: 8b 7f andi r24, 0xFB ; 251 1b7f2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7f6: 9f bf out 0x3f, r25 ; 63 1b7f8: 2f ef ldi r18, 0xFF ; 255 1b7fa: 37 ea ldi r19, 0xA7 ; 167 1b7fc: 81 e6 ldi r24, 0x61 ; 97 1b7fe: 21 50 subi r18, 0x01 ; 1 1b800: 30 40 sbci r19, 0x00 ; 0 1b802: 80 40 sbci r24, 0x00 ; 0 1b804: e1 f7 brne .-8 ; 0x1b7fe 1b806: 00 c0 rjmp .+0 ; 0x1b808 1b808: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1b80a: 80 e2 ldi r24, 0x20 ; 32 1b80c: 97 e8 ldi r25, 0x87 ; 135 1b80e: 9a 83 std Y+2, r25 ; 0x02 1b810: 89 83 std Y+1, r24 ; 0x01 1b812: 85 e1 ldi r24, 0x15 ; 21 1b814: 97 e8 ldi r25, 0x87 ; 135 1b816: 9c 83 std Y+4, r25 ; 0x04 1b818: 8b 83 std Y+3, r24 ; 0x03 1b81a: 87 e0 ldi r24, 0x07 ; 7 1b81c: 97 e8 ldi r25, 0x87 ; 135 1b81e: 9e 83 std Y+6, r25 ; 0x06 1b820: 8d 83 std Y+5, r24 ; 0x05 1b822: 8a ef ldi r24, 0xFA ; 250 1b824: 96 e8 ldi r25, 0x86 ; 134 1b826: 98 87 std Y+8, r25 ; 0x08 1b828: 8f 83 std Y+7, r24 ; 0x07 1b82a: 81 ef ldi r24, 0xF1 ; 241 1b82c: 96 e8 ldi r25, 0x86 ; 134 1b82e: 9a 87 std Y+10, r25 ; 0x0a 1b830: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1b832: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_putc_at(0, 0, '>'); 1b836: 4e e3 ldi r20, 0x3E ; 62 1b838: 60 e0 ldi r22, 0x00 ; 0 1b83a: 80 e0 ldi r24, 0x00 ; 0 1b83c: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_consume_click(); 1b840: 0e 94 14 6c call 0xd828 ; 0xd828 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1b844: 10 e0 ldi r17, 0x00 ; 0 1b846: d1 2c mov r13, r1 1b848: 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]); 1b84a: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b84e: f6 01 movw r30, r12 1b850: e8 0f add r30, r24 1b852: f1 1d adc r31, r1 1b854: 87 fd sbrc r24, 7 1b856: fa 95 dec r31 1b858: ee 0f add r30, r30 1b85a: ff 1f adc r31, r31 1b85c: ee 0d add r30, r14 1b85e: ff 1d adc r31, r15 1b860: 40 81 ld r20, Z 1b862: 51 81 ldd r21, Z+1 ; 0x01 1b864: 6c 2d mov r22, r12 1b866: 81 e0 ldi r24, 0x01 ; 1 1b868: 0e 94 10 6a call 0xd420 ; 0xd420 1b86c: 9f ef ldi r25, 0xFF ; 255 1b86e: c9 1a sub r12, r25 1b870: 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++) { 1b872: a4 e0 ldi r26, 0x04 ; 4 1b874: ca 16 cp r12, r26 1b876: d1 04 cpc r13, r1 1b878: 41 f7 brne .-48 ; 0x1b84a lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1b87a: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1b87e: 81 e0 ldi r24, 0x01 ; 1 1b880: 0e 94 89 7a call 0xf512 ; 0xf512 if (lcd_encoder) { 1b884: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1b888: 90 91 07 05 lds r25, 0x0507 ; 0x800507 1b88c: 00 97 sbiw r24, 0x00 ; 0 1b88e: 71 f1 breq .+92 ; 0x1b8ec if (lcd_encoder < 0) { 1b890: 97 ff sbrs r25, 7 1b892: 12 c0 rjmp .+36 ; 0x1b8b8 cursor_pos--; 1b894: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1b896: 14 30 cpi r17, 0x04 ; 4 1b898: 0c f4 brge .+2 ; 0x1b89c 1b89a: 3a c2 rjmp .+1140 ; 0x1bd10 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b89c: 87 e0 ldi r24, 0x07 ; 7 1b89e: 0f 94 fd 2c call 0x259fa ; 0x259fa if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1b8a2: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b8a6: 18 16 cp r1, r24 1b8a8: 2c f0 brlt .+10 ; 0x1b8b4 first++; 1b8aa: 8f 5f subi r24, 0xFF ; 255 1b8ac: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1b8b0: 0e 94 2f 6a call 0xd45e ; 0xd45e if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1b8b4: 13 e0 ldi r17, 0x03 ; 3 1b8b6: 03 c0 rjmp .+6 ; 0x1b8be if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b8b8: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1b8ba: 14 30 cpi r17, 0x04 ; 4 1b8bc: 78 f7 brcc .-34 ; 0x1b89c if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1b8be: 49 ee ldi r20, 0xE9 ; 233 1b8c0: 56 e8 ldi r21, 0x86 ; 134 1b8c2: 60 e0 ldi r22, 0x00 ; 0 1b8c4: 80 e0 ldi r24, 0x00 ; 0 1b8c6: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(0, cursor_pos); 1b8ca: 61 2f mov r22, r17 1b8cc: 80 e0 ldi r24, 0x00 ; 0 1b8ce: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_putc('>'); 1b8d2: 8e e3 ldi r24, 0x3E ; 62 1b8d4: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_encoder = 0; 1b8d8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1b8dc: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 1b8e0: 64 e6 ldi r22, 0x64 ; 100 1b8e2: 70 e0 ldi r23, 0x00 ; 0 1b8e4: 80 e0 ldi r24, 0x00 ; 0 1b8e6: 90 e0 ldi r25, 0x00 ; 0 1b8e8: 0f 94 d5 0d call 0x21baa ; 0x21baa } if (lcd_clicked()) { 1b8ec: 0e 94 19 6c call 0xd832 ; 0xd832 1b8f0: 88 23 and r24, r24 1b8f2: 09 f4 brne .+2 ; 0x1b8f6 1b8f4: a8 cf rjmp .-176 ; 0x1b846 return(cursor_pos + first); 1b8f6: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b8fa: 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(); 1b8fc: 0e 94 2f 6a call 0xd45e ; 0xd45e Sound_MakeCustom(100,0,false); 1b900: 40 e0 ldi r20, 0x00 ; 0 1b902: 70 e0 ldi r23, 0x00 ; 0 1b904: 60 e0 ldi r22, 0x00 ; 0 1b906: 84 e6 ldi r24, 0x64 ; 100 1b908: 90 e0 ldi r25, 0x00 ; 0 1b90a: 0f 94 0b 32 call 0x26416 ; 0x26416 switch (level) { 1b90e: 12 30 cpi r17, 0x02 ; 2 1b910: 09 f4 brne .+2 ; 0x1b914 1b912: 35 c2 rjmp .+1130 ; 0x1bd7e 1b914: 08 f0 brcs .+2 ; 0x1b918 1b916: 0d c2 rjmp .+1050 ; 0x1bd32 1b918: 11 23 and r17, r17 1b91a: 09 f4 brne .+2 ; 0x1b91e 1b91c: 28 c2 rjmp .+1104 ; 0x1bd6e 1b91e: 11 30 cpi r17, 0x01 ; 1 1b920: 09 f4 brne .+2 ; 0x1b924 1b922: 28 c2 rjmp .+1104 ; 0x1bd74 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1b924: 82 e0 ldi r24, 0x02 ; 2 1b926: 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); 1b92a: 60 e0 ldi r22, 0x00 ; 0 1b92c: 8f ef ldi r24, 0xFF ; 255 1b92e: 9f e0 ldi r25, 0x0F ; 15 1b930: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1b934: 61 e0 ldi r22, 0x01 ; 1 1b936: 8f e5 ldi r24, 0x5F ; 95 1b938: 9f e0 ldi r25, 0x0F ; 15 1b93a: 0e 94 6e 6f call 0xdedc ; 0xdedc void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1b93e: 0f 94 13 22 call 0x24426 ; 0x24426 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; 1b942: 85 e0 ldi r24, 0x05 ; 5 1b944: e8 eb ldi r30, 0xB8 ; 184 1b946: f2 e0 ldi r31, 0x02 ; 2 1b948: d7 01 movw r26, r14 1b94a: 01 90 ld r0, Z+ 1b94c: 0d 92 st X+, r0 1b94e: 8a 95 dec r24 1b950: e1 f7 brne .-8 ; 0x1b94a SET_OUTPUT(X_MS1_PIN); 1b952: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1b954: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1b956: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b95a: 80 68 ori r24, 0x80 ; 128 1b95c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1b960: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1b962: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b966: 80 64 ori r24, 0x40 ; 64 1b968: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1b96c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b970: 80 62 ori r24, 0x20 ; 32 1b972: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1b976: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b97a: 88 60 ori r24, 0x08 ; 8 1b97c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1b980: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b984: 80 61 ori r24, 0x10 ; 16 1b986: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b98a: 67 01 movw r12, r14 1b98c: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1b98e: f6 01 movw r30, r12 1b990: 61 91 ld r22, Z+ 1b992: 6f 01 movw r12, r30 1b994: 81 2f mov r24, r17 1b996: 0f 94 d6 21 call 0x243ac ; 0x243ac 1b99a: 1f 5f subi r17, 0xFF ; 255 1b99c: 15 30 cpi r17, 0x05 ; 5 1b99e: b9 f7 brne .-18 ; 0x1b98e microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1b9a0: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9a4: 82 60 ori r24, 0x02 ; 2 1b9a6: 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); 1b9aa: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9ae: 81 60 ori r24, 0x01 ; 1 1b9b0: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && (Y2_DIR_PIN > -1) SET_OUTPUT(Y2_DIR_PIN); #endif #endif #if defined(Z_DIR_PIN) && Z_DIR_PIN > -1 SET_OUTPUT(Z_DIR_PIN); 1b9b4: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9b8: 84 60 ori r24, 0x04 ; 4 1b9ba: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && (Z2_DIR_PIN > -1) SET_OUTPUT(Z2_DIR_PIN); #endif #endif #if defined(E0_DIR_PIN) && E0_DIR_PIN > -1 SET_OUTPUT(E0_DIR_PIN); 1b9be: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9c2: 80 64 ori r24, 0x40 ; 64 1b9c4: 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); 1b9c8: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1b9ca: 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); 1b9cc: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1b9ce: 16 9a sbi 0x02, 6 ; 2 SET_OUTPUT(Y2_ENABLE_PIN); if(!Y_ENABLE_ON) WRITE(Y2_ENABLE_PIN,HIGH); #endif #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 1b9d0: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1b9d2: 15 9a sbi 0x02, 5 ; 2 SET_OUTPUT(Z2_ENABLE_PIN); if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH); #endif #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 1b9d4: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1b9d6: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1b9d8: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1b9da: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1b9dc: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1b9de: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1b9e0: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1b9e2: 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); 1b9e4: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1b9e6: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1b9e8: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1b9ea: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1b9ec: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1b9ee: 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(); 1b9f0: 17 9a sbi 0x02, 7 ; 2 1b9f2: 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); 1b9f6: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1b9f8: 41 98 cbi 0x08, 1 ; 8 #endif //DEBUG_YSTEP_DUP_PIN #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1) SET_OUTPUT(Y2_STEP_PIN); WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN); #endif disable_y(); 1b9fa: 16 9a sbi 0x02, 6 ; 2 1b9fc: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1ba00: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1ba02: 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); 1ba04: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1ba06: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1ba08: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1ba0e: 8f 7e andi r24, 0xEF ; 239 1ba10: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1ba18: 88 60 ori r24, 0x08 ; 8 1ba1a: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1ba22: 8d 7f andi r24, 0xFD ; 253 1ba24: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1ba2c: 8e 7f andi r24, 0xFE ; 254 1ba2e: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1ba36: 8f 73 andi r24, 0x3F ; 63 1ba38: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1ba40: 8f 7c andi r24, 0xCF ; 207 1ba42: 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< 1ba4a: 88 7f andi r24, 0xF8 ; 248 1ba4c: 82 60 ori r24, 0x02 ; 2 1ba4e: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1ba52: 80 e0 ldi r24, 0x00 ; 0 1ba54: 90 e4 ldi r25, 0x40 ; 64 1ba56: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1ba5a: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1ba5e: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1ba62: 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; 1ba66: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 1ba6a: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> nextAdvanceISR = ADV_NEVER; 1ba6e: 8f ef ldi r24, 0xFF ; 255 1ba70: 9f ef ldi r25, 0xFF ; 255 1ba72: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 1ba76: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> main_Rate = ADV_NEVER; 1ba7a: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 1ba7e: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> current_adv_steps = 0; 1ba82: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 1ba86: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 1ba8a: 81 e0 ldi r24, 0x01 ; 1 1ba8c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 1ba90: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1ba94: 82 60 ori r24, 0x02 ; 2 1ba96: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1ba9a: 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(); 1ba9c: 0f 94 83 90 call 0x32106 ; 0x32106 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1baa0: 85 ef ldi r24, 0xF5 ; 245 1baa2: 91 e1 ldi r25, 0x11 ; 17 1baa4: 0e 94 46 65 call 0xca8c ; 0xca8c plan_set_position_curposXYZE(); 1baa8: 0f 94 90 84 call 0x30920 ; 0x30920 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1baac: 84 e9 ldi r24, 0x94 ; 148 1baae: 9c e0 ldi r25, 0x0C ; 12 1bab0: 0f 94 3c a1 call 0x34278 ; 0x34278 1bab4: 82 34 cpi r24, 0x42 ; 66 1bab6: 59 f4 brne .+22 ; 0x1bace 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); 1bab8: 6f ef ldi r22, 0xFF ; 255 1baba: 84 e9 ldi r24, 0x94 ; 148 1babc: 9c e0 ldi r25, 0x0C ; 12 1babe: 0f 94 84 a1 call 0x34308 ; 0x34308 // 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); 1bac2: 85 e9 ldi r24, 0x95 ; 149 1bac4: 9c e0 ldi r25, 0x0C ; 12 1bac6: 0f 94 4a a1 call 0x34294 ; 0x34294 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1baca: 0f 94 7b 0b call 0x216f6 ; 0x216f6 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1bace: 0f 94 9b 53 call 0x2a736 ; 0x2a736 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1bad2: 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); 1bad4: 88 e0 ldi r24, 0x08 ; 8 1bad6: 0f 94 5f 99 call 0x332be ; 0x332be // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1bada: 8b eb ldi r24, 0xBB ; 187 1badc: 9f e0 ldi r25, 0x0F ; 15 1bade: 0f 94 3c a1 call 0x34278 ; 0x34278 1bae2: 91 e0 ldi r25, 0x01 ; 1 1bae4: 81 30 cpi r24, 0x01 ; 1 1bae6: 09 f0 breq .+2 ; 0x1baea 1bae8: 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; } 1baea: 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(); 1baee: 81 e0 ldi r24, 0x01 ; 1 1baf0: 0f 94 da 4d call 0x29bb4 ; 0x29bb4 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1baf4: 60 e0 ldi r22, 0x00 ; 0 1baf6: 84 e6 ldi r24, 0x64 ; 100 1baf8: 9f e0 ldi r25, 0x0F ; 15 1bafa: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1bafe: 60 e0 ldi r22, 0x00 ; 0 1bb00: 86 e6 ldi r24, 0x66 ; 102 1bb02: 9f e0 ldi r25, 0x0F ; 15 1bb04: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1bb08: 60 e0 ldi r22, 0x00 ; 0 1bb0a: 88 e6 ldi r24, 0x68 ; 104 1bb0c: 9f e0 ldi r25, 0x0F ; 15 1bb0e: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1bb12: 60 e0 ldi r22, 0x00 ; 0 1bb14: 85 e6 ldi r24, 0x65 ; 101 1bb16: 9f e0 ldi r25, 0x0F ; 15 1bb18: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1bb1c: 70 e0 ldi r23, 0x00 ; 0 1bb1e: 60 e0 ldi r22, 0x00 ; 0 1bb20: 8f ef ldi r24, 0xFF ; 255 1bb22: 9e e0 ldi r25, 0x0E ; 14 1bb24: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1bb28: 70 e0 ldi r23, 0x00 ; 0 1bb2a: 60 e0 ldi r22, 0x00 ; 0 1bb2c: 85 e0 ldi r24, 0x05 ; 5 1bb2e: 9f e0 ldi r25, 0x0F ; 15 1bb30: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1bb34: 70 e0 ldi r23, 0x00 ; 0 1bb36: 60 e0 ldi r22, 0x00 ; 0 1bb38: 83 e0 ldi r24, 0x03 ; 3 1bb3a: 9f e0 ldi r25, 0x0F ; 15 1bb3c: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1bb40: 70 e0 ldi r23, 0x00 ; 0 1bb42: 60 e0 ldi r22, 0x00 ; 0 1bb44: 81 e0 ldi r24, 0x01 ; 1 1bb46: 9f e0 ldi r25, 0x0F ; 15 1bb48: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1bb4c: 70 e0 ldi r23, 0x00 ; 0 1bb4e: 60 e0 ldi r22, 0x00 ; 0 1bb50: 83 ed ldi r24, 0xD3 ; 211 1bb52: 9e e0 ldi r25, 0x0E ; 14 1bb54: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1bb58: 70 e0 ldi r23, 0x00 ; 0 1bb5a: 60 e0 ldi r22, 0x00 ; 0 1bb5c: 80 ed ldi r24, 0xD0 ; 208 1bb5e: 9e e0 ldi r25, 0x0E ; 14 1bb60: 0e 94 56 6f call 0xdeac ; 0xdeac eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1bb64: 60 e0 ldi r22, 0x00 ; 0 1bb66: 82 ed ldi r24, 0xD2 ; 210 1bb68: 9e e0 ldi r25, 0x0E ; 14 1bb6a: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1bb6e: 60 e0 ldi r22, 0x00 ; 0 1bb70: 8f ec ldi r24, 0xCF ; 207 1bb72: 9e e0 ldi r25, 0x0E ; 14 1bb74: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1bb78: 88 ea ldi r24, 0xA8 ; 168 1bb7a: 9c e0 ldi r25, 0x0C ; 12 1bb7c: 0f 94 14 49 call 0x29228 ; 0x29228 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1bb80: 81 ea ldi r24, 0xA1 ; 161 1bb82: 9d e0 ldi r25, 0x0D ; 13 1bb84: 0f 94 3c a1 call 0x34278 ; 0x34278 1bb88: 8f 3f cpi r24, 0xFF ; 255 1bb8a: 71 f4 brne .+28 ; 0x1bba8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bb8c: 60 e0 ldi r22, 0x00 ; 0 1bb8e: 81 ea ldi r24, 0xA1 ; 161 1bb90: 9d e0 ldi r25, 0x0D ; 13 1bb92: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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); 1bb96: 88 ef ldi r24, 0xF8 ; 248 1bb98: 9f e0 ldi r25, 0x0F ; 15 1bb9a: 0f 94 4a a1 call 0x34294 ; 0x34294 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1bb9e: bc 01 movw r22, r24 1bba0: 80 e5 ldi r24, 0x50 ; 80 1bba2: 9d e0 ldi r25, 0x0D ; 13 1bba4: 0f 94 7e a1 call 0x342fc ; 0x342fc 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); 1bba8: 49 e4 ldi r20, 0x49 ; 73 1bbaa: c4 2e mov r12, r20 1bbac: 4d e0 ldi r20, 0x0D ; 13 1bbae: d4 2e mov r13, r20 1bbb0: 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); 1bbb2: b7 01 movw r22, r14 1bbb4: 81 2f mov r24, r17 1bbb6: 0e 94 c9 6f call 0xdf92 ; 0xdf92 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1bbba: a7 01 movw r20, r14 1bbbc: 67 e0 ldi r22, 0x07 ; 7 1bbbe: 70 e0 ldi r23, 0x00 ; 0 1bbc0: c6 01 movw r24, r12 1bbc2: 0e 94 37 6f call 0xde6e ; 0xde6e 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++) { 1bbc6: 1f 5f subi r17, 0xFF ; 255 1bbc8: fb e0 ldi r31, 0x0B ; 11 1bbca: cf 0e add r12, r31 1bbcc: d1 1c adc r13, r1 1bbce: 18 30 cpi r17, 0x08 ; 8 1bbd0: 81 f7 brne .-32 ; 0x1bbb2 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)))) 1bbd2: 81 ea ldi r24, 0xA1 ; 161 1bbd4: 9d e0 ldi r25, 0x0D ; 13 1bbd6: 0f 94 3c a1 call 0x34278 ; 0x34278 1bbda: 0e 94 99 6f call 0xdf32 ; 0xdf32 1bbde: 81 11 cpse r24, r1 1bbe0: 02 c0 rjmp .+4 ; 0x1bbe6 { eeprom_switch_to_next_sheet(); 1bbe2: 0e 94 bb 6f call 0xdf76 ; 0xdf76 } check_babystep(); 1bbe6: 0e 94 33 73 call 0xe666 ; 0xe666 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1bbea: 80 e8 ldi r24, 0x80 ; 128 1bbec: 9c e0 ldi r25, 0x0C ; 12 1bbee: 0f 94 3c a1 call 0x34278 ; 0x34278 1bbf2: 8f 3f cpi r24, 0xFF ; 255 1bbf4: 41 f4 brne .+16 ; 0x1bc06 #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); 1bbf6: 40 e1 ldi r20, 0x10 ; 16 1bbf8: 50 e0 ldi r21, 0x00 ; 0 1bbfa: 60 e8 ldi r22, 0x80 ; 128 1bbfc: 7c e0 ldi r23, 0x0C ; 12 1bbfe: 88 ec ldi r24, 0xC8 ; 200 1bc00: 92 e0 ldi r25, 0x02 ; 2 1bc02: 0f 94 50 a1 call 0x342a0 ; 0x342a0 //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); 1bc06: 60 e0 ldi r22, 0x00 ; 0 1bc08: 89 e2 ldi r24, 0x29 ; 41 1bc0a: 9d e0 ldi r25, 0x0D ; 13 1bc0c: 0e 94 6e 6f call 0xdedc ; 0xdedc #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1bc10: 85 e0 ldi r24, 0x05 ; 5 1bc12: 9d e0 ldi r25, 0x0D ; 13 1bc14: 0f 94 14 49 call 0x29228 ; 0x29228 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1bc18: 8d ee ldi r24, 0xED ; 237 1bc1a: 9f e0 ldi r25, 0x0F ; 15 1bc1c: 0f 94 14 49 call 0x29228 ; 0x29228 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1bc20: 81 ef ldi r24, 0xF1 ; 241 1bc22: 9f e0 ldi r25, 0x0F ; 15 1bc24: 0f 94 14 49 call 0x29228 ; 0x29228 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1bc28: 60 e0 ldi r22, 0x00 ; 0 1bc2a: 8e ec ldi r24, 0xCE ; 206 1bc2c: 9e e0 ldi r25, 0x0E ; 14 1bc2e: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1bc32: 61 e0 ldi r22, 0x01 ; 1 1bc34: 87 ea ldi r24, 0xA7 ; 167 1bc36: 9c e0 ldi r25, 0x0C ; 12 1bc38: 0e 94 6e 6f call 0xdedc ; 0xdedc putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1bc3c: 8e ef ldi r24, 0xFE ; 254 1bc3e: 9f e0 ldi r25, 0x0F ; 15 1bc40: 0f 94 3c a1 call 0x34278 ; 0x34278 1bc44: 0e 94 c6 6c call 0xd98c ; 0xd98c 1bc48: 81 11 cpse r24, r1 1bc4a: 02 c0 rjmp .+4 ; 0x1bc50 lcd_language(); 1bc4c: 0e 94 50 fe call 0x1fca0 ; 0x1fca0 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1bc50: 60 e0 ldi r22, 0x00 ; 0 1bc52: 8f ea ldi r24, 0xAF ; 175 1bc54: 9f e0 ldi r25, 0x0F ; 15 1bc56: 0e 94 6e 6f call 0xdedc ; 0xdedc if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1bc5a: 86 ea ldi r24, 0xA6 ; 166 1bc5c: 9f e0 ldi r25, 0x0F ; 15 1bc5e: 0f 94 3c a1 call 0x34278 ; 0x34278 1bc62: 8f 3f cpi r24, 0xFF ; 255 1bc64: d9 f4 brne .+54 ; 0x1bc9c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc66: 61 e0 ldi r22, 0x01 ; 1 1bc68: 86 ea ldi r24, 0xA6 ; 166 1bc6a: 9f e0 ldi r25, 0x0F ; 15 1bc6c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1bc70: 30 eb ldi r19, 0xB0 ; 176 1bc72: e3 2e mov r14, r19 1bc74: 3f e0 ldi r19, 0x0F ; 15 1bc76: 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); 1bc78: 70 e0 ldi r23, 0x00 ; 0 1bc7a: 60 e0 ldi r22, 0x00 ; 0 1bc7c: c7 01 movw r24, r14 1bc7e: 0f 94 7e a1 call 0x342fc ; 0x342fc 1bc82: 22 e0 ldi r18, 0x02 ; 2 1bc84: e2 0e add r14, r18 1bc86: 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++) { 1bc88: 3a eb ldi r19, 0xBA ; 186 1bc8a: e3 16 cp r14, r19 1bc8c: 3f e0 ldi r19, 0x0F ; 15 1bc8e: f3 06 cpc r15, r19 1bc90: 99 f7 brne .-26 ; 0x1bc78 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc92: 60 e0 ldi r22, 0x00 ; 0 1bc94: 8f ea ldi r24, 0xAF ; 175 1bc96: 9f e0 ldi r25, 0x0F ; 15 1bc98: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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); 1bc9c: 60 e0 ldi r22, 0x00 ; 0 1bc9e: 85 ea ldi r24, 0xA5 ; 165 1bca0: 9f e0 ldi r25, 0x0F ; 15 1bca2: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1bca6: 60 e0 ldi r22, 0x00 ; 0 1bca8: 8f e7 ldi r24, 0x7F ; 127 1bcaa: 9c e0 ldi r25, 0x0C ; 12 1bcac: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1bcb0: 60 e0 ldi r22, 0x00 ; 0 1bcb2: 89 e0 ldi r24, 0x09 ; 9 1bcb4: 9f e0 ldi r25, 0x0F ; 15 1bcb6: 0e 94 6e 6f call 0xdedc ; 0xdedc } 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); 1bcba: 61 e0 ldi r22, 0x01 ; 1 1bcbc: 8c ea ldi r24, 0xAC ; 172 1bcbe: 9d e0 ldi r25, 0x0D ; 13 1bcc0: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1bcc4: 63 e0 ldi r22, 0x03 ; 3 1bcc6: 8b ea ldi r24, 0xAB ; 171 1bcc8: 9d e0 ldi r25, 0x0D ; 13 1bcca: 0e 94 6e 6f call 0xdedc ; 0xdedc eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1bcce: 63 e0 ldi r22, 0x03 ; 3 1bcd0: 8a ea ldi r24, 0xAA ; 170 1bcd2: 9d e0 ldi r25, 0x0D ; 13 1bcd4: 0e 94 6e 6f call 0xdedc ; 0xdedc //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1bcd8: 61 e0 ldi r22, 0x01 ; 1 1bcda: 89 ea ldi r24, 0xA9 ; 169 1bcdc: 9d e0 ldi r25, 0x0D ; 13 1bcde: 0e 94 6e 6f call 0xdedc ; 0xdedc #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); 1bce2: 84 e0 ldi r24, 0x04 ; 4 1bce4: 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) { 1bce8: 02 30 cpi r16, 0x02 ; 2 1bcea: 09 f4 brne .+2 ; 0x1bcee 1bcec: 6e c0 rjmp .+220 ; 0x1bdca 1bcee: 03 30 cpi r16, 0x03 ; 3 1bcf0: 09 f4 brne .+2 ; 0x1bcf4 1bcf2: 0f c1 rjmp .+542 ; 0x1bf12 1bcf4: 01 30 cpi r16, 0x01 ; 1 1bcf6: 09 f0 breq .+2 ; 0x1bcfa 1bcf8: 74 c0 rjmp .+232 ; 0x1bde2 //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)); 1bcfa: 86 e3 ldi r24, 0x36 ; 54 1bcfc: 94 e4 ldi r25, 0x44 ; 68 1bcfe: 0e 94 32 6d call 0xda64 ; 0xda64 1bd02: 0f 94 7b 0b call 0x216f6 ; 0x216f6 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); 1bd06: 6b ec ldi r22, 0xCB ; 203 1bd08: 70 e0 ldi r23, 0x00 ; 0 1bd0a: 8c ee ldi r24, 0xEC ; 236 1bd0c: 9e e0 ldi r25, 0x0E ; 14 1bd0e: 67 c0 rjmp .+206 ; 0x1bdde first++; lcd_clear(); } } if (cursor_pos < 0) { 1bd10: 1f 3f cpi r17, 0xFF ; 255 1bd12: 09 f0 breq .+2 ; 0x1bd16 1bd14: d4 cd rjmp .-1112 ; 0x1b8be cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1bd16: 87 e0 ldi r24, 0x07 ; 7 1bd18: 0f 94 fd 2c call 0x259fa ; 0x259fa if (first > 0) { 1bd1c: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1bd20: 18 16 cp r1, r24 1bd22: 2c f4 brge .+10 ; 0x1bd2e first--; 1bd24: 81 50 subi r24, 0x01 ; 1 1bd26: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1bd2a: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1bd2e: 10 e0 ldi r17, 0x00 ; 0 1bd30: c6 cd rjmp .-1140 ; 0x1b8be // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1bd32: 13 30 cpi r17, 0x03 ; 3 1bd34: 31 f1 breq .+76 ; 0x1bd82 1bd36: 14 30 cpi r17, 0x04 ; 4 1bd38: 09 f0 breq .+2 ; 0x1bd3c 1bd3a: f4 cd rjmp .-1048 ; 0x1b924 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1bd3c: 69 e2 ldi r22, 0x29 ; 41 1bd3e: 77 e8 ldi r23, 0x87 ; 135 1bd40: 80 e0 ldi r24, 0x00 ; 0 1bd42: 90 e1 ldi r25, 0x10 ; 16 1bd44: 0f 94 7e 92 call 0x324fc ; 0x324fc // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bd48: 10 e0 ldi r17, 0x00 ; 0 1bd4a: 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); 1bd4c: 6f ef ldi r22, 0xFF ; 255 1bd4e: c8 01 movw r24, r16 1bd50: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1bd54: c8 01 movw r24, r16 1bd56: 0f 94 4f 92 call 0x3249e ; 0x3249e break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bd5a: 0f 5f subi r16, 0xFF ; 255 1bd5c: 1f 4f sbci r17, 0xFF ; 255 1bd5e: 01 15 cp r16, r1 1bd60: b0 e1 ldi r27, 0x10 ; 16 1bd62: 1b 07 cpc r17, r27 1bd64: 99 f7 brne .-26 ; 0x1bd4c eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1bd66: 0f 94 70 92 call 0x324e0 ; 0x324e0 softReset(); 1bd6a: 0e 94 28 61 call 0xc250 ; 0xc250 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1bd6e: 0e 94 35 6c call 0xd86a ; 0xd86a 1bd72: d8 cd rjmp .-1104 ; 0x1b924 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1bd74: 0e 94 ed 60 call 0xc1da ; 0xc1da lcd_menu_statistics(); 1bd78: 0f 94 f6 1c call 0x239ec ; 0x239ec 1bd7c: d3 cd rjmp .-1114 ; 0x1b924 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1bd7e: 0e 94 ed 60 call 0xc1da ; 0xc1da // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1bd82: 0e 94 35 6c call 0xd86a ; 0xd86a // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1bd86: 84 e0 ldi r24, 0x04 ; 4 1bd88: 0e 94 28 c6 call 0x18c50 ; 0x18c50 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); 1bd8c: 62 e0 ldi r22, 0x02 ; 2 1bd8e: 8f e5 ldi r24, 0x5F ; 95 1bd90: 9f e0 ldi r25, 0x0F ; 15 1bd92: 0f 94 84 a1 call 0x34308 ; 0x34308 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1bd96: 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); 1bd9a: 60 e0 ldi r22, 0x00 ; 0 1bd9c: 84 ec ldi r24, 0xC4 ; 196 1bd9e: 9f e0 ldi r25, 0x0F ; 15 1bda0: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1bda4: 81 e0 ldi r24, 0x01 ; 1 1bda6: 0e 94 a1 6e call 0xdd42 ; 0xdd42 1bdaa: 11 e0 ldi r17, 0x01 ; 1 1bdac: 10 93 85 16 sts 0x1685, r17 ; 0x801685 1bdb0: 61 e0 ldi r22, 0x01 ; 1 1bdb2: 87 e0 ldi r24, 0x07 ; 7 1bdb4: 9f e0 ldi r25, 0x0F ; 15 1bdb6: 0f 94 60 a1 call 0x342c0 ; 0x342c0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1bdba: 10 93 86 16 sts 0x1686, r17 ; 0x801686 1bdbe: 61 e0 ldi r22, 0x01 ; 1 1bdc0: 85 ed ldi r24, 0xD5 ; 213 1bdc2: 9e e0 ldi r25, 0x0E ; 14 1bdc4: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1bdc8: ad cd rjmp .-1190 ; 0x1b924 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)); 1bdca: 85 e1 ldi r24, 0x15 ; 21 1bdcc: 94 e4 ldi r25, 0x44 ; 68 1bdce: 0e 94 32 6d call 0xda64 ; 0xda64 1bdd2: 0f 94 7b 0b call 0x216f6 ; 0x216f6 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); 1bdd6: 6c ef ldi r22, 0xFC ; 252 1bdd8: 70 e0 ldi r23, 0x00 ; 0 1bdda: 8e ee ldi r24, 0xEE ; 238 1bddc: 9e e0 ldi r25, 0x0E ; 14 1bdde: 0f 94 9a a1 call 0x34334 ; 0x34334 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1bde2: b1 10 cpse r11, r1 1bde4: 08 c0 rjmp .+16 ; 0x1bdf6 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 1bde6: 8e e9 ldi r24, 0x9E ; 158 1bde8: 93 e4 ldi r25, 0x43 ; 67 1bdea: 0e 94 32 6d call 0xda64 ; 0xda64 1bdee: 0f 94 7b 0b call 0x216f6 ; 0x216f6 Config_StoreSettings(); 1bdf2: 0e 94 e4 75 call 0xebc8 ; 0xebc8 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1bdf6: 80 e8 ldi r24, 0x80 ; 128 1bdf8: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1bdfc: 88 23 and r24, r24 1bdfe: c9 f0 breq .+50 ; 0x1be32 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1be00: 87 ef ldi r24, 0xF7 ; 247 1be02: 9f e0 ldi r25, 0x0F ; 15 1be04: 0f 94 3c a1 call 0x34278 ; 0x34278 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1be08: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1be0a: 81 30 cpi r24, 0x01 ; 1 1be0c: 71 f4 brne .+28 ; 0x1be2a // 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)) { 1be0e: 8a e5 ldi r24, 0x5A ; 90 1be10: 97 e8 ldi r25, 0x87 ; 135 1be12: 0e 94 46 b3 call 0x1668c ; 0x1668c 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); 1be16: 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)) { 1be18: 88 23 and r24, r24 1be1a: 39 f0 breq .+14 ; 0x1be2a // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1be1c: 8c e5 ldi r24, 0x5C ; 92 1be1e: 93 e4 ldi r25, 0x43 ; 67 1be20: 0e 94 32 6d call 0xda64 ; 0xda64 1be24: 0f 94 7b 0b call 0x216f6 ; 0x216f6 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1be28: 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); 1be2a: 86 ea ldi r24, 0xA6 ; 166 1be2c: 9c e0 ldi r25, 0x0C ; 12 1be2e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1be32: 82 e5 ldi r24, 0x52 ; 82 1be34: 97 e8 ldi r25, 0x87 ; 135 1be36: 0e 94 46 b3 call 0x1668c ; 0x1668c 1be3a: 18 2f mov r17, r24 1be3c: 88 23 and r24, r24 1be3e: 29 f0 breq .+10 ; 0x1be4a if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1be40: 87 e1 ldi r24, 0x17 ; 23 1be42: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1be46: 11 e0 ldi r17, 0x01 ; 1 1be48: 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; 1be4a: f1 2c mov r15, r1 1be4c: 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)); 1be4e: f7 01 movw r30, r14 1be50: e8 5b subi r30, 0xB8 ; 184 1be52: f8 47 sbci r31, 0x78 ; 120 1be54: 64 91 lpm r22, Z 1be56: c7 01 movw r24, r14 1be58: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1be5c: 8f ef ldi r24, 0xFF ; 255 1be5e: e8 1a sub r14, r24 1be60: 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){ 1be62: 9a e0 ldi r25, 0x0A ; 10 1be64: e9 16 cp r14, r25 1be66: f1 04 cpc r15, r1 1be68: 91 f7 brne .-28 ; 0x1be4e 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])); 1be6a: e2 e5 ldi r30, 0x52 ; 82 1be6c: f7 e8 ldi r31, 0x87 ; 135 1be6e: 65 91 lpm r22, Z+ 1be70: 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); 1be72: 8a e0 ldi r24, 0x0A ; 10 1be74: 90 e0 ldi r25, 0x00 ; 0 1be76: 0f 94 7e a1 call 0x342fc ; 0x342fc eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1be7a: e4 e5 ldi r30, 0x54 ; 84 1be7c: f7 e8 ldi r31, 0x87 ; 135 1be7e: 65 91 lpm r22, Z+ 1be80: 74 91 lpm r23, Z 1be82: 8c e0 ldi r24, 0x0C ; 12 1be84: 90 e0 ldi r25, 0x00 ; 0 1be86: 0f 94 7e a1 call 0x342fc ; 0x342fc eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1be8a: e6 e5 ldi r30, 0x56 ; 86 1be8c: f7 e8 ldi r31, 0x87 ; 135 1be8e: 65 91 lpm r22, Z+ 1be90: 74 91 lpm r23, Z 1be92: 8e e0 ldi r24, 0x0E ; 14 1be94: 90 e0 ldi r25, 0x00 ; 0 1be96: 0f 94 7e a1 call 0x342fc ; 0x342fc // 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])); 1be9a: e8 e5 ldi r30, 0x58 ; 88 1be9c: f7 e8 ldi r31, 0x87 ; 135 1be9e: 65 91 lpm r22, Z+ 1bea0: 74 91 lpm r23, Z 1bea2: 80 e1 ldi r24, 0x10 ; 16 1bea4: 90 e0 ldi r25, 0x00 ; 0 1bea6: 0f 94 7e a1 call 0x342fc ; 0x342fc run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1beaa: 8f e5 ldi r24, 0x5F ; 95 1beac: 9f e0 ldi r25, 0x0F ; 15 1beae: 0f 94 3c a1 call 0x34278 ; 0x34278 1beb2: 88 23 and r24, r24 1beb4: d9 f1 breq .+118 ; 0x1bf2c // first time run of wizard or service prep lcd_wizard(WizState::Run); 1beb6: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1beb8: 0f 94 5c 2e call 0x25cb8 ; 0x25cb8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1bebc: 83 e0 ldi r24, 0x03 ; 3 1bebe: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1bec2: 81 e0 ldi r24, 0x01 ; 1 1bec4: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 1bec8: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_update(2); 1becc: 82 e0 ldi r24, 0x02 ; 2 1bece: 0e 94 c3 69 call 0xd386 ; 0xd386 "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); 1bed2: 83 e0 ldi r24, 0x03 ; 3 1bed4: 9d e0 ldi r25, 0x0D ; 13 1bed6: 0f 94 3c a1 call 0x34278 ; 0x34278 1beda: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1bedc: 8f ef ldi r24, 0xFF ; 255 1bede: 81 0f add r24, r17 1bee0: 8e 3f cpi r24, 0xFE ; 254 1bee2: 08 f0 brcs .+2 ; 0x1bee6 1bee4: 49 c0 rjmp .+146 ; 0x1bf78 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1bee6: 80 e0 ldi r24, 0x00 ; 0 1bee8: 0f 94 fd 2c call 0x259fa ; 0x259fa { lcd_beeper_quick_feedback(); lcd_clear(); 1beec: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1bef0: 83 e0 ldi r24, 0x03 ; 3 1bef2: 99 e6 ldi r25, 0x69 ; 105 1bef4: 0e 94 e7 69 call 0xd3ce ; 0xd3ce switch(crash_reason) 1bef8: 12 30 cpi r17, 0x02 ; 2 1befa: b1 f1 breq .+108 ; 0x1bf68 1befc: 13 30 cpi r17, 0x03 ; 3 1befe: 09 f4 brne .+2 ; 0x1bf02 1bf00: 16 c1 rjmp .+556 ; 0x1c12e { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1bf02: 80 ee ldi r24, 0xE0 ; 224 1bf04: 98 e6 ldi r25, 0x68 ; 104 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1bf06: 11 30 cpi r17, 0x01 ; 1 1bf08: 89 f1 breq .+98 ; 0x1bf6c } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1bf0a: 81 2f mov r24, r17 1bf0c: 0e 94 ab 6a call 0xd556 ; 0xd556 1bf10: 2f c0 rjmp .+94 ; 0x1bf70 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)); 1bf12: 8a ed ldi r24, 0xDA ; 218 1bf14: 93 e4 ldi r25, 0x43 ; 67 1bf16: 0e 94 32 6d call 0xda64 ; 0xda64 1bf1a: 0f 94 7b 0b call 0x216f6 ; 0x216f6 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); 1bf1e: 6c ef ldi r22, 0xFC ; 252 1bf20: 70 e0 ldi r23, 0x00 ; 0 1bf22: 8e ee ldi r24, 0xEE ; 238 1bf24: 9e e0 ldi r25, 0x0E ; 14 1bf26: 0f 94 9a a1 call 0x34334 ; 0x34334 1bf2a: ed ce rjmp .-550 ; 0x1bd06 // 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); 1bf2c: 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) { 1bf2e: 11 11 cpse r17, r1 1bf30: c3 cf rjmp .-122 ; 0x1beb8 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1bf32: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1bf36: 81 11 cpse r24, r1 1bf38: 07 c0 rjmp .+14 ; 0x1bf48 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1bf3a: 8c ee ldi r24, 0xEC ; 236 1bf3c: 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)); 1bf3e: 0e 94 32 6d call 0xda64 ; 0xda64 1bf42: 0f 94 7b 0b call 0x216f6 ; 0x216f6 1bf46: ba cf rjmp .-140 ; 0x1bebc 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)) { 1bf48: 84 e0 ldi r24, 0x04 ; 4 1bf4a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1bf4e: 81 11 cpse r24, r1 1bf50: 03 c0 rjmp .+6 ; 0x1bf58 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1bf52: 84 e7 ldi r24, 0x74 ; 116 1bf54: 92 e4 ldi r25, 0x42 ; 66 1bf56: f3 cf rjmp .-26 ; 0x1bf3e } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1bf58: 80 e1 ldi r24, 0x10 ; 16 1bf5a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 1bf5e: 81 11 cpse r24, r1 1bf60: ad cf rjmp .-166 ; 0x1bebc lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1bf62: 80 e3 ldi r24, 0x30 ; 48 1bf64: 97 e4 ldi r25, 0x47 ; 71 1bf66: eb cf rjmp .-42 ; 0x1bf3e { 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")); 1bf68: 8f ec ldi r24, 0xCF ; 207 1bf6a: 98 e6 ldi r25, 0x68 ; 104 1bf6c: 0e 94 e7 69 call 0xd3ce ; 0xd3ce } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1bf70: 90 e0 ldi r25, 0x00 ; 0 1bf72: 80 e0 ldi r24, 0x00 ; 0 1bf74: 0f 94 f5 34 call 0x269ea ; 0x269ea if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bf78: 6f ef ldi r22, 0xFF ; 255 1bf7a: 83 e0 ldi r24, 0x03 ; 3 1bf7c: 9d e0 ldi r25, 0x0D ; 13 1bf7e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 // 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(); 1bf82: 0e 94 59 d8 call 0x1b0b2 ; 0x1b0b2 KEEPALIVE_STATE(NOT_BUSY); 1bf86: 81 e0 ldi r24, 0x01 ; 1 1bf88: 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" ); 1bf8c: 88 e1 ldi r24, 0x18 ; 24 1bf8e: 98 e2 ldi r25, 0x28 ; 40 1bf90: 0f b6 in r0, 0x3f ; 63 1bf92: f8 94 cli 1bf94: a8 95 wdr 1bf96: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bf9a: 0f be out 0x3f, r0 ; 63 1bf9c: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1bfa0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bfa4: 80 64 ori r24, 0x40 ; 64 1bfa6: 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; 1bfaa: 85 e0 ldi r24, 0x05 ; 5 1bfac: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1bfae: 90 e0 ldi r25, 0x00 ; 0 1bfb0: e9 2e mov r14, r25 1bfb2: 90 e0 ldi r25, 0x00 ; 0 1bfb4: 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); 1bfb6: cc 24 eor r12, r12 1bfb8: 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); 1bfba: 24 e0 ldi r18, 0x04 ; 4 1bfbc: 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; 1bfbe: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 1bfc2: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1bfc6: 88 23 and r24, r24 1bfc8: 09 f4 brne .+2 ; 0x1bfcc 1bfca: b4 c0 rjmp .+360 ; 0x1c134 // 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); 1bfcc: 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. 1bfd0: 0e 94 3e 61 call 0xc27c ; 0xc27c 1bfd4: 88 23 and r24, r24 1bfd6: 09 f4 brne .+2 ; 0x1bfda 1bfd8: b0 c0 rjmp .+352 ; 0x1c13a 1bfda: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1bfde: 81 30 cpi r24, 0x01 ; 1 1bfe0: 09 f0 breq .+2 ; 0x1bfe4 1bfe2: ab c0 rjmp .+342 ; 0x1c13a usb_timer.start(); 1bfe4: 85 ed ldi r24, 0xD5 ; 213 1bfe6: 91 e1 ldi r25, 0x11 ; 17 1bfe8: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> } else #endif { get_command(); 1bfec: 0e 94 fa 75 call 0xebf4 ; 0xebf4 // 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) 1bff0: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> 1bff4: 88 23 and r24, r24 1bff6: 89 f0 breq .+34 ; 0x1c01a return; if(autostart_atmillis.expired(5000)) 1bff8: 68 e8 ldi r22, 0x88 ; 136 1bffa: 73 e1 ldi r23, 0x13 ; 19 1bffc: 8b e7 ldi r24, 0x7B ; 123 1bffe: 96 e1 ldi r25, 0x16 ; 22 1c000: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1c004: 81 11 cpse r24, r1 1c006: 09 c0 rjmp .+18 ; 0x1c01a return; } autostart_stilltocheck = false; 1c008: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) 1c00c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c010: 88 23 and r24, r24 1c012: 09 f4 brne .+2 ; 0x1c016 1c014: 9e c0 rjmp .+316 ; 0x1c152 1c016: 0f 94 6e 44 call 0x288dc ; 0x288dc #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1c01a: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c01e: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c022: 89 2b or r24, r25 1c024: 09 f4 brne .+2 ; 0x1c028 1c026: 63 c0 rjmp .+198 ; 0x1c0ee { cmdbuffer_front_already_processed = false; 1c028: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 #ifdef SDSUPPORT if(card.saving) 1c02c: 80 91 68 13 lds r24, 0x1368 ; 0x801368 1c030: 88 23 and r24, r24 1c032: c1 f1 breq .+112 ; 0x1c0a4 { // 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) { 1c034: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1c038: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 1c03c: 0f 51 subi r16, 0x1F ; 31 1c03e: 10 4f sbci r17, 0xF0 ; 240 1c040: 6b e9 ldi r22, 0x9B ; 155 1c042: 77 e8 ldi r23, 0x87 ; 135 1c044: c8 01 movw r24, r16 1c046: 0f 94 43 9f call 0x33e86 ; 0x33e86 1c04a: 89 2b or r24, r25 1c04c: 09 f0 breq .+2 ; 0x1c050 1c04e: 8e c0 rjmp .+284 ; 0x1c16c else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1c050: 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)); 1c054: f8 01 movw r30, r16 1c056: 01 90 ld r0, Z+ 1c058: 00 20 and r0, r0 1c05a: e9 f7 brne .-6 ; 0x1c056 1c05c: 31 97 sbiw r30, 0x01 ; 1 1c05e: bf 01 movw r22, r30 1c060: 60 1b sub r22, r16 1c062: 71 0b sbc r23, r17 1c064: c8 01 movw r24, r16 1c066: 0f 94 79 50 call 0x2a0f2 ; 0x2a0f2 1c06a: 62 e0 ldi r22, 0x02 ; 2 1c06c: 70 e0 ldi r23, 0x00 ; 0 1c06e: 88 ed ldi r24, 0xD8 ; 216 1c070: 92 e0 ldi r25, 0x02 ; 2 1c072: 0f 94 79 50 call 0x2a0f2 ; 0x2a0f2 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1c076: 80 91 fa 15 lds r24, 0x15FA ; 0x8015fa 1c07a: 88 23 and r24, r24 1c07c: 41 f0 breq .+16 ; 0x1c08e { SERIAL_ERROR_START; 1c07e: 8a e5 ldi r24, 0x5A ; 90 1c080: 9e e9 ldi r25, 0x9E ; 158 1c082: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1c086: 8d ea ldi r24, 0xAD ; 173 1c088: 99 e6 ldi r25, 0x69 ; 105 1c08a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1c08e: 80 91 69 13 lds r24, 0x1369 ; 0x801369 1c092: 88 23 and r24, r24 1c094: 09 f4 brne .+2 ; 0x1c098 1c096: 65 c0 rjmp .+202 ; 0x1c162 */ void process_commands() { if (!buflen) return; //empty command 1c098: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c09c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c0a0: 89 2b or r24, r25 1c0a2: 11 f0 breq .+4 ; 0x1c0a8 1c0a4: 0e 94 67 84 call 0x108ce ; 0x108ce } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1c0a8: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1c0ac: 81 11 cpse r24, r1 1c0ae: 19 c0 rjmp .+50 ; 0x1c0e2 1c0b0: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c0b4: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c0b8: 89 2b or r24, r25 1c0ba: 99 f0 breq .+38 ; 0x1c0e2 { // 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; 1c0bc: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb 1c0c0: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc 1c0c4: e2 52 subi r30, 0x22 ; 34 1c0c6: f0 4f sbci r31, 0xF0 ; 240 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1c0c8: 80 81 ld r24, Z 1c0ca: 82 30 cpi r24, 0x02 ; 2 1c0cc: 09 f0 breq .+2 ; 0x1c0d0 1c0ce: 53 c0 rjmp .+166 ; 0x1c176 { // 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(); 1c0d0: 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; 1c0d2: 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); 1c0d4: 81 81 ldd r24, Z+1 ; 0x01 1c0d6: 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); 1c0d8: 0f 94 dc 75 call 0x2ebb8 ; 0x2ebb8 sei(); 1c0dc: 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(); 1c0de: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1c0e2: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1c0e6: 81 11 cpse r24, r1 1c0e8: 02 c0 rjmp .+4 ; 0x1c0ee 1c0ea: 0e 94 d8 72 call 0xe5b0 ; 0xe5b0 } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1c0ee: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(printingIsPaused()); 1c0f2: 0e 94 3e 61 call 0xc27c ; 0xc27c 1c0f6: 0e 94 89 7a call 0xf512 ; 0xf512 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1c0fa: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 1c0fe: 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; 1c100: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> checkHitEndstops(); lcd_update(0); 1c104: 80 e0 ldi r24, 0x00 ; 0 1c106: 0e 94 c3 69 call 0xd386 ; 0xd386 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) { 1c10a: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1c10e: 81 11 cpse r24, r1 1c110: 07 c0 rjmp .+14 ; 0x1c120 return; } avoidRecursion = true; 1c112: c0 92 2d 04 sts 0x042D, r12 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); 1c116: 81 e0 ldi r24, 0x01 ; 1 1c118: 0f 94 b2 65 call 0x2cb64 ; 0x2cb64 avoidRecursion = false; 1c11c: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1c120: e1 14 cp r14, r1 1c122: f1 04 cpc r15, r1 1c124: 09 f4 brne .+2 ; 0x1c128 1c126: 4b cf rjmp .-362 ; 0x1bfbe 1c128: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1c12c: 48 cf rjmp .-368 ; 0x1bfbe 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")); 1c12e: 81 ec ldi r24, 0xC1 ; 193 1c130: 98 e6 ldi r25, 0x68 ; 104 1c132: 1c cf rjmp .-456 ; 0x1bf6c // 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); 1c134: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1c138: 4b cf rjmp .-362 ; 0x1bfd0 } 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. 1c13a: 60 e1 ldi r22, 0x10 ; 16 1c13c: 77 e2 ldi r23, 0x27 ; 39 1c13e: 85 ed ldi r24, 0xD5 ; 213 1c140: 91 e1 ldi r25, 0x11 ; 17 1c142: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1c146: 88 23 and r24, r24 1c148: 09 f4 brne .+2 ; 0x1c14c 1c14a: 50 cf rjmp .-352 ; 0x1bfec } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1c14c: b0 92 cb 0d sts 0x0DCB, r11 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 1c150: 4d cf rjmp .-358 ; 0x1bfec return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1c152: 81 e0 ldi r24, 0x01 ; 1 1c154: 0f 94 da 4d call 0x29bb4 ; 0x29bb4 if(!mounted) //fail 1c158: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c15c: 81 11 cpse r24, r1 1c15e: 5b cf rjmp .-330 ; 0x1c016 1c160: 5c cf rjmp .-328 ; 0x1c01a 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); 1c162: 85 ed ldi r24, 0xD5 ; 213 1c164: 99 e6 ldi r25, 0x69 ; 105 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c166: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 1c16a: 9e cf rjmp .-196 ; 0x1c0a8 if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1c16c: 0f 94 3a 42 call 0x28474 ; 0x28474 SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c170: 83 ec ldi r24, 0xC3 ; 195 1c172: 99 e6 ldi r25, 0x69 ; 105 1c174: f8 cf rjmp .-16 ; 0x1c166 // 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){ 1c176: 86 30 cpi r24, 0x06 ; 6 1c178: 09 f0 breq .+2 ; 0x1c17c 1c17a: b1 cf rjmp .-158 ; 0x1c0de 1c17c: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1c180: 81 11 cpse r24, r1 1c182: ad cf rjmp .-166 ; 0x1c0de cli(); 1c184: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1c186: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1c188: 81 e0 ldi r24, 0x01 ; 1 1c18a: 90 e0 ldi r25, 0x00 ; 0 1c18c: a5 cf rjmp .-182 ; 0x1c0d8 { 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; 1c18e: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1c190: 8b 3c cpi r24, 0xCB ; 203 1c192: 91 05 cpc r25, r1 1c194: 09 f0 breq .+2 ; 0x1c198 1c196: 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(); 1c198: 0e 94 53 75 call 0xeaa6 ; 0xeaa6 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; 1c19c: 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; 1c19e: 82 ea ldi r24, 0xA2 ; 162 1c1a0: 92 ea ldi r25, 0xA2 ; 162 1c1a2: a0 e0 ldi r26, 0x00 ; 0 1c1a4: b0 e0 ldi r27, 0x00 ; 0 1c1a6: 80 93 24 17 sts 0x1724, r24 ; 0x801724 <__bss_end+0x20> 1c1aa: 90 93 25 17 sts 0x1725, r25 ; 0x801725 <__bss_end+0x21> 1c1ae: a0 93 26 17 sts 0x1726, r26 ; 0x801726 <__bss_end+0x22> 1c1b2: 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; 1c1b6: 10 92 ea 03 sts 0x03EA, r1 ; 0x8003ea <_ZL14iState_sum_min.lto_priv.429> 1c1ba: 10 92 eb 03 sts 0x03EB, r1 ; 0x8003eb <_ZL14iState_sum_min.lto_priv.429+0x1> 1c1be: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec <_ZL14iState_sum_min.lto_priv.429+0x2> 1c1c2: 10 92 ed 03 sts 0x03ED, r1 ; 0x8003ed <_ZL14iState_sum_min.lto_priv.429+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 1c1c6: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1c1ca: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1c1ce: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1c1d2: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1c1d6: 60 e0 ldi r22, 0x00 ; 0 1c1d8: 70 e0 ldi r23, 0x00 ; 0 1c1da: 8f e7 ldi r24, 0x7F ; 127 1c1dc: 93 e4 ldi r25, 0x43 ; 67 1c1de: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1c1e2: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 1c1e6: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 1c1ea: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 1c1ee: 90 93 e9 03 sts 0x03E9, r25 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.430+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 1c1f2: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.427> 1c1f6: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.427+0x1> 1c1fa: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.427+0x2> 1c1fe: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.427+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 1c202: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1c206: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1c20a: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1c20e: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1c212: 60 e0 ldi r22, 0x00 ; 0 1c214: 70 e0 ldi r23, 0x00 ; 0 1c216: 8f e7 ldi r24, 0x7F ; 127 1c218: 93 e4 ldi r25, 0x43 ; 67 1c21a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1c21e: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 1c222: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 1c226: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 1c22a: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.428+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 1c22e: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1c230: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1c232: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1c236: 88 60 ori r24, 0x08 ; 8 1c238: 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)); 1c23c: 80 91 05 05 lds r24, 0x0505 ; 0x800505 1c240: 90 e0 ldi r25, 0x00 ; 0 1c242: 64 e0 ldi r22, 0x04 ; 4 1c244: 95 95 asr r25 1c246: 87 95 ror r24 1c248: 6a 95 dec r22 1c24a: e1 f7 brne .-8 ; 0x1c244 1c24c: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.432> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 1c250: 8e e1 ldi r24, 0x1E ; 30 1c252: 90 e0 ldi r25, 0x00 ; 0 1c254: 90 93 dc 03 sts 0x03DC, r25 ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 1c258: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db <_ZL8minttemp.lto_priv.422> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1c25c: c0 90 52 02 lds r12, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 1c260: d0 90 53 02 lds r13, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 1c264: c6 01 movw r24, r12 1c266: 0e 94 b6 bd call 0x17b6c ; 0x17b6c 1c26a: 20 e0 ldi r18, 0x00 ; 0 1c26c: 30 e0 ldi r19, 0x00 ; 0 1c26e: 40 ef ldi r20, 0xF0 ; 240 1c270: 51 e4 ldi r21, 0x41 ; 65 1c272: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1c276: 87 ff sbrs r24, 7 1c278: 81 c9 rjmp .-3326 ; 0x1b57c #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1c27a: f0 e1 ldi r31, 0x10 ; 16 1c27c: cf 1a sub r12, r31 1c27e: d1 08 sbc r13, r1 1c280: d0 92 53 02 sts 0x0253, r13 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 1c284: c0 92 52 02 sts 0x0252, r12 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 1c288: e9 cf rjmp .-46 ; 0x1c25c 0001c28a : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1c28a: 0f 93 push r16 1c28c: 1f 93 push r17 1c28e: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1c290: 0e 94 6e b1 call 0x162dc ; 0x162dc if (*str != '.') 1c294: fc 01 movw r30, r24 1c296: 20 81 ld r18, Z 1c298: 2e 32 cpi r18, 0x2E ; 46 1c29a: 11 f0 breq .+4 ; 0x1c2a0 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 1c29c: 80 e0 ldi r24, 0x00 ; 0 1c29e: 34 c0 rjmp .+104 ; 0x1c308 // 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); 1c2a0: b8 01 movw r22, r16 1c2a2: 6e 5f subi r22, 0xFE ; 254 1c2a4: 7f 4f sbci r23, 0xFF ; 255 1c2a6: 01 96 adiw r24, 0x01 ; 1 1c2a8: 0e 94 6e b1 call 0x162dc ; 0x162dc if (*str != '.') 1c2ac: fc 01 movw r30, r24 1c2ae: 20 81 ld r18, Z 1c2b0: 2e 32 cpi r18, 0x2E ; 46 1c2b2: a1 f7 brne .-24 ; 0x1c29c return false; ++str; } str = Number(str, version + 2); 1c2b4: b8 01 movw r22, r16 1c2b6: 6c 5f subi r22, 0xFC ; 252 1c2b8: 7f 4f sbci r23, 0xFF ; 255 1c2ba: 01 96 adiw r24, 0x01 ; 1 1c2bc: 0e 94 6e b1 call 0x162dc ; 0x162dc version[3] = FIRMWARE_REVISION_RELEASED; 1c2c0: 20 e4 ldi r18, 0x40 ; 64 1c2c2: 30 e0 ldi r19, 0x00 ; 0 1c2c4: f8 01 movw r30, r16 1c2c6: 37 83 std Z+7, r19 ; 0x07 1c2c8: 26 83 std Z+6, r18 ; 0x06 1c2ca: fc 01 movw r30, r24 1c2cc: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1c2ce: 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'; 1c2d0: 89 2f mov r24, r25 1c2d2: 8f 7d andi r24, 0xDF ; 223 1c2d4: c1 f1 breq .+112 ; 0x1c346 1c2d6: 87 ef ldi r24, 0xF7 ; 247 1c2d8: 89 0f add r24, r25 1c2da: 82 30 cpi r24, 0x02 ; 2 1c2dc: a0 f1 brcs .+104 ; 0x1c346 1c2de: 9d 30 cpi r25, 0x0D ; 13 1c2e0: 91 f1 breq .+100 ; 0x1c346 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 == '-'){ 1c2e2: 9d 32 cpi r25, 0x2D ; 45 1c2e4: 99 f7 brne .-26 ; 0x1c2cc // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c2e6: 11 96 adiw r26, 0x01 ; 1 1c2e8: 9c 91 ld r25, X 1c2ea: 92 34 cpi r25, 0x42 ; 66 1c2ec: e1 f0 breq .+56 ; 0x1c326 1c2ee: 7c f4 brge .+30 ; 0x1c30e 1c2f0: 91 34 cpi r25, 0x41 ; 65 1c2f2: a1 f6 brne .-88 ; 0x1c29c 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); 1c2f4: 0a 5f subi r16, 0xFA ; 250 1c2f6: 1f 4f sbci r17, 0xFF ; 255 1c2f8: 28 e0 ldi r18, 0x08 ; 8 1c2fa: 30 e0 ldi r19, 0x00 ; 0 1c2fc: 45 e0 ldi r20, 0x05 ; 5 1c2fe: 67 e4 ldi r22, 0x47 ; 71 1c300: 75 e8 ldi r23, 0x85 ; 133 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); 1c302: cf 01 movw r24, r30 1c304: 0e 94 24 b5 call 0x16a48 ; 0x16a48 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1c308: 1f 91 pop r17 1c30a: 0f 91 pop r16 1c30c: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c30e: 94 34 cpi r25, 0x44 ; 68 1c310: 91 f0 breq .+36 ; 0x1c336 1c312: 92 35 cpi r25, 0x52 ; 82 1c314: 19 f6 brne .-122 ; 0x1c29c 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); 1c316: 0a 5f subi r16, 0xFA ; 250 1c318: 1f 4f sbci r17, 0xFF ; 255 1c31a: 20 e2 ldi r18, 0x20 ; 32 1c31c: 30 e0 ldi r19, 0x00 ; 0 1c31e: 42 e0 ldi r20, 0x02 ; 2 1c320: 6b e3 ldi r22, 0x3B ; 59 1c322: 75 e8 ldi r23, 0x85 ; 133 1c324: ee cf rjmp .-36 ; 0x1c302 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); 1c326: 0a 5f subi r16, 0xFA ; 250 1c328: 1f 4f sbci r17, 0xFF ; 255 1c32a: 20 e1 ldi r18, 0x10 ; 16 1c32c: 30 e0 ldi r19, 0x00 ; 0 1c32e: 44 e0 ldi r20, 0x04 ; 4 1c330: 62 e4 ldi r22, 0x42 ; 66 1c332: 75 e8 ldi r23, 0x85 ; 133 1c334: e6 cf rjmp .-52 ; 0x1c302 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); 1c336: 0a 5f subi r16, 0xFA ; 250 1c338: 1f 4f sbci r17, 0xFF ; 255 1c33a: 30 e0 ldi r19, 0x00 ; 0 1c33c: 20 e0 ldi r18, 0x00 ; 0 1c33e: 43 e0 ldi r20, 0x03 ; 3 1c340: 6e e3 ldi r22, 0x3E ; 62 1c342: 75 e8 ldi r23, 0x85 ; 133 1c344: de cf rjmp .-68 ; 0x1c302 // 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; 1c346: 81 e0 ldi r24, 0x01 ; 1 1c348: df cf rjmp .-66 ; 0x1c308 0001c34a : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c34a: cf 93 push r28 1c34c: 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) 1c34e: 8c e6 ldi r24, 0x6C ; 108 1c350: 91 e4 ldi r25, 0x41 ; 65 1c352: 0e 94 32 6d call 0xda64 ; 0xda64 1c356: 40 e0 ldi r20, 0x00 ; 0 1c358: 60 e0 ldi r22, 0x00 ; 0 1c35a: 0f 94 33 2e call 0x25c66 ; 0x25c66 1c35e: 81 11 cpse r24, r1 1c360: 20 c0 rjmp .+64 ; 0x1c3a2 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c362: 0e 94 a3 6c call 0xd946 ; 0xd946 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c366: c2 30 cpi r28, 0x02 ; 2 1c368: e0 f0 brcs .+56 ; 0x1c3a2 1c36a: 8c 17 cp r24, r28 1c36c: d0 f0 brcs .+52 ; 0x1c3a2 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c36e: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c370: 8a ea ldi r24, 0xAA ; 170 1c372: 95 e5 ldi r25, 0x55 ; 85 1c374: dc 01 movw r26, r24 1c376: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8f8> 1c37a: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8f9> 1c37e: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8fa> 1c382: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8fb> boot_app_flags = BOOT_APP_FLG_USER0; 1c386: 80 e8 ldi r24, 0x80 ; 128 1c388: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8f7> boot_copy_size = 0; 1c38c: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8f5> 1c390: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8f4> bootapp_reboot_user0(lang << 3); 1c394: cc 0f add r28, r28 1c396: cc 0f add r28, r28 1c398: cc 0f add r28, r28 boot_reserved = reserved; 1c39a: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8f6> // bootapp_print_vars(); softReset(); 1c39e: 0e 94 28 61 call 0xc250 ; 0xc250 lang_boot_update_start(lang); lcd_update_enable(true); 1c3a2: 81 e0 ldi r24, 0x01 ; 1 1c3a4: 0e 94 41 6a call 0xd482 ; 0xd482 menu_goto(lcd_language_menu, 0, true, true); 1c3a8: 21 e0 ldi r18, 0x01 ; 1 1c3aa: 41 e0 ldi r20, 0x01 ; 1 1c3ac: 70 e0 ldi r23, 0x00 ; 0 1c3ae: 60 e0 ldi r22, 0x00 ; 0 1c3b0: 81 ee ldi r24, 0xE1 ; 225 1c3b2: 97 e3 ldi r25, 0x37 ; 55 1c3b4: 0f 94 46 94 call 0x3288c ; 0x3288c 1c3b8: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c3bc: cf 91 pop r28 1c3be: 08 95 ret 0001c3c0 : 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)) { 1c3c0: 0f 93 push r16 1c3c2: 1f 93 push r17 1c3c4: cf 93 push r28 1c3c6: df 93 push r29 1c3c8: eb 01 movw r28, r22 1c3ca: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1c3cc: 81 30 cpi r24, 0x01 ; 1 1c3ce: 81 f0 breq .+32 ; 0x1c3f0 1c3d0: 82 30 cpi r24, 0x02 ; 2 1c3d2: 89 f0 breq .+34 ; 0x1c3f6 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1c3d4: 87 eb ldi r24, 0xB7 ; 183 1c3d6: 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); 1c3d8: 0e 94 32 6d call 0xda64 ; 0xda64 1c3dc: 22 e0 ldi r18, 0x02 ; 2 1c3de: a8 01 movw r20, r16 1c3e0: bc 01 movw r22, r24 1c3e2: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1c3e4: df 91 pop r29 1c3e6: cf 91 pop r28 1c3e8: 1f 91 pop r17 1c3ea: 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); 1c3ec: 0d 94 ab 95 jmp 0x32b56 ; 0x32b56 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); 1c3f0: 80 eb ldi r24, 0xB0 ; 176 1c3f2: 90 e4 ldi r25, 0x40 ; 64 1c3f4: f1 cf rjmp .-30 ; 0x1c3d8 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c3f6: 87 ea ldi r24, 0xA7 ; 167 1c3f8: 90 e4 ldi r25, 0x40 ; 64 1c3fa: ee cf rjmp .-36 ; 0x1c3d8 0001c3fc : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c3fc: 44 e1 ldi r20, 0x14 ; 20 1c3fe: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1c400: 66 23 and r22, r22 1c402: 89 f0 breq .+34 ; 0x1c426 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c404: bc 01 movw r22, r24 1c406: 89 e0 ldi r24, 0x09 ; 9 1c408: 95 e0 ldi r25, 0x05 ; 5 1c40a: 0f 94 29 9f call 0x33e52 ; 0x33e52 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1c40e: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL18lcd_status_message.lto_priv.419+0x14> lcd_status_message_idx = 0; // Print message from beginning 1c412: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1c416: 8a e7 ldi r24, 0x7A ; 122 1c418: 98 e6 ldi r25, 0x68 ; 104 1c41a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1c41e: 81 e0 ldi r24, 0x01 ; 1 1c420: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1c424: 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); 1c426: bc 01 movw r22, r24 1c428: 89 e0 ldi r24, 0x09 ; 9 1c42a: 95 e0 ldi r25, 0x05 ; 5 1c42c: 0f 94 bc a7 call 0x34f78 ; 0x34f78 1c430: ee cf rjmp .-36 ; 0x1c40e 0001c432 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1c432: 90 91 8e 03 lds r25, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 1c436: 89 17 cp r24, r25 1c438: 80 f4 brcc .+32 ; 0x1c45a return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1c43a: 91 30 cpi r25, 0x01 ; 1 1c43c: 61 f4 brne .+24 ; 0x1c456 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1c43e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 1c442: 88 23 and r24, r24 1c444: 51 f0 breq .+20 ; 0x1c45a 1c446: 40 e2 ldi r20, 0x20 ; 32 1c448: 5e e4 ldi r21, 0x4E ; 78 1c44a: 60 e0 ldi r22, 0x00 ; 0 1c44c: 70 e0 ldi r23, 0x00 ; 0 1c44e: 8e e1 ldi r24, 0x1E ; 30 1c450: 95 e0 ldi r25, 0x05 ; 5 1c452: 0d 94 3c 10 jmp 0x22078 ; 0x22078 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1c456: 80 e0 ldi r24, 0x00 ; 0 1c458: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1c45a: 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; } 1c45c: 08 95 ret 0001c45e : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1c45e: ef 92 push r14 1c460: ff 92 push r15 1c462: 1f 93 push r17 1c464: cf 93 push r28 1c466: df 93 push r29 1c468: ec 01 movw r28, r24 1c46a: 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)) { 1c46c: 86 2f mov r24, r22 1c46e: 0e 94 19 e2 call 0x1c432 ; 0x1c432 1c472: 88 23 and r24, r24 1c474: e9 f0 breq .+58 ; 0x1c4b0 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1c476: be 01 movw r22, r28 1c478: 89 e0 ldi r24, 0x09 ; 9 1c47a: 95 e0 ldi r25, 0x05 ; 5 1c47c: 0f 94 ea 9e call 0x33dd4 ; 0x33dd4 1c480: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1c482: 8e e1 ldi r24, 0x1E ; 30 1c484: 95 e0 ldi r25, 0x05 ; 5 1c486: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> lcd_status_message_level = severity; 1c48a: 10 93 8e 03 sts 0x038E, r17 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> custom_message_type = CustomMsg::Status; 1c48e: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 1c492: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 1c496: ef 28 or r14, r15 1c498: 59 f0 breq .+22 ; 0x1c4b0 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1c49a: 61 e0 ldi r22, 0x01 ; 1 1c49c: ce 01 movw r24, r28 1c49e: 0e 94 fe e1 call 0x1c3fc ; 0x1c3fc } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c4a2: df 91 pop r29 1c4a4: cf 91 pop r28 1c4a6: 1f 91 pop r17 1c4a8: ff 90 pop r15 1c4aa: 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(); 1c4ac: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c4b0: df 91 pop r29 1c4b2: cf 91 pop r28 1c4b4: 1f 91 pop r17 1c4b6: ff 90 pop r15 1c4b8: ef 90 pop r14 1c4ba: 08 95 ret 0001c4bc : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1c4bc: ef 92 push r14 1c4be: ff 92 push r15 1c4c0: 1f 93 push r17 1c4c2: cf 93 push r28 1c4c4: df 93 push r29 1c4c6: 18 2f mov r17, r24 1c4c8: eb 01 movw r28, r22 1c4ca: 7a 01 movw r14, r20 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1c4cc: 80 e0 ldi r24, 0x00 ; 0 1c4ce: 0f 94 fd 2c call 0x259fa ; 0x259fa lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1c4d2: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c4d6: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c4da: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c4de: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c4e2: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 1c4e6: 80 e0 ldi r24, 0x00 ; 0 1c4e8: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_clear(); 1c4ec: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1c4f0: 87 e7 ldi r24, 0x77 ; 119 1c4f2: 9f e3 ldi r25, 0x3F ; 63 1c4f4: 0e 94 32 6d call 0xda64 ; 0xda64 1c4f8: ac 01 movw r20, r24 1c4fa: 60 e0 ldi r22, 0x00 ; 0 1c4fc: 80 e0 ldi r24, 0x00 ; 0 1c4fe: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1c502: 87 e6 ldi r24, 0x67 ; 103 1c504: 9f e3 ldi r25, 0x3F ; 63 1c506: 0e 94 32 6d call 0xda64 ; 0xda64 1c50a: ac 01 movw r20, r24 1c50c: 61 e0 ldi r22, 0x01 ; 1 1c50e: 80 e0 ldi r24, 0x00 ; 0 1c510: 0e 94 10 6a call 0xd420 ; 0xd420 switch (testError) 1c514: 11 50 subi r17, 0x01 ; 1 1c516: 19 30 cpi r17, 0x09 ; 9 1c518: 88 f4 brcc .+34 ; 0x1c53c 1c51a: e1 2f mov r30, r17 1c51c: f0 e0 ldi r31, 0x00 ; 0 1c51e: 88 27 eor r24, r24 1c520: eb 56 subi r30, 0x6B ; 107 1c522: fd 41 sbci r31, 0x1D ; 29 1c524: 8f 4f sbci r24, 0xFF ; 255 1c526: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 1c52a: d6 e2 ldi r29, 0x26 ; 38 1c52c: e2 e2 ldi r30, 0x22 ; 34 1c52e: fa e2 ldi r31, 0x2A ; 42 1c530: 1b e3 ldi r17, 0x3B ; 59 1c532: 27 e3 ldi r18, 0x37 ; 55 1c534: 2a e3 ldi r18, 0x3A ; 58 1c536: 2d e3 ldi r18, 0x3D ; 61 1c538: 30 e3 ldi r19, 0x30 ; 48 1c53a: 3c e3 ldi r19, 0x3C ; 60 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1c53c: 83 e5 ldi r24, 0x53 ; 83 1c53e: 9f e3 ldi r25, 0x3F ; 63 1c540: 0e 94 32 6d call 0xda64 ; 0xda64 1c544: ac 01 movw r20, r24 1c546: 62 e0 ldi r22, 0x02 ; 2 1c548: 80 e0 ldi r24, 0x00 ; 0 1c54a: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1c54e: 83 e4 ldi r24, 0x43 ; 67 1c550: 9f e3 ldi r25, 0x3F ; 63 break; case TestError::Bed: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_BEDHEATER)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c552: 0e 94 32 6d call 0xda64 ; 0xda64 1c556: ac 01 movw r20, r24 1c558: 63 e0 ldi r22, 0x03 ; 3 1c55a: 80 e0 ldi r24, 0x00 ; 0 1c55c: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1c560: 68 ee ldi r22, 0xE8 ; 232 1c562: 73 e0 ldi r23, 0x03 ; 3 1c564: 80 e0 ldi r24, 0x00 ; 0 1c566: 90 e0 ldi r25, 0x00 ; 0 1c568: 0f 94 d5 0d call 0x21baa ; 0x21baa 1c56c: 80 e0 ldi r24, 0x00 ; 0 1c56e: 0f 94 fd 2c call 0x259fa ; 0x259fa lcd_beeper_quick_feedback(); do { _delay(100); 1c572: 64 e6 ldi r22, 0x64 ; 100 1c574: 70 e0 ldi r23, 0x00 ; 0 1c576: 80 e0 ldi r24, 0x00 ; 0 1c578: 90 e0 ldi r25, 0x00 ; 0 1c57a: 0f 94 d5 0d call 0x21baa ; 0x21baa manage_heater(); 1c57e: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(); 1c582: 80 e0 ldi r24, 0x00 ; 0 1c584: 0e 94 89 7a call 0xf512 ; 0xf512 } while (!lcd_clicked()); 1c588: 0e 94 19 6c call 0xd832 ; 0xd832 1c58c: 88 23 and r24, r24 1c58e: 89 f3 breq .-30 ; 0x1c572 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1c590: 89 ec ldi r24, 0xC9 ; 201 1c592: 9f e3 ldi r25, 0x3F ; 63 1c594: 0e 94 32 6d call 0xda64 ; 0xda64 1c598: 62 e0 ldi r22, 0x02 ; 2 1c59a: 0e 94 2f e2 call 0x1c45e ; 0x1c45e lcd_return_to_status(); } 1c59e: df 91 pop r29 1c5a0: cf 91 pop r28 1c5a2: 1f 91 pop r17 1c5a4: ff 90 pop r15 1c5a6: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1c5a8: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 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)); 1c5ac: 86 e3 ldi r24, 0x36 ; 54 1c5ae: 9f e3 ldi r25, 0x3F ; 63 1c5b0: 0e 94 32 6d call 0xda64 ; 0xda64 1c5b4: ac 01 movw r20, r24 1c5b6: 62 e0 ldi r22, 0x02 ; 2 1c5b8: 80 e0 ldi r24, 0x00 ; 0 1c5ba: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c5be: 87 e2 ldi r24, 0x27 ; 39 1c5c0: 9f e3 ldi r25, 0x3F ; 63 1c5c2: c7 cf rjmp .-114 ; 0x1c552 break; case TestError::Endstops: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOPS)); 1c5c4: 8c e1 ldi r24, 0x1C ; 28 1c5c6: 9f e3 ldi r25, 0x3F ; 63 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)); 1c5c8: 0e 94 32 6d call 0xda64 ; 0xda64 1c5cc: ac 01 movw r20, r24 1c5ce: 62 e0 ldi r22, 0x02 ; 2 1c5d0: 80 e0 ldi r24, 0x00 ; 0 1c5d2: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c5d6: 87 e2 ldi r24, 0x27 ; 39 1c5d8: 9f e3 ldi r25, 0x3F ; 63 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)); 1c5da: 0e 94 32 6d call 0xda64 ; 0xda64 1c5de: ac 01 movw r20, r24 1c5e0: 63 e0 ldi r22, 0x03 ; 3 1c5e2: 80 e0 ldi r24, 0x00 ; 0 1c5e4: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(18, 3); 1c5e8: 63 e0 ldi r22, 0x03 ; 3 1c5ea: 82 e1 ldi r24, 0x12 ; 18 1c5ec: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(_error_1); 1c5f0: ce 01 movw r24, r28 1c5f2: 1e c0 rjmp .+60 ; 0x1c630 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)); 1c5f4: 84 e1 ldi r24, 0x14 ; 20 1c5f6: 9f e3 ldi r25, 0x3F ; 63 1c5f8: 0e 94 32 6d call 0xda64 ; 0xda64 1c5fc: ac 01 movw r20, r24 1c5fe: 62 e0 ldi r22, 0x02 ; 2 1c600: 80 e0 ldi r24, 0x00 ; 0 1c602: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(18, 2); 1c606: 62 e0 ldi r22, 0x02 ; 2 1c608: 82 e1 ldi r24, 0x12 ; 18 1c60a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(_error_1); 1c60e: ce 01 movw r24, r28 1c610: 0e 94 03 6c call 0xd806 ; 0xd806 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1c614: 8a e0 ldi r24, 0x0A ; 10 1c616: 9f e3 ldi r25, 0x3F ; 63 1c618: 0e 94 32 6d call 0xda64 ; 0xda64 1c61c: ac 01 movw r20, r24 1c61e: 63 e0 ldi r22, 0x03 ; 3 1c620: 80 e0 ldi r24, 0x00 ; 0 1c622: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(18, 3); 1c626: 63 e0 ldi r22, 0x03 ; 3 1c628: 82 e1 ldi r24, 0x12 ; 18 1c62a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(_error_2); 1c62e: 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); 1c630: 0e 94 03 6c call 0xd806 ; 0xd806 1c634: 95 cf rjmp .-214 ; 0x1c560 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)); 1c636: 88 ef ldi r24, 0xF8 ; 248 1c638: 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)); 1c63a: 0e 94 32 6d call 0xda64 ; 0xda64 1c63e: ac 01 movw r20, r24 1c640: 62 e0 ldi r22, 0x02 ; 2 1c642: 80 e0 ldi r24, 0x00 ; 0 1c644: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1c648: 84 e1 ldi r24, 0x14 ; 20 1c64a: 9f e3 ldi r25, 0x3F ; 63 1c64c: c6 cf rjmp .-116 ; 0x1c5da 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)); 1c64e: 80 e9 ldi r24, 0x90 ; 144 1c650: 94 e4 ldi r25, 0x44 ; 68 1c652: ba cf rjmp .-140 ; 0x1c5c8 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)); 1c654: 8d e7 ldi r24, 0x7D ; 125 1c656: 94 e4 ldi r25, 0x44 ; 68 1c658: b7 cf rjmp .-146 ; 0x1c5c8 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)); 1c65a: 89 ee ldi r24, 0xE9 ; 233 1c65c: 9e e3 ldi r25, 0x3E ; 62 1c65e: ed cf rjmp .-38 ; 0x1c63a 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)); 1c660: 8b ed ldi r24, 0xDB ; 219 1c662: 9e e3 ldi r25, 0x3E ; 62 1c664: 0e 94 32 6d call 0xda64 ; 0xda64 1c668: ac 01 movw r20, r24 1c66a: 62 e0 ldi r22, 0x02 ; 2 1c66c: 80 e0 ldi r24, 0x00 ; 0 1c66e: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1c672: 84 ed ldi r24, 0xD4 ; 212 1c674: 9e e3 ldi r25, 0x3E ; 62 1c676: b1 cf rjmp .-158 ; 0x1c5da lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1c678: 82 ec ldi r24, 0xC2 ; 194 1c67a: 9e e3 ldi r25, 0x3E ; 62 1c67c: 0e 94 32 6d call 0xda64 ; 0xda64 1c680: ac 01 movw r20, r24 1c682: 62 e0 ldi r22, 0x02 ; 2 1c684: 80 e0 ldi r24, 0x00 ; 0 1c686: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1c68a: 88 eb ldi r24, 0xB8 ; 184 1c68c: 9e e3 ldi r25, 0x3E ; 62 1c68e: a5 cf rjmp .-182 ; 0x1c5da 0001c690 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1c690: 8f 92 push r8 1c692: 9f 92 push r9 1c694: af 92 push r10 1c696: bf 92 push r11 1c698: cf 92 push r12 1c69a: df 92 push r13 1c69c: ef 92 push r14 1c69e: ff 92 push r15 1c6a0: 0f 93 push r16 1c6a2: 1f 93 push r17 1c6a4: cf 93 push r28 1c6a6: df 93 push r29 1c6a8: f8 2e mov r15, r24 1c6aa: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c6ae: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c6b2: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c6b6: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c6ba: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1c6be: 4b 01 movw r8, r22 1c6c0: 6b 01 movw r12, r22 1c6c2: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c6c6: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c6ca: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c6ce: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c6d2: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1c6d6: 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 1c6d8: 9c e3 ldi r25, 0x3C ; 60 1c6da: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1c6dc: 88 ec ldi r24, 0xC8 ; 200 1c6de: 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); 1c6e0: ff 20 and r15, r15 1c6e2: 31 f0 breq .+12 ; 0x1c6f0 1c6e4: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1c6e6: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1c6e8: 24 eb ldi r18, 0xB4 ; 180 1c6ea: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1c6ec: 90 e0 ldi r25, 0x00 ; 0 1c6ee: 80 e0 ldi r24, 0x00 ; 0 1c6f0: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 1c6f4: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 target_temperature_bed = (_isbed) ? 100 : 0; 1c6f8: 84 e6 ldi r24, 0x64 ; 100 1c6fa: 90 e0 ldi r25, 0x00 ; 0 1c6fc: f1 10 cpse r15, r1 1c6fe: 02 c0 rjmp .+4 ; 0x1c704 1c700: 90 e0 ldi r25, 0x00 ; 0 1c702: 80 e0 ldi r24, 0x00 ; 0 1c704: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee 1c708: 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(); 1c70c: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1c710: 81 e0 ldi r24, 0x01 ; 1 1c712: 0e 94 89 7a call 0xf512 ; 0xf512 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c716: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1c718: 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 1c71a: 85 e0 ldi r24, 0x05 ; 5 1c71c: 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) 1c71e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1c722: 81 11 cpse r24, r1 1c724: 1c c0 rjmp .+56 ; 0x1c75e { manage_heater(); 1c726: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1c72a: 81 e0 ldi r24, 0x01 ; 1 1c72c: 0e 94 89 7a call 0xf512 ; 0xf512 _progress = (_isbed? 1c730: 00 e9 ldi r16, 0x90 ; 144 1c732: 11 e0 ldi r17, 0x01 ; 1 1c734: 20 e0 ldi r18, 0x00 ; 0 1c736: 42 e0 ldi r20, 0x02 ; 2 1c738: 6b 2d mov r22, r11 1c73a: 87 e0 ldi r24, 0x07 ; 7 1c73c: f1 10 cpse r15, r1 1c73e: 01 c0 rjmp .+2 ; 0x1c742 1c740: 88 e0 ldi r24, 0x08 ; 8 1c742: 0e 94 30 b9 call 0x17260 ; 0x17260 1c746: 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 1c748: 8e 2d mov r24, r14 1c74a: 69 2d mov r22, r9 1c74c: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 1c750: 91 11 cpse r25, r1 1c752: 02 c0 rjmp .+4 ; 0x1c758 1c754: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c758: e3 94 inc r14 1c75a: ea 10 cpse r14, r10 1c75c: e0 cf rjmp .-64 ; 0x1c71e MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1c75e: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c762: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c766: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c76a: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c76e: 0f 94 af 32 call 0x2655e ; 0x2655e 1c772: b6 01 movw r22, r12 1c774: dd 0c add r13, r13 1c776: 88 0b sbc r24, r24 1c778: 99 0b sbc r25, r25 1c77a: 4e 01 movw r8, r28 1c77c: dd 0f add r29, r29 1c77e: aa 08 sbc r10, r10 1c780: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c782: ff 20 and r15, r15 1c784: 09 f4 brne .+2 ; 0x1c788 1c786: 4d c0 rjmp .+154 ; 0x1c822 1c788: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1c78c: 9b 01 movw r18, r22 1c78e: ac 01 movw r20, r24 1c790: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c794: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c798: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c79c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c7a0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1c7a4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1c7a8: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c7aa: c5 01 movw r24, r10 1c7ac: b4 01 movw r22, r8 1c7ae: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1c7b2: 9b 01 movw r18, r22 1c7b4: ac 01 movw r20, r24 1c7b6: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c7ba: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c7be: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c7c2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c7c6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1c7ca: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c7ce: 10 91 ce 11 lds r17, 0x11CE ; 0x8011ce 1c7d2: 11 11 cpse r17, r1 1c7d4: 0c c0 rjmp .+24 ; 0x1c7ee 1c7d6: f1 10 cpse r15, r1 1c7d8: 44 c0 rjmp .+136 ; 0x1c862 1c7da: 69 30 cpi r22, 0x09 ; 9 1c7dc: 71 05 cpc r23, r1 1c7de: 0c f0 brlt .+2 ; 0x1c7e2 1c7e0: 46 c0 rjmp .+140 ; 0x1c86e { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c7e2: 8e e1 ldi r24, 0x1E ; 30 1c7e4: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1c7e6: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c7e8: c8 17 cp r28, r24 1c7ea: d9 07 cpc r29, r25 1c7ec: 3c f4 brge .+14 ; 0x1c7fc _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1c7ee: 4a ed ldi r20, 0xDA ; 218 1c7f0: 52 e0 ldi r21, 0x02 ; 2 1c7f2: ba 01 movw r22, r20 1c7f4: 80 e0 ldi r24, 0x00 ; 0 1c7f6: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1c7fa: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1c7fc: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1c800: 81 e0 ldi r24, 0x01 ; 1 1c802: 0e 94 89 7a call 0xf512 ; 0xf512 return _stepresult; } 1c806: 81 2f mov r24, r17 1c808: df 91 pop r29 1c80a: cf 91 pop r28 1c80c: 1f 91 pop r17 1c80e: 0f 91 pop r16 1c810: ff 90 pop r15 1c812: ef 90 pop r14 1c814: df 90 pop r13 1c816: cf 90 pop r12 1c818: bf 90 pop r11 1c81a: af 90 pop r10 1c81c: 9f 90 pop r9 1c81e: 8f 90 pop r8 1c820: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c822: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1c826: 9b 01 movw r18, r22 1c828: ac 01 movw r20, r24 1c82a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c82e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c832: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c836: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c83a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1c83e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1c842: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c844: c5 01 movw r24, r10 1c846: b4 01 movw r22, r8 1c848: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1c84c: 9b 01 movw r18, r22 1c84e: ac 01 movw r20, r24 1c850: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c854: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c858: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c85c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c860: b2 cf rjmp .-156 ; 0x1c7c6 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c862: 89 e0 ldi r24, 0x09 ; 9 1c864: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c866: 6e 31 cpi r22, 0x1E ; 30 1c868: 71 05 cpc r23, r1 1c86a: 0c f4 brge .+2 ; 0x1c86e 1c86c: bc cf rjmp .-136 ; 0x1c7e6 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1c86e: 4a ed ldi r20, 0xDA ; 218 1c870: 52 e0 ldi r21, 0x02 ; 2 1c872: ba 01 movw r22, r20 1c874: 81 e0 ldi r24, 0x01 ; 1 1c876: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc 1c87a: c0 cf rjmp .-128 ; 0x1c7fc 0001c87c : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1c87c: 2f 92 push r2 1c87e: 3f 92 push r3 1c880: 4f 92 push r4 1c882: 5f 92 push r5 1c884: 6f 92 push r6 1c886: 7f 92 push r7 1c888: 8f 92 push r8 1c88a: 9f 92 push r9 1c88c: af 92 push r10 1c88e: bf 92 push r11 1c890: cf 92 push r12 1c892: df 92 push r13 1c894: ef 92 push r14 1c896: ff 92 push r15 1c898: 0f 93 push r16 1c89a: 1f 93 push r17 1c89c: cf 93 push r28 1c89e: df 93 push r29 1c8a0: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1c8a2: 0e 94 4a 60 call 0xc094 ; 0xc094 manage_inactivity(true); 1c8a6: 81 e0 ldi r24, 0x01 ; 1 1c8a8: 0e 94 89 7a call 0xf512 ; 0xf512 if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1c8ac: 18 01 movw r2, r16 1c8ae: 22 0c add r2, r2 1c8b0: 33 1c adc r3, r3 1c8b2: 22 0c add r2, r2 1c8b4: 33 1c adc r3, r3 1c8b6: e1 01 movw r28, r2 1c8b8: cb 50 subi r28, 0x0B ; 11 1c8ba: de 4e sbci r29, 0xEE ; 238 1c8bc: 88 80 ld r8, Y 1c8be: 99 80 ldd r9, Y+1 ; 0x01 1c8c0: aa 80 ldd r10, Y+2 ; 0x02 1c8c2: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1c8c4: 20 e0 ldi r18, 0x00 ; 0 1c8c6: 30 e0 ldi r19, 0x00 ; 0 1c8c8: 40 e0 ldi r20, 0x00 ; 0 1c8ca: 50 e4 ldi r21, 0x40 ; 64 1c8cc: c5 01 movw r24, r10 1c8ce: b4 01 movw r22, r8 1c8d0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1c8d4: 68 83 st Y, r22 1c8d6: 79 83 std Y+1, r23 ; 0x01 1c8d8: 8a 83 std Y+2, r24 ; 0x02 1c8da: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c8dc: 60 e0 ldi r22, 0x00 ; 0 1c8de: 70 e0 ldi r23, 0x00 ; 0 1c8e0: 84 e3 ldi r24, 0x34 ; 52 1c8e2: 92 e4 ldi r25, 0x42 ; 66 1c8e4: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 1c8e8: 95 e0 ldi r25, 0x05 ; 5 1c8ea: e9 2e mov r14, r25 1c8ec: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1c8ee: 0e 94 4a 60 call 0xc094 ; 0xc094 current_position[axis] = current_position[axis] + move; 1c8f2: 20 e0 ldi r18, 0x00 ; 0 1c8f4: 30 e0 ldi r19, 0x00 ; 0 1c8f6: 48 e4 ldi r20, 0x48 ; 72 1c8f8: 52 e4 ldi r21, 0x42 ; 66 1c8fa: 68 81 ld r22, Y 1c8fc: 79 81 ldd r23, Y+1 ; 0x01 1c8fe: 8a 81 ldd r24, Y+2 ; 0x02 1c900: 9b 81 ldd r25, Y+3 ; 0x03 1c902: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1c906: 68 83 st Y, r22 1c908: 79 83 std Y+1, r23 ; 0x01 1c90a: 8a 83 std Y+2, r24 ; 0x02 1c90c: 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); 1c90e: 6c e6 ldi r22, 0x6C ; 108 1c910: 70 e0 ldi r23, 0x00 ; 0 1c912: 8e e2 ldi r24, 0x2E ; 46 1c914: 0e 94 69 c0 call 0x180d2 ; 0x180d2 st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1c918: 60 e0 ldi r22, 0x00 ; 0 1c91a: 70 e0 ldi r23, 0x00 ; 0 1c91c: 88 e4 ldi r24, 0x48 ; 72 1c91e: 93 e4 ldi r25, 0x43 ; 67 1c920: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1c924: 0f 94 a0 22 call 0x24540 ; 0x24540 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1c928: 80 91 89 03 lds r24, 0x0389 ; 0x800389 1c92c: 62 e2 ldi r22, 0x22 ; 34 1c92e: 70 e0 ldi r23, 0x00 ; 0 1c930: 81 11 cpse r24, r1 1c932: 02 c0 rjmp .+4 ; 0x1c938 1c934: 64 e4 ldi r22, 0x44 ; 68 1c936: 70 e0 ldi r23, 0x00 ; 0 1c938: 8e e2 ldi r24, 0x2E ; 46 1c93a: 0e 94 69 c0 call 0x180d2 ; 0x180d2 else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1c93e: 20 e0 ldi r18, 0x00 ; 0 1c940: 30 e0 ldi r19, 0x00 ; 0 1c942: 48 e4 ldi r20, 0x48 ; 72 1c944: 52 e4 ldi r21, 0x42 ; 66 1c946: 68 81 ld r22, Y 1c948: 79 81 ldd r23, Y+1 ; 0x01 1c94a: 8a 81 ldd r24, Y+2 ; 0x02 1c94c: 9b 81 ldd r25, Y+3 ; 0x03 1c94e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1c952: 68 83 st Y, r22 1c954: 79 83 std Y+1, r23 ; 0x01 1c956: 8a 83 std Y+2, r24 ; 0x02 1c958: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1c95a: 60 e0 ldi r22, 0x00 ; 0 1c95c: 70 e0 ldi r23, 0x00 ; 0 1c95e: 88 e4 ldi r24, 0x48 ; 72 1c960: 92 e4 ldi r25, 0x42 ; 66 1c962: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1c966: 0f 94 a0 22 call 0x24540 ; 0x24540 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c96a: 1e 99 sbic 0x03, 6 ; 3 1c96c: 3a c0 rjmp .+116 ; 0x1c9e2 1c96e: 1d 99 sbic 0x03, 5 ; 3 1c970: 38 c0 rjmp .+112 ; 0x1c9e2 1c972: 21 e0 ldi r18, 0x01 ; 1 1c974: e2 1a sub r14, r18 1c976: 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++) { 1c978: 09 f0 breq .+2 ; 0x1c97c 1c97a: b9 cf rjmp .-142 ; 0x1c8ee ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1c97c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1c980: 2b 01 movw r4, r22 1c982: 3c 01 movw r6, r24 1c984: 24 ec ldi r18, 0xC4 ; 196 1c986: 42 0e add r4, r18 1c988: 29 e0 ldi r18, 0x09 ; 9 1c98a: 52 1e adc r5, r18 1c98c: 61 1c adc r6, r1 1c98e: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1c990: 81 e0 ldi r24, 0x01 ; 1 1c992: 0e 94 89 7a call 0xf512 ; 0xf512 1c996: e1 01 movw r28, r2 1c998: cb 50 subi r28, 0x0B ; 11 1c99a: de 4e sbci r29, 0xEE ; 238 1c99c: c8 80 ld r12, Y 1c99e: d9 80 ldd r13, Y+1 ; 0x01 1c9a0: ea 80 ldd r14, Y+2 ; 0x02 1c9a2: 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]) { 1c9a4: 20 e0 ldi r18, 0x00 ; 0 1c9a6: 30 e0 ldi r19, 0x00 ; 0 1c9a8: 40 e8 ldi r20, 0x80 ; 128 1c9aa: 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) || 1c9ac: 1e 99 sbic 0x03, 6 ; 3 1c9ae: 26 c0 rjmp .+76 ; 0x1c9fc 1c9b0: 1d 99 sbic 0x03, 5 ; 3 1c9b2: 24 c0 rjmp .+72 ; 0x1c9fc lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1c9b4: c7 01 movw r24, r14 1c9b6: b6 01 movw r22, r12 1c9b8: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1c9bc: 68 83 st Y, r22 1c9be: 79 83 std Y+1, r23 ; 0x01 1c9c0: 8a 83 std Y+2, r24 ; 0x02 1c9c2: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c9c4: 60 e0 ldi r22, 0x00 ; 0 1c9c6: 70 e0 ldi r23, 0x00 ; 0 1c9c8: 84 e3 ldi r24, 0x34 ; 52 1c9ca: 92 e4 ldi r25, 0x42 ; 66 1c9cc: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1c9d0: 0f 94 a0 22 call 0x24540 ; 0x24540 if (_millis() > timeout_counter) { 1c9d4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1c9d8: 46 16 cp r4, r22 1c9da: 57 06 cpc r5, r23 1c9dc: 68 06 cpc r6, r24 1c9de: 79 06 cpc r7, r25 1c9e0: e8 f6 brcc .-70 ; 0x1c99c lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1c9e2: 6b ed ldi r22, 0xDB ; 219 1c9e4: 72 e0 ldi r23, 0x02 ; 2 1c9e6: 01 2b or r16, r17 1c9e8: 11 f0 breq .+4 ; 0x1c9ee 1c9ea: 6d ed ldi r22, 0xDD ; 221 1c9ec: 72 e0 ldi r23, 0x02 ; 2 1c9ee: 4a ed ldi r20, 0xDA ; 218 1c9f0: 52 e0 ldi r21, 0x02 ; 2 1c9f2: 87 e0 ldi r24, 0x07 ; 7 1c9f4: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc return(false); 1c9f8: 80 e0 ldi r24, 0x00 ; 0 1c9fa: 30 c0 rjmp .+96 ; 0x1ca5c 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]) { 1c9fc: c5 01 movw r24, r10 1c9fe: b4 01 movw r22, r8 1ca00: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1ca04: a7 01 movw r20, r14 1ca06: 96 01 movw r18, r12 1ca08: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1ca0c: 18 16 cp r1, r24 1ca0e: 4c f3 brlt .-46 ; 0x1c9e2 1ca10: 20 e0 ldi r18, 0x00 ; 0 1ca12: 30 e0 ldi r19, 0x00 ; 0 1ca14: 40 e8 ldi r20, 0x80 ; 128 1ca16: 5f e3 ldi r21, 0x3F ; 63 1ca18: c5 01 movw r24, r10 1ca1a: b4 01 movw r22, r8 1ca1c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1ca20: a7 01 movw r20, r14 1ca22: 96 01 movw r18, r12 1ca24: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1ca28: 87 fd sbrc r24, 7 1ca2a: db cf rjmp .-74 ; 0x1c9e2 current_position[axis] += 10; 1ca2c: e1 01 movw r28, r2 1ca2e: cb 50 subi r28, 0x0B ; 11 1ca30: de 4e sbci r29, 0xEE ; 238 1ca32: 20 e0 ldi r18, 0x00 ; 0 1ca34: 30 e0 ldi r19, 0x00 ; 0 1ca36: 40 e2 ldi r20, 0x20 ; 32 1ca38: 51 e4 ldi r21, 0x41 ; 65 1ca3a: c7 01 movw r24, r14 1ca3c: b6 01 movw r22, r12 1ca3e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1ca42: 68 83 st Y, r22 1ca44: 79 83 std Y+1, r23 ; 0x01 1ca46: 8a 83 std Y+2, r24 ; 0x02 1ca48: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ca4a: 60 e0 ldi r22, 0x00 ; 0 1ca4c: 70 e0 ldi r23, 0x00 ; 0 1ca4e: 84 e3 ldi r24, 0x34 ; 52 1ca50: 92 e4 ldi r25, 0x42 ; 66 1ca52: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1ca56: 0f 94 a0 22 call 0x24540 ; 0x24540 return(true); 1ca5a: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1ca5c: df 91 pop r29 1ca5e: cf 91 pop r28 1ca60: 1f 91 pop r17 1ca62: 0f 91 pop r16 1ca64: ff 90 pop r15 1ca66: ef 90 pop r14 1ca68: df 90 pop r13 1ca6a: cf 90 pop r12 1ca6c: bf 90 pop r11 1ca6e: af 90 pop r10 1ca70: 9f 90 pop r9 1ca72: 8f 90 pop r8 1ca74: 7f 90 pop r7 1ca76: 6f 90 pop r6 1ca78: 5f 90 pop r5 1ca7a: 4f 90 pop r4 1ca7c: 3f 90 pop r3 1ca7e: 2f 90 pop r2 1ca80: 08 95 ret 0001ca82 : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca82: 2f 92 push r2 1ca84: 3f 92 push r3 1ca86: 4f 92 push r4 1ca88: 5f 92 push r5 1ca8a: 6f 92 push r6 1ca8c: 7f 92 push r7 1ca8e: 8f 92 push r8 1ca90: 9f 92 push r9 1ca92: af 92 push r10 1ca94: bf 92 push r11 1ca96: cf 92 push r12 1ca98: df 92 push r13 1ca9a: ef 92 push r14 1ca9c: ff 92 push r15 1ca9e: 0f 93 push r16 1caa0: 1f 93 push r17 1caa2: cf 93 push r28 1caa4: df 93 push r29 1caa6: 7c 01 movw r14, r24 1caa8: 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); 1caaa: cb 01 movw r24, r22 1caac: 6a e0 ldi r22, 0x0A ; 10 1caae: 70 e0 ldi r23, 0x00 ; 0 1cab0: 0f 94 19 a2 call 0x34432 ; 0x34432 <__divmodhi4> 1cab4: 66 0e add r6, r22 1cab6: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1cab8: e1 14 cp r14, r1 1caba: f1 04 cpc r15, r1 1cabc: e1 f4 brne .+56 ; 0x1caf6 current_position[Z_AXIS] += 17; 1cabe: 20 e0 ldi r18, 0x00 ; 0 1cac0: 30 e0 ldi r19, 0x00 ; 0 1cac2: 48 e8 ldi r20, 0x88 ; 136 1cac4: 51 e4 ldi r21, 0x41 ; 65 1cac6: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1caca: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1cace: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1cad2: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1cad6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1cada: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1cade: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1cae2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1cae6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1caea: 60 e0 ldi r22, 0x00 ; 0 1caec: 70 e0 ldi r23, 0x00 ; 0 1caee: 84 e3 ldi r24, 0x34 ; 52 1caf0: 92 e4 ldi r25, 0x42 ; 66 1caf2: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1caf6: 10 e0 ldi r17, 0x00 ; 0 1caf8: 00 e0 ldi r16, 0x00 ; 0 1cafa: d0 e0 ldi r29, 0x00 ; 0 1cafc: c0 e0 ldi r28, 0x00 ; 0 1cafe: d1 2c mov r13, r1 1cb00: c1 2c mov r12, r1 1cb02: 31 2c mov r3, r1 1cb04: 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; 1cb06: 57 01 movw r10, r14 1cb08: aa 0c add r10, r10 1cb0a: bb 1c adc r11, r11 1cb0c: aa 0c add r10, r10 1cb0e: bb 1c adc r11, r11 1cb10: c5 01 movw r24, r10 1cb12: 8b 50 subi r24, 0x0B ; 11 1cb14: 9e 4e sbci r25, 0xEE ; 238 1cb16: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cb18: 94 e0 ldi r25, 0x04 ; 4 1cb1a: 29 2e mov r2, r25 1cb1c: 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; 1cb1e: 20 e0 ldi r18, 0x00 ; 0 1cb20: 30 e0 ldi r19, 0x00 ; 0 1cb22: 40 e8 ldi r20, 0x80 ; 128 1cb24: 5f e3 ldi r21, 0x3F ; 63 1cb26: f4 01 movw r30, r8 1cb28: 60 81 ld r22, Z 1cb2a: 71 81 ldd r23, Z+1 ; 0x01 1cb2c: 82 81 ldd r24, Z+2 ; 0x02 1cb2e: 93 81 ldd r25, Z+3 ; 0x03 1cb30: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1cb34: f4 01 movw r30, r8 1cb36: 60 83 st Z, r22 1cb38: 71 83 std Z+1, r23 ; 0x01 1cb3a: 82 83 std Z+2, r24 ; 0x02 1cb3c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cb3e: 60 e0 ldi r22, 0x00 ; 0 1cb40: 70 e0 ldi r23, 0x00 ; 0 1cb42: 84 e3 ldi r24, 0x34 ; 52 1cb44: 92 e4 ldi r25, 0x42 ; 66 1cb46: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1cb4a: 0f 94 a0 22 call 0x24540 ; 0x24540 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1cb4e: 1e 99 sbic 0x03, 6 ; 3 1cb50: 04 c0 rjmp .+8 ; 0x1cb5a 1cb52: 1d 99 sbic 0x03, 5 ; 3 1cb54: 02 c0 rjmp .+4 ; 0x1cb5a 1cb56: 1c 9b sbis 0x03, 4 ; 3 1cb58: 39 c0 rjmp .+114 ; 0x1cbcc (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb5a: 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) 1cb5c: e1 14 cp r14, r1 1cb5e: f1 04 cpc r15, r1 1cb60: 51 f4 brne .+20 ; 0x1cb76 { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb62: 56 fa bst r5, 6 1cb64: 55 24 eor r5, r5 1cb66: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1cb68: 1d 99 sbic 0x03, 5 ; 3 1cb6a: 8e c0 rjmp .+284 ; 0x1cc88 } 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; 1cb6c: c2 e0 ldi r28, 0x02 ; 2 1cb6e: 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; 1cb70: 44 24 eor r4, r4 1cb72: 43 94 inc r4 1cb74: 2c c0 rjmp .+88 ; 0x1cbce { _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) 1cb76: f1 e0 ldi r31, 0x01 ; 1 1cb78: ef 16 cp r14, r31 1cb7a: f1 04 cpc r15, r1 1cb7c: 41 f4 brne .+16 ; 0x1cb8e { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb7e: 55 fa bst r5, 5 1cb80: 55 24 eor r5, r5 1cb82: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1cb84: 1e 9b sbis 0x03, 6 ; 3 1cb86: f2 cf rjmp .-28 ; 0x1cb6c 1cb88: d0 e0 ldi r29, 0x00 ; 0 1cb8a: c0 e0 ldi r28, 0x00 ; 0 1cb8c: f1 cf rjmp .-30 ; 0x1cb70 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb8e: 54 fa bst r5, 4 1cb90: 55 24 eor r5, r5 1cb92: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1cb94: 83 b1 in r24, 0x03 ; 3 1cb96: 82 95 swap r24 1cb98: 86 95 lsr r24 1cb9a: 86 95 lsr r24 1cb9c: 83 70 andi r24, 0x03 ; 3 1cb9e: 21 e0 ldi r18, 0x01 ; 1 1cba0: 82 27 eor r24, r18 1cba2: 81 70 andi r24, 0x01 ; 1 1cba4: c8 2f mov r28, r24 1cba6: 80 e0 ldi r24, 0x00 ; 0 1cba8: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1cbaa: 8f 93 push r24 1cbac: cf 93 push r28 1cbae: 1f 92 push r1 1cbb0: 5f 92 push r5 1cbb2: e4 ed ldi r30, 0xD4 ; 212 1cbb4: f3 e8 ldi r31, 0x83 ; 131 1cbb6: ff 93 push r31 1cbb8: ef 93 push r30 1cbba: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 1cbbe: 0f 90 pop r0 1cbc0: 0f 90 pop r0 1cbc2: 0f 90 pop r0 1cbc4: 0f 90 pop r0 1cbc6: 0f 90 pop r0 1cbc8: 0f 90 pop r0 1cbca: d2 cf rjmp .-92 ; 0x1cb70 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) || 1cbcc: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1cbce: 06 30 cpi r16, 0x06 ; 6 1cbd0: 11 05 cpc r17, r1 1cbd2: 0c f0 brlt .+2 ; 0x1cbd6 1cbd4: 4f c0 rjmp .+158 ; 0x1cc74 { _lcd_refresh++; 1cbd6: 0f 5f subi r16, 0xFF ; 255 1cbd8: 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(); 1cbda: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1cbde: 81 e0 ldi r24, 0x01 ; 1 1cbe0: 0e 94 89 7a call 0xf512 ; 0xf512 (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1cbe4: 6c 14 cp r6, r12 1cbe6: 7d 04 cpc r7, r13 1cbe8: 34 f0 brlt .+12 ; 0x1cbf6 1cbea: 8f ef ldi r24, 0xFF ; 255 1cbec: c8 1a sub r12, r24 1cbee: d8 0a sbc r13, r24 } while (!_stepdone); 1cbf0: 44 20 and r4, r4 1cbf2: 09 f4 brne .+2 ; 0x1cbf6 1cbf4: 94 cf rjmp .-216 ; 0x1cb1e if (!_stepresult) 1cbf6: 51 10 cpse r5, r1 1cbf8: 20 c0 rjmp .+64 ; 0x1cc3a { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1cbfa: 6d ed ldi r22, 0xDD ; 221 1cbfc: 72 e0 ldi r23, 0x02 ; 2 1cbfe: 91 e0 ldi r25, 0x01 ; 1 1cc00: e9 16 cp r14, r25 1cc02: f1 04 cpc r15, r1 1cc04: 41 f0 breq .+16 ; 0x1cc16 if (_axis == Z_AXIS) _error_1 = "Z"; 1cc06: 6f ed ldi r22, 0xDF ; 223 1cc08: 72 e0 ldi r23, 0x02 ; 2 1cc0a: e2 e0 ldi r30, 0x02 ; 2 1cc0c: ee 16 cp r14, r30 1cc0e: f1 04 cpc r15, r1 1cc10: 11 f0 breq .+4 ; 0x1cc16 1cc12: 6b ed ldi r22, 0xDB ; 219 1cc14: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1cc16: 4d ed ldi r20, 0xDD ; 221 1cc18: 52 e0 ldi r21, 0x02 ; 2 1cc1a: c1 30 cpi r28, 0x01 ; 1 1cc1c: d1 05 cpc r29, r1 1cc1e: 31 f0 breq .+12 ; 0x1cc2c if (_err_endstop == 2) _error_2 = "Z"; 1cc20: 4f ed ldi r20, 0xDF ; 223 1cc22: 52 e0 ldi r21, 0x02 ; 2 1cc24: 22 97 sbiw r28, 0x02 ; 2 1cc26: 11 f0 breq .+4 ; 0x1cc2c 1cc28: 4b ed ldi r20, 0xDB ; 219 1cc2a: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1cc2c: 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) 1cc2e: c6 14 cp r12, r6 1cc30: d7 04 cpc r13, r7 1cc32: 0c f4 brge .+2 ; 0x1cc36 { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1cc34: 83 e0 ldi r24, 0x03 ; 3 1cc36: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1cc3a: f5 01 movw r30, r10 1cc3c: eb 50 subi r30, 0x0B ; 11 1cc3e: fe 4e sbci r31, 0xEE ; 238 1cc40: 10 82 st Z, r1 1cc42: 11 82 std Z+1, r1 ; 0x01 1cc44: 12 82 std Z+2, r1 ; 0x02 1cc46: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1cc48: 0f 94 90 84 call 0x30920 ; 0x30920 return _stepresult; } 1cc4c: 85 2d mov r24, r5 1cc4e: df 91 pop r29 1cc50: cf 91 pop r28 1cc52: 1f 91 pop r17 1cc54: 0f 91 pop r16 1cc56: ff 90 pop r15 1cc58: ef 90 pop r14 1cc5a: df 90 pop r13 1cc5c: cf 90 pop r12 1cc5e: bf 90 pop r11 1cc60: af 90 pop r10 1cc62: 9f 90 pop r9 1cc64: 8f 90 pop r8 1cc66: 7f 90 pop r7 1cc68: 6f 90 pop r6 1cc6a: 5f 90 pop r5 1cc6c: 4f 90 pop r4 1cc6e: 3f 90 pop r3 1cc70: 2f 90 pop r2 1cc72: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cc74: 10 e0 ldi r17, 0x00 ; 0 1cc76: 00 e0 ldi r16, 0x00 ; 0 1cc78: 20 e0 ldi r18, 0x00 ; 0 1cc7a: 43 e0 ldi r20, 0x03 ; 3 1cc7c: 63 2d mov r22, r3 1cc7e: 82 2d mov r24, r2 1cc80: 0e 94 30 b9 call 0x17260 ; 0x17260 1cc84: 38 2e mov r3, r24 1cc86: a9 cf rjmp .-174 ; 0x1cbda (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; 1cc88: c1 e0 ldi r28, 0x01 ; 1 1cc8a: d0 e0 ldi r29, 0x00 ; 0 1cc8c: 71 cf rjmp .-286 ; 0x1cb70 0001cc8e : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1cc8e: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1cc92: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1cc96: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 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() 1cc9a: 81 11 cpse r24, r1 1cc9c: 39 c0 rjmp .+114 ; 0x1cd10 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1cc9e: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1cca2: 81 11 cpse r24, r1 1cca4: 02 c0 rjmp .+4 ; 0x1ccaa #endif ) { return false; // abort if error persists } return true; 1cca6: 81 e0 ldi r24, 0x01 ; 1 1cca8: 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; 1ccaa: 8f ef ldi r24, 0xFF ; 255 1ccac: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ccb0: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1ccb4: 0f 94 af 32 call 0x2655e ; 0x2655e { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1ccb8: 83 e0 ldi r24, 0x03 ; 3 1ccba: 0e 94 c0 6e call 0xdd80 ; 0xdd80 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1ccbe: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1ccc2: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1ccc6: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1ccca: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1ccce: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = true; 1ccd2: 81 e0 ldi r24, 0x01 ; 1 1ccd4: 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) 1ccd8: 68 ee ldi r22, 0xE8 ; 232 1ccda: 73 e0 ldi r23, 0x03 ; 3 1ccdc: 80 e0 ldi r24, 0x00 ; 0 1ccde: 90 e0 ldi r25, 0x00 ; 0 1cce0: 0f 94 d5 0d call 0x21baa ; 0x21baa manage_heater(); 1cce4: 0f 94 af 32 call 0x2655e ; 0x2655e setExtruderAutoFanState(1); //releases lock on the hotend fan 1cce8: 81 e0 ldi r24, 0x01 ; 1 1ccea: 0e 94 c0 6e call 0xdd80 ; 0xdd80 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1ccee: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ccf2: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1ccf6: 0f 94 af 32 call 0x2655e ; 0x2655e _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 1ccfa: 80 91 85 03 lds r24, 0x0385 ; 0x800385 1ccfe: 90 91 86 03 lds r25, 0x0386 ; 0x800386 1cd02: 45 97 sbiw r24, 0x15 ; 21 1cd04: 84 f6 brge .-96 ; 0x1cca6 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1cd06: 62 e0 ldi r22, 0x02 ; 2 1cd08: 8f e0 ldi r24, 0x0F ; 15 1cd0a: 98 e6 ldi r25, 0x68 ; 104 1cd0c: 0e 94 2f e2 call 0x1c45e ; 0x1c45e if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1cd10: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1cd12: 08 95 ret 0001cd14 : //! @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; 1cd14: 0e 94 47 e6 call 0x1cc8e ; 0x1cc8e 1cd18: 88 23 and r24, r24 1cd1a: 21 f0 breq .+8 ; 0x1cd24 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1cd1c: 85 e3 ldi r24, 0x35 ; 53 1cd1e: 98 e6 ldi r25, 0x68 ; 104 1cd20: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 } 1cd24: 08 95 ret 0001cd26 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1cd26: cf 93 push r28 1cd28: df 93 push r29 1cd2a: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1cd2c: 80 e0 ldi r24, 0x00 ; 0 1cd2e: 0e 94 19 e2 call 0x1c432 ; 0x1c432 1cd32: 88 23 and r24, r24 1cd34: 31 f0 breq .+12 ; 0x1cd42 lcd_updatestatus(message, true); 1cd36: 61 e0 ldi r22, 0x01 ; 1 1cd38: ce 01 movw r24, r28 } 1cd3a: df 91 pop r29 1cd3c: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1cd3e: 0c 94 fe e1 jmp 0x1c3fc ; 0x1c3fc } 1cd42: df 91 pop r29 1cd44: cf 91 pop r28 1cd46: 08 95 ret 0001cd48 : } } void lcd_print_stop_finish(); void lcd_commands() 1cd48: 2f 92 push r2 1cd4a: 3f 92 push r3 1cd4c: 4f 92 push r4 1cd4e: 5f 92 push r5 1cd50: 6f 92 push r6 1cd52: 7f 92 push r7 1cd54: 8f 92 push r8 1cd56: 9f 92 push r9 1cd58: af 92 push r10 1cd5a: bf 92 push r11 1cd5c: cf 92 push r12 1cd5e: df 92 push r13 1cd60: ef 92 push r14 1cd62: ff 92 push r15 1cd64: 0f 93 push r16 1cd66: 1f 93 push r17 1cd68: cf 93 push r28 1cd6a: df 93 push r29 1cd6c: 00 d0 rcall .+0 ; 0x1cd6e 1cd6e: 1f 92 push r1 1cd70: 1f 92 push r1 1cd72: cd b7 in r28, 0x3d ; 61 1cd74: de b7 in r29, 0x3e ; 62 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) 1cd76: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cd7a: 81 30 cpi r24, 0x01 ; 1 1cd7c: 09 f0 breq .+2 ; 0x1cd80 1cd7e: 61 c0 rjmp .+194 ; 0x1ce42 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); 1cd80: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cd84: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cd88: 98 13 cpse r25, r24 1cd8a: 5b c0 rjmp .+182 ; 0x1ce42 1cd8c: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cd90: 81 11 cpse r24, r1 1cd92: 57 c0 rjmp .+174 ; 0x1ce42 { custom_message_type = CustomMsg::Status; 1cd94: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1cd98: 8c e5 ldi r24, 0x5C ; 92 1cd9a: 91 e4 ldi r25, 0x41 ; 65 1cd9c: 0e 94 32 6d call 0xda64 ; 0xda64 1cda0: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_commands_type = LcdCommands::Idle; 1cda4: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1cda8: 82 e0 ldi r24, 0x02 ; 2 1cdaa: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1cdae: 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(); 1cdb2: 0f 94 d8 20 call 0x241b0 ; 0x241b0 save_statistics(); 1cdb6: 0e 94 b9 5f call 0xbf72 ; 0xbf72 // lift Z raise_z(10); 1cdba: 60 e0 ldi r22, 0x00 ; 0 1cdbc: 70 e0 ldi r23, 0x00 ; 0 1cdbe: 80 e2 ldi r24, 0x20 ; 32 1cdc0: 91 e4 ldi r25, 0x41 ; 65 1cdc2: 0e 94 5e 67 call 0xcebc ; 0xcebc // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1cdc6: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1cdca: 88 23 and r24, r24 1cdcc: 21 f1 breq .+72 ; 0x1ce16 1cdce: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1cdd2: 88 23 and r24, r24 1cdd4: 01 f1 breq .+64 ; 0x1ce16 current_position[X_AXIS] = X_CANCEL_POS; 1cdd6: 80 e0 ldi r24, 0x00 ; 0 1cdd8: 90 e0 ldi r25, 0x00 ; 0 1cdda: a8 e4 ldi r26, 0x48 ; 72 1cddc: b2 e4 ldi r27, 0x42 ; 66 1cdde: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1cde2: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1cde6: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1cdea: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = Y_CANCEL_POS; 1cdee: 80 e0 ldi r24, 0x00 ; 0 1cdf0: 90 e0 ldi r25, 0x00 ; 0 1cdf2: ae e3 ldi r26, 0x3E ; 62 1cdf4: b3 e4 ldi r27, 0x43 ; 67 1cdf6: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1cdfa: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1cdfe: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ce02: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ce06: 60 e0 ldi r22, 0x00 ; 0 1ce08: 70 e0 ldi r23, 0x00 ; 0 1ce0a: 84 e3 ldi r24, 0x34 ; 52 1ce0c: 92 e4 ldi r25, 0x42 ; 66 1ce0e: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1ce12: 0f 94 a0 22 call 0x24540 ; 0x24540 1ce16: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> // 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()) { 1ce1a: 88 23 and r24, r24 1ce1c: 09 f4 brne .+2 ; 0x1ce20 1ce1e: c9 c0 rjmp .+402 ; 0x1cfb2 // time to stop the error beep WRITE(BEEPER, LOW); 1ce20: 9f b7 in r25, 0x3f ; 63 1ce22: f8 94 cli 1ce24: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ce28: 8b 7f andi r24, 0xFB ; 251 1ce2a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ce2e: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1ce30: 0f 94 ce 12 call 0x2259c ; 0x2259c finishAndDisableSteppers(); //M84 1ce34: 0e 94 ba 74 call 0xe974 ; 0xe974 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1ce38: 88 e0 ldi r24, 0x08 ; 8 1ce3a: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb did_pause_print = false; // Clear pause state in case the print was aborted while paused 1ce3e: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1ce42: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1ce46: 82 30 cpi r24, 0x02 ; 2 1ce48: 09 f0 breq .+2 ; 0x1ce4c 1ce4a: 6a c0 rjmp .+212 ; 0x1cf20 1ce4c: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1ce50: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1ce54: 98 13 cpse r25, r24 1ce56: 64 c0 rjmp .+200 ; 0x1cf20 1ce58: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1ce5c: 81 11 cpse r24, r1 1ce5e: 60 c0 rjmp .+192 ; 0x1cf20 { if (custom_message_type != CustomMsg::M117) 1ce60: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1ce64: 87 30 cpi r24, 0x07 ; 7 1ce66: 41 f0 breq .+16 ; 0x1ce78 { custom_message_type = CustomMsg::Status; 1ce68: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1ce6c: 8d e4 ldi r24, 0x4D ; 77 1ce6e: 91 e4 ldi r25, 0x41 ; 65 1ce70: 0e 94 32 6d call 0xda64 ; 0xda64 1ce74: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 } lcd_commands_type = LcdCommands::Idle; 1ce78: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1ce7c: 82 e0 ldi r24, 0x02 ; 2 1ce7e: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1ce82: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1ce86: 0f 94 a0 22 call 0x24540 ; 0x24540 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1ce8a: 10 92 99 03 sts 0x0399, r1 ; 0x800399 1ce8e: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1ce92: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1ce96: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.493+0x8> 1ce9a: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.493+0x9> 1ce9e: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.493+0xa> 1cea2: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.493+0xb> 1cea6: 0e 94 5e 67 call 0xcebc ; 0xcebc // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1ceaa: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1ceae: 88 23 and r24, r24 1ceb0: 51 f1 breq .+84 ; 0x1cf06 1ceb2: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1ceb6: 88 23 and r24, r24 1ceb8: 31 f1 breq .+76 ; 0x1cf06 current_position[X_AXIS] = pause_position[X_AXIS]; 1ceba: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.493> 1cebe: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.493+0x1> 1cec2: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.493+0x2> 1cec6: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.493+0x3> 1ceca: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1cece: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ced2: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ced6: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1ceda: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.493+0x4> 1cede: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.493+0x5> 1cee2: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.493+0x6> 1cee6: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.493+0x7> 1ceea: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ceee: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1cef2: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1cef6: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(50); 1cefa: 60 e0 ldi r22, 0x00 ; 0 1cefc: 70 e0 ldi r23, 0x00 ; 0 1cefe: 88 e4 ldi r24, 0x48 ; 72 1cf00: 92 e4 ldi r25, 0x42 ; 66 1cf02: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 1cf06: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } // did we come here from a thermal error? if(get_temp_error()) { 1cf0a: 88 23 and r24, r24 1cf0c: 09 f4 brne .+2 ; 0x1cf10 1cf0e: 7b c0 rjmp .+246 ; 0x1d006 // time to stop the error beep WRITE(BEEPER, LOW); 1cf10: 9f b7 in r25, 0x3f ; 63 1cf12: f8 94 cli 1cf14: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1cf18: 8b 7f andi r24, 0xFB ; 251 1cf1a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1cf1e: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1cf20: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cf24: 84 30 cpi r24, 0x04 ; 4 1cf26: 09 f0 breq .+2 ; 0x1cf2a 1cf28: ad c0 rjmp .+346 ; 0x1d084 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1cf2a: 85 ea ldi r24, 0xA5 ; 165 1cf2c: 9d e0 ldi r25, 0x0D ; 13 1cf2e: 0f 94 4a a1 call 0x34294 ; 0x34294 1cf32: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 1cf36: 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) 1cf3a: 32 13 cpse r19, r18 1cf3c: 7c c1 rjmp .+760 ; 0x1d236 1cf3e: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 1cf42: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 1cf46: 23 2b or r18, r19 1cf48: 09 f0 breq .+2 ; 0x1cf4c 1cf4a: 75 c1 rjmp .+746 ; 0x1d236 1cf4c: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 1cf50: 29 83 std Y+1, r18 ; 0x01 1cf52: 21 11 cpse r18, r1 1cf54: 70 c1 rjmp .+736 ; 0x1d236 { 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 c8 9b call 0x33790 ; 0x33790 <__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 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1cf7c: 6b 01 movw r12, r22 1cf7e: 7c 01 movw r14, 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: 7c c0 rjmp .+248 ; 0x1d084 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 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 1cf9a: e1 ea ldi r30, 0xA1 ; 161 1cf9c: cb ea ldi r28, 0xAB ; 171 1cf9e: c7 ea ldi r28, 0xA7 ; 167 1cfa0: c3 ea ldi r28, 0xA3 ; 163 1cfa2: bf ea ldi r27, 0xAF ; 175 1cfa4: b9 ea ldi r27, 0xA9 ; 169 1cfa6: 44 ea ldi r20, 0xA4 ; 164 1cfa8: bf e9 ldi r27, 0x9F ; 159 1cfaa: bb e9 ldi r27, 0x9B ; 155 1cfac: 54 e9 ldi r21, 0x94 ; 148 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 b3 6e call 0xdd66 ; 0xdd66 setExtruderAutoFanState(1); 1cfba: 81 e0 ldi r24, 0x01 ; 1 1cfbc: 0e 94 c0 6e call 0xdd80 ; 0xdd80 // 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: 33 cf rjmp .-410 ; 0x1ce30 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: 2e cf rjmp .-420 ; 0x1ce30 #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: 29 cf rjmp .-430 ; 0x1ce30 #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 3e 61 call 0xc27c ; 0xc27c 1cfe2: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1cfe4: 0e 94 2c 5f call 0xbe58 ; 0xbe58 } // 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: 18 cf rjmp .-464 ; 0x1ce30 MMU2::mmu2.unload(); // M702 1d000: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 1d004: 15 cf rjmp .-470 ; 0x1ce30 } else { // Turn off the print fan fanSpeed = 0; 1d006: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 1d00a: 8a cf rjmp .-236 ; 0x1cf20 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: 89 eb ldi r24, 0xB9 ; 185 1d014: 94 e8 ldi r25, 0x84 ; 132 cmd_pre_meander_5, cmd_pre_meander_6, cmd_pre_meander_7, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 1d016: 0e 94 b6 7d call 0xfb6c ; 0xfb6c 1d01a: 34 c0 rjmp .+104 ; 0x1d084 //! @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: 69 f5 brne .+90 ; 0x1d07e { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1d024: 30 91 af 03 lds r19, 0x03AF ; 0x8003af <_ZL16lay1cal_filament.lto_priv.407> 1d028: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 1d02a: 61 e0 ldi r22, 0x01 ; 1 1d02c: 89 ed ldi r24, 0xD9 ; 217 1d02e: 9c e6 ldi r25, 0x6C ; 108 1d030: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommand_P(PSTR("G1 Y-3 F1000")); 1d034: 61 e0 ldi r22, 0x01 ; 1 1d036: 8c ea ldi r24, 0xAC ; 172 1d038: 94 e8 ldi r25, 0x84 ; 132 1d03a: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommand_P(PSTR("G1 Z0.4 F1000")); 1d03e: 61 e0 ldi r22, 0x01 ; 1 1d040: 8e e9 ldi r24, 0x9E ; 158 1d042: 94 e8 ldi r25, 0x84 ; 132 1d044: 0e 94 37 7d call 0xfa6e ; 0xfa6e uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1d048: 0f 94 e8 41 call 0x283d0 ; 0x283d0 if(currentTool == filament ){ 1d04c: 9b 81 ldd r25, Y+3 ; 0x03 1d04e: 98 17 cp r25, r24 1d050: b1 f0 breq .+44 ; 0x1d07e // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1d052: 8f 3f cpi r24, 0xFF ; 255 1d054: 29 f0 breq .+10 ; 0x1d060 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1d056: 61 e0 ldi r22, 0x01 ; 1 1d058: 81 eb ldi r24, 0xB1 ; 177 1d05a: 98 e6 ldi r25, 0x68 ; 104 1d05c: 0e 94 37 7d call 0xfa6e ; 0xfa6e } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1d060: 1f 92 push r1 1d062: 2b 81 ldd r18, Y+3 ; 0x03 1d064: 2f 93 push r18 1d066: 8a e9 ldi r24, 0x9A ; 154 1d068: 94 e8 ldi r25, 0x84 ; 132 1d06a: 9f 93 push r25 1d06c: 8f 93 push r24 1d06e: 0e 94 cd 7d call 0xfb9a ; 0xfb9a 1d072: 0f 90 pop r0 1d074: 0f 90 pop r0 1d076: 0f 90 pop r0 1d078: 0f 90 pop r0 return true; 1d07a: 31 e0 ldi r19, 0x01 ; 1 1d07c: 39 83 std Y+1, r19 ; 0x01 1d07e: 89 81 ldd r24, Y+1 ; 0x01 1d080: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1d084: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d088: 83 30 cpi r24, 0x03 ; 3 1d08a: 09 f0 breq .+2 ; 0x1d08e 1d08c: d4 c0 rjmp .+424 ; 0x1d236 if (lcd_commands_step == 0) { 1d08e: 90 91 b0 03 lds r25, 0x03B0 ; 0x8003b0 1d092: 91 11 cpse r25, r1 1d094: 09 c0 rjmp .+18 ; 0x1d0a8 custom_message_type = CustomMsg::PidCal; 1d096: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 1d09a: 91 e0 ldi r25, 0x01 ; 1 1d09c: 90 93 ac 03 sts 0x03AC, r25 ; 0x8003ac lcd_draw_update = 3; 1d0a0: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_commands_step = 3; 1d0a4: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1d0a8: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d0ac: 83 30 cpi r24, 0x03 ; 3 1d0ae: 19 f5 brne .+70 ; 0x1d0f6 1d0b0: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d0b4: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1d0b8: 98 13 cpse r25, r24 1d0ba: 1d c0 rjmp .+58 ; 0x1d0f6 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1d0bc: 0f 94 b9 12 call 0x22572 ; 0x22572 pid_tuning_finished = false; 1d0c0: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> 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); 1d0c4: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1d0c8: 8f 93 push r24 1d0ca: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1d0ce: 8f 93 push r24 1d0d0: 8e e2 ldi r24, 0x2E ; 46 1d0d2: 95 e8 ldi r25, 0x85 ; 133 1d0d4: 9f 93 push r25 1d0d6: 8f 93 push r24 1d0d8: 0e 94 cd 7d call 0xfb9a ; 0xfb9a lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1d0dc: 82 e4 ldi r24, 0x42 ; 66 1d0de: 91 e4 ldi r25, 0x41 ; 65 1d0e0: 0e 94 32 6d call 0xda64 ; 0xda64 1d0e4: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_commands_step = 2; 1d0e8: 82 e0 ldi r24, 0x02 ; 2 1d0ea: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d0ee: 0f 90 pop r0 1d0f0: 0f 90 pop r0 1d0f2: 0f 90 pop r0 1d0f4: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1d0f6: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d0fa: 82 30 cpi r24, 0x02 ; 2 1d0fc: 09 f0 breq .+2 ; 0x1d100 1d0fe: 7c c0 rjmp .+248 ; 0x1d1f8 1d100: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> 1d104: 88 23 and r24, r24 1d106: 09 f4 brne .+2 ; 0x1d10a 1d108: 77 c0 rjmp .+238 ; 0x1d1f8 custom_message_state = 0; 1d10a: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1d10e: 8e e2 ldi r24, 0x2E ; 46 1d110: 91 e4 ldi r25, 0x41 ; 65 1d112: 0e 94 32 6d call 0xda64 ; 0xda64 1d116: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 1d11a: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d11e: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1d122: 30 91 a8 03 lds r19, 0x03A8 ; 0x8003a8 <_Kp> 1d126: 39 83 std Y+1, r19 ; 0x01 1d128: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 <_Kp+0x1> 1d12c: 8b 83 std Y+3, r24 ; 0x03 1d12e: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa <_Kp+0x2> 1d132: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab <_Kp+0x3> 1d136: 20 e0 ldi r18, 0x00 ; 0 1d138: 30 e0 ldi r19, 0x00 ; 0 1d13a: a9 01 movw r20, r18 1d13c: b9 81 ldd r27, Y+1 ; 0x01 1d13e: f8 01 movw r30, r16 1d140: 6b 2f mov r22, r27 1d142: 78 2f mov r23, r24 1d144: 8f 2f mov r24, r31 1d146: 9e 2f mov r25, r30 1d148: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1d14c: 81 11 cpse r24, r1 1d14e: 1f c0 rjmp .+62 ; 0x1d18e 1d150: 20 e0 ldi r18, 0x00 ; 0 1d152: 30 e0 ldi r19, 0x00 ; 0 1d154: a9 01 movw r20, r18 1d156: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 1d15a: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d15e: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d162: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d166: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1d16a: 81 11 cpse r24, r1 1d16c: 10 c0 rjmp .+32 ; 0x1d18e 1d16e: 20 e0 ldi r18, 0x00 ; 0 1d170: 30 e0 ldi r19, 0x00 ; 0 1d172: a9 01 movw r20, r18 1d174: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 1d178: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d17c: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d180: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d184: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1d188: 88 23 and r24, r24 1d18a: 09 f4 brne .+2 ; 0x1d18e 1d18c: 30 c2 rjmp .+1120 ; 0x1d5ee enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1d18e: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d192: 8f 93 push r24 1d194: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d198: 8f 93 push r24 1d19a: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d19e: 8f 93 push r24 1d1a0: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 <_Kd> 1d1a4: 8f 93 push r24 1d1a6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d1aa: 8f 93 push r24 1d1ac: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d1b0: 8f 93 push r24 1d1b2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d1b6: 8f 93 push r24 1d1b8: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 <_Ki> 1d1bc: 8f 93 push r24 1d1be: 0f 93 push r16 1d1c0: 1f 93 push r17 1d1c2: 9b 81 ldd r25, Y+3 ; 0x03 1d1c4: 9f 93 push r25 1d1c6: 29 81 ldd r18, Y+1 ; 0x01 1d1c8: 2f 93 push r18 1d1ca: 87 e1 ldi r24, 0x17 ; 23 1d1cc: 95 e8 ldi r25, 0x85 ; 133 1d1ce: 9f 93 push r25 1d1d0: 8f 93 push r24 1d1d2: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommand_P(MSG_M500); 1d1d6: 61 e0 ldi r22, 0x01 ; 1 1d1d8: 8c eb ldi r24, 0xBC ; 188 1d1da: 98 e6 ldi r25, 0x68 ; 104 1d1dc: 0e 94 37 7d call 0xfa6e ; 0xfa6e 1d1e0: 0f b6 in r0, 0x3f ; 63 1d1e2: f8 94 cli 1d1e4: de bf out 0x3e, r29 ; 62 1d1e6: 0f be out 0x3f, r0 ; 63 1d1e8: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1d1ea: 8d e9 ldi r24, 0x9D ; 157 1d1ec: 93 e0 ldi r25, 0x03 ; 3 1d1ee: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> lcd_commands_step = 1; 1d1f2: 81 e0 ldi r24, 0x01 ; 1 1d1f4: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1d1f8: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d1fc: 81 30 cpi r24, 0x01 ; 1 1d1fe: d9 f4 brne .+54 ; 0x1d236 1d200: 60 ed ldi r22, 0xD0 ; 208 1d202: 77 e0 ldi r23, 0x07 ; 7 1d204: 8d e9 ldi r24, 0x9D ; 157 1d206: 93 e0 ldi r25, 0x03 ; 3 1d208: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1d20c: 88 23 and r24, r24 1d20e: 99 f0 breq .+38 ; 0x1d236 lcd_setstatuspgm(MSG_WELCOME); 1d210: 8b e0 ldi r24, 0x0B ; 11 1d212: 9c e6 ldi r25, 0x6C ; 108 1d214: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = CustomMsg::Status; 1d218: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 pid_temp = DEFAULT_PID_TEMP; 1d21c: 82 ed ldi r24, 0xD2 ; 210 1d21e: 90 e0 ldi r25, 0x00 ; 0 1d220: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1d224: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.409> lcd_commands_step = 0; 1d228: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d22c: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d230: 82 e0 ldi r24, 0x02 ; 2 1d232: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1d236: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d23a: 85 30 cpi r24, 0x05 ; 5 1d23c: e9 f4 brne .+58 ; 0x1d278 1d23e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d242: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1d246: 98 13 cpse r25, r24 1d248: 17 c0 rjmp .+46 ; 0x1d278 1d24a: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1d24e: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1d252: 89 2b or r24, r25 1d254: 89 f4 brne .+34 ; 0x1d278 1d256: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 1d25a: 81 11 cpse r24, r1 1d25c: 0d c0 rjmp .+26 ; 0x1d278 #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) 1d25e: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d262: 81 30 cpi r24, 0x01 ; 1 1d264: 09 f4 brne .+2 ; 0x1d268 1d266: f8 c1 rjmp .+1008 ; 0x1d658 1d268: 08 f4 brcc .+2 ; 0x1d26c 1d26a: c6 c1 rjmp .+908 ; 0x1d5f8 1d26c: 82 30 cpi r24, 0x02 ; 2 1d26e: 09 f4 brne .+2 ; 0x1d272 1d270: de c1 rjmp .+956 ; 0x1d62e 1d272: 83 30 cpi r24, 0x03 ; 3 1d274: 09 f4 brne .+2 ; 0x1d278 1d276: c4 c1 rjmp .+904 ; 0x1d600 menu_depth = 3; break; } } } } 1d278: 0f 90 pop r0 1d27a: 0f 90 pop r0 1d27c: 0f 90 pop r0 1d27e: 0f 90 pop r0 1d280: 0f 90 pop r0 1d282: df 91 pop r29 1d284: cf 91 pop r28 1d286: 1f 91 pop r17 1d288: 0f 91 pop r16 1d28a: ff 90 pop r15 1d28c: ef 90 pop r14 1d28e: df 90 pop r13 1d290: cf 90 pop r12 1d292: bf 90 pop r11 1d294: af 90 pop r10 1d296: 9f 90 pop r9 1d298: 8f 90 pop r8 1d29a: 7f 90 pop r7 1d29c: 6f 90 pop r6 1d29e: 5f 90 pop r5 1d2a0: 4f 90 pop r4 1d2a2: 3f 90 pop r3 1d2a4: 2f 90 pop r2 1d2a6: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1d2a8: 0e 94 2f 6a call 0xd45e ; 0xd45e menu_depth = 0; 1d2ac: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_babystep_z, true); 1d2b0: 61 e0 ldi r22, 0x01 ; 1 1d2b2: 8d e5 ldi r24, 0x5D ; 93 1d2b4: 98 e3 ldi r25, 0x38 ; 56 1d2b6: 0f 94 89 95 call 0x32b12 ; 0x32b12 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 1d2ba: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1d2be: 81 30 cpi r24, 0x01 ; 1 1d2c0: f1 f4 brne .+60 ; 0x1d2fe { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1d2c2: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1d2c6: 10 e0 ldi r17, 0x00 ; 0 1d2c8: 81 11 cpse r24, r1 1d2ca: 01 c0 rjmp .+2 ; 0x1d2ce 1d2cc: 12 e0 ldi r17, 0x02 ; 2 1d2ce: 21 2f mov r18, r17 1d2d0: 30 e0 ldi r19, 0x00 ; 0 1d2d2: 22 0f add r18, r18 1d2d4: 33 1f adc r19, r19 1d2d6: 2a 57 subi r18, 0x7A ; 122 1d2d8: 3b 47 sbci r19, 0x7B ; 123 1d2da: 3a 83 std Y+2, r19 ; 0x02 1d2dc: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 1d2de: e9 81 ldd r30, Y+1 ; 0x01 1d2e0: fa 81 ldd r31, Y+2 ; 0x02 1d2e2: 85 91 lpm r24, Z+ 1d2e4: 94 91 lpm r25, Z 1d2e6: 61 e0 ldi r22, 0x01 ; 1 1d2e8: 0e 94 37 7d call 0xfa6e ; 0xfa6e cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1d2ec: 1f 5f subi r17, 0xFF ; 255 1d2ee: 89 81 ldd r24, Y+1 ; 0x01 1d2f0: 9a 81 ldd r25, Y+2 ; 0x02 1d2f2: 02 96 adiw r24, 0x02 ; 2 1d2f4: 9a 83 std Y+2, r25 ; 0x02 1d2f6: 89 83 std Y+1, r24 ; 0x01 1d2f8: 1a 30 cpi r17, 0x0A ; 10 1d2fa: 89 f7 brne .-30 ; 0x1d2de 1d2fc: c3 ce rjmp .-634 ; 0x1d084 } } else { static const char fmt1[] PROGMEM = "G1 X%d E%-.3f F1000"; enquecommandf_P(fmt1, 60, count_e(layer_height, extrusion_width * 4.f, 60)); 1d2fe: 20 e0 ldi r18, 0x00 ; 0 1d300: 30 e0 ldi r19, 0x00 ; 0 1d302: 40 e8 ldi r20, 0x80 ; 128 1d304: 50 e4 ldi r21, 0x40 ; 64 1d306: c7 01 movw r24, r14 1d308: b6 01 movw r22, r12 1d30a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1d30e: 20 e0 ldi r18, 0x00 ; 0 1d310: 30 e0 ldi r19, 0x00 ; 0 1d312: 40 e7 ldi r20, 0x70 ; 112 1d314: 52 e4 ldi r21, 0x42 ; 66 1d316: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d31a: 9f 93 push r25 1d31c: 8f 93 push r24 1d31e: 7f 93 push r23 1d320: 6f 93 push r22 1d322: 1f 92 push r1 1d324: 8c e3 ldi r24, 0x3C ; 60 1d326: 8f 93 push r24 1d328: 22 e7 ldi r18, 0x72 ; 114 1d32a: 34 e8 ldi r19, 0x84 ; 132 1d32c: 3f 93 push r19 1d32e: 2f 93 push r18 1d330: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 1d334: 20 e0 ldi r18, 0x00 ; 0 1d336: 30 e0 ldi r19, 0x00 ; 0 1d338: 40 e0 ldi r20, 0x00 ; 0 1d33a: 51 e4 ldi r21, 0x41 ; 65 1d33c: c7 01 movw r24, r14 1d33e: b6 01 movw r22, r12 1d340: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1d344: 20 e0 ldi r18, 0x00 ; 0 1d346: 30 e0 ldi r19, 0x00 ; 0 1d348: 40 e2 ldi r20, 0x20 ; 32 1d34a: 52 e4 ldi r21, 0x42 ; 66 1d34c: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d350: 9f 93 push r25 1d352: 8f 93 push r24 1d354: 7f 93 push r23 1d356: 6f 93 push r22 1d358: 1f 92 push r1 1d35a: 84 e6 ldi r24, 0x64 ; 100 1d35c: 8f 93 push r24 1d35e: 22 e7 ldi r18, 0x72 ; 114 1d360: 34 e8 ldi r19, 0x84 ; 132 1d362: 3f 93 push r19 1d364: 2f 93 push r18 1d366: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommand_P(PSTR("G1 F1080")); enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1d36a: 0f b6 in r0, 0x3f ; 63 1d36c: f8 94 cli 1d36e: de bf out 0x3e, r29 ; 62 1d370: 0f be out 0x3f, r0 ; 63 1d372: cd bf out 0x3d, r28 ; 61 1d374: 87 ce rjmp .-754 ; 0x1d084 cmd_pre_meander_5, cmd_pre_meander_6, cmd_pre_meander_7, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 1d376: 67 e0 ldi r22, 0x07 ; 7 1d378: 84 e6 ldi r24, 0x64 ; 100 1d37a: 94 e8 ldi r25, 0x84 ; 132 1d37c: 4c ce rjmp .-872 ; 0x1d016 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 1d37e: 61 e0 ldi r22, 0x01 ; 1 1d380: 88 e5 ldi r24, 0x58 ; 88 1d382: 94 e8 ldi r25, 0x84 ; 132 1d384: 0e 94 37 7d call 0xfa6e ; 0xfa6e static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 1d388: 8e e3 ldi r24, 0x3E ; 62 1d38a: 8f 93 push r24 1d38c: 8c e4 ldi r24, 0x4C ; 76 1d38e: 8f 93 push r24 1d390: 8c ec ldi r24, 0xCC ; 204 1d392: 8f 93 push r24 1d394: 8d ec ldi r24, 0xCD ; 205 1d396: 8f 93 push r24 1d398: 88 e4 ldi r24, 0x48 ; 72 1d39a: 94 e8 ldi r25, 0x84 ; 132 1d39c: 9f 93 push r25 1d39e: 8f 93 push r24 1d3a0: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommand_P(PSTR("G1 F1080")); 1d3a4: 61 e0 ldi r22, 0x01 ; 1 1d3a6: 8f e3 ldi r24, 0x3F ; 63 1d3a8: 94 e8 ldi r25, 0x84 ; 132 1d3aa: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 1d3ae: 20 e0 ldi r18, 0x00 ; 0 1d3b0: 30 e0 ldi r19, 0x00 ; 0 1d3b2: 40 e8 ldi r20, 0x80 ; 128 1d3b4: 50 e4 ldi r21, 0x40 ; 64 1d3b6: c7 01 movw r24, r14 1d3b8: b6 01 movw r22, r12 1d3ba: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1d3be: 20 e0 ldi r18, 0x00 ; 0 1d3c0: 30 e0 ldi r19, 0x00 ; 0 1d3c2: 48 ec ldi r20, 0xC8 ; 200 1d3c4: 51 e4 ldi r21, 0x41 ; 65 1d3c6: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d3ca: 9f 93 push r25 1d3cc: 8f 93 push r24 1d3ce: 7f 93 push r23 1d3d0: 6f 93 push r22 1d3d2: 1f 92 push r1 1d3d4: 1b e9 ldi r17, 0x9B ; 155 1d3d6: 1f 93 push r17 1d3d8: 1f 92 push r1 1d3da: 8b e4 ldi r24, 0x4B ; 75 1d3dc: 8f 93 push r24 1d3de: 8d e2 ldi r24, 0x2D ; 45 1d3e0: 94 e8 ldi r25, 0x84 ; 132 1d3e2: 9f 93 push r25 1d3e4: 8f 93 push r24 1d3e6: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 1d3ea: a7 01 movw r20, r14 1d3ec: 96 01 movw r18, r12 1d3ee: c7 01 movw r24, r14 1d3f0: b6 01 movw r22, r12 1d3f2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1d3f6: 20 e0 ldi r18, 0x00 ; 0 1d3f8: 30 e0 ldi r19, 0x00 ; 0 1d3fa: 48 ec ldi r20, 0xC8 ; 200 1d3fc: 51 e4 ldi r21, 0x41 ; 65 1d3fe: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d402: 9f 93 push r25 1d404: 8f 93 push r24 1d406: 7f 93 push r23 1d408: 6f 93 push r22 1d40a: 1f 92 push r1 1d40c: 1f 93 push r17 1d40e: 1f 92 push r1 1d410: 84 e6 ldi r24, 0x64 ; 100 1d412: 8f 93 push r24 1d414: 8d e2 ldi r24, 0x2D ; 45 1d416: 94 e8 ldi r25, 0x84 ; 132 1d418: 9f 93 push r25 1d41a: 8f 93 push r24 1d41c: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 1d420: 20 e0 ldi r18, 0x00 ; 0 1d422: 30 e0 ldi r19, 0x00 ; 0 1d424: 48 ec ldi r20, 0xC8 ; 200 1d426: 52 e4 ldi r21, 0x42 ; 66 1d428: c7 01 movw r24, r14 1d42a: b6 01 movw r22, r12 1d42c: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d430: 9f 93 push r25 1d432: 8f 93 push r24 1d434: 7f 93 push r23 1d436: 6f 93 push r22 1d438: 1f 92 push r1 1d43a: 1f 93 push r17 1d43c: 1f 92 push r1 1d43e: 18 ec ldi r17, 0xC8 ; 200 1d440: 1f 93 push r17 1d442: 8d e2 ldi r24, 0x2D ; 45 1d444: 94 e8 ldi r25, 0x84 ; 132 1d446: 9f 93 push r25 1d448: 8f 93 push r24 1d44a: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1d44e: 0f b6 in r0, 0x3f ; 63 1d450: f8 94 cli 1d452: de bf out 0x3e, r29 ; 62 1d454: 0f be out 0x3f, r0 ; 63 1d456: cd bf out 0x3d, r28 ; 61 1d458: 20 e0 ldi r18, 0x00 ; 0 1d45a: 30 e0 ldi r19, 0x00 ; 0 1d45c: 40 ea ldi r20, 0xA0 ; 160 1d45e: 51 e4 ldi r21, 0x41 ; 65 1d460: c7 01 movw r24, r14 1d462: b6 01 movw r22, r12 1d464: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d468: 9f 93 push r25 1d46a: 8f 93 push r24 1d46c: 7f 93 push r23 1d46e: 6f 93 push r22 1d470: 1f 92 push r1 1d472: 87 e8 ldi r24, 0x87 ; 135 1d474: 8f 93 push r24 1d476: 1f 92 push r1 1d478: 1f 93 push r17 1d47a: 2d e2 ldi r18, 0x2D ; 45 1d47c: 34 e8 ldi r19, 0x84 ; 132 1d47e: 3f 93 push r19 1d480: 2f 93 push r18 1d482: 0e 94 cd 7d call 0xfb9a ; 0xfb9a 1d486: 71 cf rjmp .-286 ; 0x1d36a //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float short_length = 20; float long_length = 150; const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 1d488: 20 e0 ldi r18, 0x00 ; 0 1d48a: 30 e0 ldi r19, 0x00 ; 0 1d48c: 46 e1 ldi r20, 0x16 ; 22 1d48e: 53 e4 ldi r21, 0x43 ; 67 1d490: c7 01 movw r24, r14 1d492: b6 01 movw r22, r12 1d494: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d498: 56 2e mov r5, r22 1d49a: 47 2e mov r4, r23 1d49c: 38 2e mov r3, r24 1d49e: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1d4a0: 20 e0 ldi r18, 0x00 ; 0 1d4a2: 30 e0 ldi r19, 0x00 ; 0 1d4a4: 40 ea ldi r20, 0xA0 ; 160 1d4a6: 51 e4 ldi r21, 0x41 ; 65 1d4a8: c7 01 movw r24, r14 1d4aa: b6 01 movw r22, r12 1d4ac: 0f 94 a9 53 call 0x2a752 ; 0x2a752 1d4b0: 6b 83 std Y+3, r22 ; 0x03 1d4b2: c7 2e mov r12, r23 1d4b4: 78 2e mov r7, r24 1d4b6: 69 2e mov r6, r25 1d4b8: 85 e0 ldi r24, 0x05 ; 5 1d4ba: d8 2e mov r13, r24 //! @brief Print meander //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float short_length = 20; float long_length = 150; 1d4bc: 81 2c mov r8, r1 1d4be: 91 2c mov r9, r1 1d4c0: 96 e1 ldi r25, 0x16 ; 22 1d4c2: a9 2e mov r10, r25 1d4c4: 93 e4 ldi r25, 0x43 ; 67 1d4c6: b9 2e mov r11, r25 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; uint8_t x_pos = 50; 1d4c8: 32 e3 ldi r19, 0x32 ; 50 1d4ca: 3c 83 std Y+4, r19 ; 0x04 const float short_length = 20; float long_length = 150; const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; 1d4cc: 87 e8 ldi r24, 0x87 ; 135 1d4ce: 8d 83 std Y+5, r24 ; 0x05 uint8_t x_pos = 50; for(uint8_t i = 0; i <= 4; ++i) { enquecommandf_P(extrude_fmt, x_pos, y_pos, long_extrusion); 1d4d0: 0d e2 ldi r16, 0x2D ; 45 1d4d2: 14 e8 ldi r17, 0x84 ; 132 1d4d4: 9d 81 ldd r25, Y+5 ; 0x05 1d4d6: e9 2e mov r14, r25 1d4d8: f1 2c mov r15, r1 1d4da: 3c 81 ldd r19, Y+4 ; 0x04 1d4dc: 23 2f mov r18, r19 1d4de: 30 e0 ldi r19, 0x00 ; 0 1d4e0: 3a 83 std Y+2, r19 ; 0x02 1d4e2: 29 83 std Y+1, r18 ; 0x01 1d4e4: 2f 92 push r2 1d4e6: 3f 92 push r3 1d4e8: 4f 92 push r4 1d4ea: 5f 92 push r5 1d4ec: 1f 92 push r1 1d4ee: 9f 93 push r25 1d4f0: 1f 92 push r1 1d4f2: 8c 81 ldd r24, Y+4 ; 0x04 1d4f4: 8f 93 push r24 1d4f6: 1f 93 push r17 1d4f8: 0f 93 push r16 1d4fa: 0e 94 cd 7d call 0xfb9a ; 0xfb9a y_pos -= short_length; 1d4fe: b7 01 movw r22, r14 1d500: ff 0c add r15, r15 1d502: 88 0b sbc r24, r24 1d504: 99 0b sbc r25, r25 1d506: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1d50a: 20 e0 ldi r18, 0x00 ; 0 1d50c: 30 e0 ldi r19, 0x00 ; 0 1d50e: 40 ea ldi r20, 0xA0 ; 160 1d510: 51 e4 ldi r21, 0x41 ; 65 1d512: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1d516: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 1d51a: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 1d51c: 6f 92 push r6 1d51e: 7f 92 push r7 1d520: cf 92 push r12 1d522: 9b 81 ldd r25, Y+3 ; 0x03 1d524: 9f 93 push r25 1d526: 1f 92 push r1 1d528: 2d 81 ldd r18, Y+5 ; 0x05 1d52a: 2f 93 push r18 1d52c: 1f 92 push r1 1d52e: 3c 81 ldd r19, Y+4 ; 0x04 1d530: 3f 93 push r19 1d532: 1f 93 push r17 1d534: 0f 93 push r16 1d536: 0e 94 cd 7d call 0xfb9a ; 0xfb9a x_pos += long_length; 1d53a: 29 81 ldd r18, Y+1 ; 0x01 1d53c: 3a 81 ldd r19, Y+2 ; 0x02 1d53e: b9 01 movw r22, r18 1d540: 33 0f add r19, r19 1d542: 88 0b sbc r24, r24 1d544: 99 0b sbc r25, r25 1d546: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1d54a: a5 01 movw r20, r10 1d54c: 94 01 movw r18, r8 1d54e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1d552: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 1d556: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 1d558: b7 fa bst r11, 7 1d55a: b0 94 com r11 1d55c: b7 f8 bld r11, 7 1d55e: b0 94 com r11 1d560: da 94 dec r13 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; uint8_t x_pos = 50; for(uint8_t i = 0; i <= 4; ++i) 1d562: 0f b6 in r0, 0x3f ; 63 1d564: f8 94 cli 1d566: de bf out 0x3e, r29 ; 62 1d568: 0f be out 0x3f, r0 ; 63 1d56a: cd bf out 0x3d, r28 ; 61 1d56c: d1 10 cpse r13, r1 1d56e: b2 cf rjmp .-156 ; 0x1d4d4 1d570: 89 cd rjmp .-1262 ; 0x1d084 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 1d572: b7 01 movw r22, r14 1d574: a6 01 movw r20, r12 1d576: 80 e0 ldi r24, 0x00 ; 0 break; case 4: lay1cal_square(8, layer_height, extrusion_width); break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1d578: 0f 94 d0 53 call 0x2a7a0 ; 0x2a7a0 1d57c: 83 cd rjmp .-1274 ; 0x1d084 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 1d57e: b7 01 movw r22, r14 1d580: a6 01 movw r20, r12 1d582: 84 e0 ldi r24, 0x04 ; 4 1d584: f9 cf rjmp .-14 ; 0x1d578 break; case 4: lay1cal_square(8, layer_height, extrusion_width); 1d586: b7 01 movw r22, r14 1d588: a6 01 movw r20, r12 1d58a: 88 e0 ldi r24, 0x08 ; 8 1d58c: f5 cf rjmp .-22 ; 0x1d578 break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1d58e: b7 01 movw r22, r14 1d590: a6 01 movw r20, r12 1d592: 8c e0 ldi r24, 0x0C ; 12 1d594: f1 cf rjmp .-30 ; 0x1d578 1d596: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1d59a: 99 83 std Y+1, r25 ; 0x01 cmd_cal_finish_3, cmd_cal_finish_4, cmd_cal_finish_5 }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 1d59c: 66 e0 ldi r22, 0x06 ; 6 1d59e: 81 e2 ldi r24, 0x21 ; 33 1d5a0: 94 e8 ldi r25, 0x84 ; 132 1d5a2: 0e 94 b6 7d call 0xfb6c ; 0xfb6c if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 1d5a6: 29 81 ldd r18, Y+1 ; 0x01 1d5a8: 21 30 cpi r18, 0x01 ; 1 1d5aa: 29 f4 brne .+10 ; 0x1d5b6 1d5ac: 61 e0 ldi r22, 0x01 ; 1 1d5ae: 81 eb ldi r24, 0xB1 ; 177 1d5b0: 98 e6 ldi r25, 0x68 ; 104 1d5b2: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommand_P(MSG_M84);// disable motors 1d5b6: 61 e0 ldi r22, 0x01 ; 1 1d5b8: 8d ea ldi r24, 0xAD ; 173 1d5ba: 98 e6 ldi r25, 0x68 ; 104 1d5bc: 0e 94 37 7d call 0xfa6e ; 0xfa6e 1d5c0: 61 cd rjmp .-1342 ; 0x1d084 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1d5c2: 8b e0 ldi r24, 0x0B ; 11 1d5c4: 9c e6 ldi r25, 0x6C ; 108 1d5c6: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_commands_step = 0; 1d5ca: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d5ce: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d5d2: 82 e0 ldi r24, 0x02 ; 2 1d5d4: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1d5d8: 8f e5 ldi r24, 0x5F ; 95 1d5da: 9f e0 ldi r25, 0x0F ; 15 1d5dc: 0f 94 3c a1 call 0x34278 ; 0x34278 1d5e0: 88 23 and r24, r24 1d5e2: 09 f4 brne .+2 ; 0x1d5e6 1d5e4: 28 ce rjmp .-944 ; 0x1d236 lcd_wizard(WizState::RepeatLay1Cal); 1d5e6: 8b e0 ldi r24, 0x0B ; 11 1d5e8: 0f 94 5c 2e call 0x25cb8 ; 0x25cb8 1d5ec: 4b cd rjmp .-1386 ; 0x1d084 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."); 1d5ee: 87 ee ldi r24, 0xE7 ; 231 1d5f0: 94 e8 ldi r25, 0x84 ; 132 1d5f2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 1d5f6: f9 cd rjmp .-1038 ; 0x1d1ea #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1d5f8: 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; 1d5fa: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d5fe: 3c ce rjmp .-904 ; 0x1d278 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)); 1d600: 87 ef ldi r24, 0xF7 ; 247 1d602: 90 e4 ldi r25, 0x40 ; 64 1d604: 0e 94 32 6d call 0xda64 ; 0xda64 1d608: 0f 94 7b 0b call 0x216f6 ; 0x216f6 enquecommand_P(G28W); 1d60c: 61 e0 ldi r22, 0x01 ; 1 1d60e: 86 eb ldi r24, 0xB6 ; 182 1d610: 98 e6 ldi r25, 0x68 ; 104 1d612: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1d616: 61 e0 ldi r22, 0x01 ; 1 1d618: 84 ed ldi r24, 0xD4 ; 212 1d61a: 94 e8 ldi r25, 0x84 ; 132 1d61c: 0e 94 37 7d call 0xfa6e ; 0xfa6e enquecommand_P(PSTR("M109 S280")); 1d620: 61 e0 ldi r22, 0x01 ; 1 1d622: 8a ec ldi r24, 0xCA ; 202 1d624: 94 e8 ldi r25, 0x84 ; 132 1d626: 0e 94 37 7d call 0xfa6e ; 0xfa6e } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1d62a: 82 e0 ldi r24, 0x02 ; 2 1d62c: e6 cf rjmp .-52 ; 0x1d5fa break; case 2: enquecommand_P(PSTR("M84 XY")); 1d62e: 61 e0 ldi r22, 0x01 ; 1 1d630: 83 ec ldi r24, 0xC3 ; 195 1d632: 94 e8 ldi r25, 0x84 ; 132 1d634: 0e 94 37 7d call 0xfa6e ; 0xfa6e if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1d638: 8e eb ldi r24, 0xBE ; 190 1d63a: 90 e4 ldi r25, 0x40 ; 64 1d63c: 0e 94 32 6d call 0xda64 ; 0xda64 1d640: 41 e0 ldi r20, 0x01 ; 1 1d642: 60 e0 ldi r22, 0x00 ; 0 1d644: 0f 94 33 2e call 0x25c66 ; 0x25c66 1d648: 81 11 cpse r24, r1 1d64a: 16 ce rjmp .-980 ; 0x1d278 1d64c: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d650: 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; 1d654: 81 e0 ldi r24, 0x01 ; 1 1d656: d1 cf rjmp .-94 ; 0x1d5fa } break; case 1: lcd_commands_step = 0; 1d658: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d65c: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d660: 82 e0 ldi r24, 0x02 ; 2 1d662: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1d666: 20 e0 ldi r18, 0x00 ; 0 1d668: 41 e0 ldi r20, 0x01 ; 1 1d66a: 62 e0 ldi r22, 0x02 ; 2 1d66c: 70 e0 ldi r23, 0x00 ; 0 1d66e: 8d ea ldi r24, 0xAD ; 173 1d670: 93 eb ldi r25, 0xB3 ; 179 1d672: 0f 94 46 94 call 0x3288c ; 0x3288c menu_depth = 3; 1d676: 83 e0 ldi r24, 0x03 ; 3 1d678: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 1d67c: fd cd rjmp .-1030 ; 0x1d278 0001d67e : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1d67e: 0f 93 push r16 1d680: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1d682: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d686: 80 95 com r24 1d688: 81 70 andi r24, 0x01 ; 1 1d68a: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 1d68e: 89 17 cp r24, r25 1d690: 89 f1 breq .+98 ; 0x1d6f4 { if(menu_menu == lcd_sdcard_menu) { 1d692: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d696: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d69a: 88 53 subi r24, 0x38 ; 56 1d69c: 9c 4e sbci r25, 0xEC ; 236 1d69e: 11 f4 brne .+4 ; 0x1d6a4 // 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(); 1d6a0: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 } lcd_draw_update = 2; 1d6a4: 82 e0 ldi r24, 0x02 ; 2 1d6a6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_oldcardstatus = IS_SD_INSERTED; 1d6aa: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d6ae: 80 95 com r24 1d6b0: 81 70 andi r24, 0x01 ; 1 1d6b2: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1d6b6: 0e 94 a8 6a call 0xd550 ; 0xd550 backlight_wake(); if (lcd_oldcardstatus) 1d6ba: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 1d6be: 88 23 and r24, r24 1d6c0: 09 f4 brne .+2 ; 0x1d6c4 1d6c2: 88 c0 rjmp .+272 ; 0x1d7d4 { if (!card.mounted) 1d6c4: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1d6c8: 81 11 cpse r24, r1 1d6ca: 05 c0 rjmp .+10 ; 0x1d6d6 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1d6cc: 0f 94 da 4d call 0x29bb4 ; 0x29bb4 card.presort_flag = true; //force sorting of the SD menu 1d6d0: 81 e0 ldi r24, 0x01 ; 1 1d6d2: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } LCD_MESSAGERPGM(MSG_WELCOME); 1d6d6: 8b e0 ldi r24, 0x0B ; 11 1d6d8: 9c e6 ldi r25, 0x6C ; 108 1d6da: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1d6de: 10 92 97 03 sts 0x0397, r1 ; 0x800397 menu_submenu(lcd_sdcard_menu, true); 1d6e2: 61 e0 ldi r22, 0x01 ; 1 1d6e4: 88 e3 ldi r24, 0x38 ; 56 1d6e6: 9c ee ldi r25, 0xEC ; 236 1d6e8: 0f 94 89 95 call 0x32b12 ; 0x32b12 lcd_timeoutToStatus.start(); 1d6ec: 81 eb ldi r24, 0xB1 ; 177 1d6ee: 93 e0 ldi r25, 0x03 ; 3 1d6f0: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1d6f4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1d6f8: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1d6fc: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1d700: 20 91 95 03 lds r18, 0x0395 ; 0x800395 1d704: 30 91 96 03 lds r19, 0x0396 ; 0x800396 1d708: 06 17 cp r16, r22 1d70a: 17 07 cpc r17, r23 1d70c: 28 07 cpc r18, r24 1d70e: 39 07 cpc r19, r25 1d710: e8 f5 brcc .+122 ; 0x1d78c { if (lcd_draw_update) { 1d712: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d716: 88 23 and r24, r24 1d718: 31 f0 breq .+12 ; 0x1d726 lcd_timeoutToStatus.start(); 1d71a: 81 eb ldi r24, 0xB1 ; 177 1d71c: 93 e0 ldi r25, 0x03 ; 3 1d71e: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> lcd_frame_start(); 1d722: 0e 94 b0 69 call 0xd360 ; 0xd360 } (*menu_menu)(); 1d726: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d72a: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d72e: 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)))); 1d730: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d734: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d738: 8d 55 subi r24, 0x5D ; 93 1d73a: 98 43 sbci r25, 0x38 ; 56 1d73c: 09 f4 brne .+2 ; 0x1d740 1d73e: 5d c0 rjmp .+186 ; 0x1d7fa } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1d740: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d744: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d748: 27 e3 ldi r18, 0x37 ; 55 1d74a: 89 30 cpi r24, 0x09 ; 9 1d74c: 92 07 cpc r25, r18 1d74e: 09 f0 breq .+2 ; 0x1d752 1d750: 75 c0 rjmp .+234 ; 0x1d83c } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1d752: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d756: 82 30 cpi r24, 0x02 ; 2 1d758: 21 f4 brne .+8 ; 0x1d762 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1d75a: 0e 94 a8 6a call 0xd550 ; 0xd550 lcd_status_message_idx = 0; // Re-draw message from beginning 1d75e: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 1d762: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d766: 88 23 and r24, r24 1d768: 19 f0 breq .+6 ; 0x1d770 1d76a: 81 50 subi r24, 0x01 ; 1 1d76c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1d770: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1d774: 6c 59 subi r22, 0x9C ; 156 1d776: 7f 4f sbci r23, 0xFF ; 255 1d778: 8f 4f sbci r24, 0xFF ; 255 1d77a: 9f 4f sbci r25, 0xFF ; 255 1d77c: 60 93 93 03 sts 0x0393, r22 ; 0x800393 1d780: 70 93 94 03 sts 0x0394, r23 ; 0x800394 1d784: 80 93 95 03 sts 0x0395, r24 ; 0x800395 1d788: 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))) { 1d78c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d790: 88 23 and r24, r24 1d792: 99 f0 breq .+38 ; 0x1d7ba 1d794: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_ZL11no_response.lto_priv.495> 1d798: 88 23 and r24, r24 1d79a: 79 f0 breq .+30 ; 0x1d7ba 1d79c: 60 e1 ldi r22, 0x10 ; 16 1d79e: 77 e2 ldi r23, 0x27 ; 39 1d7a0: 8f e8 ldi r24, 0x8F ; 143 1d7a2: 93 e0 ldi r25, 0x03 ; 3 1d7a4: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1d7a8: 88 23 and r24, r24 1d7aa: 39 f0 breq .+14 ; 0x1d7ba //send important status messages periodicaly prusa_statistics(8); 1d7ac: 88 e0 ldi r24, 0x08 ; 8 1d7ae: 0f 94 5f 99 call 0x332be ; 0x332be NcTime.start(); 1d7b2: 8f e8 ldi r24, 0x8F ; 143 1d7b4: 93 e0 ldi r25, 0x03 ; 3 1d7b6: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1d7ba: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d7be: 84 30 cpi r24, 0x04 ; 4 1d7c0: 09 f0 breq .+2 ; 0x1d7c4 1d7c2: 53 c0 rjmp .+166 ; 0x1d86a 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) { 1d7c4: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1d7c8: 81 11 cpse r24, r1 1d7ca: 4f c0 rjmp .+158 ; 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(); } 1d7cc: 1f 91 pop r17 1d7ce: 0f 91 pop r16 1d7d0: 0c 94 a4 e6 jmp 0x1cd48 ; 0x1cd48 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1d7d4: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 1d7d8: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 1d7dc: 87 e7 ldi r24, 0x77 ; 119 1d7de: 9e e9 ldi r25, 0x9E ; 158 1d7e0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1d7e4: 8d e8 ldi r24, 0x8D ; 141 1d7e6: 98 e6 ldi r25, 0x68 ; 104 1d7e8: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1d7ec: 87 e6 ldi r24, 0x67 ; 103 1d7ee: 90 e4 ldi r25, 0x40 ; 64 1d7f0: 0e 94 32 6d call 0xda64 ; 0xda64 1d7f4: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 1d7f8: 7d cf rjmp .-262 ; 0x1d6f4 // 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)))); 1d7fa: 0e 94 58 61 call 0xc2b0 ; 0xc2b0 1d7fe: 81 11 cpse r24, r1 1d800: 0e c0 rjmp .+28 ; 0x1d81e 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) 1d802: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d806: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d80a: 30 97 sbiw r30, 0x00 ; 0 1d80c: 39 f5 brne .+78 ; 0x1d85c { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1d80e: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_return_to_status(); 1d812: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_draw_update = 2; 1d816: 82 e0 ldi r24, 0x02 ; 2 1d818: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b 1d81c: 9a cf rjmp .-204 ; 0x1d752 // 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)))); 1d81e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d822: 81 11 cpse r24, r1 1d824: 8d cf rjmp .-230 ; 0x1d740 1d826: 40 e9 ldi r20, 0x90 ; 144 1d828: 5f e5 ldi r21, 0x5F ; 95 1d82a: 61 e0 ldi r22, 0x01 ; 1 1d82c: 70 e0 ldi r23, 0x00 ; 0 1d82e: 81 eb ldi r24, 0xB1 ; 177 1d830: 93 e0 ldi r25, 0x03 ; 3 1d832: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> 1d836: 81 11 cpse r24, r1 1d838: e4 cf rjmp .-56 ; 0x1d802 1d83a: 82 cf rjmp .-252 ; 0x1d740 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1d83c: 8d 55 subi r24, 0x5D ; 93 1d83e: 98 43 sbci r25, 0x38 ; 56 1d840: 09 f4 brne .+2 ; 0x1d844 1d842: 87 cf rjmp .-242 ; 0x1d752 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d844: 40 e3 ldi r20, 0x30 ; 48 1d846: 55 e7 ldi r21, 0x75 ; 117 1d848: 60 e0 ldi r22, 0x00 ; 0 1d84a: 70 e0 ldi r23, 0x00 ; 0 1d84c: 81 eb ldi r24, 0xB1 ; 177 1d84e: 93 e0 ldi r25, 0x03 ; 3 1d850: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> 1d854: 88 23 and r24, r24 1d856: 09 f4 brne .+2 ; 0x1d85a 1d858: 7c cf rjmp .-264 ; 0x1d752 1d85a: d3 cf rjmp .-90 ; 0x1d802 // 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; 1d85c: 81 e0 ldi r24, 0x01 ; 1 1d85e: 80 93 92 03 sts 0x0392, r24 ; 0x800392 (*menu_menu)(); 1d862: 19 95 eicall menu_leaving = 0; 1d864: 10 92 92 03 sts 0x0392, r1 ; 0x800392 1d868: d2 cf rjmp .-92 ; 0x1d80e 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(); } 1d86a: 1f 91 pop r17 1d86c: 0f 91 pop r16 1d86e: 08 95 ret 0001d870 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1d870: 2f 92 push r2 1d872: 3f 92 push r3 1d874: 4f 92 push r4 1d876: 5f 92 push r5 1d878: 6f 92 push r6 1d87a: 7f 92 push r7 1d87c: 8f 92 push r8 1d87e: 9f 92 push r9 1d880: af 92 push r10 1d882: bf 92 push r11 1d884: cf 92 push r12 1d886: df 92 push r13 1d888: ef 92 push r14 1d88a: ff 92 push r15 1d88c: 0f 93 push r16 1d88e: 1f 93 push r17 1d890: cf 93 push r28 1d892: df 93 push r29 1d894: cd b7 in r28, 0x3d ; 61 1d896: de b7 in r29, 0x3e ; 62 1d898: 2d 97 sbiw r28, 0x0d ; 13 1d89a: 0f b6 in r0, 0x3f ; 63 1d89c: f8 94 cli 1d89e: de bf out 0x3e, r29 ; 62 1d8a0: 0f be out 0x3f, r0 ; 63 1d8a2: 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) 1d8a4: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1d8a8: 81 30 cpi r24, 0x01 ; 1 1d8aa: 51 f1 breq .+84 ; 0x1d900 1d8ac: 30 f0 brcs .+12 ; 0x1d8ba 1d8ae: 82 30 cpi r24, 0x02 ; 2 1d8b0: 09 f4 brne .+2 ; 0x1d8b4 1d8b2: 88 c2 rjmp .+1296 ; 0x1ddc4 { _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. 1d8b4: 10 92 64 03 sts 0x0364, r1 ; 0x800364 1d8b8: 04 c1 rjmp .+520 ; 0x1dac2 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1d8ba: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1d8be: 88 23 and r24, r24 1d8c0: 49 f0 breq .+18 ; 0x1d8d4 { card.presort_flag = false; 1d8c2: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 lcd_update_enabled = false; 1d8c6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c card.presort(); 1d8ca: 0f 94 a2 49 call 0x29344 ; 0x29344 lcd_update_enabled = true; 1d8ce: 81 e0 ldi r24, 0x01 ; 1 1d8d0: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } _md->fileCnt = card.getnrfilenames(); 1d8d4: 0f 94 8b 48 call 0x29116 ; 0x29116 1d8d8: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 1d8dc: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1d8e0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d8e4: 81 11 cpse r24, r1 1d8e6: e7 c0 rjmp .+462 ; 0x1dab6 1d8e8: 89 e0 ldi r24, 0x09 ; 9 1d8ea: 9f e0 ldi r25, 0x0F ; 15 1d8ec: 0f 94 3c a1 call 0x34278 ; 0x34278 1d8f0: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e _md->menuState = _standard; 1d8f4: 81 e0 ldi r24, 0x01 ; 1 1d8f6: 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. 1d8fa: 8f ef ldi r24, 0xFF ; 255 1d8fc: 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. 1d900: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 1d904: 81 11 cpse r24, r1 1d906: 07 c0 rjmp .+14 ; 0x1d916 { _md->lcd_scrollTimer.start(); 1d908: 8f e6 ldi r24, 0x6F ; 111 1d90a: 93 e0 ldi r25, 0x03 ; 3 1d90c: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> lcd_draw_update = 1; 1d910: 81 e0 ldi r24, 0x01 ; 1 1d912: 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. 1d916: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d91a: 81 11 cpse r24, r1 1d91c: 21 c0 rjmp .+66 ; 0x1d960 1d91e: 64 ef ldi r22, 0xF4 ; 244 1d920: 71 e0 ldi r23, 0x01 ; 1 1d922: 8f e6 ldi r24, 0x6F ; 111 1d924: 93 e0 ldi r25, 0x03 ; 3 1d926: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1d92a: 88 23 and r24, r24 1d92c: a1 f0 breq .+40 ; 0x1d956 1d92e: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 1d932: 8f 3f cpi r24, 0xFF ; 255 1d934: 81 f0 breq .+32 ; 0x1d956 { _md->menuState = _scrolling; 1d936: 82 e0 ldi r24, 0x02 ; 2 1d938: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->offset = 0; 1d93c: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->scrollPointer = NULL; 1d940: 10 92 68 03 sts 0x0368, r1 ; 0x800368 1d944: 10 92 67 03 sts 0x0367, r1 ; 0x800367 _md->lcd_scrollTimer.start(); 1d948: 8f e6 ldi r24, 0x6F ; 111 1d94a: 93 e0 ldi r25, 0x03 ; 3 1d94c: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1d950: 81 e0 ldi r24, 0x01 ; 1 1d952: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update == 0 && !lcd_clicked()) 1d956: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d95a: 88 23 and r24, r24 1d95c: 09 f4 brne .+2 ; 0x1d960 1d95e: ad c0 rjmp .+346 ; 0x1daba 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. 1d960: 8f ef ldi r24, 0xFF ; 255 1d962: 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(); 1d966: 8f e6 ldi r24, 0x6F ; 111 1d968: 93 e0 ldi r25, 0x03 ; 3 1d96a: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> MENU_BEGIN(); 1d96e: 0f 94 1c 94 call 0x32838 ; 0x32838 1d972: 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); 1d976: ce 01 movw r24, r28 1d978: 01 96 adiw r24, 0x01 ; 1 1d97a: 7c 01 movw r14, r24 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1d97c: fd e8 ldi r31, 0x8D ; 141 1d97e: 2f 2e mov r2, r31 1d980: fc e6 ldi r31, 0x6C ; 108 1d982: 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(); 1d984: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1d988: 84 30 cpi r24, 0x04 ; 4 1d98a: 08 f0 brcs .+2 ; 0x1d98e 1d98c: 9a c0 rjmp .+308 ; 0x1dac2 1d98e: 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 1d992: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1d996: 88 23 and r24, r24 1d998: 09 f4 brne .+2 ; 0x1d99c 1d99a: ac c0 rjmp .+344 ; 0x1daf4 1d99c: 8a e5 ldi r24, 0x5A ; 90 1d99e: 9e e3 ldi r25, 0x3E ; 62 1d9a0: 0e 94 32 6d call 0xda64 ; 0xda64 1d9a4: 0f 94 e7 96 call 0x32dce ; 0x32dce 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;}; 1d9a8: 6c e6 ldi r22, 0x6C ; 108 1d9aa: 73 e1 ldi r23, 0x13 ; 19 1d9ac: 85 e1 ldi r24, 0x15 ; 21 1d9ae: 94 e1 ldi r25, 0x14 ; 20 1d9b0: 0f 94 15 70 call 0x2e02a ; 0x2e02a card.getWorkDirName(); if (card.filename[0] == '/') 1d9b4: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1d9b8: 8f 32 cpi r24, 0x2F ; 47 1d9ba: 09 f0 breq .+2 ; 0x1d9be 1d9bc: 9e c0 rjmp .+316 ; 0x1dafa { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1d9be: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1d9c2: 88 23 and r24, r24 1d9c4: 41 f0 breq .+16 ; 0x1d9d6 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1d9c6: 8f e4 ldi r24, 0x4F ; 79 1d9c8: 9e e3 ldi r25, 0x3E ; 62 1d9ca: 0e 94 32 6d call 0xda64 ; 0xda64 1d9ce: 65 ec ldi r22, 0xC5 ; 197 1d9d0: 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. 1d9d2: 0f 94 99 93 call 0x32732 ; 0x32732 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1d9d6: c0 90 6b 03 lds r12, 0x036B ; 0x80036b 1d9da: 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; 1d9de: 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. 1d9e0: 91 e0 ldi r25, 0x01 ; 1 1d9e2: c9 1a sub r12, r25 1d9e4: d1 08 sbc r13, r1 1d9e6: 08 f4 brcc .+2 ; 0x1d9ea 1d9e8: e0 c1 rjmp .+960 ; 0x1ddaa { if (menu_item == menu_line) //If the file is on the screen. 1d9ea: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1d9ee: 90 91 30 04 lds r25, 0x0430 ; 0x800430 1d9f2: 89 13 cpse r24, r25 1d9f4: d6 c1 rjmp .+940 ; 0x1dda2 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1d9f6: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1d9fa: c6 01 movw r24, r12 1d9fc: 0f 94 19 52 call 0x2a432 ; 0x2a432 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1da00: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1da04: 90 e0 ldi r25, 0x00 ; 0 1da06: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1da0a: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1da0e: 10 91 b6 13 lds r17, 0x13B6 ; 0x8013b6 1da12: 82 17 cp r24, r18 1da14: 93 07 cpc r25, r19 1da16: 51 f4 brne .+20 ; 0x1da2c { _md->selectedFileID = i; 1da18: d0 92 6a 03 sts 0x036A, r13 ; 0x80036a 1da1c: c0 92 69 03 sts 0x0369, r12 ; 0x800369 _md->isDir = card.filenameIsDir; 1da20: 10 93 66 03 sts 0x0366, r17 ; 0x800366 _md->row = menu_row; 1da24: 40 91 2e 04 lds r20, 0x042E ; 0x80042e 1da28: 40 93 6d 03 sts 0x036D, r20 ; 0x80036d 1da2c: 40 91 5b 02 lds r20, 0x025B ; 0x80025b } if (card.filenameIsDir) 1da30: 11 23 and r17, r17 1da32: 09 f4 brne .+2 ; 0x1da36 1da34: 67 c0 rjmp .+206 ; 0x1db04 #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) 1da36: 44 23 and r20, r20 1da38: e9 f0 breq .+58 ; 0x1da74 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1da3a: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1da3e: ec e6 ldi r30, 0x6C ; 108 1da40: ae 2e mov r10, r30 1da42: e3 e1 ldi r30, 0x13 ; 19 1da44: be 2e mov r11, r30 1da46: 44 23 and r20, r20 1da48: 21 f0 breq .+8 ; 0x1da52 1da4a: 71 e8 ldi r23, 0x81 ; 129 1da4c: a7 2e mov r10, r23 1da4e: 73 e1 ldi r23, 0x13 ; 19 1da50: b7 2e mov r11, r23 1da52: 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)?'>':' '); 1da56: 4e e3 ldi r20, 0x3E ; 62 1da58: 82 17 cp r24, r18 1da5a: 93 07 cpc r25, r19 1da5c: 09 f0 breq .+2 ; 0x1da60 1da5e: 40 e2 ldi r20, 0x20 ; 32 1da60: 80 e0 ldi r24, 0x00 ; 0 1da62: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc(LCD_STR_FOLDER[0]); 1da66: 85 e8 ldi r24, 0x85 ; 133 1da68: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_print_pad(longFilename, len); 1da6c: 62 e1 ldi r22, 0x12 ; 18 1da6e: c5 01 movw r24, r10 1da70: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 1da74: 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)) 1da78: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1da7c: 99 23 and r25, r25 1da7e: 09 f4 brne .+2 ; 0x1da82 1da80: 90 c1 rjmp .+800 ; 0x1dda2 1da82: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1da86: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1da8a: 82 17 cp r24, r18 1da8c: 13 06 cpc r1, r19 1da8e: 09 f0 breq .+2 ; 0x1da92 1da90: 88 c1 rjmp .+784 ; 0x1dda2 { lcd_update_enabled = false; 1da92: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1da96: 61 e0 ldi r22, 0x01 ; 1 1da98: 8c e6 ldi r24, 0x6C ; 108 1da9a: 93 e1 ldi r25, 0x13 ; 19 1da9c: 0f 94 2c 4b call 0x29658 ; 0x29658 lcd_encoder = 0; 1daa0: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1daa4: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 1daa8: 0f 94 3e 94 call 0x3287c ; 0x3287c } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1daac: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c menu_item_ret(); 1dab0: 0f 94 02 93 call 0x32604 ; 0x32604 1dab4: 95 cf rjmp .-214 ; 0x1d9e0 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); 1dab6: 82 e0 ldi r24, 0x02 ; 2 1dab8: 1b cf rjmp .-458 ; 0x1d8f0 _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()) 1daba: 0e 94 19 6c call 0xd832 ; 0xd832 1dabe: 81 11 cpse r24, r1 1dac0: 4f cf rjmp .-354 ; 0x1d960 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1dac2: 2d 96 adiw r28, 0x0d ; 13 1dac4: 0f b6 in r0, 0x3f ; 63 1dac6: f8 94 cli 1dac8: de bf out 0x3e, r29 ; 62 1daca: 0f be out 0x3f, r0 ; 63 1dacc: cd bf out 0x3d, r28 ; 61 1dace: df 91 pop r29 1dad0: cf 91 pop r28 1dad2: 1f 91 pop r17 1dad4: 0f 91 pop r16 1dad6: ff 90 pop r15 1dad8: ef 90 pop r14 1dada: df 90 pop r13 1dadc: cf 90 pop r12 1dade: bf 90 pop r11 1dae0: af 90 pop r10 1dae2: 9f 90 pop r9 1dae4: 8f 90 pop r8 1dae6: 7f 90 pop r7 1dae8: 6f 90 pop r6 1daea: 5f 90 pop r5 1daec: 4f 90 pop r4 1daee: 3f 90 pop r3 1daf0: 2f 90 pop r2 1daf2: 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 1daf4: 86 e7 ldi r24, 0x76 ; 118 1daf6: 90 e4 ldi r25, 0x40 ; 64 1daf8: 53 cf rjmp .-346 ; 0x1d9a0 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. 1dafa: 6f ec ldi r22, 0xCF ; 207 1dafc: 7a eb ldi r23, 0xBA ; 186 1dafe: 84 ec ldi r24, 0xC4 ; 196 1db00: 93 e8 ldi r25, 0x83 ; 131 1db02: 67 cf rjmp .-306 ; 0x1d9d2 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1db04: 44 23 and r20, r20 1db06: d1 f0 breq .+52 ; 0x1db3c { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1db08: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1db0c: 6c e6 ldi r22, 0x6C ; 108 1db0e: a6 2e mov r10, r22 1db10: 63 e1 ldi r22, 0x13 ; 19 1db12: b6 2e mov r11, r22 1db14: 44 23 and r20, r20 1db16: 21 f0 breq .+8 ; 0x1db20 1db18: 51 e8 ldi r21, 0x81 ; 129 1db1a: a5 2e mov r10, r21 1db1c: 53 e1 ldi r21, 0x13 ; 19 1db1e: b5 2e mov r11, r21 1db20: 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)?'>':' '); 1db24: 4e e3 ldi r20, 0x3E ; 62 1db26: 82 17 cp r24, r18 1db28: 93 07 cpc r25, r19 1db2a: 09 f0 breq .+2 ; 0x1db2e 1db2c: 40 e2 ldi r20, 0x20 ; 32 1db2e: 80 e0 ldi r24, 0x00 ; 0 1db30: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_print_pad(longFilename, len); 1db34: 63 e1 ldi r22, 0x13 ; 19 1db36: c5 01 movw r24, r10 1db38: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 1db3c: 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)) 1db40: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1db44: 99 23 and r25, r25 1db46: 09 f4 brne .+2 ; 0x1db4a 1db48: 2c c1 rjmp .+600 ; 0x1dda2 1db4a: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1db4e: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1db52: 82 17 cp r24, r18 1db54: 13 06 cpc r1, r19 1db56: 09 f0 breq .+2 ; 0x1db5a 1db58: 24 c1 rjmp .+584 ; 0x1dda2 { lcd_update_enabled = false; 1db5a: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1db5e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1db62: 81 11 cpse r24, r1 1db64: a3 cf rjmp .-186 ; 0x1daac // 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); 1db66: 6c e6 ldi r22, 0x6C ; 108 1db68: 73 e1 ldi r23, 0x13 ; 19 1db6a: c7 01 movw r24, r14 1db6c: 0f 94 a7 a7 call 0x34f4e ; 0x34f4e 1db70: 47 01 movw r8, r14 1db72: 45 e9 ldi r20, 0x95 ; 149 1db74: a4 2e mov r10, r20 1db76: 4f e0 ldi r20, 0x0F ; 15 1db78: 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] == '.') { 1db7a: f4 01 movw r30, r8 1db7c: 61 91 ld r22, Z+ 1db7e: 4f 01 movw r8, r30 1db80: 66 23 and r22, r22 1db82: 19 f0 breq .+6 ; 0x1db8a 1db84: 6e 32 cpi r22, 0x2E ; 46 1db86: 09 f0 breq .+2 ; 0x1db8a 1db88: 4b c0 rjmp .+150 ; 0x1dc20 1db8a: 60 e0 ldi r22, 0x00 ; 0 1db8c: c5 01 movw r24, r10 1db8e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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, '.'); 1db92: 6e e2 ldi r22, 0x2E ; 46 1db94: 70 e0 ldi r23, 0x00 ; 0 1db96: c7 01 movw r24, r14 1db98: 0f 94 93 a7 call 0x34f26 ; 0x34f26 1db9c: 3c 01 movw r6, r24 if (extension_ptr) { 1db9e: 89 2b or r24, r25 1dba0: 19 f0 breq .+6 ; 0x1dba8 extension_ptr++; // skip the '.' 1dba2: 8f ef ldi r24, 0xFF ; 255 1dba4: 68 1a sub r6, r24 1dba6: 78 0a sbc r7, r24 1dba8: 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); 1dbaa: 31 e9 ldi r19, 0x91 ; 145 1dbac: a3 2e mov r10, r19 1dbae: 3c e0 ldi r19, 0x0C ; 12 1dbb0: 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') { 1dbb2: 61 14 cp r6, r1 1dbb4: 71 04 cpc r7, r1 1dbb6: 21 f0 breq .+8 ; 0x1dbc0 1dbb8: f4 01 movw r30, r8 1dbba: 60 81 ld r22, Z 1dbbc: 61 11 cpse r22, r1 1dbbe: 01 c0 rjmp .+2 ; 0x1dbc2 1dbc0: 60 e0 ldi r22, 0x00 ; 0 1dbc2: c5 01 movw r24, r10 1dbc4: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1dbc8: ff ef ldi r31, 0xFF ; 255 1dbca: af 1a sub r10, r31 1dbcc: bf 0a sbc r11, r31 1dbce: 2f ef ldi r18, 0xFF ; 255 1dbd0: 82 1a sub r8, r18 1dbd2: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1dbd4: 84 e9 ldi r24, 0x94 ; 148 1dbd6: a8 16 cp r10, r24 1dbd8: 8c e0 ldi r24, 0x0C ; 12 1dbda: b8 06 cpc r11, r24 1dbdc: 51 f7 brne .-44 ; 0x1dbb2 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1dbde: 60 90 0a 15 lds r6, 0x150A ; 0x80150a 1dbe2: 66 2d mov r22, r6 1dbe4: 8a e5 ldi r24, 0x5A ; 90 1dbe6: 9f e0 ldi r25, 0x0F ; 15 1dbe8: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1dbec: 88 e6 ldi r24, 0x68 ; 104 1dbee: 93 e1 ldi r25, 0x13 ; 19 1dbf0: 2a e0 ldi r18, 0x0A ; 10 1dbf2: a2 2e mov r10, r18 1dbf4: 2f e0 ldi r18, 0x0F ; 15 1dbf6: 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++) { 1dbf8: 71 2c mov r7, r1 1dbfa: 4c 01 movw r8, r24 1dbfc: e9 e0 ldi r30, 0x09 ; 9 1dbfe: 8e 0e add r8, r30 1dc00: 91 1c adc r9, r1 1dc02: 76 14 cp r7, r6 1dc04: d1 f0 breq .+52 ; 0x1dc3a #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); 1dc06: 48 e0 ldi r20, 0x08 ; 8 1dc08: 50 e0 ldi r21, 0x00 ; 0 1dc0a: b5 01 movw r22, r10 1dc0c: 8e 5a subi r24, 0xAE ; 174 1dc0e: 9f 4f sbci r25, 0xFF ; 255 1dc10: 0f 94 50 a1 call 0x342a0 ; 0x342a0 1dc14: 73 94 inc r7 1dc16: f8 e0 ldi r31, 0x08 ; 8 1dc18: af 0e add r10, r31 1dc1a: b1 1c adc r11, r1 1dc1c: c4 01 movw r24, r8 1dc1e: ed cf rjmp .-38 ; 0x1dbfa if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dc20: c5 01 movw r24, r10 1dc22: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1dc26: ff ef ldi r31, 0xFF ; 255 1dc28: af 1a sub r10, r31 1dc2a: 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++) { 1dc2c: 2d e9 ldi r18, 0x9D ; 157 1dc2e: a2 16 cp r10, r18 1dc30: 2f e0 ldi r18, 0x0F ; 15 1dc32: b2 06 cpc r11, r18 1dc34: 09 f0 breq .+2 ; 0x1dc38 1dc36: a1 cf rjmp .-190 ; 0x1db7a 1dc38: ac cf rjmp .-168 ; 0x1db92 /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1dc3a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1dc3e: 88 23 and r24, r24 1dc40: 91 f0 breq .+36 ; 0x1dc66 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1dc42: ff 92 push r15 1dc44: ef 92 push r14 1dc46: 3f 92 push r3 1dc48: 2f 92 push r2 1dc4a: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommand_P(MSG_M24); 1dc4e: 61 e0 ldi r22, 0x01 ; 1 1dc50: 89 e8 ldi r24, 0x89 ; 137 1dc52: 9c e6 ldi r25, 0x6C ; 108 1dc54: 0e 94 37 7d call 0xfa6e ; 0xfa6e 1dc58: 0f 90 pop r0 1dc5a: 0f 90 pop r0 1dc5c: 0f 90 pop r0 1dc5e: 0f 90 pop r0 } lcd_return_to_status(); 1dc60: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e 1dc64: 23 cf rjmp .-442 ; 0x1daac /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1dc66: 61 e0 ldi r22, 0x01 ; 1 1dc68: c7 01 movw r24, r14 1dc6a: 0f 94 63 4c call 0x298c6 ; 0x298c6 } uint32_t CardReader::getFileSize() { return filesize; 1dc6e: 40 90 77 16 lds r4, 0x1677 ; 0x801677 1dc72: 50 90 78 16 lds r5, 0x1678 ; 0x801678 1dc76: 60 90 79 16 lds r6, 0x1679 ; 0x801679 1dc7a: 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); 1dc7e: 94 2d mov r25, r4 1dc80: 85 2d mov r24, r5 1dc82: 21 e0 ldi r18, 0x01 ; 1 1dc84: 42 16 cp r4, r18 1dc86: 28 e7 ldi r18, 0x78 ; 120 1dc88: 52 06 cpc r5, r18 1dc8a: 61 04 cpc r6, r1 1dc8c: 71 04 cpc r7, r1 1dc8e: 10 f0 brcs .+4 ; 0x1dc94 1dc90: 90 e0 ldi r25, 0x00 ; 0 1dc92: 88 e7 ldi r24, 0x78 ; 120 1dc94: a9 2e mov r10, r25 1dc96: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1dc98: 81 e0 ldi r24, 0x01 ; 1 1dc9a: 48 16 cp r4, r24 1dc9c: 88 e7 ldi r24, 0x78 ; 120 1dc9e: 58 06 cpc r5, r24 1dca0: 61 04 cpc r6, r1 1dca2: 71 04 cpc r7, r1 1dca4: 08 f4 brcc .+2 ; 0x1dca8 1dca6: 5d c0 rjmp .+186 ; 0x1dd62 startPos = filesize - END_FILE_SECTION; 1dca8: 98 e7 ldi r25, 0x78 ; 120 1dcaa: 59 1a sub r5, r25 1dcac: 61 08 sbc r6, r1 1dcae: 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);}; 1dcb0: 40 92 7e 16 sts 0x167E, r4 ; 0x80167e 1dcb4: 50 92 7f 16 sts 0x167F, r5 ; 0x80167f 1dcb8: 60 92 80 16 sts 0x1680, r6 ; 0x801680 1dcbc: 70 92 81 16 sts 0x1681, r7 ; 0x801681 1dcc0: c3 01 movw r24, r6 1dcc2: b2 01 movw r22, r4 1dcc4: 0f 94 53 44 call 0x288a6 ; 0x288a6 card.setIndex(startPos); } cmdqueue_reset(); 1dcc8: 0e 94 a1 73 call 0xe742 ; 0xe742 cmdqueue_serial_disabled = true; 1dccc: 00 93 61 03 sts 0x0361, r16 ; 0x800361 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1dcd0: 8b e1 ldi r24, 0x1B ; 27 1dcd2: 9e e3 ldi r25, 0x3E ; 62 1dcd4: 0e 94 32 6d call 0xda64 ; 0xda64 1dcd8: bc 01 movw r22, r24 1dcda: c5 01 movw r24, r10 1dcdc: 0f 94 7e 92 call 0x324fc ; 0x324fc 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; } 1dce0: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1dce4: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1dce8: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1dcec: b0 91 81 16 lds r27, 0x1681 ; 0x801681 while (!card.eof() && !result) { 1dcf0: 40 91 77 16 lds r20, 0x1677 ; 0x801677 1dcf4: 50 91 78 16 lds r21, 0x1678 ; 0x801678 1dcf8: 60 91 79 16 lds r22, 0x1679 ; 0x801679 1dcfc: 70 91 7a 16 lds r23, 0x167A ; 0x80167a 1dd00: 84 17 cp r24, r20 1dd02: 95 07 cpc r25, r21 1dd04: a6 07 cpc r26, r22 1dd06: b7 07 cpc r27, r23 1dd08: 80 f5 brcc .+96 ; 0x1dd6a 1dd0a: 11 11 cpse r17, r1 1dd0c: 2e c0 rjmp .+92 ; 0x1dd6a 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); }; 1dd0e: 20 91 fd 15 lds r18, 0x15FD ; 0x8015fd 1dd12: 21 11 cpse r18, r1 1dd14: 03 c0 rjmp .+6 ; 0x1dd1c 1dd16: 80 e0 ldi r24, 0x00 ; 0 1dd18: 90 e0 ldi r25, 0x00 ; 0 1dd1a: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1dd1c: 84 19 sub r24, r4 1dd1e: 95 09 sbc r25, r5 1dd20: 0f 94 4f 92 call 0x3249e ; 0x3249e card.sdprinting = true; 1dd24: 00 93 6a 13 sts 0x136A, r16 ; 0x80136a get_command(); 1dd28: 0e 94 fa 75 call 0xebf4 ; 0xebf4 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1dd2c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1dd30: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1dd34: 89 2b or r24, r25 1dd36: a1 f2 breq .-88 ; 0x1dce0 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1dd38: 8d ea ldi r24, 0xAD ; 173 1dd3a: 98 e6 ldi r25, 0x68 ; 104 1dd3c: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 1dd40: 81 11 cpse r24, r1 1dd42: 05 c0 rjmp .+10 ; 0x1dd4e 1dd44: 8f eb ldi r24, 0xBF ; 191 1dd46: 93 e8 ldi r25, 0x83 ; 131 1dd48: 0f 94 b1 75 call 0x2eb62 ; 0x2eb62 1dd4c: 81 11 cpse r24, r1 1dd4e: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1dd50: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1dd54: 81 11 cpse r24, r1 1dd56: 02 c0 rjmp .+4 ; 0x1dd5c cmdqueue_pop_front(); 1dd58: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 cmdbuffer_front_already_processed = false; 1dd5c: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 1dd60: e5 cf rjmp .-54 ; 0x1dd2c 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; 1dd62: 41 2c mov r4, r1 1dd64: 51 2c mov r5, r1 1dd66: 32 01 movw r6, r4 1dd68: af cf rjmp .-162 ; 0x1dcc8 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1dd6a: 0f 94 70 92 call 0x324e0 ; 0x324e0 cmdqueue_serial_disabled = false; 1dd6e: 10 92 61 03 sts 0x0361, r1 ; 0x800361 card.printingHasFinished(); 1dd72: 0f 94 9b 4d call 0x29b36 ; 0x29b36 lcd_setstatuspgm(MSG_WELCOME); 1dd76: 8b e0 ldi r24, 0x0B ; 11 1dd78: 9c e6 ldi r25, 0x6C ; 108 1dd7a: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 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)) { 1dd7e: 11 11 cpse r17, r1 1dd80: 60 cf rjmp .-320 ; 0x1dc42 result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1dd82: 8b e2 ldi r24, 0x2B ; 43 1dd84: 9e e3 ldi r25, 0x3E ; 62 1dd86: 0e 94 32 6d call 0xda64 ; 0xda64 1dd8a: 41 e0 ldi r20, 0x01 ; 1 1dd8c: 60 e0 ldi r22, 0x00 ; 0 1dd8e: 0f 94 33 2e call 0x25c66 ; 0x25c66 1dd92: 18 2f mov r17, r24 lcd_update_enable(true); 1dd94: 81 e0 ldi r24, 0x01 ; 1 1dd96: 0e 94 41 6a call 0xd482 ; 0xd482 } if (result) { 1dd9a: 11 23 and r17, r17 1dd9c: 09 f4 brne .+2 ; 0x1dda0 1dd9e: 51 cf rjmp .-350 ; 0x1dc42 1dda0: 5f cf rjmp .-322 ; 0x1dc60 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1dda2: 8f 5f subi r24, 0xFF ; 255 1dda4: 80 93 31 04 sts 0x0431, r24 ; 0x800431 1dda8: 1b ce rjmp .-970 ; 0x1d9e0 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1ddaa: 0f 94 f0 93 call 0x327e0 ; 0x327e0 _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(); 1ddae: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1ddb2: 8f 5f subi r24, 0xFF ; 255 1ddb4: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1ddb8: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1ddbc: 8f 5f subi r24, 0xFF ; 255 1ddbe: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1ddc2: e0 cd rjmp .-1088 ; 0x1d984 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. 1ddc4: 80 91 63 03 lds r24, 0x0363 ; 0x800363 1ddc8: 11 e0 ldi r17, 0x01 ; 1 1ddca: 81 11 cpse r24, r1 1ddcc: 05 c0 rjmp .+10 ; 0x1ddd8 1ddce: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1ddd2: 81 11 cpse r24, r1 1ddd4: 01 c0 rjmp .+2 ; 0x1ddd8 1ddd6: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1ddd8: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1dddc: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1dde0: 89 2b or r24, r25 1dde2: 91 f4 brne .+36 ; 0x1de08 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1dde4: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1dde8: 80 91 69 03 lds r24, 0x0369 ; 0x800369 1ddec: 90 91 6a 03 lds r25, 0x036A ; 0x80036a 1ddf0: 0f 94 19 52 call 0x2a432 ; 0x2a432 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1ddf4: 80 91 81 13 lds r24, 0x1381 ; 0x801381 1ddf8: 81 11 cpse r24, r1 1ddfa: 46 c0 rjmp .+140 ; 0x1de88 1ddfc: 8c e6 ldi r24, 0x6C ; 108 1ddfe: 93 e1 ldi r25, 0x13 ; 19 1de00: 90 93 68 03 sts 0x0368, r25 ; 0x800368 1de04: 80 93 67 03 sts 0x0367, r24 ; 0x800367 } if (rewindFlag) 1de08: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1de0a: 10 92 65 03 sts 0x0365, r1 ; 0x800365 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1de0e: 6c e2 ldi r22, 0x2C ; 44 1de10: 71 e0 ldi r23, 0x01 ; 1 1de12: 8f e6 ldi r24, 0x6F ; 111 1de14: 93 e0 ldi r25, 0x03 ; 3 1de16: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 1de1a: 81 11 cpse r24, r1 1de1c: 03 c0 rjmp .+6 ; 0x1de24 1de1e: 11 23 and r17, r17 1de20: 09 f4 brne .+2 ; 0x1de24 1de22: 4f ce rjmp .-866 ; 0x1dac2 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1de24: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de28: 02 e1 ldi r16, 0x12 ; 18 1de2a: 81 11 cpse r24, r1 1de2c: 01 c0 rjmp .+2 ; 0x1de30 1de2e: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1de30: 4e e3 ldi r20, 0x3E ; 62 1de32: 60 91 6d 03 lds r22, 0x036D ; 0x80036d 1de36: 80 e0 ldi r24, 0x00 ; 0 1de38: 0e 94 1c 6a call 0xd438 ; 0xd438 if (_md->isDir) 1de3c: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de40: 88 23 and r24, r24 1de42: 19 f0 breq .+6 ; 0x1de4a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1de44: 85 e8 ldi r24, 0x85 ; 133 1de46: 0e 94 ab 6a call 0xd556 ; 0xd556 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1de4a: 20 91 65 03 lds r18, 0x0365 ; 0x800365 1de4e: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1de52: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1de56: 60 2f mov r22, r16 1de58: 82 0f add r24, r18 1de5a: 91 1d adc r25, r1 1de5c: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 1de60: 81 11 cpse r24, r1 1de62: 15 c0 rjmp .+42 ; 0x1de8e { _md->lcd_scrollTimer.start(); 1de64: 8f e6 ldi r24, 0x6F ; 111 1de66: 93 e0 ldi r25, 0x03 ; 3 1de68: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> _md->offset++; 1de6c: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1de70: 8f 5f subi r24, 0xFF ; 255 1de72: 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. 1de76: 11 23 and r17, r17 1de78: 09 f4 brne .+2 ; 0x1de7c 1de7a: 23 ce rjmp .-954 ; 0x1dac2 1de7c: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1de80: 81 e0 ldi r24, 0x01 ; 1 1de82: 80 93 64 03 sts 0x0364, r24 ; 0x800364 1de86: 1d ce rjmp .-966 ; 0x1dac2 #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; 1de88: 81 e8 ldi r24, 0x81 ; 129 1de8a: 93 e1 ldi r25, 0x13 ; 19 1de8c: b9 cf rjmp .-142 ; 0x1de00 1de8e: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 1de92: f1 cf rjmp .-30 ; 0x1de76 0001de94 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1de94: 61 e0 ldi r22, 0x01 ; 1 1de96: 8f e1 ldi r24, 0x1F ; 31 1de98: 9c e6 ldi r25, 0x6C ; 108 1de9a: 0e 94 37 7d call 0xfa6e ; 0xfa6e custom_message_type = CustomMsg::FilamentLoading; //just print status message 1de9e: 82 e0 ldi r24, 0x02 ; 2 1dea0: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1dea4: 8d e7 ldi r24, 0x7D ; 125 1dea6: 97 e5 ldi r25, 0x57 ; 87 1dea8: 0e 94 32 6d call 0xda64 ; 0xda64 1deac: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_return_to_status(); 1deb0: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_draw_update = 3; 1deb4: 83 e0 ldi r24, 0x03 ; 3 1deb6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1deba: 08 95 ret 0001debc : //! @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; 1debc: 0e 94 47 e6 call 0x1cc8e ; 0x1cc8e 1dec0: 88 23 and r24, r24 1dec2: 51 f1 breq .+84 ; 0x1df18 cmdqueue_serial_disabled = false; 1dec4: 10 92 61 03 sts 0x0361, r1 ; 0x800361 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1dec8: 8d e7 ldi r24, 0x7D ; 125 1deca: 97 e5 ldi r25, 0x57 ; 87 1decc: 0e 94 32 6d call 0xda64 ; 0xda64 1ded0: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 st_synchronize(); 1ded4: 0f 94 a0 22 call 0x24540 ; 0x24540 custom_message_type = CustomMsg::Resuming; 1ded8: 88 e0 ldi r24, 0x08 ; 8 1deda: 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(); 1dede: 0e 94 b3 6e call 0xdd66 ; 0xdd66 setExtruderAutoFanState(1); 1dee2: 81 e0 ldi r24, 0x01 ; 1 1dee4: 0e 94 c0 6e call 0xdd80 ; 0xdd80 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1dee8: 10 92 ce 11 sts 0x11CE, r1 ; 0x8011ce restore_print_from_ram_and_continue(default_retraction); 1deec: 60 e0 ldi r22, 0x00 ; 0 1deee: 70 e0 ldi r23, 0x00 ; 0 1def0: 80 e8 ldi r24, 0x80 ; 128 1def2: 9f e3 ldi r25, 0x3F ; 63 1def4: 0e 94 c1 61 call 0xc382 ; 0xc382 did_pause_print = false; 1def8: 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(); 1defc: 80 91 59 03 lds r24, 0x0359 ; 0x800359 1df00: 82 30 cpi r24, 0x02 ; 2 1df02: 11 f4 brne .+4 ; 0x1df08 1df04: 0f 94 b4 20 call 0x24168 ; 0x24168 refresh_cmd_timeout(); 1df08: 0e 94 4a 60 call 0xc094 ; 0xc094 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1df0c: 84 e2 ldi r24, 0x24 ; 36 1df0e: 98 e6 ldi r25, 0x68 ; 104 1df10: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 custom_message_type = CustomMsg::Status; 1df14: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 1df18: 08 95 ret 0001df1a : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1df1a: cf 93 push r28 1df1c: df 93 push r29 1df1e: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1df20: 80 e0 ldi r24, 0x00 ; 0 1df22: 0e 94 19 e2 call 0x1c432 ; 0x1c432 1df26: 88 23 and r24, r24 1df28: 31 f0 breq .+12 ; 0x1df36 lcd_updatestatus(message); 1df2a: 60 e0 ldi r22, 0x00 ; 0 1df2c: ce 01 movw r24, r28 } 1df2e: df 91 pop r29 1df30: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1df32: 0c 94 fe e1 jmp 0x1c3fc ; 0x1c3fc } 1df36: df 91 pop r29 1df38: cf 91 pop r28 1df3a: 08 95 ret 0001df3c : 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) { 1df3c: cf 93 push r28 1df3e: df 93 push r29 1df40: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1df42: 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) { 1df44: 66 23 and r22, r22 1df46: 89 f1 breq .+98 ; 0x1dfaa 1df48: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1df4a: 0f 94 b9 12 call 0x22572 ; 0x22572 cancel_heatup = true; 1df4e: 81 e0 ldi r24, 0x01 ; 1 1df50: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> heating_status = HeatingStatus::NO_HEATING; 1df54: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1df58: 0e 94 10 5f call 0xbe20 ; 0xbe20 // Abort the planner planner_abort_hard(); 1df5c: 0f 94 4a 87 call 0x30e94 ; 0x30e94 // Reset the queue cmdqueue_reset(); 1df60: 0e 94 a1 73 call 0xe742 ; 0xe742 cmdqueue_serial_disabled = false; 1df64: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1df68: 0f 94 ac 22 call 0x24558 ; 0x24558 CRITICAL_SECTION_END; 1df6c: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1df6e: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b print_job_timer.stop(); 1df72: 0f 94 d8 20 call 0x241b0 ; 0x241b0 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1df76: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1df7a: 88 23 and r24, r24 1df7c: 21 f0 breq .+8 ; 0x1df86 // Reset the sd status card.sdprinting = false; 1df7e: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a card.closefile(); 1df82: 0f 94 3a 42 call 0x28474 ; 0x28474 } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1df86: 87 e6 ldi r24, 0x67 ; 103 1df88: 98 e6 ldi r25, 0x68 ; 104 1df8a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 #ifdef MESH_BED_LEVELING mbl.active = false; 1df8e: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c #endif if (interactive) { 1df92: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1df94: 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; 1df98: 81 e0 ldi r24, 0x01 ; 1 1df9a: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 1df9e: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1dfa2: df 91 pop r29 1dfa4: 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(); 1dfa6: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e } void ConditionalStop() { CRITICAL_SECTION_START; 1dfaa: 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; 1dfac: 81 e0 ldi r24, 0x01 ; 1 1dfae: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> heating_status = HeatingStatus::NO_HEATING; 1dfb2: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1dfb6: 0e 94 10 5f call 0xbe20 ; 0xbe20 // Abort the planner planner_abort_hard(); 1dfba: 0f 94 4a 87 call 0x30e94 ; 0x30e94 // Reset the queue cmdqueue_reset(); 1dfbe: 0e 94 a1 73 call 0xe742 ; 0xe742 cmdqueue_serial_disabled = false; 1dfc2: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1dfc6: 0f 94 ac 22 call 0x24558 ; 0x24558 CRITICAL_SECTION_END; 1dfca: df bf out 0x3f, r29 ; 63 1dfcc: d4 cf rjmp .-88 ; 0x1df76 0001dfce : } void lcd_print_stop() { print_stop(true); 1dfce: 60 e0 ldi r22, 0x00 ; 0 1dfd0: 81 e0 ldi r24, 0x01 ; 1 1dfd2: 0c 94 9e ef jmp 0x1df3c ; 0x1df3c 0001dfd6 : 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' 1dfd6: 41 30 cpi r20, 0x01 ; 1 1dfd8: 41 f4 brne .+16 ; 0x1dfea if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1dfda: 40 e0 ldi r20, 0x00 ; 0 1dfdc: 61 e0 ldi r22, 0x01 ; 1 1dfde: 0f 94 33 2e call 0x25c66 ; 0x25c66 1dfe2: 81 30 cpi r24, 0x01 ; 1 1dfe4: 41 f4 brne .+16 ; 0x1dff6 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1dfe6: 0c 94 e7 ef jmp 0x1dfce ; 0x1dfce { if (check == 1) { // Warning, stop print if user selects 'No' if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print 1dfea: 42 30 cpi r20, 0x02 ; 2 1dfec: 21 f4 brne .+8 ; 0x1dff6 lcd_show_fullscreen_message_and_wait_P(strict); 1dfee: cb 01 movw r24, r22 1dff0: 0f 94 7b 0b call 0x216f6 ; 0x216f6 1dff4: f8 cf rjmp .-16 ; 0x1dfe6 lcd_print_stop(); } } 1dff6: 08 95 ret 0001dff8 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1dff8: 0f 93 push r16 1dffa: 1f 93 push r17 1dffc: 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)) { 1dffe: 8c ea ldi r24, 0xAC ; 172 1e000: 9c e0 ldi r25, 0x0C ; 12 1e002: 0f 94 3c a1 call 0x34278 ; 0x34278 1e006: 88 23 and r24, r24 1e008: 29 f0 breq .+10 ; 0x1e014 return false; } } done: return true; 1e00a: 81 e0 ldi r24, 0x01 ; 1 } 1e00c: cf 91 pop r28 1e00e: 1f 91 pop r17 1e010: 0f 91 pop r16 1e012: 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()) { 1e014: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1e018: 88 23 and r24, r24 1e01a: b9 f3 breq .-18 ; 0x1e00a 1e01c: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 1e020: 81 11 cpse r24, r1 1e022: f3 cf rjmp .-26 ; 0x1e00a if (oCheckFilament == ClCheckMode::_None) { 1e024: c0 91 bc 03 lds r28, 0x03BC ; 0x8003bc 1e028: cc 23 and r28, r28 1e02a: 79 f3 breq .-34 ; 0x1e00a goto done; } render_M862_warnings( 1e02c: 84 e4 ldi r24, 0x44 ; 68 1e02e: 92 e4 ldi r25, 0x42 ; 66 1e030: 0e 94 32 6d call 0xda64 ; 0xda64 1e034: 8c 01 movw r16, r24 1e036: 8b e1 ldi r24, 0x1B ; 27 1e038: 92 e4 ldi r25, 0x42 ; 66 1e03a: 0e 94 32 6d call 0xda64 ; 0xda64 1e03e: 4c 2f mov r20, r28 1e040: b8 01 movw r22, r16 1e042: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1e046: 81 e0 ldi r24, 0x01 ; 1 1e048: 90 91 c8 0d lds r25, 0x0DC8 ; 0x800dc8 1e04c: 91 30 cpi r25, 0x01 ; 1 1e04e: f1 f6 brne .-68 ; 0x1e00c 1e050: 80 e0 ldi r24, 0x00 ; 0 1e052: dc cf rjmp .-72 ; 0x1e00c 0001e054 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1e054: 1f 93 push r17 1e056: cf 93 push r28 1e058: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1e05a: 10 91 bb 03 lds r17, 0x03BB ; 0x8003bb 1e05e: 11 23 and r17, r17 1e060: 19 f1 breq .+70 ; 0x1e0a8 1e062: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1e064: 85 ea ldi r24, 0xA5 ; 165 1e066: 9d e0 ldi r25, 0x0D ; 13 1e068: 0f 94 4a a1 call 0x34294 ; 0x34294 if (nDiameter == nDiameter_um) 1e06c: 8c 17 cp r24, r28 1e06e: 9d 07 cpc r25, r29 1e070: d9 f0 breq .+54 ; 0x1e0a8 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1e072: 8b eb ldi r24, 0xBB ; 187 1e074: 91 e4 ldi r25, 0x41 ; 65 1e076: 0e 94 32 6d call 0xda64 ; 0xda64 1e07a: ec 01 movw r28, r24 1e07c: 86 e8 ldi r24, 0x86 ; 134 1e07e: 91 e4 ldi r25, 0x41 ; 65 1e080: 0e 94 32 6d call 0xda64 ; 0xda64 1e084: 41 2f mov r20, r17 1e086: be 01 movw r22, r28 1e088: 0e 94 eb ef call 0x1dfd6 ; 0x1dfd6 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1e08c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1e090: 81 11 cpse r24, r1 1e092: 0a c0 rjmp .+20 ; 0x1e0a8 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1e094: 10 92 ba 03 sts 0x03BA, r1 ; 0x8003ba menu_submenu(lcd_hw_setup_menu); 1e098: 60 e0 ldi r22, 0x00 ; 0 1e09a: 8d ea ldi r24, 0xAD ; 173 1e09c: 93 eb ldi r25, 0xB3 ; 179 } } 1e09e: df 91 pop r29 1e0a0: cf 91 pop r28 1e0a2: 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); 1e0a4: 0d 94 89 95 jmp 0x32b12 ; 0x32b12 } } 1e0a8: df 91 pop r29 1e0aa: cf 91 pop r28 1e0ac: 1f 91 pop r17 1e0ae: 08 95 ret 0001e0b0 : } /// @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) { 1e0b0: cf 92 push r12 1e0b2: df 92 push r13 1e0b4: ef 92 push r14 1e0b6: ff 92 push r15 1e0b8: cf 93 push r28 1e0ba: 6b 01 movw r12, r22 1e0bc: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1e0be: 82 e0 ldi r24, 0x02 ; 2 1e0c0: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1e0c4: 80 e2 ldi r24, 0x20 ; 32 1e0c6: 97 e5 ldi r25, 0x57 ; 87 1e0c8: 0e 94 32 6d call 0xda64 ; 0xda64 1e0cc: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 1e0d0: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e0d4: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1e0d8: 20 e0 ldi r18, 0x00 ; 0 1e0da: 30 e0 ldi r19, 0x00 ; 0 1e0dc: 44 e3 ldi r20, 0x34 ; 52 1e0de: 52 e4 ldi r21, 0x42 ; 66 1e0e0: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e0e4: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e0e8: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e0ec: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e0f0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e0f4: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e0f8: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e0fc: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e100: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1e104: 6a e0 ldi r22, 0x0A ; 10 1e106: 77 e5 ldi r23, 0x57 ; 87 1e108: 8d ea ldi r24, 0xAD ; 173 1e10a: 92 e4 ldi r25, 0x42 ; 66 1e10c: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1e110: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1e114: 20 e0 ldi r18, 0x00 ; 0 1e116: 30 e0 ldi r19, 0x00 ; 0 1e118: 4c e0 ldi r20, 0x0C ; 12 1e11a: 52 e4 ldi r21, 0x42 ; 66 1e11c: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e120: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e124: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e128: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e12c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e130: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e134: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e138: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e13c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1e140: 69 e2 ldi r22, 0x29 ; 41 1e142: 7c e5 ldi r23, 0x5C ; 92 1e144: 85 e8 ldi r24, 0x85 ; 133 1e146: 91 e4 ldi r25, 0x41 ; 65 1e148: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1e14c: 0f 94 a0 22 call 0x24540 ; 0x24540 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1e150: 20 e0 ldi r18, 0x00 ; 0 1e152: 30 e0 ldi r19, 0x00 ; 0 1e154: a9 01 movw r20, r18 1e156: c7 01 movw r24, r14 1e158: b6 01 movw r22, r12 1e15a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1e15e: 88 23 and r24, r24 1e160: e1 f0 breq .+56 ; 0x1e19a { current_position[E_AXIS] += unloadLength; 1e162: a7 01 movw r20, r14 1e164: 96 01 movw r18, r12 1e166: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e16a: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e16e: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e172: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e176: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1e17a: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e17e: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e182: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e186: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1e18a: 60 e0 ldi r22, 0x00 ; 0 1e18c: 70 e0 ldi r23, 0x00 ; 0 1e18e: 80 e2 ldi r24, 0x20 ; 32 1e190: 91 e4 ldi r25, 0x41 ; 65 1e192: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1e196: 0f 94 a0 22 call 0x24540 ; 0x24540 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1e19a: 82 ef ldi r24, 0xF2 ; 242 1e19c: 9b e3 ldi r25, 0x3B ; 59 1e19e: 0e 94 32 6d call 0xda64 ; 0xda64 1e1a2: 0f 94 f4 0a call 0x215e8 ; 0x215e8 //disable extruder steppers so filament can be removed disable_e0(); 1e1a6: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1e1a8: 64 e6 ldi r22, 0x64 ; 100 1e1aa: 70 e0 ldi r23, 0x00 ; 0 1e1ac: 80 e0 ldi r24, 0x00 ; 0 1e1ae: 90 e0 ldi r25, 0x00 ; 0 1e1b0: 0f 94 d5 0d call 0x21baa ; 0x21baa Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1e1b4: 82 e0 ldi r24, 0x02 ; 2 1e1b6: 0f 94 fd 2c call 0x259fa ; 0x259fa 1e1ba: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1e1bc: 0e 94 19 6c call 0xd832 ; 0xd832 1e1c0: 81 11 cpse r24, r1 1e1c2: 07 c0 rjmp .+14 ; 0x1e1d2 1e1c4: c1 50 subi r28, 0x01 ; 1 1e1c6: 29 f0 breq .+10 ; 0x1e1d2 delay_keep_alive(100); 1e1c8: 84 e6 ldi r24, 0x64 ; 100 1e1ca: 90 e0 ldi r25, 0x00 ; 0 1e1cc: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 1e1d0: f5 cf rjmp .-22 ; 0x1e1bc counterBeep++; } st_synchronize(); 1e1d2: 0f 94 a0 22 call 0x24540 ; 0x24540 while (lcd_clicked()) delay_keep_alive(100); 1e1d6: 0e 94 19 6c call 0xd832 ; 0xd832 1e1da: 88 23 and r24, r24 1e1dc: 29 f0 breq .+10 ; 0x1e1e8 1e1de: 84 e6 ldi r24, 0x64 ; 100 1e1e0: 90 e0 ldi r25, 0x00 ; 0 1e1e2: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 1e1e6: f7 cf rjmp .-18 ; 0x1e1d6 lcd_update_enable(true); 1e1e8: 81 e0 ldi r24, 0x01 ; 1 1e1ea: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_setstatuspgm(MSG_WELCOME); 1e1ee: 8b e0 ldi r24, 0x0B ; 11 1e1f0: 9c e6 ldi r25, 0x6C ; 108 1e1f2: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = CustomMsg::Status; 1e1f6: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 clearFilamentAction(); 1e1fa: 0f 94 63 0c call 0x218c6 ; 0x218c6 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e1fe: 84 e8 ldi r24, 0x84 ; 132 1e200: 96 e1 ldi r25, 0x16 ; 22 } 1e202: cf 91 pop r28 1e204: ff 90 pop r15 1e206: ef 90 pop r14 1e208: df 90 pop r13 1e20a: cf 90 pop r12 1e20c: 0c 94 71 6e jmp 0xdce2 ; 0xdce2 0001e210 : 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() 1e210: 2f 92 push r2 1e212: 3f 92 push r3 1e214: 4f 92 push r4 1e216: 5f 92 push r5 1e218: 6f 92 push r6 1e21a: 7f 92 push r7 1e21c: 8f 92 push r8 1e21e: 9f 92 push r9 1e220: af 92 push r10 1e222: bf 92 push r11 1e224: cf 92 push r12 1e226: df 92 push r13 1e228: ef 92 push r14 1e22a: ff 92 push r15 1e22c: 0f 93 push r16 1e22e: 1f 93 push r17 1e230: cf 93 push r28 1e232: df 93 push r29 1e234: 00 d0 rcall .+0 ; 0x1e236 1e236: 00 d0 rcall .+0 ; 0x1e238 1e238: 00 d0 rcall .+0 ; 0x1e23a 1e23a: cd b7 in r28, 0x3d ; 61 1e23c: de b7 in r29, 0x3e ; 62 1e23e: 0c e9 ldi r16, 0x9C ; 156 1e240: 12 e1 ldi r17, 0x12 ; 18 1e242: 1f 83 std Y+7, r17 ; 0x07 1e244: 0e 83 std Y+6, r16 ; 0x06 1e246: 2e 80 ldd r2, Y+6 ; 0x06 1e248: 3f 80 ldd r3, Y+7 ; 0x07 1e24a: 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])) 1e24c: f1 01 movw r30, r2 1e24e: 61 81 ldd r22, Z+1 ; 0x01 1e250: 72 81 ldd r23, Z+2 ; 0x02 1e252: 83 81 ldd r24, Z+3 ; 0x03 1e254: 94 81 ldd r25, Z+4 ; 0x04 1e256: 9b 01 movw r18, r22 1e258: ac 01 movw r20, r24 1e25a: 0f 94 72 a6 call 0x34ce4 ; 0x34ce4 <__unordsf2> 1e25e: 88 23 and r24, r24 1e260: 09 f4 brne .+2 ; 0x1e264 1e262: 7c c0 rjmp .+248 ; 0x1e35c mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 1e264: 89 81 ldd r24, Y+1 ; 0x01 1e266: 0f 94 c5 8c call 0x3198a ; 0x3198a 1e26a: 20 e0 ldi r18, 0x00 ; 0 1e26c: 30 e0 ldi r19, 0x00 ; 0 1e26e: 48 eb ldi r20, 0xB8 ; 184 1e270: 51 e4 ldi r21, 0x41 ; 65 1e272: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1e276: 6b 01 movw r12, r22 1e278: 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)) + 1e27a: 20 e0 ldi r18, 0x00 ; 0 1e27c: 30 e0 ldi r19, 0x00 ; 0 1e27e: 4c ef ldi r20, 0xFC ; 252 1e280: 52 e4 ldi r21, 0x42 ; 66 1e282: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e286: 2b 01 movw r4, r22 1e288: 3c 01 movw r6, r24 1e28a: 20 e0 ldi r18, 0x00 ; 0 1e28c: 30 e0 ldi r19, 0x00 ; 0 1e28e: 44 e6 ldi r20, 0x64 ; 100 1e290: 53 e4 ldi r21, 0x43 ; 67 1e292: c7 01 movw r24, r14 1e294: b6 01 movw r22, r12 1e296: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e29a: 4b 01 movw r8, r22 1e29c: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e29e: 20 e0 ldi r18, 0x00 ; 0 1e2a0: 30 e0 ldi r19, 0x00 ; 0 1e2a2: 40 ec ldi r20, 0xC0 ; 192 1e2a4: 51 e4 ldi r21, 0x41 ; 65 1e2a6: c7 01 movw r24, r14 1e2a8: b6 01 movw r22, r12 1e2aa: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e2ae: 6b 01 movw r12, r22 1e2b0: 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)) + 1e2b2: ee 81 ldd r30, Y+6 ; 0x06 1e2b4: ff 81 ldd r31, Y+7 ; 0x07 1e2b6: 21 81 ldd r18, Z+1 ; 0x01 1e2b8: 32 81 ldd r19, Z+2 ; 0x02 1e2ba: 43 81 ldd r20, Z+3 ; 0x03 1e2bc: 54 81 ldd r21, Z+4 ; 0x04 1e2be: c3 01 movw r24, r6 1e2c0: b2 01 movw r22, r4 1e2c2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e2c6: a5 01 movw r20, r10 1e2c8: 94 01 movw r18, r8 1e2ca: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e2ce: 20 e0 ldi r18, 0x00 ; 0 1e2d0: 30 e9 ldi r19, 0x90 ; 144 1e2d2: 42 ea ldi r20, 0xA2 ; 162 1e2d4: 56 e4 ldi r21, 0x46 ; 70 1e2d6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e2da: 6a 83 std Y+2, r22 ; 0x02 1e2dc: 7b 83 std Y+3, r23 ; 0x03 1e2de: 8c 83 std Y+4, r24 ; 0x04 1e2e0: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e2e2: ee 81 ldd r30, Y+6 ; 0x06 1e2e4: ff 81 ldd r31, Y+7 ; 0x07 1e2e6: 25 85 ldd r18, Z+13 ; 0x0d 1e2e8: 36 85 ldd r19, Z+14 ; 0x0e 1e2ea: 47 85 ldd r20, Z+15 ; 0x0f 1e2ec: 50 89 ldd r21, Z+16 ; 0x10 1e2ee: c7 01 movw r24, r14 1e2f0: b6 01 movw r22, r12 1e2f2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e2f6: a5 01 movw r20, r10 1e2f8: 94 01 movw r18, r8 1e2fa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e2fe: 20 e0 ldi r18, 0x00 ; 0 1e300: 30 e9 ldi r19, 0x90 ; 144 1e302: 42 e2 ldi r20, 0x22 ; 34 1e304: 56 ec ldi r21, 0xC6 ; 198 1e306: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e30a: 9b 01 movw r18, r22 1e30c: 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)) + 1e30e: 6a 81 ldd r22, Y+2 ; 0x02 1e310: 7b 81 ldd r23, Y+3 ; 0x03 1e312: 8c 81 ldd r24, Y+4 ; 0x04 1e314: 9d 81 ldd r25, Y+5 ; 0x05 1e316: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1e31a: 4b 01 movw r8, r22 1e31c: 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)); 1e31e: ee 81 ldd r30, Y+6 ; 0x06 1e320: ff 81 ldd r31, Y+7 ; 0x07 1e322: 21 8d ldd r18, Z+25 ; 0x19 1e324: 32 8d ldd r19, Z+26 ; 0x1a 1e326: 43 8d ldd r20, Z+27 ; 0x1b 1e328: 54 8d ldd r21, Z+28 ; 0x1c 1e32a: c7 01 movw r24, r14 1e32c: b6 01 movw r22, r12 1e32e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e332: a3 01 movw r20, r6 1e334: 92 01 movw r18, r4 1e336: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e33a: 20 e0 ldi r18, 0x00 ; 0 1e33c: 30 e9 ldi r19, 0x90 ; 144 1e33e: 42 ea ldi r20, 0xA2 ; 162 1e340: 56 e4 ldi r21, 0x46 ; 70 1e342: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e346: 9b 01 movw r18, r22 1e348: 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)) + 1e34a: c5 01 movw r24, r10 1e34c: b4 01 movw r22, r8 1e34e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__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] = 1e352: f1 01 movw r30, r2 1e354: 61 83 std Z+1, r22 ; 0x01 1e356: 72 83 std Z+2, r23 ; 0x02 1e358: 83 83 std Z+3, r24 ; 0x03 1e35a: 94 83 std Z+4, r25 ; 0x04 1e35c: f4 e0 ldi r31, 0x04 ; 4 1e35e: 2f 0e add r2, r31 1e360: 31 1c adc r3, r1 1e362: 29 81 ldd r18, Y+1 ; 0x01 1e364: 2f 5f subi r18, 0xFF ; 255 1e366: 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) { 1e368: 27 30 cpi r18, 0x07 ; 7 1e36a: 09 f0 breq .+2 ; 0x1e36e 1e36c: 6f cf rjmp .-290 ; 0x1e24c 1e36e: 8e 81 ldd r24, Y+6 ; 0x06 1e370: 9f 81 ldd r25, Y+7 ; 0x07 1e372: 4c 96 adiw r24, 0x1c ; 28 1e374: 9f 83 std Y+7, r25 ; 0x07 1e376: 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) { 1e378: 80 56 subi r24, 0x60 ; 96 1e37a: 93 41 sbci r25, 0x13 ; 19 1e37c: 09 f0 breq .+2 ; 0x1e380 1e37e: 63 cf rjmp .-314 ; 0x1e246 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() 1e380: 19 87 std Y+9, r17 ; 0x09 1e382: 08 87 std Y+8, r16 ; 0x08 1e384: f1 e0 ldi r31, 0x01 ; 1 1e386: 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)) + 1e388: c8 01 movw r24, r16 1e38a: 8b 5a subi r24, 0xAB ; 171 1e38c: 9f 4f sbci r25, 0xFF ; 255 1e38e: 9f 83 std Y+7, r25 ; 0x07 1e390: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 1e392: 18 01 movw r2, r16 1e394: 99 ea ldi r25, 0xA9 ; 169 1e396: 29 0e add r2, r25 1e398: 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])) 1e39a: e8 85 ldd r30, Y+8 ; 0x08 1e39c: f9 85 ldd r31, Y+9 ; 0x09 1e39e: 65 8d ldd r22, Z+29 ; 0x1d 1e3a0: 76 8d ldd r23, Z+30 ; 0x1e 1e3a2: 87 8d ldd r24, Z+31 ; 0x1f 1e3a4: 90 a1 ldd r25, Z+32 ; 0x20 1e3a6: 9b 01 movw r18, r22 1e3a8: ac 01 movw r20, r24 1e3aa: 0f 94 72 a6 call 0x34ce4 ; 0x34ce4 <__unordsf2> 1e3ae: 88 23 and r24, r24 1e3b0: 09 f4 brne .+2 ; 0x1e3b4 1e3b2: 79 c0 rjmp .+242 ; 0x1e4a6 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 1e3b4: 89 81 ldd r24, Y+1 ; 0x01 1e3b6: 0f 94 c5 8c call 0x3198a ; 0x3198a 1e3ba: 20 e0 ldi r18, 0x00 ; 0 1e3bc: 30 e0 ldi r19, 0x00 ; 0 1e3be: 40 ea ldi r20, 0xA0 ; 160 1e3c0: 50 e4 ldi r21, 0x40 ; 64 1e3c2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1e3c6: 6b 01 movw r12, r22 1e3c8: 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)) + 1e3ca: 20 e0 ldi r18, 0x00 ; 0 1e3cc: 30 e0 ldi r19, 0x00 ; 0 1e3ce: 48 ed ldi r20, 0xD8 ; 216 1e3d0: 52 e4 ldi r21, 0x42 ; 66 1e3d2: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e3d6: 2b 01 movw r4, r22 1e3d8: 3c 01 movw r6, r24 1e3da: 20 e0 ldi r18, 0x00 ; 0 1e3dc: 30 e0 ldi r19, 0x00 ; 0 1e3de: 42 e5 ldi r20, 0x52 ; 82 1e3e0: 53 e4 ldi r21, 0x43 ; 67 1e3e2: c7 01 movw r24, r14 1e3e4: b6 01 movw r22, r12 1e3e6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e3ea: 4b 01 movw r8, r22 1e3ec: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e3ee: 20 e0 ldi r18, 0x00 ; 0 1e3f0: 30 e0 ldi r19, 0x00 ; 0 1e3f2: 40 ec ldi r20, 0xC0 ; 192 1e3f4: 50 e4 ldi r21, 0x40 ; 64 1e3f6: c7 01 movw r24, r14 1e3f8: b6 01 movw r22, r12 1e3fa: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e3fe: 6b 01 movw r12, r22 1e400: 7c 01 movw r14, r24 1e402: ee 81 ldd r30, Y+6 ; 0x06 1e404: ff 81 ldd r31, Y+7 ; 0x07 1e406: 20 81 ld r18, Z 1e408: 31 81 ldd r19, Z+1 ; 0x01 1e40a: 42 81 ldd r20, Z+2 ; 0x02 1e40c: 53 81 ldd r21, Z+3 ; 0x03 1e40e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e412: a5 01 movw r20, r10 1e414: 94 01 movw r18, r8 1e416: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e41a: 20 e0 ldi r18, 0x00 ; 0 1e41c: 30 e9 ldi r19, 0x90 ; 144 1e41e: 42 e2 ldi r20, 0x22 ; 34 1e420: 56 ec ldi r21, 0xC6 ; 198 1e422: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e426: 6a 83 std Y+2, r22 ; 0x02 1e428: 7b 83 std Y+3, r23 ; 0x03 1e42a: 8c 83 std Y+4, r24 ; 0x04 1e42c: 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)) + 1e42e: f8 01 movw r30, r16 1e430: 21 81 ldd r18, Z+1 ; 0x01 1e432: 32 81 ldd r19, Z+2 ; 0x02 1e434: 43 81 ldd r20, Z+3 ; 0x03 1e436: 54 81 ldd r21, Z+4 ; 0x04 1e438: c3 01 movw r24, r6 1e43a: b2 01 movw r22, r4 1e43c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e440: a5 01 movw r20, r10 1e442: 94 01 movw r18, r8 1e444: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e448: 20 e0 ldi r18, 0x00 ; 0 1e44a: 30 e9 ldi r19, 0x90 ; 144 1e44c: 42 ea ldi r20, 0xA2 ; 162 1e44e: 56 e4 ldi r21, 0x46 ; 70 1e450: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e454: 9b 01 movw r18, r22 1e456: ac 01 movw r20, r24 1e458: 6a 81 ldd r22, Y+2 ; 0x02 1e45a: 7b 81 ldd r23, Y+3 ; 0x03 1e45c: 8c 81 ldd r24, Y+4 ; 0x04 1e45e: 9d 81 ldd r25, Y+5 ; 0x05 1e460: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1e464: 4b 01 movw r8, r22 1e466: 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)); 1e468: f1 01 movw r30, r2 1e46a: 20 81 ld r18, Z 1e46c: 31 81 ldd r19, Z+1 ; 0x01 1e46e: 42 81 ldd r20, Z+2 ; 0x02 1e470: 53 81 ldd r21, Z+3 ; 0x03 1e472: c7 01 movw r24, r14 1e474: b6 01 movw r22, r12 1e476: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e47a: a3 01 movw r20, r6 1e47c: 92 01 movw r18, r4 1e47e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e482: 20 e0 ldi r18, 0x00 ; 0 1e484: 30 e9 ldi r19, 0x90 ; 144 1e486: 42 ea ldi r20, 0xA2 ; 162 1e488: 56 e4 ldi r21, 0x46 ; 70 1e48a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e48e: 9b 01 movw r18, r22 1e490: 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)) + 1e492: c5 01 movw r24, r10 1e494: b4 01 movw r22, r8 1e496: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__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] = 1e49a: e8 85 ldd r30, Y+8 ; 0x08 1e49c: f9 85 ldd r31, Y+9 ; 0x09 1e49e: 65 8f std Z+29, r22 ; 0x1d 1e4a0: 76 8f std Z+30, r23 ; 0x1e 1e4a2: 87 8f std Z+31, r24 ; 0x1f 1e4a4: 90 a3 std Z+32, r25 ; 0x20 1e4a6: 88 85 ldd r24, Y+8 ; 0x08 1e4a8: 99 85 ldd r25, Y+9 ; 0x09 1e4aa: 4c 96 adiw r24, 0x1c ; 28 1e4ac: 99 87 std Y+9, r25 ; 0x09 1e4ae: 88 87 std Y+8, r24 ; 0x08 1e4b0: 99 81 ldd r25, Y+1 ; 0x01 1e4b2: 9f 5f subi r25, 0xFF ; 255 1e4b4: 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) { 1e4b6: 96 30 cpi r25, 0x06 ; 6 1e4b8: 09 f0 breq .+2 ; 0x1e4bc 1e4ba: 6f cf rjmp .-290 ; 0x1e39a 1e4bc: 0c 5f subi r16, 0xFC ; 252 1e4be: 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) { 1e4c0: e2 e1 ldi r30, 0x12 ; 18 1e4c2: 08 3b cpi r16, 0xB8 ; 184 1e4c4: 1e 07 cpc r17, r30 1e4c6: 09 f0 breq .+2 ; 0x1e4ca 1e4c8: 5b cf rjmp .-330 ; 0x1e380 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 1e4ca: 29 96 adiw r28, 0x09 ; 9 1e4cc: 0f b6 in r0, 0x3f ; 63 1e4ce: f8 94 cli 1e4d0: de bf out 0x3e, r29 ; 62 1e4d2: 0f be out 0x3f, r0 ; 63 1e4d4: cd bf out 0x3d, r28 ; 61 1e4d6: df 91 pop r29 1e4d8: cf 91 pop r28 1e4da: 1f 91 pop r17 1e4dc: 0f 91 pop r16 1e4de: ff 90 pop r15 1e4e0: ef 90 pop r14 1e4e2: df 90 pop r13 1e4e4: cf 90 pop r12 1e4e6: bf 90 pop r11 1e4e8: af 90 pop r10 1e4ea: 9f 90 pop r9 1e4ec: 8f 90 pop r8 1e4ee: 7f 90 pop r7 1e4f0: 6f 90 pop r6 1e4f2: 5f 90 pop r5 1e4f4: 4f 90 pop r4 1e4f6: 3f 90 pop r3 1e4f8: 2f 90 pop r2 1e4fa: 08 95 ret 0001e4fc : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1e4fc: 2f 92 push r2 1e4fe: 3f 92 push r3 1e500: 4f 92 push r4 1e502: 5f 92 push r5 1e504: 6f 92 push r6 1e506: 7f 92 push r7 1e508: 8f 92 push r8 1e50a: 9f 92 push r9 1e50c: af 92 push r10 1e50e: bf 92 push r11 1e510: cf 92 push r12 1e512: df 92 push r13 1e514: ef 92 push r14 1e516: ff 92 push r15 1e518: 0f 93 push r16 1e51a: 1f 93 push r17 1e51c: cf 93 push r28 1e51e: df 93 push r29 1e520: cd b7 in r28, 0x3d ; 61 1e522: de b7 in r29, 0x3e ; 62 1e524: 67 97 sbiw r28, 0x17 ; 23 1e526: 0f b6 in r0, 0x3f ; 63 1e528: f8 94 cli 1e52a: de bf out 0x3e, r29 ; 62 1e52c: 0f be out 0x3f, r0 ; 63 1e52e: cd bf out 0x3d, r28 ; 61 1e530: 08 2f mov r16, r24 1e532: ce 01 movw r24, r28 1e534: 46 96 adiw r24, 0x16 ; 22 1e536: 9f 8b std Y+23, r25 ; 0x17 1e538: 8e 8b std Y+22, r24 ; 0x16 1e53a: 83 e0 ldi r24, 0x03 ; 3 1e53c: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1e53e: 95 e1 ldi r25, 0x15 ; 21 1e540: 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 1e542: 0f 94 60 88 call 0x310c0 ; 0x310c0 tool_change_extruder = slot; 1e546: 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)); 1e54a: 40 2f mov r20, r16 1e54c: 64 e5 ldi r22, 0x54 ; 84 1e54e: ce 01 movw r24, r28 1e550: 01 96 adiw r24, 0x01 ; 1 1e552: 0f 94 53 88 call 0x310a6 ; 0x310a6 1e556: 49 81 ldd r20, Y+1 ; 0x01 1e558: 5a 81 ldd r21, Y+2 ; 0x02 1e55a: 6b 81 ldd r22, Y+3 ; 0x03 1e55c: 7c 81 ldd r23, Y+4 ; 0x04 1e55e: 8d 81 ldd r24, Y+5 ; 0x05 1e560: 0f 94 93 63 call 0x2c726 ; 0x2c726 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1e564: 61 e0 ldi r22, 0x01 ; 1 1e566: 81 e0 ldi r24, 0x01 ; 1 1e568: 0f 94 28 6b call 0x2d650 ; 0x2d650 1e56c: 18 2f mov r17, r24 1e56e: 81 11 cpse r24, r1 1e570: 07 c0 rjmp .+14 ; 0x1e580 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1e572: 0f 94 b7 87 call 0x30f6e ; 0x30f6e // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1e576: 0f 94 c6 6a call 0x2d58c ; 0x2d58c // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1e57a: 0f 94 b6 6b call 0x2d76c ; 0x2d76c 1e57e: e1 cf rjmp .-62 ; 0x1e542 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e580: 0f 94 a0 22 call 0x24540 ; 0x24540 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1e584: 0f 94 96 88 call 0x3112c ; 0x3112c 1e588: 81 30 cpi r24, 0x01 ; 1 1e58a: 79 f1 breq .+94 ; 0x1e5ea // 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(); 1e58c: 0f 94 b6 6b call 0x2d76c ; 0x2d76c if (retries == 2 && cutter_enabled()) { 1e590: 92 e0 ldi r25, 0x02 ; 2 1e592: f9 12 cpse r15, r25 1e594: 09 c0 rjmp .+18 ; 0x1e5a8 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; 1e596: 8e ec ldi r24, 0xCE ; 206 1e598: 9e e0 ldi r25, 0x0E ; 14 1e59a: 0f 94 3c a1 call 0x34278 ; 0x34278 1e59e: 81 30 cpi r24, 0x01 ; 1 1e5a0: 19 f4 brne .+6 ; 0x1e5a8 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1e5a2: 80 2f mov r24, r16 1e5a4: 0f 94 a1 6c call 0x2d942 ; 0x2d942 1e5a8: 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) { 1e5aa: f1 10 cpse r15, r1 1e5ac: ca cf rjmp .-108 ; 0x1e542 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()) { 1e5ae: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e5b2: 88 23 and r24, r24 1e5b4: 09 f4 brne .+2 ; 0x1e5b8 1e5b6: ef c0 rjmp .+478 ; 0x1e796 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1e5b8: 67 96 adiw r28, 0x17 ; 23 1e5ba: 0f b6 in r0, 0x3f ; 63 1e5bc: f8 94 cli 1e5be: de bf out 0x3e, r29 ; 62 1e5c0: 0f be out 0x3f, r0 ; 63 1e5c2: cd bf out 0x3d, r28 ; 61 1e5c4: df 91 pop r29 1e5c6: cf 91 pop r28 1e5c8: 1f 91 pop r17 1e5ca: 0f 91 pop r16 1e5cc: ff 90 pop r15 1e5ce: ef 90 pop r14 1e5d0: df 90 pop r13 1e5d2: cf 90 pop r12 1e5d4: bf 90 pop r11 1e5d6: af 90 pop r10 1e5d8: 9f 90 pop r9 1e5da: 8f 90 pop r8 1e5dc: 7f 90 pop r7 1e5de: 6f 90 pop r6 1e5e0: 5f 90 pop r5 1e5e2: 4f 90 pop r4 1e5e4: 3f 90 pop r3 1e5e6: 2f 90 pop r2 1e5e8: 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(); 1e5ea: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1e5ee: 70 e0 ldi r23, 0x00 ; 0 1e5f0: 90 e0 ldi r25, 0x00 ; 0 1e5f2: 80 e0 ldi r24, 0x00 ; 0 1e5f4: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1e5f8: 9b 01 movw r18, r22 1e5fa: ac 01 movw r20, r24 1e5fc: 60 e0 ldi r22, 0x00 ; 0 1e5fe: 70 e0 ldi r23, 0x00 ; 0 1e600: 8c e5 ldi r24, 0x5C ; 92 1e602: 92 e4 ldi r25, 0x42 ; 66 1e604: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e608: 36 2e mov r3, r22 1e60a: 87 2e mov r8, r23 1e60c: 98 2e mov r9, r24 1e60e: 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)) 1e610: 26 2f mov r18, r22 1e612: 37 2f mov r19, r23 1e614: 48 2f mov r20, r24 1e616: 59 2f mov r21, r25 1e618: 60 e0 ldi r22, 0x00 ; 0 1e61a: 70 e0 ldi r23, 0x00 ; 0 1e61c: 80 e2 ldi r24, 0x20 ; 32 1e61e: 91 e4 ldi r25, 0x41 ; 65 1e620: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 1e624: 2b 01 movw r4, r22 1e626: 3c 01 movw r6, r24 1e628: e9 e0 ldi r30, 0x09 ; 9 1e62a: f5 e0 ldi r31, 0x05 ; 5 1e62c: 82 2d mov r24, r2 1e62e: 11 92 st Z+, r1 1e630: 8a 95 dec r24 1e632: e9 f7 brne .-6 ; 0x1e62e lcd_status_message_idx = 0; 1e634: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 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); 1e638: 83 2d mov r24, r3 1e63a: 98 2d mov r25, r8 1e63c: a9 2d mov r26, r9 1e63e: be 2d mov r27, r14 1e640: bc 01 movw r22, r24 1e642: 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++) { 1e644: 91 2c mov r9, r1 1e646: 31 2c mov r3, r1 1e648: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e64a: 5b 01 movw r10, r22 1e64c: 6c 01 movw r12, r24 1e64e: d7 fa bst r13, 7 1e650: d0 94 com r13 1e652: d7 f8 bld r13, 7 1e654: d0 94 com r13 1e656: 20 e0 ldi r18, 0x00 ; 0 1e658: 30 e0 ldi r19, 0x00 ; 0 1e65a: 48 e4 ldi r20, 0x48 ; 72 1e65c: 52 e4 ldi r21, 0x42 ; 66 1e65e: 0f 94 62 88 call 0x310c4 ; 0x310c4 1e662: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1e666: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (planner_any_moves()) { 1e66a: 98 17 cp r25, r24 1e66c: 09 f4 brne .+2 ; 0x1e670 1e66e: 49 c0 rjmp .+146 ; 0x1e702 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1e670: 11 23 and r17, r17 1e672: 31 f0 breq .+12 ; 0x1e680 1e674: 0f 94 96 88 call 0x3112c ; 0x3112c 1e678: 11 e0 ldi r17, 0x01 ; 1 1e67a: 81 30 cpi r24, 0x01 ; 1 1e67c: 09 f0 breq .+2 ; 0x1e680 1e67e: 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); 1e680: 83 e0 ldi r24, 0x03 ; 3 1e682: 0f 94 8c 22 call 0x24518 ; 0x24518 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); 1e686: 20 91 01 12 lds r18, 0x1201 ; 0x801201 1e68a: 30 91 02 12 lds r19, 0x1202 ; 0x801202 1e68e: 40 91 03 12 lds r20, 0x1203 ; 0x801203 1e692: 50 91 04 12 lds r21, 0x1204 ; 0x801204 1e696: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1e69a: a3 01 movw r20, r6 1e69c: 92 01 movw r18, r4 1e69e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1e6a2: 0f 94 42 a3 call 0x34684 ; 0x34684 1e6a6: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 1e6aa: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1e6ac: e6 16 cp r14, r22 1e6ae: c1 f0 breq .+48 ; 0x1e6e0 1e6b0: e3 2d mov r30, r3 1e6b2: e4 31 cpi r30, 0x14 ; 20 1e6b4: 08 f0 brcs .+2 ; 0x1e6b8 1e6b6: 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); 1e6b8: 33 24 eor r3, r3 1e6ba: 33 94 inc r3 1e6bc: 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] : '-'); 1e6be: 8f ef ldi r24, 0xFF ; 255 1e6c0: 11 11 cpse r17, r1 1e6c2: 01 c0 rjmp .+2 ; 0x1e6c6 1e6c4: 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; 1e6c6: f0 e0 ldi r31, 0x00 ; 0 1e6c8: e7 5f subi r30, 0xF7 ; 247 1e6ca: fa 4f sbci r31, 0xFA ; 250 1e6cc: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1e6ce: 91 e0 ldi r25, 0x01 ; 1 1e6d0: 90 93 5b 02 sts 0x025B, r25 ; 0x80025b if (!lcd_update_enabled) lcdui_print_status_line(); 1e6d4: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 1e6d8: 81 11 cpse r24, r1 1e6da: 02 c0 rjmp .+4 ; 0x1e6e0 1e6dc: 0f 94 7f 10 call 0x220fe ; 0x220fe void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1e6e0: 90 e0 ldi r25, 0x00 ; 0 1e6e2: 80 e0 ldi r24, 0x00 ; 0 1e6e4: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 } 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); 1e6e8: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1e6ea: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e6ee: 88 23 and r24, r24 1e6f0: 09 f4 brne .+2 ; 0x1e6f4 1e6f2: b7 cf rjmp .-146 ; 0x1e662 return false; // power panic or a similar issue happened, bail out fast 1e6f4: 10 e0 ldi r17, 0x00 ; 0 1e6f6: 37 c0 rjmp .+110 ; 0x1e766 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); 1e6f8: c6 01 movw r24, r12 1e6fa: b5 01 movw r22, r10 1e6fc: 99 24 eor r9, r9 1e6fe: 93 94 inc r9 1e700: aa cf rjmp .-172 ; 0x1e656 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++) { 1e702: 91 e0 ldi r25, 0x01 ; 1 1e704: 99 12 cpse r9, r25 1e706: f8 cf rjmp .-16 ; 0x1e6f8 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1e708: 0f 94 60 88 call 0x310c0 ; 0x310c0 if (!filament_inserted) { 1e70c: 11 11 cpse r17, r1 1e70e: 08 c0 rjmp .+16 ; 0x1e720 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1e710: 8f ec ldi r24, 0xCF ; 207 1e712: 9e e0 ldi r25, 0x0E ; 14 1e714: 0e 94 8d 6f call 0xdf1a ; 0xdf1a eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1e718: 80 ed ldi r24, 0xD0 ; 208 1e71a: 9e e0 ldi r25, 0x0E ; 14 1e71c: 0e 94 80 6f call 0xdf00 ; 0xdf00 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); 1e720: 44 e1 ldi r20, 0x14 ; 20 1e722: 50 e0 ldi r21, 0x00 ; 0 1e724: 69 e0 ldi r22, 0x09 ; 9 1e726: 75 e0 ldi r23, 0x05 ; 5 1e728: ce 01 movw r24, r28 1e72a: 01 96 adiw r24, 0x01 ; 1 1e72c: 0f 94 bc a7 call 0x34f78 ; 0x34f78 1e730: fe 01 movw r30, r28 1e732: 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'; 1e734: 81 91 ld r24, Z+ 1e736: 87 fd sbrc r24, 7 1e738: 2c c0 rjmp .+88 ; 0x1e792 1e73a: 80 e3 ldi r24, 0x30 ; 48 1e73c: df 01 movw r26, r30 1e73e: 11 97 sbiw r26, 0x01 ; 1 1e740: 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++) { 1e742: 8e 89 ldd r24, Y+22 ; 0x16 1e744: 9f 89 ldd r25, Y+23 ; 0x17 1e746: 8e 17 cp r24, r30 1e748: 9f 07 cpc r25, r31 1e74a: a1 f7 brne .-24 ; 0x1e734 // 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; 1e74c: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1e74e: 87 e7 ldi r24, 0x77 ; 119 1e750: 9e e9 ldi r25, 0x9E ; 158 1e752: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 1e756: 8d eb ldi r24, 0xBD ; 189 1e758: 97 e8 ldi r25, 0x87 ; 135 1e75a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 1e75e: ce 01 movw r24, r28 1e760: 01 96 adiw r24, 0x01 ; 1 1e762: 0f 94 5d 9a call 0x334ba ; 0x334ba SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1e766: 8e e1 ldi r24, 0x1E ; 30 1e768: 95 e0 ldi r25, 0x05 ; 5 1e76a: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::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()) { 1e76e: 11 23 and r17, r17 1e770: 09 f4 brne .+2 ; 0x1e774 1e772: 0c cf rjmp .-488 ; 0x1e58c // 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 1e774: 80 2f mov r24, r16 1e776: 0f 94 08 42 call 0x28410 ; 0x28410 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1e77a: 00 93 23 12 sts 0x1223, r16 ; 0x801223 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1e77e: 80 91 98 12 lds r24, 0x1298 ; 0x801298 1e782: 90 91 99 12 lds r25, 0x1299 ; 0x801299 1e786: 01 96 adiw r24, 0x01 ; 1 1e788: 90 93 99 12 sts 0x1299, r25 ; 0x801299 1e78c: 80 93 98 12 sts 0x1298, r24 ; 0x801298 1e790: 13 cf rjmp .-474 ; 0x1e5b8 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'; 1e792: 81 e3 ldi r24, 0x31 ; 49 1e794: d3 cf rjmp .-90 ; 0x1e73c void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1e796: 8a e2 ldi r24, 0x2A ; 42 1e798: 90 e8 ldi r25, 0x80 ; 128 1e79a: 90 93 26 12 sts 0x1226, r25 ; 0x801226 1e79e: 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 1e7a2: 61 e0 ldi r22, 0x01 ; 1 1e7a4: 81 e0 ldi r24, 0x01 ; 1 1e7a6: 0f 94 28 6b call 0x2d650 ; 0x2d650 1e7aa: c7 ce rjmp .-626 ; 0x1e53a 0001e7ac : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1e7ac: cf 93 push r28 1e7ae: df 93 push r29 1e7b0: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1e7b2: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 1e7b6: c8 2f mov r28, r24 1e7b8: 88 23 and r24, r24 1e7ba: d9 f0 breq .+54 ; 0x1e7f2 return false; } if (slot != extruder) { 1e7bc: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1e7c0: 8d 17 cp r24, r29 1e7c2: b9 f0 breq .+46 ; 0x1e7f2 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(); 1e7c4: 0e 94 9a 61 call 0xc334 ; 0xc334 if (/*FindaDetectsFilament()*/ 1e7c8: 81 11 cpse r24, r1 1e7ca: 02 c0 rjmp .+4 ; 0x1e7d0 /*!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(); 1e7cc: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1e7d0: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e7d4: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e7d8: 10 92 85 16 sts 0x1685, r1 ; 0x801685 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e7dc: 0f 94 a0 22 call 0x24540 ; 0x24540 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 1e7e0: 8d 2f mov r24, r29 1e7e2: 0e 94 7e f2 call 0x1e4fc ; 0x1e4fc #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e7e6: 84 e8 ldi r24, 0x84 ; 132 1e7e8: 96 e1 ldi r25, 0x16 ; 22 1e7ea: 0e 94 71 6e call 0xdce2 ; 0xdce2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1e7ee: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1e7f2: 8c 2f mov r24, r28 1e7f4: df 91 pop r29 1e7f6: cf 91 pop r28 1e7f8: 08 95 ret 0001e7fa : { (void)lcd_selftest(); } bool lcd_selftest() { 1e7fa: cf 92 push r12 1e7fc: df 92 push r13 1e7fe: ef 92 push r14 1e800: ff 92 push r15 1e802: 0f 93 push r16 1e804: 1f 93 push r17 1e806: cf 93 push r28 1e808: df 93 push r29 1e80a: 00 d0 rcall .+0 ; 0x1e80c 1e80c: 1f 92 push r1 1e80e: cd b7 in r28, 0x3d ; 61 1e810: 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(); 1e812: 0f 94 b9 12 call 0x22572 ; 0x22572 uint8_t fanSpeedBckp = fanSpeed; 1e816: d0 90 e9 11 lds r13, 0x11E9 ; 0x8011e9 fanSpeed = 255; 1e81a: 8f ef ldi r24, 0xFF ; 255 1e81c: 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)); 1e820: 8e ec ldi r24, 0xCE ; 206 1e822: e8 2e mov r14, r24 1e824: 83 e8 ldi r24, 0x83 ; 131 1e826: 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()); 1e828: 08 ec ldi r16, 0xC8 ; 200 1e82a: 13 e8 ldi r17, 0x83 ; 131 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)) { 1e82c: 20 e0 ldi r18, 0x00 ; 0 1e82e: 30 e0 ldi r19, 0x00 ; 0 1e830: 48 e4 ldi r20, 0x48 ; 72 1e832: 52 e4 ldi r21, 0x42 ; 66 1e834: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e838: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e83c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e840: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e844: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1e848: 18 16 cp r1, r24 1e84a: 8c f0 brlt .+34 ; 0x1e86e 1e84c: 20 e0 ldi r18, 0x00 ; 0 1e84e: 30 e0 ldi r19, 0x00 ; 0 1e850: 48 e4 ldi r20, 0x48 ; 72 1e852: 52 e4 ldi r21, 0x42 ; 66 1e854: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e858: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e85c: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e860: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e864: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1e868: 18 16 cp r1, r24 1e86a: 0c f0 brlt .+2 ; 0x1e86e 1e86c: 42 c0 rjmp .+132 ; 0x1e8f2 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1e86e: 81 e6 ldi r24, 0x61 ; 97 1e870: 9e e3 ldi r25, 0x3E ; 62 1e872: 0e 94 32 6d call 0xda64 ; 0xda64 1e876: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1e87a: 42 e8 ldi r20, 0x82 ; 130 1e87c: 64 e0 ldi r22, 0x04 ; 4 1e87e: 80 e0 ldi r24, 0x00 ; 0 1e880: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1e884: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e888: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e88c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e890: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e894: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1e898: 7f 93 push r23 1e89a: 6f 93 push r22 1e89c: ff 92 push r15 1e89e: ef 92 push r14 1e8a0: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_putc(LCD_STR_DEGREE[0]); 1e8a4: 81 e8 ldi r24, 0x81 ; 129 1e8a6: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1e8aa: 40 e8 ldi r20, 0x80 ; 128 1e8ac: 64 e0 ldi r22, 0x04 ; 4 1e8ae: 89 e0 ldi r24, 0x09 ; 9 1e8b0: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1e8b4: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e8b8: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e8bc: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e8c0: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e8c4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1e8c8: 7f 93 push r23 1e8ca: 6f 93 push r22 1e8cc: 1f 93 push r17 1e8ce: 0f 93 push r16 1e8d0: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_putc(LCD_STR_DEGREE[0]); 1e8d4: 81 e8 ldi r24, 0x81 ; 129 1e8d6: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 delay_keep_alive(1000); 1e8da: 88 ee ldi r24, 0xE8 ; 232 1e8dc: 93 e0 ldi r25, 0x03 ; 3 1e8de: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 serialecho_temperatures(); 1e8e2: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 1e8e6: 0f b6 in r0, 0x3f ; 63 1e8e8: f8 94 cli 1e8ea: de bf out 0x3e, r29 ; 62 1e8ec: 0f be out 0x3f, r0 ; 63 1e8ee: cd bf out 0x3d, r28 ; 61 1e8f0: 9d cf rjmp .-198 ; 0x1e82c } fanSpeed = fanSpeedBckp; 1e8f2: d0 92 e9 11 sts 0x11E9, r13 ; 0x8011e9 lcd_update_enable(true); 1e8f6: 81 e0 ldi r24, 0x01 ; 1 1e8f8: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1e8fc: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1e900: 87 ea ldi r24, 0xA7 ; 167 1e902: 9e e3 ldi r25, 0x3E ; 62 1e904: 0e 94 32 6d call 0xda64 ; 0xda64 1e908: ac 01 movw r20, r24 1e90a: 60 e0 ldi r22, 0x00 ; 0 1e90c: 80 e0 ldi r24, 0x00 ; 0 1e90e: 0e 94 10 6a call 0xd420 ; 0xd420 #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1e912: 60 ed ldi r22, 0xD0 ; 208 1e914: 77 e0 ldi r23, 0x07 ; 7 1e916: 80 e0 ldi r24, 0x00 ; 0 1e918: 90 e0 ldi r25, 0x00 ; 0 1e91a: 0f 94 d5 0d call 0x21baa ; 0x21baa KEEPALIVE_STATE(IN_HANDLER); 1e91e: 82 e0 ldi r24, 0x02 ; 2 1e920: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1e924: 00 ed ldi r16, 0xD0 ; 208 1e926: 17 e0 ldi r17, 0x07 ; 7 1e928: 21 e0 ldi r18, 0x01 ; 1 1e92a: 43 e0 ldi r20, 0x03 ; 3 1e92c: 60 e0 ldi r22, 0x00 ; 0 1e92e: 80 e0 ldi r24, 0x00 ; 0 1e930: 0e 94 30 b9 call 0x17260 ; 0x17260 1e934: 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 1e936: 83 e0 ldi r24, 0x03 ; 3 1e938: 0e 94 c0 6e call 0xdd80 ; 0xdd80 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1e93c: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1e940: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1e944: 0f 94 af 32 call 0x2655e ; 0x2655e // 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]); 1e948: 4d e2 ldi r20, 0x2D ; 45 1e94a: 62 e0 ldi r22, 0x02 ; 2 1e94c: 82 e1 ldi r24, 0x12 ; 18 1e94e: 0e 94 1c 6a call 0xd438 ; 0xd438 delay_keep_alive(1000 / sizeof(symbols)); 1e952: 84 ef ldi r24, 0xF4 ; 244 1e954: 91 e0 ldi r25, 0x01 ; 1 1e956: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 // 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]); 1e95a: 4c e7 ldi r20, 0x7C ; 124 1e95c: 62 e0 ldi r22, 0x02 ; 2 1e95e: 82 e1 ldi r24, 0x12 ; 18 1e960: 0e 94 1c 6a call 0xd438 ; 0xd438 delay_keep_alive(1000 / sizeof(symbols)); 1e964: 84 ef ldi r24, 0xF4 ; 244 1e966: 91 e0 ldi r25, 0x01 ; 1 1e968: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 // 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]); 1e96c: 4d e2 ldi r20, 0x2D ; 45 1e96e: 62 e0 ldi r22, 0x02 ; 2 1e970: 82 e1 ldi r24, 0x12 ; 18 1e972: 0e 94 1c 6a call 0xd438 ; 0xd438 delay_keep_alive(1000 / sizeof(symbols)); 1e976: 84 ef ldi r24, 0xF4 ; 244 1e978: 91 e0 ldi r25, 0x01 ; 1 1e97a: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 // 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]); 1e97e: 4c e7 ldi r20, 0x7C ; 124 1e980: 62 e0 ldi r22, 0x02 ; 2 1e982: 82 e1 ldi r24, 0x12 ; 18 1e984: 0e 94 1c 6a call 0xd438 ; 0xd438 delay_keep_alive(1000 / sizeof(symbols)); 1e988: 84 ef ldi r24, 0xF4 ; 244 1e98a: 91 e0 ldi r25, 0x01 ; 1 1e98c: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1e990: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 1e994: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1e998: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1e99c: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1e9a0: 90 93 90 16 sts 0x1690, r25 ; 0x801690 #endif fan_measuring = true; 1e9a4: 81 e0 ldi r24, 0x01 ; 1 1e9a6: 80 93 84 03 sts 0x0384, r24 ; 0x800384 while(fan_measuring) { 1e9aa: 80 91 84 03 lds r24, 0x0384 ; 0x800384 1e9ae: 88 23 and r24, r24 1e9b0: 29 f0 breq .+10 ; 0x1e9bc delay_keep_alive(100); 1e9b2: 84 e6 ldi r24, 0x64 ; 100 1e9b4: 90 e0 ldi r25, 0x00 ; 0 1e9b6: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 1e9ba: f7 cf rjmp .-18 ; 0x1e9aa } gcode_M123(); 1e9bc: 0e 94 1e 60 call 0xc03c ; 0xc03c 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 1e9c0: 80 e0 ldi r24, 0x00 ; 0 1e9c2: 0e 94 c0 6e call 0xdd80 ; 0xdd80 if (fan_speed[0] < failThr) { 1e9c6: c0 90 85 03 lds r12, 0x0385 ; 0x800385 1e9ca: d0 90 86 03 lds r13, 0x0386 ; 0x800386 1e9ce: 94 e1 ldi r25, 0x14 ; 20 1e9d0: c9 16 cp r12, r25 1e9d2: d1 04 cpc r13, r1 1e9d4: 54 f1 brlt .+84 ; 0x1ea2a lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1e9d6: 00 ed ldi r16, 0xD0 ; 208 1e9d8: 17 e0 ldi r17, 0x07 ; 7 1e9da: 21 e0 ldi r18, 0x01 ; 1 1e9dc: 43 e0 ldi r20, 0x03 ; 3 1e9de: 6f 2d mov r22, r15 1e9e0: 81 e0 ldi r24, 0x01 ; 1 1e9e2: 0e 94 30 b9 call 0x17260 ; 0x17260 1e9e6: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1e9e8: 60 e0 ldi r22, 0x00 ; 0 1e9ea: 80 e0 ldi r24, 0x00 ; 0 1e9ec: 0e 94 9d b1 call 0x1633a ; 0x1633a #endif //defined(TACH_1) if (!_result) 1e9f0: 81 11 cpse r24, r1 1e9f2: 3a c0 rjmp .+116 ; 0x1ea68 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1e9f4: 4a ed ldi r20, 0xDA ; 218 1e9f6: 52 e0 ldi r21, 0x02 ; 2 1e9f8: ba 01 movw r22, r20 1e9fa: 85 e0 ldi r24, 0x05 ; 5 1e9fc: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc } } if (_swapped_fan) { 1ea00: 86 e4 ldi r24, 0x46 ; 70 1ea02: c8 16 cp r12, r24 1ea04: d1 04 cpc r13, r1 1ea06: bc f0 brlt .+46 ; 0x1ea36 //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1ea08: 60 e0 ldi r22, 0x00 ; 0 1ea0a: 81 e0 ldi r24, 0x01 ; 1 1ea0c: 0e 94 9d b1 call 0x1633a ; 0x1633a if (_result) { 1ea10: 88 23 and r24, r24 1ea12: d9 f0 breq .+54 ; 0x1ea4a //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1ea14: 61 e0 ldi r22, 0x01 ; 1 1ea16: 80 e0 ldi r24, 0x00 ; 0 1ea18: 0e 94 9d b1 call 0x1633a ; 0x1633a if (!_result){ 1ea1c: 81 11 cpse r24, r1 1ea1e: 28 c0 rjmp .+80 ; 0x1ea70 lcd_selftest_error(TestError::PrintFan, "", ""); 1ea20: 4a ed ldi r20, 0xDA ; 218 1ea22: 52 e0 ldi r21, 0x02 ; 2 1ea24: ba 01 movw r22, r20 1ea26: 85 e0 ldi r24, 0x05 ; 5 1ea28: 04 c0 rjmp .+8 ; 0x1ea32 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ea2a: 4a ed ldi r20, 0xDA ; 218 1ea2c: 52 e0 ldi r21, 0x02 ; 2 1ea2e: ba 01 movw r22, r20 1ea30: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ea32: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ea36: 08 e8 ldi r16, 0x88 ; 136 1ea38: 13 e1 ldi r17, 0x13 ; 19 1ea3a: 21 e0 ldi r18, 0x01 ; 1 1ea3c: 43 e0 ldi r20, 0x03 ; 3 1ea3e: 6f 2d mov r22, r15 1ea40: 8d e0 ldi r24, 0x0D ; 13 1ea42: 0e 94 30 b9 call 0x17260 ; 0x17260 1ea46: e1 2c mov r14, r1 1ea48: 88 c1 rjmp .+784 ; 0x1ed5a lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ea4a: 4a ed ldi r20, 0xDA ; 218 1ea4c: 52 e0 ldi r21, 0x02 ; 2 1ea4e: ba 01 movw r22, r20 1ea50: 89 e0 ldi r24, 0x09 ; 9 1ea52: ef cf rjmp .-34 ; 0x1ea32 #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1ea54: 11 e0 ldi r17, 0x01 ; 1 1ea56: 96 c0 rjmp .+300 ; 0x1eb84 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1ea58: 89 ec ldi r24, 0xC9 ; 201 1ea5a: 9f e3 ldi r25, 0x3F ; 63 1ea5c: 0e 94 32 6d call 0xda64 ; 0xda64 1ea60: 62 e0 ldi r22, 0x02 ; 2 1ea62: 0e 94 2f e2 call 0x1c45e ; 0x1c45e 1ea66: 91 c1 rjmp .+802 ; 0x1ed8a { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ea68: 96 e4 ldi r25, 0x46 ; 70 1ea6a: c9 16 cp r12, r25 1ea6c: d1 04 cpc r13, r1 1ea6e: 64 f6 brge .-104 ; 0x1ea08 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ea70: 00 ed ldi r16, 0xD0 ; 208 1ea72: 17 e0 ldi r17, 0x07 ; 7 1ea74: 21 e0 ldi r18, 0x01 ; 1 1ea76: 43 e0 ldi r20, 0x03 ; 3 1ea78: 6f 2d mov r22, r15 1ea7a: 82 e0 ldi r24, 0x02 ; 2 1ea7c: 0e 94 30 b9 call 0x17260 ; 0x17260 1ea80: 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) || 1ea82: 1e 99 sbic 0x03, 6 ; 3 1ea84: 04 c0 rjmp .+8 ; 0x1ea8e { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1ea86: 1d 99 sbic 0x03, 5 ; 3 1ea88: 02 c0 rjmp .+4 ; 0x1ea8e ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1ea8a: 1c 9b sbis 0x03, 4 ; 3 1ea8c: 48 c0 rjmp .+144 ; 0x1eb1e #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; 1ea8e: 1e 9b sbis 0x03, 6 ; 3 1ea90: 16 c0 rjmp .+44 ; 0x1eabe 1ea92: 20 e0 ldi r18, 0x00 ; 0 1ea94: 30 e0 ldi r19, 0x00 ; 0 1ea96: 40 e2 ldi r20, 0x20 ; 32 1ea98: 51 e4 ldi r21, 0x41 ; 65 1ea9a: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 1ea9e: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 1eaa2: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 1eaa6: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 1eaaa: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1eaae: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1eab2: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 1eab6: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1eaba: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1eabe: 1d 9b sbis 0x03, 5 ; 3 1eac0: 16 c0 rjmp .+44 ; 0x1eaee 1eac2: 20 e0 ldi r18, 0x00 ; 0 1eac4: 30 e0 ldi r19, 0x00 ; 0 1eac6: 40 e2 ldi r20, 0x20 ; 32 1eac8: 51 e4 ldi r21, 0x41 ; 65 1eaca: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 1eace: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 1ead2: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 1ead6: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 1eada: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1eade: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 1eae2: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 1eae6: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 1eaea: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1eaee: 1c 9b sbis 0x03, 4 ; 3 1eaf0: 16 c0 rjmp .+44 ; 0x1eb1e 1eaf2: 20 e0 ldi r18, 0x00 ; 0 1eaf4: 30 e0 ldi r19, 0x00 ; 0 1eaf6: 40 e2 ldi r20, 0x20 ; 32 1eaf8: 51 e4 ldi r21, 0x41 ; 65 1eafa: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1eafe: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1eb02: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1eb06: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1eb0a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1eb0e: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1eb12: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1eb16: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1eb1a: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1eb1e: 60 e0 ldi r22, 0x00 ; 0 1eb20: 70 e0 ldi r23, 0x00 ; 0 1eb22: 84 e3 ldi r24, 0x34 ; 52 1eb24: 92 e4 ldi r25, 0x42 ; 66 1eb26: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 1eb2a: 0f 94 a0 22 call 0x24540 ; 0x24540 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb2e: 1e 99 sbic 0x03, 6 ; 3 1eb30: 04 c0 rjmp .+8 ; 0x1eb3a plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1eb32: 1d 99 sbic 0x03, 5 ; 3 1eb34: 02 c0 rjmp .+4 ; 0x1eb3a ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb36: 1c 9b sbis 0x03, 4 ; 3 1eb38: 8d cf rjmp .-230 ; 0x1ea54 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1eb3a: 1a 82 std Y+2, r1 ; 0x02 1eb3c: 19 82 std Y+1, r1 ; 0x01 1eb3e: 1c 82 std Y+4, r1 ; 0x04 1eb40: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1eb42: 1e 9b sbis 0x03, 6 ; 3 1eb44: 06 c0 rjmp .+12 ; 0x1eb52 1eb46: 6b ed ldi r22, 0xDB ; 219 1eb48: 72 e0 ldi r23, 0x02 ; 2 1eb4a: ce 01 movw r24, r28 1eb4c: 01 96 adiw r24, 0x01 ; 1 1eb4e: 0f 94 88 a7 call 0x34f10 ; 0x34f10 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1eb52: 1d 9b sbis 0x03, 5 ; 3 1eb54: 06 c0 rjmp .+12 ; 0x1eb62 1eb56: 6d ed ldi r22, 0xDD ; 221 1eb58: 72 e0 ldi r23, 0x02 ; 2 1eb5a: ce 01 movw r24, r28 1eb5c: 01 96 adiw r24, 0x01 ; 1 1eb5e: 0f 94 88 a7 call 0x34f10 ; 0x34f10 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1eb62: 1c 9b sbis 0x03, 4 ; 3 1eb64: 06 c0 rjmp .+12 ; 0x1eb72 1eb66: 6f ed ldi r22, 0xDF ; 223 1eb68: 72 e0 ldi r23, 0x02 ; 2 1eb6a: ce 01 movw r24, r28 1eb6c: 01 96 adiw r24, 0x01 ; 1 1eb6e: 0f 94 88 a7 call 0x34f10 ; 0x34f10 lcd_selftest_error(TestError::Endstops, _error, ""); 1eb72: 4a ed ldi r20, 0xDA ; 218 1eb74: 52 e0 ldi r21, 0x02 ; 2 1eb76: be 01 movw r22, r28 1eb78: 6f 5f subi r22, 0xFF ; 255 1eb7a: 7f 4f sbci r23, 0xFF ; 255 1eb7c: 82 e0 ldi r24, 0x02 ; 2 1eb7e: 0e 94 5e e2 call 0x1c4bc ; 0x1c4bc ((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; 1eb82: 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(); 1eb84: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 1eb88: 81 e0 ldi r24, 0x01 ; 1 1eb8a: 0e 94 89 7a call 0xf512 ; 0xf512 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1eb8e: 11 23 and r17, r17 1eb90: 09 f4 brne .+2 ; 0x1eb94 1eb92: 51 cf rjmp .-350 ; 0x1ea36 { //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); 1eb94: 00 ed ldi r16, 0xD0 ; 208 1eb96: 17 e0 ldi r17, 0x07 ; 7 1eb98: 21 e0 ldi r18, 0x01 ; 1 1eb9a: 43 e0 ldi r20, 0x03 ; 3 1eb9c: 6f 2d mov r22, r15 1eb9e: 84 e0 ldi r24, 0x04 ; 4 1eba0: 0e 94 30 b9 call 0x17260 ; 0x17260 1eba4: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1eba6: 6a ef ldi r22, 0xFA ; 250 1eba8: 70 e0 ldi r23, 0x00 ; 0 1ebaa: 90 e0 ldi r25, 0x00 ; 0 1ebac: 80 e0 ldi r24, 0x00 ; 0 1ebae: 0e 94 41 e5 call 0x1ca82 ; 0x1ca82 } if (_result) 1ebb2: 88 23 and r24, r24 1ebb4: 09 f4 brne .+2 ; 0x1ebb8 1ebb6: 3f cf rjmp .-386 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ebb8: 10 e0 ldi r17, 0x00 ; 0 1ebba: 00 e0 ldi r16, 0x00 ; 0 1ebbc: 21 e0 ldi r18, 0x01 ; 1 1ebbe: 43 e0 ldi r20, 0x03 ; 3 1ebc0: 6f 2d mov r22, r15 1ebc2: 84 e0 ldi r24, 0x04 ; 4 1ebc4: 0e 94 30 b9 call 0x17260 ; 0x17260 1ebc8: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1ebca: 90 e0 ldi r25, 0x00 ; 0 1ebcc: 80 e0 ldi r24, 0x00 ; 0 1ebce: 0e 94 3e e4 call 0x1c87c ; 0x1c87c #endif } if (_result) 1ebd2: 88 23 and r24, r24 1ebd4: 09 f4 brne .+2 ; 0x1ebd8 1ebd6: 2f cf rjmp .-418 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ebd8: 0c ed ldi r16, 0xDC ; 220 1ebda: 15 e0 ldi r17, 0x05 ; 5 1ebdc: 21 e0 ldi r18, 0x01 ; 1 1ebde: 43 e0 ldi r20, 0x03 ; 3 1ebe0: 6f 2d mov r22, r15 1ebe2: 85 e0 ldi r24, 0x05 ; 5 1ebe4: 0e 94 30 b9 call 0x17260 ; 0x17260 1ebe8: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1ebea: 62 ed ldi r22, 0xD2 ; 210 1ebec: 70 e0 ldi r23, 0x00 ; 0 1ebee: 81 e0 ldi r24, 0x01 ; 1 1ebf0: 90 e0 ldi r25, 0x00 ; 0 1ebf2: 0e 94 41 e5 call 0x1ca82 ; 0x1ca82 #endif // TMC2130 } if (_result) 1ebf6: 88 23 and r24, r24 1ebf8: 09 f4 brne .+2 ; 0x1ebfc 1ebfa: 1d cf rjmp .-454 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ebfc: 10 e0 ldi r17, 0x00 ; 0 1ebfe: 00 e0 ldi r16, 0x00 ; 0 1ec00: 21 e0 ldi r18, 0x01 ; 1 1ec02: 43 e0 ldi r20, 0x03 ; 3 1ec04: 6f 2d mov r22, r15 1ec06: 86 e0 ldi r24, 0x06 ; 6 1ec08: 0e 94 30 b9 call 0x17260 ; 0x17260 1ec0c: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1ec0e: 81 e0 ldi r24, 0x01 ; 1 1ec10: 90 e0 ldi r25, 0x00 ; 0 1ec12: 0e 94 3e e4 call 0x1c87c ; 0x1c87c #endif // TMC2130 } if (_result) 1ec16: 88 23 and r24, r24 1ec18: 09 f4 brne .+2 ; 0x1ec1c 1ec1a: 0d cf rjmp .-486 ; 0x1ea36 enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1ec1c: ef e4 ldi r30, 0x4F ; 79 1ec1e: f9 e8 ldi r31, 0x89 ; 137 1ec20: 85 91 lpm r24, Z+ 1ec22: 95 91 lpm r25, Z+ 1ec24: a5 91 lpm r26, Z+ 1ec26: b4 91 lpm r27, Z 1ec28: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ec2c: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ec30: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ec34: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ec38: e3 e5 ldi r30, 0x53 ; 83 1ec3a: f9 e8 ldi r31, 0x89 ; 137 1ec3c: 85 91 lpm r24, Z+ 1ec3e: 95 91 lpm r25, Z+ 1ec40: a5 91 lpm r26, Z+ 1ec42: b4 91 lpm r27, Z 1ec44: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ec48: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ec4c: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ec50: 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); 1ec54: 60 e0 ldi r22, 0x00 ; 0 1ec56: 70 e0 ldi r23, 0x00 ; 0 1ec58: 80 e2 ldi r24, 0x20 ; 32 1ec5a: 91 e4 ldi r25, 0x41 ; 65 1ec5c: 0e 94 5e 67 call 0xcebc ; 0xcebc set_destination_to_current(); 1ec60: 0e 94 b7 61 call 0xc36e ; 0xc36e _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ec64: 0c ed ldi r16, 0xDC ; 220 1ec66: 15 e0 ldi r17, 0x05 ; 5 1ec68: 21 e0 ldi r18, 0x01 ; 1 1ec6a: 43 e0 ldi r20, 0x03 ; 3 1ec6c: 6f 2d mov r22, r15 1ec6e: 86 e0 ldi r24, 0x06 ; 6 1ec70: 0e 94 30 b9 call 0x17260 ; 0x17260 1ec74: 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); 1ec76: 62 ed ldi r22, 0xD2 ; 210 1ec78: 70 e0 ldi r23, 0x00 ; 0 1ec7a: 82 e0 ldi r24, 0x02 ; 2 1ec7c: 90 e0 ldi r25, 0x00 ; 0 1ec7e: 0e 94 41 e5 call 0x1ca82 ; 0x1ca82 1ec82: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1ec84: 60 e0 ldi r22, 0x00 ; 0 1ec86: 70 e0 ldi r23, 0x00 ; 0 1ec88: 80 ea ldi r24, 0xA0 ; 160 1ec8a: 91 e4 ldi r25, 0x41 ; 65 1ec8c: 0e 94 5e 67 call 0xcebc ; 0xcebc eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1ec90: 11 23 and r17, r17 1ec92: 09 f4 brne .+2 ; 0x1ec96 1ec94: d0 ce rjmp .-608 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ec96: 00 ed ldi r16, 0xD0 ; 208 1ec98: 17 e0 ldi r17, 0x07 ; 7 1ec9a: 21 e0 ldi r18, 0x01 ; 1 1ec9c: 43 e0 ldi r20, 0x03 ; 3 1ec9e: 6f 2d mov r22, r15 1eca0: 87 e0 ldi r24, 0x07 ; 7 1eca2: 0e 94 30 b9 call 0x17260 ; 0x17260 1eca6: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1eca8: 81 e0 ldi r24, 0x01 ; 1 1ecaa: 0e 94 48 e3 call 0x1c690 ; 0x1c690 } if (_result) 1ecae: 88 23 and r24, r24 1ecb0: 09 f4 brne .+2 ; 0x1ecb4 1ecb2: c1 ce rjmp .-638 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ecb4: 08 ee ldi r16, 0xE8 ; 232 1ecb6: 13 e0 ldi r17, 0x03 ; 3 1ecb8: 21 e0 ldi r18, 0x01 ; 1 1ecba: 43 e0 ldi r20, 0x03 ; 3 1ecbc: 6f 2d mov r22, r15 1ecbe: 88 e0 ldi r24, 0x08 ; 8 1ecc0: 0e 94 30 b9 call 0x17260 ; 0x17260 1ecc4: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1ecc6: 80 e0 ldi r24, 0x00 ; 0 1ecc8: 0e 94 48 e3 call 0x1c690 ; 0x1c690 1eccc: e8 2e mov r14, r24 } if (_result) 1ecce: 88 23 and r24, r24 1ecd0: 09 f4 brne .+2 ; 0x1ecd4 1ecd2: b1 ce rjmp .-670 ; 0x1ea36 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1ecd4: 00 ed ldi r16, 0xD0 ; 208 1ecd6: 17 e0 ldi r17, 0x07 ; 7 1ecd8: 21 e0 ldi r18, 0x01 ; 1 1ecda: 43 e0 ldi r20, 0x03 ; 3 1ecdc: 6f 2d mov r22, r15 1ecde: 89 e0 ldi r24, 0x09 ; 9 1ece0: 0e 94 30 b9 call 0x17260 ; 0x17260 } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 1ece4: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1ece8: 91 30 cpi r25, 0x01 ; 1 1ecea: 79 f5 brne .+94 ; 0x1ed4a { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1ecec: 21 e0 ldi r18, 0x01 ; 1 1ecee: 43 e0 ldi r20, 0x03 ; 3 1ecf0: 68 2f mov r22, r24 1ecf2: 8a e0 ldi r24, 0x0A ; 10 1ecf4: 0e 94 30 b9 call 0x17260 ; 0x17260 1ecf8: 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); 1ecfa: 86 e8 ldi r24, 0x86 ; 134 1ecfc: 9e e3 ldi r25, 0x3E ; 62 1ecfe: 0e 94 32 6d call 0xda64 ; 0xda64 1ed02: 70 e0 ldi r23, 0x00 ; 0 1ed04: 60 e0 ldi r22, 0x00 ; 0 1ed06: 0e 94 e2 bc call 0x179c4 ; 0x179c4 1ed0a: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 1ed0c: 10 e0 ldi r17, 0x00 ; 0 1ed0e: 00 e0 ldi r16, 0x00 ; 0 1ed10: 21 e0 ldi r18, 0x01 ; 1 1ed12: 41 e0 ldi r20, 0x01 ; 1 1ed14: 60 e0 ldi r22, 0x00 ; 0 1ed16: 8a e0 ldi r24, 0x0A ; 10 1ed18: 0e 94 30 b9 call 0x17260 ; 0x17260 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1ed1c: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ed20: 10 92 57 02 sts 0x0257, r1 ; 0x800257 // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 1ed24: 8d 2d mov r24, r13 1ed26: 0e 94 d6 f3 call 0x1e7ac ; 0x1e7ac MMU2::mmu2.unload(); //Unload filament 1ed2a: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 1ed2e: 8f ea ldi r24, 0xAF ; 175 1ed30: 90 e0 ldi r25, 0x00 ; 0 1ed32: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ed36: 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 1ed3a: 00 ed ldi r16, 0xD0 ; 208 1ed3c: 17 e0 ldi r17, 0x07 ; 7 1ed3e: 21 e0 ldi r18, 0x01 ; 1 1ed40: 43 e0 ldi r20, 0x03 ; 3 1ed42: 6f 2d mov r22, r15 1ed44: 8b e0 ldi r24, 0x0B ; 11 1ed46: 0e 94 30 b9 call 0x17260 ; 0x17260 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1ed4a: 08 e8 ldi r16, 0x88 ; 136 1ed4c: 13 e1 ldi r17, 0x13 ; 19 1ed4e: 21 e0 ldi r18, 0x01 ; 1 1ed50: 43 e0 ldi r20, 0x03 ; 3 1ed52: 68 2f mov r22, r24 1ed54: 8c e0 ldi r24, 0x0C ; 12 1ed56: 0e 94 30 b9 call 0x17260 ; 0x17260 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ed5a: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1ed5e: 61 e0 ldi r22, 0x01 ; 1 1ed60: 8d ea ldi r24, 0xAD ; 173 1ed62: 98 e6 ldi r25, 0x68 ; 104 1ed64: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_update_enable(true); 1ed68: 81 e0 ldi r24, 0x01 ; 1 1ed6a: 0e 94 41 6a call 0xd482 ; 0xd482 if (_result) 1ed6e: ee 20 and r14, r14 1ed70: 09 f4 brne .+2 ; 0x1ed74 1ed72: 72 ce rjmp .-796 ; 0x1ea58 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1ed74: 81 e0 ldi r24, 0x01 ; 1 1ed76: 0e 94 7d c6 call 0x18cfa ; 0x18cfa lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1ed7a: 89 e9 ldi r24, 0x99 ; 153 1ed7c: 9e e3 ldi r25, 0x3E ; 62 1ed7e: 0e 94 32 6d call 0xda64 ; 0xda64 1ed82: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_return_to_status(); 1ed86: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1ed8a: 81 e0 ldi r24, 0x01 ; 1 1ed8c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1ed90: 8e 2d mov r24, r14 1ed92: 0f 90 pop r0 1ed94: 0f 90 pop r0 1ed96: 0f 90 pop r0 1ed98: 0f 90 pop r0 1ed9a: df 91 pop r29 1ed9c: cf 91 pop r28 1ed9e: 1f 91 pop r17 1eda0: 0f 91 pop r16 1eda2: ff 90 pop r15 1eda4: ef 90 pop r14 1eda6: df 90 pop r13 1eda8: cf 90 pop r12 1edaa: 08 95 ret 0001edac : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1edac: 0c 94 fd f3 jmp 0x1e7fa ; 0x1e7fa 0001edb0 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1edb0: cf 93 push r28 1edb2: 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); 1edb4: 84 ed ldi r24, 0xD4 ; 212 1edb6: 9b e3 ldi r25, 0x3B ; 59 1edb8: 0e 94 32 6d call 0xda64 ; 0xda64 1edbc: 6c 2f mov r22, r28 1edbe: 0f 94 98 87 call 0x30f30 ; 0x30f30 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1edc2: 8c 2f mov r24, r28 1edc4: 0e 94 d6 f3 call 0x1e7ac ; 0x1e7ac 1edc8: 0f 94 a0 22 call 0x24540 ; 0x24540 planner_synchronize(); unload(); 1edcc: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 ScreenUpdateEnable(); 1edd0: 0f 94 95 87 call 0x30f2a ; 0x30f2a MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1edd4: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1edd6: 0d 94 63 0c jmp 0x218c6 ; 0x218c6 0001edda : 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(){ 1edda: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 1eddc: c0 e0 ldi r28, 0x00 ; 0 1edde: 84 ed ldi r24, 0xD4 ; 212 1ede0: 9b e3 ldi r25, 0x3B ; 59 1ede2: 0e 94 32 6d call 0xda64 ; 0xda64 1ede6: 6c 2f mov r22, r28 1ede8: 0f 94 98 87 call 0x30f30 ; 0x30f30 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1edec: 8c 2f mov r24, r28 1edee: 0e 94 d6 f3 call 0x1e7ac ; 0x1e7ac 1edf2: 0f 94 a0 22 call 0x24540 ; 0x24540 planner_synchronize(); unload(); 1edf6: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 ScreenUpdateEnable(); 1edfa: 0f 94 95 87 call 0x30f2a ; 0x30f2a 1edfe: cf 5f subi r28, 0xFF ; 255 1ee00: c5 30 cpi r28, 0x05 ; 5 1ee02: 69 f7 brne .-38 ; 0x1edde MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1ee04: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1ee06: 0d 94 63 0c jmp 0x218c6 ; 0x218c6 0001ee0a : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1ee0a: cf 93 push r28 1ee0c: df 93 push r29 1ee0e: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1ee10: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 1ee14: c8 2f mov r28, r24 1ee16: 88 23 and r24, r24 1ee18: 69 f1 breq .+90 ; 0x1ee74 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1ee1a: 88 ec ldi r24, 0xC8 ; 200 1ee1c: 90 e0 ldi r25, 0x00 ; 0 1ee1e: 0f 94 df 8b call 0x317be ; 0x317be (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> 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); 1ee22: 82 e0 ldi r24, 0x02 ; 2 1ee24: 0f 94 fd 2c call 0x259fa ; 0x259fa void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1ee28: 84 ec ldi r24, 0xC4 ; 196 1ee2a: 9a e5 ldi r25, 0x5A ; 90 1ee2c: 0e 94 32 6d call 0xda64 ; 0xda64 1ee30: 6d 2f mov r22, r29 1ee32: 0f 94 98 87 call 0x30f30 ; 0x30f30 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1ee36: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee3a: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee3e: 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 1ee42: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1ee46: 83 36 cpi r24, 0x63 ; 99 1ee48: 29 f0 breq .+10 ; 0x1ee54 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1ee4a: 62 e1 ldi r22, 0x12 ; 18 1ee4c: 84 ef ldi r24, 0xF4 ; 244 1ee4e: 99 e9 ldi r25, 0x99 ; 153 1ee50: 0f 94 eb 54 call 0x2a9d6 ; 0x2a9d6 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1ee54: 8d 2f mov r24, r29 1ee56: 0e 94 7e f2 call 0x1e4fc ; 0x1e4fc // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1ee5a: 0e 94 32 b2 call 0x16464 ; 0x16464 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); 1ee5e: 83 e0 ldi r24, 0x03 ; 3 1ee60: 0f 94 fd 2c call 0x259fa ; 0x259fa #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1ee64: 84 e8 ldi r24, 0x84 ; 132 1ee66: 96 e1 ldi r25, 0x16 ; 22 1ee68: 0e 94 71 6e call 0xdce2 ; 0xdce2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1ee6c: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1ee70: 0f 94 95 87 call 0x30f2a ; 0x30f2a return true; } 1ee74: 8c 2f mov r24, r28 1ee76: df 91 pop r29 1ee78: cf 91 pop r28 1ee7a: 08 95 ret 0001ee7c : /// 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) { 1ee7c: 1f 93 push r17 1ee7e: cf 93 push r28 1ee80: df 93 push r29 1ee82: c8 2f mov r28, r24 1ee84: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1ee86: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 1ee8a: d8 2f mov r29, r24 1ee8c: 88 23 and r24, r24 1ee8e: a9 f0 breq .+42 ; 0x1eeba eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee90: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee94: 10 92 85 16 sts 0x1685, r1 ; 0x801685 return false; } FSensorBlockRunout blockRunout; switch (code) { 1ee98: c3 36 cpi r28, 0x63 ; 99 1ee9a: 11 f1 breq .+68 ; 0x1eee0 1ee9c: c8 37 cpi r28, 0x78 ; 120 1ee9e: 91 f0 breq .+36 ; 0x1eec4 1eea0: cf 33 cpi r28, 0x3F ; 63 1eea2: 39 f4 brne .+14 ; 0x1eeb2 case '?': { waitForHotendTargetTemp(100, [] {}); 1eea4: 84 e6 ldi r24, 0x64 ; 100 1eea6: 90 e0 ldi r25, 0x00 ; 0 1eea8: 0f 94 df 8b call 0x317be ; 0x317be (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> load_filament_to_nozzle(slot); 1eeac: 81 2f mov r24, r17 1eeae: 0e 94 05 f7 call 0x1ee0a ; 0x1ee0a #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1eeb2: 84 e8 ldi r24, 0x84 ; 132 1eeb4: 96 e1 ldi r25, 0x16 ; 22 1eeb6: 0e 94 71 6e call 0xdce2 ; 0xdce2 execute_load_to_nozzle_sequence(); } break; } return true; } 1eeba: 8d 2f mov r24, r29 1eebc: df 91 pop r29 1eebe: cf 91 pop r28 1eec0: 1f 91 pop r17 1eec2: 08 95 ret 1eec4: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1eec8: 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); 1eecc: 81 2f mov r24, r17 1eece: 0e 94 d6 f3 call 0x1e7ac ; 0x1e7ac 1eed2: 8f ea ldi r24, 0xAF ; 175 1eed4: 90 e0 ldi r25, 0x00 ; 0 1eed6: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1eeda: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1eede: e9 cf rjmp .-46 ; 0x1eeb2 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1eee0: 84 e6 ldi r24, 0x64 ; 100 1eee2: 90 e0 ldi r25, 0x00 ; 0 1eee4: 0f 94 df 8b call 0x317be ; 0x317be (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> execute_load_to_nozzle_sequence(); 1eee8: 0e 94 32 b2 call 0x16464 ; 0x16464 1eeec: e2 cf rjmp .-60 ; 0x1eeb2 0001eeee : 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); 1eeee: 0e 94 05 f7 call 0x1ee0a ; 0x1ee0a // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1eef2: 0e 94 f6 5e call 0xbdec ; 0xbdec st_synchronize(); 1eef6: 0f 94 a0 22 call 0x24540 ; 0x24540 // Ask user if the extruded color is correct: lcd_return_to_status(); 1eefa: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_load_filament_color_check(); 1eefe: 0f 94 25 30 call 0x2604a ; 0x2604a lcd_setstatuspgm(MSG_WELCOME); 1ef02: 8b e0 ldi r24, 0x0B ; 11 1ef04: 9c e6 ldi r25, 0x6C ; 108 1ef06: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = CustomMsg::Status; 1ef0a: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 // Clear the filament action clearFilamentAction(); 1ef0e: 0d 94 63 0c jmp 0x218c6 ; 0x218c6 0001ef12 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1ef12: 1f 93 push r17 1ef14: cf 93 push r28 1ef16: df 93 push r29 1ef18: 00 d0 rcall .+0 ; 0x1ef1a 1ef1a: 1f 92 push r1 1ef1c: 1f 92 push r1 1ef1e: cd b7 in r28, 0x3d ; 61 1ef20: de b7 in r29, 0x3e ; 62 1ef22: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1ef24: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 1ef28: 88 23 and r24, r24 1ef2a: d9 f0 breq .+54 ; 0x1ef62 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1ef2c: 41 2f mov r20, r17 1ef2e: 62 e5 ldi r22, 0x52 ; 82 1ef30: ce 01 movw r24, r28 1ef32: 01 96 adiw r24, 0x01 ; 1 1ef34: 0f 94 53 88 call 0x310a6 ; 0x310a6 1ef38: 49 81 ldd r20, Y+1 ; 0x01 1ef3a: 5a 81 ldd r21, Y+2 ; 0x02 1ef3c: 6b 81 ldd r22, Y+3 ; 0x03 1ef3e: 7c 81 ldd r23, Y+4 ; 0x04 1ef40: 8d 81 ldd r24, Y+5 ; 0x05 1ef42: 0f 94 93 63 call 0x2c726 ; 0x2c726 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)); 1ef46: 60 e0 ldi r22, 0x00 ; 0 1ef48: 80 e0 ldi r24, 0x00 ; 0 1ef4a: 0f 94 28 6b call 0x2d650 ; 0x2d650 1ef4e: 88 23 and r24, r24 1ef50: 69 f3 breq .-38 ; 0x1ef2c // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1ef52: 20 91 40 12 lds r18, 0x1240 ; 0x801240 1ef56: 30 91 41 12 lds r19, 0x1241 ; 0x801241 1ef5a: 30 93 91 12 sts 0x1291, r19 ; 0x801291 1ef5e: 20 93 90 12 sts 0x1290, r18 ; 0x801290 return true; } 1ef62: 0f 90 pop r0 1ef64: 0f 90 pop r0 1ef66: 0f 90 pop r0 1ef68: 0f 90 pop r0 1ef6a: 0f 90 pop r0 1ef6c: df 91 pop r29 1ef6e: cf 91 pop r28 1ef70: 1f 91 pop r17 1ef72: 08 95 ret 0001ef74 : 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) { 1ef74: fc 01 movw r30, r24 switch(*oCheckSetting) { 1ef76: 80 81 ld r24, Z 1ef78: 88 23 and r24, r24 1ef7a: 21 f0 breq .+8 ; 0x1ef84 1ef7c: 81 30 cpi r24, 0x01 ; 1 1ef7e: 29 f4 brne .+10 ; 0x1ef8a case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef80: 82 e0 ldi r24, 0x02 ; 2 1ef82: 01 c0 rjmp .+2 ; 0x1ef86 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 1ef84: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef86: 80 83 st Z, r24 1ef88: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 1ef8a: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 1ef8c: 08 95 ret 0001ef8e : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 1ef8e: fc 01 movw r30, r24 1ef90: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 1ef92: 90 32 cpi r25, 0x20 ; 32 1ef94: 49 f0 breq .+18 ; 0x1efa8 1ef96: 87 ef ldi r24, 0xF7 ; 247 1ef98: 89 0f add r24, r25 1ef9a: 82 30 cpi r24, 0x02 ; 2 1ef9c: 28 f0 brcs .+10 ; 0x1efa8 1ef9e: 81 e0 ldi r24, 0x01 ; 1 1efa0: 9d 30 cpi r25, 0x0D ; 13 1efa2: 19 f0 breq .+6 ; 0x1efaa 1efa4: 80 e0 ldi r24, 0x00 ; 0 1efa6: 08 95 ret 1efa8: 81 e0 ldi r24, 0x01 ; 1 } 1efaa: 08 95 ret 0001efac : 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; 1efac: 88 3e cpi r24, 0xE8 ; 232 1efae: 23 e0 ldi r18, 0x03 ; 3 1efb0: 92 07 cpc r25, r18 1efb2: 10 f0 brcs .+4 ; 0x1efb8 1efb4: 87 ee ldi r24, 0xE7 ; 231 1efb6: 93 e0 ldi r25, 0x03 ; 3 } 1efb8: 08 95 ret 0001efba : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1efba: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 1efbe: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 1efc2: 2f ef ldi r18, 0xFF ; 255 1efc4: 3f ef ldi r19, 0xFF ; 255 1efc6: 89 17 cp r24, r25 1efc8: 71 f0 breq .+28 ; 0x1efe6 _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 1efca: e9 2f mov r30, r25 1efcc: f0 e0 ldi r31, 0x00 ; 0 1efce: ed 54 subi r30, 0x4D ; 77 1efd0: f2 4f sbci r31, 0xF2 ; 242 1efd2: 20 81 ld r18, Z 1efd4: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1efd6: 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 1efd8: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 1efdc: 98 17 cp r25, r24 1efde: 08 f0 brcs .+2 ; 0x1efe2 1efe0: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1efe2: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 return rbuf_get(uart2_ibuf); } 1efe6: c9 01 movw r24, r18 1efe8: 08 95 ret 0001efea : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1efea: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1efee: 95 ff sbrs r25, 5 1eff0: fc cf rjmp .-8 ; 0x1efea UDR2 = c; // transmit byte 1eff2: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> // while (!uart2_txcomplete); // wait until byte sent // UCSR2A |= (1 << TXC2); // delete TXCflag return 0; } 1eff6: 90 e0 ldi r25, 0x00 ; 0 1eff8: 80 e0 ldi r24, 0x00 ; 0 1effa: 08 95 ret 0001effc : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1effc: 3f b7 in r19, 0x3f ; 63 cli(); 1effe: f8 94 cli m = timer2_overflow_count; 1f000: 80 91 69 06 lds r24, 0x0669 ; 0x800669 1f004: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 1f008: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 1f00c: b0 91 6c 06 lds r27, 0x066C ; 0x80066c #if defined(TCNT2) t = TCNT2; 1f010: 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)) 1f014: b8 9b sbis 0x17, 0 ; 23 1f016: 05 c0 rjmp .+10 ; 0x1f022 1f018: 2f 3f cpi r18, 0xFF ; 255 1f01a: 19 f0 breq .+6 ; 0x1f022 m++; 1f01c: 01 96 adiw r24, 0x01 ; 1 1f01e: a1 1d adc r26, r1 1f020: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1f022: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1f024: ba 2f mov r27, r26 1f026: a9 2f mov r26, r25 1f028: 98 2f mov r25, r24 1f02a: 88 27 eor r24, r24 1f02c: bc 01 movw r22, r24 1f02e: cd 01 movw r24, r26 1f030: 62 0f add r22, r18 1f032: 71 1d adc r23, r1 1f034: 81 1d adc r24, r1 1f036: 91 1d adc r25, r1 1f038: 42 e0 ldi r20, 0x02 ; 2 1f03a: 66 0f add r22, r22 1f03c: 77 1f adc r23, r23 1f03e: 88 1f adc r24, r24 1f040: 99 1f adc r25, r25 1f042: 4a 95 dec r20 1f044: d1 f7 brne .-12 ; 0x1f03a } 1f046: 08 95 ret 0001f048 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1f048: 2f 92 push r2 1f04a: 3f 92 push r3 1f04c: 4f 92 push r4 1f04e: 5f 92 push r5 1f050: 6f 92 push r6 1f052: 7f 92 push r7 1f054: 8f 92 push r8 1f056: 9f 92 push r9 1f058: af 92 push r10 1f05a: bf 92 push r11 1f05c: cf 92 push r12 1f05e: df 92 push r13 1f060: ef 92 push r14 1f062: ff 92 push r15 1f064: 0f 93 push r16 1f066: 1f 93 push r17 1f068: cf 93 push r28 1f06a: df 93 push r29 1f06c: cd b7 in r28, 0x3d ; 61 1f06e: de b7 in r29, 0x3e ; 62 1f070: 2e 97 sbiw r28, 0x0e ; 14 1f072: 0f b6 in r0, 0x3f ; 63 1f074: f8 94 cli 1f076: de bf out 0x3e, r29 ; 62 1f078: 0f be out 0x3f, r0 ; 63 1f07a: 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]); 1f07c: 20 90 5c 06 lds r2, 0x065C ; 0x80065c 1f080: 30 90 5d 06 lds r3, 0x065D ; 0x80065d 1f084: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 1f088: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 1f08c: 60 90 60 06 lds r6, 0x0660 ; 0x800660 1f090: 70 90 61 06 lds r7, 0x0661 ; 0x800661 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1f094: 21 14 cp r2, r1 1f096: 31 04 cpc r3, r1 1f098: 39 f4 brne .+14 ; 0x1f0a8 pid_output = 0; pid_reset[e] = true; 1f09a: 81 e0 ldi r24, 0x01 ; 1 1f09c: 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; 1f0a0: 81 2c mov r8, r1 1f0a2: 91 2c mov r9, r1 1f0a4: 54 01 movw r10, r8 1f0a6: f9 c0 rjmp .+498 ; 0x1f29a #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1f0a8: b1 01 movw r22, r2 1f0aa: 03 2c mov r0, r3 1f0ac: 00 0c add r0, r0 1f0ae: 88 0b sbc r24, r24 1f0b0: 99 0b sbc r25, r25 1f0b2: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1f0b6: a3 01 movw r20, r6 1f0b8: 92 01 movw r18, r4 1f0ba: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f0be: 6b 01 movw r12, r22 1f0c0: 7c 01 movw r14, r24 if(pid_reset[e]) { 1f0c2: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1f0c6: 88 23 and r24, r24 1f0c8: 91 f0 breq .+36 ; 0x1f0ee iState_sum[e] = 0.0; 1f0ca: 10 92 31 06 sts 0x0631, r1 ; 0x800631 1f0ce: 10 92 32 06 sts 0x0632, r1 ; 0x800632 1f0d2: 10 92 33 06 sts 0x0633, r1 ; 0x800633 1f0d6: 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) 1f0da: 10 92 2d 06 sts 0x062D, r1 ; 0x80062d 1f0de: 10 92 2e 06 sts 0x062E, r1 ; 0x80062e 1f0e2: 10 92 2f 06 sts 0x062F, r1 ; 0x80062f 1f0e6: 10 92 30 06 sts 0x0630, r1 ; 0x800630 pid_reset[e] = false; 1f0ea: 10 92 35 06 sts 0x0635, r1 ; 0x800635 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1f0ee: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 1f0f2: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 1f0f6: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 1f0fa: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 1f0fe: c7 01 movw r24, r14 1f100: b6 01 movw r22, r12 1f102: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f106: 69 83 std Y+1, r22 ; 0x01 1f108: 7a 83 std Y+2, r23 ; 0x02 1f10a: 8b 83 std Y+3, r24 ; 0x03 1f10c: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1f10e: 20 91 31 06 lds r18, 0x0631 ; 0x800631 1f112: 30 91 32 06 lds r19, 0x0632 ; 0x800632 1f116: 40 91 33 06 lds r20, 0x0633 ; 0x800633 1f11a: 50 91 34 06 lds r21, 0x0634 ; 0x800634 1f11e: c7 01 movw r24, r14 1f120: b6 01 movw r22, r12 1f122: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f126: 4b 01 movw r8, r22 1f128: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1f12a: 20 91 ea 03 lds r18, 0x03EA ; 0x8003ea <_ZL14iState_sum_min.lto_priv.429> 1f12e: 2d 87 std Y+13, r18 ; 0x0d 1f130: 30 91 eb 03 lds r19, 0x03EB ; 0x8003eb <_ZL14iState_sum_min.lto_priv.429+0x1> 1f134: 39 87 std Y+9, r19 ; 0x09 1f136: 10 91 ec 03 lds r17, 0x03EC ; 0x8003ec <_ZL14iState_sum_min.lto_priv.429+0x2> 1f13a: 00 91 ed 03 lds r16, 0x03ED ; 0x8003ed <_ZL14iState_sum_min.lto_priv.429+0x3> 1f13e: 41 2f mov r20, r17 1f140: 50 2f mov r21, r16 1f142: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f146: 87 fd sbrc r24, 7 1f148: 17 c0 rjmp .+46 ; 0x1f178 1f14a: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 1f14e: 8d 87 std Y+13, r24 ; 0x0d 1f150: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 1f154: 99 87 std Y+9, r25 ; 0x09 1f156: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 1f15a: 00 91 e9 03 lds r16, 0x03E9 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.430+0x3> 1f15e: 9c 01 movw r18, r24 1f160: 41 2f mov r20, r17 1f162: 50 2f mov r21, r16 1f164: b4 01 movw r22, r8 1f166: c5 01 movw r24, r10 1f168: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1f16c: 18 16 cp r1, r24 1f16e: 24 f0 brlt .+8 ; 0x1f178 1f170: 8d 86 std Y+13, r8 ; 0x0d 1f172: 99 86 std Y+9, r9 ; 0x09 1f174: 1a 2d mov r17, r10 1f176: 0b 2d mov r16, r11 1f178: 8d 85 ldd r24, Y+13 ; 0x0d 1f17a: 99 85 ldd r25, Y+9 ; 0x09 1f17c: a1 2f mov r26, r17 1f17e: b0 2f mov r27, r16 1f180: 80 93 31 06 sts 0x0631, r24 ; 0x800631 1f184: 90 93 32 06 sts 0x0632, r25 ; 0x800632 1f188: a0 93 33 06 sts 0x0633, r26 ; 0x800633 1f18c: b0 93 34 06 sts 0x0634, r27 ; 0x800634 iTerm[e] = cs.Ki * iState_sum[e]; 1f190: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1f194: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1f198: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1f19c: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1f1a0: bc 01 movw r22, r24 1f1a2: 81 2f mov r24, r17 1f1a4: 90 2f mov r25, r16 1f1a6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f1aa: 6d 83 std Y+5, r22 ; 0x05 1f1ac: 7e 83 std Y+6, r23 ; 0x06 1f1ae: 8f 83 std Y+7, r24 ; 0x07 1f1b0: 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 1f1b2: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1f1b6: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 1f1ba: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 1f1be: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 1f1c2: c3 01 movw r24, r6 1f1c4: b2 01 movw r22, r4 1f1c6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f1ca: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 1f1ce: 30 91 a3 04 lds r19, 0x04A3 ; 0x8004a3 1f1d2: 40 91 a4 04 lds r20, 0x04A4 ; 0x8004a4 1f1d6: 50 91 a5 04 lds r21, 0x04A5 ; 0x8004a5 1f1da: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f1de: 20 ed ldi r18, 0xD0 ; 208 1f1e0: 3c ec ldi r19, 0xCC ; 204 1f1e2: 4c e4 ldi r20, 0x4C ; 76 1f1e4: 5d e3 ldi r21, 0x3D ; 61 1f1e6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f1ea: 4b 01 movw r8, r22 1f1ec: 5c 01 movw r10, r24 1f1ee: 23 e3 ldi r18, 0x33 ; 51 1f1f0: 33 e3 ldi r19, 0x33 ; 51 1f1f2: 43 e7 ldi r20, 0x73 ; 115 1f1f4: 5f e3 ldi r21, 0x3F ; 63 1f1f6: 60 91 2d 06 lds r22, 0x062D ; 0x80062d 1f1fa: 70 91 2e 06 lds r23, 0x062E ; 0x80062e 1f1fe: 80 91 2f 06 lds r24, 0x062F ; 0x80062f 1f202: 90 91 30 06 lds r25, 0x0630 ; 0x800630 1f206: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f20a: 9b 01 movw r18, r22 1f20c: ac 01 movw r20, r24 1f20e: c5 01 movw r24, r10 1f210: b4 01 movw r22, r8 1f212: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f216: 4b 01 movw r8, r22 1f218: 5c 01 movw r10, r24 1f21a: 80 92 2d 06 sts 0x062D, r8 ; 0x80062d 1f21e: 90 92 2e 06 sts 0x062E, r9 ; 0x80062e 1f222: a0 92 2f 06 sts 0x062F, r10 ; 0x80062f 1f226: 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) 1f22a: 2d 81 ldd r18, Y+5 ; 0x05 1f22c: 3e 81 ldd r19, Y+6 ; 0x06 1f22e: 4f 81 ldd r20, Y+7 ; 0x07 1f230: 58 85 ldd r21, Y+8 ; 0x08 1f232: 69 81 ldd r22, Y+1 ; 0x01 1f234: 7a 81 ldd r23, Y+2 ; 0x02 1f236: 8b 81 ldd r24, Y+3 ; 0x03 1f238: 9c 81 ldd r25, Y+4 ; 0x04 1f23a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f23e: a5 01 movw r20, r10 1f240: 94 01 movw r18, r8 1f242: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f246: 4b 01 movw r8, r22 1f248: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1f24a: 20 e0 ldi r18, 0x00 ; 0 1f24c: 30 e0 ldi r19, 0x00 ; 0 1f24e: 4f e7 ldi r20, 0x7F ; 127 1f250: 53 e4 ldi r21, 0x43 ; 67 1f252: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f256: 20 e0 ldi r18, 0x00 ; 0 1f258: 30 e0 ldi r19, 0x00 ; 0 1f25a: 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) { 1f25c: 18 16 cp r1, r24 1f25e: 0c f0 brlt .+2 ; 0x1f262 1f260: 6d c1 rjmp .+730 ; 0x1f53c if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f262: c7 01 movw r24, r14 1f264: b6 01 movw r22, r12 1f266: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1f26a: 18 16 cp r1, r24 1f26c: 84 f4 brge .+32 ; 0x1f28e 1f26e: a7 01 movw r20, r14 1f270: 96 01 movw r18, r12 1f272: 6d 85 ldd r22, Y+13 ; 0x0d 1f274: 79 85 ldd r23, Y+9 ; 0x09 1f276: 81 2f mov r24, r17 1f278: 90 2f mov r25, r16 1f27a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f27e: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f282: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f286: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f28a: 90 93 34 06 sts 0x0634, r25 ; 0x800634 pid_output=PID_MAX; 1f28e: 81 2c mov r8, r1 1f290: 91 2c mov r9, r1 1f292: 3f e7 ldi r19, 0x7F ; 127 1f294: a3 2e mov r10, r19 1f296: 33 e4 ldi r19, 0x43 ; 67 1f298: 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; 1f29a: 40 92 29 06 sts 0x0629, r4 ; 0x800629 1f29e: 50 92 2a 06 sts 0x062A, r5 ; 0x80062a 1f2a2: 60 92 2b 06 sts 0x062B, r6 ; 0x80062b 1f2a6: 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)) 1f2aa: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.431> 1f2ae: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.431+0x1> 1f2b2: 07 2e mov r0, r23 1f2b4: 00 0c add r0, r0 1f2b6: 88 0b sbc r24, r24 1f2b8: 99 0b sbc r25, r25 1f2ba: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1f2be: 9b 01 movw r18, r22 1f2c0: ac 01 movw r20, r24 1f2c2: c3 01 movw r24, r6 1f2c4: b2 01 movw r22, r4 1f2c6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f2ca: 87 ff sbrs r24, 7 1f2cc: 57 c1 rjmp .+686 ; 0x1f57c 1f2ce: 23 28 or r2, r3 1f2d0: 09 f4 brne .+2 ; 0x1f2d4 1f2d2: 54 c1 rjmp .+680 ; 0x1f57c soft_pwm[e] = (int)pid_output >> 1; 1f2d4: c5 01 movw r24, r10 1f2d6: b4 01 movw r22, r8 1f2d8: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1f2dc: 75 95 asr r23 1f2de: 67 95 ror r22 1f2e0: 60 93 62 06 sts 0x0662, r22 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 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); 1f2e4: 20 91 55 06 lds r18, 0x0655 ; 0x800655 1f2e8: 30 91 56 06 lds r19, 0x0656 ; 0x800656 1f2ec: 3a 83 std Y+2, r19 ; 0x02 1f2ee: 29 83 std Y+1, r18 ; 0x01 1f2f0: 40 90 57 06 lds r4, 0x0657 ; 0x800657 1f2f4: 50 90 58 06 lds r5, 0x0658 ; 0x800658 1f2f8: 60 90 59 06 lds r6, 0x0659 ; 0x800659 1f2fc: 70 90 5a 06 lds r7, 0x065A ; 0x80065a #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1f300: b9 01 movw r22, r18 1f302: 33 0f add r19, r19 1f304: 88 0b sbc r24, r24 1f306: 99 0b sbc r25, r25 1f308: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 1f30c: a3 01 movw r20, r6 1f30e: 92 01 movw r18, r4 1f310: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f314: 6b 01 movw r12, r22 1f316: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1f318: 20 91 a6 04 lds r18, 0x04A6 ; 0x8004a6 1f31c: 30 91 a7 04 lds r19, 0x04A7 ; 0x8004a7 1f320: 40 91 a8 04 lds r20, 0x04A8 ; 0x8004a8 1f324: 50 91 a9 04 lds r21, 0x04A9 ; 0x8004a9 1f328: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f32c: 6d 83 std Y+5, r22 ; 0x05 1f32e: 7e 83 std Y+6, r23 ; 0x06 1f330: 8f 83 std Y+7, r24 ; 0x07 1f332: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1f334: 20 91 3e 06 lds r18, 0x063E ; 0x80063e 1f338: 30 91 3f 06 lds r19, 0x063F ; 0x80063f 1f33c: 40 91 40 06 lds r20, 0x0640 ; 0x800640 1f340: 50 91 41 06 lds r21, 0x0641 ; 0x800641 1f344: c7 01 movw r24, r14 1f346: b6 01 movw r22, r12 1f348: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f34c: 5b 01 movw r10, r22 1f34e: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1f350: 30 91 e2 03 lds r19, 0x03E2 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.427> 1f354: 3e 87 std Y+14, r19 ; 0x0e 1f356: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.427+0x1> 1f35a: 8d 87 std Y+13, r24 ; 0x0d 1f35c: 30 90 e4 03 lds r3, 0x03E4 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.427+0x2> 1f360: 20 90 e5 03 lds r2, 0x03E5 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.427+0x3> 1f364: 23 2f mov r18, r19 1f366: 38 2f mov r19, r24 1f368: 43 2d mov r20, r3 1f36a: 52 2d mov r21, r2 1f36c: b5 01 movw r22, r10 1f36e: c8 01 movw r24, r16 1f370: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f374: 87 fd sbrc r24, 7 1f376: 18 c0 rjmp .+48 ; 0x1f3a8 1f378: 90 91 de 03 lds r25, 0x03DE ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 1f37c: 9e 87 std Y+14, r25 ; 0x0e 1f37e: 20 91 df 03 lds r18, 0x03DF ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 1f382: 2d 87 std Y+13, r18 ; 0x0d 1f384: 30 90 e0 03 lds r3, 0x03E0 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 1f388: 20 90 e1 03 lds r2, 0x03E1 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.428+0x3> 1f38c: 29 2f mov r18, r25 1f38e: 3d 85 ldd r19, Y+13 ; 0x0d 1f390: 43 2d mov r20, r3 1f392: 52 2d mov r21, r2 1f394: b5 01 movw r22, r10 1f396: c8 01 movw r24, r16 1f398: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1f39c: 18 16 cp r1, r24 1f39e: 24 f0 brlt .+8 ; 0x1f3a8 1f3a0: ae 86 std Y+14, r10 ; 0x0e 1f3a2: bd 86 std Y+13, r11 ; 0x0d 1f3a4: 30 2e mov r3, r16 1f3a6: 21 2e mov r2, r17 1f3a8: 8e 85 ldd r24, Y+14 ; 0x0e 1f3aa: 9d 85 ldd r25, Y+13 ; 0x0d 1f3ac: a3 2d mov r26, r3 1f3ae: b2 2d mov r27, r2 1f3b0: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 1f3b4: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f 1f3b8: a0 93 40 06 sts 0x0640, r26 ; 0x800640 1f3bc: b0 93 41 06 sts 0x0641, r27 ; 0x800641 iTerm_bed = cs.bedKi * temp_iState_bed; 1f3c0: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1f3c4: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1f3c8: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1f3cc: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1f3d0: bc 01 movw r22, r24 1f3d2: 83 2d mov r24, r3 1f3d4: 92 2d mov r25, r2 1f3d6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f3da: 69 87 std Y+9, r22 ; 0x09 1f3dc: 7a 87 std Y+10, r23 ; 0x0a 1f3de: 8b 87 std Y+11, r24 ; 0x0b 1f3e0: 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); 1f3e2: 20 91 3a 06 lds r18, 0x063A ; 0x80063a 1f3e6: 30 91 3b 06 lds r19, 0x063B ; 0x80063b 1f3ea: 40 91 3c 06 lds r20, 0x063C ; 0x80063c 1f3ee: 50 91 3d 06 lds r21, 0x063D ; 0x80063d 1f3f2: c3 01 movw r24, r6 1f3f4: b2 01 movw r22, r4 1f3f6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f3fa: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1f3fe: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1f402: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 1f406: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 1f40a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f40e: 20 ed ldi r18, 0xD0 ; 208 1f410: 3c ec ldi r19, 0xCC ; 204 1f412: 4c e4 ldi r20, 0x4C ; 76 1f414: 5d e3 ldi r21, 0x3D ; 61 1f416: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f41a: 4b 01 movw r8, r22 1f41c: 5c 01 movw r10, r24 1f41e: 23 e3 ldi r18, 0x33 ; 51 1f420: 33 e3 ldi r19, 0x33 ; 51 1f422: 43 e7 ldi r20, 0x73 ; 115 1f424: 5f e3 ldi r21, 0x3F ; 63 1f426: 60 91 36 06 lds r22, 0x0636 ; 0x800636 1f42a: 70 91 37 06 lds r23, 0x0637 ; 0x800637 1f42e: 80 91 38 06 lds r24, 0x0638 ; 0x800638 1f432: 90 91 39 06 lds r25, 0x0639 ; 0x800639 1f436: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 1f43a: 9b 01 movw r18, r22 1f43c: ac 01 movw r20, r24 1f43e: c5 01 movw r24, r10 1f440: b4 01 movw r22, r8 1f442: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f446: 4b 01 movw r8, r22 1f448: 5c 01 movw r10, r24 1f44a: 80 92 36 06 sts 0x0636, r8 ; 0x800636 1f44e: 90 92 37 06 sts 0x0637, r9 ; 0x800637 1f452: a0 92 38 06 sts 0x0638, r10 ; 0x800638 1f456: b0 92 39 06 sts 0x0639, r11 ; 0x800639 temp_dState_bed = pid_input; 1f45a: 40 92 3a 06 sts 0x063A, r4 ; 0x80063a 1f45e: 50 92 3b 06 sts 0x063B, r5 ; 0x80063b 1f462: 60 92 3c 06 sts 0x063C, r6 ; 0x80063c 1f466: 70 92 3d 06 sts 0x063D, r7 ; 0x80063d pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1f46a: 29 85 ldd r18, Y+9 ; 0x09 1f46c: 3a 85 ldd r19, Y+10 ; 0x0a 1f46e: 4b 85 ldd r20, Y+11 ; 0x0b 1f470: 5c 85 ldd r21, Y+12 ; 0x0c 1f472: 6d 81 ldd r22, Y+5 ; 0x05 1f474: 7e 81 ldd r23, Y+6 ; 0x06 1f476: 8f 81 ldd r24, Y+7 ; 0x07 1f478: 98 85 ldd r25, Y+8 ; 0x08 1f47a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 1f47e: a5 01 movw r20, r10 1f480: 94 01 movw r18, r8 1f482: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f486: 4b 01 movw r8, r22 1f488: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1f48a: 20 e0 ldi r18, 0x00 ; 0 1f48c: 30 e0 ldi r19, 0x00 ; 0 1f48e: 4f e7 ldi r20, 0x7F ; 127 1f490: 53 e4 ldi r21, 0x43 ; 67 1f492: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f496: 20 e0 ldi r18, 0x00 ; 0 1f498: 30 e0 ldi r19, 0x00 ; 0 1f49a: 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) { 1f49c: 18 16 cp r1, r24 1f49e: 0c f0 brlt .+2 ; 0x1f4a2 1f4a0: 70 c0 rjmp .+224 ; 0x1f582 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f4a2: c7 01 movw r24, r14 1f4a4: b6 01 movw r22, r12 1f4a6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 1f4aa: 18 16 cp r1, r24 1f4ac: 84 f4 brge .+32 ; 0x1f4ce 1f4ae: a7 01 movw r20, r14 1f4b0: 96 01 movw r18, r12 1f4b2: 6e 85 ldd r22, Y+14 ; 0x0e 1f4b4: 7d 85 ldd r23, Y+13 ; 0x0d 1f4b6: 83 2d mov r24, r3 1f4b8: 92 2d mov r25, r2 1f4ba: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f4be: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f4c2: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f4c6: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f4ca: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=MAX_BED_POWER; 1f4ce: 81 2c mov r8, r1 1f4d0: 91 2c mov r9, r1 1f4d2: 9f e7 ldi r25, 0x7F ; 127 1f4d4: a9 2e mov r10, r25 1f4d6: 93 e4 ldi r25, 0x43 ; 67 1f4d8: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1f4da: 20 e0 ldi r18, 0x00 ; 0 1f4dc: 30 e0 ldi r19, 0x00 ; 0 1f4de: 4a ef ldi r20, 0xFA ; 250 1f4e0: 52 e4 ldi r21, 0x42 ; 66 1f4e2: c3 01 movw r24, r6 1f4e4: b2 01 movw r22, r4 1f4e6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f4ea: 87 ff sbrs r24, 7 1f4ec: 6d c0 rjmp .+218 ; 0x1f5c8 { soft_pwm_bed = (int)pid_output >> 1; 1f4ee: c5 01 movw r24, r10 1f4f0: b4 01 movw r22, r8 1f4f2: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 1f4f6: 75 95 asr r23 1f4f8: 67 95 ror r22 1f4fa: 60 93 5b 06 sts 0x065B, r22 ; 0x80065b soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1f4fe: 89 81 ldd r24, Y+1 ; 0x01 1f500: 9a 81 ldd r25, Y+2 ; 0x02 1f502: 89 2b or r24, r25 1f504: 11 f4 brne .+4 ; 0x1f50a { soft_pwm_bed = 0; 1f506: 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); } 1f50a: 2e 96 adiw r28, 0x0e ; 14 1f50c: 0f b6 in r0, 0x3f ; 63 1f50e: f8 94 cli 1f510: de bf out 0x3e, r29 ; 62 1f512: 0f be out 0x3f, r0 ; 63 1f514: cd bf out 0x3d, r28 ; 61 1f516: df 91 pop r29 1f518: cf 91 pop r28 1f51a: 1f 91 pop r17 1f51c: 0f 91 pop r16 1f51e: ff 90 pop r15 1f520: ef 90 pop r14 1f522: df 90 pop r13 1f524: cf 90 pop r12 1f526: bf 90 pop r11 1f528: af 90 pop r10 1f52a: 9f 90 pop r9 1f52c: 8f 90 pop r8 1f52e: 7f 90 pop r7 1f530: 6f 90 pop r6 1f532: 5f 90 pop r5 1f534: 4f 90 pop r4 1f536: 3f 90 pop r3 1f538: 2f 90 pop r2 1f53a: 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) { 1f53c: c5 01 movw r24, r10 1f53e: b4 01 movw r22, r8 1f540: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f544: 87 ff sbrs r24, 7 1f546: a9 ce rjmp .-686 ; 0x1f29a if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f548: 20 e0 ldi r18, 0x00 ; 0 1f54a: 30 e0 ldi r19, 0x00 ; 0 1f54c: a9 01 movw r20, r18 1f54e: c7 01 movw r24, r14 1f550: b6 01 movw r22, r12 1f552: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f556: 87 ff sbrs r24, 7 1f558: a3 cd rjmp .-1210 ; 0x1f0a0 1f55a: a7 01 movw r20, r14 1f55c: 96 01 movw r18, r12 1f55e: 6d 85 ldd r22, Y+13 ; 0x0d 1f560: 79 85 ldd r23, Y+9 ; 0x09 1f562: 81 2f mov r24, r17 1f564: 90 2f mov r25, r16 1f566: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f56a: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f56e: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f572: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f576: 90 93 34 06 sts 0x0634, r25 ; 0x800634 1f57a: 92 cd rjmp .-1244 ; 0x1f0a0 // 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; 1f57c: 10 92 62 06 sts 0x0662, r1 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 1f580: b1 ce rjmp .-670 ; 0x1f2e4 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){ 1f582: c5 01 movw r24, r10 1f584: b4 01 movw r22, r8 1f586: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f58a: 87 ff sbrs r24, 7 1f58c: a6 cf rjmp .-180 ; 0x1f4da if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f58e: 20 e0 ldi r18, 0x00 ; 0 1f590: 30 e0 ldi r19, 0x00 ; 0 1f592: a9 01 movw r20, r18 1f594: c7 01 movw r24, r14 1f596: b6 01 movw r22, r12 1f598: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 1f59c: 87 ff sbrs r24, 7 1f59e: 10 c0 rjmp .+32 ; 0x1f5c0 1f5a0: a7 01 movw r20, r14 1f5a2: 96 01 movw r18, r12 1f5a4: 6e 85 ldd r22, Y+14 ; 0x0e 1f5a6: 7d 85 ldd r23, Y+13 ; 0x0d 1f5a8: 83 2d mov r24, r3 1f5aa: 92 2d mov r25, r2 1f5ac: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 1f5b0: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f5b4: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f5b8: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f5bc: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=0; 1f5c0: 81 2c mov r8, r1 1f5c2: 91 2c mov r9, r1 1f5c4: 54 01 movw r10, r8 1f5c6: 89 cf rjmp .-238 ; 0x1f4da { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1f5c8: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1f5cc: 98 cf rjmp .-208 ; 0x1f4fe 0001f5ce : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1f5d2: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 1f5d6: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 1f5da: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c target_temperature_bed_isr = target_temperature_bed; 1f5de: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 1f5e2: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 1f5e6: 90 93 56 06 sts 0x0656, r25 ; 0x800656 1f5ea: 80 93 55 06 sts 0x0655, r24 ; 0x800655 } 1f5ee: 08 95 ret 0001f5f0 : /* 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() { 1f5f0: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f5f2: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f5f4: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1f5f6: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f5fa: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1f5fc: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f600: 8d 7f andi r24, 0xFD ; 253 1f602: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f606: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1f60c: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 1f610: a0 91 60 06 lds r26, 0x0660 ; 0x800660 1f614: b0 91 61 06 lds r27, 0x0661 ; 0x800661 1f618: 80 93 c4 0d sts 0x0DC4, r24 ; 0x800dc4 1f61c: 90 93 c5 0d sts 0x0DC5, r25 ; 0x800dc5 1f620: a0 93 c6 0d sts 0x0DC6, r26 ; 0x800dc6 1f624: b0 93 c7 0d sts 0x0DC7, r27 ; 0x800dc7 current_temperature_bed = current_temperature_bed_isr; 1f628: 80 91 57 06 lds r24, 0x0657 ; 0x800657 1f62c: 90 91 58 06 lds r25, 0x0658 ; 0x800658 1f630: a0 91 59 06 lds r26, 0x0659 ; 0x800659 1f634: b0 91 5a 06 lds r27, 0x065A ; 0x80065a 1f638: 80 93 8a 03 sts 0x038A, r24 ; 0x80038a 1f63c: 90 93 8b 03 sts 0x038B, r25 ; 0x80038b 1f640: a0 93 8c 03 sts 0x038C, r26 ; 0x80038c 1f644: b0 93 8d 03 sts 0x038D, r27 ; 0x80038d #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 1f648: 80 91 43 06 lds r24, 0x0643 ; 0x800643 1f64c: 90 91 44 06 lds r25, 0x0644 ; 0x800644 1f650: a0 91 45 06 lds r26, 0x0645 ; 0x800645 1f654: b0 91 46 06 lds r27, 0x0646 ; 0x800646 1f658: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e 1f65c: 90 93 8f 06 sts 0x068F, r25 ; 0x80068f 1f660: a0 93 90 06 sts 0x0690, r26 ; 0x800690 1f664: 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) { 1f668: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 1f66c: 81 11 cpse r24, r1 1f66e: 02 c0 rjmp .+4 ; 0x1f674 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 1f670: 0e 94 e7 fa call 0x1f5ce ; 0x1f5ce } temp_meas_ready = false; 1f674: 10 92 42 06 sts 0x0642, r1 ; 0x800642 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f678: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f67a: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 1f67c: cc 23 and r28, r28 1f67e: 29 f0 breq .+10 ; 0x1f68a 1f680: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f684: 82 60 ori r24, 0x02 ; 2 1f686: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f68a: 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; } 1f68c: cf 91 pop r28 1f68e: 08 95 ret 0001f690 : { // 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) 1f690: 81 30 cpi r24, 0x01 ; 1 1f692: 61 f1 breq .+88 ; 0x1f6ec 1f694: 20 f0 brcs .+8 ; 0x1f69e 1f696: 82 30 cpi r24, 0x02 ; 2 1f698: 09 f4 brne .+2 ; 0x1f69c 1f69a: 4b c0 rjmp .+150 ; 0x1f732 1f69c: 08 95 ret { case X_AXIS: { enable_x(); 1f69e: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 1f6a0: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f6a4: 81 e0 ldi r24, 0x01 ; 1 1f6a6: 29 2f mov r18, r25 1f6a8: 22 70 andi r18, 0x02 ; 2 1f6aa: 91 ff sbrs r25, 1 1f6ac: 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) { 1f6ae: 86 17 cp r24, r22 1f6b0: 59 f0 breq .+22 ; 0x1f6c8 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 1f6b2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6b6: 66 23 and r22, r22 1f6b8: a9 f0 breq .+42 ; 0x1f6e4 1f6ba: 82 60 ori r24, 0x02 ; 2 1f6bc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 1f6c0: 8b e8 ldi r24, 0x8B ; 139 1f6c2: 91 e0 ldi r25, 0x01 ; 1 1f6c4: 01 97 sbiw r24, 0x01 ; 1 1f6c6: f1 f7 brne .-4 ; 0x1f6c4 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 1f6c8: 40 9a sbi 0x08, 0 ; 8 1f6ca: 83 e0 ldi r24, 0x03 ; 3 1f6cc: 90 e0 ldi r25, 0x00 ; 0 1f6ce: 01 97 sbiw r24, 0x01 ; 1 1f6d0: f1 f7 brne .-4 ; 0x1f6ce #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 1f6d2: 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); 1f6d4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6d8: 22 23 and r18, r18 1f6da: 31 f0 breq .+12 ; 0x1f6e8 1f6dc: 82 60 ori r24, 0x02 ; 2 STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f6de: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 1f6e2: 08 95 ret uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 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); 1f6e4: 8d 7f andi r24, 0xFD ; 253 1f6e6: ea cf rjmp .-44 ; 0x1f6bc #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); 1f6e8: 8d 7f andi r24, 0xFD ; 253 1f6ea: f9 cf rjmp .-14 ; 0x1f6de } break; case Y_AXIS: { enable_y(); 1f6ec: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 1f6ee: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f6f2: 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) { 1f6f4: 86 17 cp r24, r22 1f6f6: 59 f0 breq .+22 ; 0x1f70e WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 1f6f8: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6fc: 66 23 and r22, r22 1f6fe: 99 f0 breq .+38 ; 0x1f726 1f700: 91 60 ori r25, 0x01 ; 1 1f702: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f706: eb e8 ldi r30, 0x8B ; 139 1f708: f1 e0 ldi r31, 0x01 ; 1 1f70a: 31 97 sbiw r30, 0x01 ; 1 1f70c: f1 f7 brne .-4 ; 0x1f70a delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 1f70e: 41 9a sbi 0x08, 1 ; 8 1f710: e3 e0 ldi r30, 0x03 ; 3 1f712: f0 e0 ldi r31, 0x00 ; 0 1f714: 31 97 sbiw r30, 0x01 ; 1 1f716: f1 f7 brne .-4 ; 0x1f714 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 1f718: 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); 1f71a: 88 23 and r24, r24 1f71c: 31 f0 breq .+12 ; 0x1f72a 1f71e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f722: 81 60 ori r24, 0x01 ; 1 1f724: dc cf rjmp .-72 ; 0x1f6de uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 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); 1f726: 9e 7f andi r25, 0xFE ; 254 1f728: ec cf rjmp .-40 ; 0x1f702 #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); 1f72a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f72e: 8e 7f andi r24, 0xFE ; 254 1f730: d6 cf rjmp .-84 ; 0x1f6de } break; case Z_AXIS: { enable_z(); 1f732: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 1f734: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f738: 81 e0 ldi r24, 0x01 ; 1 1f73a: 29 2f mov r18, r25 1f73c: 24 70 andi r18, 0x04 ; 4 1f73e: 92 ff sbrs r25, 2 1f740: 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) { 1f742: 68 17 cp r22, r24 1f744: 59 f0 breq .+22 ; 0x1f75c WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 1f746: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f74a: 66 23 and r22, r22 1f74c: b1 f0 breq .+44 ; 0x1f77a 1f74e: 94 60 ori r25, 0x04 ; 4 1f750: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f754: eb e8 ldi r30, 0x8B ; 139 1f756: f1 e0 ldi r31, 0x01 ; 1 1f758: 31 97 sbiw r30, 0x01 ; 1 1f75a: f1 f7 brne .-4 ; 0x1f758 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 1f75c: 42 9a sbi 0x08, 2 ; 8 1f75e: e3 e0 ldi r30, 0x03 ; 3 1f760: f0 e0 ldi r31, 0x00 ; 0 1f762: 31 97 sbiw r30, 0x01 ; 1 1f764: f1 f7 brne .-4 ; 0x1f762 #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_HI(Z2_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 1f766: 42 98 cbi 0x08, 2 ; 8 #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 1f768: 68 17 cp r22, r24 1f76a: 09 f4 brne .+2 ; 0x1f76e 1f76c: ba cf rjmp .-140 ; 0x1f6e2 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f76e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f772: 22 23 and r18, r18 1f774: 21 f0 breq .+8 ; 0x1f77e 1f776: 84 60 ori r24, 0x04 ; 4 1f778: b2 cf rjmp .-156 ; 0x1f6de uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 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); 1f77a: 9b 7f andi r25, 0xFB ; 251 1f77c: e9 cf rjmp .-46 ; 0x1f750 STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f77e: 8b 7f andi r24, 0xFB ; 251 1f780: ae cf rjmp .-164 ; 0x1f6de 0001f782 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 1f782: 80 91 04 05 lds r24, 0x0504 ; 0x800504 1f786: 81 11 cpse r24, r1 1f788: 25 c0 rjmp .+74 ; 0x1f7d4 if((M_UCSRxA & (1< 1f78e: 87 ff sbrs r24, 7 1f790: 3d c0 rjmp .+122 ; 0x1f80c // Test for a framing error. if (M_UCSRxA & (1< 1f796: 84 ff sbrs r24, 4 1f798: 03 c0 rjmp .+6 ; 0x1f7a0 // 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); 1f79a: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 1f79e: 08 95 ret } else { unsigned char c = M_UDRx; 1f7a0: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f7a4: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f7a8: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f7ac: c9 01 movw r24, r18 1f7ae: 01 96 adiw r24, 0x01 ; 1 1f7b0: 8f 77 andi r24, 0x7F ; 127 1f7b2: 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) { 1f7b4: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f7b8: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f7bc: 86 17 cp r24, r22 1f7be: 97 07 cpc r25, r23 1f7c0: 29 f1 breq .+74 ; 0x1f80c // 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; 1f7c2: 21 5d subi r18, 0xD1 ; 209 1f7c4: 3a 4f sbci r19, 0xFA ; 250 1f7c6: f9 01 movw r30, r18 1f7c8: 40 83 st Z, r20 rx_buffer.head = i; 1f7ca: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 1f7ce: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 1f7d2: 1c c0 rjmp .+56 ; 0x1f80c UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 1f7d8: 87 ff sbrs r24, 7 1f7da: 18 c0 rjmp .+48 ; 0x1f80c // Test for a framing error. if (UCSR1A & (1< 1f7e0: 84 ff sbrs r24, 4 1f7e2: 03 c0 rjmp .+6 ; 0x1f7ea // 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); 1f7e4: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 1f7e8: 08 95 ret } else { unsigned char c = UDR1; 1f7ea: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f7ee: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f7f2: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f7f6: c9 01 movw r24, r18 1f7f8: 01 96 adiw r24, 0x01 ; 1 1f7fa: 8f 77 andi r24, 0x7F ; 127 1f7fc: 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) { 1f7fe: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f802: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f806: 68 17 cp r22, r24 1f808: 79 07 cpc r23, r25 1f80a: d9 f6 brne .-74 ; 0x1f7c2 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 1f80c: 08 95 ret 0001f80e : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 1f80e: 23 e0 ldi r18, 0x03 ; 3 1f810: 81 11 cpse r24, r1 1f812: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 1f826: 94 60 ori r25, 0x04 ; 4 1f828: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f82c: 3f bf out 0x3f, r19 ; 63 1f82e: fb 01 movw r30, r22 1f830: 31 97 sbiw r30, 0x01 ; 1 1f832: f1 f7 brne .-4 ; 0x1f830 delayMicroseconds(200); WRITE(BEEPER,LOW); 1f834: 3f b7 in r19, 0x3f ; 63 1f836: f8 94 cli 1f838: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f83c: 9b 7f andi r25, 0xFB ; 251 1f83e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f842: 3f bf out 0x3f, r19 ; 63 1f844: fa 01 movw r30, r20 1f846: 31 97 sbiw r30, 0x01 ; 1 1f848: f1 f7 brne .-4 ; 0x1f846 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); } } 1f850: 08 95 ret 0001f852 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 1f852: 8a e0 ldi r24, 0x0A ; 10 1f854: 2b e8 ldi r18, 0x8B ; 139 1f856: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 1f858: 4f b7 in r20, 0x3f ; 63 1f85a: f8 94 cli 1f85c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f860: 94 60 ori r25, 0x04 ; 4 1f862: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f866: 4f bf out 0x3f, r20 ; 63 1f868: f9 01 movw r30, r18 1f86a: 31 97 sbiw r30, 0x01 ; 1 1f86c: f1 f7 brne .-4 ; 0x1f86a delayMicroseconds(100); WRITE(BEEPER,LOW); 1f86e: 4f b7 in r20, 0x3f ; 63 1f870: f8 94 cli 1f872: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f876: 9b 7f andi r25, 0xFB ; 251 1f878: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f87c: 4f bf out 0x3f, r20 ; 63 1f87e: f9 01 movw r30, r18 1f880: 31 97 sbiw r30, 0x01 ; 1 1f882: f1 f7 brne .-4 ; 0x1f880 1f884: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 1f886: 41 f7 brne .-48 ; 0x1f858 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 1f888: 08 95 ret 0001f88a : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f88a: 0f 94 1c 94 call 0x32838 ; 0x32838 1f88e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1f892: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f896: 84 30 cpi r24, 0x04 ; 4 1f898: d8 f5 brcc .+118 ; 0x1f910 1f89a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1f89e: 8f ee ldi r24, 0xEF ; 239 1f8a0: 9a e3 ldi r25, 0x3A ; 58 1f8a2: 0e 94 32 6d call 0xda64 ; 0xda64 1f8a6: 0f 94 e7 96 call 0x32dce ; 0x32dce settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1f8aa: 8a e4 ldi r24, 0x4A ; 74 1f8ac: 96 e5 ldi r25, 0x56 ; 86 1f8ae: 0e 94 32 6d call 0xda64 ; 0xda64 1f8b2: 47 ea ldi r20, 0xA7 ; 167 1f8b4: 5c ef ldi r21, 0xFC ; 252 1f8b6: bc 01 movw r22, r24 1f8b8: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1f8bc: 0e 94 e0 e1 call 0x1c3c0 ; 0x1c3c0 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1f8c0: 82 e4 ldi r24, 0x42 ; 66 1f8c2: 96 e5 ldi r25, 0x56 ; 86 1f8c4: 0e 94 32 6d call 0xda64 ; 0xda64 1f8c8: 4d e9 ldi r20, 0x9D ; 157 1f8ca: 5c ef ldi r21, 0xFC ; 252 1f8cc: bc 01 movw r22, r24 1f8ce: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 1f8d2: 0e 94 e0 e1 call 0x1c3c0 ; 0x1c3c0 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1f8d6: 43 e9 ldi r20, 0x93 ; 147 1f8d8: 5c ef ldi r21, 0xFC ; 252 1f8da: 62 e0 ldi r22, 0x02 ; 2 1f8dc: 7c e6 ldi r23, 0x6C ; 108 1f8de: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1f8e2: 0e 94 e0 e1 call 0x1c3c0 ; 0x1c3c0 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1f8e6: 49 e8 ldi r20, 0x89 ; 137 1f8e8: 5c ef ldi r21, 0xFC ; 252 1f8ea: 68 ed ldi r22, 0xD8 ; 216 1f8ec: 79 e6 ldi r23, 0x69 ; 105 1f8ee: 80 91 bc 03 lds r24, 0x03BC ; 0x8003bc 1f8f2: 0e 94 e0 e1 call 0x1c3c0 ; 0x1c3c0 MENU_END(); 1f8f6: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f8fa: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f8fe: 8f 5f subi r24, 0xFF ; 255 1f900: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1f904: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1f908: 8f 5f subi r24, 0xFF ; 255 1f90a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1f90e: c1 cf rjmp .-126 ; 0x1f892 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(); } 1f910: 08 95 ret 0001f912 : 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); 1f912: 8c eb ldi r24, 0xBC ; 188 1f914: 93 e0 ldi r25, 0x03 ; 3 1f916: 0e 94 ba f7 call 0x1ef74 ; 0x1ef74 1f91a: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1f91e: 80 e2 ldi r24, 0x20 ; 32 1f920: 9c e0 ldi r25, 0x0C ; 12 1f922: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f926 : 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); 1f926: 87 eb ldi r24, 0xB7 ; 183 1f928: 93 e0 ldi r25, 0x03 ; 3 1f92a: 0e 94 ba f7 call 0x1ef74 ; 0x1ef74 1f92e: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 1f932: 83 ea ldi r24, 0xA3 ; 163 1f934: 9d e0 ldi r25, 0x0D ; 13 1f936: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f93a : 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); 1f93a: 88 eb ldi r24, 0xB8 ; 184 1f93c: 93 e0 ldi r25, 0x03 ; 3 1f93e: 0e 94 ba f7 call 0x1ef74 ; 0x1ef74 1f942: 60 91 b8 03 lds r22, 0x03B8 ; 0x8003b8 1f946: 84 ea ldi r24, 0xA4 ; 164 1f948: 9d e0 ldi r25, 0x0D ; 13 1f94a: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f94e : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 1f94e: 8b eb ldi r24, 0xBB ; 187 1f950: 93 e0 ldi r25, 0x03 ; 3 1f952: 0e 94 ba f7 call 0x1ef74 ; 0x1ef74 1f956: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 1f95a: 88 ea ldi r24, 0xA8 ; 168 1f95c: 9d e0 ldi r25, 0x0D ; 13 1f95e: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f962 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1f962: 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; 1f966: 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) { 1f968: 81 11 cpse r24, r1 1f96a: 01 c0 rjmp .+2 ; 0x1f96e case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 1f96c: 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; 1f96e: 60 93 8c 16 sts 0x168C, r22 ; 0x80168c 1f972: 87 e4 ldi r24, 0x47 ; 71 1f974: 9d e0 ldi r25, 0x0D ; 13 1f976: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f97a : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 1f97a: e4 e8 ldi r30, 0x84 ; 132 1f97c: f6 e1 ldi r31, 0x16 ; 22 1f97e: 61 81 ldd r22, Z+1 ; 0x01 1f980: 81 e0 ldi r24, 0x01 ; 1 1f982: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1f984: 61 83 std Z+1, r22 ; 0x01 1f986: 87 e0 ldi r24, 0x07 ; 7 1f988: 9f e0 ldi r25, 0x0F ; 15 1f98a: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f98e : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 1f98e: e4 e8 ldi r30, 0x84 ; 132 1f990: f6 e1 ldi r31, 0x16 ; 22 1f992: 62 81 ldd r22, Z+2 ; 0x02 1f994: 81 e0 ldi r24, 0x01 ; 1 1f996: 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; 1f998: 62 83 std Z+2, r22 ; 0x02 1f99a: 85 ed ldi r24, 0xD5 ; 213 1f99c: 9e e0 ldi r25, 0x0E ; 14 1f99e: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f9a2 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 1f9a2: eb ed ldi r30, 0xDB ; 219 1f9a4: f5 e1 ldi r31, 0x15 ; 21 1f9a6: 60 81 ld r22, Z 1f9a8: 81 e0 ldi r24, 0x01 ; 1 1f9aa: 68 27 eor r22, r24 1f9ac: 60 83 st Z, r22 1f9ae: 8b eb ldi r24, 0xBB ; 187 1f9b0: 9f e0 ldi r25, 0x0F ; 15 1f9b2: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001f9b6 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 1f9b6: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1f9ba: 81 30 cpi r24, 0x01 ; 1 1f9bc: 71 f0 breq .+28 ; 0x1f9da 1f9be: 20 f0 brcs .+8 ; 0x1f9c8 1f9c0: 82 30 cpi r24, 0x02 ; 2 1f9c2: 69 f4 brne .+26 ; 0x1f9de break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1f9c4: 83 e0 ldi r24, 0x03 ; 3 1f9c6: 01 c0 rjmp .+2 ; 0x1f9ca void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1f9c8: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1f9ca: 80 93 15 04 sts 0x0415, r24 ; 0x800415 1f9ce: 60 91 15 04 lds r22, 0x0415 ; 0x800415 1f9d2: 87 ed ldi r24, 0xD7 ; 215 1f9d4: 9e e0 ldi r25, 0x0E ; 14 1f9d6: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 1f9da: 82 e0 ldi r24, 0x02 ; 2 1f9dc: f6 cf rjmp .-20 ; 0x1f9ca break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1f9de: 10 92 15 04 sts 0x0415, r1 ; 0x800415 1f9e2: f5 cf rjmp .-22 ; 0x1f9ce 0001f9e4 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 1f9e4: 60 91 40 02 lds r22, 0x0240 ; 0x800240 1f9e8: 81 e0 ldi r24, 0x01 ; 1 1f9ea: 68 27 eor r22, r24 1f9ec: 60 93 40 02 sts 0x0240, r22 ; 0x800240 1f9f0: 87 e8 ldi r24, 0x87 ; 135 1f9f2: 9f e0 ldi r25, 0x0F ; 15 1f9f4: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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. 1f9f8: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1f9fc: 81 11 cpse r24, r1 1f9fe: 02 c0 rjmp .+4 ; 0x1fa04 1fa00: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c #endif //FANCHECK } 1fa04: 08 95 ret 0001fa06 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1fa06: cf 93 push r28 1fa08: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1fa0a: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 1fa0e: 8c 33 cpi r24, 0x3C ; 60 1fa10: e1 f0 breq .+56 ; 0x1fa4a 1fa12: 80 35 cpi r24, 0x50 ; 80 1fa14: 01 f1 breq .+64 ; 0x1fa56 1fa16: 88 32 cpi r24, 0x28 ; 40 1fa18: 91 f0 breq .+36 ; 0x1fa3e case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1fa1a: 88 e2 ldi r24, 0x28 ; 40 1fa1c: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=400; 1fa20: c0 e9 ldi r28, 0x90 ; 144 1fa22: d1 e0 ldi r29, 0x01 ; 1 1fa24: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 1fa28: 87 ea ldi r24, 0xA7 ; 167 1fa2a: 9d e0 ldi r25, 0x0D ; 13 1fa2c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1fa30: be 01 movw r22, r28 1fa32: 85 ea ldi r24, 0xA5 ; 165 1fa34: 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); } 1fa36: df 91 pop r29 1fa38: cf 91 pop r28 1fa3a: 0d 94 7e a1 jmp 0x342fc ; 0x342fc case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1fa3e: 8c e3 ldi r24, 0x3C ; 60 1fa40: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=600; 1fa44: c8 e5 ldi r28, 0x58 ; 88 1fa46: d2 e0 ldi r29, 0x02 ; 2 1fa48: ed cf rjmp .-38 ; 0x1fa24 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1fa4a: 80 e5 ldi r24, 0x50 ; 80 1fa4c: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=800; 1fa50: c0 e2 ldi r28, 0x20 ; 32 1fa52: d3 e0 ldi r29, 0x03 ; 3 1fa54: e7 cf rjmp .-50 ; 0x1fa24 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1fa56: 89 e1 ldi r24, 0x19 ; 25 1fa58: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=250; 1fa5c: ca ef ldi r28, 0xFA ; 250 1fa5e: d0 e0 ldi r29, 0x00 ; 0 1fa60: e1 cf rjmp .-62 ; 0x1fa24 0001fa62 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1fa62: cf 93 push r28 1fa64: df 93 push r29 MENU_BEGIN(); 1fa66: 0f 94 1c 94 call 0x32838 ; 0x32838 1fa6a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fa6e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fa72: 84 30 cpi r24, 0x04 ; 4 1fa74: 08 f0 brcs .+2 ; 0x1fa78 1fa76: 96 c0 rjmp .+300 ; 0x1fba4 1fa78: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1fa7c: 86 e7 ldi r24, 0x76 ; 118 1fa7e: 90 e4 ldi r25, 0x40 ; 64 1fa80: 0e 94 32 6d call 0xda64 ; 0xda64 1fa84: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1fa88: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1fa8c: 88 23 and r24, r24 1fa8e: f1 f1 breq .+124 ; 0x1fb0c 1fa90: 81 e7 ldi r24, 0x71 ; 113 1fa92: 9b e5 ldi r25, 0x5B ; 91 1fa94: 0e 94 32 6d call 0xda64 ; 0xda64 1fa98: ec 01 movw r28, r24 1fa9a: 8e e9 ldi r24, 0x9E ; 158 1fa9c: 9d e3 ldi r25, 0x3D ; 61 1fa9e: 0e 94 32 6d call 0xda64 ; 0xda64 1faa2: 22 e0 ldi r18, 0x02 ; 2 1faa4: 46 e3 ldi r20, 0x36 ; 54 1faa6: 5e ef ldi r21, 0xFE ; 254 1faa8: be 01 movw r22, r28 1faaa: 0f 94 ab 95 call 0x32b56 ; 0x32b56 1faae: 80 91 84 16 lds r24, 0x1684 ; 0x801684 if (fsensor.isEnabled()) { 1fab2: 88 23 and r24, r24 1fab4: 09 f4 brne .+2 ; 0x1fab8 1fab6: 66 c0 rjmp .+204 ; 0x1fb84 if (fsensor.isError()) { 1fab8: 83 30 cpi r24, 0x03 ; 3 1faba: 59 f5 brne .+86 ; 0x1fb12 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1fabc: 8d ed ldi r24, 0xDD ; 221 1fabe: 9d e3 ldi r25, 0x3D ; 61 1fac0: 0e 94 32 6d call 0xda64 ; 0xda64 1fac4: ec 01 movw r28, r24 1fac6: 8e e0 ldi r24, 0x0E ; 14 1fac8: 96 e5 ldi r25, 0x56 ; 86 1faca: 0e 94 32 6d call 0xda64 ; 0xda64 1face: 22 e0 ldi r18, 0x02 ; 2 1fad0: 4d e3 ldi r20, 0x3D ; 61 1fad2: 5e ef ldi r21, 0xFE ; 254 1fad4: be 01 movw r22, r28 1fad6: 0f 94 ab 95 call 0x32b56 ; 0x32b56 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1fada: 8d ed ldi r24, 0xDD ; 221 1fadc: 9d e3 ldi r25, 0x3D ; 61 1fade: 0e 94 32 6d call 0xda64 ; 0xda64 1fae2: ec 01 movw r28, r24 1fae4: 80 e0 ldi r24, 0x00 ; 0 1fae6: 96 e5 ldi r25, 0x56 ; 86 1fae8: 0e 94 32 6d call 0xda64 ; 0xda64 1faec: 22 e0 ldi r18, 0x02 ; 2 1faee: 4d e3 ldi r20, 0x3D ; 61 1faf0: 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); 1faf2: be 01 movw r22, r28 1faf4: 0f 94 ab 95 call 0x32b56 ; 0x32b56 #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()) { 1faf8: 80 91 8c 16 lds r24, 0x168C ; 0x80168c 1fafc: 88 23 and r24, r24 1fafe: 99 f1 breq .+102 ; 0x1fb66 1fb00: 81 30 cpi r24, 0x01 ; 1 1fb02: 09 f4 brne .+2 ; 0x1fb06 1fb04: 4c c0 rjmp .+152 ; 0x1fb9e 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(); 1fb06: 0e 94 b1 fc call 0x1f962 ; 0x1f962 1fb0a: 3c c0 rjmp .+120 ; 0x1fb84 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); 1fb0c: 8b e6 ldi r24, 0x6B ; 107 1fb0e: 9b e5 ldi r25, 0x5B ; 91 1fb10: c1 cf rjmp .-126 ; 0x1fa94 #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); 1fb12: 80 91 86 16 lds r24, 0x1686 ; 0x801686 1fb16: 88 23 and r24, r24 1fb18: 01 f1 breq .+64 ; 0x1fb5a 1fb1a: 81 e7 ldi r24, 0x71 ; 113 1fb1c: 9b e5 ldi r25, 0x5B ; 91 1fb1e: 0e 94 32 6d call 0xda64 ; 0xda64 1fb22: ec 01 movw r28, r24 1fb24: 8e e0 ldi r24, 0x0E ; 14 1fb26: 96 e5 ldi r25, 0x56 ; 86 1fb28: 0e 94 32 6d call 0xda64 ; 0xda64 1fb2c: 22 e0 ldi r18, 0x02 ; 2 1fb2e: 47 ec ldi r20, 0xC7 ; 199 1fb30: 5c ef ldi r21, 0xFC ; 252 1fb32: be 01 movw r22, r28 1fb34: 0f 94 ab 95 call 0x32b56 ; 0x32b56 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fb38: 80 91 85 16 lds r24, 0x1685 ; 0x801685 1fb3c: 88 23 and r24, r24 1fb3e: 81 f0 breq .+32 ; 0x1fb60 1fb40: 81 e7 ldi r24, 0x71 ; 113 1fb42: 9b e5 ldi r25, 0x5B ; 91 1fb44: 0e 94 32 6d call 0xda64 ; 0xda64 1fb48: ec 01 movw r28, r24 1fb4a: 80 e0 ldi r24, 0x00 ; 0 1fb4c: 96 e5 ldi r25, 0x56 ; 86 1fb4e: 0e 94 32 6d call 0xda64 ; 0xda64 1fb52: 22 e0 ldi r18, 0x02 ; 2 1fb54: 4d eb ldi r20, 0xBD ; 189 1fb56: 5c ef ldi r21, 0xFC ; 252 1fb58: cc cf rjmp .-104 ; 0x1faf2 #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); 1fb5a: 8b e6 ldi r24, 0x6B ; 107 1fb5c: 9b e5 ldi r25, 0x5B ; 91 1fb5e: df cf rjmp .-66 ; 0x1fb1e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fb60: 8b e6 ldi r24, 0x6B ; 107 1fb62: 9b e5 ldi r25, 0x5B ; 91 1fb64: ef cf rjmp .-34 ; 0x1fb44 #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); 1fb66: 88 ef ldi r24, 0xF8 ; 248 1fb68: 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); 1fb6a: 0e 94 32 6d call 0xda64 ; 0xda64 1fb6e: ec 01 movw r28, r24 1fb70: 8c ee ldi r24, 0xEC ; 236 1fb72: 95 e5 ldi r25, 0x55 ; 85 1fb74: 0e 94 32 6d call 0xda64 ; 0xda64 1fb78: 22 e0 ldi r18, 0x02 ; 2 1fb7a: 41 eb ldi r20, 0xB1 ; 177 1fb7c: 5c ef ldi r21, 0xFC ; 252 1fb7e: be 01 movw r22, r28 1fb80: 0f 94 ab 95 call 0x32b56 ; 0x32b56 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1fb84: 0f 94 f0 93 call 0x327e0 ; 0x327e0 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1fb88: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fb8c: 8f 5f subi r24, 0xFF ; 255 1fb8e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fb92: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fb96: 8f 5f subi r24, 0xFF ; 255 1fb98: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fb9c: 68 cf rjmp .-304 ; 0x1fa6e 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); 1fb9e: 84 ee ldi r24, 0xE4 ; 228 1fba0: 95 e5 ldi r25, 0x55 ; 85 1fba2: e3 cf rjmp .-58 ; 0x1fb6a lcd_fsensor_actionNA_set(); } } MENU_END(); } 1fba4: df 91 pop r29 1fba6: cf 91 pop r28 1fba8: 08 95 ret 0001fbaa : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 1fbaa: 86 ed ldi r24, 0xD6 ; 214 1fbac: 9e e0 ldi r25, 0x0E ; 14 1fbae: 0f 94 3c a1 call 0x34278 ; 0x34278 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fbb2: 61 e0 ldi r22, 0x01 ; 1 1fbb4: 82 30 cpi r24, 0x02 ; 2 1fbb6: 09 f0 breq .+2 ; 0x1fbba 1fbb8: 62 e0 ldi r22, 0x02 ; 2 1fbba: 86 ed ldi r24, 0xD6 ; 214 1fbbc: 9e e0 ldi r25, 0x0E ; 14 1fbbe: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001fbc2 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 1fbc2: 8e ec ldi r24, 0xCE ; 206 1fbc4: 9e e0 ldi r25, 0x0E ; 14 1fbc6: 0f 94 3c a1 call 0x34278 ; 0x34278 1fbca: 60 e0 ldi r22, 0x00 ; 0 1fbcc: 81 30 cpi r24, 0x01 ; 1 1fbce: 09 f0 breq .+2 ; 0x1fbd2 1fbd0: 61 e0 ldi r22, 0x01 ; 1 1fbd2: 8e ec ldi r24, 0xCE ; 206 1fbd4: 9e e0 ldi r25, 0x0E ; 14 1fbd6: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001fbda : 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); 1fbda: 8f ea ldi r24, 0xAF ; 175 1fbdc: 9f e0 ldi r25, 0x0F ; 15 1fbde: 0f 94 3c a1 call 0x34278 ; 0x34278 temp_cal_active = !temp_cal_active; 1fbe2: 61 e0 ldi r22, 0x01 ; 1 1fbe4: 81 11 cpse r24, r1 1fbe6: 60 e0 ldi r22, 0x00 ; 0 1fbe8: 8f ea ldi r24, 0xAF ; 175 1fbea: 9f e0 ldi r25, 0x0F ; 15 1fbec: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 0001fbf0 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1fbf0: 89 e0 ldi r24, 0x09 ; 9 1fbf2: 9f e0 ldi r25, 0x0F ; 15 1fbf4: 0f 94 3c a1 call 0x34278 ; 0x34278 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1fbf8: 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) { 1fbfa: 88 23 and r24, r24 1fbfc: 21 f0 breq .+8 ; 0x1fc06 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1fbfe: 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) { 1fc00: 81 30 cpi r24, 0x01 ; 1 1fc02: 09 f0 breq .+2 ; 0x1fc06 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1fc04: 60 e0 ldi r22, 0x00 ; 0 1fc06: 89 e0 ldi r24, 0x09 ; 9 1fc08: 9f e0 ldi r25, 0x0F ; 15 1fc0a: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1fc0e: 81 e0 ldi r24, 0x01 ; 1 1fc10: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } 1fc14: 08 95 ret 0001fc16 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 1fc16: 87 ea ldi r24, 0xA7 ; 167 1fc18: 9c e0 ldi r25, 0x0C ; 12 1fc1a: 0f 94 3c a1 call 0x34278 ; 0x34278 if (eeprom_setting != 0) 1fc1e: 81 11 cpse r24, r1 1fc20: 05 c0 rjmp .+10 ; 0x1fc2c return false; switch(eFilamentAction) { 1fc22: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1fc26: 81 50 subi r24, 0x01 ; 1 1fc28: 88 30 cpi r24, 0x08 ; 8 1fc2a: 10 f0 brcs .+4 ; 0x1fc30 #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; 1fc2c: 80 e0 ldi r24, 0x00 ; 0 1fc2e: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 1fc30: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 1fc32: 08 95 ret 0001fc34 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1fc34: 8c ea ldi r24, 0xAC ; 172 1fc36: 9c e0 ldi r25, 0x0C ; 12 1fc38: 0f 94 3c a1 call 0x34278 ; 0x34278 if (current_state) 1fc3c: 88 23 and r24, r24 1fc3e: 99 f0 breq .+38 ; 0x1fc66 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1fc40: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1fc44: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 1fc48: 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)); 1fc4c: 8c ea ldi r24, 0xAC ; 172 1fc4e: 9c e0 ldi r25, 0x0C ; 12 1fc50: 0f 94 3c a1 call 0x34278 ; 0x34278 1fc54: 61 e0 ldi r22, 0x01 ; 1 1fc56: 81 11 cpse r24, r1 1fc58: 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); 1fc5a: 8c ea ldi r24, 0xAC ; 172 1fc5c: 9c e0 ldi r25, 0x0C ; 12 1fc5e: 0f 94 84 a1 call 0x34308 ; 0x34308 { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 1fc62: 0d 94 ee 41 jmp 0x283dc ; 0x283dc { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1fc66: 0f 94 fa 63 call 0x2c7f4 ; 0x2c7f4 1fc6a: f0 cf rjmp .-32 ; 0x1fc4c 0001fc6c : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1fc6c: 81 e0 ldi r24, 0x01 ; 1 1fc6e: 90 91 84 16 lds r25, 0x1684 ; 0x801684 1fc72: 91 11 cpse r25, r1 1fc74: 80 e0 ldi r24, 0x00 ; 0 1fc76: 0c 94 a1 6e jmp 0xdd42 ; 0xdd42 0001fc7a : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1fc7a: 0d 94 9b 53 jmp 0x2a736 ; 0x2a736 0001fc7e : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1fc7e: 0e 94 a8 6a call 0xd550 ; 0xd550 lcd_status_message_idx = 0; // Re-draw message from beginning 1fc82: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 1fc86: 20 e0 ldi r18, 0x00 ; 0 1fc88: 41 e0 ldi r20, 0x01 ; 1 1fc8a: 70 e0 ldi r23, 0x00 ; 0 1fc8c: 60 e0 ldi r22, 0x00 ; 0 1fc8e: 89 e0 ldi r24, 0x09 ; 9 1fc90: 97 e3 ldi r25, 0x37 ; 55 1fc92: 0f 94 46 94 call 0x3288c ; 0x3288c menu_depth = 0; 1fc96: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 1fc9a: 10 92 62 03 sts 0x0362, r1 ; 0x800362 } 1fc9e: 08 95 ret 0001fca0 : } } #if (LANG_MODE != 0) void lcd_language() { 1fca0: cf 93 push r28 1fca2: df 93 push r29 lcd_update_enable(true); 1fca4: 81 e0 ldi r24, 0x01 ; 1 1fca6: 0e 94 41 6a call 0xd482 ; 0xd482 menu_goto(lcd_language_menu, 0, true, true); 1fcaa: 21 e0 ldi r18, 0x01 ; 1 1fcac: 41 e0 ldi r20, 0x01 ; 1 1fcae: 70 e0 ldi r23, 0x00 ; 0 1fcb0: 60 e0 ldi r22, 0x00 ; 0 1fcb2: 81 ee ldi r24, 0xE1 ; 225 1fcb4: 97 e3 ldi r25, 0x37 ; 55 1fcb6: 0f 94 46 94 call 0x3288c ; 0x3288c 1fcba: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1fcbe: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 1fcc2: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 1fcc6: 0e 94 26 6c call 0xd84c ; 0xd84c 1fcca: c9 50 subi r28, 0x09 ; 9 1fccc: d7 43 sbci r29, 0x37 ; 55 1fcce: 39 f0 breq .+14 ; 0x1fcde 1fcd0: 81 11 cpse r24, r1 1fcd2: 07 c0 rjmp .+14 ; 0x1fce2 { delay_keep_alive(50); 1fcd4: 82 e3 ldi r24, 0x32 ; 50 1fcd6: 90 e0 ldi r25, 0x00 ; 0 1fcd8: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 1fcdc: f0 cf rjmp .-32 ; 0x1fcbe } if (lang_is_selected()) 1fcde: 88 23 and r24, r24 1fce0: 21 f0 breq .+8 ; 0x1fcea lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1fce2: df 91 pop r29 1fce4: 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(); 1fce6: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e else lang_select(LANG_ID_PRI); 1fcea: 80 e0 ldi r24, 0x00 ; 0 } 1fcec: df 91 pop r29 1fcee: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1fcf0: 0c 94 c6 6c jmp 0xd98c ; 0xd98c 0001fcf4 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 1fcf4: 61 e0 ldi r22, 0x01 ; 1 1fcf6: 8d e1 ldi r24, 0x1D ; 29 1fcf8: 99 e9 ldi r25, 0x99 ; 153 1fcfa: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 1fcfe: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 0001fd02 : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 1fd02: 61 e0 ldi r22, 0x01 ; 1 1fd04: 87 e1 ldi r24, 0x17 ; 23 1fd06: 99 e9 ldi r25, 0x99 ; 153 1fd08: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 1fd0c: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 0001fd10 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 1fd10: 61 e0 ldi r22, 0x01 ; 1 1fd12: 83 e1 ldi r24, 0x13 ; 19 1fd14: 99 e9 ldi r25, 0x99 ; 153 1fd16: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 1fd1a: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 0001fd1e : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 1fd1e: 61 e0 ldi r22, 0x01 ; 1 1fd20: 8f e0 ldi r24, 0x0F ; 15 1fd22: 99 e9 ldi r25, 0x99 ; 153 1fd24: 0e 94 37 7d call 0xfa6e ; 0xfa6e lcd_return_to_status(); 1fd28: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 0001fd2c : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fd2c: 0f 94 1c 94 call 0x32838 ; 0x32838 1fd30: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fd34: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd38: 84 30 cpi r24, 0x04 ; 4 1fd3a: a8 f5 brcc .+106 ; 0x1fda6 1fd3c: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1fd40: 88 ef ldi r24, 0xF8 ; 248 1fd42: 9d e3 ldi r25, 0x3D ; 61 1fd44: 0e 94 32 6d call 0xda64 ; 0xda64 1fd48: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1fd4c: 82 e4 ldi r24, 0x42 ; 66 1fd4e: 9e e4 ldi r25, 0x4E ; 78 1fd50: 0e 94 32 6d call 0xda64 ; 0xda64 1fd54: 69 e7 ldi r22, 0x79 ; 121 1fd56: 77 e3 ldi r23, 0x37 ; 55 1fd58: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1fd5c: 89 e3 ldi r24, 0x39 ; 57 1fd5e: 9e e4 ldi r25, 0x4E ; 78 1fd60: 0e 94 32 6d call 0xda64 ; 0xda64 1fd64: 6d e0 ldi r22, 0x0D ; 13 1fd66: 77 e3 ldi r23, 0x37 ; 55 1fd68: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1fd6c: 80 e3 ldi r24, 0x30 ; 48 1fd6e: 9e e4 ldi r25, 0x4E ; 78 1fd70: 0e 94 32 6d call 0xda64 ; 0xda64 1fd74: 67 e2 ldi r22, 0x27 ; 39 1fd76: 77 e3 ldi r23, 0x37 ; 55 1fd78: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1fd7c: 85 e2 ldi r24, 0x25 ; 37 1fd7e: 9e e4 ldi r25, 0x4E ; 78 1fd80: 0e 94 32 6d call 0xda64 ; 0xda64 1fd84: 61 ec ldi r22, 0xC1 ; 193 1fd86: 78 e3 ldi r23, 0x38 ; 56 1fd88: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_END(); 1fd8c: 0f 94 f0 93 call 0x327e0 ; 0x327e0 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fd90: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd94: 8f 5f subi r24, 0xFF ; 255 1fd96: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fd9a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fd9e: 8f 5f subi r24, 0xFF ; 255 1fda0: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fda4: c7 cf rjmp .-114 ; 0x1fd34 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(); } 1fda6: 08 95 ret 0001fda8 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fda8: 0f 94 1c 94 call 0x32838 ; 0x32838 1fdac: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fdb0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fdb4: 84 30 cpi r24, 0x04 ; 4 1fdb6: 68 f5 brcc .+90 ; 0x1fe12 1fdb8: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1fdbc: 8a e5 ldi r24, 0x5A ; 90 1fdbe: 9e e3 ldi r25, 0x3E ; 62 1fdc0: 0e 94 32 6d call 0xda64 ; 0xda64 1fdc4: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 1fdc8: 82 e8 ldi r24, 0x82 ; 130 1fdca: 99 e4 ldi r25, 0x49 ; 73 1fdcc: 0e 94 32 6d call 0xda64 ; 0xda64 1fdd0: 6b ef ldi r22, 0xFB ; 251 1fdd2: 76 e3 ldi r23, 0x36 ; 54 1fdd4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 1fdd8: 8a e7 ldi r24, 0x7A ; 122 1fdda: 99 e4 ldi r25, 0x49 ; 73 1fddc: 0e 94 32 6d call 0xda64 ; 0xda64 1fde0: 61 e1 ldi r22, 0x11 ; 17 1fde2: 78 e3 ldi r23, 0x38 ; 56 1fde4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 1fde8: 8e eb ldi r24, 0xBE ; 190 1fdea: 99 e4 ldi r25, 0x49 ; 73 1fdec: 0e 94 32 6d call 0xda64 ; 0xda64 1fdf0: 61 e6 ldi r22, 0x61 ; 97 1fdf2: 78 e3 ldi r23, 0x38 ; 56 1fdf4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_END(); 1fdf8: 0f 94 f0 93 call 0x327e0 ; 0x327e0 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fdfc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fe00: 8f 5f subi r24, 0xFF ; 255 1fe02: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fe06: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fe0a: 8f 5f subi r24, 0xFF ; 255 1fe0c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fe10: cf cf rjmp .-98 ; 0x1fdb0 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(); } 1fe12: 08 95 ret 0001fe14 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 1fe14: ef 92 push r14 1fe16: ff 92 push r15 1fe18: 0f 93 push r16 1fe1a: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 1fe1c: 80 91 71 03 lds r24, 0x0371 ; 0x800371 1fe20: 81 11 cpse r24, r1 1fe22: 35 c0 rjmp .+106 ; 0x1fe8e { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 1fe24: 80 ec ldi r24, 0xC0 ; 192 1fe26: 9f e0 ldi r25, 0x0F ; 15 1fe28: 0f 94 3c a1 call 0x34278 ; 0x34278 1fe2c: 81 30 cpi r24, 0x01 ; 1 1fe2e: 61 f5 brne .+88 ; 0x1fe88 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 1fe30: 8f eb ldi r24, 0xBF ; 191 1fe32: 9f e0 ldi r25, 0x0F ; 15 1fe34: 0f 94 3c a1 call 0x34278 ; 0x34278 1fe38: 08 2e mov r0, r24 1fe3a: 00 0c add r0, r0 1fe3c: 99 0b sbc r25, r25 1fe3e: 90 93 73 03 sts 0x0373, r25 ; 0x800373 1fe42: 80 93 72 03 sts 0x0372, r24 ; 0x800372 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 1fe46: 8e eb ldi r24, 0xBE ; 190 1fe48: 9f e0 ldi r25, 0x0F ; 15 1fe4a: 0f 94 3c a1 call 0x34278 ; 0x34278 1fe4e: 08 2e mov r0, r24 1fe50: 00 0c add r0, r0 1fe52: 99 0b sbc r25, r25 1fe54: 90 93 75 03 sts 0x0375, r25 ; 0x800375 1fe58: 80 93 74 03 sts 0x0374, r24 ; 0x800374 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 1fe5c: 8d eb ldi r24, 0xBD ; 189 1fe5e: 9f e0 ldi r25, 0x0F ; 15 1fe60: 0f 94 3c a1 call 0x34278 ; 0x34278 1fe64: 08 2e mov r0, r24 1fe66: 00 0c add r0, r0 1fe68: 99 0b sbc r25, r25 1fe6a: 90 93 77 03 sts 0x0377, r25 ; 0x800377 1fe6e: 80 93 76 03 sts 0x0376, r24 ; 0x800376 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1fe72: 8c eb ldi r24, 0xBC ; 188 1fe74: 9f e0 ldi r25, 0x0F ; 15 1fe76: 0f 94 3c a1 call 0x34278 ; 0x34278 1fe7a: 08 2e mov r0, r24 1fe7c: 00 0c add r0, r0 1fe7e: 99 0b sbc r25, r25 1fe80: 90 93 79 03 sts 0x0379, r25 ; 0x800379 1fe84: 80 93 78 03 sts 0x0378, r24 ; 0x800378 } _md->status = 1; 1fe88: 81 e0 ldi r24, 0x01 ; 1 1fe8a: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } MENU_BEGIN(); 1fe8e: 0f 94 1c 94 call 0x32838 ; 0x32838 1fe92: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fe96: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fe9a: 84 30 cpi r24, 0x04 ; 4 1fe9c: 08 f0 brcs .+2 ; 0x1fea0 1fe9e: 6e c0 rjmp .+220 ; 0x1ff7c 1fea0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1fea4: 0f 94 9c 92 call 0x32538 ; 0x32538 1fea8: 88 23 and r24, r24 1feaa: e9 f0 breq .+58 ; 0x1fee6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1feac: 60 91 72 03 lds r22, 0x0372 ; 0x800372 1feb0: 8f eb ldi r24, 0xBF ; 191 1feb2: 9f e0 ldi r25, 0x0F ; 15 1feb4: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1feb8: 60 91 76 03 lds r22, 0x0376 ; 0x800376 1febc: 8d eb ldi r24, 0xBD ; 189 1febe: 9f e0 ldi r25, 0x0F ; 15 1fec0: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1fec4: 60 91 78 03 lds r22, 0x0378 ; 0x800378 1fec8: 8c eb ldi r24, 0xBC ; 188 1feca: 9f e0 ldi r25, 0x0F ; 15 1fecc: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1fed0: 60 91 74 03 lds r22, 0x0374 ; 0x800374 1fed4: 8e eb ldi r24, 0xBE ; 190 1fed6: 9f e0 ldi r25, 0x0F ; 15 1fed8: 0f 94 60 a1 call 0x342c0 ; 0x342c0 1fedc: 61 e0 ldi r22, 0x01 ; 1 1fede: 80 ec ldi r24, 0xC0 ; 192 1fee0: 9f e0 ldi r25, 0x0F ; 15 1fee2: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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)); 1fee6: 86 e7 ldi r24, 0x76 ; 118 1fee8: 90 e4 ldi r25, 0x40 ; 64 1feea: 0e 94 32 6d call 0xda64 ; 0xda64 1feee: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fef2: 8d e9 ldi r24, 0x9D ; 157 1fef4: 9c e4 ldi r25, 0x4C ; 76 1fef6: 0e 94 32 6d call 0xda64 ; 0xda64 1fefa: f1 2c mov r15, r1 1fefc: e1 2c mov r14, r1 1fefe: 04 e6 ldi r16, 0x64 ; 100 1ff00: 10 e0 ldi r17, 0x00 ; 0 1ff02: 2c e9 ldi r18, 0x9C ; 156 1ff04: 3f ef ldi r19, 0xFF ; 255 1ff06: 40 e1 ldi r20, 0x10 ; 16 1ff08: 62 e7 ldi r22, 0x72 ; 114 1ff0a: 73 e0 ldi r23, 0x03 ; 3 1ff0c: 0f 94 6c 94 call 0x328d8 ; 0x328d8 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff10: 8c e8 ldi r24, 0x8C ; 140 1ff12: 9c e4 ldi r25, 0x4C ; 76 1ff14: 0e 94 32 6d call 0xda64 ; 0xda64 1ff18: 2c e9 ldi r18, 0x9C ; 156 1ff1a: 3f ef ldi r19, 0xFF ; 255 1ff1c: 40 e1 ldi r20, 0x10 ; 16 1ff1e: 64 e7 ldi r22, 0x74 ; 116 1ff20: 73 e0 ldi r23, 0x03 ; 3 1ff22: 0f 94 6c 94 call 0x328d8 ; 0x328d8 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff26: 8b e7 ldi r24, 0x7B ; 123 1ff28: 9c e4 ldi r25, 0x4C ; 76 1ff2a: 0e 94 32 6d call 0xda64 ; 0xda64 1ff2e: 2c e9 ldi r18, 0x9C ; 156 1ff30: 3f ef ldi r19, 0xFF ; 255 1ff32: 40 e1 ldi r20, 0x10 ; 16 1ff34: 66 e7 ldi r22, 0x76 ; 118 1ff36: 73 e0 ldi r23, 0x03 ; 3 1ff38: 0f 94 6c 94 call 0x328d8 ; 0x328d8 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff3c: 8a e6 ldi r24, 0x6A ; 106 1ff3e: 9c e4 ldi r25, 0x4C ; 76 1ff40: 0e 94 32 6d call 0xda64 ; 0xda64 1ff44: 2c e9 ldi r18, 0x9C ; 156 1ff46: 3f ef ldi r19, 0xFF ; 255 1ff48: 40 e1 ldi r20, 0x10 ; 16 1ff4a: 68 e7 ldi r22, 0x78 ; 120 1ff4c: 73 e0 ldi r23, 0x03 ; 3 1ff4e: 0f 94 6c 94 call 0x328d8 ; 0x328d8 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 1ff52: 89 e1 ldi r24, 0x19 ; 25 1ff54: 9c e3 ldi r25, 0x3C ; 60 1ff56: 0e 94 32 6d call 0xda64 ; 0xda64 1ff5a: 6f e1 ldi r22, 0x1F ; 31 1ff5c: 77 e3 ldi r23, 0x37 ; 55 1ff5e: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_END(); 1ff62: 0f 94 f0 93 call 0x327e0 ; 0x327e0 _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(); 1ff66: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1ff6a: 8f 5f subi r24, 0xFF ; 255 1ff6c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1ff70: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1ff74: 8f 5f subi r24, 0xFF ; 255 1ff76: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1ff7a: 8d cf rjmp .-230 ; 0x1fe96 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(); } 1ff7c: 1f 91 pop r17 1ff7e: 0f 91 pop r16 1ff80: ff 90 pop r15 1ff82: ef 90 pop r14 1ff84: 08 95 ret 0001ff86 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 1ff86: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 1ff8a: 8e ea ldi r24, 0xAE ; 174 1ff8c: 9c e4 ldi r25, 0x4C ; 76 1ff8e: 0e 94 32 6d call 0xda64 ; 0xda64 1ff92: ac 01 movw r20, r24 1ff94: 60 e0 ldi r22, 0x00 ; 0 1ff96: 80 e0 ldi r24, 0x00 ; 0 1ff98: 0e 94 10 6a call 0xd420 ; 0xd420 pid_temp += lcd_encoder; 1ff9c: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1ffa0: 90 91 4f 02 lds r25, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1ffa4: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1ffa8: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1ffac: 82 0f add r24, r18 1ffae: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 1ffb0: 82 33 cpi r24, 0x32 ; 50 1ffb2: 21 e0 ldi r18, 0x01 ; 1 1ffb4: 92 07 cpc r25, r18 1ffb6: 50 f1 brcs .+84 ; 0x2000c 1ffb8: 81 e3 ldi r24, 0x31 ; 49 1ffba: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 1ffbc: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1ffc0: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.409> lcd_encoder = 0; 1ffc4: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1ffc8: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_set_cursor(1, 2); 1ffcc: 62 e0 ldi r22, 0x02 ; 2 1ffce: 81 e0 ldi r24, 0x01 ; 1 1ffd0: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%3u"), pid_temp); 1ffd4: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1ffd8: 8f 93 push r24 1ffda: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1ffde: 8f 93 push r24 1ffe0: 86 e7 ldi r24, 0x76 ; 118 1ffe2: 98 e9 ldi r25, 0x98 ; 152 1ffe4: 9f 93 push r25 1ffe6: 8f 93 push r24 1ffe8: 0e 94 d5 69 call 0xd3aa ; 0xd3aa if (lcd_clicked()) { 1ffec: 0e 94 19 6c call 0xd832 ; 0xd832 1fff0: 0f 90 pop r0 1fff2: 0f 90 pop r0 1fff4: 0f 90 pop r0 1fff6: 0f 90 pop r0 1fff8: 88 23 and r24, r24 1fffa: 71 f0 breq .+28 ; 0x20018 lcd_commands_type = LcdCommands::PidExtruder; 1fffc: 83 e0 ldi r24, 0x03 ; 3 1fffe: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 20002: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_update(2); 20006: 82 e0 ldi r24, 0x02 ; 2 20008: 0c 94 c3 69 jmp 0xd386 ; 0xd386 { 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; 2000c: 8e 31 cpi r24, 0x1E ; 30 2000e: 91 05 cpc r25, r1 20010: a8 f6 brcc .-86 ; 0x1ffbc 20012: 8e e1 ldi r24, 0x1E ; 30 20014: 90 e0 ldi r25, 0x00 ; 0 20016: d2 cf rjmp .-92 ; 0x1ffbc lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 20018: 08 95 ret 0002001a : #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){ 2001a: cf 93 push r28 2001c: df 93 push r29 2001e: cd b7 in r28, 0x3d ; 61 20020: de b7 in r29, 0x3e ; 62 20022: 2f 97 sbiw r28, 0x0f ; 15 20024: 0f b6 in r0, 0x3f ; 63 20026: f8 94 cli 20028: de bf out 0x3e, r29 ; 62 2002a: 0f be out 0x3f, r0 ; 63 2002c: cd bf out 0x3d, r28 ; 61 2002e: fc 01 movw r30, r24 20030: de 01 movw r26, r28 20032: 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; 20034: 90 e0 ldi r25, 0x00 ; 0 20036: 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); 20038: 84 91 lpm r24, Z 2003a: 41 e0 ldi r20, 0x01 ; 1 2003c: 49 0f add r20, r25 if( ! b ) 2003e: 88 23 and r24, r24 20040: 29 f0 breq .+10 ; 0x2004c break; dst[i] = b; 20042: 8d 93 st X+, r24 20044: 31 96 adiw r30, 0x01 ; 1 20046: 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 20048: 4d 30 cpi r20, 0x0D ; 13 2004a: b1 f7 brne .-20 ; 0x20038 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 2004c: f9 01 movw r30, r18 2004e: e9 0f add r30, r25 20050: f1 1d adc r31, r1 20052: 8a e3 ldi r24, 0x3A ; 58 20054: 80 83 st Z, r24 ++i; 20056: 9f 5f subi r25, 0xFF ; 255 20058: f9 01 movw r30, r18 2005a: e9 0f add r30, r25 2005c: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 2005e: 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 20060: 9e 30 cpi r25, 0x0E ; 14 20062: 19 f0 breq .+6 ; 0x2006a dst[i] = ' '; 20064: 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 20066: 9f 5f subi r25, 0xFF ; 255 20068: fb cf rjmp .-10 ; 0x20060 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 2006a: 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 2006c: 7f 93 push r23 2006e: 6f 93 push r22 20070: 3f 93 push r19 20072: 2f 93 push r18 20074: 8b e5 ldi r24, 0x5B ; 91 20076: 96 e9 ldi r25, 0x96 ; 150 20078: 9f 93 push r25 2007a: 8f 93 push r24 2007c: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 20080: 0f 90 pop r0 20082: 0f 90 pop r0 20084: 0f 90 pop r0 20086: 0f 90 pop r0 20088: 0f 90 pop r0 2008a: 0f 90 pop r0 } 2008c: 2f 96 adiw r28, 0x0f ; 15 2008e: 0f b6 in r0, 0x3f ; 63 20090: f8 94 cli 20092: de bf out 0x3e, r29 ; 62 20094: 0f be out 0x3f, r0 ; 63 20096: cd bf out 0x3d, r28 ; 61 20098: df 91 pop r29 2009a: cf 91 pop r28 2009c: 08 95 ret 0002009e : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 2009e: af 92 push r10 200a0: bf 92 push r11 200a2: cf 92 push r12 200a4: df 92 push r13 200a6: ef 92 push r14 200a8: ff 92 push r15 200aa: 0f 93 push r16 200ac: 1f 93 push r17 200ae: cf 93 push r28 200b0: df 93 push r29 200b2: 00 d0 rcall .+0 ; 0x200b4 200b4: 00 d0 rcall .+0 ; 0x200b6 200b6: 1f 92 push r1 200b8: cd b7 in r28, 0x3d ; 61 200ba: 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)) || 200bc: 80 91 63 03 lds r24, 0x0363 ; 0x800363 200c0: 81 11 cpse r24, r1 200c2: 18 c0 rjmp .+48 ; 0x200f4 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))) || 200c4: 81 ea ldi r24, 0xA1 ; 161 200c6: 9d e0 ldi r25, 0x0D ; 13 200c8: 0f 94 3c a1 call 0x34278 ; 0x34278 200cc: 18 2f mov r17, r24 200ce: 0e 94 99 6f call 0xdf32 ; 0xdf32 200d2: 88 23 and r24, r24 200d4: 79 f0 breq .+30 ; 0x200f4 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 200d6: 80 e1 ldi r24, 0x10 ; 16 200d8: 0e 94 4c d8 call 0x1b098 ; 0x1b098 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))) || 200dc: 88 23 and r24, r24 200de: 51 f0 breq .+20 ; 0x200f4 (!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))))) 200e0: 2b e0 ldi r18, 0x0B ; 11 200e2: 12 9f mul r17, r18 200e4: c0 01 movw r24, r0 200e6: 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 200e8: 80 5b subi r24, 0xB0 ; 176 200ea: 92 4f sbci r25, 0xF2 ; 242 200ec: 0f 94 4a a1 call 0x34294 ; 0x34294 } 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)) || 200f0: 89 2b or r24, r25 200f2: f1 f4 brne .+60 ; 0x20130 (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) 200f4: 80 91 64 03 lds r24, 0x0364 ; 0x800364 200f8: 88 23 and r24, r24 200fa: 71 f0 breq .+28 ; 0x20118 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 200fc: 81 ea ldi r24, 0xA1 ; 161 200fe: 9d e0 ldi r25, 0x0D ; 13 20100: 0f 94 3c a1 call 0x34278 ; 0x34278 20104: 2b e0 ldi r18, 0x0B ; 11 20106: 82 9f mul r24, r18 20108: c0 01 movw r24, r0 2010a: 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); 2010c: 6f ef ldi r22, 0xFF ; 255 2010e: 7f ef ldi r23, 0xFF ; 255 20110: 80 5b subi r24, 0xB0 ; 176 20112: 92 4f sbci r25, 0xF2 ; 242 20114: 0f 94 7e a1 call 0x342fc ; 0x342fc } // 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()); 20118: 0e 94 19 6c call 0xd832 ; 0xd832 2011c: 21 e0 ldi r18, 0x01 ; 1 2011e: 81 11 cpse r24, r1 20120: 20 e0 ldi r18, 0x00 ; 0 20122: 41 e0 ldi r20, 0x01 ; 1 20124: 70 e0 ldi r23, 0x00 ; 0 20126: 60 e0 ldi r22, 0x00 ; 0 20128: 8f e8 ldi r24, 0x8F ; 143 2012a: 98 e3 ldi r25, 0x38 ; 56 2012c: 0f 94 46 94 call 0x3288c ; 0x3288c } if (lcd_encoder) { 20130: 20 91 06 05 lds r18, 0x0506 ; 0x800506 20134: 30 91 07 05 lds r19, 0x0507 ; 0x800507 20138: 21 15 cp r18, r1 2013a: 31 05 cpc r19, r1 2013c: 59 f0 breq .+22 ; 0x20154 menuData->reset = lcd_encoder > 0; 2013e: 81 e0 ldi r24, 0x01 ; 1 20140: 12 16 cp r1, r18 20142: 13 06 cpc r1, r19 20144: 0c f0 brlt .+2 ; 0x20148 20146: 80 e0 ldi r24, 0x00 ; 0 20148: 80 93 64 03 sts 0x0364, r24 ; 0x800364 lcd_encoder = 0; // Reset 2014c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20150: 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)); 20154: 81 ea ldi r24, 0xA1 ; 161 20156: 9d e0 ldi r25, 0x0D ; 13 20158: 0f 94 3c a1 call 0x34278 ; 0x34278 2015c: 1b e0 ldi r17, 0x0B ; 11 2015e: 81 9f mul r24, r17 20160: b0 01 movw r22, r0 20162: 11 24 eor r1, r1 20164: 67 5b subi r22, 0xB7 ; 183 20166: 72 4f sbci r23, 0xF2 ; 242 20168: 47 e0 ldi r20, 0x07 ; 7 2016a: 50 e0 ldi r21, 0x00 ; 0 2016c: ce 01 movw r24, r28 2016e: 01 96 adiw r24, 0x01 ; 1 20170: 7c 01 movw r14, r24 20172: 0f 94 2c a1 call 0x34258 ; 0x34258 lcd_home(); 20176: 0e 94 28 6a call 0xd450 ; 0xd450 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]; 2017a: 81 ea ldi r24, 0xA1 ; 161 2017c: 9d e0 ldi r25, 0x0D ; 13 2017e: 0f 94 3c a1 call 0x34278 ; 0x34278 20182: 81 9f mul r24, r17 20184: c0 01 movw r24, r0 20186: 11 24 eor r1, r1 20188: 80 5b subi r24, 0xB0 ; 176 2018a: 92 4f sbci r25, 0xF2 ; 242 2018c: 0f 94 4a a1 call 0x34294 ; 0x34294 20190: bc 01 movw r22, r24 20192: 99 0f add r25, r25 20194: 88 0b sbc r24, r24 20196: 99 0b sbc r25, r25 20198: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2019c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 201a0: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 201a4: 40 91 40 04 lds r20, 0x0440 ; 0x800440 201a8: 50 91 41 04 lds r21, 0x0441 ; 0x800441 201ac: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 201b0: d6 2e mov r13, r22 201b2: c7 2e mov r12, r23 201b4: b8 2e mov r11, r24 201b6: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 201b8: 80 91 64 03 lds r24, 0x0364 ; 0x800364 201bc: 0e e3 ldi r16, 0x3E ; 62 201be: 10 e2 ldi r17, 0x20 ; 32 201c0: 81 11 cpse r24, r1 201c2: 02 c0 rjmp .+4 ; 0x201c8 201c4: 00 e2 ldi r16, 0x20 ; 32 201c6: 1e e3 ldi r17, 0x3E ; 62 201c8: 8b e4 ldi r24, 0x4B ; 75 201ca: 9e e4 ldi r25, 0x4E ; 78 201cc: 0e 94 32 6d call 0xda64 ; 0xda64 201d0: 1f 92 push r1 201d2: 0f 93 push r16 201d4: 1f 92 push r1 201d6: 1f 93 push r17 201d8: af 92 push r10 201da: bf 92 push r11 201dc: cf 92 push r12 201de: df 92 push r13 201e0: ff 92 push r15 201e2: ef 92 push r14 201e4: 9f 93 push r25 201e6: 8f 93 push r24 201e8: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 201ec: 0f b6 in r0, 0x3f ; 63 201ee: f8 94 cli 201f0: de bf out 0x3e, r29 ; 62 201f2: 0f be out 0x3f, r0 ; 63 201f4: 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. } 201f6: 27 96 adiw r28, 0x07 ; 7 201f8: 0f b6 in r0, 0x3f ; 63 201fa: f8 94 cli 201fc: de bf out 0x3e, r29 ; 62 201fe: 0f be out 0x3f, r0 ; 63 20200: cd bf out 0x3d, r28 ; 61 20202: df 91 pop r29 20204: cf 91 pop r28 20206: 1f 91 pop r17 20208: 0f 91 pop r16 2020a: ff 90 pop r15 2020c: ef 90 pop r14 2020e: df 90 pop r13 20210: cf 90 pop r12 20212: bf 90 pop r11 20214: af 90 pop r10 20216: 08 95 ret 00020218 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 20218: cf 93 push r28 2021a: df 93 push r29 MENU_BEGIN(); 2021c: 0f 94 1c 94 call 0x32838 ; 0x32838 20220: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 20224: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20228: 84 30 cpi r24, 0x04 ; 4 2022a: 08 f0 brcs .+2 ; 0x2022e 2022c: 5c c0 rjmp .+184 ; 0x202e6 2022e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 20232: 0e 94 26 6c call 0xd84c ; 0xd84c 20236: 88 23 and r24, r24 20238: 31 f0 breq .+12 ; 0x20246 2023a: 88 ef ldi r24, 0xF8 ; 248 2023c: 9d e3 ldi r25, 0x3D ; 61 2023e: 0e 94 32 6d call 0xda64 ; 0xda64 20242: 0f 94 e7 96 call 0x32dce ; 0x32dce if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 20246: 8e e6 ldi r24, 0x6E ; 110 20248: 95 e6 ldi r25, 0x65 ; 101 2024a: 0e 94 3c 6c call 0xd878 ; 0xd878 2024e: 0f 94 ca 93 call 0x32794 ; 0x32794 20252: 88 23 and r24, r24 20254: 49 f0 breq .+18 ; 0x20268 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 20256: 80 e0 ldi r24, 0x00 ; 0 20258: 0e 94 c6 6c call 0xd98c ; 0xd98c 2025c: 81 11 cpse r24, r1 2025e: 43 c0 rjmp .+134 ; 0x202e6 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 20260: df 91 pop r29 20262: cf 91 pop r28 20264: 0c 94 a5 e1 jmp 0x1c34a ; 0x1c34a 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(); 20268: 0e 94 a3 6c call 0xd946 ; 0xd946 2026c: 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) 2026e: c1 e0 ldi r28, 0x01 ; 1 20270: cd 17 cp r28, r29 20272: 60 f5 brcc .+88 ; 0x202cc 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; 20274: 80 e0 ldi r24, 0x00 ; 0 20276: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 20278: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 2027a: fc 01 movw r30, r24 2027c: 45 91 lpm r20, Z+ 2027e: 55 91 lpm r21, Z+ 20280: 65 91 lpm r22, Z+ 20282: 74 91 lpm r23, Z 20284: 45 3a cpi r20, 0xA5 ; 165 20286: 5a 45 sbci r21, 0x5A ; 90 20288: 64 4b sbci r22, 0xB4 ; 180 2028a: 7b 44 sbci r23, 0x4B ; 75 2028c: 19 f0 breq .+6 ; 0x20294 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; 2028e: 8f e3 ldi r24, 0x3F ; 63 20290: 9f e3 ldi r25, 0x3F ; 63 20292: 06 c0 rjmp .+12 ; 0x202a0 #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 20294: fc 01 movw r30, r24 20296: c2 13 cpse r28, r18 20298: 10 c0 rjmp .+32 ; 0x202ba 2029a: 3a 96 adiw r30, 0x0a ; 10 2029c: 85 91 lpm r24, Z+ 2029e: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 202a0: 0e 94 3c 6c call 0xd878 ; 0xd878 202a4: 0f 94 ca 93 call 0x32794 ; 0x32794 202a8: 88 23 and r24, r24 202aa: 71 f0 breq .+28 ; 0x202c8 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 202ac: 8c 2f mov r24, r28 202ae: 0e 94 c6 6c call 0xd98c ; 0xd98c 202b2: 81 11 cpse r24, r1 202b4: 18 c0 rjmp .+48 ; 0x202e6 202b6: 8c 2f mov r24, r28 202b8: d3 cf rjmp .-90 ; 0x20260 table += pgm_read_word((uint16_t*)(table + 4)); 202ba: 34 96 adiw r30, 0x04 ; 4 202bc: 45 91 lpm r20, Z+ 202be: 54 91 lpm r21, Z 202c0: 84 0f add r24, r20 202c2: 95 1f adc r25, r21 count++; 202c4: 2f 5f subi r18, 0xFF ; 255 202c6: d9 cf rjmp .-78 ; 0x2027a } } 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) 202c8: cf 5f subi r28, 0xFF ; 255 202ca: d2 cf rjmp .-92 ; 0x20270 #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 202cc: 0f 94 f0 93 call 0x327e0 ; 0x327e0 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 202d0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 202d4: 8f 5f subi r24, 0xFF ; 255 202d6: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 202da: 80 91 30 04 lds r24, 0x0430 ; 0x800430 202de: 8f 5f subi r24, 0xFF ; 255 202e0: 80 93 30 04 sts 0x0430, r24 ; 0x800430 202e4: 9f cf rjmp .-194 ; 0x20224 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 202e6: df 91 pop r29 202e8: cf 91 pop r28 202ea: 08 95 ret 000202ec : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 202ec: df 92 push r13 202ee: ef 92 push r14 202f0: ff 92 push r15 202f2: 0f 93 push r16 202f4: 1f 93 push r17 202f6: cf 93 push r28 202f8: df 93 push r29 202fa: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 202fe: 0e 94 28 6a call 0xd450 ; 0xd450 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] ); 20302: c5 e8 ldi r28, 0x85 ; 133 20304: d3 e0 ldi r29, 0x03 ; 3 20306: 8a 81 ldd r24, Y+2 ; 0x02 20308: 9b 81 ldd r25, Y+3 ; 0x03 2030a: 2c e3 ldi r18, 0x3C ; 60 2030c: f2 2e mov r15, r18 2030e: f8 9e mul r15, r24 20310: 80 01 movw r16, r0 20312: f9 9e mul r15, r25 20314: 10 0d add r17, r0 20316: 11 24 eor r1, r1 20318: 8b e9 ldi r24, 0x9B ; 155 2031a: 9f e3 ldi r25, 0x3F ; 63 2031c: 0e 94 32 6d call 0xda64 ; 0xda64 20320: e8 2e mov r14, r24 20322: d9 2e mov r13, r25 20324: 88 81 ld r24, Y 20326: 99 81 ldd r25, Y+1 ; 0x01 20328: f8 9e mul r15, r24 2032a: e0 01 movw r28, r0 2032c: f9 9e mul r15, r25 2032e: d0 0d add r29, r0 20330: 11 24 eor r1, r1 20332: 88 ea ldi r24, 0xA8 ; 168 20334: 9f e3 ldi r25, 0x3F ; 63 20336: 0e 94 32 6d call 0xda64 ; 0xda64 2033a: 1f 93 push r17 2033c: 0f 93 push r16 2033e: df 92 push r13 20340: ef 92 push r14 20342: df 93 push r29 20344: cf 93 push r28 20346: 9f 93 push r25 20348: 8f 93 push r24 2034a: 81 ed ldi r24, 0xD1 ; 209 2034c: 95 e9 ldi r25, 0x95 ; 149 2034e: 9f 93 push r25 20350: 8f 93 push r24 20352: 0e 94 d5 69 call 0xd3aa ; 0xd3aa menu_back_if_clicked(); 20356: 8d b7 in r24, 0x3d ; 61 20358: 9e b7 in r25, 0x3e ; 62 2035a: 0a 96 adiw r24, 0x0a ; 10 2035c: 0f b6 in r0, 0x3f ; 63 2035e: f8 94 cli 20360: 9e bf out 0x3e, r25 ; 62 20362: 0f be out 0x3f, r0 ; 63 20364: 8d bf out 0x3d, r24 ; 61 } 20366: df 91 pop r29 20368: cf 91 pop r28 2036a: 1f 91 pop r17 2036c: 0f 91 pop r16 2036e: ff 90 pop r15 20370: ef 90 pop r14 20372: 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(); 20374: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 00020378 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 20378: cf 92 push r12 2037a: df 92 push r13 2037c: ef 92 push r14 2037e: ff 92 push r15 20380: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20384: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 20388: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2038c: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20390: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20394: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20398: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2039c: 6b 01 movw r12, r22 2039e: 8a e4 ldi r24, 0x4A ; 74 203a0: 96 e5 ldi r25, 0x56 ; 86 203a2: 0e 94 32 6d call 0xda64 ; 0xda64 203a6: b6 01 movw r22, r12 203a8: 0f 94 0d 00 call 0x2001a ; 0x2001a lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 203ac: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 203b0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 203b4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 203b8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 203bc: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 203c0: 6b 01 movw r12, r22 203c2: 8f e2 ldi r24, 0x2F ; 47 203c4: 96 e5 ldi r25, 0x56 ; 86 203c6: 0e 94 32 6d call 0xda64 ; 0xda64 203ca: b6 01 movw r22, r12 203cc: 0f 94 0d 00 call 0x2001a ; 0x2001a #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 203d0: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 203d4: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 203d8: 80 91 90 06 lds r24, 0x0690 ; 0x800690 203dc: 90 91 91 06 lds r25, 0x0691 ; 0x800691 203e0: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 203e4: 8c ed ldi r24, 0xDC ; 220 203e6: 9b e6 ldi r25, 0x6B ; 107 203e8: 0f 94 0d 00 call 0x2001a ; 0x2001a #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 203ec: ff 90 pop r15 203ee: ef 90 pop r14 203f0: df 90 pop r13 203f2: 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(); 203f4: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 000203f8 : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 203f8: bf 92 push r11 203fa: cf 92 push r12 203fc: df 92 push r13 203fe: ef 92 push r14 20400: ff 92 push r15 20402: 0f 93 push r16 20404: 1f 93 push r17 20406: cf 93 push r28 20408: df 93 push r29 2040a: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 2040e: 85 e6 ldi r24, 0x65 ; 101 20410: 9f e0 ldi r25, 0x0F ; 15 20412: 0f 94 3c a1 call 0x34278 ; 0x34278 20416: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 20418: 81 e0 ldi r24, 0x01 ; 1 2041a: 9f e0 ldi r25, 0x0F ; 15 2041c: 0f 94 4a a1 call 0x34294 ; 0x34294 20420: 0e 94 d6 f7 call 0x1efac ; 0x1efac 20424: c8 2e mov r12, r24 20426: b9 2e mov r11, r25 lcd_home(); 20428: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P(failStatsFmt, 2042c: 88 ef ldi r24, 0xF8 ; 248 2042e: 99 e4 ldi r25, 0x49 ; 73 20430: 0e 94 32 6d call 0xda64 ; 0xda64 20434: e8 2e mov r14, r24 20436: d9 2e mov r13, r25 20438: 87 ee ldi r24, 0xE7 ; 231 2043a: 99 e4 ldi r25, 0x49 ; 73 2043c: 0e 94 32 6d call 0xda64 ; 0xda64 20440: 08 2f mov r16, r24 20442: f9 2e mov r15, r25 20444: 88 ef ldi r24, 0xF8 ; 248 20446: 99 e4 ldi r25, 0x49 ; 73 20448: 0e 94 32 6d call 0xda64 ; 0xda64 2044c: ec 01 movw r28, r24 2044e: 81 ed ldi r24, 0xD1 ; 209 20450: 99 e4 ldi r25, 0x49 ; 73 20452: 0e 94 32 6d call 0xda64 ; 0xda64 20456: bf 92 push r11 20458: cf 92 push r12 2045a: df 92 push r13 2045c: ef 92 push r14 2045e: ff 92 push r15 20460: 0f 93 push r16 20462: 1f 92 push r1 20464: 1f 93 push r17 20466: df 93 push r29 20468: cf 93 push r28 2046a: 9f 93 push r25 2046c: 8f 93 push r24 2046e: 88 e3 ldi r24, 0x38 ; 56 20470: 96 e9 ldi r25, 0x96 ; 150 20472: 9f 93 push r25 20474: 8f 93 push r24 20476: 0e 94 d5 69 call 0xd3aa ; 0xd3aa _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 2047a: 8d b7 in r24, 0x3d ; 61 2047c: 9e b7 in r25, 0x3e ; 62 2047e: 0e 96 adiw r24, 0x0e ; 14 20480: 0f b6 in r0, 0x3f ; 63 20482: f8 94 cli 20484: 9e bf out 0x3e, r25 ; 62 20486: 0f be out 0x3f, r0 ; 63 20488: 8d bf out 0x3d, r24 ; 61 } 2048a: df 91 pop r29 2048c: cf 91 pop r28 2048e: 1f 91 pop r17 20490: 0f 91 pop r16 20492: ff 90 pop r15 20494: ef 90 pop r14 20496: df 90 pop r13 20498: cf 90 pop r12 2049a: 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(); 2049c: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 000204a0 : //! | 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() { 204a0: 8f 92 push r8 204a2: 9f 92 push r9 204a4: af 92 push r10 204a6: bf 92 push r11 204a8: cf 92 push r12 204aa: df 92 push r13 204ac: ef 92 push r14 204ae: ff 92 push r15 204b0: 0f 93 push r16 204b2: 1f 93 push r17 204b4: cf 93 push r28 204b6: df 93 push r29 204b8: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 204bc: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P( 204c0: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 204c4: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 204c8: 0e 94 d6 f7 call 0x1efac ; 0x1efac 204cc: 98 2e mov r9, r24 204ce: 89 2e mov r8, r25 204d0: 8c ea ldi r24, 0xAC ; 172 204d2: 99 e4 ldi r25, 0x49 ; 73 204d4: 0e 94 32 6d call 0xda64 ; 0xda64 204d8: b8 2e mov r11, r24 204da: a9 2e mov r10, r25 204dc: 80 ed ldi r24, 0xD0 ; 208 204de: 9e e0 ldi r25, 0x0E ; 14 204e0: 0f 94 4a a1 call 0x34294 ; 0x34294 204e4: 0e 94 d6 f7 call 0x1efac ; 0x1efac 204e8: d8 2e mov r13, r24 204ea: c9 2e mov r12, r25 204ec: 8b e9 ldi r24, 0x9B ; 155 204ee: 99 e4 ldi r25, 0x49 ; 73 204f0: 0e 94 32 6d call 0xda64 ; 0xda64 204f4: f8 2e mov r15, r24 204f6: e9 2e mov r14, r25 204f8: 83 ed ldi r24, 0xD3 ; 211 204fa: 9e e0 ldi r25, 0x0E ; 14 204fc: 0f 94 4a a1 call 0x34294 ; 0x34294 20500: 0e 94 d6 f7 call 0x1efac ; 0x1efac 20504: 18 2f mov r17, r24 20506: 09 2f mov r16, r25 20508: 8f e8 ldi r24, 0x8F ; 143 2050a: 99 e4 ldi r25, 0x49 ; 73 2050c: 0e 94 32 6d call 0xda64 ; 0xda64 20510: ec 01 movw r28, r24 20512: 87 ee ldi r24, 0xE7 ; 231 20514: 99 e4 ldi r25, 0x49 ; 73 20516: 0e 94 32 6d call 0xda64 ; 0xda64 2051a: 8f 92 push r8 2051c: 9f 92 push r9 2051e: af 92 push r10 20520: bf 92 push r11 20522: cf 92 push r12 20524: df 92 push r13 20526: ef 92 push r14 20528: ff 92 push r15 2052a: 0f 93 push r16 2052c: 1f 93 push r17 2052e: df 93 push r29 20530: cf 93 push r28 20532: 9f 93 push r25 20534: 8f 93 push r24 20536: 8b e0 ldi r24, 0x0B ; 11 20538: 96 e9 ldi r25, 0x96 ; 150 2053a: 9f 93 push r25 2053c: 8f 93 push r24 2053e: 0e 94 d5 69 call 0xd3aa ; 0xd3aa ), _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(); 20542: 8d b7 in r24, 0x3d ; 61 20544: 9e b7 in r25, 0x3e ; 62 20546: 40 96 adiw r24, 0x10 ; 16 20548: 0f b6 in r0, 0x3f ; 63 2054a: f8 94 cli 2054c: 9e bf out 0x3e, r25 ; 62 2054e: 0f be out 0x3f, r0 ; 63 20550: 8d bf out 0x3d, r24 ; 61 } 20552: df 91 pop r29 20554: cf 91 pop r28 20556: 1f 91 pop r17 20558: 0f 91 pop r16 2055a: ff 90 pop r15 2055c: ef 90 pop r14 2055e: df 90 pop r13 20560: cf 90 pop r12 20562: bf 90 pop r11 20564: af 90 pop r10 20566: 9f 90 pop r9 20568: 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(); 2056a: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 0002056e : //! | 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() { 2056e: cf 92 push r12 20570: df 92 push r13 20572: ef 92 push r14 20574: ff 92 push r15 20576: 0f 93 push r16 20578: 1f 93 push r17 2057a: cf 93 push r28 2057c: df 93 push r29 2057e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20582: 0e 94 28 6a call 0xd450 ; 0xd450 " %-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) )); 20586: 8f ec ldi r24, 0xCF ; 207 20588: 9e e0 ldi r25, 0x0E ; 14 2058a: 0f 94 3c a1 call 0x34278 ; 0x34278 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 2058e: 90 e0 ldi r25, 0x00 ; 0 20590: 0e 94 d6 f7 call 0x1efac ; 0x1efac 20594: d8 2e mov r13, r24 20596: c9 2e mov r12, r25 20598: 8b e9 ldi r24, 0x9B ; 155 2059a: 99 e4 ldi r25, 0x49 ; 73 2059c: 0e 94 32 6d call 0xda64 ; 0xda64 205a0: f8 2e mov r15, r24 205a2: 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) ), 205a4: 82 ed ldi r24, 0xD2 ; 210 205a6: 9e e0 ldi r25, 0x0E ; 14 205a8: 0f 94 3c a1 call 0x34278 ; 0x34278 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 205ac: 90 e0 ldi r25, 0x00 ; 0 205ae: 0e 94 d6 f7 call 0x1efac ; 0x1efac 205b2: 18 2f mov r17, r24 205b4: 09 2f mov r16, r25 205b6: 8f e8 ldi r24, 0x8F ; 143 205b8: 99 e4 ldi r25, 0x49 ; 73 205ba: 0e 94 32 6d call 0xda64 ; 0xda64 205be: ec 01 movw r28, r24 205c0: 81 ed ldi r24, 0xD1 ; 209 205c2: 99 e4 ldi r25, 0x49 ; 73 205c4: 0e 94 32 6d call 0xda64 ; 0xda64 205c8: cf 92 push r12 205ca: df 92 push r13 205cc: ef 92 push r14 205ce: ff 92 push r15 205d0: 0f 93 push r16 205d2: 1f 93 push r17 205d4: df 93 push r29 205d6: cf 93 push r28 205d8: 9f 93 push r25 205da: 8f 93 push r24 205dc: 8c ee ldi r24, 0xEC ; 236 205de: 95 e9 ldi r25, 0x95 ; 149 205e0: 9f 93 push r25 205e2: 8f 93 push r24 205e4: 0e 94 d5 69 call 0xd3aa ; 0xd3aa " %-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(); 205e8: 8d b7 in r24, 0x3d ; 61 205ea: 9e b7 in r25, 0x3e ; 62 205ec: 0c 96 adiw r24, 0x0c ; 12 205ee: 0f b6 in r0, 0x3f ; 63 205f0: f8 94 cli 205f2: 9e bf out 0x3e, r25 ; 62 205f4: 0f be out 0x3f, r0 ; 63 205f6: 8d bf out 0x3d, r24 ; 61 } 205f8: df 91 pop r29 205fa: cf 91 pop r28 205fc: 1f 91 pop r17 205fe: 0f 91 pop r16 20600: ff 90 pop r15 20602: ef 90 pop r14 20604: df 90 pop r13 20606: 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(); 20608: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 0002060c : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 2060c: 81 30 cpi r24, 0x01 ; 1 2060e: 21 f4 brne .+8 ; 0x20618 case STATE_ON: lcd_puts_P(_N(" 1")); 20610: 82 ed ldi r24, 0xD2 ; 210 20612: 9b e6 ldi r25, 0x6B ; 107 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 20614: 0c 94 e7 69 jmp 0xd3ce ; 0xd3ce 20618: 8e ec ldi r24, 0xCE ; 206 2061a: 9b e6 ldi r25, 0x6B ; 107 2061c: fb cf rjmp .-10 ; 0x20614 0002061e : //! |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() { 2061e: 2f 92 push r2 20620: 3f 92 push r3 20622: 4f 92 push r4 20624: 5f 92 push r5 20626: 6f 92 push r6 20628: 7f 92 push r7 2062a: 8f 92 push r8 2062c: 9f 92 push r9 2062e: af 92 push r10 20630: bf 92 push r11 20632: cf 92 push r12 20634: df 92 push r13 20636: ef 92 push r14 20638: ff 92 push r15 2063a: 0f 93 push r16 2063c: 1f 93 push r17 2063e: cf 93 push r28 20640: df 93 push r29 20642: cd b7 in r28, 0x3d ; 61 20644: de b7 in r29, 0x3e ; 62 20646: a8 97 sbiw r28, 0x28 ; 40 20648: 0f b6 in r0, 0x3f ; 63 2064a: f8 94 cli 2064c: de bf out 0x3e, r29 ; 62 2064e: 0f be out 0x3f, r0 ; 63 20650: 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); 20652: 48 e0 ldi r20, 0x08 ; 8 20654: 50 e0 ldi r21, 0x00 ; 0 20656: 65 ee ldi r22, 0xE5 ; 229 20658: 7f e0 ldi r23, 0x0F ; 15 2065a: ce 01 movw r24, r28 2065c: 41 96 adiw r24, 0x11 ; 17 2065e: 0f 94 2c a1 call 0x34258 ; 0x34258 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 20662: 48 e0 ldi r20, 0x08 ; 8 20664: 50 e0 ldi r21, 0x00 ; 0 20666: 6d ed ldi r22, 0xDD ; 221 20668: 7f e0 ldi r23, 0x0F ; 15 2066a: ce 01 movw r24, r28 2066c: 09 96 adiw r24, 0x09 ; 9 2066e: 0f 94 2c a1 call 0x34258 ; 0x34258 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 20672: 48 e0 ldi r20, 0x08 ; 8 20674: 50 e0 ldi r21, 0x00 ; 0 20676: 65 ed ldi r22, 0xD5 ; 213 20678: 7f e0 ldi r23, 0x0F ; 15 2067a: ce 01 movw r24, r28 2067c: 01 96 adiw r24, 0x01 ; 1 2067e: 0f 94 2c a1 call 0x34258 ; 0x34258 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]; 20682: 8d 84 ldd r8, Y+13 ; 0x0d 20684: 9e 84 ldd r9, Y+14 ; 0x0e 20686: af 84 ldd r10, Y+15 ; 0x0f 20688: b8 88 ldd r11, Y+16 ; 0x10 2068a: ef e4 ldi r30, 0x4F ; 79 2068c: f9 e8 ldi r31, 0x89 ; 137 2068e: 25 91 lpm r18, Z+ 20690: 35 91 lpm r19, Z+ 20692: 45 91 lpm r20, Z+ 20694: 54 91 lpm r21, Z 20696: cd 80 ldd r12, Y+5 ; 0x05 20698: de 80 ldd r13, Y+6 ; 0x06 2069a: ef 80 ldd r14, Y+7 ; 0x07 2069c: f8 84 ldd r15, Y+8 ; 0x08 2069e: e3 e5 ldi r30, 0x53 ; 83 206a0: f9 e8 ldi r31, 0x89 ; 137 206a2: 85 91 lpm r24, Z+ 206a4: 95 91 lpm r25, Z+ 206a6: a5 91 lpm r26, Z+ 206a8: b4 91 lpm r27, Z 206aa: 8d a3 std Y+37, r24 ; 0x25 206ac: 9e a3 std Y+38, r25 ; 0x26 206ae: af a3 std Y+39, r26 ; 0x27 206b0: b8 a7 std Y+40, r27 ; 0x28 206b2: 8d 89 ldd r24, Y+21 ; 0x15 206b4: 9e 89 ldd r25, Y+22 ; 0x16 206b6: af 89 ldd r26, Y+23 ; 0x17 206b8: b8 8d ldd r27, Y+24 ; 0x18 206ba: 89 a3 std Y+33, r24 ; 0x21 206bc: 9a a3 std Y+34, r25 ; 0x22 206be: ab a3 std Y+35, r26 ; 0x23 206c0: bc a3 std Y+36, r27 ; 0x24 206c2: c5 01 movw r24, r10 206c4: b4 01 movw r22, r8 206c6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 206ca: 2b 01 movw r4, r22 206cc: 3c 01 movw r6, r24 206ce: 2d a1 ldd r18, Y+37 ; 0x25 206d0: 3e a1 ldd r19, Y+38 ; 0x26 206d2: 4f a1 ldd r20, Y+39 ; 0x27 206d4: 58 a5 ldd r21, Y+40 ; 0x28 206d6: c7 01 movw r24, r14 206d8: b6 01 movw r22, r12 206da: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 206de: 9b 01 movw r18, r22 206e0: ac 01 movw r20, r24 206e2: c3 01 movw r24, r6 206e4: b2 01 movw r22, r4 206e6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 206ea: 29 a1 ldd r18, Y+33 ; 0x21 206ec: 3a a1 ldd r19, Y+34 ; 0x22 206ee: 4b a1 ldd r20, Y+35 ; 0x23 206f0: 5c a1 ldd r21, Y+36 ; 0x24 206f2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 206f6: 20 e0 ldi r18, 0x00 ; 0 206f8: 30 e0 ldi r19, 0x00 ; 0 206fa: 40 e9 ldi r20, 0x90 ; 144 206fc: 50 e4 ldi r21, 0x40 ; 64 206fe: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 20702: 1b 01 movw r2, r22 20704: 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]; 20706: e7 e5 ldi r30, 0x57 ; 87 20708: f9 e8 ldi r31, 0x89 ; 137 2070a: 25 91 lpm r18, Z+ 2070c: 35 91 lpm r19, Z+ 2070e: 45 91 lpm r20, Z+ 20710: 54 91 lpm r21, Z 20712: eb e5 ldi r30, 0x5B ; 91 20714: f9 e8 ldi r31, 0x89 ; 137 20716: 45 90 lpm r4, Z+ 20718: 55 90 lpm r5, Z+ 2071a: 65 90 lpm r6, Z+ 2071c: 74 90 lpm r7, Z 2071e: c5 01 movw r24, r10 20720: b4 01 movw r22, r8 20722: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 20726: 4b 01 movw r8, r22 20728: 5c 01 movw r10, r24 2072a: a3 01 movw r20, r6 2072c: 92 01 movw r18, r4 2072e: c7 01 movw r24, r14 20730: b6 01 movw r22, r12 20732: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 20736: 9b 01 movw r18, r22 20738: ac 01 movw r20, r24 2073a: c5 01 movw r24, r10 2073c: b4 01 movw r22, r8 2073e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 20742: 29 a1 ldd r18, Y+33 ; 0x21 20744: 3a a1 ldd r19, Y+34 ; 0x22 20746: 4b a1 ldd r20, Y+35 ; 0x23 20748: 5c a1 ldd r21, Y+36 ; 0x24 2074a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2074e: 20 e0 ldi r18, 0x00 ; 0 20750: 30 e0 ldi r19, 0x00 ; 0 20752: 40 e9 ldi r20, 0x90 ; 144 20754: 50 e4 ldi r21, 0x40 ; 64 20756: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2075a: 6d 8f std Y+29, r22 ; 0x1d 2075c: 7e 8f std Y+30, r23 ; 0x1e 2075e: 8f 8f std Y+31, r24 ; 0x1f 20760: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 20762: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P(_N( 20766: 83 e1 ldi r24, 0x13 ; 19 20768: 9c e4 ldi r25, 0x4C ; 76 2076a: 0e 94 32 6d call 0xda64 ; 0xda64 2076e: d8 2e mov r13, r24 20770: c9 2e mov r12, r25 20772: 8c e0 ldi r24, 0x0C ; 12 20774: 9c e4 ldi r25, 0x4C ; 76 20776: 0e 94 32 6d call 0xda64 ; 0xda64 2077a: f8 2e mov r15, r24 2077c: e9 2e mov r14, r25 2077e: 86 ef ldi r24, 0xF6 ; 246 20780: 9b e4 ldi r25, 0x4B ; 75 20782: 0e 94 32 6d call 0xda64 ; 0xda64 20786: cf 92 push r12 20788: df 92 push r13 2078a: ef 92 push r14 2078c: ff 92 push r15 2078e: 20 e0 ldi r18, 0x00 ; 0 20790: 34 e8 ldi r19, 0x84 ; 132 20792: 3f 93 push r19 20794: 2f 93 push r18 20796: 9f 93 push r25 20798: 8f 93 push r24 2079a: 8c e8 ldi r24, 0x8C ; 140 2079c: 9b e6 ldi r25, 0x6B ; 107 2079e: 9f 93 push r25 207a0: 8f 93 push r24 207a2: 0e 94 d5 69 call 0xd3aa ; 0xd3aa _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 207a6: 62 e0 ldi r22, 0x02 ; 2 207a8: 8b e0 ldi r24, 0x0B ; 11 207aa: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 207ae: 0f b6 in r0, 0x3f ; 63 207b0: f8 94 cli 207b2: de bf out 0x3e, r29 ; 62 207b4: 0f be out 0x3f, r0 ; 63 207b6: cd bf out 0x3d, r28 ; 61 207b8: 20 e0 ldi r18, 0x00 ; 0 207ba: 30 e0 ldi r19, 0x00 ; 0 207bc: 48 e4 ldi r20, 0x48 ; 72 207be: 53 e4 ldi r21, 0x43 ; 67 207c0: 62 2d mov r22, r2 207c2: 73 2d mov r23, r3 207c4: 80 2f mov r24, r16 207c6: 91 2f mov r25, r17 207c8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 207cc: 87 ff sbrs r24, 7 207ce: 51 c0 rjmp .+162 ; 0x20872 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 207d0: 1f 93 push r17 207d2: 0f 93 push r16 207d4: 3f 92 push r3 207d6: 2f 92 push r2 207d8: 84 e8 ldi r24, 0x84 ; 132 207da: 9b e6 ldi r25, 0x6B ; 107 207dc: 9f 93 push r25 207de: 8f 93 push r24 207e0: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 207e4: 0f 90 pop r0 207e6: 0f 90 pop r0 207e8: 0f 90 pop r0 207ea: 0f 90 pop r0 207ec: 0f 90 pop r0 207ee: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 207f0: 63 e0 ldi r22, 0x03 ; 3 207f2: 8b e0 ldi r24, 0x0B ; 11 207f4: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 207f8: 1d 8d ldd r17, Y+29 ; 0x1d 207fa: 0e 8d ldd r16, Y+30 ; 0x1e 207fc: ff 8c ldd r15, Y+31 ; 0x1f 207fe: e8 a0 ldd r14, Y+32 ; 0x20 20800: 20 e0 ldi r18, 0x00 ; 0 20802: 30 e0 ldi r19, 0x00 ; 0 20804: 48 e4 ldi r20, 0x48 ; 72 20806: 53 e4 ldi r21, 0x43 ; 67 20808: d8 01 movw r26, r16 2080a: f7 01 movw r30, r14 2080c: 6b 2f mov r22, r27 2080e: 7a 2f mov r23, r26 20810: 8f 2f mov r24, r31 20812: 9e 2f mov r25, r30 20814: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 20818: 87 fd sbrc r24, 7 2081a: 32 c0 rjmp .+100 ; 0x20880 2081c: 8d ed ldi r24, 0xDD ; 221 2081e: 9d e3 ldi r25, 0x3D ; 61 20820: 0e 94 32 6d call 0xda64 ; 0xda64 20824: 0e 94 e7 69 call 0xd3ce ; 0xd3ce else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 20828: 0e 94 19 6c call 0xd832 ; 0xd832 2082c: 88 23 and r24, r24 2082e: 41 f0 breq .+16 ; 0x20840 menu_goto(lcd_menu_xyz_skew, 0, true); 20830: 20 e0 ldi r18, 0x00 ; 0 20832: 41 e0 ldi r20, 0x01 ; 1 20834: 70 e0 ldi r23, 0x00 ; 0 20836: 60 e0 ldi r22, 0x00 ; 0 20838: 89 e3 ldi r24, 0x39 ; 57 2083a: 98 e3 ldi r25, 0x38 ; 56 2083c: 0f 94 46 94 call 0x3288c ; 0x3288c } 20840: a8 96 adiw r28, 0x28 ; 40 20842: 0f b6 in r0, 0x3f ; 63 20844: f8 94 cli 20846: de bf out 0x3e, r29 ; 62 20848: 0f be out 0x3f, r0 ; 63 2084a: cd bf out 0x3d, r28 ; 61 2084c: df 91 pop r29 2084e: cf 91 pop r28 20850: 1f 91 pop r17 20852: 0f 91 pop r16 20854: ff 90 pop r15 20856: ef 90 pop r14 20858: df 90 pop r13 2085a: cf 90 pop r12 2085c: bf 90 pop r11 2085e: af 90 pop r10 20860: 9f 90 pop r9 20862: 8f 90 pop r8 20864: 7f 90 pop r7 20866: 6f 90 pop r6 20868: 5f 90 pop r5 2086a: 4f 90 pop r4 2086c: 3f 90 pop r3 2086e: 2f 90 pop r2 20870: 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)); 20872: 8d ed ldi r24, 0xDD ; 221 20874: 9d e3 ldi r25, 0x3D ; 61 20876: 0e 94 32 6d call 0xda64 ; 0xda64 2087a: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 2087e: b8 cf rjmp .-144 ; 0x207f0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 20880: ef 92 push r14 20882: ff 92 push r15 20884: 0f 93 push r16 20886: 1f 93 push r17 20888: 84 e8 ldi r24, 0x84 ; 132 2088a: 9b e6 ldi r25, 0x6B ; 107 2088c: 9f 93 push r25 2088e: 8f 93 push r24 20890: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 20894: 0f 90 pop r0 20896: 0f 90 pop r0 20898: 0f 90 pop r0 2089a: 0f 90 pop r0 2089c: 0f 90 pop r0 2089e: 0f 90 pop r0 208a0: c3 cf rjmp .-122 ; 0x20828 000208a2 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 208a2: 8a ee ldi r24, 0xEA ; 234 208a4: 9a e6 ldi r25, 0x6A ; 106 208a6: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 000208aa : * 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) { 208aa: af 92 push r10 208ac: bf 92 push r11 208ae: cf 92 push r12 208b0: df 92 push r13 208b2: ef 92 push r14 208b4: ff 92 push r15 208b6: 0f 93 push r16 208b8: 1f 93 push r17 208ba: cf 93 push r28 208bc: df 93 push r29 208be: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 208c0: 0e 94 b0 69 call 0xd360 ; 0xd360 * @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; 208c4: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 208c6: 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; 208c8: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 208ca: 6f 2d mov r22, r15 208cc: 80 e0 ldi r24, 0x00 ; 0 208ce: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 // 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) 208d2: c6 01 movw r24, r12 208d4: 0e 94 c7 f7 call 0x1ef8e ; 0x1ef8e 208d8: 88 23 and r24, r24 208da: 29 f0 breq .+10 ; 0x208e6 208dc: 8f ef ldi r24, 0xFF ; 255 208de: c8 1a sub r12, r24 208e0: d8 0a sbc r13, r24 208e2: 09 f4 brne .+2 ; 0x208e6 208e4: 49 c0 rjmp .+146 ; 0x20978 208e6: c6 01 movw r24, r12 208e8: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 208ec: 84 31 cpi r24, 0x14 ; 20 208ee: 91 05 cpc r25, r1 208f0: 10 f0 brcs .+4 ; 0x208f6 208f2: 84 e1 ldi r24, 0x14 ; 20 208f4: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 208f6: e6 01 movw r28, r12 208f8: c8 0f add r28, r24 208fa: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 208fc: e3 e0 ldi r30, 0x03 ; 3 208fe: fe 12 cpse r15, r30 20900: 0a c0 rjmp .+20 ; 0x20916 20902: 84 31 cpi r24, 0x14 ; 20 20904: 41 f4 brne .+16 ; 0x20916 // 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; 20906: fe 01 movw r30, r28 20908: 84 91 lpm r24, Z 2090a: e1 2c mov r14, r1 if (multi_screen) 2090c: 88 23 and r24, r24 2090e: 19 f0 breq .+6 ; 0x20916 msgend = (msgend2 -= 2); 20910: 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; 20912: ee 24 eor r14, r14 20914: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 20916: fe 01 movw r30, r28 20918: 84 91 lpm r24, Z 2091a: 88 23 and r24, r24 2091c: 09 f4 brne .+2 ; 0x20920 2091e: 40 c0 rjmp .+128 ; 0x209a0 20920: ce 01 movw r24, r28 20922: 0e 94 c7 f7 call 0x1ef8e ; 0x1ef8e 20926: 81 11 cpse r24, r1 20928: 3b c0 rjmp .+118 ; 0x209a0 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); 2092a: fe 01 movw r30, r28 2092c: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2092e: 92 ed ldi r25, 0xD2 ; 210 20930: 98 0f add r25, r24 20932: 92 30 cpi r25, 0x02 ; 2 20934: a8 f1 brcs .+106 ; 0x209a0 20936: 8c 32 cpi r24, 0x2C ; 44 20938: 99 f1 breq .+102 ; 0x209a0 2093a: 96 ec ldi r25, 0xC6 ; 198 2093c: 98 0f add r25, r24 2093e: 92 30 cpi r25, 0x02 ; 2 20940: 78 f1 brcs .+94 ; 0x209a0 20942: 8f 33 cpi r24, 0x3F ; 63 20944: 69 f1 breq .+90 ; 0x209a0 20946: 81 32 cpi r24, 0x21 ; 33 20948: 59 f1 breq .+86 ; 0x209a0 2094a: 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)) 2094c: c0 16 cp r12, r16 2094e: d1 06 cpc r13, r17 20950: 58 f4 brcc .+22 ; 0x20968 20952: 58 01 movw r10, r16 20954: f1 e0 ldi r31, 0x01 ; 1 20956: af 1a sub r10, r31 20958: b1 08 sbc r11, r1 2095a: c5 01 movw r24, r10 2095c: 0e 94 c7 f7 call 0x1ef8e ; 0x1ef8e 20960: 81 11 cpse r24, r1 20962: 1d c0 rjmp .+58 ; 0x2099e -- msgend; 20964: 85 01 movw r16, r10 20966: f2 cf rjmp .-28 ; 0x2094c if (msgend == msg) 20968: c0 16 cp r12, r16 2096a: d1 06 cpc r13, r17 2096c: c9 f0 breq .+50 ; 0x209a0 2096e: 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) { 20970: f3 94 inc r15 20972: 84 e0 ldi r24, 0x04 ; 4 20974: f8 12 cpse r15, r24 20976: a9 cf rjmp .-174 ; 0x208ca } lcd_print(c); } } if (multi_screen) { 20978: ee 20 and r14, r14 2097a: f9 f0 breq .+62 ; 0x209ba // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 2097c: 48 e8 ldi r20, 0x88 ; 136 2097e: 63 e0 ldi r22, 0x03 ; 3 20980: 83 e1 ldi r24, 0x13 ; 19 20982: 0e 94 1c 6a call 0xd438 ; 0xd438 } return multi_screen ? msgend : NULL; } 20986: ce 01 movw r24, r28 20988: df 91 pop r29 2098a: cf 91 pop r28 2098c: 1f 91 pop r17 2098e: 0f 91 pop r16 20990: ff 90 pop r15 20992: ef 90 pop r14 20994: df 90 pop r13 20996: cf 90 pop r12 20998: bf 90 pop r11 2099a: af 90 pop r10 2099c: 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)) 2099e: 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) { 209a0: cc 16 cp r12, r28 209a2: dd 06 cpc r13, r29 209a4: 28 f7 brcc .-54 ; 0x20970 char c = char(pgm_read_byte(msg)); 209a6: f6 01 movw r30, r12 209a8: 84 91 lpm r24, Z if (c == '\n') { 209aa: 8a 30 cpi r24, 0x0A ; 10 209ac: 09 f3 breq .-62 ; 0x20970 209ae: 0e 94 ab 6a call 0xd556 ; 0xd556 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 209b2: ff ef ldi r31, 0xFF ; 255 209b4: cf 1a sub r12, r31 209b6: df 0a sbc r13, r31 209b8: f3 cf rjmp .-26 ; 0x209a0 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 209ba: d0 e0 ldi r29, 0x00 ; 0 209bc: c0 e0 ldi r28, 0x00 ; 0 209be: e3 cf rjmp .-58 ; 0x20986 000209c0 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 209c0: 89 e4 ldi r24, 0x49 ; 73 209c2: 9b e4 ldi r25, 0x4B ; 75 209c4: 0e 94 32 6d call 0xda64 ; 0xda64 209c8: 0f 94 55 04 call 0x208aa ; 0x208aa menu_back_if_clicked(); 209cc: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 000209d0 : } _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(); 209d0: 0e 94 f0 6f call 0xdfe0 ; 0xdfe0 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 209d4: 10 92 71 03 sts 0x0371, r1 ; 0x800371 } 209d8: 08 95 ret 000209da : //! |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() { 209da: cf 93 push r28 209dc: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 209de: 87 e4 ldi r24, 0x47 ; 71 209e0: 9c e4 ldi r25, 0x4C ; 76 209e2: 0e 94 32 6d call 0xda64 ; 0xda64 209e6: ac 01 movw r20, r24 209e8: 60 e0 ldi r22, 0x00 ; 0 209ea: 80 e0 ldi r24, 0x00 ; 0 209ec: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 1, STR_SEPARATOR); 209f0: 40 e0 ldi r20, 0x00 ; 0 209f2: 54 e8 ldi r21, 0x84 ; 132 209f4: 61 e0 ldi r22, 0x01 ; 1 209f6: 80 e0 ldi r24, 0x00 ; 0 209f8: 0e 94 10 6a call 0xd420 ; 0xd420 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 209fc: 62 e0 ldi r22, 0x02 ; 2 209fe: 80 e0 ldi r24, 0x00 ; 0 20a00: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20a04: 85 ee ldi r24, 0xE5 ; 229 20a06: 9f e0 ldi r25, 0x0F ; 15 20a08: 0f 94 44 a1 call 0x34288 ; 0x34288 20a0c: 9f 93 push r25 20a0e: 8f 93 push r24 20a10: 7f 93 push r23 20a12: 6f 93 push r22 20a14: 1f 92 push r1 20a16: 88 e5 ldi r24, 0x58 ; 88 20a18: 8f 93 push r24 20a1a: c1 e5 ldi r28, 0x51 ; 81 20a1c: d8 e9 ldi r29, 0x98 ; 152 20a1e: df 93 push r29 20a20: cf 93 push r28 20a22: 0e 94 d5 69 call 0xd3aa ; 0xd3aa { 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); 20a26: 63 e0 ldi r22, 0x03 ; 3 20a28: 80 e0 ldi r24, 0x00 ; 0 20a2a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20a2e: 89 ee ldi r24, 0xE9 ; 233 20a30: 9f e0 ldi r25, 0x0F ; 15 20a32: 0f 94 44 a1 call 0x34288 ; 0x34288 20a36: 9f 93 push r25 20a38: 8f 93 push r24 20a3a: 7f 93 push r23 20a3c: 6f 93 push r22 20a3e: 1f 92 push r1 20a40: 89 e5 ldi r24, 0x59 ; 89 20a42: 8f 93 push r24 20a44: df 93 push r29 20a46: cf 93 push r28 20a48: 0e 94 d5 69 call 0xd3aa ; 0xd3aa } menu_back_if_clicked(); 20a4c: 8d b7 in r24, 0x3d ; 61 20a4e: 9e b7 in r25, 0x3e ; 62 20a50: 40 96 adiw r24, 0x10 ; 16 20a52: 0f b6 in r0, 0x3f ; 63 20a54: f8 94 cli 20a56: 9e bf out 0x3e, r25 ; 62 20a58: 0f be out 0x3f, r0 ; 63 20a5a: 8d bf out 0x3d, r24 ; 61 } 20a5c: df 91 pop r29 20a5e: 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(); 20a60: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 00020a64 : //! ---------------------- //! 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() { 20a64: cf 92 push r12 20a66: df 92 push r13 20a68: ef 92 push r14 20a6a: ff 92 push r15 20a6c: 0f 93 push r16 20a6e: 1f 93 push r17 20a70: cf 93 push r28 20a72: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 20a74: 80 e6 ldi r24, 0x60 ; 96 20a76: 9f e0 ldi r25, 0x0F ; 15 20a78: 0f 94 44 a1 call 0x34288 ; 0x34288 20a7c: 6b 01 movw r12, r22 20a7e: 7c 01 movw r14, r24 lcd_home(); 20a80: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P(_N( 20a84: 89 e3 ldi r24, 0x39 ; 57 20a86: 9c e4 ldi r25, 0x4C ; 76 20a88: 0e 94 32 6d call 0xda64 ; 0xda64 20a8c: 18 2f mov r17, r24 20a8e: 09 2f mov r16, r25 20a90: 8b e2 ldi r24, 0x2B ; 43 20a92: 9c e4 ldi r25, 0x4C ; 76 20a94: 0e 94 32 6d call 0xda64 ; 0xda64 20a98: ec 01 movw r28, r24 20a9a: 8b e1 ldi r24, 0x1B ; 27 20a9c: 9c e4 ldi r25, 0x4C ; 76 20a9e: 0e 94 32 6d call 0xda64 ; 0xda64 20aa2: 2e e3 ldi r18, 0x3E ; 62 20aa4: 2f 93 push r18 20aa6: 20 e8 ldi r18, 0x80 ; 128 20aa8: 2f 93 push r18 20aaa: 1f 92 push r1 20aac: 1f 92 push r1 20aae: 0f 93 push r16 20ab0: 1f 93 push r17 20ab2: 2d e3 ldi r18, 0x3D ; 61 20ab4: 2f 93 push r18 20ab6: 25 ef ldi r18, 0xF5 ; 245 20ab8: 2f 93 push r18 20aba: 22 ec ldi r18, 0xC2 ; 194 20abc: 2f 93 push r18 20abe: 20 e9 ldi r18, 0x90 ; 144 20ac0: 2f 93 push r18 20ac2: df 93 push r29 20ac4: cf 93 push r28 20ac6: 20 e0 ldi r18, 0x00 ; 0 20ac8: 34 e8 ldi r19, 0x84 ; 132 20aca: 3f 93 push r19 20acc: 2f 93 push r18 20ace: 9f 93 push r25 20ad0: 8f 93 push r24 20ad2: 81 ea ldi r24, 0xA1 ; 161 20ad4: 9b e6 ldi r25, 0x6B ; 107 20ad6: 9f 93 push r25 20ad8: 8f 93 push r24 20ada: 0e 94 d5 69 call 0xd3aa ; 0xd3aa _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); 20ade: 60 e0 ldi r22, 0x00 ; 0 20ae0: 8f e0 ldi r24, 0x0F ; 15 20ae2: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 if (angleDiff < 100){ 20ae6: 8d b7 in r24, 0x3d ; 61 20ae8: 9e b7 in r25, 0x3e ; 62 20aea: 42 96 adiw r24, 0x12 ; 18 20aec: 0f b6 in r0, 0x3f ; 63 20aee: f8 94 cli 20af0: 9e bf out 0x3e, r25 ; 62 20af2: 0f be out 0x3f, r0 ; 63 20af4: 8d bf out 0x3d, r24 ; 61 20af6: 20 e0 ldi r18, 0x00 ; 0 20af8: 30 e0 ldi r19, 0x00 ; 0 20afa: 48 ec ldi r20, 0xC8 ; 200 20afc: 52 e4 ldi r21, 0x42 ; 66 20afe: c7 01 movw r24, r14 20b00: b6 01 movw r22, r12 20b02: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 20b06: 87 ff sbrs r24, 7 20b08: 32 c0 rjmp .+100 ; 0x20b6e } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 20b0a: 20 e0 ldi r18, 0x00 ; 0 20b0c: 30 e0 ldi r19, 0x00 ; 0 20b0e: 44 e3 ldi r20, 0x34 ; 52 20b10: 53 e4 ldi r21, 0x43 ; 67 20b12: c7 01 movw r24, r14 20b14: b6 01 movw r22, r12 20b16: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 20b1a: 2b ed ldi r18, 0xDB ; 219 20b1c: 3f e0 ldi r19, 0x0F ; 15 20b1e: 49 e4 ldi r20, 0x49 ; 73 20b20: 50 e4 ldi r21, 0x40 ; 64 20b22: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__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)); 20b26: 9f 93 push r25 20b28: 8f 93 push r24 20b2a: 7f 93 push r23 20b2c: 6f 93 push r22 20b2e: 8a e9 ldi r24, 0x9A ; 154 20b30: 9b e6 ldi r25, 0x6B ; 107 20b32: 9f 93 push r25 20b34: 8f 93 push r24 20b36: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 20b3a: 0f 90 pop r0 20b3c: 0f 90 pop r0 20b3e: 0f 90 pop r0 20b40: 0f 90 pop r0 20b42: 0f 90 pop r0 20b44: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 20b46: 0e 94 19 6c call 0xd832 ; 0xd832 20b4a: 88 23 and r24, r24 20b4c: b9 f0 breq .+46 ; 0x20b7c menu_goto(lcd_menu_xyz_offset, 0, true); 20b4e: 20 e0 ldi r18, 0x00 ; 0 20b50: 41 e0 ldi r20, 0x01 ; 1 20b52: 70 e0 ldi r23, 0x00 ; 0 20b54: 60 e0 ldi r22, 0x00 ; 0 20b56: 85 e1 ldi r24, 0x15 ; 21 20b58: 98 e3 ldi r25, 0x38 ; 56 } 20b5a: df 91 pop r29 20b5c: cf 91 pop r28 20b5e: 1f 91 pop r17 20b60: 0f 91 pop r16 20b62: ff 90 pop r15 20b64: ef 90 pop r14 20b66: df 90 pop r13 20b68: 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); 20b6a: 0d 94 46 94 jmp 0x3288c ; 0x3288c ); 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)); 20b6e: 8d ed ldi r24, 0xDD ; 221 20b70: 9d e3 ldi r25, 0x3D ; 61 20b72: 0e 94 32 6d call 0xda64 ; 0xda64 20b76: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 20b7a: e5 cf rjmp .-54 ; 0x20b46 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 20b7c: df 91 pop r29 20b7e: cf 91 pop r28 20b80: 1f 91 pop r17 20b82: 0f 91 pop r16 20b84: ff 90 pop r15 20b86: ef 90 pop r14 20b88: df 90 pop r13 20b8a: cf 90 pop r12 20b8c: 08 95 ret 00020b8e <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 20b8e: 2f 92 push r2 20b90: 3f 92 push r3 20b92: 4f 92 push r4 20b94: 5f 92 push r5 20b96: 6f 92 push r6 20b98: 7f 92 push r7 20b9a: 9f 92 push r9 20b9c: af 92 push r10 20b9e: bf 92 push r11 20ba0: cf 92 push r12 20ba2: df 92 push r13 20ba4: ef 92 push r14 20ba6: ff 92 push r15 20ba8: 0f 93 push r16 20baa: 1f 93 push r17 20bac: cf 93 push r28 20bae: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 20bb0: 70 91 05 12 lds r23, 0x1205 ; 0x801205 20bb4: 71 11 cpse r23, r1 20bb6: 04 c0 rjmp .+8 ; 0x20bc0 <_lcd_move(char const*, unsigned char, int, int)+0x32> 20bb8: 70 91 06 12 lds r23, 0x1206 ; 0x801206 20bbc: 77 23 and r23, r23 20bbe: 99 f0 breq .+38 ; 0x20be6 <_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(); } 20bc0: df 91 pop r29 20bc2: cf 91 pop r28 20bc4: 1f 91 pop r17 20bc6: 0f 91 pop r16 20bc8: ff 90 pop r15 20bca: ef 90 pop r14 20bcc: df 90 pop r13 20bce: cf 90 pop r12 20bd0: bf 90 pop r11 20bd2: af 90 pop r10 20bd4: 9f 90 pop r9 20bd6: 7f 90 pop r7 20bd8: 6f 90 pop r6 20bda: 5f 90 pop r5 20bdc: 4f 90 pop r4 20bde: 3f 90 pop r3 20be0: 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(); 20be2: 0d 94 e4 96 jmp 0x32dc8 ; 0x32dc8 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) 20be6: 70 91 64 03 lds r23, 0x0364 ; 0x800364 20bea: 71 11 cpse r23, r1 20bec: 09 c0 rjmp .+18 ; 0x20c00 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 20bee: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> check_endstops = check; 20bf2: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> { _md->endstopsEnabledPrevious = enable_endstops(false); 20bf6: 70 93 65 03 sts 0x0365, r23 ; 0x800365 _md->initialized = true; 20bfa: 71 e0 ldi r23, 0x01 ; 1 20bfc: 70 93 64 03 sts 0x0364, r23 ; 0x800364 20c00: 19 01 movw r2, r18 20c02: 6a 01 movw r12, r20 20c04: c6 2f mov r28, r22 20c06: d9 2f mov r29, r25 20c08: 98 2e mov r9, r24 } if (lcd_encoder != 0) 20c0a: 80 91 06 05 lds r24, 0x0506 ; 0x800506 20c0e: 90 91 07 05 lds r25, 0x0507 ; 0x800507 20c12: 89 2b or r24, r25 20c14: 09 f4 brne .+2 ; 0x20c18 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 20c16: 71 c0 rjmp .+226 ; 0x20cfa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 20c18: 0e 94 4a 60 call 0xc094 ; 0xc094 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; 20c1c: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 20c20: 8f 5f subi r24, 0xFF ; 255 20c22: 80 31 cpi r24, 0x10 ; 16 20c24: 09 f4 brne .+2 ; 0x20c28 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 20c26: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 20c28: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 20c2c: 98 17 cp r25, r24 20c2e: 09 f4 brne .+2 ; 0x20c32 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 20c30: 64 c0 rjmp .+200 ; 0x20cfa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 20c32: 84 e0 ldi r24, 0x04 ; 4 20c34: c8 9f mul r28, r24 20c36: 80 01 movw r16, r0 20c38: 11 24 eor r1, r1 20c3a: f8 01 movw r30, r16 20c3c: eb 50 subi r30, 0x0B ; 11 20c3e: fe 4e sbci r31, 0xEE ; 238 20c40: 5f 01 movw r10, r30 20c42: 60 91 06 05 lds r22, 0x0506 ; 0x800506 20c46: 70 91 07 05 lds r23, 0x0507 ; 0x800507 20c4a: 07 2e mov r0, r23 20c4c: 00 0c add r0, r0 20c4e: 88 0b sbc r24, r24 20c50: 99 0b sbc r25, r25 20c52: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 20c56: f5 01 movw r30, r10 20c58: 20 81 ld r18, Z 20c5a: 31 81 ldd r19, Z+1 ; 0x01 20c5c: 42 81 ldd r20, Z+2 ; 0x02 20c5e: 53 81 ldd r21, Z+3 ; 0x03 20c60: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 20c64: 2b 01 movw r4, r22 20c66: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20c68: b6 01 movw r22, r12 20c6a: dd 0c add r13, r13 20c6c: 88 0b sbc r24, r24 20c6e: 99 0b sbc r25, r25 20c70: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 20c74: 6b 01 movw r12, r22 20c76: 7c 01 movw r14, r24 20c78: ac 01 movw r20, r24 20c7a: 9b 01 movw r18, r22 20c7c: c3 01 movw r24, r6 20c7e: b2 01 movw r22, r4 20c80: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 20c84: f5 01 movw r30, r10 20c86: 87 fd sbrc r24, 7 20c88: 7d c0 rjmp .+250 ; 0x20d84 <_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; 20c8a: 40 82 st Z, r4 20c8c: 51 82 std Z+1, r5 ; 0x01 20c8e: 62 82 std Z+2, r6 ; 0x02 20c90: 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; 20c92: b1 01 movw r22, r2 20c94: 33 0c add r3, r3 20c96: 88 0b sbc r24, r24 20c98: 99 0b sbc r25, r25 20c9a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 20c9e: 2b 01 movw r4, r22 20ca0: 3c 01 movw r6, r24 20ca2: c8 01 movw r24, r16 20ca4: 8b 50 subi r24, 0x0B ; 11 20ca6: 9e 4e sbci r25, 0xEE ; 238 20ca8: 7c 01 movw r14, r24 20caa: a3 01 movw r20, r6 20cac: 92 01 movw r18, r4 20cae: fc 01 movw r30, r24 20cb0: 60 81 ld r22, Z 20cb2: 71 81 ldd r23, Z+1 ; 0x01 20cb4: 82 81 ldd r24, Z+2 ; 0x02 20cb6: 93 81 ldd r25, Z+3 ; 0x03 20cb8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 20cbc: 18 16 cp r1, r24 20cbe: 2c f4 brge .+10 ; 0x20cca <_lcd_move(char const*, unsigned char, int, int)+0x13c> 20cc0: f7 01 movw r30, r14 20cc2: 40 82 st Z, r4 20cc4: 51 82 std Z+1, r5 ; 0x01 20cc6: 62 82 std Z+2, r6 ; 0x02 20cc8: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 20cca: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20cce: 10 92 06 05 sts 0x0506, r1 ; 0x800506 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 20cd2: 69 ef ldi r22, 0xF9 ; 249 20cd4: 71 e1 ldi r23, 0x11 ; 17 20cd6: 85 ef ldi r24, 0xF5 ; 245 20cd8: 91 e1 ldi r25, 0x11 ; 17 20cda: 0e 94 27 64 call 0xc84e ; 0xc84e plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 20cde: f8 01 movw r30, r16 20ce0: ef 51 subi r30, 0x1F ; 31 20ce2: fd 4f sbci r31, 0xFD ; 253 20ce4: 60 81 ld r22, Z 20ce6: 71 81 ldd r23, Z+1 ; 0x01 20ce8: 82 81 ldd r24, Z+2 ; 0x02 20cea: 93 81 ldd r25, Z+3 ; 0x03 20cec: 0e 94 4e 60 call 0xc09c ; 0xc09c 20cf0: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 lcd_draw_update = 1; 20cf4: 81 e0 ldi r24, 0x01 ; 1 20cf6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 20cfa: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20cfe: 88 23 and r24, r24 20d00: 11 f1 breq .+68 ; 0x20d46 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 20d02: 61 e0 ldi r22, 0x01 ; 1 20d04: 80 e0 ldi r24, 0x00 ; 0 20d06: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 menu_draw_float31(name, current_position[axis]); 20d0a: 84 e0 ldi r24, 0x04 ; 4 20d0c: c8 9f mul r28, r24 20d0e: f0 01 movw r30, r0 20d10: 11 24 eor r1, r1 20d12: eb 50 subi r30, 0x0B ; 11 20d14: 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); 20d16: 83 81 ldd r24, Z+3 ; 0x03 20d18: 8f 93 push r24 20d1a: 82 81 ldd r24, Z+2 ; 0x02 20d1c: 8f 93 push r24 20d1e: 81 81 ldd r24, Z+1 ; 0x01 20d20: 8f 93 push r24 20d22: 80 81 ld r24, Z 20d24: 8f 93 push r24 20d26: df 93 push r29 20d28: 9f 92 push r9 20d2a: 88 e3 ldi r24, 0x38 ; 56 20d2c: 98 e9 ldi r25, 0x98 ; 152 20d2e: 9f 93 push r25 20d30: 8f 93 push r24 20d32: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 20d36: ed b7 in r30, 0x3d ; 61 20d38: fe b7 in r31, 0x3e ; 62 20d3a: 38 96 adiw r30, 0x08 ; 8 20d3c: 0f b6 in r0, 0x3f ; 63 20d3e: f8 94 cli 20d40: fe bf out 0x3e, r31 ; 62 20d42: 0f be out 0x3f, r0 ; 63 20d44: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 20d46: 80 91 92 03 lds r24, 0x0392 ; 0x800392 20d4a: 81 11 cpse r24, r1 20d4c: 04 c0 rjmp .+8 ; 0x20d56 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 20d4e: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20d52: 88 23 and r24, r24 20d54: 21 f0 breq .+8 ; 0x20d5e <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 20d56: 80 91 65 03 lds r24, 0x0365 ; 0x800365 20d5a: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> menu_back_if_clicked(); } 20d5e: df 91 pop r29 20d60: cf 91 pop r28 20d62: 1f 91 pop r17 20d64: 0f 91 pop r16 20d66: ff 90 pop r15 20d68: ef 90 pop r14 20d6a: df 90 pop r13 20d6c: cf 90 pop r12 20d6e: bf 90 pop r11 20d70: af 90 pop r10 20d72: 9f 90 pop r9 20d74: 7f 90 pop r7 20d76: 6f 90 pop r6 20d78: 5f 90 pop r5 20d7a: 4f 90 pop r4 20d7c: 3f 90 pop r3 20d7e: 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(); 20d80: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20d84: c0 82 st Z, r12 20d86: d1 82 std Z+1, r13 ; 0x01 20d88: e2 82 std Z+2, r14 ; 0x02 20d8a: f3 82 std Z+3, r15 ; 0x03 20d8c: 82 cf rjmp .-252 ; 0x20c92 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00020d8e : } // 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); 20d8e: 2a ef ldi r18, 0xFA ; 250 20d90: 30 e0 ldi r19, 0x00 ; 0 20d92: 50 e0 ldi r21, 0x00 ; 0 20d94: 40 e0 ldi r20, 0x00 ; 0 20d96: 60 e0 ldi r22, 0x00 ; 0 20d98: 8c e5 ldi r24, 0x5C ; 92 20d9a: 98 e9 ldi r25, 0x98 ; 152 20d9c: 0d 94 c7 05 jmp 0x20b8e ; 0x20b8e <_lcd_move(char const*, unsigned char, int, int)> 00020da0 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 20da0: 22 ed ldi r18, 0xD2 ; 210 20da2: 30 e0 ldi r19, 0x00 ; 0 20da4: 4c ef ldi r20, 0xFC ; 252 20da6: 5f ef ldi r21, 0xFF ; 255 20da8: 61 e0 ldi r22, 0x01 ; 1 20daa: 8f e5 ldi r24, 0x5F ; 95 20dac: 98 e9 ldi r25, 0x98 ; 152 20dae: 0d 94 c7 05 jmp 0x20b8e ; 0x20b8e <_lcd_move(char const*, unsigned char, int, int)> 00020db2 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 20db2: 22 ed ldi r18, 0xD2 ; 210 20db4: 30 e0 ldi r19, 0x00 ; 0 20db6: 50 e0 ldi r21, 0x00 ; 0 20db8: 40 e0 ldi r20, 0x00 ; 0 20dba: 62 e0 ldi r22, 0x02 ; 2 20dbc: 82 e6 ldi r24, 0x62 ; 98 20dbe: 98 e9 ldi r25, 0x98 ; 152 20dc0: 0d 94 c7 05 jmp 0x20b8e ; 0x20b8e <_lcd_move(char const*, unsigned char, int, int)> 00020dc4 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20dc4: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20dc8: 81 11 cpse r24, r1 20dca: 03 c0 rjmp .+6 ; 0x20dd2 20dcc: 82 e0 ldi r24, 0x02 ; 2 20dce: 0d 94 c8 96 jmp 0x32d90 ; 0x32d90 20dd2: 81 e0 ldi r24, 0x01 ; 1 20dd4: fc cf rjmp .-8 ; 0x20dce 00020dd6 : } // 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); 20dd6: 5f 93 push r21 20dd8: 4f 93 push r20 20dda: 7f 93 push r23 20ddc: 6f 93 push r22 20dde: 28 2f mov r18, r24 20de0: 08 2e mov r0, r24 20de2: 00 0c add r0, r0 20de4: 33 0b sbc r19, r19 20de6: 3f 93 push r19 20de8: 8f 93 push r24 20dea: 86 e7 ldi r24, 0x76 ; 118 20dec: 9a e6 ldi r25, 0x6A ; 106 20dee: 9f 93 push r25 20df0: 8f 93 push r24 20df2: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_space(9 - chars); 20df6: 2d b7 in r18, 0x3d ; 61 20df8: 3e b7 in r19, 0x3e ; 62 20dfa: 28 5f subi r18, 0xF8 ; 248 20dfc: 3f 4f sbci r19, 0xFF ; 255 20dfe: 0f b6 in r0, 0x3f ; 63 20e00: f8 94 cli 20e02: 3e bf out 0x3e, r19 ; 62 20e04: 0f be out 0x3f, r0 ; 63 20e06: 2d bf out 0x3d, r18 ; 61 20e08: 99 e0 ldi r25, 0x09 ; 9 20e0a: 98 1b sub r25, r24 20e0c: 89 2f mov r24, r25 20e0e: 0c 94 f2 69 jmp 0xd3e4 ; 0xd3e4 00020e12 : default: return false; } } void lcd_print_target_temps_first_line() { 20e12: cf 93 push r28 20e14: df 93 push r29 lcd_home(); 20e16: 0e 94 28 6a call 0xd450 ; 0xd450 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 20e1a: c0 91 f1 11 lds r28, 0x11F1 ; 0x8011f1 20e1e: d0 91 f2 11 lds r29, 0x11F2 ; 0x8011f2 20e22: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 20e26: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20e2a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20e2e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20e32: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 20e36: ae 01 movw r20, r28 20e38: 82 e8 ldi r24, 0x82 ; 130 20e3a: 0f 94 eb 06 call 0x20dd6 ; 0x20dd6 lcd_set_cursor(10, 0); 20e3e: 60 e0 ldi r22, 0x00 ; 0 20e40: 8a e0 ldi r24, 0x0A ; 10 20e42: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 20e46: c0 91 ed 11 lds r28, 0x11ED ; 0x8011ed 20e4a: d0 91 ee 11 lds r29, 0x11EE ; 0x8011ee int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 20e4e: 20 97 sbiw r28, 0x00 ; 0 20e50: 81 f0 breq .+32 ; 0x20e72 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 20e52: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20e56: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20e5a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20e5e: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20e62: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 20e66: ae 01 movw r20, r28 20e68: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 20e6a: df 91 pop r29 20e6c: 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); 20e6e: 0d 94 eb 06 jmp 0x20dd6 ; 0x20dd6 } else { lcd_space(10); 20e72: 8a e0 ldi r24, 0x0A ; 10 } } 20e74: df 91 pop r29 20e76: 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); 20e78: 0c 94 f2 69 jmp 0xd3e4 ; 0xd3e4 00020e7c : 20e7c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 20e80: 0f 94 09 07 call 0x20e12 ; 0x20e12 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 20e84: 84 ea ldi r24, 0xA4 ; 164 20e86: 9a e4 ldi r25, 0x4A ; 74 20e88: 0e 94 32 6d call 0xda64 ; 0xda64 20e8c: ac 01 movw r20, r24 20e8e: 61 e0 ldi r22, 0x01 ; 1 20e90: 80 e0 ldi r24, 0x00 ; 0 20e92: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(0,2); 20e96: 62 e0 ldi r22, 0x02 ; 2 20e98: 80 e0 ldi r24, 0x00 ; 0 20e9a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 switch(eFilamentAction) { 20e9e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20ea2: 83 30 cpi r24, 0x03 ; 3 20ea4: 81 f1 breq .+96 ; 0x20f06 20ea6: 48 f4 brcc .+18 ; 0x20eba 20ea8: 81 30 cpi r24, 0x01 ; 1 20eaa: 60 f0 brcs .+24 ; 0x20ec4 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 20eac: 81 e9 ldi r24, 0x91 ; 145 20eae: 9a e4 ldi r25, 0x4A ; 74 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 20eb0: 0e 94 32 6d call 0xda64 ; 0xda64 20eb4: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 20eb8: 05 c0 rjmp .+10 ; 0x20ec4 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) { 20eba: 85 30 cpi r24, 0x05 ; 5 20ebc: 21 f1 breq .+72 ; 0x20f06 20ebe: b0 f3 brcs .-20 ; 0x20eac 20ec0: 88 30 cpi r24, 0x08 ; 8 20ec2: a1 f3 breq .-24 ; 0x20eac case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 20ec4: 0e 94 19 6c call 0xd832 ; 0xd832 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 20ec8: 81 11 cpse r24, r1 20eca: 09 c0 rjmp .+18 ; 0x20ede 20ecc: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20ed0: 81 50 subi r24, 0x01 ; 1 20ed2: 82 30 cpi r24, 0x02 ; 2 20ed4: 28 f5 brcc .+74 ; 0x20f20 20ed6: 80 91 88 16 lds r24, 0x1688 ; 0x801688 20eda: 88 23 and r24, r24 20edc: 09 f1 breq .+66 ; 0x20f20 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 20ede: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20ee2: 81 11 cpse r24, r1 20ee4: 13 c0 rjmp .+38 ; 0x20f0c 20ee6: 83 e0 ldi r24, 0x03 ; 3 20ee8: 0f 94 c8 96 call 0x32d90 ; 0x32d90 switch(eFilamentAction) { 20eec: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20ef0: 82 30 cpi r24, 0x02 ; 2 20ef2: 71 f0 breq .+28 ; 0x20f10 20ef4: 83 30 cpi r24, 0x03 ; 3 20ef6: 81 f0 breq .+32 ; 0x20f18 20ef8: 81 30 cpi r24, 0x01 ; 1 20efa: 91 f4 brne .+36 ; 0x20f20 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 20efc: 61 e0 ldi r22, 0x01 ; 1 20efe: 87 e3 ldi r24, 0x37 ; 55 20f00: 9b e6 ldi r25, 0x6B ; 107 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20f02: 0c 94 37 7d jmp 0xfa6e ; 0xfa6e 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)); 20f06: 8c e7 ldi r24, 0x7C ; 124 20f08: 9a e4 ldi r25, 0x4A ; 74 20f0a: d2 cf rjmp .-92 ; 0x20eb0 #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); 20f0c: 82 e0 ldi r24, 0x02 ; 2 20f0e: ec cf rjmp .-40 ; 0x20ee8 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 20f10: 81 e0 ldi r24, 0x01 ; 1 20f12: 80 93 62 03 sts 0x0362, r24 ; 0x800362 20f16: f2 cf rjmp .-28 ; 0x20efc [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20f18: 61 e0 ldi r22, 0x01 ; 1 20f1a: 81 eb ldi r24, 0xB1 ; 177 20f1c: 98 e6 ldi r25, 0x68 ; 104 20f1e: f1 cf rjmp .-30 ; 0x20f02 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 20f20: 08 95 ret 00020f22 : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 20f22: 80 e0 ldi r24, 0x00 ; 0 20f24: 0c 94 de 74 jmp 0xe9bc ; 0xe9bc 00020f28 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 20f28: ef 92 push r14 20f2a: ff 92 push r15 20f2c: 0f 93 push r16 20f2e: 1f 93 push r17 20f30: cf 93 push r28 20f32: 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) 20f34: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20f38: 88 23 and r24, r24 20f3a: 29 f0 breq .+10 ; 0x20f46 20f3c: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 20f40: 92 30 cpi r25, 0x02 ; 2 20f42: 09 f0 breq .+2 ; 0x20f46 20f44: 74 c1 rjmp .+744 ; 0x2122e { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 20f46: 81 e0 ldi r24, 0x01 ; 1 20f48: 80 93 64 03 sts 0x0364, r24 ; 0x800364 20f4c: 80 91 db 15 lds r24, 0x15DB ; 0x8015db _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 20f50: 80 93 65 03 sts 0x0365, r24 ; 0x800365 if (_md->is_flash_air) { 20f54: 88 23 and r24, r24 20f56: 21 f0 breq .+8 ; 0x20f60 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 20f58: 86 e6 ldi r24, 0x66 ; 102 20f5a: 93 e0 ldi r25, 0x03 ; 3 20f5c: 0f 94 e7 52 call 0x2a5ce ; 0x2a5ce { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20f60: 0f 94 1c 94 call 0x32838 ; 0x32838 20f64: 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); 20f68: 86 e9 ldi r24, 0x96 ; 150 20f6a: e8 2e mov r14, r24 20f6c: 86 e9 ldi r24, 0x96 ; 150 20f6e: 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]); 20f70: c5 e6 ldi r28, 0x65 ; 101 20f72: d6 e9 ldi r29, 0x96 ; 150 20f74: 0a e6 ldi r16, 0x6A ; 106 20f76: 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(); 20f78: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20f7c: 84 30 cpi r24, 0x04 ; 4 20f7e: 08 f0 brcs .+2 ; 0x20f82 20f80: 7d c1 rjmp .+762 ; 0x2127c 20f82: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20f86: 8a e5 ldi r24, 0x5A ; 90 20f88: 9e e3 ldi r25, 0x3E ; 62 20f8a: 0e 94 32 6d call 0xda64 ; 0xda64 20f8e: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR("Firmware:")); 20f92: 8a ef ldi r24, 0xFA ; 250 20f94: 96 e9 ldi r25, 0x96 ; 150 20f96: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20f9a: 8d ee ldi r24, 0xED ; 237 20f9c: 96 e9 ldi r25, 0x96 ; 150 20f9e: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20fa2: 8f ed ldi r24, 0xDF ; 223 20fa4: 96 e9 ldi r25, 0x96 ; 150 20fa6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 20faa: 8f ec ldi r24, 0xCF ; 207 20fac: 96 e9 ldi r25, 0x96 ; 150 20fae: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 20fb2: 8b e2 ldi r24, 0x2B ; 43 20fb4: 9b e6 ldi r25, 0x6B ; 107 20fb6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 20fba: 89 e1 ldi r24, 0x19 ; 25 20fbc: 9b e6 ldi r25, 0x6B ; 107 20fbe: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 20fc2: 88 e0 ldi r24, 0x08 ; 8 20fc4: 9b e6 ldi r25, 0x6B ; 107 20fc6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(STR_SEPARATOR); 20fca: 80 e0 ldi r24, 0x00 ; 0 20fcc: 94 e8 ldi r25, 0x84 ; 132 20fce: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 20fd2: 82 ec ldi r24, 0xC2 ; 194 20fd4: 96 e9 ldi r25, 0x96 ; 150 20fd6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 20fda: 89 eb ldi r24, 0xB9 ; 185 20fdc: 96 e9 ldi r25, 0x96 ; 150 20fde: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 20fe2: 8f ea ldi r24, 0xAF ; 175 20fe4: 96 e9 ldi r25, 0x96 ; 150 20fe6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(STR_SEPARATOR); 20fea: 80 e0 ldi r24, 0x00 ; 0 20fec: 94 e8 ldi r25, 0x84 ; 132 20fee: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(_T(MSG_DATE)); 20ff2: 84 e7 ldi r24, 0x74 ; 116 20ff4: 9a e4 ldi r25, 0x4A ; 74 20ff6: 0e 94 32 6d call 0xda64 ; 0xda64 20ffa: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 20ffe: 84 ea ldi r24, 0xA4 ; 164 21000: 96 e9 ldi r25, 0x96 ; 150 21002: 0f 94 e7 96 call 0x32dce ; 0x32dce 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); 21006: 80 e0 ldi r24, 0x00 ; 0 21008: 94 e8 ldi r25, 0x84 ; 132 2100a: 0f 94 e7 96 call 0x32dce ; 0x32dce if (MMU2::mmu2.Enabled()) 2100e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21012: 81 30 cpi r24, 0x01 ; 1 21014: 09 f0 breq .+2 ; 0x21018 21016: 2d c1 rjmp .+602 ; 0x21272 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 21018: 84 e6 ldi r24, 0x64 ; 100 2101a: 9a e4 ldi r25, 0x4A ; 74 2101c: 0e 94 32 6d call 0xda64 ; 0xda64 21020: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 21024: 8f e9 ldi r24, 0x9F ; 159 21026: 96 e9 ldi r25, 0x96 ; 150 21028: 0f 94 e7 96 call 0x32dce ; 0x32dce if (((menu_item - 1) == menu_line) && lcd_draw_update) 2102c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 21030: 81 50 subi r24, 0x01 ; 1 21032: 99 0b sbc r25, r25 21034: 20 91 30 04 lds r18, 0x0430 ; 0x800430 21038: 28 17 cp r18, r24 2103a: 19 06 cpc r1, r25 2103c: 49 f5 brne .+82 ; 0x21090 2103e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21042: 88 23 and r24, r24 21044: 29 f1 breq .+74 ; 0x21090 { lcd_set_cursor(6, menu_row); 21046: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 2104a: 86 e0 ldi r24, 0x06 ; 6 2104c: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 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) { 21050: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21054: 81 30 cpi r24, 0x01 ; 1 21056: 09 f0 breq .+2 ; 0x2105a 21058: 05 c1 rjmp .+522 ; 0x21264 2105a: 80 91 74 12 lds r24, 0x1274 ; 0x801274 2105e: 90 91 75 12 lds r25, 0x1275 ; 0x801275 21062: 20 91 76 12 lds r18, 0x1276 ; 0x801276 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 21066: 88 23 and r24, r24 21068: 09 f4 brne .+2 ; 0x2106c 2106a: fc c0 rjmp .+504 ; 0x21264 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 2106c: 1f 92 push r1 2106e: 2f 93 push r18 21070: 1f 92 push r1 21072: 9f 93 push r25 21074: 1f 92 push r1 21076: 8f 93 push r24 21078: ff 92 push r15 2107a: ef 92 push r14 2107c: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 21080: 8d b7 in r24, 0x3d ; 61 21082: 9e b7 in r25, 0x3e ; 62 21084: 08 96 adiw r24, 0x08 ; 8 21086: 0f b6 in r0, 0x3f ; 63 21088: f8 94 cli 2108a: 9e bf out 0x3e, r25 ; 62 2108c: 0f be out 0x3f, r0 ; 63 2108e: 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) { 21090: 80 91 65 03 lds r24, 0x0365 ; 0x800365 21094: 88 23 and r24, r24 21096: 09 f4 brne .+2 ; 0x2109a 21098: 40 c0 rjmp .+128 ; 0x2111a MENU_ITEM_BACK_P(STR_SEPARATOR); 2109a: 80 e0 ldi r24, 0x00 ; 0 2109c: 94 e8 ldi r25, 0x84 ; 132 2109e: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 210a2: 85 e7 ldi r24, 0x75 ; 117 210a4: 96 e9 ldi r25, 0x96 ; 150 210a6: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" ")); 210aa: 83 e7 ldi r24, 0x73 ; 115 210ac: 96 e9 ldi r25, 0x96 ; 150 210ae: 0f 94 e7 96 call 0x32dce ; 0x32dce if (((menu_item - 1) == menu_line) && lcd_draw_update) { 210b2: 80 91 31 04 lds r24, 0x0431 ; 0x800431 210b6: 81 50 subi r24, 0x01 ; 1 210b8: 99 0b sbc r25, r25 210ba: 20 91 30 04 lds r18, 0x0430 ; 0x800430 210be: 28 17 cp r18, r24 210c0: 19 06 cpc r1, r25 210c2: 59 f5 brne .+86 ; 0x2111a 210c4: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 210c8: 88 23 and r24, r24 210ca: 39 f1 breq .+78 ; 0x2111a lcd_set_cursor(2, menu_row); 210cc: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 210d0: 82 e0 ldi r24, 0x02 ; 2 210d2: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 210d6: 80 91 69 03 lds r24, 0x0369 ; 0x800369 210da: 1f 92 push r1 210dc: 8f 93 push r24 210de: 80 91 68 03 lds r24, 0x0368 ; 0x800368 210e2: 1f 92 push r1 210e4: 8f 93 push r24 210e6: 80 91 67 03 lds r24, 0x0367 ; 0x800367 210ea: 1f 92 push r1 210ec: 8f 93 push r24 210ee: 80 91 66 03 lds r24, 0x0366 ; 0x800366 210f2: 1f 92 push r1 210f4: 8f 93 push r24 210f6: df 93 push r29 210f8: cf 93 push r28 210fa: 1f 93 push r17 210fc: 0f 93 push r16 210fe: 0f 94 53 a0 call 0x340a6 ; 0x340a6 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 21102: 8a e6 ldi r24, 0x6A ; 106 21104: 93 e0 ldi r25, 0x03 ; 3 21106: 0e 94 03 6c call 0xd806 ; 0xd806 2110a: 8d b7 in r24, 0x3d ; 61 2110c: 9e b7 in r25, 0x3e ; 62 2110e: 0c 96 adiw r24, 0x0c ; 12 21110: 0f b6 in r0, 0x3f ; 63 21112: f8 94 cli 21114: 9e bf out 0x3e, r25 ; 62 21116: 0f be out 0x3f, r0 ; 63 21118: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 2111a: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 2111e: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 21122: a0 91 7f 06 lds r26, 0x067F ; 0x80067f 21126: b0 91 80 06 lds r27, 0x0680 ; 0x800680 2112a: 89 2b or r24, r25 2112c: 8a 2b or r24, r26 2112e: 8b 2b or r24, r27 21130: 09 f4 brne .+2 ; 0x21134 21132: 42 c0 rjmp .+132 ; 0x211b8 MENU_ITEM_BACK_P(STR_SEPARATOR); 21134: 80 e0 ldi r24, 0x00 ; 0 21136: 94 e8 ldi r25, 0x84 ; 132 21138: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 2113c: 87 e4 ldi r24, 0x47 ; 71 2113e: 9a e4 ldi r25, 0x4A ; 74 21140: 0e 94 32 6d call 0xda64 ; 0xda64 21144: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_BACK_P(PSTR(" ")); 21148: 81 e7 ldi r24, 0x71 ; 113 2114a: 96 e9 ldi r25, 0x96 ; 150 2114c: 0f 94 e7 96 call 0x32dce ; 0x32dce if (((menu_item - 1) == menu_line) && lcd_draw_update) { 21150: 80 91 31 04 lds r24, 0x0431 ; 0x800431 21154: 81 50 subi r24, 0x01 ; 1 21156: 99 0b sbc r25, r25 21158: 20 91 30 04 lds r18, 0x0430 ; 0x800430 2115c: 28 17 cp r18, r24 2115e: 19 06 cpc r1, r25 21160: 59 f5 brne .+86 ; 0x211b8 21162: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21166: 88 23 and r24, r24 21168: 39 f1 breq .+78 ; 0x211b8 lcd_set_cursor(2, menu_row); 2116a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 2116e: 82 e0 ldi r24, 0x02 ; 2 21170: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 21174: 80 91 80 06 lds r24, 0x0680 ; 0x800680 21178: 1f 92 push r1 2117a: 8f 93 push r24 2117c: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 21180: 1f 92 push r1 21182: 8f 93 push r24 21184: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 21188: 1f 92 push r1 2118a: 8f 93 push r24 2118c: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 21190: 1f 92 push r1 21192: 8f 93 push r24 21194: df 93 push r29 21196: cf 93 push r28 21198: 1f 93 push r17 2119a: 0f 93 push r16 2119c: 0f 94 53 a0 call 0x340a6 ; 0x340a6 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 211a0: 8a e6 ldi r24, 0x6A ; 106 211a2: 93 e0 ldi r25, 0x03 ; 3 211a4: 0e 94 03 6c call 0xd806 ; 0xd806 211a8: 8d b7 in r24, 0x3d ; 61 211aa: 9e b7 in r25, 0x3e ; 62 211ac: 0c 96 adiw r24, 0x0c ; 12 211ae: 0f b6 in r0, 0x3f ; 63 211b0: f8 94 cli 211b2: 9e bf out 0x3e, r25 ; 62 211b4: 0f be out 0x3f, r0 ; 63 211b6: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 211b8: 80 e0 ldi r24, 0x00 ; 0 211ba: 94 e8 ldi r25, 0x84 ; 132 211bc: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 211c0: 84 e3 ldi r24, 0x34 ; 52 211c2: 9a e4 ldi r25, 0x4A ; 74 211c4: 0e 94 32 6d call 0xda64 ; 0xda64 211c8: 65 e6 ldi r22, 0x65 ; 101 211ca: 78 e3 ldi r23, 0x38 ; 56 211cc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 211d0: 84 e2 ldi r24, 0x24 ; 36 211d2: 9a e4 ldi r25, 0x4A ; 74 211d4: 0e 94 32 6d call 0xda64 ; 0xda64 211d8: 6d ed ldi r22, 0xDD ; 221 211da: 78 e3 ldi r23, 0x38 ; 56 211dc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 211e0: 86 e1 ldi r24, 0x16 ; 22 211e2: 9a e4 ldi r25, 0x4A ; 74 211e4: 0e 94 32 6d call 0xda64 ; 0xda64 211e8: 69 e2 ldi r22, 0x29 ; 41 211ea: 77 e3 ldi r23, 0x37 ; 55 211ec: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #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); 211f0: 87 e0 ldi r24, 0x07 ; 7 211f2: 9a e4 ldi r25, 0x4A ; 74 211f4: 0e 94 32 6d call 0xda64 ; 0xda64 211f8: 6f e5 ldi r22, 0x5F ; 95 211fa: 77 e3 ldi r23, 0x37 ; 55 211fc: 0f 94 9a 96 call 0x32d34 ; 0x32d34 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 21200: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 21204: 88 23 and r24, r24 21206: 31 f0 breq .+12 ; 0x21214 MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 21208: 6b e1 ldi r22, 0x1B ; 27 2120a: 77 e3 ldi r23, 0x37 ; 55 2120c: 89 ef ldi r24, 0xF9 ; 249 2120e: 9a e6 ldi r25, 0x6A ; 106 21210: 0f 94 99 93 call 0x32732 ; 0x32732 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(); 21214: 0f 94 f0 93 call 0x327e0 ; 0x327e0 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 21218: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 2121c: 8f 5f subi r24, 0xFF ; 255 2121e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 21222: 80 91 30 04 lds r24, 0x0430 ; 0x800430 21226: 8f 5f subi r24, 0xFF ; 255 21228: 80 93 30 04 sts 0x0430, r24 ; 0x800430 2122c: a5 ce rjmp .-694 ; 0x20f78 _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) 2122e: 90 91 65 03 lds r25, 0x0365 ; 0x800365 21232: 99 23 and r25, r25 21234: 09 f4 brne .+2 ; 0x21238 21236: 94 ce rjmp .-728 ; 0x20f60 21238: 40 91 66 03 lds r20, 0x0366 ; 0x800366 2123c: 50 91 67 03 lds r21, 0x0367 ; 0x800367 21240: 60 91 68 03 lds r22, 0x0368 ; 0x800368 21244: 70 91 69 03 lds r23, 0x0369 ; 0x800369 21248: 45 2b or r20, r21 2124a: 46 2b or r20, r22 2124c: 47 2b or r20, r23 2124e: 09 f0 breq .+2 ; 0x21252 21250: 87 ce rjmp .-754 ; 0x20f60 21252: 8f 5f subi r24, 0xFF ; 255 21254: 80 31 cpi r24, 0x10 ; 16 21256: 19 f0 breq .+6 ; 0x2125e 21258: 80 93 64 03 sts 0x0364, r24 ; 0x800364 2125c: 81 ce rjmp .-766 ; 0x20f60 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 2125e: 10 92 64 03 sts 0x0364, r1 ; 0x800364 21262: 7e ce rjmp .-772 ; 0x20f60 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)); 21264: 8a e5 ldi r24, 0x5A ; 90 21266: 9a e4 ldi r25, 0x4A ; 74 21268: 0e 94 32 6d call 0xda64 ; 0xda64 2126c: 0e 94 e7 69 call 0xd3ce ; 0xd3ce 21270: 0f cf rjmp .-482 ; 0x21090 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 21272: 87 e8 ldi r24, 0x87 ; 135 21274: 96 e9 ldi r25, 0x96 ; 150 21276: 0f 94 e7 96 call 0x32dce ; 0x32dce 2127a: 0a cf rjmp .-492 ; 0x21090 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 2127c: df 91 pop r29 2127e: cf 91 pop r28 21280: 1f 91 pop r17 21282: 0f 91 pop r16 21284: ff 90 pop r15 21286: ef 90 pop r14 21288: 08 95 ret 0002128a : { 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) { 2128a: 80 91 64 03 lds r24, 0x0364 ; 0x800364 2128e: 81 11 cpse r24, r1 21290: 19 c0 rjmp .+50 ; 0x212c4 lcd_clear(); 21292: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 21296: 8e eb ldi r24, 0xBE ; 190 21298: 99 e4 ldi r25, 0x49 ; 73 2129a: 0e 94 32 6d call 0xda64 ; 0xda64 2129e: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_putc(':'); 212a2: 8a e3 ldi r24, 0x3A ; 58 212a4: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_set_cursor(10, 1); 212a8: 61 e0 ldi r22, 0x01 ; 1 212aa: 8a e0 ldi r24, 0x0A ; 10 212ac: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 212b0: 88 ea ldi r24, 0xA8 ; 168 212b2: 9c e0 ldi r25, 0x0C ; 12 212b4: 0f 94 44 a1 call 0x34288 ; 0x34288 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 212b8: 4a e0 ldi r20, 0x0A ; 10 212ba: 0e 94 50 6b call 0xd6a0 ; 0xd6a0 _md->initialized = true; 212be: 81 e0 ldi r24, 0x01 ; 1 212c0: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } menu_back_if_clicked(); 212c4: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 000212c8 : } 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){ 212c8: 0f 93 push r16 212ca: 1f 93 push r17 212cc: cf 93 push r28 212ce: df 93 push r29 212d0: ec 01 movw r28, r24 212d2: cb 01 movw r24, r22 212d4: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 212d6: 4a 81 ldd r20, Y+2 ; 0x02 212d8: 41 30 cpi r20, 0x01 ; 1 212da: 29 f0 breq .+10 ; 0x212e6 212dc: 88 f0 brcs .+34 ; 0x21300 212de: 42 30 cpi r20, 0x02 ; 2 212e0: 09 f1 breq .+66 ; 0x21324 212e2: 43 30 cpi r20, 0x03 ; 3 212e4: d1 f4 brne .+52 ; 0x2131a 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 ){ 212e6: 8b 81 ldd r24, Y+3 ; 0x03 212e8: 81 11 cpse r24, r1 212ea: 25 c0 rjmp .+74 ; 0x21336 state = next_state; // advance to the next state 212ec: 82 e0 ldi r24, 0x02 ; 2 212ee: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 212f0: 63 e0 ldi r22, 0x03 ; 3 212f2: 89 e8 ldi r24, 0x89 ; 137 212f4: 95 e9 ldi r25, 0x95 ; 149 212f6: 0e 94 2f e2 call 0x1c45e ; 0x1c45e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 212fa: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 212fc: 8b 83 std Y+3, r24 ; 0x03 212fe: 0d c0 rjmp .+26 ; 0x2131a //! @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 ){ 21300: a9 01 movw r20, r18 21302: 98 01 movw r18, r16 21304: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 21308: 18 16 cp r1, r24 2130a: 3c f4 brge .+14 ; 0x2131a lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 2130c: 63 e0 ldi r22, 0x03 ; 3 2130e: 88 81 ld r24, Y 21310: 99 81 ldd r25, Y+1 ; 0x01 21312: 0e 94 2f e2 call 0x1c45e ; 0x1c45e state = States::TempAboveMintemp; 21316: 81 e0 ldi r24, 0x01 ; 1 21318: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 2131a: df 91 pop r29 2131c: cf 91 pop r28 2131e: 1f 91 pop r17 21320: 0f 91 pop r16 21322: 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 ){ 21324: 8b 81 ldd r24, Y+3 ; 0x03 21326: 81 11 cpse r24, r1 21328: 06 c0 rjmp .+12 ; 0x21336 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); 2132a: 88 81 ld r24, Y 2132c: 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 2132e: 23 e0 ldi r18, 0x03 ; 3 21330: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 21332: 63 e0 ldi r22, 0x03 ; 3 21334: e0 cf rjmp .-64 ; 0x212f6 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 21336: 81 50 subi r24, 0x01 ; 1 21338: e1 cf rjmp .-62 ; 0x212fc 0002133a : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 2133a: cf 93 push r28 2133c: df 93 push r29 if(IsStopped() == false) { 2133e: 90 91 ce 11 lds r25, 0x11CE ; 0x8011ce 21342: 91 11 cpse r25, r1 21344: 21 c0 rjmp .+66 ; 0x21388 21346: c6 2f mov r28, r22 21348: d8 2f mov r29, r24 if (isPreheat) { 2134a: 88 23 and r24, r24 2134c: 09 f1 breq .+66 ; 0x21390 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 2134e: 8d e2 ldi r24, 0x2D ; 45 21350: 95 e9 ldi r25, 0x95 ; 149 21352: 66 23 and r22, r22 21354: 11 f0 breq .+4 ; 0x2135a 21356: 8b e3 ldi r24, 0x3B ; 59 21358: 95 e9 ldi r25, 0x95 ; 149 2135a: 63 e0 ldi r22, 0x03 ; 3 2135c: 0e 94 2f e2 call 0x1c45e ; 0x1c45e SERIAL_ERROR_START; 21360: 8a e5 ldi r24, 0x5A ; 90 21362: 9e e9 ldi r25, 0x9E ; 158 21364: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 21368: 8a e0 ldi r24, 0x0A ; 10 2136a: 95 e9 ldi r25, 0x95 ; 149 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 2136c: c1 11 cpse r28, r1 2136e: 02 c0 rjmp .+4 ; 0x21374 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 21370: 88 ee ldi r24, 0xE8 ; 232 21372: 94 e9 ldi r25, 0x94 ; 148 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"); 21374: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 } } prusa_statistics(0); 21378: 80 e0 ldi r24, 0x00 ; 0 2137a: 0f 94 5f 99 call 0x332be ; 0x332be prusa_statistics(isPreheat? 91 : 90); 2137e: 8a e5 ldi r24, 0x5A ; 90 21380: d1 11 cpse r29, r1 21382: 8b e5 ldi r24, 0x5B ; 91 21384: 0f 94 5f 99 call 0x332be ; 0x332be } ThermalStop(); } 21388: df 91 pop r29 2138a: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 2138c: 0d 94 8b 43 jmp 0x28716 ; 0x28716 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); 21390: 84 ec ldi r24, 0xC4 ; 196 21392: 94 e9 ldi r25, 0x94 ; 148 21394: 66 23 and r22, r22 21396: 11 f0 breq .+4 ; 0x2139c 21398: 84 ed ldi r24, 0xD4 ; 212 2139a: 94 e9 ldi r25, 0x94 ; 148 2139c: 63 e0 ldi r22, 0x03 ; 3 2139e: 0e 94 2f e2 call 0x1c45e ; 0x1c45e SERIAL_ERROR_START; 213a2: 8a e5 ldi r24, 0x5A ; 90 213a4: 9e e9 ldi r25, 0x9E ; 158 213a6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 213aa: 8b ea ldi r24, 0xAB ; 171 213ac: 94 e9 ldi r25, 0x94 ; 148 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) { 213ae: c1 11 cpse r28, r1 213b0: e1 cf rjmp .-62 ; 0x21374 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 213b2: 83 e9 ldi r24, 0x93 ; 147 213b4: 94 e9 ldi r25, 0x94 ; 148 213b6: de cf rjmp .-68 ; 0x21374 000213b8 : } static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 213b8: 9f b7 in r25, 0x3f ; 63 213ba: f8 94 cli 213bc: e2 e0 ldi r30, 0x02 ; 2 213be: f1 e0 ldi r31, 0x01 ; 1 213c0: 80 81 ld r24, Z 213c2: 84 60 ori r24, 0x04 ; 4 213c4: 80 83 st Z, r24 213c6: 9f bf out 0x3f, r25 ; 63 213c8: 2f ef ldi r18, 0xFF ; 255 213ca: 89 e6 ldi r24, 0x69 ; 105 213cc: 98 e1 ldi r25, 0x18 ; 24 213ce: 21 50 subi r18, 0x01 ; 1 213d0: 80 40 sbci r24, 0x00 ; 0 213d2: 90 40 sbci r25, 0x00 ; 0 213d4: e1 f7 brne .-8 ; 0x213ce 213d6: 00 c0 rjmp .+0 ; 0x213d8 213d8: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 213da: 9f b7 in r25, 0x3f ; 63 213dc: f8 94 cli 213de: 80 81 ld r24, Z 213e0: 8b 7f andi r24, 0xFB ; 251 213e2: 80 83 st Z, r24 213e4: 9f bf out 0x3f, r25 ; 63 } 213e6: 08 95 ret 000213e8 : 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() { 213e8: cf 93 push r28 213ea: 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); 213ec: 80 91 40 02 lds r24, 0x0240 ; 0x800240 213f0: 88 23 and r24, r24 213f2: 89 f0 breq .+34 ; 0x21416 213f4: 81 e7 ldi r24, 0x71 ; 113 213f6: 9b e5 ldi r25, 0x5B ; 91 213f8: 0e 94 32 6d call 0xda64 ; 0xda64 213fc: ec 01 movw r28, r24 213fe: 85 e3 ldi r24, 0x35 ; 53 21400: 96 e5 ldi r25, 0x56 ; 86 21402: 0e 94 32 6d call 0xda64 ; 0xda64 21406: 22 e0 ldi r18, 0x02 ; 2 21408: 42 ef ldi r20, 0xF2 ; 242 2140a: 5c ef ldi r21, 0xFC ; 252 2140c: be 01 movw r22, r28 } 2140e: df 91 pop r29 21410: 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); 21412: 0d 94 ab 95 jmp 0x32b56 ; 0x32b56 21416: 8b e6 ldi r24, 0x6B ; 107 21418: 9b e5 ldi r25, 0x5B ; 91 2141a: ee cf rjmp .-36 ; 0x213f8 0002141c : } #endif // TMC2130 } } static void menuitems_temperature_common() { 2141c: ef 92 push r14 2141e: ff 92 push r15 21420: 0f 93 push r16 21422: 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); 21424: 8a e4 ldi r24, 0x4A ; 74 21426: 96 e5 ldi r25, 0x56 ; 86 21428: 0e 94 32 6d call 0xda64 ; 0xda64 2142c: 28 ec ldi r18, 0xC8 ; 200 2142e: e2 2e mov r14, r18 21430: f1 2c mov r15, r1 21432: 07 e2 ldi r16, 0x27 ; 39 21434: 11 e0 ldi r17, 0x01 ; 1 21436: 30 e0 ldi r19, 0x00 ; 0 21438: 20 e0 ldi r18, 0x00 ; 0 2143a: 40 e1 ldi r20, 0x10 ; 16 2143c: 61 ef ldi r22, 0xF1 ; 241 2143e: 71 e1 ldi r23, 0x11 ; 17 21440: 0f 94 6c 94 call 0x328d8 ; 0x328d8 #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); 21444: 8f e2 ldi r24, 0x2F ; 47 21446: 96 e5 ldi r25, 0x56 ; 86 21448: 0e 94 32 6d call 0xda64 ; 0xda64 2144c: 32 e3 ldi r19, 0x32 ; 50 2144e: e3 2e mov r14, r19 21450: f1 2c mov r15, r1 21452: 08 e7 ldi r16, 0x78 ; 120 21454: 10 e0 ldi r17, 0x00 ; 0 21456: 30 e0 ldi r19, 0x00 ; 0 21458: 20 e0 ldi r18, 0x00 ; 0 2145a: 40 e1 ldi r20, 0x10 ; 16 2145c: 6d ee ldi r22, 0xED ; 237 2145e: 71 e1 ldi r23, 0x11 ; 17 21460: 0f 94 6c 94 call 0x328d8 ; 0x328d8 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 21464: 83 e2 ldi r24, 0x23 ; 35 21466: 96 e5 ldi r25, 0x56 ; 86 21468: 0e 94 32 6d call 0xda64 ; 0xda64 2146c: 4f e7 ldi r20, 0x7F ; 127 2146e: e4 2e mov r14, r20 21470: f1 2c mov r15, r1 21472: 0f ef ldi r16, 0xFF ; 255 21474: 10 e0 ldi r17, 0x00 ; 0 21476: 30 e0 ldi r19, 0x00 ; 0 21478: 20 e0 ldi r18, 0x00 ; 0 2147a: 48 e0 ldi r20, 0x08 ; 8 2147c: 69 ee ldi r22, 0xE9 ; 233 2147e: 71 e1 ldi r23, 0x11 ; 17 21480: 0f 94 6c 94 call 0x328d8 ; 0x328d8 } 21484: 1f 91 pop r17 21486: 0f 91 pop r16 21488: ff 90 pop r15 2148a: ef 90 pop r14 2148c: 08 95 ret 0002148e : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 2148e: cf 93 push r28 21490: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 21492: 86 ed ldi r24, 0xD6 ; 214 21494: 9e e0 ldi r25, 0x0E ; 14 21496: 0f 94 3c a1 call 0x34278 ; 0x34278 2149a: 81 30 cpi r24, 0x01 ; 1 2149c: 19 f5 brne .+70 ; 0x214e4 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 2149e: 81 e7 ldi r24, 0x71 ; 113 214a0: 9b e5 ldi r25, 0x5B ; 91 214a2: 0e 94 32 6d call 0xda64 ; 0xda64 214a6: 22 e0 ldi r18, 0x02 ; 2 214a8: 45 ed ldi r20, 0xD5 ; 213 214aa: 5d ef ldi r21, 0xFD ; 253 214ac: bc 01 movw r22, r24 214ae: 88 ef ldi r24, 0xF8 ; 248 214b0: 9b e6 ldi r25, 0x6B ; 107 214b2: 0f 94 ab 95 call 0x32b56 ; 0x32b56 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 214b6: 8e ec ldi r24, 0xCE ; 206 214b8: 9e e0 ldi r25, 0x0E ; 14 214ba: 0f 94 3c a1 call 0x34278 ; 0x34278 214be: 81 30 cpi r24, 0x01 ; 1 214c0: a1 f4 brne .+40 ; 0x214ea { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 214c2: 81 e7 ldi r24, 0x71 ; 113 214c4: 9b e5 ldi r25, 0x5B ; 91 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); 214c6: 0e 94 32 6d call 0xda64 ; 0xda64 214ca: ec 01 movw r28, r24 214cc: 8a e1 ldi r24, 0x1A ; 26 214ce: 96 e5 ldi r25, 0x56 ; 86 214d0: 0e 94 32 6d call 0xda64 ; 0xda64 214d4: 22 e0 ldi r18, 0x02 ; 2 214d6: 41 ee ldi r20, 0xE1 ; 225 214d8: 5d ef ldi r21, 0xFD ; 253 214da: 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 } 214dc: df 91 pop r29 214de: 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); 214e0: 0d 94 ab 95 jmp 0x32b56 ; 0x32b56 #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); 214e4: 8b e6 ldi r24, 0x6B ; 107 214e6: 9b e5 ldi r25, 0x5B ; 91 214e8: dc cf rjmp .-72 ; 0x214a2 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); 214ea: 8b e6 ldi r24, 0x6B ; 107 214ec: 9b e5 ldi r25, 0x5B ; 91 214ee: eb cf rjmp .-42 ; 0x214c6 000214f0 : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 214f0: 40 e0 ldi r20, 0x00 ; 0 214f2: 59 e9 ldi r21, 0x99 ; 153 214f4: 60 e0 ldi r22, 0x00 ; 0 214f6: 80 e0 ldi r24, 0x00 ; 0 214f8: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 214fc: 1e 99 sbic 0x03, 6 ; 3 214fe: 16 c0 rjmp .+44 ; 0x2152c 21500: 4a ef ldi r20, 0xFA ; 250 21502: 58 e9 ldi r21, 0x98 ; 152 21504: 61 e0 ldi r22, 0x01 ; 1 21506: 80 e0 ldi r24, 0x00 ; 0 21508: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 2150c: 1d 9b sbis 0x03, 5 ; 3 2150e: 11 c0 rjmp .+34 ; 0x21532 21510: 47 ef ldi r20, 0xF7 ; 247 21512: 58 e9 ldi r21, 0x98 ; 152 21514: 62 e0 ldi r22, 0x02 ; 2 21516: 80 e0 ldi r24, 0x00 ; 0 21518: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 2151c: 1c 9b sbis 0x03, 4 ; 3 2151e: 0c c0 rjmp .+24 ; 0x21538 21520: 41 ef ldi r20, 0xF1 ; 241 21522: 58 e9 ldi r21, 0x98 ; 152 21524: 63 e0 ldi r22, 0x03 ; 3 21526: 80 e0 ldi r24, 0x00 ; 0 21528: 0c 94 10 6a jmp 0xd420 ; 0xd420 } #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"))); 2152c: 4d ef ldi r20, 0xFD ; 253 2152e: 58 e9 ldi r21, 0x98 ; 152 21530: e9 cf rjmp .-46 ; 0x21504 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 21532: 44 ef ldi r20, 0xF4 ; 244 21534: 58 e9 ldi r21, 0x98 ; 152 21536: ee cf rjmp .-36 ; 0x21514 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 21538: 4e ee ldi r20, 0xEE ; 238 2153a: 58 e9 ldi r21, 0x98 ; 152 2153c: f3 cf rjmp .-26 ; 0x21524 0002153e : } static void menu_show_end_stops() { lcd_show_end_stops(); 2153e: 0f 94 78 0a call 0x214f0 ; 0x214f0 menu_back_if_clicked(); 21542: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 00021546 : //! @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) { 21546: cf 92 push r12 21548: df 92 push r13 2154a: ef 92 push r14 2154c: ff 92 push r15 2154e: 0f 93 push r16 21550: 1f 93 push r17 21552: cf 93 push r28 21554: df 93 push r29 21556: d8 2f mov r29, r24 21558: 6b 01 movw r12, r22 2155a: 7a 01 movw r14, r20 2155c: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 2155e: 40 e2 ldi r20, 0x20 ; 32 21560: 81 11 cpse r24, r1 21562: 01 c0 rjmp .+2 ; 0x21566 21564: 4e e3 ldi r20, 0x3E ; 62 21566: 63 e0 ldi r22, 0x03 ; 3 21568: 80 e0 ldi r24, 0x00 ; 0 2156a: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_puts_P(first_choice); 2156e: c6 01 movw r24, r12 21570: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 21574: 40 e2 ldi r20, 0x20 ; 32 21576: d1 30 cpi r29, 0x01 ; 1 21578: 09 f4 brne .+2 ; 0x2157c 2157a: 4e e3 ldi r20, 0x3E ; 62 2157c: 63 e0 ldi r22, 0x03 ; 3 2157e: 8c 2f mov r24, r28 21580: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_puts_P(second_choice); 21584: c7 01 movw r24, r14 21586: 0e 94 e7 69 call 0xd3ce ; 0xd3ce if (third_choice) { 2158a: 01 15 cp r16, r1 2158c: 11 05 cpc r17, r1 2158e: 19 f1 breq .+70 ; 0x215d6 21590: c8 01 movw r24, r16 21592: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> 21596: d8 2e mov r13, r24 21598: c7 01 movw r24, r14 2159a: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__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; 2159e: 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;} 215a0: 93 e1 ldi r25, 0x13 ; 19 215a2: 9d 19 sub r25, r13 215a4: 8c 0f add r24, r28 215a6: 89 17 cp r24, r25 215a8: 08 f4 brcc .+2 ; 0x215ac 215aa: 89 2f mov r24, r25 215ac: 83 31 cpi r24, 0x13 ; 19 215ae: 08 f0 brcs .+2 ; 0x215b2 215b0: 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 ? '>': ' '); 215b2: 40 e2 ldi r20, 0x20 ; 32 215b4: d2 30 cpi r29, 0x02 ; 2 215b6: 09 f4 brne .+2 ; 0x215ba 215b8: 4e e3 ldi r20, 0x3E ; 62 215ba: 63 e0 ldi r22, 0x03 ; 3 215bc: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_puts_P(third_choice); 215c0: c8 01 movw r24, r16 } } 215c2: df 91 pop r29 215c4: cf 91 pop r28 215c6: 1f 91 pop r17 215c8: 0f 91 pop r16 215ca: ff 90 pop r15 215cc: ef 90 pop r14 215ce: df 90 pop r13 215d0: 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); 215d2: 0c 94 e7 69 jmp 0xd3ce ; 0xd3ce } } 215d6: df 91 pop r29 215d8: cf 91 pop r28 215da: 1f 91 pop r17 215dc: 0f 91 pop r16 215de: ff 90 pop r15 215e0: ef 90 pop r14 215e2: df 90 pop r13 215e4: cf 90 pop r12 215e6: 08 95 ret 000215e8 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 215e8: cf 93 push r28 215ea: df 93 push r29 215ec: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 215ee: 80 e0 ldi r24, 0x00 ; 0 215f0: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 215f4: 0e 94 2f 6a call 0xd45e ; 0xd45e return lcd_display_message_fullscreen_nonBlocking_P(msg); 215f8: ce 01 movw r24, r28 } 215fa: df 91 pop r29 215fc: 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); 215fe: 0d 94 55 04 jmp 0x208aa ; 0x208aa 00021602 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 21602: cf 92 push r12 21604: df 92 push r13 21606: ef 92 push r14 21608: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 2160a: 80 e0 ldi r24, 0x00 ; 0 2160c: 90 e0 ldi r25, 0x00 ; 0 2160e: a8 ec ldi r26, 0xC8 ; 200 21610: b2 e4 ldi r27, 0x42 ; 66 21612: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 21616: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 2161a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 2161e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 21622: 65 e5 ldi r22, 0x55 ; 85 21624: 75 e5 ldi r23, 0x55 ; 85 21626: 85 e5 ldi r24, 0x55 ; 85 21628: 91 e4 ldi r25, 0x41 ; 65 2162a: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 delay_keep_alive(2000); 2162e: 80 ed ldi r24, 0xD0 ; 208 21630: 97 e0 ldi r25, 0x07 ; 7 21632: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 21636: 87 e0 ldi r24, 0x07 ; 7 21638: 9f e4 ldi r25, 0x4F ; 79 2163a: 0e 94 32 6d call 0xda64 ; 0xda64 2163e: 0f 94 f4 0a call 0x215e8 ; 0x215e8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 21642: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 21646: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 2164a: 07 2e mov r0, r23 2164c: 00 0c add r0, r0 2164e: 88 0b sbc r24, r24 21650: 99 0b sbc r25, r25 21652: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 21656: 9b 01 movw r18, r22 21658: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 2165a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2165e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21662: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21666: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2166a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2166e: 9f 77 andi r25, 0x7F ; 127 21670: 20 e0 ldi r18, 0x00 ; 0 21672: 30 e0 ldi r19, 0x00 ; 0 21674: 40 ea ldi r20, 0xA0 ; 160 21676: 50 e4 ldi r21, 0x40 ; 64 21678: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2167c: 18 16 cp r1, r24 2167e: b4 f5 brge .+108 ; 0x216ec lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 21680: 87 e0 ldi r24, 0x07 ; 7 21682: 9f e4 ldi r25, 0x4F ; 79 21684: 0e 94 32 6d call 0xda64 ; 0xda64 21688: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_set_cursor(0, 4); 2168c: 64 e0 ldi r22, 0x04 ; 4 2168e: 80 e0 ldi r24, 0x00 ; 0 21690: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 21694: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 21698: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 2169c: 07 2e mov r0, r23 2169e: 00 0c add r0, r0 216a0: 88 0b sbc r24, r24 216a2: 99 0b sbc r25, r25 216a4: 0f 94 ca 9b call 0x33794 ; 0x33794 <__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)); 216a8: 20 e0 ldi r18, 0x00 ; 0 216aa: 30 e0 ldi r19, 0x00 ; 0 216ac: 40 e0 ldi r20, 0x00 ; 0 216ae: 5f e3 ldi r21, 0x3F ; 63 216b0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 216b4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 216b8: 6b 01 movw r12, r22 216ba: 20 e0 ldi r18, 0x00 ; 0 216bc: 30 e0 ldi r19, 0x00 ; 0 216be: 40 e0 ldi r20, 0x00 ; 0 216c0: 5f e3 ldi r21, 0x3F ; 63 216c2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 216c6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 216ca: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 216ce: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 216d2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 216d6: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 216da: a6 01 movw r20, r12 216dc: 82 e8 ldi r24, 0x82 ; 130 216de: 0f 94 eb 06 call 0x20dd6 ; 0x20dd6 delay_keep_alive(1000); 216e2: 88 ee ldi r24, 0xE8 ; 232 216e4: 93 e0 ldi r25, 0x03 ; 3 216e6: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 216ea: ab cf rjmp .-170 ; 0x21642 } } 216ec: ff 90 pop r15 216ee: ef 90 pop r14 216f0: df 90 pop r13 216f2: cf 90 pop r12 216f4: 08 95 ret 000216f6 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 216f6: cf 92 push r12 216f8: df 92 push r13 216fa: ef 92 push r14 216fc: ff 92 push r15 216fe: 0f 93 push r16 21700: 1f 93 push r17 21702: cf 93 push r28 21704: df 93 push r29 21706: d8 2e mov r13, r24 21708: 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) 2170a: 01 e0 ldi r16, 0x01 ; 1 2170c: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 21710: 81 11 cpse r24, r1 21712: 01 c0 rjmp .+2 ; 0x21716 21714: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 21716: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 2171a: 8d 2d mov r24, r13 2171c: 9c 2d mov r25, r12 2171e: 0f 94 f4 0a call 0x215e8 ; 0x215e8 21722: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 21724: 0e 94 14 6c call 0xd828 ; 0xd828 KEEPALIVE_STATE(PAUSED_FOR_USER); 21728: 84 e0 ldi r24, 0x04 ; 4 2172a: 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); 2172e: 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) { 21730: 20 97 sbiw r28, 0x00 ; 0 21732: 29 f4 brne .+10 ; 0x2173e // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 21734: 49 e8 ldi r20, 0x89 ; 137 21736: 63 e0 ldi r22, 0x03 ; 3 21738: 83 e1 ldi r24, 0x13 ; 19 2173a: 0e 94 1c 6a call 0xd438 ; 0xd438 * @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); 2173e: 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); 21740: 82 e3 ldi r24, 0x32 ; 50 21742: 90 e0 ldi r25, 0x00 ; 0 21744: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (lcd_clicked()) { 21748: 0e 94 19 6c call 0xd832 ; 0xd832 2174c: 88 23 and r24, r24 2174e: 81 f0 breq .+32 ; 0x21770 if (msg_next == NULL) { 21750: 20 97 sbiw r28, 0x00 ; 0 21752: 81 f4 brne .+32 ; 0x21774 KEEPALIVE_STATE(IN_HANDLER); 21754: 82 e0 ldi r24, 0x02 ; 2 21756: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 2175a: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 2175e: df 91 pop r29 21760: cf 91 pop r28 21762: 1f 91 pop r17 21764: 0f 91 pop r16 21766: ff 90 pop r15 21768: ef 90 pop r14 2176a: df 90 pop r13 2176c: cf 90 pop r12 2176e: 08 95 ret 21770: 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) { 21772: 31 f7 brne .-52 ; 0x21740 else { break; } } } if (multi_screen) { 21774: e1 14 cp r14, r1 21776: f1 04 cpc r15, r1 21778: d9 f2 breq .-74 ; 0x21730 if (msg_next == NULL) 2177a: 20 97 sbiw r28, 0x00 ; 0 2177c: 11 f4 brne .+4 ; 0x21782 msg_next = msg; 2177e: cd 2d mov r28, r13 21780: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 21782: ce 01 movw r24, r28 21784: 0f 94 f4 0a call 0x215e8 ; 0x215e8 21788: ec 01 movw r28, r24 2178a: d2 cf rjmp .-92 ; 0x21730 0002178c : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 2178c: cf 93 push r28 2178e: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 21790: 89 ef ldi r24, 0xF9 ; 249 21792: 90 e5 ldi r25, 0x50 ; 80 21794: 0e 94 32 6d call 0xda64 ; 0xda64 21798: 0f 94 7b 0b call 0x216f6 ; 0x216f6 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 2179c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 217a0: 81 30 cpi r24, 0x01 ; 1 217a2: 69 f4 brne .+26 ; 0x217be { lcd_show_fullscreen_message_and_wait_P( 217a4: 80 ea ldi r24, 0xA0 ; 160 217a6: 90 e5 ldi r25, 0x50 ; 80 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 217a8: 0e 94 32 6d call 0xda64 ; 0xda64 217ac: 0f 94 7b 0b call 0x216f6 ; 0x216f6 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 217b0: 8e ec ldi r24, 0xCE ; 206 217b2: 9f e4 ldi r25, 0x4F ; 79 217b4: 0e 94 32 6d call 0xda64 ; 0xda64 _T(MSG_WIZARD_V2_CAL_2)); } 217b8: 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( 217ba: 0d 94 7b 0b jmp 0x216f6 ; 0x216f6 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 217be: cc 23 and r28, r28 217c0: b9 f3 breq .-18 ; 0x217b0 { lcd_show_fullscreen_message_and_wait_P( 217c2: 8e e6 ldi r24, 0x6E ; 110 217c4: 90 e5 ldi r25, 0x50 ; 80 217c6: f0 cf rjmp .-32 ; 0x217a8 000217c8 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 217c8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 217cc: 81 30 cpi r24, 0x01 ; 1 217ce: 71 f4 brne .+28 ; 0x217ec lcd_show_fullscreen_message_and_wait_P( 217d0: 85 e7 ldi r24, 0x75 ; 117 217d2: 9f e4 ldi r25, 0x4F ; 79 217d4: 0e 94 32 6d call 0xda64 ; 0xda64 217d8: 0f 94 7b 0b call 0x216f6 ; 0x216f6 _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; 217dc: 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; 217de: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 217e2: 61 e0 ldi r22, 0x01 ; 1 217e4: 81 e2 ldi r24, 0x21 ; 33 217e6: 99 e9 ldi r25, 0x99 ; 153 217e8: 0c 94 37 7d jmp 0xfa6e ; 0xfa6e // 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( 217ec: 89 e2 ldi r24, 0x29 ; 41 217ee: 9f e4 ldi r25, 0x4F ; 79 217f0: 0e 94 32 6d call 0xda64 ; 0xda64 217f4: 0f 94 7b 0b call 0x216f6 ; 0x216f6 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 217f8: 80 e0 ldi r24, 0x00 ; 0 217fa: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 217fe: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 21802: 84 ec ldi r24, 0xC4 ; 196 21804: 9a e5 ldi r25, 0x5A ; 90 21806: 0e 94 32 6d call 0xda64 ; 0xda64 2180a: ac 01 movw r20, r24 2180c: 62 e0 ldi r22, 0x02 ; 2 2180e: 80 e0 ldi r24, 0x00 ; 0 21810: 0e 94 10 6a call 0xd420 ; 0xd420 eFilamentAction = FilamentAction::Load; 21814: 81 e0 ldi r24, 0x01 ; 1 21816: e3 cf rjmp .-58 ; 0x217de 00021818 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 21818: cf 93 push r28 2181a: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 2181c: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 disable_x(); 21820: 17 9a sbi 0x02, 7 ; 2 21822: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); 21826: 16 9a sbi 0x02, 6 ; 2 21828: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); 2182c: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2182e: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 21832: 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); 21836: 68 2f mov r22, r24 21838: 86 ea ldi r24, 0xA6 ; 166 2183a: 9f e0 ldi r25, 0x0F ; 15 2183c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 21840: 6c 2f mov r22, r28 21842: 8f ea ldi r24, 0xAF ; 175 21844: 9f e0 ldi r25, 0x0F ; 15 21846: 0f 94 60 a1 call 0x342c0 ; 0x342c0 // 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) { 2184a: cc 23 and r28, r28 2184c: 89 f0 breq .+34 ; 0x21870 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 2184e: 85 eb ldi r24, 0xB5 ; 181 21850: 98 e9 ldi r25, 0x98 ; 152 21852: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 21856: 89 ec ldi r24, 0xC9 ; 201 21858: 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)); 2185a: 0e 94 32 6d call 0xda64 ; 0xda64 2185e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 } lcd_update_enable(true); 21862: 81 e0 ldi r24, 0x01 ; 1 21864: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_update(2); 21868: 82 e0 ldi r24, 0x02 ; 2 } 2186a: 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); 2186c: 0c 94 c3 69 jmp 0xd386 ; 0xd386 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."); 21870: 8a e7 ldi r24, 0x7A ; 122 21872: 98 e9 ldi r25, 0x98 ; 152 21874: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 21878: 8e ea ldi r24, 0xAE ; 174 2187a: 9d e4 ldi r25, 0x4D ; 77 2187c: ee cf rjmp .-36 ; 0x2185a 0002187e : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 2187e: 1f 93 push r17 21880: cf 93 push r28 21882: 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); 21884: 64 e6 ldi r22, 0x64 ; 100 21886: 70 e0 ldi r23, 0x00 ; 0 21888: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 2188c: 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++) { 2188e: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 21890: 4e e2 ldi r20, 0x2E ; 46 21892: 63 e0 ldi r22, 0x03 ; 3 21894: 81 2f mov r24, r17 21896: 0e 94 1c 6a call 0xd438 ; 0xd438 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 2189a: ce 01 movw r24, r28 2189c: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 218a0: ce 01 movw r24, r28 218a2: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 218a6: ce 01 movw r24, r28 218a8: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 218ac: ce 01 movw r24, r28 218ae: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 218b2: ce 01 movw r24, r28 218b4: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 218b8: 1f 5f subi r17, 0xFF ; 255 218ba: 14 31 cpi r17, 0x14 ; 20 218bc: 49 f7 brne .-46 ; 0x21890 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 218be: df 91 pop r29 218c0: cf 91 pop r28 218c2: 1f 91 pop r17 218c4: 08 95 ret 000218c6 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 218c6: 10 92 62 03 sts 0x0362, r1 ; 0x800362 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 218ca: 08 95 ret 000218cc : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 218cc: cf 93 push r28 MENU_BEGIN(); 218ce: 0f 94 1c 94 call 0x32838 ; 0x32838 218d2: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 218d6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 218da: 84 30 cpi r24, 0x04 ; 4 218dc: 08 f0 brcs .+2 ; 0x218e0 218de: b1 c0 rjmp .+354 ; 0x21a42 218e0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 218e4: 8f e5 ldi r24, 0x5F ; 95 218e6: 9f e0 ldi r25, 0x0F ; 15 218e8: 0f 94 3c a1 call 0x34278 ; 0x34278 218ec: 81 11 cpse r24, r1 218ee: 0f c0 rjmp .+30 ; 0x2190e { ON_MENU_LEAVE( 218f0: 0f 94 9c 92 call 0x32538 ; 0x32538 218f4: 81 11 cpse r24, r1 218f6: 0f 94 63 0c call 0x218c6 ; 0x218c6 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 218fa: 80 91 62 03 lds r24, 0x0362 ; 0x800362 218fe: 8a 30 cpi r24, 0x0A ; 10 21900: a9 f1 breq .+106 ; 0x2196c 21902: 8a e5 ldi r24, 0x5A ; 90 21904: 9e e3 ldi r25, 0x3E ; 62 21906: 0e 94 32 6d call 0xda64 ; 0xda64 2190a: 0f 94 e7 96 call 0x32dce ; 0x32dce } if (farm_mode) 2190e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 21912: 88 23 and r24, r24 21914: 71 f1 breq .+92 ; 0x21972 { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 21916: 6f ec ldi r22, 0xCF ; 207 21918: 77 e3 ldi r23, 0x37 ; 55 2191a: 87 e2 ldi r24, 0x27 ; 39 2191c: 98 e9 ldi r25, 0x98 ; 152 2191e: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 21922: 67 eb ldi r22, 0xB7 ; 183 21924: 78 e3 ldi r23, 0x38 ; 56 21926: 87 e1 ldi r24, 0x17 ; 23 21928: 98 e9 ldi r25, 0x98 ; 152 2192a: 0f 94 99 93 call 0x32732 ; 0x32732 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); 2192e: 8f e5 ldi r24, 0x5F ; 95 21930: 9f e0 ldi r25, 0x0F ; 15 21932: 0f 94 3c a1 call 0x34278 ; 0x34278 21936: 81 11 cpse r24, r1 21938: 0c c0 rjmp .+24 ; 0x21952 2193a: 80 91 62 03 lds r24, 0x0362 ; 0x800362 2193e: 89 30 cpi r24, 0x09 ; 9 21940: 41 f4 brne .+16 ; 0x21952 21942: 8b e0 ldi r24, 0x0B ; 11 21944: 9b e4 ldi r25, 0x4B ; 75 21946: 0e 94 32 6d call 0xda64 ; 0xda64 2194a: 69 ef ldi r22, 0xF9 ; 249 2194c: 77 e3 ldi r23, 0x37 ; 55 2194e: 0f 94 99 93 call 0x32732 ; 0x32732 MENU_END(); 21952: 0f 94 f0 93 call 0x327e0 ; 0x327e0 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 21956: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 2195a: 8f 5f subi r24, 0xFF ; 255 2195c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 21960: 80 91 30 04 lds r24, 0x0430 ; 0x800430 21964: 8f 5f subi r24, 0xFF ; 255 21966: 80 93 30 04 sts 0x0430, r24 ; 0x800430 2196a: b5 cf rjmp .-150 ; 0x218d6 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)); 2196c: 86 e7 ldi r24, 0x76 ; 118 2196e: 90 e4 ldi r25, 0x40 ; 64 21970: ca cf rjmp .-108 ; 0x21906 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(); 21972: 0e 94 0b fe call 0x1fc16 ; 0x1fc16 21976: 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); 21978: 8c ef ldi r24, 0xFC ; 252 2197a: 97 e9 ldi r25, 0x97 ; 151 2197c: cc 23 and r28, r28 2197e: 11 f0 breq .+4 ; 0x21984 21980: 8b e0 ldi r24, 0x0B ; 11 21982: 98 e9 ldi r25, 0x98 ; 152 21984: 6d ee ldi r22, 0xED ; 237 21986: 77 e3 ldi r23, 0x37 ; 55 21988: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 2198c: 81 ee ldi r24, 0xE1 ; 225 2198e: 97 e9 ldi r25, 0x97 ; 151 21990: cc 23 and r28, r28 21992: 11 f0 breq .+4 ; 0x21998 21994: 80 ef ldi r24, 0xF0 ; 240 21996: 97 e9 ldi r25, 0x97 ; 151 21998: 67 e4 ldi r22, 0x47 ; 71 2199a: 78 e3 ldi r23, 0x38 ; 56 2199c: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 219a0: 85 ec ldi r24, 0xC5 ; 197 219a2: 97 e9 ldi r25, 0x97 ; 151 219a4: cc 23 and r28, r28 219a6: 11 f0 breq .+4 ; 0x219ac 219a8: 85 ed ldi r24, 0xD5 ; 213 219aa: 97 e9 ldi r25, 0x97 ; 151 219ac: 61 ee ldi r22, 0xE1 ; 225 219ae: 78 e3 ldi r23, 0x38 ; 56 219b0: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 219b4: 89 ea ldi r24, 0xA9 ; 169 219b6: 97 e9 ldi r25, 0x97 ; 151 219b8: cc 23 and r28, r28 219ba: 11 f0 breq .+4 ; 0x219c0 219bc: 89 eb ldi r24, 0xB9 ; 185 219be: 97 e9 ldi r25, 0x97 ; 151 219c0: 6f e4 ldi r22, 0x4F ; 79 219c2: 78 e3 ldi r23, 0x38 ; 56 219c4: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 219c8: 8e e8 ldi r24, 0x8E ; 142 219ca: 97 e9 ldi r25, 0x97 ; 151 219cc: cc 23 and r28, r28 219ce: 11 f0 breq .+4 ; 0x219d4 219d0: 8d e9 ldi r24, 0x9D ; 157 219d2: 97 e9 ldi r25, 0x97 ; 151 219d4: 61 e6 ldi r22, 0x61 ; 97 219d6: 77 e3 ldi r23, 0x37 ; 55 219d8: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 219dc: 83 e7 ldi r24, 0x73 ; 115 219de: 97 e9 ldi r25, 0x97 ; 151 219e0: cc 23 and r28, r28 219e2: 11 f0 breq .+4 ; 0x219e8 219e4: 82 e8 ldi r24, 0x82 ; 130 219e6: 97 e9 ldi r25, 0x97 ; 151 219e8: 69 ee ldi r22, 0xE9 ; 233 219ea: 77 e3 ldi r23, 0x37 ; 55 219ec: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 219f0: 87 e5 ldi r24, 0x57 ; 87 219f2: 97 e9 ldi r25, 0x97 ; 151 219f4: cc 23 and r28, r28 219f6: 11 f0 breq .+4 ; 0x219fc 219f8: 87 e6 ldi r24, 0x67 ; 103 219fa: 97 e9 ldi r25, 0x97 ; 151 219fc: 63 e6 ldi r22, 0x63 ; 99 219fe: 77 e3 ldi r23, 0x37 ; 55 21a00: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 21a04: 8b e3 ldi r24, 0x3B ; 59 21a06: 97 e9 ldi r25, 0x97 ; 151 21a08: cc 23 and r28, r28 21a0a: 11 f0 breq .+4 ; 0x21a10 21a0c: 8b e4 ldi r24, 0x4B ; 75 21a0e: 97 e9 ldi r25, 0x97 ; 151 21a10: 6b ea ldi r22, 0xAB ; 171 21a12: 77 e3 ldi r23, 0x37 ; 55 21a14: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 21a18: 8f e1 ldi r24, 0x1F ; 31 21a1a: 97 e9 ldi r25, 0x97 ; 151 21a1c: cc 23 and r28, r28 21a1e: 11 f0 breq .+4 ; 0x21a24 21a20: 8f e2 ldi r24, 0x2F ; 47 21a22: 97 e9 ldi r25, 0x97 ; 151 21a24: 6d e3 ldi r22, 0x3D ; 61 21a26: 77 e3 ldi r23, 0x37 ; 55 21a28: 0f 94 9a 96 call 0x32d34 ; 0x32d34 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); 21a2c: 84 e0 ldi r24, 0x04 ; 4 21a2e: 97 e9 ldi r25, 0x97 ; 151 21a30: cc 23 and r28, r28 21a32: 11 f0 breq .+4 ; 0x21a38 21a34: 83 e1 ldi r24, 0x13 ; 19 21a36: 97 e9 ldi r25, 0x97 ; 151 21a38: 63 e3 ldi r22, 0x33 ; 51 21a3a: 78 e3 ldi r23, 0x38 ; 56 21a3c: 0f 94 9a 96 call 0x32d34 ; 0x32d34 21a40: 76 cf rjmp .-276 ; 0x2192e } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 21a42: cf 91 pop r28 21a44: 08 95 ret 00021a46 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 21a46: 89 e0 ldi r24, 0x09 ; 9 21a48: 80 93 62 03 sts 0x0362, r24 ; 0x800362 lcd_generic_preheat_menu(); 21a4c: 0d 94 66 0c jmp 0x218cc ; 0x218cc 00021a50 : // 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); 21a50: 81 e0 ldi r24, 0x01 ; 1 21a52: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 21a56: 0f 94 e8 41 call 0x283d0 ; 0x283d0 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; 21a5a: 90 91 7c 12 lds r25, 0x127C ; 0x80127c 21a5e: 93 36 cpi r25, 0x63 ; 99 21a60: 09 f4 brne .+2 ; 0x21a64 21a62: 9f ef ldi r25, 0xFF ; 255 21a64: 89 13 cpse r24, r25 21a66: 0e c0 rjmp .+28 ; 0x21a84 lcd_putc('F'); 21a68: 86 e4 ldi r24, 0x46 ; 70 21a6a: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21a6e: 0f 94 e8 41 call 0x283d0 ; 0x283d0 21a72: 8f 3f cpi r24, 0xFF ; 255 21a74: 29 f0 breq .+10 ; 0x21a80 21a76: 8f 5c subi r24, 0xCF ; 207 21a78: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 21a7c: 83 e0 ldi r24, 0x03 ; 3 21a7e: 08 95 ret 21a80: 8f e3 ldi r24, 0x3F ; 63 21a82: fa cf rjmp .-12 ; 0x21a78 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21a84: 8f 3f cpi r24, 0xFF ; 255 21a86: 89 f0 breq .+34 ; 0x21aaa 21a88: 8f 5c subi r24, 0xCF ; 207 21a8a: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_putc('>'); 21a8e: 8e e3 ldi r24, 0x3E ; 62 21a90: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 21a94: 80 91 7c 12 lds r24, 0x127C ; 0x80127c 21a98: 83 36 cpi r24, 0x63 ; 99 21a9a: 49 f0 breq .+18 ; 0x21aae lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21a9c: 8f 3f cpi r24, 0xFF ; 255 21a9e: 39 f0 breq .+14 ; 0x21aae 21aa0: 8f 5c subi r24, 0xCF ; 207 21aa2: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 chars += 3; 21aa6: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 21aa8: 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'); 21aaa: 8f e3 ldi r24, 0x3F ; 63 21aac: ee cf rjmp .-36 ; 0x21a8a lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21aae: 8f e3 ldi r24, 0x3F ; 63 21ab0: f8 cf rjmp .-16 ; 0x21aa2 00021ab2 <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 21ab2: 1f 92 push r1 21ab4: 0f 92 push r0 21ab6: 0f b6 in r0, 0x3f ; 63 21ab8: 0f 92 push r0 21aba: 11 24 eor r1, r1 21abc: 0b b6 in r0, 0x3b ; 59 21abe: 0f 92 push r0 21ac0: 2f 93 push r18 21ac2: 3f 93 push r19 21ac4: 4f 93 push r20 21ac6: 5f 93 push r21 21ac8: 6f 93 push r22 21aca: 7f 93 push r23 21acc: 8f 93 push r24 21ace: 9f 93 push r25 21ad0: af 93 push r26 21ad2: bf 93 push r27 21ad4: ef 93 push r30 21ad6: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 21ad8: 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 21adc: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 uint8_t buf_r = ptr[2]; //get read index 21ae0: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 21ae4: e8 2f mov r30, r24 21ae6: f0 e0 ldi r31, 0x00 ; 0 21ae8: ed 54 subi r30, 0x4D ; 77 21aea: f2 4f sbci r31, 0xF2 ; 242 21aec: 20 83 st Z, r18 buf_w++; //incerment write index 21aee: 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 21af0: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 21af4: 82 17 cp r24, r18 21af6: 08 f0 brcs .+2 ; 0x21afa <__vector_51+0x48> 21af8: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 21afa: 98 13 cpse r25, r24 21afc: 17 c0 rjmp .+46 ; 0x21b2c <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 21afe: 88 e9 ldi r24, 0x98 ; 152 21b00: 95 e9 ldi r25, 0x95 ; 149 21b02: 0f 94 25 a0 call 0x3404a ; 0x3404a } } 21b06: ff 91 pop r31 21b08: ef 91 pop r30 21b0a: bf 91 pop r27 21b0c: af 91 pop r26 21b0e: 9f 91 pop r25 21b10: 8f 91 pop r24 21b12: 7f 91 pop r23 21b14: 6f 91 pop r22 21b16: 5f 91 pop r21 21b18: 4f 91 pop r20 21b1a: 3f 91 pop r19 21b1c: 2f 91 pop r18 21b1e: 0f 90 pop r0 21b20: 0b be out 0x3b, r0 ; 59 21b22: 0f 90 pop r0 21b24: 0f be out 0x3f, r0 ; 63 21b26: 0f 90 pop r0 21b28: 1f 90 pop r1 21b2a: 18 95 reti ptr[1] = buf_w; //store write index 21b2c: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 21b30: ea cf rjmp .-44 ; 0x21b06 <__vector_51+0x54> 00021b32 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21b32: 1f 92 push r1 21b34: 0f 92 push r0 21b36: 0f b6 in r0, 0x3f ; 63 21b38: 0f 92 push r0 21b3a: 11 24 eor r1, r1 21b3c: 0b b6 in r0, 0x3b ; 59 21b3e: 0f 92 push r0 21b40: 8f 93 push r24 21b42: 9f 93 push r25 21b44: ef 93 push r30 21b46: ff 93 push r31 WRITE(BEEPER, 0); 21b48: 9f b7 in r25, 0x3f ; 63 21b4a: f8 94 cli 21b4c: e2 e0 ldi r30, 0x02 ; 2 21b4e: f1 e0 ldi r31, 0x01 ; 1 21b50: 80 81 ld r24, Z 21b52: 8b 7f andi r24, 0xFB ; 251 21b54: 80 83 st Z, r24 21b56: 9f bf out 0x3f, r25 ; 63 } 21b58: ff 91 pop r31 21b5a: ef 91 pop r30 21b5c: 9f 91 pop r25 21b5e: 8f 91 pop r24 21b60: 0f 90 pop r0 21b62: 0b be out 0x3b, r0 ; 59 21b64: 0f 90 pop r0 21b66: 0f be out 0x3f, r0 ; 63 21b68: 0f 90 pop r0 21b6a: 1f 90 pop r1 21b6c: 18 95 reti 00021b6e <__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) { 21b6e: 1f 92 push r1 21b70: 0f 92 push r0 21b72: 0f b6 in r0, 0x3f ; 63 21b74: 0f 92 push r0 21b76: 11 24 eor r1, r1 21b78: 0b b6 in r0, 0x3b ; 59 21b7a: 0f 92 push r0 21b7c: 8f 93 push r24 21b7e: 9f 93 push r25 21b80: ef 93 push r30 21b82: ff 93 push r31 WRITE(BEEPER, 1); 21b84: 9f b7 in r25, 0x3f ; 63 21b86: f8 94 cli 21b88: e2 e0 ldi r30, 0x02 ; 2 21b8a: f1 e0 ldi r31, 0x01 ; 1 21b8c: 80 81 ld r24, Z 21b8e: 84 60 ori r24, 0x04 ; 4 21b90: 80 83 st Z, r24 21b92: 9f bf out 0x3f, r25 ; 63 } 21b94: ff 91 pop r31 21b96: ef 91 pop r30 21b98: 9f 91 pop r25 21b9a: 8f 91 pop r24 21b9c: 0f 90 pop r0 21b9e: 0b be out 0x3b, r0 ; 59 21ba0: 0f 90 pop r0 21ba2: 0f be out 0x3f, r0 ; 63 21ba4: 0f 90 pop r0 21ba6: 1f 90 pop r1 21ba8: 18 95 reti 00021baa : void delay2(unsigned long ms) { 21baa: 8f 92 push r8 21bac: 9f 92 push r9 21bae: af 92 push r10 21bb0: bf 92 push r11 21bb2: cf 92 push r12 21bb4: df 92 push r13 21bb6: ef 92 push r14 21bb8: ff 92 push r15 21bba: 6b 01 movw r12, r22 21bbc: 7c 01 movw r14, r24 uint32_t start = micros2(); 21bbe: 0e 94 fe f7 call 0x1effc ; 0x1effc 21bc2: 4b 01 movw r8, r22 21bc4: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 21bc6: c1 14 cp r12, r1 21bc8: d1 04 cpc r13, r1 21bca: e1 04 cpc r14, r1 21bcc: f1 04 cpc r15, r1 21bce: b9 f0 breq .+46 ; 0x21bfe 21bd0: 0e 94 fe f7 call 0x1effc ; 0x1effc 21bd4: 68 19 sub r22, r8 21bd6: 79 09 sbc r23, r9 21bd8: 8a 09 sbc r24, r10 21bda: 9b 09 sbc r25, r11 21bdc: 68 3e cpi r22, 0xE8 ; 232 21bde: 73 40 sbci r23, 0x03 ; 3 21be0: 81 05 cpc r24, r1 21be2: 91 05 cpc r25, r1 21be4: 80 f3 brcs .-32 ; 0x21bc6 { ms--; 21be6: 21 e0 ldi r18, 0x01 ; 1 21be8: c2 1a sub r12, r18 21bea: d1 08 sbc r13, r1 21bec: e1 08 sbc r14, r1 21bee: f1 08 sbc r15, r1 start += 1000; 21bf0: 88 ee ldi r24, 0xE8 ; 232 21bf2: 88 0e add r8, r24 21bf4: 83 e0 ldi r24, 0x03 ; 3 21bf6: 98 1e adc r9, r24 21bf8: a1 1c adc r10, r1 21bfa: b1 1c adc r11, r1 21bfc: e4 cf rjmp .-56 ; 0x21bc6 } } } 21bfe: ff 90 pop r15 21c00: ef 90 pop r14 21c02: df 90 pop r13 21c04: cf 90 pop r12 21c06: bf 90 pop r11 21c08: af 90 pop r10 21c0a: 9f 90 pop r9 21c0c: 8f 90 pop r8 21c0e: 08 95 ret 00021c10 : * @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() { 21c10: ef 92 push r14 21c12: ff 92 push r15 21c14: 0f 93 push r16 21c16: 1f 93 push r17 21c18: cf 93 push r28 21c1a: df 93 push r29 21c1c: cd b7 in r28, 0x3d ; 61 21c1e: de b7 in r29, 0x3e ; 62 21c20: 63 97 sbiw r28, 0x13 ; 19 21c22: 0f b6 in r0, 0x3f ; 63 21c24: f8 94 cli 21c26: de bf out 0x3e, r29 ; 62 21c28: 0f be out 0x3f, r0 ; 63 21c2a: 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) 21c2c: 80 91 64 03 lds r24, 0x0364 ; 0x800364 21c30: 81 11 cpse r24, r1 21c32: 3a c0 rjmp .+116 ; 0x21ca8 { // Menu was entered. // Initialize its status. _md->status = 1; 21c34: 81 e0 ldi r24, 0x01 ; 1 21c36: 80 93 64 03 sts 0x0364, r24 ; 0x800364 check_babystep(); 21c3a: 0e 94 33 73 call 0xe666 ; 0xe666 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 21c3e: 81 ea ldi r24, 0xA1 ; 161 21c40: 9d e0 ldi r25, 0x0D ; 13 21c42: 0f 94 3c a1 call 0x34278 ; 0x34278 21c46: 18 2f mov r17, r24 21c48: 0e 94 99 6f call 0xdf32 ; 0xdf32 21c4c: 81 11 cpse r24, r1 21c4e: ee c0 rjmp .+476 ; 0x21e2c _md->babystepMemZ = 0; 21c50: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21c54: 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)) 21c58: 80 e1 ldi r24, 0x10 ; 16 21c5a: 0e 94 4c d8 call 0x1b098 ; 0x1b098 21c5e: 81 11 cpse r24, r1 21c60: 04 c0 rjmp .+8 ; 0x21c6a _md->babystepMemZ = 0; 21c62: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21c66: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 21c6a: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21c6e: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21c72: 07 2e mov r0, r23 21c74: 00 0c add r0, r0 21c76: 88 0b sbc r24, r24 21c78: 99 0b sbc r25, r25 21c7a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 21c7e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21c82: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21c86: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21c8a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21c8e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 21c92: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21c96: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21c9a: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21c9e: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a lcd_draw_update = 1; 21ca2: 81 e0 ldi r24, 0x01 ; 1 21ca4: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 21ca8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21cac: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21cb0: 00 97 sbiw r24, 0x00 ; 0 21cb2: f1 f1 breq .+124 ; 0x21d30 { _md->babystepMemZ += lcd_encoder; 21cb4: 20 91 65 03 lds r18, 0x0365 ; 0x800365 21cb8: 30 91 66 03 lds r19, 0x0366 ; 0x800366 21cbc: 28 0f add r18, r24 21cbe: 39 1f adc r19, r25 21cc0: 30 93 66 03 sts 0x0366, r19 ; 0x800366 21cc4: 20 93 65 03 sts 0x0365, r18 ; 0x800365 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 21cc8: 21 36 cpi r18, 0x61 ; 97 21cca: 40 ef ldi r20, 0xF0 ; 240 21ccc: 34 07 cpc r19, r20 21cce: 0c f0 brlt .+2 ; 0x21cd2 21cd0: ba c0 rjmp .+372 ; 0x21e46 21cd2: 81 e6 ldi r24, 0x61 ; 97 21cd4: 90 ef ldi r25, 0xF0 ; 240 21cd6: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21cda: 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]; 21cde: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21ce2: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21ce6: 07 2e mov r0, r23 21ce8: 00 0c add r0, r0 21cea: 88 0b sbc r24, r24 21cec: 99 0b sbc r25, r25 21cee: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 21cf2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21cf6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21cfa: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21cfe: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21d02: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 21d06: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21d0a: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21d0e: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21d12: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a _delay(50); 21d16: 62 e3 ldi r22, 0x32 ; 50 21d18: 70 e0 ldi r23, 0x00 ; 0 21d1a: 80 e0 ldi r24, 0x00 ; 0 21d1c: 90 e0 ldi r25, 0x00 ; 0 21d1e: 0f 94 d5 0d call 0x21baa ; 0x21baa lcd_encoder = 0; 21d22: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21d26: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_draw_update = 1; 21d2a: 81 e0 ldi r24, 0x01 ; 1 21d2c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update) 21d30: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21d34: 88 23 and r24, r24 21d36: c9 f1 breq .+114 ; 0x21daa { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 21d38: 81 ea ldi r24, 0xA1 ; 161 21d3a: 9d e0 ldi r25, 0x0D ; 13 21d3c: 0f 94 3c a1 call 0x34278 ; 0x34278 21d40: 2b e0 ldi r18, 0x0B ; 11 21d42: 82 9f mul r24, r18 21d44: c0 01 movw r24, r0 21d46: 11 24 eor r1, r1 21d48: be 01 movw r22, r28 21d4a: 6f 5f subi r22, 0xFF ; 255 21d4c: 7f 4f sbci r23, 0xFF ; 255 21d4e: 87 5b subi r24, 0xB7 ; 183 21d50: 92 4f sbci r25, 0xF2 ; 242 21d52: 0f 94 b6 92 call 0x3256c ; 0x3256c lcd_home(); 21d56: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_print(buffer.c); 21d5a: ce 01 movw r24, r28 21d5c: 01 96 adiw r24, 0x01 ; 1 21d5e: 0e 94 03 6c call 0xd806 ; 0xd806 lcd_set_cursor(0, 1); 21d62: 61 e0 ldi r22, 0x01 ; 1 21d64: 80 e0 ldi r24, 0x00 ; 0 21d66: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 21d6a: 10 91 67 03 lds r17, 0x0367 ; 0x800367 21d6e: 00 91 68 03 lds r16, 0x0368 ; 0x800368 21d72: f0 90 69 03 lds r15, 0x0369 ; 0x800369 21d76: e0 90 6a 03 lds r14, 0x036A ; 0x80036a 21d7a: 8c e5 ldi r24, 0x5C ; 92 21d7c: 9c e4 ldi r25, 0x4C ; 76 21d7e: 0e 94 32 6d call 0xda64 ; 0xda64 //! (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); 21d82: ef 92 push r14 21d84: ff 92 push r15 21d86: 0f 93 push r16 21d88: 1f 93 push r17 21d8a: 9f 93 push r25 21d8c: 8f 93 push r24 21d8e: 1f 92 push r1 21d90: 80 e2 ldi r24, 0x20 ; 32 21d92: 8f 93 push r24 21d94: 85 e6 ldi r24, 0x65 ; 101 21d96: 98 e9 ldi r25, 0x98 ; 152 21d98: 9f 93 push r25 21d9a: 8f 93 push r24 21d9c: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 21da0: 0f b6 in r0, 0x3f ; 63 21da2: f8 94 cli 21da4: de bf out 0x3e, r29 ; 62 21da6: 0f be out 0x3f, r0 ; 63 21da8: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 21daa: 80 91 63 03 lds r24, 0x0363 ; 0x800363 21dae: 81 11 cpse r24, r1 21db0: 04 c0 rjmp .+8 ; 0x21dba 21db2: 80 91 92 03 lds r24, 0x0392 ; 0x800392 21db6: 88 23 and r24, r24 21db8: 51 f1 breq .+84 ; 0x21e0e { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 21dba: 81 ea ldi r24, 0xA1 ; 161 21dbc: 9d e0 ldi r25, 0x0D ; 13 21dbe: 0f 94 3c a1 call 0x34278 ; 0x34278 21dc2: 9b e0 ldi r25, 0x0B ; 11 21dc4: 89 9f mul r24, r25 21dc6: 80 01 movw r16, r0 21dc8: 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); 21dca: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21dce: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21dd2: c8 01 movw r24, r16 21dd4: 80 5b subi r24, 0xB0 ; 176 21dd6: 92 4f sbci r25, 0xF2 ; 242 21dd8: 0f 94 7e a1 call 0x342fc ; 0x342fc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 21ddc: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 21de0: c8 01 movw r24, r16 21de2: 8e 5a subi r24, 0xAE ; 174 21de4: 92 4f sbci r25, 0xF2 ; 242 21de6: 0f 94 60 a1 call 0x342c0 ; 0x342c0 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); 21dea: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 21dee: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 21df2: 80 91 90 06 lds r24, 0x0690 ; 0x800690 21df6: 90 91 91 06 lds r25, 0x0691 ; 0x800691 21dfa: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 21dfe: c8 01 movw r24, r16 21e00: 8d 5a subi r24, 0xAD ; 173 21e02: 92 4f sbci r25, 0xF2 ; 242 21e04: 0f 94 60 a1 call 0x342c0 ; 0x342c0 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 21e08: 80 e1 ldi r24, 0x10 ; 16 21e0a: 0e 94 7d c6 call 0x18cfa ; 0x18cfa } menu_back_if_clicked(); 21e0e: 0f 94 86 97 call 0x32f0c ; 0x32f0c } 21e12: 63 96 adiw r28, 0x13 ; 19 21e14: 0f b6 in r0, 0x3f ; 63 21e16: f8 94 cli 21e18: de bf out 0x3e, r29 ; 62 21e1a: 0f be out 0x3f, r0 ; 63 21e1c: cd bf out 0x3d, r28 ; 61 21e1e: df 91 pop r29 21e20: cf 91 pop r28 21e22: 1f 91 pop r17 21e24: 0f 91 pop r16 21e26: ff 90 pop r15 21e28: ef 90 pop r14 21e2a: 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-> 21e2c: 2b e0 ldi r18, 0x0B ; 11 21e2e: 12 9f mul r17, r18 21e30: c0 01 movw r24, r0 21e32: 11 24 eor r1, r1 21e34: 80 5b subi r24, 0xB0 ; 176 21e36: 92 4f sbci r25, 0xF2 ; 242 21e38: 0f 94 4a a1 call 0x34294 ; 0x34294 21e3c: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21e40: 80 93 65 03 sts 0x0365, r24 ; 0x800365 21e44: 09 cf rjmp .-494 ; 0x21c58 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 21e46: 12 16 cp r1, r18 21e48: 13 06 cpc r1, r19 21e4a: 2c f4 brge .+10 ; 0x21e56 21e4c: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21e50: 10 92 65 03 sts 0x0365, r1 ; 0x800365 21e54: 44 cf rjmp .-376 ; 0x21cde extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 21e56: 2f b7 in r18, 0x3f ; 63 21e58: f8 94 cli babystepsTodo[Z_AXIS] += n; 21e5a: 40 91 8c 06 lds r20, 0x068C ; 0x80068c 21e5e: 50 91 8d 06 lds r21, 0x068D ; 0x80068d 21e62: 84 0f add r24, r20 21e64: 95 1f adc r25, r21 21e66: 90 93 8d 06 sts 0x068D, r25 ; 0x80068d 21e6a: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c CRITICAL_SECTION_END 21e6e: 2f bf out 0x3f, r18 ; 63 21e70: 36 cf rjmp .-404 ; 0x21cde 00021e72 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 21e72: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21e76: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21e7a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21e7e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 21e82: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 21e86: 20 91 57 02 lds r18, 0x0257 ; 0x800257 21e8a: 30 91 58 02 lds r19, 0x0258 ; 0x800258 21e8e: 26 17 cp r18, r22 21e90: 37 07 cpc r19, r23 21e92: 0c f0 brlt .+2 ; 0x21e96 21e94: 65 c0 rjmp .+202 ; 0x21f60 { if (lcd_encoder != 0) 21e96: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21e9a: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21e9e: 89 2b or r24, r25 21ea0: b9 f1 breq .+110 ; 0x21f10 { refresh_cmd_timeout(); 21ea2: 0e 94 4a 60 call 0xc094 ; 0xc094 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; 21ea6: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 21eaa: 8f 5f subi r24, 0xFF ; 255 21eac: 80 31 cpi r24, 0x10 ; 16 21eae: 09 f4 brne .+2 ; 0x21eb2 next_block_index = 0; 21eb0: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 21eb2: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 21eb6: 98 17 cp r25, r24 21eb8: 59 f1 breq .+86 ; 0x21f10 { current_position[E_AXIS] += lcd_encoder; 21eba: 60 91 06 05 lds r22, 0x0506 ; 0x800506 21ebe: 70 91 07 05 lds r23, 0x0507 ; 0x800507 21ec2: 07 2e mov r0, r23 21ec4: 00 0c add r0, r0 21ec6: 88 0b sbc r24, r24 21ec8: 99 0b sbc r25, r25 21eca: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 21ece: 9b 01 movw r18, r22 21ed0: ac 01 movw r20, r24 21ed2: 60 91 01 12 lds r22, 0x1201 ; 0x801201 21ed6: 70 91 02 12 lds r23, 0x1202 ; 0x801202 21eda: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21ede: 90 91 04 12 lds r25, 0x1204 ; 0x801204 21ee2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 21ee6: 60 93 01 12 sts 0x1201, r22 ; 0x801201 21eea: 70 93 02 12 sts 0x1202, r23 ; 0x801202 21eee: 80 93 03 12 sts 0x1203, r24 ; 0x801203 21ef2: 90 93 04 12 sts 0x1204, r25 ; 0x801204 lcd_encoder = 0; 21ef6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21efa: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 21efe: 65 e5 ldi r22, 0x55 ; 85 21f00: 75 e5 ldi r23, 0x55 ; 85 21f02: 85 ed ldi r24, 0xD5 ; 213 21f04: 9f e3 ldi r25, 0x3F ; 63 21f06: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 lcd_draw_update = 1; 21f0a: 81 e0 ldi r24, 0x01 ; 1 21f0c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 21f10: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21f14: 88 23 and r24, r24 21f16: 11 f1 breq .+68 ; 0x21f5c { lcd_set_cursor(0, 1); 21f18: 61 e0 ldi r22, 0x01 ; 1 21f1a: 80 e0 ldi r24, 0x00 ; 0 21f1c: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 //! 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); 21f20: 80 91 04 12 lds r24, 0x1204 ; 0x801204 21f24: 8f 93 push r24 21f26: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21f2a: 8f 93 push r24 21f2c: 80 91 02 12 lds r24, 0x1202 ; 0x801202 21f30: 8f 93 push r24 21f32: 80 91 01 12 lds r24, 0x1201 ; 0x801201 21f36: 8f 93 push r24 21f38: 87 e4 ldi r24, 0x47 ; 71 21f3a: 98 e9 ldi r25, 0x98 ; 152 21f3c: 9f 93 push r25 21f3e: 8f 93 push r24 21f40: 88 e3 ldi r24, 0x38 ; 56 21f42: 98 e9 ldi r25, 0x98 ; 152 21f44: 9f 93 push r25 21f46: 8f 93 push r24 21f48: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 21f4c: 8d b7 in r24, 0x3d ; 61 21f4e: 9e b7 in r25, 0x3e ; 62 21f50: 08 96 adiw r24, 0x08 ; 8 21f52: 0f b6 in r0, 0x3f ; 63 21f54: f8 94 cli 21f56: 9e bf out 0x3e, r25 ; 62 21f58: 0f be out 0x3f, r0 ; 63 21f5a: 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(); 21f5c: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c }; } void show_preheat_nozzle_warning() { lcd_clear(); 21f60: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 21f64: 8d ee ldi r24, 0xED ; 237 21f66: 9b e4 ldi r25, 0x4B ; 75 21f68: 0e 94 32 6d call 0xda64 ; 0xda64 21f6c: ac 01 movw r20, r24 21f6e: 60 e0 ldi r22, 0x00 ; 0 21f70: 80 e0 ldi r24, 0x00 ; 0 21f72: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 21f76: 87 ed ldi r24, 0xD7 ; 215 21f78: 9b e4 ldi r25, 0x4B ; 75 21f7a: 0e 94 32 6d call 0xda64 ; 0xda64 21f7e: ac 01 movw r20, r24 21f80: 62 e0 ldi r22, 0x02 ; 2 21f82: 80 e0 ldi r24, 0x00 ; 0 21f84: 0e 94 10 6a call 0xd420 ; 0xd420 _delay(2000); 21f88: 60 ed ldi r22, 0xD0 ; 208 21f8a: 77 e0 ldi r23, 0x07 ; 7 21f8c: 80 e0 ldi r24, 0x00 ; 0 21f8e: 90 e0 ldi r25, 0x00 ; 0 21f90: 0f 94 d5 0d call 0x21baa ; 0x21baa lcd_clear(); 21f94: 0e 94 2f 6a call 0xd45e ; 0xd45e menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 21f98: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 00021f9c : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21f9c: 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(); 21f9e: f8 94 cli m = timer2_millis; 21fa0: 60 91 65 06 lds r22, 0x0665 ; 0x800665 21fa4: 70 91 66 06 lds r23, 0x0666 ; 0x800666 21fa8: 80 91 67 06 lds r24, 0x0667 ; 0x800667 21fac: 90 91 68 06 lds r25, 0x0668 ; 0x800668 SREG = oldSREG; 21fb0: 2f bf out 0x3f, r18 ; 63 return m; } 21fb2: 08 95 ret 00021fb4 : //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 21fb4: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 21fb8: 81 11 cpse r24, r1 21fba: 06 c0 rjmp .+12 ; 0x21fc8 21fbc: 60 e0 ldi r22, 0x00 ; 0 21fbe: 70 e0 ldi r23, 0x00 ; 0 21fc0: 80 e8 ldi r24, 0x80 ; 128 21fc2: 9f eb ldi r25, 0xBF ; 191 21fc4: 0f 94 47 42 call 0x2848e ; 0x2848e //! @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); 21fc8: 8a ed ldi r24, 0xDA ; 218 21fca: 9a e6 ldi r25, 0x6A ; 106 21fcc: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // Indicate that the printer is paused did_pause_print = true; 21fd0: 81 e0 ldi r24, 0x01 ; 1 21fd2: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b } else return false; } bool Stopwatch::pause() { if (isRunning()) { 21fd6: 80 91 59 03 lds r24, 0x0359 ; 0x800359 21fda: 81 30 cpi r24, 0x01 ; 1 21fdc: 69 f4 brne .+26 ; 0x21ff8 state = PAUSED; 21fde: 82 e0 ldi r24, 0x02 ; 2 21fe0: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 21fe4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 21fe8: 60 93 78 06 sts 0x0678, r22 ; 0x800678 21fec: 70 93 79 06 sts 0x0679, r23 ; 0x800679 21ff0: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 21ff4: 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; 21ff8: 82 e0 ldi r24, 0x02 ; 2 21ffa: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 21ffe: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 00022002 ::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) 22002: ff 92 push r15 22004: 0f 93 push r16 22006: 1f 93 push r17 22008: cf 93 push r28 2200a: df 93 push r29 { if (!m_isRunning) return false; 2200c: fc 01 movw r30, r24 2200e: f0 80 ld r15, Z 22010: f1 10 cpse r15, r1 22012: 08 c0 rjmp .+16 ; 0x22024 ::expired(unsigned short)+0x22> 22014: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 22016: 8f 2d mov r24, r15 22018: df 91 pop r29 2201a: cf 91 pop r28 2201c: 1f 91 pop r17 2201e: 0f 91 pop r16 22020: ff 90 pop r15 22022: 08 95 ret 22024: 8b 01 movw r16, r22 22026: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 22028: 0f 94 ce 0f call 0x21f9c ; 0x21f9c if (m_started <= m_started + msPeriod) 2202c: 89 81 ldd r24, Y+1 ; 0x01 2202e: 9a 81 ldd r25, Y+2 ; 0x02 22030: 08 0f add r16, r24 22032: 19 1f adc r17, r25 22034: 08 17 cp r16, r24 22036: 19 07 cpc r17, r25 22038: 40 f0 brcs .+16 ; 0x2204a ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 2203a: 60 17 cp r22, r16 2203c: 71 07 cpc r23, r17 2203e: 18 f4 brcc .+6 ; 0x22046 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 22040: 68 17 cp r22, r24 22042: 79 07 cpc r23, r25 22044: 38 f7 brcc .-50 ; 0x22014 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 22046: 18 82 st Y, r1 22048: e6 cf rjmp .-52 ; 0x22016 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2204a: 60 17 cp r22, r16 2204c: 71 07 cpc r23, r17 2204e: c0 f7 brcc .-16 ; 0x22040 ::expired(unsigned short)+0x3e> 22050: e1 cf rjmp .-62 ; 0x22014 ::expired(unsigned short)+0x12> 00022052 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 22052: fc 01 movw r30, r24 22054: 20 81 ld r18, Z 22056: 21 11 cpse r18, r1 22058: 0d 94 01 10 jmp 0x22002 ; 0x22002 ::expired(unsigned short)> } 2205c: 81 e0 ldi r24, 0x01 ; 1 2205e: 08 95 ret 00022060 ::start()>: /** * @brief Start timer */ template void Timer::start() 22060: cf 93 push r28 22062: df 93 push r29 22064: ec 01 movw r28, r24 { m_started = _millis(); 22066: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2206a: 7a 83 std Y+2, r23 ; 0x02 2206c: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 2206e: 81 e0 ldi r24, 0x01 ; 1 22070: 88 83 st Y, r24 } 22072: df 91 pop r29 22074: cf 91 pop r28 22076: 08 95 ret 00022078 ::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) 22078: 8f 92 push r8 2207a: 9f 92 push r9 2207c: af 92 push r10 2207e: bf 92 push r11 22080: cf 92 push r12 22082: df 92 push r13 22084: ef 92 push r14 22086: ff 92 push r15 22088: 1f 93 push r17 2208a: cf 93 push r28 2208c: df 93 push r29 { if (!m_isRunning) return false; 2208e: fc 01 movw r30, r24 22090: 10 81 ld r17, Z 22092: 11 11 cpse r17, r1 22094: 0e c0 rjmp .+28 ; 0x220b2 ::expired(unsigned long)+0x3a> 22096: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 22098: 81 2f mov r24, r17 2209a: df 91 pop r29 2209c: cf 91 pop r28 2209e: 1f 91 pop r17 220a0: ff 90 pop r15 220a2: ef 90 pop r14 220a4: df 90 pop r13 220a6: cf 90 pop r12 220a8: bf 90 pop r11 220aa: af 90 pop r10 220ac: 9f 90 pop r9 220ae: 8f 90 pop r8 220b0: 08 95 ret 220b2: 6a 01 movw r12, r20 220b4: 7b 01 movw r14, r22 220b6: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 220b8: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 220bc: 4b 01 movw r8, r22 220be: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 220c0: 89 81 ldd r24, Y+1 ; 0x01 220c2: 9a 81 ldd r25, Y+2 ; 0x02 220c4: ab 81 ldd r26, Y+3 ; 0x03 220c6: bc 81 ldd r27, Y+4 ; 0x04 220c8: c8 0e add r12, r24 220ca: d9 1e adc r13, r25 220cc: ea 1e adc r14, r26 220ce: fb 1e adc r15, r27 220d0: c8 16 cp r12, r24 220d2: d9 06 cpc r13, r25 220d4: ea 06 cpc r14, r26 220d6: fb 06 cpc r15, r27 220d8: 60 f0 brcs .+24 ; 0x220f2 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 220da: 8c 14 cp r8, r12 220dc: 9d 04 cpc r9, r13 220de: ae 04 cpc r10, r14 220e0: bf 04 cpc r11, r15 220e2: 28 f4 brcc .+10 ; 0x220ee ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 220e4: 88 16 cp r8, r24 220e6: 99 06 cpc r9, r25 220e8: aa 06 cpc r10, r26 220ea: bb 06 cpc r11, r27 220ec: a0 f6 brcc .-88 ; 0x22096 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 220ee: 18 82 st Y, r1 220f0: d3 cf rjmp .-90 ; 0x22098 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 220f2: 8c 14 cp r8, r12 220f4: 9d 04 cpc r9, r13 220f6: ae 04 cpc r10, r14 220f8: bf 04 cpc r11, r15 220fa: a0 f7 brcc .-24 ; 0x220e4 ::expired(unsigned long)+0x6c> 220fc: cc cf rjmp .-104 ; 0x22096 ::expired(unsigned long)+0x1e> 000220fe : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 220fe: 0f 93 push r16 22100: 1f 93 push r17 22102: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 22104: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22108: 88 23 and r24, r24 2210a: 09 f4 brne .+2 ; 0x2210e 2210c: 4d c0 rjmp .+154 ; 0x221a8 heating_status_counter++; 2210e: 80 91 71 06 lds r24, 0x0671 ; 0x800671 22112: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 22114: 8e 30 cpi r24, 0x0E ; 14 22116: b0 f4 brcc .+44 ; 0x22144 //! @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++; 22118: 80 93 71 06 sts 0x0671, r24 ; 0x800671 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 2211c: 63 e0 ldi r22, 0x03 ; 3 2211e: 87 e0 ldi r24, 0x07 ; 7 22120: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_space(13); 22124: 8d e0 ldi r24, 0x0D ; 13 22126: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2212a: c0 e0 ldi r28, 0x00 ; 0 2212c: 80 91 71 06 lds r24, 0x0671 ; 0x800671 22130: c8 17 cp r28, r24 22132: 58 f4 brcc .+22 ; 0x2214a lcd_putc_at(7 + dots, 3, '.'); 22134: 4e e2 ldi r20, 0x2E ; 46 22136: 63 e0 ldi r22, 0x03 ; 3 22138: 87 e0 ldi r24, 0x07 ; 7 2213a: 8c 0f add r24, r28 2213c: 0e 94 1c 6a call 0xd438 ; 0xd438 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 22140: cf 5f subi r28, 0xFF ; 255 22142: f4 cf rjmp .-24 ; 0x2212c 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; 22144: 10 92 71 06 sts 0x0671, r1 ; 0x800671 22148: e9 cf rjmp .-46 ; 0x2211c lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 2214a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2214e: 82 30 cpi r24, 0x02 ; 2 22150: d1 f0 breq .+52 ; 0x22186 22152: 30 f4 brcc .+12 ; 0x22160 22154: 81 30 cpi r24, 0x01 ; 1 22156: 59 f0 breq .+22 ; 0x2216e case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 22158: cf 91 pop r28 2215a: 1f 91 pop r17 2215c: 0f 91 pop r16 2215e: 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) { 22160: 83 30 cpi r24, 0x03 ; 3 22162: f9 f0 breq .+62 ; 0x221a2 22164: 84 30 cpi r24, 0x04 ; 4 22166: c1 f7 brne .-16 ; 0x22158 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)); 22168: 87 e4 ldi r24, 0x47 ; 71 2216a: 99 e4 ldi r25, 0x49 ; 73 2216c: 0e c0 rjmp .+28 ; 0x2218a 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)); 2216e: 80 e7 ldi r24, 0x70 ; 112 22170: 99 e4 ldi r25, 0x49 ; 73 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 22172: 0e 94 32 6d call 0xda64 ; 0xda64 22176: ac 01 movw r20, r24 22178: 63 e0 ldi r22, 0x03 ; 3 2217a: 80 e0 ldi r24, 0x00 ; 0 break; } } } 2217c: cf 91 pop r28 2217e: 1f 91 pop r17 22180: 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)); 22182: 0c 94 10 6a jmp 0xd420 ; 0xd420 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)); 22186: 80 e6 ldi r24, 0x60 ; 96 22188: 99 e4 ldi r25, 0x49 ; 73 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)); 2218a: 0e 94 32 6d call 0xda64 ; 0xda64 2218e: ac 01 movw r20, r24 22190: 63 e0 ldi r22, 0x03 ; 3 22192: 80 e0 ldi r24, 0x00 ; 0 22194: 0e 94 10 6a call 0xd420 ; 0xd420 heating_status = HeatingStatus::NO_HEATING; 22198: 10 92 99 03 sts 0x0399, r1 ; 0x800399 heating_status_counter = 0; 2219c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 221a0: db cf rjmp .-74 ; 0x22158 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)); 221a2: 82 e5 ldi r24, 0x52 ; 82 221a4: 99 e4 ldi r25, 0x49 ; 73 221a6: e5 cf rjmp .-54 ; 0x22172 break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 221a8: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 221ac: 88 23 and r24, r24 221ae: 61 f1 breq .+88 ; 0x22208 break; default: break; } } else if ((IS_SD_PRINTING) && 221b0: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 221b4: 81 11 cpse r24, r1 221b6: 28 c0 rjmp .+80 ; 0x22208 (custom_message_type == CustomMsg::Status) && 221b8: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 221bc: 82 30 cpi r24, 0x02 ; 2 221be: 20 f5 brcc .+72 ; 0x22208 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 221c0: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 221c4: 81 11 cpse r24, r1 221c6: 16 c0 rjmp .+44 ; 0x221f4 (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); 221c8: 80 91 81 13 lds r24, 0x1381 ; 0x801381 221cc: 88 23 and r24, r24 221ce: 09 f4 brne .+2 ; 0x221d2 221d0: 35 c0 rjmp .+106 ; 0x2223c 221d2: 81 e8 ldi r24, 0x81 ; 129 221d4: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 221d6: 20 91 cc 0d lds r18, 0x0DCC ; 0x800dcc 221da: 64 e1 ldi r22, 0x14 ; 20 221dc: 82 0f add r24, r18 221de: 91 1d adc r25, r1 221e0: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 221e4: 81 11 cpse r24, r1 221e6: 2d c0 rjmp .+90 ; 0x22242 { scrollstuff++; 221e8: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 221ec: 8f 5f subi r24, 0xFF ; 255 221ee: 80 93 cc 0d sts 0x0DCC, r24 ; 0x800dcc 221f2: b2 cf rjmp .-156 ; 0x22158 221f4: 40 e2 ldi r20, 0x20 ; 32 221f6: 5e e4 ldi r21, 0x4E ; 78 221f8: 60 e0 ldi r22, 0x00 ; 0 221fa: 70 e0 ldi r23, 0x00 ; 0 221fc: 8e e1 ldi r24, 0x1E ; 30 221fe: 95 e0 ldi r25, 0x05 ; 5 22200: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> 22204: 81 11 cpse r24, r1 22206: e0 cf rjmp .-64 ; 0x221c8 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) 22208: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 2220c: 81 11 cpse r24, r1 2220e: 1c c0 rjmp .+56 ; 0x22248 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 22210: e0 91 c7 06 lds r30, 0x06C7 ; 0x8006c7 22214: ea 30 cpi r30, 0x0A ; 10 22216: 08 f0 brcs .+2 ; 0x2221a 22218: 9f cf rjmp .-194 ; 0x22158 2221a: f0 e0 ldi r31, 0x00 ; 0 2221c: 88 27 eor r24, r24 2221e: ec 5e subi r30, 0xEC ; 236 22220: fe 4e sbci r31, 0xEE ; 238 22222: 8e 4f sbci r24, 0xFE ; 254 22224: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 22228: 7d 38 cpi r23, 0x8D ; 141 2222a: 95 37 cpi r25, 0x75 ; 117 2222c: 7d 38 cpi r23, 0x8D ; 141 2222e: 29 38 cpi r18, 0x89 ; 137 22230: b9 37 cpi r27, 0x79 ; 121 22232: 17 37 cpi r17, 0x77 ; 119 22234: 7d 38 cpi r23, 0x8D ; 141 22236: 7d 38 cpi r23, 0x8D ; 141 22238: a3 38 cpi r26, 0x83 ; 131 2223a: 7d 38 cpi r23, 0x8D ; 141 (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); 2223c: 8c e6 ldi r24, 0x6C ; 108 2223e: 93 e1 ldi r25, 0x13 ; 19 22240: ca cf rjmp .-108 ; 0x221d6 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 22242: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 22246: 88 cf rjmp .-240 ; 0x22158 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 22248: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 2224c: 88 23 and r24, r24 2224e: 01 f3 breq .-64 ; 0x22210 * 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; 22250: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 22254: 00 91 1f 05 lds r16, 0x051F ; 0x80051f <_ZL26lcd_status_message_timeout.lto_priv.418+0x1> 22258: 10 91 20 05 lds r17, 0x0520 ; 0x800520 <_ZL26lcd_status_message_timeout.lto_priv.418+0x2> 2225c: 20 91 21 05 lds r18, 0x0521 ; 0x800521 <_ZL26lcd_status_message_timeout.lto_priv.418+0x3> 22260: 30 91 22 05 lds r19, 0x0522 ; 0x800522 <_ZL26lcd_status_message_timeout.lto_priv.418+0x4> 22264: 60 1b sub r22, r16 22266: 71 0b sbc r23, r17 22268: 82 0b sbc r24, r18 2226a: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 2226c: 60 3a cpi r22, 0xA0 ; 160 2226e: 7f 40 sbci r23, 0x0F ; 15 22270: 81 05 cpc r24, r1 22272: 91 05 cpc r25, r1 22274: 68 f6 brcc .-102 ; 0x22210 22276: 70 cf rjmp .-288 ; 0x22158 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); 22278: 63 e0 ldi r22, 0x03 ; 3 2227a: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 2227e: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 22282: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 22286: c4 e1 ldi r28, 0x14 ; 20 22288: 6c 2f mov r22, r28 2228a: 68 1b sub r22, r24 2228c: 90 e0 ldi r25, 0x00 ; 0 2228e: 87 5f subi r24, 0xF7 ; 247 22290: 9a 4f sbci r25, 0xFA ; 250 22292: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 lcd_status_message_idx = LCD_WIDTH - padding; 22296: c8 1b sub r28, r24 22298: c0 93 08 05 sts 0x0508, r28 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 2229c: 5d cf rjmp .-326 ; 0x22158 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 2229e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222a2: 8b 30 cpi r24, 0x0B ; 11 222a4: 08 f1 brcs .+66 ; 0x222e8 lcd_set_cursor(0, 3); 222a6: 63 e0 ldi r22, 0x03 ; 3 222a8: 80 e0 ldi r24, 0x00 ; 0 222aa: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_space(LCD_WIDTH); 222ae: 84 e1 ldi r24, 0x14 ; 20 222b0: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 222b4: 87 e3 ldi r24, 0x37 ; 55 222b6: 99 e4 ldi r25, 0x49 ; 73 222b8: 0e 94 32 6d call 0xda64 ; 0xda64 222bc: ac 01 movw r20, r24 222be: 63 e0 ldi r22, 0x03 ; 3 222c0: 80 e0 ldi r24, 0x00 ; 0 222c2: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_puts_P(PSTR(" : ")); 222c6: 84 ec ldi r24, 0xC4 ; 196 222c8: 95 e9 ldi r25, 0x95 ; 149 222ca: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_print(custom_message_state - 10); 222ce: 60 91 ac 03 lds r22, 0x03AC ; 0x8003ac 222d2: 6a 50 subi r22, 0x0A ; 10 222d4: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 222d6: 07 2e mov r0, r23 222d8: 00 0c add r0, r0 222da: 88 0b sbc r24, r24 222dc: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 222de: cf 91 pop r28 222e0: 1f 91 pop r17 222e2: 0f 91 pop r16 222e4: 0c 94 b5 6b jmp 0xd76a ; 0xd76a 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) { 222e8: 83 30 cpi r24, 0x03 ; 3 222ea: 31 f4 brne .+12 ; 0x222f8 lcd_setstatuspgm(MSG_WELCOME); 222ec: 8b e0 ldi r24, 0x0B ; 11 222ee: 9c e6 ldi r25, 0x6C ; 108 222f0: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 custom_message_type = CustomMsg::Status; 222f4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } if (custom_message_state > 3 && custom_message_state <= 10) { 222f8: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222fc: 84 50 subi r24, 0x04 ; 4 222fe: 87 30 cpi r24, 0x07 ; 7 22300: 08 f0 brcs .+2 ; 0x22304 22302: 2a cf rjmp .-428 ; 0x22158 lcd_set_cursor(0, 3); 22304: 63 e0 ldi r22, 0x03 ; 3 22306: 80 e0 ldi r24, 0x00 ; 0 22308: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_space(19); 2230c: 83 e1 ldi r24, 0x13 ; 19 2230e: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 22312: 84 e2 ldi r24, 0x24 ; 36 22314: 99 e4 ldi r25, 0x49 ; 73 22316: 0e 94 32 6d call 0xda64 ; 0xda64 2231a: ac 01 movw r20, r24 2231c: 63 e0 ldi r22, 0x03 ; 3 2231e: 80 e0 ldi r24, 0x00 ; 0 22320: 0e 94 10 6a call 0xd420 ; 0xd420 custom_message_state--; 22324: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22328: 81 50 subi r24, 0x01 ; 1 2232a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 2232e: 14 cf rjmp .-472 ; 0x22158 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 22330: 64 e1 ldi r22, 0x14 ; 20 22332: 89 e0 ldi r24, 0x09 ; 9 22334: 95 e0 ldi r25, 0x05 ; 5 22336: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 2233a: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 2233e: 30 91 70 06 lds r19, 0x0670 ; 0x800670 22342: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 22346: 90 91 6e 06 lds r25, 0x066E ; 0x80066e 2234a: 82 17 cp r24, r18 2234c: 93 07 cpc r25, r19 2234e: 0c f4 brge .+2 ; 0x22352 22350: 03 cf rjmp .-506 ; 0x22158 22352: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22356: 88 23 and r24, r24 22358: 09 f4 brne .+2 ; 0x2235c 2235a: fe ce rjmp .-516 ; 0x22158 lcd_set_cursor(10, 3); 2235c: 63 e0 ldi r22, 0x03 ; 3 2235e: 8a e0 ldi r24, 0x0A ; 10 22360: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 22364: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 22368: 8f 93 push r24 2236a: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 2236e: 8f 93 push r24 22370: 80 91 70 06 lds r24, 0x0670 ; 0x800670 22374: 8f 93 push r24 22376: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 2237a: 8f 93 push r24 2237c: 8b eb ldi r24, 0xBB ; 187 2237e: 95 e9 ldi r25, 0x95 ; 149 } 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); 22380: 9f 93 push r25 22382: 8f 93 push r24 22384: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 22388: 0f 90 pop r0 2238a: 0f 90 pop r0 2238c: 0f 90 pop r0 2238e: 0f 90 pop r0 22390: 0f 90 pop r0 22392: 0f 90 pop r0 22394: e1 ce rjmp .-574 ; 0x22158 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); 22396: 63 e0 ldi r22, 0x03 ; 3 22398: 80 e0 ldi r24, 0x00 ; 0 2239a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 2239e: c0 91 ac 03 lds r28, 0x03AC ; 0x8003ac 223a2: 86 e3 ldi r24, 0x36 ; 54 223a4: 9b e3 ldi r25, 0x3B ; 59 223a6: 0e 94 32 6d call 0xda64 ; 0xda64 223aa: 1f 92 push r1 223ac: cf 93 push r28 223ae: 9f 93 push r25 223b0: 8f 93 push r24 223b2: 8d ea ldi r24, 0xAD ; 173 223b4: 95 e9 ldi r25, 0x95 ; 149 223b6: e4 cf rjmp .-56 ; 0x22380 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 223b8: 84 e1 ldi r24, 0x14 ; 20 223ba: 99 e4 ldi r25, 0x49 ; 73 223bc: 0e 94 32 6d call 0xda64 ; 0xda64 223c0: ac 01 movw r20, r24 223c2: 63 e0 ldi r22, 0x03 ; 3 223c4: 80 e0 ldi r24, 0x00 ; 0 223c6: 0e 94 10 6a call 0xd420 ; 0xd420 if (custom_message_state <= PINDA_HEAT_T) { 223ca: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 223ce: 89 37 cpi r24, 0x79 ; 121 223d0: 08 f0 brcs .+2 ; 0x223d4 223d2: c2 ce rjmp .-636 ; 0x22158 lcd_puts_P(PSTR(": ")); 223d4: 8a ea ldi r24, 0xAA ; 170 223d6: 95 e9 ldi r25, 0x95 ; 149 223d8: 0e 94 e7 69 call 0xd3ce ; 0xd3ce } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 223dc: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 223e0: 0e 94 ab 6a call 0xd556 ; 0xd556 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 223e4: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 223e6: cf 91 pop r28 223e8: 1f 91 pop r17 223ea: 0f 91 pop r16 223ec: 0c 94 ab 6a jmp 0xd556 ; 0xd556 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 223f0: 83 e0 ldi r24, 0x03 ; 3 223f2: 99 e4 ldi r25, 0x49 ; 73 223f4: be ce rjmp .-644 ; 0x22172 000223f6 ::start()>: /** * @brief Start timer */ template void Timer::start() 223f6: cf 93 push r28 223f8: df 93 push r29 223fa: ec 01 movw r28, r24 { m_started = _millis(); 223fc: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 22400: 69 83 std Y+1, r22 ; 0x01 22402: 7a 83 std Y+2, r23 ; 0x02 22404: 8b 83 std Y+3, r24 ; 0x03 22406: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 22408: 81 e0 ldi r24, 0x01 ; 1 2240a: 88 83 st Y, r24 } 2240c: df 91 pop r29 2240e: cf 91 pop r28 22410: 08 95 ret 00022412 : //! 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) { 22412: cf 92 push r12 22414: df 92 push r13 22416: ef 92 push r14 22418: ff 92 push r15 2241a: 1f 93 push r17 2241c: cf 93 push r28 2241e: df 93 push r29 22420: cd b7 in r28, 0x3d ; 61 22422: de b7 in r29, 0x3e ; 62 22424: 64 97 sbiw r28, 0x14 ; 20 22426: 0f b6 in r0, 0x3f ; 63 22428: f8 94 cli 2242a: de bf out 0x3e, r29 ; 62 2242c: 0f be out 0x3f, r0 ; 63 2242e: cd bf out 0x3d, r28 ; 61 22430: 7c 01 movw r14, r24 22432: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 22434: 63 e7 ldi r22, 0x73 ; 115 22436: 75 e9 ldi r23, 0x95 ; 149 22438: ce 01 movw r24, r28 2243a: 01 96 adiw r24, 0x01 ; 1 2243c: 0f 94 f3 9e call 0x33de6 ; 0x33de6 strcat_P(msg, type); 22440: b7 01 movw r22, r14 22442: ce 01 movw r24, r28 22444: 01 96 adiw r24, 0x01 ; 1 22446: 0f 94 df 9e call 0x33dbe ; 0x33dbe lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 2244a: 83 e0 ldi r24, 0x03 ; 3 2244c: 0e 94 19 e2 call 0x1c432 ; 0x1c432 22450: 88 23 and r24, r24 22452: e1 f0 breq .+56 ; 0x2248c bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 22454: be 01 movw r22, r28 22456: 6f 5f subi r22, 0xFF ; 255 22458: 7f 4f sbci r23, 0xFF ; 255 2245a: 89 e0 ldi r24, 0x09 ; 9 2245c: 95 e0 ldi r25, 0x05 ; 5 2245e: 0f 94 9e a7 call 0x34f3c ; 0x34f3c 22462: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 22464: 8e e1 ldi r24, 0x1E ; 30 22466: 95 e0 ldi r25, 0x05 ; 5 22468: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> lcd_status_message_level = severity; 2246c: 83 e0 ldi r24, 0x03 ; 3 2246e: 80 93 8e 03 sts 0x038E, r24 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> custom_message_type = CustomMsg::Status; 22472: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 22476: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 2247a: cd 28 or r12, r13 2247c: 39 f0 breq .+14 ; 0x2248c // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 2247e: 60 e0 ldi r22, 0x00 ; 0 22480: ce 01 movw r24, r28 22482: 01 96 adiw r24, 0x01 ; 1 22484: 0e 94 fe e1 call 0x1c3fc ; 0x1c3fc lcd_return_to_status(); 22488: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 2248c: 8a e5 ldi r24, 0x5A ; 90 2248e: 9e e9 ldi r25, 0x9E ; 158 22490: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if(e != EXTRUDERS) { 22494: 11 30 cpi r17, 0x01 ; 1 22496: 51 f0 breq .+20 ; 0x224ac 22498: 61 2f mov r22, r17 2249a: 70 e0 ldi r23, 0x00 ; 0 2249c: 90 e0 ldi r25, 0x00 ; 0 2249e: 80 e0 ldi r24, 0x00 ; 0 224a0: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 224a4: 80 e7 ldi r24, 0x70 ; 112 224a6: 95 e9 ldi r25, 0x95 ; 149 224a8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } SERIAL_ERRORPGM("Heaters switched off. "); 224ac: 89 e5 ldi r24, 0x59 ; 89 224ae: 95 e9 ldi r25, 0x95 ; 149 224b0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORRPGM(type); 224b4: c7 01 movw r24, r14 224b6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNPGM(" triggered!"); 224ba: 8d e4 ldi r24, 0x4D ; 77 224bc: 95 e9 ldi r25, 0x95 ; 149 224be: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 } 224c2: 64 96 adiw r28, 0x14 ; 20 224c4: 0f b6 in r0, 0x3f ; 63 224c6: f8 94 cli 224c8: de bf out 0x3e, r29 ; 62 224ca: 0f be out 0x3f, r0 ; 63 224cc: cd bf out 0x3d, r28 ; 61 224ce: df 91 pop r29 224d0: cf 91 pop r28 224d2: 1f 91 pop r17 224d4: ff 90 pop r15 224d6: ef 90 pop r14 224d8: df 90 pop r13 224da: cf 90 pop r12 224dc: 08 95 ret 000224de <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 224de: 1f 92 push r1 224e0: 0f 92 push r0 224e2: 0f b6 in r0, 0x3f ; 63 224e4: 0f 92 push r0 224e6: 11 24 eor r1, r1 224e8: 2f 93 push r18 224ea: 3f 93 push r19 224ec: 8f 93 push r24 224ee: 9f 93 push r25 224f0: af 93 push r26 224f2: 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; 224f4: 80 91 65 06 lds r24, 0x0665 ; 0x800665 224f8: 90 91 66 06 lds r25, 0x0666 ; 0x800666 224fc: a0 91 67 06 lds r26, 0x0667 ; 0x800667 22500: b0 91 68 06 lds r27, 0x0668 ; 0x800668 unsigned char f = timer2_fract; 22504: 30 91 64 06 lds r19, 0x0664 ; 0x800664 m += MILLIS_INC; f += FRACT_INC; 22508: 23 e0 ldi r18, 0x03 ; 3 2250a: 23 0f add r18, r19 if (f >= FRACT_MAX) 2250c: 2d 37 cpi r18, 0x7D ; 125 2250e: 58 f5 brcc .+86 ; 0x22566 <__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; 22510: 01 96 adiw r24, 0x01 ; 1 22512: a1 1d adc r26, r1 22514: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 22516: 20 93 64 06 sts 0x0664, r18 ; 0x800664 timer2_millis = m; 2251a: 80 93 65 06 sts 0x0665, r24 ; 0x800665 2251e: 90 93 66 06 sts 0x0666, r25 ; 0x800666 22522: a0 93 67 06 sts 0x0667, r26 ; 0x800667 22526: b0 93 68 06 sts 0x0668, r27 ; 0x800668 timer2_overflow_count++; 2252a: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2252e: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 22532: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 22536: b0 91 6c 06 lds r27, 0x066C ; 0x80066c 2253a: 01 96 adiw r24, 0x01 ; 1 2253c: a1 1d adc r26, r1 2253e: b1 1d adc r27, r1 22540: 80 93 69 06 sts 0x0669, r24 ; 0x800669 22544: 90 93 6a 06 sts 0x066A, r25 ; 0x80066a 22548: a0 93 6b 06 sts 0x066B, r26 ; 0x80066b 2254c: b0 93 6c 06 sts 0x066C, r27 ; 0x80066c } 22550: bf 91 pop r27 22552: af 91 pop r26 22554: 9f 91 pop r25 22556: 8f 91 pop r24 22558: 3f 91 pop r19 2255a: 2f 91 pop r18 2255c: 0f 90 pop r0 2255e: 0f be out 0x3f, r0 ; 63 22560: 0f 90 pop r0 22562: 1f 90 pop r1 22564: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 22566: 26 e8 ldi r18, 0x86 ; 134 22568: 23 0f add r18, r19 m += 1; 2256a: 02 96 adiw r24, 0x02 ; 2 2256c: a1 1d adc r26, r1 2256e: b1 1d adc r27, r1 22570: d2 cf rjmp .-92 ; 0x22516 <__vector_15+0x38> 00022572 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 22572: 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; 22574: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 22578: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2257c: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 22580: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22584: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22586: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 22588: 0e 94 e7 fa call 0x1f5ce ; 0x1f5ce temp_mgr_pid(); 2258c: 0e 94 24 f8 call 0x1f048 ; 0x1f048 // 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); 22590: 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; 22592: 10 92 92 06 sts 0x0692, r1 ; 0x800692 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22596: cf bf out 0x3f, r28 ; 63 #endif } } 22598: cf 91 pop r28 2259a: 08 95 ret 0002259c : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 2259c: 0f 94 b9 12 call 0x22572 ; 0x22572 fanSpeed = 0; 225a0: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 lcd_return_to_status(); 225a4: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e 000225a8 : // 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) { 225a8: 1f 93 push r17 225aa: cf 93 push r28 225ac: df 93 push r29 225ae: c8 2f mov r28, r24 225b0: 16 2f mov r17, r22 225b2: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 225b4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 225b8: 80 fd sbrc r24, 0 225ba: 18 c0 rjmp .+48 ; 0x225ec 225bc: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 225c0: 81 11 cpse r24, r1 225c2: 14 c0 rjmp .+40 ; 0x225ec saved_bed_temperature = target_temperature_bed; 225c4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 225c8: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_temperature = target_temperature[index]; 225cc: e6 2f mov r30, r22 225ce: f0 e0 ldi r31, 0x00 ; 0 225d0: ee 0f add r30, r30 225d2: ff 1f adc r31, r31 225d4: ef 50 subi r30, 0x0F ; 15 225d6: fe 4e sbci r31, 0xEE ; 238 225d8: 80 81 ld r24, Z 225da: 91 81 ldd r25, Z+1 ; 0x01 225dc: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 225e0: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_fan_speed = fanSpeed; 225e4: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 225e8: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 225ec: 0f 94 b9 12 call 0x22572 ; 0x22572 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 225f0: 0e 94 b3 6e call 0xdd66 ; 0xdd66 setExtruderAutoFanState(3); 225f4: 83 e0 ldi r24, 0x03 ; 3 225f6: 0e 94 c0 6e call 0xdd80 ; 0xdd80 SET_OUTPUT(FAN_PIN); 225fa: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 225fe: 88 60 ori r24, 0x08 ; 8 22600: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 22604: 8f ef ldi r24, 0xFF ; 255 22606: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 2260a: 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) { 2260e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22612: 80 ff sbrs r24, 0 22614: 07 c0 rjmp .+14 ; 0x22624 22616: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2261a: 82 95 swap r24 2261c: 86 95 lsr r24 2261e: 87 70 andi r24, 0x07 ; 7 22620: d8 17 cp r29, r24 22622: c0 f4 brcc .+48 ; 0x22654 temp_error_state.source = (uint8_t)source; 22624: c3 70 andi r28, 0x03 ; 3 22626: cc 0f add r28, r28 22628: cc 0f add r28, r28 2262a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2262e: 83 7f andi r24, 0xF3 ; 243 22630: 8c 2b or r24, r28 22632: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.index = index; 22636: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2263a: 10 fb bst r17, 0 2263c: 84 f9 bld r24, 4 2263e: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.type = (uint8_t)type; 22642: d2 95 swap r29 22644: dd 0f add r29, r29 22646: d0 7e andi r29, 0xE0 ; 224 22648: 40 91 9a 03 lds r20, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2264c: 4f 71 andi r20, 0x1F ; 31 2264e: 4d 2b or r20, r29 22650: 40 93 9a 03 sts 0x039A, r20 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } // always set the error state temp_error_state.error = true; 22654: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22658: 81 60 ori r24, 0x01 ; 1 2265a: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.assert = true; 2265e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22662: 82 60 ori r24, 0x02 ; 2 22664: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } 22668: df 91 pop r29 2266a: cf 91 pop r28 2266c: 1f 91 pop r17 2266e: 08 95 ret 00022670 : 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) { 22670: 2f 92 push r2 22672: 3f 92 push r3 22674: 4f 92 push r4 22676: 5f 92 push r5 22678: 6f 92 push r6 2267a: 7f 92 push r7 2267c: 8f 92 push r8 2267e: 9f 92 push r9 22680: af 92 push r10 22682: bf 92 push r11 22684: cf 92 push r12 22686: df 92 push r13 22688: ef 92 push r14 2268a: ff 92 push r15 2268c: 0f 93 push r16 2268e: 1f 93 push r17 22690: cf 93 push r28 22692: df 93 push r29 22694: cd b7 in r28, 0x3d ; 61 22696: de b7 in r29, 0x3e ; 62 22698: 2c 97 sbiw r28, 0x0c ; 12 2269a: 0f b6 in r0, 0x3f ; 63 2269c: f8 94 cli 2269e: de bf out 0x3e, r29 ; 62 226a0: 0f be out 0x3f, r0 ; 63 226a2: cd bf out 0x3d, r28 ; 61 226a4: 28 2e mov r2, r24 226a6: 49 83 std Y+1, r20 ; 0x01 226a8: 5a 83 std Y+2, r21 ; 0x02 226aa: 6b 83 std Y+3, r22 ; 0x03 226ac: 7c 83 std Y+4, r23 ; 0x04 226ae: 28 01 movw r4, r16 226b0: 39 01 movw r6, r18 226b2: 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) 226b4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 226b8: 02 2d mov r16, r2 226ba: 10 e0 ldi r17, 0x00 ; 0 226bc: 98 01 movw r18, r16 226be: 22 0f add r18, r18 226c0: 33 1f adc r19, r19 226c2: 22 0f add r18, r18 226c4: 33 1f adc r19, r19 226c6: 3c 87 std Y+12, r19 ; 0x0c 226c8: 2b 87 std Y+11, r18 ; 0x0b 226ca: f9 01 movw r30, r18 226cc: e7 5f subi r30, 0xF7 ; 247 226ce: f9 4f sbci r31, 0xF9 ; 249 226d0: 80 80 ld r8, Z 226d2: 91 80 ldd r9, Z+1 ; 0x01 226d4: a2 80 ldd r10, Z+2 ; 0x02 226d6: b3 80 ldd r11, Z+3 ; 0x03 226d8: 68 19 sub r22, r8 226da: 79 09 sbc r23, r9 226dc: 8a 09 sbc r24, r10 226de: 9b 09 sbc r25, r11 226e0: 61 3d cpi r22, 0xD1 ; 209 226e2: 77 40 sbci r23, 0x07 ; 7 226e4: 81 05 cpc r24, r1 226e6: 91 05 cpc r25, r1 226e8: 08 f4 brcc .+2 ; 0x226ec 226ea: ea c0 rjmp .+468 ; 0x228c0 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 226ec: 33 20 and r3, r3 226ee: 09 f4 brne .+2 ; 0x226f2 226f0: 75 c0 rjmp .+234 ; 0x227dc { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 226f2: 88 e6 ldi r24, 0x68 ; 104 226f4: 91 e0 ldi r25, 0x01 ; 1 226f6: 9a 87 std Y+10, r25 ; 0x0a 226f8: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 226fa: 80 e0 ldi r24, 0x00 ; 0 226fc: 90 e0 ldi r25, 0x00 ; 0 226fe: a0 ea ldi r26, 0xA0 ; 160 22700: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 22702: 8d 83 std Y+5, r24 ; 0x05 22704: 9e 83 std Y+6, r25 ; 0x06 22706: af 83 std Y+7, r26 ; 0x07 22708: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 2270a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2270e: eb 85 ldd r30, Y+11 ; 0x0b 22710: fc 85 ldd r31, Y+12 ; 0x0c 22712: e7 5f subi r30, 0xF7 ; 247 22714: f9 4f sbci r31, 0xF9 ; 249 22716: 60 83 st Z, r22 22718: 71 83 std Z+1, r23 ; 0x01 2271a: 82 83 std Z+2, r24 ; 0x02 2271c: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2271e: 20 e0 ldi r18, 0x00 ; 0 22720: 30 e0 ldi r19, 0x00 ; 0 22722: a9 01 movw r20, r18 22724: c7 01 movw r24, r14 22726: b6 01 movw r22, r12 22728: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2272c: 81 11 cpse r24, r1 2272e: 07 c0 rjmp .+14 ; 0x2273e { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22730: f8 01 movw r30, r16 22732: ee 0f add r30, r30 22734: ff 1f adc r31, r31 22736: eb 5f subi r30, 0xFB ; 251 22738: f9 4f sbci r31, 0xF9 ; 249 2273a: 11 82 std Z+1, r1 ; 0x01 2273c: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2273e: ab 85 ldd r26, Y+11 ; 0x0b 22740: bc 85 ldd r27, Y+12 ; 0x0c 22742: a3 50 subi r26, 0x03 ; 3 22744: ba 4f sbci r27, 0xFA ; 250 22746: 5d 01 movw r10, r26 22748: 29 81 ldd r18, Y+1 ; 0x01 2274a: 3a 81 ldd r19, Y+2 ; 0x02 2274c: 4b 81 ldd r20, Y+3 ; 0x03 2274e: 5c 81 ldd r21, Y+4 ; 0x04 22750: 6d 91 ld r22, X+ 22752: 7d 91 ld r23, X+ 22754: 8d 91 ld r24, X+ 22756: 9c 91 ld r25, X 22758: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2275c: 88 23 and r24, r24 2275e: 09 f4 brne .+2 ; 0x22762 22760: 91 c0 rjmp .+290 ; 0x22884 { if (_target_temperature > 0) 22762: 20 e0 ldi r18, 0x00 ; 0 22764: 30 e0 ldi r19, 0x00 ; 0 22766: a9 01 movw r20, r18 22768: 69 81 ldd r22, Y+1 ; 0x01 2276a: 7a 81 ldd r23, Y+2 ; 0x02 2276c: 8b 81 ldd r24, Y+3 ; 0x03 2276e: 9c 81 ldd r25, Y+4 ; 0x04 22770: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22774: f8 01 movw r30, r16 22776: e5 50 subi r30, 0x05 ; 5 22778: fa 4f sbci r31, 0xFA ; 250 2277a: 18 16 cp r1, r24 2277c: c4 f5 brge .+112 ; 0x227ee { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 2277e: 81 e0 ldi r24, 0x01 ; 1 22780: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 22782: 89 81 ldd r24, Y+1 ; 0x01 22784: 9a 81 ldd r25, Y+2 ; 0x02 22786: ab 81 ldd r26, Y+3 ; 0x03 22788: bc 81 ldd r27, Y+4 ; 0x04 2278a: f5 01 movw r30, r10 2278c: 80 83 st Z, r24 2278e: 91 83 std Z+1, r25 ; 0x01 22790: a2 83 std Z+2, r26 ; 0x02 22792: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 22794: eb 85 ldd r30, Y+11 ; 0x0b 22796: fc 85 ldd r31, Y+12 ; 0x0c 22798: ed 50 subi r30, 0x0D ; 13 2279a: fa 4f sbci r31, 0xFA ; 250 2279c: 40 82 st Z, r4 2279e: 51 82 std Z+1, r5 ; 0x01 227a0: 62 82 std Z+2, r6 ; 0x02 227a2: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 227a4: f8 01 movw r30, r16 227a6: ef 50 subi r30, 0x0F ; 15 227a8: fa 4f sbci r31, 0xFA ; 250 227aa: 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)) 227ac: a3 01 movw r20, r6 227ae: 92 01 movw r18, r4 227b0: bc 01 movw r22, r24 227b2: cd 01 movw r24, r26 227b4: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 227b8: 18 16 cp r1, r24 227ba: 1c f5 brge .+70 ; 0x22802 { __preheat_counter[_heater_id]++; 227bc: f8 01 movw r30, r16 227be: ef 50 subi r30, 0x0F ; 15 227c0: fa 4f sbci r31, 0xFA ; 250 227c2: 80 81 ld r24, Z 227c4: 8f 5f subi r24, 0xFF ; 255 227c6: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 227c8: 31 10 cpse r3, r1 227ca: c7 c0 rjmp .+398 ; 0x2295a 227cc: 89 30 cpi r24, 0x09 ; 9 227ce: c8 f0 brcs .+50 ; 0x22802 { __delta=2.0; 227d0: 81 2c mov r8, r1 227d2: 91 2c mov r9, r1 227d4: a1 2c mov r10, r1 227d6: 50 e4 ldi r21, 0x40 ; 64 227d8: b5 2e mov r11, r21 227da: e8 c0 rjmp .+464 ; 0x229ac #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 227dc: ad e2 ldi r26, 0x2D ; 45 227de: b0 e0 ldi r27, 0x00 ; 0 227e0: ba 87 std Y+10, r27 ; 0x0a 227e2: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 227e4: 80 e0 ldi r24, 0x00 ; 0 227e6: 90 e0 ldi r25, 0x00 ; 0 227e8: a0 e7 ldi r26, 0x70 ; 112 227ea: b1 e4 ldi r27, 0x41 ; 65 227ec: 8a cf rjmp .-236 ; 0x22702 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 227ee: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 227f0: 89 81 ldd r24, Y+1 ; 0x01 227f2: 9a 81 ldd r25, Y+2 ; 0x02 227f4: ab 81 ldd r26, Y+3 ; 0x03 227f6: bc 81 ldd r27, Y+4 ; 0x04 227f8: f5 01 movw r30, r10 227fa: 80 83 st Z, r24 227fc: 91 83 std Z+1, r25 ; 0x01 227fe: a2 83 std Z+2, r26 ; 0x02 22800: 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) 22802: 2d 81 ldd r18, Y+5 ; 0x05 22804: 3e 81 ldd r19, Y+6 ; 0x06 22806: 4f 81 ldd r20, Y+7 ; 0x07 22808: 58 85 ldd r21, Y+8 ; 0x08 2280a: 69 81 ldd r22, Y+1 ; 0x01 2280c: 7a 81 ldd r23, Y+2 ; 0x02 2280e: 8b 81 ldd r24, Y+3 ; 0x03 22810: 9c 81 ldd r25, Y+4 ; 0x04 22812: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 22816: a3 01 movw r20, r6 22818: 92 01 movw r18, r4 2281a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2281e: 87 ff sbrs r24, 7 22820: 46 c0 rjmp .+140 ; 0x228ae 22822: f8 01 movw r30, r16 22824: e5 50 subi r30, 0x05 ; 5 22826: fa 4f sbci r31, 0xFA ; 250 22828: 80 81 ld r24, Z 2282a: 81 30 cpi r24, 0x01 ; 1 2282c: 49 f4 brne .+18 ; 0x22840 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2282e: 82 e0 ldi r24, 0x02 ; 2 22830: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22832: f8 01 movw r30, r16 22834: ee 0f add r30, r30 22836: ff 1f adc r31, r31 22838: eb 5f subi r30, 0xFB ; 251 2283a: f9 4f sbci r31, 0xF9 ; 249 2283c: 11 82 std Z+1, r1 ; 0x01 2283e: 10 82 st Z, r1 } if (_output > 0) 22840: 20 e0 ldi r18, 0x00 ; 0 22842: 30 e0 ldi r19, 0x00 ; 0 22844: a9 01 movw r20, r18 22846: c7 01 movw r24, r14 22848: b6 01 movw r22, r12 2284a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2284e: 18 16 cp r1, r24 22850: bc f5 brge .+110 ; 0x228c0 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 22852: 29 81 ldd r18, Y+1 ; 0x01 22854: 3a 81 ldd r19, Y+2 ; 0x02 22856: 4b 81 ldd r20, Y+3 ; 0x03 22858: 5c 81 ldd r21, Y+4 ; 0x04 2285a: 6d 81 ldd r22, Y+5 ; 0x05 2285c: 7e 81 ldd r23, Y+6 ; 0x06 2285e: 8f 81 ldd r24, Y+7 ; 0x07 22860: 98 85 ldd r25, Y+8 ; 0x08 22862: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 22866: a3 01 movw r20, r6 22868: 92 01 movw r18, r4 2286a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2286e: 18 16 cp r1, r24 22870: 0c f0 brlt .+2 ; 0x22874 22872: 3f c0 rjmp .+126 ; 0x228f2 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22874: 00 0f add r16, r16 22876: 11 1f adc r17, r17 22878: f8 01 movw r30, r16 2287a: eb 5f subi r30, 0xFB ; 251 2287c: f9 4f sbci r31, 0xF9 ; 249 2287e: 11 82 std Z+1, r1 ; 0x01 22880: 10 82 st Z, r1 22882: 1e c0 rjmp .+60 ; 0x228c0 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)) 22884: a3 01 movw r20, r6 22886: 92 01 movw r18, r4 22888: 69 81 ldd r22, Y+1 ; 0x01 2288a: 7a 81 ldd r23, Y+2 ; 0x02 2288c: 8b 81 ldd r24, Y+3 ; 0x03 2288e: 9c 81 ldd r25, Y+4 ; 0x04 22890: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22894: 18 16 cp r1, r24 22896: 0c f0 brlt .+2 ; 0x2289a 22898: b4 cf rjmp .-152 ; 0x22802 2289a: f8 01 movw r30, r16 2289c: e5 50 subi r30, 0x05 ; 5 2289e: fa 4f sbci r31, 0xFA ; 250 228a0: 80 81 ld r24, Z 228a2: 81 30 cpi r24, 0x01 ; 1 228a4: 09 f0 breq .+2 ; 0x228a8 228a6: ad cf rjmp .-166 ; 0x22802 228a8: 89 cf rjmp .-238 ; 0x227bc 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; 228aa: 10 82 st Z, r1 228ac: 97 c0 rjmp .+302 ; 0x229dc temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 228ae: 20 e0 ldi r18, 0x00 ; 0 228b0: 30 e0 ldi r19, 0x00 ; 0 228b2: a9 01 movw r20, r18 228b4: c7 01 movw r24, r14 228b6: b6 01 movw r22, r12 228b8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 228bc: 18 16 cp r1, r24 228be: cc f0 brlt .+50 ; 0x228f2 } } } } } 228c0: 2c 96 adiw r28, 0x0c ; 12 228c2: 0f b6 in r0, 0x3f ; 63 228c4: f8 94 cli 228c6: de bf out 0x3e, r29 ; 62 228c8: 0f be out 0x3f, r0 ; 63 228ca: cd bf out 0x3d, r28 ; 61 228cc: df 91 pop r29 228ce: cf 91 pop r28 228d0: 1f 91 pop r17 228d2: 0f 91 pop r16 228d4: ff 90 pop r15 228d6: ef 90 pop r14 228d8: df 90 pop r13 228da: cf 90 pop r12 228dc: bf 90 pop r11 228de: af 90 pop r10 228e0: 9f 90 pop r9 228e2: 8f 90 pop r8 228e4: 7f 90 pop r7 228e6: 6f 90 pop r6 228e8: 5f 90 pop r5 228ea: 4f 90 pop r4 228ec: 3f 90 pop r3 228ee: 2f 90 pop r2 228f0: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 228f2: f8 01 movw r30, r16 228f4: e5 50 subi r30, 0x05 ; 5 228f6: fa 4f sbci r31, 0xFA ; 250 228f8: 80 81 ld r24, Z 228fa: 82 30 cpi r24, 0x02 ; 2 228fc: 08 f3 brcs .-62 ; 0x228c0 { temp_runaway_error_counter[_heater_id]++; 228fe: 00 0f add r16, r16 22900: 11 1f adc r17, r17 22902: f8 01 movw r30, r16 22904: eb 5f subi r30, 0xFB ; 251 22906: f9 4f sbci r31, 0xF9 ; 249 22908: 80 81 ld r24, Z 2290a: 91 81 ldd r25, Z+1 ; 0x01 2290c: 01 96 adiw r24, 0x01 ; 1 2290e: 91 83 std Z+1, r25 ; 0x01 22910: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 22912: 88 0f add r24, r24 22914: 99 1f adc r25, r25 22916: e9 85 ldd r30, Y+9 ; 0x09 22918: fa 85 ldd r31, Y+10 ; 0x0a 2291a: e8 17 cp r30, r24 2291c: f9 07 cpc r31, r25 2291e: 80 f6 brcc .-96 ; 0x228c0 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 22920: 43 e0 ldi r20, 0x03 ; 3 22922: 62 2d mov r22, r2 22924: 83 2d mov r24, r3 } } } } } 22926: 2c 96 adiw r28, 0x0c ; 12 22928: 0f b6 in r0, 0x3f ; 63 2292a: f8 94 cli 2292c: de bf out 0x3e, r29 ; 62 2292e: 0f be out 0x3f, r0 ; 63 22930: cd bf out 0x3d, r28 ; 61 22932: df 91 pop r29 22934: cf 91 pop r28 22936: 1f 91 pop r17 22938: 0f 91 pop r16 2293a: ff 90 pop r15 2293c: ef 90 pop r14 2293e: df 90 pop r13 22940: cf 90 pop r12 22942: bf 90 pop r11 22944: af 90 pop r10 22946: 9f 90 pop r9 22948: 8f 90 pop r8 2294a: 7f 90 pop r7 2294c: 6f 90 pop r6 2294e: 5f 90 pop r5 22950: 4f 90 pop r4 22952: 3f 90 pop r3 22954: 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); 22956: 0d 94 d4 12 jmp 0x225a8 ; 0x225a8 } 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 2295a: 81 31 cpi r24, 0x11 ; 17 2295c: 08 f4 brcc .+2 ; 0x22960 2295e: 51 cf rjmp .-350 ; 0x22802 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 22960: 20 e0 ldi r18, 0x00 ; 0 22962: 30 e0 ldi r19, 0x00 ; 0 22964: 44 eb ldi r20, 0xB4 ; 180 22966: 52 e4 ldi r21, 0x42 ; 66 22968: c3 01 movw r24, r6 2296a: b2 01 movw r22, r4 2296c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 22970: 81 2c mov r8, r1 22972: 91 2c mov r9, r1 22974: e0 e4 ldi r30, 0x40 ; 64 22976: ae 2e mov r10, r30 22978: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 2297a: 18 16 cp r1, r24 2297c: 2c f4 brge .+10 ; 0x22988 2297e: 81 2c mov r8, r1 22980: 91 2c mov r9, r1 22982: a1 2c mov r10, r1 22984: 70 e4 ldi r23, 0x40 ; 64 22986: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 22988: 20 e0 ldi r18, 0x00 ; 0 2298a: 30 e0 ldi r19, 0x00 ; 0 2298c: 42 ed ldi r20, 0xD2 ; 210 2298e: 52 e4 ldi r21, 0x42 ; 66 22990: c3 01 movw r24, r6 22992: b2 01 movw r22, r4 22994: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22998: 18 16 cp r1, r24 2299a: 44 f4 brge .+16 ; 0x229ac 2299c: 6a e9 ldi r22, 0x9A ; 154 2299e: 86 2e mov r8, r22 229a0: 69 e9 ldi r22, 0x99 ; 153 229a2: 96 2e mov r9, r22 229a4: 69 e1 ldi r22, 0x19 ; 25 229a6: a6 2e mov r10, r22 229a8: 6f e3 ldi r22, 0x3F ; 63 229aa: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 229ac: eb 85 ldd r30, Y+11 ; 0x0b 229ae: fc 85 ldd r31, Y+12 ; 0x0c 229b0: ed 50 subi r30, 0x0D ; 13 229b2: fa 4f sbci r31, 0xFA ; 250 229b4: 20 81 ld r18, Z 229b6: 31 81 ldd r19, Z+1 ; 0x01 229b8: 42 81 ldd r20, Z+2 ; 0x02 229ba: 53 81 ldd r21, Z+3 ; 0x03 229bc: c3 01 movw r24, r6 229be: b2 01 movw r22, r4 229c0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 229c4: a5 01 movw r20, r10 229c6: 94 01 movw r18, r8 229c8: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 229cc: f8 01 movw r30, r16 229ce: e1 51 subi r30, 0x11 ; 17 229d0: fa 4f sbci r31, 0xFA ; 250 229d2: 87 ff sbrs r24, 7 229d4: 6a cf rjmp .-300 ; 0x228aa __preheat_errors[_heater_id]++; 229d6: 80 81 ld r24, Z 229d8: 8f 5f subi r24, 0xFF ; 255 229da: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 229dc: 80 81 ld r24, Z 229de: 90 e0 ldi r25, 0x00 ; 0 229e0: 31 10 cpse r3, r1 229e2: 04 c0 rjmp .+8 ; 0x229ec 229e4: 06 97 sbiw r24, 0x06 ; 6 229e6: 4c f0 brlt .+18 ; 0x229fa set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 229e8: 80 e0 ldi r24, 0x00 ; 0 229ea: 03 c0 rjmp .+6 ; 0x229f2 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 229ec: 04 97 sbiw r24, 0x04 ; 4 229ee: 2c f0 brlt .+10 ; 0x229fa set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 229f0: 81 e0 ldi r24, 0x01 ; 1 229f2: 42 e0 ldi r20, 0x02 ; 2 229f4: 62 2d mov r22, r2 229f6: 0f 94 d4 12 call 0x225a8 ; 0x225a8 __preheat_start[_heater_id] = _current_temperature; 229fa: 2b 85 ldd r18, Y+11 ; 0x0b 229fc: 3c 85 ldd r19, Y+12 ; 0x0c 229fe: 2d 50 subi r18, 0x0D ; 13 22a00: 3a 4f sbci r19, 0xFA ; 250 22a02: d9 01 movw r26, r18 22a04: 4d 92 st X+, r4 22a06: 5d 92 st X+, r5 22a08: 6d 92 st X+, r6 22a0a: 7c 92 st X, r7 22a0c: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 22a0e: f8 01 movw r30, r16 22a10: ef 50 subi r30, 0x0F ; 15 22a12: fa 4f sbci r31, 0xFA ; 250 22a14: 10 82 st Z, r1 22a16: f5 ce rjmp .-534 ; 0x22802 00022a18 : //! @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() { 22a18: 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); 22a1a: 89 e2 ldi r24, 0x29 ; 41 22a1c: 9d e0 ldi r25, 0x0D ; 13 22a1e: 0f 94 3c a1 call 0x34278 ; 0x34278 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; 22a22: 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. 22a24: 8f 3f cpi r24, 0xFF ; 255 22a26: 91 f4 brne .+36 ; 0x22a4c { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22a28: 20 e0 ldi r18, 0x00 ; 0 22a2a: 30 e0 ldi r19, 0x00 ; 0 22a2c: 40 ef ldi r20, 0xF0 ; 240 22a2e: 51 e4 ldi r21, 0x41 ; 65 22a30: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 22a34: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 22a38: 80 91 90 06 lds r24, 0x0690 ; 0x800690 22a3c: 90 91 91 06 lds r25, 0x0691 ; 0x800691 22a40: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22a44: 87 ff sbrs r24, 7 22a46: 04 c0 rjmp .+8 ; 0x22a50 #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22a48: c0 e0 ldi r28, 0x00 ; 0 22a4a: 02 c0 rjmp .+4 ; 0x22a50 22a4c: 81 11 cpse r24, r1 22a4e: fc cf rjmp .-8 ; 0x22a48 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 22a50: 8c 2f mov r24, r28 22a52: cf 91 pop r28 22a54: 08 95 ret 00022a56 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 22a56: 1f 92 push r1 22a58: 0f 92 push r0 22a5a: 0f b6 in r0, 0x3f ; 63 22a5c: 0f 92 push r0 22a5e: 11 24 eor r1, r1 22a60: 0b b6 in r0, 0x3b ; 59 22a62: 0f 92 push r0 22a64: ff 92 push r15 22a66: 0f 93 push r16 22a68: 1f 93 push r17 22a6a: 2f 93 push r18 22a6c: 3f 93 push r19 22a6e: 4f 93 push r20 22a70: 5f 93 push r21 22a72: 6f 93 push r22 22a74: 7f 93 push r23 22a76: 8f 93 push r24 22a78: 9f 93 push r25 22a7a: af 93 push r26 22a7c: bf 93 push r27 22a7e: cf 93 push r28 22a80: df 93 push r29 22a82: ef 93 push r30 22a84: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 22a86: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22a8a: 8b 7f andi r24, 0xFB ; 251 22a8c: 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(); 22a90: 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) 22a92: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 22a96: 86 fd sbrc r24, 6 22a98: c8 c0 rjmp .+400 ; 0x22c2a <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 22a9a: 68 ec ldi r22, 0xC8 ; 200 22a9c: 70 e0 ldi r23, 0x00 ; 0 22a9e: 8f e1 ldi r24, 0x1F ; 31 22aa0: 96 e0 ldi r25, 0x06 ; 6 22aa2: 0f 94 29 10 call 0x22052 ; 0x22052 ::expired_cont(unsigned short)> 22aa6: 88 23 and r24, r24 22aa8: b9 f0 breq .+46 ; 0x22ad8 <__vector_14+0x82> buttonBlanking.start(); 22aaa: 8f e1 ldi r24, 0x1F ; 31 22aac: 96 e0 ldi r25, 0x06 ; 6 22aae: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> safetyTimer.start(); 22ab2: 8a e1 ldi r24, 0x1A ; 26 22ab4: 96 e0 ldi r25, 0x06 ; 6 22ab6: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 22aba: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22abe: 81 11 cpse r24, r1 22ac0: a5 c0 rjmp .+330 ; 0x22c0c <__vector_14+0x1b6> 22ac2: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22ac6: 81 11 cpse r24, r1 22ac8: a1 c0 rjmp .+322 ; 0x22c0c <__vector_14+0x1b6> { longPressTimer.start(); 22aca: 85 e1 ldi r24, 0x15 ; 21 22acc: 96 e0 ldi r25, 0x06 ; 6 22ace: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> lcd_button_pressed = 1; 22ad2: 81 e0 ldi r24, 0x01 ; 1 22ad4: 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); 22ad8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22adc: 82 fb bst r24, 2 22ade: 88 27 eor r24, r24 22ae0: 80 f9 bld r24, 0 22ae2: 91 e0 ldi r25, 0x01 ; 1 22ae4: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 22ae6: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22aea: 91 ff sbrs r25, 1 22aec: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 22aee: e0 91 12 06 lds r30, 0x0612 ; 0x800612 22af2: e8 17 cp r30, r24 22af4: e1 f0 breq .+56 ; 0x22b2e <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 22af6: 24 e0 ldi r18, 0x04 ; 4 22af8: e2 9f mul r30, r18 22afa: f0 01 movw r30, r0 22afc: 11 24 eor r1, r1 22afe: e8 2b or r30, r24 22b00: e7 58 subi r30, 0x87 ; 135 22b02: fa 46 sbci r31, 0x6A ; 106 22b04: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 22b06: 90 91 11 06 lds r25, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> 22b0a: e9 0f add r30, r25 22b0c: e0 93 11 06 sts 0x0611, r30 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 22b10: 0e 2e mov r0, r30 22b12: 00 0c add r0, r0 22b14: ff 0b sbc r31, r31 22b16: f7 ff sbrs r31, 7 22b18: 03 c0 rjmp .+6 ; 0x22b20 <__vector_14+0xca> 22b1a: f1 95 neg r31 22b1c: e1 95 neg r30 22b1e: f1 09 sbc r31, r1 22b20: 34 97 sbiw r30, 0x04 ; 4 22b22: 1c f0 brlt .+6 ; 0x22b2a <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 22b24: 91 e0 ldi r25, 0x01 ; 1 22b26: 90 93 13 06 sts 0x0613, r25 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> } enc_bits_old = enc_bits; 22b2a: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 22b2e: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22b32: 81 11 cpse r24, r1 22b34: 08 c0 rjmp .+16 ; 0x22b46 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 22b36: 80 91 62 06 lds r24, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 22b3a: 80 93 28 06 sts 0x0628, r24 ; 0x800628 if(soft_pwm_0 > 0) 22b3e: 88 23 and r24, r24 22b40: 09 f4 brne .+2 ; 0x22b44 <__vector_14+0xee> 22b42: 87 c0 rjmp .+270 ; 0x22c52 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 22b44: 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) 22b46: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22b4a: 8f 70 andi r24, 0x0F ; 15 22b4c: a9 f4 brne .+42 ; 0x22b78 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 22b4e: 80 91 05 05 lds r24, 0x0505 ; 0x800505 22b52: 90 e0 ldi r25, 0x00 ; 0 22b54: 24 e0 ldi r18, 0x04 ; 4 22b56: 95 95 asr r25 22b58: 87 95 ror r24 22b5a: 2a 95 dec r18 22b5c: e1 f7 brne .-8 ; 0x22b56 <__vector_14+0x100> 22b5e: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.432> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22b62: 89 2b or r24, r25 22b64: 09 f4 brne .+2 ; 0x22b68 <__vector_14+0x112> 22b66: 77 c0 rjmp .+238 ; 0x22c56 <__vector_14+0x200> 22b68: 9f b7 in r25, 0x3f ; 63 22b6a: f8 94 cli 22b6c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b70: 88 60 ori r24, 0x08 ; 8 22b72: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b76: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22b78: 90 91 28 06 lds r25, 0x0628 ; 0x800628 22b7c: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22b80: 98 17 cp r25, r24 22b82: 08 f4 brcc .+2 ; 0x22b86 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 22b84: 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); 22b86: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22b8a: 8f 70 andi r24, 0x0F ; 15 22b8c: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.432> 22b90: 98 17 cp r25, r24 22b92: 40 f4 brcc .+16 ; 0x22ba4 <__vector_14+0x14e> 22b94: 9f b7 in r25, 0x3f ; 63 22b96: f8 94 cli 22b98: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b9c: 87 7f andi r24, 0xF7 ; 247 22b9e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ba2: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 22ba4: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22ba8: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22baa: 8f 77 andi r24, 0x7F ; 127 22bac: 80 93 70 02 sts 0x0270, r24 ; 0x800270 22bb0: 10 e0 ldi r17, 0x00 ; 0 22bb2: 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 22bb4: e8 01 movw r28, r16 22bb6: cc 0f add r28, r28 22bb8: dd 1f adc r29, r29 22bba: c8 57 subi r28, 0x78 ; 120 22bbc: d9 4f sbci r29, 0xF9 ; 249 22bbe: 88 81 ld r24, Y 22bc0: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 22bc2: 18 16 cp r1, r24 22bc4: 19 06 cpc r1, r25 22bc6: 0c f0 brlt .+2 ; 0x22bca <__vector_14+0x174> 22bc8: 4c c0 rjmp .+152 ; 0x22c62 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22bca: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22bcc: f8 94 cli babystep(axis,/*fwd*/true); 22bce: 61 e0 ldi r22, 0x01 ; 1 22bd0: 80 2f mov r24, r16 22bd2: 0e 94 48 fb call 0x1f690 ; 0x1f690 babystepsTodo[axis]--; //less to do next time 22bd6: 88 81 ld r24, Y 22bd8: 99 81 ldd r25, Y+1 ; 0x01 22bda: 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 22bdc: 99 83 std Y+1, r25 ; 0x01 22bde: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22be0: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 22be2: 0f 5f subi r16, 0xFF ; 255 22be4: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 22be6: 03 30 cpi r16, 0x03 ; 3 22be8: 11 05 cpc r17, r1 22bea: 21 f7 brne .-56 ; 0x22bb4 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 22bec: 80 91 24 17 lds r24, 0x1724 ; 0x801724 <__bss_end+0x20> 22bf0: 90 91 25 17 lds r25, 0x1725 ; 0x801725 <__bss_end+0x21> 22bf4: a0 91 26 17 lds r26, 0x1726 ; 0x801726 <__bss_end+0x22> 22bf8: b0 91 27 17 lds r27, 0x1727 ; 0x801727 <__bss_end+0x23> 22bfc: 82 3a cpi r24, 0xA2 ; 162 22bfe: 92 4a sbci r25, 0xA2 ; 162 22c00: a1 05 cpc r26, r1 22c02: b1 05 cpc r27, r1 22c04: d9 f1 breq .+118 ; 0x22c7c <__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); 22c06: 81 e0 ldi r24, 0x01 ; 1 22c08: 0e 94 2c 75 call 0xea58 ; 0xea58 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 22c0c: 68 ee ldi r22, 0xE8 ; 232 22c0e: 73 e0 ldi r23, 0x03 ; 3 22c10: 85 e1 ldi r24, 0x15 ; 21 22c12: 96 e0 ldi r25, 0x06 ; 6 22c14: 0f 94 01 10 call 0x22002 ; 0x22002 ::expired(unsigned short)> 22c18: 88 23 and r24, r24 22c1a: 09 f4 brne .+2 ; 0x22c1e <__vector_14+0x1c8> 22c1c: 5d cf rjmp .-326 ; 0x22ad8 <__vector_14+0x82> { lcd_long_press_active = 1; 22c1e: 81 e0 ldi r24, 0x01 ; 1 22c20: 80 93 18 06 sts 0x0618, r24 ; 0x800618 lcd_longpress_trigger = 1; 22c24: 80 93 14 06 sts 0x0614, r24 ; 0x800614 22c28: 57 cf rjmp .-338 ; 0x22ad8 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 22c2a: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22c2e: 88 23 and r24, r24 22c30: 09 f4 brne .+2 ; 0x22c34 <__vector_14+0x1de> 22c32: 52 cf rjmp .-348 ; 0x22ad8 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 22c34: 10 92 19 06 sts 0x0619, r1 ; 0x800619 if (!lcd_long_press_active) 22c38: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22c3c: 81 11 cpse r24, r1 22c3e: 03 c0 rjmp .+6 ; 0x22c46 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22c40: 81 e0 ldi r24, 0x01 ; 1 22c42: 80 93 63 03 sts 0x0363, r24 ; 0x800363 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22c46: 81 e0 ldi r24, 0x01 ; 1 22c48: 80 93 13 06 sts 0x0613, r24 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> lcd_long_press_active = 0; 22c4c: 10 92 18 06 sts 0x0618, r1 ; 0x800618 22c50: 43 cf rjmp .-378 ; 0x22ad8 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 22c52: 75 98 cbi 0x0e, 5 ; 14 22c54: 78 cf rjmp .-272 ; 0x22b46 <__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); 22c56: 9f b7 in r25, 0x3f ; 63 22c58: f8 94 cli 22c5a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22c5e: 87 7f andi r24, 0xF7 ; 247 22c60: 88 cf rjmp .-240 ; 0x22b72 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 22c62: 89 2b or r24, r25 22c64: 09 f4 brne .+2 ; 0x22c68 <__vector_14+0x212> 22c66: bd cf rjmp .-134 ; 0x22be2 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22c68: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22c6a: f8 94 cli babystep(axis,/*fwd*/false); 22c6c: 60 e0 ldi r22, 0x00 ; 0 22c6e: 80 2f mov r24, r16 22c70: 0e 94 48 fb call 0x1f690 ; 0x1f690 babystepsTodo[axis]++; //less to do next time 22c74: 88 81 ld r24, Y 22c76: 99 81 ldd r25, Y+1 ; 0x01 22c78: 01 96 adiw r24, 0x01 ; 1 22c7a: b0 cf rjmp .-160 ; 0x22bdc <__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]) { 22c7c: 96 b1 in r25, 0x06 ; 6 22c7e: 80 91 26 06 lds r24, 0x0626 ; 0x800626 22c82: 99 1f adc r25, r25 22c84: 99 27 eor r25, r25 22c86: 99 1f adc r25, r25 22c88: 98 17 cp r25, r24 22c8a: 91 f0 breq .+36 ; 0x22cb0 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 22c8c: 90 91 84 03 lds r25, 0x0384 ; 0x800384 22c90: 99 23 and r25, r25 22c92: 51 f0 breq .+20 ; 0x22ca8 <__vector_14+0x252> 22c94: 20 91 22 06 lds r18, 0x0622 ; 0x800622 22c98: 30 91 23 06 lds r19, 0x0623 ; 0x800623 22c9c: 2f 5f subi r18, 0xFF ; 255 22c9e: 3f 4f sbci r19, 0xFF ; 255 22ca0: 30 93 23 06 sts 0x0623, r19 ; 0x800623 22ca4: 20 93 22 06 sts 0x0622, r18 ; 0x800622 fan_state[0] = !fan_state[0]; 22ca8: 91 e0 ldi r25, 0x01 ; 1 22caa: 89 27 eor r24, r25 22cac: 80 93 26 06 sts 0x0626, r24 ; 0x800626 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22cb0: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 22cb2: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22cb6: 84 60 ori r24, 0x04 ; 4 22cb8: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22cbc: ff 91 pop r31 22cbe: ef 91 pop r30 22cc0: df 91 pop r29 22cc2: cf 91 pop r28 22cc4: bf 91 pop r27 22cc6: af 91 pop r26 22cc8: 9f 91 pop r25 22cca: 8f 91 pop r24 22ccc: 7f 91 pop r23 22cce: 6f 91 pop r22 22cd0: 5f 91 pop r21 22cd2: 4f 91 pop r20 22cd4: 3f 91 pop r19 22cd6: 2f 91 pop r18 22cd8: 1f 91 pop r17 22cda: 0f 91 pop r16 22cdc: ff 90 pop r15 22cde: 0f 90 pop r0 22ce0: 0b be out 0x3b, r0 ; 59 22ce2: 0f 90 pop r0 22ce4: 0f be out 0x3f, r0 ; 63 22ce6: 0f 90 pop r0 22ce8: 1f 90 pop r1 22cea: 18 95 reti 00022cec : 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) { 22cec: 4f 92 push r4 22cee: 5f 92 push r5 22cf0: 6f 92 push r6 22cf2: 7f 92 push r7 22cf4: af 92 push r10 22cf6: bf 92 push r11 22cf8: cf 92 push r12 22cfa: df 92 push r13 22cfc: ef 92 push r14 22cfe: ff 92 push r15 22d00: 0f 93 push r16 22d02: 1f 93 push r17 22d04: cf 93 push r28 22d06: df 93 push r29 22d08: 24 e0 ldi r18, 0x04 ; 4 22d0a: 30 e0 ldi r19, 0x00 ; 0 22d0c: 41 e0 ldi r20, 0x01 ; 1 22d0e: 50 e0 ldi r21, 0x00 ; 0 22d10: d9 01 movw r26, r18 22d12: a1 56 subi r26, 0x61 ; 97 22d14: bc 46 sbci r27, 0x6C ; 108 float celsius = 0; byte i; for (i=1; i raw) 22d16: fd 01 movw r30, r26 22d18: 65 91 lpm r22, Z+ 22d1a: 74 91 lpm r23, Z 22d1c: 86 17 cp r24, r22 22d1e: 97 07 cpc r25, r23 22d20: 0c f0 brlt .+2 ; 0x22d24 22d22: 80 c0 rjmp .+256 ; 0x22e24 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22d24: 41 50 subi r20, 0x01 ; 1 22d26: 51 09 sbc r21, r1 22d28: 44 0f add r20, r20 22d2a: 55 1f adc r21, r21 22d2c: 44 0f add r20, r20 22d2e: 55 1f adc r21, r21 22d30: 8a 01 movw r16, r20 22d32: 0f 55 subi r16, 0x5F ; 95 22d34: 1c 46 sbci r17, 0x6C ; 108 22d36: f8 01 movw r30, r16 22d38: c5 90 lpm r12, Z+ 22d3a: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22d3c: 41 56 subi r20, 0x61 ; 97 22d3e: 5c 46 sbci r21, 0x6C ; 108 22d40: fa 01 movw r30, r20 22d42: 65 91 lpm r22, Z+ 22d44: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22d46: f9 01 movw r30, r18 22d48: ef 55 subi r30, 0x5F ; 95 22d4a: fc 46 sbci r31, 0x6C ; 108 22d4c: c5 91 lpm r28, Z+ 22d4e: d4 91 lpm r29, Z 22d50: f8 01 movw r30, r16 22d52: 05 91 lpm r16, Z+ 22d54: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22d56: fd 01 movw r30, r26 22d58: e5 90 lpm r14, Z+ 22d5a: f4 90 lpm r15, Z 22d5c: fa 01 movw r30, r20 22d5e: a5 90 lpm r10, Z+ 22d60: 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])) * 22d62: 86 1b sub r24, r22 22d64: 97 0b sbc r25, r23 22d66: bc 01 movw r22, r24 22d68: 99 0f add r25, r25 22d6a: 88 0b sbc r24, r24 22d6c: 99 0b sbc r25, r25 22d6e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 22d72: 2b 01 movw r4, r22 22d74: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22d76: be 01 movw r22, r28 22d78: 60 1b sub r22, r16 22d7a: 71 0b sbc r23, r17 22d7c: 07 2e mov r0, r23 22d7e: 00 0c add r0, r0 22d80: 88 0b sbc r24, r24 22d82: 99 0b sbc r25, r25 22d84: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 22d88: 9b 01 movw r18, r22 22d8a: 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])) * 22d8c: c3 01 movw r24, r6 22d8e: b2 01 movw r22, r4 22d90: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 22d94: 2b 01 movw r4, r22 22d96: 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])); 22d98: b7 01 movw r22, r14 22d9a: 6a 19 sub r22, r10 22d9c: 7b 09 sbc r23, r11 22d9e: 07 2e mov r0, r23 22da0: 00 0c add r0, r0 22da2: 88 0b sbc r24, r24 22da4: 99 0b sbc r25, r25 22da6: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 22daa: 9b 01 movw r18, r22 22dac: 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])) / 22dae: c3 01 movw r24, r6 22db0: b2 01 movw r22, r4 22db2: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 22db6: 2b 01 movw r4, r22 22db8: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22dba: b6 01 movw r22, r12 22dbc: dd 0c add r13, r13 22dbe: 88 0b sbc r24, r24 22dc0: 99 0b sbc r25, r25 22dc2: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 22dc6: 9b 01 movw r18, r22 22dc8: ac 01 movw r20, r24 22dca: c3 01 movw r24, r6 22dcc: b2 01 movw r22, r4 22dce: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22dd2: 6b 01 movw r12, r22 22dd4: 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) 22dd6: 20 e0 ldi r18, 0x00 ; 0 22dd8: 30 e0 ldi r19, 0x00 ; 0 22dda: 40 e2 ldi r20, 0x20 ; 32 22ddc: 52 e4 ldi r21, 0x42 ; 66 22dde: c7 01 movw r24, r14 22de0: b6 01 movw r22, r12 22de2: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22de6: 87 fd sbrc r24, 7 22de8: 30 c0 rjmp .+96 ; 0x22e4a 22dea: 20 e0 ldi r18, 0x00 ; 0 22dec: 30 e0 ldi r19, 0x00 ; 0 22dee: 48 e4 ldi r20, 0x48 ; 72 22df0: 52 e4 ldi r21, 0x42 ; 66 22df2: c7 01 movw r24, r14 22df4: b6 01 movw r22, r12 22df6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 22dfa: 18 16 cp r1, r24 22dfc: 34 f1 brlt .+76 ; 0x22e4a { celsius = celsius + (_first_koef * (celsius - _offset_start)); 22dfe: 20 e0 ldi r18, 0x00 ; 0 22e00: 30 e0 ldi r19, 0x00 ; 0 22e02: 40 e2 ldi r20, 0x20 ; 32 22e04: 52 e4 ldi r21, 0x42 ; 66 22e06: c7 01 movw r24, r14 22e08: b6 01 movw r22, r12 22e0a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 22e0e: 20 e0 ldi r18, 0x00 ; 0 22e10: 30 e0 ldi r19, 0x00 ; 0 22e12: 40 e0 ldi r20, 0x00 ; 0 22e14: 5f e3 ldi r21, 0x3F ; 63 22e16: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 22e1a: 9b 01 movw r18, r22 22e1c: 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; 22e1e: c7 01 movw r24, r14 22e20: b6 01 movw r22, r12 22e22: 43 c0 rjmp .+134 ; 0x22eaa 22e24: 4f 5f subi r20, 0xFF ; 255 22e26: 5f 4f sbci r21, 0xFF ; 255 22e28: 2c 5f subi r18, 0xFC ; 252 22e2a: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22e32: 6e cf rjmp .-292 ; 0x22d10 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22e34: e1 e9 ldi r30, 0x91 ; 145 22e36: f4 e9 ldi r31, 0x94 ; 148 22e38: 65 91 lpm r22, Z+ 22e3a: 74 91 lpm r23, Z 22e3c: 07 2e mov r0, r23 22e3e: 00 0c add r0, r0 22e40: 88 0b sbc r24, r24 22e42: 99 0b sbc r25, r25 22e44: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 22e48: c4 cf rjmp .-120 ; 0x22dd2 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 22e4a: 20 e0 ldi r18, 0x00 ; 0 22e4c: 30 e0 ldi r19, 0x00 ; 0 22e4e: 48 e4 ldi r20, 0x48 ; 72 22e50: 52 e4 ldi r21, 0x42 ; 66 22e52: c7 01 movw r24, r14 22e54: b6 01 movw r22, r12 22e56: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22e5a: 18 16 cp r1, r24 22e5c: dc f5 brge .+118 ; 0x22ed4 22e5e: 20 e0 ldi r18, 0x00 ; 0 22e60: 30 e0 ldi r19, 0x00 ; 0 22e62: 48 ec ldi r20, 0xC8 ; 200 22e64: 52 e4 ldi r21, 0x42 ; 66 22e66: c7 01 movw r24, r14 22e68: b6 01 movw r22, r12 22e6a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 22e6e: 18 16 cp r1, r24 22e70: 8c f1 brlt .+98 ; 0x22ed4 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 22e72: 20 e0 ldi r18, 0x00 ; 0 22e74: 30 e0 ldi r19, 0x00 ; 0 22e76: 40 ea ldi r20, 0xA0 ; 160 22e78: 50 e4 ldi r21, 0x40 ; 64 22e7a: c7 01 movw r24, r14 22e7c: b6 01 movw r22, r12 22e7e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 22e82: 2b 01 movw r4, r22 22e84: 3c 01 movw r6, r24 22e86: 20 e0 ldi r18, 0x00 ; 0 22e88: 30 e0 ldi r19, 0x00 ; 0 22e8a: 48 e4 ldi r20, 0x48 ; 72 22e8c: 52 e4 ldi r21, 0x42 ; 66 22e8e: c7 01 movw r24, r14 22e90: b6 01 movw r22, r12 22e92: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 22e96: 2d ec ldi r18, 0xCD ; 205 22e98: 3c ec ldi r19, 0xCC ; 204 22e9a: 4c ec ldi r20, 0xCC ; 204 22e9c: 5d e3 ldi r21, 0x3D ; 61 22e9e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 22ea2: 9b 01 movw r18, r22 22ea4: ac 01 movw r20, r24 22ea6: c3 01 movw r24, r6 22ea8: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22eaa: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 22eae: 6b 01 movw r12, r22 22eb0: 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 } 22eb2: c7 01 movw r24, r14 22eb4: b6 01 movw r22, r12 22eb6: df 91 pop r29 22eb8: cf 91 pop r28 22eba: 1f 91 pop r17 22ebc: 0f 91 pop r16 22ebe: ff 90 pop r15 22ec0: ef 90 pop r14 22ec2: df 90 pop r13 22ec4: cf 90 pop r12 22ec6: bf 90 pop r11 22ec8: af 90 pop r10 22eca: 7f 90 pop r7 22ecc: 6f 90 pop r6 22ece: 5f 90 pop r5 22ed0: 4f 90 pop r4 22ed2: 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) 22ed4: 20 e0 ldi r18, 0x00 ; 0 22ed6: 30 e0 ldi r19, 0x00 ; 0 22ed8: 48 ec ldi r20, 0xC8 ; 200 22eda: 52 e4 ldi r21, 0x42 ; 66 22edc: c7 01 movw r24, r14 22ede: b6 01 movw r22, r12 22ee0: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 22ee4: 18 16 cp r1, r24 22ee6: 2c f7 brge .-54 ; 0x22eb2 { celsius = celsius + _offset; 22ee8: 20 e0 ldi r18, 0x00 ; 0 22eea: 30 e0 ldi r19, 0x00 ; 0 22eec: 40 e2 ldi r20, 0x20 ; 32 22eee: 51 e4 ldi r21, 0x41 ; 65 22ef0: 96 cf rjmp .-212 ; 0x22e1e 00022ef2 <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 22ef2: 1f 92 push r1 22ef4: 0f 92 push r0 22ef6: 0f b6 in r0, 0x3f ; 63 22ef8: 0f 92 push r0 22efa: 11 24 eor r1, r1 22efc: 0b b6 in r0, 0x3b ; 59 22efe: 0f 92 push r0 22f00: 4f 92 push r4 22f02: 5f 92 push r5 22f04: 6f 92 push r6 22f06: 7f 92 push r7 22f08: 8f 92 push r8 22f0a: 9f 92 push r9 22f0c: af 92 push r10 22f0e: bf 92 push r11 22f10: cf 92 push r12 22f12: df 92 push r13 22f14: ef 92 push r14 22f16: ff 92 push r15 22f18: 0f 93 push r16 22f1a: 1f 93 push r17 22f1c: 2f 93 push r18 22f1e: 3f 93 push r19 22f20: 4f 93 push r20 22f22: 5f 93 push r21 22f24: 6f 93 push r22 22f26: 7f 93 push r23 22f28: 8f 93 push r24 22f2a: 9f 93 push r25 22f2c: af 93 push r26 22f2e: bf 93 push r27 22f30: cf 93 push r28 22f32: df 93 push r29 22f34: ef 93 push r30 22f36: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22f38: 80 91 63 06 lds r24, 0x0663 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> 22f3c: 88 23 and r24, r24 22f3e: 09 f4 brne .+2 ; 0x22f42 <__vector_32+0x50> 22f40: 22 c1 rjmp .+580 ; 0x23186 <__vector_32+0x294> adc_values_ready = false; 22f42: 10 92 63 06 sts 0x0663, r1 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> adc_start_cycle(); 22f46: 0e 94 70 7e call 0xfce0 ; 0xfce0 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 22f4a: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22f4e: 8d 7f andi r24, 0xFD ; 253 22f50: 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(); 22f54: 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 22f5a: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 22f5e: 0e 94 b6 bd call 0x17b6c ; 0x17b6c 22f62: 4b 01 movw r8, r22 22f64: 5c 01 movw r10, r24 22f66: 80 92 5e 06 sts 0x065E, r8 ; 0x80065e 22f6a: 90 92 5f 06 sts 0x065F, r9 ; 0x80065f 22f6e: a0 92 60 06 sts 0x0660, r10 ; 0x800660 22f72: b0 92 61 06 sts 0x0661, r11 ; 0x800661 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22f76: 00 91 4b 06 lds r16, 0x064B ; 0x80064b 22f7a: 10 91 4c 06 lds r17, 0x064C ; 0x80064c 22f7e: c8 01 movw r24, r16 22f80: 0f 94 76 16 call 0x22cec ; 0x22cec 22f84: 6b 01 movw r12, r22 22f86: 7c 01 movw r14, r24 22f88: c0 92 57 06 sts 0x0657, r12 ; 0x800657 22f8c: d0 92 58 06 sts 0x0658, r13 ; 0x800658 22f90: e0 92 59 06 sts 0x0659, r14 ; 0x800659 22f94: f0 92 5a 06 sts 0x065A, r15 ; 0x80065a #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22f98: 80 91 47 06 lds r24, 0x0647 ; 0x800647 22f9c: 90 91 48 06 lds r25, 0x0648 ; 0x800648 22fa0: 0f 94 76 16 call 0x22cec ; 0x22cec 22fa4: 60 93 43 06 sts 0x0643, r22 ; 0x800643 22fa8: 70 93 44 06 sts 0x0644, r23 ; 0x800644 22fac: 80 93 45 06 sts 0x0645, r24 ; 0x800645 22fb0: 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; 22fb4: 81 e0 ldi r24, 0x01 ; 1 22fb6: 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; 22fba: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22fbe: 8d 7f andi r24, 0xFD ; 253 22fc0: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 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]) { 22fc4: c0 91 49 06 lds r28, 0x0649 ; 0x800649 22fc8: d0 91 4a 06 lds r29, 0x064A ; 0x80064a 22fcc: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 22fd0: 90 91 da 03 lds r25, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 22fd4: 8c 17 cp r24, r28 22fd6: 9d 07 cpc r25, r29 22fd8: 2c f0 brlt .+10 ; 0x22fe4 <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 22fda: 40 e0 ldi r20, 0x00 ; 0 22fdc: 60 e0 ldi r22, 0x00 ; 0 22fde: 80 e0 ldi r24, 0x00 ; 0 22fe0: 0f 94 d4 12 call 0x225a8 ; 0x225a8 } //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) { 22fe4: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 22fe8: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 22fec: 80 17 cp r24, r16 22fee: 91 07 cpc r25, r17 22ff0: 2c f0 brlt .+10 ; 0x22ffc <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 22ff2: 40 e0 ldi r20, 0x00 ; 0 22ff4: 60 e0 ldi r22, 0x00 ; 0 22ff6: 81 e0 ldi r24, 0x01 ; 1 22ff8: 0f 94 d4 12 call 0x225a8 ; 0x225a8 { // 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]) { 22ffc: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.422> 23000: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 23004: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 23008: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 2300c: 68 17 cp r22, r24 2300e: 79 07 cpc r23, r25 23010: 0c f0 brlt .+2 ; 0x23014 <__vector_32+0x122> 23012: dc c0 rjmp .+440 ; 0x231cc <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 23014: 10 91 54 06 lds r17, 0x0654 ; 0x800654 23018: 11 11 cpse r17, r1 2301a: 12 c0 rjmp .+36 ; 0x23040 <__vector_32+0x14e> 2301c: 6b 5f subi r22, 0xFB ; 251 2301e: 7f 4f sbci r23, 0xFF ; 255 23020: 07 2e mov r0, r23 23022: 00 0c add r0, r0 23024: 88 0b sbc r24, r24 23026: 99 0b sbc r25, r25 23028: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2302c: 9b 01 movw r18, r22 2302e: ac 01 movw r20, r24 23030: 11 e0 ldi r17, 0x01 ; 1 23032: c5 01 movw r24, r10 23034: b4 01 movw r22, r8 23036: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2303a: 18 16 cp r1, r24 2303c: 0c f0 brlt .+2 ; 0x23040 <__vector_32+0x14e> 2303e: 10 e0 ldi r17, 0x00 ; 0 23040: 10 93 54 06 sts 0x0654, r17 ; 0x800654 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 23044: 68 e9 ldi r22, 0x98 ; 152 23046: 7a e3 ldi r23, 0x3A ; 58 23048: 81 e5 ldi r24, 0x51 ; 81 2304a: 96 e0 ldi r25, 0x06 ; 6 2304c: 0f 94 29 10 call 0x22052 ; 0x22052 ::expired_cont(unsigned short)> 23050: 81 11 cpse r24, r1 23052: 02 c0 rjmp .+4 ; 0x23058 <__vector_32+0x166> 23054: 11 23 and r17, r17 23056: 79 f0 breq .+30 ; 0x23076 <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 23058: 81 e0 ldi r24, 0x01 ; 1 2305a: 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]) { 2305e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 23062: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 23066: c8 17 cp r28, r24 23068: d9 07 cpc r29, r25 2306a: 2c f0 brlt .+10 ; 0x23076 <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 2306c: 41 e0 ldi r20, 0x01 ; 1 2306e: 60 e0 ldi r22, 0x00 ; 0 23070: 80 e0 ldi r24, 0x00 ; 0 23072: 0f 94 d4 12 call 0x225a8 ; 0x225a8 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 23076: 80 91 55 06 lds r24, 0x0655 ; 0x800655 2307a: 90 91 56 06 lds r25, 0x0656 ; 0x800656 2307e: 4f 97 sbiw r24, 0x1f ; 31 23080: 0c f4 brge .+2 ; 0x23084 <__vector_32+0x192> 23082: ab c0 rjmp .+342 ; 0x231da <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 23084: c0 91 50 06 lds r28, 0x0650 ; 0x800650 23088: c1 11 cpse r28, r1 2308a: 0c c0 rjmp .+24 ; 0x230a4 <__vector_32+0x1b2> 2308c: c1 e0 ldi r28, 0x01 ; 1 2308e: 20 e0 ldi r18, 0x00 ; 0 23090: 30 e0 ldi r19, 0x00 ; 0 23092: 4c e0 ldi r20, 0x0C ; 12 23094: 52 e4 ldi r21, 0x42 ; 66 23096: c7 01 movw r24, r14 23098: b6 01 movw r22, r12 2309a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2309e: 18 16 cp r1, r24 230a0: 0c f0 brlt .+2 ; 0x230a4 <__vector_32+0x1b2> 230a2: c0 e0 ldi r28, 0x00 ; 0 230a4: c0 93 50 06 sts 0x0650, r28 ; 0x800650 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 230a8: 60 e5 ldi r22, 0x50 ; 80 230aa: 73 ec ldi r23, 0xC3 ; 195 230ac: 8d e4 ldi r24, 0x4D ; 77 230ae: 96 e0 ldi r25, 0x06 ; 6 230b0: 0f 94 29 10 call 0x22052 ; 0x22052 ::expired_cont(unsigned short)> 230b4: 81 11 cpse r24, r1 230b6: 02 c0 rjmp .+4 ; 0x230bc <__vector_32+0x1ca> 230b8: cc 23 and r28, r28 230ba: 99 f0 breq .+38 ; 0x230e2 <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 230bc: 81 e0 ldi r24, 0x01 ; 1 230be: 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) { 230c2: 20 91 4b 06 lds r18, 0x064B ; 0x80064b 230c6: 30 91 4c 06 lds r19, 0x064C ; 0x80064c 230ca: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 230ce: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 230d2: 28 17 cp r18, r24 230d4: 39 07 cpc r19, r25 230d6: 2c f0 brlt .+10 ; 0x230e2 <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 230d8: 41 e0 ldi r20, 0x01 ; 1 230da: 60 e0 ldi r22, 0x00 ; 0 230dc: 81 e0 ldi r24, 0x01 ; 1 230de: 0f 94 d4 12 call 0x225a8 ; 0x225a8 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); 230e2: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 230e6: 70 e0 ldi r23, 0x00 ; 0 230e8: 90 e0 ldi r25, 0x00 ; 0 230ea: 80 e0 ldi r24, 0x00 ; 0 230ec: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 230f0: 6b 01 movw r12, r22 230f2: 7c 01 movw r14, r24 230f4: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 230f8: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 230fc: 60 90 60 06 lds r6, 0x0660 ; 0x800660 23100: 70 90 61 06 lds r7, 0x0661 ; 0x800661 23104: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 23108: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 2310c: 07 2e mov r0, r23 2310e: 00 0c add r0, r0 23110: 88 0b sbc r24, r24 23112: 99 0b sbc r25, r25 23114: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 23118: ab 01 movw r20, r22 2311a: bc 01 movw r22, r24 2311c: a1 2c mov r10, r1 2311e: 93 01 movw r18, r6 23120: 82 01 movw r16, r4 23122: 81 e0 ldi r24, 0x01 ; 1 23124: 0f 94 38 13 call 0x22670 ; 0x22670 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 23128: 60 91 5b 06 lds r22, 0x065B ; 0x80065b 2312c: 70 e0 ldi r23, 0x00 ; 0 2312e: 90 e0 ldi r25, 0x00 ; 0 23130: 80 e0 ldi r24, 0x00 ; 0 23132: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 23136: 6b 01 movw r12, r22 23138: 7c 01 movw r14, r24 2313a: 40 90 57 06 lds r4, 0x0657 ; 0x800657 2313e: 50 90 58 06 lds r5, 0x0658 ; 0x800658 23142: 60 90 59 06 lds r6, 0x0659 ; 0x800659 23146: 70 90 5a 06 lds r7, 0x065A ; 0x80065a 2314a: 60 91 55 06 lds r22, 0x0655 ; 0x800655 2314e: 70 91 56 06 lds r23, 0x0656 ; 0x800656 23152: 07 2e mov r0, r23 23154: 00 0c add r0, r0 23156: 88 0b sbc r24, r24 23158: 99 0b sbc r25, r25 2315a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2315e: ab 01 movw r20, r22 23160: bc 01 movw r22, r24 23162: aa 24 eor r10, r10 23164: a3 94 inc r10 23166: 93 01 movw r18, r6 23168: 82 01 movw r16, r4 2316a: 80 e0 ldi r24, 0x00 ; 0 2316c: 0f 94 38 13 call 0x22670 ; 0x22670 thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 23170: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> 23174: 81 11 cpse r24, r1 temp_mgr_pid(); 23176: 0e 94 24 f8 call 0x1f048 ; 0x1f048 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2317a: 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(); 2317c: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 23180: 82 60 ori r24, 0x02 ; 2 23182: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 23186: ff 91 pop r31 23188: ef 91 pop r30 2318a: df 91 pop r29 2318c: cf 91 pop r28 2318e: bf 91 pop r27 23190: af 91 pop r26 23192: 9f 91 pop r25 23194: 8f 91 pop r24 23196: 7f 91 pop r23 23198: 6f 91 pop r22 2319a: 5f 91 pop r21 2319c: 4f 91 pop r20 2319e: 3f 91 pop r19 231a0: 2f 91 pop r18 231a2: 1f 91 pop r17 231a4: 0f 91 pop r16 231a6: ff 90 pop r15 231a8: ef 90 pop r14 231aa: df 90 pop r13 231ac: cf 90 pop r12 231ae: bf 90 pop r11 231b0: af 90 pop r10 231b2: 9f 90 pop r9 231b4: 8f 90 pop r8 231b6: 7f 90 pop r7 231b8: 6f 90 pop r6 231ba: 5f 90 pop r5 231bc: 4f 90 pop r4 231be: 0f 90 pop r0 231c0: 0b be out 0x3b, r0 ; 59 231c2: 0f 90 pop r0 231c4: 0f be out 0x3f, r0 ; 63 231c6: 0f 90 pop r0 231c8: 1f 90 pop r1 231ca: 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(); 231cc: 81 e5 ldi r24, 0x51 ; 81 231ce: 96 e0 ldi r25, 0x06 ; 6 231d0: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> bCheckingOnHeater=false; 231d4: 10 92 54 06 sts 0x0654, r1 ; 0x800654 231d8: 4e cf rjmp .-356 ; 0x23076 <__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(); 231da: 8d e4 ldi r24, 0x4D ; 77 231dc: 96 e0 ldi r25, 0x06 ; 6 231de: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> bCheckingOnBed=false; 231e2: 10 92 50 06 sts 0x0650, r1 ; 0x800650 231e6: 7d cf rjmp .-262 ; 0x230e2 <__vector_32+0x1f0> 000231e8 : 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; 231e8: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 231ec: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 231f0: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 231f4: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 231f8: 60 e0 ldi r22, 0x00 ; 0 231fa: 70 e0 ldi r23, 0x00 ; 0 231fc: 8f e7 ldi r24, 0x7F ; 127 231fe: 93 e4 ldi r25, 0x43 ; 67 23200: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 23204: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 23208: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 2320c: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 23210: 90 93 e9 03 sts 0x03E9, r25 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.430+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 23214: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 23218: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 2321c: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 23220: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 23224: 60 e0 ldi r22, 0x00 ; 0 23226: 70 e0 ldi r23, 0x00 ; 0 23228: 8f e7 ldi r24, 0x7F ; 127 2322a: 93 e4 ldi r25, 0x43 ; 67 2322c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 23230: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 23234: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 23238: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 2323c: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.428+0x3> #endif } 23240: 08 95 ret 00023242 : #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) { 23242: 2f 92 push r2 23244: 3f 92 push r3 23246: 4f 92 push r4 23248: 5f 92 push r5 2324a: 6f 92 push r6 2324c: 7f 92 push r7 2324e: 8f 92 push r8 23250: 9f 92 push r9 23252: af 92 push r10 23254: bf 92 push r11 23256: cf 92 push r12 23258: df 92 push r13 2325a: ef 92 push r14 2325c: ff 92 push r15 2325e: 0f 93 push r16 23260: 1f 93 push r17 23262: cf 93 push r28 23264: df 93 push r29 23266: cd b7 in r28, 0x3d ; 61 23268: de b7 in r29, 0x3e ; 62 2326a: e0 97 sbiw r28, 0x30 ; 48 2326c: 0f b6 in r0, 0x3f ; 63 2326e: f8 94 cli 23270: de bf out 0x3e, r29 ; 62 23272: 0f be out 0x3f, r0 ; 63 23274: cd bf out 0x3d, r28 ; 61 23276: 6a 87 std Y+10, r22 ; 0x0a 23278: 7b 87 std Y+11, r23 ; 0x0b 2327a: 8c 87 std Y+12, r24 ; 0x0c 2327c: 9d 87 std Y+13, r25 ; 0x0d 2327e: 1a 01 movw r2, r20 23280: 3a a7 std Y+42, r19 ; 0x2a 23282: 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(); 23284: 0f 94 b9 12 call 0x22572 ; 0x22572 pid_tuning_finished = false; 23288: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> // 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; 2328c: 29 a5 ldd r18, Y+41 ; 0x29 2328e: 3a a5 ldd r19, Y+42 ; 0x2a 23290: 30 93 6e 06 sts 0x066E, r19 ; 0x80066e 23294: 20 93 6d 06 sts 0x066D, r18 ; 0x80066d float input = 0.0; pid_cycle=0; 23298: 10 92 70 06 sts 0x0670, r1 ; 0x800670 2329c: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f bool heating = true; unsigned long temp_millis = _millis(); 232a0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 232a4: 6e 83 std Y+6, r22 ; 0x06 232a6: 7f 83 std Y+7, r23 ; 0x07 232a8: 88 87 std Y+8, r24 ; 0x08 232aa: 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 232ac: 37 fe sbrs r3, 7 232ae: ff c0 rjmp .+510 ; 0x234ae 232b0: 3d e2 ldi r19, 0x2D ; 45 232b2: 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(); 232b4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 232b8: 6c a3 std Y+36, r22 ; 0x24 232ba: 7d a3 std Y+37, r23 ; 0x25 232bc: 8e a3 std Y+38, r24 ; 0x26 232be: 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."); 232c0: 8e ef ldi r24, 0xFE ; 254 232c2: 92 e9 ldi r25, 0x92 ; 146 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 232c4: 12 14 cp r1, r2 232c6: 13 04 cpc r1, r3 232c8: 0c f4 brge .+2 ; 0x232cc 232ca: 8a c2 rjmp .+1300 ; 0x237e0 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 232cc: 8b ee ldi r24, 0xEB ; 235 232ce: 92 e9 ldi r25, 0x92 ; 146 232d0: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 232d4: 6a 85 ldd r22, Y+10 ; 0x0a 232d6: 7b 85 ldd r23, Y+11 ; 0x0b 232d8: 8c 85 ldd r24, Y+12 ; 0x0c 232da: 9d 85 ldd r25, Y+13 ; 0x0d 232dc: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 232e0: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 232e2: 21 14 cp r2, r1 232e4: 31 04 cpc r3, r1 232e6: 09 f4 brne .+2 ; 0x232ea 232e8: e5 c0 rjmp .+458 ; 0x234b4 { soft_pwm_bed = (MAX_BED_POWER)/2; 232ea: 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 232ee: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 232f2: 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 232f6: 8e 81 ldd r24, Y+6 ; 0x06 232f8: 9f 81 ldd r25, Y+7 ; 0x07 232fa: a8 85 ldd r26, Y+8 ; 0x08 232fc: b9 85 ldd r27, Y+9 ; 0x09 232fe: 8e 87 std Y+14, r24 ; 0x0e 23300: 9f 87 std Y+15, r25 ; 0x0f 23302: a8 8b std Y+16, r26 ; 0x10 23304: b9 8b std Y+17, r27 ; 0x11 23306: 88 a3 std Y+32, r24 ; 0x20 23308: 99 a3 std Y+33, r25 ; 0x21 2330a: aa a3 std Y+34, r26 ; 0x22 2330c: bb a3 std Y+35, r27 ; 0x23 2330e: 1a 8a std Y+18, r1 ; 0x12 23310: 90 e4 ldi r25, 0x40 ; 64 23312: 9b 8b std Y+19, r25 ; 0x13 23314: ac e1 ldi r26, 0x1C ; 28 23316: ac 8b std Y+20, r26 ; 0x14 23318: b6 e4 ldi r27, 0x46 ; 70 2331a: bd 8b std Y+21, r27 ; 0x15 2331c: 1e 8a std Y+22, r1 ; 0x16 2331e: 1f 8a std Y+23, r1 ; 0x17 23320: 18 8e std Y+24, r1 ; 0x18 23322: 19 8e std Y+25, r1 ; 0x19 23324: 6f e7 ldi r22, 0x7F ; 127 23326: c6 2e mov r12, r22 23328: d1 2c mov r13, r1 2332a: e1 2c mov r14, r1 2332c: f1 2c mov r15, r1 2332e: 00 e0 ldi r16, 0x00 ; 0 23330: 10 e0 ldi r17, 0x00 ; 0 23332: 18 aa std Y+48, r1 ; 0x30 23334: 1f a6 std Y+47, r1 ; 0x2f 23336: 1d 82 std Y+5, r1 ; 0x05 23338: 2f e7 ldi r18, 0x7F ; 127 2333a: 30 e0 ldi r19, 0x00 ; 0 2333c: 40 e0 ldi r20, 0x00 ; 0 2333e: 50 e0 ldi r21, 0x00 ; 0 23340: 29 83 std Y+1, r18 ; 0x01 23342: 3a 83 std Y+2, r19 ; 0x02 23344: 4b 83 std Y+3, r20 ; 0x03 23346: 5c 83 std Y+4, r21 ; 0x04 23348: 1b 8e std Y+27, r1 ; 0x1b 2334a: 1c 8e std Y+28, r1 ; 0x1c 2334c: 1d 8e std Y+29, r1 ; 0x1d 2334e: 1e 8e std Y+30, r1 ; 0x1e 23350: 31 e0 ldi r19, 0x01 ; 1 23352: 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(); 23354: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 23356: 40 91 42 06 lds r20, 0x0642 ; 0x800642 2335a: 48 a7 std Y+40, r20 ; 0x28 2335c: 44 23 and r20, r20 2335e: 09 f4 brne .+2 ; 0x23362 23360: 2c c2 rjmp .+1112 ; 0x237ba updateTemperatures(); 23362: 0e 94 f8 fa call 0x1f5f0 ; 0x1f5f0 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 23366: 21 14 cp r2, r1 23368: 31 04 cpc r3, r1 2336a: 09 f0 breq .+2 ; 0x2336e 2336c: aa c0 rjmp .+340 ; 0x234c2 2336e: 00 91 c4 0d lds r16, 0x0DC4 ; 0x800dc4 23372: 10 91 c5 0d lds r17, 0x0DC5 ; 0x800dc5 23376: 50 91 c6 0d lds r21, 0x0DC6 ; 0x800dc6 2337a: 58 ab std Y+48, r21 ; 0x30 2337c: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 23380: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 23382: 2e 89 ldd r18, Y+22 ; 0x16 23384: 3f 89 ldd r19, Y+23 ; 0x17 23386: 48 8d ldd r20, Y+24 ; 0x18 23388: 59 8d ldd r21, Y+25 ; 0x19 2338a: b8 01 movw r22, r16 2338c: 88 a9 ldd r24, Y+48 ; 0x30 2338e: 9f a5 ldd r25, Y+47 ; 0x2f 23390: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 23394: 87 fd sbrc r24, 7 23396: 06 c0 rjmp .+12 ; 0x233a4 23398: 0e 8b std Y+22, r16 ; 0x16 2339a: 1f 8b std Y+23, r17 ; 0x17 2339c: b8 a9 ldd r27, Y+48 ; 0x30 2339e: b8 8f std Y+24, r27 ; 0x18 233a0: 2f a5 ldd r18, Y+47 ; 0x2f 233a2: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 233a4: 2a 89 ldd r18, Y+18 ; 0x12 233a6: 3b 89 ldd r19, Y+19 ; 0x13 233a8: 4c 89 ldd r20, Y+20 ; 0x14 233aa: 5d 89 ldd r21, Y+21 ; 0x15 233ac: b8 01 movw r22, r16 233ae: 88 a9 ldd r24, Y+48 ; 0x30 233b0: 9f a5 ldd r25, Y+47 ; 0x2f 233b2: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 233b6: 18 16 cp r1, r24 233b8: 34 f0 brlt .+12 ; 0x233c6 233ba: 0a 8b std Y+18, r16 ; 0x12 233bc: 1b 8b std Y+19, r17 ; 0x13 233be: 38 a9 ldd r19, Y+48 ; 0x30 233c0: 3c 8b std Y+20, r19 ; 0x14 233c2: 4f a5 ldd r20, Y+47 ; 0x2f 233c4: 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) { 233c6: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 233ca: 2c a1 ldd r18, Y+36 ; 0x24 233cc: 3d a1 ldd r19, Y+37 ; 0x25 233ce: 4e a1 ldd r20, Y+38 ; 0x26 233d0: 5f a1 ldd r21, Y+39 ; 0x27 233d2: 62 1b sub r22, r18 233d4: 73 0b sbc r23, r19 233d6: 84 0b sbc r24, r20 233d8: 95 0b sbc r25, r21 233da: 65 3c cpi r22, 0xC5 ; 197 233dc: 79 40 sbci r23, 0x09 ; 9 233de: 81 05 cpc r24, r1 233e0: 91 05 cpc r25, r1 233e2: 40 f0 brcs .+16 ; 0x233f4 checkExtruderAutoFans(); 233e4: 0e 94 0c 6f call 0xde18 ; 0xde18 extruder_autofan_last_check = _millis(); 233e8: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 233ec: 6c a3 std Y+36, r22 ; 0x24 233ee: 7d a3 std Y+37, r23 ; 0x25 233f0: 8e a3 std Y+38, r24 ; 0x26 233f2: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 233f4: 4a 8d ldd r20, Y+26 ; 0x1a 233f6: 44 23 and r20, r20 233f8: 09 f4 brne .+2 ; 0x233fc 233fa: 4c c0 rjmp .+152 ; 0x23494 233fc: 2a 85 ldd r18, Y+10 ; 0x0a 233fe: 3b 85 ldd r19, Y+11 ; 0x0b 23400: 4c 85 ldd r20, Y+12 ; 0x0c 23402: 5d 85 ldd r21, Y+13 ; 0x0d 23404: b8 01 movw r22, r16 23406: 88 a9 ldd r24, Y+48 ; 0x30 23408: 9f a5 ldd r25, Y+47 ; 0x2f 2340a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2340e: 18 16 cp r1, r24 23410: 0c f0 brlt .+2 ; 0x23414 23412: d3 c1 rjmp .+934 ; 0x237ba if(_millis() - t2 > 5000) { 23414: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23418: 2e 85 ldd r18, Y+14 ; 0x0e 2341a: 3f 85 ldd r19, Y+15 ; 0x0f 2341c: 48 89 ldd r20, Y+16 ; 0x10 2341e: 59 89 ldd r21, Y+17 ; 0x11 23420: 62 1b sub r22, r18 23422: 73 0b sbc r23, r19 23424: 84 0b sbc r24, r20 23426: 95 0b sbc r25, r21 23428: 69 38 cpi r22, 0x89 ; 137 2342a: 73 41 sbci r23, 0x13 ; 19 2342c: 81 05 cpc r24, r1 2342e: 91 05 cpc r25, r1 23430: 08 f4 brcc .+2 ; 0x23434 23432: c3 c1 rjmp .+902 ; 0x237ba 23434: d7 01 movw r26, r14 23436: c6 01 movw r24, r12 23438: 29 81 ldd r18, Y+1 ; 0x01 2343a: 3a 81 ldd r19, Y+2 ; 0x02 2343c: 4b 81 ldd r20, Y+3 ; 0x03 2343e: 5c 81 ldd r21, Y+4 ; 0x04 23440: 82 1b sub r24, r18 23442: 93 0b sbc r25, r19 23444: a4 0b sbc r26, r20 23446: b5 0b sbc r27, r21 23448: b5 95 asr r27 2344a: a7 95 ror r26 2344c: 97 95 ror r25 2344e: 87 95 ror r24 heating=false; if (extruder<0) { 23450: 21 14 cp r2, r1 23452: 31 04 cpc r3, r1 23454: 09 f4 brne .+2 ; 0x23458 23456: 40 c0 rjmp .+128 ; 0x234d8 soft_pwm_bed = (bias - d) >> 1; 23458: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2345c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23460: 6e 83 std Y+6, r22 ; 0x06 23462: 7f 83 std Y+7, r23 ; 0x07 23464: 88 87 std Y+8, r24 ; 0x08 23466: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 23468: dc 01 movw r26, r24 2346a: cb 01 movw r24, r22 2346c: 2e 85 ldd r18, Y+14 ; 0x0e 2346e: 3f 85 ldd r19, Y+15 ; 0x0f 23470: 48 89 ldd r20, Y+16 ; 0x10 23472: 59 89 ldd r21, Y+17 ; 0x11 23474: 82 1b sub r24, r18 23476: 93 0b sbc r25, r19 23478: a4 0b sbc r26, r20 2347a: b5 0b sbc r27, r21 2347c: 8b 8f std Y+27, r24 ; 0x1b 2347e: 9c 8f std Y+28, r25 ; 0x1c 23480: ad 8f std Y+29, r26 ; 0x1d 23482: be 8f std Y+30, r27 ; 0x1e max=temp; 23484: 3a 85 ldd r19, Y+10 ; 0x0a 23486: 3e 8b std Y+22, r19 ; 0x16 23488: 4b 85 ldd r20, Y+11 ; 0x0b 2348a: 4f 8b std Y+23, r20 ; 0x17 2348c: 5c 85 ldd r21, Y+12 ; 0x0c 2348e: 58 8f std Y+24, r21 ; 0x18 23490: 8d 85 ldd r24, Y+13 ; 0x0d 23492: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 23494: 2a 85 ldd r18, Y+10 ; 0x0a 23496: 3b 85 ldd r19, Y+11 ; 0x0b 23498: 4c 85 ldd r20, Y+12 ; 0x0c 2349a: 5d 85 ldd r21, Y+13 ; 0x0d 2349c: b8 01 movw r22, r16 2349e: 88 a9 ldd r24, Y+48 ; 0x30 234a0: 9f a5 ldd r25, Y+47 ; 0x2f 234a2: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 234a6: 87 fd sbrc r24, 7 234a8: 1a c0 rjmp .+52 ; 0x234de if(_millis() - t1 > 5000) { 234aa: 1a 8e std Y+26, r1 ; 0x1a 234ac: 86 c1 rjmp .+780 ; 0x237ba 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 234ae: 4a e0 ldi r20, 0x0A ; 10 234b0: 4f 8f std Y+31, r20 ; 0x1f 234b2: 00 cf rjmp .-512 ; 0x232b4 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; 234b4: 20 93 62 06 sts 0x0662, r18 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 234b8: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 234bc: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 234c0: 1a cf rjmp .-460 ; 0x232f6 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 234c2: 00 91 8a 03 lds r16, 0x038A ; 0x80038a 234c6: 10 91 8b 03 lds r17, 0x038B ; 0x80038b 234ca: 90 91 8c 03 lds r25, 0x038C ; 0x80038c 234ce: 98 ab std Y+48, r25 ; 0x30 234d0: a0 91 8d 03 lds r26, 0x038D ; 0x80038d 234d4: af a7 std Y+47, r26 ; 0x2f 234d6: 55 cf rjmp .-342 ; 0x23382 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 234d8: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 234dc: bf cf rjmp .-130 ; 0x2345c t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 234de: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 234e2: 2e 81 ldd r18, Y+6 ; 0x06 234e4: 3f 81 ldd r19, Y+7 ; 0x07 234e6: 48 85 ldd r20, Y+8 ; 0x08 234e8: 59 85 ldd r21, Y+9 ; 0x09 234ea: 62 1b sub r22, r18 234ec: 73 0b sbc r23, r19 234ee: 84 0b sbc r24, r20 234f0: 95 0b sbc r25, r21 234f2: 69 38 cpi r22, 0x89 ; 137 234f4: 73 41 sbci r23, 0x13 ; 19 234f6: 81 05 cpc r24, r1 234f8: 91 05 cpc r25, r1 234fa: b8 f2 brcs .-82 ; 0x234aa heating=true; t2=_millis(); 234fc: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23500: 6e 87 std Y+14, r22 ; 0x0e 23502: 7f 87 std Y+15, r23 ; 0x0f 23504: 88 8b std Y+16, r24 ; 0x10 23506: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 23508: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 2350c: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23510: 18 16 cp r1, r24 23512: 19 06 cpc r1, r25 23514: 0c f0 brlt .+2 ; 0x23518 23516: 2c c1 rjmp .+600 ; 0x23770 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 23518: 8e 85 ldd r24, Y+14 ; 0x0e 2351a: 9f 85 ldd r25, Y+15 ; 0x0f 2351c: a8 89 ldd r26, Y+16 ; 0x10 2351e: b9 89 ldd r27, Y+17 ; 0x11 23520: 2e 81 ldd r18, Y+6 ; 0x06 23522: 3f 81 ldd r19, Y+7 ; 0x07 23524: 48 85 ldd r20, Y+8 ; 0x08 23526: 59 85 ldd r21, Y+9 ; 0x09 23528: 82 1b sub r24, r18 2352a: 93 0b sbc r25, r19 2352c: a4 0b sbc r26, r20 2352e: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 23530: 4b 8c ldd r4, Y+27 ; 0x1b 23532: 5c 8c ldd r5, Y+28 ; 0x1c 23534: 6d 8c ldd r6, Y+29 ; 0x1d 23536: 7e 8c ldd r7, Y+30 ; 0x1e 23538: 48 0e add r4, r24 2353a: 59 1e adc r5, r25 2353c: 6a 1e adc r6, r26 2353e: 7b 1e adc r7, r27 23540: 2b 8d ldd r18, Y+27 ; 0x1b 23542: 3c 8d ldd r19, Y+28 ; 0x1c 23544: 4d 8d ldd r20, Y+29 ; 0x1d 23546: 5e 8d ldd r21, Y+30 ; 0x1e 23548: 28 1b sub r18, r24 2354a: 39 0b sbc r19, r25 2354c: 4a 0b sbc r20, r26 2354e: 5b 0b sbc r21, r27 23550: 69 81 ldd r22, Y+1 ; 0x01 23552: 7a 81 ldd r23, Y+2 ; 0x02 23554: 8b 81 ldd r24, Y+3 ; 0x03 23556: 9c 81 ldd r25, Y+4 ; 0x04 23558: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 2355c: a3 01 movw r20, r6 2355e: 92 01 movw r18, r4 23560: 0f 94 2d a2 call 0x3445a ; 0x3445a <__divmodsi4> 23564: da 01 movw r26, r20 23566: c9 01 movw r24, r18 23568: 8c 0d add r24, r12 2356a: 9d 1d adc r25, r13 2356c: ae 1d adc r26, r14 2356e: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 23570: 84 31 cpi r24, 0x14 ; 20 23572: 91 05 cpc r25, r1 23574: a1 05 cpc r26, r1 23576: b1 05 cpc r27, r1 23578: 0c f4 brge .+2 ; 0x2357c 2357a: 3c c1 rjmp .+632 ; 0x237f4 2357c: 6c 01 movw r12, r24 2357e: 7d 01 movw r14, r26 23580: 3c ee ldi r19, 0xEC ; 236 23582: c3 16 cp r12, r19 23584: d1 04 cpc r13, r1 23586: e1 04 cpc r14, r1 23588: f1 04 cpc r15, r1 2358a: 2c f0 brlt .+10 ; 0x23596 2358c: 4b ee ldi r20, 0xEB ; 235 2358e: c4 2e mov r12, r20 23590: d1 2c mov r13, r1 23592: e1 2c mov r14, r1 23594: 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; 23596: 80 38 cpi r24, 0x80 ; 128 23598: 91 05 cpc r25, r1 2359a: a1 05 cpc r26, r1 2359c: b1 05 cpc r27, r1 2359e: 0c f4 brge .+2 ; 0x235a2 235a0: 37 c1 rjmp .+622 ; 0x23810 235a2: 8e ef ldi r24, 0xFE ; 254 235a4: 90 e0 ldi r25, 0x00 ; 0 235a6: a0 e0 ldi r26, 0x00 ; 0 235a8: b0 e0 ldi r27, 0x00 ; 0 235aa: 8c 19 sub r24, r12 235ac: 9d 09 sbc r25, r13 235ae: ae 09 sbc r26, r14 235b0: bf 09 sbc r27, r15 235b2: 89 83 std Y+1, r24 ; 0x01 235b4: 9a 83 std Y+2, r25 ; 0x02 235b6: ab 83 std Y+3, r26 ; 0x03 235b8: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 235ba: 83 ee ldi r24, 0xE3 ; 227 235bc: 92 e9 ldi r25, 0x92 ; 146 235be: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 235c2: c7 01 movw r24, r14 235c4: b6 01 movw r22, r12 235c6: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 235ca: 8e ed ldi r24, 0xDE ; 222 235cc: 92 e9 ldi r25, 0x92 ; 146 235ce: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 235d2: 69 81 ldd r22, Y+1 ; 0x01 235d4: 7a 81 ldd r23, Y+2 ; 0x02 235d6: 8b 81 ldd r24, Y+3 ; 0x03 235d8: 9c 81 ldd r25, Y+4 ; 0x04 235da: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 235de: 87 ed ldi r24, 0xD7 ; 215 235e0: 92 e9 ldi r25, 0x92 ; 146 235e2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 235e6: 42 e0 ldi r20, 0x02 ; 2 235e8: 6a 89 ldd r22, Y+18 ; 0x12 235ea: 7b 89 ldd r23, Y+19 ; 0x13 235ec: 8c 89 ldd r24, Y+20 ; 0x14 235ee: 9d 89 ldd r25, Y+21 ; 0x15 235f0: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 235f4: 80 ed ldi r24, 0xD0 ; 208 235f6: 92 e9 ldi r25, 0x92 ; 146 235f8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 235fc: 6e 89 ldd r22, Y+22 ; 0x16 235fe: 7f 89 ldd r23, Y+23 ; 0x17 23600: 88 8d ldd r24, Y+24 ; 0x18 23602: 99 8d ldd r25, Y+25 ; 0x19 23604: 0f 94 e3 41 call 0x283c6 ; 0x283c6 if(pid_cycle > 2) { 23608: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 2360c: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23610: 03 97 sbiw r24, 0x03 ; 3 23612: 0c f4 brge .+2 ; 0x23616 23614: ad c0 rjmp .+346 ; 0x23770 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 23616: 69 81 ldd r22, Y+1 ; 0x01 23618: 7a 81 ldd r23, Y+2 ; 0x02 2361a: 8b 81 ldd r24, Y+3 ; 0x03 2361c: 9c 81 ldd r25, Y+4 ; 0x04 2361e: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 23622: 20 e0 ldi r18, 0x00 ; 0 23624: 30 e0 ldi r19, 0x00 ; 0 23626: 40 e8 ldi r20, 0x80 ; 128 23628: 50 e4 ldi r21, 0x40 ; 64 2362a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2362e: 4b 01 movw r8, r22 23630: 5c 01 movw r10, r24 23632: 2a 89 ldd r18, Y+18 ; 0x12 23634: 3b 89 ldd r19, Y+19 ; 0x13 23636: 4c 89 ldd r20, Y+20 ; 0x14 23638: 5d 89 ldd r21, Y+21 ; 0x15 2363a: 6e 89 ldd r22, Y+22 ; 0x16 2363c: 7f 89 ldd r23, Y+23 ; 0x17 2363e: 88 8d ldd r24, Y+24 ; 0x18 23640: 99 8d ldd r25, Y+25 ; 0x19 23642: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 23646: 20 ed ldi r18, 0xD0 ; 208 23648: 3f e0 ldi r19, 0x0F ; 15 2364a: 49 e4 ldi r20, 0x49 ; 73 2364c: 50 e4 ldi r21, 0x40 ; 64 2364e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 23652: 20 e0 ldi r18, 0x00 ; 0 23654: 30 e0 ldi r19, 0x00 ; 0 23656: 40 e0 ldi r20, 0x00 ; 0 23658: 5f e3 ldi r21, 0x3F ; 63 2365a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2365e: 9b 01 movw r18, r22 23660: ac 01 movw r20, r24 23662: c5 01 movw r24, r10 23664: b4 01 movw r22, r8 23666: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2366a: 4b 01 movw r8, r22 2366c: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2366e: c3 01 movw r24, r6 23670: b2 01 movw r22, r4 23672: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 23676: 20 e0 ldi r18, 0x00 ; 0 23678: 30 e0 ldi r19, 0x00 ; 0 2367a: 4a e7 ldi r20, 0x7A ; 122 2367c: 54 e4 ldi r21, 0x44 ; 68 2367e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 23682: 2b 01 movw r4, r22 23684: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 23686: 8a ec ldi r24, 0xCA ; 202 23688: 92 e9 ldi r25, 0x92 ; 146 2368a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2368e: 42 e0 ldi r20, 0x02 ; 2 23690: c5 01 movw r24, r10 23692: b4 01 movw r22, r8 23694: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 23698: 84 ec ldi r24, 0xC4 ; 196 2369a: 92 e9 ldi r25, 0x92 ; 146 2369c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 236a0: c3 01 movw r24, r6 236a2: b2 01 movw r22, r4 236a4: 0f 94 e3 41 call 0x283c6 ; 0x283c6 _Kp = 0.6*Ku; 236a8: 2a e9 ldi r18, 0x9A ; 154 236aa: 39 e9 ldi r19, 0x99 ; 153 236ac: 49 e1 ldi r20, 0x19 ; 25 236ae: 5f e3 ldi r21, 0x3F ; 63 236b0: c5 01 movw r24, r10 236b2: b4 01 movw r22, r8 236b4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 236b8: 4b 01 movw r8, r22 236ba: 5c 01 movw r10, r24 236bc: 80 92 a8 03 sts 0x03A8, r8 ; 0x8003a8 <_Kp> 236c0: 90 92 a9 03 sts 0x03A9, r9 ; 0x8003a9 <_Kp+0x1> 236c4: a0 92 aa 03 sts 0x03AA, r10 ; 0x8003aa <_Kp+0x2> 236c8: b0 92 ab 03 sts 0x03AB, r11 ; 0x8003ab <_Kp+0x3> _Ki = 2*_Kp/Tu; 236cc: ac 01 movw r20, r24 236ce: 9b 01 movw r18, r22 236d0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 236d4: a3 01 movw r20, r6 236d6: 92 01 movw r18, r4 236d8: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 236dc: 60 93 a4 03 sts 0x03A4, r22 ; 0x8003a4 <_Ki> 236e0: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 <_Ki+0x1> 236e4: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 <_Ki+0x2> 236e8: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 <_Ki+0x3> _Kd = _Kp*Tu/8; 236ec: a3 01 movw r20, r6 236ee: 92 01 movw r18, r4 236f0: c5 01 movw r24, r10 236f2: b4 01 movw r22, r8 236f4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 236f8: 20 e0 ldi r18, 0x00 ; 0 236fa: 30 e0 ldi r19, 0x00 ; 0 236fc: 40 e0 ldi r20, 0x00 ; 0 236fe: 5e e3 ldi r21, 0x3E ; 62 23700: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 23704: 60 93 a0 03 sts 0x03A0, r22 ; 0x8003a0 <_Kd> 23708: 70 93 a1 03 sts 0x03A1, r23 ; 0x8003a1 <_Kd+0x1> 2370c: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 <_Kd+0x2> 23710: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 23714: 86 eb ldi r24, 0xB6 ; 182 23716: 92 e9 ldi r25, 0x92 ; 146 23718: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2371c: 80 eb ldi r24, 0xB0 ; 176 2371e: 92 e9 ldi r25, 0x92 ; 146 23720: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 23724: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 <_Kp> 23728: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 <_Kp+0x1> 2372c: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa <_Kp+0x2> 23730: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab <_Kp+0x3> 23734: 0f 94 e3 41 call 0x283c6 ; 0x283c6 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 23738: 8a ea ldi r24, 0xAA ; 170 2373a: 92 e9 ldi r25, 0x92 ; 146 2373c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 23740: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 23744: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 23748: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 2374c: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 23750: 0f 94 e3 41 call 0x283c6 ; 0x283c6 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 23754: 84 ea ldi r24, 0xA4 ; 164 23756: 92 e9 ldi r25, 0x92 ; 146 23758: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2375c: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 23760: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 23764: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 23768: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 2376c: 0f 94 e3 41 call 0x283c6 ; 0x283c6 23770: 89 81 ldd r24, Y+1 ; 0x01 23772: 9a 81 ldd r25, Y+2 ; 0x02 23774: ab 81 ldd r26, Y+3 ; 0x03 23776: bc 81 ldd r27, Y+4 ; 0x04 23778: 8c 0d add r24, r12 2377a: 9d 1d adc r25, r13 2377c: ae 1d adc r26, r14 2377e: bf 1d adc r27, r15 23780: b5 95 asr r27 23782: a7 95 ror r26 23784: 97 95 ror r25 23786: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 23788: 21 14 cp r2, r1 2378a: 31 04 cpc r3, r1 2378c: 09 f4 brne .+2 ; 0x23790 2378e: 45 c0 rjmp .+138 ; 0x2381a { soft_pwm_bed = (bias + d) >> 1; 23790: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 23794: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23798: 90 91 70 06 lds r25, 0x0670 ; 0x800670 2379c: 01 96 adiw r24, 0x01 ; 1 2379e: 90 93 70 06 sts 0x0670, r25 ; 0x800670 237a2: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f min=temp; 237a6: 3a 85 ldd r19, Y+10 ; 0x0a 237a8: 3a 8b std Y+18, r19 ; 0x12 237aa: 4b 85 ldd r20, Y+11 ; 0x0b 237ac: 4b 8b std Y+19, r20 ; 0x13 237ae: 5c 85 ldd r21, Y+12 ; 0x0c 237b0: 5c 8b std Y+20, r21 ; 0x14 237b2: 8d 85 ldd r24, Y+13 ; 0x0d 237b4: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 237b6: 98 a5 ldd r25, Y+40 ; 0x28 237b8: 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)) { 237ba: 20 e0 ldi r18, 0x00 ; 0 237bc: 30 e0 ldi r19, 0x00 ; 0 237be: 40 ea ldi r20, 0xA0 ; 160 237c0: 51 e4 ldi r21, 0x41 ; 65 237c2: 6a 85 ldd r22, Y+10 ; 0x0a 237c4: 7b 85 ldd r23, Y+11 ; 0x0b 237c6: 8c 85 ldd r24, Y+12 ; 0x0c 237c8: 9d 85 ldd r25, Y+13 ; 0x0d 237ca: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 237ce: 98 01 movw r18, r16 237d0: 48 a9 ldd r20, Y+48 ; 0x30 237d2: 5f a5 ldd r21, Y+47 ; 0x2f 237d4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 237d8: 87 ff sbrs r24, 7 237da: 22 c0 rjmp .+68 ; 0x23820 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 237dc: 8a e7 ldi r24, 0x7A ; 122 237de: 92 e9 ldi r25, 0x92 ; 146 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"); 237e0: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 pid_tuning_finished = true; 237e4: 81 e0 ldi r24, 0x01 ; 1 237e6: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> pid_cycle = 0; 237ea: 10 92 70 06 sts 0x0670, r1 ; 0x800670 237ee: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 237f2: 98 c0 rjmp .+304 ; 0x23924 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); 237f4: 34 e1 ldi r19, 0x14 ; 20 237f6: c3 2e mov r12, r19 237f8: d1 2c mov r13, r1 237fa: e1 2c mov r14, r1 237fc: f1 2c mov r15, r1 237fe: 24 e1 ldi r18, 0x14 ; 20 23800: 30 e0 ldi r19, 0x00 ; 0 23802: 40 e0 ldi r20, 0x00 ; 0 23804: 50 e0 ldi r21, 0x00 ; 0 23806: 29 83 std Y+1, r18 ; 0x01 23808: 3a 83 std Y+2, r19 ; 0x02 2380a: 4b 83 std Y+3, r20 ; 0x03 2380c: 5c 83 std Y+4, r21 ; 0x04 2380e: d5 ce rjmp .-598 ; 0x235ba 23810: c9 82 std Y+1, r12 ; 0x01 23812: da 82 std Y+2, r13 ; 0x02 23814: eb 82 std Y+3, r14 ; 0x03 23816: fc 82 std Y+4, r15 ; 0x04 23818: d0 ce rjmp .-608 ; 0x235ba if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2381a: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 2381e: ba cf rjmp .-140 ; 0x23794 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 23820: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23824: 28 a1 ldd r18, Y+32 ; 0x20 23826: 39 a1 ldd r19, Y+33 ; 0x21 23828: 4a a1 ldd r20, Y+34 ; 0x22 2382a: 5b a1 ldd r21, Y+35 ; 0x23 2382c: 62 1b sub r22, r18 2382e: 73 0b sbc r23, r19 23830: 84 0b sbc r24, r20 23832: 95 0b sbc r25, r21 23834: 61 3d cpi r22, 0xD1 ; 209 23836: 77 40 sbci r23, 0x07 ; 7 23838: 81 05 cpc r24, r1 2383a: 91 05 cpc r25, r1 2383c: 58 f1 brcs .+86 ; 0x23894 int p; if (extruder<0){ p=soft_pwm_bed; 2383e: a0 90 5b 06 lds r10, 0x065B ; 0x80065b 23842: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 23844: 87 e7 ldi r24, 0x77 ; 119 23846: 92 e9 ldi r25, 0x92 ; 146 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 23848: 21 14 cp r2, r1 2384a: 31 04 cpc r3, r1 2384c: 29 f4 brne .+10 ; 0x23858 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2384e: a0 90 62 06 lds r10, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 23852: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 23854: 84 e7 ldi r24, 0x74 ; 116 23856: 92 e9 ldi r25, 0x92 ; 146 23858: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2385c: 42 e0 ldi r20, 0x02 ; 2 2385e: b8 01 movw r22, r16 23860: 88 a9 ldd r24, Y+48 ; 0x30 23862: 9f a5 ldd r25, Y+47 ; 0x2f 23864: 0f 94 a9 98 call 0x33152 ; 0x33152 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 23868: 80 e7 ldi r24, 0x70 ; 112 2386a: 92 e9 ldi r25, 0x92 ; 146 2386c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOLLN(p); 23870: c5 01 movw r24, r10 23872: 0f 94 00 42 call 0x28400 ; 0x28400 if (safety_check_cycles == 0) { //save ambient temp 23876: 4d 81 ldd r20, Y+5 ; 0x05 23878: 44 23 and r20, r20 2387a: 09 f4 brne .+2 ; 0x2387e 2387c: 6c c0 rjmp .+216 ; 0x23956 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2387e: 5f 8d ldd r21, Y+31 ; 0x1f 23880: 45 17 cp r20, r21 23882: 70 f5 brcc .+92 ; 0x238e0 safety_check_cycles++; 23884: 4f 5f subi r20, 0xFF ; 255 23886: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 23888: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2388c: 68 a3 std Y+32, r22 ; 0x20 2388e: 79 a3 std Y+33, r23 ; 0x21 23890: 8a a3 std Y+34, r24 ; 0x22 23892: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 23894: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23898: 4b 01 movw r8, r22 2389a: 5c 01 movw r10, r24 2389c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 238a0: 4e 80 ldd r4, Y+6 ; 0x06 238a2: 5f 80 ldd r5, Y+7 ; 0x07 238a4: 68 84 ldd r6, Y+8 ; 0x08 238a6: 79 84 ldd r7, Y+9 ; 0x09 238a8: 2e 85 ldd r18, Y+14 ; 0x0e 238aa: 3f 85 ldd r19, Y+15 ; 0x0f 238ac: 48 89 ldd r20, Y+16 ; 0x10 238ae: 59 89 ldd r21, Y+17 ; 0x11 238b0: 42 0e add r4, r18 238b2: 53 1e adc r5, r19 238b4: 64 1e adc r6, r20 238b6: 75 1e adc r7, r21 238b8: 84 18 sub r8, r4 238ba: 95 08 sbc r9, r5 238bc: a6 08 sbc r10, r6 238be: b7 08 sbc r11, r7 238c0: 86 0e add r8, r22 238c2: 97 1e adc r9, r23 238c4: a8 1e adc r10, r24 238c6: b9 1e adc r11, r25 238c8: 31 e8 ldi r19, 0x81 ; 129 238ca: 83 16 cp r8, r19 238cc: 3f e4 ldi r19, 0x4F ; 79 238ce: 93 06 cpc r9, r19 238d0: 32 e1 ldi r19, 0x12 ; 18 238d2: a3 06 cpc r10, r19 238d4: b1 04 cpc r11, r1 238d6: 08 f4 brcc .+2 ; 0x238da 238d8: 47 c0 rjmp .+142 ; 0x23968 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 238da: 83 e5 ldi r24, 0x53 ; 83 238dc: 92 e9 ldi r25, 0x92 ; 146 238de: 80 cf rjmp .-256 ; 0x237e0 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 238e0: 8d 81 ldd r24, Y+5 ; 0x05 238e2: 9f 8d ldd r25, Y+31 ; 0x1f 238e4: 89 13 cpse r24, r25 238e6: d0 cf rjmp .-96 ; 0x23888 safety_check_cycles++; 238e8: 8f 5f subi r24, 0xFF ; 255 238ea: 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) { 238ec: 2b a5 ldd r18, Y+43 ; 0x2b 238ee: 3c a5 ldd r19, Y+44 ; 0x2c 238f0: 4d a5 ldd r20, Y+45 ; 0x2d 238f2: 5e a5 ldd r21, Y+46 ; 0x2e 238f4: b8 01 movw r22, r16 238f6: 88 a9 ldd r24, Y+48 ; 0x30 238f8: 9f a5 ldd r25, Y+47 ; 0x2f 238fa: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 238fe: 9f 77 andi r25, 0x7F ; 127 23900: 20 e0 ldi r18, 0x00 ; 0 23902: 30 e0 ldi r19, 0x00 ; 0 23904: 40 ea ldi r20, 0xA0 ; 160 23906: 50 e4 ldi r21, 0x40 ; 64 23908: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2390c: 87 ff sbrs r24, 7 2390e: bc cf rjmp .-136 ; 0x23888 temp_runaway_stop(false, (extruder<0)); 23910: 63 2d mov r22, r3 23912: 66 1f adc r22, r22 23914: 66 27 eor r22, r22 23916: 66 1f adc r22, r22 23918: 80 e0 ldi r24, 0x00 ; 0 2391a: 0f 94 9d 09 call 0x2133a ; 0x2133a pid_tuning_finished = true; 2391e: 81 e0 ldi r24, 0x01 ; 1 23920: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> pid_cycle = 0; return; } lcd_update(0); } } 23924: e0 96 adiw r28, 0x30 ; 48 23926: 0f b6 in r0, 0x3f ; 63 23928: f8 94 cli 2392a: de bf out 0x3e, r29 ; 62 2392c: 0f be out 0x3f, r0 ; 63 2392e: cd bf out 0x3d, r28 ; 61 23930: df 91 pop r29 23932: cf 91 pop r28 23934: 1f 91 pop r17 23936: 0f 91 pop r16 23938: ff 90 pop r15 2393a: ef 90 pop r14 2393c: df 90 pop r13 2393e: cf 90 pop r12 23940: bf 90 pop r11 23942: af 90 pop r10 23944: 9f 90 pop r9 23946: 8f 90 pop r8 23948: 7f 90 pop r7 2394a: 6f 90 pop r6 2394c: 5f 90 pop r5 2394e: 4f 90 pop r4 23950: 3f 90 pop r3 23952: 2f 90 pop r2 23954: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 23956: 0b a7 std Y+43, r16 ; 0x2b 23958: 1c a7 std Y+44, r17 ; 0x2c 2395a: a8 a9 ldd r26, Y+48 ; 0x30 2395c: ad a7 std Y+45, r26 ; 0x2d 2395e: bf a5 ldd r27, Y+47 ; 0x2f 23960: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 23962: 21 e0 ldi r18, 0x01 ; 1 23964: 2d 83 std Y+5, r18 ; 0x05 23966: 90 cf rjmp .-224 ; 0x23888 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 23968: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 2396c: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23970: 49 a5 ldd r20, Y+41 ; 0x29 23972: 5a a5 ldd r21, Y+42 ; 0x2a 23974: 48 17 cp r20, r24 23976: 59 07 cpc r21, r25 23978: 1c f4 brge .+6 ; 0x23980 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2397a: 87 ef ldi r24, 0xF7 ; 247 2397c: 91 e9 ldi r25, 0x91 ; 145 2397e: 30 cf rjmp .-416 ; 0x237e0 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 23980: 80 e0 ldi r24, 0x00 ; 0 23982: 0e 94 c3 69 call 0xd386 ; 0xd386 23986: e6 cc rjmp .-1588 ; 0x23354 00023988 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 23988: 0f 93 push r16 2398a: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2398c: 80 91 59 03 lds r24, 0x0359 ; 0x800359 23990: 81 30 cpi r24, 0x01 ; 1 23992: 19 f5 brne .+70 ; 0x239da 23994: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 23998: 00 91 e9 05 lds r16, 0x05E9 ; 0x8005e9 2399c: 10 91 ea 05 lds r17, 0x05EA ; 0x8005ea 239a0: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 239a4: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 239a8: 60 1b sub r22, r16 239aa: 71 0b sbc r23, r17 239ac: 82 0b sbc r24, r18 239ae: 93 0b sbc r25, r19 239b0: 28 ee ldi r18, 0xE8 ; 232 239b2: 33 e0 ldi r19, 0x03 ; 3 239b4: 40 e0 ldi r20, 0x00 ; 0 239b6: 50 e0 ldi r21, 0x00 ; 0 239b8: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 239bc: 60 91 e5 05 lds r22, 0x05E5 ; 0x8005e5 239c0: 70 91 e6 05 lds r23, 0x05E6 ; 0x8005e6 239c4: 80 91 e7 05 lds r24, 0x05E7 ; 0x8005e7 239c8: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 239cc: 62 0f add r22, r18 239ce: 73 1f adc r23, r19 239d0: 84 1f adc r24, r20 239d2: 95 1f adc r25, r21 } 239d4: 1f 91 pop r17 239d6: 0f 91 pop r16 239d8: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 239da: 60 91 78 06 lds r22, 0x0678 ; 0x800678 239de: 70 91 79 06 lds r23, 0x0679 ; 0x800679 239e2: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 239e6: 90 91 7b 06 lds r25, 0x067B ; 0x80067b 239ea: d6 cf rjmp .-84 ; 0x23998 000239ec : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 239ec: 4f 92 push r4 239ee: 5f 92 push r5 239f0: 6f 92 push r6 239f2: 7f 92 push r7 239f4: 8f 92 push r8 239f6: 9f 92 push r9 239f8: af 92 push r10 239fa: bf 92 push r11 239fc: cf 92 push r12 239fe: df 92 push r13 23a00: ef 92 push r14 23a02: ff 92 push r15 23a04: 0f 93 push r16 23a06: 1f 93 push r17 23a08: cf 93 push r28 23a0a: df 93 push r29 23a0c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 23a10: 0e 94 49 61 call 0xc292 ; 0xc292 23a14: 88 23 and r24, r24 23a16: 09 f4 brne .+2 ; 0x23a1a 23a18: 6e c0 rjmp .+220 ; 0x23af6 { const float _met = ((float)total_filament_used) / (100000.f); 23a1a: 60 91 84 06 lds r22, 0x0684 ; 0x800684 23a1e: 70 91 85 06 lds r23, 0x0685 ; 0x800685 23a22: 80 91 86 06 lds r24, 0x0686 ; 0x800686 23a26: 90 91 87 06 lds r25, 0x0687 ; 0x800687 23a2a: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 23a2e: 20 e0 ldi r18, 0x00 ; 0 23a30: 30 e5 ldi r19, 0x50 ; 80 23a32: 43 ec ldi r20, 0xC3 ; 195 23a34: 57 e4 ldi r21, 0x47 ; 71 23a36: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 23a3a: 56 2e mov r5, r22 23a3c: 47 2e mov r4, r23 23a3e: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 23a40: 0f 94 c4 1c call 0x23988 ; 0x23988 23a44: 6b 01 movw r12, r22 23a46: 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(); 23a48: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P(_N( 23a4c: 8a ec ldi r24, 0xCA ; 202 23a4e: 9b e4 ldi r25, 0x4B ; 75 23a50: 0e 94 32 6d call 0xda64 ; 0xda64 23a54: 18 2f mov r17, r24 23a56: 09 2f mov r16, r25 23a58: 8a eb ldi r24, 0xBA ; 186 23a5a: 9b e4 ldi r25, 0x4B ; 75 23a5c: 0e 94 32 6d call 0xda64 ; 0xda64 23a60: 78 2e mov r7, r24 23a62: 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; 23a64: 8c e3 ldi r24, 0x3C ; 60 23a66: 88 2e mov r8, r24 23a68: 91 2c mov r9, r1 23a6a: a1 2c mov r10, r1 23a6c: b1 2c mov r11, r1 23a6e: c7 01 movw r24, r14 23a70: b6 01 movw r22, r12 23a72: a5 01 movw r20, r10 23a74: 94 01 movw r18, r8 23a76: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23a7a: 7f 93 push r23 23a7c: 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; 23a7e: ca 01 movw r24, r20 23a80: b9 01 movw r22, r18 23a82: a5 01 movw r20, r10 23a84: 94 01 movw r18, r8 23a86: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23a8a: 7f 93 push r23 23a8c: 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; 23a8e: c7 01 movw r24, r14 23a90: b6 01 movw r22, r12 23a92: 20 e1 ldi r18, 0x10 ; 16 23a94: 3e e0 ldi r19, 0x0E ; 14 23a96: 40 e0 ldi r20, 0x00 ; 0 23a98: 50 e0 ldi r21, 0x00 ; 0 23a9a: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23a9e: 5f 93 push r21 23aa0: 4f 93 push r20 23aa2: 3f 93 push r19 23aa4: 2f 93 push r18 23aa6: 0f 93 push r16 23aa8: 1f 93 push r17 23aaa: df 93 push r29 23aac: cf 93 push r28 23aae: 4f 92 push r4 23ab0: 5f 92 push r5 23ab2: 6f 92 push r6 23ab4: 7f 92 push r7 23ab6: 80 e6 ldi r24, 0x60 ; 96 23ab8: 9b e6 ldi r25, 0x6B ; 107 23aba: 9f 93 push r25 23abc: 8f 93 push r24 23abe: 0e 94 d5 69 call 0xd3aa ; 0xd3aa "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 23ac2: 8d b7 in r24, 0x3d ; 61 23ac4: 9e b7 in r25, 0x3e ; 62 23ac6: 42 96 adiw r24, 0x12 ; 18 23ac8: 0f b6 in r0, 0x3f ; 63 23aca: f8 94 cli 23acc: 9e bf out 0x3e, r25 ; 62 23ace: 0f be out 0x3f, r0 ; 63 23ad0: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 23ad2: df 91 pop r29 23ad4: cf 91 pop r28 23ad6: 1f 91 pop r17 23ad8: 0f 91 pop r16 23ada: ff 90 pop r15 23adc: ef 90 pop r14 23ade: df 90 pop r13 23ae0: cf 90 pop r12 23ae2: bf 90 pop r11 23ae4: af 90 pop r10 23ae6: 9f 90 pop r9 23ae8: 8f 90 pop r8 23aea: 7f 90 pop r7 23aec: 6f 90 pop r6 23aee: 5f 90 pop r5 23af0: 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(); 23af2: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 23af6: 81 ef ldi r24, 0xF1 ; 241 23af8: 9f e0 ldi r25, 0x0F ; 15 23afa: 0f 94 44 a1 call 0x34288 ; 0x34288 23afe: 2b 01 movw r4, r22 23b00: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 23b02: 8d ee ldi r24, 0xED ; 237 23b04: 9f e0 ldi r25, 0x0F ; 15 23b06: 0f 94 44 a1 call 0x34288 ; 0x34288 23b0a: 6b 01 movw r12, r22 23b0c: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 23b0e: 0e 94 28 6a call 0xd450 ; 0xd450 lcd_printf_P(_N( 23b12: 87 ea ldi r24, 0xA7 ; 167 23b14: 9b e4 ldi r25, 0x4B ; 75 23b16: 0e 94 32 6d call 0xda64 ; 0xda64 23b1a: 98 2e mov r9, r24 23b1c: 89 2e mov r8, r25 23b1e: 86 e9 ldi r24, 0x96 ; 150 23b20: 9b e4 ldi r25, 0x4B ; 75 23b22: 0e 94 32 6d call 0xda64 ; 0xda64 23b26: b8 2e mov r11, r24 23b28: 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; 23b2a: c7 01 movw r24, r14 23b2c: b6 01 movw r22, r12 23b2e: 2c e3 ldi r18, 0x3C ; 60 23b30: 30 e0 ldi r19, 0x00 ; 0 23b32: 40 e0 ldi r20, 0x00 ; 0 23b34: 50 e0 ldi r21, 0x00 ; 0 23b36: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23b3a: 7f 93 push r23 23b3c: 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; 23b3e: ca 01 movw r24, r20 23b40: b9 01 movw r22, r18 23b42: 28 e1 ldi r18, 0x18 ; 24 23b44: 30 e0 ldi r19, 0x00 ; 0 23b46: 40 e0 ldi r20, 0x00 ; 0 23b48: 50 e0 ldi r21, 0x00 ; 0 23b4a: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23b4e: 7f 93 push r23 23b50: 6f 93 push r22 uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 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; 23b52: c7 01 movw r24, r14 23b54: b6 01 movw r22, r12 23b56: 20 ea ldi r18, 0xA0 ; 160 23b58: 35 e0 ldi r19, 0x05 ; 5 23b5a: 40 e0 ldi r20, 0x00 ; 0 23b5c: 50 e0 ldi r21, 0x00 ; 0 23b5e: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23b62: 5f 93 push r21 23b64: 4f 93 push r20 23b66: 3f 93 push r19 23b68: 2f 93 push r18 23b6a: 8f 92 push r8 23b6c: 9f 92 push r9 { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 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; 23b6e: c3 01 movw r24, r6 23b70: b2 01 movw r22, r4 23b72: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 23b76: 20 e0 ldi r18, 0x00 ; 0 23b78: 30 e0 ldi r19, 0x00 ; 0 23b7a: 48 ec ldi r20, 0xC8 ; 200 23b7c: 52 e4 ldi r21, 0x42 ; 66 23b7e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23b82: 9f 93 push r25 23b84: 8f 93 push r24 23b86: 7f 93 push r23 23b88: 6f 93 push r22 23b8a: af 92 push r10 23b8c: bf 92 push r11 23b8e: 8c e3 ldi r24, 0x3C ; 60 23b90: 9b e6 ldi r25, 0x6B ; 107 23b92: 9f 93 push r25 23b94: 8f 93 push r24 23b96: 0e 94 d5 69 call 0xd3aa ; 0xd3aa "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 23b9a: 8d b7 in r24, 0x3d ; 61 23b9c: 9e b7 in r25, 0x3e ; 62 23b9e: 42 96 adiw r24, 0x12 ; 18 23ba0: 0f b6 in r0, 0x3f ; 63 23ba2: f8 94 cli 23ba4: 9e bf out 0x3e, r25 ; 62 23ba6: 0f be out 0x3f, r0 ; 63 23ba8: 8d bf out 0x3d, r24 ; 61 23baa: 93 cf rjmp .-218 ; 0x23ad2 00023bac : 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()") { 23bac: cf 92 push r12 23bae: df 92 push r13 23bb0: ef 92 push r14 23bb2: ff 92 push r15 23bb4: 0f 93 push r16 23bb6: 1f 93 push r17 23bb8: cf 93 push r28 23bba: df 93 push r29 23bbc: 00 d0 rcall .+0 ; 0x23bbe 23bbe: 00 d0 rcall .+0 ; 0x23bc0 23bc0: 1f 92 push r1 23bc2: 1f 92 push r1 23bc4: cd b7 in r28, 0x3d ; 61 23bc6: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 23bc8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 23bcc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 23bd0: 00 97 sbiw r24, 0x00 ; 0 23bd2: e1 f1 breq .+120 ; 0x23c4c { const int16_t initial_feedmultiply = feedmultiply; 23bd4: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 23bd8: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23bdc: 24 36 cpi r18, 0x64 ; 100 23bde: 31 05 cpc r19, r1 23be0: 4c f4 brge .+18 ; 0x23bf4 23be2: ac 01 movw r20, r24 23be4: 42 0f add r20, r18 23be6: 53 1f adc r21, r19 23be8: 45 36 cpi r20, 0x65 ; 101 23bea: 51 05 cpc r21, r1 23bec: 6c f4 brge .+26 ; 0x23c08 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; 23bee: 82 0f add r24, r18 23bf0: 93 1f adc r25, r19 23bf2: 0c c0 rjmp .+24 ; 0x23c0c #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23bf4: 24 36 cpi r18, 0x64 ; 100 23bf6: 31 05 cpc r19, r1 23bf8: 09 f4 brne .+2 ; 0x23bfc 23bfa: 55 c0 rjmp .+170 ; 0x23ca6 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 23bfc: ac 01 movw r20, r24 23bfe: 42 0f add r20, r18 23c00: 53 1f adc r21, r19 23c02: 44 36 cpi r20, 0x64 ; 100 23c04: 51 05 cpc r21, r1 23c06: 9c f7 brge .-26 ; 0x23bee { feedmultiply = 100; 23c08: 84 e6 ldi r24, 0x64 ; 100 23c0a: 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; 23c0c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23c10: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 23c14: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23c18: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 23c1c: 82 17 cp r24, r18 23c1e: 93 07 cpc r25, r19 23c20: a9 f0 breq .+42 ; 0x23c4c feedmultiply = constrain(feedmultiply, 10, 999); 23c22: 88 3e cpi r24, 0xE8 ; 232 23c24: 53 e0 ldi r21, 0x03 ; 3 23c26: 95 07 cpc r25, r21 23c28: 14 f0 brlt .+4 ; 0x23c2e 23c2a: 87 ee ldi r24, 0xE7 ; 231 23c2c: 93 e0 ldi r25, 0x03 ; 3 23c2e: 8a 30 cpi r24, 0x0A ; 10 23c30: 91 05 cpc r25, r1 23c32: 14 f4 brge .+4 ; 0x23c38 23c34: 8a e0 ldi r24, 0x0A ; 10 23c36: 90 e0 ldi r25, 0x00 ; 0 23c38: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23c3c: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 23c40: 10 92 07 05 sts 0x0507, r1 ; 0x800507 23c44: 10 92 06 05 sts 0x0506, r1 ; 0x800506 refresh_saved_feedrate_multiplier_in_ram(); 23c48: 0e 94 46 5f call 0xbe8c ; 0xbe8c } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 23c4c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 23c50: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 23c52: 10 92 77 06 sts 0x0677, r1 ; 0x800677 } if (lcd_status_update_delay) 23c56: 10 91 77 06 lds r17, 0x0677 ; 0x800677 23c5a: 11 23 and r17, r17 23c5c: 91 f1 breq .+100 ; 0x23cc2 lcd_status_update_delay--; 23c5e: 2f ef ldi r18, 0xFF ; 255 23c60: 21 0f add r18, r17 23c62: 20 93 77 06 sts 0x0677, r18 ; 0x800677 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 23c66: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 23c6a: 81 11 cpse r24, r1 23c6c: 0d c0 rjmp .+26 ; 0x23c88 23c6e: 0e 94 19 6c call 0xd832 ; 0xd832 23c72: 88 23 and r24, r24 23c74: 49 f0 breq .+18 ; 0x23c88 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 23c76: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_main_menu); 23c7a: 60 e0 ldi r22, 0x00 ; 0 23c7c: 8a ef ldi r24, 0xFA ; 250 23c7e: 93 ec ldi r25, 0xC3 ; 195 23c80: 0f 94 89 95 call 0x32b12 ; 0x32b12 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 23c84: 0e 94 a8 6a call 0xd550 ; 0xd550 } } 23c88: 28 96 adiw r28, 0x08 ; 8 23c8a: 0f b6 in r0, 0x3f ; 63 23c8c: f8 94 cli 23c8e: de bf out 0x3e, r29 ; 62 23c90: 0f be out 0x3f, r0 ; 63 23c92: cd bf out 0x3d, r28 ; 61 23c94: df 91 pop r29 23c96: cf 91 pop r28 23c98: 1f 91 pop r17 23c9a: 0f 91 pop r16 23c9c: ff 90 pop r15 23c9e: ef 90 pop r14 23ca0: df 90 pop r13 23ca2: cf 90 pop r12 23ca4: 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) { 23ca6: 8b 30 cpi r24, 0x0B ; 11 23ca8: 91 05 cpc r25, r1 23caa: 1c f0 brlt .+6 ; 0x23cb2 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 23cac: 86 5a subi r24, 0xA6 ; 166 23cae: 9f 4f sbci r25, 0xFF ; 255 23cb0: ad cf rjmp .-166 ; 0x23c0c } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 23cb2: 86 3f cpi r24, 0xF6 ; 246 23cb4: 4f ef ldi r20, 0xFF ; 255 23cb6: 94 07 cpc r25, r20 23cb8: 0c f0 brlt .+2 ; 0x23cbc 23cba: ac cf rjmp .-168 ; 0x23c14 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 23cbc: 82 59 subi r24, 0x92 ; 146 23cbe: 9f 4f sbci r25, 0xFF ; 255 23cc0: a5 cf rjmp .-182 ; 0x23c0c 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; 23cc2: 6a e0 ldi r22, 0x0A ; 10 23cc4: 60 93 77 06 sts 0x0677, r22 ; 0x800677 ReInitLCD++; 23cc8: 80 91 76 06 lds r24, 0x0676 ; 0x800676 23ccc: 8f 5f subi r24, 0xFF ; 255 23cce: 80 93 76 06 sts 0x0676, r24 ; 0x800676 if (ReInitLCD == 30) 23cd2: 8e 31 cpi r24, 0x1E ; 30 23cd4: 09 f0 breq .+2 ; 0x23cd8 23cd6: 9f c0 rjmp .+318 ; 0x23e16 { ReInitLCD = 0 ; 23cd8: 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(); 23cdc: 0e 94 a8 6a call 0xd550 ; 0xd550 lcd_status_message_idx = 0; // Re-draw message from beginning 23ce0: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 23ce4: 0e 94 b0 69 call 0xd360 ; 0xd360 lcd_home(); //line 0 23ce8: 0e 94 28 6a call 0xd450 ; 0xd450 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 23cec: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 23cf0: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 23cf4: 07 2e mov r0, r23 23cf6: 00 0c add r0, r0 23cf8: 88 0b sbc r24, r24 23cfa: 99 0b sbc r25, r25 23cfc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__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)); 23d00: 20 e0 ldi r18, 0x00 ; 0 23d02: 30 e0 ldi r19, 0x00 ; 0 23d04: 40 e0 ldi r20, 0x00 ; 0 23d06: 5f e3 ldi r21, 0x3F ; 63 23d08: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 23d0c: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 23d10: 6b 01 movw r12, r22 23d12: 20 e0 ldi r18, 0x00 ; 0 23d14: 30 e0 ldi r19, 0x00 ; 0 23d16: 40 e0 ldi r20, 0x00 ; 0 23d18: 5f e3 ldi r21, 0x3F ; 63 23d1a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 23d1e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 23d22: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 23d26: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 23d2a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 23d2e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 23d32: a6 01 movw r20, r12 23d34: 82 e8 ldi r24, 0x82 ; 130 23d36: 0f 94 eb 06 call 0x20dd6 ; 0x20dd6 lcd_space(3); //3 spaces 23d3a: 83 e0 ldi r24, 0x03 ; 3 23d3c: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 23d40: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 23d44: 81 30 cpi r24, 0x01 ; 1 23d46: 09 f0 breq .+2 ; 0x23d4a 23d48: 6e c0 rjmp .+220 ; 0x23e26 lcd_puts_P(_N("Z --- ")); 23d4a: 89 e8 ldi r24, 0x89 ; 137 23d4c: 9a e6 ldi r25, 0x6A ; 106 23d4e: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 23d52: 61 e0 ldi r22, 0x01 ; 1 23d54: 80 e0 ldi r24, 0x00 ; 0 23d56: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 23d5a: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 23d5e: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 23d62: 07 2e mov r0, r23 23d64: 00 0c add r0, r0 23d66: 88 0b sbc r24, r24 23d68: 99 0b sbc r25, r25 23d6a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 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: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 23d7a: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 23d7e: 6b 01 movw r12, r22 23d80: 20 e0 ldi r18, 0x00 ; 0 23d82: 30 e0 ldi r19, 0x00 ; 0 23d84: 40 e0 ldi r20, 0x00 ; 0 23d86: 5f e3 ldi r21, 0x3F ; 63 23d88: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 23d8c: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 23d90: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 23d94: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 23d98: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 23d9c: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 23da0: a6 01 movw r20, r12 23da2: 80 e8 ldi r24, 0x80 ; 128 23da4: 0f 94 eb 06 call 0x20dd6 ; 0x20dd6 lcd_space(3); //3 spaces 23da8: 83 e0 ldi r24, 0x03 ; 3 23daa: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 23dae: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 23db2: 8f 93 push r24 23db4: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23db8: 8f 93 push r24 23dba: 82 e9 ldi r24, 0x92 ; 146 23dbc: 9a e6 ldi r25, 0x6A ; 106 23dbe: 9f 93 push r25 23dc0: 8f 93 push r24 23dc2: 0e 94 d5 69 call 0xd3aa ; 0xd3aa lcd_space(8 - chars); 23dc6: 98 e0 ldi r25, 0x08 ; 8 23dc8: 98 1b sub r25, r24 23dca: 89 2f mov r24, r25 23dcc: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 23dd0: 62 e0 ldi r22, 0x02 ; 2 23dd2: 80 e0 ldi r24, 0x00 ; 0 23dd4: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 } // 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(" ")); 23dd8: 0f 90 pop r0 23dda: 0f 90 pop r0 23ddc: 0f 90 pop r0 23dde: 0f 90 pop r0 23de0: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 23de4: e0 90 6a 13 lds r14, 0x136A ; 0x80136a 23de8: 81 11 cpse r24, r1 23dea: 3e c0 rjmp .+124 ; 0x23e68 23dec: 25 ea ldi r18, 0xA5 ; 165 23dee: c2 2e mov r12, r18 23df0: 2a e6 ldi r18, 0x6A ; 106 23df2: d2 2e mov r13, r18 23df4: e1 10 cpse r14, r1 23df6: 3c c0 rjmp .+120 ; 0x23e70 23df8: 89 ea ldi r24, 0xA9 ; 169 23dfa: c8 2e mov r12, r24 23dfc: 8a e6 ldi r24, 0x6A ; 106 23dfe: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23e00: 0e 94 9a 61 call 0xc334 ; 0xc334 23e04: f8 2e mov r15, r24 23e06: 88 23 and r24, r24 23e08: d9 f1 breq .+118 ; 0x23e80 23e0a: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23e0e: 8f 3f cpi r24, 0xFF ; 255 23e10: 89 f5 brne .+98 ; 0x23e74 23e12: f1 2c mov r15, r1 23e14: 35 c0 rjmp .+106 ; 0x23e80 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 23e16: 0f 94 f7 a1 call 0x343ee ; 0x343ee <__divmodqi4> 23e1a: 91 11 cpse r25, r1 23e1c: 63 cf rjmp .-314 ; 0x23ce4 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 23e1e: 80 e0 ldi r24, 0x00 ; 0 23e20: 0e 94 67 6a call 0xd4ce ; 0xd4ce 23e24: 5d cf rjmp .-326 ; 0x23ce0 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]?' ':'?'); 23e26: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 23e2a: 88 23 and r24, r24 23e2c: d9 f0 breq .+54 ; 0x23e64 23e2e: 80 e2 ldi r24, 0x20 ; 32 23e30: 1f 92 push r1 23e32: 8f 93 push r24 23e34: 80 91 00 12 lds r24, 0x1200 ; 0x801200 23e38: 8f 93 push r24 23e3a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 23e3e: 8f 93 push r24 23e40: 80 91 fe 11 lds r24, 0x11FE ; 0x8011fe 23e44: 8f 93 push r24 23e46: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 23e4a: 8f 93 push r24 23e4c: 80 e8 ldi r24, 0x80 ; 128 23e4e: 9a e6 ldi r25, 0x6A ; 106 23e50: 9f 93 push r25 23e52: 8f 93 push r24 23e54: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 23e58: 0f b6 in r0, 0x3f ; 63 23e5a: f8 94 cli 23e5c: de bf out 0x3e, r29 ; 62 23e5e: 0f be out 0x3f, r0 ; 63 23e60: cd bf out 0x3d, r28 ; 61 23e62: 77 cf rjmp .-274 ; 0x23d52 23e64: 8f e3 ldi r24, 0x3F ; 63 23e66: e4 cf rjmp .-56 ; 0x23e30 } // 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(" ")); 23e68: 9d ea ldi r25, 0xAD ; 173 23e6a: c9 2e mov r12, r25 23e6c: 9a e6 ldi r25, 0x6A ; 106 23e6e: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23e70: ee 20 and r14, r14 23e72: 31 f2 breq .-116 ; 0x23e00 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23e74: 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)); 23e78: ff 24 eor r15, r15 23e7a: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23e7c: 88 23 and r24, r24 23e7e: 99 f1 breq .+102 ; 0x23ee6 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 23e80: 81 ea ldi r24, 0xA1 ; 161 23e82: 9d e0 ldi r25, 0x0D ; 13 23e84: 0f 94 3c a1 call 0x34278 ; 0x34278 23e88: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 23e8a: 0e 94 a7 6f call 0xdf4e ; 0xdf4e if ((nextSheet >= 0) && (sheetNR != nextSheet)) 23e8e: 87 fd sbrc r24, 7 23e90: 2a c0 rjmp .+84 ; 0x23ee6 23e92: 08 17 cp r16, r24 23e94: 41 f1 breq .+80 ; 0x23ee6 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 23e96: 9b e0 ldi r25, 0x0B ; 11 23e98: 09 02 muls r16, r25 23e9a: b0 01 movw r22, r0 23e9c: 11 24 eor r1, r1 23e9e: 67 5b subi r22, 0xB7 ; 183 23ea0: 72 4f sbci r23, 0xF2 ; 242 23ea2: 47 e0 ldi r20, 0x07 ; 7 23ea4: 50 e0 ldi r21, 0x00 ; 0 23ea6: 8e 01 movw r16, r28 23ea8: 0f 5f subi r16, 0xFF ; 255 23eaa: 1f 4f sbci r17, 0xFF ; 255 23eac: c8 01 movw r24, r16 23eae: 0f 94 2c a1 call 0x34258 ; 0x34258 sheet[7] = '\0'; 23eb2: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 23eb4: 1f 93 push r17 23eb6: 0f 93 push r16 23eb8: 8c ec ldi r24, 0xCC ; 204 23eba: 95 e9 ldi r25, 0x95 ; 149 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23ebc: 9f 93 push r25 23ebe: 8f 93 push r24 23ec0: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 23ec4: 0f 90 pop r0 23ec6: 0f 90 pop r0 23ec8: 0f 90 pop r0 23eca: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 23ecc: 80 91 94 12 lds r24, 0x1294 ; 0x801294 23ed0: 81 30 cpi r24, 0x01 ; 1 23ed2: 09 f0 breq .+2 ; 0x23ed6 23ed4: 5a c0 rjmp .+180 ; 0x23f8a // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 23ed6: 0f 94 28 0d call 0x21a50 ; 0x21a50 23eda: 95 e0 ldi r25, 0x05 ; 5 23edc: 98 1b sub r25, r24 23ede: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 23ee0: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 23ee4: 5f c0 rjmp .+190 ; 0x23fa4 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 23ee6: e1 10 cpse r14, r1 23ee8: 04 c0 rjmp .+8 ; 0x23ef2 23eea: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 23eee: 81 11 cpse r24, r1 23ef0: 42 c0 rjmp .+132 ; 0x23f76 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 23ef2: df 92 push r13 23ef4: cf 92 push r12 23ef6: 88 ec ldi r24, 0xC8 ; 200 23ef8: 95 e9 ldi r25, 0x95 ; 149 23efa: 9f 93 push r25 23efc: 8f 93 push r24 23efe: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 23f02: 0f 90 pop r0 23f04: 0f 90 pop r0 23f06: 0f 90 pop r0 23f08: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 23f0a: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23f0e: 85 36 cpi r24, 0x65 ; 101 23f10: d0 f1 brcs .+116 ; 0x23f86 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;}; 23f12: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 23f16: 88 23 and r24, r24 23f18: 19 f1 breq .+70 ; 0x23f60 23f1a: 80 91 77 16 lds r24, 0x1677 ; 0x801677 23f1e: 90 91 78 16 lds r25, 0x1678 ; 0x801678 23f22: a0 91 79 16 lds r26, 0x1679 ; 0x801679 23f26: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 23f2a: 00 97 sbiw r24, 0x00 ; 0 23f2c: a1 05 cpc r26, r1 23f2e: b1 05 cpc r27, r1 23f30: b9 f0 breq .+46 ; 0x23f60 23f32: bc 01 movw r22, r24 23f34: cd 01 movw r24, r26 23f36: 6d 59 subi r22, 0x9D ; 157 23f38: 7f 4f sbci r23, 0xFF ; 255 23f3a: 8f 4f sbci r24, 0xFF ; 255 23f3c: 9f 4f sbci r25, 0xFF ; 255 23f3e: 24 e6 ldi r18, 0x64 ; 100 23f40: 30 e0 ldi r19, 0x00 ; 0 23f42: 40 e0 ldi r20, 0x00 ; 0 23f44: 50 e0 ldi r21, 0x00 ; 0 23f46: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 23f4a: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 23f4e: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 23f52: 80 91 80 16 lds r24, 0x1680 ; 0x801680 23f56: 90 91 81 16 lds r25, 0x1681 ; 0x801681 23f5a: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 23f5e: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23f60: 21 2f mov r18, r17 23f62: 30 e0 ldi r19, 0x00 ; 0 23f64: 8f e9 ldi r24, 0x9F ; 159 23f66: 9a e6 ldi r25, 0x6A ; 106 23f68: f1 10 cpse r15, r1 23f6a: 02 c0 rjmp .+4 ; 0x23f70 23f6c: 89 e9 ldi r24, 0x99 ; 153 23f6e: 9a e6 ldi r25, 0x6A ; 106 23f70: 3f 93 push r19 23f72: 2f 93 push r18 23f74: a3 cf rjmp .-186 ; 0x23ebc if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 23f76: 81 e0 ldi r24, 0x01 ; 1 23f78: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 lcd_print(hostName); // Two characters 23f7c: 82 e7 ldi r24, 0x72 ; 114 23f7e: 96 e0 ldi r25, 0x06 ; 6 23f80: 0e 94 03 6c call 0xd806 ; 0xd806 23f84: c2 cf rjmp .-124 ; 0x23f0a 23f86: 18 2f mov r17, r24 23f88: eb cf rjmp .-42 ; 0x23f60 lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 23f8a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23f8e: 88 23 and r24, r24 23f90: 09 f4 brne .+2 ; 0x23f94 23f92: a5 c0 rjmp .+330 ; 0x240de } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 23f94: 81 eb ldi r24, 0xB1 ; 177 23f96: 9a e6 ldi r25, 0x6A ; 106 23f98: 9f 93 push r25 23f9a: 8f 93 push r24 23f9c: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 23fa0: 0f 90 pop r0 23fa2: 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()) { 23fa4: 0e 94 9a 61 call 0xc334 ; 0xc334 23fa8: 88 23 and r24, r24 23faa: 09 f4 brne .+2 ; 0x23fae 23fac: ac c0 rjmp .+344 ; 0x24106 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) 23fae: c0 90 74 02 lds r12, 0x0274 ; 0x800274 23fb2: 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) 23fb6: e0 90 72 02 lds r14, 0x0272 ; 0x800272 23fba: f0 90 73 02 lds r15, 0x0273 ; 0x800273 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 23fbe: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23fc2: 8a 30 cpi r24, 0x0A ; 10 23fc4: 11 f4 brne .+4 ; 0x23fca clock_interval = 0; 23fc6: 10 92 75 06 sts 0x0675, r1 ; 0x800675 clock_interval++; 23fca: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23fce: 8f 5f subi r24, 0xFF ; 255 23fd0: 80 93 75 06 sts 0x0675, r24 ; 0x800675 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 23fd4: 2f ef ldi r18, 0xFF ; 255 23fd6: e2 16 cp r14, r18 23fd8: f2 06 cpc r15, r18 23fda: 21 f0 breq .+8 ; 0x23fe4 23fdc: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 23fde: 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) { 23fe0: 86 30 cpi r24, 0x06 ; 6 23fe2: 70 f4 brcc .+28 ; 0x24000 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 23fe4: 3f ef ldi r19, 0xFF ; 255 23fe6: c3 16 cp r12, r19 23fe8: d3 06 cpc r13, r19 23fea: 09 f0 breq .+2 ; 0x23fee 23fec: 7a c0 rjmp .+244 ; 0x240e2 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 23fee: 0f 94 c4 1c call 0x23988 ; 0x23988 23ff2: 2c e3 ldi r18, 0x3C ; 60 23ff4: 30 e0 ldi r19, 0x00 ; 0 23ff6: 40 e0 ldi r20, 0x00 ; 0 23ff8: 50 e0 ldi r21, 0x00 ; 0 23ffa: 0f 94 af a1 call 0x3435e ; 0x3435e <__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 = ' '; 23ffe: 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)) { 24000: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 24004: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 24008: 44 36 cpi r20, 0x64 ; 100 2400a: 51 05 cpc r21, r1 2400c: 09 f4 brne .+2 ; 0x24010 2400e: 6c c0 rjmp .+216 ; 0x240e8 24010: c2 16 cp r12, r18 24012: d3 06 cpc r13, r19 24014: 21 f0 breq .+8 ; 0x2401e 24016: e2 16 cp r14, r18 24018: f3 06 cpc r15, r19 2401a: 09 f0 breq .+2 ; 0x2401e 2401c: 65 c0 rjmp .+202 ; 0x240e8 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); 2401e: a4 e6 ldi r26, 0x64 ; 100 24020: b0 e0 ldi r27, 0x00 ; 0 24022: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 24026: 9a 01 movw r18, r20 24028: 55 0f add r21, r21 2402a: 44 0b sbc r20, r20 2402c: 55 0b sbc r21, r21 2402e: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 24032: 4f e3 ldi r20, 0x3F ; 63 24034: e4 2e mov r14, r20 24036: 04 2e mov r0, r20 24038: 00 0c add r0, r0 2403a: ff 08 sbc r15, r15 2403c: e1 2f mov r30, r17 2403e: 01 2e mov r0, r17 24040: 00 0c add r0, r0 24042: ff 0b sbc r31, r31 24044: c9 01 movw r24, r18 24046: 6c e3 ldi r22, 0x3C ; 60 24048: 70 e0 ldi r23, 0x00 ; 0 2404a: 0f 94 05 a2 call 0x3440a ; 0x3440a <__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 2404e: 20 37 cpi r18, 0x70 ; 112 24050: 37 41 sbci r19, 0x17 ; 23 24052: 08 f0 brcs .+2 ; 0x24056 24054: 4b c0 rjmp .+150 ; 0x240ec chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 24056: ff 92 push r15 24058: 4f 93 push r20 2405a: ff 93 push r31 2405c: 1f 93 push r17 2405e: 9f 93 push r25 24060: 8f 93 push r24 24062: 7f 93 push r23 24064: 6f 93 push r22 24066: 8b ec ldi r24, 0xCB ; 203 24068: 9a e6 ldi r25, 0x6A ; 106 2406a: 9f 93 push r25 2406c: 8f 93 push r24 2406e: 0e 94 d5 69 call 0xd3aa ; 0xd3aa else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 24072: 0f b6 in r0, 0x3f ; 63 24074: f8 94 cli 24076: de bf out 0x3e, r29 ; 62 24078: 0f be out 0x3f, r0 ; 63 2407a: 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); 2407c: 98 e0 ldi r25, 0x08 ; 8 2407e: 98 1b sub r25, r24 24080: 89 2f mov r24, r25 24082: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 24086: 63 e0 ldi r22, 0x03 ; 3 24088: 80 e0 ldi r24, 0x00 ; 0 2408a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2408e: 0f 94 7f 10 call 0x220fe ; 0x220fe } SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { 24092: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 24096: 88 23 and r24, r24 24098: b1 f0 breq .+44 ; 0x240c6 farm_timer--; 2409a: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 2409e: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 240a0: d9 f1 breq .+118 ; 0x24118 SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 240a2: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> if (farm_timer < 1) { farm_timer = 10; prusa_statistics(0); } switch (farm_timer) { 240a6: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 240aa: 85 30 cpi r24, 0x05 ; 5 240ac: e1 f1 breq .+120 ; 0x24126 240ae: 88 30 cpi r24, 0x08 ; 8 240b0: 51 f4 brne .+20 ; 0x240c6 case 8: prusa_statistics(21); 240b2: 85 e1 ldi r24, 0x15 ; 21 240b4: 0f 94 5f 99 call 0x332be ; 0x332be if(eFilamentAction != FilamentAction::None) 240b8: 80 91 62 03 lds r24, 0x0362 ; 0x800362 240bc: 88 23 and r24, r24 240be: 19 f0 breq .+6 ; 0x240c6 prusa_statistics(22); 240c0: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 240c2: 0f 94 5f 99 call 0x332be ; 0x332be lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 240c6: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 240ca: 88 23 and r24, r24 240cc: 09 f4 brne .+2 ; 0x240d0 240ce: cb cd rjmp .-1130 ; 0x23c66 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) { 240d0: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 240d4: 81 11 cpse r24, r1 240d6: c7 cd rjmp .-1138 ; 0x23c66 240d8: 0e 94 a4 e6 call 0x1cd48 ; 0x1cd48 240dc: c4 cd rjmp .-1144 ; 0x23c66 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 240de: 85 e0 ldi r24, 0x05 ; 5 240e0: ff ce rjmp .-514 ; 0x23ee0 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) { 240e2: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 240e4: 12 e5 ldi r17, 0x52 ; 82 240e6: 8c cf rjmp .-232 ; 0x24000 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 = ' '; 240e8: 40 e2 ldi r20, 0x20 ; 32 240ea: a4 cf rjmp .-184 ; 0x24034 } 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); 240ec: ff 92 push r15 240ee: 4f 93 push r20 240f0: ff 93 push r31 240f2: 1f 93 push r17 240f4: 7f 93 push r23 240f6: 6f 93 push r22 240f8: 80 ec ldi r24, 0xC0 ; 192 240fa: 9a e6 ldi r25, 0x6A ; 106 240fc: 9f 93 push r25 240fe: 8f 93 push r24 24100: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 24104: b6 cf rjmp .-148 ; 0x24072 } 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 "--:-- ")); 24106: 87 eb ldi r24, 0xB7 ; 183 24108: 9a e6 ldi r25, 0x6A ; 106 2410a: 9f 93 push r25 2410c: 8f 93 push r24 2410e: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 24112: 0f 90 pop r0 24114: 0f 90 pop r0 24116: b2 cf rjmp .-156 ; 0x2407c void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 24118: 8a e0 ldi r24, 0x0A ; 10 2411a: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> prusa_statistics(0); 2411e: 80 e0 ldi r24, 0x00 ; 0 24120: 0f 94 5f 99 call 0x332be ; 0x332be 24124: c0 cf rjmp .-128 ; 0x240a6 prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 24126: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 2412a: 88 23 and r24, r24 2412c: 61 f2 breq .-104 ; 0x240c6 prusa_statistics(20); 2412e: 84 e1 ldi r24, 0x14 ; 20 24130: c8 cf rjmp .-112 ; 0x240c2 00024132 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 24132: 10 92 59 03 sts 0x0359, r1 ; 0x800359 startTimestamp = 0; 24136: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 2413a: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 2413e: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 24142: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec stopTimestamp = 0; 24146: 10 92 78 06 sts 0x0678, r1 ; 0x800678 2414a: 10 92 79 06 sts 0x0679, r1 ; 0x800679 2414e: 10 92 7a 06 sts 0x067A, r1 ; 0x80067a 24152: 10 92 7b 06 sts 0x067B, r1 ; 0x80067b accumulator = 0; 24156: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 2415a: 10 92 e6 05 sts 0x05E6, r1 ; 0x8005e6 2415e: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 24162: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 } 24166: 08 95 ret 00024168 : /** * @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; } 24168: 80 91 59 03 lds r24, 0x0359 ; 0x800359 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2416c: 81 30 cpi r24, 0x01 ; 1 2416e: f1 f0 breq .+60 ; 0x241ac if (isPaused()) accumulator = duration(); 24170: 82 30 cpi r24, 0x02 ; 2 24172: c9 f4 brne .+50 ; 0x241a6 24174: 0f 94 c4 1c call 0x23988 ; 0x23988 24178: 60 93 e5 05 sts 0x05E5, r22 ; 0x8005e5 2417c: 70 93 e6 05 sts 0x05E6, r23 ; 0x8005e6 24180: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 24184: 90 93 e8 05 sts 0x05E8, r25 ; 0x8005e8 else reset(); state = RUNNING; 24188: 81 e0 ldi r24, 0x01 ; 1 2418a: 80 93 59 03 sts 0x0359, r24 ; 0x800359 startTimestamp = _millis(); 2418e: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 24192: 60 93 e9 05 sts 0x05E9, r22 ; 0x8005e9 24196: 70 93 ea 05 sts 0x05EA, r23 ; 0x8005ea 2419a: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 2419e: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 241a2: 81 e0 ldi r24, 0x01 ; 1 241a4: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 241a6: 0f 94 99 20 call 0x24132 ; 0x24132 241aa: ee cf rjmp .-36 ; 0x24188 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 241ac: 80 e0 ldi r24, 0x00 ; 0 } 241ae: 08 95 ret 000241b0 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 241b0: 80 91 59 03 lds r24, 0x0359 ; 0x800359 241b4: 81 50 subi r24, 0x01 ; 1 241b6: 82 30 cpi r24, 0x02 ; 2 241b8: 70 f4 brcc .+28 ; 0x241d6 state = STOPPED; 241ba: 10 92 59 03 sts 0x0359, r1 ; 0x800359 stopTimestamp = _millis(); 241be: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 241c2: 60 93 78 06 sts 0x0678, r22 ; 0x800678 241c6: 70 93 79 06 sts 0x0679, r23 ; 0x800679 241ca: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 241ce: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 241d2: 81 e0 ldi r24, 0x01 ; 1 241d4: 08 95 ret return true; } else return false; 241d6: 80 e0 ldi r24, 0x00 ; 0 } 241d8: 08 95 ret 000241da : #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); 241da: 2f ef ldi r18, 0xFF ; 255 241dc: 30 e0 ldi r19, 0x00 ; 0 241de: dc 01 movw r26, r24 241e0: 0f 94 5c a2 call 0x344b8 ; 0x344b8 <__usmulhisi3> 241e4: 20 ed ldi r18, 0xD0 ; 208 241e6: 37 e0 ldi r19, 0x07 ; 7 241e8: 40 e0 ldi r20, 0x00 ; 0 241ea: 50 e0 ldi r21, 0x00 ; 0 241ec: 0f 94 2d a2 call 0x3445a ; 0x3445a <__divmodsi4> 241f0: b9 01 movw r22, r18 241f2: 8c e2 ldi r24, 0x2C ; 44 241f4: 0c 94 69 c0 jmp 0x180d2 ; 0x180d2 000241f8 : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 241f8: cf 93 push r28 241fa: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 241fc: 8a ee ldi r24, 0xEA ; 234 241fe: 91 e9 ldi r25, 0x91 ; 145 24200: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 SERIAL_PROTOCOLPGM("X: "); 24204: 86 ee ldi r24, 0xE6 ; 230 24206: 91 e9 ldi r25, 0x91 ; 145 24208: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL( READ(X_MS1_PIN)); 2420c: 62 b3 in r22, 0x12 ; 18 2420e: 66 95 lsr r22 24210: 61 70 andi r22, 0x01 ; 1 24212: 70 e0 ldi r23, 0x00 ; 0 24214: 90 e0 ldi r25, 0x00 ; 0 24216: 80 e0 ldi r24, 0x00 ; 0 24218: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 2421c: 82 b3 in r24, 0x12 ; 18 2421e: 81 70 andi r24, 0x01 ; 1 24220: 90 e0 ldi r25, 0x00 ; 0 24222: 0f 94 00 42 call 0x28400 ; 0x28400 SERIAL_PROTOCOLPGM("Y: "); 24226: 82 ee ldi r24, 0xE2 ; 226 24228: 91 e9 ldi r25, 0x91 ; 145 2422a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 2422e: c6 e0 ldi r28, 0x06 ; 6 24230: d1 e0 ldi r29, 0x01 ; 1 24232: 68 81 ld r22, Y 24234: 06 2e mov r0, r22 24236: 00 0c add r0, r0 24238: 77 0b sbc r23, r23 2423a: 88 0b sbc r24, r24 2423c: 99 0b sbc r25, r25 2423e: 66 27 eor r22, r22 24240: 97 fd sbrc r25, 7 24242: 63 95 inc r22 24244: 77 27 eor r23, r23 24246: 88 27 eor r24, r24 24248: 99 27 eor r25, r25 2424a: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 2424e: 82 b3 in r24, 0x12 ; 18 24250: 82 fb bst r24, 2 24252: 88 27 eor r24, r24 24254: 80 f9 bld r24, 0 24256: 90 e0 ldi r25, 0x00 ; 0 24258: 0f 94 00 42 call 0x28400 ; 0x28400 SERIAL_PROTOCOLPGM("Z: "); 2425c: 8e ed ldi r24, 0xDE ; 222 2425e: 91 e9 ldi r25, 0x91 ; 145 24260: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 24264: 68 81 ld r22, Y 24266: 66 fb bst r22, 6 24268: 66 27 eor r22, r22 2426a: 60 f9 bld r22, 0 2426c: 70 e0 ldi r23, 0x00 ; 0 2426e: 90 e0 ldi r25, 0x00 ; 0 24270: 80 e0 ldi r24, 0x00 ; 0 24272: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 24276: 88 81 ld r24, Y 24278: 85 fb bst r24, 5 2427a: 88 27 eor r24, r24 2427c: 80 f9 bld r24, 0 2427e: 90 e0 ldi r25, 0x00 ; 0 24280: 0f 94 00 42 call 0x28400 ; 0x28400 SERIAL_PROTOCOLPGM("E0: "); 24284: 89 ed ldi r24, 0xD9 ; 217 24286: 91 e9 ldi r25, 0x91 ; 145 24288: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 2428c: 68 81 ld r22, Y 2428e: 63 fb bst r22, 3 24290: 66 27 eor r22, r22 24292: 60 f9 bld r22, 0 24294: 70 e0 ldi r23, 0x00 ; 0 24296: 90 e0 ldi r25, 0x00 ; 0 24298: 80 e0 ldi r24, 0x00 ; 0 2429a: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 2429e: 88 81 ld r24, Y 242a0: 82 95 swap r24 242a2: 81 70 andi r24, 0x01 ; 1 242a4: 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 } 242a6: df 91 pop r29 242a8: 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)); 242aa: 0d 94 00 42 jmp 0x28400 ; 0x28400 000242ae : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 242ae: 67 fd sbrc r22, 7 242b0: 08 c0 rjmp .+16 ; 0x242c2 242b2: 81 30 cpi r24, 0x01 ; 1 242b4: 21 f1 breq .+72 ; 0x242fe 242b6: d8 f0 brcs .+54 ; 0x242ee 242b8: 82 30 cpi r24, 0x02 ; 2 242ba: 99 f1 breq .+102 ; 0x24322 242bc: 83 30 cpi r24, 0x03 ; 3 242be: 09 f4 brne .+2 ; 0x242c2 242c0: 42 c0 rjmp .+132 ; 0x24346 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) 242c2: 47 fd sbrc r20, 7 242c4: 4c c0 rjmp .+152 ; 0x2435e 242c6: 81 30 cpi r24, 0x01 ; 1 242c8: 09 f4 brne .+2 ; 0x242cc 242ca: 55 c0 rjmp .+170 ; 0x24376 242cc: 08 f4 brcc .+2 ; 0x242d0 242ce: 4d c0 rjmp .+154 ; 0x2436a 242d0: 82 30 cpi r24, 0x02 ; 2 242d2: 09 f4 brne .+2 ; 0x242d6 242d4: 56 c0 rjmp .+172 ; 0x24382 242d6: 83 30 cpi r24, 0x03 ; 3 242d8: 09 f0 breq .+2 ; 0x242dc 242da: 41 c0 rjmp .+130 ; 0x2435e { 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; 242dc: 9f b7 in r25, 0x3f ; 63 242de: 44 23 and r20, r20 242e0: 09 f4 brne .+2 ; 0x242e4 242e2: 5f c0 rjmp .+190 ; 0x243a2 242e4: f8 94 cli 242e6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242ea: 80 61 ori r24, 0x10 ; 16 242ec: 51 c0 rjmp .+162 ; 0x24390 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; 242ee: 66 23 and r22, r22 242f0: 21 f0 breq .+8 ; 0x242fa 242f2: 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) 242f4: 47 ff sbrs r20, 7 242f6: 39 c0 rjmp .+114 ; 0x2436a 242f8: 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; 242fa: a1 98 cbi 0x14, 1 ; 20 242fc: fb cf rjmp .-10 ; 0x242f4 case 1: WRITE( Y_MS1_PIN,ms1); break; 242fe: 9f b7 in r25, 0x3f ; 63 24300: 66 23 and r22, r22 24302: 51 f0 breq .+20 ; 0x24318 24304: f8 94 cli 24306: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2430a: 80 68 ori r24, 0x80 ; 128 2430c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24310: 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) 24312: 47 ff sbrs r20, 7 24314: 30 c0 rjmp .+96 ; 0x24376 24316: 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; 24318: f8 94 cli 2431a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2431e: 8f 77 andi r24, 0x7F ; 127 24320: f5 cf rjmp .-22 ; 0x2430c case 2: WRITE( Z_MS1_PIN,ms1); break; 24322: 9f b7 in r25, 0x3f ; 63 24324: 66 23 and r22, r22 24326: 51 f0 breq .+20 ; 0x2433c 24328: f8 94 cli 2432a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2432e: 80 64 ori r24, 0x40 ; 64 24330: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24334: 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) 24336: 47 ff sbrs r20, 7 24338: 24 c0 rjmp .+72 ; 0x24382 2433a: 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; 2433c: f8 94 cli 2433e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24342: 8f 7b andi r24, 0xBF ; 191 24344: f5 cf rjmp .-22 ; 0x24330 case 3: WRITE(E0_MS1_PIN,ms1); break; 24346: 9f b7 in r25, 0x3f ; 63 24348: 66 23 and r22, r22 2434a: 51 f0 breq .+20 ; 0x24360 2434c: f8 94 cli 2434e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24352: 88 60 ori r24, 0x08 ; 8 24354: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24358: 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) 2435a: 47 ff sbrs r20, 7 2435c: bf cf rjmp .-130 ; 0x242dc 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 } } 2435e: 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; 24360: f8 94 cli 24362: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24366: 87 7f andi r24, 0xF7 ; 247 24368: f5 cf rjmp .-22 ; 0x24354 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 2436a: 44 23 and r20, r20 2436c: 11 f0 breq .+4 ; 0x24372 2436e: a0 9a sbi 0x14, 0 ; 20 24370: 08 95 ret 24372: a0 98 cbi 0x14, 0 ; 20 24374: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 24376: 44 23 and r20, r20 24378: 11 f0 breq .+4 ; 0x2437e 2437a: a2 9a sbi 0x14, 2 ; 20 2437c: 08 95 ret 2437e: a2 98 cbi 0x14, 2 ; 20 24380: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 24382: 9f b7 in r25, 0x3f ; 63 24384: 44 23 and r20, r20 24386: 41 f0 breq .+16 ; 0x24398 24388: f8 94 cli 2438a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2438e: 80 62 ori r24, 0x20 ; 32 24390: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24394: 9f bf out 0x3f, r25 ; 63 24396: 08 95 ret 24398: f8 94 cli 2439a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2439e: 8f 7d andi r24, 0xDF ; 223 243a0: f7 cf rjmp .-18 ; 0x24390 case 3: WRITE(E0_MS2_PIN,ms2); break; 243a2: f8 94 cli 243a4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243a8: 8f 7e andi r24, 0xEF ; 239 243aa: f2 cf rjmp .-28 ; 0x24390 000243ac : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 243ac: 64 30 cpi r22, 0x04 ; 4 243ae: 81 f0 breq .+32 ; 0x243d0 243b0: 30 f4 brcc .+12 ; 0x243be 243b2: 61 30 cpi r22, 0x01 ; 1 243b4: 49 f0 breq .+18 ; 0x243c8 { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 243b6: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 243b8: 62 30 cpi r22, 0x02 ; 2 243ba: 69 f0 breq .+26 ; 0x243d6 243bc: 08 95 ret 243be: 68 30 cpi r22, 0x08 ; 8 243c0: 49 f0 breq .+18 ; 0x243d4 243c2: 60 31 cpi r22, 0x10 ; 16 243c4: 39 f0 breq .+14 ; 0x243d4 243c6: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 243c8: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 243ca: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 243cc: 0d 94 57 21 jmp 0x242ae ; 0x242ae { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 243d0: 41 e0 ldi r20, 0x01 ; 1 243d2: fb cf rjmp .-10 ; 0x243ca case 8: microstep_ms(driver,MICROSTEP8); break; 243d4: 41 e0 ldi r20, 0x01 ; 1 243d6: 61 e0 ldi r22, 0x01 ; 1 243d8: f9 cf rjmp .-14 ; 0x243cc 000243da : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 243da: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 243dc: 81 11 cpse r24, r1 243de: 0e c0 rjmp .+28 ; 0x243fc 243e0: 2f ef ldi r18, 0xFF ; 255 243e2: 30 e0 ldi r19, 0x00 ; 0 243e4: 0f 94 5c a2 call 0x344b8 ; 0x344b8 <__usmulhisi3> 243e8: 20 ed ldi r18, 0xD0 ; 208 243ea: 37 e0 ldi r19, 0x07 ; 7 243ec: 40 e0 ldi r20, 0x00 ; 0 243ee: 50 e0 ldi r21, 0x00 ; 0 243f0: 0f 94 2d a2 call 0x3445a ; 0x3445a <__divmodsi4> 243f4: b9 01 movw r22, r18 243f6: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 243f8: 0c 94 69 c0 jmp 0x180d2 ; 0x180d2 243fc: 81 30 cpi r24, 0x01 ; 1 243fe: 69 f4 brne .+26 ; 0x2441a 24400: 2f ef ldi r18, 0xFF ; 255 24402: 30 e0 ldi r19, 0x00 ; 0 24404: 0f 94 5c a2 call 0x344b8 ; 0x344b8 <__usmulhisi3> 24408: 20 ed ldi r18, 0xD0 ; 208 2440a: 37 e0 ldi r19, 0x07 ; 7 2440c: 40 e0 ldi r20, 0x00 ; 0 2440e: 50 e0 ldi r21, 0x00 ; 0 24410: 0f 94 2d a2 call 0x3445a ; 0x3445a <__divmodsi4> 24414: b9 01 movw r22, r18 24416: 8d e2 ldi r24, 0x2D ; 45 24418: ef cf rjmp .-34 ; 0x243f8 if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2441a: 82 30 cpi r24, 0x02 ; 2 2441c: 19 f4 brne .+6 ; 0x24424 2441e: cb 01 movw r24, r22 24420: 0d 94 ed 20 jmp 0x241da ; 0x241da } 24424: 08 95 ret 00024426 : #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); 24426: 8f ef ldi r24, 0xFF ; 255 24428: 9f e0 ldi r25, 0x0F ; 15 2442a: 0f 94 3c a1 call 0x34278 ; 0x34278 SilentModeMenu = SilentMode; 2442e: 80 93 89 03 sts 0x0389, r24 ; 0x800389 SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 24432: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24436: 98 60 ori r25, 0x08 ; 8 24438: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 2443c: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24440: 90 61 ori r25, 0x10 ; 16 24442: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 24446: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2444a: 90 62 ori r25, 0x20 ; 32 2444c: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 24450: 88 23 and r24, r24 24452: 21 f0 breq .+8 ; 0x2445c 24454: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 24458: 88 23 and r24, r24 2445a: 59 f1 breq .+86 ; 0x244b2 motor_current_setting[0] = motor_current_setting_loud[0]; 2445c: 8c e1 ldi r24, 0x1C ; 28 2445e: 92 e0 ldi r25, 0x02 ; 2 24460: 90 93 62 02 sts 0x0262, r25 ; 0x800262 24464: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_loud[1]; 24468: 8e e3 ldi r24, 0x3E ; 62 2446a: 93 e0 ldi r25, 0x03 ; 3 2446c: 90 93 64 02 sts 0x0264, r25 ; 0x800264 24470: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_loud[2]; 24474: 84 ef ldi r24, 0xF4 ; 244 24476: 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]; 24478: 90 93 66 02 sts 0x0266, r25 ; 0x800266 2447c: 80 93 65 02 sts 0x0265, r24 ; 0x800265 } st_current_set(0, motor_current_setting[0]); 24480: 60 91 61 02 lds r22, 0x0261 ; 0x800261 24484: 70 91 62 02 lds r23, 0x0262 ; 0x800262 24488: 80 e0 ldi r24, 0x00 ; 0 2448a: 0f 94 ed 21 call 0x243da ; 0x243da st_current_set(1, motor_current_setting[1]); 2448e: 6e e3 ldi r22, 0x3E ; 62 24490: 73 e0 ldi r23, 0x03 ; 3 24492: 81 e0 ldi r24, 0x01 ; 1 24494: 0f 94 ed 21 call 0x243da ; 0x243da 24498: 80 91 65 02 lds r24, 0x0265 ; 0x800265 2449c: 90 91 66 02 lds r25, 0x0266 ; 0x800266 244a0: 0f 94 ed 20 call 0x241da ; 0x241da 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); 244a4: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 244a8: 88 7f andi r24, 0xF8 ; 248 244aa: 81 60 ori r24, 0x01 ; 1 244ac: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 244b0: 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]; 244b2: 8e e0 ldi r24, 0x0E ; 14 244b4: 91 e0 ldi r25, 0x01 ; 1 244b6: 90 93 62 02 sts 0x0262, r25 ; 0x800262 244ba: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_silent[1]; 244be: 8e e3 ldi r24, 0x3E ; 62 244c0: 93 e0 ldi r25, 0x03 ; 3 244c2: 90 93 64 02 sts 0x0264, r25 ; 0x800264 244c6: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_silent[2]; 244ca: 82 ec ldi r24, 0xC2 ; 194 244cc: 91 e0 ldi r25, 0x01 ; 1 244ce: d4 cf rjmp .-88 ; 0x24478 000244d0 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 244d0: 80 91 89 03 lds r24, 0x0389 ; 0x800389 244d4: 88 23 and r24, r24 244d6: 21 f0 breq .+8 ; 0x244e0 244d8: 81 30 cpi r24, 0x01 ; 1 244da: 69 f4 brne .+26 ; 0x244f6 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; 244dc: 82 e0 ldi r24, 0x02 ; 2 244de: 01 c0 rjmp .+2 ; 0x244e2 #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; 244e0: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 244e2: 80 93 89 03 sts 0x0389, r24 ; 0x800389 244e6: 60 91 89 03 lds r22, 0x0389 ; 0x800389 244ea: 8f ef ldi r24, 0xFF ; 255 244ec: 9f e0 ldi r25, 0x0F ; 15 244ee: 0f 94 60 a1 call 0x342c0 ; 0x342c0 // 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(); 244f2: 0d 94 13 22 jmp 0x24426 ; 0x24426 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; 244f6: 10 92 89 03 sts 0x0389, r1 ; 0x800389 244fa: f5 cf rjmp .-22 ; 0x244e6 000244fc : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 244fc: 2f b7 in r18, 0x3f ; 63 244fe: f8 94 cli count_pos = count_position[axis]; 24500: 94 e0 ldi r25, 0x04 ; 4 24502: 89 9f mul r24, r25 24504: f0 01 movw r30, r0 24506: 11 24 eor r1, r1 24508: ea 54 subi r30, 0x4A ; 74 2450a: f9 4f sbci r31, 0xF9 ; 249 2450c: 60 81 ld r22, Z 2450e: 71 81 ldd r23, Z+1 ; 0x01 24510: 82 81 ldd r24, Z+2 ; 0x02 24512: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 24514: 2f bf out 0x3f, r18 ; 63 return count_pos; } 24516: 08 95 ret 00024518 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 24518: cf 93 push r28 2451a: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2451c: 0f 94 7e 22 call 0x244fc ; 0x244fc 24520: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 24524: 24 e0 ldi r18, 0x04 ; 4 24526: c2 9f mul r28, r18 24528: f0 01 movw r30, r0 2452a: 11 24 eor r1, r1 2452c: ea 5c subi r30, 0xCA ; 202 2452e: fb 4f sbci r31, 0xFB ; 251 24530: 20 81 ld r18, Z 24532: 31 81 ldd r19, Z+1 ; 0x01 24534: 42 81 ldd r20, Z+2 ; 0x02 24536: 53 81 ldd r21, Z+3 ; 0x03 24538: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> } 2453c: cf 91 pop r28 2453e: 08 95 ret 00024540 : 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); 24540: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 24544: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 24548: 98 17 cp r25, r24 2454a: 29 f0 breq .+10 ; 0x24556 manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 2454c: 90 e0 ldi r25, 0x00 ; 0 2454e: 80 e0 ldi r24, 0x00 ; 0 24550: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 24554: f5 cf rjmp .-22 ; 0x24540 #endif //TMC2130 } } 24556: 08 95 ret 00024558 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 24558: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2455a: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2455e: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 24562: 80 ed ldi r24, 0xD0 ; 208 24564: 97 e0 ldi r25, 0x07 ; 7 24566: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2456a: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2456e: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24572: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 24576: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 2457a: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2457e: 01 97 sbiw r24, 0x01 ; 1 24580: 8e 3f cpi r24, 0xFE ; 254 24582: 9f 4f sbci r25, 0xFF ; 255 24584: 20 f4 brcc .+8 ; 0x2458e nextAdvanceISR = 0; 24586: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2458a: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> #endif } 2458e: 08 95 ret 00024590 <__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) { 24590: 1f 92 push r1 24592: 0f 92 push r0 24594: 0f b6 in r0, 0x3f ; 63 24596: 0f 92 push r0 24598: 11 24 eor r1, r1 2459a: 0b b6 in r0, 0x3b ; 59 2459c: 0f 92 push r0 2459e: 4f 92 push r4 245a0: 5f 92 push r5 245a2: 6f 92 push r6 245a4: 7f 92 push r7 245a6: 8f 92 push r8 245a8: cf 92 push r12 245aa: df 92 push r13 245ac: ef 92 push r14 245ae: ff 92 push r15 245b0: 1f 93 push r17 245b2: 2f 93 push r18 245b4: 3f 93 push r19 245b6: 4f 93 push r20 245b8: 5f 93 push r21 245ba: 6f 93 push r22 245bc: 7f 93 push r23 245be: 8f 93 push r24 245c0: 9f 93 push r25 245c2: af 93 push r26 245c4: bf 93 push r27 245c6: cf 93 push r28 245c8: df 93 push r29 245ca: ef 93 push r30 245cc: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 245ce: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 245d2: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 245d6: 9c 01 movw r18, r24 245d8: 21 50 subi r18, 0x01 ; 1 245da: 31 09 sbc r19, r1 245dc: 2e 3f cpi r18, 0xFE ; 254 245de: 3f 4f sbci r19, 0xFF ; 255 245e0: 90 f4 brcc .+36 ; 0x24606 <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 245e2: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 245e6: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245ea: 28 17 cp r18, r24 245ec: 39 07 cpc r19, r25 245ee: 08 f0 brcs .+2 ; 0x245f2 <__vector_17+0x62> 245f0: f9 c0 rjmp .+498 ; 0x247e4 <__vector_17+0x254> nextAdvanceISR -= OCR1A; 245f2: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 245f6: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245fa: 82 1b sub r24, r18 245fc: 93 0b sbc r25, r19 245fe: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24602: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 24606: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2460a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2460e: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 24612: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24616: 28 17 cp r18, r24 24618: 39 07 cpc r19, r25 2461a: 08 f0 brcs .+2 ; 0x2461e <__vector_17+0x8e> 2461c: e8 c0 rjmp .+464 ; 0x247ee <__vector_17+0x25e> nextMainISR -= OCR1A; 2461e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24622: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24626: 82 1b sub r24, r18 24628: 93 0b sbc r25, r19 2462a: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 2462e: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 24632: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 24636: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 2463a: 89 2b or r24, r25 2463c: 11 f0 breq .+4 ; 0x24642 <__vector_17+0xb2> 2463e: 0d 94 b3 2b jmp 0x25766 ; 0x25766 <__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) 24642: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24646: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 2464a: 30 97 sbiw r30, 0x00 ; 0 2464c: 09 f0 breq .+2 ; 0x24650 <__vector_17+0xc0> 2464e: 82 c1 rjmp .+772 ; 0x24954 <__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) { 24650: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 24654: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 24658: 98 17 cp r25, r24 2465a: 09 f4 brne .+2 ; 0x2465e <__vector_17+0xce> 2465c: 35 c3 rjmp .+1642 ; 0x24cc8 <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2465e: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 24662: 2c 2f mov r18, r28 24664: 30 e0 ldi r19, 0x00 ; 0 24666: 5e e6 ldi r21, 0x6E ; 110 24668: c5 9f mul r28, r21 2466a: e0 01 movw r28, r0 2466c: 11 24 eor r1, r1 2466e: c8 53 subi r28, 0x38 ; 56 24670: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 24672: fe 01 movw r30, r28 24674: e9 5b subi r30, 0xB9 ; 185 24676: ff 4f sbci r31, 0xFF ; 255 24678: 41 e0 ldi r20, 0x01 ; 1 2467a: 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(); 2467c: d0 93 e5 11 sts 0x11E5, r29 ; 0x8011e5 24680: c0 93 e4 11 sts 0x11E4, r28 ; 0x8011e4 if (current_block != NULL) { 24684: 20 97 sbiw r28, 0x00 ; 0 24686: 09 f4 brne .+2 ; 0x2468a <__vector_17+0xfa> 24688: 1f c3 rjmp .+1598 ; 0x24cc8 <__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; 2468a: 10 92 e1 05 sts 0x05E1, r1 ; 0x8005e1 2468e: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 24692: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 24696: 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; 2469a: 10 92 e0 05 sts 0x05E0, r1 ; 0x8005e0 acc_step_rate = uint16_t(current_block->initial_rate); 2469e: 8a ad ldd r24, Y+58 ; 0x3a 246a0: 9b ad ldd r25, Y+59 ; 0x3b 246a2: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 246a6: 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; 246aa: 81 34 cpi r24, 0x41 ; 65 246ac: ac e9 ldi r26, 0x9C ; 156 246ae: 9a 07 cpc r25, r26 246b0: 08 f0 brcs .+2 ; 0x246b4 <__vector_17+0x124> 246b2: a2 c0 rjmp .+324 ; 0x247f8 <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 246b4: 81 32 cpi r24, 0x21 ; 33 246b6: be e4 ldi r27, 0x4E ; 78 246b8: 9b 07 cpc r25, r27 246ba: 08 f4 brcc .+2 ; 0x246be <__vector_17+0x12e> 246bc: a0 c0 rjmp .+320 ; 0x247fe <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 246be: 96 95 lsr r25 246c0: 87 95 ror r24 246c2: 96 95 lsr r25 246c4: 87 95 ror r24 step_loops = 4; 246c6: 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; 246c8: 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 246cc: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 246ce: 81 15 cp r24, r1 246d0: f8 e0 ldi r31, 0x08 ; 8 246d2: 9f 07 cpc r25, r31 246d4: 08 f4 brcc .+2 ; 0x246d8 <__vector_17+0x148> 246d6: a4 c0 rjmp .+328 ; 0x24820 <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 246d8: e9 2f mov r30, r25 246da: ff 27 eor r31, r31 246dc: ee 0f add r30, r30 246de: ff 1f adc r31, r31 246e0: ee 0f add r30, r30 246e2: ff 1f adc r31, r31 246e4: af 01 movw r20, r30 246e6: 47 52 subi r20, 0x27 ; 39 246e8: 52 47 sbci r21, 0x72 ; 114 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 246ea: fa 01 movw r30, r20 246ec: 32 96 adiw r30, 0x02 ; 2 246ee: a5 91 lpm r26, Z+ 246f0: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 246f2: fa 01 movw r30, r20 246f4: 45 91 lpm r20, Z+ 246f6: 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. ); 246f8: b8 9f mul r27, r24 246fa: b0 01 movw r22, r0 246fc: a8 9f mul r26, r24 246fe: 00 0c add r0, r0 24700: 61 1d adc r22, r1 24702: 11 24 eor r1, r1 24704: 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); 24706: 46 1b sub r20, r22 24708: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2470a: ca 01 movw r24, r20 2470c: 44 36 cpi r20, 0x64 ; 100 2470e: 51 05 cpc r21, r1 24710: 10 f4 brcc .+4 ; 0x24716 <__vector_17+0x186> 24712: 84 e6 ldi r24, 0x64 ; 100 24714: 90 e0 ldi r25, 0x00 ; 0 24716: b0 e0 ldi r27, 0x00 ; 0 24718: a0 e0 ldi r26, 0x00 ; 0 2471a: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 2471e: 90 93 da 05 sts 0x05DA, r25 ; 0x8005da 24722: a0 93 db 05 sts 0x05DB, r26 ; 0x8005db 24726: b0 93 dc 05 sts 0x05DC, r27 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2472a: 4e e6 ldi r20, 0x6E ; 110 2472c: 42 9f mul r20, r18 2472e: c0 01 movw r24, r0 24730: 43 9f mul r20, r19 24732: 90 0d add r25, r0 24734: 11 24 eor r1, r1 24736: 88 53 subi r24, 0x38 ; 56 24738: 99 4f sbci r25, 0xF9 ; 249 2473a: fc 01 movw r30, r24 2473c: e4 5b subi r30, 0xB4 ; 180 2473e: ff 4f sbci r31, 0xFF ; 255 24740: 40 81 ld r20, Z 24742: 44 23 and r20, r20 24744: 49 f0 breq .+18 ; 0x24758 <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 24746: 81 5b subi r24, 0xB1 ; 177 24748: 9f 4f sbci r25, 0xFF ; 255 2474a: dc 01 movw r26, r24 2474c: 8d 91 ld r24, X+ 2474e: 9c 91 ld r25, X 24750: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 24754: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 } e_steps = 0; 24758: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 nextAdvanceISR = ADV_NEVER; 2475c: 8f ef ldi r24, 0xFF ; 255 2475e: 9f ef ldi r25, 0xFF ; 255 24760: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24764: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> LA_phase = -1; 24768: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2476c: 8e e6 ldi r24, 0x6E ; 110 2476e: 82 9f mul r24, r18 24770: f0 01 movw r30, r0 24772: 83 9f mul r24, r19 24774: f0 0d add r31, r0 24776: 11 24 eor r1, r1 24778: e8 53 subi r30, 0x38 ; 56 2477a: f9 4f sbci r31, 0xF9 ; 249 2477c: 85 a9 ldd r24, Z+53 ; 0x35 2477e: 84 ff sbrs r24, 4 24780: 08 c0 rjmp .+16 ; 0x24792 <__vector_17+0x202> count_position[E_AXIS] = 0; 24782: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 24786: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 2478a: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 2478e: 10 92 c5 06 sts 0x06C5, r1 ; 0x8006c5 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 24792: 83 ff sbrs r24, 3 24794: 61 c0 rjmp .+194 ; 0x24858 <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 24796: 8e e6 ldi r24, 0x6E ; 110 24798: 82 9f mul r24, r18 2479a: f0 01 movw r30, r0 2479c: 83 9f mul r24, r19 2479e: f0 0d add r31, r0 247a0: 11 24 eor r1, r1 247a2: e8 53 subi r30, 0x38 ; 56 247a4: f9 4f sbci r31, 0xF9 ; 249 247a6: 80 89 ldd r24, Z+16 ; 0x10 247a8: 91 89 ldd r25, Z+17 ; 0x11 247aa: 96 95 lsr r25 247ac: 87 95 ror r24 247ae: 91 95 neg r25 247b0: 81 95 neg r24 247b2: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 247b4: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 247b8: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 247bc: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 247c0: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 247c4: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 247c8: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 247cc: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 247d0: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 247d4: 81 e0 ldi r24, 0x01 ; 1 247d6: 24 85 ldd r18, Z+12 ; 0x0c 247d8: 35 85 ldd r19, Z+13 ; 0x0d 247da: 23 2b or r18, r19 247dc: 09 f0 breq .+2 ; 0x247e0 <__vector_17+0x250> 247de: 7d c0 rjmp .+250 ; 0x248da <__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; 247e0: 80 e0 ldi r24, 0x00 ; 0 247e2: 7b c0 rjmp .+246 ; 0x248da <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 247e4: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 247e8: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 247ec: 0c cf rjmp .-488 ; 0x24606 <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 247ee: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 247f2: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 247f6: 1d cf rjmp .-454 ; 0x24632 <__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; 247f8: 80 e4 ldi r24, 0x40 ; 64 247fa: 9c e9 ldi r25, 0x9C ; 156 247fc: 60 cf rjmp .-320 ; 0x246be <__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 247fe: 81 31 cpi r24, 0x11 ; 17 24800: e7 e2 ldi r30, 0x27 ; 39 24802: 9e 07 cpc r25, r30 24804: 20 f0 brcs .+8 ; 0x2480e <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 24806: 96 95 lsr r25 24808: 87 95 ror r24 step_loops = 2; 2480a: 42 e0 ldi r20, 0x02 ; 2 2480c: 5d cf rjmp .-326 ; 0x246c8 <__vector_17+0x138> } else { step_loops = 1; 2480e: 40 93 dd 05 sts 0x05DD, r20 ; 0x8005dd 24812: 80 32 cpi r24, 0x20 ; 32 24814: 91 05 cpc r25, r1 24816: 08 f0 brcs .+2 ; 0x2481a <__vector_17+0x28a> 24818: 59 cf rjmp .-334 ; 0x246cc <__vector_17+0x13c> 2481a: 80 e2 ldi r24, 0x20 ; 32 2481c: 90 e0 ldi r25, 0x00 ; 0 2481e: 56 cf rjmp .-340 ; 0x246cc <__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; 24820: bc 01 movw r22, r24 24822: 76 95 lsr r23 24824: 67 95 ror r22 24826: 6c 7f andi r22, 0xFC ; 252 24828: 67 52 subi r22, 0x27 ; 39 2482a: 76 47 sbci r23, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 2482c: fb 01 movw r30, r22 2482e: 45 91 lpm r20, Z+ 24830: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 24832: fb 01 movw r30, r22 24834: 32 96 adiw r30, 0x02 ; 2 24836: a5 91 lpm r26, Z+ 24838: b4 91 lpm r27, Z 2483a: 87 70 andi r24, 0x07 ; 7 2483c: 99 27 eor r25, r25 2483e: 8a 9f mul r24, r26 24840: b0 01 movw r22, r0 24842: 8b 9f mul r24, r27 24844: 70 0d add r23, r0 24846: 9a 9f mul r25, r26 24848: 70 0d add r23, r0 2484a: 11 24 eor r1, r1 2484c: e3 e0 ldi r30, 0x03 ; 3 2484e: 76 95 lsr r23 24850: 67 95 ror r22 24852: ea 95 dec r30 24854: e1 f7 brne .-8 ; 0x2484e <__vector_17+0x2be> 24856: 57 cf rjmp .-338 ; 0x24706 <__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); 24858: 8e e6 ldi r24, 0x6E ; 110 2485a: 82 9f mul r24, r18 2485c: f0 01 movw r30, r0 2485e: 83 9f mul r24, r19 24860: f0 0d add r31, r0 24862: 11 24 eor r1, r1 24864: e8 53 subi r30, 0x38 ; 56 24866: f9 4f sbci r31, 0xF9 ; 249 24868: 80 89 ldd r24, Z+16 ; 0x10 2486a: 91 89 ldd r25, Z+17 ; 0x11 2486c: a2 89 ldd r26, Z+18 ; 0x12 2486e: b3 89 ldd r27, Z+19 ; 0x13 24870: b6 95 lsr r27 24872: a7 95 ror r26 24874: 97 95 ror r25 24876: 87 95 ror r24 24878: b0 95 com r27 2487a: a0 95 com r26 2487c: 90 95 com r25 2487e: 81 95 neg r24 24880: 9f 4f sbci r25, 0xFF ; 255 24882: af 4f sbci r26, 0xFF ; 255 24884: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 24886: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 2488a: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 2488e: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24892: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 24896: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 2489a: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 2489e: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 248a2: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc 248a6: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 248aa: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 248ae: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 248b2: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 248b6: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 248ba: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 248be: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 248c2: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 248c6: 81 e0 ldi r24, 0x01 ; 1 248c8: 44 85 ldd r20, Z+12 ; 0x0c 248ca: 55 85 ldd r21, Z+13 ; 0x0d 248cc: 66 85 ldd r22, Z+14 ; 0x0e 248ce: 77 85 ldd r23, Z+15 ; 0x0f 248d0: 45 2b or r20, r21 248d2: 46 2b or r20, r22 248d4: 47 2b or r20, r23 248d6: 09 f4 brne .+2 ; 0x248da <__vector_17+0x34a> 248d8: 83 cf rjmp .-250 ; 0x247e0 <__vector_17+0x250> 248da: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 #endif } step_events_completed.wide = 0; 248de: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 248e2: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 248e6: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 248ea: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 // Set directions. out_bits = current_block->direction_bits; 248ee: 88 8d ldd r24, Y+24 ; 0x18 248f0: 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); 248f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 248fc: 8d 7f andi r24, 0xFD ; 253 248fe: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 24902: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 24904: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if((out_bits & (1< 2490c: 81 ff sbrs r24, 1 2490e: cc c1 rjmp .+920 ; 0x24ca8 <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 24910: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24914: 8e 7f andi r24, 0xFE ; 254 24916: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2491a: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2491c: 80 93 5e 02 sts 0x025E, r24 ; 0x80025e } if ((out_bits & (1< 24924: 82 ff sbrs r24, 2 24926: c7 c1 rjmp .+910 ; 0x24cb6 <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 24928: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2492c: 8b 7f andi r24, 0xFB ; 251 2492e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 24932: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 24934: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 24938: 80 91 bf 05 lds r24, 0x05BF ; 0x8005bf 2493c: 83 ff sbrs r24, 3 2493e: c2 c1 rjmp .+900 ; 0x24cc4 <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 24940: 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; 24942: 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) 24946: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2494a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 2494e: 30 97 sbiw r30, 0x00 ; 0 24950: 09 f4 brne .+2 ; 0x24954 <__vector_17+0x3c4> 24952: 09 c7 rjmp .+3602 ; 0x25766 <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 24954: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 24958: 50 91 bc 05 lds r21, 0x05BC ; 0x8005bc 2495c: 88 23 and r24, r24 2495e: 09 f4 brne .+2 ; 0x24962 <__vector_17+0x3d2> 24960: 6c c0 rjmp .+216 ; 0x24a3a <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 24962: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> uint8_t _endstop = endstop; 24966: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 2496a: 90 91 bd 05 lds r25, 0x05BD ; 0x8005bd #ifndef COREXY if ((out_bits & (1< 24972: 30 ff sbrs r19, 0 24974: 1d c0 rjmp .+58 ; 0x249b0 <__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)); 24976: 1e 9b sbis 0x03, 6 ; 3 24978: c6 c1 rjmp .+908 ; 0x24d06 <__vector_17+0x776> 2497a: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 2497c: 49 2f mov r20, r25 2497e: 41 70 andi r20, 0x01 ; 1 24980: 48 23 and r20, r24 24982: b1 f0 breq .+44 ; 0x249b0 <__vector_17+0x420> 24984: c0 80 ld r12, Z 24986: d1 80 ldd r13, Z+1 ; 0x01 24988: e2 80 ldd r14, Z+2 ; 0x02 2498a: f3 80 ldd r15, Z+3 ; 0x03 2498c: 1c 14 cp r1, r12 2498e: 1d 04 cpc r1, r13 24990: 1e 04 cpc r1, r14 24992: 1f 04 cpc r1, r15 24994: 6c f4 brge .+26 ; 0x249b0 <__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); 24996: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 24998: c0 88 ldd r12, Z+16 ; 0x10 2499a: d1 88 ldd r13, Z+17 ; 0x11 2499c: e2 88 ldd r14, Z+18 ; 0x12 2499e: f3 88 ldd r15, Z+19 ; 0x13 249a0: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 249a4: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 249a8: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 249ac: 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)); 249b4: 1d 9b sbis 0x03, 5 ; 3 249b6: a9 c1 rjmp .+850 ; 0x24d0a <__vector_17+0x77a> 249b8: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 249ba: 49 2f mov r20, r25 249bc: 42 70 andi r20, 0x02 ; 2 249be: 48 23 and r20, r24 249c0: b1 f0 breq .+44 ; 0x249ee <__vector_17+0x45e> 249c2: c4 80 ldd r12, Z+4 ; 0x04 249c4: d5 80 ldd r13, Z+5 ; 0x05 249c6: e6 80 ldd r14, Z+6 ; 0x06 249c8: f7 80 ldd r15, Z+7 ; 0x07 249ca: 1c 14 cp r1, r12 249cc: 1d 04 cpc r1, r13 249ce: 1e 04 cpc r1, r14 249d0: 1f 04 cpc r1, r15 249d2: 6c f4 brge .+26 ; 0x249ee <__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); 249d4: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 249d6: c0 88 ldd r12, Z+16 ; 0x10 249d8: d1 88 ldd r13, Z+17 ; 0x11 249da: e2 88 ldd r14, Z+18 ; 0x12 249dc: f3 88 ldd r15, Z+19 ; 0x13 249de: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 249e2: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 249e6: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 249ea: 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) { 249f2: 51 11 cpse r21, r1 249f4: 1c c0 rjmp .+56 ; 0x24a2e <__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)); 249f6: 1c 9b sbis 0x03, 4 ; 3 249f8: 8a c1 rjmp .+788 ; 0x24d0e <__vector_17+0x77e> 249fa: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 249fc: 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)) { 249fe: 98 23 and r25, r24 24a00: b1 f0 breq .+44 ; 0x24a2e <__vector_17+0x49e> 24a02: c0 84 ldd r12, Z+8 ; 0x08 24a04: d1 84 ldd r13, Z+9 ; 0x09 24a06: e2 84 ldd r14, Z+10 ; 0x0a 24a08: f3 84 ldd r15, Z+11 ; 0x0b 24a0a: 1c 14 cp r1, r12 24a0c: 1d 04 cpc r1, r13 24a0e: 1e 04 cpc r1, r14 24a10: 1f 04 cpc r1, r15 24a12: 6c f4 brge .+26 ; 0x24a2e <__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); 24a14: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 24a16: c0 88 ldd r12, Z+16 ; 0x10 24a18: d1 88 ldd r13, Z+17 ; 0x11 24a1a: e2 88 ldd r14, Z+18 ; 0x12 24a1c: f3 88 ldd r15, Z+19 ; 0x13 24a1e: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24a22: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 24a26: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24a2a: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 } #endif } endstop = _endstop; 24a2e: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 24a32: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 24a36: 20 93 2c 04 sts 0x042C, r18 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> } // 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) { 24a3a: 55 23 and r21, r21 24a3c: f9 f0 breq .+62 ; 0x24a7c <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 24a3e: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> uint8_t _endstop = endstop; 24a42: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 24a46: 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)); 24a4a: 1c 9b sbis 0x03, 4 ; 3 24a4c: 69 c1 rjmp .+722 ; 0x24d20 <__vector_17+0x790> 24a4e: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 24a50: 94 70 andi r25, 0x04 ; 4 24a52: 98 23 and r25, r24 24a54: 69 f0 breq .+26 ; 0x24a70 <__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); 24a56: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 24a58: 40 89 ldd r20, Z+16 ; 0x10 24a5a: 51 89 ldd r21, Z+17 ; 0x11 24a5c: 62 89 ldd r22, Z+18 ; 0x12 24a5e: 73 89 ldd r23, Z+19 ; 0x13 24a60: 40 93 c0 05 sts 0x05C0, r20 ; 0x8005c0 24a64: 50 93 c1 05 sts 0x05C1, r21 ; 0x8005c1 24a68: 60 93 c2 05 sts 0x05C2, r22 ; 0x8005c2 24a6c: 70 93 c3 05 sts 0x05C3, r23 ; 0x8005c3 } endstop = _endstop; 24a70: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 24a74: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 24a78: 20 93 2c 04 sts 0x042C, r18 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 24a7c: 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) 24a7e: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 24a80: 83 ff sbrs r24, 3 24a82: 50 c1 rjmp .+672 ; 0x24d24 <__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) 24a84: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24a88: c8 17 cp r28, r24 24a8a: 08 f0 brcs .+2 ; 0x24a8e <__vector_17+0x4fe> 24a8c: bd c2 rjmp .+1402 ; 0x25008 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24a8e: 0e 94 c1 fb call 0x1f782 ; 0x1f782 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 24a92: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a96: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a9a: 80 81 ld r24, Z 24a9c: 91 81 ldd r25, Z+1 ; 0x01 24a9e: 20 91 c5 05 lds r18, 0x05C5 ; 0x8005c5 24aa2: 30 91 c6 05 lds r19, 0x05C6 ; 0x8005c6 24aa6: 82 0f add r24, r18 24aa8: 93 1f adc r25, r19 24aaa: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24aae: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 if (counter[X_AXIS].lo > 0) { 24ab2: 18 16 cp r1, r24 24ab4: 19 06 cpc r1, r25 24ab6: 6c f5 brge .+90 ; 0x24b12 <__vector_17+0x582> STEP_NC_HI(X_AXIS); 24ab8: 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; 24aba: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24abe: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24ac2: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24ac6: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24aca: 20 89 ldd r18, Z+16 ; 0x10 24acc: 31 89 ldd r19, Z+17 ; 0x11 24ace: 82 1b sub r24, r18 24ad0: 93 0b sbc r25, r19 24ad2: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24ad6: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 count_position[X_AXIS]+=count_direction[X_AXIS]; 24ada: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24ade: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24ae2: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24ae6: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24aea: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24aee: 89 2f mov r24, r25 24af0: 99 0f add r25, r25 24af2: 99 0b sbc r25, r25 24af4: aa 0b sbc r26, r26 24af6: bb 0b sbc r27, r27 24af8: 84 0f add r24, r20 24afa: 95 1f adc r25, r21 24afc: a6 1f adc r26, r22 24afe: b7 1f adc r27, r23 24b00: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24b04: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24b08: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24b0c: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24b10: 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; 24b12: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b16: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b1a: 84 81 ldd r24, Z+4 ; 0x04 24b1c: 95 81 ldd r25, Z+5 ; 0x05 24b1e: 20 91 c9 05 lds r18, 0x05C9 ; 0x8005c9 24b22: 30 91 ca 05 lds r19, 0x05CA ; 0x8005ca 24b26: 82 0f add r24, r18 24b28: 93 1f adc r25, r19 24b2a: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24b2e: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 if (counter[Y_AXIS].lo > 0) { 24b32: 18 16 cp r1, r24 24b34: 19 06 cpc r1, r25 24b36: 4c f5 brge .+82 ; 0x24b8a <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 24b38: 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; 24b3a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b3e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b42: 20 89 ldd r18, Z+16 ; 0x10 24b44: 31 89 ldd r19, Z+17 ; 0x11 24b46: 82 1b sub r24, r18 24b48: 93 0b sbc r25, r19 24b4a: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24b4e: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24b52: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24b56: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24b5a: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24b5e: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24b62: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24b66: 89 2f mov r24, r25 24b68: 99 0f add r25, r25 24b6a: 99 0b sbc r25, r25 24b6c: aa 0b sbc r26, r26 24b6e: bb 0b sbc r27, r27 24b70: 84 0f add r24, r20 24b72: 95 1f adc r25, r21 24b74: a6 1f adc r26, r22 24b76: b7 1f adc r27, r23 24b78: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24b7c: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24b80: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24b84: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24b88: 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; 24b8a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b8e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b92: 80 85 ldd r24, Z+8 ; 0x08 24b94: 91 85 ldd r25, Z+9 ; 0x09 24b96: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 24b9a: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 24b9e: 82 0f add r24, r18 24ba0: 93 1f adc r25, r19 24ba2: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24ba6: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd if (counter[Z_AXIS].lo > 0) { 24baa: 18 16 cp r1, r24 24bac: 19 06 cpc r1, r25 24bae: 4c f5 brge .+82 ; 0x24c02 <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 24bb0: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 24bb2: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24bb6: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24bba: 20 89 ldd r18, Z+16 ; 0x10 24bbc: 31 89 ldd r19, Z+17 ; 0x11 24bbe: 82 1b sub r24, r18 24bc0: 93 0b sbc r25, r19 24bc2: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24bc6: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24bca: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24bce: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24bd2: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24bd6: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24bda: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24bde: 89 2f mov r24, r25 24be0: 99 0f add r25, r25 24be2: 99 0b sbc r25, r25 24be4: aa 0b sbc r26, r26 24be6: bb 0b sbc r27, r27 24be8: 84 0f add r24, r20 24bea: 95 1f adc r25, r21 24bec: a6 1f adc r26, r22 24bee: b7 1f adc r27, r23 24bf0: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24bf4: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24bf8: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24bfc: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24c00: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 24c02: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c06: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c0a: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24c0e: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24c12: 24 85 ldd r18, Z+12 ; 0x0c 24c14: 35 85 ldd r19, Z+13 ; 0x0d 24c16: 82 0f add r24, r18 24c18: 93 1f adc r25, r19 24c1a: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24c1e: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24c22: 20 89 ldd r18, Z+16 ; 0x10 24c24: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 24c26: 18 16 cp r1, r24 24c28: 19 06 cpc r1, r25 24c2a: 44 f5 brge .+80 ; 0x24c7c <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 24c2c: 82 1b sub r24, r18 24c2e: 93 0b sbc r25, r19 24c30: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24c34: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 count_position[E_AXIS] += count_direction[E_AXIS]; 24c38: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24c3c: 40 91 c2 06 lds r20, 0x06C2 ; 0x8006c2 24c40: 50 91 c3 06 lds r21, 0x06C3 ; 0x8006c3 24c44: 60 91 c4 06 lds r22, 0x06C4 ; 0x8006c4 24c48: 70 91 c5 06 lds r23, 0x06C5 ; 0x8006c5 24c4c: 89 2f mov r24, r25 24c4e: 99 0f add r25, r25 24c50: 99 0b sbc r25, r25 24c52: aa 0b sbc r26, r26 24c54: bb 0b sbc r27, r27 24c56: 84 0f add r24, r20 24c58: 95 1f adc r25, r21 24c5a: a6 1f adc r26, r22 24c5c: b7 1f adc r27, r23 24c5e: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24c62: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24c66: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24c6a: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24c6e: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24c72: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24c76: 89 0f add r24, r25 24c78: 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) 24c7c: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24c80: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24c84: 01 96 adiw r24, 0x01 ; 1 24c86: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24c8a: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24c8e: 82 17 cp r24, r18 24c90: 93 07 cpc r25, r19 24c92: 08 f0 brcs .+2 ; 0x24c96 <__vector_17+0x706> 24c94: b9 c1 rjmp .+882 ; 0x25008 <__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) 24c96: cf 5f subi r28, 0xFF ; 255 24c98: f5 ce rjmp .-534 ; 0x24a84 <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 24c9e: 82 60 ori r24, 0x02 ; 2 24ca0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 24ca4: 81 e0 ldi r24, 0x01 ; 1 24ca6: 2e ce rjmp .-932 ; 0x24904 <__vector_17+0x374> } if((out_bits & (1< 24cac: 81 60 ori r24, 0x01 ; 1 24cae: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 24cb2: 81 e0 ldi r24, 0x01 ; 1 24cb4: 33 ce rjmp .-922 ; 0x2491c <__vector_17+0x38c> } if ((out_bits & (1< 24cba: 84 60 ori r24, 0x04 ; 4 24cbc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 24cc0: 81 e0 ldi r24, 0x01 ; 1 24cc2: 38 ce rjmp .-912 ; 0x24934 <__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; 24cc4: 81 e0 ldi r24, 0x01 ; 1 24cc6: 3d ce rjmp .-902 ; 0x24942 <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 24cc8: 80 ed ldi r24, 0xD0 ; 208 24cca: 97 e0 ldi r25, 0x07 ; 7 24ccc: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24cd0: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 24cd4: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 24cd8: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 24cdc: 8f ef ldi r24, 0xFF ; 255 24cde: 9f ef ldi r25, 0xFF ; 255 24ce0: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24ce4: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> e_steps = 0; 24ce8: 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) 24cec: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 24cf0: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 24cf4: 00 97 sbiw r24, 0x00 ; 0 24cf6: 09 f4 brne .+2 ; 0x24cfa <__vector_17+0x76a> 24cf8: 26 ce rjmp .-948 ; 0x24946 <__vector_17+0x3b6> --current_adv_steps; 24cfa: 01 97 sbiw r24, 0x01 ; 1 24cfc: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 24d00: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 24d04: 20 ce rjmp .-960 ; 0x24946 <__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)); 24d06: 8e 7f andi r24, 0xFE ; 254 24d08: 39 ce rjmp .-910 ; 0x2497c <__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)); 24d0a: 8d 7f andi r24, 0xFD ; 253 24d0c: 56 ce rjmp .-852 ; 0x249ba <__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)); 24d0e: 8b 7f andi r24, 0xFB ; 251 24d10: 75 ce rjmp .-790 ; 0x249fc <__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)); 24d12: 01 99 sbic 0x00, 1 ; 0 24d14: 03 c0 rjmp .+6 ; 0x24d1c <__vector_17+0x78c> 24d16: 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)) { 24d18: 90 74 andi r25, 0x40 ; 64 24d1a: 71 ce rjmp .-798 ; 0x249fe <__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)); 24d1c: 8f 7b andi r24, 0xBF ; 191 24d1e: fc cf rjmp .-8 ; 0x24d18 <__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)); 24d20: 8b 7f andi r24, 0xFB ; 251 24d22: 96 ce rjmp .-724 ; 0x24a50 <__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) 24d24: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24d28: c8 17 cp r28, r24 24d2a: 08 f0 brcs .+2 ; 0x24d2e <__vector_17+0x79e> 24d2c: 6d c1 rjmp .+730 ; 0x25008 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24d2e: 0e 94 c1 fb call 0x1f782 ; 0x1f782 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 24d32: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d36: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d3a: 80 81 ld r24, Z 24d3c: 91 81 ldd r25, Z+1 ; 0x01 24d3e: a2 81 ldd r26, Z+2 ; 0x02 24d40: b3 81 ldd r27, Z+3 ; 0x03 24d42: 40 91 c5 05 lds r20, 0x05C5 ; 0x8005c5 24d46: 50 91 c6 05 lds r21, 0x05C6 ; 0x8005c6 24d4a: 60 91 c7 05 lds r22, 0x05C7 ; 0x8005c7 24d4e: 70 91 c8 05 lds r23, 0x05C8 ; 0x8005c8 24d52: 84 0f add r24, r20 24d54: 95 1f adc r25, r21 24d56: a6 1f adc r26, r22 24d58: b7 1f adc r27, r23 24d5a: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24d5e: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24d62: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24d66: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 if (counter[X_AXIS].wide > 0) { 24d6a: 18 16 cp r1, r24 24d6c: 19 06 cpc r1, r25 24d6e: 1a 06 cpc r1, r26 24d70: 1b 06 cpc r1, r27 24d72: cc f5 brge .+114 ; 0x24de6 <__vector_17+0x856> STEP_NC_HI(X_AXIS); 24d74: 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; 24d76: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d7a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d7e: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24d82: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24d86: a0 91 c7 05 lds r26, 0x05C7 ; 0x8005c7 24d8a: b0 91 c8 05 lds r27, 0x05C8 ; 0x8005c8 24d8e: 40 89 ldd r20, Z+16 ; 0x10 24d90: 51 89 ldd r21, Z+17 ; 0x11 24d92: 62 89 ldd r22, Z+18 ; 0x12 24d94: 73 89 ldd r23, Z+19 ; 0x13 24d96: 84 1b sub r24, r20 24d98: 95 0b sbc r25, r21 24d9a: a6 0b sbc r26, r22 24d9c: b7 0b sbc r27, r23 24d9e: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24da2: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24da6: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24daa: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 count_position[X_AXIS]+=count_direction[X_AXIS]; 24dae: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24db2: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24db6: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24dba: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24dbe: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24dc2: 89 2f mov r24, r25 24dc4: 99 0f add r25, r25 24dc6: 99 0b sbc r25, r25 24dc8: aa 0b sbc r26, r26 24dca: bb 0b sbc r27, r27 24dcc: 84 0f add r24, r20 24dce: 95 1f adc r25, r21 24dd0: a6 1f adc r26, r22 24dd2: b7 1f adc r27, r23 24dd4: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24dd8: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24ddc: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24de0: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24de4: 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; 24de6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24dea: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24dee: 84 81 ldd r24, Z+4 ; 0x04 24df0: 95 81 ldd r25, Z+5 ; 0x05 24df2: a6 81 ldd r26, Z+6 ; 0x06 24df4: b7 81 ldd r27, Z+7 ; 0x07 24df6: 40 91 c9 05 lds r20, 0x05C9 ; 0x8005c9 24dfa: 50 91 ca 05 lds r21, 0x05CA ; 0x8005ca 24dfe: 60 91 cb 05 lds r22, 0x05CB ; 0x8005cb 24e02: 70 91 cc 05 lds r23, 0x05CC ; 0x8005cc 24e06: 84 0f add r24, r20 24e08: 95 1f adc r25, r21 24e0a: a6 1f adc r26, r22 24e0c: b7 1f adc r27, r23 24e0e: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24e12: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24e16: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24e1a: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc if (counter[Y_AXIS].wide > 0) { 24e1e: 18 16 cp r1, r24 24e20: 19 06 cpc r1, r25 24e22: 1a 06 cpc r1, r26 24e24: 1b 06 cpc r1, r27 24e26: 8c f5 brge .+98 ; 0x24e8a <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 24e28: 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; 24e2a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e2e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e32: 40 89 ldd r20, Z+16 ; 0x10 24e34: 51 89 ldd r21, Z+17 ; 0x11 24e36: 62 89 ldd r22, Z+18 ; 0x12 24e38: 73 89 ldd r23, Z+19 ; 0x13 24e3a: 84 1b sub r24, r20 24e3c: 95 0b sbc r25, r21 24e3e: a6 0b sbc r26, r22 24e40: b7 0b sbc r27, r23 24e42: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24e46: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24e4a: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24e4e: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24e52: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24e56: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24e5a: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24e5e: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24e62: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24e66: 89 2f mov r24, r25 24e68: 99 0f add r25, r25 24e6a: 99 0b sbc r25, r25 24e6c: aa 0b sbc r26, r26 24e6e: bb 0b sbc r27, r27 24e70: 84 0f add r24, r20 24e72: 95 1f adc r25, r21 24e74: a6 1f adc r26, r22 24e76: b7 1f adc r27, r23 24e78: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24e7c: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24e80: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24e84: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24e88: 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; 24e8a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e8e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e92: 80 85 ldd r24, Z+8 ; 0x08 24e94: 91 85 ldd r25, Z+9 ; 0x09 24e96: a2 85 ldd r26, Z+10 ; 0x0a 24e98: b3 85 ldd r27, Z+11 ; 0x0b 24e9a: 40 91 cd 05 lds r20, 0x05CD ; 0x8005cd 24e9e: 50 91 ce 05 lds r21, 0x05CE ; 0x8005ce 24ea2: 60 91 cf 05 lds r22, 0x05CF ; 0x8005cf 24ea6: 70 91 d0 05 lds r23, 0x05D0 ; 0x8005d0 24eaa: 84 0f add r24, r20 24eac: 95 1f adc r25, r21 24eae: a6 1f adc r26, r22 24eb0: b7 1f adc r27, r23 24eb2: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24eb6: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24eba: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24ebe: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 if (counter[Z_AXIS].wide > 0) { 24ec2: 18 16 cp r1, r24 24ec4: 19 06 cpc r1, r25 24ec6: 1a 06 cpc r1, r26 24ec8: 1b 06 cpc r1, r27 24eca: 8c f5 brge .+98 ; 0x24f2e <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 24ecc: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 24ece: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24ed2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24ed6: 40 89 ldd r20, Z+16 ; 0x10 24ed8: 51 89 ldd r21, Z+17 ; 0x11 24eda: 62 89 ldd r22, Z+18 ; 0x12 24edc: 73 89 ldd r23, Z+19 ; 0x13 24ede: 84 1b sub r24, r20 24ee0: 95 0b sbc r25, r21 24ee2: a6 0b sbc r26, r22 24ee4: b7 0b sbc r27, r23 24ee6: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24eea: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24eee: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24ef2: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24ef6: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24efa: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24efe: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24f02: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24f06: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24f0a: 89 2f mov r24, r25 24f0c: 99 0f add r25, r25 24f0e: 99 0b sbc r25, r25 24f10: aa 0b sbc r26, r26 24f12: bb 0b sbc r27, r27 24f14: 84 0f add r24, r20 24f16: 95 1f adc r25, r21 24f18: a6 1f adc r26, r22 24f1a: b7 1f adc r27, r23 24f1c: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24f20: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24f24: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24f28: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24f2c: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 24f2e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24f32: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24f36: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24f3a: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24f3e: a0 91 d3 05 lds r26, 0x05D3 ; 0x8005d3 24f42: b0 91 d4 05 lds r27, 0x05D4 ; 0x8005d4 24f46: 44 85 ldd r20, Z+12 ; 0x0c 24f48: 55 85 ldd r21, Z+13 ; 0x0d 24f4a: 66 85 ldd r22, Z+14 ; 0x0e 24f4c: 77 85 ldd r23, Z+15 ; 0x0f 24f4e: 84 0f add r24, r20 24f50: 95 1f adc r25, r21 24f52: a6 1f adc r26, r22 24f54: b7 1f adc r27, r23 24f56: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24f5a: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24f5e: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24f62: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 24f66: 40 89 ldd r20, Z+16 ; 0x10 24f68: 51 89 ldd r21, Z+17 ; 0x11 24f6a: 62 89 ldd r22, Z+18 ; 0x12 24f6c: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 24f6e: 18 16 cp r1, r24 24f70: 19 06 cpc r1, r25 24f72: 1a 06 cpc r1, r26 24f74: 1b 06 cpc r1, r27 24f76: 74 f5 brge .+92 ; 0x24fd4 <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 24f78: 84 1b sub r24, r20 24f7a: 95 0b sbc r25, r21 24f7c: a6 0b sbc r26, r22 24f7e: b7 0b sbc r27, r23 24f80: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24f84: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24f88: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24f8c: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 count_position[E_AXIS] += count_direction[E_AXIS]; 24f90: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24f94: c0 90 c2 06 lds r12, 0x06C2 ; 0x8006c2 24f98: d0 90 c3 06 lds r13, 0x06C3 ; 0x8006c3 24f9c: e0 90 c4 06 lds r14, 0x06C4 ; 0x8006c4 24fa0: f0 90 c5 06 lds r15, 0x06C5 ; 0x8006c5 24fa4: 89 2f mov r24, r25 24fa6: 99 0f add r25, r25 24fa8: 99 0b sbc r25, r25 24faa: aa 0b sbc r26, r26 24fac: bb 0b sbc r27, r27 24fae: 8c 0d add r24, r12 24fb0: 9d 1d adc r25, r13 24fb2: ae 1d adc r26, r14 24fb4: bf 1d adc r27, r15 24fb6: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24fba: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24fbe: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24fc2: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24fc6: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24fca: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24fce: 89 0f add r24, r25 24fd0: 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) 24fd4: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24fd8: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24fdc: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 24fe0: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 24fe4: 01 96 adiw r24, 0x01 ; 1 24fe6: a1 1d adc r26, r1 24fe8: b1 1d adc r27, r1 24fea: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24fee: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24ff2: a0 93 c2 05 sts 0x05C2, r26 ; 0x8005c2 24ff6: b0 93 c3 05 sts 0x05C3, r27 ; 0x8005c3 24ffa: 84 17 cp r24, r20 24ffc: 95 07 cpc r25, r21 24ffe: a6 07 cpc r26, r22 25000: b7 07 cpc r27, r23 25002: 10 f4 brcc .+4 ; 0x25008 <__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) 25004: cf 5f subi r28, 0xFF ; 255 25006: 8e ce rjmp .-740 ; 0x24d24 <__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); 25008: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 2500c: 88 23 and r24, r24 2500e: 39 f0 breq .+14 ; 0x2501e <__vector_17+0xa8e> 25010: 87 ff sbrs r24, 7 25012: f2 c0 rjmp .+484 ; 0x251f8 <__vector_17+0xc68> 25014: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25018: 80 64 ori r24, 0x40 ; 64 2501a: 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) { 2501e: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 25022: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25026: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 2502a: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 2502e: c0 91 e4 11 lds r28, 0x11E4 ; 0x8011e4 25032: d0 91 e5 11 lds r29, 0x11E5 ; 0x8011e5 25036: 89 8d ldd r24, Y+25 ; 0x19 25038: 9a 8d ldd r25, Y+26 ; 0x1a 2503a: ab 8d ldd r26, Y+27 ; 0x1b 2503c: bc 8d ldd r27, Y+28 ; 0x1c 2503e: 84 17 cp r24, r20 25040: 95 07 cpc r25, r21 25042: a6 07 cpc r26, r22 25044: b7 07 cpc r27, r23 25046: 08 f4 brcc .+2 ; 0x2504a <__vector_17+0xaba> 25048: 37 c1 rjmp .+622 ; 0x252b8 <__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); 2504a: c0 90 d9 05 lds r12, 0x05D9 ; 0x8005d9 2504e: d0 90 da 05 lds r13, 0x05DA ; 0x8005da 25052: e0 90 db 05 lds r14, 0x05DB ; 0x8005db 25056: 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. ); 2505a: 2c 89 ldd r18, Y+20 ; 0x14 2505c: 3d 89 ldd r19, Y+21 ; 0x15 2505e: 4e 89 ldd r20, Y+22 ; 0x16 25060: aa 27 eor r26, r26 25062: c3 9e mul r12, r19 25064: b1 2d mov r27, r1 25066: d4 9e mul r13, r20 25068: c0 01 movw r24, r0 2506a: e4 9e mul r14, r20 2506c: 90 0d add r25, r0 2506e: e3 9e mul r14, r19 25070: 80 0d add r24, r0 25072: 91 1d adc r25, r1 25074: c4 9e mul r12, r20 25076: b0 0d add r27, r0 25078: 81 1d adc r24, r1 2507a: 9a 1f adc r25, r26 2507c: d3 9e mul r13, r19 2507e: b0 0d add r27, r0 25080: 81 1d adc r24, r1 25082: 9a 1f adc r25, r26 25084: e2 9e mul r14, r18 25086: b0 0d add r27, r0 25088: 81 1d adc r24, r1 2508a: 9a 1f adc r25, r26 2508c: d2 9e mul r13, r18 2508e: b1 0d add r27, r1 25090: 8a 1f adc r24, r26 25092: 9a 1f adc r25, r26 25094: bb 0f add r27, r27 25096: 8a 1f adc r24, r26 25098: 9a 1f adc r25, r26 2509a: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2509c: 2a ad ldd r18, Y+58 ; 0x3a 2509e: 3b ad ldd r19, Y+59 ; 0x3b 250a0: 82 0f add r24, r18 250a2: 93 1f adc r25, r19 250a4: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 250a8: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 250ac: 2e a9 ldd r18, Y+54 ; 0x36 250ae: 3f a9 ldd r19, Y+55 ; 0x37 250b0: 28 17 cp r18, r24 250b2: 39 07 cpc r19, r25 250b4: 20 f4 brcc .+8 ; 0x250be <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 250b6: 30 93 df 05 sts 0x05DF, r19 ; 0x8005df 250ba: 20 93 de 05 sts 0x05DE, r18 ; 0x8005de // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 250be: 80 91 de 05 lds r24, 0x05DE ; 0x8005de 250c2: 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; 250c6: 81 34 cpi r24, 0x41 ; 65 250c8: bc e9 ldi r27, 0x9C ; 156 250ca: 9b 07 cpc r25, r27 250cc: 08 f0 brcs .+2 ; 0x250d0 <__vector_17+0xb40> 250ce: 98 c0 rjmp .+304 ; 0x25200 <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 250d0: 81 32 cpi r24, 0x21 ; 33 250d2: ee e4 ldi r30, 0x4E ; 78 250d4: 9e 07 cpc r25, r30 250d6: 08 f4 brcc .+2 ; 0x250da <__vector_17+0xb4a> 250d8: 96 c0 rjmp .+300 ; 0x25206 <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 250da: 96 95 lsr r25 250dc: 87 95 ror r24 250de: 96 95 lsr r25 250e0: 87 95 ror r24 step_loops = 4; 250e2: 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; 250e4: 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 250e8: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 250ea: 81 15 cp r24, r1 250ec: 28 e0 ldi r18, 0x08 ; 8 250ee: 92 07 cpc r25, r18 250f0: 08 f4 brcc .+2 ; 0x250f4 <__vector_17+0xb64> 250f2: 9b c0 rjmp .+310 ; 0x2522a <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 250f4: e9 2f mov r30, r25 250f6: ff 27 eor r31, r31 250f8: ee 0f add r30, r30 250fa: ff 1f adc r31, r31 250fc: ee 0f add r30, r30 250fe: ff 1f adc r31, r31 25100: 9f 01 movw r18, r30 25102: 27 52 subi r18, 0x27 ; 39 25104: 32 47 sbci r19, 0x72 ; 114 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 25106: f9 01 movw r30, r18 25108: 32 96 adiw r30, 0x02 ; 2 2510a: 45 91 lpm r20, Z+ 2510c: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2510e: f9 01 movw r30, r18 25110: 25 91 lpm r18, Z+ 25112: 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. ); 25114: 58 9f mul r21, r24 25116: b0 01 movw r22, r0 25118: 48 9f mul r20, r24 2511a: 00 0c add r0, r0 2511c: 61 1d adc r22, r1 2511e: 11 24 eor r1, r1 25120: 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); 25122: 26 1b sub r18, r22 25124: 37 0b sbc r19, r23 25126: c9 01 movw r24, r18 25128: 24 36 cpi r18, 0x64 ; 100 2512a: 31 05 cpc r19, r1 2512c: 10 f4 brcc .+4 ; 0x25132 <__vector_17+0xba2> 2512e: 84 e6 ldi r24, 0x64 ; 100 25130: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 25132: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 25136: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 2513a: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 2513e: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> acceleration_time += timer; 25142: c8 0e add r12, r24 25144: d9 1e adc r13, r25 25146: e1 1c adc r14, r1 25148: f1 1c adc r15, r1 2514a: c0 92 d9 05 sts 0x05D9, r12 ; 0x8005d9 2514e: d0 92 da 05 sts 0x05DA, r13 ; 0x8005da 25152: e0 92 db 05 sts 0x05DB, r14 ; 0x8005db 25156: f0 92 dc 05 sts 0x05DC, r15 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2515a: fe 01 movw r30, r28 2515c: e4 5b subi r30, 0xB4 ; 180 2515e: ff 4f sbci r31, 0xFF ; 255 25160: 80 81 ld r24, Z 25162: 81 11 cpse r24, r1 25164: 80 c0 rjmp .+256 ; 0x25266 <__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; 25166: 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) { 25168: 80 ff sbrs r24, 0 2516a: 16 c0 rjmp .+44 ; 0x25198 <__vector_17+0xc08> LA_phase = -1; 2516c: 9f ef ldi r25, 0xFF ; 255 2516e: 90 93 d5 05 sts 0x05D5, r25 ; 0x8005d5 if (current_adv_steps == target_adv_steps) { 25172: e0 91 16 04 lds r30, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25176: f0 91 17 04 lds r31, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 2517a: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 2517e: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 25182: e2 17 cp r30, r18 25184: f3 07 cpc r31, r19 25186: 09 f0 breq .+2 ; 0x2518a <__vector_17+0xbfa> 25188: 27 c2 rjmp .+1102 ; 0x255d8 <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2518a: 8f ef ldi r24, 0xFF ; 255 2518c: 9f ef ldi r25, 0xFF ; 255 2518e: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 25192: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 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; 25196: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 25198: 80 fd sbrc r24, 0 2519a: 07 c0 rjmp .+14 ; 0x251aa <__vector_17+0xc1a> 2519c: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 251a0: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 251a4: 01 96 adiw r24, 0x01 ; 1 251a6: 09 f4 brne .+2 ; 0x251aa <__vector_17+0xc1a> 251a8: b7 c2 rjmp .+1390 ; 0x25718 <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 251aa: e0 91 18 04 lds r30, 0x0418 ; 0x800418 <_ZL9main_Rate.lto_priv.435> 251ae: f0 91 19 04 lds r31, 0x0419 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 251b2: 80 91 b6 05 lds r24, 0x05B6 ; 0x8005b6 251b6: 90 91 b7 05 lds r25, 0x05B7 ; 0x8005b7 251ba: a0 91 b8 05 lds r26, 0x05B8 ; 0x8005b8 251be: b0 91 b9 05 lds r27, 0x05B9 ; 0x8005b9 251c2: 2c 01 movw r4, r24 251c4: 3d 01 movw r6, r26 251c6: 4e 0e add r4, r30 251c8: 5f 1e adc r5, r31 251ca: 61 1c adc r6, r1 251cc: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 251ce: 9e 01 movw r18, r28 251d0: 23 5b subi r18, 0xB3 ; 179 251d2: 3f 4f sbci r19, 0xFF ; 255 251d4: d9 01 movw r26, r18 251d6: cd 90 ld r12, X+ 251d8: dc 90 ld r13, X 251da: f1 2c mov r15, r1 251dc: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 251de: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 251e0: 4c 14 cp r4, r12 251e2: 5d 04 cpc r5, r13 251e4: 6e 04 cpc r6, r14 251e6: 7f 04 cpc r7, r15 251e8: 08 f4 brcc .+2 ; 0x251ec <__vector_17+0xc5c> 251ea: 26 c2 rjmp .+1100 ; 0x25638 <__vector_17+0x10a8> { ++ticks; 251ec: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 251ee: 4c 18 sub r4, r12 251f0: 5d 08 sbc r5, r13 251f2: 6e 08 sbc r6, r14 251f4: 7f 08 sbc r7, r15 251f6: f4 cf rjmp .-24 ; 0x251e0 <__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); 251f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 251fc: 8f 7b andi r24, 0xBF ; 191 251fe: 0d cf rjmp .-486 ; 0x2501a <__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; 25200: 80 e4 ldi r24, 0x40 ; 64 25202: 9c e9 ldi r25, 0x9C ; 156 25204: 6a cf rjmp .-300 ; 0x250da <__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 25206: 81 31 cpi r24, 0x11 ; 17 25208: f7 e2 ldi r31, 0x27 ; 39 2520a: 9f 07 cpc r25, r31 2520c: 20 f0 brcs .+8 ; 0x25216 <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 2520e: 96 95 lsr r25 25210: 87 95 ror r24 step_loops = 2; 25212: 22 e0 ldi r18, 0x02 ; 2 25214: 67 cf rjmp .-306 ; 0x250e4 <__vector_17+0xb54> } else { step_loops = 1; 25216: 21 e0 ldi r18, 0x01 ; 1 25218: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 2521c: 80 32 cpi r24, 0x20 ; 32 2521e: 91 05 cpc r25, r1 25220: 08 f0 brcs .+2 ; 0x25224 <__vector_17+0xc94> 25222: 62 cf rjmp .-316 ; 0x250e8 <__vector_17+0xb58> 25224: 80 e2 ldi r24, 0x20 ; 32 25226: 90 e0 ldi r25, 0x00 ; 0 25228: 5f cf rjmp .-322 ; 0x250e8 <__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; 2522a: ac 01 movw r20, r24 2522c: 56 95 lsr r21 2522e: 47 95 ror r20 25230: 4c 7f andi r20, 0xFC ; 252 25232: 47 52 subi r20, 0x27 ; 39 25234: 56 47 sbci r21, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 25236: fa 01 movw r30, r20 25238: 25 91 lpm r18, Z+ 2523a: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2523c: fa 01 movw r30, r20 2523e: 32 96 adiw r30, 0x02 ; 2 25240: 65 91 lpm r22, Z+ 25242: 74 91 lpm r23, Z 25244: 87 70 andi r24, 0x07 ; 7 25246: 99 27 eor r25, r25 25248: 86 9f mul r24, r22 2524a: a0 01 movw r20, r0 2524c: 87 9f mul r24, r23 2524e: 50 0d add r21, r0 25250: 96 9f mul r25, r22 25252: 50 0d add r21, r0 25254: 11 24 eor r1, r1 25256: 73 e0 ldi r23, 0x03 ; 3 25258: 56 95 lsr r21 2525a: 47 95 ror r20 2525c: 7a 95 dec r23 2525e: e1 f7 brne .-8 ; 0x25258 <__vector_17+0xcc8> 25260: 24 1b sub r18, r20 25262: 35 0b sbc r19, r21 25264: 60 cf rjmp .-320 ; 0x25126 <__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) { 25266: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 2526a: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 2526e: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 25272: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 25276: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 2527a: 90 e0 ldi r25, 0x00 ; 0 2527c: b0 e0 ldi r27, 0x00 ; 0 2527e: a0 e0 ldi r26, 0x00 ; 0 25280: 84 17 cp r24, r20 25282: 95 07 cpc r25, r21 25284: a6 07 cpc r26, r22 25286: b7 07 cpc r27, r23 25288: 08 f4 brcc .+2 ; 0x2528c <__vector_17+0xcfc> 2528a: 6d cf rjmp .-294 ; 0x25166 <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2528c: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25290: 81 11 cpse r24, r1 25292: 02 c0 rjmp .+4 ; 0x25298 <__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; 25294: 83 e0 ldi r24, 0x03 ; 3 25296: 68 cf rjmp .-304 ; 0x25168 <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 25298: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 2529c: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 252a0: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 252a4: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 252a8: 28 17 cp r18, r24 252aa: 39 07 cpc r19, r25 252ac: 98 f7 brcc .-26 ; 0x25294 <__vector_17+0xd04> target_adv_steps = current_adv_steps; 252ae: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 252b2: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 252b6: ee cf rjmp .-36 ; 0x25294 <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 252b8: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 252bc: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 252c0: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 252c4: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 252c8: 4d 8d ldd r20, Y+29 ; 0x1d 252ca: 5e 8d ldd r21, Y+30 ; 0x1e 252cc: 6f 8d ldd r22, Y+31 ; 0x1f 252ce: 78 a1 ldd r23, Y+32 ; 0x20 252d0: 48 17 cp r20, r24 252d2: 59 07 cpc r21, r25 252d4: 6a 07 cpc r22, r26 252d6: 7b 07 cpc r23, r27 252d8: 08 f0 brcs .+2 ; 0x252dc <__vector_17+0xd4c> 252da: e3 c0 rjmp .+454 ; 0x254a2 <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 252dc: c0 90 e1 05 lds r12, 0x05E1 ; 0x8005e1 252e0: d0 90 e2 05 lds r13, 0x05E2 ; 0x8005e2 252e4: e0 90 e3 05 lds r14, 0x05E3 ; 0x8005e3 252e8: 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. ); 252ec: 6c 88 ldd r6, Y+20 ; 0x14 252ee: 7d 88 ldd r7, Y+21 ; 0x15 252f0: 8e 88 ldd r8, Y+22 ; 0x16 252f2: aa 27 eor r26, r26 252f4: c7 9c mul r12, r7 252f6: b1 2d mov r27, r1 252f8: d8 9c mul r13, r8 252fa: f0 01 movw r30, r0 252fc: e8 9c mul r14, r8 252fe: f0 0d add r31, r0 25300: e7 9c mul r14, r7 25302: e0 0d add r30, r0 25304: f1 1d adc r31, r1 25306: c8 9c mul r12, r8 25308: b0 0d add r27, r0 2530a: e1 1d adc r30, r1 2530c: fa 1f adc r31, r26 2530e: d7 9c mul r13, r7 25310: b0 0d add r27, r0 25312: e1 1d adc r30, r1 25314: fa 1f adc r31, r26 25316: e6 9c mul r14, r6 25318: b0 0d add r27, r0 2531a: e1 1d adc r30, r1 2531c: fa 1f adc r31, r26 2531e: d6 9c mul r13, r6 25320: b1 0d add r27, r1 25322: ea 1f adc r30, r26 25324: fa 1f adc r31, r26 25326: bb 0f add r27, r27 25328: ea 1f adc r30, r26 2532a: fa 1f adc r31, r26 2532c: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2532e: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 25332: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 25336: 8e ad ldd r24, Y+62 ; 0x3e 25338: 9f ad ldd r25, Y+63 ; 0x3f 2533a: 2e 17 cp r18, r30 2533c: 3f 07 cpc r19, r31 2533e: 30 f0 brcs .+12 ; 0x2534c <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 25340: 2e 1b sub r18, r30 25342: 3f 0b sbc r19, r31 25344: 82 17 cp r24, r18 25346: 93 07 cpc r25, r19 25348: 08 f4 brcc .+2 ; 0x2534c <__vector_17+0xdbc> 2534a: 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; 2534c: 81 34 cpi r24, 0x41 ; 65 2534e: ac e9 ldi r26, 0x9C ; 156 25350: 9a 07 cpc r25, r26 25352: 08 f0 brcs .+2 ; 0x25356 <__vector_17+0xdc6> 25354: 75 c0 rjmp .+234 ; 0x25440 <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 25356: 81 32 cpi r24, 0x21 ; 33 25358: be e4 ldi r27, 0x4E ; 78 2535a: 9b 07 cpc r25, r27 2535c: 08 f4 brcc .+2 ; 0x25360 <__vector_17+0xdd0> 2535e: 73 c0 rjmp .+230 ; 0x25446 <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 25360: 96 95 lsr r25 25362: 87 95 ror r24 25364: 96 95 lsr r25 25366: 87 95 ror r24 step_loops = 4; 25368: 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; 2536a: 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 2536e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 25370: 81 15 cp r24, r1 25372: f8 e0 ldi r31, 0x08 ; 8 25374: 9f 07 cpc r25, r31 25376: 08 f4 brcc .+2 ; 0x2537a <__vector_17+0xdea> 25378: 78 c0 rjmp .+240 ; 0x2546a <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2537a: e9 2f mov r30, r25 2537c: ff 27 eor r31, r31 2537e: ee 0f add r30, r30 25380: ff 1f adc r31, r31 25382: ee 0f add r30, r30 25384: ff 1f adc r31, r31 25386: 9f 01 movw r18, r30 25388: 27 52 subi r18, 0x27 ; 39 2538a: 32 47 sbci r19, 0x72 ; 114 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2538c: f9 01 movw r30, r18 2538e: 32 96 adiw r30, 0x02 ; 2 25390: a5 91 lpm r26, Z+ 25392: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 25394: f9 01 movw r30, r18 25396: 25 91 lpm r18, Z+ 25398: 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. ); 2539a: b8 9f mul r27, r24 2539c: f0 01 movw r30, r0 2539e: a8 9f mul r26, r24 253a0: 00 0c add r0, r0 253a2: e1 1d adc r30, r1 253a4: 11 24 eor r1, r1 253a6: 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); 253a8: 2e 1b sub r18, r30 253aa: 3f 0b sbc r19, r31 253ac: c9 01 movw r24, r18 253ae: 24 36 cpi r18, 0x64 ; 100 253b0: 31 05 cpc r19, r1 253b2: 10 f4 brcc .+4 ; 0x253b8 <__vector_17+0xe28> 253b4: 84 e6 ldi r24, 0x64 ; 100 253b6: 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); 253b8: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 253bc: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 253c0: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 253c4: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> deceleration_time += timer; 253c8: c8 0e add r12, r24 253ca: d9 1e adc r13, r25 253cc: e1 1c adc r14, r1 253ce: f1 1c adc r15, r1 253d0: c0 92 e1 05 sts 0x05E1, r12 ; 0x8005e1 253d4: d0 92 e2 05 sts 0x05E2, r13 ; 0x8005e2 253d8: e0 92 e3 05 sts 0x05E3, r14 ; 0x8005e3 253dc: f0 92 e4 05 sts 0x05E4, r15 ; 0x8005e4 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 253e0: fe 01 movw r30, r28 253e2: e4 5b subi r30, 0xB4 ; 180 253e4: ff 4f sbci r31, 0xFF ; 255 253e6: 80 81 ld r24, Z 253e8: 88 23 and r24, r24 253ea: 09 f4 brne .+2 ; 0x253ee <__vector_17+0xe5e> 253ec: bc ce rjmp .-648 ; 0x25166 <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 253ee: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 253f2: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 253f6: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 253fa: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 253fe: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd 25402: 42 0f add r20, r18 25404: 51 1d adc r21, r1 25406: 61 1d adc r22, r1 25408: 71 1d adc r23, r1 2540a: 48 17 cp r20, r24 2540c: 59 07 cpc r21, r25 2540e: 6a 07 cpc r22, r26 25410: 7b 07 cpc r23, r27 25412: 08 f4 brcc .+2 ; 0x25416 <__vector_17+0xe86> 25414: a8 ce rjmp .-688 ; 0x25166 <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 25416: 35 96 adiw r30, 0x05 ; 5 25418: 20 81 ld r18, Z 2541a: 31 81 ldd r19, Z+1 ; 0x01 2541c: 30 93 d8 05 sts 0x05D8, r19 ; 0x8005d8 25420: 20 93 d7 05 sts 0x05D7, r18 ; 0x8005d7 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 25424: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25428: 88 23 and r24, r24 2542a: 09 f4 brne .+2 ; 0x2542e <__vector_17+0xe9e> 2542c: 33 cf rjmp .-410 ; 0x25294 <__vector_17+0xd04> 2542e: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25432: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 25436: 82 17 cp r24, r18 25438: 93 07 cpc r25, r19 2543a: 08 f0 brcs .+2 ; 0x2543e <__vector_17+0xeae> 2543c: 2b cf rjmp .-426 ; 0x25294 <__vector_17+0xd04> 2543e: 37 cf rjmp .-402 ; 0x252ae <__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; 25440: 80 e4 ldi r24, 0x40 ; 64 25442: 9c e9 ldi r25, 0x9C ; 156 25444: 8d cf rjmp .-230 ; 0x25360 <__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 25446: 81 31 cpi r24, 0x11 ; 17 25448: e7 e2 ldi r30, 0x27 ; 39 2544a: 9e 07 cpc r25, r30 2544c: 20 f0 brcs .+8 ; 0x25456 <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 2544e: 96 95 lsr r25 25450: 87 95 ror r24 step_loops = 2; 25452: 22 e0 ldi r18, 0x02 ; 2 25454: 8a cf rjmp .-236 ; 0x2536a <__vector_17+0xdda> } else { step_loops = 1; 25456: 21 e0 ldi r18, 0x01 ; 1 25458: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 2545c: 80 32 cpi r24, 0x20 ; 32 2545e: 91 05 cpc r25, r1 25460: 08 f0 brcs .+2 ; 0x25464 <__vector_17+0xed4> 25462: 85 cf rjmp .-246 ; 0x2536e <__vector_17+0xdde> 25464: 80 e2 ldi r24, 0x20 ; 32 25466: 90 e0 ldi r25, 0x00 ; 0 25468: 82 cf rjmp .-252 ; 0x2536e <__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; 2546a: dc 01 movw r26, r24 2546c: b6 95 lsr r27 2546e: a7 95 ror r26 25470: ac 7f andi r26, 0xFC ; 252 25472: a7 52 subi r26, 0x27 ; 39 25474: b6 47 sbci r27, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 25476: fd 01 movw r30, r26 25478: 25 91 lpm r18, Z+ 2547a: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2547c: fd 01 movw r30, r26 2547e: 32 96 adiw r30, 0x02 ; 2 25480: a5 91 lpm r26, Z+ 25482: b4 91 lpm r27, Z 25484: 87 70 andi r24, 0x07 ; 7 25486: 99 27 eor r25, r25 25488: 8a 9f mul r24, r26 2548a: f0 01 movw r30, r0 2548c: 8b 9f mul r24, r27 2548e: f0 0d add r31, r0 25490: 9a 9f mul r25, r26 25492: f0 0d add r31, r0 25494: 11 24 eor r1, r1 25496: a3 e0 ldi r26, 0x03 ; 3 25498: f6 95 lsr r31 2549a: e7 95 ror r30 2549c: aa 95 dec r26 2549e: e1 f7 brne .-8 ; 0x25498 <__vector_17+0xf08> 254a0: 83 cf rjmp .-250 ; 0x253a8 <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 254a2: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 254a6: 88 23 and r24, r24 254a8: 71 f0 breq .+28 ; 0x254c6 <__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; 254aa: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 254ac: 20 91 ba 05 lds r18, 0x05BA ; 0x8005ba 254b0: 30 91 bb 05 lds r19, 0x05BB ; 0x8005bb 254b4: 30 93 1d 04 sts 0x041D, r19 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 254b8: 20 93 1c 04 sts 0x041C, r18 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 254bc: 30 93 19 04 sts 0x0419, r19 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 254c0: 20 93 18 04 sts 0x0418, r18 ; 0x800418 <_ZL9main_Rate.lto_priv.435> 254c4: 51 ce rjmp .-862 ; 0x25168 <__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); 254c6: 8e a9 ldd r24, Y+54 ; 0x36 254c8: 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; 254ca: 81 34 cpi r24, 0x41 ; 65 254cc: 2c e9 ldi r18, 0x9C ; 156 254ce: 92 07 cpc r25, r18 254d0: 08 f0 brcs .+2 ; 0x254d4 <__vector_17+0xf44> 254d2: 4e c0 rjmp .+156 ; 0x25570 <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 254d4: 81 32 cpi r24, 0x21 ; 33 254d6: 4e e4 ldi r20, 0x4E ; 78 254d8: 94 07 cpc r25, r20 254da: 08 f4 brcc .+2 ; 0x254de <__vector_17+0xf4e> 254dc: 4c c0 rjmp .+152 ; 0x25576 <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 254de: 96 95 lsr r25 254e0: 87 95 ror r24 254e2: 96 95 lsr r25 254e4: 87 95 ror r24 step_loops = 4; 254e6: 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; 254e8: 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 254ec: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 254ee: 81 15 cp r24, r1 254f0: a8 e0 ldi r26, 0x08 ; 8 254f2: 9a 07 cpc r25, r26 254f4: 08 f4 brcc .+2 ; 0x254f8 <__vector_17+0xf68> 254f6: 51 c0 rjmp .+162 ; 0x2559a <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 254f8: e9 2f mov r30, r25 254fa: ff 27 eor r31, r31 254fc: ee 0f add r30, r30 254fe: ff 1f adc r31, r31 25500: ee 0f add r30, r30 25502: ff 1f adc r31, r31 25504: 9f 01 movw r18, r30 25506: 27 52 subi r18, 0x27 ; 39 25508: 32 47 sbci r19, 0x72 ; 114 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2550a: f9 01 movw r30, r18 2550c: 32 96 adiw r30, 0x02 ; 2 2550e: 65 91 lpm r22, Z+ 25510: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 25512: f9 01 movw r30, r18 25514: 25 91 lpm r18, Z+ 25516: 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. ); 25518: 78 9f mul r23, r24 2551a: a0 01 movw r20, r0 2551c: 68 9f mul r22, r24 2551e: 00 0c add r0, r0 25520: 41 1d adc r20, r1 25522: 11 24 eor r1, r1 25524: 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); 25526: c9 01 movw r24, r18 25528: 84 1b sub r24, r20 2552a: 95 0b sbc r25, r21 2552c: 84 36 cpi r24, 0x64 ; 100 2552e: 91 05 cpc r25, r1 25530: 10 f4 brcc .+4 ; 0x25536 <__vector_17+0xfa6> 25532: 84 e6 ldi r24, 0x64 ; 100 25534: 90 e0 ldi r25, 0x00 ; 0 25536: 90 93 bb 05 sts 0x05BB, r25 ; 0x8005bb 2553a: 80 93 ba 05 sts 0x05BA, r24 ; 0x8005ba step_loops_nominal = step_loops; 2553e: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 25542: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 25546: fe 01 movw r30, r28 25548: e4 5b subi r30, 0xB4 ; 180 2554a: ff 4f sbci r31, 0xFF ; 255 2554c: 80 81 ld r24, Z 2554e: 88 23 and r24, r24 25550: 09 f4 brne .+2 ; 0x25554 <__vector_17+0xfc4> 25552: ab cf rjmp .-170 ; 0x254aa <__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) 25554: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25558: 88 23 and r24, r24 2555a: 41 f0 breq .+16 ; 0x2556c <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 2555c: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25560: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 25564: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 25568: 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; 2556c: 81 e0 ldi r24, 0x01 ; 1 2556e: 9e cf rjmp .-196 ; 0x254ac <__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; 25570: 80 e4 ldi r24, 0x40 ; 64 25572: 9c e9 ldi r25, 0x9C ; 156 25574: b4 cf rjmp .-152 ; 0x254de <__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 25576: 81 31 cpi r24, 0x11 ; 17 25578: 57 e2 ldi r21, 0x27 ; 39 2557a: 95 07 cpc r25, r21 2557c: 20 f0 brcs .+8 ; 0x25586 <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 2557e: 96 95 lsr r25 25580: 87 95 ror r24 step_loops = 2; 25582: 22 e0 ldi r18, 0x02 ; 2 25584: b1 cf rjmp .-158 ; 0x254e8 <__vector_17+0xf58> } else { step_loops = 1; 25586: 21 e0 ldi r18, 0x01 ; 1 25588: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 2558c: 80 32 cpi r24, 0x20 ; 32 2558e: 91 05 cpc r25, r1 25590: 08 f0 brcs .+2 ; 0x25594 <__vector_17+0x1004> 25592: ac cf rjmp .-168 ; 0x254ec <__vector_17+0xf5c> 25594: 80 e2 ldi r24, 0x20 ; 32 25596: 90 e0 ldi r25, 0x00 ; 0 25598: a9 cf rjmp .-174 ; 0x254ec <__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; 2559a: 9c 01 movw r18, r24 2559c: 36 95 lsr r19 2559e: 27 95 ror r18 255a0: 2c 7f andi r18, 0xFC ; 252 255a2: 27 52 subi r18, 0x27 ; 39 255a4: 36 47 sbci r19, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 255a6: f9 01 movw r30, r18 255a8: 45 91 lpm r20, Z+ 255aa: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 255ac: f9 01 movw r30, r18 255ae: 32 96 adiw r30, 0x02 ; 2 255b0: 65 91 lpm r22, Z+ 255b2: 74 91 lpm r23, Z 255b4: 87 70 andi r24, 0x07 ; 7 255b6: 99 27 eor r25, r25 255b8: 86 9f mul r24, r22 255ba: 90 01 movw r18, r0 255bc: 87 9f mul r24, r23 255be: 30 0d add r19, r0 255c0: 96 9f mul r25, r22 255c2: 30 0d add r19, r0 255c4: 11 24 eor r1, r1 255c6: a3 e0 ldi r26, 0x03 ; 3 255c8: 36 95 lsr r19 255ca: 27 95 ror r18 255cc: aa 95 dec r26 255ce: e1 f7 brne .-8 ; 0x255c8 <__vector_17+0x1038> 255d0: ca 01 movw r24, r20 255d2: 82 1b sub r24, r18 255d4: 93 0b sbc r25, r19 255d6: aa cf rjmp .-172 ; 0x2552c <__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; 255d8: de 01 movw r26, r28 255da: a3 5b subi r26, 0xB3 ; 179 255dc: bf 4f sbci r27, 0xFF ; 255 255de: 4d 91 ld r20, X+ 255e0: 5c 91 ld r21, X 255e2: 11 97 sbiw r26, 0x01 ; 1 255e4: 70 e0 ldi r23, 0x00 ; 0 255e6: 60 e0 ldi r22, 0x00 ; 0 255e8: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 255ec: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 255f0: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 255f4: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 e_step_loops = current_block->advance_step_loops; 255f8: 16 96 adiw r26, 0x06 ; 6 255fa: 9c 91 ld r25, X 255fc: 90 93 b5 05 sts 0x05B5, r25 ; 0x8005b5 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 25600: 98 2f mov r25, r24 25602: 92 70 andi r25, 0x02 ; 2 25604: 09 f4 brne .+2 ; 0x25608 <__vector_17+0x1078> 25606: c8 cd rjmp .-1136 ; 0x25198 <__vector_17+0xc08> 25608: 90 91 c4 05 lds r25, 0x05C4 ; 0x8005c4 2560c: 99 23 and r25, r25 2560e: 09 f4 brne .+2 ; 0x25612 <__vector_17+0x1082> 25610: c3 cd rjmp .-1146 ; 0x25198 <__vector_17+0xc08> 25612: 2e 17 cp r18, r30 25614: 3f 07 cpc r19, r31 25616: 08 f0 brcs .+2 ; 0x2561a <__vector_17+0x108a> 25618: bf cd rjmp .-1154 ; 0x25198 <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2561a: 44 0f add r20, r20 2561c: 55 1f adc r21, r21 2561e: 66 1f adc r22, r22 25620: 77 1f adc r23, r23 25622: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 25626: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 2562a: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 2562e: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 LA_phase = 0; 25632: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 25636: b0 cd rjmp .-1184 ; 0x25198 <__vector_17+0xc08> 25638: 40 92 b6 05 sts 0x05B6, r4 ; 0x8005b6 2563c: 50 92 b7 05 sts 0x05B7, r5 ; 0x8005b7 25640: 60 92 b8 05 sts 0x05B8, r6 ; 0x8005b8 25644: 70 92 b9 05 sts 0x05B9, r7 ; 0x8005b9 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 25648: 61 11 cpse r22, r1 2564a: 1d c0 rjmp .+58 ; 0x25686 <__vector_17+0x10f6> { eISR_Rate = timer; 2564c: f0 93 b4 05 sts 0x05B4, r31 ; 0x8005b4 25650: e0 93 b3 05 sts 0x05B3, r30 ; 0x8005b3 nextAdvanceISR = timer; 25654: f0 93 1b 04 sts 0x041B, r31 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 25658: e0 93 1a 04 sts 0x041A, r30 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2565c: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 25660: 87 fd sbrc r24, 7 25662: 5a c0 rjmp .+180 ; 0x25718 <__vector_17+0x1188> if (step_loops == e_step_loops) 25664: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 25668: 10 91 b5 05 lds r17, 0x05B5 ; 0x8005b5 2566c: c3 5b subi r28, 0xB3 ; 179 2566e: df 4f sbci r29, 0xFF ; 255 25670: 28 81 ld r18, Y 25672: 39 81 ldd r19, Y+1 ; 0x01 25674: 81 13 cpse r24, r17 25676: 35 c0 rjmp .+106 ; 0x256e2 <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 25678: 81 e0 ldi r24, 0x01 ; 1 2567a: 2e 17 cp r18, r30 2567c: 3f 07 cpc r19, r31 2567e: 08 f4 brcc .+2 ; 0x25682 <__vector_17+0x10f2> 25680: 49 c0 rjmp .+146 ; 0x25714 <__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); 25682: 80 e0 ldi r24, 0x00 ; 0 25684: 47 c0 rjmp .+142 ; 0x25714 <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 25686: 64 30 cpi r22, 0x04 ; 4 25688: 28 f5 brcc .+74 ; 0x256d4 <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 2568a: 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); 2568c: 63 30 cpi r22, 0x03 ; 3 2568e: a9 f0 breq .+42 ; 0x256ba <__vector_17+0x112a> 25690: 66 95 lsr r22 25692: af 01 movw r20, r30 25694: 02 c0 rjmp .+4 ; 0x2569a <__vector_17+0x110a> 25696: 56 95 lsr r21 25698: 47 95 ror r20 2569a: 6a 95 dec r22 2569c: e2 f7 brpl .-8 ; 0x25696 <__vector_17+0x1106> 2569e: 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); 256a0: 70 93 b4 05 sts 0x05B4, r23 ; 0x8005b4 256a4: 60 93 b3 05 sts 0x05B3, r22 ; 0x8005b3 } nextAdvanceISR = eISR_Rate; 256a8: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 256ac: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 256b0: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 256b4: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 256b8: d1 cf rjmp .-94 ; 0x2565c <__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; 256ba: 9f 01 movw r18, r30 256bc: ab ea ldi r26, 0xAB ; 171 256be: ba ea ldi r27, 0xAA ; 170 256c0: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 256c4: 41 e1 ldi r20, 0x11 ; 17 256c6: 96 95 lsr r25 256c8: 87 95 ror r24 256ca: 77 95 ror r23 256cc: 67 95 ror r22 256ce: 4a 95 dec r20 256d0: d1 f7 brne .-12 ; 0x256c6 <__vector_17+0x1136> 256d2: e6 cf rjmp .-52 ; 0x256a0 <__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); 256d4: 70 e0 ldi r23, 0x00 ; 0 256d6: 6f 5f subi r22, 0xFF ; 255 256d8: 7f 4f sbci r23, 0xFF ; 255 256da: cf 01 movw r24, r30 256dc: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 256e0: df cf rjmp .-66 ; 0x256a0 <__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); 256e2: 83 30 cpi r24, 0x03 ; 3 256e4: 09 f4 brne .+2 ; 0x256e8 <__vector_17+0x1158> 256e6: a2 c0 rjmp .+324 ; 0x2582c <__vector_17+0x129c> 256e8: 86 95 lsr r24 256ea: a9 01 movw r20, r18 256ec: 02 c0 rjmp .+4 ; 0x256f2 <__vector_17+0x1162> 256ee: 56 95 lsr r21 256f0: 47 95 ror r20 256f2: 8a 95 dec r24 256f4: e2 f7 brpl .-8 ; 0x256ee <__vector_17+0x115e> 256f6: 13 30 cpi r17, 0x03 ; 3 256f8: 09 f4 brne .+2 ; 0x256fc <__vector_17+0x116c> 256fa: a6 c0 rjmp .+332 ; 0x25848 <__vector_17+0x12b8> 256fc: 16 95 lsr r17 256fe: bf 01 movw r22, r30 25700: 02 c0 rjmp .+4 ; 0x25706 <__vector_17+0x1176> 25702: 76 95 lsr r23 25704: 67 95 ror r22 25706: 1a 95 dec r17 25708: e2 f7 brpl .-8 ; 0x25702 <__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); 2570a: 81 e0 ldi r24, 0x01 ; 1 2570c: 46 17 cp r20, r22 2570e: 57 07 cpc r21, r23 25710: 08 f0 brcs .+2 ; 0x25714 <__vector_17+0x1184> 25712: b7 cf rjmp .-146 ; 0x25682 <__vector_17+0x10f2> 25714: 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(); 25718: 0e 94 c1 fb call 0x1f782 ; 0x1f782 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2571c: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 25720: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25724: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 25728: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 2572c: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 25730: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 25734: 80 89 ldd r24, Z+16 ; 0x10 25736: 91 89 ldd r25, Z+17 ; 0x11 25738: a2 89 ldd r26, Z+18 ; 0x12 2573a: b3 89 ldd r27, Z+19 ; 0x13 2573c: 48 17 cp r20, r24 2573e: 59 07 cpc r21, r25 25740: 6a 07 cpc r22, r26 25742: 7b 07 cpc r23, r27 25744: 80 f0 brcs .+32 ; 0x25766 <__vector_17+0x11d6> current_block = NULL; 25746: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 2574a: 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) { 2574e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 25752: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 25756: 98 17 cp r25, r24 25758: 31 f0 breq .+12 ; 0x25766 <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2575a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2575e: 8f 5f subi r24, 0xFF ; 255 25760: 8f 70 andi r24, 0x0F ; 15 25762: 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; 25766: 60 91 1a 04 lds r22, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 2576a: 70 91 1b 04 lds r23, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> if (eisr) 2576e: 61 15 cp r22, r1 25770: 71 05 cpc r23, r1 25772: 09 f0 breq .+2 ; 0x25776 <__vector_17+0x11e6> 25774: 46 c0 rjmp .+140 ; 0x25802 <__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) { 25776: 40 91 16 04 lds r20, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 2577a: 50 91 17 04 lds r21, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 2577e: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 25782: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 25786: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 2578a: 24 17 cp r18, r20 2578c: 35 07 cpc r19, r21 2578e: 08 f0 brcs .+2 ; 0x25792 <__vector_17+0x1202> 25790: 6c c0 rjmp .+216 ; 0x2586a <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 25792: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 25796: 91 30 cpi r25, 0x01 ; 1 25798: 41 f0 breq .+16 ; 0x257aa <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 2579a: 42 1b sub r20, r18 2579c: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2579e: 94 17 cp r25, r20 257a0: 15 06 cpc r1, r21 257a2: 19 f0 breq .+6 ; 0x257aa <__vector_17+0x121a> 257a4: 10 f0 brcs .+4 ; 0x257aa <__vector_17+0x121a> e_step_loops = d_steps; 257a6: 40 93 b5 05 sts 0x05B5, r20 ; 0x8005b5 } e_steps -= e_step_loops; 257aa: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 257ae: 89 1b sub r24, r25 257b0: 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); 257b4: 88 23 and r24, r24 257b6: 39 f0 breq .+14 ; 0x257c6 <__vector_17+0x1236> 257b8: 87 ff sbrs r24, 7 257ba: 53 c0 rjmp .+166 ; 0x25862 <__vector_17+0x12d2> 257bc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 257c0: 80 64 ori r24, 0x40 ; 64 257c2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 257c6: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 257ca: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 257ce: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 257d2: 82 1b sub r24, r18 257d4: 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; 257d6: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 257da: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> } if (current_adv_steps == target_adv_steps) { 257de: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 257e2: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 257e6: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 257ea: 90 91 d8 05 lds r25, 0x05D8 ; 0x8005d8 257ee: 28 17 cp r18, r24 257f0: 39 07 cpc r19, r25 257f2: 09 f0 breq .+2 ; 0x257f6 <__vector_17+0x1266> 257f4: 66 c0 rjmp .+204 ; 0x258c2 <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 257f6: 8f ef ldi r24, 0xFF ; 255 257f8: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 257fa: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 257fe: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 25802: 40 91 d6 05 lds r20, 0x05D6 ; 0x8005d6 25806: 41 11 cpse r20, r1 25808: 61 c0 rjmp .+194 ; 0x258cc <__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) 2580a: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 2580e: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 25812: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 25816: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 2581a: 8f 3f cpi r24, 0xFF ; 255 2581c: 98 07 cpc r25, r24 2581e: 09 f0 breq .+2 ; 0x25822 <__vector_17+0x1292> 25820: 88 c0 rjmp .+272 ; 0x25932 <__vector_17+0x13a2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 25822: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25826: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2582a: 8e c0 rjmp .+284 ; 0x25948 <__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; 2582c: ab ea ldi r26, 0xAB ; 171 2582e: ba ea ldi r27, 0xAA ; 170 25830: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 25834: ab 01 movw r20, r22 25836: bc 01 movw r22, r24 25838: 31 e1 ldi r19, 0x11 ; 17 2583a: 76 95 lsr r23 2583c: 67 95 ror r22 2583e: 57 95 ror r21 25840: 47 95 ror r20 25842: 3a 95 dec r19 25844: d1 f7 brne .-12 ; 0x2583a <__vector_17+0x12aa> 25846: 57 cf rjmp .-338 ; 0x256f6 <__vector_17+0x1166> 25848: 9f 01 movw r18, r30 2584a: ab ea ldi r26, 0xAB ; 171 2584c: ba ea ldi r27, 0xAA ; 170 2584e: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 25852: 21 e1 ldi r18, 0x11 ; 17 25854: 96 95 lsr r25 25856: 87 95 ror r24 25858: 77 95 ror r23 2585a: 67 95 ror r22 2585c: 2a 95 dec r18 2585e: d1 f7 brne .-12 ; 0x25854 <__vector_17+0x12c4> 25860: 54 cf rjmp .-344 ; 0x2570a <__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); 25862: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25866: 8f 7b andi r24, 0xBF ; 191 25868: ac cf rjmp .-168 ; 0x257c2 <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2586a: 42 17 cp r20, r18 2586c: 53 07 cpc r21, r19 2586e: 08 f0 brcs .+2 ; 0x25872 <__vector_17+0x12e2> 25870: b6 cf rjmp .-148 ; 0x257de <__vector_17+0x124e> // compression if (e_step_loops != 1) { 25872: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 25876: 91 30 cpi r25, 0x01 ; 1 25878: 41 f0 breq .+16 ; 0x2588a <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 2587a: 24 1b sub r18, r20 2587c: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2587e: 92 17 cp r25, r18 25880: 13 06 cpc r1, r19 25882: 19 f0 breq .+6 ; 0x2588a <__vector_17+0x12fa> 25884: 10 f0 brcs .+4 ; 0x2588a <__vector_17+0x12fa> e_step_loops = d_steps; 25886: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 } e_steps += e_step_loops; 2588a: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 2588e: 89 0f add r24, r25 25890: 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); 25894: 88 23 and r24, r24 25896: 39 f0 breq .+14 ; 0x258a6 <__vector_17+0x1316> 25898: 87 ff sbrs r24, 7 2589a: 0f c0 rjmp .+30 ; 0x258ba <__vector_17+0x132a> 2589c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 258a0: 80 64 ori r24, 0x40 ; 64 258a2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 258a6: 80 91 b5 05 lds r24, 0x05B5 ; 0x8005b5 258aa: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 258ae: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 258b2: 82 0f add r24, r18 258b4: 93 2f mov r25, r19 258b6: 91 1d adc r25, r1 258b8: 8e cf rjmp .-228 ; 0x257d6 <__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); 258ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 258be: 8f 7b andi r24, 0xBF ; 191 258c0: f0 cf rjmp .-32 ; 0x258a2 <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 258c2: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 258c6: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 258ca: 97 cf rjmp .-210 ; 0x257fa <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 258cc: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 258d0: 87 fd sbrc r24, 7 258d2: 0e c0 rjmp .+28 ; 0x258f0 <__vector_17+0x1360> 258d4: 08 2e mov r0, r24 258d6: 00 0c add r0, r0 258d8: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 258da: 21 e0 ldi r18, 0x01 ; 1 258dc: 30 e0 ldi r19, 0x00 ; 0 258de: 61 15 cp r22, r1 258e0: 71 05 cpc r23, r1 258e2: 11 f0 breq .+4 ; 0x258e8 <__vector_17+0x1358> 258e4: 30 e0 ldi r19, 0x00 ; 0 258e6: 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)) { 258e8: 82 17 cp r24, r18 258ea: 93 07 cpc r25, r19 258ec: 09 f0 breq .+2 ; 0x258f0 <__vector_17+0x1360> 258ee: 8d cf rjmp .-230 ; 0x2580a <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 258f0: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 258f4: 67 2b or r22, r23 258f6: 11 f0 breq .+4 ; 0x258fc <__vector_17+0x136c> 258f8: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd max_ticks = min(abs(e_steps), max_ticks); 258fc: 84 2f mov r24, r20 258fe: 04 2e mov r0, r20 25900: 00 0c add r0, r0 25902: 99 0b sbc r25, r25 25904: 97 ff sbrs r25, 7 25906: 03 c0 rjmp .+6 ; 0x2590e <__vector_17+0x137e> 25908: 91 95 neg r25 2590a: 81 95 neg r24 2590c: 91 09 sbc r25, r1 2590e: 30 e0 ldi r19, 0x00 ; 0 25910: 28 17 cp r18, r24 25912: 39 07 cpc r19, r25 25914: 0c f4 brge .+2 ; 0x25918 <__vector_17+0x1388> 25916: c9 01 movw r24, r18 25918: 21 e0 ldi r18, 0x01 ; 1 2591a: 47 ff sbrs r20, 7 2591c: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2591e: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 25920: 90 91 d6 05 lds r25, 0x05D6 ; 0x8005d6 25924: 92 0f add r25, r18 25926: 90 93 d6 05 sts 0x05D6, r25 ; 0x8005d6 STEP_NC_LO(E_AXIS); 2592a: 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); 2592c: 81 50 subi r24, 0x01 ; 1 2592e: b9 f7 brne .-18 ; 0x2591e <__vector_17+0x138e> 25930: 6c cf rjmp .-296 ; 0x2580a <__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) 25932: ac 01 movw r20, r24 25934: 48 5d subi r20, 0xD8 ; 216 25936: 5f 4f sbci r21, 0xFF ; 255 25938: 42 17 cp r20, r18 2593a: 53 07 cpc r21, r19 2593c: 08 f0 brcs .+2 ; 0x25940 <__vector_17+0x13b0> 2593e: 71 cf rjmp .-286 ; 0x25822 <__vector_17+0x1292> OCR1A = nextAdvanceISR; 25940: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25944: 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) { 25948: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2594c: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25950: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 25954: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 25958: 40 96 adiw r24, 0x10 ; 16 2595a: 28 17 cp r18, r24 2595c: 39 07 cpc r19, r25 2595e: 48 f4 brcc .+18 ; 0x25972 <__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; 25960: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 25964: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 25968: 40 96 adiw r24, 0x10 ; 16 2596a: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2596e: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 25972: ff 91 pop r31 25974: ef 91 pop r30 25976: df 91 pop r29 25978: cf 91 pop r28 2597a: bf 91 pop r27 2597c: af 91 pop r26 2597e: 9f 91 pop r25 25980: 8f 91 pop r24 25982: 7f 91 pop r23 25984: 6f 91 pop r22 25986: 5f 91 pop r21 25988: 4f 91 pop r20 2598a: 3f 91 pop r19 2598c: 2f 91 pop r18 2598e: 1f 91 pop r17 25990: ff 90 pop r15 25992: ef 90 pop r14 25994: df 90 pop r13 25996: cf 90 pop r12 25998: 8f 90 pop r8 2599a: 7f 90 pop r7 2599c: 6f 90 pop r6 2599e: 5f 90 pop r5 259a0: 4f 90 pop r4 259a2: 0f 90 pop r0 259a4: 0b be out 0x3b, r0 ; 59 259a6: 0f 90 pop r0 259a8: 0f be out 0x3f, r0 ; 63 259aa: 0f 90 pop r0 259ac: 1f 90 pop r1 259ae: 18 95 reti 000259b0 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 259b0: 90 91 bc 05 lds r25, 0x05BC ; 0x8005bc check_z_endstop = check; 259b4: 80 93 bc 05 sts 0x05BC, r24 ; 0x8005bc CRITICAL_SECTION_START; 259b8: 2f b7 in r18, 0x3f ; 63 259ba: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 259bc: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 259c0: 8b 7f andi r24, 0xFB ; 251 259c2: 80 93 2c 04 sts 0x042C, r24 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_END; 259c6: 2f bf out 0x3f, r18 ; 63 return old; } 259c8: 89 2f mov r24, r25 259ca: 08 95 ret 000259cc : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 259cc: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_START; 259d0: 2f b7 in r18, 0x3f ; 63 259d2: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 259d4: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 259d8: 9b 7f andi r25, 0xFB ; 251 259da: 90 93 2c 04 sts 0x042C, r25 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_END; 259de: 2f bf out 0x3f, r18 ; 63 return hit; } 259e0: 82 fb bst r24, 2 259e2: 88 27 eor r24, r24 259e4: 80 f9 bld r24, 0 259e6: 08 95 ret 000259e8 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 259e8: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> endstop_hit = 0; 259ec: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> return old; 259f0: 81 e0 ldi r24, 0x01 ; 1 259f2: 91 11 cpse r25, r1 259f4: 01 c0 rjmp .+2 ; 0x259f8 259f6: 80 e0 ldi r24, 0x00 ; 0 } 259f8: 08 95 ret 000259fa : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 259fa: 90 91 15 04 lds r25, 0x0415 ; 0x800415 259fe: 91 30 cpi r25, 0x01 ; 1 25a00: a1 f0 breq .+40 ; 0x25a2a 25a02: 28 f0 brcs .+10 ; 0x25a0e 25a04: 92 30 cpi r25, 0x02 ; 2 25a06: a9 f0 breq .+42 ; 0x25a32 25a08: 93 30 cpi r25, 0x03 ; 3 25a0a: c1 f0 breq .+48 ; 0x25a3c 25a0c: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 25a0e: 81 11 cpse r24, r1 25a10: 02 c0 rjmp .+4 ; 0x25a16 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(); 25a12: 0c 94 29 fc jmp 0x1f852 ; 0x1f852 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a16: 82 30 cpi r24, 0x02 ; 2 25a18: 11 f4 brne .+4 ; 0x25a1e break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 25a1a: 0d 94 dc 09 jmp 0x213b8 ; 0x213b8 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) 25a1e: 85 30 cpi r24, 0x05 ; 5 25a20: 09 f0 breq .+2 ; 0x25a24 25a22: 4d c0 rjmp .+154 ; 0x25abe Sound_DoSound_Alert(false); 25a24: 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); 25a26: 0c 94 07 fc jmp 0x1f80e ; 0x1f80e 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) 25a2a: 88 23 and r24, r24 25a2c: 91 f3 breq .-28 ; 0x25a12 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a2e: 82 30 cpi r24, 0x02 ; 2 25a30: a1 f3 breq .-24 ; 0x25a1a Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25a32: 85 30 cpi r24, 0x05 ; 5 25a34: 09 f0 breq .+2 ; 0x25a38 25a36: 43 c0 rjmp .+134 ; 0x25abe Sound_DoSound_Alert(true); 25a38: 81 e0 ldi r24, 0x01 ; 1 25a3a: f5 cf rjmp .-22 ; 0x25a26 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) 25a3c: 88 23 and r24, r24 25a3e: 49 f3 breq .-46 ; 0x25a12 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a40: 82 30 cpi r24, 0x02 ; 2 25a42: 59 f3 breq .-42 ; 0x25a1a Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25a44: 85 30 cpi r24, 0x05 ; 5 25a46: 71 f3 breq .-36 ; 0x25a24 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 25a48: 86 30 cpi r24, 0x06 ; 6 25a4a: e1 f4 brne .+56 ; 0x25a84 25a4c: 85 e0 ldi r24, 0x05 ; 5 25a4e: 27 e2 ldi r18, 0x27 ; 39 25a50: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 25a52: 4f b7 in r20, 0x3f ; 63 25a54: f8 94 cli 25a56: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a5a: 94 60 ori r25, 0x04 ; 4 25a5c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a60: 4f bf out 0x3f, r20 ; 63 25a62: f9 01 movw r30, r18 25a64: 31 97 sbiw r30, 0x01 ; 1 25a66: f1 f7 brne .-4 ; 0x25a64 delayMicroseconds(75); WRITE(BEEPER,LOW); 25a68: 4f b7 in r20, 0x3f ; 63 25a6a: f8 94 cli 25a6c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a70: 9b 7f andi r25, 0xFB ; 251 25a72: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a76: 4f bf out 0x3f, r20 ; 63 25a78: f9 01 movw r30, r18 25a7a: 31 97 sbiw r30, 0x01 ; 1 25a7c: f1 f7 brne .-4 ; 0x25a7a 25a7e: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 25a80: 41 f7 brne .-48 ; 0x25a52 25a82: 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) 25a84: 87 30 cpi r24, 0x07 ; 7 25a86: d9 f4 brne .+54 ; 0x25abe 25a88: 84 e1 ldi r24, 0x14 ; 20 25a8a: 23 e7 ldi r18, 0x73 ; 115 25a8c: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 25a8e: 4f b7 in r20, 0x3f ; 63 25a90: f8 94 cli 25a92: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a96: 94 60 ori r25, 0x04 ; 4 25a98: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25a9c: 4f bf out 0x3f, r20 ; 63 25a9e: f9 01 movw r30, r18 25aa0: 31 97 sbiw r30, 0x01 ; 1 25aa2: f1 f7 brne .-4 ; 0x25aa0 delayMicroseconds(94); WRITE(BEEPER,LOW); 25aa4: 4f b7 in r20, 0x3f ; 63 25aa6: f8 94 cli 25aa8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25aac: 9b 7f andi r25, 0xFB ; 251 25aae: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25ab2: 4f bf out 0x3f, r20 ; 63 25ab4: f9 01 movw r30, r18 25ab6: 31 97 sbiw r30, 0x01 ; 1 25ab8: f1 f7 brne .-4 ; 0x25ab6 25aba: 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++) 25abc: 41 f7 brne .-48 ; 0x25a8e Sound_DoSound_Blind_Alert(); break; default: break; } } 25abe: 08 95 ret 00025ac0 : //! @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 ) { 25ac0: 2f 92 push r2 25ac2: 3f 92 push r3 25ac4: 4f 92 push r4 25ac6: 5f 92 push r5 25ac8: 6f 92 push r6 25aca: 7f 92 push r7 25acc: 8f 92 push r8 25ace: 9f 92 push r9 25ad0: af 92 push r10 25ad2: bf 92 push r11 25ad4: cf 92 push r12 25ad6: df 92 push r13 25ad8: ef 92 push r14 25ada: ff 92 push r15 25adc: 0f 93 push r16 25ade: 1f 93 push r17 25ae0: cf 93 push r28 25ae2: df 93 push r29 25ae4: 00 d0 rcall .+0 ; 0x25ae6 25ae6: 00 d0 rcall .+0 ; 0x25ae8 25ae8: cd b7 in r28, 0x3d ; 61 25aea: de b7 in r29, 0x3e ; 62 25aec: 5c 01 movw r10, r24 25aee: 6c 83 std Y+4, r22 ; 0x04 25af0: 34 2e mov r3, r20 25af2: 3b 83 std Y+3, r19 ; 0x03 25af4: 2a 83 std Y+2, r18 ; 0x02 25af6: 48 01 movw r8, r16 25af8: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 25afa: 00 97 sbiw r24, 0x00 ; 0 25afc: 09 f0 breq .+2 ; 0x25b00 25afe: 51 c0 rjmp .+162 ; 0x25ba2 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); 25b00: 87 01 movw r16, r14 25b02: 22 2d mov r18, r2 25b04: a4 01 movw r20, r8 25b06: 6a 81 ldd r22, Y+2 ; 0x02 25b08: 7b 81 ldd r23, Y+3 ; 0x03 25b0a: 83 2d mov r24, r3 25b0c: 0f 94 a3 0a call 0x21546 ; 0x21546 25b10: d1 2c mov r13, r1 25b12: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 25b14: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 25b18: 2b 01 movw r4, r22 25b1a: 3c 01 movw r6, r24 lcd_consume_click(); 25b1c: 0e 94 14 6c call 0xd828 ; 0xd828 KEEPALIVE_STATE(PAUSED_FOR_USER); 25b20: 84 e0 ldi r24, 0x04 ; 4 25b22: 80 93 78 02 sts 0x0278, r24 ; 0x800278 25b26: de 82 std Y+6, r13 ; 0x06 25b28: cd 82 std Y+5, r12 ; 0x05 25b2a: 24 e6 ldi r18, 0x64 ; 100 25b2c: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 25b2e: 82 e3 ldi r24, 0x32 ; 50 25b30: 90 e0 ldi r25, 0x00 ; 0 25b32: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 25b36: 3c 81 ldd r19, Y+4 ; 0x04 25b38: 31 11 cpse r19, r1 25b3a: 3a c0 rjmp .+116 ; 0x25bb0 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 25b3c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 25b40: 90 91 07 05 lds r25, 0x0507 ; 0x800507 25b44: 00 97 sbiw r24, 0x00 ; 0 25b46: 09 f0 breq .+2 ; 0x25b4a 25b48: 42 c0 rjmp .+132 ; 0x25bce } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 25b4a: 0e 94 19 6c call 0xd832 ; 0xd832 25b4e: 88 23 and r24, r24 25b50: 09 f4 brne .+2 ; 0x25b54 25b52: 67 c0 rjmp .+206 ; 0x25c22 if (msg_next == NULL) { 25b54: 8d 81 ldd r24, Y+5 ; 0x05 25b56: 9e 81 ldd r25, Y+6 ; 0x06 25b58: 89 2b or r24, r25 25b5a: 09 f0 breq .+2 ; 0x25b5e 25b5c: 5e c0 rjmp .+188 ; 0x25c1a if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 25b5e: 82 e0 ldi r24, 0x02 ; 2 25b60: 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; 25b64: 91 e0 ldi r25, 0x01 ; 1 25b66: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c lcd_draw_update = 2; 25b6a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b return current_selection; } 25b6e: 83 2d mov r24, r3 25b70: 26 96 adiw r28, 0x06 ; 6 25b72: 0f b6 in r0, 0x3f ; 63 25b74: f8 94 cli 25b76: de bf out 0x3e, r29 ; 62 25b78: 0f be out 0x3f, r0 ; 63 25b7a: cd bf out 0x3d, r28 ; 61 25b7c: df 91 pop r29 25b7e: cf 91 pop r28 25b80: 1f 91 pop r17 25b82: 0f 91 pop r16 25b84: ff 90 pop r15 25b86: ef 90 pop r14 25b88: df 90 pop r13 25b8a: cf 90 pop r12 25b8c: bf 90 pop r11 25b8e: af 90 pop r10 25b90: 9f 90 pop r9 25b92: 8f 90 pop r8 25b94: 7f 90 pop r7 25b96: 6f 90 pop r6 25b98: 5f 90 pop r5 25b9a: 4f 90 pop r4 25b9c: 3f 90 pop r3 25b9e: 2f 90 pop r2 25ba0: 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; 25ba2: 0f 94 f4 0a call 0x215e8 ; 0x215e8 25ba6: 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) { 25ba8: 89 2b or r24, r25 25baa: 09 f0 breq .+2 ; 0x25bae 25bac: b3 cf rjmp .-154 ; 0x25b14 25bae: a8 cf rjmp .-176 ; 0x25b00 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) { 25bb0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 25bb4: 64 19 sub r22, r4 25bb6: 75 09 sbc r23, r5 25bb8: 86 09 sbc r24, r6 25bba: 97 09 sbc r25, r7 25bbc: 61 33 cpi r22, 0x31 ; 49 25bbe: 75 47 sbci r23, 0x75 ; 117 25bc0: 81 05 cpc r24, r1 25bc2: 91 05 cpc r25, r1 25bc4: 08 f4 brcc .+2 ; 0x25bc8 25bc6: ba cf rjmp .-140 ; 0x25b3c current_selection = LCD_BUTTON_TIMEOUT; 25bc8: 33 24 eor r3, r3 25bca: 3a 94 dec r3 25bcc: c8 cf rjmp .-112 ; 0x25b5e goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 25bce: 2d 81 ldd r18, Y+5 ; 0x05 25bd0: 3e 81 ldd r19, Y+6 ; 0x06 25bd2: 23 2b or r18, r19 25bd4: f9 f4 brne .+62 ; 0x25c14 if (third_choice) { // third_choice is not nullptr, safe to dereference 25bd6: e1 14 cp r14, r1 25bd8: f1 04 cpc r15, r1 25bda: b1 f0 breq .+44 ; 0x25c08 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25bdc: 97 ff sbrs r25, 7 25bde: 0f c0 rjmp .+30 ; 0x25bfe 25be0: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 25be2: 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); 25be4: 87 01 movw r16, r14 25be6: 22 2d mov r18, r2 25be8: a4 01 movw r20, r8 25bea: 6a 81 ldd r22, Y+2 ; 0x02 25bec: 7b 81 ldd r23, Y+3 ; 0x03 25bee: 83 2d mov r24, r3 25bf0: 0f 94 a3 0a call 0x21546 ; 0x21546 lcd_encoder = 0; 25bf4: 10 92 07 05 sts 0x0507, r1 ; 0x800507 25bf8: 10 92 06 05 sts 0x0506, r1 ; 0x800506 25bfc: a6 cf rjmp .-180 ; 0x25b4a 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) { 25bfe: 32 e0 ldi r19, 0x02 ; 2 25c00: 33 16 cp r3, r19 25c02: 81 f3 breq .-32 ; 0x25be4 // Rotating knob clockwise current_selection++; 25c04: 33 94 inc r3 25c06: ee cf rjmp .-36 ; 0x25be4 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25c08: 39 2e mov r3, r25 25c0a: 30 94 com r3 25c0c: 33 1c adc r3, r3 25c0e: 33 24 eor r3, r3 25c10: 33 1c adc r3, r3 25c12: e8 cf rjmp .-48 ; 0x25be4 } } 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); 25c14: 87 e0 ldi r24, 0x07 ; 7 25c16: 0f 94 fd 2c call 0x259fa ; 0x259fa goto exit; } else break; } } if (multi_screen) { 25c1a: c1 14 cp r12, r1 25c1c: d1 04 cpc r13, r1 25c1e: 79 f4 brne .+30 ; 0x25c3e 25c20: 84 cf rjmp .-248 ; 0x25b2a 25c22: 99 81 ldd r25, Y+1 ; 0x01 25c24: 91 50 subi r25, 0x01 ; 1 25c26: 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) { 25c28: 91 11 cpse r25, r1 25c2a: 81 cf rjmp .-254 ; 0x25b2e goto exit; } else break; } } if (multi_screen) { 25c2c: c1 14 cp r12, r1 25c2e: d1 04 cpc r13, r1 25c30: 61 f0 breq .+24 ; 0x25c4a if (msg_next == NULL) { 25c32: 2d 81 ldd r18, Y+5 ; 0x05 25c34: 3e 81 ldd r19, Y+6 ; 0x06 25c36: 23 2b or r18, r19 25c38: 11 f4 brne .+4 ; 0x25c3e 25c3a: be 82 std Y+6, r11 ; 0x06 25c3c: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 25c3e: 8d 81 ldd r24, Y+5 ; 0x05 25c40: 9e 81 ldd r25, Y+6 ; 0x06 25c42: 0f 94 f4 0a call 0x215e8 ; 0x215e8 25c46: 9e 83 std Y+6, r25 ; 0x06 25c48: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 25c4a: 8d 81 ldd r24, Y+5 ; 0x05 25c4c: 9e 81 ldd r25, Y+6 ; 0x06 25c4e: 89 2b or r24, r25 25c50: 09 f0 breq .+2 ; 0x25c54 25c52: 6b cf rjmp .-298 ; 0x25b2a lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 25c54: 87 01 movw r16, r14 25c56: 22 2d mov r18, r2 25c58: a4 01 movw r20, r8 25c5a: 6a 81 ldd r22, Y+2 ; 0x02 25c5c: 7b 81 ldd r23, Y+3 ; 0x03 25c5e: 83 2d mov r24, r3 25c60: 0f 94 a3 0a call 0x21546 ; 0x21546 25c64: 62 cf rjmp .-316 ; 0x25b2a 00025c66 : //! @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) { 25c66: bf 92 push r11 25c68: cf 92 push r12 25c6a: df 92 push r13 25c6c: ef 92 push r14 25c6e: ff 92 push r15 25c70: 0f 93 push r16 25c72: 1f 93 push r17 25c74: cf 93 push r28 25c76: df 93 push r29 25c78: ec 01 movw r28, r24 25c7a: d6 2e mov r13, r22 25c7c: 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); 25c7e: 89 e0 ldi r24, 0x09 ; 9 25c80: 9e e3 ldi r25, 0x3E ; 62 25c82: 0e 94 32 6d call 0xda64 ; 0xda64 25c86: 8c 01 movw r16, r24 25c88: 83 e0 ldi r24, 0x03 ; 3 25c8a: 9e e3 ldi r25, 0x3E ; 62 25c8c: 0e 94 32 6d call 0xda64 ; 0xda64 25c90: 2a e0 ldi r18, 0x0A ; 10 25c92: c2 2e mov r12, r18 25c94: f1 2c mov r15, r1 25c96: e1 2c mov r14, r1 25c98: 9c 01 movw r18, r24 25c9a: 4b 2d mov r20, r11 25c9c: 6d 2d mov r22, r13 25c9e: ce 01 movw r24, r28 25ca0: 0f 94 60 2d call 0x25ac0 ; 0x25ac0 } 25ca4: df 91 pop r29 25ca6: cf 91 pop r28 25ca8: 1f 91 pop r17 25caa: 0f 91 pop r16 25cac: ff 90 pop r15 25cae: ef 90 pop r14 25cb0: df 90 pop r13 25cb2: cf 90 pop r12 25cb4: bf 90 pop r11 25cb6: 08 95 ret 00025cb8 : //! ---------------------- | ---------------- //! 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) { 25cb8: af 92 push r10 25cba: bf 92 push r11 25cbc: cf 92 push r12 25cbe: df 92 push r13 25cc0: ef 92 push r14 25cc2: ff 92 push r15 25cc4: 0f 93 push r16 25cc6: 1f 93 push r17 25cc8: cf 93 push r28 25cca: 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); 25ccc: 88 23 and r24, r24 25cce: 29 f0 breq .+10 ; 0x25cda 25cd0: 61 e0 ldi r22, 0x01 ; 1 25cd2: 8f e5 ldi r24, 0x5F ; 95 25cd4: 9f e0 ldi r25, 0x0F ; 15 25cd6: 0f 94 60 a1 call 0x342c0 ; 0x342c0 FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25cda: 89 e2 ldi r24, 0x29 ; 41 25cdc: e8 2e mov r14, r24 25cde: 89 e9 ldi r24, 0x99 ; 153 25ce0: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25ce2: 97 ed ldi r25, 0xD7 ; 215 25ce4: c9 2e mov r12, r25 25ce6: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25ce8: 2c e3 ldi r18, 0x3C ; 60 25cea: a2 2e mov r10, r18 25cec: b1 2c mov r11, r1 25cee: 0c 2f mov r16, r28 25cf0: 10 e0 ldi r17, 0x00 ; 0 25cf2: 1f 92 push r1 25cf4: cf 93 push r28 25cf6: ff 92 push r15 25cf8: ef 92 push r14 25cfa: 0f 94 fe 9f call 0x33ffc ; 0x33ffc switch (state) { 25cfe: 0f 90 pop r0 25d00: 0f 90 pop r0 25d02: 0f 90 pop r0 25d04: 0f 90 pop r0 25d06: ef ef ldi r30, 0xFF ; 255 25d08: ec 0f add r30, r28 25d0a: ed 30 cpi r30, 0x0D ; 13 25d0c: a0 f4 brcc .+40 ; 0x25d36 25d0e: f0 e0 ldi r31, 0x00 ; 0 25d10: 88 27 eor r24, r24 25d12: e2 57 subi r30, 0x72 ; 114 25d14: f1 4d sbci r31, 0xD1 ; 209 25d16: 8e 4f sbci r24, 0xFE ; 254 25d18: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 25d1c: dd 37 cpi r29, 0x7D ; 125 25d1e: 07 38 cpi r16, 0x87 ; 135 25d20: df 38 cpi r29, 0x8F ; 143 25d22: 57 37 cpi r21, 0x77 ; 119 25d24: cb 38 cpi r28, 0x8B ; 139 25d26: 9f 37 cpi r25, 0x7F ; 127 25d28: c9 38 cpi r28, 0x89 ; 137 25d2a: 13 37 cpi r17, 0x73 ; 115 25d2c: 53 38 cpi r21, 0x83 ; 131 25d2e: 73 38 cpi r23, 0x83 ; 131 25d30: 03 38 cpi r16, 0x83 ; 131 25d32: e7 37 cpi r30, 0x77 ; 119 25d34: e7 37 cpi r30, 0x77 ; 119 // 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; 25d36: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 25d3a: 8f e5 ldi r24, 0x5F ; 95 25d3c: 9f e0 ldi r25, 0x0F ; 15 25d3e: 0f 94 3c a1 call 0x34278 ; 0x34278 25d42: 82 30 cpi r24, 0x02 ; 2 25d44: 39 f4 brne .+14 ; 0x25d54 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 25d46: 8f e3 ldi r24, 0x3F ; 63 25d48: 95 e5 ldi r25, 0x55 ; 85 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)); 25d4a: 0e 94 32 6d call 0xda64 ; 0xda64 25d4e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 25d52: 0f c0 rjmp .+30 ; 0x25d72 // 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); 25d54: 8a ed ldi r24, 0xDA ; 218 25d56: 94 e5 ldi r25, 0x54 ; 84 25d58: 0e 94 32 6d call 0xda64 ; 0xda64 25d5c: 40 e0 ldi r20, 0x00 ; 0 25d5e: 60 e0 ldi r22, 0x00 ; 0 25d60: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25d64: 81 11 cpse r24, r1 25d66: 07 c0 rjmp .+14 ; 0x25d76 25d68: 61 e0 ldi r22, 0x01 ; 1 25d6a: 8f e5 ldi r24, 0x5F ; 95 25d6c: 9f e0 ldi r25, 0x0F ; 15 25d6e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 25d72: c1 e0 ldi r28, 0x01 ; 1 25d74: bc cf rjmp .-136 ; 0x25cee 25d76: 60 e0 ldi r22, 0x00 ; 0 25d78: 8f e5 ldi r24, 0x5F ; 95 25d7a: 9f e0 ldi r25, 0x0F ; 15 25d7c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 25d80: 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); 25d82: 10 e0 ldi r17, 0x00 ; 0 25d84: 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); 25d86: 1f 93 push r17 25d88: 0f 93 push r16 25d8a: 82 ee ldi r24, 0xE2 ; 226 25d8c: 9b e6 ldi r25, 0x6B ; 107 25d8e: 9f 93 push r25 25d90: 8f 93 push r24 25d92: 0f 94 fe 9f call 0x33ffc ; 0x33ffc switch (state) { 25d96: 0f 90 pop r0 25d98: 0f 90 pop r0 25d9a: 0f 90 pop r0 25d9c: 0f 90 pop r0 25d9e: cc 30 cpi r28, 0x0C ; 12 25da0: 09 f4 brne .+2 ; 0x25da4 25da2: ed c0 rjmp .+474 ; 0x25f7e 25da4: cd 30 cpi r28, 0x0D ; 13 25da6: 09 f4 brne .+2 ; 0x25daa 25da8: ff c0 rjmp .+510 ; 0x25fa8 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 25daa: 89 e3 ldi r24, 0x39 ; 57 25dac: 92 e5 ldi r25, 0x52 ; 82 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 25dae: cc 23 and r28, r28 25db0: 09 f4 brne .+2 ; 0x25db4 25db2: fc c0 rjmp .+504 ; 0x25fac break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 25db4: 81 e0 ldi r24, 0x01 ; 1 25db6: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_update(2); 25dba: 82 e0 ldi r24, 0x02 ; 2 } 25dbc: cf 91 pop r28 25dbe: 1f 91 pop r17 25dc0: 0f 91 pop r16 25dc2: ff 90 pop r15 25dc4: ef 90 pop r14 25dc6: df 90 pop r13 25dc8: cf 90 pop r12 25dca: bf 90 pop r11 25dcc: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 25dce: 0c 94 c3 69 jmp 0xd386 ; 0xd386 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25dd2: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 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)) { 25dd6: 81 e0 ldi r24, 0x01 ; 1 25dd8: 0e 94 4c d8 call 0x1b098 ; 0x1b098 state = S::Selftest; 25ddc: 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)) { 25dde: 88 23 and r24, r24 25de0: 09 f4 brne .+2 ; 0x25de4 25de2: 85 cf rjmp .-246 ; 0x25cee state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 25de4: 82 e0 ldi r24, 0x02 ; 2 25de6: 0e 94 4c d8 call 0x1b098 ; 0x1b098 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 25dea: 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)) { 25dec: 88 23 and r24, r24 25dee: 09 f4 brne .+2 ; 0x25df2 25df0: 7e cf rjmp .-260 ; 0x25cee // 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)) { 25df2: 84 e0 ldi r24, 0x04 ; 4 25df4: 0e 94 4c d8 call 0x1b098 ; 0x1b098 state = S::Z; 25df8: 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)) { 25dfa: 88 23 and r24, r24 25dfc: 09 f4 brne .+2 ; 0x25e00 25dfe: 77 cf rjmp .-274 ; 0x25cee 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)) { 25e00: 80 e1 ldi r24, 0x10 ; 16 25e02: 0e 94 4c d8 call 0x1b098 ; 0x1b098 state = S::IsFil; 25e06: 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)) { 25e08: 88 23 and r24, r24 25e0a: 09 f4 brne .+2 ; 0x25e0e 25e0c: 70 cf rjmp .-288 ; 0x25cee state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 25e0e: cc e0 ldi r28, 0x0C ; 12 25e10: 6e cf rjmp .-292 ; 0x25cee } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 25e12: 81 e9 ldi r24, 0x91 ; 145 25e14: 94 e5 ldi r25, 0x54 ; 84 25e16: 0e 94 32 6d call 0xda64 ; 0xda64 25e1a: 0f 94 7b 0b call 0x216f6 ; 0x216f6 wizard_event = lcd_selftest(); 25e1e: 0e 94 fd f3 call 0x1e7fa ; 0x1e7fa 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); 25e22: 81 11 cpse r24, r1 25e24: a6 cf rjmp .-180 ; 0x25d72 } 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); 25e26: cd e0 ldi r28, 0x0D ; 13 25e28: 62 cf rjmp .-316 ; 0x25cee break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 25e2a: 83 e5 ldi r24, 0x53 ; 83 25e2c: 94 e5 ldi r25, 0x54 ; 84 25e2e: 0e 94 32 6d call 0xda64 ; 0xda64 25e32: 0f 94 7b 0b call 0x216f6 ; 0x216f6 wizard_event = gcode_M45(false, 0); 25e36: 80 e0 ldi r24, 0x00 ; 0 25e38: 0e 94 8a c6 call 0x18d14 ; 0x18d14 25e3c: f2 cf rjmp .-28 ; 0x25e22 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 25e3e: 8b e2 ldi r24, 0x2B ; 43 25e40: 94 e5 ldi r25, 0x54 ; 84 25e42: 0e 94 32 6d call 0xda64 ; 0xda64 25e46: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 25e4a: 8d ef ldi r24, 0xFD ; 253 25e4c: 93 e5 ldi r25, 0x53 ; 83 25e4e: 0e 94 32 6d call 0xda64 ; 0xda64 25e52: 0f 94 7b 0b call 0x216f6 ; 0x216f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 25e56: 8d ed ldi r24, 0xDD ; 221 25e58: 93 e5 ldi r25, 0x53 ; 83 25e5a: 0e 94 32 6d call 0xda64 ; 0xda64 25e5e: 0f 94 7b 0b call 0x216f6 ; 0x216f6 wizard_event = gcode_M45(true, 0); 25e62: 81 e0 ldi r24, 0x01 ; 1 25e64: 0e 94 8a c6 call 0x18d14 ; 0x18d14 if (!wizard_event) { 25e68: 88 23 and r24, r24 25e6a: e9 f2 breq .-70 ; 0x25e26 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 25e6c: 60 e0 ldi r22, 0x00 ; 0 25e6e: 70 e0 ldi r23, 0x00 ; 0 25e70: 88 ed ldi r24, 0xD8 ; 216 25e72: 91 e4 ldi r25, 0x41 ; 65 25e74: 0e 94 c0 67 call 0xcf80 ; 0xcf80 if(!MMU2::mmu2.Enabled()) { 25e78: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25e7c: 81 30 cpi r24, 0x01 ; 1 25e7e: 09 f4 brne .+2 ; 0x25e82 25e80: 78 cf rjmp .-272 ; 0x25d72 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25e82: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25e86: 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)); 25e8a: 88 eb ldi r24, 0xB8 ; 184 25e8c: 93 e5 ldi r25, 0x53 ; 83 25e8e: 0e 94 32 6d call 0xda64 ; 0xda64 25e92: 0f 94 f4 0a call 0x215e8 ; 0x215e8 wait_preheat(); 25e96: 0f 94 01 0b call 0x21602 ; 0x21602 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 25e9a: 60 e0 ldi r22, 0x00 ; 0 25e9c: 70 e0 ldi r23, 0x00 ; 0 25e9e: cb 01 movw r24, r22 25ea0: 0e 94 58 f0 call 0x1e0b0 ; 0x1e0b0 lcd_wizard_load(); // load filament 25ea4: 0f 94 e4 0b call 0x217c8 ; 0x217c8 25ea8: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 25eac: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 25eb0: 60 cf rjmp .-320 ; 0x25d72 25eb2: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25eb6: c0 92 f1 11 sts 0x11F1, r12 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25eba: b0 92 ee 11 sts 0x11EE, r11 ; 0x8011ee 25ebe: 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); 25ec2: 82 ea ldi r24, 0xA2 ; 162 25ec4: 93 e5 ldi r25, 0x53 ; 83 25ec6: 0e 94 32 6d call 0xda64 ; 0xda64 25eca: 41 e0 ldi r20, 0x01 ; 1 25ecc: 60 e0 ldi r22, 0x00 ; 0 25ece: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25ed2: 88 23 and r24, r24 25ed4: 09 f1 breq .+66 ; 0x25f18 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 25ed6: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25eda: c7 e0 ldi r28, 0x07 ; 7 25edc: 81 30 cpi r24, 0x01 ; 1 25ede: 09 f4 brne .+2 ; 0x25ee2 25ee0: 06 cf rjmp .-500 ; 0x25cee else state = S::Preheat; 25ee2: c6 e0 ldi r28, 0x06 ; 6 25ee4: 04 cf rjmp .-504 ; 0x25cee } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 25ee6: 20 e0 ldi r18, 0x00 ; 0 25ee8: 41 e0 ldi r20, 0x01 ; 1 25eea: 70 e0 ldi r23, 0x00 ; 0 25eec: 60 e0 ldi r22, 0x00 ; 0 25eee: 8b e0 ldi r24, 0x0B ; 11 25ef0: 98 e3 ldi r25, 0x38 ; 56 25ef2: 0f 94 46 94 call 0x3288c ; 0x3288c lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 25ef6: 81 e6 ldi r24, 0x61 ; 97 25ef8: 93 e5 ldi r25, 0x53 ; 83 25efa: 0e 94 32 6d call 0xda64 ; 0xda64 25efe: 0f 94 7b 0b call 0x216f6 ; 0x216f6 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); 25f02: 06 e0 ldi r16, 0x06 ; 6 25f04: 10 e0 ldi r17, 0x00 ; 0 25f06: 3f cf rjmp .-386 ; 0x25d86 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(); 25f08: 0f 94 01 0b call 0x21602 ; 0x21602 lcd_wizard_load(); 25f0c: 0f 94 e4 0b call 0x217c8 ; 0x217c8 state = S::Lay1CalHot; 25f10: ca e0 ldi r28, 0x0A ; 10 25f12: ed ce rjmp .-550 ; 0x25cee break; case S::LoadFilCold: lcd_wizard_load(); 25f14: 0f 94 e4 0b call 0x217c8 ; 0x217c8 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; 25f18: c9 e0 ldi r28, 0x09 ; 9 25f1a: e9 ce rjmp .-558 ; 0x25cee case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 25f1c: 81 e0 ldi r24, 0x01 ; 1 25f1e: 0f 94 c6 0b call 0x2178c ; 0x2178c menu_goto(lcd_v2_calibration, 0, true); 25f22: 20 e0 ldi r18, 0x00 ; 0 25f24: 41 e0 ldi r20, 0x01 ; 1 25f26: 70 e0 ldi r23, 0x00 ; 0 25f28: 60 e0 ldi r22, 0x00 ; 0 25f2a: 8f e8 ldi r24, 0x8F ; 143 25f2c: 98 e3 ldi r25, 0x38 ; 56 25f2e: 0f 94 46 94 call 0x3288c ; 0x3288c 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); 25f32: 09 e0 ldi r16, 0x09 ; 9 25f34: 10 e0 ldi r17, 0x00 ; 0 25f36: 27 cf rjmp .-434 ; 0x25d86 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); 25f38: 80 e0 ldi r24, 0x00 ; 0 25f3a: 0f 94 c6 0b call 0x2178c ; 0x2178c lcd_commands_type = LcdCommands::Layer1Cal; 25f3e: 84 e0 ldi r24, 0x04 ; 4 25f40: 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); 25f44: 0a e0 ldi r16, 0x0A ; 10 25f46: 10 e0 ldi r17, 0x00 ; 0 25f48: 1e cf rjmp .-452 ; 0x25d86 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); 25f4a: 8e e0 ldi r24, 0x0E ; 14 25f4c: 93 e5 ldi r25, 0x53 ; 83 25f4e: 0e 94 32 6d call 0xda64 ; 0xda64 25f52: 41 e0 ldi r20, 0x01 ; 1 25f54: 60 e0 ldi r22, 0x00 ; 0 25f56: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 25f5a: 81 11 cpse r24, r1 25f5c: 07 c0 rjmp .+14 ; 0x25f6c { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 25f5e: 8e ed ldi r24, 0xDE ; 222 25f60: 92 e5 ldi r25, 0x52 ; 82 25f62: 0e 94 32 6d call 0xda64 ; 0xda64 25f66: 0f 94 7b 0b call 0x216f6 ; 0x216f6 25f6a: d6 cf rjmp .-84 ; 0x25f18 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 25f6c: 88 e7 ldi r24, 0x78 ; 120 25f6e: 92 e5 ldi r25, 0x52 ; 82 25f70: ec ce rjmp .-552 ; 0x25d4a 25f72: 60 e0 ldi r22, 0x00 ; 0 25f74: 8f e5 ldi r24, 0x5F ; 95 25f76: 9f e0 ldi r25, 0x0F ; 15 25f78: 0f 94 60 a1 call 0x342c0 ; 0x342c0 25f7c: 04 cf rjmp .-504 ; 0x25d86 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 25f7e: 8a e1 ldi r24, 0x1A ; 26 25f80: 92 e5 ldi r25, 0x52 ; 82 25f82: 0e 94 32 6d call 0xda64 ; 0xda64 25f86: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25f88: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 25f8c: 8b e0 ldi r24, 0x0B ; 11 25f8e: 9c e6 ldi r25, 0x6C ; 108 25f90: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 lcd_return_to_status(); 25f94: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e default: // exiting for later re-entry break; } if (msg) { 25f98: 01 15 cp r16, r1 25f9a: 11 05 cpc r17, r1 25f9c: 09 f4 brne .+2 ; 0x25fa0 25f9e: 0a cf rjmp .-492 ; 0x25db4 lcd_show_fullscreen_message_and_wait_P(msg); 25fa0: c8 01 movw r24, r16 25fa2: 0f 94 7b 0b call 0x216f6 ; 0x216f6 25fa6: 06 cf rjmp .-500 ; 0x25db4 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 25fa8: 88 eb ldi r24, 0xB8 ; 184 25faa: 91 e5 ldi r25, 0x51 ; 81 25fac: 0e 94 32 6d call 0xda64 ; 0xda64 25fb0: 8c 01 movw r16, r24 25fb2: f2 cf rjmp .-28 ; 0x25f98 00025fb4 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 25fb4: cf 93 push r28 25fb6: 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); 25fb8: 8b e9 ldi r24, 0x9B ; 155 25fba: 91 e5 ldi r25, 0x51 ; 81 25fbc: 0e 94 32 6d call 0xda64 ; 0xda64 25fc0: 41 e0 ldi r20, 0x01 ; 1 25fc2: 4c 27 eor r20, r28 25fc4: 60 e0 ldi r22, 0x00 ; 0 25fc6: 0f 94 33 2e call 0x25c66 ; 0x25c66 25fca: 91 e0 ldi r25, 0x01 ; 1 25fcc: 81 11 cpse r24, r1 25fce: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 25fd0: c9 17 cp r28, r25 25fd2: 59 f0 breq .+22 ; 0x25fea lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 25fd4: 81 e7 ldi r24, 0x71 ; 113 25fd6: 91 e5 ldi r25, 0x51 ; 81 25fd8: cc 23 and r28, r28 25fda: 11 f0 breq .+4 ; 0x25fe0 25fdc: 89 e0 ldi r24, 0x09 ; 9 25fde: 97 e4 ldi r25, 0x47 ; 71 25fe0: 0e 94 32 6d call 0xda64 ; 0xda64 } #endif //STEEL_SHEET } 25fe4: 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)); 25fe6: 0d 94 7b 0b jmp 0x216f6 ; 0x216f6 } #endif //STEEL_SHEET } 25fea: cf 91 pop r28 25fec: 08 95 ret 00025fee : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 25fee: cf 93 push r28 25ff0: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 25ff2: 88 e4 ldi r24, 0x48 ; 72 25ff4: 91 e5 ldi r25, 0x51 ; 81 25ff6: 0e 94 32 6d call 0xda64 ; 0xda64 25ffa: 40 e0 ldi r20, 0x00 ; 0 25ffc: 6c 2f mov r22, r28 25ffe: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (result == LCD_LEFT_BUTTON_CHOICE) { 26002: 81 11 cpse r24, r1 26004: 03 c0 rjmp .+6 ; 0x2600c lcd_mesh_calibration_z(); } } 26006: 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(); 26008: 0c 94 81 fe jmp 0x1fd02 ; 0x1fd02 } } 2600c: cf 91 pop r28 2600e: 08 95 ret 00026010 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 26010: 87 e1 ldi r24, 0x17 ; 23 26012: 0e 94 4c d8 call 0x1b098 ; 0x1b098 26016: 81 11 cpse r24, r1 26018: 06 c0 rjmp .+12 ; 0x26026 // calibration already performed: ask before clearing the previous status result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_RERUN), false); } if (result) { calibration_status_clear(CALIBRATION_WIZARD_STEPS); 2601a: 87 e1 ldi r24, 0x17 ; 23 2601c: 0e 94 28 c6 call 0x18c50 ; 0x18c50 lcd_wizard(WizState::Run); 26020: 80 e0 ldi r24, 0x00 ; 0 26022: 0d 94 5c 2e jmp 0x25cb8 ; 0x25cb8 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_yes_no_and_wait_P(_T(MSG_WIZARD_RERUN), false); 26026: 86 ea ldi r24, 0xA6 ; 166 26028: 9e e4 ldi r25, 0x4E ; 78 2602a: 0e 94 32 6d call 0xda64 ; 0xda64 2602e: 41 e0 ldi r20, 0x01 ; 1 26030: 60 e0 ldi r22, 0x00 ; 0 26032: 0f 94 33 2e call 0x25c66 ; 0x25c66 } if (result) { 26036: 88 23 and r24, r24 26038: 81 f3 breq .-32 ; 0x2601a calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2603a: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e lcd_update_enable(true); 2603e: 81 e0 ldi r24, 0x01 ; 1 26040: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_update(2); 26044: 82 e0 ldi r24, 0x02 ; 2 26046: 0c 94 c3 69 jmp 0xd386 ; 0xd386 0002604a : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2604a: cf 92 push r12 2604c: ef 92 push r14 2604e: ff 92 push r15 26050: 0f 93 push r16 26052: 1f 93 push r17 26054: cf 93 push r28 26056: df 93 push r29 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), 8); 26058: 81 e4 ldi r24, 0x41 ; 65 2605a: 9b e4 ldi r25, 0x4B ; 75 2605c: 0e 94 32 6d call 0xda64 ; 0xda64 26060: 7c 01 movw r14, r24 26062: 89 e0 ldi r24, 0x09 ; 9 26064: 9e e3 ldi r25, 0x3E ; 62 26066: 0e 94 32 6d call 0xda64 ; 0xda64 2606a: 8c 01 movw r16, r24 2606c: 83 e0 ldi r24, 0x03 ; 3 2606e: 9e e3 ldi r25, 0x3E ; 62 26070: 0e 94 32 6d call 0xda64 ; 0xda64 26074: ec 01 movw r28, r24 26076: 86 e1 ldi r24, 0x16 ; 22 26078: 9b e4 ldi r25, 0x4B ; 75 2607a: 0e 94 32 6d call 0xda64 ; 0xda64 2607e: 28 e0 ldi r18, 0x08 ; 8 26080: c2 2e mov r12, r18 26082: 9e 01 movw r18, r28 26084: 40 e0 ldi r20, 0x00 ; 0 26086: 60 e0 ldi r22, 0x00 ; 0 26088: 0f 94 60 2d call 0x25ac0 ; 0x25ac0 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2608c: 81 30 cpi r24, 0x01 ; 1 2608e: 29 f4 brne .+10 ; 0x2609a load_filament_final_feed(); 26090: 0e 94 f6 5e call 0xbdec ; 0xbdec st_synchronize(); 26094: 0f 94 a0 22 call 0x24540 ; 0x24540 26098: df cf rjmp .-66 ; 0x26058 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), 8); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { 2609a: 82 30 cpi r24, 0x02 ; 2 2609c: 61 f4 brne .+24 ; 0x260b6 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2609e: 60 e0 ldi r22, 0x00 ; 0 260a0: 70 e0 ldi r23, 0x00 ; 0 260a2: cb 01 movw r24, r22 } } 260a4: df 91 pop r29 260a6: cf 91 pop r28 260a8: 1f 91 pop r17 260aa: 0f 91 pop r16 260ac: ff 90 pop r15 260ae: ef 90 pop r14 260b0: 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), 8); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { unload_filament(FILAMENTCHANGE_FINALRETRACT); 260b2: 0c 94 58 f0 jmp 0x1e0b0 ; 0x1e0b0 } } 260b6: df 91 pop r29 260b8: cf 91 pop r28 260ba: 1f 91 pop r17 260bc: 0f 91 pop r16 260be: ff 90 pop r15 260c0: ef 90 pop r14 260c2: cf 90 pop r12 260c4: 08 95 ret 000260c6 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 260c6: 0f 93 push r16 260c8: 1f 93 push r17 260ca: cf 93 push r28 260cc: df 93 push r29 260ce: 8c 01 movw r16, r24 260d0: 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; 260d2: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 260d6: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 260da: 0e 94 0b fe call 0x1fc16 ; 0x1fc16 260de: 81 11 cpse r24, r1 260e0: 04 c0 rjmp .+8 ; 0x260ea resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 260e2: d0 93 ee 11 sts 0x11EE, r29 ; 0x8011ee 260e6: c0 93 ed 11 sts 0x11ED, r28 ; 0x8011ed { const FilamentAction action = eFilamentAction; 260ea: c0 91 62 03 lds r28, 0x0362 ; 0x800362 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 260ee: 87 ef ldi r24, 0xF7 ; 247 260f0: 8c 0f add r24, r28 260f2: 82 30 cpi r24, 0x02 ; 2 260f4: f8 f4 brcc .+62 ; 0x26134 { lcd_return_to_status(); 260f6: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e if (action == FilamentAction::Lay1Cal) 260fa: ca 30 cpi r28, 0x0A ; 10 260fc: 41 f4 brne .+16 ; 0x2610e { lcd_commands_type = LcdCommands::Layer1Cal; 260fe: 84 e0 ldi r24, 0x04 ; 4 26100: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 } menu_back(); clearFilamentAction(); } } } 26104: df 91 pop r29 26106: cf 91 pop r28 26108: 1f 91 pop r17 2610a: 0f 91 pop r16 2610c: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2610e: 60 e0 ldi r22, 0x00 ; 0 26110: 70 e0 ldi r23, 0x00 ; 0 26112: 80 e2 ldi r24, 0x20 ; 32 26114: 91 e4 ldi r25, 0x41 ; 65 26116: 0e 94 c0 67 call 0xcf80 ; 0xcf80 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2611a: 8f e5 ldi r24, 0x5F ; 95 2611c: 9f e0 ldi r25, 0x0F ; 15 2611e: 0f 94 3c a1 call 0x34278 ; 0x34278 26122: 88 23 and r24, r24 26124: 79 f3 breq .-34 ; 0x26104 lcd_wizard(WizState::LoadFilHot); 26126: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 26128: df 91 pop r29 2612a: cf 91 pop r28 2612c: 1f 91 pop r17 2612e: 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); 26130: 0d 94 5c 2e jmp 0x25cb8 ; 0x25cb8 26134: 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) 26138: 80 91 83 06 lds r24, 0x0683 ; 0x800683 2613c: 81 11 cpse r24, r1 2613e: 12 c0 rjmp .+36 ; 0x26164 26140: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 26144: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 26148: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2614c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 26150: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 26154: 60 1b sub r22, r16 26156: 71 0b sbc r23, r17 26158: 6c 5f subi r22, 0xFC ; 252 2615a: 7f 4f sbci r23, 0xFF ; 255 2615c: 69 30 cpi r22, 0x09 ; 9 2615e: 71 05 cpc r23, r1 26160: 08 f0 brcs .+2 ; 0x26164 26162: 60 c0 rjmp .+192 ; 0x26224 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 26164: c1 50 subi r28, 0x01 ; 1 26166: c8 30 cpi r28, 0x08 ; 8 26168: 88 f5 brcc .+98 ; 0x261cc 2616a: ec 2f mov r30, r28 2616c: f0 e0 ldi r31, 0x00 ; 0 2616e: 88 27 eor r24, r24 26170: e3 54 subi r30, 0x43 ; 67 26172: ff 4c sbci r31, 0xCF ; 207 26174: 8e 4f sbci r24, 0xFE ; 254 26176: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 2617a: e5 37 cpi r30, 0x75 ; 117 2617c: e5 37 cpi r30, 0x75 ; 117 2617e: e5 37 cpi r30, 0x75 ; 117 26180: a1 38 cpi r26, 0x81 ; 129 26182: 9d 38 cpi r25, 0x8D ; 141 26184: 49 37 cpi r20, 0x79 ; 121 26186: 43 38 cpi r20, 0x83 ; 131 26188: e7 38 cpi r30, 0x87 ; 135 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2618a: c0 e6 ldi r28, 0x60 ; 96 2618c: dc eb ldi r29, 0xBC ; 188 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2618e: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26192: 88 23 and r24, r24 26194: 29 f0 breq .+10 ; 0x261a0 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 26196: 82 e0 ldi r24, 0x02 ; 2 26198: 0f 94 fd 2c call 0x259fa ; 0x259fa bFilamentWaitingFlag = false; 2619c: 10 92 81 06 sts 0x0681, r1 ; 0x800681 } if (filamentActionMenu) { 261a0: 20 97 sbiw r28, 0x00 ; 0 261a2: 09 f4 brne .+2 ; 0x261a6 261a4: af cf rjmp .-162 ; 0x26104 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 261a6: 0f 94 e2 06 call 0x20dc4 ; 0x20dc4 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 261aa: 61 e0 ldi r22, 0x01 ; 1 261ac: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 261ae: df 91 pop r29 261b0: cf 91 pop r28 261b2: 1f 91 pop r17 261b4: 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); 261b6: 0d 94 89 95 jmp 0x32b12 ; 0x32b12 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 261ba: 80 91 81 06 lds r24, 0x0681 ; 0x800681 261be: 88 23 and r24, r24 261c0: 41 f0 breq .+16 ; 0x261d2 261c2: 61 e0 ldi r22, 0x01 ; 1 261c4: 87 e2 ldi r24, 0x27 ; 39 261c6: 98 e3 ldi r25, 0x38 ; 56 261c8: 0f 94 89 95 call 0x32b12 ; 0x32b12 // 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; 261cc: d0 e0 ldi r29, 0x00 ; 0 261ce: c0 e0 ldi r28, 0x00 ; 0 261d0: de cf rjmp .-68 ; 0x2618e case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 261d2: 0f 94 e2 06 call 0x20dc4 ; 0x20dc4 if (eFilamentAction == FilamentAction::AutoLoad) { 261d6: 80 91 62 03 lds r24, 0x0362 ; 0x800362 261da: 82 30 cpi r24, 0x02 ; 2 261dc: 19 f4 brne .+6 ; 0x261e4 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 261de: 81 e0 ldi r24, 0x01 ; 1 261e0: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } if (eFilamentAction == FilamentAction::Load) 261e4: 80 91 62 03 lds r24, 0x0362 ; 0x800362 261e8: 81 30 cpi r24, 0x01 ; 1 261ea: 31 f4 brne .+12 ; 0x261f8 enquecommand_P(MSG_M701); // load filament 261ec: 61 e0 ldi r22, 0x01 ; 1 261ee: 87 e3 ldi r24, 0x37 ; 55 261f0: 9b e6 ldi r25, 0x6B ; 107 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 261f2: 0e 94 37 7d call 0xfa6e ; 0xfa6e 261f6: ea cf rjmp .-44 ; 0x261cc eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 261f8: 83 30 cpi r24, 0x03 ; 3 261fa: 41 f7 brne .-48 ; 0x261cc enquecommand_P(MSG_M702); // unload filament 261fc: 61 e0 ldi r22, 0x01 ; 1 261fe: 81 eb ldi r24, 0xB1 ; 177 26200: 98 e6 ldi r25, 0x68 ; 104 26202: f7 cf rjmp .-18 ; 0x261f2 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 26204: ca ed ldi r28, 0xDA ; 218 26206: db eb ldi r29, 0xBB ; 187 26208: c2 cf rjmp .-124 ; 0x2618e break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2620a: 0f 94 e2 06 call 0x20dc4 ; 0x20dc4 MMU2::mmu2.unload(); 2620e: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 // 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(); 26212: 0f 94 63 0c call 0x218c6 ; 0x218c6 26216: da cf rjmp .-76 ; 0x261cc break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 26218: c8 e5 ldi r28, 0x58 ; 88 2621a: dc eb ldi r29, 0xBC ; 188 2621c: b8 cf rjmp .-144 ; 0x2618e break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2621e: c0 e5 ldi r28, 0x50 ; 80 26220: dc eb ldi r29, 0xBC ; 188 26222: b5 cf rjmp .-150 ; 0x2618e menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 26224: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26228: 88 23 and r24, r24 2622a: 21 f0 breq .+8 ; 0x26234 2622c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 26230: 88 23 and r24, r24 26232: 71 f1 breq .+92 ; 0x26290 // 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; 26234: 81 e0 ldi r24, 0x01 ; 1 26236: 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; 2623a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_clear(); 2623e: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 26242: 8c e9 ldi r24, 0x9C ; 156 26244: 9e e4 ldi r25, 0x4E ; 78 26246: 0e 94 32 6d call 0xda64 ; 0xda64 2624a: ac 01 movw r20, r24 2624c: 63 e0 ldi r22, 0x03 ; 3 2624e: 80 e0 ldi r24, 0x00 ; 0 26250: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(0, 1); 26254: 61 e0 ldi r22, 0x01 ; 1 26256: 80 e0 ldi r24, 0x00 ; 0 26258: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 switch (eFilamentAction) 2625c: e0 91 62 03 lds r30, 0x0362 ; 0x800362 26260: e1 50 subi r30, 0x01 ; 1 26262: e8 30 cpi r30, 0x08 ; 8 26264: a8 f4 brcc .+42 ; 0x26290 26266: f0 e0 ldi r31, 0x00 ; 0 26268: 88 27 eor r24, r24 2626a: e6 5c subi r30, 0xC6 ; 198 2626c: fe 4c sbci r31, 0xCE ; 206 2626e: 8e 4f sbci r24, 0xFE ; 254 26270: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 26274: 81 38 cpi r24, 0x81 ; 129 26276: 81 38 cpi r24, 0x81 ; 129 26278: 79 38 cpi r23, 0x89 ; 137 2627a: 81 38 cpi r24, 0x81 ; 129 2627c: 79 38 cpi r23, 0x89 ; 137 2627e: 33 37 cpi r19, 0x73 ; 115 26280: 7d 37 cpi r23, 0x7D ; 125 26282: 81 38 cpi r24, 0x81 ; 129 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 26284: 86 ef ldi r24, 0xF6 ; 246 26286: 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)); 26288: 0e 94 32 6d call 0xda64 ; 0xda64 2628c: 0e 94 e7 69 call 0xd3ce ; 0xd3ce // handled earlier break; } } if (bFilamentWaitingFlag) { 26290: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26294: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 26296: 0f 94 09 07 call 0x20e12 ; 0x20e12 } if (lcd_clicked()) 2629a: 0e 94 19 6c call 0xd832 ; 0xd832 2629e: 88 23 and r24, r24 262a0: 09 f4 brne .+2 ; 0x262a4 262a2: 30 cf rjmp .-416 ; 0x26104 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 262a4: 10 92 81 06 sts 0x0681, r1 ; 0x800681 if (!bFilamentPreheatState) 262a8: 80 91 82 06 lds r24, 0x0682 ; 0x800682 262ac: 81 11 cpse r24, r1 262ae: 0e c0 rjmp .+28 ; 0x262cc return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 262b0: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 262b4: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 262b8: 0e 94 3e 61 call 0xc27c ; 0xc27c 262bc: 81 11 cpse r24, r1 262be: 04 c0 rjmp .+8 ; 0x262c8 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 262c0: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 262c4: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed menu_back(); 262c8: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 } menu_back(); 262cc: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 clearFilamentAction(); } } } 262d0: df 91 pop r29 262d2: cf 91 pop r28 262d4: 1f 91 pop r17 262d6: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 262d8: 0d 94 63 0c jmp 0x218c6 ; 0x218c6 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)); 262dc: 8f ed ldi r24, 0xDF ; 223 262de: 9a e4 ldi r25, 0x4A ; 74 262e0: d3 cf rjmp .-90 ; 0x26288 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 262e2: 89 ec ldi r24, 0xC9 ; 201 262e4: 9a e4 ldi r25, 0x4A ; 74 262e6: d0 cf rjmp .-96 ; 0x26288 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 262e8: 85 eb ldi r24, 0xB5 ; 181 262ea: 9a e4 ldi r25, 0x4A ; 74 262ec: cd cf rjmp .-102 ; 0x26288 000262ee : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 262ee: 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) ); 262f2: 40 91 94 12 lds r20, 0x1294 ; 0x801294 262f6: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 262fa: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 262fe: 41 30 cpi r20, 0x01 ; 1 26300: 59 f0 breq .+22 ; 0x26318 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() 26302: 10 92 83 06 sts 0x0683, r1 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 26306: 80 91 57 02 lds r24, 0x0257 ; 0x800257 2630a: 90 91 58 02 lds r25, 0x0258 ; 0x800258 2630e: 28 17 cp r18, r24 26310: 39 07 cpc r19, r25 26312: 5c f4 brge .+22 ; 0x2632a bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 26314: 0d 94 66 0c jmp 0x218cc ; 0x218cc 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() 26318: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2631c: 91 11 cpse r25, r1 2631e: f1 cf rjmp .-30 ; 0x26302 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 26320: 86 50 subi r24, 0x06 ; 6 26322: 82 30 cpi r24, 0x02 ; 2 26324: 70 f7 brcc .-36 ; 0x26302 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() 26326: 40 93 83 06 sts 0x0683, r20 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2632a: 81 e0 ldi r24, 0x01 ; 1 2632c: 80 93 82 06 sts 0x0682, r24 ; 0x800682 mFilamentItem(target_temperature[0], target_temperature_bed); 26330: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 26334: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 26338: c9 01 movw r24, r18 2633a: 0f 94 63 30 call 0x260c6 ; 0x260c6 bFilamentSkipPreheat = false; // Reset flag 2633e: 10 92 83 06 sts 0x0683, r1 ; 0x800683 } else { lcd_generic_preheat_menu(); } } 26342: 08 95 ret 00026344 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 26344: 82 e0 ldi r24, 0x02 ; 2 26346: 0d 94 77 31 jmp 0x262ee ; 0x262ee 0002634a : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2634a: 81 e0 ldi r24, 0x01 ; 1 2634c: 0d 94 77 31 jmp 0x262ee ; 0x262ee 00026350 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 26350: 83 e0 ldi r24, 0x03 ; 3 26352: 0d 94 77 31 jmp 0x262ee ; 0x262ee 00026356 : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 26356: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 2635a: 60 e5 ldi r22, 0x50 ; 80 2635c: 70 e0 ldi r23, 0x00 ; 0 2635e: 8a ef ldi r24, 0xFA ; 250 26360: 90 e0 ldi r25, 0x00 ; 0 26362: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026366 : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 26366: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 2636a: 70 e0 ldi r23, 0x00 ; 0 2636c: 60 e0 ldi r22, 0x00 ; 0 2636e: 8a ef ldi r24, 0xFA ; 250 26370: 90 e0 ldi r25, 0x00 ; 0 26372: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026376 : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 26376: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2637a: 6c e3 ldi r22, 0x3C ; 60 2637c: 70 e0 ldi r23, 0x00 ; 0 2637e: 87 ed ldi r24, 0xD7 ; 215 26380: 90 e0 ldi r25, 0x00 ; 0 26382: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026386 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 26386: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2638a: 65 e5 ldi r22, 0x55 ; 85 2638c: 70 e0 ldi r23, 0x00 ; 0 2638e: 86 ee ldi r24, 0xE6 ; 230 26390: 90 e0 ldi r25, 0x00 ; 0 26392: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026396 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 26396: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2639a: 69 e6 ldi r22, 0x69 ; 105 2639c: 70 e0 ldi r23, 0x00 ; 0 2639e: 84 e0 ldi r24, 0x04 ; 4 263a0: 91 e0 ldi r25, 0x01 ; 1 263a2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263a6 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 263a6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 263aa: 69 e6 ldi r22, 0x69 ; 105 263ac: 70 e0 ldi r23, 0x00 ; 0 263ae: 83 e1 ldi r24, 0x13 ; 19 263b0: 91 e0 ldi r25, 0x01 ; 1 263b2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263b6 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 263b6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 263ba: 6b e4 ldi r22, 0x4B ; 75 263bc: 70 e0 ldi r23, 0x00 ; 0 263be: 87 ed ldi r24, 0xD7 ; 215 263c0: 90 e0 ldi r25, 0x00 ; 0 263c2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263c6 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 263c6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 263ca: 6a e5 ldi r22, 0x5A ; 90 263cc: 70 e0 ldi r23, 0x00 ; 0 263ce: 83 e1 ldi r24, 0x13 ; 19 263d0: 91 e0 ldi r25, 0x01 ; 1 263d2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263d6 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 263d6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 263da: 64 e6 ldi r22, 0x64 ; 100 263dc: 70 e0 ldi r23, 0x00 ; 0 263de: 8f ef ldi r24, 0xFF ; 255 263e0: 90 e0 ldi r25, 0x00 ; 0 263e2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263e6 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 263e6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 263ea: 64 e6 ldi r22, 0x64 ; 100 263ec: 70 e0 ldi r23, 0x00 ; 0 263ee: 8c ed ldi r24, 0xDC ; 220 263f0: 90 e0 ldi r25, 0x00 ; 0 263f2: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 000263f6 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 263f6: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 263fa: 64 e6 ldi r22, 0x64 ; 100 263fc: 70 e0 ldi r23, 0x00 ; 0 263fe: 8e ef ldi r24, 0xFE ; 254 26400: 90 e0 ldi r25, 0x00 ; 0 26402: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026406 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 26406: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2640a: 62 e3 ldi r22, 0x32 ; 50 2640c: 70 e0 ldi r23, 0x00 ; 0 2640e: 80 ef ldi r24, 0xF0 ; 240 26410: 90 e0 ldi r25, 0x00 ; 0 26412: 0d 94 63 30 jmp 0x260c6 ; 0x260c6 00026416 : } 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){ 26416: cf 92 push r12 26418: df 92 push r13 2641a: ef 92 push r14 2641c: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2641e: 41 11 cpse r20, r1 26420: 04 c0 rjmp .+8 ; 0x2642a 26422: 20 91 15 04 lds r18, 0x0415 ; 0x800415 26426: 22 30 cpi r18, 0x02 ; 2 26428: d1 f0 breq .+52 ; 0x2645e 2642a: 9b 01 movw r18, r22 2642c: 6c 01 movw r12, r24 2642e: f1 2c mov r15, r1 26430: e1 2c mov r14, r1 if(!tone_) { 26432: 67 2b or r22, r23 26434: c9 f4 brne .+50 ; 0x26468 WRITE(BEEPER, HIGH); 26436: 9f b7 in r25, 0x3f ; 63 26438: f8 94 cli 2643a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2643e: 84 60 ori r24, 0x04 ; 4 26440: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26444: 9f bf out 0x3f, r25 ; 63 _delay(ms); 26446: c7 01 movw r24, r14 26448: b6 01 movw r22, r12 2644a: 0f 94 d5 0d call 0x21baa ; 0x21baa 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); 2644e: 9f b7 in r25, 0x3f ; 63 26450: f8 94 cli 26452: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26456: 8b 7f andi r24, 0xFB ; 251 26458: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2645c: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2645e: ff 90 pop r15 26460: ef 90 pop r14 26462: df 90 pop r13 26464: cf 90 pop r12 26466: 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); 26468: 22 0f add r18, r18 2646a: 33 1f adc r19, r19 2646c: 50 e0 ldi r21, 0x00 ; 0 2646e: 40 e0 ldi r20, 0x00 ; 0 26470: 60 e0 ldi r22, 0x00 ; 0 26472: 74 e2 ldi r23, 0x24 ; 36 26474: 84 ef ldi r24, 0xF4 ; 244 26476: 90 e0 ldi r25, 0x00 ; 0 26478: 0f 94 2d a2 call 0x3445a ; 0x3445a <__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; 2647c: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2647e: 21 15 cp r18, r1 26480: 31 05 cpc r19, r1 26482: 81 e0 ldi r24, 0x01 ; 1 26484: 48 07 cpc r20, r24 26486: 51 05 cpc r21, r1 26488: 44 f0 brlt .+16 ; 0x2649a pwm_freq /= 64; // Increase prescaler to 64 2648a: 86 e0 ldi r24, 0x06 ; 6 2648c: 56 95 lsr r21 2648e: 47 95 ror r20 26490: 37 95 ror r19 26492: 27 95 ror r18 26494: 8a 95 dec r24 26496: d1 f7 brne .-12 ; 0x2648c prescalarbits = 0b011; 26498: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2649a: 21 50 subi r18, 0x01 ; 1 2649c: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2649e: 4f b7 in r20, 0x3f ; 63 264a0: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 264a2: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 264a6: 88 7f andi r24, 0xF8 ; 248 264a8: 89 2b or r24, r25 264aa: 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); 264ae: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 264b2: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 264b6: 26 9f mul r18, r22 264b8: c0 01 movw r24, r0 264ba: 27 9f mul r18, r23 264bc: 90 0d add r25, r0 264be: 36 9f mul r19, r22 264c0: 90 0d add r25, r0 264c2: 11 24 eor r1, r1 264c4: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 264c8: 6f ef ldi r22, 0xFF ; 255 264ca: 70 e0 ldi r23, 0x00 ; 0 264cc: 51 ff sbrs r21, 1 264ce: 04 c0 rjmp .+8 ; 0x264d8 264d0: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 264d4: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 264d8: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 264dc: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 264e0: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 264e4: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 264e8: 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); 264ec: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 264f0: 83 60 ori r24, 0x03 ; 3 264f2: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 264f6: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 264f8: c7 01 movw r24, r14 264fa: b6 01 movw r22, r12 264fc: 0f 94 d5 0d call 0x21baa ; 0x21baa } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 26500: 2f b7 in r18, 0x3f ; 63 26502: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 26504: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 26508: 88 7f andi r24, 0xF8 ; 248 2650a: 85 60 ori r24, 0x05 ; 5 2650c: 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); 26510: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 26514: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26518: 3f ef ldi r19, 0xFF ; 255 2651a: 34 9f mul r19, r20 2651c: c0 01 movw r24, r0 2651e: 35 9f mul r19, r21 26520: 90 0d add r25, r0 26522: 11 24 eor r1, r1 26524: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26528: 6f ef ldi r22, 0xFF ; 255 2652a: 70 e0 ldi r23, 0x00 ; 0 2652c: 31 ff sbrs r19, 1 2652e: 04 c0 rjmp .+8 ; 0x26538 26530: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 26534: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26538: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 2653c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26540: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 26544: 8f ef ldi r24, 0xFF ; 255 26546: 90 e0 ldi r25, 0x00 ; 0 26548: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2654c: 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)); 26550: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26554: 8c 7f andi r24, 0xFC ; 252 26556: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2655a: 2f bf out 0x3f, r18 ; 63 2655c: 78 cf rjmp .-272 ; 0x2644e 0002655e : } void handle_temp_error(); void manage_heater() { 2655e: cf 92 push r12 26560: df 92 push r13 26562: ef 92 push r14 26564: ff 92 push r15 26566: 0f 93 push r16 26568: 1f 93 push r17 2656a: cf 93 push r28 2656c: df 93 push r29 2656e: 1f 92 push r1 26570: 1f 92 push r1 26572: cd b7 in r28, 0x3d ; 61 26574: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 26576: 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) 26578: 80 91 42 06 lds r24, 0x0642 ; 0x800642 2657c: 88 23 and r24, r24 2657e: 09 f4 brne .+2 ; 0x26582 26580: 29 c2 rjmp .+1106 ; 0x269d4 return; // syncronize temperatures with isr updateTemperatures(); 26582: 0e 94 f8 fa call 0x1f5f0 ; 0x1f5f0 if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 26586: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2658a: 88 23 and r24, r24 2658c: 89 f1 breq .+98 ; 0x265f0 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 2658e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26592: 82 95 swap r24 26594: 86 95 lsr r24 26596: 87 70 andi r24, 0x07 ; 7 26598: 81 30 cpi r24, 0x01 ; 1 2659a: 01 f1 breq .+64 ; 0x265dc 2659c: 08 f4 brcc .+2 ; 0x265a0 2659e: be c1 rjmp .+892 ; 0x2691c 265a0: 84 30 cpi r24, 0x04 ; 4 265a2: 30 f5 brcc .+76 ; 0x265f0 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 265a4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 265a8: 86 95 lsr r24 265aa: 86 95 lsr r24 265ac: 83 70 andi r24, 0x03 ; 3 265ae: 82 30 cpi r24, 0x02 ; 2 265b0: f8 f4 brcc .+62 ; 0x265f0 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 265b2: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 265b6: 86 95 lsr r24 265b8: 86 95 lsr r24 265ba: 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), 265bc: 90 91 9a 03 lds r25, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 265c0: 92 95 swap r25 265c2: 96 95 lsr r25 265c4: 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( 265c6: 61 e0 ldi r22, 0x01 ; 1 265c8: 81 30 cpi r24, 0x01 ; 1 265ca: 09 f0 breq .+2 ; 0x265ce 265cc: 60 e0 ldi r22, 0x00 ; 0 265ce: 81 e0 ldi r24, 0x01 ; 1 265d0: 92 30 cpi r25, 0x02 ; 2 265d2: 09 f0 breq .+2 ; 0x265d6 265d4: 80 e0 ldi r24, 0x00 ; 0 265d6: 0f 94 9d 09 call 0x2133a ; 0x2133a 265da: 0a c0 rjmp .+20 ; 0x265f0 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 265dc: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 265e0: 86 95 lsr r24 265e2: 86 95 lsr r24 265e4: 83 70 andi r24, 0x03 ; 3 265e6: 09 f4 brne .+2 ; 0x265ea 265e8: 4b c1 rjmp .+662 ; 0x26880 265ea: 81 30 cpi r24, 0x01 ; 1 265ec: 09 f4 brne .+2 ; 0x265f0 265ee: 79 c1 rjmp .+754 ; 0x268e2 #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)) { 265f0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 265f4: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 265f8: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 265fc: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26600: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26604: 60 1b sub r22, r16 26606: 71 0b sbc r23, r17 26608: 82 0b sbc r24, r18 2660a: 93 0b sbc r25, r19 2660c: 69 38 cpi r22, 0x89 ; 137 2660e: 73 41 sbci r23, 0x13 ; 19 26610: 81 05 cpc r24, r1 26612: 91 05 cpc r25, r1 26614: d0 f0 brcs .+52 ; 0x2664a 26616: 80 91 84 03 lds r24, 0x0384 ; 0x800384 2661a: 81 11 cpse r24, r1 2661c: 16 c0 rjmp .+44 ; 0x2664a extruder_autofan_last_check = _millis(); 2661e: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26622: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 26626: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 2662a: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 2662e: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fanSpeedBckp = fanSpeedSoftPwm; 26632: 80 91 05 05 lds r24, 0x0505 ; 0x800505 26636: 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 2663a: 8b 34 cpi r24, 0x4B ; 75 2663c: 18 f0 brcs .+6 ; 0x26644 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 2663e: 8f ef ldi r24, 0xFF ; 255 26640: 80 93 05 05 sts 0x0505, r24 ; 0x800505 } fan_measuring = true; 26644: 81 e0 ldi r24, 0x01 ; 1 26646: 80 93 84 03 sts 0x0384, r24 ; 0x800384 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 2664a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2664e: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26652: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 26656: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 2665a: 30 91 90 16 lds r19, 0x1690 ; 0x801690 2665e: 60 1b sub r22, r16 26660: 71 0b sbc r23, r17 26662: 82 0b sbc r24, r18 26664: 93 0b sbc r25, r19 26666: 65 36 cpi r22, 0x65 ; 101 26668: 71 05 cpc r23, r1 2666a: 81 05 cpc r24, r1 2666c: 91 05 cpc r25, r1 2666e: 08 f4 brcc .+2 ; 0x26672 26670: a5 c1 rjmp .+842 ; 0x269bc 26672: 80 91 84 03 lds r24, 0x0384 ; 0x800384 26676: 88 23 and r24, r24 26678: 09 f4 brne .+2 ; 0x2667c 2667a: a0 c1 rjmp .+832 ; 0x269bc #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))); 2667c: 60 91 22 06 lds r22, 0x0622 ; 0x800622 26680: 70 91 23 06 lds r23, 0x0623 ; 0x800623 26684: 07 2e mov r0, r23 26686: 00 0c add r0, r0 26688: 88 0b sbc r24, r24 2668a: 99 0b sbc r25, r25 2668c: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 26690: 6b 01 movw r12, r22 26692: 7c 01 movw r14, r24 26694: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26698: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 2669c: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 266a0: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 266a4: 30 91 90 16 lds r19, 0x1690 ; 0x801690 266a8: 60 1b sub r22, r16 266aa: 71 0b sbc r23, r17 266ac: 82 0b sbc r24, r18 266ae: 93 0b sbc r25, r19 266b0: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 266b4: 9b 01 movw r18, r22 266b6: ac 01 movw r20, r24 266b8: 60 e0 ldi r22, 0x00 ; 0 266ba: 70 e0 ldi r23, 0x00 ; 0 266bc: 8a e7 ldi r24, 0x7A ; 122 266be: 93 e4 ldi r25, 0x43 ; 67 266c0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 266c4: a7 01 movw r20, r14 266c6: 96 01 movw r18, r12 266c8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 266cc: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 266d0: 70 93 86 03 sts 0x0386, r23 ; 0x800386 266d4: 60 93 85 03 sts 0x0385, r22 ; 0x800385 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 266d8: 60 91 24 06 lds r22, 0x0624 ; 0x800624 266dc: 70 91 25 06 lds r23, 0x0625 ; 0x800625 266e0: 07 2e mov r0, r23 266e2: 00 0c add r0, r0 266e4: 88 0b sbc r24, r24 266e6: 99 0b sbc r25, r25 266e8: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 266ec: 6b 01 movw r12, r22 266ee: 7c 01 movw r14, r24 266f0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 266f4: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 266f8: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 266fc: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26700: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26704: 60 1b sub r22, r16 26706: 71 0b sbc r23, r17 26708: 82 0b sbc r24, r18 2670a: 93 0b sbc r25, r19 2670c: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 26710: 9b 01 movw r18, r22 26712: ac 01 movw r20, r24 26714: 60 e0 ldi r22, 0x00 ; 0 26716: 70 e0 ldi r23, 0x00 ; 0 26718: 8a e7 ldi r24, 0x7A ; 122 2671a: 93 e4 ldi r25, 0x43 ; 67 2671c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 26720: a7 01 movw r20, r14 26722: 96 01 movw r18, r12 26724: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 26728: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2672c: 70 93 88 03 sts 0x0388, r23 ; 0x800388 26730: 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; 26734: 10 92 23 06 sts 0x0623, r1 ; 0x800623 26738: 10 92 22 06 sts 0x0622, r1 ; 0x800622 fan_edge_counter[1] = 0; 2673c: 10 92 25 06 sts 0x0625, r1 ; 0x800625 26740: 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) 26744: 83 e0 ldi r24, 0x03 ; 3 26746: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 26748: 82 e0 ldi r24, 0x02 ; 2 2674a: 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) 2674c: 80 91 40 02 lds r24, 0x0240 ; 0x800240 26750: 88 23 and r24, r24 26752: 51 f0 breq .+20 ; 0x26768 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 26754: 87 e8 ldi r24, 0x87 ; 135 26756: 9f e0 ldi r25, 0x0F ; 15 26758: 0f 94 3c a1 call 0x34278 ; 0x34278 2675c: 91 e0 ldi r25, 0x01 ; 1 2675e: 81 11 cpse r24, r1 26760: 01 c0 rjmp .+2 ; 0x26764 26762: 90 e0 ldi r25, 0x00 ; 0 26764: 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]++;} 26768: 80 91 85 03 lds r24, 0x0385 ; 0x800385 2676c: 90 91 86 03 lds r25, 0x0386 ; 0x800386 26770: 44 97 sbiw r24, 0x14 ; 20 26772: 0c f0 brlt .+2 ; 0x26776 26774: f2 c0 rjmp .+484 ; 0x2695a 26776: 20 e0 ldi r18, 0x00 ; 0 26778: 30 e0 ldi r19, 0x00 ; 0 2677a: 48 e4 ldi r20, 0x48 ; 72 2677c: 52 e4 ldi r21, 0x42 ; 66 2677e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 26782: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 26786: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2678a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2678e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 26792: 18 16 cp r1, r24 26794: 0c f0 brlt .+2 ; 0x26798 26796: e1 c0 rjmp .+450 ; 0x2695a 26798: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 2679c: 8f 5f subi r24, 0xFF ; 255 2679e: 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){ 267a2: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 267a6: 81 11 cpse r24, r1 267a8: 0b c0 rjmp .+22 ; 0x267c0 267aa: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee 267ae: 81 11 cpse r24, r1 267b0: 07 c0 rjmp .+14 ; 0x267c0 267b2: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 267b6: 82 30 cpi r24, 0x02 ; 2 267b8: 19 f4 brne .+6 ; 0x267c0 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 267ba: 81 e0 ldi r24, 0x01 ; 1 267bc: 80 93 9c 03 sts 0x039C, r24 ; 0x80039c } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 267c0: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 267c4: 81 30 cpi r24, 0x01 ; 1 267c6: 61 f4 brne .+24 ; 0x267e0 267c8: 0e 94 9a 61 call 0xc334 ; 0xc334 267cc: 81 11 cpse r24, r1 267ce: 08 c0 rjmp .+16 ; 0x267e0 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 267d0: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 267d4: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 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 267d8: 8b e0 ldi r24, 0x0B ; 11 267da: 9c e6 ldi r25, 0x6C ; 108 267dc: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 267e0: 80 91 40 02 lds r24, 0x0240 ; 0x800240 267e4: 88 23 and r24, r24 267e6: 09 f4 brne .+2 ; 0x267ea 267e8: d9 c0 rjmp .+434 ; 0x2699c 267ea: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 267ee: 82 30 cpi r24, 0x02 ; 2 267f0: 09 f4 brne .+2 ; 0x267f4 267f2: d4 c0 rjmp .+424 ; 0x2699c 267f4: 8d ee ldi r24, 0xED ; 237 267f6: e8 2e mov r14, r24 267f8: 85 e0 ldi r24, 0x05 ; 5 267fa: f8 2e mov r15, r24 267fc: ce 01 movw r24, r28 267fe: 01 96 adiw r24, 0x01 ; 1 26800: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 26802: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 26804: 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]) 26806: f7 01 movw r30, r14 26808: 91 91 ld r25, Z+ 2680a: 7f 01 movw r14, r30 2680c: f6 01 movw r30, r12 2680e: 81 91 ld r24, Z+ 26810: 6f 01 movw r12, r30 26812: 89 17 cp r24, r25 26814: 80 f5 brcc .+96 ; 0x26876 { fan_speed_errors[fan] = 0; 26816: f7 01 movw r30, r14 26818: 31 97 sbiw r30, 0x01 ; 1 2681a: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 2681c: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 26820: 82 30 cpi r24, 0x02 ; 2 26822: 49 f1 breq .+82 ; 0x26876 fan_check_error = EFCE_REPORTED; 26824: 00 93 9c 03 sts 0x039C, r16 ; 0x80039c if (printJobOngoing()) { 26828: 0e 94 49 61 call 0xc292 ; 0xc292 2682c: 88 23 and r24, r24 2682e: 09 f4 brne .+2 ; 0x26832 26830: 9a c0 rjmp .+308 ; 0x26966 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 26832: 0e 94 3e 61 call 0xc27c ; 0xc27c 26836: 81 11 cpse r24, r1 26838: 07 c0 rjmp .+14 ; 0x26848 if (usb_timer.running()) 2683a: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 2683e: 88 23 and r24, r24 26840: 09 f4 brne .+2 ; 0x26844 26842: 8e c0 rjmp .+284 ; 0x26960 lcd_pause_usb_print(); 26844: 0f 94 51 04 call 0x208a2 ; 0x208a2 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 26848: 11 30 cpi r17, 0x01 ; 1 2684a: 09 f4 brne .+2 ; 0x2684e 2684c: 93 c0 rjmp .+294 ; 0x26974 //! 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); 2684e: 88 e2 ldi r24, 0x28 ; 40 26850: 93 e9 ldi r25, 0x93 ; 147 26852: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 if (get_message_level() == 0) { 26856: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 2685a: 81 11 cpse r24, r1 2685c: 0c c0 rjmp .+24 ; 0x26876 Sound_MakeCustom(200,0,true); 2685e: 41 e0 ldi r20, 0x01 ; 1 26860: 70 e0 ldi r23, 0x00 ; 0 26862: 60 e0 ldi r22, 0x00 ; 0 26864: 88 ec ldi r24, 0xC8 ; 200 26866: 90 e0 ldi r25, 0x00 ; 0 26868: 0f 94 0b 32 call 0x26416 ; 0x26416 LCD_ALERTMESSAGERPGM(lcdMsg); 2686c: 62 e0 ldi r22, 0x02 ; 2 2686e: 8f e0 ldi r24, 0x0F ; 15 26870: 98 e6 ldi r25, 0x68 ; 104 26872: 0e 94 2f e2 call 0x1c45e ; 0x1c45e 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++) 26876: 11 30 cpi r17, 0x01 ; 1 26878: 09 f4 brne .+2 ; 0x2687c 2687a: 90 c0 rjmp .+288 ; 0x2699c 2687c: 11 e0 ldi r17, 0x01 ; 1 2687e: c3 cf rjmp .-122 ; 0x26806 case TempErrorSource::hotend: if(temp_error_state.assert) { 26880: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26884: 81 ff sbrs r24, 1 26886: 12 c0 rjmp .+36 ; 0x268ac min_temp_error(temp_error_state.index); 26888: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2688c: 62 95 swap r22 2688e: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 26890: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 26894: 81 11 cpse r24, r1 26896: 07 c0 rjmp .+14 ; 0x268a6 temp_error_messagepgm(err, e); 26898: 83 e8 ldi r24, 0x83 ; 131 2689a: 93 e9 ldi r25, 0x93 ; 147 2689c: 0f 94 09 12 call 0x22412 ; 0x22412 prusa_statistics(92); 268a0: 8c e5 ldi r24, 0x5C ; 92 268a2: 0f 94 5f 99 call 0x332be ; 0x332be } ThermalStop(); 268a6: 0f 94 8b 43 call 0x28716 ; 0x28716 268aa: a2 ce rjmp .-700 ; 0x265f0 // 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); 268ac: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.422> 268b0: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 268b4: 6b 5f subi r22, 0xFB ; 251 268b6: 7f 4f sbci r23, 0xFF ; 255 268b8: 07 2e mov r0, r23 268ba: 00 0c add r0, r0 268bc: 88 0b sbc r24, r24 268be: 99 0b sbc r25, r25 268c0: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 268c4: 8b 01 movw r16, r22 268c6: 9c 01 movw r18, r24 268c8: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 268cc: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 268d0: 60 91 c6 0d lds r22, 0x0DC6 ; 0x800dc6 268d4: 70 91 c7 0d lds r23, 0x0DC7 ; 0x800dc7 268d8: 8c e6 ldi r24, 0x6C ; 108 268da: 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); 268dc: 0f 94 64 09 call 0x212c8 ; 0x212c8 268e0: 87 ce rjmp .-754 ; 0x265f0 // 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) { 268e2: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 268e6: 81 ff sbrs r24, 1 268e8: 0a c0 rjmp .+20 ; 0x268fe ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 268ea: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 268ee: 81 11 cpse r24, r1 268f0: da cf rjmp .-76 ; 0x268a6 temp_error_messagepgm(err); 268f2: 61 e0 ldi r22, 0x01 ; 1 268f4: 87 e7 ldi r24, 0x77 ; 119 268f6: 93 e9 ldi r25, 0x93 ; 147 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 268f8: 0f 94 09 12 call 0x22412 ; 0x22412 268fc: d4 cf rjmp .-88 ; 0x268a6 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); 268fe: 40 91 8a 03 lds r20, 0x038A ; 0x80038a 26902: 50 91 8b 03 lds r21, 0x038B ; 0x80038b 26906: 60 91 8c 03 lds r22, 0x038C ; 0x80038c 2690a: 70 91 8d 03 lds r23, 0x038D ; 0x80038d 2690e: 00 e0 ldi r16, 0x00 ; 0 26910: 10 e0 ldi r17, 0x00 ; 0 26912: 2c e0 ldi r18, 0x0C ; 12 26914: 32 e4 ldi r19, 0x42 ; 66 26916: 88 e6 ldi r24, 0x68 ; 104 26918: 92 e0 ldi r25, 0x02 ; 2 2691a: e0 cf rjmp .-64 ; 0x268dc break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 2691c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26920: 86 95 lsr r24 26922: 86 95 lsr r24 26924: 83 70 andi r24, 0x03 ; 3 26926: 59 f0 breq .+22 ; 0x2693e 26928: 81 30 cpi r24, 0x01 ; 1 2692a: 09 f0 breq .+2 ; 0x2692e 2692c: 61 ce rjmp .-830 ; 0x265f0 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 2692e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 26932: 81 11 cpse r24, r1 26934: b8 cf rjmp .-144 ; 0x268a6 temp_error_messagepgm(PSTR("MAXTEMP BED")); 26936: 61 e0 ldi r22, 0x01 ; 1 26938: 83 e9 ldi r24, 0x93 ; 147 2693a: 93 e9 ldi r25, 0x93 ; 147 2693c: dd cf rjmp .-70 ; 0x268f8 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 2693e: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26942: 62 95 swap r22 26944: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 26946: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2694a: 81 11 cpse r24, r1 2694c: ac cf rjmp .-168 ; 0x268a6 temp_error_messagepgm(PSTR("MAXTEMP"), e); 2694e: 8b e8 ldi r24, 0x8B ; 139 26950: 93 e9 ldi r25, 0x93 ; 147 26952: 0f 94 09 12 call 0x22412 ; 0x22412 prusa_statistics(93); 26956: 8d e5 ldi r24, 0x5D ; 93 26958: a4 cf rjmp .-184 ; 0x268a2 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; 2695a: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 2695e: 21 cf rjmp .-446 ; 0x267a2 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 26960: 0f 94 da 0f call 0x21fb4 ; 0x21fb4 26964: 71 cf rjmp .-286 ; 0x26848 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 26966: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2696a: 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; 2696e: 10 92 99 03 sts 0x0399, r1 ; 0x800399 26972: 6a cf rjmp .-300 ; 0x26848 //! 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); 26974: 80 e5 ldi r24, 0x50 ; 80 26976: 93 e9 ldi r25, 0x93 ; 147 26978: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 if (get_message_level() == 0) { 2697c: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 26980: 81 11 cpse r24, r1 26982: 0c c0 rjmp .+24 ; 0x2699c Sound_MakeCustom(200,0,true); 26984: 41 e0 ldi r20, 0x01 ; 1 26986: 70 e0 ldi r23, 0x00 ; 0 26988: 60 e0 ldi r22, 0x00 ; 0 2698a: 88 ec ldi r24, 0xC8 ; 200 2698c: 90 e0 ldi r25, 0x00 ; 0 2698e: 0f 94 0b 32 call 0x26416 ; 0x26416 LCD_ALERTMESSAGERPGM(lcdMsg); 26992: 62 e0 ldi r22, 0x02 ; 2 26994: 82 e6 ldi r24, 0x62 ; 98 26996: 9a e6 ldi r25, 0x6A ; 106 26998: 0e 94 2f e2 call 0x1c45e ; 0x1c45e } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 2699c: 80 91 67 02 lds r24, 0x0267 ; 0x800267 269a0: 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(); 269a4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 269a8: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 269ac: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 269b0: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 269b4: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = false; 269b8: 10 92 84 03 sts 0x0384, r1 ; 0x800384 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 269bc: 0f 90 pop r0 269be: 0f 90 pop r0 269c0: df 91 pop r29 269c2: cf 91 pop r28 269c4: 1f 91 pop r17 269c6: 0f 91 pop r16 269c8: ff 90 pop r15 269ca: ef 90 pop r14 269cc: df 90 pop r13 269ce: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 269d0: 0c 94 0c 6f jmp 0xde18 ; 0xde18 269d4: 0f 90 pop r0 269d6: 0f 90 pop r0 269d8: df 91 pop r29 269da: cf 91 pop r28 269dc: 1f 91 pop r17 269de: 0f 91 pop r16 269e0: ff 90 pop r15 269e2: ef 90 pop r14 269e4: df 90 pop r13 269e6: cf 90 pop r12 269e8: 08 95 ret 000269ea : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 269ea: 4f 92 push r4 269ec: 5f 92 push r5 269ee: 6f 92 push r6 269f0: 7f 92 push r7 269f2: 8f 92 push r8 269f4: 9f 92 push r9 269f6: af 92 push r10 269f8: bf 92 push r11 269fa: cf 92 push r12 269fc: df 92 push r13 269fe: ef 92 push r14 26a00: ff 92 push r15 26a02: 0f 93 push r16 26a04: 1f 93 push r17 26a06: cf 93 push r28 26a08: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 26a0a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26a0e: 28 ee ldi r18, 0xE8 ; 232 26a10: 33 e0 ldi r19, 0x03 ; 3 26a12: 40 e0 ldi r20, 0x00 ; 0 26a14: 50 e0 ldi r21, 0x00 ; 0 26a16: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 26a1a: 69 01 movw r12, r18 26a1c: 7a 01 movw r14, r20 lcd_consume_click(); 26a1e: 0e 94 14 6c call 0xd828 ; 0xd828 KEEPALIVE_STATE(PAUSED_FOR_USER); 26a22: 84 e0 ldi r24, 0x04 ; 4 26a24: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 26a28: 88 ee ldi r24, 0xE8 ; 232 26a2a: 88 2e mov r8, r24 26a2c: 83 e0 ldi r24, 0x03 ; 3 26a2e: 98 2e mov r9, r24 26a30: a1 2c mov r10, r1 26a32: b1 2c mov r11, r1 26a34: 28 01 movw r4, r16 26a36: 71 2c mov r7, r1 26a38: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 26a3a: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 26a3e: 81 e0 ldi r24, 0x01 ; 1 26a40: 0e 94 89 7a call 0xf512 ; 0xf512 bDelayed = ((_millis()/1000-nTime0) > nDelay); 26a44: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26a48: a5 01 movw r20, r10 26a4a: 94 01 movw r18, r8 26a4c: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 26a50: 2c 19 sub r18, r12 26a52: 3d 09 sbc r19, r13 26a54: 4e 09 sbc r20, r14 26a56: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 26a58: 42 16 cp r4, r18 26a5a: 53 06 cpc r5, r19 26a5c: 64 06 cpc r6, r20 26a5e: 75 06 cpc r7, r21 26a60: 20 f4 brcc .+8 ; 0x26a6a 26a62: c1 e0 ldi r28, 0x01 ; 1 26a64: 01 15 cp r16, r1 26a66: 11 05 cpc r17, r1 26a68: 09 f4 brne .+2 ; 0x26a6c 26a6a: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 26a6c: 0e 94 19 6c call 0xd832 ; 0xd832 26a70: 81 11 cpse r24, r1 26a72: 02 c0 rjmp .+4 ; 0x26a78 26a74: cc 23 and r28, r28 26a76: 09 f3 breq .-62 ; 0x26a3a KEEPALIVE_STATE(IN_HANDLER); 26a78: 82 e0 ldi r24, 0x02 ; 2 26a7a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 26a7e: 81 e0 ldi r24, 0x01 ; 1 26a80: 8c 27 eor r24, r28 26a82: cf 91 pop r28 26a84: 1f 91 pop r17 26a86: 0f 91 pop r16 26a88: ff 90 pop r15 26a8a: ef 90 pop r14 26a8c: df 90 pop r13 26a8e: cf 90 pop r12 26a90: bf 90 pop r11 26a92: af 90 pop r10 26a94: 9f 90 pop r9 26a96: 8f 90 pop r8 26a98: 7f 90 pop r7 26a9a: 6f 90 pop r6 26a9c: 5f 90 pop r5 26a9e: 4f 90 pop r4 26aa0: 08 95 ret 00026aa2 : // 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) { 26aa2: 9f 92 push r9 26aa4: af 92 push r10 26aa6: bf 92 push r11 26aa8: cf 92 push r12 26aaa: df 92 push r13 26aac: ef 92 push r14 26aae: ff 92 push r15 26ab0: 0f 93 push r16 26ab2: 1f 93 push r17 26ab4: cf 93 push r28 26ab6: df 93 push r29 26ab8: 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; 26aba: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 26abe: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 26ac2: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 26ac6: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 26aca: 0f 94 90 84 call 0x30920 ; 0x30920 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 26ace: 8d e4 ldi r24, 0x4D ; 77 26ad0: 9d e4 ldi r25, 0x4D ; 77 26ad2: 91 10 cpse r9, r1 26ad4: 02 c0 rjmp .+4 ; 0x26ada 26ad6: 8a ee ldi r24, 0xEA ; 234 26ad8: 9c e4 ldi r25, 0x4C ; 76 26ada: 0e 94 32 6d call 0xda64 ; 0xda64 26ade: b8 2e mov r11, r24 26ae0: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 26ae2: 0f 94 f4 0a call 0x215e8 ; 0x215e8 26ae6: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 26ae8: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26aec: 6b 01 movw r12, r22 26aee: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 26af0: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26af4: 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); 26af8: 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(); 26afa: 0f 94 af 32 call 0x2655e ; 0x2655e manage_inactivity(true); 26afe: 81 e0 ldi r24, 0x01 ; 1 26b00: 0e 94 89 7a call 0xf512 ; 0xf512 if (lcd_encoder) { 26b04: 80 91 06 05 lds r24, 0x0506 ; 0x800506 26b08: 90 91 07 05 lds r25, 0x0507 ; 0x800507 26b0c: 89 2b or r24, r25 26b0e: d9 f1 breq .+118 ; 0x26b86 _delay(50); 26b10: 62 e3 ldi r22, 0x32 ; 50 26b12: 70 e0 ldi r23, 0x00 ; 0 26b14: 80 e0 ldi r24, 0x00 ; 0 26b16: 90 e0 ldi r25, 0x00 ; 0 26b18: 0f 94 d5 0d call 0x21baa ; 0x21baa 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; 26b1c: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 26b20: 8f 5f subi r24, 0xFF ; 255 26b22: 80 31 cpi r24, 0x10 ; 16 26b24: 09 f4 brne .+2 ; 0x26b28 next_block_index = 0; 26b26: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 26b28: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) { 26b2c: 98 17 cp r25, r24 26b2e: 59 f1 breq .+86 ; 0x26b86 // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 26b30: 60 91 06 05 lds r22, 0x0506 ; 0x800506 26b34: 70 91 07 05 lds r23, 0x0507 ; 0x800507 26b38: 77 ff sbrs r23, 7 26b3a: 03 c0 rjmp .+6 ; 0x26b42 26b3c: 71 95 neg r23 26b3e: 61 95 neg r22 26b40: 71 09 sbc r23, r1 26b42: 07 2e mov r0, r23 26b44: 00 0c add r0, r0 26b46: 88 0b sbc r24, r24 26b48: 99 0b sbc r25, r25 26b4a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 26b4e: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 26b52: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 26b56: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 26b5a: 50 91 00 12 lds r21, 0x1200 ; 0x801200 26b5e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 26b62: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 26b66: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 26b6a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 26b6e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 lcd_encoder = 0; 26b72: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26b76: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 26b7a: 65 e5 ldi r22, 0x55 ; 85 26b7c: 75 e5 ldi r23, 0x55 ; 85 26b7e: 85 e8 ldi r24, 0x85 ; 133 26b80: 91 e4 ldi r25, 0x41 ; 65 26b82: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 } } if (lcd_clicked()) { 26b86: 0e 94 19 6c call 0xd832 ; 0xd832 26b8a: 88 23 and r24, r24 26b8c: c9 f1 breq .+114 ; 0x26c00 // Abort a move if in progress. planner_abort_hard(); 26b8e: 0f 94 4a 87 call 0x30e94 ; 0x30e94 planner_aborted = false; 26b92: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac while (lcd_clicked()) ; 26b96: 0e 94 19 6c call 0xd832 ; 0xd832 26b9a: 81 11 cpse r24, r1 26b9c: fc cf rjmp .-8 ; 0x26b96 _delay(10); 26b9e: 6a e0 ldi r22, 0x0A ; 10 26ba0: 70 e0 ldi r23, 0x00 ; 0 26ba2: 80 e0 ldi r24, 0x00 ; 0 26ba4: 90 e0 ldi r25, 0x00 ; 0 26ba6: 0f 94 d5 0d call 0x21baa ; 0x21baa while (lcd_clicked()) ; 26baa: 0e 94 19 6c call 0xd832 ; 0xd832 26bae: 81 11 cpse r24, r1 26bb0: fc cf rjmp .-8 ; 0x26baa 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); 26bb2: 81 ec ldi r24, 0xC1 ; 193 26bb4: 9c e4 ldi r25, 0x4C ; 76 26bb6: 0e 94 32 6d call 0xda64 ; 0xda64 26bba: 41 e0 ldi r20, 0x01 ; 1 26bbc: 60 e0 ldi r22, 0x00 ; 0 26bbe: 0f 94 33 2e call 0x25c66 ; 0x25c66 if (result == LCD_BUTTON_TIMEOUT) 26bc2: 8f 3f cpi r24, 0xFF ; 255 26bc4: d1 f1 breq .+116 ; 0x26c3a goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 26bc6: 81 11 cpse r24, r1 26bc8: 82 cf rjmp .-252 ; 0x26ace // 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; 26bca: 80 e0 ldi r24, 0x00 ; 0 26bcc: 90 e0 ldi r25, 0x00 ; 0 26bce: a6 e5 ldi r26, 0x56 ; 86 26bd0: b3 e4 ldi r27, 0x43 ; 67 26bd2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 26bd6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 26bda: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 26bde: b0 93 00 12 sts 0x1200, r27 ; 0x801200 } plan_set_position_curposXYZE(); 26be2: 0f 94 90 84 call 0x30920 ; 0x30920 return true; 26be6: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 26be8: df 91 pop r29 26bea: cf 91 pop r28 26bec: 1f 91 pop r17 26bee: 0f 91 pop r16 26bf0: ff 90 pop r15 26bf2: ef 90 pop r14 26bf4: df 90 pop r13 26bf6: cf 90 pop r12 26bf8: bf 90 pop r11 26bfa: af 90 pop r10 26bfc: 9f 90 pop r9 26bfe: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 26c00: 01 15 cp r16, r1 26c02: 11 05 cpc r17, r1 26c04: 09 f4 brne .+2 ; 0x26c08 26c06: 79 cf rjmp .-270 ; 0x26afa 26c08: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26c0c: 6c 19 sub r22, r12 26c0e: 7d 09 sbc r23, r13 26c10: 8e 09 sbc r24, r14 26c12: 9f 09 sbc r25, r15 26c14: 69 38 cpi r22, 0x89 ; 137 26c16: 73 41 sbci r23, 0x13 ; 19 26c18: 81 05 cpc r24, r1 26c1a: 91 05 cpc r25, r1 26c1c: 08 f4 brcc .+2 ; 0x26c20 26c1e: 6d cf rjmp .-294 ; 0x26afa if (msg_next == NULL) 26c20: 20 97 sbiw r28, 0x00 ; 0 26c22: 11 f4 brne .+4 ; 0x26c28 msg_next = msg; 26c24: cb 2d mov r28, r11 26c26: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 26c28: ce 01 movw r24, r28 26c2a: 0f 94 f4 0a call 0x215e8 ; 0x215e8 26c2e: ec 01 movw r28, r24 previous_millis_msg = _millis(); 26c30: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 26c34: 6b 01 movw r12, r22 26c36: 7c 01 movw r14, r24 26c38: 60 cf rjmp .-320 ; 0x26afa } plan_set_position_curposXYZE(); return true; canceled: return false; 26c3a: 80 e0 ldi r24, 0x00 ; 0 26c3c: d5 cf rjmp .-86 ; 0x26be8 00026c3e : /// 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() { 26c3e: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 26c40: c0 91 15 04 lds r28, 0x0415 ; 0x800415 26c44: c2 30 cpi r28, 0x02 ; 2 26c46: 59 f1 breq .+86 ; 0x26c9e // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 26c48: c1 30 cpi r28, 0x01 ; 1 26c4a: 69 f4 brne .+26 ; 0x26c66 if (bFirst) return; 26c4c: 80 91 2e 05 lds r24, 0x052E ; 0x80052e <_ZL6bFirst.lto_priv.455> 26c50: 81 11 cpse r24, r1 26c52: 25 c0 rjmp .+74 ; 0x26c9e Sound_MakeCustom(80, 0, false); 26c54: 40 e0 ldi r20, 0x00 ; 0 26c56: 70 e0 ldi r23, 0x00 ; 0 26c58: 60 e0 ldi r22, 0x00 ; 0 26c5a: 80 e5 ldi r24, 0x50 ; 80 26c5c: 90 e0 ldi r25, 0x00 ; 0 26c5e: 0f 94 0b 32 call 0x26416 ; 0x26416 bFirst = true; 26c62: c0 93 2e 05 sts 0x052E, r28 ; 0x80052e <_ZL6bFirst.lto_priv.455> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 26c66: 60 ed ldi r22, 0xD0 ; 208 26c68: 77 e0 ldi r23, 0x07 ; 7 26c6a: 8b e2 ldi r24, 0x2B ; 43 26c6c: 95 e0 ldi r25, 0x05 ; 5 26c6e: 0f 94 29 10 call 0x22052 ; 0x22052 ::expired_cont(unsigned short)> 26c72: 88 23 and r24, r24 26c74: a1 f0 breq .+40 ; 0x26c9e beep_timer.start(); 26c76: 8b e2 ldi r24, 0x2B ; 43 26c78: 95 e0 ldi r25, 0x05 ; 5 26c7a: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 26c7e: 80 91 15 04 lds r24, 0x0415 ; 0x800415 26c82: 81 11 cpse r24, r1 26c84: 08 c0 rjmp .+16 ; 0x26c96 Sound_MakeCustom(80, 0, false); 26c86: 40 e0 ldi r20, 0x00 ; 0 26c88: 70 e0 ldi r23, 0x00 ; 0 26c8a: 60 e0 ldi r22, 0x00 ; 0 26c8c: 80 e5 ldi r24, 0x50 ; 80 26c8e: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 26c90: 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); 26c92: 0d 94 0b 32 jmp 0x26416 ; 0x26416 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 26c96: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 26c98: 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); 26c9a: 0d 94 fd 2c jmp 0x259fa ; 0x259fa } } #endif // BEEPER > 0 } 26c9e: cf 91 pop r28 26ca0: 08 95 ret 00026ca2 : { #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; 26ca2: 98 b1 in r25, 0x08 ; 8 26ca4: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 26ca6: 89 2b or r24, r25 26ca8: 88 b9 out 0x08, r24 ; 8 asm("nop"); 26caa: 00 00 nop PORTC = portC; //set step signals to zero 26cac: 98 b9 out 0x08, r25 ; 8 asm("nop"); 26cae: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 26cb0: 08 95 ret 00026cb2 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 26cb2: 82 30 cpi r24, 0x02 ; 2 26cb4: b9 f0 breq .+46 ; 0x26ce4 26cb6: 83 30 cpi r24, 0x03 ; 3 26cb8: e9 f0 breq .+58 ; 0x26cf4 26cba: 81 30 cpi r24, 0x01 ; 1 26cbc: 59 f0 breq .+22 ; 0x26cd4 { #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; 26cbe: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26cc2: 61 11 cpse r22, r1 26cc4: 05 c0 rjmp .+10 ; 0x26cd0 26cc6: 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; 26cc8: 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"); 26ccc: 00 00 nop } 26cce: 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; 26cd0: 8d 7f andi r24, 0xFD ; 253 26cd2: fa cf rjmp .-12 ; 0x26cc8 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 26cd4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26cd8: 61 11 cpse r22, r1 26cda: 02 c0 rjmp .+4 ; 0x26ce0 26cdc: 81 60 ori r24, 0x01 ; 1 26cde: f4 cf rjmp .-24 ; 0x26cc8 26ce0: 8e 7f andi r24, 0xFE ; 254 26ce2: f2 cf rjmp .-28 ; 0x26cc8 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 26ce4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26ce8: 61 11 cpse r22, r1 26cea: 02 c0 rjmp .+4 ; 0x26cf0 26cec: 84 60 ori r24, 0x04 ; 4 26cee: ec cf rjmp .-40 ; 0x26cc8 26cf0: 8b 7f andi r24, 0xFB ; 251 26cf2: ea cf rjmp .-44 ; 0x26cc8 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 26cf4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26cf8: 61 30 cpi r22, 0x01 ; 1 26cfa: 11 f4 brne .+4 ; 0x26d00 26cfc: 80 64 ori r24, 0x40 ; 64 26cfe: e4 cf rjmp .-56 ; 0x26cc8 26d00: 8f 7b andi r24, 0xBF ; 191 26d02: e2 cf rjmp .-60 ; 0x26cc8 00026d04 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 26d04: cf 93 push r28 if (cacheDirty_) { 26d06: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 26d0a: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 26d0c: 88 23 and r24, r24 26d0e: a1 f0 breq .+40 ; 0x26d38 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 26d10: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26d14: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26d18: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26d1c: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26d20: 29 ed ldi r18, 0xD9 ; 217 26d22: 3d e0 ldi r19, 0x0D ; 13 26d24: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26d28: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26d2c: 0f 94 af 71 call 0x2e35e ; 0x2e35e 26d30: c8 2f mov r28, r24 26d32: 81 11 cpse r24, r1 26d34: 04 c0 rjmp .+8 ; 0x26d3e cacheDirty_ = 0; } return true; fail: return false; 26d36: c0 e0 ldi r28, 0x00 ; 0 } 26d38: 8c 2f mov r24, r28 26d3a: cf 91 pop r28 26d3c: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 26d3e: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 26d42: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 26d46: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 26d4a: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 26d4e: 41 15 cp r20, r1 26d50: 51 05 cpc r21, r1 26d52: 61 05 cpc r22, r1 26d54: 71 05 cpc r23, r1 26d56: 91 f0 breq .+36 ; 0x26d7c if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 26d58: 29 ed ldi r18, 0xD9 ; 217 26d5a: 3d e0 ldi r19, 0x0D ; 13 26d5c: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26d60: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26d64: 0f 94 af 71 call 0x2e35e ; 0x2e35e 26d68: 88 23 and r24, r24 26d6a: 29 f3 breq .-54 ; 0x26d36 goto fail; } cacheMirrorBlock_ = 0; 26d6c: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 26d70: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 26d74: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 26d78: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 } cacheDirty_ = 0; 26d7c: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 26d80: db cf rjmp .-74 ; 0x26d38 00026d82 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 26d82: cf 92 push r12 26d84: df 92 push r13 26d86: ef 92 push r14 26d88: ff 92 push r15 26d8a: cf 93 push r28 26d8c: 6b 01 movw r12, r22 26d8e: 7c 01 movw r14, r24 26d90: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 26d92: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 26d96: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 26d9a: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 26d9e: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 26da2: 8c 15 cp r24, r12 26da4: 9d 05 cpc r25, r13 26da6: ae 05 cpc r26, r14 26da8: bf 05 cpc r27, r15 26daa: 01 f1 breq .+64 ; 0x26dec if (!cacheFlush()) goto fail; 26dac: 0f 94 82 36 call 0x26d04 ; 0x26d04 26db0: 81 11 cpse r24, r1 26db2: 08 c0 rjmp .+16 ; 0x26dc4 } if (dirty) cacheDirty_ = true; return true; fail: return false; 26db4: c0 e0 ldi r28, 0x00 ; 0 } 26db6: 8c 2f mov r24, r28 26db8: cf 91 pop r28 26dba: ff 90 pop r15 26dbc: ef 90 pop r14 26dbe: df 90 pop r13 26dc0: cf 90 pop r12 26dc2: 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; 26dc4: 29 ed ldi r18, 0xD9 ; 217 26dc6: 3d e0 ldi r19, 0x0D ; 13 26dc8: b7 01 movw r22, r14 26dca: a6 01 movw r20, r12 26dcc: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26dd0: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26dd4: 0f 94 13 72 call 0x2e426 ; 0x2e426 26dd8: 88 23 and r24, r24 26dda: 61 f3 breq .-40 ; 0x26db4 cacheBlockNumber_ = blockNumber; 26ddc: c0 92 cd 0d sts 0x0DCD, r12 ; 0x800dcd 26de0: d0 92 ce 0d sts 0x0DCE, r13 ; 0x800dce 26de4: e0 92 cf 0d sts 0x0DCF, r14 ; 0x800dcf 26de8: f0 92 d0 0d sts 0x0DD0, r15 ; 0x800dd0 } if (dirty) cacheDirty_ = true; 26dec: cc 23 and r28, r28 26dee: 21 f0 breq .+8 ; 0x26df8 26df0: 81 e0 ldi r24, 0x01 ; 1 26df2: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 26df6: df cf rjmp .-66 ; 0x26db6 return true; 26df8: c1 e0 ldi r28, 0x01 ; 1 26dfa: dd cf rjmp .-70 ; 0x26db6 00026dfc : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 26dfc: 4f 92 push r4 26dfe: 5f 92 push r5 26e00: 6f 92 push r6 26e02: 7f 92 push r7 26e04: 8f 92 push r8 26e06: 9f 92 push r9 26e08: af 92 push r10 26e0a: bf 92 push r11 26e0c: cf 92 push r12 26e0e: df 92 push r13 26e10: ef 92 push r14 26e12: ff 92 push r15 26e14: 0f 93 push r16 26e16: 1f 93 push r17 26e18: cf 93 push r28 26e1a: df 93 push r29 26e1c: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 26e1e: 42 30 cpi r20, 0x02 ; 2 26e20: 51 05 cpc r21, r1 26e22: 61 05 cpc r22, r1 26e24: 71 05 cpc r23, r1 26e26: 90 f4 brcc .+36 ; 0x26e4c // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 26e28: 80 e0 ldi r24, 0x00 ; 0 } 26e2a: df 91 pop r29 26e2c: cf 91 pop r28 26e2e: 1f 91 pop r17 26e30: 0f 91 pop r16 26e32: ff 90 pop r15 26e34: ef 90 pop r14 26e36: df 90 pop r13 26e38: cf 90 pop r12 26e3a: bf 90 pop r11 26e3c: af 90 pop r10 26e3e: 9f 90 pop r9 26e40: 8f 90 pop r8 26e42: 7f 90 pop r7 26e44: 6f 90 pop r6 26e46: 5f 90 pop r5 26e48: 4f 90 pop r4 26e4a: 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; 26e4c: 89 85 ldd r24, Y+9 ; 0x09 26e4e: 9a 85 ldd r25, Y+10 ; 0x0a 26e50: ab 85 ldd r26, Y+11 ; 0x0b 26e52: bc 85 ldd r27, Y+12 ; 0x0c 26e54: 01 96 adiw r24, 0x01 ; 1 26e56: a1 1d adc r26, r1 26e58: b1 1d adc r27, r1 26e5a: 84 17 cp r24, r20 26e5c: 95 07 cpc r25, r21 26e5e: a6 07 cpc r26, r22 26e60: b7 07 cpc r27, r23 26e62: 10 f3 brcs .-60 ; 0x26e28 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 26e64: 8f 89 ldd r24, Y+23 ; 0x17 26e66: 80 31 cpi r24, 0x10 ; 16 26e68: c9 f5 brne .+114 ; 0x26edc lba = fatStartBlock_ + (cluster >> 8); 26e6a: 85 2e mov r8, r21 26e6c: 96 2e mov r9, r22 26e6e: a7 2e mov r10, r23 26e70: bb 24 eor r11, r11 26e72: 8b 89 ldd r24, Y+19 ; 0x13 26e74: 9c 89 ldd r25, Y+20 ; 0x14 26e76: ad 89 ldd r26, Y+21 ; 0x15 26e78: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26e7a: 88 0e add r8, r24 26e7c: 99 1e adc r9, r25 26e7e: aa 1e adc r10, r26 26e80: bb 1e adc r11, r27 26e82: 28 01 movw r4, r16 26e84: 39 01 movw r6, r18 26e86: 6a 01 movw r12, r20 26e88: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 26e8a: 41 e0 ldi r20, 0x01 ; 1 26e8c: c5 01 movw r24, r10 26e8e: b4 01 movw r22, r8 26e90: 0f 94 c1 36 call 0x26d82 ; 0x26d82 26e94: 88 23 and r24, r24 26e96: 41 f2 breq .-112 ; 0x26e28 // store entry if (fatType_ == 16) { 26e98: 9f 89 ldd r25, Y+23 ; 0x17 26e9a: 90 31 cpi r25, 0x10 ; 16 26e9c: 81 f5 brne .+96 ; 0x26efe cacheBuffer_.fat16[cluster & 0XFF] = value; 26e9e: dd 24 eor r13, r13 26ea0: ee 24 eor r14, r14 26ea2: ff 24 eor r15, r15 26ea4: f6 01 movw r30, r12 26ea6: ee 0f add r30, r30 26ea8: ff 1f adc r31, r31 26eaa: e7 52 subi r30, 0x27 ; 39 26eac: f2 4f sbci r31, 0xF2 ; 242 26eae: 11 83 std Z+1, r17 ; 0x01 26eb0: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 26eb2: 9a 89 ldd r25, Y+18 ; 0x12 26eb4: 92 30 cpi r25, 0x02 ; 2 26eb6: 08 f4 brcc .+2 ; 0x26eba 26eb8: b8 cf rjmp .-144 ; 0x26e2a 26eba: 4d 81 ldd r20, Y+5 ; 0x05 26ebc: 5e 81 ldd r21, Y+6 ; 0x06 26ebe: 6f 81 ldd r22, Y+7 ; 0x07 26ec0: 78 85 ldd r23, Y+8 ; 0x08 26ec2: 84 0e add r8, r20 26ec4: 95 1e adc r9, r21 26ec6: a6 1e adc r10, r22 26ec8: b7 1e adc r11, r23 26eca: 80 92 d1 0d sts 0x0DD1, r8 ; 0x800dd1 26ece: 90 92 d2 0d sts 0x0DD2, r9 ; 0x800dd2 26ed2: a0 92 d3 0d sts 0x0DD3, r10 ; 0x800dd3 26ed6: b0 92 d4 0d sts 0x0DD4, r11 ; 0x800dd4 26eda: a7 cf rjmp .-178 ; 0x26e2a cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26edc: 80 32 cpi r24, 0x20 ; 32 26ede: 09 f0 breq .+2 ; 0x26ee2 26ee0: a3 cf rjmp .-186 ; 0x26e28 lba = fatStartBlock_ + (cluster >> 7); 26ee2: 8b 89 ldd r24, Y+19 ; 0x13 26ee4: 9c 89 ldd r25, Y+20 ; 0x14 26ee6: ad 89 ldd r26, Y+21 ; 0x15 26ee8: be 89 ldd r27, Y+22 ; 0x16 26eea: 4a 01 movw r8, r20 26eec: 5b 01 movw r10, r22 26eee: e7 e0 ldi r30, 0x07 ; 7 26ef0: b6 94 lsr r11 26ef2: a7 94 ror r10 26ef4: 97 94 ror r9 26ef6: 87 94 ror r8 26ef8: ea 95 dec r30 26efa: d1 f7 brne .-12 ; 0x26ef0 26efc: be cf rjmp .-132 ; 0x26e7a if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 26efe: e8 94 clt 26f00: c7 f8 bld r12, 7 26f02: dd 24 eor r13, r13 26f04: ee 24 eor r14, r14 26f06: ff 24 eor r15, r15 26f08: f6 01 movw r30, r12 26f0a: ee 0f add r30, r30 26f0c: ff 1f adc r31, r31 26f0e: ee 0f add r30, r30 26f10: ff 1f adc r31, r31 26f12: e7 52 subi r30, 0x27 ; 39 26f14: f2 4f sbci r31, 0xF2 ; 242 26f16: 40 82 st Z, r4 26f18: 51 82 std Z+1, r5 ; 0x01 26f1a: 62 82 std Z+2, r6 ; 0x02 26f1c: 73 82 std Z+3, r7 ; 0x03 26f1e: c9 cf rjmp .-110 ; 0x26eb2 00026f20 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 26f20: cf 92 push r12 26f22: df 92 push r13 26f24: ef 92 push r14 26f26: ff 92 push r15 26f28: 0f 93 push r16 26f2a: 1f 93 push r17 26f2c: cf 93 push r28 26f2e: df 93 push r29 26f30: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 26f32: 81 85 ldd r24, Z+9 ; 0x09 26f34: 92 85 ldd r25, Z+10 ; 0x0a 26f36: a3 85 ldd r26, Z+11 ; 0x0b 26f38: b4 85 ldd r27, Z+12 ; 0x0c 26f3a: 01 96 adiw r24, 0x01 ; 1 26f3c: a1 1d adc r26, r1 26f3e: b1 1d adc r27, r1 26f40: 84 17 cp r24, r20 26f42: 95 07 cpc r25, r21 26f44: a6 07 cpc r26, r22 26f46: b7 07 cpc r27, r23 26f48: 50 f4 brcc .+20 ; 0x26f5e *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 26f4a: 80 e0 ldi r24, 0x00 ; 0 } 26f4c: df 91 pop r29 26f4e: cf 91 pop r28 26f50: 1f 91 pop r17 26f52: 0f 91 pop r16 26f54: ff 90 pop r15 26f56: ef 90 pop r14 26f58: df 90 pop r13 26f5a: cf 90 pop r12 26f5c: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 26f5e: 87 89 ldd r24, Z+23 ; 0x17 26f60: 80 31 cpi r24, 0x10 ; 16 26f62: a9 f5 brne .+106 ; 0x26fce lba = fatStartBlock_ + (cluster >> 8); 26f64: bb 27 eor r27, r27 26f66: a7 2f mov r26, r23 26f68: 96 2f mov r25, r22 26f6a: 85 2f mov r24, r21 26f6c: c3 88 ldd r12, Z+19 ; 0x13 26f6e: d4 88 ldd r13, Z+20 ; 0x14 26f70: e5 88 ldd r14, Z+21 ; 0x15 26f72: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26f74: 8c 0d add r24, r12 26f76: 9d 1d adc r25, r13 26f78: ae 1d adc r26, r14 26f7a: bf 1d adc r27, r15 26f7c: e9 01 movw r28, r18 26f7e: 6a 01 movw r12, r20 26f80: 7b 01 movw r14, r22 26f82: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 26f84: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26f88: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26f8c: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26f90: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26f94: 84 17 cp r24, r20 26f96: 95 07 cpc r25, r21 26f98: a6 07 cpc r26, r22 26f9a: b7 07 cpc r27, r23 26f9c: 49 f5 brne .+82 ; 0x26ff0 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 26f9e: f8 01 movw r30, r16 26fa0: 87 89 ldd r24, Z+23 ; 0x17 26fa2: 80 31 cpi r24, 0x10 ; 16 26fa4: 69 f5 brne .+90 ; 0x27000 *value = cacheBuffer_.fat16[cluster & 0XFF]; 26fa6: b7 01 movw r22, r14 26fa8: a6 01 movw r20, r12 26faa: 55 27 eor r21, r21 26fac: 66 27 eor r22, r22 26fae: 77 27 eor r23, r23 26fb0: 44 0f add r20, r20 26fb2: 55 1f adc r21, r21 26fb4: 47 52 subi r20, 0x27 ; 39 26fb6: 52 4f sbci r21, 0xF2 ; 242 26fb8: fa 01 movw r30, r20 26fba: 80 81 ld r24, Z 26fbc: 91 81 ldd r25, Z+1 ; 0x01 26fbe: b0 e0 ldi r27, 0x00 ; 0 26fc0: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 26fc2: 88 83 st Y, r24 26fc4: 99 83 std Y+1, r25 ; 0x01 26fc6: aa 83 std Y+2, r26 ; 0x02 26fc8: bb 83 std Y+3, r27 ; 0x03 26fca: 81 e0 ldi r24, 0x01 ; 1 26fcc: bf cf rjmp .-130 ; 0x26f4c *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26fce: 80 32 cpi r24, 0x20 ; 32 26fd0: 09 f0 breq .+2 ; 0x26fd4 26fd2: bb cf rjmp .-138 ; 0x26f4a lba = fatStartBlock_ + (cluster >> 7); 26fd4: c3 88 ldd r12, Z+19 ; 0x13 26fd6: d4 88 ldd r13, Z+20 ; 0x14 26fd8: e5 88 ldd r14, Z+21 ; 0x15 26fda: f6 88 ldd r15, Z+22 ; 0x16 26fdc: db 01 movw r26, r22 26fde: ca 01 movw r24, r20 26fe0: c7 e0 ldi r28, 0x07 ; 7 26fe2: b6 95 lsr r27 26fe4: a7 95 ror r26 26fe6: 97 95 ror r25 26fe8: 87 95 ror r24 26fea: ca 95 dec r28 26fec: d1 f7 brne .-12 ; 0x26fe2 26fee: c2 cf rjmp .-124 ; 0x26f74 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 26ff0: 40 e0 ldi r20, 0x00 ; 0 26ff2: bc 01 movw r22, r24 26ff4: cd 01 movw r24, r26 26ff6: 0f 94 c1 36 call 0x26d82 ; 0x26d82 26ffa: 81 11 cpse r24, r1 26ffc: d0 cf rjmp .-96 ; 0x26f9e 26ffe: a5 cf rjmp .-182 ; 0x26f4a } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 27000: b7 01 movw r22, r14 27002: a6 01 movw r20, r12 27004: 4f 77 andi r20, 0x7F ; 127 27006: 55 27 eor r21, r21 27008: 66 27 eor r22, r22 2700a: 77 27 eor r23, r23 2700c: 44 0f add r20, r20 2700e: 55 1f adc r21, r21 27010: 44 0f add r20, r20 27012: 55 1f adc r21, r21 27014: 47 52 subi r20, 0x27 ; 39 27016: 52 4f sbci r21, 0xF2 ; 242 27018: fa 01 movw r30, r20 2701a: 80 81 ld r24, Z 2701c: 91 81 ldd r25, Z+1 ; 0x01 2701e: a2 81 ldd r26, Z+2 ; 0x02 27020: b3 81 ldd r27, Z+3 ; 0x03 27022: bf 70 andi r27, 0x0F ; 15 27024: ce cf rjmp .-100 ; 0x26fc2 00027026 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 27026: 4f 92 push r4 27028: 5f 92 push r5 2702a: 6f 92 push r6 2702c: 7f 92 push r7 2702e: af 92 push r10 27030: bf 92 push r11 27032: cf 92 push r12 27034: df 92 push r13 27036: ef 92 push r14 27038: ff 92 push r15 2703a: 0f 93 push r16 2703c: 1f 93 push r17 2703e: cf 93 push r28 27040: df 93 push r29 27042: 00 d0 rcall .+0 ; 0x27044 27044: 1f 92 push r1 27046: cd b7 in r28, 0x3d ; 61 27048: de b7 in r29, 0x3e ; 62 2704a: 8c 01 movw r16, r24 2704c: 49 83 std Y+1, r20 ; 0x01 2704e: 5a 83 std Y+2, r21 ; 0x02 27050: 6b 83 std Y+3, r22 ; 0x03 27052: 7c 83 std Y+4, r23 ; 0x04 27054: 59 01 movw r10, r18 uint32_t s = 0; 27056: c1 2c mov r12, r1 27058: d1 2c mov r13, r1 2705a: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2705c: 41 2c mov r4, r1 2705e: 82 e0 ldi r24, 0x02 ; 2 27060: 58 2e mov r5, r24 27062: 61 2c mov r6, r1 27064: 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; 27066: 49 81 ldd r20, Y+1 ; 0x01 27068: 5a 81 ldd r21, Y+2 ; 0x02 2706a: 6b 81 ldd r22, Y+3 ; 0x03 2706c: 7c 81 ldd r23, Y+4 ; 0x04 2706e: 9e 01 movw r18, r28 27070: 2f 5f subi r18, 0xFF ; 255 27072: 3f 4f sbci r19, 0xFF ; 255 27074: c8 01 movw r24, r16 27076: 0f 94 90 37 call 0x26f20 ; 0x26f20 2707a: 88 23 and r24, r24 2707c: 19 f1 breq .+70 ; 0x270c4 s += 512UL << clusterSizeShift_; 2707e: f8 01 movw r30, r16 27080: 85 85 ldd r24, Z+13 ; 0x0d 27082: a3 01 movw r20, r6 27084: 92 01 movw r18, r4 27086: 04 c0 rjmp .+8 ; 0x27090 27088: 22 0f add r18, r18 2708a: 33 1f adc r19, r19 2708c: 44 1f adc r20, r20 2708e: 55 1f adc r21, r21 27090: 8a 95 dec r24 27092: d2 f7 brpl .-12 ; 0x27088 27094: da 01 movw r26, r20 27096: c9 01 movw r24, r18 27098: c8 0e add r12, r24 2709a: d9 1e adc r13, r25 2709c: ea 1e adc r14, r26 2709e: fb 1e adc r15, r27 } while (!isEOC(cluster)); 270a0: 49 81 ldd r20, Y+1 ; 0x01 270a2: 5a 81 ldd r21, Y+2 ; 0x02 270a4: 6b 81 ldd r22, Y+3 ; 0x03 270a6: 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; 270a8: 87 89 ldd r24, Z+23 ; 0x17 270aa: 80 31 cpi r24, 0x10 ; 16 270ac: f1 f4 brne .+60 ; 0x270ea 270ae: 81 e0 ldi r24, 0x01 ; 1 270b0: 48 3f cpi r20, 0xF8 ; 248 270b2: 5f 4f sbci r21, 0xFF ; 255 270b4: 61 05 cpc r22, r1 270b6: 71 05 cpc r23, r1 270b8: b0 f2 brcs .-84 ; 0x27066 *size = s; 270ba: f5 01 movw r30, r10 270bc: c0 82 st Z, r12 270be: d1 82 std Z+1, r13 ; 0x01 270c0: e2 82 std Z+2, r14 ; 0x02 270c2: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 270c4: 0f 90 pop r0 270c6: 0f 90 pop r0 270c8: 0f 90 pop r0 270ca: 0f 90 pop r0 270cc: df 91 pop r29 270ce: cf 91 pop r28 270d0: 1f 91 pop r17 270d2: 0f 91 pop r16 270d4: ff 90 pop r15 270d6: ef 90 pop r14 270d8: df 90 pop r13 270da: cf 90 pop r12 270dc: bf 90 pop r11 270de: af 90 pop r10 270e0: 7f 90 pop r7 270e2: 6f 90 pop r6 270e4: 5f 90 pop r5 270e6: 4f 90 pop r4 270e8: 08 95 ret return cluster >= FAT32EOC_MIN; 270ea: 81 e0 ldi r24, 0x01 ; 1 270ec: 48 3f cpi r20, 0xF8 ; 248 270ee: 5f 4f sbci r21, 0xFF ; 255 270f0: 6f 4f sbci r22, 0xFF ; 255 270f2: 7f 40 sbci r23, 0x0F ; 15 270f4: 08 f4 brcc .+2 ; 0x270f8 270f6: b7 cf rjmp .-146 ; 0x27066 270f8: e0 cf rjmp .-64 ; 0x270ba 000270fa : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 270fa: cf 92 push r12 270fc: df 92 push r13 270fe: ef 92 push r14 27100: ff 92 push r15 27102: 1f 93 push r17 27104: cf 93 push r28 27106: df 93 push r29 27108: ec 01 movw r28, r24 2710a: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2710c: e1 11 cpse r30, r1 2710e: 09 c0 rjmp .+18 ; 0x27122 27110: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 27112: df 91 pop r29 27114: cf 91 pop r28 27116: 1f 91 pop r17 27118: ff 90 pop r15 2711a: ef 90 pop r14 2711c: df 90 pop r13 2711e: cf 90 pop r12 27120: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 27122: 89 81 ldd r24, Y+1 ; 0x01 27124: 80 ff sbrs r24, 0 27126: f4 cf rjmp .-24 ; 0x27110 gfOffset = curPosition_ & 0X1FF; // offset in block 27128: 48 85 ldd r20, Y+8 ; 0x08 2712a: 59 85 ldd r21, Y+9 ; 0x09 2712c: 6a 85 ldd r22, Y+10 ; 0x0a 2712e: 7b 85 ldd r23, Y+11 ; 0x0b 27130: 9a 01 movw r18, r20 27132: 31 70 andi r19, 0x01 ; 1 27134: 3a a3 std Y+34, r19 ; 0x22 27136: 29 a3 std Y+33, r18 ; 0x21 27138: 89 8d ldd r24, Y+25 ; 0x19 2713a: 9a 8d ldd r25, Y+26 ; 0x1a 2713c: 6a 01 movw r12, r20 2713e: 7b 01 movw r14, r22 27140: f9 e0 ldi r31, 0x09 ; 9 27142: f6 94 lsr r15 27144: e7 94 ror r14 27146: d7 94 ror r13 27148: c7 94 ror r12 2714a: fa 95 dec r31 2714c: d1 f7 brne .-12 ; 0x27142 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2714e: e2 30 cpi r30, 0x02 ; 2 27150: 79 f4 brne .+30 ; 0x27170 // 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); 27152: fc 01 movw r30, r24 27154: 82 8d ldd r24, Z+26 ; 0x1a 27156: 93 8d ldd r25, Z+27 ; 0x1b 27158: a4 8d ldd r26, Z+28 ; 0x1c 2715a: b5 8d ldd r27, Z+29 ; 0x1d 2715c: 8c 0d add r24, r12 2715e: 9d 1d adc r25, r13 27160: ae 1d adc r26, r14 27162: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 27164: 8d 8f std Y+29, r24 ; 0x1d 27166: 9e 8f std Y+30, r25 ; 0x1e 27168: af 8f std Y+31, r26 ; 0x1f 2716a: b8 a3 std Y+32, r27 ; 0x20 } return true; 2716c: 81 e0 ldi r24, 0x01 ; 1 2716e: d1 cf rjmp .-94 ; 0x27112 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);} 27170: fc 01 movw r30, r24 27172: 14 81 ldd r17, Z+4 ; 0x04 27174: 11 50 subi r17, 0x01 ; 1 27176: 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) { 27178: 23 2b or r18, r19 2717a: 71 f4 brne .+28 ; 0x27198 2717c: 11 11 cpse r17, r1 2717e: 0c c0 rjmp .+24 ; 0x27198 // start of new cluster if (curPosition_ == 0) { 27180: 45 2b or r20, r21 27182: 46 2b or r20, r22 27184: 47 2b or r20, r23 27186: 31 f5 brne .+76 ; 0x271d4 // use first cluster in file curCluster_ = firstCluster_; 27188: 8d 89 ldd r24, Y+21 ; 0x15 2718a: 9e 89 ldd r25, Y+22 ; 0x16 2718c: af 89 ldd r26, Y+23 ; 0x17 2718e: b8 8d ldd r27, Y+24 ; 0x18 27190: 8c 83 std Y+4, r24 ; 0x04 27192: 9d 83 std Y+5, r25 ; 0x05 27194: ae 83 std Y+6, r26 ; 0x06 27196: 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; 27198: e9 8d ldd r30, Y+25 ; 0x19 2719a: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2719c: 8c 81 ldd r24, Y+4 ; 0x04 2719e: 9d 81 ldd r25, Y+5 ; 0x05 271a0: ae 81 ldd r26, Y+6 ; 0x06 271a2: bf 81 ldd r27, Y+7 ; 0x07 271a4: 02 97 sbiw r24, 0x02 ; 2 271a6: a1 09 sbc r26, r1 271a8: b1 09 sbc r27, r1 271aa: 25 85 ldd r18, Z+13 ; 0x0d 271ac: 04 c0 rjmp .+8 ; 0x271b6 271ae: 88 0f add r24, r24 271b0: 99 1f adc r25, r25 271b2: aa 1f adc r26, r26 271b4: bb 1f adc r27, r27 271b6: 2a 95 dec r18 271b8: d2 f7 brpl .-12 ; 0x271ae 271ba: 46 85 ldd r20, Z+14 ; 0x0e 271bc: 57 85 ldd r21, Z+15 ; 0x0f 271be: 60 89 ldd r22, Z+16 ; 0x10 271c0: 71 89 ldd r23, Z+17 ; 0x11 271c2: 84 0f add r24, r20 271c4: 95 1f adc r25, r21 271c6: a6 1f adc r26, r22 271c8: b7 1f adc r27, r23 271ca: 81 0f add r24, r17 271cc: 91 1d adc r25, r1 271ce: a1 1d adc r26, r1 271d0: b1 1d adc r27, r1 271d2: c8 cf rjmp .-112 ; 0x27164 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 271d4: 4c 81 ldd r20, Y+4 ; 0x04 271d6: 5d 81 ldd r21, Y+5 ; 0x05 271d8: 6e 81 ldd r22, Y+6 ; 0x06 271da: 7f 81 ldd r23, Y+7 ; 0x07 271dc: 9e 01 movw r18, r28 271de: 2c 5f subi r18, 0xFC ; 252 271e0: 3f 4f sbci r19, 0xFF ; 255 271e2: 0f 94 90 37 call 0x26f20 ; 0x26f20 271e6: 81 11 cpse r24, r1 271e8: d7 cf rjmp .-82 ; 0x27198 271ea: 92 cf rjmp .-220 ; 0x27110 000271ec : * 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) { 271ec: df 92 push r13 271ee: ef 92 push r14 271f0: ff 92 push r15 271f2: 0f 93 push r16 271f4: 1f 93 push r17 271f6: cf 93 push r28 271f8: df 93 push r29 271fa: 8c 01 movw r16, r24 271fc: eb 01 movw r28, r22 271fe: 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; 27200: 8d e0 ldi r24, 0x0D ; 13 27202: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 27204: 40 e2 ldi r20, 0x20 ; 32 27206: 50 e0 ldi r21, 0x00 ; 0 27208: be 01 movw r22, r28 2720a: c8 01 movw r24, r16 2720c: 0f 94 cc 72 call 0x2e598 ; 0x2e598 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 27210: 80 32 cpi r24, 0x20 ; 32 27212: 91 05 cpc r25, r1 27214: 71 f0 breq .+28 ; 0x27232 27216: 21 e0 ldi r18, 0x01 ; 1 27218: 89 2b or r24, r25 2721a: 09 f4 brne .+2 ; 0x2721e 2721c: 20 e0 ldi r18, 0x00 ; 0 2721e: 82 2f mov r24, r18 27220: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 27222: df 91 pop r29 27224: cf 91 pop r28 27226: 1f 91 pop r17 27228: 0f 91 pop r16 2722a: ff 90 pop r15 2722c: ef 90 pop r14 2722e: df 90 pop r13 27230: 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; 27232: 28 81 ld r18, Y 27234: 22 23 and r18, r18 27236: 09 f4 brne .+2 ; 0x2723a 27238: 3f c0 rjmp .+126 ; 0x272b8 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2723a: 25 3e cpi r18, 0xE5 ; 229 2723c: 19 f3 breq .-58 ; 0x27204 2723e: 2e 32 cpi r18, 0x2E ; 46 27240: 09 f3 breq .-62 ; 0x27204 //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) 27242: 3b 85 ldd r19, Y+11 ; 0x0b 27244: 3f 73 andi r19, 0x3F ; 63 27246: 3f 30 cpi r19, 0x0F ; 15 27248: 99 f5 brne .+102 ; 0x272b0 2724a: e1 14 cp r14, r1 2724c: f1 04 cpc r15, r1 2724e: 81 f1 breq .+96 ; 0x272b0 { 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) 27250: 4a 8d ldd r20, Y+26 ; 0x1a 27252: 5b 8d ldd r21, Y+27 ; 0x1b 27254: 45 2b or r20, r21 27256: 61 f5 brne .+88 ; 0x272b0 27258: 2f 71 andi r18, 0x1F ; 31 2725a: 3f ef ldi r19, 0xFF ; 255 2725c: 32 0f add r19, r18 2725e: 34 30 cpi r19, 0x04 ; 4 27260: 38 f5 brcc .+78 ; 0x272b0 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 27262: 21 50 subi r18, 0x01 ; 1 27264: 33 0b sbc r19, r19 27266: d2 9e mul r13, r18 27268: c0 01 movw r24, r0 2726a: d3 9e mul r13, r19 2726c: 90 0d add r25, r0 2726e: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 27270: f7 01 movw r30, r14 27272: e8 0f add r30, r24 27274: f9 1f adc r31, r25 27276: 29 81 ldd r18, Y+1 ; 0x01 27278: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2727a: 2b 81 ldd r18, Y+3 ; 0x03 2727c: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2727e: 2d 81 ldd r18, Y+5 ; 0x05 27280: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 27282: 2f 81 ldd r18, Y+7 ; 0x07 27284: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 27286: 29 85 ldd r18, Y+9 ; 0x09 27288: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2728a: 2e 85 ldd r18, Y+14 ; 0x0e 2728c: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2728e: 28 89 ldd r18, Y+16 ; 0x10 27290: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 27292: 2a 89 ldd r18, Y+18 ; 0x12 27294: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 27296: 2c 89 ldd r18, Y+20 ; 0x14 27298: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2729a: 2e 89 ldd r18, Y+22 ; 0x16 2729c: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2729e: 28 8d ldd r18, Y+24 ; 0x18 272a0: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 272a2: 2c 8d ldd r18, Y+28 ; 0x1c 272a4: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 272a6: 2e 8d ldd r18, Y+30 ; 0x1e 272a8: 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) 272aa: 28 81 ld r18, Y 272ac: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 272ae: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 272b0: 2b 85 ldd r18, Y+11 ; 0x0b 272b2: 23 fd sbrc r18, 3 272b4: a7 cf rjmp .-178 ; 0x27204 272b6: b5 cf rjmp .-150 ; 0x27222 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; 272b8: 80 e0 ldi r24, 0x00 ; 0 272ba: b3 cf rjmp .-154 ; 0x27222 000272bc : * \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() { 272bc: cf 93 push r28 272be: df 93 push r29 272c0: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 272c2: 8b 81 ldd r24, Y+3 ; 0x03 272c4: 88 23 and r24, r24 272c6: 49 f1 breq .+82 ; 0x2731a if (flags_ & F_FILE_DIR_DIRTY) { 272c8: 89 81 ldd r24, Y+1 ; 0x01 272ca: 87 ff sbrs r24, 7 272cc: 22 c0 rjmp .+68 ; 0x27312 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 272ce: 61 e0 ldi r22, 0x01 ; 1 272d0: ce 01 movw r24, r28 272d2: 0f 94 fb 6f call 0x2dff6 ; 0x2dff6 272d6: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 272d8: 89 2b or r24, r25 272da: f9 f0 breq .+62 ; 0x2731a 272dc: 80 81 ld r24, Z 272de: 85 3e cpi r24, 0xE5 ; 229 272e0: e1 f0 breq .+56 ; 0x2731a // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 272e2: 8b 81 ldd r24, Y+3 ; 0x03 272e4: 82 30 cpi r24, 0x02 ; 2 272e6: 40 f4 brcc .+16 ; 0x272f8 272e8: 89 89 ldd r24, Y+17 ; 0x11 272ea: 9a 89 ldd r25, Y+18 ; 0x12 272ec: ab 89 ldd r26, Y+19 ; 0x13 272ee: bc 89 ldd r27, Y+20 ; 0x14 272f0: 84 8f std Z+28, r24 ; 0x1c 272f2: 95 8f std Z+29, r25 ; 0x1d 272f4: a6 8f std Z+30, r26 ; 0x1e 272f6: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 272f8: 8d 89 ldd r24, Y+21 ; 0x15 272fa: 9e 89 ldd r25, Y+22 ; 0x16 272fc: 93 8f std Z+27, r25 ; 0x1b 272fe: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 27300: 8d 89 ldd r24, Y+21 ; 0x15 27302: 9e 89 ldd r25, Y+22 ; 0x16 27304: af 89 ldd r26, Y+23 ; 0x17 27306: b8 8d ldd r27, Y+24 ; 0x18 27308: b5 8b std Z+21, r27 ; 0x15 2730a: 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; 2730c: 89 81 ldd r24, Y+1 ; 0x01 2730e: 8f 77 andi r24, 0x7F ; 127 27310: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 27312: df 91 pop r29 27314: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 27316: 0d 94 82 36 jmp 0x26d04 ; 0x26d04 fail: writeError = true; 2731a: 81 e0 ldi r24, 0x01 ; 1 2731c: 88 83 st Y, r24 return false; } 2731e: 80 e0 ldi r24, 0x00 ; 0 27320: df 91 pop r29 27322: cf 91 pop r28 27324: 08 95 ret 00027326 : * \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) { 27326: 8f 92 push r8 27328: 9f 92 push r9 2732a: af 92 push r10 2732c: bf 92 push r11 2732e: cf 92 push r12 27330: df 92 push r13 27332: ef 92 push r14 27334: ff 92 push r15 27336: 0f 93 push r16 27338: 1f 93 push r17 2733a: cf 93 push r28 2733c: df 93 push r29 2733e: ec 01 movw r28, r24 27340: 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; 27342: 81 11 cpse r24, r1 27344: 0e c0 rjmp .+28 ; 0x27362 done: return true; fail: return false; 27346: 80 e0 ldi r24, 0x00 ; 0 } 27348: df 91 pop r29 2734a: cf 91 pop r28 2734c: 1f 91 pop r17 2734e: 0f 91 pop r16 27350: ff 90 pop r15 27352: ef 90 pop r14 27354: df 90 pop r13 27356: cf 90 pop r12 27358: bf 90 pop r11 2735a: af 90 pop r10 2735c: 9f 90 pop r9 2735e: 8f 90 pop r8 27360: 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; 27362: 09 89 ldd r16, Y+17 ; 0x11 27364: 1a 89 ldd r17, Y+18 ; 0x12 27366: 2b 89 ldd r18, Y+19 ; 0x13 27368: 3c 89 ldd r19, Y+20 ; 0x14 2736a: 04 17 cp r16, r20 2736c: 15 07 cpc r17, r21 2736e: 26 07 cpc r18, r22 27370: 37 07 cpc r19, r23 27372: 48 f3 brcs .-46 ; 0x27346 27374: 4a 01 movw r8, r20 27376: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 27378: 82 30 cpi r24, 0x02 ; 2 2737a: 31 f4 brne .+12 ; 0x27388 curPosition_ = pos; 2737c: 88 86 std Y+8, r8 ; 0x08 2737e: 99 86 std Y+9, r9 ; 0x09 27380: aa 86 std Y+10, r10 ; 0x0a 27382: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 27384: 81 e0 ldi r24, 0x01 ; 1 27386: e0 cf rjmp .-64 ; 0x27348 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 27388: 81 14 cp r8, r1 2738a: 91 04 cpc r9, r1 2738c: a1 04 cpc r10, r1 2738e: b1 04 cpc r11, r1 27390: 49 f4 brne .+18 ; 0x273a4 // set position to start of file curCluster_ = 0; 27392: 1c 82 std Y+4, r1 ; 0x04 27394: 1d 82 std Y+5, r1 ; 0x05 27396: 1e 82 std Y+6, r1 ; 0x06 27398: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2739a: 18 86 std Y+8, r1 ; 0x08 2739c: 19 86 std Y+9, r1 ; 0x09 2739e: 1a 86 std Y+10, r1 ; 0x0a 273a0: 1b 86 std Y+11, r1 ; 0x0b 273a2: f0 cf rjmp .-32 ; 0x27384 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 273a4: 08 85 ldd r16, Y+8 ; 0x08 273a6: 19 85 ldd r17, Y+9 ; 0x09 273a8: 2a 85 ldd r18, Y+10 ; 0x0a 273aa: 3b 85 ldd r19, Y+11 ; 0x0b 273ac: e9 8d ldd r30, Y+25 ; 0x19 273ae: fa 8d ldd r31, Y+26 ; 0x1a 273b0: 85 85 ldd r24, Z+13 ; 0x0d 273b2: 90 e0 ldi r25, 0x00 ; 0 273b4: 09 96 adiw r24, 0x09 ; 9 273b6: b9 01 movw r22, r18 273b8: a8 01 movw r20, r16 273ba: 41 50 subi r20, 0x01 ; 1 273bc: 51 09 sbc r21, r1 273be: 61 09 sbc r22, r1 273c0: 71 09 sbc r23, r1 273c2: 08 2e mov r0, r24 273c4: 04 c0 rjmp .+8 ; 0x273ce 273c6: 76 95 lsr r23 273c8: 67 95 ror r22 273ca: 57 95 ror r21 273cc: 47 95 ror r20 273ce: 0a 94 dec r0 273d0: d2 f7 brpl .-12 ; 0x273c6 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 273d2: 75 01 movw r14, r10 273d4: 64 01 movw r12, r8 273d6: e1 e0 ldi r30, 0x01 ; 1 273d8: ce 1a sub r12, r30 273da: d1 08 sbc r13, r1 273dc: e1 08 sbc r14, r1 273de: f1 08 sbc r15, r1 273e0: 04 c0 rjmp .+8 ; 0x273ea 273e2: f6 94 lsr r15 273e4: e7 94 ror r14 273e6: d7 94 ror r13 273e8: c7 94 ror r12 273ea: 8a 95 dec r24 273ec: d2 f7 brpl .-12 ; 0x273e2 if (nNew < nCur || curPosition_ == 0) { 273ee: c4 16 cp r12, r20 273f0: d5 06 cpc r13, r21 273f2: e6 06 cpc r14, r22 273f4: f7 06 cpc r15, r23 273f6: 20 f0 brcs .+8 ; 0x27400 273f8: 01 2b or r16, r17 273fa: 02 2b or r16, r18 273fc: 03 2b or r16, r19 273fe: 11 f5 brne .+68 ; 0x27444 // must follow chain from first cluster curCluster_ = firstCluster_; 27400: 8d 89 ldd r24, Y+21 ; 0x15 27402: 9e 89 ldd r25, Y+22 ; 0x16 27404: af 89 ldd r26, Y+23 ; 0x17 27406: b8 8d ldd r27, Y+24 ; 0x18 27408: 8c 83 std Y+4, r24 ; 0x04 2740a: 9d 83 std Y+5, r25 ; 0x05 2740c: ae 83 std Y+6, r26 ; 0x06 2740e: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 27410: 8e 01 movw r16, r28 27412: 0c 5f subi r16, 0xFC ; 252 27414: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 27416: c1 14 cp r12, r1 27418: d1 04 cpc r13, r1 2741a: e1 04 cpc r14, r1 2741c: f1 04 cpc r15, r1 2741e: 09 f4 brne .+2 ; 0x27422 27420: ad cf rjmp .-166 ; 0x2737c if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 27422: 4c 81 ldd r20, Y+4 ; 0x04 27424: 5d 81 ldd r21, Y+5 ; 0x05 27426: 6e 81 ldd r22, Y+6 ; 0x06 27428: 7f 81 ldd r23, Y+7 ; 0x07 2742a: 98 01 movw r18, r16 2742c: 89 8d ldd r24, Y+25 ; 0x19 2742e: 9a 8d ldd r25, Y+26 ; 0x1a 27430: 0f 94 90 37 call 0x26f20 ; 0x26f20 27434: 91 e0 ldi r25, 0x01 ; 1 27436: c9 1a sub r12, r25 27438: d1 08 sbc r13, r1 2743a: e1 08 sbc r14, r1 2743c: f1 08 sbc r15, r1 2743e: 81 11 cpse r24, r1 27440: ea cf rjmp .-44 ; 0x27416 27442: 81 cf rjmp .-254 ; 0x27346 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 27444: c4 1a sub r12, r20 27446: d5 0a sbc r13, r21 27448: e6 0a sbc r14, r22 2744a: f7 0a sbc r15, r23 2744c: e1 cf rjmp .-62 ; 0x27410 0002744e : 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() { 2744e: cf 93 push r28 27450: df 93 push r29 if (MMU2::mmu2.Enabled()) { 27452: 80 91 94 12 lds r24, 0x1294 ; 0x801294 27456: 81 30 cpi r24, 0x01 ; 1 27458: f9 f4 brne .+62 ; 0x27498 const uint8_t filament = choose_menu_P( _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,(_T(MSG_CANCEL)+1)); //Hack to reuse MSG but strip 1st char off 2745a: 8c e9 ldi r24, 0x9C ; 156 2745c: 9e e4 ldi r25, 0x4E ; 78 2745e: 0e 94 32 6d call 0xda64 ; 0xda64 27462: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 27464: 86 e8 ldi r24, 0x86 ; 134 27466: 9e e3 ldi r25, 0x3E ; 62 27468: 0e 94 32 6d call 0xda64 ; 0xda64 2746c: be 01 movw r22, r28 2746e: 6f 5f subi r22, 0xFF ; 255 27470: 7f 4f sbci r23, 0xFF ; 255 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,(_T(MSG_CANCEL)+1)); //Hack to reuse MSG but strip 1st char off 27472: 0e 94 e2 bc call 0x179c4 ; 0x179c4 if (filament < MMU_FILAMENT_COUNT) { 27476: 85 30 cpi r24, 0x05 ; 5 27478: a0 f5 brcc .+104 ; 0x274e2 lay1cal_filament = filament; 2747a: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af <_ZL16lay1cal_filament.lto_priv.407> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2747e: 8a e0 ldi r24, 0x0A ; 10 27480: 80 93 62 03 sts 0x0362, r24 ; 0x800362 menu_goto(lcd_generic_preheat_menu, 0, true); 27484: 20 e0 ldi r18, 0x00 ; 0 27486: 41 e0 ldi r20, 0x01 ; 1 27488: 70 e0 ldi r23, 0x00 ; 0 2748a: 60 e0 ldi r22, 0x00 ; 0 2748c: 8b e2 ldi r24, 0x2B ; 43 2748e: 98 e3 ldi r25, 0x38 ; 56 } 27490: df 91 pop r29 27492: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 27494: 0d 94 46 94 jmp 0x3288c ; 0x3288c menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 27498: 8f e5 ldi r24, 0x5F ; 95 2749a: 9f e0 ldi r25, 0x0F ; 15 2749c: 0f 94 3c a1 call 0x34278 ; 0x34278 274a0: 81 11 cpse r24, r1 274a2: ed cf rjmp .-38 ; 0x2747e { bool loaded = false; if (fsensor.isReady()) { 274a4: 80 91 84 16 lds r24, 0x1684 ; 0x801684 274a8: 82 30 cpi r24, 0x02 ; 2 274aa: f9 f4 brne .+62 ; 0x274ea loaded = fsensor.getFilamentPresent(); 274ac: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 274b0: 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) { 274b2: 91 11 cpse r25, r1 274b4: e4 cf rjmp .-56 ; 0x2747e lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 274b6: 8e e7 ldi r24, 0x7E ; 126 274b8: 9e e4 ldi r25, 0x4E ; 78 274ba: 0e 94 32 6d call 0xda64 ; 0xda64 274be: 0f 94 f4 0a call 0x215e8 ; 0x215e8 lcd_consume_click(); 274c2: 0e 94 14 6c call 0xd828 ; 0xd828 274c6: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 274c8: 84 e6 ldi r24, 0x64 ; 100 274ca: 90 e0 ldi r25, 0x00 ; 0 274cc: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 if (lcd_clicked()) { 274d0: 0e 94 19 6c call 0xd832 ; 0xd832 274d4: 81 11 cpse r24, r1 274d6: 02 c0 rjmp .+4 ; 0x274dc 274d8: 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 274da: b1 f7 brne .-20 ; 0x274c8 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 274dc: 81 e0 ldi r24, 0x01 ; 1 274de: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 274e2: df 91 pop r29 274e4: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 274e6: 0d 94 e4 96 jmp 0x32dc8 ; 0x32dc8 { 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); 274ea: 82 ea ldi r24, 0xA2 ; 162 274ec: 93 e5 ldi r25, 0x53 ; 83 274ee: 0e 94 32 6d call 0xda64 ; 0xda64 274f2: 41 e0 ldi r20, 0x01 ; 1 274f4: 60 e0 ldi r22, 0x00 ; 0 274f6: 0f 94 33 2e call 0x25c66 ; 0x25c66 274fa: 91 e0 ldi r25, 0x01 ; 1 274fc: 81 11 cpse r24, r1 274fe: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 27500: 81 e0 ldi r24, 0x01 ; 1 27502: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 27506: d5 cf rjmp .-86 ; 0x274b2 00027508 : 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()") { 27508: cf 93 push r28 2750a: 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); 2750e: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 27510: 4c ed ldi r20, 0xDC ; 220 27512: 5b e6 ldi r21, 0x6B ; 107 27514: 60 e0 ldi r22, 0x00 ; 0 27516: 80 e0 ldi r24, 0x00 ; 0 27518: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(LCD_WIDTH - 14, 0); 2751c: 60 e0 ldi r22, 0x00 ; 0 2751e: 86 e0 ldi r24, 0x06 ; 6 27520: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print_state(pinda_state); 27524: c4 fb bst r28, 4 27526: 88 27 eor r24, r24 27528: 80 f9 bld r24, 0 2752a: 0f 94 06 03 call 0x2060c ; 0x2060c if (MMU2::mmu2.Enabled()) { 2752e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 27532: 81 30 cpi r24, 0x01 ; 1 27534: 99 f4 brne .+38 ; 0x2755c inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 27536: c1 e0 ldi r28, 0x01 ; 1 27538: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2753c: 81 11 cpse r24, r1 2753e: 01 c0 rjmp .+2 ; 0x27542 27540: 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 27542: 46 ed ldi r20, 0xD6 ; 214 27544: 5b e6 ldi r21, 0x6B ; 107 27546: 60 e0 ldi r22, 0x00 ; 0 27548: 8a e0 ldi r24, 0x0A ; 10 2754a: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(LCD_WIDTH - 3, 0); 2754e: 60 e0 ldi r22, 0x00 ; 0 27550: 81 e1 ldi r24, 0x11 ; 17 27552: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print_state(finda_state); 27556: 8c 2f mov r24, r28 27558: 0f 94 06 03 call 0x2060c ; 0x2060c } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2755c: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 27560: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 27562: 8e e9 ldi r24, 0x9E ; 158 27564: 9d e3 ldi r25, 0x3D ; 61 27566: 0e 94 32 6d call 0xda64 ; 0xda64 2756a: ac 01 movw r20, r24 2756c: 61 e0 ldi r22, 0x01 ; 1 2756e: 80 e0 ldi r24, 0x00 ; 0 27570: 0e 94 10 6a call 0xd420 ; 0xd420 lcd_set_cursor(LCD_WIDTH - 3, 1); 27574: 61 e0 ldi r22, 0x01 ; 1 27576: 81 e1 ldi r24, 0x11 ; 17 27578: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print_state(idler_state); 2757c: 8c 2f mov r24, r28 2757e: 0f 94 06 03 call 0x2060c ; 0x2060c 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(); } 27582: 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(); 27584: 0d 94 86 97 jmp 0x32f0c ; 0x32f0c 00027588 : } // 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; 27588: e2 e0 ldi r30, 0x02 ; 2 2758a: f6 e1 ldi r31, 0x16 ; 22 2758c: 40 81 ld r20, Z 2758e: 51 81 ldd r21, Z+1 ; 0x01 27590: 62 81 ldd r22, Z+2 ; 0x02 27592: 73 81 ldd r23, Z+3 ; 0x03 27594: 48 0f add r20, r24 27596: 59 1f adc r21, r25 27598: 61 1d adc r22, r1 2759a: 71 1d adc r23, r1 2759c: 40 83 st Z, r20 2759e: 51 83 std Z+1, r21 ; 0x01 275a0: 62 83 std Z+2, r22 ; 0x02 275a2: 73 83 std Z+3, r23 ; 0x03 } 275a4: 08 95 ret 000275a6 : 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){ 275a6: 2f 92 push r2 275a8: 3f 92 push r3 275aa: 4f 92 push r4 275ac: 5f 92 push r5 275ae: 6f 92 push r6 275b0: 7f 92 push r7 275b2: 8f 92 push r8 275b4: 9f 92 push r9 275b6: af 92 push r10 275b8: bf 92 push r11 275ba: cf 92 push r12 275bc: df 92 push r13 275be: ef 92 push r14 275c0: ff 92 push r15 275c2: 0f 93 push r16 275c4: 1f 93 push r17 275c6: cf 93 push r28 275c8: df 93 push r29 275ca: 00 d0 rcall .+0 ; 0x275cc 275cc: 1f 92 push r1 275ce: 1f 92 push r1 275d0: cd b7 in r28, 0x3d ; 61 275d2: de b7 in r29, 0x3e ; 62 275d4: 1c 01 movw r2, r24 275d6: 2a 01 movw r4, r20 275d8: 3b 01 movw r6, r22 275da: 00 e2 ldi r16, 0x20 ; 32 275dc: 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){ 275de: 19 82 std Y+1, r1 ; 0x01 275e0: 99 81 ldd r25, Y+1 ; 0x01 275e2: 89 2f mov r24, r25 275e4: 90 e0 ldi r25, 0x00 ; 0 275e6: 9b 83 std Y+3, r25 ; 0x03 275e8: 8a 83 std Y+2, r24 ; 0x02 275ea: 80 17 cp r24, r16 275ec: 91 07 cpc r25, r17 275ee: 9c f5 brge .+102 ; 0x27656 if (points[j] > points[j + 1]) 275f0: 88 0f add r24, r24 275f2: 99 1f adc r25, r25 275f4: 88 0f add r24, r24 275f6: 99 1f adc r25, r25 275f8: 9d 83 std Y+5, r25 ; 0x05 275fa: 8c 83 std Y+4, r24 ; 0x04 275fc: 82 0d add r24, r2 275fe: 93 1d adc r25, r3 27600: 9b 83 std Y+3, r25 ; 0x03 27602: 8a 83 std Y+2, r24 ; 0x02 27604: fc 01 movw r30, r24 27606: c0 80 ld r12, Z 27608: d1 80 ldd r13, Z+1 ; 0x01 2760a: e2 80 ldd r14, Z+2 ; 0x02 2760c: f3 80 ldd r15, Z+3 ; 0x03 2760e: 8c 81 ldd r24, Y+4 ; 0x04 27610: 9d 81 ldd r25, Y+5 ; 0x05 27612: 04 96 adiw r24, 0x04 ; 4 27614: 82 0d add r24, r2 27616: 93 1d adc r25, r3 27618: 9d 83 std Y+5, r25 ; 0x05 2761a: 8c 83 std Y+4, r24 ; 0x04 2761c: fc 01 movw r30, r24 2761e: 80 80 ld r8, Z 27620: 91 80 ldd r9, Z+1 ; 0x01 27622: a2 80 ldd r10, Z+2 ; 0x02 27624: b3 80 ldd r11, Z+3 ; 0x03 27626: a5 01 movw r20, r10 27628: 94 01 movw r18, r8 2762a: c7 01 movw r24, r14 2762c: b6 01 movw r22, r12 2762e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 27632: 18 16 cp r1, r24 27634: 64 f4 brge .+24 ; 0x2764e SWAP(points[j], points[j + 1]); 27636: ea 81 ldd r30, Y+2 ; 0x02 27638: fb 81 ldd r31, Y+3 ; 0x03 2763a: 80 82 st Z, r8 2763c: 91 82 std Z+1, r9 ; 0x01 2763e: a2 82 std Z+2, r10 ; 0x02 27640: b3 82 std Z+3, r11 ; 0x03 27642: ec 81 ldd r30, Y+4 ; 0x04 27644: fd 81 ldd r31, Y+5 ; 0x05 27646: c0 82 st Z, r12 27648: d1 82 std Z+1, r13 ; 0x01 2764a: e2 82 std Z+2, r14 ; 0x02 2764c: 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){ 2764e: f9 81 ldd r31, Y+1 ; 0x01 27650: ff 5f subi r31, 0xFF ; 255 27652: f9 83 std Y+1, r31 ; 0x01 27654: c5 cf rjmp .-118 ; 0x275e0 27656: 01 50 subi r16, 0x01 ; 1 27658: 11 09 sbc r17, r1 2765a: 08 f6 brcc .-126 ; 0x275de /// 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]; 2765c: f1 01 movw r30, r2 2765e: e0 5c subi r30, 0xC0 ; 192 27660: 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); 27662: 20 81 ld r18, Z 27664: 31 81 ldd r19, Z+1 ; 0x01 27666: 42 81 ldd r20, Z+2 ; 0x02 27668: 53 81 ldd r21, Z+3 ; 0x03 2766a: c3 01 movw r24, r6 2766c: b2 01 movw r22, r4 2766e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 27672: 6b 01 movw r12, r22 27674: 7c 01 movw r14, r24 27676: 20 e0 ldi r18, 0x00 ; 0 27678: 30 e0 ldi r19, 0x00 ; 0 2767a: 40 e0 ldi r20, 0x00 ; 0 2767c: 5f eb ldi r21, 0xBF ; 191 2767e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 27682: 87 fd sbrc r24, 7 27684: 10 c0 rjmp .+32 ; 0x276a6 27686: 20 e0 ldi r18, 0x00 ; 0 27688: 30 e0 ldi r19, 0x00 ; 0 2768a: 40 e0 ldi r20, 0x00 ; 0 2768c: 5f e3 ldi r21, 0x3F ; 63 2768e: c7 01 movw r24, r14 27690: b6 01 movw r22, r12 27692: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 27696: 18 16 cp r1, r24 27698: 5c f4 brge .+22 ; 0x276b0 2769a: c1 2c mov r12, r1 2769c: d1 2c mov r13, r1 2769e: e1 2c mov r14, r1 276a0: 8f e3 ldi r24, 0x3F ; 63 276a2: f8 2e mov r15, r24 276a4: 05 c0 rjmp .+10 ; 0x276b0 276a6: c1 2c mov r12, r1 276a8: d1 2c mov r13, r1 276aa: e1 2c mov r14, r1 276ac: 9f eb ldi r25, 0xBF ; 191 276ae: f9 2e mov r15, r25 } 276b0: c7 01 movw r24, r14 276b2: b6 01 movw r22, r12 276b4: 0f 90 pop r0 276b6: 0f 90 pop r0 276b8: 0f 90 pop r0 276ba: 0f 90 pop r0 276bc: 0f 90 pop r0 276be: df 91 pop r29 276c0: cf 91 pop r28 276c2: 1f 91 pop r17 276c4: 0f 91 pop r16 276c6: ff 90 pop r15 276c8: ef 90 pop r14 276ca: df 90 pop r13 276cc: cf 90 pop r12 276ce: bf 90 pop r11 276d0: af 90 pop r10 276d2: 9f 90 pop r9 276d4: 8f 90 pop r8 276d6: 7f 90 pop r7 276d8: 6f 90 pop r6 276da: 5f 90 pop r5 276dc: 4f 90 pop r4 276de: 3f 90 pop r3 276e0: 2f 90 pop r2 276e2: 08 95 ret 000276e4 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 276e4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 276e8: 60 93 34 12 sts 0x1234, r22 ; 0x801234 276ec: 70 93 35 12 sts 0x1235, r23 ; 0x801235 276f0: 80 93 36 12 sts 0x1236, r24 ; 0x801236 276f4: 90 93 37 12 sts 0x1237, r25 ; 0x801237 } 276f8: 08 95 ret 000276fa : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 276fa: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 276fe: 88 23 and r24, r24 27700: 69 f0 breq .+26 ; 0x2771c 27702: 80 91 79 12 lds r24, 0x1279 ; 0x801279 27706: 88 23 and r24, r24 27708: 49 f0 breq .+18 ; 0x2771c SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2770a: 8e ee ldi r24, 0xEE ; 238 2770c: 9d e9 ldi r25, 0x9D ; 157 2770e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 retryAttempts--; 27712: 80 91 79 12 lds r24, 0x1279 ; 0x801279 27716: 81 50 subi r24, 0x01 ; 1 27718: 80 93 79 12 sts 0x1279, r24 ; 0x801279 } } 2771c: 08 95 ret 0002771e : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2771e: 9f 92 push r9 27720: af 92 push r10 27722: bf 92 push r11 27724: cf 92 push r12 27726: df 92 push r13 27728: ef 92 push r14 2772a: ff 92 push r15 2772c: 0f 93 push r16 2772e: 1f 93 push r17 27730: cf 93 push r28 27732: df 93 push r29 27734: cd b7 in r28, 0x3d ; 61 27736: de b7 in r29, 0x3e ; 62 27738: e0 97 sbiw r28, 0x30 ; 48 2773a: 0f b6 in r0, 0x3f ; 63 2773c: f8 94 cli 2773e: de bf out 0x3e, r29 ; 62 27740: 0f be out 0x3f, r0 ; 63 27742: cd bf out 0x3d, r28 ; 61 27744: 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()]; 27746: e0 90 62 12 lds r14, 0x1262 ; 0x801262 2774a: fe 01 movw r30, r28 2774c: 31 96 adiw r30, 0x01 ; 1 2774e: 21 e0 ldi r18, 0x01 ; 1 27750: 30 e0 ldi r19, 0x00 ; 0 27752: 5f 01 movw r10, r30 27754: f1 2c mov r15, r1 27756: 40 e1 ldi r20, 0x10 ; 16 27758: c4 2e mov r12, r20 2775a: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2775c: 50 e2 ldi r21, 0x20 ; 32 2775e: 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()]; 27760: c7 01 movw r24, r14 27762: 82 1b sub r24, r18 27764: 93 0b sbc r25, r19 27766: b6 01 movw r22, r12 27768: 0f 94 19 a2 call 0x34432 ; 0x34432 <__divmodhi4> 2776c: dc 01 movw r26, r24 2776e: bb 27 eor r27, r27 27770: ab 5d subi r26, 0xDB ; 219 27772: bd 4e sbci r27, 0xED ; 237 27774: 9d 96 adiw r26, 0x2d ; 45 27776: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 27778: 48 2f mov r20, r24 2777a: 50 e0 ldi r21, 0x00 ; 0 2777c: 94 e0 ldi r25, 0x04 ; 4 2777e: 55 95 asr r21 27780: 47 95 ror r20 27782: 9a 95 dec r25 27784: e1 f7 brne .-8 ; 0x2777e lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 27786: 96 ef ldi r25, 0xF6 ; 246 27788: 94 0f add r25, r20 2778a: 96 30 cpi r25, 0x06 ; 6 2778c: a8 f1 brcs .+106 ; 0x277f8 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2778e: 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); 27790: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 27792: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 27794: 96 ef ldi r25, 0xF6 ; 246 27796: 98 0f add r25, r24 27798: 96 30 cpi r25, 0x06 ; 6 2779a: 80 f1 brcs .+96 ; 0x277fc case 5: case 6: case 7: case 8: case 9: return c + '0'; 2779c: 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); 2779e: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 277a0: 92 82 std Z+2, r9 ; 0x02 277a2: 2f 5f subi r18, 0xFF ; 255 277a4: 3f 4f sbci r19, 0xFF ; 255 277a6: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 277a8: 21 31 cpi r18, 0x11 ; 17 277aa: 31 05 cpc r19, r1 277ac: c9 f6 brne .-78 ; 0x27760 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 277ae: 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); 277b0: 87 e7 ldi r24, 0x77 ; 119 277b2: 9e e9 ldi r25, 0x9E ; 158 277b4: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 277b8: 81 e7 ldi r24, 0x71 ; 113 277ba: 9e e9 ldi r25, 0x9E ; 158 277bc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 277c0: c8 01 movw r24, r16 277c2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOPGM(", last bytes: "); 277c6: 89 e1 ldi r24, 0x19 ; 25 277c8: 9e e9 ldi r25, 0x9E ; 158 277ca: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(lrb); 277ce: c5 01 movw r24, r10 277d0: 0f 94 5d 9a call 0x334ba ; 0x334ba } 277d4: e0 96 adiw r28, 0x30 ; 48 277d6: 0f b6 in r0, 0x3f ; 63 277d8: f8 94 cli 277da: de bf out 0x3e, r29 ; 62 277dc: 0f be out 0x3f, r0 ; 63 277de: cd bf out 0x3d, r28 ; 61 277e0: df 91 pop r29 277e2: cf 91 pop r28 277e4: 1f 91 pop r17 277e6: 0f 91 pop r16 277e8: ff 90 pop r15 277ea: ef 90 pop r14 277ec: df 90 pop r13 277ee: cf 90 pop r12 277f0: bf 90 pop r11 277f2: af 90 pop r10 277f4: 9f 90 pop r9 277f6: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 277f8: 49 5a subi r20, 0xA9 ; 169 277fa: ca cf rjmp .-108 ; 0x27790 277fc: 89 5a subi r24, 0xA9 ; 169 277fe: cf cf rjmp .-98 ; 0x2779e 00027800 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 27800: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 27802: 90 91 39 12 lds r25, 0x1239 ; 0x801239 27806: 9a 30 cpi r25, 0x0A ; 10 27808: 11 f4 brne .+4 ; 0x2780e cause = ss; 2780a: 60 93 38 12 sts 0x1238, r22 ; 0x801238 } --occurrences; 2780e: 91 50 subi r25, 0x01 ; 1 27810: 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)) { 27814: 91 11 cpse r25, r1 27816: 0d c0 rjmp .+26 ; 0x27832 27818: c9 01 movw r24, r18 LogError(msg_P); 2781a: 0f 94 8f 3b call 0x2771e ; 0x2771e SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2781e: 8a e0 ldi r24, 0x0A ; 10 27820: 9e e9 ldi r25, 0x9E ; 158 27822: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 /// @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; } 27826: 8a e0 ldi r24, 0x0A ; 10 27828: 80 93 39 12 sts 0x1239, r24 ; 0x801239 2782c: 80 91 38 12 lds r24, 0x1238 ; 0x801238 27830: 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 27832: 80 e0 ldi r24, 0x00 ; 0 } } 27834: 08 95 ret 00027836 : } *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) { 27836: cf 93 push r28 27838: df 93 push r29 2783a: cd b7 in r28, 0x3d ; 61 2783c: de b7 in r29, 0x3e ; 62 2783e: 2e 97 sbiw r28, 0x0e ; 14 27840: 0f b6 in r0, 0x3f ; 63 27842: f8 94 cli 27844: de bf out 0x3e, r29 ; 62 27846: 0f be out 0x3f, r0 ; 63 27848: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2784a: 2e e3 ldi r18, 0x3E ; 62 2784c: 30 e0 ldi r19, 0x00 ; 0 2784e: 3a 83 std Y+2, r19 ; 0x02 27850: 29 83 std Y+1, r18 ; 0x01 27852: fe 01 movw r30, r28 27854: 33 96 adiw r30, 0x03 ; 3 27856: 2c e0 ldi r18, 0x0C ; 12 27858: df 01 movw r26, r30 2785a: 1d 92 st X+, r1 2785c: 2a 95 dec r18 2785e: e9 f7 brne .-6 ; 0x2785a 27860: de 01 movw r26, r28 27862: 12 96 adiw r26, 0x02 ; 2 27864: 48 2f mov r20, r24 27866: fc 01 movw r30, r24 27868: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2786a: 8e 2f mov r24, r30 2786c: 84 1b sub r24, r20 2786e: 86 17 cp r24, r22 27870: 40 f4 brcc .+16 ; 0x27882 uint8_t b = txbuff[i]; 27872: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 27874: 90 ee ldi r25, 0xE0 ; 224 27876: 98 0f add r25, r24 27878: 90 36 cpi r25, 0x60 ; 96 2787a: 08 f0 brcs .+2 ; 0x2787e b = '.'; 2787c: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2787e: 8d 93 st X+, r24 27880: f4 cf rjmp .-24 ; 0x2786a } tmp[size + 1] = 0; 27882: f9 01 movw r30, r18 27884: e6 0f add r30, r22 27886: f1 1d adc r31, r1 27888: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2788a: 4e e0 ldi r20, 0x0E ; 14 2788c: 50 e0 ldi r21, 0x00 ; 0 2788e: 6d e7 ldi r22, 0x7D ; 125 27890: 7e e9 ldi r23, 0x9E ; 158 27892: ce 01 movw r24, r28 27894: 01 96 adiw r24, 0x01 ; 1 27896: 0f 94 1b 9f call 0x33e36 ; 0x33e36 2789a: 89 2b or r24, r25 2789c: 59 f4 brne .+22 ; 0x278b4 2789e: 4e e0 ldi r20, 0x0E ; 14 278a0: 50 e0 ldi r21, 0x00 ; 0 278a2: be 01 movw r22, r28 278a4: 6f 5f subi r22, 0xFF ; 255 278a6: 7f 4f sbci r23, 0xFF ; 255 278a8: 85 e1 ldi r24, 0x15 ; 21 278aa: 92 e1 ldi r25, 0x12 ; 18 278ac: 0f 94 ae a7 call 0x34f5c ; 0x34f5c 278b0: 89 2b or r24, r25 278b2: 61 f0 breq .+24 ; 0x278cc // 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); 278b4: 87 e7 ldi r24, 0x77 ; 119 278b6: 9e e9 ldi r25, 0x9E ; 158 278b8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 278bc: 81 e7 ldi r24, 0x71 ; 113 278be: 9e e9 ldi r25, 0x9E ; 158 278c0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 278c4: ce 01 movw r24, r28 278c6: 01 96 adiw r24, 0x01 ; 1 278c8: 0f 94 5d 9a call 0x334ba ; 0x334ba } strncpy(lastMsg, tmp, rqs); 278cc: 4e e0 ldi r20, 0x0E ; 14 278ce: 50 e0 ldi r21, 0x00 ; 0 278d0: be 01 movw r22, r28 278d2: 6f 5f subi r22, 0xFF ; 255 278d4: 7f 4f sbci r23, 0xFF ; 255 278d6: 85 e1 ldi r24, 0x15 ; 21 278d8: 92 e1 ldi r25, 0x12 ; 18 278da: 0f 94 bc a7 call 0x34f78 ; 0x34f78 } 278de: 2e 96 adiw r28, 0x0e ; 14 278e0: 0f b6 in r0, 0x3f ; 63 278e2: f8 94 cli 278e4: de bf out 0x3e, r29 ; 62 278e6: 0f be out 0x3f, r0 ; 63 278e8: cd bf out 0x3d, r28 ; 61 278ea: df 91 pop r29 278ec: cf 91 pop r28 278ee: 08 95 ret 000278f0 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 278f0: cf 92 push r12 278f2: df 92 push r13 278f4: ef 92 push r14 278f6: ff 92 push r15 278f8: 1f 93 push r17 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: 62 97 sbiw r28, 0x12 ; 18 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 2790e: 4e 87 std Y+14, r20 ; 0x0e 27910: 5f 87 std Y+15, r21 ; 0x0f 27912: 68 8b std Y+16, r22 ; 0x10 27914: 79 8b std Y+17, r23 ; 0x11 27916: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 27918: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2791a: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2791c: 51 11 cpse r21, r1 2791e: 31 c0 rjmp .+98 ; 0x27982 *dst = '0'; 27920: 80 e3 ldi r24, 0x30 ; 48 27922: 8a 83 std Y+2, r24 ; 0x02 return 1; 27924: 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); 27926: e1 e0 ldi r30, 0x01 ; 1 27928: e1 0f add r30, r17 2792a: 81 e0 ldi r24, 0x01 ; 1 2792c: 90 e0 ldi r25, 0x00 ; 0 2792e: 8c 0f add r24, r28 27930: 9d 1f adc r25, r29 27932: 8e 0f add r24, r30 27934: 91 1d adc r25, r1 27936: fc 01 movw r30, r24 27938: 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 2793a: 9a e2 ldi r25, 0x2A ; 42 2793c: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2793e: 81 11 cpse r24, r1 27940: 27 c0 rjmp .+78 ; 0x27990 *dst = '0'; 27942: 80 e3 ldi r24, 0x30 ; 48 27944: 81 83 std Z+1, r24 ; 0x01 return 1; 27946: 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); 27948: 1e 5f subi r17, 0xFE ; 254 2794a: 18 0f add r17, r24 txbuff[i] = '\n'; 2794c: e1 e0 ldi r30, 0x01 ; 1 2794e: f0 e0 ldi r31, 0x00 ; 0 27950: ec 0f add r30, r28 27952: fd 1f adc r31, r29 27954: e1 0f add r30, r17 27956: f1 1d adc r31, r1 27958: 8a e0 ldi r24, 0x0A ; 10 2795a: 80 83 st Z, r24 ++i; 2795c: 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); 2795e: fe 01 movw r30, r28 27960: 31 96 adiw r30, 0x01 ; 1 27962: 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--){ 27964: 6f 01 movw r12, r30 27966: c1 0e add r12, r17 27968: d1 1c adc r13, r1 2796a: ec 14 cp r14, r12 2796c: fd 04 cpc r15, r13 2796e: b1 f0 breq .+44 ; 0x2799c fputc(*buffer, uart2io); 27970: f7 01 movw r30, r14 27972: 81 91 ld r24, Z+ 27974: 7f 01 movw r14, r30 27976: 67 e0 ldi r22, 0x07 ; 7 27978: 72 e1 ldi r23, 0x12 ; 18 2797a: 90 e0 ldi r25, 0x00 ; 0 2797c: 0f 94 a4 9f call 0x33f48 ; 0x33f48 27980: f4 cf rjmp .-24 ; 0x2796a 27982: be 01 movw r22, r28 27984: 6e 5f subi r22, 0xFE ; 254 27986: 7f 4f sbci r23, 0xFF ; 255 27988: 0f 94 03 88 call 0x31006 ; 0x31006 2798c: 18 2f mov r17, r24 2798e: cb cf rjmp .-106 ; 0x27926 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); 27990: bf 01 movw r22, r30 27992: 6f 5f subi r22, 0xFF ; 255 27994: 7f 4f sbci r23, 0xFF ; 255 27996: 0f 94 03 88 call 0x31006 ; 0x31006 2799a: d6 cf rjmp .-84 ; 0x27948 LogRequestMsg(txbuff, len); 2799c: 61 2f mov r22, r17 2799e: ce 01 movw r24, r28 279a0: 01 96 adiw r24, 0x01 ; 1 279a2: 0f 94 1b 3c call 0x27836 ; 0x27836 RecordUARTActivity(); 279a6: 0f 94 72 3b call 0x276e4 ; 0x276e4 } 279aa: 62 96 adiw r28, 0x12 ; 18 279ac: 0f b6 in r0, 0x3f ; 63 279ae: f8 94 cli 279b0: de bf out 0x3e, r29 ; 62 279b2: 0f be out 0x3f, r0 ; 63 279b4: cd bf out 0x3d, r28 ; 61 279b6: df 91 pop r29 279b8: cf 91 pop r28 279ba: 1f 91 pop r17 279bc: ff 90 pop r15 279be: ef 90 pop r14 279c0: df 90 pop r13 279c2: cf 90 pop r12 279c4: 08 95 ret 000279c6 : 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) { 279c6: 8f 92 push r8 279c8: 9f 92 push r9 279ca: af 92 push r10 279cc: bf 92 push r11 279ce: df 92 push r13 279d0: ef 92 push r14 279d2: ff 92 push r15 279d4: 0f 93 push r16 279d6: 1f 93 push r17 279d8: cf 93 push r28 279da: df 93 push r29 279dc: cd b7 in r28, 0x3d ; 61 279de: de b7 in r29, 0x3e ; 62 279e0: 67 97 sbiw r28, 0x17 ; 23 279e2: 0f b6 in r0, 0x3f ; 63 279e4: f8 94 cli 279e6: de bf out 0x3e, r29 ; 62 279e8: 0f be out 0x3f, r0 ; 63 279ea: cd bf out 0x3d, r28 ; 61 279ec: 18 2f mov r17, r24 279ee: 7b 01 movw r14, r22 279f0: d4 2e mov r13, r20 279f2: 07 e5 ldi r16, 0x57 ; 87 279f4: 0b 8b std Y+19, r16 ; 0x13 279f6: 8c 8b std Y+20, r24 ; 0x14 279f8: 7e 8b std Y+22, r23 ; 0x16 279fa: 6d 8b std Y+21, r22 ; 0x15 279fc: ce 01 movw r24, r28 279fe: 43 96 adiw r24, 0x13 ; 19 27a00: 0f 94 2f 88 call 0x3105e ; 0x3105e 27a04: 8f 8b std Y+23, r24 ; 0x17 27a06: 0e 87 std Y+14, r16 ; 0x0e 27a08: 1f 87 std Y+15, r17 ; 0x0f 27a0a: f9 8a std Y+17, r15 ; 0x11 27a0c: e8 8a std Y+16, r14 ; 0x10 27a0e: ce 01 movw r24, r28 27a10: 0e 96 adiw r24, 0x0e ; 14 27a12: 0f 94 2f 88 call 0x3105e ; 0x3105e 27a16: 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; 27a18: 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) { 27a1a: 11 11 cpse r17, r1 27a1c: 27 c0 rjmp .+78 ; 0x27a6c *dst = '0'; 27a1e: 80 e3 ldi r24, 0x30 ; 48 27a20: 8a 83 std Y+2, r24 ; 0x02 return 1; 27a22: 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); 27a24: e1 e0 ldi r30, 0x01 ; 1 27a26: e8 0f add r30, r24 dst[i] = ' '; 27a28: 21 e0 ldi r18, 0x01 ; 1 27a2a: 30 e0 ldi r19, 0x00 ; 0 27a2c: 2c 0f add r18, r28 27a2e: 3d 1f adc r19, r29 27a30: 2e 0f add r18, r30 27a32: 31 1d adc r19, r1 27a34: f9 01 movw r30, r18 27a36: 90 e2 ldi r25, 0x20 ; 32 27a38: 90 83 st Z, r25 return i + 1; 27a3a: 02 e0 ldi r16, 0x02 ; 2 27a3c: 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); 27a3e: aa 24 eor r10, r10 27a40: a3 94 inc r10 27a42: b1 2c mov r11, r1 27a44: ac 0e add r10, r28 27a46: bd 1e adc r11, r29 27a48: a0 0e add r10, r16 27a4a: 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) { 27a4c: e1 14 cp r14, r1 27a4e: f1 04 cpc r15, r1 27a50: 39 f1 breq .+78 ; 0x27aa0 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 27a52: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 27a54: c7 01 movw r24, r14 27a56: 88 27 eor r24, r24 27a58: 90 7f andi r25, 0xF0 ; 240 27a5a: 89 2b or r24, r25 27a5c: 71 f4 brne .+28 ; 0x27a7a value <<= 4U; 27a5e: 24 e0 ldi r18, 0x04 ; 4 27a60: ee 0c add r14, r14 27a62: ff 1c adc r15, r15 27a64: 2a 95 dec r18 27a66: e1 f7 brne .-8 ; 0x27a60 --charsOut; 27a68: 11 50 subi r17, 0x01 ; 1 27a6a: f4 cf rjmp .-24 ; 0x27a54 27a6c: be 01 movw r22, r28 27a6e: 6e 5f subi r22, 0xFE ; 254 27a70: 7f 4f sbci r23, 0xFF ; 255 27a72: 81 2f mov r24, r17 27a74: 0f 94 03 88 call 0x31006 ; 0x31006 27a78: d5 cf rjmp .-86 ; 0x27a24 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 27a7a: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 27a7c: 88 2d mov r24, r8 27a7e: 8a 19 sub r24, r10 27a80: 81 17 cp r24, r17 27a82: 90 f4 brcc .+36 ; 0x27aa8 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 27a84: 8f 2d mov r24, r15 27a86: 82 95 swap r24 27a88: 8f 70 andi r24, 0x0F ; 15 27a8a: 94 e0 ldi r25, 0x04 ; 4 27a8c: ee 0c add r14, r14 27a8e: ff 1c adc r15, r15 27a90: 9a 95 dec r25 27a92: e1 f7 brne .-8 ; 0x27a8c 27a94: 0f 94 f9 87 call 0x30ff2 ; 0x30ff2 27a98: f4 01 movw r30, r8 27a9a: 81 93 st Z+, r24 27a9c: 4f 01 movw r8, r30 27a9e: ee cf rjmp .-36 ; 0x27a7c } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 27aa0: 80 e3 ldi r24, 0x30 ; 48 27aa2: f5 01 movw r30, r10 27aa4: 80 83 st Z, r24 return 1; 27aa6: 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); 27aa8: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 27aaa: e1 e0 ldi r30, 0x01 ; 1 27aac: f0 e0 ldi r31, 0x00 ; 0 27aae: ec 0f add r30, r28 27ab0: fd 1f adc r31, r29 27ab2: e1 0f add r30, r17 27ab4: f1 1d adc r31, r1 27ab6: 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 27ab8: 9a e2 ldi r25, 0x2A ; 42 27aba: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27abc: 81 11 cpse r24, r1 27abe: 21 c0 rjmp .+66 ; 0x27b02 *dst = '0'; 27ac0: 80 e3 ldi r24, 0x30 ; 48 27ac2: 81 83 std Z+1, r24 ; 0x01 return 1; 27ac4: 81 e0 ldi r24, 0x01 ; 1 27ac6: 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); 27ac8: 18 0f add r17, r24 txbuff[i] = '\n'; 27aca: e1 e0 ldi r30, 0x01 ; 1 27acc: f0 e0 ldi r31, 0x00 ; 0 27ace: ec 0f add r30, r28 27ad0: fd 1f adc r31, r29 27ad2: e1 0f add r30, r17 27ad4: f1 1d adc r31, r1 27ad6: 8a e0 ldi r24, 0x0A ; 10 27ad8: 80 83 st Z, r24 ++i; 27ada: 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); 27adc: 9e 01 movw r18, r28 27ade: 2f 5f subi r18, 0xFF ; 255 27ae0: 3f 4f sbci r19, 0xFF ; 255 27ae2: 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--){ 27ae4: 59 01 movw r10, r18 27ae6: a1 0e add r10, r17 27ae8: b1 1c adc r11, r1 27aea: ea 14 cp r14, r10 27aec: fb 04 cpc r15, r11 27aee: 79 f0 breq .+30 ; 0x27b0e fputc(*buffer, uart2io); 27af0: f7 01 movw r30, r14 27af2: 81 91 ld r24, Z+ 27af4: 7f 01 movw r14, r30 27af6: 67 e0 ldi r22, 0x07 ; 7 27af8: 72 e1 ldi r23, 0x12 ; 18 27afa: 90 e0 ldi r25, 0x00 ; 0 27afc: 0f 94 a4 9f call 0x33f48 ; 0x33f48 27b00: f4 cf rjmp .-24 ; 0x27aea 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); 27b02: bf 01 movw r22, r30 27b04: 6f 5f subi r22, 0xFF ; 255 27b06: 7f 4f sbci r23, 0xFF ; 255 27b08: 0f 94 03 88 call 0x31006 ; 0x31006 27b0c: dc cf rjmp .-72 ; 0x27ac6 LogRequestMsg(txbuff, len); 27b0e: 61 2f mov r22, r17 27b10: ce 01 movw r24, r28 27b12: 01 96 adiw r24, 0x01 ; 1 27b14: 0f 94 1b 3c call 0x27836 ; 0x27836 RecordUARTActivity(); 27b18: 0f 94 72 3b call 0x276e4 ; 0x276e4 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 27b1c: d0 92 28 12 sts 0x1228, r13 ; 0x801228 } 27b20: 67 96 adiw r28, 0x17 ; 23 27b22: 0f b6 in r0, 0x3f ; 63 27b24: f8 94 cli 27b26: de bf out 0x3e, r29 ; 62 27b28: 0f be out 0x3f, r0 ; 63 27b2a: cd bf out 0x3d, r28 ; 61 27b2c: df 91 pop r29 27b2e: cf 91 pop r28 27b30: 1f 91 pop r17 27b32: 0f 91 pop r16 27b34: ff 90 pop r15 27b36: ef 90 pop r14 27b38: df 90 pop r13 27b3a: bf 90 pop r11 27b3c: af 90 pop r10 27b3e: 9f 90 pop r9 27b40: 8f 90 pop r8 27b42: 08 95 ret 00027b44 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 27b44: 20 91 73 12 lds r18, 0x1273 ; 0x801273 27b48: 2f 5f subi r18, 0xFF ; 255 27b4a: 20 93 73 12 sts 0x1273, r18 ; 0x801273 if (regIndex >= initRegs8Count) { 27b4e: 22 30 cpi r18, 0x02 ; 2 27b50: 78 f4 brcc .+30 ; 0x27b70 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 27b52: 30 e0 ldi r19, 0x00 ; 0 27b54: f9 01 movw r30, r18 27b56: e8 5f subi r30, 0xF8 ; 248 27b58: f1 46 sbci r31, 0x61 ; 97 27b5a: 84 91 lpm r24, Z 27b5c: 2f 58 subi r18, 0x8F ; 143 27b5e: 3d 4e sbci r19, 0xED ; 237 27b60: f9 01 movw r30, r18 27b62: 60 81 ld r22, Z 27b64: 70 e0 ldi r23, 0x00 ; 0 27b66: 49 e0 ldi r20, 0x09 ; 9 27b68: 0f 94 e3 3c call 0x279c6 ; 0x279c6 } return false; 27b6c: 80 e0 ldi r24, 0x00 ; 0 27b6e: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 27b70: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 27b72: 08 95 ret 00027b74 : * \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) { 27b74: 8f 92 push r8 27b76: 9f 92 push r9 27b78: af 92 push r10 27b7a: bf 92 push r11 27b7c: cf 92 push r12 27b7e: df 92 push r13 27b80: ef 92 push r14 27b82: ff 92 push r15 27b84: cf 93 push r28 27b86: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 27b88: 27 ed ldi r18, 0xD7 ; 215 27b8a: 35 e1 ldi r19, 0x15 ; 21 27b8c: 30 93 d7 0d sts 0x0DD7, r19 ; 0x800dd7 27b90: 20 93 d6 0d sts 0x0DD6, r18 ; 0x800dd6 fatType_ = 0; 27b94: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 allocSearchStart_ = 2; 27b98: 42 e0 ldi r20, 0x02 ; 2 27b9a: 50 e0 ldi r21, 0x00 ; 0 27b9c: 60 e0 ldi r22, 0x00 ; 0 27b9e: 70 e0 ldi r23, 0x00 ; 0 27ba0: 40 93 dc 15 sts 0x15DC, r20 ; 0x8015dc 27ba4: 50 93 dd 15 sts 0x15DD, r21 ; 0x8015dd 27ba8: 60 93 de 15 sts 0x15DE, r22 ; 0x8015de 27bac: 70 93 df 15 sts 0x15DF, r23 ; 0x8015df cacheDirty_ = 0; // cacheFlush() will write block if true 27bb0: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheMirrorBlock_ = 0; 27bb4: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 27bb8: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 27bbc: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 27bc0: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 cacheBlockNumber_ = 0XFFFFFFFF; 27bc4: 4f ef ldi r20, 0xFF ; 255 27bc6: 5f ef ldi r21, 0xFF ; 255 27bc8: ba 01 movw r22, r20 27bca: 40 93 cd 0d sts 0x0DCD, r20 ; 0x800dcd 27bce: 50 93 ce 0d sts 0x0DCE, r21 ; 0x800dce 27bd2: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 27bd6: 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) { 27bda: 88 23 and r24, r24 27bdc: 09 f4 brne .+2 ; 0x27be0 27bde: 70 c0 rjmp .+224 ; 0x27cc0 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27be0: 40 e0 ldi r20, 0x00 ; 0 27be2: 60 e0 ldi r22, 0x00 ; 0 27be4: 70 e0 ldi r23, 0x00 ; 0 27be6: cb 01 movw r24, r22 27be8: 0f 94 c1 36 call 0x26d82 ; 0x26d82 27bec: 81 11 cpse r24, r1 27bee: 0d c0 rjmp .+26 ; 0x27c0a fatType_ = 32; } return true; fail: return false; 27bf0: c0 e0 ldi r28, 0x00 ; 0 } 27bf2: 8c 2f mov r24, r28 27bf4: df 91 pop r29 27bf6: cf 91 pop r28 27bf8: ff 90 pop r15 27bfa: ef 90 pop r14 27bfc: df 90 pop r13 27bfe: cf 90 pop r12 27c00: bf 90 pop r11 27c02: af 90 pop r10 27c04: 9f 90 pop r9 27c06: 8f 90 pop r8 27c08: 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 || 27c0a: 80 91 97 0f lds r24, 0x0F97 ; 0x800f97 27c0e: 8f 77 andi r24, 0x7F ; 127 27c10: 79 f7 brne .-34 ; 0x27bf0 27c12: 80 91 a3 0f lds r24, 0x0FA3 ; 0x800fa3 27c16: 90 91 a4 0f lds r25, 0x0FA4 ; 0x800fa4 27c1a: a0 91 a5 0f lds r26, 0x0FA5 ; 0x800fa5 27c1e: b0 91 a6 0f lds r27, 0x0FA6 ; 0x800fa6 27c22: 84 36 cpi r24, 0x64 ; 100 27c24: 91 05 cpc r25, r1 27c26: a1 05 cpc r26, r1 27c28: b1 05 cpc r27, r1 27c2a: 10 f3 brcs .-60 ; 0x27bf0 p->totalSectors < 100 || p->firstSector == 0) { 27c2c: c0 90 9f 0f lds r12, 0x0F9F ; 0x800f9f 27c30: d0 90 a0 0f lds r13, 0x0FA0 ; 0x800fa0 27c34: e0 90 a1 0f lds r14, 0x0FA1 ; 0x800fa1 27c38: 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 || 27c3c: c1 14 cp r12, r1 27c3e: d1 04 cpc r13, r1 27c40: e1 04 cpc r14, r1 27c42: f1 04 cpc r15, r1 27c44: a9 f2 breq .-86 ; 0x27bf0 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27c46: 40 e0 ldi r20, 0x00 ; 0 27c48: c7 01 movw r24, r14 27c4a: b6 01 movw r22, r12 27c4c: 0f 94 c1 36 call 0x26d82 ; 0x26d82 27c50: c8 2f mov r28, r24 27c52: 88 23 and r24, r24 27c54: 69 f2 breq .-102 ; 0x27bf0 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 27c56: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 27c5a: 90 91 e5 0d lds r25, 0x0DE5 ; 0x800de5 27c5e: 81 15 cp r24, r1 27c60: 92 40 sbci r25, 0x02 ; 2 27c62: 31 f6 brne .-116 ; 0x27bf0 fbs->fatCount == 0 || 27c64: 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 || 27c68: aa 23 and r26, r26 27c6a: 11 f2 breq .-124 ; 0x27bf0 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 27c6c: 60 91 e7 0d lds r22, 0x0DE7 ; 0x800de7 27c70: 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 || 27c74: 61 15 cp r22, r1 27c76: 71 05 cpc r23, r1 27c78: 09 f4 brne .+2 ; 0x27c7c 27c7a: ba cf rjmp .-140 ; 0x27bf0 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 27c7c: 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 || 27c80: 22 23 and r18, r18 27c82: 09 f4 brne .+2 ; 0x27c86 27c84: b5 cf rjmp .-150 ; 0x27bf0 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 27c86: a0 93 ee 15 sts 0x15EE, r26 ; 0x8015ee blocksPerCluster_ = fbs->sectorsPerCluster; 27c8a: 20 93 e0 15 sts 0x15E0, r18 ; 0x8015e0 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 27c8e: 90 e0 ldi r25, 0x00 ; 0 27c90: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 27c92: 30 e0 ldi r19, 0x00 ; 0 27c94: e1 e0 ldi r30, 0x01 ; 1 27c96: f0 e0 ldi r31, 0x00 ; 0 27c98: d8 2f mov r29, r24 27c9a: af 01 movw r20, r30 27c9c: 08 2e mov r0, r24 27c9e: 02 c0 rjmp .+4 ; 0x27ca4 27ca0: 44 0f add r20, r20 27ca2: 55 1f adc r21, r21 27ca4: 0a 94 dec r0 27ca6: e2 f7 brpl .-8 ; 0x27ca0 27ca8: 24 17 cp r18, r20 27caa: 35 07 cpc r19, r21 27cac: 69 f0 breq .+26 ; 0x27cc8 27cae: 41 e0 ldi r20, 0x01 ; 1 27cb0: 48 0f add r20, r24 27cb2: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 27cb4: 89 30 cpi r24, 0x09 ; 9 27cb6: 91 05 cpc r25, r1 27cb8: 79 f7 brne .-34 ; 0x27c98 27cba: 40 93 e9 15 sts 0x15E9, r20 ; 0x8015e9 27cbe: 98 cf rjmp .-208 ; 0x27bf0 * 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; 27cc0: c1 2c mov r12, r1 27cc2: d1 2c mov r13, r1 27cc4: 76 01 movw r14, r12 27cc6: bf cf rjmp .-130 ; 0x27c46 27cc8: 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 ? 27ccc: 20 91 ef 0d lds r18, 0x0DEF ; 0x800def 27cd0: 30 91 f0 0d lds r19, 0x0DF0 ; 0x800df0 27cd4: 50 e0 ldi r21, 0x00 ; 0 27cd6: 40 e0 ldi r20, 0x00 ; 0 27cd8: 21 15 cp r18, r1 27cda: 31 05 cpc r19, r1 27cdc: 41 f4 brne .+16 ; 0x27cee 27cde: 20 91 fd 0d lds r18, 0x0DFD ; 0x800dfd 27ce2: 30 91 fe 0d lds r19, 0x0DFE ; 0x800dfe 27ce6: 40 91 ff 0d lds r20, 0x0DFF ; 0x800dff 27cea: 50 91 00 0e lds r21, 0x0E00 ; 0x800e00 27cee: 20 93 e1 15 sts 0x15E1, r18 ; 0x8015e1 27cf2: 30 93 e2 15 sts 0x15E2, r19 ; 0x8015e2 27cf6: 40 93 e3 15 sts 0x15E3, r20 ; 0x8015e3 27cfa: 50 93 e4 15 sts 0x15E4, r21 ; 0x8015e4 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 27cfe: 46 01 movw r8, r12 27d00: 57 01 movw r10, r14 27d02: 86 0e add r8, r22 27d04: 97 1e adc r9, r23 27d06: a1 1c adc r10, r1 27d08: b1 1c adc r11, r1 27d0a: 80 92 ef 15 sts 0x15EF, r8 ; 0x8015ef 27d0e: 90 92 f0 15 sts 0x15F0, r9 ; 0x8015f0 27d12: a0 92 f1 15 sts 0x15F1, r10 ; 0x8015f1 27d16: b0 92 f2 15 sts 0x15F2, r11 ; 0x8015f2 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 27d1a: e0 91 ea 0d lds r30, 0x0DEA ; 0x800dea 27d1e: f0 91 eb 0d lds r31, 0x0DEB ; 0x800deb 27d22: f0 93 f5 15 sts 0x15F5, r31 ; 0x8015f5 27d26: e0 93 f4 15 sts 0x15F4, r30 ; 0x8015f4 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 27d2a: b0 e0 ldi r27, 0x00 ; 0 27d2c: 0f 94 d1 a1 call 0x343a2 ; 0x343a2 <__muluhisi3> 27d30: dc 01 movw r26, r24 27d32: cb 01 movw r24, r22 27d34: 88 0d add r24, r8 27d36: 99 1d adc r25, r9 27d38: aa 1d adc r26, r10 27d3a: bb 1d adc r27, r11 27d3c: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27d40: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27d44: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27d48: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 27d4c: 25 e0 ldi r18, 0x05 ; 5 27d4e: ee 0f add r30, r30 27d50: ff 1f adc r31, r31 27d52: 2a 95 dec r18 27d54: e1 f7 brne .-8 ; 0x27d4e 27d56: e1 50 subi r30, 0x01 ; 1 27d58: fe 4f sbci r31, 0xFE ; 254 27d5a: ef 2f mov r30, r31 27d5c: ff 27 eor r31, r31 27d5e: e6 95 lsr r30 27d60: 8e 0f add r24, r30 27d62: 9f 1f adc r25, r31 27d64: a1 1d adc r26, r1 27d66: b1 1d adc r27, r1 27d68: 80 93 ea 15 sts 0x15EA, r24 ; 0x8015ea 27d6c: 90 93 eb 15 sts 0x15EB, r25 ; 0x8015eb 27d70: a0 93 ec 15 sts 0x15EC, r26 ; 0x8015ec 27d74: b0 93 ed 15 sts 0x15ED, r27 ; 0x8015ed // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 27d78: 80 90 ec 0d lds r8, 0x0DEC ; 0x800dec 27d7c: 90 90 ed 0d lds r9, 0x0DED ; 0x800ded 27d80: b1 2c mov r11, r1 27d82: a1 2c mov r10, r1 27d84: 81 14 cp r8, r1 27d86: 91 04 cpc r9, r1 27d88: 41 f4 brne .+16 ; 0x27d9a 27d8a: 80 90 f9 0d lds r8, 0x0DF9 ; 0x800df9 27d8e: 90 90 fa 0d lds r9, 0x0DFA ; 0x800dfa 27d92: a0 90 fb 0d lds r10, 0x0DFB ; 0x800dfb 27d96: b0 90 fc 0d lds r11, 0x0DFC ; 0x800dfc fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 27d9a: c8 1a sub r12, r24 27d9c: d9 0a sbc r13, r25 27d9e: ea 0a sbc r14, r26 27da0: fb 0a sbc r15, r27 27da2: c8 0c add r12, r8 27da4: d9 1c adc r13, r9 27da6: ea 1c adc r14, r10 27da8: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 27daa: 04 c0 rjmp .+8 ; 0x27db4 27dac: f6 94 lsr r15 27dae: e7 94 ror r14 27db0: d7 94 ror r13 27db2: c7 94 ror r12 27db4: da 95 dec r29 27db6: d2 f7 brpl .-12 ; 0x27dac 27db8: c0 92 e5 15 sts 0x15E5, r12 ; 0x8015e5 27dbc: d0 92 e6 15 sts 0x15E6, r13 ; 0x8015e6 27dc0: e0 92 e7 15 sts 0x15E7, r14 ; 0x8015e7 27dc4: f0 92 e8 15 sts 0x15E8, r15 ; 0x8015e8 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 27dc8: 85 ef ldi r24, 0xF5 ; 245 27dca: c8 16 cp r12, r24 27dcc: 8f e0 ldi r24, 0x0F ; 15 27dce: d8 06 cpc r13, r24 27dd0: e1 04 cpc r14, r1 27dd2: f1 04 cpc r15, r1 27dd4: 20 f4 brcc .+8 ; 0x27dde fatType_ = 12; 27dd6: 8c e0 ldi r24, 0x0C ; 12 27dd8: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27ddc: 09 cf rjmp .-494 ; 0x27bf0 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 27dde: 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) { 27de0: 25 ef ldi r18, 0xF5 ; 245 27de2: c2 16 cp r12, r18 27de4: 2f ef ldi r18, 0xFF ; 255 27de6: d2 06 cpc r13, r18 27de8: e1 04 cpc r14, r1 27dea: f1 04 cpc r15, r1 27dec: 88 f0 brcs .+34 ; 0x27e10 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 27dee: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 27df2: 90 91 06 0e lds r25, 0x0E06 ; 0x800e06 27df6: a0 91 07 0e lds r26, 0x0E07 ; 0x800e07 27dfa: b0 91 08 0e lds r27, 0x0E08 ; 0x800e08 27dfe: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27e02: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27e06: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27e0a: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 fatType_ = 32; 27e0e: 80 e2 ldi r24, 0x20 ; 32 27e10: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27e14: ee ce rjmp .-548 ; 0x27bf2 00027e16 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 27e16: 0f 93 push r16 27e18: 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_ ){ 27e1a: 60 91 17 16 lds r22, 0x1617 ; 0x801617 27e1e: 70 91 18 16 lds r23, 0x1618 ; 0x801618 27e22: 80 91 19 16 lds r24, 0x1619 ; 0x801619 27e26: 90 91 1a 16 lds r25, 0x161A ; 0x80161a 27e2a: 00 91 cd 0d lds r16, 0x0DCD ; 0x800dcd 27e2e: 10 91 ce 0d lds r17, 0x0DCE ; 0x800dce 27e32: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 27e36: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 27e3a: 60 17 cp r22, r16 27e3c: 71 07 cpc r23, r17 27e3e: 82 07 cpc r24, r18 27e40: 93 07 cpc r25, r19 27e42: 39 f1 breq .+78 ; 0x27e92 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 27e44: 40 e0 ldi r20, 0x00 ; 0 27e46: 0f 94 c1 36 call 0x26d82 ; 0x26d82 27e4a: 88 23 and r24, r24 27e4c: f9 f0 breq .+62 ; 0x27e8c return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 27e4e: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 27e52: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 27e56: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 27e5a: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 27e5e: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 27e62: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 27e66: 42 1b sub r20, r18 27e68: 53 0b sbc r21, r19 27e6a: 61 09 sbc r22, r1 27e6c: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 27e6e: 41 30 cpi r20, 0x01 ; 1 27e70: 92 e0 ldi r25, 0x02 ; 2 27e72: 59 07 cpc r21, r25 27e74: 61 05 cpc r22, r1 27e76: 71 05 cpc r23, r1 27e78: 20 f0 brcs .+8 ; 0x27e82 27e7a: 40 e0 ldi r20, 0x00 ; 0 27e7c: 52 e0 ldi r21, 0x02 ; 2 27e7e: 60 e0 ldi r22, 0x00 ; 0 27e80: 70 e0 ldi r23, 0x00 ; 0 27e82: 47 52 subi r20, 0x27 ; 39 27e84: 52 4f sbci r21, 0xF2 ; 242 27e86: 9a e0 ldi r25, 0x0A ; 10 27e88: fa 01 movw r30, r20 27e8a: 90 83 st Z, r25 } return true; } 27e8c: 1f 91 pop r17 27e8e: 0f 91 pop r16 27e90: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 27e92: 81 e0 ldi r24, 0x01 ; 1 27e94: fb cf rjmp .-10 ; 0x27e8c 00027e96 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 27e96: 20 e0 ldi r18, 0x00 ; 0 27e98: 30 e0 ldi r19, 0x00 ; 0 27e9a: 40 ea ldi r20, 0xA0 ; 160 27e9c: 52 e4 ldi r21, 0x42 ; 66 27e9e: 60 e0 ldi r22, 0x00 ; 0 27ea0: 70 e0 ldi r23, 0x00 ; 0 27ea2: 80 ea ldi r24, 0xA0 ; 160 27ea4: 92 ec ldi r25, 0xC2 ; 194 27ea6: 0d 94 62 88 jmp 0x310c4 ; 0x310c4 00027eaa : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 27eaa: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27eae: 91 fd sbrc r25, 1 27eb0: 17 c0 rjmp .+46 ; 0x27ee0 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 27eb2: 88 23 and r24, r24 27eb4: a9 f0 breq .+42 ; 0x27ee0 27eb6: 92 fd sbrc r25, 2 27eb8: 13 c0 rjmp .+38 ; 0x27ee0 Disable_E0(); 27eba: 0f 94 60 88 call 0x310c0 ; 0x310c0 resume_hotend_temp = thermal_degTargetHotend(); 27ebe: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 27ec2: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 27ec6: 90 93 8a 12 sts 0x128A, r25 ; 0x80128a 27eca: 80 93 89 12 sts 0x1289, r24 ; 0x801289 mmu_print_saved |= SavedState::CooldownPending; 27ece: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27ed2: 84 60 ori r24, 0x04 ; 4 27ed4: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Heater cooldown pending")); 27ed8: 85 ed ldi r24, 0xD5 ; 213 27eda: 9a e9 ldi r25, 0x9A ; 154 27edc: 0d 94 86 88 jmp 0x3110c ; 0x3110c } } 27ee0: 08 95 ret 00027ee2 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 27ee2: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27ee6: 80 ff sbrs r24, 0 27ee8: 45 c0 rjmp .+138 ; 0x27f74 LogEchoEvent_P(PSTR("Resuming XYZ")); 27eea: 8d ee ldi r24, 0xED ; 237 27eec: 9a e9 ldi r25, 0x9A ; 154 27eee: 0f 94 86 88 call 0x3110c ; 0x3110c // 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)); 27ef2: 80 91 81 12 lds r24, 0x1281 ; 0x801281 27ef6: 90 91 82 12 lds r25, 0x1282 ; 0x801282 27efa: a0 91 83 12 lds r26, 0x1283 ; 0x801283 27efe: 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; 27f02: 40 91 7d 12 lds r20, 0x127D ; 0x80127d 27f06: 50 91 7e 12 lds r21, 0x127E ; 0x80127e 27f0a: 60 91 7f 12 lds r22, 0x127F ; 0x80127f 27f0e: 70 91 80 12 lds r23, 0x1280 ; 0x801280 27f12: 40 93 f5 11 sts 0x11F5, r20 ; 0x8011f5 27f16: 50 93 f6 11 sts 0x11F6, r21 ; 0x8011f6 27f1a: 60 93 f7 11 sts 0x11F7, r22 ; 0x8011f7 27f1e: 70 93 f8 11 sts 0x11F8, r23 ; 0x8011f8 current_position[Y_AXIS] = ry; 27f22: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 27f26: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 27f2a: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 27f2e: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc planner_line_to_current_position_sync(feedRate_mm_s); 27f32: 60 e0 ldi r22, 0x00 ; 0 27f34: 70 e0 ldi r23, 0x00 ; 0 27f36: 88 e4 ldi r24, 0x48 ; 72 27f38: 92 e4 ldi r25, 0x42 ; 66 27f3a: 0f 94 82 88 call 0x31104 ; 0x31104 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 27f3e: 80 91 85 12 lds r24, 0x1285 ; 0x801285 27f42: 90 91 86 12 lds r25, 0x1286 ; 0x801286 27f46: a0 91 87 12 lds r26, 0x1287 ; 0x801287 27f4a: b0 91 88 12 lds r27, 0x1288 ; 0x801288 27f4e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 27f52: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 27f56: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 27f5a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 planner_line_to_current_position_sync(feedRate_mm_s); 27f5e: 60 e0 ldi r22, 0x00 ; 0 27f60: 70 e0 ldi r23, 0x00 ; 0 27f62: 80 e7 ldi r24, 0x70 ; 112 27f64: 91 e4 ldi r25, 0x41 ; 65 27f66: 0f 94 82 88 call 0x31104 ; 0x31104 // 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); 27f6a: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27f6e: 8e 7f andi r24, 0xFE ; 254 27f70: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } } 27f74: 08 95 ret 00027f76 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 27f76: 0f 93 push r16 27f78: 1f 93 push r17 27f7a: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 27f7c: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27f80: 91 11 cpse r25, r1 27f82: 72 c0 rjmp .+228 ; 0x28068 27f84: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 27f86: 82 ec ldi r24, 0xC2 ; 194 27f88: 9a e9 ldi r25, 0x9A ; 154 27f8a: 0f 94 86 88 call 0x3110c ; 0x3110c Disable_E0(); 27f8e: 0f 94 60 88 call 0x310c0 ; 0x310c0 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 27f92: 0f 94 a0 22 call 0x24540 ; 0x24540 /// 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; 27f96: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 27f9a: 81 11 cpse r24, r1 27f9c: 02 c0 rjmp .+4 ; 0x27fa2 27f9e: 0e 94 af 5e call 0xbd5e ; 0xbd5e // 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) { 27fa2: cc 23 and r28, r28 27fa4: 09 f4 brne .+2 ; 0x27fa8 27fa6: 60 c0 rjmp .+192 ; 0x28068 mmu_print_saved |= SavedState::ParkExtruder; 27fa8: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27fac: 81 60 ori r24, 0x01 ; 1 27fae: 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]); 27fb2: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 27fb6: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 27fba: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 27fbe: b0 91 00 12 lds r27, 0x1200 ; 0x801200 27fc2: 40 91 f9 11 lds r20, 0x11F9 ; 0x8011f9 27fc6: 50 91 fa 11 lds r21, 0x11FA ; 0x8011fa 27fca: 60 91 fb 11 lds r22, 0x11FB ; 0x8011fb 27fce: 70 91 fc 11 lds r23, 0x11FC ; 0x8011fc resume_position = planner_current_position(); // save current pos 27fd2: 00 91 f5 11 lds r16, 0x11F5 ; 0x8011f5 27fd6: 10 91 f6 11 lds r17, 0x11F6 ; 0x8011f6 27fda: 20 91 f7 11 lds r18, 0x11F7 ; 0x8011f7 27fde: 30 91 f8 11 lds r19, 0x11F8 ; 0x8011f8 27fe2: 00 93 7d 12 sts 0x127D, r16 ; 0x80127d 27fe6: 10 93 7e 12 sts 0x127E, r17 ; 0x80127e 27fea: 20 93 7f 12 sts 0x127F, r18 ; 0x80127f 27fee: 30 93 80 12 sts 0x1280, r19 ; 0x801280 27ff2: 40 93 81 12 sts 0x1281, r20 ; 0x801281 27ff6: 50 93 82 12 sts 0x1282, r21 ; 0x801282 27ffa: 60 93 83 12 sts 0x1283, r22 ; 0x801283 27ffe: 70 93 84 12 sts 0x1284, r23 ; 0x801284 28002: 80 93 85 12 sts 0x1285, r24 ; 0x801285 28006: 90 93 86 12 sts 0x1286, r25 ; 0x801286 2800a: a0 93 87 12 sts 0x1287, r26 ; 0x801287 2800e: 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); 28012: 60 e0 ldi r22, 0x00 ; 0 28014: 70 e0 ldi r23, 0x00 ; 0 28016: 80 ea ldi r24, 0xA0 ; 160 28018: 91 e4 ldi r25, 0x41 ; 65 2801a: 0e 94 5e 67 call 0xcebc ; 0xcebc void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2801e: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 28022: 88 23 and r24, r24 28024: 09 f1 breq .+66 ; 0x28068 28026: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 2802a: 88 23 and r24, r24 2802c: e9 f0 breq .+58 ; 0x28068 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; 2802e: 80 e0 ldi r24, 0x00 ; 0 28030: 90 e0 ldi r25, 0x00 ; 0 28032: aa ef ldi r26, 0xFA ; 250 28034: b2 e4 ldi r27, 0x42 ; 66 28036: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 2803a: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 2803e: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 28042: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 28046: 10 92 f9 11 sts 0x11F9, r1 ; 0x8011f9 2804a: 10 92 fa 11 sts 0x11FA, r1 ; 0x8011fa 2804e: 10 92 fb 11 sts 0x11FB, r1 ; 0x8011fb 28052: 10 92 fc 11 sts 0x11FC, r1 ; 0x8011fc planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 28056: 60 e0 ldi r22, 0x00 ; 0 28058: 70 e0 ldi r23, 0x00 ; 0 2805a: 88 e4 ldi r24, 0x48 ; 72 2805c: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2805e: cf 91 pop r28 28060: 1f 91 pop r17 28062: 0f 91 pop r16 28064: 0d 94 82 88 jmp 0x31104 ; 0x31104 28068: cf 91 pop r28 2806a: 1f 91 pop r17 2806c: 0f 91 pop r16 2806e: 08 95 ret 00028070 : 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){ 28070: ef 92 push r14 28072: ff 92 push r15 28074: 0f 93 push r16 28076: 1f 93 push r17 28078: cf 93 push r28 2807a: df 93 push r29 2807c: 1f 92 push r1 2807e: 1f 92 push r1 28080: cd b7 in r28, 0x3d ; 61 28082: de b7 in r29, 0x3e ; 62 28084: f8 2e mov r15, r24 28086: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 28088: 80 e1 ldi r24, 0x10 ; 16 2808a: 97 e2 ldi r25, 0x27 ; 39 2808c: 9a 83 std Y+2, r25 ; 0x02 2808e: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 28090: 8a 01 movw r16, r20 28092: 16 95 lsr r17 28094: 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); 28096: 8f 2d mov r24, r15 28098: 0e 94 71 c2 call 0x184e2 ; 0x184e2 while (steps--){ 2809c: 01 50 subi r16, 0x01 ; 1 2809e: 11 09 sbc r17, r1 280a0: 78 f0 brcs .+30 ; 0x280c0 accelerate_1_step(axes, acc, delay_us, min_delay_us); 280a2: 28 ec ldi r18, 0xC8 ; 200 280a4: 30 e0 ldi r19, 0x00 ; 0 280a6: ae 01 movw r20, r28 280a8: 4f 5f subi r20, 0xFF ; 255 280aa: 5f 4f sbci r21, 0xFF ; 255 280ac: 68 ee ldi r22, 0xE8 ; 232 280ae: 73 e0 ldi r23, 0x03 ; 3 280b0: 8f 2d mov r24, r15 280b2: 0e 94 40 c1 call 0x18280 ; 0x18280 update_position_1_step(axes, dir); 280b6: 6e 2d mov r22, r14 280b8: 8f 2d mov r24, r15 280ba: 0e 94 8a c2 call 0x18514 ; 0x18514 280be: ee cf rjmp .-36 ; 0x2809c } /// \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); 280c0: 6e 2d mov r22, r14 280c2: 8f 2d mov r24, r15 280c4: 0e 94 71 c2 call 0x184e2 ; 0x184e2 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); } 280c8: 0f 90 pop r0 280ca: 0f 90 pop r0 280cc: df 91 pop r29 280ce: cf 91 pop r28 280d0: 1f 91 pop r17 280d2: 0f 91 pop r16 280d4: ff 90 pop r15 280d6: ef 90 pop r14 280d8: 08 95 ret 000280da : 280da: ef 92 push r14 280dc: ff 92 push r15 280de: 0f 93 push r16 280e0: 1f 93 push r17 280e2: cf 93 push r28 280e4: df 93 push r29 280e6: cd b7 in r28, 0x3d ; 61 280e8: de b7 in r29, 0x3e ; 62 280ea: 2f 97 sbiw r28, 0x0f ; 15 280ec: 0f b6 in r0, 0x3f ; 63 280ee: f8 94 cli 280f0: de bf out 0x3e, r29 ; 62 280f2: 0f be out 0x3f, r0 ; 63 280f4: cd bf out 0x3d, r28 ; 61 280f6: 10 92 23 12 sts 0x1223, r1 ; 0x801223 280fa: 05 e2 ldi r16, 0x25 ; 37 280fc: 12 e1 ldi r17, 0x12 ; 18 280fe: ee 24 eor r14, r14 28100: e3 94 inc r14 28102: f1 2c mov r15, r1 28104: d8 01 movw r26, r16 28106: 11 96 adiw r26, 0x01 ; 1 28108: fc 92 st X, r15 2810a: ee 92 st -X, r14 2810c: 12 96 adiw r26, 0x02 ; 2 2810e: 1c 92 st X, r1 28110: 12 97 sbiw r26, 0x02 ; 2 28112: 82 e8 ldi r24, 0x82 ; 130 28114: 13 96 adiw r26, 0x03 ; 3 28116: 8c 93 st X, r24 28118: 40 e0 ldi r20, 0x00 ; 0 2811a: 60 e0 ldi r22, 0x00 ; 0 2811c: 8a e2 ldi r24, 0x2A ; 42 2811e: 92 e1 ldi r25, 0x12 ; 18 28120: 0f 94 53 88 call 0x310a6 ; 0x310a6 28124: 40 e0 ldi r20, 0x00 ; 0 28126: 60 e0 ldi r22, 0x00 ; 0 28128: 8f e2 ldi r24, 0x2F ; 47 2812a: 92 e1 ldi r25, 0x12 ; 18 2812c: 0f 94 53 88 call 0x310a6 ; 0x310a6 28130: f8 01 movw r30, r16 28132: 17 86 std Z+15, r1 ; 0x0f 28134: 10 8a std Z+16, r1 ; 0x10 28136: 11 8a std Z+17, r1 ; 0x11 28138: 12 8a std Z+18, r1 ; 0x12 2813a: 13 8a std Z+19, r1 ; 0x13 2813c: 8a e0 ldi r24, 0x0A ; 10 2813e: 84 8b std Z+20, r24 ; 0x14 28140: 40 e0 ldi r20, 0x00 ; 0 28142: 60 e0 ldi r22, 0x00 ; 0 28144: ce 01 movw r24, r28 28146: 01 96 adiw r24, 0x01 ; 1 28148: 0f 94 53 88 call 0x310a6 ; 0x310a6 2814c: 85 e0 ldi r24, 0x05 ; 5 2814e: fe 01 movw r30, r28 28150: 31 96 adiw r30, 0x01 ; 1 28152: de 01 movw r26, r28 28154: 16 96 adiw r26, 0x06 ; 6 28156: 01 90 ld r0, Z+ 28158: 0d 92 st X+, r0 2815a: 8a 95 dec r24 2815c: e1 f7 brne .-8 ; 0x28156 2815e: 85 e0 ldi r24, 0x05 ; 5 28160: fe 01 movw r30, r28 28162: 36 96 adiw r30, 0x06 ; 6 28164: aa e3 ldi r26, 0x3A ; 58 28166: b2 e1 ldi r27, 0x12 ; 18 28168: 01 90 ld r0, Z+ 2816a: 0d 92 st X+, r0 2816c: 8a 95 dec r24 2816e: e1 f7 brne .-8 ; 0x28168 28170: d8 01 movw r26, r16 28172: 5a 96 adiw r26, 0x1a ; 26 28174: 1c 92 st X, r1 28176: 5a 97 sbiw r26, 0x1a ; 26 28178: 5c 96 adiw r26, 0x1c ; 28 2817a: 1c 92 st X, r1 2817c: 1e 92 st -X, r1 2817e: 5b 97 sbiw r26, 0x1b ; 27 28180: 8a e3 ldi r24, 0x3A ; 58 28182: 92 e1 ldi r25, 0x12 ; 18 28184: 0f 94 42 88 call 0x31084 ; 0x31084 28188: f8 01 movw r30, r16 2818a: 81 8f std Z+25, r24 ; 0x19 2818c: 15 8e std Z+29, r1 ; 0x1d 2818e: 16 8e std Z+30, r1 ; 0x1e 28190: 40 e0 ldi r20, 0x00 ; 0 28192: 60 e0 ldi r22, 0x00 ; 0 28194: 84 e4 ldi r24, 0x44 ; 68 28196: 92 e1 ldi r25, 0x12 ; 18 28198: 0f 94 53 88 call 0x310a6 ; 0x310a6 2819c: d8 01 movw r26, r16 2819e: 94 96 adiw r26, 0x24 ; 36 281a0: 1c 92 st X, r1 281a2: 40 e0 ldi r20, 0x00 ; 0 281a4: 60 e0 ldi r22, 0x00 ; 0 281a6: ce 01 movw r24, r28 281a8: 0b 96 adiw r24, 0x0b ; 11 281aa: 0f 94 53 88 call 0x310a6 ; 0x310a6 281ae: 85 e0 ldi r24, 0x05 ; 5 281b0: fe 01 movw r30, r28 281b2: 3b 96 adiw r30, 0x0b ; 11 281b4: de 01 movw r26, r28 281b6: 11 96 adiw r26, 0x01 ; 1 281b8: 01 90 ld r0, Z+ 281ba: 0d 92 st X+, r0 281bc: 8a 95 dec r24 281be: e1 f7 brne .-8 ; 0x281b8 281c0: 85 e0 ldi r24, 0x05 ; 5 281c2: fe 01 movw r30, r28 281c4: 31 96 adiw r30, 0x01 ; 1 281c6: aa e4 ldi r26, 0x4A ; 74 281c8: b2 e1 ldi r27, 0x12 ; 18 281ca: 01 90 ld r0, Z+ 281cc: 0d 92 st X+, r0 281ce: 8a 95 dec r24 281d0: e1 f7 brne .-8 ; 0x281ca 281d2: f8 01 movw r30, r16 281d4: 12 a6 std Z+42, r1 ; 0x2a 281d6: 14 a6 std Z+44, r1 ; 0x2c 281d8: 13 a6 std Z+43, r1 ; 0x2b 281da: 8a e4 ldi r24, 0x4A ; 74 281dc: 92 e1 ldi r25, 0x12 ; 18 281de: 0f 94 42 88 call 0x31084 ; 0x31084 281e2: d8 01 movw r26, r16 281e4: 99 96 adiw r26, 0x29 ; 41 281e6: 8c 93 st X, r24 281e8: 99 97 sbiw r26, 0x29 ; 41 281ea: dd 96 adiw r26, 0x3d ; 61 281ec: 1c 92 st X, r1 281ee: dd 97 sbiw r26, 0x3d ; 61 281f0: 84 e2 ldi r24, 0x24 ; 36 281f2: 92 e1 ldi r25, 0x12 ; 18 281f4: df 96 adiw r26, 0x3f ; 63 281f6: 9c 93 st X, r25 281f8: 8e 93 st -X, r24 281fa: de 97 sbiw r26, 0x3e ; 62 281fc: f0 92 66 12 sts 0x1266, r15 ; 0x801266 28200: e0 92 65 12 sts 0x1265, r14 ; 0x801265 28204: 10 92 67 12 sts 0x1267, r1 ; 0x801267 28208: 1f ef ldi r17, 0xFF ; 255 2820a: 10 93 68 12 sts 0x1268, r17 ; 0x801268 2820e: 0f 94 96 88 call 0x3112c ; 0x3112c 28212: 80 93 69 12 sts 0x1269, r24 ; 0x801269 28216: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2821a: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2821e: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c 28222: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 28226: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 2822a: 10 92 70 12 sts 0x1270, r1 ; 0x801270 2822e: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 28232: 10 92 73 12 sts 0x1273, r1 ; 0x801273 28236: 10 92 74 12 sts 0x1274, r1 ; 0x801274 2823a: 10 92 75 12 sts 0x1275, r1 ; 0x801275 2823e: 10 92 76 12 sts 0x1276, r1 ; 0x801276 28242: 83 e0 ldi r24, 0x03 ; 3 28244: 80 93 79 12 sts 0x1279, r24 ; 0x801279 28248: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a 2824c: 85 e0 ldi r24, 0x05 ; 5 2824e: 80 93 71 12 sts 0x1271, r24 ; 0x801271 28252: 84 e1 ldi r24, 0x14 ; 20 28254: 80 93 72 12 sts 0x1272, r24 ; 0x801272 28258: 83 e6 ldi r24, 0x63 ; 99 2825a: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b 2825e: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c 28262: 10 92 7d 12 sts 0x127D, r1 ; 0x80127d 28266: 10 92 7e 12 sts 0x127E, r1 ; 0x80127e 2826a: 10 92 7f 12 sts 0x127F, r1 ; 0x80127f 2826e: 10 92 80 12 sts 0x1280, r1 ; 0x801280 28272: 10 92 81 12 sts 0x1281, r1 ; 0x801281 28276: 10 92 82 12 sts 0x1282, r1 ; 0x801282 2827a: 10 92 83 12 sts 0x1283, r1 ; 0x801283 2827e: 10 92 84 12 sts 0x1284, r1 ; 0x801284 28282: 10 92 85 12 sts 0x1285, r1 ; 0x801285 28286: 10 92 86 12 sts 0x1286, r1 ; 0x801286 2828a: 10 92 87 12 sts 0x1287, r1 ; 0x801287 2828e: 10 92 88 12 sts 0x1288, r1 ; 0x801288 28292: 10 92 8a 12 sts 0x128A, r1 ; 0x80128a 28296: 10 92 89 12 sts 0x1289, r1 ; 0x801289 2829a: 10 92 8b 12 sts 0x128B, r1 ; 0x80128b 2829e: 8e e2 ldi r24, 0x2E ; 46 282a0: 90 e8 ldi r25, 0x80 ; 128 282a2: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 282a6: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c 282aa: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e 282ae: 10 93 8f 12 sts 0x128F, r17 ; 0x80128f 282b2: 10 92 91 12 sts 0x1291, r1 ; 0x801291 282b6: 10 92 90 12 sts 0x1290, r1 ; 0x801290 282ba: 10 93 92 12 sts 0x1292, r17 ; 0x801292 282be: 82 e0 ldi r24, 0x02 ; 2 282c0: 80 93 93 12 sts 0x1293, r24 ; 0x801293 282c4: 10 92 94 12 sts 0x1294, r1 ; 0x801294 282c8: 10 92 95 12 sts 0x1295, r1 ; 0x801295 282cc: 10 92 96 12 sts 0x1296, r1 ; 0x801296 282d0: 10 92 97 12 sts 0x1297, r1 ; 0x801297 282d4: 10 92 99 12 sts 0x1299, r1 ; 0x801299 282d8: 10 92 98 12 sts 0x1298, r1 ; 0x801298 282dc: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b 282e0: 10 92 9a 12 sts 0x129A, r1 ; 0x80129a 282e4: 0f 94 51 57 call 0x2aea2 ; 0x2aea2 282e8: e8 e6 ldi r30, 0x68 ; 104 282ea: f3 e1 ldi r31, 0x13 ; 19 282ec: 10 92 f0 13 sts 0x13F0, r1 ; 0x8013f0 282f0: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 282f4: 10 92 15 14 sts 0x1415, r1 ; 0x801415 282f8: 10 92 18 14 sts 0x1418, r1 ; 0x801418 282fc: 89 e1 ldi r24, 0x19 ; 25 282fe: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 28302: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 28306: 10 92 db 15 sts 0x15DB, r1 ; 0x8015db 2830a: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 2830e: 10 92 fa 15 sts 0x15FA, r1 ; 0x8015fa 28312: 10 92 fd 15 sts 0x15FD, r1 ; 0x8015fd 28316: 10 92 7b 16 sts 0x167B, r1 ; 0x80167b 2831a: 10 92 7d 16 sts 0x167D, r1 ; 0x80167d 2831e: 10 92 7c 16 sts 0x167C, r1 ; 0x80167c 28322: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 28326: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b 2832a: 10 92 77 16 sts 0x1677, r1 ; 0x801677 2832e: 10 92 78 16 sts 0x1678, r1 ; 0x801678 28332: 10 92 79 16 sts 0x1679, r1 ; 0x801679 28336: 10 92 7a 16 sts 0x167A, r1 ; 0x80167a 2833a: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 2833e: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 28342: 10 92 80 16 sts 0x1680, r1 ; 0x801680 28346: 10 92 81 16 sts 0x1681, r1 ; 0x801681 2834a: 12 82 std Z+2, r1 ; 0x02 2834c: 13 82 std Z+3, r1 ; 0x03 2834e: 10 82 st Z, r1 28350: 11 82 std Z+1, r1 ; 0x01 28352: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a 28356: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d 2835a: e8 e3 ldi r30, 0x38 ; 56 2835c: f4 e1 ldi r31, 0x14 ; 20 2835e: 82 ed ldi r24, 0xD2 ; 210 28360: df 01 movw r26, r30 28362: 1d 92 st X+, r1 28364: 8a 95 dec r24 28366: e9 f7 brne .-6 ; 0x28362 28368: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 2836c: 10 92 b8 13 sts 0x13B8, r1 ; 0x8013b8 28370: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 28374: 8b e7 ldi r24, 0x7B ; 123 28376: 96 e1 ldi r25, 0x16 ; 22 28378: 0f 94 30 10 call 0x22060 ; 0x22060 ::start()> 2837c: e1 e6 ldi r30, 0x61 ; 97 2837e: f3 e1 ldi r31, 0x13 ; 19 28380: 11 82 std Z+1, r1 ; 0x01 28382: 12 82 std Z+2, r1 ; 0x02 28384: 13 82 std Z+3, r1 ; 0x03 28386: 14 82 std Z+4, r1 ; 0x04 28388: 15 82 std Z+5, r1 ; 0x05 2838a: 16 82 std Z+6, r1 ; 0x06 2838c: 10 83 st Z, r17 2838e: e4 e8 ldi r30, 0x84 ; 132 28390: f6 e1 ldi r31, 0x16 ; 22 28392: 15 82 std Z+5, r1 ; 0x05 28394: 17 82 std Z+7, r1 ; 0x07 28396: 16 82 std Z+6, r1 ; 0x06 28398: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2839c: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 283a0: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 283a4: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 283a8: 90 93 90 16 sts 0x1690, r25 ; 0x801690 283ac: 2f 96 adiw r28, 0x0f ; 15 283ae: 0f b6 in r0, 0x3f ; 63 283b0: f8 94 cli 283b2: de bf out 0x3e, r29 ; 62 283b4: 0f be out 0x3f, r0 ; 63 283b6: cd bf out 0x3d, r28 ; 61 283b8: df 91 pop r29 283ba: cf 91 pop r28 283bc: 1f 91 pop r17 283be: 0f 91 pop r16 283c0: ff 90 pop r15 283c2: ef 90 pop r14 283c4: 08 95 ret 000283c6 : 283c6: 42 e0 ldi r20, 0x02 ; 2 283c8: 0f 94 a9 98 call 0x33152 ; 0x33152 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 283cc: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 000283d0 : 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; 283d0: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 283d4: 83 36 cpi r24, 0x63 ; 99 283d6: 09 f4 brne .+2 ; 0x283da 283d8: 8f ef ldi r24, 0xFF ; 255 } 283da: 08 95 ret 000283dc : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 283dc: 85 e8 ldi r24, 0x85 ; 133 283de: 9e e9 ldi r25, 0x9E ; 158 283e0: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 283e4: 60 e0 ldi r22, 0x00 ; 0 283e6: 8c ea ldi r24, 0xAC ; 172 283e8: 9c e0 ldi r25, 0x0C ; 12 283ea: 0e 94 6e 6f call 0xdedc ; 0xdedc if (status == 1) { 283ee: 81 30 cpi r24, 0x01 ; 1 283f0: 21 f4 brne .+8 ; 0x283fa SERIAL_ECHOLNRPGM(_O(MSG_ON)); 283f2: 83 e7 ldi r24, 0x73 ; 115 283f4: 9b e5 ldi r25, 0x5B ; 91 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 283f6: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 283fa: 8d e6 ldi r24, 0x6D ; 109 283fc: 9b e5 ldi r25, 0x5B ; 91 283fe: fb cf rjmp .-10 ; 0x283f6 00028400 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 28400: bc 01 movw r22, r24 28402: 99 0f add r25, r25 28404: 88 0b sbc r24, r24 28406: 99 0b sbc r25, r25 28408: 0f 94 02 98 call 0x33004 ; 0x33004 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2840c: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 00028410 : 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){ 28410: cf 93 push r28 28412: c8 2f mov r28, r24 extruder = ex; 28414: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 28418: 87 e7 ldi r24, 0x77 ; 119 2841a: 9e e9 ldi r25, 0x9E ; 158 2841c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 28420: 8b e6 ldi r24, 0x6B ; 107 28422: 9e e9 ldi r25, 0x9E ; 158 28424: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 28428: 81 e6 ldi r24, 0x61 ; 97 2842a: 9e e9 ldi r25, 0x9E ; 158 2842c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN((int)ex); 28430: 8c 2f mov r24, r28 28432: 90 e0 ldi r25, 0x00 ; 0 } 28434: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 28436: 0d 94 00 42 jmp 0x28400 ; 0x28400 0002843a : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2843a: 28 9a sbi 0x05, 0 ; 5 } 2843c: 08 95 ret 0002843e : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2843e: 0f 93 push r16 28440: 1f 93 push r17 28442: cf 93 push r28 28444: df 93 push r29 28446: ec 01 movw r28, r24 uint16_t t0 = _millis(); 28448: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2844c: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2844e: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 28452: 8f 3f cpi r24, 0xFF ; 255 28454: 69 f0 breq .+26 ; 0x28470 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 28456: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2845a: 60 1b sub r22, r16 2845c: 71 0b sbc r23, r17 2845e: 6c 17 cp r22, r28 28460: 7d 07 cpc r23, r29 28462: a8 f3 brcs .-22 ; 0x2844e } return true; fail: return false; 28464: 80 e0 ldi r24, 0x00 ; 0 } 28466: df 91 pop r29 28468: cf 91 pop r28 2846a: 1f 91 pop r17 2846c: 0f 91 pop r16 2846e: 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; 28470: 81 e0 ldi r24, 0x01 ; 1 28472: f9 cf rjmp .-14 ; 0x28466 00028474 : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 28474: 8a ef ldi r24, 0xFA ; 250 28476: 95 e1 ldi r25, 0x15 ; 21 28478: 0f 94 5e 39 call 0x272bc ; 0x272bc file.close(); 2847c: 8a ef ldi r24, 0xFA ; 250 2847e: 95 e1 ldi r25, 0x15 ; 21 28480: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 saving = false; 28484: e8 e6 ldi r30, 0x68 ; 104 28486: f3 e1 ldi r31, 0x13 ; 19 28488: 10 82 st Z, r1 logging = false; 2848a: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 2848c: 08 95 ret 0002848e : //! 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) 2848e: cf 92 push r12 28490: df 92 push r13 28492: ef 92 push r14 28494: ff 92 push r15 28496: 0f 93 push r16 28498: 1f 93 push r17 2849a: cf 93 push r28 2849c: df 93 push r29 2849e: eb 01 movw r28, r22 284a0: 18 2f mov r17, r24 284a2: 09 2f mov r16, r25 { if (saved_printing) return; cli(); 284a4: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 284a6: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 284aa: 88 23 and r24, r24 284ac: 09 f4 brne .+2 ; 0x284b0 284ae: d8 c0 rjmp .+432 ; 0x28660 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 284b0: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc 284b4: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd 284b8: a0 91 de 11 lds r26, 0x11DE ; 0x8011de 284bc: b0 91 df 11 lds r27, 0x11DF ; 0x8011df 284c0: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 284c4: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 284c8: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 284cc: b0 93 db 11 sts 0x11DB, r27 ; 0x8011db sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 284d0: 0f 94 c5 75 call 0x2eb8a ; 0x2eb8a saved_sdpos -= sdlen_planner; 284d4: c0 90 d8 11 lds r12, 0x11D8 ; 0x8011d8 284d8: d0 90 d9 11 lds r13, 0x11D9 ; 0x8011d9 284dc: e0 90 da 11 lds r14, 0x11DA ; 0x8011da 284e0: f0 90 db 11 lds r15, 0x11DB ; 0x8011db 284e4: c8 1a sub r12, r24 284e6: d9 0a sbc r13, r25 284e8: e1 08 sbc r14, r1 284ea: f1 08 sbc r15, r1 284ec: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 284f0: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 284f4: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 284f8: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 284fc: 0e 94 14 70 call 0xe028 ; 0xe028 saved_sdpos -= sdlen_cmdqueue; 28500: c8 1a sub r12, r24 28502: d9 0a sbc r13, r25 28504: e1 08 sbc r14, r1 28506: f1 08 sbc r15, r1 28508: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 2850c: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 28510: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 28514: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_SD; 28518: 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; 2851c: 20 91 06 12 lds r18, 0x1206 ; 0x801206 28520: f0 90 05 12 lds r15, 0x1205 ; 0x801205 28524: 21 11 cpse r18, r1 28526: 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)) 28528: 80 91 e4 11 lds r24, 0x11E4 ; 0x8011e4 2852c: 90 91 e5 11 lds r25, 0x11E5 ; 0x8011e5 28530: 00 97 sbiw r24, 0x00 ; 0 28532: 09 f4 brne .+2 ; 0x28536 28534: d1 c0 rjmp .+418 ; 0x286d8 28536: 21 11 cpse r18, r1 28538: cf c0 rjmp .+414 ; 0x286d8 2853a: 20 91 05 12 lds r18, 0x1205 ; 0x801205 2853e: 21 11 cpse r18, r1 28540: cb c0 rjmp .+406 ; 0x286d8 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 28542: fc 01 movw r30, r24 28544: e8 5a subi r30, 0xA8 ; 168 28546: ff 4f sbci r31, 0xFF ; 255 28548: 20 e1 ldi r18, 0x10 ; 16 2854a: ae e7 ldi r26, 0x7E ; 126 2854c: b2 e0 ldi r27, 0x02 ; 2 2854e: 01 90 ld r0, Z+ 28550: 0d 92 st X+, r0 28552: 2a 95 dec r18 28554: e1 f7 brne .-8 ; 0x2854e saved_feedrate2 = current_block->gcode_feedrate; 28556: fc 01 movw r30, r24 28558: e6 59 subi r30, 0x96 ; 150 2855a: ff 4f sbci r31, 0xFF ; 255 2855c: 20 81 ld r18, Z 2855e: 31 81 ldd r19, Z+1 ; 0x01 28560: 30 93 e3 11 sts 0x11E3, r19 ; 0x8011e3 28564: 20 93 e2 11 sts 0x11E2, r18 ; 0x8011e2 saved_segment_idx = current_block->segment_idx; 28568: 88 59 subi r24, 0x98 ; 152 2856a: 9f 4f sbci r25, 0xFF ; 255 2856c: fc 01 movw r30, r24 2856e: 80 81 ld r24, Z 28570: 91 81 ldd r25, Z+1 ; 0x01 28572: 90 93 e1 11 sts 0x11E1, r25 ; 0x8011e1 28576: 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 2857a: 0f 94 4a 87 call 0x30e94 ; 0x30e94 memcpy(saved_pos, current_position, sizeof(saved_pos)); 2857e: 80 e1 ldi r24, 0x10 ; 16 28580: e5 ef ldi r30, 0xF5 ; 245 28582: f1 e1 ldi r31, 0x11 ; 17 28584: a0 e9 ldi r26, 0x90 ; 144 28586: b2 e0 ldi r27, 0x02 ; 2 28588: 01 90 ld r0, Z+ 2858a: 0d 92 st X+, r0 2858c: 8a 95 dec r24 2858e: e1 f7 brne .-8 ; 0x28588 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 28590: ff 20 and r15, r15 28592: 61 f0 breq .+24 ; 0x285ac 28594: 80 e0 ldi r24, 0x00 ; 0 28596: 90 e0 ldi r25, 0x00 ; 0 28598: a0 e8 ldi r26, 0x80 ; 128 2859a: bf eb ldi r27, 0xBF ; 191 2859c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 285a0: 90 93 91 02 sts 0x0291, r25 ; 0x800291 285a4: a0 93 92 02 sts 0x0292, r26 ; 0x800292 285a8: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 285ac: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 285b0: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 285b4: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> 285b8: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 285bc: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 285c0: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 285c4: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 285c8: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); 285cc: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 285d0: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 285d4: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 285d8: 83 fb bst r24, 3 285da: 88 27 eor r24, r24 285dc: 80 f9 bld r24, 0 285de: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; 285e2: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 285e6: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 cmdqueue_reset(); //empty cmdqueue 285ea: 0e 94 a1 73 call 0xe742 ; 0xe742 card.sdprinting = false; 285ee: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a // card.closefile(); saved_printing = true; 285f2: 81 e0 ldi r24, 0x01 ; 1 285f4: 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(); 285f8: 0f 94 ac 22 call 0x24558 ; 0x24558 sei(); 285fc: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 285fe: 20 e0 ldi r18, 0x00 ; 0 28600: 30 e0 ldi r19, 0x00 ; 0 28602: a9 01 movw r20, r18 28604: f8 01 movw r30, r16 28606: 6c 2f mov r22, r28 28608: 7d 2f mov r23, r29 2860a: 8f 2f mov r24, r31 2860c: 90 2f mov r25, r16 2860e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 28612: 88 23 and r24, r24 28614: e1 f0 breq .+56 ; 0x2864e // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 28616: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea 2861a: 81 11 cpse r24, r1 2861c: 05 c0 rjmp .+10 ; 0x28628 enquecommand_P(MSG_M83); 2861e: 61 e0 ldi r22, 0x01 ; 1 28620: 89 ed ldi r24, 0xD9 ; 217 28622: 9c e6 ldi r25, 0x6C ; 108 28624: 0e 94 37 7d call 0xfa6e ; 0xfa6e // 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); 28628: 0f 93 push r16 2862a: 1f 93 push r17 2862c: df 93 push r29 2862e: cf 93 push r28 28630: 89 ec ldi r24, 0xC9 ; 201 28632: 9c e6 ldi r25, 0x6C ; 108 28634: 9f 93 push r25 28636: 8f 93 push r24 28638: 0e 94 cd 7d call 0xfb9a ; 0xfb9a 2863c: 81 e0 ldi r24, 0x01 ; 1 2863e: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 28642: 0f 90 pop r0 28644: 0f 90 pop r0 28646: 0f 90 pop r0 28648: 0f 90 pop r0 2864a: 0f 90 pop r0 2864c: 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(); } } 2864e: df 91 pop r29 28650: cf 91 pop r28 28652: 1f 91 pop r17 28654: 0f 91 pop r16 28656: ff 90 pop r15 28658: ef 90 pop r14 2865a: df 90 pop r13 2865c: cf 90 pop r12 2865e: 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 28660: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 28664: 88 23 and r24, r24 28666: b1 f1 breq .+108 ; 0x286d4 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 28668: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 2866c: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 28670: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 28674: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 28678: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 2867c: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 28680: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 28684: 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 28688: 0f 94 c5 75 call 0x2eb8a ; 0x2eb8a saved_sdpos -= nlines; 2868c: 40 91 d8 11 lds r20, 0x11D8 ; 0x8011d8 28690: 50 91 d9 11 lds r21, 0x11D9 ; 0x8011d9 28694: 60 91 da 11 lds r22, 0x11DA ; 0x8011da 28698: 70 91 db 11 lds r23, 0x11DB ; 0x8011db 2869c: 48 1b sub r20, r24 2869e: 51 09 sbc r21, r1 286a0: 61 09 sbc r22, r1 286a2: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 286a4: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 286a8: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 286ac: 09 2e mov r0, r25 286ae: 00 0c add r0, r0 286b0: aa 0b sbc r26, r26 286b2: bb 0b sbc r27, r27 286b4: 48 1b sub r20, r24 286b6: 59 0b sbc r21, r25 286b8: 6a 0b sbc r22, r26 286ba: 7b 0b sbc r23, r27 286bc: 40 93 d8 11 sts 0x11D8, r20 ; 0x8011d8 286c0: 50 93 d9 11 sts 0x11D9, r21 ; 0x8011d9 286c4: 60 93 da 11 sts 0x11DA, r22 ; 0x8011da 286c8: 70 93 db 11 sts 0x11DB, r23 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 286cc: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 286ce: 80 93 79 02 sts 0x0279, r24 ; 0x800279 286d2: 24 cf rjmp .-440 ; 0x2851c 286d4: 82 e0 ldi r24, 0x02 ; 2 286d6: fb cf rjmp .-10 ; 0x286ce saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 286d8: 80 e0 ldi r24, 0x00 ; 0 286da: 90 e0 ldi r25, 0x00 ; 0 286dc: a0 e8 ldi r26, 0x80 ; 128 286de: bf eb ldi r27, 0xBF ; 191 286e0: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 286e4: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 286e8: a0 93 80 02 sts 0x0280, r26 ; 0x800280 286ec: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 286f0: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 286f4: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 286f8: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 286fc: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 28700: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 28704: 70 93 e3 11 sts 0x11E3, r23 ; 0x8011e3 28708: 60 93 e2 11 sts 0x11E2, r22 ; 0x8011e2 saved_segment_idx = 0; 2870c: 10 92 e1 11 sts 0x11E1, r1 ; 0x8011e1 28710: 10 92 e0 11 sts 0x11E0, r1 ; 0x8011e0 28714: 32 cf rjmp .-412 ; 0x2857a 00028716 : // "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) { 28716: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2871a: 81 11 cpse r24, r1 2871c: 24 c0 rjmp .+72 ; 0x28766 Stopped = true; 2871e: 81 e0 ldi r24, 0x01 ; 1 28720: 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); 28724: 61 e0 ldi r22, 0x01 ; 1 28726: 80 e0 ldi r24, 0x00 ; 0 28728: 0e 94 9e ef call 0x1df3c ; 0x1df3c } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 2872c: 8a e5 ldi r24, 0x5A ; 90 2872e: 9e e9 ldi r25, 0x9E ; 158 28730: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 28734: 84 e9 ldi r24, 0x94 ; 148 28736: 9c e6 ldi r25, 0x6C ; 108 28738: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // 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)); 2873c: 80 e6 ldi r24, 0x60 ; 96 2873e: 9b e5 ldi r25, 0x5B ; 91 28740: 0e 94 32 6d call 0xda64 ; 0xda64 28744: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 // 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); 28748: 9f b7 in r25, 0x3f ; 63 2874a: f8 94 cli 2874c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 28750: 84 60 ori r24, 0x04 ; 4 28752: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 28756: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 28758: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 2875c: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 28760: 81 60 ori r24, 0x01 ; 1 28762: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd } } } 28766: 08 95 ret 00028768 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 28768: 0f 93 push r16 2876a: 1f 93 push r17 2876c: cf 93 push r28 2876e: df 93 push r29 28770: ec 01 movw r28, r24 28772: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> 28776: 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) 28778: 80 36 cpi r24, 0x60 ; 96 2877a: 91 05 cpc r25, r1 2877c: 08 f0 brcs .+2 ; 0x28780 2877e: 85 c0 rjmp .+266 ; 0x2888a return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 28780: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 28784: 81 11 cpse r24, r1 28786: 05 c0 rjmp .+10 ; 0x28792 cmdqueue_pop_front(); 28788: 0e 94 54 70 call 0xe0a8 ; 0xe0a8 cmdbuffer_front_already_processed = true; 2878c: 81 e0 ldi r24, 0x01 ; 1 2878e: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } if (bufindr == bufindw && buflen > 0) 28792: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb 28796: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc 2879a: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> 2879e: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> 287a2: 48 17 cp r20, r24 287a4: 59 07 cpc r21, r25 287a6: 41 f4 brne .+16 ; 0x287b8 287a8: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 287ac: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 287b0: 12 16 cp r1, r18 287b2: 13 06 cpc r1, r19 287b4: 0c f4 brge .+2 ; 0x287b8 287b6: 69 c0 rjmp .+210 ; 0x2888a // 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; 287b8: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda 287bc: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb 287c0: 12 16 cp r1, r18 287c2: 13 06 cpc r1, r19 287c4: 0c f0 brlt .+2 ; 0x287c8 287c6: 41 c0 rjmp .+130 ; 0x2884a 287c8: 9c 01 movw r18, r24 287ca: 2f 59 subi r18, 0x9F ; 159 287cc: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 287ce: 84 17 cp r24, r20 287d0: 95 07 cpc r25, r21 287d2: e8 f5 brcc .+122 ; 0x2884e int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 287d4: 44 50 subi r20, 0x04 ; 4 287d6: 51 09 sbc r21, r1 287d8: 40 1b sub r20, r16 287da: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 287dc: 42 17 cp r20, r18 287de: 53 07 cpc r21, r19 287e0: 0c f4 brge .+2 ; 0x287e4 287e2: 53 c0 rjmp .+166 ; 0x2888a } } 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); 287e4: 50 93 cc 11 sts 0x11CC, r21 ; 0x8011cc 287e8: 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; 287ec: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 287f0: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 287f4: fc 01 movw r30, r24 287f6: e2 52 subi r30, 0x22 ; 34 287f8: f0 4f sbci r31, 0xF0 ; 240 287fa: 23 e0 ldi r18, 0x03 ; 3 287fc: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 287fe: be 01 movw r22, r28 28800: 8f 51 subi r24, 0x1F ; 31 28802: 90 4f sbci r25, 0xF0 ; 240 28804: 0f 94 f3 9e call 0x33de6 ; 0x33de6 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 28808: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 2880c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 28810: 01 96 adiw r24, 0x01 ; 1 28812: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 28816: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHO_START; 2881a: 87 e7 ldi r24, 0x77 ; 119 2881c: 9e e9 ldi r25, 0x9E ; 158 2881e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(enqueingFront); 28822: 81 e4 ldi r24, 0x41 ; 65 28824: 9e e9 ldi r25, 0x9E ; 158 28826: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2882a: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 2882e: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc } }*/ static FORCE_INLINE void print(const char *str) { write(str); 28832: 8f 51 subi r24, 0x1F ; 31 28834: 90 4f sbci r25, 0xF0 ; 240 28836: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHOLNPGM("\""); 2883a: 8f e3 ldi r24, 0x3F ; 63 2883c: 9e e9 ldi r25, 0x9E ; 158 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2883e: df 91 pop r29 28840: cf 91 pop r28 28842: 1f 91 pop r17 28844: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 28846: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 // 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) 2884a: 9c 01 movw r18, r24 2884c: c0 cf rjmp .-128 ; 0x287ce bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2884e: c8 01 movw r24, r16 28850: 04 96 adiw r24, 0x04 ; 4 28852: 48 17 cp r20, r24 28854: 59 07 cpc r21, r25 28856: 28 f0 brcs .+10 ; 0x28862 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 28858: 44 50 subi r20, 0x04 ; 4 2885a: 51 09 sbc r21, r1 2885c: 40 1b sub r20, r16 2885e: 51 0b sbc r21, r17 28860: c1 cf rjmp .-126 ; 0x287e4 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 28862: 89 ee ldi r24, 0xE9 ; 233 28864: 91 e0 ldi r25, 0x01 ; 1 28866: bc 01 movw r22, r24 28868: 60 1b sub r22, r16 2886a: 71 0b sbc r23, r17 2886c: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2886e: 62 17 cp r22, r18 28870: 73 07 cpc r23, r19 28872: 5c f0 brlt .+22 ; 0x2888a memset(cmdbuffer, 0, bufindr); 28874: 70 e0 ldi r23, 0x00 ; 0 28876: 60 e0 ldi r22, 0x00 ; 0 28878: 8e ed ldi r24, 0xDE ; 222 2887a: 9f e0 ldi r25, 0x0F ; 15 2887c: 0f 94 6e a7 call 0x34edc ; 0x34edc bufindr = bufindr_new; 28880: 10 93 cc 11 sts 0x11CC, r17 ; 0x8011cc 28884: 00 93 cb 11 sts 0x11CB, r16 ; 0x8011cb 28888: b1 cf rjmp .-158 ; 0x287ec SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2888a: 8a e5 ldi r24, 0x5A ; 90 2888c: 9e e9 ldi r25, 0x9E ; 158 2888e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(enqueingFront); 28892: 81 e4 ldi r24, 0x41 ; 65 28894: 9e e9 ldi r25, 0x9E ; 158 28896: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2889a: ce 01 movw r24, r28 2889c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 288a0: 88 e2 ldi r24, 0x28 ; 40 288a2: 9e e9 ldi r25, 0x9E ; 158 288a4: cc cf rjmp .-104 ; 0x2883e 000288a6 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 288a6: ab 01 movw r20, r22 288a8: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 288aa: 8a ef ldi r24, 0xFA ; 250 288ac: 95 e1 ldi r25, 0x15 ; 21 288ae: 0f 94 93 39 call 0x27326 ; 0x27326 288b2: 81 11 cpse r24, r1 288b4: 02 c0 rjmp .+4 ; 0x288ba 288b6: 80 e0 ldi r24, 0x00 ; 0 288b8: 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() ) 288ba: 8a ef ldi r24, 0xFA ; 250 288bc: 95 e1 ldi r25, 0x15 ; 21 288be: 0f 94 7d 38 call 0x270fa ; 0x270fa 288c2: 88 23 and r24, r24 288c4: c1 f3 breq .-16 ; 0x288b6 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; 288c6: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 288ca: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 288ce: 27 52 subi r18, 0x27 ; 39 288d0: 32 4f sbci r19, 0xF2 ; 242 288d2: 30 93 16 16 sts 0x1616, r19 ; 0x801616 288d6: 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; } 288da: 08 95 ret 000288dc : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 288dc: 8f 92 push r8 288de: 9f 92 push r9 288e0: af 92 push r10 288e2: bf 92 push r11 288e4: cf 92 push r12 288e6: df 92 push r13 288e8: ef 92 push r14 288ea: ff 92 push r15 288ec: 0f 93 push r16 288ee: 1f 93 push r17 288f0: cf 93 push r28 288f2: df 93 push r29 288f4: cd b7 in r28, 0x3d ; 61 288f6: de b7 in r29, 0x3e ; 62 288f8: ee 97 sbiw r28, 0x3e ; 62 288fa: 0f b6 in r0, 0x3f ; 63 288fc: f8 94 cli 288fe: de bf out 0x3e, r29 ; 62 28900: 0f be out 0x3f, r0 ; 63 28902: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 28904: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 28908: 8f 93 push r24 2890a: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 2890e: 8f 93 push r24 28910: 83 ee ldi r24, 0xE3 ; 227 28912: 9d e9 ldi r25, 0x9D ; 157 28914: 9f 93 push r25 28916: 8f 93 push r24 28918: 8e 01 movw r16, r28 2891a: 0f 5d subi r16, 0xDF ; 223 2891c: 1f 4f sbci r17, 0xFF ; 255 2891e: 1f 93 push r17 28920: 0f 93 push r16 28922: 0f 94 53 a0 call 0x340a6 ; 0x340a6 28926: 0f 90 pop r0 28928: 0f 90 pop r0 2892a: 0f 90 pop r0 2892c: 0f 90 pop r0 2892e: 0f 90 pop r0 28930: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 28932: f1 2c mov r15, r1 28934: f8 01 movw r30, r16 28936: 01 90 ld r0, Z+ 28938: 00 20 and r0, r0 2893a: e9 f7 brne .-6 ; 0x28936 2893c: 31 97 sbiw r30, 0x01 ; 1 2893e: e0 1b sub r30, r16 28940: f1 0b sbc r31, r17 28942: fe 16 cp r15, r30 28944: 84 f4 brge .+32 ; 0x28966 autoname[i]=tolower(autoname[i]); 28946: 68 01 movw r12, r16 28948: cf 0c add r12, r15 2894a: d1 1c adc r13, r1 2894c: f7 fc sbrc r15, 7 2894e: da 94 dec r13 28950: f6 01 movw r30, r12 28952: 80 81 ld r24, Z 28954: 08 2e mov r0, r24 28956: 00 0c add r0, r0 28958: 99 0b sbc r25, r25 2895a: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 2895e: f6 01 movw r30, r12 28960: 80 83 st Z, r24 28962: f3 94 inc r15 28964: e7 cf rjmp .-50 ; 0x28934 dir_t p; root.rewind(); 28966: 80 ef ldi r24, 0xF0 ; 240 28968: 93 e1 ldi r25, 0x13 ; 19 2896a: 0e 94 b7 70 call 0xe16e ; 0xe16e bool found=false; 2896e: a1 2c mov r10, r1 28970: ce 01 movw r24, r28 28972: 01 96 adiw r24, 0x01 ; 1 28974: 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); 28976: 8d e8 ldi r24, 0x8D ; 141 28978: c8 2e mov r12, r24 2897a: 8c e6 ldi r24, 0x6C ; 108 2897c: 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; 2897e: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 28982: 82 30 cpi r24, 0x02 ; 2 28984: 08 f4 brcc .+2 ; 0x28988 28986: 50 c0 rjmp .+160 ; 0x28a28 28988: 80 91 f8 13 lds r24, 0x13F8 ; 0x8013f8 2898c: 90 91 f9 13 lds r25, 0x13F9 ; 0x8013f9 28990: a0 91 fa 13 lds r26, 0x13FA ; 0x8013fa 28994: b0 91 fb 13 lds r27, 0x13FB ; 0x8013fb 28998: 8f 71 andi r24, 0x1F ; 31 2899a: 99 27 eor r25, r25 2899c: aa 27 eor r26, r26 2899e: bb 27 eor r27, r27 289a0: 89 2b or r24, r25 289a2: 8a 2b or r24, r26 289a4: 8b 2b or r24, r27 289a6: 09 f0 breq .+2 ; 0x289aa 289a8: 3f c0 rjmp .+126 ; 0x28a28 289aa: 50 e0 ldi r21, 0x00 ; 0 289ac: 40 e0 ldi r20, 0x00 ; 0 289ae: b7 01 movw r22, r14 289b0: 80 ef ldi r24, 0xF0 ; 240 289b2: 93 e1 ldi r25, 0x13 ; 19 289b4: 0f 94 f6 38 call 0x271ec ; 0x271ec dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 289b8: 18 16 cp r1, r24 289ba: b4 f5 brge .+108 ; 0x28a28 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 289bc: b1 2c mov r11, r1 289be: f7 01 movw r30, r14 289c0: 01 90 ld r0, Z+ 289c2: 00 20 and r0, r0 289c4: e9 f7 brne .-6 ; 0x289c0 289c6: 31 97 sbiw r30, 0x01 ; 1 289c8: ee 19 sub r30, r14 289ca: ff 09 sbc r31, r15 289cc: be 16 cp r11, r30 289ce: 74 f4 brge .+28 ; 0x289ec p.name[i]=tolower(p.name[i]); 289d0: 47 01 movw r8, r14 289d2: 8b 0c add r8, r11 289d4: 91 1c adc r9, r1 289d6: b7 fc sbrc r11, 7 289d8: 9a 94 dec r9 289da: f4 01 movw r30, r8 289dc: 80 81 ld r24, Z 289de: 90 e0 ldi r25, 0x00 ; 0 289e0: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 289e4: f4 01 movw r30, r8 289e6: 80 83 st Z, r24 289e8: b3 94 inc r11 289ea: e9 cf rjmp .-46 ; 0x289be //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 289ec: 8a 85 ldd r24, Y+10 ; 0x0a 289ee: 8e 37 cpi r24, 0x7E ; 126 289f0: 31 f2 breq .-116 ; 0x2897e if(strncmp((char*)p.name,autoname,5)==0) 289f2: 45 e0 ldi r20, 0x05 ; 5 289f4: 50 e0 ldi r21, 0x00 ; 0 289f6: b8 01 movw r22, r16 289f8: c7 01 movw r24, r14 289fa: 0f 94 ae a7 call 0x34f5c ; 0x34f5c 289fe: 89 2b or r24, r25 28a00: 09 f0 breq .+2 ; 0x28a04 28a02: bd cf rjmp .-134 ; 0x2897e { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 28a04: 1f 93 push r17 28a06: 0f 93 push r16 28a08: df 92 push r13 28a0a: cf 92 push r12 28a0c: 0e 94 cd 7d call 0xfb9a ; 0xfb9a // M24: Start/resume SD print enquecommand_P(MSG_M24); 28a10: 61 e0 ldi r22, 0x01 ; 1 28a12: 89 e8 ldi r24, 0x89 ; 137 28a14: 9c e6 ldi r25, 0x6C ; 108 28a16: 0e 94 37 7d call 0xfa6e ; 0xfa6e 28a1a: 0f 90 pop r0 28a1c: 0f 90 pop r0 28a1e: 0f 90 pop r0 28a20: 0f 90 pop r0 found=true; 28a22: aa 24 eor r10, r10 28a24: a3 94 inc r10 28a26: ab cf rjmp .-170 ; 0x2897e } } if(!found) lastnr=-1; 28a28: 8f ef ldi r24, 0xFF ; 255 28a2a: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 28a2c: aa 20 and r10, r10 28a2e: 29 f0 breq .+10 ; 0x28a3a lastnr=-1; else lastnr++; 28a30: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 28a34: 90 91 b8 13 lds r25, 0x13B8 ; 0x8013b8 28a38: 01 96 adiw r24, 0x01 ; 1 28a3a: 90 93 b8 13 sts 0x13B8, r25 ; 0x8013b8 28a3e: 80 93 b7 13 sts 0x13B7, r24 ; 0x8013b7 } 28a42: ee 96 adiw r28, 0x3e ; 62 28a44: 0f b6 in r0, 0x3f ; 63 28a46: f8 94 cli 28a48: de bf out 0x3e, r29 ; 62 28a4a: 0f be out 0x3f, r0 ; 63 28a4c: cd bf out 0x3d, r28 ; 61 28a4e: df 91 pop r29 28a50: cf 91 pop r28 28a52: 1f 91 pop r17 28a54: 0f 91 pop r16 28a56: ff 90 pop r15 28a58: ef 90 pop r14 28a5a: df 90 pop r13 28a5c: cf 90 pop r12 28a5e: bf 90 pop r11 28a60: af 90 pop r10 28a62: 9f 90 pop r9 28a64: 8f 90 pop r8 28a66: 08 95 ret 00028a68 : * \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) { 28a68: 8f 92 push r8 28a6a: 9f 92 push r9 28a6c: af 92 push r10 28a6e: bf 92 push r11 28a70: cf 92 push r12 28a72: df 92 push r13 28a74: ef 92 push r14 28a76: ff 92 push r15 28a78: 0f 93 push r16 28a7a: 1f 93 push r17 28a7c: cf 93 push r28 28a7e: df 93 push r29 28a80: 00 d0 rcall .+0 ; 0x28a82 28a82: 1f 92 push r1 28a84: cd b7 in r28, 0x3d ; 61 28a86: de b7 in r29, 0x3e ; 62 28a88: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 28a8a: 83 81 ldd r24, Z+3 ; 0x03 28a8c: 81 30 cpi r24, 0x01 ; 1 28a8e: 11 f0 breq .+4 ; 0x28a94 // set file to correct position return seekSet(newPos); fail: return false; 28a90: 80 e0 ldi r24, 0x00 ; 0 28a92: 60 c0 rjmp .+192 ; 0x28b54 * \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; 28a94: 81 81 ldd r24, Z+1 ; 0x01 28a96: 81 ff sbrs r24, 1 28a98: fb cf rjmp .-10 ; 0x28a90 // 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; 28a9a: 81 89 ldd r24, Z+17 ; 0x11 28a9c: 92 89 ldd r25, Z+18 ; 0x12 28a9e: a3 89 ldd r26, Z+19 ; 0x13 28aa0: b4 89 ldd r27, Z+20 ; 0x14 28aa2: 89 2b or r24, r25 28aa4: 8a 2b or r24, r26 28aa6: 8b 2b or r24, r27 28aa8: 09 f4 brne .+2 ; 0x28aac 28aaa: 6e c0 rjmp .+220 ; 0x28b88 28aac: 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; 28aae: 40 e0 ldi r20, 0x00 ; 0 28ab0: 50 e0 ldi r21, 0x00 ; 0 28ab2: ba 01 movw r22, r20 28ab4: cf 01 movw r24, r30 28ab6: 0f 94 93 39 call 0x27326 ; 0x27326 28aba: 88 23 and r24, r24 28abc: 49 f3 breq .-46 ; 0x28a90 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 28abe: f7 01 movw r30, r14 28ac0: c1 8c ldd r12, Z+25 ; 0x19 28ac2: d2 8c ldd r13, Z+26 ; 0x1a 28ac4: 85 88 ldd r8, Z+21 ; 0x15 28ac6: 96 88 ldd r9, Z+22 ; 0x16 28ac8: a7 88 ldd r10, Z+23 ; 0x17 28aca: 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; 28acc: 82 e0 ldi r24, 0x02 ; 2 28ace: 90 e0 ldi r25, 0x00 ; 0 28ad0: a0 e0 ldi r26, 0x00 ; 0 28ad2: b0 e0 ldi r27, 0x00 ; 0 28ad4: f6 01 movw r30, r12 28ad6: 80 83 st Z, r24 28ad8: 91 83 std Z+1, r25 ; 0x01 28ada: a2 83 std Z+2, r26 ; 0x02 28adc: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 28ade: 9e 01 movw r18, r28 28ae0: 2f 5f subi r18, 0xFF ; 255 28ae2: 3f 4f sbci r19, 0xFF ; 255 28ae4: b5 01 movw r22, r10 28ae6: a4 01 movw r20, r8 28ae8: c6 01 movw r24, r12 28aea: 0f 94 90 37 call 0x26f20 ; 0x26f20 28aee: 88 23 and r24, r24 28af0: 79 f2 breq .-98 ; 0x28a90 // free cluster if (!fatPut(cluster, 0)) goto fail; 28af2: 00 e0 ldi r16, 0x00 ; 0 28af4: 10 e0 ldi r17, 0x00 ; 0 28af6: 98 01 movw r18, r16 28af8: b5 01 movw r22, r10 28afa: a4 01 movw r20, r8 28afc: c6 01 movw r24, r12 28afe: 0f 94 fe 36 call 0x26dfc ; 0x26dfc 28b02: 88 23 and r24, r24 28b04: 29 f2 breq .-118 ; 0x28a90 cluster = next; 28b06: 89 80 ldd r8, Y+1 ; 0x01 28b08: 9a 80 ldd r9, Y+2 ; 0x02 28b0a: ab 80 ldd r10, Y+3 ; 0x03 28b0c: 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; 28b0e: f6 01 movw r30, r12 28b10: 87 89 ldd r24, Z+23 ; 0x17 28b12: 80 31 cpi r24, 0x10 ; 16 28b14: 81 f5 brne .+96 ; 0x28b76 28b16: f8 ef ldi r31, 0xF8 ; 248 28b18: 8f 16 cp r8, r31 28b1a: ff ef ldi r31, 0xFF ; 255 28b1c: 9f 06 cpc r9, r31 28b1e: a1 04 cpc r10, r1 28b20: b1 04 cpc r11, r1 28b22: e8 f2 brcs .-70 ; 0x28ade firstCluster_ = 0; 28b24: f7 01 movw r30, r14 28b26: 15 8a std Z+21, r1 ; 0x15 28b28: 16 8a std Z+22, r1 ; 0x16 28b2a: 17 8a std Z+23, r1 ; 0x17 28b2c: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 28b2e: 11 8a std Z+17, r1 ; 0x11 28b30: 12 8a std Z+18, r1 ; 0x12 28b32: 13 8a std Z+19, r1 ; 0x13 28b34: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 28b36: 81 81 ldd r24, Z+1 ; 0x01 28b38: 80 68 ori r24, 0x80 ; 128 28b3a: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 28b3c: c7 01 movw r24, r14 28b3e: 0f 94 5e 39 call 0x272bc ; 0x272bc 28b42: 88 23 and r24, r24 28b44: 09 f4 brne .+2 ; 0x28b48 28b46: a4 cf rjmp .-184 ; 0x28a90 // set file to correct position return seekSet(newPos); 28b48: 40 e0 ldi r20, 0x00 ; 0 28b4a: 50 e0 ldi r21, 0x00 ; 0 28b4c: ba 01 movw r22, r20 28b4e: c7 01 movw r24, r14 28b50: 0f 94 93 39 call 0x27326 ; 0x27326 fail: return false; } 28b54: 0f 90 pop r0 28b56: 0f 90 pop r0 28b58: 0f 90 pop r0 28b5a: 0f 90 pop r0 28b5c: df 91 pop r29 28b5e: cf 91 pop r28 28b60: 1f 91 pop r17 28b62: 0f 91 pop r16 28b64: ff 90 pop r15 28b66: ef 90 pop r14 28b68: df 90 pop r13 28b6a: cf 90 pop r12 28b6c: bf 90 pop r11 28b6e: af 90 pop r10 28b70: 9f 90 pop r9 28b72: 8f 90 pop r8 28b74: 08 95 ret return cluster >= FAT32EOC_MIN; 28b76: 88 ef ldi r24, 0xF8 ; 248 28b78: 88 16 cp r8, r24 28b7a: 8f ef ldi r24, 0xFF ; 255 28b7c: 98 06 cpc r9, r24 28b7e: a8 06 cpc r10, r24 28b80: 8f e0 ldi r24, 0x0F ; 15 28b82: b8 06 cpc r11, r24 28b84: 78 f6 brcc .-98 ; 0x28b24 28b86: ab cf rjmp .-170 ; 0x28ade // 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; 28b88: 81 e0 ldi r24, 0x01 ; 1 28b8a: e4 cf rjmp .-56 ; 0x28b54 00028b8c : +* 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) { 28b8c: 2f 92 push r2 28b8e: 3f 92 push r3 28b90: 4f 92 push r4 28b92: 5f 92 push r5 28b94: 6f 92 push r6 28b96: 7f 92 push r7 28b98: 8f 92 push r8 28b9a: 9f 92 push r9 28b9c: af 92 push r10 28b9e: bf 92 push r11 28ba0: cf 92 push r12 28ba2: df 92 push r13 28ba4: ef 92 push r14 28ba6: ff 92 push r15 28ba8: 0f 93 push r16 28baa: 1f 93 push r17 28bac: cf 93 push r28 28bae: df 93 push r29 28bb0: cd b7 in r28, 0x3d ; 61 28bb2: de b7 in r29, 0x3e ; 62 28bb4: c6 57 subi r28, 0x76 ; 118 28bb6: d1 09 sbc r29, r1 28bb8: 0f b6 in r0, 0x3f ; 63 28bba: f8 94 cli 28bbc: de bf out 0x3e, r29 ; 62 28bbe: 0f be out 0x3f, r0 ; 63 28bc0: cd bf out 0x3d, r28 ; 61 28bc2: 4c 01 movw r8, r24 28bc4: 6b 01 movw r12, r22 28bc6: 3a 01 movw r6, r20 28bc8: e5 96 adiw r28, 0x35 ; 53 28bca: 2f af std Y+63, r18 ; 0x3f 28bcc: e5 97 sbiw r28, 0x35 ; 53 28bce: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 28bd0: 2d b6 in r2, 0x3d ; 61 28bd2: 3e b6 in r3, 0x3e ; 62 28bd4: 10 2f mov r17, r16 28bd6: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 28bd8: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28bdc: 8f 5f subi r24, 0xFF ; 255 28bde: 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()) { 28be2: fb 01 movw r30, r22 28be4: 80 85 ldd r24, Z+8 ; 0x08 28be6: 91 85 ldd r25, Z+9 ; 0x09 28be8: a2 85 ldd r26, Z+10 ; 0x0a 28bea: b3 85 ldd r27, Z+11 ; 0x0b 28bec: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28bf0: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28bf4: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28bf8: b0 93 80 13 sts 0x1380, r27 ; 0x801380 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 28bfc: 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); 28bfe: 5e 01 movw r10, r28 28c00: f7 e6 ldi r31, 0x67 ; 103 28c02: af 0e add r10, r31 28c04: 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; 28c06: f6 01 movw r30, r12 28c08: 83 81 ldd r24, Z+3 ; 0x03 28c0a: 82 30 cpi r24, 0x02 ; 2 28c0c: 08 f4 brcc .+2 ; 0x28c10 28c0e: c0 c1 rjmp .+896 ; 0x28f90 28c10: 80 85 ldd r24, Z+8 ; 0x08 28c12: 91 85 ldd r25, Z+9 ; 0x09 28c14: a2 85 ldd r26, Z+10 ; 0x0a 28c16: b3 85 ldd r27, Z+11 ; 0x0b 28c18: 8f 71 andi r24, 0x1F ; 31 28c1a: 99 27 eor r25, r25 28c1c: aa 27 eor r26, r26 28c1e: bb 27 eor r27, r27 28c20: 89 2b or r24, r25 28c22: 8a 2b or r24, r26 28c24: 8b 2b or r24, r27 28c26: 09 f0 breq .+2 ; 0x28c2a 28c28: b3 c1 rjmp .+870 ; 0x28f90 //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'; 28c2a: 10 92 81 13 sts 0x1381, r1 ; 0x801381 28c2e: 41 e8 ldi r20, 0x81 ; 129 28c30: 53 e1 ldi r21, 0x13 ; 19 28c32: be 01 movw r22, r28 28c34: 69 5b subi r22, 0xB9 ; 185 28c36: 7f 4f sbci r23, 0xFF ; 255 28c38: c6 01 movw r24, r12 28c3a: 0f 94 f6 38 call 0x271ec ; 0x271ec } 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()) { 28c3e: 18 16 cp r1, r24 28c40: 0c f0 brlt .+2 ; 0x28c44 28c42: a6 c1 rjmp .+844 ; 0x28f90 if (recursionCnt > MAX_DIR_DEPTH) 28c44: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28c48: 87 30 cpi r24, 0x07 ; 7 28c4a: 08 f0 brcs .+2 ; 0x28c4e 28c4c: a1 c1 rjmp .+834 ; 0x28f90 return; uint8_t pn0 = p.name[0]; 28c4e: 28 96 adiw r28, 0x08 ; 8 28c50: 8f ad ldd r24, Y+63 ; 0x3f 28c52: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 28c54: 88 23 and r24, r24 28c56: 09 f4 brne .+2 ; 0x28c5a 28c58: 9b c1 rjmp .+822 ; 0x28f90 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 28c5a: 85 3e cpi r24, 0xE5 ; 229 28c5c: 09 f4 brne .+2 ; 0x28c60 28c5e: 39 c1 rjmp .+626 ; 0x28ed2 28c60: 8e 32 cpi r24, 0x2E ; 46 28c62: 09 f4 brne .+2 ; 0x28c66 28c64: 36 c1 rjmp .+620 ; 0x28ed2 if (longFilename[0] == '.') continue; 28c66: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28c6a: 8e 32 cpi r24, 0x2E ; 46 28c6c: 09 f4 brne .+2 ; 0x28c70 28c6e: 31 c1 rjmp .+610 ; 0x28ed2 28c70: 63 96 adiw r28, 0x13 ; 19 28c72: 8f ad ldd r24, Y+63 ; 0x3f 28c74: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 28c76: 98 2f mov r25, r24 28c78: 9a 70 andi r25, 0x0A ; 10 28c7a: 09 f0 breq .+2 ; 0x28c7e 28c7c: 2a c1 rjmp .+596 ; 0x28ed2 28c7e: 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; 28c80: 91 e0 ldi r25, 0x01 ; 1 28c82: 80 31 cpi r24, 0x10 ; 16 28c84: 19 f0 breq .+6 ; 0x28c8c 28c86: 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 28c88: 80 31 cpi r24, 0x10 ; 16 28c8a: 31 f4 brne .+12 ; 0x28c98 28c8c: e5 96 adiw r28, 0x35 ; 53 28c8e: ff ad ldd r31, Y+63 ; 0x3f 28c90: e5 97 sbiw r28, 0x35 ; 53 28c92: ff 23 and r31, r31 28c94: 09 f4 brne .+2 ; 0x28c98 28c96: 94 c0 rjmp .+296 ; 0x28dc0 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 28c98: 90 93 b6 13 sts 0x13B6, r25 ; 0x8013b6 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 28c9c: 80 31 cpi r24, 0x10 ; 16 28c9e: 61 f0 breq .+24 ; 0x28cb8 28ca0: 60 96 adiw r28, 0x10 ; 16 28ca2: 8f ad ldd r24, Y+63 ; 0x3f 28ca4: 60 97 sbiw r28, 0x10 ; 16 28ca6: 87 34 cpi r24, 0x47 ; 71 28ca8: 09 f0 breq .+2 ; 0x28cac 28caa: 13 c1 rjmp .+550 ; 0x28ed2 28cac: 61 96 adiw r28, 0x11 ; 17 28cae: 8f ad ldd r24, Y+63 ; 0x3f 28cb0: 61 97 sbiw r28, 0x11 ; 17 28cb2: 8e 37 cpi r24, 0x7E ; 126 28cb4: 09 f4 brne .+2 ; 0x28cb8 28cb6: 0d c1 rjmp .+538 ; 0x28ed2 switch (lsAction) { 28cb8: e5 96 adiw r28, 0x35 ; 53 28cba: ff ad ldd r31, Y+63 ; 0x3f 28cbc: e5 97 sbiw r28, 0x35 ; 53 28cbe: f1 30 cpi r31, 0x01 ; 1 28cc0: 09 f4 brne .+2 ; 0x28cc4 28cc2: 1b c1 rjmp .+566 ; 0x28efa 28cc4: f2 30 cpi r31, 0x02 ; 2 28cc6: 09 f4 brne .+2 ; 0x28cca 28cc8: 25 c1 rjmp .+586 ; 0x28f14 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 28cca: be 01 movw r22, r28 28ccc: 69 5b subi r22, 0xB9 ; 185 28cce: 7f 4f sbci r23, 0xFF ; 255 28cd0: 8c e6 ldi r24, 0x6C ; 108 28cd2: 93 e1 ldi r25, 0x13 ; 19 28cd4: 0e 94 a1 70 call 0xe142 ; 0xe142 28cd8: c4 01 movw r24, r8 28cda: 0e 94 2b 7d call 0xfa56 ; 0xfa56 28cde: 8c e6 ldi r24, 0x6C ; 108 28ce0: 93 e1 ldi r25, 0x13 ; 19 28ce2: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 28ce6: 80 e2 ldi r24, 0x20 ; 32 28ce8: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 28cec: a7 96 adiw r28, 0x27 ; 39 28cee: 6c ad ldd r22, Y+60 ; 0x3c 28cf0: 7d ad ldd r23, Y+61 ; 0x3d 28cf2: 8e ad ldd r24, Y+62 ; 0x3e 28cf4: 9f ad ldd r25, Y+63 ; 0x3f 28cf6: a7 97 sbiw r28, 0x27 ; 39 28cf8: 4a e0 ldi r20, 0x0A ; 10 28cfa: 0f 94 8c 97 call 0x32f18 ; 0x32f18 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 28cfe: 51 fe sbrs r5, 1 28d00: 45 c0 rjmp .+138 ; 0x28d8c { crmodDate = p.lastWriteDate; 28d02: a1 96 adiw r28, 0x21 ; 33 28d04: 2e ad ldd r18, Y+62 ; 0x3e 28d06: 3f ad ldd r19, Y+63 ; 0x3f 28d08: a1 97 sbiw r28, 0x21 ; 33 28d0a: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28d0e: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28d12: 6f 96 adiw r28, 0x1f ; 31 28d14: 4e ad ldd r20, Y+62 ; 0x3e 28d16: 5f ad ldd r21, Y+63 ; 0x3f 28d18: 6f 97 sbiw r28, 0x1f ; 31 28d1a: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28d1e: 40 93 79 13 sts 0x1379, r20 ; 0x801379 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 28d22: 69 96 adiw r28, 0x19 ; 25 28d24: 8e ad ldd r24, Y+62 ; 0x3e 28d26: 9f ad ldd r25, Y+63 ; 0x3f 28d28: 69 97 sbiw r28, 0x19 ; 25 28d2a: 28 17 cp r18, r24 28d2c: 39 07 cpc r19, r25 28d2e: 50 f0 brcs .+20 ; 0x28d44 28d30: 28 17 cp r18, r24 28d32: 39 07 cpc r19, r25 28d34: 99 f4 brne .+38 ; 0x28d5c 28d36: 67 96 adiw r28, 0x17 ; 23 28d38: 2e ad ldd r18, Y+62 ; 0x3e 28d3a: 3f ad ldd r19, Y+63 ; 0x3f 28d3c: 67 97 sbiw r28, 0x17 ; 23 28d3e: 42 17 cp r20, r18 28d40: 53 07 cpc r21, r19 28d42: 60 f4 brcc .+24 ; 0x28d5c crmodDate = p.creationDate; 28d44: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28d48: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28d4c: 67 96 adiw r28, 0x17 ; 23 28d4e: 8e ad ldd r24, Y+62 ; 0x3e 28d50: 9f ad ldd r25, Y+63 ; 0x3f 28d52: 67 97 sbiw r28, 0x17 ; 23 28d54: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28d58: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 28d5c: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 28d60: 8f 93 push r24 28d62: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 28d66: 8f 93 push r24 28d68: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 28d6c: 8f 93 push r24 28d6e: 80 91 79 13 lds r24, 0x1379 ; 0x801379 28d72: 8f 93 push r24 28d74: 20 ec ldi r18, 0xC0 ; 192 28d76: 3d e9 ldi r19, 0x9D ; 157 28d78: 3f 93 push r19 28d7a: 2f 93 push r18 28d7c: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 28d80: 0f 90 pop r0 28d82: 0f 90 pop r0 28d84: 0f 90 pop r0 28d86: 0f 90 pop r0 28d88: 0f 90 pop r0 28d8a: 0f 90 pop r0 } if (lsParams.LFN) 28d8c: 11 23 and r17, r17 28d8e: 99 f0 breq .+38 ; 0x28db6 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28d90: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28d94: 88 23 and r24, r24 28d96: 09 f4 brne .+2 ; 0x28d9a 28d98: ba c0 rjmp .+372 ; 0x28f0e 28d9a: 81 e8 ldi r24, 0x81 ; 129 28d9c: 93 e1 ldi r25, 0x13 ; 19 28d9e: 9f 93 push r25 28da0: 8f 93 push r24 28da2: ea eb ldi r30, 0xBA ; 186 28da4: fd e9 ldi r31, 0x9D ; 157 28da6: ff 93 push r31 28da8: ef 93 push r30 28daa: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 28dae: 0f 90 pop r0 28db0: 0f 90 pop r0 28db2: 0f 90 pop r0 28db4: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 28db6: 0f 94 5c 99 call 0x332b8 ; 0x332b8 manage_heater(); 28dba: 0f 94 af 32 call 0x2655e ; 0x2655e 28dbe: 89 c0 rjmp .+274 ; 0x28ed2 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 28dc0: 2d b7 in r18, 0x3d ; 61 28dc2: 3e b7 in r19, 0x3e ; 62 28dc4: e7 96 adiw r28, 0x37 ; 55 28dc6: 3f af std Y+63, r19 ; 0x3f 28dc8: 2e af std Y+62, r18 ; 0x3e 28dca: 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); 28dcc: be 01 movw r22, r28 28dce: 69 5b subi r22, 0xB9 ; 185 28dd0: 7f 4f sbci r23, 0xFF ; 255 28dd2: c5 01 movw r24, r10 28dd4: 0e 94 a1 70 call 0xe142 ; 0xe142 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 28dd8: f4 01 movw r30, r8 28dda: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 28ddc: 88 23 and r24, r24 28dde: 09 f4 brne .+2 ; 0x28de2 28de0: 86 c0 rjmp .+268 ; 0x28eee 28de2: 01 90 ld r0, Z+ 28de4: 00 20 and r0, r0 28de6: e9 f7 brne .-6 ; 0x28de2 28de8: 31 97 sbiw r30, 0x01 ; 1 28dea: e8 19 sub r30, r8 28dec: f9 09 sbc r31, r9 28dee: d5 01 movw r26, r10 28df0: 0d 90 ld r0, X+ 28df2: 00 20 and r0, r0 28df4: e9 f7 brne .-6 ; 0x28df0 28df6: ea 19 sub r30, r10 28df8: fb 09 sbc r31, r11 char path[len]; 28dfa: ea 0f add r30, r26 28dfc: fb 1f adc r31, r27 28dfe: 31 96 adiw r30, 0x01 ; 1 28e00: 2d b7 in r18, 0x3d ; 61 28e02: 3e b7 in r19, 0x3e ; 62 28e04: 2e 1b sub r18, r30 28e06: 3f 0b sbc r19, r31 28e08: 0f b6 in r0, 0x3f ; 63 28e0a: f8 94 cli 28e0c: 3e bf out 0x3e, r19 ; 62 28e0e: 0f be out 0x3f, r0 ; 63 28e10: 2d bf out 0x3d, r18 ; 61 28e12: ed b7 in r30, 0x3d ; 61 28e14: fe b7 in r31, 0x3e ; 62 28e16: 31 96 adiw r30, 0x01 ; 1 28e18: 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 28e1a: 61 ef ldi r22, 0xF1 ; 241 28e1c: 72 e0 ldi r23, 0x02 ; 2 28e1e: 81 11 cpse r24, r1 28e20: b4 01 movw r22, r8 28e22: c7 01 movw r24, r14 28e24: 0f 94 a7 a7 call 0x34f4e ; 0x34f4e strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 28e28: b5 01 movw r22, r10 28e2a: c7 01 movw r24, r14 28e2c: 0f 94 88 a7 call 0x34f10 ; 0x34f10 strcat(path, "/"); // 1 character 28e30: 61 ef ldi r22, 0xF1 ; 241 28e32: 72 e0 ldi r23, 0x02 ; 2 28e34: c7 01 movw r24, r14 28e36: 0f 94 88 a7 call 0x34f10 ; 0x34f10 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 28e3a: 11 23 and r17, r17 28e3c: a9 f0 breq .+42 ; 0x28e68 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 28e3e: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28e42: 81 11 cpse r24, r1 28e44: 57 c0 rjmp .+174 ; 0x28ef4 28e46: c5 01 movw r24, r10 28e48: 9f 93 push r25 28e4a: 8f 93 push r24 28e4c: ff 92 push r15 28e4e: ef 92 push r14 28e50: 2f ec ldi r18, 0xCF ; 207 28e52: 3d e9 ldi r19, 0x9D ; 157 28e54: 3f 93 push r19 28e56: 2f 93 push r18 28e58: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 28e5c: 0f 90 pop r0 28e5e: 0f 90 pop r0 28e60: 0f 90 pop r0 28e62: 0f 90 pop r0 28e64: 0f 90 pop r0 28e66: 0f 90 pop r0 28e68: 1c a2 std Y+36, r1 ; 0x24 28e6a: 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); 28e6c: 21 e0 ldi r18, 0x01 ; 1 28e6e: a5 01 movw r20, r10 28e70: b6 01 movw r22, r12 28e72: ce 01 movw r24, r28 28e74: 84 96 adiw r24, 0x24 ; 36 28e76: 0f 94 e9 9a call 0x335d2 ; 0x335d2 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); 28e7a: 83 e2 ldi r24, 0x23 ; 35 28e7c: fe 01 movw r30, r28 28e7e: b4 96 adiw r30, 0x24 ; 36 28e80: de 01 movw r26, r28 28e82: 11 96 adiw r26, 0x01 ; 1 28e84: 01 90 ld r0, Z+ 28e86: 0d 92 st X+, r0 28e88: 8a 95 dec r24 28e8a: e1 f7 brne .-8 ; 0x28e84 28e8c: 10 fb bst r17, 0 28e8e: 50 f8 bld r5, 0 28e90: 05 2d mov r16, r5 28e92: 20 e0 ldi r18, 0x00 ; 0 28e94: 50 e0 ldi r21, 0x00 ; 0 28e96: 40 e0 ldi r20, 0x00 ; 0 28e98: be 01 movw r22, r28 28e9a: 6f 5f subi r22, 0xFF ; 255 28e9c: 7f 4f sbci r23, 0xFF ; 255 28e9e: c7 01 movw r24, r14 28ea0: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 28ea4: ce 01 movw r24, r28 28ea6: 01 96 adiw r24, 0x01 ; 1 28ea8: 0e 94 bc 70 call 0xe178 ; 0xe178 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 28eac: 11 23 and r17, r17 28eae: 21 f0 breq .+8 ; 0x28eb8 puts_P(PSTR("DIR_EXIT")); 28eb0: 86 ec ldi r24, 0xC6 ; 198 28eb2: 9d e9 ldi r25, 0x9D ; 157 28eb4: 0f 94 25 a0 call 0x3404a ; 0x3404a 28eb8: ce 01 movw r24, r28 28eba: 84 96 adiw r24, 0x24 ; 36 28ebc: 0e 94 bc 70 call 0xe178 ; 0xe178 28ec0: e7 96 adiw r28, 0x37 ; 55 28ec2: ee ad ldd r30, Y+62 ; 0x3e 28ec4: ff ad ldd r31, Y+63 ; 0x3f 28ec6: e7 97 sbiw r28, 0x37 ; 55 28ec8: 0f b6 in r0, 0x3f ; 63 28eca: f8 94 cli 28ecc: fe bf out 0x3e, r31 ; 62 28ece: 0f be out 0x3f, r0 ; 63 28ed0: 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()) { 28ed2: f6 01 movw r30, r12 28ed4: 80 85 ldd r24, Z+8 ; 0x08 28ed6: 91 85 ldd r25, Z+9 ; 0x09 28ed8: a2 85 ldd r26, Z+10 ; 0x0a 28eda: b3 85 ldd r27, Z+11 ; 0x0b 28edc: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28ee0: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28ee4: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28ee8: b0 93 80 13 sts 0x1380, r27 ; 0x801380 28eec: 8c ce rjmp .-744 ; 0x28c06 // 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; 28eee: e1 e0 ldi r30, 0x01 ; 1 28ef0: f0 e0 ldi r31, 0x00 ; 0 28ef2: 7d cf rjmp .-262 ; 0x28dee // 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); 28ef4: 81 e8 ldi r24, 0x81 ; 129 28ef6: 93 e1 ldi r25, 0x13 ; 19 28ef8: a7 cf rjmp .-178 ; 0x28e48 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 28efa: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28efe: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28f02: 01 96 adiw r24, 0x01 ; 1 28f04: 90 93 83 16 sts 0x1683, r25 ; 0x801683 28f08: 80 93 82 16 sts 0x1682, r24 ; 0x801682 28f0c: e2 cf rjmp .-60 ; 0x28ed2 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28f0e: 8c e6 ldi r24, 0x6C ; 108 28f10: 93 e1 ldi r25, 0x13 ; 19 28f12: 45 cf rjmp .-374 ; 0x28d9e manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 28f14: be 01 movw r22, r28 28f16: 69 5b subi r22, 0xB9 ; 185 28f18: 7f 4f sbci r23, 0xFF ; 255 28f1a: 8c e6 ldi r24, 0x6C ; 108 28f1c: 93 e1 ldi r25, 0x13 ; 19 28f1e: 0e 94 a1 70 call 0xe142 ; 0xe142 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 28f22: a1 96 adiw r28, 0x21 ; 33 28f24: 2e ad ldd r18, Y+62 ; 0x3e 28f26: 3f ad ldd r19, Y+63 ; 0x3f 28f28: a1 97 sbiw r28, 0x21 ; 33 28f2a: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28f2e: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28f32: 6f 96 adiw r28, 0x1f ; 31 28f34: 4e ad ldd r20, Y+62 ; 0x3e 28f36: 5f ad ldd r21, Y+63 ; 0x3f 28f38: 6f 97 sbiw r28, 0x1f ; 31 28f3a: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28f3e: 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 ) ){ 28f42: 69 96 adiw r28, 0x19 ; 25 28f44: 8e ad ldd r24, Y+62 ; 0x3e 28f46: 9f ad ldd r25, Y+63 ; 0x3f 28f48: 69 97 sbiw r28, 0x19 ; 25 28f4a: 28 17 cp r18, r24 28f4c: 39 07 cpc r19, r25 28f4e: 50 f0 brcs .+20 ; 0x28f64 28f50: 28 17 cp r18, r24 28f52: 39 07 cpc r19, r25 28f54: 99 f4 brne .+38 ; 0x28f7c 28f56: 67 96 adiw r28, 0x17 ; 23 28f58: 2e ad ldd r18, Y+62 ; 0x3e 28f5a: 3f ad ldd r19, Y+63 ; 0x3f 28f5c: 67 97 sbiw r28, 0x17 ; 23 28f5e: 42 17 cp r20, r18 28f60: 53 07 cpc r21, r19 28f62: 60 f4 brcc .+24 ; 0x28f7c crmodDate = p.creationDate; 28f64: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28f68: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28f6c: 67 96 adiw r28, 0x17 ; 23 28f6e: 8e ad ldd r24, Y+62 ; 0x3e 28f70: 9f ad ldd r25, Y+63 ; 0x3f 28f72: 67 97 sbiw r28, 0x17 ; 23 28f74: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28f78: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } //writeDate = p.lastAccessDate; if (match != NULL) { 28f7c: 61 14 cp r6, r1 28f7e: 71 04 cpc r7, r1 28f80: 59 f1 breq .+86 ; 0x28fd8 if (strcasecmp(match, filename) == 0) return; 28f82: 6c e6 ldi r22, 0x6C ; 108 28f84: 73 e1 ldi r23, 0x13 ; 19 28f86: c3 01 movw r24, r6 28f88: 0f 94 75 a7 call 0x34eea ; 0x34eea 28f8c: 89 2b or r24, r25 28f8e: 59 f5 brne .+86 ; 0x28fe6 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 28f90: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28f94: 81 50 subi r24, 0x01 ; 1 28f96: 80 93 d8 0d sts 0x0DD8, r24 ; 0x800dd8 cnt++; break; } } } // while readDir } 28f9a: 0f b6 in r0, 0x3f ; 63 28f9c: f8 94 cli 28f9e: 3e be out 0x3e, r3 ; 62 28fa0: 0f be out 0x3f, r0 ; 63 28fa2: 2d be out 0x3d, r2 ; 61 28fa4: ca 58 subi r28, 0x8A ; 138 28fa6: df 4f sbci r29, 0xFF ; 255 28fa8: 0f b6 in r0, 0x3f ; 63 28faa: f8 94 cli 28fac: de bf out 0x3e, r29 ; 62 28fae: 0f be out 0x3f, r0 ; 63 28fb0: cd bf out 0x3d, r28 ; 61 28fb2: df 91 pop r29 28fb4: cf 91 pop r28 28fb6: 1f 91 pop r17 28fb8: 0f 91 pop r16 28fba: ff 90 pop r15 28fbc: ef 90 pop r14 28fbe: df 90 pop r13 28fc0: cf 90 pop r12 28fc2: bf 90 pop r11 28fc4: af 90 pop r10 28fc6: 9f 90 pop r9 28fc8: 8f 90 pop r8 28fca: 7f 90 pop r7 28fcc: 6f 90 pop r6 28fce: 5f 90 pop r5 28fd0: 4f 90 pop r4 28fd2: 3f 90 pop r3 28fd4: 2f 90 pop r2 28fd6: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 28fd8: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28fdc: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28fe0: 48 16 cp r4, r24 28fe2: 19 06 cpc r1, r25 28fe4: a9 f2 breq .-86 ; 0x28f90 cnt++; 28fe6: 43 94 inc r4 28fe8: 74 cf rjmp .-280 ; 0x28ed2 00028fea : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 28fea: cf 92 push r12 28fec: df 92 push r13 28fee: ef 92 push r14 28ff0: ff 92 push r15 28ff2: 0f 93 push r16 28ff4: cf 93 push r28 28ff6: df 93 push r29 28ff8: cd b7 in r28, 0x3d ; 61 28ffa: de b7 in r29, 0x3e ; 62 28ffc: a3 97 sbiw r28, 0x23 ; 35 28ffe: 0f b6 in r0, 0x3f ; 63 29000: f8 94 cli 29002: de bf out 0x3e, r29 ; 62 29004: 0f be out 0x3f, r0 ; 63 29006: cd bf out 0x3d, r28 ; 61 29008: 6c 01 movw r12, r24 { curDir=&workDir; 2900a: 83 e1 ldi r24, 0x13 ; 19 2900c: e8 2e mov r14, r24 2900e: 84 e1 ldi r24, 0x14 ; 20 29010: f8 2e mov r15, r24 29012: 85 e1 ldi r24, 0x15 ; 21 29014: 94 e1 ldi r25, 0x14 ; 20 29016: d7 01 movw r26, r14 29018: 8d 93 st X+, r24 2901a: 9c 93 st X, r25 nrFiles=nr; 2901c: 10 92 83 16 sts 0x1683, r1 ; 0x801683 29020: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->rewind(); 29024: 0e 94 b7 70 call 0xe16e ; 0xe16e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 29028: 00 e0 ldi r16, 0x00 ; 0 2902a: 0e 7f andi r16, 0xFE ; 254 2902c: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2902e: d7 01 movw r26, r14 29030: ed 91 ld r30, X+ 29032: fc 91 ld r31, X 29034: 83 e2 ldi r24, 0x23 ; 35 29036: de 01 movw r26, r28 29038: 11 96 adiw r26, 0x01 ; 1 2903a: 01 90 ld r0, Z+ 2903c: 0d 92 st X+, r0 2903e: 8a 95 dec r24 29040: e1 f7 brne .-8 ; 0x2903a 29042: 22 e0 ldi r18, 0x02 ; 2 29044: a6 01 movw r20, r12 29046: be 01 movw r22, r28 29048: 6f 5f subi r22, 0xFF ; 255 2904a: 7f 4f sbci r23, 0xFF ; 255 2904c: 8a ed ldi r24, 0xDA ; 218 2904e: 92 e0 ldi r25, 0x02 ; 2 29050: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 29054: ce 01 movw r24, r28 29056: 01 96 adiw r24, 0x01 ; 1 29058: 0e 94 bc 70 call 0xe178 ; 0xe178 } 2905c: a3 96 adiw r28, 0x23 ; 35 2905e: 0f b6 in r0, 0x3f ; 63 29060: f8 94 cli 29062: de bf out 0x3e, r29 ; 62 29064: 0f be out 0x3f, r0 ; 63 29066: cd bf out 0x3d, r28 ; 61 29068: df 91 pop r29 2906a: cf 91 pop r28 2906c: 0f 91 pop r16 2906e: ff 90 pop r15 29070: ef 90 pop r14 29072: df 90 pop r13 29074: cf 90 pop r12 29076: 08 95 ret 00029078 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 29078: ef 92 push r14 2907a: ff 92 push r15 2907c: 0f 93 push r16 2907e: cf 93 push r28 29080: df 93 push r29 29082: cd b7 in r28, 0x3d ; 61 29084: de b7 in r29, 0x3e ; 62 29086: a3 97 sbiw r28, 0x23 ; 35 29088: 0f b6 in r0, 0x3f ; 63 2908a: f8 94 cli 2908c: de bf out 0x3e, r29 ; 62 2908e: 0f be out 0x3f, r0 ; 63 29090: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 29092: 23 e1 ldi r18, 0x13 ; 19 29094: e2 2e mov r14, r18 29096: 24 e1 ldi r18, 0x14 ; 20 29098: f2 2e mov r15, r18 2909a: 25 e1 ldi r18, 0x15 ; 21 2909c: 34 e1 ldi r19, 0x14 ; 20 2909e: d7 01 movw r26, r14 290a0: 2d 93 st X+, r18 290a2: 3c 93 st X, r19 nrFiles = 0; 290a4: 10 92 83 16 sts 0x1683, r1 ; 0x801683 290a8: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->seekSet((uint32_t)entry << 5); 290ac: b0 e0 ldi r27, 0x00 ; 0 290ae: a0 e0 ldi r26, 0x00 ; 0 290b0: ac 01 movw r20, r24 290b2: bd 01 movw r22, r26 290b4: e5 e0 ldi r30, 0x05 ; 5 290b6: 44 0f add r20, r20 290b8: 55 1f adc r21, r21 290ba: 66 1f adc r22, r22 290bc: 77 1f adc r23, r23 290be: ea 95 dec r30 290c0: d1 f7 brne .-12 ; 0x290b6 290c2: c9 01 movw r24, r18 290c4: 0f 94 93 39 call 0x27326 ; 0x27326 290c8: 00 e0 ldi r16, 0x00 ; 0 290ca: 0e 7f andi r16, 0xFE ; 254 290cc: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 290ce: d7 01 movw r26, r14 290d0: ed 91 ld r30, X+ 290d2: fc 91 ld r31, X 290d4: 83 e2 ldi r24, 0x23 ; 35 290d6: de 01 movw r26, r28 290d8: 11 96 adiw r26, 0x01 ; 1 290da: 01 90 ld r0, Z+ 290dc: 0d 92 st X+, r0 290de: 8a 95 dec r24 290e0: e1 f7 brne .-8 ; 0x290da 290e2: 22 e0 ldi r18, 0x02 ; 2 290e4: 50 e0 ldi r21, 0x00 ; 0 290e6: 40 e0 ldi r20, 0x00 ; 0 290e8: be 01 movw r22, r28 290ea: 6f 5f subi r22, 0xFF ; 255 290ec: 7f 4f sbci r23, 0xFF ; 255 290ee: 8a ed ldi r24, 0xDA ; 218 290f0: 92 e0 ldi r25, 0x02 ; 2 290f2: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 290f6: ce 01 movw r24, r28 290f8: 01 96 adiw r24, 0x01 ; 1 290fa: 0e 94 bc 70 call 0xe178 ; 0xe178 } 290fe: a3 96 adiw r28, 0x23 ; 35 29100: 0f b6 in r0, 0x3f ; 63 29102: f8 94 cli 29104: de bf out 0x3e, r29 ; 62 29106: 0f be out 0x3f, r0 ; 63 29108: cd bf out 0x3d, r28 ; 61 2910a: df 91 pop r29 2910c: cf 91 pop r28 2910e: 0f 91 pop r16 29110: ff 90 pop r15 29112: ef 90 pop r14 29114: 08 95 ret 00029116 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 29116: cf 92 push r12 29118: df 92 push r13 2911a: ef 92 push r14 2911c: ff 92 push r15 2911e: 0f 93 push r16 29120: cf 93 push r28 29122: df 93 push r29 29124: cd b7 in r28, 0x3d ; 61 29126: de b7 in r29, 0x3e ; 62 29128: a3 97 sbiw r28, 0x23 ; 35 2912a: 0f b6 in r0, 0x3f ; 63 2912c: f8 94 cli 2912e: de bf out 0x3e, r29 ; 62 29130: 0f be out 0x3f, r0 ; 63 29132: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 29134: 83 e1 ldi r24, 0x13 ; 19 29136: c8 2e mov r12, r24 29138: 84 e1 ldi r24, 0x14 ; 20 2913a: d8 2e mov r13, r24 2913c: 85 e1 ldi r24, 0x15 ; 21 2913e: 94 e1 ldi r25, 0x14 ; 20 29140: d6 01 movw r26, r12 29142: 8d 93 st X+, r24 29144: 9c 93 st X, r25 nrFiles=0; 29146: 22 e8 ldi r18, 0x82 ; 130 29148: e2 2e mov r14, r18 2914a: 26 e1 ldi r18, 0x16 ; 22 2914c: f2 2e mov r15, r18 2914e: f7 01 movw r30, r14 29150: 11 82 std Z+1, r1 ; 0x01 29152: 10 82 st Z, r1 curDir->rewind(); 29154: 0e 94 b7 70 call 0xe16e ; 0xe16e 29158: 00 e0 ldi r16, 0x00 ; 0 2915a: 0e 7f andi r16, 0xFE ; 254 2915c: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2915e: d6 01 movw r26, r12 29160: ed 91 ld r30, X+ 29162: fc 91 ld r31, X 29164: 83 e2 ldi r24, 0x23 ; 35 29166: de 01 movw r26, r28 29168: 11 96 adiw r26, 0x01 ; 1 2916a: 01 90 ld r0, Z+ 2916c: 0d 92 st X+, r0 2916e: 8a 95 dec r24 29170: e1 f7 brne .-8 ; 0x2916a 29172: 21 e0 ldi r18, 0x01 ; 1 29174: 50 e0 ldi r21, 0x00 ; 0 29176: 40 e0 ldi r20, 0x00 ; 0 29178: be 01 movw r22, r28 2917a: 6f 5f subi r22, 0xFF ; 255 2917c: 7f 4f sbci r23, 0xFF ; 255 2917e: 8a ed ldi r24, 0xDA ; 218 29180: 92 e0 ldi r25, 0x02 ; 2 29182: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 29186: ce 01 movw r24, r28 29188: 01 96 adiw r24, 0x01 ; 1 2918a: 0e 94 bc 70 call 0xe178 ; 0xe178 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2918e: f7 01 movw r30, r14 29190: 80 81 ld r24, Z 29192: 91 81 ldd r25, Z+1 ; 0x01 29194: a3 96 adiw r28, 0x23 ; 35 29196: 0f b6 in r0, 0x3f ; 63 29198: f8 94 cli 2919a: de bf out 0x3e, r29 ; 62 2919c: 0f be out 0x3f, r0 ; 63 2919e: cd bf out 0x3d, r28 ; 61 291a0: df 91 pop r29 291a2: cf 91 pop r28 291a4: 0f 91 pop r16 291a6: ff 90 pop r15 291a8: ef 90 pop r14 291aa: df 90 pop r13 291ac: cf 90 pop r12 291ae: 08 95 ret 000291b0 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 291b0: cf 93 push r28 291b2: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 291b4: 8f e2 ldi r24, 0x2F ; 47 291b6: 0e 94 c2 70 call 0xe184 ; 0xe184 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 291ba: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 291bc: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 291be: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 291c2: c8 17 cp r28, r24 291c4: 60 f4 brcc .+24 ; 0x291de { SERIAL_PROTOCOL(dir_names[i]); 291c6: cd 9f mul r28, r29 291c8: c0 01 movw r24, r0 291ca: 11 24 eor r1, r1 291cc: 86 54 subi r24, 0x46 ; 70 291ce: 9c 4e sbci r25, 0xEC ; 236 291d0: 0e 94 2b 7d call 0xfa56 ; 0xfa56 291d4: 8f e2 ldi r24, 0x2F ; 47 291d6: 0e 94 c2 70 call 0xe184 ; 0xe184 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 291da: cf 5f subi r28, 0xFF ; 255 291dc: f0 cf rjmp .-32 ; 0x291be { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 291de: 80 91 81 13 lds r24, 0x1381 ; 0x801381 291e2: 81 11 cpse r24, r1 291e4: 06 c0 rjmp .+12 ; 0x291f2 291e6: 8c e6 ldi r24, 0x6C ; 108 291e8: 93 e1 ldi r25, 0x13 ; 19 } 291ea: df 91 pop r29 291ec: cf 91 pop r28 291ee: 0c 94 2b 7d jmp 0xfa56 ; 0xfa56 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 291f2: 81 e8 ldi r24, 0x81 ; 129 291f4: 93 e1 ldi r25, 0x13 ; 19 291f6: f9 cf rjmp .-14 ; 0x291ea 000291f8 : 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) { 291f8: cf 92 push r12 291fa: df 92 push r13 291fc: ef 92 push r14 291fe: ff 92 push r15 29200: 6b 01 movw r12, r22 29202: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 29204: 88 ea ldi r24, 0xA8 ; 168 29206: 9c e0 ldi r25, 0x0C ; 12 29208: 0f 94 44 a1 call 0x34288 ; 0x34288 2920c: ab 01 movw r20, r22 2920e: bc 01 movw r22, r24 29210: 4c 0d add r20, r12 29212: 5d 1d adc r21, r13 29214: 6e 1d adc r22, r14 29216: 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); 29218: 88 ea ldi r24, 0xA8 ; 168 2921a: 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); } 2921c: ff 90 pop r15 2921e: ef 90 pop r14 29220: df 90 pop r13 29222: 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); 29224: 0d 94 92 a1 jmp 0x34324 ; 0x34324 00029228 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 29228: cf 93 push r28 2922a: df 93 push r29 2922c: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2922e: 0f 94 44 a1 call 0x34288 ; 0x34288 if (val == EEPROM_EMPTY_VALUE32) { 29232: 6f 3f cpi r22, 0xFF ; 255 29234: 2f ef ldi r18, 0xFF ; 255 29236: 72 07 cpc r23, r18 29238: 82 07 cpc r24, r18 2923a: 92 07 cpc r25, r18 2923c: 49 f4 brne .+18 ; 0x29250 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); 2923e: 40 e0 ldi r20, 0x00 ; 0 29240: 50 e0 ldi r21, 0x00 ; 0 29242: ba 01 movw r22, r20 29244: ce 01 movw r24, r28 29246: 0f 94 92 a1 call 0x34324 ; 0x34324 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; 2924a: 60 e0 ldi r22, 0x00 ; 0 2924c: 70 e0 ldi r23, 0x00 ; 0 2924e: cb 01 movw r24, r22 } return val; } 29250: df 91 pop r29 29252: cf 91 pop r28 29254: 08 95 ret 00029256 : : "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(){ 29256: 0f 93 push r16 29258: 1f 93 push r17 2925a: cf 93 push r28 2925c: df 93 push r29 if( ! gfEnsureBlock() ){ 2925e: 0f 94 0b 3f call 0x27e16 ; 0x27e16 29262: 88 23 and r24, r24 29264: 39 f1 breq .+78 ; 0x292b4 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; 29266: 20 91 15 16 lds r18, 0x1615 ; 0x801615 2926a: 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; 2926e: 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; 29270: 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 == ';' ){ 29272: 88 81 ld r24, Y 29274: 8b 33 cpi r24, 0x3B ; 59 29276: 51 f5 brne .+84 ; 0x292cc // 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); 29278: fe 01 movw r30, r28 0002927a : 2927a: 61 91 ld r22, Z+ 2927c: 6a 30 cpi r22, 0x0A ; 10 2927e: e9 f7 brne .-6 ; 0x2927a 29280: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 29282: cf 01 movw r24, r30 29284: 89 5d subi r24, 0xD9 ; 217 29286: 9d 40 sbci r25, 0x0D ; 13 29288: 81 30 cpi r24, 0x01 ; 1 2928a: 92 40 sbci r25, 0x02 ; 2 2928c: e4 f0 brlt .+56 ; 0x292c6 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 2928e: ce 01 movw r24, r28 29290: 82 1b sub r24, r18 29292: 93 0b sbc r25, r19 29294: 01 97 sbiw r24, 0x01 ; 1 29296: 0f 94 c4 3a call 0x27588 ; 0x27588 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2929a: 8a ef ldi r24, 0xFA ; 250 2929c: 95 e1 ldi r25, 0x15 ; 21 2929e: 0f 94 7d 38 call 0x270fa ; 0x270fa 292a2: 88 23 and r24, r24 292a4: 39 f0 breq .+14 ; 0x292b4 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 292a6: 0f 94 0b 3f call 0x27e16 ; 0x27e16 rdPtr = start = blockBuffBegin; 292aa: 29 ed ldi r18, 0xD9 ; 217 292ac: 3d e0 ldi r19, 0x0D ; 13 292ae: 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 292b0: 81 11 cpse r24, r1 292b2: e2 cf rjmp .-60 ; 0x29278 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 292b4: 89 ed ldi r24, 0xD9 ; 217 292b6: 9f e0 ldi r25, 0x0F ; 15 292b8: 90 93 16 16 sts 0x1616, r25 ; 0x801616 292bc: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return -1; 292c0: cf ef ldi r28, 0xFF ; 255 292c2: df ef ldi r29, 0xFF ; 255 292c4: 34 c0 rjmp .+104 ; 0x2932e 292c6: 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){ 292c8: c1 f5 brne .+112 ; 0x2933a // 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 292ca: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 292cc: ce 01 movw r24, r28 292ce: 82 1b sub r24, r18 292d0: 93 0b sbc r25, r19 292d2: 01 96 adiw r24, 0x01 ; 1 292d4: 0f 94 c4 3a call 0x27588 ; 0x27588 int16_t rv = *rdPtr++; 292d8: ce 01 movw r24, r28 292da: 01 96 adiw r24, 0x01 ; 1 292dc: c8 81 ld r28, Y 292de: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 292e0: 00 91 02 16 lds r16, 0x1602 ; 0x801602 292e4: 10 91 03 16 lds r17, 0x1603 ; 0x801603 292e8: 20 91 04 16 lds r18, 0x1604 ; 0x801604 292ec: 30 91 05 16 lds r19, 0x1605 ; 0x801605 292f0: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 292f4: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 292f8: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 292fc: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 29300: 04 17 cp r16, r20 29302: 15 07 cpc r17, r21 29304: 26 07 cpc r18, r22 29306: 37 07 cpc r19, r23 29308: a8 f6 brcc .-86 ; 0x292b4 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 2930a: 9c 01 movw r18, r24 2930c: 29 5d subi r18, 0xD9 ; 217 2930e: 3d 40 sbci r19, 0x0D ; 13 29310: 21 15 cp r18, r1 29312: 32 40 sbci r19, 0x02 ; 2 29314: 44 f0 brlt .+16 ; 0x29326 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 29316: 8a ef ldi r24, 0xFA ; 250 29318: 95 e1 ldi r25, 0x15 ; 21 2931a: 0f 94 7d 38 call 0x270fa ; 0x270fa 2931e: 88 23 and r24, r24 29320: 49 f2 breq .-110 ; 0x292b4 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 29322: 89 ed ldi r24, 0xD9 ; 217 29324: 9d e0 ldi r25, 0x0D ; 13 } // save the current read ptr for the next run gfReadPtr = rdPtr; 29326: 90 93 16 16 sts 0x1616, r25 ; 0x801616 2932a: 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; } 2932e: ce 01 movw r24, r28 29330: df 91 pop r29 29332: cf 91 pop r28 29334: 1f 91 pop r17 29336: 0f 91 pop r16 29338: 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 == ';' ){ 2933a: 88 81 ld r24, Y 2933c: 8b 33 cpi r24, 0x3B ; 59 2933e: 09 f4 brne .+2 ; 0x29342 29340: 98 cf rjmp .-208 ; 0x29272 29342: c3 cf rjmp .-122 ; 0x292ca 00029344 : * 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() { 29344: 2f 92 push r2 29346: 3f 92 push r3 29348: 4f 92 push r4 2934a: 5f 92 push r5 2934c: 6f 92 push r6 2934e: 7f 92 push r7 29350: 8f 92 push r8 29352: 9f 92 push r9 29354: af 92 push r10 29356: bf 92 push r11 29358: cf 92 push r12 2935a: df 92 push r13 2935c: ef 92 push r14 2935e: ff 92 push r15 29360: 0f 93 push r16 29362: 1f 93 push r17 29364: cf 93 push r28 29366: df 93 push r29 29368: cd b7 in r28, 0x3d ; 61 2936a: de b7 in r29, 0x3e ; 62 2936c: ed 97 sbiw r28, 0x3d ; 61 2936e: 0f b6 in r0, 0x3f ; 63 29370: f8 94 cli 29372: de bf out 0x3e, r29 ; 62 29374: 0f be out 0x3f, r0 ; 63 29376: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 29378: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 2937c: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b lastSortedFilePosition = 0; 29380: 10 92 d6 15 sts 0x15D6, r1 ; 0x8015d6 29384: 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 29388: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2938c: 80 fd sbrc r24, 0 2938e: f7 c0 rjmp .+494 ; 0x2957e uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 29390: 89 e0 ldi r24, 0x09 ; 9 29392: 9f e0 ldi r25, 0x0F ; 15 29394: 0f 94 3c a1 call 0x34278 ; 0x34278 29398: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2939a: 82 e0 ldi r24, 0x02 ; 2 2939c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 293a0: 0f 94 8b 48 call 0x29116 ; 0x29116 293a4: 6c 01 movw r12, r24 if (fileCnt > 0) { 293a6: 00 97 sbiw r24, 0x00 ; 0 293a8: 09 f4 brne .+2 ; 0x293ac 293aa: e6 c0 rjmp .+460 ; 0x29578 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 293ac: 85 36 cpi r24, 0x65 ; 101 293ae: 91 05 cpc r25, r1 293b0: 80 f0 brcs .+32 ; 0x293d2 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 293b2: 32 e0 ldi r19, 0x02 ; 2 293b4: 33 16 cp r3, r19 293b6: 51 f0 breq .+20 ; 0x293cc 293b8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 293bc: 81 11 cpse r24, r1 293be: 06 c0 rjmp .+12 ; 0x293cc lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 293c0: 8d e0 ldi r24, 0x0D ; 13 293c2: 9b e5 ldi r25, 0x5B ; 91 293c4: 0e 94 32 6d call 0xda64 ; 0xda64 293c8: 0f 94 7b 0b call 0x216f6 ; 0x216f6 } fileCnt = SDSORT_LIMIT; 293cc: f4 e6 ldi r31, 0x64 ; 100 293ce: cf 2e mov r12, r31 293d0: d1 2c mov r13, r1 } sort_count = fileCnt; 293d2: d0 92 0c 15 sts 0x150C, r13 ; 0x80150c 293d6: c0 92 0b 15 sts 0x150B, r12 ; 0x80150b 293da: 6d e0 ldi r22, 0x0D ; 13 293dc: 66 2e mov r6, r22 293de: 65 e1 ldi r22, 0x15 ; 21 293e0: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 293e2: f1 2c mov r15, r1 293e4: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 293e6: 75 e1 ldi r23, 0x15 ; 21 293e8: a7 2e mov r10, r23 293ea: 74 e1 ldi r23, 0x14 ; 20 293ec: b7 2e mov r11, r23 nrFiles = 1; 293ee: 88 24 eor r8, r8 293f0: 83 94 inc r8 293f2: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 293f4: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 293f8: 80 fd sbrc r24, 0 293fa: c1 c0 rjmp .+386 ; 0x2957e manage_heater(); 293fc: 0f 94 af 32 call 0x2655e ; 0x2655e if (i == 0) 29400: e1 14 cp r14, r1 29402: f1 04 cpc r15, r1 29404: 09 f0 breq .+2 ; 0x29408 29406: d4 c0 rjmp .+424 ; 0x295b0 getfilename(0); 29408: 90 e0 ldi r25, 0x00 ; 0 2940a: 80 e0 ldi r24, 0x00 ; 0 2940c: 0f 94 f5 47 call 0x28fea ; 0x28fea else getfilename_next(position); sort_entries[i] = position >> 5; 29410: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 29414: 90 91 7e 13 lds r25, 0x137E ; 0x80137e 29418: a0 91 7f 13 lds r26, 0x137F ; 0x80137f 2941c: b0 91 80 13 lds r27, 0x1380 ; 0x801380 29420: 55 e0 ldi r21, 0x05 ; 5 29422: b6 95 lsr r27 29424: a7 95 ror r26 29426: 97 95 ror r25 29428: 87 95 ror r24 2942a: 5a 95 dec r21 2942c: d1 f7 brne .-12 ; 0x29422 2942e: f3 01 movw r30, r6 29430: 81 93 st Z+, r24 29432: 91 93 st Z+, r25 29434: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 29436: ff ef ldi r31, 0xFF ; 255 29438: ef 1a sub r14, r31 2943a: ff 0a sbc r15, r31 2943c: ce 14 cp r12, r14 2943e: df 04 cpc r13, r15 29440: c9 f6 brne .-78 ; 0x293f4 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 29442: 21 e0 ldi r18, 0x01 ; 1 29444: e2 16 cp r14, r18 29446: f1 04 cpc r15, r1 29448: 09 f4 brne .+2 ; 0x2944c 2944a: 96 c0 rjmp .+300 ; 0x29578 2944c: 32 e0 ldi r19, 0x02 ; 2 2944e: 33 16 cp r3, r19 29450: 09 f4 brne .+2 ; 0x29454 29452: 92 c0 rjmp .+292 ; 0x29578 29454: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 29458: 21 11 cpse r18, r1 2945a: 8e c0 rjmp .+284 ; 0x29578 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2945c: 90 93 d6 15 sts 0x15D6, r25 ; 0x8015d6 29460: 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)); 29464: 8d ef ldi r24, 0xFD ; 253 29466: 9a e5 ldi r25, 0x5A ; 90 29468: 0e 94 32 6d call 0xda64 ; 0xda64 2946c: ee 9c mul r14, r14 2946e: 90 01 movw r18, r0 29470: ef 9c mul r14, r15 29472: 30 0d add r19, r0 29474: 30 0d add r19, r0 29476: 11 24 eor r1, r1 29478: bc 01 movw r22, r24 2947a: c9 01 movw r24, r18 2947c: 96 95 lsr r25 2947e: 87 95 ror r24 29480: 0f 94 7e 92 call 0x324fc ; 0x324fc 29484: 3f e0 ldi r19, 0x0F ; 15 29486: a3 2e mov r10, r19 29488: 35 e1 ldi r19, 0x15 ; 21 2948a: 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; 2948c: 91 2c mov r9, r1 2948e: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 29490: cc 24 eor r12, r12 29492: c3 94 inc r12 29494: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 29496: c4 01 movw r24, r8 29498: 0f 94 4f 92 call 0x3249e ; 0x3249e counter += i; 2949c: 8c 0c add r8, r12 2949e: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 294a0: f5 01 movw r30, r10 294a2: 01 90 ld r0, Z+ 294a4: f0 81 ld r31, Z 294a6: e0 2d mov r30, r0 294a8: f9 af std Y+57, r31 ; 0x39 294aa: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 294ac: cf 01 movw r24, r30 294ae: 0f 94 3c 48 call 0x29078 ; 0x29078 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 294b2: 80 91 81 13 lds r24, 0x1381 ; 0x801381 294b6: 6c e6 ldi r22, 0x6C ; 108 294b8: 73 e1 ldi r23, 0x13 ; 19 294ba: 88 23 and r24, r24 294bc: 11 f0 breq .+4 ; 0x294c2 294be: 61 e8 ldi r22, 0x81 ; 129 294c0: 73 e1 ldi r23, 0x13 ; 19 294c2: ce 01 movw r24, r28 294c4: 01 96 adiw r24, 0x01 ; 1 294c6: 0f 94 a7 a7 call 0x34f4e ; 0x34f4e crmod_date_bckp = crmodDate; 294ca: 60 90 7b 13 lds r6, 0x137B ; 0x80137b 294ce: 70 90 7c 13 lds r7, 0x137C ; 0x80137c crmod_time_bckp = crmodTime; 294d2: 20 91 79 13 lds r18, 0x1379 ; 0x801379 294d6: 30 91 7a 13 lds r19, 0x137A ; 0x80137a 294da: 3b af std Y+59, r19 ; 0x3b 294dc: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 294de: 20 90 b6 13 lds r2, 0x13B6 ; 0x8013b6 294e2: bf aa std Y+55, r11 ; 0x37 294e4: ae aa std Y+54, r10 ; 0x36 294e6: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 294e8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 294ec: 80 fd sbrc r24, 0 294ee: 47 c0 rjmp .+142 ; 0x2957e printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 294f0: 0f 94 af 32 call 0x2655e ; 0x2655e const uint16_t o2 = sort_entries[j - 1]; 294f4: c8 01 movw r24, r16 294f6: 01 97 sbiw r24, 0x01 ; 1 294f8: 9d af std Y+61, r25 ; 0x3d 294fa: 8c af std Y+60, r24 ; 0x3c 294fc: ee a9 ldd r30, Y+54 ; 0x36 294fe: ff a9 ldd r31, Y+55 ; 0x37 29500: 52 90 ld r5, -Z 29502: 42 90 ld r4, -Z 29504: ff ab std Y+55, r31 ; 0x37 29506: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 29508: c2 01 movw r24, r4 2950a: 0f 94 3c 48 call 0x29078 ; 0x29078 char *name2 = LONGEST_FILENAME; // use the string in-place 2950e: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29512: 6c e6 ldi r22, 0x6C ; 108 29514: 73 e1 ldi r23, 0x13 ; 19 29516: 88 23 and r24, r24 29518: 11 f0 breq .+4 ; 0x2951e 2951a: 61 e8 ldi r22, 0x81 ; 129 2951c: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 2951e: 31 10 cpse r3, r1 29520: 8a c0 rjmp .+276 ; 0x29636 29522: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 29526: 28 12 cpse r2, r24 29528: 83 c0 rjmp .+262 ; 0x29630 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2952a: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 2952e: 90 91 7c 13 lds r25, 0x137C ; 0x80137c 29532: 68 16 cp r6, r24 29534: 79 06 cpc r7, r25 29536: 09 f0 breq .+2 ; 0x2953a 29538: 6c c0 rjmp .+216 ; 0x29612 2953a: 80 91 79 13 lds r24, 0x1379 ; 0x801379 2953e: 90 91 7a 13 lds r25, 0x137A ; 0x80137a 29542: 2a ad ldd r18, Y+58 ; 0x3a 29544: 3b ad ldd r19, Y+59 ; 0x3b 29546: 82 17 cp r24, r18 29548: 93 07 cpc r25, r19 2954a: 08 f0 brcs .+2 ; 0x2954e 2954c: 66 c0 rjmp .+204 ; 0x2961a #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2954e: 00 0f add r16, r16 29550: 11 1f adc r17, r17 29552: f8 01 movw r30, r16 29554: e3 5f subi r30, 0xF3 ; 243 29556: fa 4e sbci r31, 0xEA ; 234 29558: 28 ad ldd r18, Y+56 ; 0x38 2955a: 39 ad ldd r19, Y+57 ; 0x39 2955c: 31 83 std Z+1, r19 ; 0x01 2955e: 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){ 29560: 3f ef ldi r19, 0xFF ; 255 29562: c3 1a sub r12, r19 29564: d3 0a sbc r13, r19 29566: 82 e0 ldi r24, 0x02 ; 2 29568: a8 0e add r10, r24 2956a: b1 1c adc r11, r1 2956c: ec 14 cp r14, r12 2956e: fd 04 cpc r15, r13 29570: 09 f0 breq .+2 ; 0x29574 29572: 91 cf rjmp .-222 ; 0x29496 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 29574: 0f 94 70 92 call 0x324e0 ; 0x324e0 } } KEEPALIVE_STATE(NOT_BUSY); 29578: 81 e0 ldi r24, 0x01 ; 1 2957a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 2957e: ed 96 adiw r28, 0x3d ; 61 29580: 0f b6 in r0, 0x3f ; 63 29582: f8 94 cli 29584: de bf out 0x3e, r29 ; 62 29586: 0f be out 0x3f, r0 ; 63 29588: cd bf out 0x3d, r28 ; 61 2958a: df 91 pop r29 2958c: cf 91 pop r28 2958e: 1f 91 pop r17 29590: 0f 91 pop r16 29592: ff 90 pop r15 29594: ef 90 pop r14 29596: df 90 pop r13 29598: cf 90 pop r12 2959a: bf 90 pop r11 2959c: af 90 pop r10 2959e: 9f 90 pop r9 295a0: 8f 90 pop r8 295a2: 7f 90 pop r7 295a4: 6f 90 pop r6 295a6: 5f 90 pop r5 295a8: 4f 90 pop r4 295aa: 3f 90 pop r3 295ac: 2f 90 pop r2 295ae: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 295b0: 40 91 7d 13 lds r20, 0x137D ; 0x80137d 295b4: 50 91 7e 13 lds r21, 0x137E ; 0x80137e 295b8: 60 91 7f 13 lds r22, 0x137F ; 0x80137f 295bc: 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; 295c0: b0 92 14 14 sts 0x1414, r11 ; 0x801414 295c4: a0 92 13 14 sts 0x1413, r10 ; 0x801413 nrFiles = 1; 295c8: 90 92 83 16 sts 0x1683, r9 ; 0x801683 295cc: 80 92 82 16 sts 0x1682, r8 ; 0x801682 curDir->seekSet(position); 295d0: 85 e1 ldi r24, 0x15 ; 21 295d2: 94 e1 ldi r25, 0x14 ; 20 295d4: 0f 94 93 39 call 0x27326 ; 0x27326 295d8: 1e 7f andi r17, 0xFE ; 254 295da: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 295dc: e0 91 13 14 lds r30, 0x1413 ; 0x801413 295e0: f0 91 14 14 lds r31, 0x1414 ; 0x801414 295e4: 83 e2 ldi r24, 0x23 ; 35 295e6: de 01 movw r26, r28 295e8: 11 96 adiw r26, 0x01 ; 1 295ea: 01 90 ld r0, Z+ 295ec: 0d 92 st X+, r0 295ee: 8a 95 dec r24 295f0: e1 f7 brne .-8 ; 0x295ea 295f2: 01 2f mov r16, r17 295f4: 22 e0 ldi r18, 0x02 ; 2 295f6: 50 e0 ldi r21, 0x00 ; 0 295f8: 40 e0 ldi r20, 0x00 ; 0 295fa: be 01 movw r22, r28 295fc: 6f 5f subi r22, 0xFF ; 255 295fe: 7f 4f sbci r23, 0xFF ; 255 29600: 8a ed ldi r24, 0xDA ; 218 29602: 92 e0 ldi r25, 0x02 ; 2 29604: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 29608: ce 01 movw r24, r28 2960a: 01 96 adiw r24, 0x01 ; 1 2960c: 0e 94 bc 70 call 0xe178 ; 0xe178 29610: ff ce rjmp .-514 ; 0x29410 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)) 29612: 86 15 cp r24, r6 29614: 97 05 cpc r25, r7 29616: 08 f4 brcc .+2 ; 0x2961a 29618: 9a cf rjmp .-204 ; 0x2954e break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2961a: ee a9 ldd r30, Y+54 ; 0x36 2961c: ff a9 ldd r31, Y+55 ; 0x37 2961e: 53 82 std Z+3, r5 ; 0x03 29620: 42 82 std Z+2, r4 ; 0x02 29622: 0c ad ldd r16, Y+60 ; 0x3c 29624: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 29626: 01 15 cp r16, r1 29628: 11 05 cpc r17, r1 2962a: 09 f0 breq .+2 ; 0x2962e 2962c: 5d cf rjmp .-326 ; 0x294e8 2962e: 8f cf rjmp .-226 ; 0x2954e 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)) 29630: 22 20 and r2, r2 29632: 99 f3 breq .-26 ; 0x2961a 29634: 8c cf rjmp .-232 ; 0x2954e 29636: 31 e0 ldi r19, 0x01 ; 1 29638: 33 12 cpse r3, r19 2963a: ef cf rjmp .-34 ; 0x2961a getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2963c: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 29640: 28 12 cpse r2, r24 29642: 07 c0 rjmp .+14 ; 0x29652 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 29644: ce 01 movw r24, r28 29646: 01 96 adiw r24, 0x01 ; 1 29648: 0f 94 75 a7 call 0x34eea ; 0x34eea 2964c: 97 fd sbrc r25, 7 2964e: e5 cf rjmp .-54 ; 0x2961a 29650: 7e cf rjmp .-260 ; 0x2954e 29652: 21 10 cpse r2, r1 29654: e2 cf rjmp .-60 ; 0x2961a 29656: 7b cf rjmp .-266 ; 0x2954e 00029658 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 29658: cf 92 push r12 2965a: df 92 push r13 2965c: ef 92 push r14 2965e: ff 92 push r15 29660: 0f 93 push r16 29662: 1f 93 push r17 29664: cf 93 push r28 29666: df 93 push r29 29668: cd b7 in r28, 0x3d ; 61 2966a: de b7 in r29, 0x3e ; 62 2966c: a3 97 sbiw r28, 0x23 ; 35 2966e: 0f b6 in r0, 0x3f ; 63 29670: f8 94 cli 29672: de bf out 0x3e, r29 ; 62 29674: 0f be out 0x3f, r0 ; 63 29676: cd bf out 0x3d, r28 ; 61 29678: 7c 01 movw r14, r24 2967a: 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) {} 2967c: 19 82 std Y+1, r1 ; 0x01 2967e: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 29680: 80 91 18 14 lds r24, 0x1418 ; 0x801418 parent=&workDir; 29684: 95 e1 ldi r25, 0x15 ; 21 29686: c9 2e mov r12, r25 29688: 94 e1 ldi r25, 0x14 ; 20 2968a: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2968c: 81 11 cpse r24, r1 2968e: 04 c0 rjmp .+8 ; 0x29698 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 29690: 80 ef ldi r24, 0xF0 ; 240 29692: c8 2e mov r12, r24 29694: 83 e1 ldi r24, 0x13 ; 19 29696: 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); 29698: 21 e0 ldi r18, 0x01 ; 1 2969a: a7 01 movw r20, r14 2969c: b6 01 movw r22, r12 2969e: ce 01 movw r24, r28 296a0: 01 96 adiw r24, 0x01 ; 1 296a2: 0f 94 e9 9a call 0x335d2 ; 0x335d2 296a6: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 296a8: 88 23 and r24, r24 296aa: 21 f1 breq .+72 ; 0x296f4 296ac: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 296b0: 85 30 cpi r24, 0x05 ; 5 296b2: 00 f5 brcc .+64 ; 0x296f4 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 296b4: 29 e0 ldi r18, 0x09 ; 9 296b6: 82 9f mul r24, r18 296b8: c0 01 movw r24, r0 296ba: 11 24 eor r1, r1 296bc: b7 01 movw r22, r14 296be: 86 54 subi r24, 0x46 ; 70 296c0: 9c 4e sbci r25, 0xEC ; 236 296c2: 0f 94 a7 a7 call 0x34f4e ; 0x34f4e puts(relpath); 296c6: c7 01 movw r24, r14 296c8: 0f 94 cb a7 call 0x34f96 ; 0x34f96 if (workDirDepth < MAX_DIR_DEPTH) { 296cc: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 296d0: 86 30 cpi r24, 0x06 ; 6 296d2: 80 f1 brcs .+96 ; 0x29734 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 296d4: 83 e2 ldi r24, 0x23 ; 35 296d6: fe 01 movw r30, r28 296d8: 31 96 adiw r30, 0x01 ; 1 296da: a5 e1 ldi r26, 0x15 ; 21 296dc: b4 e1 ldi r27, 0x14 ; 20 296de: 01 90 ld r0, Z+ 296e0: 0d 92 st X+, r0 296e2: 8a 95 dec r24 296e4: e1 f7 brne .-8 ; 0x296de #ifdef SDCARD_SORT_ALPHA if (doPresort) 296e6: 00 23 and r16, r16 296e8: 09 f4 brne .+2 ; 0x296ec 296ea: 4c c0 rjmp .+152 ; 0x29784 presort(); 296ec: 0f 94 a2 49 call 0x29344 ; 0x29344 else presort_flag = true; #endif return 1; 296f0: 10 2f mov r17, r16 296f2: 0c c0 rjmp .+24 ; 0x2970c if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 296f4: 87 e7 ldi r24, 0x77 ; 119 296f6: 9e e9 ldi r25, 0x9E ; 158 296f8: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 296fc: 83 e7 ldi r24, 0x73 ; 115 296fe: 9c e6 ldi r25, 0x6C ; 108 29700: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(relpath); 29704: c7 01 movw r24, r14 29706: 0f 94 5d 9a call 0x334ba ; 0x334ba return 0; 2970a: 10 e0 ldi r17, 0x00 ; 0 2970c: ce 01 movw r24, r28 2970e: 01 96 adiw r24, 0x01 ; 1 29710: 0e 94 bc 70 call 0xe178 ; 0xe178 else presort_flag = true; #endif return 1; } } 29714: 81 2f mov r24, r17 29716: a3 96 adiw r28, 0x23 ; 35 29718: 0f b6 in r0, 0x3f ; 63 2971a: f8 94 cli 2971c: de bf out 0x3e, r29 ; 62 2971e: 0f be out 0x3f, r0 ; 63 29720: cd bf out 0x3d, r28 ; 61 29722: df 91 pop r29 29724: cf 91 pop r28 29726: 1f 91 pop r17 29728: 0f 91 pop r16 2972a: ff 90 pop r15 2972c: ef 90 pop r14 2972e: df 90 pop r13 29730: cf 90 pop r12 29732: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 29734: 8f 5f subi r24, 0xFF ; 255 29736: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDirParents[d+1] = workDirParents[d]; 2973a: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2973c: 81 50 subi r24, 0x01 ; 1 2973e: c8 f0 brcs .+50 ; 0x29772 workDirParents[d+1] = workDirParents[d]; 29740: 28 2f mov r18, r24 29742: 30 e0 ldi r19, 0x00 ; 0 29744: a9 01 movw r20, r18 29746: 4f 5f subi r20, 0xFF ; 255 29748: 5f 4f sbci r21, 0xFF ; 255 2974a: 94 9f mul r25, r20 2974c: d0 01 movw r26, r0 2974e: 95 9f mul r25, r21 29750: b0 0d add r27, r0 29752: 11 24 eor r1, r1 29754: a8 5c subi r26, 0xC8 ; 200 29756: bb 4e sbci r27, 0xEB ; 235 29758: 92 9f mul r25, r18 2975a: f0 01 movw r30, r0 2975c: 93 9f mul r25, r19 2975e: f0 0d add r31, r0 29760: 11 24 eor r1, r1 29762: e8 5c subi r30, 0xC8 ; 200 29764: fb 4e sbci r31, 0xEB ; 235 29766: 29 2f mov r18, r25 29768: 01 90 ld r0, Z+ 2976a: 0d 92 st X+, r0 2976c: 2a 95 dec r18 2976e: e1 f7 brne .-8 ; 0x29768 29770: e5 cf rjmp .-54 ; 0x2973c workDirParents[0]=*parent; 29772: 83 e2 ldi r24, 0x23 ; 35 29774: f6 01 movw r30, r12 29776: a8 e3 ldi r26, 0x38 ; 56 29778: b4 e1 ldi r27, 0x14 ; 20 2977a: 01 90 ld r0, Z+ 2977c: 0d 92 st X+, r0 2977e: 8a 95 dec r24 29780: e1 f7 brne .-8 ; 0x2977a 29782: a8 cf rjmp .-176 ; 0x296d4 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 29784: 81 e0 ldi r24, 0x01 ; 1 29786: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2978a: c0 cf rjmp .-128 ; 0x2970c 0002978c : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2978c: 93 e2 ldi r25, 0x23 ; 35 2978e: e0 ef ldi r30, 0xF0 ; 240 29790: f3 e1 ldi r31, 0x13 ; 19 29792: a5 e1 ldi r26, 0x15 ; 21 29794: b4 e1 ldi r27, 0x14 ; 20 29796: 01 90 ld r0, Z+ 29798: 0d 92 st X+, r0 2979a: 9a 95 dec r25 2979c: e1 f7 brne .-8 ; 0x29796 workDirDepth = 0; 2979e: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a curDir=&workDir; 297a2: 25 e1 ldi r18, 0x15 ; 21 297a4: 34 e1 ldi r19, 0x14 ; 20 297a6: 30 93 14 14 sts 0x1414, r19 ; 0x801414 297aa: 20 93 13 14 sts 0x1413, r18 ; 0x801413 #ifdef SDCARD_SORT_ALPHA if (doPresort) 297ae: 81 11 cpse r24, r1 presort(); 297b0: 0d 94 a2 49 jmp 0x29344 ; 0x29344 else presort_flag = true; 297b4: 81 e0 ldi r24, 0x01 ; 1 297b6: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 #endif } 297ba: 08 95 ret 000297bc : * * @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) 297bc: 8f 92 push r8 297be: 9f 92 push r9 297c0: af 92 push r10 297c2: bf 92 push r11 297c4: cf 92 push r12 297c6: df 92 push r13 297c8: ef 92 push r14 297ca: ff 92 push r15 297cc: 0f 93 push r16 297ce: 1f 93 push r17 297d0: cf 93 push r28 297d2: df 93 push r29 297d4: cd b7 in r28, 0x3d ; 61 297d6: de b7 in r29, 0x3e ; 62 297d8: 2d 97 sbiw r28, 0x0d ; 13 297da: 0f b6 in r0, 0x3f ; 63 297dc: f8 94 cli 297de: de bf out 0x3e, r29 ; 62 297e0: 0f be out 0x3f, r0 ; 63 297e2: cd bf out 0x3d, r28 ; 61 { curDir=&root; 297e4: 20 ef ldi r18, 0xF0 ; 240 297e6: 33 e1 ldi r19, 0x13 ; 19 297e8: 30 93 14 14 sts 0x1414, r19 ; 0x801414 297ec: 20 93 13 14 sts 0x1413, r18 ; 0x801413 if (!fileName) 297f0: dc 01 movw r26, r24 297f2: ed 91 ld r30, X+ 297f4: fc 91 ld r31, X 297f6: 30 97 sbiw r30, 0x00 ; 0 297f8: a1 f4 brne .+40 ; 0x29822 } else //relative path { curDir = &workDir; } return 1; 297fa: 81 e0 ldi r24, 0x01 ; 1 } 297fc: 2d 96 adiw r28, 0x0d ; 13 297fe: 0f b6 in r0, 0x3f ; 63 29800: f8 94 cli 29802: de bf out 0x3e, r29 ; 62 29804: 0f be out 0x3f, r0 ; 63 29806: cd bf out 0x3d, r28 ; 61 29808: df 91 pop r29 2980a: cf 91 pop r28 2980c: 1f 91 pop r17 2980e: 0f 91 pop r16 29810: ff 90 pop r15 29812: ef 90 pop r14 29814: df 90 pop r13 29816: cf 90 pop r12 29818: bf 90 pop r11 2981a: af 90 pop r10 2981c: 9f 90 pop r9 2981e: 8f 90 pop r8 29820: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 29822: 20 81 ld r18, Z 29824: 2f 32 cpi r18, 0x2F ; 47 29826: 09 f0 breq .+2 ; 0x2982a 29828: 47 c0 rjmp .+142 ; 0x298b8 2982a: 6c 01 movw r12, r24 { cdroot(false); 2982c: 80 e0 ldi r24, 0x00 ; 0 2982e: 0f 94 c6 4b call 0x2978c ; 0x2978c dirname_start = fileName + 1; 29832: f6 01 movw r30, r12 29834: 00 81 ld r16, Z 29836: 11 81 ldd r17, Z+1 ; 0x01 29838: 0f 5f subi r16, 0xFF ; 255 2983a: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2983c: 95 e1 ldi r25, 0x15 ; 21 2983e: 89 2e mov r8, r25 29840: 94 e1 ldi r25, 0x14 ; 20 29842: 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) 29844: d8 01 movw r26, r16 29846: 8c 91 ld r24, X 29848: 88 23 and r24, r24 2984a: b9 f2 breq .-82 ; 0x297fa { dirname_end = strchr(dirname_start, '/'); 2984c: 6f e2 ldi r22, 0x2F ; 47 2984e: 70 e0 ldi r23, 0x00 ; 0 29850: c8 01 movw r24, r16 29852: 0f 94 93 a7 call 0x34f26 ; 0x34f26 29856: 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) 29858: 00 97 sbiw r24, 0x00 ; 0 2985a: 51 f1 breq .+84 ; 0x298b0 2985c: 08 17 cp r16, r24 2985e: 19 07 cpc r17, r25 29860: 38 f5 brcc .+78 ; 0x298b0 { 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); 29862: 7c 01 movw r14, r24 29864: e0 1a sub r14, r16 29866: f1 0a sbc r15, r17 29868: bd e0 ldi r27, 0x0D ; 13 2986a: eb 16 cp r14, r27 2986c: f1 04 cpc r15, r1 2986e: 18 f0 brcs .+6 ; 0x29876 29870: 8c e0 ldi r24, 0x0C ; 12 29872: e8 2e mov r14, r24 29874: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 29876: a7 01 movw r20, r14 29878: b8 01 movw r22, r16 2987a: ce 01 movw r24, r28 2987c: 01 96 adiw r24, 0x01 ; 1 2987e: 0f 94 bc a7 call 0x34f78 ; 0x34f78 subdirname[len] = 0; 29882: e1 e0 ldi r30, 0x01 ; 1 29884: f0 e0 ldi r31, 0x00 ; 0 29886: ec 0f add r30, r28 29888: fd 1f adc r31, r29 2988a: ee 0d add r30, r14 2988c: ff 1d adc r31, r15 2988e: 10 82 st Z, r1 if (!chdir(subdirname, false)) 29890: 60 e0 ldi r22, 0x00 ; 0 29892: ce 01 movw r24, r28 29894: 01 96 adiw r24, 0x01 ; 1 29896: 0f 94 2c 4b call 0x29658 ; 0x29658 2989a: 88 23 and r24, r24 2989c: 09 f4 brne .+2 ; 0x298a0 2989e: ae cf rjmp .-164 ; 0x297fc return 0; curDir = &workDir; 298a0: 90 92 14 14 sts 0x1414, r9 ; 0x801414 298a4: 80 92 13 14 sts 0x1413, r8 ; 0x801413 dirname_start = dirname_end + 1; 298a8: 85 01 movw r16, r10 298aa: 0f 5f subi r16, 0xFF ; 255 298ac: 1f 4f sbci r17, 0xFF ; 255 298ae: ca cf rjmp .-108 ; 0x29844 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 298b0: f6 01 movw r30, r12 298b2: 11 83 std Z+1, r17 ; 0x01 298b4: 00 83 st Z, r16 298b6: a1 cf rjmp .-190 ; 0x297fa } } else //relative path { curDir = &workDir; 298b8: 85 e1 ldi r24, 0x15 ; 21 298ba: 94 e1 ldi r25, 0x14 ; 20 298bc: 90 93 14 14 sts 0x1414, r25 ; 0x801414 298c0: 80 93 13 14 sts 0x1413, r24 ; 0x801413 298c4: 9a cf rjmp .-204 ; 0x297fa 000298c6 : 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*/){ 298c6: bf 92 push r11 298c8: cf 92 push r12 298ca: df 92 push r13 298cc: ef 92 push r14 298ce: ff 92 push r15 298d0: 0f 93 push r16 298d2: 1f 93 push r17 298d4: cf 93 push r28 298d6: df 93 push r29 298d8: 1f 92 push r1 298da: 1f 92 push r1 298dc: cd b7 in r28, 0x3d ; 61 298de: de b7 in r29, 0x3e ; 62 if(!mounted) 298e0: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 298e4: 22 23 and r18, r18 298e6: 09 f4 brne .+2 ; 0x298ea 298e8: ef c0 rjmp .+478 ; 0x29ac8 298ea: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 298ec: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 298f0: 88 23 and r24, r24 298f2: 09 f4 brne .+2 ; 0x298f6 298f4: 04 c1 rjmp .+520 ; 0x29afe if(!replace_current){ 298f6: 61 11 cpse r22, r1 298f8: f6 c0 rjmp .+492 ; 0x29ae6 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 298fa: d0 90 1d 16 lds r13, 0x161D ; 0x80161d 298fe: dd 20 and r13, r13 29900: 21 f0 breq .+8 ; 0x2990a // 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); 29902: 85 e8 ldi r24, 0x85 ; 133 29904: 9d e9 ldi r25, 0x9D ; 157 29906: 0e 94 60 73 call 0xe6c0 ; 0xe6c0 return; } SERIAL_ECHO_START; 2990a: 87 e7 ldi r24, 0x77 ; 119 2990c: 9e e9 ldi r25, 0x9E ; 158 2990e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(ofSubroutineCallTgt); 29912: 8c e6 ldi r24, 0x6C ; 108 29914: 9d e9 ldi r25, 0x9D ; 157 29916: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2991a: c7 01 movw r24, r14 2991c: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 29920: 81 e6 ldi r24, 0x61 ; 97 29922: 9d e9 ldi r25, 0x9D ; 157 29924: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 29928: 00 91 1d 16 lds r16, 0x161D ; 0x80161d 2992c: 25 e5 ldi r18, 0x55 ; 85 2992e: 02 9f mul r16, r18 29930: 80 01 movw r16, r0 29932: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 29934: 0e 5d subi r16, 0xDE ; 222 29936: 19 4e sbci r17, 0xE9 ; 233 29938: 8f e2 ldi r24, 0x2F ; 47 2993a: f8 01 movw r30, r16 2993c: 81 93 st Z+, r24 2993e: 8f 01 movw r16, r30 29940: cc 24 eor r12, r12 29942: c3 94 inc r12 for(uint8_t i=0;i 2994c: d8 16 cp r13, r24 2994e: b0 f4 brcc .+44 ; 0x2997c { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 29950: db 9c mul r13, r11 29952: c0 01 movw r24, r0 29954: 11 24 eor r1, r1 29956: b8 01 movw r22, r16 29958: 88 5c subi r24, 0xC8 ; 200 2995a: 9b 4e sbci r25, 0xEB ; 235 2995c: 0f 94 15 70 call 0x2e02a ; 0x2e02a 29960: c8 01 movw r24, r16 29962: 8c 01 movw r16, r24 29964: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 29966: f8 01 movw r30, r16 29968: 20 81 ld r18, Z 2996a: 22 23 and r18, r18 2996c: 29 f0 breq .+10 ; 0x29978 2996e: f4 e5 ldi r31, 0x54 ; 84 29970: fc 15 cp r31, r12 29972: 10 f0 brcs .+4 ; 0x29978 {t++;cnt++;} //crawl counter forward. 29974: c3 94 inc r12 29976: f5 cf rjmp .-22 ; 0x29962 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) 2997c: 27 e4 ldi r18, 0x47 ; 71 2997e: 2c 15 cp r18, r12 29980: 08 f4 brcc .+2 ; 0x29984 29982: ae c0 rjmp .+348 ; 0x29ae0 file.getFilename(t); 29984: b8 01 movw r22, r16 29986: 8a ef ldi r24, 0xFA ; 250 29988: 95 e1 ldi r25, 0x15 ; 21 2998a: 0f 94 15 70 call 0x2e02a ; 0x2e02a SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2998e: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29992: f5 e5 ldi r31, 0x55 ; 85 29994: 8f 9f mul r24, r31 29996: c0 01 movw r24, r0 29998: 11 24 eor r1, r1 2999a: 8e 5d subi r24, 0xDE ; 222 2999c: 99 4e sbci r25, 0xE9 ; 233 2999e: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHORPGM(ofPos); 299a2: 8b e5 ldi r24, 0x5B ; 91 299a4: 9d e9 ldi r25, 0x9D ; 157 299a6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 299aa: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 299ae: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 299b2: 80 91 80 16 lds r24, 0x1680 ; 0x801680 299b6: 90 91 81 16 lds r25, 0x1681 ; 0x801681 299ba: 4a e0 ldi r20, 0x0A ; 10 299bc: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 299c0: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 299c4: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 299c8: 24 e0 ldi r18, 0x04 ; 4 299ca: 82 9f mul r24, r18 299cc: f0 01 movw r30, r0 299ce: 11 24 eor r1, r1 299d0: e2 5e subi r30, 0xE2 ; 226 299d2: f9 4e sbci r31, 0xE9 ; 233 299d4: 40 91 7e 16 lds r20, 0x167E ; 0x80167e 299d8: 50 91 7f 16 lds r21, 0x167F ; 0x80167f 299dc: 60 91 80 16 lds r22, 0x1680 ; 0x801680 299e0: 70 91 81 16 lds r23, 0x1681 ; 0x801681 299e4: 40 83 st Z, r20 299e6: 51 83 std Z+1, r21 ; 0x01 299e8: 62 83 std Z+2, r22 ; 0x02 299ea: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 299ec: 8f 5f subi r24, 0xFF ; 255 299ee: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 299f2: 8a ef ldi r24, 0xFA ; 250 299f4: 95 e1 ldi r25, 0x15 ; 21 299f6: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 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; 299fa: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 299fe: fa 82 std Y+2, r15 ; 0x02 29a00: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 29a02: ce 01 movw r24, r28 29a04: 01 96 adiw r24, 0x01 ; 1 29a06: 0f 94 de 4b call 0x297bc ; 0x297bc 29a0a: 88 23 and r24, r24 29a0c: 09 f4 brne .+2 ; 0x29a10 29a0e: 5c c0 rjmp .+184 ; 0x29ac8 */ 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) ){ 29a10: 49 81 ldd r20, Y+1 ; 0x01 29a12: 5a 81 ldd r21, Y+2 ; 0x02 29a14: 60 91 13 14 lds r22, 0x1413 ; 0x801413 29a18: 70 91 14 14 lds r23, 0x1414 ; 0x801414 29a1c: 21 e0 ldi r18, 0x01 ; 1 29a1e: 8a ef ldi r24, 0xFA ; 250 29a20: 95 e1 ldi r25, 0x15 ; 21 29a22: 0f 94 e9 9a call 0x335d2 ; 0x335d2 29a26: 88 23 and r24, r24 29a28: 09 f4 brne .+2 ; 0x29a2c 29a2a: 77 c0 rjmp .+238 ; 0x29b1a // compute the block to start with if( ! gfComputeNextFileBlock() ) 29a2c: 8a ef ldi r24, 0xFA ; 250 29a2e: 95 e1 ldi r25, 0x15 ; 21 29a30: 0f 94 7d 38 call 0x270fa ; 0x270fa 29a34: 88 23 and r24, r24 29a36: 09 f4 brne .+2 ; 0x29a3a 29a38: 70 c0 rjmp .+224 ; 0x29b1a 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; 29a3a: 80 91 1b 16 lds r24, 0x161B ; 0x80161b 29a3e: 90 91 1c 16 lds r25, 0x161C ; 0x80161c 29a42: 87 52 subi r24, 0x27 ; 39 29a44: 92 4f sbci r25, 0xF2 ; 242 29a46: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29a4a: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 29a4e: 89 81 ldd r24, Y+1 ; 0x01 29a50: 9a 81 ldd r25, Y+2 ; 0x02 29a52: 0f 94 f5 47 call 0x28fea ; 0x28fea filesize = file.fileSize(); 29a56: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 29a5a: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 29a5e: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 29a62: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 29a66: 80 93 77 16 sts 0x1677, r24 ; 0x801677 29a6a: 90 93 78 16 sts 0x1678, r25 ; 0x801678 29a6e: a0 93 79 16 sts 0x1679, r26 ; 0x801679 29a72: b0 93 7a 16 sts 0x167A, r27 ; 0x80167a SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 29a76: 8b e2 ldi r24, 0x2B ; 43 29a78: 9d e9 ldi r25, 0x9D ; 157 29a7a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 printAbsFilenameFast(); 29a7e: 0f 94 d8 48 call 0x291b0 ; 0x291b0 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 29a82: 83 e2 ldi r24, 0x23 ; 35 29a84: 9d e9 ldi r25, 0x9D ; 157 29a86: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 29a8a: 60 91 77 16 lds r22, 0x1677 ; 0x801677 29a8e: 70 91 78 16 lds r23, 0x1678 ; 0x801678 29a92: 80 91 79 16 lds r24, 0x1679 ; 0x801679 29a96: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 29a9a: 4a e0 ldi r20, 0x0A ; 10 29a9c: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29aa0: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 29aa4: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 29aa8: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 29aac: 10 92 80 16 sts 0x1680, r1 ; 0x801680 29ab0: 10 92 81 16 sts 0x1681, r1 ; 0x801681 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 29ab4: 85 e1 ldi r24, 0x15 ; 21 29ab6: 9d e9 ldi r25, 0x9D ; 157 29ab8: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_setstatuspgm(ofFileSelected); 29abc: 85 e1 ldi r24, 0x15 ; 21 29abe: 9d e9 ldi r25, 0x9D ; 157 29ac0: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 scrollstuff = 0; 29ac4: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 29ac8: 0f 90 pop r0 29aca: 0f 90 pop r0 29acc: df 91 pop r29 29ace: cf 91 pop r28 29ad0: 1f 91 pop r17 29ad2: 0f 91 pop r16 29ad4: ff 90 pop r15 29ad6: ef 90 pop r14 29ad8: df 90 pop r13 29ada: cf 90 pop r12 29adc: bf 90 pop r11 29ade: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 29ae0: f8 01 movw r30, r16 29ae2: 10 82 st Z, r1 29ae4: 54 cf rjmp .-344 ; 0x2998e SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 29ae6: 87 e7 ldi r24, 0x77 ; 119 29ae8: 9e e9 ldi r25, 0x9E ; 158 29aea: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(ofNowDoingFile); 29aee: 8a e4 ldi r24, 0x4A ; 74 29af0: 9d e9 ldi r25, 0x9D ; 157 29af2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(name); 29af6: c7 01 movw r24, r14 29af8: 0f 94 5d 9a call 0x334ba ; 0x334ba 29afc: 7a cf rjmp .-268 ; 0x299f2 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 29afe: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 29b02: 87 e7 ldi r24, 0x77 ; 119 29b04: 9e e9 ldi r25, 0x9E ; 158 29b06: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(ofNowFreshFile); 29b0a: 89 e3 ldi r24, 0x39 ; 57 29b0c: 9d e9 ldi r25, 0x9D ; 157 29b0e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(name); 29b12: c7 01 movw r24, r14 29b14: 0f 94 5d 9a call 0x334ba ; 0x334ba 29b18: 70 cf rjmp .-288 ; 0x299fa SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 29b1a: 8f e5 ldi r24, 0x5F ; 95 29b1c: 9c e6 ldi r25, 0x6C ; 108 29b1e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 29b22: 89 81 ldd r24, Y+1 ; 0x01 29b24: 9a 81 ldd r25, Y+2 ; 0x02 29b26: 0e 94 2b 7d call 0xfa56 ; 0xfa56 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29b2a: 8e e2 ldi r24, 0x2E ; 46 29b2c: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29b30: 0f 94 5c 99 call 0x332b8 ; 0x332b8 29b34: c9 cf rjmp .-110 ; 0x29ac8 00029b36 : void CardReader::printingHasFinished() { st_synchronize(); 29b36: 0f 94 a0 22 call 0x24540 ; 0x24540 file.close(); 29b3a: 8a ef ldi r24, 0xFA ; 250 29b3c: 95 e1 ldi r25, 0x15 ; 21 29b3e: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 29b42: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29b46: 88 23 and r24, r24 29b48: 69 f1 breq .+90 ; 0x29ba4 { file_subcall_ctr--; 29b4a: 81 50 subi r24, 0x01 ; 1 29b4c: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 29b50: 25 e5 ldi r18, 0x55 ; 85 29b52: 82 9f mul r24, r18 29b54: c0 01 movw r24, r0 29b56: 11 24 eor r1, r1 29b58: 61 e0 ldi r22, 0x01 ; 1 29b5a: 8e 5d subi r24, 0xDE ; 222 29b5c: 99 4e sbci r25, 0xE9 ; 233 29b5e: 0f 94 63 4c call 0x298c6 ; 0x298c6 setIndex(filespos[file_subcall_ctr]); 29b62: e0 91 1d 16 lds r30, 0x161D ; 0x80161d 29b66: 84 e0 ldi r24, 0x04 ; 4 29b68: e8 9f mul r30, r24 29b6a: f0 01 movw r30, r0 29b6c: 11 24 eor r1, r1 29b6e: e2 5e subi r30, 0xE2 ; 226 29b70: f9 4e sbci r31, 0xE9 ; 233 29b72: 60 81 ld r22, Z 29b74: 71 81 ldd r23, Z+1 ; 0x01 29b76: 82 81 ldd r24, Z+2 ; 0x02 29b78: 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);}; 29b7a: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 29b7e: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 29b82: 80 93 80 16 sts 0x1680, r24 ; 0x801680 29b86: 90 93 81 16 sts 0x1681, r25 ; 0x801681 29b8a: 0f 94 53 44 call 0x288a6 ; 0x288a6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 29b8e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29b92: 88 23 and r24, r24 29b94: 71 f0 breq .+28 ; 0x29bb2 { sdprinting = true; 29b96: 81 e0 ldi r24, 0x01 ; 1 29b98: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 29b9c: 85 e0 ldi r24, 0x05 ; 5 29b9e: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 29ba2: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 29ba4: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 29ba8: 83 e0 ldi r24, 0x03 ; 3 29baa: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 29bae: 0c 94 ba 74 jmp 0xe974 ; 0xe974 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 29bb2: 08 95 ret 00029bb4 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 29bb4: cf 92 push r12 29bb6: df 92 push r13 29bb8: ef 92 push r14 29bba: ff 92 push r15 29bbc: 0f 93 push r16 29bbe: 1f 93 push r17 29bc0: cf 93 push r28 29bc2: df 93 push r29 29bc4: 08 2f mov r16, r24 { mounted = false; 29bc6: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b if(root.isOpen()) 29bca: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 29bce: 88 23 and r24, r24 29bd0: 21 f0 breq .+8 ; 0x29bda root.close(); 29bd2: 80 ef ldi r24, 0xF0 ; 240 29bd4: 93 e1 ldi r25, 0x13 ; 19 29bd6: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 * \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; 29bda: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 29bde: 10 92 d7 15 sts 0x15D7, r1 ; 0x8015d7 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 29be2: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29be6: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 29be8: 0f 94 1d 42 call 0x2843a ; 0x2843a SET_OUTPUT(SDSS); 29bec: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 29bee: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 29bf0: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 29bf2: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 29bf4: 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); 29bf6: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 29bf8: 85 e0 ldi r24, 0x05 ; 5 29bfa: 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); 29bfe: 82 e5 ldi r24, 0x52 ; 82 29c00: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 29c02: 1d bc out 0x2d, r1 ; 45 29c04: 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); 29c06: 8f ef ldi r24, 0xFF ; 255 29c08: 0f 94 4a 71 call 0x2e294 ; 0x2e294 29c0c: 11 50 subi r17, 0x01 ; 1 29c0e: d9 f7 brne .-10 ; 0x29c06 WRITE(MISO, 1); // temporarily enable the MISO line pullup 29c10: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 29c12: 20 e0 ldi r18, 0x00 ; 0 29c14: 30 e0 ldi r19, 0x00 ; 0 29c16: a9 01 movw r20, r18 29c18: 60 e0 ldi r22, 0x00 ; 0 29c1a: 87 ed ldi r24, 0xD7 ; 215 29c1c: 95 e1 ldi r25, 0x15 ; 21 29c1e: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 29c22: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29c26: 81 30 cpi r24, 0x01 ; 1 29c28: 61 f0 breq .+24 ; 0x29c42 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29c2a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29c2e: 6c 1b sub r22, r28 29c30: 7d 0b sbc r23, r29 29c32: 61 3d cpi r22, 0xD1 ; 209 29c34: 77 40 sbci r23, 0x07 ; 7 29c36: 68 f3 brcs .-38 ; 0x29c12 WRITE(MISO, 0); // disable the MISO line pullup 29c38: 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;} 29c3a: 81 e0 ldi r24, 0x01 ; 1 29c3c: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 29c40: 22 c0 rjmp .+68 ; 0x29c86 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 29c42: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 29c44: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29c48: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 29c4a: 88 e0 ldi r24, 0x08 ; 8 29c4c: 9d e9 ldi r25, 0x9D ; 157 29c4e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 spiSend(0XFF); 29c52: 8f ef ldi r24, 0xFF ; 255 29c54: 0f 94 4a 71 call 0x2e294 ; 0x2e294 while ((status_ = spiRec()) != 0xFF) 29c58: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 29c5c: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29c60: 8f 3f cpi r24, 0xFF ; 255 29c62: 59 f1 breq .+86 ; 0x29cba { spiSend(0XFF); 29c64: 8f ef ldi r24, 0xFF ; 255 29c66: 0f 94 4a 71 call 0x2e294 ; 0x2e294 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 29c6a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29c6e: 6c 1b sub r22, r28 29c70: 7d 0b sbc r23, r29 29c72: 62 32 cpi r22, 0x22 ; 34 29c74: 71 05 cpc r23, r1 29c76: 80 f3 brcs .-32 ; 0x29c58 29c78: 82 e0 ldi r24, 0x02 ; 2 29c7a: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 29c7e: 87 ef ldi r24, 0xF7 ; 247 29c80: 9c e9 ldi r25, 0x9C ; 156 29c82: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 29c86: 0f 94 1d 42 call 0x2843a ; 0x2843a #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 29c8a: 87 e7 ldi r24, 0x77 ; 119 29c8c: 9e e9 ldi r25, 0x9E ; 158 29c8e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 29c92: 82 e5 ldi r24, 0x52 ; 82 29c94: 9c e6 ldi r25, 0x6C ; 108 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29c96: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 } if (mounted) 29c9a: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29c9e: 88 23 and r24, r24 29ca0: 09 f4 brne .+2 ; 0x29ca4 29ca2: 9a c0 rjmp .+308 ; 0x29dd8 { cdroot(doPresort); 29ca4: 80 2f mov r24, r16 } } 29ca6: df 91 pop r29 29ca8: cf 91 pop r28 29caa: 1f 91 pop r17 29cac: 0f 91 pop r16 29cae: ff 90 pop r15 29cb0: ef 90 pop r14 29cb2: df 90 pop r13 29cb4: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 29cb6: 0d 94 c6 4b jmp 0x2978c ; 0x2978c goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29cba: 2a ea ldi r18, 0xAA ; 170 29cbc: 31 e0 ldi r19, 0x01 ; 1 29cbe: 40 e0 ldi r20, 0x00 ; 0 29cc0: 50 e0 ldi r21, 0x00 ; 0 29cc2: 68 e0 ldi r22, 0x08 ; 8 29cc4: 87 ed ldi r24, 0xD7 ; 215 29cc6: 95 e1 ldi r25, 0x15 ; 21 29cc8: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 29ccc: 82 ff sbrs r24, 2 29cce: 2b c0 rjmp .+86 ; 0x29d26 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;} 29cd0: 81 e0 ldi r24, 0x01 ; 1 29cd2: 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; 29cd6: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29cda: c1 2c mov r12, r1 29cdc: d1 2c mov r13, r1 29cde: 76 01 movw r14, r12 29ce0: 82 30 cpi r24, 0x02 ; 2 29ce2: 29 f4 brne .+10 ; 0x29cee 29ce4: c1 2c mov r12, r1 29ce6: d1 2c mov r13, r1 29ce8: e1 2c mov r14, r1 29cea: 80 e4 ldi r24, 0x40 ; 64 29cec: 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); 29cee: 20 e0 ldi r18, 0x00 ; 0 29cf0: 30 e0 ldi r19, 0x00 ; 0 29cf2: a9 01 movw r20, r18 29cf4: 67 e3 ldi r22, 0x37 ; 55 29cf6: 87 ed ldi r24, 0xD7 ; 215 29cf8: 95 e1 ldi r25, 0x15 ; 21 29cfa: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac return cardCommand(cmd, arg); 29cfe: a7 01 movw r20, r14 29d00: 96 01 movw r18, r12 29d02: 69 e2 ldi r22, 0x29 ; 41 29d04: 87 ed ldi r24, 0xD7 ; 215 29d06: 95 e1 ldi r25, 0x15 ; 21 29d08: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 29d0c: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29d10: 88 23 and r24, r24 29d12: b1 f0 breq .+44 ; 0x29d40 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29d14: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29d18: 6c 1b sub r22, r28 29d1a: 7d 0b sbc r23, r29 29d1c: 61 3d cpi r22, 0xD1 ; 209 29d1e: 77 40 sbci r23, 0x07 ; 7 29d20: 30 f3 brcs .-52 ; 0x29cee bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29d22: 8a e0 ldi r24, 0x0A ; 10 29d24: 8b cf rjmp .-234 ; 0x29c3c goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29d26: 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(); 29d28: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 29d2c: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29d30: 11 50 subi r17, 0x01 ; 1 29d32: d1 f7 brne .-12 ; 0x29d28 if (status_ != 0XAA) { 29d34: 8a 3a cpi r24, 0xAA ; 170 29d36: 11 f0 breq .+4 ; 0x29d3c 29d38: 82 e0 ldi r24, 0x02 ; 2 29d3a: 80 cf rjmp .-256 ; 0x29c3c 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;} 29d3c: 82 e0 ldi r24, 0x02 ; 2 29d3e: c9 cf rjmp .-110 ; 0x29cd2 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 29d40: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29d44: 82 30 cpi r24, 0x02 ; 2 29d46: d1 f4 brne .+52 ; 0x29d7c if (cardCommand(CMD58, 0)) { 29d48: 20 e0 ldi r18, 0x00 ; 0 29d4a: 30 e0 ldi r19, 0x00 ; 0 29d4c: a9 01 movw r20, r18 29d4e: 6a e3 ldi r22, 0x3A ; 58 29d50: 87 ed ldi r24, 0xD7 ; 215 29d52: 95 e1 ldi r25, 0x15 ; 21 29d54: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 29d58: 88 23 and r24, r24 29d5a: 11 f0 breq .+4 ; 0x29d60 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29d5c: 88 e0 ldi r24, 0x08 ; 8 29d5e: 6e cf rjmp .-292 ; 0x29c3c error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 29d60: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 29d64: 80 7c andi r24, 0xC0 ; 192 29d66: 80 3c cpi r24, 0xC0 ; 192 29d68: 19 f4 brne .+6 ; 0x29d70 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;} 29d6a: 83 e0 ldi r24, 0x03 ; 3 29d6c: 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(); 29d70: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 29d74: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 29d78: 0f 94 4f 71 call 0x2e29e ; 0x2e29e } chipSelectHigh(); 29d7c: 0f 94 1d 42 call 0x2843a ; 0x2843a bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 29d80: 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);} 29d84: 81 e0 ldi r24, 0x01 ; 1 29d86: 0f 94 ba 3d call 0x27b74 ; 0x27b74 29d8a: 81 11 cpse r24, r1 29d8c: 0c c0 rjmp .+24 ; 0x29da6 29d8e: 80 e0 ldi r24, 0x00 ; 0 29d90: 0f 94 ba 3d call 0x27b74 ; 0x27b74 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 29d94: 81 11 cpse r24, r1 29d96: 07 c0 rjmp .+14 ; 0x29da6 { SERIAL_ERROR_START; 29d98: 8a e5 ldi r24, 0x5A ; 90 29d9a: 9e e9 ldi r25, 0x9E ; 158 29d9c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 29da0: 8f e3 ldi r24, 0x3F ; 63 29da2: 9c e6 ldi r25, 0x6C ; 108 29da4: 78 cf rjmp .-272 ; 0x29c96 } else if (!root.openRoot(&volume)) 29da6: 6c ed ldi r22, 0xDC ; 220 29da8: 75 e1 ldi r23, 0x15 ; 21 29daa: 80 ef ldi r24, 0xF0 ; 240 29dac: 93 e1 ldi r25, 0x13 ; 19 29dae: 0f 94 a2 6f call 0x2df44 ; 0x2df44 29db2: 81 11 cpse r24, r1 29db4: 07 c0 rjmp .+14 ; 0x29dc4 { SERIAL_ERROR_START; 29db6: 8a e5 ldi r24, 0x5A ; 90 29db8: 9e e9 ldi r25, 0x9E ; 158 29dba: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 29dbe: 8f e2 ldi r24, 0x2F ; 47 29dc0: 9c e6 ldi r25, 0x6C ; 108 29dc2: 69 cf rjmp .-302 ; 0x29c96 } else { mounted = true; 29dc4: 81 e0 ldi r24, 0x01 ; 1 29dc6: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b SERIAL_ECHO_START; 29dca: 87 e7 ldi r24, 0x77 ; 119 29dcc: 9e e9 ldi r25, 0x9E ; 158 29dce: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29dd2: 84 e2 ldi r24, 0x24 ; 36 29dd4: 9c e6 ldi r25, 0x6C ; 108 29dd6: 5f cf rjmp .-322 ; 0x29c96 if (mounted) { cdroot(doPresort); } } 29dd8: df 91 pop r29 29dda: cf 91 pop r28 29ddc: 1f 91 pop r17 29dde: 0f 91 pop r16 29de0: ff 90 pop r15 29de2: ef 90 pop r14 29de4: df 90 pop r13 29de6: cf 90 pop r12 29de8: 08 95 ret 00029dea : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 29dea: 4f 92 push r4 29dec: 5f 92 push r5 29dee: 6f 92 push r6 29df0: 7f 92 push r7 29df2: 8f 92 push r8 29df4: 9f 92 push r9 29df6: af 92 push r10 29df8: bf 92 push r11 29dfa: cf 92 push r12 29dfc: df 92 push r13 29dfe: ef 92 push r14 29e00: ff 92 push r15 29e02: 4b 01 movw r8, r22 29e04: 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]; 29e06: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29e0a: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29e0e: 07 2e mov r0, r23 29e10: 00 0c add r0, r0 29e12: 88 0b sbc r24, r24 29e14: 99 0b sbc r25, r25 29e16: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> if (!degTargetHotend(extruder)) 29e1a: 20 e0 ldi r18, 0x00 ; 0 29e1c: 30 e0 ldi r19, 0x00 ; 0 29e1e: a9 01 movw r20, r18 29e20: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 29e24: 88 23 and r24, r24 29e26: d1 f0 breq .+52 ; 0x29e5c #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; 29e28: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 29e2c: cc 24 eor r12, r12 29e2e: ca 94 dec r12 29e30: dc 2c mov r13, r12 29e32: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29e34: 98 ee ldi r25, 0xE8 ; 232 29e36: 49 2e mov r4, r25 29e38: 93 e0 ldi r25, 0x03 ; 3 29e3a: 59 2e mov r5, r25 29e3c: 61 2c mov r6, r1 29e3e: 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) || 29e40: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 29e44: 81 11 cpse r24, r1 29e46: 0a c0 rjmp .+20 ; 0x29e5c 29e48: 2f ef ldi r18, 0xFF ; 255 29e4a: c2 16 cp r12, r18 29e4c: d2 06 cpc r13, r18 29e4e: e2 06 cpc r14, r18 29e50: f2 06 cpc r15, r18 29e52: 89 f4 brne .+34 ; 0x29e76 (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) { 29e54: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 29e58: 82 30 cpi r24, 0x02 ; 2 29e5a: b9 f4 brne .+46 ; 0x29e8a { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 29e5c: ff 90 pop r15 29e5e: ef 90 pop r14 29e60: df 90 pop r13 29e62: cf 90 pop r12 29e64: bf 90 pop r11 29e66: af 90 pop r10 29e68: 9f 90 pop r9 29e6a: 8f 90 pop r8 29e6c: 7f 90 pop r7 29e6e: 6f 90 pop r6 29e70: 5f 90 pop r5 29e72: 4f 90 pop r4 29e74: 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) || 29e76: f7 fc sbrc r15, 7 29e78: f1 cf rjmp .-30 ; 0x29e5c (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 29e7a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29e7e: 6c 19 sub r22, r12 29e80: 7d 09 sbc r23, r13 29e82: 68 3b cpi r22, 0xB8 ; 184 29e84: 7b 40 sbci r23, 0x0B ; 11 29e86: 30 f3 brcs .-52 ; 0x29e54 29e88: e9 cf rjmp .-46 ; 0x29e5c 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) 29e8a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29e8e: 68 19 sub r22, r8 29e90: 79 09 sbc r23, r9 29e92: 8a 09 sbc r24, r10 29e94: 9b 09 sbc r25, r11 29e96: 69 3e cpi r22, 0xE9 ; 233 29e98: 73 40 sbci r23, 0x03 ; 3 29e9a: 81 05 cpc r24, r1 29e9c: 91 05 cpc r25, r1 29e9e: 08 f4 brcc .+2 ; 0x29ea2 29ea0: 42 c0 rjmp .+132 ; 0x29f26 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 29ea2: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29ea6: 81 11 cpse r24, r1 29ea8: 3a c0 rjmp .+116 ; 0x29f1e SERIAL_PROTOCOLPGM("T:"); 29eaa: 84 ef ldi r24, 0xF4 ; 244 29eac: 9c e9 ldi r25, 0x9C ; 156 29eae: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 29eb2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29eb6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29eba: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29ebe: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29ec2: 41 e0 ldi r20, 0x01 ; 1 29ec4: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 29ec8: 80 ef ldi r24, 0xF0 ; 240 29eca: 9c e9 ldi r25, 0x9C ; 156 29ecc: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 29ed0: 60 e0 ldi r22, 0x00 ; 0 29ed2: 70 e0 ldi r23, 0x00 ; 0 29ed4: cb 01 movw r24, r22 29ed6: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 29eda: 8c ee ldi r24, 0xEC ; 236 29edc: 9c e9 ldi r25, 0x9C ; 156 29ede: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (residencyStart > -1) 29ee2: f7 fc sbrc r15, 7 29ee4: 52 c0 rjmp .+164 ; 0x29f8a { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29ee6: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29eea: 46 01 movw r8, r12 29eec: 57 01 movw r10, r14 29eee: 58 eb ldi r21, 0xB8 ; 184 29ef0: 85 0e add r8, r21 29ef2: 5b e0 ldi r21, 0x0B ; 11 29ef4: 95 1e adc r9, r21 29ef6: a1 1c adc r10, r1 29ef8: b1 1c adc r11, r1 29efa: a5 01 movw r20, r10 29efc: 94 01 movw r18, r8 29efe: 26 1b sub r18, r22 29f00: 37 0b sbc r19, r23 29f02: 48 0b sbc r20, r24 29f04: 59 0b sbc r21, r25 29f06: ca 01 movw r24, r20 29f08: b9 01 movw r22, r18 29f0a: a3 01 movw r20, r6 29f0c: 92 01 movw r18, r4 29f0e: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 29f12: ca 01 movw r24, r20 29f14: b9 01 movw r22, r18 29f16: 0f 94 02 98 call 0x33004 ; 0x33004 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29f1a: 0f 94 5c 99 call 0x332b8 ; 0x332b8 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 29f1e: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29f22: 4b 01 movw r8, r22 29f24: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 29f26: 90 e0 ldi r25, 0x00 ; 0 29f28: 80 e0 ldi r24, 0x00 ; 0 29f2a: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 #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))) || 29f2e: 3f ef ldi r19, 0xFF ; 255 29f30: c3 16 cp r12, r19 29f32: d3 06 cpc r13, r19 29f34: e3 06 cpc r14, r19 29f36: f3 06 cpc r15, r19 29f38: 09 f0 breq .+2 ; 0x29f3c 29f3a: 46 c0 rjmp .+140 ; 0x29fc8 } 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))) || 29f3c: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> 29f40: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29f44: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29f48: 88 23 and r24, r24 29f4a: 19 f1 breq .+70 ; 0x29f92 29f4c: 07 2e mov r0, r23 29f4e: 00 0c add r0, r0 29f50: 88 0b sbc r24, r24 29f52: 99 0b sbc r25, r25 29f54: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 29f58: 20 e0 ldi r18, 0x00 ; 0 29f5a: 30 e0 ldi r19, 0x00 ; 0 29f5c: 40 e8 ldi r20, 0x80 ; 128 29f5e: 5f e3 ldi r21, 0x3F ; 63 29f60: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 29f64: 9b 01 movw r18, r22 29f66: ac 01 movw r20, r24 29f68: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29f6c: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29f70: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29f74: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29f78: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 29f7c: 87 fd sbrc r24, 7 29f7e: 60 cf rjmp .-320 ; 0x29e40 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 29f80: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 29f84: 6b 01 movw r12, r22 29f86: 7c 01 movw r14, r24 29f88: 5b cf rjmp .-330 ; 0x29e40 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29f8a: 8f e3 ldi r24, 0x3F ; 63 29f8c: 0e 94 c2 70 call 0xe184 ; 0xe184 29f90: c4 cf rjmp .-120 ; 0x29f1a 29f92: 07 2e mov r0, r23 29f94: 00 0c add r0, r0 29f96: 88 0b sbc r24, r24 29f98: 99 0b sbc r25, r25 29f9a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__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))) || 29f9e: 20 e0 ldi r18, 0x00 ; 0 29fa0: 30 e0 ldi r19, 0x00 ; 0 29fa2: 40 e8 ldi r20, 0x80 ; 128 29fa4: 5f e3 ldi r21, 0x3F ; 63 29fa6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 29faa: 9b 01 movw r18, r22 29fac: ac 01 movw r20, r24 29fae: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29fb2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29fb6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29fba: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29fbe: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 29fc2: 18 16 cp r1, r24 29fc4: ec f6 brge .-70 ; 0x29f80 29fc6: 3c cf rjmp .-392 ; 0x29e40 29fc8: f7 fc sbrc r15, 7 29fca: 3a cf rjmp .-396 ; 0x29e40 29fcc: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29fd0: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29fd4: 07 2e mov r0, r23 29fd6: 00 0c add r0, r0 29fd8: 88 0b sbc r24, r24 29fda: 99 0b sbc r25, r25 29fdc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 29fe0: 9b 01 movw r18, r22 29fe2: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 29fe4: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29fe8: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29fec: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29ff0: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29ff4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 29ff8: 9f 77 andi r25, 0x7F ; 127 29ffa: 20 e0 ldi r18, 0x00 ; 0 29ffc: 30 e0 ldi r19, 0x00 ; 0 29ffe: 40 ea ldi r20, 0xA0 ; 160 2a000: 50 e4 ldi r21, 0x40 ; 64 2a002: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2a006: 18 16 cp r1, r24 2a008: 0c f0 brlt .+2 ; 0x2a00c 2a00a: 1a cf rjmp .-460 ; 0x29e40 2a00c: b9 cf rjmp .-142 ; 0x29f80 0002a00e : // 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) { 2a00e: 1f 93 push r17 2a010: cf 93 push r28 2a012: df 93 push r29 2a014: ec 01 movw r28, r24 2a016: 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()) { 2a018: 80 91 67 12 lds r24, 0x1267 ; 0x801267 2a01c: 83 30 cpi r24, 0x03 ; 3 2a01e: 09 f4 brne .+2 ; 0x2a022 2a020: 4e c0 rjmp .+156 ; 0x2a0be 2a022: 8c 31 cpi r24, 0x1C ; 28 2a024: 09 f4 brne .+2 ; 0x2a028 2a026: 52 c0 rjmp .+164 ; 0x2a0cc break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 2a028: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2a02c: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2a030: 8c 17 cp r24, r28 2a032: 9d 07 cpc r25, r29 2a034: 79 f1 breq .+94 ; 0x2a094 lastErrorCode = ec; 2a036: d0 93 8d 12 sts 0x128D, r29 ; 0x80128d 2a03a: c0 93 8c 12 sts 0x128C, r28 ; 0x80128c lastErrorSource = res; 2a03e: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 2a042: ce 01 movw r24, r28 2a044: 0f 94 98 88 call 0x31130 ; 0x31130 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); 2a048: e8 2f mov r30, r24 2a04a: f0 e0 ldi r31, 0x00 ; 0 2a04c: ee 0f add r30, r30 2a04e: ff 1f adc r31, r31 2a050: e3 5f subi r30, 0xF3 ; 243 2a052: f3 46 sbci r31, 0x63 ; 99 2a054: 85 91 lpm r24, Z+ 2a056: 94 91 lpm r25, Z 2a058: 02 96 adiw r24, 0x02 ; 2 2a05a: 0f 94 86 88 call 0x3110c ; 0x3110c if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 2a05e: c1 30 cpi r28, 0x01 ; 1 2a060: d1 05 cpc r29, r1 2a062: c1 f0 breq .+48 ; 0x2a094 2a064: cc 30 cpi r28, 0x0C ; 12 2a066: 80 e8 ldi r24, 0x80 ; 128 2a068: d8 07 cpc r29, r24 2a06a: a1 f0 breq .+40 ; 0x2a094 2a06c: c9 32 cpi r28, 0x29 ; 41 2a06e: 80 e8 ldi r24, 0x80 ; 128 2a070: d8 07 cpc r29, r24 2a072: 81 f0 breq .+32 ; 0x2a094 IncrementMMUFails(); 2a074: 0f 94 b7 87 call 0x30f6e ; 0x30f6e | (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 2a078: ce 01 movw r24, r28 2a07a: 88 27 eor r24, r24 2a07c: 9e 77 andi r25, 0x7E ; 126 2a07e: 89 2b or r24, r25 2a080: 49 f0 breq .+18 ; 0x2a094 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 2a082: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 2a086: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 2a08a: 01 96 adiw r24, 0x01 ; 1 2a08c: 90 93 9b 12 sts 0x129B, r25 ; 0x80129b 2a090: 80 93 9a 12 sts 0x129A, r24 ; 0x80129a return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 2a094: 80 91 79 12 lds r24, 0x1279 ; 0x801279 2a098: 88 23 and r24, r24 2a09a: d9 f0 breq .+54 ; 0x2a0d2 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2a09c: 11 e0 ldi r17, 0x01 ; 1 2a09e: 10 93 ae 0d sts 0x0DAE, r17 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 2a0a2: ce 01 movw r24, r28 2a0a4: 0f 94 23 8b call 0x31646 ; 0x31646 2a0a8: 8f 3f cpi r24, 0xFF ; 255 2a0aa: 99 f0 breq .+38 ; 0x2a0d2 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 2a0ac: 10 93 7a 12 sts 0x127A, r17 ; 0x80127a logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2a0b0: 8a ef ldi r24, 0xFA ; 250 2a0b2: 9b e9 ldi r25, 0x9B ; 155 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 2a0b4: df 91 pop r29 2a0b6: cf 91 pop r28 2a0b8: 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"); 2a0ba: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 // 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; 2a0be: 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(); 2a0c2: 0f 94 4a 87 call 0x30e94 ; 0x30e94 // 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; 2a0c6: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 2a0ca: ae cf rjmp .-164 ; 0x2a028 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; 2a0cc: 10 92 96 12 sts 0x1296, r1 ; 0x801296 2a0d0: f8 cf rjmp .-16 ; 0x2a0c2 2a0d2: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2a0d6: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 2a0da: 81 11 cpse r24, r1 2a0dc: 06 c0 rjmp .+12 ; 0x2a0ea 2a0de: 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"); } 2a0e0: df 91 pop r29 2a0e2: cf 91 pop r28 2a0e4: 1f 91 pop r17 2a0e6: 0d 94 e9 89 jmp 0x313d2 ; 0x313d2 2a0ea: df 91 pop r29 2a0ec: cf 91 pop r28 2a0ee: 1f 91 pop r17 2a0f0: 08 95 ret 0002a0f2 : * \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) { 2a0f2: 2f 92 push r2 2a0f4: 3f 92 push r3 2a0f6: 4f 92 push r4 2a0f8: 5f 92 push r5 2a0fa: 6f 92 push r6 2a0fc: 7f 92 push r7 2a0fe: 8f 92 push r8 2a100: 9f 92 push r9 2a102: af 92 push r10 2a104: bf 92 push r11 2a106: cf 92 push r12 2a108: df 92 push r13 2a10a: ef 92 push r14 2a10c: ff 92 push r15 2a10e: 0f 93 push r16 2a110: 1f 93 push r17 2a112: cf 93 push r28 2a114: df 93 push r29 2a116: 00 d0 rcall .+0 ; 0x2a118 2a118: 1f 92 push r1 2a11a: cd b7 in r28, 0x3d ; 61 2a11c: de b7 in r29, 0x3e ; 62 2a11e: 5c 01 movw r10, r24 2a120: 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; 2a122: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a126: 81 30 cpi r24, 0x01 ; 1 2a128: 09 f0 breq .+2 ; 0x2a12c 2a12a: de c0 rjmp .+444 ; 0x2a2e8 2a12c: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a130: 81 ff sbrs r24, 1 2a132: da c0 rjmp .+436 ; 0x2a2e8 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2a134: 82 fd sbrc r24, 2 2a136: bc c0 rjmp .+376 ; 0x2a2b0 * \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) { 2a138: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a13a: 21 2c mov r2, r1 2a13c: 32 e0 ldi r19, 0x02 ; 2 2a13e: 33 2e mov r3, r19 2a140: 00 91 02 16 lds r16, 0x1602 ; 0x801602 2a144: 10 91 03 16 lds r17, 0x1603 ; 0x801603 2a148: 20 91 04 16 lds r18, 0x1604 ; 0x801604 2a14c: 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) { 2a150: e1 14 cp r14, r1 2a152: f1 04 cpc r15, r1 2a154: 09 f4 brne .+2 ; 0x2a158 2a156: 30 c1 rjmp .+608 ; 0x2a3b8 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2a158: 80 91 13 16 lds r24, 0x1613 ; 0x801613 2a15c: 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);} 2a160: dc 01 movw r26, r24 2a162: 14 96 adiw r26, 0x04 ; 4 2a164: 7c 90 ld r7, X 2a166: 7a 94 dec r7 2a168: b9 01 movw r22, r18 2a16a: a8 01 movw r20, r16 2a16c: 29 e0 ldi r18, 0x09 ; 9 2a16e: 76 95 lsr r23 2a170: 67 95 ror r22 2a172: 57 95 ror r21 2a174: 47 95 ror r20 2a176: 2a 95 dec r18 2a178: d1 f7 brne .-12 ; 0x2a16e 2a17a: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2a17c: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2a17e: 71 10 cpse r7, r1 2a180: 25 c0 rjmp .+74 ; 0x2a1cc 2a182: 01 15 cp r16, r1 2a184: 11 05 cpc r17, r1 2a186: 11 f5 brne .+68 ; 0x2a1cc 2a188: 40 91 fe 15 lds r20, 0x15FE ; 0x8015fe 2a18c: 50 91 ff 15 lds r21, 0x15FF ; 0x8015ff 2a190: 60 91 00 16 lds r22, 0x1600 ; 0x801600 2a194: 70 91 01 16 lds r23, 0x1601 ; 0x801601 // start of new cluster if (curCluster_ == 0) { 2a198: 41 15 cp r20, r1 2a19a: 51 05 cpc r21, r1 2a19c: 61 05 cpc r22, r1 2a19e: 71 05 cpc r23, r1 2a1a0: 09 f0 breq .+2 ; 0x2a1a4 2a1a2: a8 c0 rjmp .+336 ; 0x2a2f4 if (firstCluster_ == 0) { 2a1a4: 80 91 0f 16 lds r24, 0x160F ; 0x80160f 2a1a8: 90 91 10 16 lds r25, 0x1610 ; 0x801610 2a1ac: a0 91 11 16 lds r26, 0x1611 ; 0x801611 2a1b0: b0 91 12 16 lds r27, 0x1612 ; 0x801612 2a1b4: 00 97 sbiw r24, 0x00 ; 0 2a1b6: a1 05 cpc r26, r1 2a1b8: b1 05 cpc r27, r1 2a1ba: 09 f0 breq .+2 ; 0x2a1be 2a1bc: b4 c0 rjmp .+360 ; 0x2a326 } 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; 2a1be: 8a ef ldi r24, 0xFA ; 250 2a1c0: 95 e1 ldi r25, 0x15 ; 21 2a1c2: 0f 94 4f 70 call 0x2e09e ; 0x2e09e 2a1c6: 88 23 and r24, r24 2a1c8: 09 f4 brne .+2 ; 0x2a1cc 2a1ca: 8e c0 rjmp .+284 ; 0x2a2e8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a1cc: c1 01 movw r24, r2 2a1ce: 80 1b sub r24, r16 2a1d0: 91 0b sbc r25, r17 2a1d2: 67 01 movw r12, r14 2a1d4: 8e 15 cp r24, r14 2a1d6: 9f 05 cpc r25, r15 2a1d8: 08 f4 brcc .+2 ; 0x2a1dc 2a1da: 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; 2a1dc: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a1e0: f0 91 14 16 lds r31, 0x1614 ; 0x801614 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2a1e4: 80 91 fe 15 lds r24, 0x15FE ; 0x8015fe 2a1e8: 90 91 ff 15 lds r25, 0x15FF ; 0x8015ff 2a1ec: a0 91 00 16 lds r26, 0x1600 ; 0x801600 2a1f0: b0 91 01 16 lds r27, 0x1601 ; 0x801601 2a1f4: 02 97 sbiw r24, 0x02 ; 2 2a1f6: a1 09 sbc r26, r1 2a1f8: b1 09 sbc r27, r1 2a1fa: 25 85 ldd r18, Z+13 ; 0x0d 2a1fc: 04 c0 rjmp .+8 ; 0x2a206 2a1fe: 88 0f add r24, r24 2a200: 99 1f adc r25, r25 2a202: aa 1f adc r26, r26 2a204: bb 1f adc r27, r27 2a206: 2a 95 dec r18 2a208: d2 f7 brpl .-12 ; 0x2a1fe 2a20a: 46 85 ldd r20, Z+14 ; 0x0e 2a20c: 57 85 ldd r21, Z+15 ; 0x0f 2a20e: 60 89 ldd r22, Z+16 ; 0x10 2a210: 71 89 ldd r23, Z+17 ; 0x11 2a212: 84 0f add r24, r20 2a214: 95 1f adc r25, r21 2a216: a6 1f adc r26, r22 2a218: b7 1f adc r27, r23 2a21a: 9c 01 movw r18, r24 2a21c: ad 01 movw r20, r26 2a21e: 27 0d add r18, r7 2a220: 31 1d adc r19, r1 2a222: 41 1d adc r20, r1 2a224: 51 1d adc r21, r1 2a226: 29 01 movw r4, r18 2a228: 3a 01 movw r6, r20 if (n == 512) { 2a22a: c1 14 cp r12, r1 2a22c: 32 e0 ldi r19, 0x02 ; 2 2a22e: d3 06 cpc r13, r19 2a230: 09 f0 breq .+2 ; 0x2a234 2a232: 8a c0 rjmp .+276 ; 0x2a348 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2a234: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2a238: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2a23c: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2a240: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2a244: 48 16 cp r4, r24 2a246: 59 06 cpc r5, r25 2a248: 6a 06 cpc r6, r26 2a24a: 7b 06 cpc r7, r27 2a24c: 69 f4 brne .+26 ; 0x2a268 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; 2a24e: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a252: 8f ef ldi r24, 0xFF ; 255 2a254: 9f ef ldi r25, 0xFF ; 255 2a256: dc 01 movw r26, r24 2a258: 80 93 cd 0d sts 0x0DCD, r24 ; 0x800dcd 2a25c: 90 93 ce 0d sts 0x0DCE, r25 ; 0x800dce 2a260: a0 93 cf 0d sts 0x0DCF, r26 ; 0x800dcf 2a264: 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); 2a268: 95 01 movw r18, r10 2a26a: b3 01 movw r22, r6 2a26c: a2 01 movw r20, r4 2a26e: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2a272: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2a276: 0f 94 af 71 call 0x2e35e ; 0x2e35e // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2a27a: 88 23 and r24, r24 2a27c: a9 f1 breq .+106 ; 0x2a2e8 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2a27e: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a282: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a286: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a28a: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a28e: 8c 0d add r24, r12 2a290: 9d 1d adc r25, r13 2a292: a1 1d adc r26, r1 2a294: b1 1d adc r27, r1 2a296: 80 93 02 16 sts 0x1602, r24 ; 0x801602 2a29a: 90 93 03 16 sts 0x1603, r25 ; 0x801603 2a29e: a0 93 04 16 sts 0x1604, r26 ; 0x801604 2a2a2: b0 93 05 16 sts 0x1605, r27 ; 0x801605 src += n; 2a2a6: ac 0c add r10, r12 2a2a8: bd 1c adc r11, r13 nToWrite -= n; 2a2aa: ec 18 sub r14, r12 2a2ac: fd 08 sbc r15, r13 2a2ae: 48 cf rjmp .-368 ; 0x2a140 // 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_) { 2a2b0: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 2a2b4: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2a2b8: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 2a2bc: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 2a2c0: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a2c4: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a2c8: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a2cc: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a2d0: 48 17 cp r20, r24 2a2d2: 59 07 cpc r21, r25 2a2d4: 6a 07 cpc r22, r26 2a2d6: 7b 07 cpc r23, r27 2a2d8: 09 f4 brne .+2 ; 0x2a2dc 2a2da: 2e cf rjmp .-420 ; 0x2a138 } /** 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);} 2a2dc: 8a ef ldi r24, 0xFA ; 250 2a2de: 95 e1 ldi r25, 0x15 ; 21 2a2e0: 0f 94 93 39 call 0x27326 ; 0x27326 if (!seekEnd()) goto fail; 2a2e4: 81 11 cpse r24, r1 2a2e6: 28 cf rjmp .-432 ; 0x2a138 } return nbyte; fail: // return for write error writeError = true; 2a2e8: 81 e0 ldi r24, 0x01 ; 1 2a2ea: 80 93 fa 15 sts 0x15FA, r24 ; 0x8015fa return -1; 2a2ee: 8f ef ldi r24, 0xFF ; 255 2a2f0: 9f ef ldi r25, 0xFF ; 255 2a2f2: 81 c0 rjmp .+258 ; 0x2a3f6 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2a2f4: 9e 01 movw r18, r28 2a2f6: 2f 5f subi r18, 0xFF ; 255 2a2f8: 3f 4f sbci r19, 0xFF ; 255 2a2fa: 0f 94 90 37 call 0x26f20 ; 0x26f20 2a2fe: 88 23 and r24, r24 2a300: 99 f3 breq .-26 ; 0x2a2e8 if (vol_->isEOC(next)) { 2a302: 89 81 ldd r24, Y+1 ; 0x01 2a304: 9a 81 ldd r25, Y+2 ; 0x02 2a306: ab 81 ldd r26, Y+3 ; 0x03 2a308: 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; 2a30a: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a30e: f0 91 14 16 lds r31, 0x1614 ; 0x801614 2a312: 27 89 ldd r18, Z+23 ; 0x17 2a314: 20 31 cpi r18, 0x10 ; 16 2a316: 81 f4 brne .+32 ; 0x2a338 2a318: 88 3f cpi r24, 0xF8 ; 248 2a31a: ef ef ldi r30, 0xFF ; 255 2a31c: 9e 07 cpc r25, r30 2a31e: a1 05 cpc r26, r1 2a320: b1 05 cpc r27, r1 2a322: 08 f0 brcs .+2 ; 0x2a326 2a324: 4c cf rjmp .-360 ; 0x2a1be // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2a326: 80 93 fe 15 sts 0x15FE, r24 ; 0x8015fe 2a32a: 90 93 ff 15 sts 0x15FF, r25 ; 0x8015ff 2a32e: a0 93 00 16 sts 0x1600, r26 ; 0x801600 2a332: b0 93 01 16 sts 0x1601, r27 ; 0x801601 2a336: 4a cf rjmp .-364 ; 0x2a1cc return cluster >= FAT32EOC_MIN; 2a338: 88 3f cpi r24, 0xF8 ; 248 2a33a: ff ef ldi r31, 0xFF ; 255 2a33c: 9f 07 cpc r25, r31 2a33e: af 07 cpc r26, r31 2a340: ff e0 ldi r31, 0x0F ; 15 2a342: bf 07 cpc r27, r31 2a344: 80 f3 brcs .-32 ; 0x2a326 2a346: 3b cf rjmp .-394 ; 0x2a1be // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2a348: 01 15 cp r16, r1 2a34a: 11 05 cpc r17, r1 2a34c: 69 f5 brne .+90 ; 0x2a3a8 2a34e: 40 91 02 16 lds r20, 0x1602 ; 0x801602 2a352: 50 91 03 16 lds r21, 0x1603 ; 0x801603 2a356: 60 91 04 16 lds r22, 0x1604 ; 0x801604 2a35a: 70 91 05 16 lds r23, 0x1605 ; 0x801605 2a35e: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a362: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a366: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a36a: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a36e: 48 17 cp r20, r24 2a370: 59 07 cpc r21, r25 2a372: 6a 07 cpc r22, r26 2a374: 7b 07 cpc r23, r27 2a376: c0 f0 brcs .+48 ; 0x2a3a8 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2a378: 0f 94 82 36 call 0x26d04 ; 0x26d04 2a37c: 88 23 and r24, r24 2a37e: 09 f4 brne .+2 ; 0x2a382 2a380: b3 cf rjmp .-154 ; 0x2a2e8 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; 2a382: 81 e0 ldi r24, 0x01 ; 1 2a384: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a388: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2a38c: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2a390: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2a394: 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); 2a398: a6 01 movw r20, r12 2a39a: b5 01 movw r22, r10 2a39c: c8 01 movw r24, r16 2a39e: 87 52 subi r24, 0x27 ; 39 2a3a0: 92 4f sbci r25, 0xF2 ; 242 2a3a2: 0f 94 65 a7 call 0x34eca ; 0x34eca 2a3a6: 6b cf rjmp .-298 ; 0x2a27e 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; 2a3a8: 41 e0 ldi r20, 0x01 ; 1 2a3aa: c3 01 movw r24, r6 2a3ac: b2 01 movw r22, r4 2a3ae: 0f 94 c1 36 call 0x26d82 ; 0x26d82 2a3b2: 81 11 cpse r24, r1 2a3b4: f1 cf rjmp .-30 ; 0x2a398 2a3b6: 98 cf rjmp .-208 ; 0x2a2e8 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2a3b8: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a3bc: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a3c0: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a3c4: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a3c8: 80 17 cp r24, r16 2a3ca: 91 07 cpc r25, r17 2a3cc: a2 07 cpc r26, r18 2a3ce: b3 07 cpc r27, r19 2a3d0: 68 f4 brcc .+26 ; 0x2a3ec 2a3d2: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2a3d6: 00 93 0b 16 sts 0x160B, r16 ; 0x80160b 2a3da: 10 93 0c 16 sts 0x160C, r17 ; 0x80160c 2a3de: 20 93 0d 16 sts 0x160D, r18 ; 0x80160d 2a3e2: 30 93 0e 16 sts 0x160E, r19 ; 0x80160e flags_ |= F_FILE_DIR_DIRTY; 2a3e6: 80 68 ori r24, 0x80 ; 128 2a3e8: 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) { 2a3ec: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a3f0: 83 fd sbrc r24, 3 2a3f2: 18 c0 rjmp .+48 ; 0x2a424 if (!sync()) goto fail; } return nbyte; 2a3f4: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2a3f6: 0f 90 pop r0 2a3f8: 0f 90 pop r0 2a3fa: 0f 90 pop r0 2a3fc: 0f 90 pop r0 2a3fe: df 91 pop r29 2a400: cf 91 pop r28 2a402: 1f 91 pop r17 2a404: 0f 91 pop r16 2a406: ff 90 pop r15 2a408: ef 90 pop r14 2a40a: df 90 pop r13 2a40c: cf 90 pop r12 2a40e: bf 90 pop r11 2a410: af 90 pop r10 2a412: 9f 90 pop r9 2a414: 8f 90 pop r8 2a416: 7f 90 pop r7 2a418: 6f 90 pop r6 2a41a: 5f 90 pop r5 2a41c: 4f 90 pop r4 2a41e: 3f 90 pop r3 2a420: 2f 90 pop r2 2a422: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2a424: 8a ef ldi r24, 0xFA ; 250 2a426: 95 e1 ldi r25, 0x15 ; 21 2a428: 0f 94 5e 39 call 0x272bc ; 0x272bc 2a42c: 81 11 cpse r24, r1 2a42e: e2 cf rjmp .-60 ; 0x2a3f4 2a430: 5b cf rjmp .-330 ; 0x2a2e8 0002a432 : #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) { 2a432: 0f 93 push r16 2a434: cf 93 push r28 2a436: df 93 push r29 2a438: cd b7 in r28, 0x3d ; 61 2a43a: de b7 in r29, 0x3e ; 62 2a43c: a3 97 sbiw r28, 0x23 ; 35 2a43e: 0f b6 in r0, 0x3f ; 63 2a440: f8 94 cli 2a442: de bf out 0x3e, r29 ; 62 2a444: 0f be out 0x3f, r0 ; 63 2a446: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2a448: 20 91 0b 15 lds r18, 0x150B ; 0x80150b 2a44c: 30 91 0c 15 lds r19, 0x150C ; 0x80150c 2a450: 82 17 cp r24, r18 2a452: 93 07 cpc r25, r19 2a454: d8 f4 brcc .+54 ; 0x2a48c getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2a456: 61 30 cpi r22, 0x01 ; 1 2a458: 31 f4 brne .+12 ; 0x2a466 2a45a: 21 50 subi r18, 0x01 ; 1 2a45c: 31 09 sbc r19, r1 2a45e: a9 01 movw r20, r18 2a460: 48 1b sub r20, r24 2a462: 59 0b sbc r21, r25 2a464: ca 01 movw r24, r20 2a466: 88 0f add r24, r24 2a468: 99 1f adc r25, r25 2a46a: fc 01 movw r30, r24 2a46c: e3 5f subi r30, 0xF3 ; 243 2a46e: fa 4e sbci r31, 0xEA ; 234 2a470: 80 81 ld r24, Z 2a472: 91 81 ldd r25, Z+1 ; 0x01 2a474: 0f 94 3c 48 call 0x29078 ; 0x29078 else getfilename_afterMaxSorting(nr); } 2a478: a3 96 adiw r28, 0x23 ; 35 2a47a: 0f b6 in r0, 0x3f ; 63 2a47c: f8 94 cli 2a47e: de bf out 0x3e, r29 ; 62 2a480: 0f be out 0x3f, r0 ; 63 2a482: cd bf out 0x3d, r28 ; 61 2a484: df 91 pop r29 2a486: cf 91 pop r28 2a488: 0f 91 pop r16 2a48a: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2a48c: 45 e1 ldi r20, 0x15 ; 21 2a48e: 54 e1 ldi r21, 0x14 ; 20 2a490: 50 93 14 14 sts 0x1414, r21 ; 0x801414 2a494: 40 93 13 14 sts 0x1413, r20 ; 0x801413 nrFiles = entry - sort_count + 1; 2a498: 82 1b sub r24, r18 2a49a: 93 0b sbc r25, r19 2a49c: 01 96 adiw r24, 0x01 ; 1 2a49e: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2a4a2: 80 93 82 16 sts 0x1682, r24 ; 0x801682 curDir->seekSet(lastSortedFilePosition << 5); 2a4a6: 40 91 d5 15 lds r20, 0x15D5 ; 0x8015d5 2a4aa: 50 91 d6 15 lds r21, 0x15D6 ; 0x8015d6 2a4ae: 85 e0 ldi r24, 0x05 ; 5 2a4b0: 44 0f add r20, r20 2a4b2: 55 1f adc r21, r21 2a4b4: 8a 95 dec r24 2a4b6: e1 f7 brne .-8 ; 0x2a4b0 2a4b8: 70 e0 ldi r23, 0x00 ; 0 2a4ba: 60 e0 ldi r22, 0x00 ; 0 2a4bc: 85 e1 ldi r24, 0x15 ; 21 2a4be: 94 e1 ldi r25, 0x14 ; 20 2a4c0: 0f 94 93 39 call 0x27326 ; 0x27326 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2a4c4: 00 e0 ldi r16, 0x00 ; 0 2a4c6: 0e 7f andi r16, 0xFE ; 254 2a4c8: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2a4ca: e0 91 13 14 lds r30, 0x1413 ; 0x801413 2a4ce: f0 91 14 14 lds r31, 0x1414 ; 0x801414 2a4d2: 83 e2 ldi r24, 0x23 ; 35 2a4d4: de 01 movw r26, r28 2a4d6: 11 96 adiw r26, 0x01 ; 1 2a4d8: 01 90 ld r0, Z+ 2a4da: 0d 92 st X+, r0 2a4dc: 8a 95 dec r24 2a4de: e1 f7 brne .-8 ; 0x2a4d8 2a4e0: 22 e0 ldi r18, 0x02 ; 2 2a4e2: 50 e0 ldi r21, 0x00 ; 0 2a4e4: 40 e0 ldi r20, 0x00 ; 0 2a4e6: be 01 movw r22, r28 2a4e8: 6f 5f subi r22, 0xFF ; 255 2a4ea: 7f 4f sbci r23, 0xFF ; 255 2a4ec: 8a ed ldi r24, 0xDA ; 218 2a4ee: 92 e0 ldi r25, 0x02 ; 2 2a4f0: 0f 94 c6 45 call 0x28b8c ; 0x28b8c 2a4f4: ce 01 movw r24, r28 2a4f6: 01 96 adiw r24, 0x01 ; 1 2a4f8: 0e 94 bc 70 call 0xe178 ; 0xe178 2a4fc: bd cf rjmp .-134 ; 0x2a478 0002a4fe : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2a4fe: 0f 93 push r16 2a500: 1f 93 push r17 2a502: cf 93 push r28 2a504: df 93 push r29 2a506: 1f 92 push r1 2a508: 1f 92 push r1 2a50a: cd b7 in r28, 0x3d ; 61 2a50c: de b7 in r29, 0x3e ; 62 { if(!mounted) 2a50e: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 2a512: 22 23 and r18, r18 2a514: 69 f1 breq .+90 ; 0x2a570 2a516: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2a518: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a51c: 88 23 and r24, r24 2a51e: 79 f1 breq .+94 ; 0x2a57e SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2a520: 81 e2 ldi r24, 0x21 ; 33 2a522: 9b e9 ldi r25, 0x9B ; 155 2a524: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 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; 2a528: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 2a52c: 1a 83 std Y+2, r17 ; 0x02 2a52e: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2a530: ce 01 movw r24, r28 2a532: 01 96 adiw r24, 0x01 ; 1 2a534: 0f 94 de 4b call 0x297bc ; 0x297bc 2a538: 88 23 and r24, r24 2a53a: d1 f0 breq .+52 ; 0x2a570 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2a53c: 49 81 ldd r20, Y+1 ; 0x01 2a53e: 5a 81 ldd r21, Y+2 ; 0x02 2a540: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2a544: 70 91 14 14 lds r23, 0x1414 ; 0x801414 2a548: 26 e5 ldi r18, 0x56 ; 86 2a54a: 8a ef ldi r24, 0xFA ; 250 2a54c: 95 e1 ldi r25, 0x15 ; 21 2a54e: 0f 94 e9 9a call 0x335d2 ; 0x335d2 2a552: 81 11 cpse r24, r1 2a554: 22 c0 rjmp .+68 ; 0x2a59a SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2a556: 8f e5 ldi r24, 0x5F ; 95 2a558: 9c e6 ldi r25, 0x6C ; 108 2a55a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2a55e: 89 81 ldd r24, Y+1 ; 0x01 2a560: 9a 81 ldd r25, Y+2 ; 0x02 2a562: 0e 94 2b 7d call 0xfa56 ; 0xfa56 2a566: 8e e2 ldi r24, 0x2E ; 46 2a568: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2a56c: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2a570: 0f 90 pop r0 2a572: 0f 90 pop r0 2a574: df 91 pop r29 2a576: cf 91 pop r28 2a578: 1f 91 pop r17 2a57a: 0f 91 pop r16 2a57c: 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 2a57e: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 2a582: 87 e7 ldi r24, 0x77 ; 119 2a584: 9e e9 ldi r25, 0x9E ; 158 2a586: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(ofNowFreshFile); 2a58a: 89 e3 ldi r24, 0x39 ; 57 2a58c: 9d e9 ldi r25, 0x9D ; 157 2a58e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN(name); 2a592: c8 01 movw r24, r16 2a594: 0f 94 5d 9a call 0x334ba ; 0x334ba 2a598: c7 cf rjmp .-114 ; 0x2a528 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; 2a59a: 81 e0 ldi r24, 0x01 ; 1 2a59c: 80 93 68 13 sts 0x1368, r24 ; 0x801368 getfilename(0, fname); 2a5a0: 89 81 ldd r24, Y+1 ; 0x01 2a5a2: 9a 81 ldd r25, Y+2 ; 0x02 2a5a4: 0f 94 f5 47 call 0x28fea ; 0x28fea SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2a5a8: 8f e0 ldi r24, 0x0F ; 15 2a5aa: 9b e9 ldi r25, 0x9B ; 155 2a5ac: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 printAbsFilenameFast(); 2a5b0: 0f 94 d8 48 call 0x291b0 ; 0x291b0 SERIAL_PROTOCOLLN(); 2a5b4: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2a5b8: 85 e1 ldi r24, 0x15 ; 21 2a5ba: 9d e9 ldi r25, 0x9D ; 157 2a5bc: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 lcd_setstatuspgm(ofFileSelected); 2a5c0: 85 e1 ldi r24, 0x15 ; 21 2a5c2: 9d e9 ldi r25, 0x9D ; 157 2a5c4: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 scrollstuff = 0; 2a5c8: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 2a5cc: d1 cf rjmp .-94 ; 0x2a570 0002a5ce : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2a5ce: 0f 93 push r16 2a5d0: 1f 93 push r17 2a5d2: cf 93 push r28 2a5d4: df 93 push r29 2a5d6: ec 01 movw r28, r24 { memset(ip, 0, 4); 2a5d8: 84 e0 ldi r24, 0x04 ; 4 2a5da: fe 01 movw r30, r28 2a5dc: 11 92 st Z+, r1 2a5de: 8a 95 dec r24 2a5e0: e9 f7 brne .-6 ; 0x2a5dc /** 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 2a5e2: 23 e0 ldi r18, 0x03 ; 3 2a5e4: 30 ea ldi r19, 0xA0 ; 160 2a5e6: 4a e0 ldi r20, 0x0A ; 10 2a5e8: 50 e9 ldi r21, 0x90 ; 144 2a5ea: 60 e3 ldi r22, 0x30 ; 48 2a5ec: 87 ed ldi r24, 0xD7 ; 215 2a5ee: 95 e1 ldi r25, 0x15 ; 21 2a5f0: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 2a5f4: 88 23 and r24, r24 2a5f6: 91 f0 breq .+36 ; 0x2a61c 2a5f8: 23 e0 ldi r18, 0x03 ; 3 2a5fa: 30 ea ldi r19, 0xA0 ; 160 2a5fc: 4a e0 ldi r20, 0x0A ; 10 2a5fe: 50 e9 ldi r21, 0x90 ; 144 2a600: 61 e1 ldi r22, 0x11 ; 17 2a602: 87 ed ldi r24, 0xD7 ; 215 2a604: 95 e1 ldi r25, 0x15 ; 21 2a606: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 2a60a: 88 23 and r24, r24 2a60c: 39 f0 breq .+14 ; 0x2a61c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a60e: 80 e8 ldi r24, 0x80 ; 128 2a610: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2a614: 0f 94 1d 42 call 0x2843a ; 0x2843a return false; 2a618: 80 e0 ldi r24, 0x00 ; 0 2a61a: 2f c0 rjmp .+94 ; 0x2a67a //------------------------------------------------------------------------------ /** 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(); 2a61c: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2a620: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a622: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2a626: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 2a62a: 8f 3f cpi r24, 0xFF ; 255 2a62c: 69 f4 brne .+26 ; 0x2a648 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a62e: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2a632: 60 1b sub r22, r16 2a634: 71 0b sbc r23, r17 2a636: 6d 32 cpi r22, 0x2D ; 45 2a638: 71 40 sbci r23, 0x01 ; 1 2a63a: 98 f3 brcs .-26 ; 0x2a622 2a63c: 81 e1 ldi r24, 0x11 ; 17 2a63e: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 goto fail; } return true; fail: chipSelectHigh(); 2a642: 0f 94 1d 42 call 0x2843a ; 0x2843a 2a646: e6 cf rjmp .-52 ; 0x2a614 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a648: 8e 3f cpi r24, 0xFE ; 254 2a64a: 11 f0 breq .+4 ; 0x2a650 2a64c: 8f e0 ldi r24, 0x0F ; 15 2a64e: f7 cf rjmp .-18 ; 0x2a63e 2a650: 8e 01 movw r16, r28 2a652: 0c 5f subi r16, 0xFC ; 252 2a654: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2a656: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2a65a: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2a65c: c0 17 cp r28, r16 2a65e: d1 07 cpc r29, r17 2a660: d1 f7 brne .-12 ; 0x2a656 2a662: ce ef ldi r28, 0xFE ; 254 2a664: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2a666: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2a66a: 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) { 2a66c: e1 f7 brne .-8 ; 0x2a666 spiRec(); } chipSelectHigh(); 2a66e: 0f 94 1d 42 call 0x2843a ; 0x2843a spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2a672: 8f ef ldi r24, 0xFF ; 255 2a674: 0f 94 4a 71 call 0x2e294 ; 0x2e294 2a678: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2a67a: df 91 pop r29 2a67c: cf 91 pop r28 2a67e: 1f 91 pop r17 2a680: 0f 91 pop r16 2a682: 08 95 ret 0002a684 : } 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) 2a684: cf 92 push r12 2a686: df 92 push r13 2a688: ef 92 push r14 2a68a: ff 92 push r15 2a68c: 0f 93 push r16 2a68e: 1f 93 push r17 2a690: cf 93 push r28 2a692: df 93 push r29 2a694: ec 01 movw r28, r24 2a696: 8b 01 movw r16, r22 2a698: 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) 2a69a: 01 15 cp r16, r1 2a69c: 11 05 cpc r17, r1 2a69e: 09 f4 brne .+2 ; 0x2a6a2 2a6a0: 41 c0 rjmp .+130 ; 0x2a724 void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2a6a2: 8d 2f mov r24, r29 2a6a4: 0e 94 09 70 call 0xe012 ; 0xe012 print_hex_byte(val & 0xFF); 2a6a8: 8c 2f mov r24, r28 2a6aa: 0e 94 09 70 call 0xe012 ; 0xe012 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2a6ae: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a6b2: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a6b6: 80 e2 ldi r24, 0x20 ; 32 2a6b8: 90 e0 ldi r25, 0x00 ; 0 2a6ba: 0f 94 a4 9f call 0x33f48 ; 0x33f48 2a6be: 6e 01 movw r12, r28 2a6c0: 80 e1 ldi r24, 0x10 ; 16 2a6c2: c8 0e add r12, r24 2a6c4: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2a6c6: 81 e0 ldi r24, 0x01 ; 1 2a6c8: e8 16 cp r14, r24 2a6ca: 39 f1 breq .+78 ; 0x2a71a { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2a6cc: 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; 2a6ce: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2a6d0: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a6d4: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a6d8: 80 e2 ldi r24, 0x20 ; 32 2a6da: 90 e0 ldi r25, 0x00 ; 0 2a6dc: 0f 94 a4 9f call 0x33f48 ; 0x33f48 print_hex_byte(data); 2a6e0: 8f 2d mov r24, r15 2a6e2: 0e 94 09 70 call 0xe012 ; 0xe012 count_line--; count--; 2a6e6: 01 50 subi r16, 0x01 ; 1 2a6e8: 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)) 2a6ea: 0f b6 in r0, 0x3f ; 63 2a6ec: 07 fe sbrs r0, 7 2a6ee: 06 c0 rjmp .+12 ; 0x2a6fc 2a6f0: c8 01 movw r24, r16 2a6f2: 9f 71 andi r25, 0x1F ; 31 2a6f4: 89 2b or r24, r25 2a6f6: 29 f4 brne .+10 ; 0x2a702 manage_heater(); 2a6f8: 0f 94 af 32 call 0x2655e ; 0x2655e while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2a6fc: 01 15 cp r16, r1 2a6fe: 11 05 cpc r17, r1 2a700: 19 f0 breq .+6 ; 0x2a708 2a702: cc 15 cp r28, r12 2a704: dd 05 cpc r29, r13 2a706: f9 f6 brne .-66 ; 0x2a6c6 // 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'); 2a708: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a70c: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a710: 8a e0 ldi r24, 0x0A ; 10 2a712: 90 e0 ldi r25, 0x00 ; 0 2a714: 0f 94 a4 9f call 0x33f48 ; 0x33f48 2a718: c0 cf rjmp .-128 ; 0x2a69a { 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; 2a71a: ce 01 movw r24, r28 2a71c: 0f 94 3c a1 call 0x34278 ; 0x34278 2a720: f8 2e mov r15, r24 2a722: d5 cf rjmp .-86 ; 0x2a6ce if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2a724: df 91 pop r29 2a726: cf 91 pop r28 2a728: 1f 91 pop r17 2a72a: 0f 91 pop r16 2a72c: ff 90 pop r15 2a72e: ef 90 pop r14 2a730: df 90 pop r13 2a732: cf 90 pop r12 2a734: 08 95 ret 0002a736 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 2a736: 80 91 84 16 lds r24, 0x1684 ; 0x801684 2a73a: 83 30 cpi r24, 0x03 ; 3 2a73c: 21 f4 brne .+8 ; 0x2a746 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 2a73e: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup 2a740: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; 2a742: 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 2a746: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 1); // pullup 2a748: 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(); } 2a74a: 84 e8 ldi r24, 0x84 ; 132 2a74c: 96 e1 ldi r25, 0x16 ; 22 2a74e: 0c 94 71 6e jmp 0xdce2 ; 0xdce2 0002a752 : //! //! @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) 2a752: cf 92 push r12 2a754: df 92 push r13 2a756: ef 92 push r14 2a758: ff 92 push r15 2a75a: 69 01 movw r12, r18 2a75c: 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); 2a75e: 2d ec ldi r18, 0xCD ; 205 2a760: 3c ec ldi r19, 0xCC ; 204 2a762: 4c e4 ldi r20, 0x4C ; 76 2a764: 5e e3 ldi r21, 0x3E ; 62 2a766: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2a76a: 2d ec ldi r18, 0xCD ; 205 2a76c: 3c ec ldi r19, 0xCC ; 204 2a76e: 4c e4 ldi r20, 0x4C ; 76 2a770: 5e e3 ldi r21, 0x3E ; 62 2a772: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2a776: 2d ef ldi r18, 0xFD ; 253 2a778: 3d ea ldi r19, 0xAD ; 173 2a77a: 40 e0 ldi r20, 0x00 ; 0 2a77c: 5d e3 ldi r21, 0x3D ; 61 2a77e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2a782: a7 01 movw r20, r14 2a784: 96 01 movw r18, r12 2a786: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2a78a: 24 e2 ldi r18, 0x24 ; 36 2a78c: 30 ef ldi r19, 0xF0 ; 240 2a78e: 49 e1 ldi r20, 0x19 ; 25 2a790: 50 e4 ldi r21, 0x40 ; 64 2a792: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> } 2a796: ff 90 pop r15 2a798: ef 90 pop r14 2a79a: df 90 pop r13 2a79c: cf 90 pop r12 2a79e: 08 95 ret 0002a7a0 : //! //! This function needs to be called 4 times with step of 0,4,8,12 //! //! @param cmd_buffer character buffer needed to format gcodes //! @param i iteration void lay1cal_square(uint8_t step, float layer_height, float extrusion_width) 2a7a0: 2f 92 push r2 2a7a2: 3f 92 push r3 2a7a4: 4f 92 push r4 2a7a6: 5f 92 push r5 2a7a8: 6f 92 push r6 2a7aa: 7f 92 push r7 2a7ac: 8f 92 push r8 2a7ae: 9f 92 push r9 2a7b0: af 92 push r10 2a7b2: bf 92 push r11 2a7b4: cf 92 push r12 2a7b6: df 92 push r13 2a7b8: ef 92 push r14 2a7ba: ff 92 push r15 2a7bc: 0f 93 push r16 2a7be: 1f 93 push r17 2a7c0: cf 93 push r28 2a7c2: df 93 push r29 2a7c4: 00 d0 rcall .+0 ; 0x2a7c6 2a7c6: 1f 92 push r1 2a7c8: 1f 92 push r1 2a7ca: cd b7 in r28, 0x3d ; 61 2a7cc: de b7 in r29, 0x3e ; 62 2a7ce: 8c 83 std Y+4, r24 ; 0x04 2a7d0: 4a 01 movw r8, r20 2a7d2: 5b 01 movw r10, r22 //! @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); 2a7d4: 23 e4 ldi r18, 0x43 ; 67 2a7d6: 3d ec ldi r19, 0xCD ; 205 2a7d8: 4f e2 ldi r20, 0x2F ; 47 2a7da: 5d e3 ldi r21, 0x3D ; 61 2a7dc: cb 01 movw r24, r22 2a7de: b4 01 movw r22, r8 2a7e0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2a7e4: 6b 01 movw r12, r22 2a7e6: 7c 01 movw r14, r24 //! @param i iteration void lay1cal_square(uint8_t step, float layer_height, float extrusion_width) { const float long_length = 20; const float short_length = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 2a7e8: 20 e0 ldi r18, 0x00 ; 0 2a7ea: 30 e0 ldi r19, 0x00 ; 0 2a7ec: 40 ea ldi r20, 0xA0 ; 160 2a7ee: 51 e4 ldi r21, 0x41 ; 65 2a7f0: c5 01 movw r24, r10 2a7f2: b4 01 movw r22, r8 2a7f4: 0f 94 a9 53 call 0x2a752 ; 0x2a752 2a7f8: 56 2e mov r5, r22 2a7fa: 47 2e mov r4, r23 2a7fc: 38 2e mov r3, r24 2a7fe: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 2a800: a7 01 movw r20, r14 2a802: 96 01 movw r18, r12 2a804: c5 01 movw r24, r10 2a806: b4 01 movw r22, r8 2a808: 0f 94 a9 53 call 0x2a752 ; 0x2a752 2a80c: 69 83 std Y+1, r22 ; 0x01 2a80e: 7a 83 std Y+2, r23 ; 0x02 2a810: 8b 83 std Y+3, r24 ; 0x03 2a812: a9 2e mov r10, r25 static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f"; for (uint8_t i = step; i < step+4; ++i) 2a814: bc 80 ldd r11, Y+4 ; 0x04 2a816: 8b 2d mov r24, r11 2a818: 90 e0 ldi r25, 0x00 ; 0 2a81a: 9c 01 movw r18, r24 2a81c: 2d 5f subi r18, 0xFD ; 253 2a81e: 3f 4f sbci r19, 0xFF ; 255 2a820: 3d 83 std Y+5, r19 ; 0x05 2a822: 2c 83 std Y+4, r18 ; 0x04 2a824: 0b 2d mov r16, r11 2a826: 10 e0 ldi r17, 0x00 ; 0 2a828: 8c 81 ldd r24, Y+4 ; 0x04 2a82a: 9d 81 ldd r25, Y+5 ; 0x05 2a82c: 80 17 cp r24, r16 2a82e: 91 07 cpc r25, r17 2a830: 0c f4 brge .+2 ; 0x2a834 2a832: a1 c0 rjmp .+322 ; 0x2a976 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 2a834: 2f 92 push r2 2a836: 3f 92 push r3 2a838: 4f 92 push r4 2a83a: 5f 92 push r5 2a83c: b8 01 movw r22, r16 2a83e: 01 2e mov r0, r17 2a840: 00 0c add r0, r0 2a842: 88 0b sbc r24, r24 2a844: 99 0b sbc r25, r25 2a846: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2a84a: a7 01 movw r20, r14 2a84c: 96 01 movw r18, r12 2a84e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2a852: 9b 01 movw r18, r22 2a854: ac 01 movw r20, r24 2a856: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2a85a: 9b 01 movw r18, r22 2a85c: ac 01 movw r20, r24 2a85e: 60 e0 ldi r22, 0x00 ; 0 2a860: 70 e0 ldi r23, 0x00 ; 0 2a862: 8c e0 ldi r24, 0x0C ; 12 2a864: 92 e4 ldi r25, 0x42 ; 66 2a866: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2a86a: 9f 93 push r25 2a86c: 8f 93 push r24 2a86e: 7f 93 push r23 2a870: 6f 93 push r22 2a872: 1f 92 push r1 2a874: 96 e4 ldi r25, 0x46 ; 70 2a876: 9f 93 push r25 2a878: 2a ef ldi r18, 0xFA ; 250 2a87a: 3a e9 ldi r19, 0x9A ; 154 2a87c: 3f 93 push r19 2a87e: 2f 93 push r18 2a880: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 2a884: b8 01 movw r22, r16 2a886: 66 0f add r22, r22 2a888: 77 1f adc r23, r23 2a88a: 6f 5f subi r22, 0xFF ; 255 2a88c: 7f 4f sbci r23, 0xFF ; 255 2a88e: 07 2e mov r0, r23 2a890: 00 0c add r0, r0 2a892: 88 0b sbc r24, r24 2a894: 99 0b sbc r25, r25 2a896: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2a89a: a7 01 movw r20, r14 2a89c: 96 01 movw r18, r12 2a89e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2a8a2: 9b 01 movw r18, r22 2a8a4: ac 01 movw r20, r24 2a8a6: 60 e0 ldi r22, 0x00 ; 0 2a8a8: 70 e0 ldi r23, 0x00 ; 0 2a8aa: 8c e0 ldi r24, 0x0C ; 12 2a8ac: 92 e4 ldi r25, 0x42 ; 66 2a8ae: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2a8b2: 96 2e mov r9, r22 2a8b4: 87 2e mov r8, r23 2a8b6: 78 2e mov r7, r24 2a8b8: 69 2e mov r6, r25 2a8ba: af 92 push r10 2a8bc: 9b 81 ldd r25, Y+3 ; 0x03 2a8be: 9f 93 push r25 2a8c0: 2a 81 ldd r18, Y+2 ; 0x02 2a8c2: 2f 93 push r18 2a8c4: 39 81 ldd r19, Y+1 ; 0x01 2a8c6: 3f 93 push r19 2a8c8: 6f 92 push r6 2a8ca: 7f 92 push r7 2a8cc: 8f 92 push r8 2a8ce: 9f 92 push r9 2a8d0: 1f 92 push r1 2a8d2: 86 e4 ldi r24, 0x46 ; 70 2a8d4: 8f 93 push r24 2a8d6: 2a ef ldi r18, 0xFA ; 250 2a8d8: 3a e9 ldi r19, 0x9A ; 154 2a8da: 3f 93 push r19 2a8dc: 2f 93 push r18 2a8de: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 2a8e2: 2f 92 push r2 2a8e4: 3f 92 push r3 2a8e6: 4f 92 push r4 2a8e8: 5f 92 push r5 2a8ea: 6f 92 push r6 2a8ec: 7f 92 push r7 2a8ee: 8f 92 push r8 2a8f0: 9f 92 push r9 2a8f2: 1f 92 push r1 2a8f4: 92 e3 ldi r25, 0x32 ; 50 2a8f6: 9f 93 push r25 2a8f8: 2a ef ldi r18, 0xFA ; 250 2a8fa: 3a e9 ldi r19, 0x9A ; 154 2a8fc: 3f 93 push r19 2a8fe: 2f 93 push r18 2a900: 0e 94 cd 7d call 0xfb9a ; 0xfb9a enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 2a904: 0f b6 in r0, 0x3f ; 63 2a906: f8 94 cli 2a908: de bf out 0x3e, r29 ; 62 2a90a: 0f be out 0x3f, r0 ; 63 2a90c: cd bf out 0x3d, r28 ; 61 2a90e: af 92 push r10 2a910: 3b 81 ldd r19, Y+3 ; 0x03 2a912: 3f 93 push r19 2a914: 8a 81 ldd r24, Y+2 ; 0x02 2a916: 8f 93 push r24 2a918: 99 81 ldd r25, Y+1 ; 0x01 2a91a: 9f 93 push r25 2a91c: b8 01 movw r22, r16 2a91e: 6f 5f subi r22, 0xFF ; 255 2a920: 7f 4f sbci r23, 0xFF ; 255 2a922: 07 2e mov r0, r23 2a924: 00 0c add r0, r0 2a926: 88 0b sbc r24, r24 2a928: 99 0b sbc r25, r25 2a92a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2a92e: a7 01 movw r20, r14 2a930: 96 01 movw r18, r12 2a932: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2a936: 9b 01 movw r18, r22 2a938: ac 01 movw r20, r24 2a93a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2a93e: 9b 01 movw r18, r22 2a940: ac 01 movw r20, r24 2a942: 60 e0 ldi r22, 0x00 ; 0 2a944: 70 e0 ldi r23, 0x00 ; 0 2a946: 8c e0 ldi r24, 0x0C ; 12 2a948: 92 e4 ldi r25, 0x42 ; 66 2a94a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2a94e: 9f 93 push r25 2a950: 8f 93 push r24 2a952: 7f 93 push r23 2a954: 6f 93 push r22 2a956: 1f 92 push r1 2a958: 22 e3 ldi r18, 0x32 ; 50 2a95a: 2f 93 push r18 2a95c: 8a ef ldi r24, 0xFA ; 250 2a95e: 9a e9 ldi r25, 0x9A ; 154 2a960: 9f 93 push r25 2a962: 8f 93 push r24 2a964: 0e 94 cd 7d call 0xfb9a ; 0xfb9a const float short_length = spacing(layer_height, 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); static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f"; for (uint8_t i = step; i < step+4; ++i) 2a968: b3 94 inc r11 2a96a: 0f b6 in r0, 0x3f ; 63 2a96c: f8 94 cli 2a96e: de bf out 0x3e, r29 ; 62 2a970: 0f be out 0x3f, r0 ; 63 2a972: cd bf out 0x3d, r28 ; 61 2a974: 57 cf rjmp .-338 ; 0x2a824 enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); } } 2a976: 0f 90 pop r0 2a978: 0f 90 pop r0 2a97a: 0f 90 pop r0 2a97c: 0f 90 pop r0 2a97e: 0f 90 pop r0 2a980: df 91 pop r29 2a982: cf 91 pop r28 2a984: 1f 91 pop r17 2a986: 0f 91 pop r16 2a988: ff 90 pop r15 2a98a: ef 90 pop r14 2a98c: df 90 pop r13 2a98e: cf 90 pop r12 2a990: bf 90 pop r11 2a992: af 90 pop r10 2a994: 9f 90 pop r9 2a996: 8f 90 pop r8 2a998: 7f 90 pop r7 2a99a: 6f 90 pop r6 2a99c: 5f 90 pop r5 2a99e: 4f 90 pop r4 2a9a0: 3f 90 pop r3 2a9a2: 2f 90 pop r2 2a9a4: 08 95 ret 0002a9a6 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2a9a6: 9f b7 in r25, 0x3f ; 63 2a9a8: 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)); 2a9aa: 80 e1 ldi r24, 0x10 ; 16 2a9ac: e6 ea ldi r30, 0xA6 ; 166 2a9ae: f6 e0 ldi r31, 0x06 ; 6 2a9b0: a6 eb ldi r26, 0xB6 ; 182 2a9b2: b6 e0 ldi r27, 0x06 ; 6 2a9b4: 01 90 ld r0, Z+ 2a9b6: 0d 92 st X+, r0 2a9b8: 8a 95 dec r24 2a9ba: e1 f7 brne .-8 ; 0x2a9b4 CRITICAL_SECTION_END; 2a9bc: 9f bf out 0x3f, r25 ; 63 } 2a9be: 08 95 ret 0002a9c0 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2a9c0: 89 e0 ldi r24, 0x09 ; 9 2a9c2: 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])) 2a9c6: e7 e3 ldi r30, 0x37 ; 55 2a9c8: fb e9 ldi r31, 0x9B ; 155 2a9ca: 85 91 lpm r24, Z+ 2a9cc: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2a9ce: 0e 94 32 6d call 0xda64 ; 0xda64 2a9d2: 0c 94 93 e6 jmp 0x1cd26 ; 0x1cd26 0002a9d6 : 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) { 2a9d6: 1f 93 push r17 2a9d8: cf 93 push r28 2a9da: df 93 push r29 2a9dc: ec 01 movw r28, r24 2a9de: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2a9e0: 0f 94 a0 22 call 0x24540 ; 0x24540 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))); 2a9e4: fe 01 movw r30, r28 2a9e6: 34 96 adiw r30, 0x04 ; 4 2a9e8: 25 91 lpm r18, Z+ 2a9ea: 35 91 lpm r19, Z+ 2a9ec: 45 91 lpm r20, Z+ 2a9ee: 54 91 lpm r21, Z 2a9f0: fe 01 movw r30, r28 2a9f2: 65 91 lpm r22, Z+ 2a9f4: 75 91 lpm r23, Z+ 2a9f6: 85 91 lpm r24, Z+ 2a9f8: 94 91 lpm r25, Z 2a9fa: 0f 94 62 88 call 0x310c4 ; 0x310c4 step++; 2a9fe: 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) { 2aa00: 11 50 subi r17, 0x01 ; 1 2aa02: 81 f7 brne .-32 ; 0x2a9e4 2aa04: 0f 94 a0 22 call 0x24540 ; 0x24540 // 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(); } 2aa08: df 91 pop r29 2aa0a: cf 91 pop r28 2aa0c: 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(); 2aa0e: 0d 94 60 88 jmp 0x310c0 ; 0x310c0 0002aa12 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2aa12: 0e 94 49 61 call 0xc292 ; 0xc292 2aa16: 81 11 cpse r24, r1 2aa18: 04 c0 rjmp .+8 ; 0x2aa22 lcd_setstatuspgm(MSG_WELCOME); 2aa1a: 8b e0 ldi r24, 0x0B ; 11 2aa1c: 9c e6 ldi r25, 0x6C ; 108 2aa1e: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 } custom_message_type = CustomMsg::Status; 2aa22: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 2aa26: 08 95 ret 0002aa28 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2aa28: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2aa2c: 88 23 and r24, r24 2aa2e: 11 f0 breq .+4 ; 0x2aa34 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; 2aa30: 81 e0 ldi r24, 0x01 ; 1 2aa32: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2aa34: 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; } } 2aa36: 08 95 ret 0002aa38 : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2aa38: 2f 92 push r2 2aa3a: 3f 92 push r3 2aa3c: 4f 92 push r4 2aa3e: 5f 92 push r5 2aa40: 6f 92 push r6 2aa42: 7f 92 push r7 2aa44: 8f 92 push r8 2aa46: 9f 92 push r9 2aa48: af 92 push r10 2aa4a: bf 92 push r11 2aa4c: cf 92 push r12 2aa4e: df 92 push r13 2aa50: ef 92 push r14 2aa52: ff 92 push r15 2aa54: 0f 93 push r16 2aa56: 1f 93 push r17 2aa58: cf 93 push r28 2aa5a: df 93 push r29 2aa5c: 00 d0 rcall .+0 ; 0x2aa5e 2aa5e: 00 d0 rcall .+0 ; 0x2aa60 2aa60: 00 d0 rcall .+0 ; 0x2aa62 2aa62: 1f 92 push r1 2aa64: 1f 92 push r1 2aa66: cd b7 in r28, 0x3d ; 61 2aa68: de b7 in r29, 0x3e ; 62 2aa6a: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2aa6c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 2aa70: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2aa72: 81 e0 ldi r24, 0x01 ; 1 2aa74: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> #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) 2aa78: 9b 81 ldd r25, Y+3 ; 0x03 2aa7a: 92 30 cpi r25, 0x02 ; 2 2aa7c: 09 f4 brne .+2 ; 0x2aa80 2aa7e: 5b c1 rjmp .+694 ; 0x2ad36 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); 2aa80: a9 2f mov r26, r25 2aa82: b0 e0 ldi r27, 0x00 ; 0 2aa84: ba 83 std Y+2, r27 ; 0x02 2aa86: a9 83 std Y+1, r26 ; 0x01 2aa88: fd 01 movw r30, r26 2aa8a: ef 50 subi r30, 0x0F ; 15 2aa8c: f6 46 sbci r31, 0x66 ; 102 #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); 2aa8e: 24 91 lpm r18, Z 2aa90: 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]; 2aa92: 8d 01 movw r16, r26 2aa94: 00 0f add r16, r16 2aa96: 11 1f adc r17, r17 2aa98: 00 0f add r16, r16 2aa9a: 11 1f adc r17, r17 2aa9c: f8 01 movw r30, r16 2aa9e: ed 50 subi r30, 0x0D ; 13 2aaa0: fd 4f sbci r31, 0xFD ; 253 2aaa2: 40 80 ld r4, Z 2aaa4: 51 80 ldd r5, Z+1 ; 0x01 2aaa6: 62 80 ldd r6, Z+2 ; 0x02 2aaa8: 73 80 ldd r7, Z+3 ; 0x03 2aaaa: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2aaae: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2aab2: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2aab6: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2aaba: c3 01 movw r24, r6 2aabc: b2 01 movw r22, r4 2aabe: 0e 94 4e 60 call 0xc09c ; 0xc09c 2aac2: 4b 01 movw r8, r22 2aac4: 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; 2aac6: c8 01 movw r24, r16 2aac8: 8b 50 subi r24, 0x0B ; 11 2aaca: 9e 4e sbci r25, 0xEE ; 238 2aacc: 1c 01 movw r2, r24 2aace: dc 01 movw r26, r24 2aad0: 1d 92 st X+, r1 2aad2: 1d 92 st X+, r1 2aad4: 1d 92 st X+, r1 2aad6: 1c 92 st X, r1 2aad8: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2aada: 0f 94 90 84 call 0x30920 ; 0x30920 set_destination_to_current(); 2aade: 0e 94 b7 61 call 0xc36e ; 0xc36e // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2aae2: bc 81 ldd r27, Y+4 ; 0x04 2aae4: 6b 2f mov r22, r27 2aae6: bb 0f add r27, r27 2aae8: 77 0b sbc r23, r23 2aaea: 88 0b sbc r24, r24 2aaec: 99 0b sbc r25, r25 2aaee: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2aaf2: 6b 01 movw r12, r22 2aaf4: 7c 01 movw r14, r24 2aaf6: f8 01 movw r30, r16 2aaf8: ed 56 subi r30, 0x6D ; 109 2aafa: f9 4f sbci r31, 0xF9 ; 249 2aafc: fb 87 std Y+11, r31 ; 0x0b 2aafe: ea 87 std Y+10, r30 ; 0x0a 2ab00: 20 e0 ldi r18, 0x00 ; 0 2ab02: 30 e0 ldi r19, 0x00 ; 0 2ab04: 40 e4 ldi r20, 0x40 ; 64 2ab06: 50 ec ldi r21, 0xC0 ; 192 2ab08: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ab0c: aa 85 ldd r26, Y+10 ; 0x0a 2ab0e: bb 85 ldd r27, Y+11 ; 0x0b 2ab10: 6d 93 st X+, r22 2ab12: 7d 93 st X+, r23 2ab14: 8d 93 st X+, r24 2ab16: 9c 93 st X, r25 2ab18: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ab1a: c5 01 movw r24, r10 2ab1c: b4 01 movw r22, r8 2ab1e: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2ab22: 0f 94 a0 22 call 0x24540 ; 0x24540 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2ab26: 0f 94 f4 2c call 0x259e8 ; 0x259e8 2ab2a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(false); current_position[axis] = 0; 2ab2e: f1 01 movw r30, r2 2ab30: 10 82 st Z, r1 2ab32: 11 82 std Z+1, r1 ; 0x01 2ab34: 12 82 std Z+2, r1 ; 0x02 2ab36: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2ab38: 0f 94 90 84 call 0x30920 ; 0x30920 destination[axis] = 1. * axis_home_dir; 2ab3c: aa 85 ldd r26, Y+10 ; 0x0a 2ab3e: bb 85 ldd r27, Y+11 ; 0x0b 2ab40: cd 92 st X+, r12 2ab42: dd 92 st X+, r13 2ab44: ed 92 st X+, r14 2ab46: fc 92 st X, r15 2ab48: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ab4a: c5 01 movw r24, r10 2ab4c: b4 01 movw r22, r8 2ab4e: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2ab52: 0f 94 a0 22 call 0x24540 ; 0x24540 2ab56: b1 e0 ldi r27, 0x01 ; 1 2ab58: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.362> { 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); 2ab5c: f8 01 movw r30, r16 2ab5e: eb 51 subi r30, 0x1B ; 27 2ab60: f6 46 sbci r31, 0x66 ; 102 #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); 2ab62: 85 91 lpm r24, Z+ 2ab64: 95 91 lpm r25, Z+ 2ab66: a5 91 lpm r26, Z+ 2ab68: b4 91 lpm r27, Z 2ab6a: 8e 83 std Y+6, r24 ; 0x06 2ab6c: 9f 83 std Y+7, r25 ; 0x07 2ab6e: a8 87 std Y+8, r26 ; 0x08 2ab70: 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); 2ab72: 2d ec ldi r18, 0xCD ; 205 2ab74: 3c ec ldi r19, 0xCC ; 204 2ab76: 4c e8 ldi r20, 0x8C ; 140 2ab78: 5f e3 ldi r21, 0x3F ; 63 2ab7a: c7 01 movw r24, r14 2ab7c: b6 01 movw r22, r12 2ab7e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ab82: 2e 81 ldd r18, Y+6 ; 0x06 2ab84: 3f 81 ldd r19, Y+7 ; 0x07 2ab86: 48 85 ldd r20, Y+8 ; 0x08 2ab88: 59 85 ldd r21, Y+9 ; 0x09 2ab8a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ab8e: aa 85 ldd r26, Y+10 ; 0x0a 2ab90: bb 85 ldd r27, Y+11 ; 0x0b 2ab92: 6d 93 st X+, r22 2ab94: 7d 93 st X+, r23 2ab96: 8d 93 st X+, r24 2ab98: 9c 93 st X, r25 2ab9a: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ab9c: c5 01 movw r24, r10 2ab9e: b4 01 movw r22, r8 2aba0: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2aba4: 0f 94 a0 22 call 0x24540 ; 0x24540 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(); 2aba8: 0f 94 f4 2c call 0x259e8 ; 0x259e8 2abac: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(false); current_position[axis] = 0; 2abb0: f1 01 movw r30, r2 2abb2: 10 82 st Z, r1 2abb4: 11 82 std Z+1, r1 ; 0x01 2abb6: 12 82 std Z+2, r1 ; 0x02 2abb8: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2abba: 0f 94 90 84 call 0x30920 ; 0x30920 destination[axis] = -10.f * axis_home_dir; 2abbe: 20 e0 ldi r18, 0x00 ; 0 2abc0: 30 e0 ldi r19, 0x00 ; 0 2abc2: 40 e2 ldi r20, 0x20 ; 32 2abc4: 51 ec ldi r21, 0xC1 ; 193 2abc6: c7 01 movw r24, r14 2abc8: b6 01 movw r22, r12 2abca: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2abce: aa 85 ldd r26, Y+10 ; 0x0a 2abd0: bb 85 ldd r27, Y+11 ; 0x0b 2abd2: 6d 93 st X+, r22 2abd4: 7d 93 st X+, r23 2abd6: 8d 93 st X+, r24 2abd8: 9c 93 st X, r25 2abda: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2abdc: c5 01 movw r24, r10 2abde: b4 01 movw r22, r8 2abe0: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2abe4: 0f 94 a0 22 call 0x24540 ; 0x24540 endstops_hit_on_purpose(); 2abe8: 0f 94 f4 2c call 0x259e8 ; 0x259e8 2abec: b1 e0 ldi r27, 0x01 ; 1 2abee: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.362> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; 2abf2: 20 e0 ldi r18, 0x00 ; 0 2abf4: 30 e0 ldi r19, 0x00 ; 0 2abf6: 40 e3 ldi r20, 0x30 ; 48 2abf8: 51 e4 ldi r21, 0x41 ; 65 2abfa: c7 01 movw r24, r14 2abfc: b6 01 movw r22, r12 2abfe: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ac02: ea 85 ldd r30, Y+10 ; 0x0a 2ac04: fb 85 ldd r31, Y+11 ; 0x0b 2ac06: 60 83 st Z, r22 2ac08: 71 83 std Z+1, r23 ; 0x01 2ac0a: 82 83 std Z+2, r24 ; 0x02 2ac0c: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2ac0e: 20 e0 ldi r18, 0x00 ; 0 2ac10: 30 e0 ldi r19, 0x00 ; 0 2ac12: 40 e0 ldi r20, 0x00 ; 0 2ac14: 5f e3 ldi r21, 0x3F ; 63 2ac16: c3 01 movw r24, r6 2ac18: b2 01 movw r22, r4 2ac1a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ac1e: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2ac22: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2ac26: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2ac2a: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ac2e: 0e 94 4e 60 call 0xc09c ; 0xc09c 2ac32: 6b 01 movw r12, r22 2ac34: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ac36: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2ac3a: 0f 94 a0 22 call 0x24540 ; 0x24540 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(); 2ac3e: 0f 94 f4 2c call 0x259e8 ; 0x259e8 2ac42: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); tmc2130_home_exit(); #endif //TMC2130 axis_is_at_home(axis); 2ac46: 8b 81 ldd r24, Y+3 ; 0x03 2ac48: 0e 94 98 60 call 0xc130 ; 0xc130 axis_known_position[axis] = true; 2ac4c: e9 81 ldd r30, Y+1 ; 0x01 2ac4e: fa 81 ldd r31, Y+2 ; 0x02 2ac50: ed 55 subi r30, 0x5D ; 93 2ac52: f9 4f sbci r31, 0xF9 ; 249 2ac54: 21 e0 ldi r18, 0x01 ; 1 2ac56: 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; 2ac58: 8c 81 ldd r24, Y+4 ; 0x04 2ac5a: 99 27 eor r25, r25 2ac5c: 81 95 neg r24 2ac5e: 0c f4 brge .+2 ; 0x2ac62 2ac60: 90 95 com r25 2ac62: bc 01 movw r22, r24 2ac64: 07 2e mov r0, r23 2ac66: 00 0c add r0, r0 2ac68: 88 0b sbc r24, r24 2ac6a: 99 0b sbc r25, r25 2ac6c: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2ac70: 2a e0 ldi r18, 0x0A ; 10 2ac72: 37 ed ldi r19, 0xD7 ; 215 2ac74: 43 e2 ldi r20, 0x23 ; 35 2ac76: 5c e3 ldi r21, 0x3C ; 60 2ac78: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ac7c: 20 e0 ldi r18, 0x00 ; 0 2ac7e: 30 e0 ldi r19, 0x00 ; 0 2ac80: 40 e8 ldi r20, 0x80 ; 128 2ac82: 52 e4 ldi r21, 0x42 ; 66 2ac84: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ac88: 4b 01 movw r8, r22 2ac8a: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2ac8c: ac 01 movw r20, r24 2ac8e: 9b 01 movw r18, r22 2ac90: d1 01 movw r26, r2 2ac92: 6d 91 ld r22, X+ 2ac94: 7d 91 ld r23, X+ 2ac96: 8d 91 ld r24, X+ 2ac98: 9c 91 ld r25, X 2ac9a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2ac9e: f1 01 movw r30, r2 2aca0: 60 83 st Z, r22 2aca2: 71 83 std Z+1, r23 ; 0x01 2aca4: 82 83 std Z+2, r24 ; 0x02 2aca6: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2aca8: 0f 94 90 84 call 0x30920 ; 0x30920 current_position[axis] += dist; 2acac: d1 01 movw r26, r2 2acae: 2d 91 ld r18, X+ 2acb0: 3d 91 ld r19, X+ 2acb2: 4d 91 ld r20, X+ 2acb4: 5c 91 ld r21, X 2acb6: c5 01 movw r24, r10 2acb8: b4 01 movw r22, r8 2acba: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2acbe: f1 01 movw r30, r2 2acc0: 60 83 st Z, r22 2acc2: 71 83 std Z+1, r23 ; 0x01 2acc4: 82 83 std Z+2, r24 ; 0x02 2acc6: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2acc8: aa 85 ldd r26, Y+10 ; 0x0a 2acca: bb 85 ldd r27, Y+11 ; 0x0b 2accc: 6d 93 st X+, r22 2acce: 7d 93 st X+, r23 2acd0: 8d 93 st X+, r24 2acd2: 9c 93 st X, r25 2acd4: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2acd6: 20 e0 ldi r18, 0x00 ; 0 2acd8: 30 e0 ldi r19, 0x00 ; 0 2acda: 40 e0 ldi r20, 0x00 ; 0 2acdc: 5f e3 ldi r21, 0x3F ; 63 2acde: c7 01 movw r24, r14 2ace0: b6 01 movw r22, r12 2ace2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ace6: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2acea: 0f 94 a0 22 call 0x24540 ; 0x24540 feedrate = 0.0; 2acee: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2acf2: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2acf6: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2acfa: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2acfe: 2d 81 ldd r18, Y+5 ; 0x05 2ad00: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.362> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2ad04: 2b 96 adiw r28, 0x0b ; 11 2ad06: 0f b6 in r0, 0x3f ; 63 2ad08: f8 94 cli 2ad0a: de bf out 0x3e, r29 ; 62 2ad0c: 0f be out 0x3f, r0 ; 63 2ad0e: cd bf out 0x3d, r28 ; 61 2ad10: df 91 pop r29 2ad12: cf 91 pop r28 2ad14: 1f 91 pop r17 2ad16: 0f 91 pop r16 2ad18: ff 90 pop r15 2ad1a: ef 90 pop r14 2ad1c: df 90 pop r13 2ad1e: cf 90 pop r12 2ad20: bf 90 pop r11 2ad22: af 90 pop r10 2ad24: 9f 90 pop r9 2ad26: 8f 90 pop r8 2ad28: 7f 90 pop r7 2ad2a: 6f 90 pop r6 2ad2c: 5f 90 pop r5 2ad2e: 4f 90 pop r4 2ad30: 3f 90 pop r3 2ad32: 2f 90 pop r2 2ad34: 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); 2ad36: e3 ef ldi r30, 0xF3 ; 243 2ad38: f9 e9 ldi r31, 0x99 ; 153 2ad3a: b4 91 lpm r27, Z 2ad3c: 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; 2ad3e: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2ad42: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2ad46: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2ad4a: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2ad4e: 0f 94 90 84 call 0x30920 ; 0x30920 #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); 2ad52: ed ee ldi r30, 0xED ; 237 2ad54: f9 e9 ldi r31, 0x99 ; 153 2ad56: 85 90 lpm r8, Z+ 2ad58: 95 90 lpm r9, Z+ 2ad5a: a5 90 lpm r10, Z+ 2ad5c: 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; 2ad5e: e9 81 ldd r30, Y+1 ; 0x01 2ad60: 6e 2f mov r22, r30 2ad62: ee 0f add r30, r30 2ad64: 77 0b sbc r23, r23 2ad66: 88 0b sbc r24, r24 2ad68: 99 0b sbc r25, r25 2ad6a: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2ad6e: 6b 01 movw r12, r22 2ad70: 7c 01 movw r14, r24 2ad72: 20 e0 ldi r18, 0x00 ; 0 2ad74: 30 e0 ldi r19, 0x00 ; 0 2ad76: 40 ec ldi r20, 0xC0 ; 192 2ad78: 5f e3 ldi r21, 0x3F ; 63 2ad7a: c5 01 movw r24, r10 2ad7c: b4 01 movw r22, r8 2ad7e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ad82: a7 01 movw r20, r14 2ad84: 96 01 movw r18, r12 2ad86: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ad8a: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ad8e: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ad92: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ad96: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis]; 2ad9a: 80 e0 ldi r24, 0x00 ; 0 2ad9c: 90 e0 ldi r25, 0x00 ; 0 2ad9e: a8 e4 ldi r26, 0x48 ; 72 2ada0: b4 e4 ldi r27, 0x44 ; 68 2ada2: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ada6: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2adaa: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2adae: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2adb2: bc 01 movw r22, r24 2adb4: cd 01 movw r24, r26 2adb6: 0e 94 4e 60 call 0xc09c ; 0xc09c 2adba: 4b 01 movw r8, r22 2adbc: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2adbe: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2adc2: 0f 94 a0 22 call 0x24540 ; 0x24540 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2adc6: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2adca: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2adce: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2add2: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2add6: 0f 94 90 84 call 0x30920 ; 0x30920 #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); 2adda: 01 ee ldi r16, 0xE1 ; 225 2addc: 19 e9 ldi r17, 0x99 ; 153 2adde: f8 01 movw r30, r16 2ade0: 65 91 lpm r22, Z+ 2ade2: 75 91 lpm r23, Z+ 2ade4: 85 91 lpm r24, Z+ 2ade6: 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; 2ade8: 90 58 subi r25, 0x80 ; 128 2adea: a7 01 movw r20, r14 2adec: 96 01 movw r18, r12 2adee: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2adf2: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2adf6: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2adfa: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2adfe: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ae02: c5 01 movw r24, r10 2ae04: b4 01 movw r22, r8 2ae06: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2ae0a: 0f 94 a0 22 call 0x24540 ; 0x24540 #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); 2ae0e: f8 01 movw r30, r16 2ae10: 65 91 lpm r22, Z+ 2ae12: 75 91 lpm r23, Z+ 2ae14: 85 91 lpm r24, Z+ 2ae16: 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; 2ae18: 9b 01 movw r18, r22 2ae1a: ac 01 movw r20, r24 2ae1c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2ae20: a7 01 movw r20, r14 2ae22: 96 01 movw r18, r12 2ae24: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ae28: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ae2c: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ae30: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ae34: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis] / 2; 2ae38: 80 e0 ldi r24, 0x00 ; 0 2ae3a: 90 e0 ldi r25, 0x00 ; 0 2ae3c: a8 ec ldi r26, 0xC8 ; 200 2ae3e: b3 e4 ldi r27, 0x43 ; 67 2ae40: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ae44: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2ae48: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2ae4c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ae50: bc 01 movw r22, r24 2ae52: cd 01 movw r24, r26 2ae54: 0e 94 4e 60 call 0xc09c ; 0xc09c plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ae58: 0f 94 9d 85 call 0x30b3a ; 0x30b3a st_synchronize(); 2ae5c: 0f 94 a0 22 call 0x24540 ; 0x24540 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2ae60: 82 e0 ldi r24, 0x02 ; 2 2ae62: 0e 94 98 60 call 0xc130 ; 0xc130 destination[axis] = current_position[axis]; 2ae66: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 2ae6a: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 2ae6e: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 2ae72: b0 91 00 12 lds r27, 0x1200 ; 0x801200 2ae76: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2ae7a: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 2ae7e: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 2ae82: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e feedrate = 0.0; 2ae86: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2ae8a: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2ae8e: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2ae92: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2ae96: 0f 94 f4 2c call 0x259e8 ; 0x259e8 axis_known_position[axis] = true; 2ae9a: f1 e0 ldi r31, 0x01 ; 1 2ae9c: f0 93 a5 06 sts 0x06A5, r31 ; 0x8006a5 2aea0: 2e cf rjmp .-420 ; 0x2acfe 0002aea2 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2aea2: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c memset(z_values, 0, sizeof(z_values)); 2aea6: ed e9 ldi r30, 0x9D ; 157 2aea8: f2 e1 ldi r31, 0x12 ; 18 2aeaa: 84 ec ldi r24, 0xC4 ; 196 2aeac: df 01 movw r26, r30 2aeae: 1d 92 st X+, r1 2aeb0: 8a 95 dec r24 2aeb2: e9 f7 brne .-6 ; 0x2aeae } 2aeb4: 08 95 ret 0002aeb6 : 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 2aeb6: 2f 92 push r2 2aeb8: 3f 92 push r3 2aeba: 4f 92 push r4 2aebc: 5f 92 push r5 2aebe: 6f 92 push r6 2aec0: 7f 92 push r7 2aec2: 8f 92 push r8 2aec4: 9f 92 push r9 2aec6: af 92 push r10 2aec8: bf 92 push r11 2aeca: cf 92 push r12 2aecc: df 92 push r13 2aece: ef 92 push r14 2aed0: ff 92 push r15 2aed2: 0f 93 push r16 2aed4: 1f 93 push r17 2aed6: cf 93 push r28 2aed8: df 93 push r29 2aeda: 00 d0 rcall .+0 ; 0x2aedc 2aedc: cd b7 in r28, 0x3d ; 61 2aede: de b7 in r29, 0x3e ; 62 2aee0: 4b 01 movw r8, r22 2aee2: 5c 01 movw r10, r24 2aee4: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2aee6: 81 e0 ldi r24, 0x01 ; 1 2aee8: 80 93 92 06 sts 0x0692, r24 ; 0x800692 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2aeec: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 2aef0: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2aef2: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> //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); 2aef6: 80 e0 ldi r24, 0x00 ; 0 2aef8: 0f 94 d8 2c call 0x259b0 ; 0x259b0 2aefc: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2aefe: 0f 94 e6 2c call 0x259cc ; 0x259cc // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2af02: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2af06: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2af0a: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2af0e: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 2af12: 65 e5 ldi r22, 0x55 ; 85 2af14: 75 e5 ldi r23, 0x55 ; 85 2af16: 85 e5 ldi r24, 0x55 ; 85 2af18: 91 e4 ldi r25, 0x41 ; 65 2af1a: 0f 94 82 88 call 0x31104 ; 0x31104 // 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(); 2af1e: 0f 94 b0 8e call 0x31d60 ; 0x31d60 if (! endstop_z_hit_on_purpose()) 2af22: 0f 94 e6 2c call 0x259cc ; 0x259cc 2af26: 8b 83 std Y+3, r24 ; 0x03 2af28: 88 23 and r24, r24 2af2a: 09 f4 brne .+2 ; 0x2af2e 2af2c: eb c0 rjmp .+470 ; 0x2b104 { //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) 2af2e: 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; 2af30: c1 2c mov r12, r1 2af32: d1 2c mov r13, r1 2af34: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2af36: 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) 2af38: 8a 81 ldd r24, Y+2 ; 0x02 2af3a: 80 17 cp r24, r16 2af3c: 08 f0 brcs .+2 ; 0x2af40 2af3e: a4 c0 rjmp .+328 ; 0x2b088 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2af40: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2af44: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2af48: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2af4c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2af50: 20 e0 ldi r18, 0x00 ; 0 2af52: 30 e0 ldi r19, 0x00 ; 0 2af54: 40 e0 ldi r20, 0x00 ; 0 2af56: 5f e3 ldi r21, 0x3F ; 63 2af58: 31 10 cpse r3, r1 2af5a: 04 c0 rjmp .+8 ; 0x2af64 2af5c: 2d ec ldi r18, 0xCD ; 205 2af5e: 3c ec ldi r19, 0xCC ; 204 2af60: 4c e4 ldi r20, 0x4C ; 76 2af62: 5e e3 ldi r21, 0x3E ; 62 2af64: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2af68: 2b 01 movw r4, r22 2af6a: 3c 01 movw r6, r24 2af6c: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 2af70: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 2af74: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 2af78: 70 92 00 12 sts 0x1200, r7 ; 0x801200 float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2af7c: 65 e5 ldi r22, 0x55 ; 85 2af7e: 75 e5 ldi r23, 0x55 ; 85 2af80: 85 e5 ldi r24, 0x55 ; 85 2af82: 91 e4 ldi r25, 0x41 ; 65 2af84: 0f 94 82 88 call 0x31104 ; 0x31104 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2af88: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2af8c: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2af90: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2af94: 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)); 2af98: 65 e5 ldi r22, 0x55 ; 85 2af9a: 75 e5 ldi r23, 0x55 ; 85 2af9c: 85 e5 ldi r24, 0x55 ; 85 2af9e: 90 e4 ldi r25, 0x40 ; 64 2afa0: 0f 94 82 88 call 0x31104 ; 0x31104 // 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(); 2afa4: 0f 94 b0 8e call 0x31d60 ; 0x31d60 //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) { 2afa8: a3 01 movw r20, r6 2afaa: 92 01 movw r18, r4 2afac: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2afb0: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2afb4: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2afb8: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2afbc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2afc0: 9f 77 andi r25, 0x7F ; 127 2afc2: 2d ec ldi r18, 0xCD ; 205 2afc4: 3c ec ldi r19, 0xCC ; 204 2afc6: 4c ec ldi r20, 0xCC ; 204 2afc8: 5c e3 ldi r21, 0x3C ; 60 2afca: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2afce: 87 ff sbrs r24, 7 2afd0: 16 c0 rjmp .+44 ; 0x2affe //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2afd2: 60 e0 ldi r22, 0x00 ; 0 2afd4: 70 e0 ldi r23, 0x00 ; 0 2afd6: 80 e0 ldi r24, 0x00 ; 0 2afd8: 9f e3 ldi r25, 0x3F ; 63 2afda: 0e 94 5e 67 call 0xcebc ; 0xcebc current_position[Z_AXIS] = minimum_z; 2afde: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2afe2: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2afe6: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2afea: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2afee: 65 e5 ldi r22, 0x55 ; 85 2aff0: 75 e5 ldi r23, 0x55 ; 85 2aff2: 85 e5 ldi r24, 0x55 ; 85 2aff4: 90 e4 ldi r25, 0x40 ; 64 2aff6: 0f 94 82 88 call 0x31104 ; 0x31104 // 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(); 2affa: 0f 94 b0 8e call 0x31d60 ; 0x31d60 } if (!endstop_z_hit_on_purpose()) 2affe: 0f 94 e6 2c call 0x259cc ; 0x259cc 2b002: 28 2e mov r2, r24 2b004: 88 23 and r24, r24 2b006: 09 f4 brne .+2 ; 0x2b00a 2b008: 7d c0 rjmp .+250 ; 0x2b104 2b00a: 40 90 fd 11 lds r4, 0x11FD ; 0x8011fd 2b00e: 50 90 fe 11 lds r5, 0x11FE ; 0x8011fe 2b012: 60 90 ff 11 lds r6, 0x11FF ; 0x8011ff 2b016: 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; 2b01a: 9a 81 ldd r25, Y+2 ; 0x02 2b01c: 99 23 and r25, r25 2b01e: d9 f0 breq .+54 ; 0x2b056 2b020: 69 2f mov r22, r25 2b022: 70 e0 ldi r23, 0x00 ; 0 2b024: 90 e0 ldi r25, 0x00 ; 0 2b026: 80 e0 ldi r24, 0x00 ; 0 2b028: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b02c: 9b 01 movw r18, r22 2b02e: ac 01 movw r20, r24 2b030: c7 01 movw r24, r14 2b032: b6 01 movw r22, r12 2b034: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2b038: 9b 01 movw r18, r22 2b03a: ac 01 movw r20, r24 2b03c: c3 01 movw r24, r6 2b03e: b2 01 movw r22, r4 2b040: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b044: 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 2b046: 2d ec ldi r18, 0xCD ; 205 2b048: 3c ec ldi r19, 0xCC ; 204 2b04a: 4c e4 ldi r20, 0x4C ; 76 2b04c: 5d e3 ldi r21, 0x3D ; 61 2b04e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2b052: 18 16 cp r1, r24 2b054: 64 f0 brlt .+24 ; 0x2b06e #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]; 2b056: a3 01 movw r20, r6 2b058: 92 01 movw r18, r4 2b05a: c7 01 movw r24, r14 2b05c: b6 01 movw r22, r12 2b05e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b062: 6b 01 movw r12, r22 2b064: 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) 2b066: 8a 81 ldd r24, Y+2 ; 0x02 2b068: 8f 5f subi r24, 0xFF ; 255 2b06a: 8a 83 std Y+2, r24 ; 0x02 2b06c: 65 cf rjmp .-310 ; 0x2af38 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 2b06e: 31 10 cpse r3, r1 2b070: 49 c0 rjmp .+146 ; 0x2b104 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2b072: 84 ef ldi r24, 0xF4 ; 244 2b074: 91 e0 ldi r25, 0x01 ; 1 2b076: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 //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; 2b07a: 32 2c mov r3, r2 i = -1; 2b07c: 2f ef ldi r18, 0xFF ; 255 2b07e: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2b080: c1 2c mov r12, r1 2b082: d1 2c mov r13, r1 2b084: 76 01 movw r14, r12 2b086: ef cf rjmp .-34 ; 0x2b066 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2b088: 02 30 cpi r16, 0x02 ; 2 2b08a: 38 f5 brcc .+78 ; 0x2b0da goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2b08c: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 2b090: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 2b094: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 2b098: f0 92 00 12 sts 0x1200, r15 ; 0x801200 2b09c: 99 81 ldd r25, Y+1 ; 0x01 2b09e: 90 93 77 02 sts 0x0277, r25 ; 0x800277 <_ZL14check_endstops.lto_priv.362> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2b0a2: 81 2f mov r24, r17 2b0a4: 0f 94 d8 2c call 0x259b0 ; 0x259b0 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2b0a8: 10 92 92 06 sts 0x0692, r1 ; 0x800692 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2b0ac: 8b 81 ldd r24, Y+3 ; 0x03 2b0ae: 0f 90 pop r0 2b0b0: 0f 90 pop r0 2b0b2: 0f 90 pop r0 2b0b4: df 91 pop r29 2b0b6: cf 91 pop r28 2b0b8: 1f 91 pop r17 2b0ba: 0f 91 pop r16 2b0bc: ff 90 pop r15 2b0be: ef 90 pop r14 2b0c0: df 90 pop r13 2b0c2: cf 90 pop r12 2b0c4: bf 90 pop r11 2b0c6: af 90 pop r10 2b0c8: 9f 90 pop r9 2b0ca: 8f 90 pop r8 2b0cc: 7f 90 pop r7 2b0ce: 6f 90 pop r6 2b0d0: 5f 90 pop r5 2b0d2: 4f 90 pop r4 2b0d4: 3f 90 pop r3 2b0d6: 2f 90 pop r2 2b0d8: 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); 2b0da: 60 2f mov r22, r16 2b0dc: 70 e0 ldi r23, 0x00 ; 0 2b0de: 90 e0 ldi r25, 0x00 ; 0 2b0e0: 80 e0 ldi r24, 0x00 ; 0 2b0e2: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2b0e6: 9b 01 movw r18, r22 2b0e8: ac 01 movw r20, r24 2b0ea: c7 01 movw r24, r14 2b0ec: b6 01 movw r22, r12 2b0ee: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2b0f2: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 2b0f6: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 2b0fa: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 2b0fe: 90 93 00 12 sts 0x1200, r25 ; 0x801200 2b102: cc cf rjmp .-104 ; 0x2b09c 2b104: 29 81 ldd r18, Y+1 ; 0x01 2b106: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.362> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2b10a: 81 2f mov r24, r17 2b10c: 0f 94 d8 2c call 0x259b0 ; 0x259b0 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2b110: 10 92 92 06 sts 0x0692, r1 ; 0x800692 return false; 2b114: 1b 82 std Y+3, r1 ; 0x03 2b116: ca cf rjmp .-108 ; 0x2b0ac 0002b118 : /// 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){ 2b118: 2f 92 push r2 2b11a: 3f 92 push r3 2b11c: 4f 92 push r4 2b11e: 5f 92 push r5 2b120: 6f 92 push r6 2b122: 7f 92 push r7 2b124: 8f 92 push r8 2b126: 9f 92 push r9 2b128: af 92 push r10 2b12a: bf 92 push r11 2b12c: cf 92 push r12 2b12e: df 92 push r13 2b130: ef 92 push r14 2b132: ff 92 push r15 2b134: 0f 93 push r16 2b136: 1f 93 push r17 2b138: cf 93 push r28 2b13a: df 93 push r29 2b13c: cd b7 in r28, 0x3d ; 61 2b13e: de b7 in r29, 0x3e ; 62 2b140: cd 5b subi r28, 0xBD ; 189 2b142: d1 40 sbci r29, 0x01 ; 1 2b144: 0f b6 in r0, 0x3f ; 63 2b146: f8 94 cli 2b148: de bf out 0x3e, r29 ; 62 2b14a: 0f be out 0x3f, r0 ; 63 2b14c: cd bf out 0x3d, r28 ; 61 2b14e: c3 57 subi r28, 0x73 ; 115 2b150: de 4f sbci r29, 0xFE ; 254 2b152: 99 83 std Y+1, r25 ; 0x01 2b154: 88 83 st Y, r24 2b156: cd 58 subi r28, 0x8D ; 141 2b158: d1 40 sbci r29, 0x01 ; 1 2b15a: c1 57 subi r28, 0x71 ; 113 2b15c: de 4f sbci r29, 0xFE ; 254 2b15e: 79 83 std Y+1, r23 ; 0x01 2b160: 68 83 st Y, r22 2b162: cf 58 subi r28, 0x8F ; 143 2b164: d1 40 sbci r29, 0x01 ; 1 2b166: ce 56 subi r28, 0x6E ; 110 2b168: de 4f sbci r29, 0xFE ; 254 2b16a: 59 83 std Y+1, r21 ; 0x01 2b16c: 48 83 st Y, r20 2b16e: c2 59 subi r28, 0x92 ; 146 2b170: d1 40 sbci r29, 0x01 ; 1 2b172: 84 e1 ldi r24, 0x14 ; 20 2b174: cf 56 subi r28, 0x6F ; 111 2b176: de 4f sbci r29, 0xFE ; 254 2b178: 88 83 st Y, r24 2b17a: c1 59 subi r28, 0x91 ; 145 2b17c: 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; 2b17e: ce 56 subi r28, 0x6E ; 110 2b180: de 4f sbci r29, 0xFE ; 254 2b182: a8 81 ld r26, Y 2b184: b9 81 ldd r27, Y+1 ; 0x01 2b186: c2 59 subi r28, 0x92 ; 146 2b188: d1 40 sbci r29, 0x01 ; 1 2b18a: 8d 91 ld r24, X+ 2b18c: 9d 91 ld r25, X+ 2b18e: 0d 90 ld r0, X+ 2b190: bc 91 ld r27, X 2b192: a0 2d mov r26, r0 2b194: c6 56 subi r28, 0x66 ; 102 2b196: de 4f sbci r29, 0xFE ; 254 2b198: 88 83 st Y, r24 2b19a: 99 83 std Y+1, r25 ; 0x01 2b19c: aa 83 std Y+2, r26 ; 0x02 2b19e: bb 83 std Y+3, r27 ; 0x03 2b1a0: ca 59 subi r28, 0x9A ; 154 2b1a2: d1 40 sbci r29, 0x01 ; 1 2b1a4: c1 57 subi r28, 0x71 ; 113 2b1a6: de 4f sbci r29, 0xFE ; 254 2b1a8: a8 81 ld r26, Y 2b1aa: b9 81 ldd r27, Y+1 ; 0x01 2b1ac: cf 58 subi r28, 0x8F ; 143 2b1ae: d1 40 sbci r29, 0x01 ; 1 2b1b0: 8d 91 ld r24, X+ 2b1b2: 9d 91 ld r25, X+ 2b1b4: 0d 90 ld r0, X+ 2b1b6: bc 91 ld r27, X 2b1b8: a0 2d mov r26, r0 2b1ba: ca 54 subi r28, 0x4A ; 74 2b1bc: de 4f sbci r29, 0xFE ; 254 2b1be: 88 83 st Y, r24 2b1c0: 99 83 std Y+1, r25 ; 0x01 2b1c2: aa 83 std Y+2, r26 ; 0x02 2b1c4: bb 83 std Y+3, r27 ; 0x03 2b1c6: c6 5b subi r28, 0xB6 ; 182 2b1c8: d1 40 sbci r29, 0x01 ; 1 2b1ca: c3 57 subi r28, 0x73 ; 115 2b1cc: de 4f sbci r29, 0xFE ; 254 2b1ce: a8 81 ld r26, Y 2b1d0: b9 81 ldd r27, Y+1 ; 0x01 2b1d2: cd 58 subi r28, 0x8D ; 141 2b1d4: d1 40 sbci r29, 0x01 ; 1 2b1d6: 8d 91 ld r24, X+ 2b1d8: 9d 91 ld r25, X+ 2b1da: 0d 90 ld r0, X+ 2b1dc: bc 91 ld r27, X 2b1de: a0 2d mov r26, r0 2b1e0: c6 54 subi r28, 0x46 ; 70 2b1e2: de 4f sbci r29, 0xFE ; 254 2b1e4: 88 83 st Y, r24 2b1e6: 99 83 std Y+1, r25 ; 0x01 2b1e8: aa 83 std Y+2, r26 ; 0x02 2b1ea: bb 83 std Y+3, r27 ; 0x03 2b1ec: ca 5b subi r28, 0xBA ; 186 2b1ee: d1 40 sbci r29, 0x01 ; 1 2b1f0: fe 01 movw r30, r28 2b1f2: e7 5f subi r30, 0xF7 ; 247 2b1f4: fe 4f sbci r31, 0xFE ; 254 2b1f6: c8 55 subi r28, 0x58 ; 88 2b1f8: de 4f sbci r29, 0xFE ; 254 2b1fa: f9 83 std Y+1, r31 ; 0x01 2b1fc: e8 83 st Y, r30 2b1fe: c8 5a subi r28, 0xA8 ; 168 2b200: d1 40 sbci r29, 0x01 ; 1 2b202: ce 01 movw r24, r28 2b204: 8b 57 subi r24, 0x7B ; 123 2b206: 9f 4f sbci r25, 0xFF ; 255 2b208: ca 55 subi r28, 0x5A ; 90 2b20a: de 4f sbci r29, 0xFE ; 254 2b20c: 99 83 std Y+1, r25 ; 0x01 2b20e: 88 83 st Y, r24 2b210: c6 5a subi r28, 0xA6 ; 166 2b212: d1 40 sbci r29, 0x01 ; 1 2b214: de 01 movw r26, r28 2b216: 11 96 adiw r26, 0x01 ; 1 2b218: c8 56 subi r28, 0x68 ; 104 2b21a: de 4f sbci r29, 0xFE ; 254 2b21c: b9 83 std Y+1, r27 ; 0x01 2b21e: a8 83 st Y, r26 2b220: c8 59 subi r28, 0x98 ; 152 2b222: d1 40 sbci r29, 0x01 ; 1 2b224: 31 2c mov r3, r1 2b226: 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; 2b228: b1 01 movw r22, r2 2b22a: 03 2c mov r0, r3 2b22c: 00 0c add r0, r0 2b22e: 88 0b sbc r24, r24 2b230: 99 0b sbc r25, r25 2b232: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b236: 2a e1 ldi r18, 0x1A ; 26 2b238: 38 ef ldi r19, 0xF8 ; 248 2b23a: 42 e4 ldi r20, 0x42 ; 66 2b23c: 5e e3 ldi r21, 0x3E ; 62 2b23e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b242: 6b 01 movw r12, r22 2b244: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b246: 0f 94 24 a6 call 0x34c48 ; 0x34c48 2b24a: c2 56 subi r28, 0x62 ; 98 2b24c: de 4f sbci r29, 0xFE ; 254 2b24e: 68 83 st Y, r22 2b250: 79 83 std Y+1, r23 ; 0x01 2b252: 8a 83 std Y+2, r24 ; 0x02 2b254: 9b 83 std Y+3, r25 ; 0x03 2b256: ce 59 subi r28, 0x9E ; 158 2b258: d1 40 sbci r29, 0x01 ; 1 2b25a: c7 01 movw r24, r14 2b25c: b6 01 movw r22, r12 2b25e: 0f 94 5e a3 call 0x346bc ; 0x346bc 2b262: ce 55 subi r28, 0x5E ; 94 2b264: de 4f sbci r29, 0xFE ; 254 2b266: 68 83 st Y, r22 2b268: 79 83 std Y+1, r23 ; 0x01 2b26a: 8a 83 std Y+2, r24 ; 0x02 2b26c: 9b 83 std Y+3, r25 ; 0x03 2b26e: c2 5a subi r28, 0xA2 ; 162 2b270: d1 40 sbci r29, 0x01 ; 1 2b272: 9b 01 movw r18, r22 2b274: ac 01 movw r20, r24 2b276: c6 56 subi r28, 0x66 ; 102 2b278: de 4f sbci r29, 0xFE ; 254 2b27a: 68 81 ld r22, Y 2b27c: 79 81 ldd r23, Y+1 ; 0x01 2b27e: 8a 81 ldd r24, Y+2 ; 0x02 2b280: 9b 81 ldd r25, Y+3 ; 0x03 2b282: ca 59 subi r28, 0x9A ; 154 2b284: d1 40 sbci r29, 0x01 ; 1 2b286: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b28a: c6 54 subi r28, 0x46 ; 70 2b28c: de 4f sbci r29, 0xFE ; 254 2b28e: 28 81 ld r18, Y 2b290: 39 81 ldd r19, Y+1 ; 0x01 2b292: 4a 81 ldd r20, Y+2 ; 0x02 2b294: 5b 81 ldd r21, Y+3 ; 0x03 2b296: ca 5b subi r28, 0xBA ; 186 2b298: d1 40 sbci r29, 0x01 ; 1 2b29a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b29e: 6b 01 movw r12, r22 2b2a0: 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) 2b2a2: 20 e0 ldi r18, 0x00 ; 0 2b2a4: 30 e0 ldi r19, 0x00 ; 0 2b2a6: a9 01 movw r20, r18 2b2a8: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2b2ac: 18 16 cp r1, r24 2b2ae: 0c f0 brlt .+2 ; 0x2b2b2 2b2b0: 7a c2 rjmp .+1268 ; 0x2b7a6 // 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; 2b2b2: c2 56 subi r28, 0x62 ; 98 2b2b4: de 4f sbci r29, 0xFE ; 254 2b2b6: 28 81 ld r18, Y 2b2b8: 39 81 ldd r19, Y+1 ; 0x01 2b2ba: 4a 81 ldd r20, Y+2 ; 0x02 2b2bc: 5b 81 ldd r21, Y+3 ; 0x03 2b2be: ce 59 subi r28, 0x9E ; 158 2b2c0: d1 40 sbci r29, 0x01 ; 1 2b2c2: c6 56 subi r28, 0x66 ; 102 2b2c4: de 4f sbci r29, 0xFE ; 254 2b2c6: 68 81 ld r22, Y 2b2c8: 79 81 ldd r23, Y+1 ; 0x01 2b2ca: 8a 81 ldd r24, Y+2 ; 0x02 2b2cc: 9b 81 ldd r25, Y+3 ; 0x03 2b2ce: ca 59 subi r28, 0x9A ; 154 2b2d0: d1 40 sbci r29, 0x01 ; 1 2b2d2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b2d6: ca 54 subi r28, 0x4A ; 74 2b2d8: de 4f sbci r29, 0xFE ; 254 2b2da: 28 81 ld r18, Y 2b2dc: 39 81 ldd r19, Y+1 ; 0x01 2b2de: 4a 81 ldd r20, Y+2 ; 0x02 2b2e0: 5b 81 ldd r21, Y+3 ; 0x03 2b2e2: c6 5b subi r28, 0xB6 ; 182 2b2e4: d1 40 sbci r29, 0x01 ; 1 2b2e6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b2ea: 4b 01 movw r8, r22 2b2ec: 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) 2b2ee: 20 e0 ldi r18, 0x00 ; 0 2b2f0: 30 e0 ldi r19, 0x00 ; 0 2b2f2: a9 01 movw r20, r18 2b2f4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2b2f8: 18 16 cp r1, r24 2b2fa: 0c f0 brlt .+2 ; 0x2b2fe 2b2fc: 54 c2 rjmp .+1192 ; 0x2b7a6 2b2fe: 20 e0 ldi r18, 0x00 ; 0 2b300: 30 e0 ldi r19, 0x00 ; 0 2b302: 48 ef ldi r20, 0xF8 ; 248 2b304: 51 e4 ldi r21, 0x41 ; 65 2b306: c7 01 movw r24, r14 2b308: b6 01 movw r22, r12 2b30a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2b30e: 87 ff sbrs r24, 7 2b310: 4a c2 rjmp .+1172 ; 0x2b7a6 2b312: 20 e0 ldi r18, 0x00 ; 0 2b314: 30 e0 ldi r19, 0x00 ; 0 2b316: 48 ef ldi r20, 0xF8 ; 248 2b318: 51 e4 ldi r21, 0x41 ; 65 2b31a: c5 01 movw r24, r10 2b31c: b4 01 movw r22, r8 2b31e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2b322: 87 ff sbrs r24, 7 2b324: 40 c2 rjmp .+1152 ; 0x2b7a6 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b326: c7 01 movw r24, r14 2b328: b6 01 movw r22, r12 2b32a: 0f 94 0b a4 call 0x34816 ; 0x34816 2b32e: 9b 01 movw r18, r22 2b330: ac 01 movw r20, r24 2b332: c7 01 movw r24, r14 2b334: b6 01 movw r22, r12 2b336: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b33a: 2b 01 movw r4, r22 2b33c: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b33e: c5 01 movw r24, r10 2b340: b4 01 movw r22, r8 2b342: 0f 94 0b a4 call 0x34816 ; 0x34816 2b346: 9b 01 movw r18, r22 2b348: ac 01 movw r20, r24 2b34a: c5 01 movw r24, r10 2b34c: b4 01 movw r22, r8 2b34e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b352: cc 56 subi r28, 0x6C ; 108 2b354: de 4f sbci r29, 0xFE ; 254 2b356: 68 83 st Y, r22 2b358: 79 83 std Y+1, r23 ; 0x01 2b35a: 8a 83 std Y+2, r24 ; 0x02 2b35c: 9b 83 std Y+3, r25 ; 0x03 2b35e: c4 59 subi r28, 0x94 ; 148 2b360: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b362: a3 01 movw r20, r6 2b364: 92 01 movw r18, r4 2b366: 60 e0 ldi r22, 0x00 ; 0 2b368: 70 e0 ldi r23, 0x00 ; 0 2b36a: 80 e8 ldi r24, 0x80 ; 128 2b36c: 9f e3 ldi r25, 0x3F ; 63 2b36e: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b372: c2 55 subi r28, 0x52 ; 82 2b374: de 4f sbci r29, 0xFE ; 254 2b376: 68 83 st Y, r22 2b378: 79 83 std Y+1, r23 ; 0x01 2b37a: 8a 83 std Y+2, r24 ; 0x02 2b37c: 9b 83 std Y+3, r25 ; 0x03 2b37e: ce 5a subi r28, 0xAE ; 174 2b380: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b382: cc 56 subi r28, 0x6C ; 108 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: c4 59 subi r28, 0x94 ; 148 2b390: d1 40 sbci r29, 0x01 ; 1 2b392: 60 e0 ldi r22, 0x00 ; 0 2b394: 70 e0 ldi r23, 0x00 ; 0 2b396: 80 e8 ldi r24, 0x80 ; 128 2b398: 9f e3 ldi r25, 0x3F ; 63 2b39a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b39e: ce 54 subi r28, 0x4E ; 78 2b3a0: de 4f sbci r29, 0xFE ; 254 2b3a2: 68 83 st Y, r22 2b3a4: 79 83 std Y+1, r23 ; 0x01 2b3a6: 8a 83 std Y+2, r24 ; 0x02 2b3a8: 9b 83 std Y+3, r25 ; 0x03 2b3aa: c2 5b subi r28, 0xB2 ; 178 2b3ac: 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; 2b3ae: c7 01 movw r24, r14 2b3b0: b6 01 movw r22, r12 2b3b2: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2b3b6: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b3b8: fb 01 movw r30, r22 2b3ba: 31 96 adiw r30, 0x01 ; 1 2b3bc: c6 55 subi r28, 0x56 ; 86 2b3be: de 4f sbci r29, 0xFE ; 254 2b3c0: f9 83 std Y+1, r31 ; 0x01 2b3c2: e8 83 st Y, r30 2b3c4: ca 5a subi r28, 0xAA ; 170 2b3c6: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b3c8: c5 01 movw r24, r10 2b3ca: b4 01 movw r22, r8 2b3cc: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b3d0: 8b 01 movw r16, r22 2b3d2: 95 e0 ldi r25, 0x05 ; 5 2b3d4: 00 0f add r16, r16 2b3d6: 11 1f adc r17, r17 2b3d8: 9a 95 dec r25 2b3da: e1 f7 brne .-8 ; 0x2b3d4 const uint16_t idx01 = c0 + 32 * r1; 2b3dc: c8 01 movw r24, r16 2b3de: 80 96 adiw r24, 0x20 ; 32 2b3e0: c4 55 subi r28, 0x54 ; 84 2b3e2: de 4f sbci r29, 0xFE ; 254 2b3e4: 99 83 std Y+1, r25 ; 0x01 2b3e6: 88 83 st Y, r24 2b3e8: cc 5a subi r28, 0xAC ; 172 2b3ea: 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]; 2b3ec: f8 01 movw r30, r16 2b3ee: ec 0d add r30, r12 2b3f0: fd 1d adc r31, r13 2b3f2: e8 53 subi r30, 0x38 ; 56 2b3f4: f9 4f sbci r31, 0xF9 ; 249 2b3f6: 60 81 ld r22, Z 2b3f8: 70 e0 ldi r23, 0x00 ; 0 2b3fa: 90 e0 ldi r25, 0x00 ; 0 2b3fc: 80 e0 ldi r24, 0x00 ; 0 2b3fe: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b402: 4b 01 movw r8, r22 2b404: 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; 2b406: ce 54 subi r28, 0x4E ; 78 2b408: de 4f sbci r29, 0xFE ; 254 2b40a: 28 81 ld r18, Y 2b40c: 39 81 ldd r19, Y+1 ; 0x01 2b40e: 4a 81 ldd r20, Y+2 ; 0x02 2b410: 5b 81 ldd r21, Y+3 ; 0x03 2b412: c2 5b subi r28, 0xB2 ; 178 2b414: d1 40 sbci r29, 0x01 ; 1 2b416: c2 55 subi r28, 0x52 ; 82 2b418: de 4f sbci r29, 0xFE ; 254 2b41a: 68 81 ld r22, Y 2b41c: 79 81 ldd r23, Y+1 ; 0x01 2b41e: 8a 81 ldd r24, Y+2 ; 0x02 2b420: 9b 81 ldd r25, Y+3 ; 0x03 2b422: ce 5a subi r28, 0xAE ; 174 2b424: d1 40 sbci r29, 0x01 ; 1 2b426: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b42a: 9b 01 movw r18, r22 2b42c: 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]; 2b42e: c5 01 movw r24, r10 2b430: b4 01 movw r22, r8 2b432: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b436: 4b 01 movw r8, r22 2b438: 5c 01 movw r10, r24 2b43a: c4 55 subi r28, 0x54 ; 84 2b43c: de 4f sbci r29, 0xFE ; 254 2b43e: e8 81 ld r30, Y 2b440: f9 81 ldd r31, Y+1 ; 0x01 2b442: cc 5a subi r28, 0xAC ; 172 2b444: d1 40 sbci r29, 0x01 ; 1 2b446: ec 0d add r30, r12 2b448: fd 1d adc r31, r13 2b44a: e8 53 subi r30, 0x38 ; 56 2b44c: f9 4f sbci r31, 0xF9 ; 249 2b44e: 60 81 ld r22, Z 2b450: 70 e0 ldi r23, 0x00 ; 0 2b452: 90 e0 ldi r25, 0x00 ; 0 2b454: 80 e0 ldi r24, 0x00 ; 0 2b456: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b45a: 6b 01 movw r12, r22 2b45c: 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; 2b45e: c2 55 subi r28, 0x52 ; 82 2b460: de 4f sbci r29, 0xFE ; 254 2b462: 28 81 ld r18, Y 2b464: 39 81 ldd r19, Y+1 ; 0x01 2b466: 4a 81 ldd r20, Y+2 ; 0x02 2b468: 5b 81 ldd r21, Y+3 ; 0x03 2b46a: ce 5a subi r28, 0xAE ; 174 2b46c: d1 40 sbci r29, 0x01 ; 1 2b46e: cc 56 subi r28, 0x6C ; 108 2b470: de 4f sbci r29, 0xFE ; 254 2b472: 68 81 ld r22, Y 2b474: 79 81 ldd r23, Y+1 ; 0x01 2b476: 8a 81 ldd r24, Y+2 ; 0x02 2b478: 9b 81 ldd r25, Y+3 ; 0x03 2b47a: c4 59 subi r28, 0x94 ; 148 2b47c: d1 40 sbci r29, 0x01 ; 1 2b47e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b482: 9b 01 movw r18, r22 2b484: 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]; 2b486: c7 01 movw r24, r14 2b488: b6 01 movw r22, r12 2b48a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b48e: 9b 01 movw r18, r22 2b490: ac 01 movw r20, r24 2b492: c5 01 movw r24, r10 2b494: b4 01 movw r22, r8 2b496: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b49a: 6b 01 movw r12, r22 2b49c: 7c 01 movw r14, r24 2b49e: c6 55 subi r28, 0x56 ; 86 2b4a0: de 4f sbci r29, 0xFE ; 254 2b4a2: a8 81 ld r26, Y 2b4a4: b9 81 ldd r27, Y+1 ; 0x01 2b4a6: ca 5a subi r28, 0xAA ; 170 2b4a8: d1 40 sbci r29, 0x01 ; 1 2b4aa: 0a 0f add r16, r26 2b4ac: 1b 1f adc r17, r27 2b4ae: f8 01 movw r30, r16 2b4b0: e8 53 subi r30, 0x38 ; 56 2b4b2: f9 4f sbci r31, 0xF9 ; 249 2b4b4: 60 81 ld r22, Z 2b4b6: 70 e0 ldi r23, 0x00 ; 0 2b4b8: 90 e0 ldi r25, 0x00 ; 0 2b4ba: 80 e0 ldi r24, 0x00 ; 0 2b4bc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b4c0: 4b 01 movw r8, r22 2b4c2: 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; 2b4c4: ce 54 subi r28, 0x4E ; 78 2b4c6: de 4f sbci r29, 0xFE ; 254 2b4c8: 28 81 ld r18, Y 2b4ca: 39 81 ldd r19, Y+1 ; 0x01 2b4cc: 4a 81 ldd r20, Y+2 ; 0x02 2b4ce: 5b 81 ldd r21, Y+3 ; 0x03 2b4d0: c2 5b subi r28, 0xB2 ; 178 2b4d2: d1 40 sbci r29, 0x01 ; 1 2b4d4: c3 01 movw r24, r6 2b4d6: b2 01 movw r22, r4 2b4d8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b4dc: 9b 01 movw r18, r22 2b4de: 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]; 2b4e0: c5 01 movw r24, r10 2b4e2: b4 01 movw r22, r8 2b4e4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b4e8: 9b 01 movw r18, r22 2b4ea: ac 01 movw r20, r24 2b4ec: c7 01 movw r24, r14 2b4ee: b6 01 movw r22, r12 2b4f0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b4f4: 6b 01 movw r12, r22 2b4f6: 7c 01 movw r14, r24 2b4f8: c6 55 subi r28, 0x56 ; 86 2b4fa: de 4f sbci r29, 0xFE ; 254 2b4fc: e8 81 ld r30, Y 2b4fe: f9 81 ldd r31, Y+1 ; 0x01 2b500: ca 5a subi r28, 0xAA ; 170 2b502: d1 40 sbci r29, 0x01 ; 1 2b504: c4 55 subi r28, 0x54 ; 84 2b506: de 4f sbci r29, 0xFE ; 254 2b508: 88 81 ld r24, Y 2b50a: 99 81 ldd r25, Y+1 ; 0x01 2b50c: cc 5a subi r28, 0xAC ; 172 2b50e: d1 40 sbci r29, 0x01 ; 1 2b510: e8 0f add r30, r24 2b512: f9 1f adc r31, r25 2b514: e8 53 subi r30, 0x38 ; 56 2b516: f9 4f sbci r31, 0xF9 ; 249 2b518: 60 81 ld r22, Z 2b51a: 70 e0 ldi r23, 0x00 ; 0 2b51c: 90 e0 ldi r25, 0x00 ; 0 2b51e: 80 e0 ldi r24, 0x00 ; 0 2b520: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b524: 4b 01 movw r8, r22 2b526: 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; 2b528: cc 56 subi r28, 0x6C ; 108 2b52a: de 4f sbci r29, 0xFE ; 254 2b52c: 28 81 ld r18, Y 2b52e: 39 81 ldd r19, Y+1 ; 0x01 2b530: 4a 81 ldd r20, Y+2 ; 0x02 2b532: 5b 81 ldd r21, Y+3 ; 0x03 2b534: c4 59 subi r28, 0x94 ; 148 2b536: d1 40 sbci r29, 0x01 ; 1 2b538: c3 01 movw r24, r6 2b53a: b2 01 movw r22, r4 2b53c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b540: 9b 01 movw r18, r22 2b542: 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]; 2b544: c5 01 movw r24, r10 2b546: b4 01 movw r22, r8 2b548: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b54c: 9b 01 movw r18, r22 2b54e: ac 01 movw r20, r24 2b550: c7 01 movw r24, r14 2b552: b6 01 movw r22, r12 2b554: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__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; 2b558: 20 e0 ldi r18, 0x00 ; 0 2b55a: 30 e0 ldi r19, 0x00 ; 0 2b55c: 40 e0 ldi r20, 0x00 ; 0 2b55e: 52 e4 ldi r21, 0x42 ; 66 2b560: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2b564: 6b 01 movw r12, r22 2b566: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2b568: ac 01 movw r20, r24 2b56a: 9b 01 movw r18, r22 2b56c: ce 55 subi r28, 0x5E ; 94 2b56e: de 4f sbci r29, 0xFE ; 254 2b570: 68 81 ld r22, Y 2b572: 79 81 ldd r23, Y+1 ; 0x01 2b574: 8a 81 ldd r24, Y+2 ; 0x02 2b576: 9b 81 ldd r25, Y+3 ; 0x03 2b578: c2 5a subi r28, 0xA2 ; 162 2b57a: d1 40 sbci r29, 0x01 ; 1 2b57c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b580: c8 55 subi r28, 0x58 ; 88 2b582: de 4f sbci r29, 0xFE ; 254 2b584: a8 81 ld r26, Y 2b586: b9 81 ldd r27, Y+1 ; 0x01 2b588: c8 5a subi r28, 0xA8 ; 168 2b58a: d1 40 sbci r29, 0x01 ; 1 2b58c: 6d 93 st X+, r22 2b58e: 7d 93 st X+, r23 2b590: 8d 93 st X+, r24 2b592: 9d 93 st X+, r25 2b594: c8 55 subi r28, 0x58 ; 88 2b596: de 4f sbci r29, 0xFE ; 254 2b598: b9 83 std Y+1, r27 ; 0x01 2b59a: a8 83 st Y, r26 2b59c: c8 5a subi r28, 0xA8 ; 168 2b59e: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2b5a0: a7 01 movw r20, r14 2b5a2: 96 01 movw r18, r12 2b5a4: c2 56 subi r28, 0x62 ; 98 2b5a6: de 4f sbci r29, 0xFE ; 254 2b5a8: 68 81 ld r22, Y 2b5aa: 79 81 ldd r23, Y+1 ; 0x01 2b5ac: 8a 81 ldd r24, Y+2 ; 0x02 2b5ae: 9b 81 ldd r25, Y+3 ; 0x03 2b5b0: ce 59 subi r28, 0x9E ; 158 2b5b2: d1 40 sbci r29, 0x01 ; 1 2b5b4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2b5b8: ca 55 subi r28, 0x5A ; 90 2b5ba: de 4f sbci r29, 0xFE ; 254 2b5bc: e8 81 ld r30, Y 2b5be: f9 81 ldd r31, Y+1 ; 0x01 2b5c0: c6 5a subi r28, 0xA6 ; 166 2b5c2: d1 40 sbci r29, 0x01 ; 1 2b5c4: 61 93 st Z+, r22 2b5c6: 71 93 st Z+, r23 2b5c8: 81 93 st Z+, r24 2b5ca: 91 93 st Z+, r25 2b5cc: ca 55 subi r28, 0x5A ; 90 2b5ce: de 4f sbci r29, 0xFE ; 254 2b5d0: f9 83 std Y+1, r31 ; 0x01 2b5d2: e8 83 st Y, r30 2b5d4: c6 5a subi r28, 0xA6 ; 166 2b5d6: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2b5d8: c8 56 subi r28, 0x68 ; 104 2b5da: de 4f sbci r29, 0xFE ; 254 2b5dc: a8 81 ld r26, Y 2b5de: b9 81 ldd r27, Y+1 ; 0x01 2b5e0: c8 59 subi r28, 0x98 ; 152 2b5e2: d1 40 sbci r29, 0x01 ; 1 2b5e4: cd 92 st X+, r12 2b5e6: dd 92 st X+, r13 2b5e8: ed 92 st X+, r14 2b5ea: fd 92 st X+, r15 2b5ec: c8 56 subi r28, 0x68 ; 104 2b5ee: de 4f sbci r29, 0xFE ; 254 2b5f0: b9 83 std Y+1, r27 ; 0x01 2b5f2: a8 83 st Y, r26 2b5f4: c8 59 subi r28, 0x98 ; 152 2b5f6: d1 40 sbci r29, 0x01 ; 1 2b5f8: bf ef ldi r27, 0xFF ; 255 2b5fa: 2b 1a sub r2, r27 2b5fc: 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){ 2b5fe: e1 e2 ldi r30, 0x21 ; 33 2b600: 2e 16 cp r2, r30 2b602: 31 04 cpc r3, r1 2b604: 09 f0 breq .+2 ; 0x2b608 2b606: 10 ce rjmp .-992 ; 0x2b228 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); 2b608: 40 e0 ldi r20, 0x00 ; 0 2b60a: 50 e0 ldi r21, 0x00 ; 0 2b60c: 60 e0 ldi r22, 0x00 ; 0 2b60e: 7d e3 ldi r23, 0x3D ; 61 2b610: ce 01 movw r24, r28 2b612: 87 5f subi r24, 0xF7 ; 247 2b614: 9e 4f sbci r25, 0xFE ; 254 2b616: 0f 94 d3 3a call 0x275a6 ; 0x275a6 2b61a: 9b 01 movw r18, r22 2b61c: ac 01 movw r20, r24 2b61e: c3 57 subi r28, 0x73 ; 115 2b620: de 4f sbci r29, 0xFE ; 254 2b622: a8 81 ld r26, Y 2b624: b9 81 ldd r27, Y+1 ; 0x01 2b626: cd 58 subi r28, 0x8D ; 141 2b628: d1 40 sbci r29, 0x01 ; 1 2b62a: 6d 91 ld r22, X+ 2b62c: 7d 91 ld r23, X+ 2b62e: 8d 91 ld r24, X+ 2b630: 9c 91 ld r25, X 2b632: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b636: c3 57 subi r28, 0x73 ; 115 2b638: de 4f sbci r29, 0xFE ; 254 2b63a: e8 81 ld r30, Y 2b63c: f9 81 ldd r31, Y+1 ; 0x01 2b63e: cd 58 subi r28, 0x8D ; 141 2b640: d1 40 sbci r29, 0x01 ; 1 2b642: 60 83 st Z, r22 2b644: 71 83 std Z+1, r23 ; 0x01 2b646: 82 83 std Z+2, r24 ; 0x02 2b648: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2b64a: 40 e0 ldi r20, 0x00 ; 0 2b64c: 50 e0 ldi r21, 0x00 ; 0 2b64e: 60 e0 ldi r22, 0x00 ; 0 2b650: 7d e3 ldi r23, 0x3D ; 61 2b652: ce 01 movw r24, r28 2b654: 8b 57 subi r24, 0x7B ; 123 2b656: 9f 4f sbci r25, 0xFF ; 255 2b658: 0f 94 d3 3a call 0x275a6 ; 0x275a6 2b65c: 9b 01 movw r18, r22 2b65e: ac 01 movw r20, r24 2b660: c1 57 subi r28, 0x71 ; 113 2b662: de 4f sbci r29, 0xFE ; 254 2b664: a8 81 ld r26, Y 2b666: b9 81 ldd r27, Y+1 ; 0x01 2b668: cf 58 subi r28, 0x8F ; 143 2b66a: d1 40 sbci r29, 0x01 ; 1 2b66c: 6d 91 ld r22, X+ 2b66e: 7d 91 ld r23, X+ 2b670: 8d 91 ld r24, X+ 2b672: 9c 91 ld r25, X 2b674: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b678: c1 57 subi r28, 0x71 ; 113 2b67a: de 4f sbci r29, 0xFE ; 254 2b67c: e8 81 ld r30, Y 2b67e: f9 81 ldd r31, Y+1 ; 0x01 2b680: cf 58 subi r28, 0x8F ; 143 2b682: d1 40 sbci r29, 0x01 ; 1 2b684: 60 83 st Z, r22 2b686: 71 83 std Z+1, r23 ; 0x01 2b688: 82 83 std Z+2, r24 ; 0x02 2b68a: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2b68c: 40 e0 ldi r20, 0x00 ; 0 2b68e: 50 e0 ldi r21, 0x00 ; 0 2b690: 60 e8 ldi r22, 0x80 ; 128 2b692: 7c e3 ldi r23, 0x3C ; 60 2b694: ce 01 movw r24, r28 2b696: 01 96 adiw r24, 0x01 ; 1 2b698: 0f 94 d3 3a call 0x275a6 ; 0x275a6 2b69c: ce 56 subi r28, 0x6E ; 110 2b69e: de 4f sbci r29, 0xFE ; 254 2b6a0: a8 81 ld r26, Y 2b6a2: b9 81 ldd r27, Y+1 ; 0x01 2b6a4: c2 59 subi r28, 0x92 ; 146 2b6a6: d1 40 sbci r29, 0x01 ; 1 2b6a8: 2d 91 ld r18, X+ 2b6aa: 3d 91 ld r19, X+ 2b6ac: 4d 91 ld r20, X+ 2b6ae: 5c 91 ld r21, X 2b6b0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b6b4: 16 2f mov r17, r22 2b6b6: 07 2f mov r16, r23 2b6b8: f8 2e mov r15, r24 2b6ba: e9 2e mov r14, r25 r = MAX(2, r); 2b6bc: 20 e0 ldi r18, 0x00 ; 0 2b6be: 30 e0 ldi r19, 0x00 ; 0 2b6c0: 40 e0 ldi r20, 0x00 ; 0 2b6c2: 50 e4 ldi r21, 0x40 ; 64 2b6c4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2b6c8: 18 16 cp r1, r24 2b6ca: 2c f0 brlt .+10 ; 0x2b6d6 2b6cc: 10 e0 ldi r17, 0x00 ; 0 2b6ce: 00 e0 ldi r16, 0x00 ; 0 2b6d0: f1 2c mov r15, r1 2b6d2: 80 e4 ldi r24, 0x40 ; 64 2b6d4: e8 2e mov r14, r24 2b6d6: a8 01 movw r20, r16 2b6d8: 97 01 movw r18, r14 2b6da: 85 2f mov r24, r21 2b6dc: 90 2f mov r25, r16 2b6de: a3 2f mov r26, r19 2b6e0: be 2d mov r27, r14 2b6e2: ce 56 subi r28, 0x6E ; 110 2b6e4: de 4f sbci r29, 0xFE ; 254 2b6e6: e8 81 ld r30, Y 2b6e8: f9 81 ldd r31, Y+1 ; 0x01 2b6ea: c2 59 subi r28, 0x92 ; 146 2b6ec: d1 40 sbci r29, 0x01 ; 1 2b6ee: 80 83 st Z, r24 2b6f0: 91 83 std Z+1, r25 ; 0x01 2b6f2: a2 83 std Z+2, r26 ; 0x02 2b6f4: b3 83 std Z+3, r27 ; 0x03 2b6f6: cf 56 subi r28, 0x6F ; 111 2b6f8: de 4f sbci r29, 0xFE ; 254 2b6fa: f8 81 ld r31, Y 2b6fc: c1 59 subi r28, 0x91 ; 145 2b6fe: d1 40 sbci r29, 0x01 ; 1 2b700: f1 50 subi r31, 0x01 ; 1 2b702: cf 56 subi r28, 0x6F ; 111 2b704: de 4f sbci r29, 0xFE ; 254 2b706: f8 83 st Y, r31 2b708: c1 59 subi r28, 0x91 ; 145 2b70a: 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){ 2b70c: f1 11 cpse r31, r1 2b70e: 37 cd rjmp .-1426 ; 0x2b17e r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2b710: ef 92 push r14 2b712: ff 92 push r15 2b714: 0f 93 push r16 2b716: 1f 93 push r17 2b718: c1 57 subi r28, 0x71 ; 113 2b71a: de 4f sbci r29, 0xFE ; 254 2b71c: a8 81 ld r26, Y 2b71e: b9 81 ldd r27, Y+1 ; 0x01 2b720: cf 58 subi r28, 0x8F ; 143 2b722: d1 40 sbci r29, 0x01 ; 1 2b724: 13 96 adiw r26, 0x03 ; 3 2b726: 8c 91 ld r24, X 2b728: 13 97 sbiw r26, 0x03 ; 3 2b72a: 8f 93 push r24 2b72c: 12 96 adiw r26, 0x02 ; 2 2b72e: 8c 91 ld r24, X 2b730: 12 97 sbiw r26, 0x02 ; 2 2b732: 8f 93 push r24 2b734: 11 96 adiw r26, 0x01 ; 1 2b736: 8c 91 ld r24, X 2b738: 11 97 sbiw r26, 0x01 ; 1 2b73a: 8f 93 push r24 2b73c: 8c 91 ld r24, X 2b73e: 8f 93 push r24 2b740: c3 57 subi r28, 0x73 ; 115 2b742: de 4f sbci r29, 0xFE ; 254 2b744: e8 81 ld r30, Y 2b746: f9 81 ldd r31, Y+1 ; 0x01 2b748: cd 58 subi r28, 0x8D ; 141 2b74a: d1 40 sbci r29, 0x01 ; 1 2b74c: 83 81 ldd r24, Z+3 ; 0x03 2b74e: 8f 93 push r24 2b750: 82 81 ldd r24, Z+2 ; 0x02 2b752: 8f 93 push r24 2b754: 81 81 ldd r24, Z+1 ; 0x01 2b756: 8f 93 push r24 2b758: 80 81 ld r24, Z 2b75a: 8f 93 push r24 2b75c: 8d eb ldi r24, 0xBD ; 189 2b75e: 99 e9 ldi r25, 0x99 ; 153 2b760: 9f 93 push r25 2b762: 8f 93 push r24 2b764: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 2b768: 0f b6 in r0, 0x3f ; 63 2b76a: f8 94 cli 2b76c: de bf out 0x3e, r29 ; 62 2b76e: 0f be out 0x3f, r0 ; 63 2b770: cd bf out 0x3d, r28 ; 61 } 2b772: c3 54 subi r28, 0x43 ; 67 2b774: de 4f sbci r29, 0xFE ; 254 2b776: 0f b6 in r0, 0x3f ; 63 2b778: f8 94 cli 2b77a: de bf out 0x3e, r29 ; 62 2b77c: 0f be out 0x3f, r0 ; 63 2b77e: cd bf out 0x3d, r28 ; 61 2b780: df 91 pop r29 2b782: cf 91 pop r28 2b784: 1f 91 pop r17 2b786: 0f 91 pop r16 2b788: ff 90 pop r15 2b78a: ef 90 pop r14 2b78c: df 90 pop r13 2b78e: cf 90 pop r12 2b790: bf 90 pop r11 2b792: af 90 pop r10 2b794: 9f 90 pop r9 2b796: 8f 90 pop r8 2b798: 7f 90 pop r7 2b79a: 6f 90 pop r6 2b79c: 5f 90 pop r5 2b79e: 4f 90 pop r4 2b7a0: 3f 90 pop r3 2b7a2: 2f 90 pop r2 2b7a4: 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; 2b7a6: 60 e0 ldi r22, 0x00 ; 0 2b7a8: 70 e0 ldi r23, 0x00 ; 0 2b7aa: cb 01 movw r24, r22 2b7ac: d5 ce rjmp .-598 ; 0x2b558 0002b7ae : } /// 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){ 2b7ae: 2f 92 push r2 2b7b0: 3f 92 push r3 2b7b2: 4f 92 push r4 2b7b4: 5f 92 push r5 2b7b6: 6f 92 push r6 2b7b8: 7f 92 push r7 2b7ba: 8f 92 push r8 2b7bc: 9f 92 push r9 2b7be: af 92 push r10 2b7c0: bf 92 push r11 2b7c2: cf 92 push r12 2b7c4: df 92 push r13 2b7c6: ef 92 push r14 2b7c8: ff 92 push r15 2b7ca: 0f 93 push r16 2b7cc: 1f 93 push r17 2b7ce: cf 93 push r28 2b7d0: df 93 push r29 2b7d2: 00 d0 rcall .+0 ; 0x2b7d4 2b7d4: 1f 92 push r1 2b7d6: 1f 92 push r1 2b7d8: cd b7 in r28, 0x3d ; 61 2b7da: de b7 in r29, 0x3e ; 62 2b7dc: 2b 01 movw r4, r22 2b7de: 1a 01 movw r2, r20 2b7e0: f1 2c mov r15, r1 2b7e2: 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; 2b7e4: 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; 2b7e6: 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; 2b7e8: 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){ 2b7ea: 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); 2b7ec: 66 24 eor r6, r6 2b7ee: 63 94 inc r6 2b7f0: 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){ 2b7f2: 70 e0 ldi r23, 0x00 ; 0 2b7f4: 60 e0 ldi r22, 0x00 ; 0 2b7f6: 97 01 movw r18, r14 2b7f8: 28 53 subi r18, 0x38 ; 56 2b7fa: 39 4f sbci r19, 0xF9 ; 249 2b7fc: 3a 83 std Y+2, r19 ; 0x02 2b7fe: 29 83 std Y+1, r18 ; 0x01 2b800: 86 2e mov r8, r22 2b802: c9 80 ldd r12, Y+1 ; 0x01 2b804: da 80 ldd r13, Y+2 ; 0x02 2b806: c6 0e add r12, r22 2b808: d7 1e adc r13, r23 2b80a: 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; 2b80c: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b80e: 40 e0 ldi r20, 0x00 ; 0 2b810: 30 e0 ldi r19, 0x00 ; 0 2b812: 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; 2b814: ae ef ldi r26, 0xFE ; 254 2b816: a4 0f add r26, r20 2b818: 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; 2b81a: 44 23 and r20, r20 2b81c: 19 f0 breq .+6 ; 0x2b824 2b81e: 4b 30 cpi r20, 0x0B ; 11 2b820: 09 f0 breq .+2 ; 0x2b824 2b822: 7d c0 rjmp .+250 ; 0x2b91e 2b824: ae ef ldi r26, 0xFE ; 254 2b826: a2 0f add r26, r18 2b828: a8 30 cpi r26, 0x08 ; 8 2b82a: 08 f4 brcc .+2 ; 0x2b82e 2b82c: 7a c0 rjmp .+244 ; 0x2b922 2b82e: 2f 5f subi r18, 0xFF ; 255 2b830: 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){ 2b832: 2c 30 cpi r18, 0x0C ; 12 2b834: 31 05 cpc r19, r1 2b836: 89 f7 brne .-30 ; 0x2b81a /// 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){ 2b838: 4f 5f subi r20, 0xFF ; 255 2b83a: 20 e2 ldi r18, 0x20 ; 32 2b83c: c2 0e add r12, r18 2b83e: d1 1c adc r13, r1 2b840: 32 96 adiw r30, 0x02 ; 2 2b842: 4c 30 cpi r20, 0x0C ; 12 2b844: 29 f7 brne .-54 ; 0x2b810 // 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){ 2b846: 3c 81 ldd r19, Y+4 ; 0x04 2b848: 30 17 cp r19, r16 2b84a: 18 f4 brcc .+6 ; 0x2b852 2b84c: 0c 83 std Y+4, r16 ; 0x04 2b84e: 5d 83 std Y+5, r21 ; 0x05 2b850: 18 2d mov r17, r8 2b852: 6f 5f subi r22, 0xFF ; 255 2b854: 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){ 2b856: 64 31 cpi r22, 0x14 ; 20 2b858: 71 05 cpc r23, r1 2b85a: 91 f6 brne .-92 ; 0x2b800 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){ 2b85c: 5f 5f subi r21, 0xFF ; 255 2b85e: a0 e2 ldi r26, 0x20 ; 32 2b860: ea 0e add r14, r26 2b862: f1 1c adc r15, r1 2b864: 54 31 cpi r21, 0x14 ; 20 2b866: 29 f6 brne .-118 ; 0x2b7f2 // 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); 2b868: ec 81 ldd r30, Y+4 ; 0x04 2b86a: 6e 2f mov r22, r30 2b86c: 70 e0 ldi r23, 0x00 ; 0 2b86e: 90 e0 ldi r25, 0x00 ; 0 2b870: 80 e0 ldi r24, 0x00 ; 0 2b872: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b876: 23 ec ldi r18, 0xC3 ; 195 2b878: 35 ef ldi r19, 0xF5 ; 245 2b87a: 48 ea ldi r20, 0xA8 ; 168 2b87c: 5f e3 ldi r21, 0x3F ; 63 2b87e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2b882: 9f 93 push r25 2b884: 8f 93 push r24 2b886: 7f 93 push r23 2b888: 6f 93 push r22 2b88a: fd 81 ldd r31, Y+5 ; 0x05 2b88c: 6f 2f mov r22, r31 2b88e: 70 e0 ldi r23, 0x00 ; 0 2b890: 90 e0 ldi r25, 0x00 ; 0 2b892: 80 e0 ldi r24, 0x00 ; 0 2b894: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b898: 20 e0 ldi r18, 0x00 ; 0 2b89a: 30 e0 ldi r19, 0x00 ; 0 2b89c: 40 eb ldi r20, 0xB0 ; 176 2b89e: 50 e4 ldi r21, 0x40 ; 64 2b8a0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b8a4: 9f 93 push r25 2b8a6: 8f 93 push r24 2b8a8: 7f 93 push r23 2b8aa: 6f 93 push r22 2b8ac: 61 2f mov r22, r17 2b8ae: 70 e0 ldi r23, 0x00 ; 0 2b8b0: 90 e0 ldi r25, 0x00 ; 0 2b8b2: 80 e0 ldi r24, 0x00 ; 0 2b8b4: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2b8b8: 20 e0 ldi r18, 0x00 ; 0 2b8ba: 30 e0 ldi r19, 0x00 ; 0 2b8bc: 40 eb ldi r20, 0xB0 ; 176 2b8be: 50 e4 ldi r21, 0x40 ; 64 2b8c0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2b8c4: 9f 93 push r25 2b8c6: 8f 93 push r24 2b8c8: 7f 93 push r23 2b8ca: 6f 93 push r22 2b8cc: 89 e9 ldi r24, 0x99 ; 153 2b8ce: 99 e9 ldi r25, 0x99 ; 153 2b8d0: 9f 93 push r25 2b8d2: 8f 93 push r24 2b8d4: 0f 94 fe 9f call 0x33ffc ; 0x33ffc *pc = max_c; 2b8d8: f2 01 movw r30, r4 2b8da: 10 83 st Z, r17 *pr = max_r; 2b8dc: 2d 81 ldd r18, Y+5 ; 0x05 2b8de: f1 01 movw r30, r2 2b8e0: 20 83 st Z, r18 2b8e2: 0f b6 in r0, 0x3f ; 63 2b8e4: f8 94 cli 2b8e6: de bf out 0x3e, r29 ; 62 2b8e8: 0f be out 0x3f, r0 ; 63 2b8ea: cd bf out 0x3d, r28 ; 61 return max_match; } 2b8ec: 8c 81 ldd r24, Y+4 ; 0x04 2b8ee: 0f 90 pop r0 2b8f0: 0f 90 pop r0 2b8f2: 0f 90 pop r0 2b8f4: 0f 90 pop r0 2b8f6: 0f 90 pop r0 2b8f8: df 91 pop r29 2b8fa: cf 91 pop r28 2b8fc: 1f 91 pop r17 2b8fe: 0f 91 pop r16 2b900: ff 90 pop r15 2b902: ef 90 pop r14 2b904: df 90 pop r13 2b906: cf 90 pop r12 2b908: bf 90 pop r11 2b90a: af 90 pop r10 2b90c: 9f 90 pop r9 2b90e: 8f 90 pop r8 2b910: 7f 90 pop r7 2b912: 6f 90 pop r6 2b914: 5f 90 pop r5 2b916: 4f 90 pop r4 2b918: 3f 90 pop r3 2b91a: 2f 90 pop r2 2b91c: 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; 2b91e: 22 23 and r18, r18 2b920: 11 f0 breq .+4 ; 0x2b926 2b922: 2b 30 cpi r18, 0x0B ; 11 2b924: 21 f4 brne .+8 ; 0x2b92e 2b926: ab 81 ldd r26, Y+3 ; 0x03 2b928: a8 30 cpi r26, 0x08 ; 8 2b92a: 08 f0 brcs .+2 ; 0x2b92e 2b92c: 80 cf rjmp .-256 ; 0x2b82e const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b92e: 99 24 eor r9, r9 2b930: 93 94 inc r9 2b932: d6 01 movw r26, r12 2b934: a2 0f add r26, r18 2b936: b3 1f adc r27, r19 2b938: ac 91 ld r26, X 2b93a: a1 31 cpi r26, 0x11 ; 17 2b93c: 08 f4 brcc .+2 ; 0x2b940 2b93e: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b940: a0 80 ld r10, Z 2b942: b1 80 ldd r11, Z+1 ; 0x01 2b944: d3 01 movw r26, r6 2b946: 02 2e mov r0, r18 2b948: 02 c0 rjmp .+4 ; 0x2b94e 2b94a: aa 0f add r26, r26 2b94c: bb 1f adc r27, r27 2b94e: 0a 94 dec r0 2b950: e2 f7 brpl .-8 ; 0x2b94a 2b952: aa 21 and r26, r10 2b954: bb 21 and r27, r11 2b956: bb 24 eor r11, r11 2b958: b3 94 inc r11 2b95a: ab 2b or r26, r27 2b95c: 09 f4 brne .+2 ; 0x2b960 2b95e: b1 2c mov r11, r1 if (high_pix == high_pat) 2b960: 9b 10 cpse r9, r11 2b962: 65 cf rjmp .-310 ; 0x2b82e match++; 2b964: 0f 5f subi r16, 0xFF ; 255 2b966: 63 cf rjmp .-314 ; 0x2b82e 0002b968 : 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){ 2b968: 2f 92 push r2 2b96a: 3f 92 push r3 2b96c: 4f 92 push r4 2b96e: 5f 92 push r5 2b970: 6f 92 push r6 2b972: 7f 92 push r7 2b974: 8f 92 push r8 2b976: 9f 92 push r9 2b978: af 92 push r10 2b97a: bf 92 push r11 2b97c: cf 92 push r12 2b97e: df 92 push r13 2b980: ef 92 push r14 2b982: ff 92 push r15 2b984: 0f 93 push r16 2b986: 1f 93 push r17 2b988: cf 93 push r28 2b98a: df 93 push r29 2b98c: cd b7 in r28, 0x3d ; 61 2b98e: de b7 in r29, 0x3e ; 62 2b990: ca 55 subi r28, 0x5A ; 90 2b992: d1 09 sbc r29, r1 2b994: 0f b6 in r0, 0x3f ; 63 2b996: f8 94 cli 2b998: de bf out 0x3e, r29 ; 62 2b99a: 0f be out 0x3f, r0 ; 63 2b99c: cd bf out 0x3d, r28 ; 61 2b99e: 63 96 adiw r28, 0x13 ; 19 2b9a0: 9f af std Y+63, r25 ; 0x3f 2b9a2: 8e af std Y+62, r24 ; 0x3e 2b9a4: 63 97 sbiw r28, 0x13 ; 19 2b9a6: 8b 01 movw r16, r22 2b9a8: 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 2b9aa: 7e 01 movw r14, r28 2b9ac: 25 e4 ldi r18, 0x45 ; 69 2b9ae: e2 0e add r14, r18 2b9b0: f1 1c adc r15, r1 2b9b2: 80 e1 ldi r24, 0x10 ; 16 2b9b4: 97 e2 ldi r25, 0x27 ; 39 2b9b6: f7 01 movw r30, r14 2b9b8: 91 83 std Z+1, r25 ; 0x01 2b9ba: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2b9bc: 88 e8 ldi r24, 0x88 ; 136 2b9be: 99 e9 ldi r25, 0x99 ; 153 2b9c0: 9f 93 push r25 2b9c2: 8f 93 push r24 2b9c4: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 2b9c8: 28 ec ldi r18, 0xC8 ; 200 2b9ca: 36 e0 ldi r19, 0x06 ; 6 2b9cc: 61 96 adiw r28, 0x11 ; 17 2b9ce: 3f af std Y+63, r19 ; 0x3f 2b9d0: 2e af std Y+62, r18 ; 0x3e 2b9d2: 61 97 sbiw r28, 0x11 ; 17 2b9d4: c8 01 movw r24, r16 2b9d6: 80 5e subi r24, 0xE0 ; 224 2b9d8: 93 40 sbci r25, 0x03 ; 3 2b9da: 2b 96 adiw r28, 0x0b ; 11 2b9dc: 9f af std Y+63, r25 ; 0x3f 2b9de: 8e af std Y+62, r24 ; 0x3e 2b9e0: 2b 97 sbiw r28, 0x0b ; 11 2b9e2: 0f 90 pop r0 2b9e4: 0f 90 pop r0 2b9e6: e0 e4 ldi r30, 0x40 ; 64 2b9e8: f0 e0 ldi r31, 0x00 ; 0 2b9ea: 29 96 adiw r28, 0x09 ; 9 2b9ec: ff af std Y+63, r31 ; 0x3f 2b9ee: ee af std Y+62, r30 ; 0x3e 2b9f0: 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); 2b9f2: 63 96 adiw r28, 0x13 ; 19 2b9f4: 2e ad ldd r18, Y+62 ; 0x3e 2b9f6: 3f ad ldd r19, Y+63 ; 0x3f 2b9f8: 63 97 sbiw r28, 0x13 ; 19 2b9fa: 20 5e subi r18, 0xE0 ; 224 2b9fc: 33 40 sbci r19, 0x03 ; 3 2b9fe: 69 96 adiw r28, 0x19 ; 25 2ba00: 3f af std Y+63, r19 ; 0x3f 2ba02: 2e af std Y+62, r18 ; 0x3e 2ba04: 69 97 sbiw r28, 0x19 ; 25 2ba06: 29 96 adiw r28, 0x09 ; 9 2ba08: 4e ac ldd r4, Y+62 ; 0x3e 2ba0a: 5f ac ldd r5, Y+63 ; 0x3f 2ba0c: 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){ 2ba0e: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2ba10: 63 96 adiw r28, 0x13 ; 19 2ba12: 8e ad ldd r24, Y+62 ; 0x3e 2ba14: 9f ad ldd r25, Y+63 ; 0x3f 2ba16: 63 97 sbiw r28, 0x13 ; 19 2ba18: 80 52 subi r24, 0x20 ; 32 2ba1a: 9c 4f sbci r25, 0xFC ; 252 2ba1c: 6b 96 adiw r28, 0x1b ; 27 2ba1e: 9f af std Y+63, r25 ; 0x3f 2ba20: 8e af std Y+62, r24 ; 0x3e 2ba22: 6b 97 sbiw r28, 0x1b ; 27 2ba24: 60 90 be 06 lds r6, 0x06BE ; 0x8006be 2ba28: 70 90 bf 06 lds r7, 0x06BF ; 0x8006bf 2ba2c: 80 90 c0 06 lds r8, 0x06C0 ; 0x8006c0 2ba30: 90 90 c1 06 lds r9, 0x06C1 ; 0x8006c1 2ba34: 6b 96 adiw r28, 0x1b ; 27 2ba36: ae ac ldd r10, Y+62 ; 0x3e 2ba38: bf ac ldd r11, Y+63 ; 0x3f 2ba3a: 6b 97 sbiw r28, 0x1b ; 27 2ba3c: 31 10 cpse r3, r1 2ba3e: 04 c0 rjmp .+8 ; 0x2ba48 2ba40: 69 96 adiw r28, 0x19 ; 25 2ba42: ae ac ldd r10, Y+62 ; 0x3e 2ba44: bf ac ldd r11, Y+63 ; 0x3f 2ba46: 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; 2ba48: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2ba4c: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2ba50: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2ba54: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2ba58: f5 01 movw r30, r10 2ba5a: e8 1b sub r30, r24 2ba5c: f9 0b sbc r31, r25 2ba5e: 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) 2ba60: 71 f0 breq .+28 ; 0x2ba7e 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)); 2ba62: af 01 movw r20, r30 2ba64: f7 ff sbrs r31, 7 2ba66: 04 c0 rjmp .+8 ; 0x2ba70 2ba68: 44 27 eor r20, r20 2ba6a: 55 27 eor r21, r21 2ba6c: 4e 1b sub r20, r30 2ba6e: 5f 0b sbc r21, r31 2ba70: 69 2f mov r22, r25 2ba72: 66 1f adc r22, r22 2ba74: 66 27 eor r22, r22 2ba76: 66 1f adc r22, r22 2ba78: 81 e0 ldi r24, 0x01 ; 1 2ba7a: 0f 94 38 40 call 0x28070 ; 0x28070 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2ba7e: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2ba82: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2ba86: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2ba8a: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2ba8e: 2b 96 adiw r28, 0x0b ; 11 2ba90: 4e ad ldd r20, Y+62 ; 0x3e 2ba92: 5f ad ldd r21, Y+63 ; 0x3f 2ba94: 2b 97 sbiw r28, 0x0b ; 11 2ba96: 48 1b sub r20, r24 2ba98: 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)); 2ba9a: 57 fd sbrc r21, 7 2ba9c: b2 c0 rjmp .+356 ; 0x2bc02 2ba9e: 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) 2baa0: 41 15 cp r20, r1 2baa2: 51 05 cpc r21, r1 2baa4: 09 f0 breq .+2 ; 0x2baa8 2baa6: ae c0 rjmp .+348 ; 0x2bc04 // 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; 2baa8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2baac: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bab0: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bab4: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bab8: 68 1a sub r6, r24 2baba: 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)); 2babc: 77 fc sbrc r7, 7 2babe: ab c0 rjmp .+342 ; 0x2bc16 2bac0: 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) 2bac2: 61 14 cp r6, r1 2bac4: 71 04 cpc r7, r1 2bac6: 09 f0 breq .+2 ; 0x2baca 2bac8: a7 c0 rjmp .+334 ; 0x2bc18 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); 2baca: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 2bace: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 2bad2: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 2bad6: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 2bada: 00 e0 ldi r16, 0x00 ; 0 2badc: 28 ec ldi r18, 0xC8 ; 200 2bade: 30 e0 ldi r19, 0x00 ; 0 2bae0: 2b 96 adiw r28, 0x0b ; 11 2bae2: 6e ad ldd r22, Y+62 ; 0x3e 2bae4: 7f ad ldd r23, Y+63 ; 0x3f 2bae6: 2b 97 sbiw r28, 0x0b ; 11 2bae8: c5 01 movw r24, r10 2baea: 0e 94 ca c2 call 0x18594 ; 0x18594 sm4_set_dir(X_AXIS, d); 2baee: 63 2d mov r22, r3 2baf0: 80 e0 ldi r24, 0x00 ; 0 2baf2: 0f 94 59 36 call 0x26cb2 ; 0x26cb2 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2baf6: 5f 92 push r5 2baf8: 4f 92 push r4 2bafa: 84 e8 ldi r24, 0x84 ; 132 2bafc: 99 e9 ldi r25, 0x99 ; 153 2bafe: 9f 93 push r25 2bb00: 8f 93 push r24 2bb02: 0f 94 fe 9f call 0x33ffc ; 0x33ffc lcd_set_cursor(4,3); 2bb06: 63 e0 ldi r22, 0x03 ; 3 2bb08: 84 e0 ldi r24, 0x04 ; 4 2bb0a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2bb0e: 5f 92 push r5 2bb10: 4f 92 push r4 2bb12: 85 e7 ldi r24, 0x75 ; 117 2bb14: 99 e9 ldi r25, 0x99 ; 153 2bb16: 9f 93 push r25 2bb18: 8f 93 push r24 2bb1a: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 2bb1e: 0f b6 in r0, 0x3f ; 63 2bb20: f8 94 cli 2bb22: de bf out 0x3e, r29 ; 62 2bb24: 0f be out 0x3f, r0 ; 63 2bb26: cd bf out 0x3d, r28 ; 61 2bb28: 21 e0 ldi r18, 0x01 ; 1 2bb2a: 30 e0 ldi r19, 0x00 ; 0 2bb2c: 31 10 cpse r3, r1 2bb2e: 02 c0 rjmp .+4 ; 0x2bb34 2bb30: 2f ef ldi r18, 0xFF ; 255 2bb32: 3f ef ldi r19, 0xFF ; 255 2bb34: 40 ec ldi r20, 0xC0 ; 192 2bb36: 42 03 mulsu r20, r18 2bb38: c0 01 movw r24, r0 2bb3a: 43 9f mul r20, r19 2bb3c: 90 0d add r25, r0 2bb3e: 11 24 eor r1, r1 2bb40: 67 96 adiw r28, 0x17 ; 23 2bb42: 9f af std Y+63, r25 ; 0x3f 2bb44: 8e af std Y+62, r24 ; 0x3e 2bb46: 67 97 sbiw r28, 0x17 ; 23 2bb48: 40 ee ldi r20, 0xE0 ; 224 2bb4a: 53 e0 ldi r21, 0x03 ; 3 2bb4c: 24 9f mul r18, r20 2bb4e: 40 01 movw r8, r0 2bb50: 25 9f mul r18, r21 2bb52: 90 0c add r9, r0 2bb54: 34 9f mul r19, r20 2bb56: 90 0c add r9, r0 2bb58: 11 24 eor r1, r1 2bb5a: 63 96 adiw r28, 0x13 ; 19 2bb5c: ee ad ldd r30, Y+62 ; 0x3e 2bb5e: ff ad ldd r31, Y+63 ; 0x3f 2bb60: 63 97 sbiw r28, 0x13 ; 19 2bb62: 8e 0e add r8, r30 2bb64: 9f 1e adc r9, r31 2bb66: 9e 01 movw r18, r28 2bb68: 2f 5f subi r18, 0xFF ; 255 2bb6a: 3f 4f sbci r19, 0xFF ; 255 2bb6c: 2d 96 adiw r28, 0x0d ; 13 2bb6e: 3f af std Y+63, r19 ; 0x3f 2bb70: 2e af std Y+62, r18 ; 0x3e 2bb72: 2d 97 sbiw r28, 0x0d ; 13 2bb74: 61 96 adiw r28, 0x11 ; 17 2bb76: 8e ad ldd r24, Y+62 ; 0x3e 2bb78: 9f ad ldd r25, Y+63 ; 0x3f 2bb7a: 61 97 sbiw r28, 0x11 ; 17 2bb7c: 2f 96 adiw r28, 0x0f ; 15 2bb7e: 9f af std Y+63, r25 ; 0x3f 2bb80: 8e af std Y+62, r24 ; 0x3e 2bb82: 2f 97 sbiw r28, 0x0f ; 15 2bb84: 71 2c mov r7, r1 2bb86: 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; 2bb88: e0 e1 ldi r30, 0x10 ; 16 2bb8a: f7 e2 ldi r31, 0x27 ; 39 2bb8c: 27 96 adiw r28, 0x07 ; 7 2bb8e: ff af std Y+63, r31 ; 0x3f 2bb90: ee af std Y+62, r30 ; 0x3e 2bb92: 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); 2bb94: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2bb98: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2bb9c: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2bba0: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2bba4: 84 01 movw r16, r8 2bba6: 08 1b sub r16, r24 2bba8: 19 0b sbc r17, r25 2bbaa: 17 ff sbrs r17, 7 2bbac: 03 c0 rjmp .+6 ; 0x2bbb4 2bbae: 11 95 neg r17 2bbb0: 01 95 neg r16 2bbb2: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2bbb4: 98 01 movw r18, r16 2bbb6: 35 95 asr r19 2bbb8: 27 95 ror r18 2bbba: 65 96 adiw r28, 0x15 ; 21 2bbbc: 3f af std Y+63, r19 ; 0x3f 2bbbe: 2e af std Y+62, r18 ; 0x3e 2bbc0: 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; 2bbc2: 1c 9b sbis 0x03, 4 ; 3 2bbc4: 33 c0 rjmp .+102 ; 0x2bc2c 2bbc6: 45 e0 ldi r20, 0x05 ; 5 2bbc8: 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); 2bbca: 65 96 adiw r28, 0x15 ; 21 2bbcc: ae ac ldd r10, Y+62 ; 0x3e 2bbce: bf ac ldd r11, Y+63 ; 0x3f 2bbd0: 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); 2bbd2: 63 2d mov r22, r3 2bbd4: 82 2d mov r24, r2 2bbd6: 0e 94 71 c2 call 0x184e2 ; 0x184e2 while (steps--){ 2bbda: 31 e0 ldi r19, 0x01 ; 1 2bbdc: a3 1a sub r10, r19 2bbde: b1 08 sbc r11, r1 2bbe0: 40 f1 brcs .+80 ; 0x2bc32 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2bbe2: 28 ec ldi r18, 0xC8 ; 200 2bbe4: 30 e0 ldi r19, 0x00 ; 0 2bbe6: a7 01 movw r20, r14 2bbe8: 68 ee ldi r22, 0xE8 ; 232 2bbea: 73 e0 ldi r23, 0x03 ; 3 2bbec: 82 2d mov r24, r2 2bbee: 0e 94 40 c1 call 0x18280 ; 0x18280 update_position_1_step(axes, dir); 2bbf2: 63 2d mov r22, r3 2bbf4: 82 2d mov r24, r2 2bbf6: 0e 94 8a c2 call 0x18514 ; 0x18514 2bbfa: ef cf rjmp .-34 ; 0x2bbda 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){ 2bbfc: 33 24 eor r3, r3 2bbfe: 33 94 inc r3 2bc00: 11 cf rjmp .-478 ; 0x2ba24 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)); 2bc02: 62 e0 ldi r22, 0x02 ; 2 2bc04: 57 ff sbrs r21, 7 2bc06: 03 c0 rjmp .+6 ; 0x2bc0e 2bc08: 51 95 neg r21 2bc0a: 41 95 neg r20 2bc0c: 51 09 sbc r21, r1 2bc0e: 82 e0 ldi r24, 0x02 ; 2 2bc10: 0f 94 38 40 call 0x28070 ; 0x28070 2bc14: 49 cf rjmp .-366 ; 0x2baa8 // 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)); 2bc16: 64 e0 ldi r22, 0x04 ; 4 2bc18: a3 01 movw r20, r6 2bc1a: 77 fe sbrs r7, 7 2bc1c: 03 c0 rjmp .+6 ; 0x2bc24 2bc1e: 51 95 neg r21 2bc20: 41 95 neg r20 2bc22: 51 09 sbc r21, r1 2bc24: 84 e0 ldi r24, 0x04 ; 4 2bc26: 0f 94 38 40 call 0x28070 ; 0x28070 2bc2a: 4f cf rjmp .-354 ; 0x2baca 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; 2bc2c: 22 24 eor r2, r2 2bc2e: 23 94 inc r2 2bc30: cc cf rjmp .-104 ; 0x2bbca 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); 2bc32: 65 96 adiw r28, 0x15 ; 21 2bc34: ee ad ldd r30, Y+62 ; 0x3e 2bc36: ff ad ldd r31, Y+63 ; 0x3f 2bc38: 65 97 sbiw r28, 0x15 ; 21 2bc3a: 0e 1b sub r16, r30 2bc3c: 1f 0b sbc r17, r31 2bc3e: 23 96 adiw r28, 0x03 ; 3 2bc40: 1f af std Y+63, r17 ; 0x3f 2bc42: 0e af std Y+62, r16 ; 0x3e 2bc44: 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); 2bc46: 63 2d mov r22, r3 2bc48: 82 2d mov r24, r2 2bc4a: 0e 94 71 c2 call 0x184e2 ; 0x184e2 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2bc4e: 9e 01 movw r18, r28 2bc50: 2f 5b subi r18, 0xBF ; 191 2bc52: 3f 4f sbci r19, 0xFF ; 255 2bc54: a7 01 movw r20, r14 2bc56: 68 ee ldi r22, 0xE8 ; 232 2bc58: 73 e0 ldi r23, 0x03 ; 3 2bc5a: 82 2d mov r24, r2 2bc5c: 0e 94 e7 c1 call 0x183ce ; 0x183ce 2bc60: 88 23 and r24, r24 2bc62: 29 f0 breq .+10 ; 0x2bc6e update_position_1_step(axes, dir); 2bc64: 63 2d mov r22, r3 2bc66: 82 2d mov r24, r2 2bc68: 0e 94 8a c2 call 0x18514 ; 0x18514 2bc6c: f0 cf rjmp .-32 ; 0x2bc4e z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2bc6e: 60 e0 ldi r22, 0x00 ; 0 2bc70: 82 e0 ldi r24, 0x02 ; 2 2bc72: 0f 94 59 36 call 0x26cb2 ; 0x26cb2 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2bc76: 20 e1 ldi r18, 0x10 ; 16 2bc78: 37 e2 ldi r19, 0x27 ; 39 2bc7a: 27 96 adiw r28, 0x07 ; 7 2bc7c: 3f af std Y+63, r19 ; 0x3f 2bc7e: 2e af std Y+62, r18 ; 0x3e 2bc80: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2bc82: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bc86: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bc8a: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bc8e: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bc92: 00 5a subi r16, 0xA0 ; 160 2bc94: 16 4f sbci r17, 0xF6 ; 246 2bc96: 17 ff sbrs r17, 7 2bc98: 02 c0 rjmp .+4 ; 0x2bc9e 2bc9a: 0f 5f subi r16, 0xFF ; 255 2bc9c: 1f 4f sbci r17, 0xFF ; 255 2bc9e: 15 95 asr r17 2bca0: 07 95 ror r16 2bca2: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bca6: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcaa: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcae: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcb2: 80 17 cp r24, r16 2bcb4: 91 07 cpc r25, r17 2bcb6: f4 f4 brge .+60 ; 0x2bcf4 if (!_PINDA){ 2bcb8: 1c 9b sbis 0x03, 4 ; 3 2bcba: 1c c0 rjmp .+56 ; 0x2bcf4 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2bcbc: 28 ec ldi r18, 0xC8 ; 200 2bcbe: 30 e0 ldi r19, 0x00 ; 0 2bcc0: a7 01 movw r20, r14 2bcc2: 68 ee ldi r22, 0xE8 ; 232 2bcc4: 73 e0 ldi r23, 0x03 ; 3 2bcc6: 84 e0 ldi r24, 0x04 ; 4 2bcc8: 0e 94 40 c1 call 0x18280 ; 0x18280 /// 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_){ 2bccc: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcd0: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcd4: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcd8: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcdc: 01 96 adiw r24, 0x01 ; 1 2bcde: a1 1d adc r26, r1 2bce0: b1 1d adc r27, r1 2bce2: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bce6: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bcea: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bcee: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bcf2: d7 cf rjmp .-82 ; 0x2bca2 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2bcf4: 1c 9b sbis 0x03, 4 ; 3 2bcf6: 3f c0 rjmp .+126 ; 0x2bd76 steps_to_go = MAX(0, max_z - _Z); 2bcf8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcfc: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bd00: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd04: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd08: e0 e6 ldi r30, 0x60 ; 96 2bd0a: f9 e0 ldi r31, 0x09 ; 9 2bd0c: e8 1b sub r30, r24 2bd0e: f9 0b sbc r31, r25 2bd10: cf 01 movw r24, r30 2bd12: f7 ff sbrs r31, 7 2bd14: 02 c0 rjmp .+4 ; 0x2bd1a 2bd16: 90 e0 ldi r25, 0x00 ; 0 2bd18: 80 e0 ldi r24, 0x00 ; 0 2bd1a: 25 96 adiw r28, 0x05 ; 5 2bd1c: 9f af std Y+63, r25 ; 0x3f 2bd1e: 8e af std Y+62, r24 ; 0x3e 2bd20: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2bd22: 1c 9b sbis 0x03, 4 ; 3 2bd24: 28 c0 rjmp .+80 ; 0x2bd76 2bd26: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bd2a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bd2e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd32: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd36: 80 36 cpi r24, 0x60 ; 96 2bd38: 99 40 sbci r25, 0x09 ; 9 2bd3a: ec f4 brge .+58 ; 0x2bd76 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2bd3c: 9e 01 movw r18, r28 2bd3e: 2d 5b subi r18, 0xBD ; 189 2bd40: 3f 4f sbci r19, 0xFF ; 255 2bd42: a7 01 movw r20, r14 2bd44: 68 ee ldi r22, 0xE8 ; 232 2bd46: 73 e0 ldi r23, 0x03 ; 3 2bd48: 84 e0 ldi r24, 0x04 ; 4 2bd4a: 0e 94 e7 c1 call 0x183ce ; 0x183ce ++_Z_; 2bd4e: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bd52: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bd56: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd5a: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd5e: 01 96 adiw r24, 0x01 ; 1 2bd60: a1 1d adc r26, r1 2bd62: b1 1d adc r27, r1 2bd64: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bd68: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bd6c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bd70: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bd74: d6 cf rjmp .-84 ; 0x2bd22 /// \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); 2bd76: 60 e0 ldi r22, 0x00 ; 0 2bd78: 84 e0 ldi r24, 0x04 ; 4 2bd7a: 0e 94 71 c2 call 0x184e2 ; 0x184e2 while (delay_us < MAX_DELAY){ 2bd7e: f7 01 movw r30, r14 2bd80: 20 81 ld r18, Z 2bd82: 31 81 ldd r19, Z+1 ; 0x01 2bd84: 20 31 cpi r18, 0x10 ; 16 2bd86: f7 e2 ldi r31, 0x27 ; 39 2bd88: 3f 07 cpc r19, r31 2bd8a: 58 f4 brcc .+22 ; 0x2bda2 accelerate_1_step(axes, -dec, delay_us, delay_us); 2bd8c: a7 01 movw r20, r14 2bd8e: 68 e1 ldi r22, 0x18 ; 24 2bd90: 7c ef ldi r23, 0xFC ; 252 2bd92: 84 e0 ldi r24, 0x04 ; 4 2bd94: 0e 94 40 c1 call 0x18280 ; 0x18280 update_position_1_step(axes, dir); 2bd98: 60 e0 ldi r22, 0x00 ; 0 2bd9a: 84 e0 ldi r24, 0x04 ; 4 2bd9c: 0e 94 8a c2 call 0x18514 ; 0x18514 2bda0: ee cf rjmp .-36 ; 0x2bd7e } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2bda2: 61 e0 ldi r22, 0x01 ; 1 2bda4: 82 e0 ldi r24, 0x02 ; 2 2bda6: 0f 94 59 36 call 0x26cb2 ; 0x26cb2 /// speed up current_delay_us = MAX_DELAY; 2bdaa: 20 e1 ldi r18, 0x10 ; 16 2bdac: 37 e2 ldi r19, 0x27 ; 39 2bdae: f7 01 movw r30, r14 2bdb0: 31 83 std Z+1, r19 ; 0x01 2bdb2: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2bdb4: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bdb8: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bdbc: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bdc0: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bdc4: 0c 0d add r16, r12 2bdc6: 1d 1d adc r17, r13 2bdc8: 17 ff sbrs r17, 7 2bdca: 02 c0 rjmp .+4 ; 0x2bdd0 2bdcc: 0f 5f subi r16, 0xFF ; 255 2bdce: 1f 4f sbci r17, 0xFF ; 255 2bdd0: 15 95 asr r17 2bdd2: 07 95 ror r16 2bdd4: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bdd8: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bddc: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bde0: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bde4: 08 17 cp r16, r24 2bde6: 19 07 cpc r17, r25 2bde8: 0c f0 brlt .+2 ; 0x2bdec 2bdea: d9 c0 rjmp .+434 ; 0x2bf9e if (_PINDA){ 2bdec: 1c 9b sbis 0x03, 4 ; 3 2bdee: bb c0 rjmp .+374 ; 0x2bf66 z_trig = _Z; 2bdf0: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bdf4: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bdf8: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bdfc: 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){ 2be00: 1c 99 sbic 0x03, 4 ; 3 2be02: 28 c0 rjmp .+80 ; 0x2be54 steps_to_go = MAX(0, _Z - min_z); 2be04: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be08: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be0c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be10: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be14: 8c 19 sub r24, r12 2be16: 9d 09 sbc r25, r13 2be18: 97 ff sbrs r25, 7 2be1a: 02 c0 rjmp .+4 ; 0x2be20 2be1c: 90 e0 ldi r25, 0x00 ; 0 2be1e: 80 e0 ldi r24, 0x00 ; 0 2be20: 25 96 adiw r28, 0x05 ; 5 2be22: 9f af std Y+63, r25 ; 0x3f 2be24: 8e af std Y+62, r24 ; 0x3e 2be26: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2be28: 1c 99 sbic 0x03, 4 ; 3 2be2a: 0c c0 rjmp .+24 ; 0x2be44 2be2c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be30: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be34: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be38: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be3c: c8 16 cp r12, r24 2be3e: d9 06 cpc r13, r25 2be40: 0c f4 brge .+2 ; 0x2be44 2be42: af c0 rjmp .+350 ; 0x2bfa2 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2be44: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2be48: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2be4c: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2be50: 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){ 2be54: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be58: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be5c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be60: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be64: c8 16 cp r12, r24 2be66: d9 06 cpc r13, r25 2be68: 3c f4 brge .+14 ; 0x2be78 2be6a: f7 01 movw r30, r14 2be6c: 80 81 ld r24, Z 2be6e: 91 81 ldd r25, Z+1 ; 0x01 2be70: 80 31 cpi r24, 0x10 ; 16 2be72: 97 42 sbci r25, 0x27 ; 39 2be74: 08 f4 brcc .+2 ; 0x2be78 2be76: b2 c0 rjmp .+356 ; 0x2bfdc 2be78: 0c 19 sub r16, r12 2be7a: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2be7c: 31 10 cpse r3, r1 2be7e: ca c0 rjmp .+404 ; 0x2c014 line_buffer[c] = (uint16_t)(z_trig - min_z); 2be80: f3 01 movw r30, r6 2be82: ee 0f add r30, r30 2be84: ff 1f adc r31, r31 2be86: 21 e0 ldi r18, 0x01 ; 1 2be88: 30 e0 ldi r19, 0x00 ; 0 2be8a: 2c 0f add r18, r28 2be8c: 3d 1f adc r19, r29 2be8e: e2 0f add r30, r18 2be90: f3 1f adc r31, r19 2be92: 11 83 std Z+1, r17 ; 0x01 2be94: 00 83 st Z, r16 2be96: ff ef ldi r31, 0xFF ; 255 2be98: 6f 1a sub r6, r31 2be9a: 7f 0a sbc r7, r31 2be9c: 67 96 adiw r28, 0x17 ; 23 2be9e: 2e ad ldd r18, Y+62 ; 0x3e 2bea0: 3f ad ldd r19, Y+63 ; 0x3f 2bea2: 67 97 sbiw r28, 0x17 ; 23 2bea4: 82 0e add r8, r18 2bea6: 93 1e adc r9, r19 2bea8: 2d 96 adiw r28, 0x0d ; 13 2beaa: 8e ad ldd r24, Y+62 ; 0x3e 2beac: 9f ad ldd r25, Y+63 ; 0x3f 2beae: 2d 97 sbiw r28, 0x0d ; 13 2beb0: 02 97 sbiw r24, 0x02 ; 2 2beb2: 2d 96 adiw r28, 0x0d ; 13 2beb4: 9f af std Y+63, r25 ; 0x3f 2beb6: 8e af std Y+62, r24 ; 0x3e 2beb8: 2d 97 sbiw r28, 0x0d ; 13 2beba: 2f 96 adiw r28, 0x0f ; 15 2bebc: ee ad ldd r30, Y+62 ; 0x3e 2bebe: ff ad ldd r31, Y+63 ; 0x3f 2bec0: 2f 97 sbiw r28, 0x0f ; 15 2bec2: 31 97 sbiw r30, 0x01 ; 1 2bec4: 2f 96 adiw r28, 0x0f ; 15 2bec6: ff af std Y+63, r31 ; 0x3f 2bec8: ee af std Y+62, r30 ; 0x3e 2beca: 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 2becc: f0 e2 ldi r31, 0x20 ; 32 2bece: 6f 16 cp r6, r31 2bed0: 71 04 cpc r7, r1 2bed2: 09 f0 breq .+2 ; 0x2bed6 2bed4: 59 ce rjmp .-846 ; 0x2bb88 2bed6: 21 e0 ldi r18, 0x01 ; 1 2bed8: 42 1a sub r4, r18 2beda: 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){ 2bedc: 31 e0 ldi r19, 0x01 ; 1 2bede: 33 12 cpse r3, r19 2bee0: 8d ce rjmp .-742 ; 0x2bbfc 2bee2: 61 96 adiw r28, 0x11 ; 17 2bee4: 8e ad ldd r24, Y+62 ; 0x3e 2bee6: 9f ad ldd r25, Y+63 ; 0x3f 2bee8: 61 97 sbiw r28, 0x11 ; 17 2beea: 80 96 adiw r24, 0x20 ; 32 2beec: 61 96 adiw r28, 0x11 ; 17 2beee: 9f af std Y+63, r25 ; 0x3f 2bef0: 8e af std Y+62, r24 ; 0x3e 2bef2: 61 97 sbiw r28, 0x11 ; 17 2bef4: 2b 96 adiw r28, 0x0b ; 11 2bef6: ee ad ldd r30, Y+62 ; 0x3e 2bef8: ff ad ldd r31, Y+63 ; 0x3f 2befa: 2b 97 sbiw r28, 0x0b ; 11 2befc: e0 5c subi r30, 0xC0 ; 192 2befe: ff 4f sbci r31, 0xFF ; 255 2bf00: 2b 96 adiw r28, 0x0b ; 11 2bf02: ff af std Y+63, r31 ; 0x3f 2bf04: ee af std Y+62, r30 ; 0x3e 2bf06: 2b 97 sbiw r28, 0x0b ; 11 2bf08: 29 96 adiw r28, 0x09 ; 9 2bf0a: 2e ad ldd r18, Y+62 ; 0x3e 2bf0c: 3f ad ldd r19, Y+63 ; 0x3f 2bf0e: 29 97 sbiw r28, 0x09 ; 9 2bf10: 22 50 subi r18, 0x02 ; 2 2bf12: 31 09 sbc r19, r1 2bf14: 29 96 adiw r28, 0x09 ; 9 2bf16: 3f af std Y+63, r19 ; 0x3f 2bf18: 2e af std Y+62, r18 ; 0x3e 2bf1a: 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 2bf1c: 23 2b or r18, r19 2bf1e: 09 f0 breq .+2 ; 0x2bf22 2bf20: 72 cd rjmp .-1308 ; 0x2ba06 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); 2bf22: 83 e7 ldi r24, 0x73 ; 115 2bf24: 99 e9 ldi r25, 0x99 ; 153 2bf26: 9f 93 push r25 2bf28: 8f 93 push r24 2bf2a: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 2bf2e: 0f 90 pop r0 2bf30: 0f 90 pop r0 } 2bf32: c6 5a subi r28, 0xA6 ; 166 2bf34: df 4f sbci r29, 0xFF ; 255 2bf36: 0f b6 in r0, 0x3f ; 63 2bf38: f8 94 cli 2bf3a: de bf out 0x3e, r29 ; 62 2bf3c: 0f be out 0x3f, r0 ; 63 2bf3e: cd bf out 0x3d, r28 ; 61 2bf40: df 91 pop r29 2bf42: cf 91 pop r28 2bf44: 1f 91 pop r17 2bf46: 0f 91 pop r16 2bf48: ff 90 pop r15 2bf4a: ef 90 pop r14 2bf4c: df 90 pop r13 2bf4e: cf 90 pop r12 2bf50: bf 90 pop r11 2bf52: af 90 pop r10 2bf54: 9f 90 pop r9 2bf56: 8f 90 pop r8 2bf58: 7f 90 pop r7 2bf5a: 6f 90 pop r6 2bf5c: 5f 90 pop r5 2bf5e: 4f 90 pop r4 2bf60: 3f 90 pop r3 2bf62: 2f 90 pop r2 2bf64: 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); 2bf66: 28 ec ldi r18, 0xC8 ; 200 2bf68: 30 e0 ldi r19, 0x00 ; 0 2bf6a: a7 01 movw r20, r14 2bf6c: 68 ee ldi r22, 0xE8 ; 232 2bf6e: 73 e0 ldi r23, 0x03 ; 3 2bf70: 84 e0 ldi r24, 0x04 ; 4 2bf72: 0e 94 40 c1 call 0x18280 ; 0x18280 /// 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_){ 2bf76: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bf7a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bf7e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bf82: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bf86: 01 97 sbiw r24, 0x01 ; 1 2bf88: a1 09 sbc r26, r1 2bf8a: b1 09 sbc r27, r1 2bf8c: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bf90: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bf94: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bf98: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bf9c: 1b cf rjmp .-458 ; 0x2bdd4 2bf9e: 86 01 movw r16, r12 2bfa0: 2f cf rjmp .-418 ; 0x2be00 } /// 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); 2bfa2: 9e 01 movw r18, r28 2bfa4: 2d 5b subi r18, 0xBD ; 189 2bfa6: 3f 4f sbci r19, 0xFF ; 255 2bfa8: a7 01 movw r20, r14 2bfaa: 68 ee ldi r22, 0xE8 ; 232 2bfac: 73 e0 ldi r23, 0x03 ; 3 2bfae: 84 e0 ldi r24, 0x04 ; 4 2bfb0: 0e 94 e7 c1 call 0x183ce ; 0x183ce --_Z_; 2bfb4: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bfb8: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bfbc: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bfc0: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bfc4: 01 97 sbiw r24, 0x01 ; 1 2bfc6: a1 09 sbc r26, r1 2bfc8: b1 09 sbc r27, r1 2bfca: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bfce: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bfd2: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bfd6: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bfda: 26 cf rjmp .-436 ; 0x2be28 } 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); 2bfdc: 28 ec ldi r18, 0xC8 ; 200 2bfde: 30 e0 ldi r19, 0x00 ; 0 2bfe0: a7 01 movw r20, r14 2bfe2: 68 e1 ldi r22, 0x18 ; 24 2bfe4: 7c ef ldi r23, 0xFC ; 252 2bfe6: 84 e0 ldi r24, 0x04 ; 4 2bfe8: 0e 94 40 c1 call 0x18280 ; 0x18280 --_Z_; 2bfec: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bff0: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bff4: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bff8: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bffc: 01 97 sbiw r24, 0x01 ; 1 2bffe: a1 09 sbc r26, r1 2c000: b1 09 sbc r27, r1 2c002: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2c006: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2c00a: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2c00e: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2c012: 20 cf rjmp .-448 ; 0x2be54 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); 2c014: 2d 96 adiw r28, 0x0d ; 13 2c016: ee ad ldd r30, Y+62 ; 0x3e 2c018: ff ad ldd r31, Y+63 ; 0x3f 2c01a: 2d 97 sbiw r28, 0x0d ; 13 2c01c: 86 ad ldd r24, Z+62 ; 0x3e 2c01e: 97 ad ldd r25, Z+63 ; 0x3f 2c020: 01 2e mov r0, r17 2c022: 00 0c add r0, r0 2c024: 22 0b sbc r18, r18 2c026: 33 0b sbc r19, r19 2c028: 08 0f add r16, r24 2c02a: 19 1f adc r17, r25 2c02c: 21 1d adc r18, r1 2c02e: 31 1d adc r19, r1 2c030: 36 95 lsr r19 2c032: 27 95 ror r18 2c034: 17 95 ror r17 2c036: 07 95 ror r16 2c038: 0f 3f cpi r16, 0xFF ; 255 2c03a: 11 05 cpc r17, r1 2c03c: 21 05 cpc r18, r1 2c03e: 31 05 cpc r19, r1 2c040: 29 f0 breq .+10 ; 0x2c04c 2c042: 20 f0 brcs .+8 ; 0x2c04c 2c044: 0f ef ldi r16, 0xFF ; 255 2c046: 10 e0 ldi r17, 0x00 ; 0 2c048: 20 e0 ldi r18, 0x00 ; 0 2c04a: 30 e0 ldi r19, 0x00 ; 0 2c04c: 2f 96 adiw r28, 0x0f ; 15 2c04e: ee ad ldd r30, Y+62 ; 0x3e 2c050: ff ad ldd r31, Y+63 ; 0x3f 2c052: 2f 97 sbiw r28, 0x0f ; 15 2c054: 07 8f std Z+31, r16 ; 0x1f 2c056: 1f cf rjmp .-450 ; 0x2be96 0002c058 : /// 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) 2c058: 2f 92 push r2 2c05a: 3f 92 push r3 2c05c: 4f 92 push r4 2c05e: 5f 92 push r5 2c060: 6f 92 push r6 2c062: 7f 92 push r7 2c064: 8f 92 push r8 2c066: 9f 92 push r9 2c068: af 92 push r10 2c06a: bf 92 push r11 2c06c: cf 92 push r12 2c06e: df 92 push r13 2c070: ef 92 push r14 2c072: ff 92 push r15 2c074: 0f 93 push r16 2c076: 1f 93 push r17 2c078: cf 93 push r28 2c07a: df 93 push r29 2c07c: cd b7 in r28, 0x3d ; 61 2c07e: de b7 in r29, 0x3e ; 62 2c080: 6c 97 sbiw r28, 0x1c ; 28 2c082: 0f b6 in r0, 0x3f ; 63 2c084: f8 94 cli 2c086: de bf out 0x3e, r29 ; 62 2c088: 0f be out 0x3f, r0 ; 63 2c08a: cd bf out 0x3d, r28 ; 61 2c08c: 6c 01 movw r12, r24 2c08e: 5b 01 movw r10, r22 2c090: 4a 01 movw r8, r20 2c092: 19 01 movw r2, r18 2c094: 18 87 std Y+8, r17 ; 0x08 2c096: 0f 83 std Y+7, r16 ; 0x07 2c098: fa 82 std Y+2, r15 ; 0x02 2c09a: 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; 2c09c: d7 01 movw r26, r14 2c09e: 8d 91 ld r24, X+ 2c0a0: 9c 91 ld r25, X 2c0a2: 60 ed ldi r22, 0xD0 ; 208 2c0a4: 72 e0 ldi r23, 0x02 ; 2 2c0a6: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 2c0aa: 9c 8f std Y+28, r25 ; 0x1c 2c0ac: 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); 2c0ae: 9f 93 push r25 2c0b0: 8f 93 push r24 2c0b2: 3f 92 push r3 2c0b4: 2f 93 push r18 2c0b6: 1f 92 push r1 2c0b8: 84 e6 ldi r24, 0x64 ; 100 2c0ba: 8f 93 push r24 2c0bc: 9f 92 push r9 2c0be: 8f 92 push r8 2c0c0: bf 92 push r11 2c0c2: af 92 push r10 2c0c4: df 92 push r13 2c0c6: cf 92 push r12 2c0c8: 8b e3 ldi r24, 0x3B ; 59 2c0ca: 99 e9 ldi r25, 0x99 ; 153 2c0cc: 9f 93 push r25 2c0ce: 8f 93 push r24 2c0d0: 0f 94 fe 9f call 0x33ffc ; 0x33ffc 2c0d4: 0f b6 in r0, 0x3f ; 63 2c0d6: f8 94 cli 2c0d8: de bf out 0x3e, r29 ; 62 2c0da: 0f be out 0x3f, r0 ; 63 2c0dc: 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; 2c0de: 22 27 eor r18, r18 2c0e0: 33 27 eor r19, r19 2c0e2: 22 19 sub r18, r2 2c0e4: 33 09 sbc r19, r3 2c0e6: 3a 8f std Y+26, r19 ; 0x1a 2c0e8: 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)); 2c0ea: c4 01 movw r24, r8 2c0ec: 99 0c add r9, r9 2c0ee: aa 0b sbc r26, r26 2c0f0: bb 0b sbc r27, r27 2c0f2: 89 87 std Y+9, r24 ; 0x09 2c0f4: 9a 87 std Y+10, r25 ; 0x0a 2c0f6: ab 87 std Y+11, r26 ; 0x0b 2c0f8: 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)); 2c0fa: 95 01 movw r18, r10 2c0fc: bb 0c add r11, r11 2c0fe: 44 0b sbc r20, r20 2c100: 55 0b sbc r21, r21 2c102: 29 8b std Y+17, r18 ; 0x11 2c104: 3a 8b std Y+18, r19 ; 0x12 2c106: 4b 8b std Y+19, r20 ; 0x13 2c108: 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)); 2c10a: c6 01 movw r24, r12 2c10c: dd 0c add r13, r13 2c10e: aa 0b sbc r26, r26 2c110: bb 0b sbc r27, r27 2c112: 8d 8b std Y+21, r24 ; 0x15 2c114: 9e 8b std Y+22, r25 ; 0x16 2c116: af 8b std Y+23, r26 ; 0x17 2c118: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2c11a: 12 14 cp r1, r2 2c11c: 13 04 cpc r1, r3 2c11e: 0c f0 brlt .+2 ; 0x2c122 2c120: ba c0 rjmp .+372 ; 0x2c296 { dad = dad_max - (ad / k); 2c122: 8b 8d ldd r24, Y+27 ; 0x1b 2c124: 9c 8d ldd r25, Y+28 ; 0x1c 2c126: 6c e3 ldi r22, 0x3C ; 60 2c128: 70 e0 ldi r23, 0x00 ; 0 2c12a: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 2c12e: 10 e1 ldi r17, 0x10 ; 16 2c130: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2c132: 2b 8d ldd r18, Y+27 ; 0x1b 2c134: 3c 8d ldd r19, Y+28 ; 0x1c 2c136: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c138: 0f 94 5c a2 call 0x344b8 ; 0x344b8 <__usmulhisi3> 2c13c: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2c140: 20 e0 ldi r18, 0x00 ; 0 2c142: 30 e0 ldi r19, 0x00 ; 0 2c144: 44 e3 ldi r20, 0x34 ; 52 2c146: 54 e4 ldi r21, 0x44 ; 68 2c148: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c14c: 6b 01 movw r12, r22 2c14e: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2c150: 6f 81 ldd r22, Y+7 ; 0x07 2c152: 78 85 ldd r23, Y+8 ; 0x08 2c154: eb 8d ldd r30, Y+27 ; 0x1b 2c156: fc 8d ldd r31, Y+28 ; 0x1c 2c158: 6e 0f add r22, r30 2c15a: 7f 1f adc r23, r31 2c15c: 90 e0 ldi r25, 0x00 ; 0 2c15e: 80 e0 ldi r24, 0x00 ; 0 2c160: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2c164: 25 e3 ldi r18, 0x35 ; 53 2c166: 3a ef ldi r19, 0xFA ; 250 2c168: 4e e8 ldi r20, 0x8E ; 142 2c16a: 5c e3 ldi r21, 0x3C ; 60 2c16c: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c170: 4b 01 movw r8, r22 2c172: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2c174: 0f 94 5e a3 call 0x346bc ; 0x346bc 2c178: 6b 83 std Y+3, r22 ; 0x03 2c17a: 7c 83 std Y+4, r23 ; 0x04 2c17c: 8d 83 std Y+5, r24 ; 0x05 2c17e: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2c180: c5 01 movw r24, r10 2c182: b4 01 movw r22, r8 2c184: 0f 94 24 a6 call 0x34c48 ; 0x34c48 2c188: 2b 01 movw r4, r22 2c18a: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2c18c: 69 85 ldd r22, Y+9 ; 0x09 2c18e: 7a 85 ldd r23, Y+10 ; 0x0a 2c190: 8b 85 ldd r24, Y+11 ; 0x0b 2c192: 9c 85 ldd r25, Y+12 ; 0x0c 2c194: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2c198: 4b 01 movw r8, r22 2c19a: 5c 01 movw r10, r24 2c19c: 2b 8d ldd r18, Y+27 ; 0x1b 2c19e: 3c 8d ldd r19, Y+28 ; 0x1c 2c1a0: a4 e6 ldi r26, 0x64 ; 100 2c1a2: b0 e0 ldi r27, 0x00 ; 0 2c1a4: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 2c1a8: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2c1ac: 20 e0 ldi r18, 0x00 ; 0 2c1ae: 30 e0 ldi r19, 0x00 ; 0 2c1b0: 44 e3 ldi r20, 0x34 ; 52 2c1b2: 54 e4 ldi r21, 0x44 ; 68 2c1b4: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c1b8: 9b 01 movw r18, r22 2c1ba: ac 01 movw r20, r24 2c1bc: c5 01 movw r24, r10 2c1be: b4 01 movw r22, r8 2c1c0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c1c4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2c1c8: 6d 87 std Y+13, r22 ; 0x0d 2c1ca: 7e 87 std Y+14, r23 ; 0x0e 2c1cc: 8f 87 std Y+15, r24 ; 0x0f 2c1ce: 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)); 2c1d0: 69 89 ldd r22, Y+17 ; 0x11 2c1d2: 7a 89 ldd r23, Y+18 ; 0x12 2c1d4: 8b 89 ldd r24, Y+19 ; 0x13 2c1d6: 9c 89 ldd r25, Y+20 ; 0x14 2c1d8: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2c1dc: 4b 01 movw r8, r22 2c1de: 5c 01 movw r10, r24 2c1e0: a3 01 movw r20, r6 2c1e2: 92 01 movw r18, r4 2c1e4: c7 01 movw r24, r14 2c1e6: b6 01 movw r22, r12 2c1e8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c1ec: 9b 01 movw r18, r22 2c1ee: ac 01 movw r20, r24 2c1f0: c5 01 movw r24, r10 2c1f2: b4 01 movw r22, r8 2c1f4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2c1f8: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2c1fc: 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)); 2c1fe: 6d 89 ldd r22, Y+21 ; 0x15 2c200: 7e 89 ldd r23, Y+22 ; 0x16 2c202: 8f 89 ldd r24, Y+23 ; 0x17 2c204: 98 8d ldd r25, Y+24 ; 0x18 2c206: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2c20a: 2b 01 movw r4, r22 2c20c: 3c 01 movw r6, r24 2c20e: a7 01 movw r20, r14 2c210: 96 01 movw r18, r12 2c212: 6b 81 ldd r22, Y+3 ; 0x03 2c214: 7c 81 ldd r23, Y+4 ; 0x04 2c216: 8d 81 ldd r24, Y+5 ; 0x05 2c218: 9e 81 ldd r25, Y+6 ; 0x06 2c21a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c21e: 9b 01 movw r18, r22 2c220: ac 01 movw r20, r24 2c222: c3 01 movw r24, r6 2c224: b2 01 movw r22, r4 2c226: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2c22a: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2c22e: 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)) 2c230: 01 e0 ldi r16, 0x01 ; 1 2c232: 20 e4 ldi r18, 0x40 ; 64 2c234: 31 e0 ldi r19, 0x01 ; 1 2c236: 4d 85 ldd r20, Y+13 ; 0x0d 2c238: 5e 85 ldd r21, Y+14 ; 0x0e 2c23a: b4 01 movw r22, r8 2c23c: 0e 94 ca c2 call 0x18594 ; 0x18594 2c240: 21 2f mov r18, r17 2c242: 30 e0 ldi r19, 0x00 ; 0 2c244: 88 23 and r24, r24 2c246: b9 f1 breq .+110 ; 0x2c2b6 2c248: 4b 8d ldd r20, Y+27 ; 0x1b 2c24a: 5c 8d ldd r21, Y+28 ; 0x1c 2c24c: 42 0f add r20, r18 2c24e: 53 1f adc r21, r19 { ad += dad + 1; 2c250: 4f 5f subi r20, 0xFF ; 255 2c252: 5f 4f sbci r21, 0xFF ; 255 2c254: 5c 8f std Y+28, r21 ; 0x1c 2c256: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2c258: eb 8d ldd r30, Y+27 ; 0x1b 2c25a: fc 8d ldd r31, Y+28 ; 0x1c 2c25c: a9 81 ldd r26, Y+1 ; 0x01 2c25e: ba 81 ldd r27, Y+2 ; 0x02 2c260: ed 93 st X+, r30 2c262: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2c264: 6c 96 adiw r28, 0x1c ; 28 2c266: 0f b6 in r0, 0x3f ; 63 2c268: f8 94 cli 2c26a: de bf out 0x3e, r29 ; 62 2c26c: 0f be out 0x3f, r0 ; 63 2c26e: cd bf out 0x3d, r28 ; 61 2c270: df 91 pop r29 2c272: cf 91 pop r28 2c274: 1f 91 pop r17 2c276: 0f 91 pop r16 2c278: ff 90 pop r15 2c27a: ef 90 pop r14 2c27c: df 90 pop r13 2c27e: cf 90 pop r12 2c280: bf 90 pop r11 2c282: af 90 pop r10 2c284: 9f 90 pop r9 2c286: 8f 90 pop r8 2c288: 7f 90 pop r7 2c28a: 6f 90 pop r6 2c28c: 5f 90 pop r5 2c28e: 4f 90 pop r4 2c290: 3f 90 pop r3 2c292: 2f 90 pop r2 2c294: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c296: 2f ec ldi r18, 0xCF ; 207 2c298: 32 e0 ldi r19, 0x02 ; 2 2c29a: ab 8d ldd r26, Y+27 ; 0x1b 2c29c: bc 8d ldd r27, Y+28 ; 0x1c 2c29e: 2a 1b sub r18, r26 2c2a0: 3b 0b sbc r19, r27 2c2a2: c9 01 movw r24, r18 2c2a4: 6c e3 ldi r22, 0x3C ; 60 2c2a6: 70 e0 ldi r23, 0x00 ; 0 2c2a8: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 2c2ac: 10 e1 ldi r17, 0x10 ; 16 2c2ae: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c2b0: a9 8d ldd r26, Y+25 ; 0x19 2c2b2: ba 8d ldd r27, Y+26 ; 0x1a 2c2b4: 41 cf rjmp .-382 ; 0x2c138 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c2b6: 2f 5f subi r18, 0xFF ; 255 2c2b8: 3f 4f sbci r19, 0xFF ; 255 2c2ba: ab 8d ldd r26, Y+27 ; 0x1b 2c2bc: bc 8d ldd r27, Y+28 ; 0x1c 2c2be: a2 0f add r26, r18 2c2c0: b3 1f adc r27, r19 2c2c2: bc 8f std Y+28, r27 ; 0x1c 2c2c4: ab 8f std Y+27, r26 ; 0x1b 2c2c6: a0 3d cpi r26, 0xD0 ; 208 2c2c8: b2 40 sbci r27, 0x02 ; 2 2c2ca: 08 f4 brcc .+2 ; 0x2c2ce 2c2cc: 26 cf rjmp .-436 ; 0x2c11a 2c2ce: c4 cf rjmp .-120 ; 0x2c258 0002c2d0 : float mesh_bed_leveling::get_z(float x, float y) { 2c2d0: 2f 92 push r2 2c2d2: 3f 92 push r3 2c2d4: 4f 92 push r4 2c2d6: 5f 92 push r5 2c2d8: 6f 92 push r6 2c2da: 7f 92 push r7 2c2dc: 8f 92 push r8 2c2de: 9f 92 push r9 2c2e0: af 92 push r10 2c2e2: bf 92 push r11 2c2e4: cf 92 push r12 2c2e6: df 92 push r13 2c2e8: ef 92 push r14 2c2ea: ff 92 push r15 2c2ec: 0f 93 push r16 2c2ee: 1f 93 push r17 2c2f0: cf 93 push r28 2c2f2: df 93 push r29 2c2f4: 00 d0 rcall .+0 ; 0x2c2f6 2c2f6: 00 d0 rcall .+0 ; 0x2c2f8 2c2f8: 00 d0 rcall .+0 ; 0x2c2fa 2c2fa: 1f 92 push r1 2c2fc: cd b7 in r28, 0x3d ; 61 2c2fe: de b7 in r29, 0x3e ; 62 2c300: 2b 01 movw r4, r22 2c302: 3c 01 movw r6, r24 2c304: 49 01 movw r8, r18 2c306: 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)); 2c308: 20 e0 ldi r18, 0x00 ; 0 2c30a: 30 e0 ldi r19, 0x00 ; 0 2c30c: 40 ec ldi r20, 0xC0 ; 192 2c30e: 51 e4 ldi r21, 0x41 ; 65 2c310: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c314: 20 e0 ldi r18, 0x00 ; 0 2c316: 30 e0 ldi r19, 0x00 ; 0 2c318: 48 e0 ldi r20, 0x08 ; 8 2c31a: 52 e4 ldi r21, 0x42 ; 66 2c31c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c320: 6b 01 movw r12, r22 2c322: 7c 01 movw r14, r24 2c324: 0f 94 0b a4 call 0x34816 ; 0x34816 2c328: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> if (i < 0) { i = 0; 2c32c: 31 2c mov r3, r1 2c32e: 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) { 2c330: 77 fd sbrc r23, 7 2c332: 1e c0 rjmp .+60 ; 0x2c370 2c334: 1b 01 movw r2, r22 2c336: 66 30 cpi r22, 0x06 ; 6 2c338: 71 05 cpc r23, r1 2c33a: 1c f0 brlt .+6 ; 0x2c342 2c33c: 45 e0 ldi r20, 0x05 ; 5 2c33e: 24 2e mov r2, r20 2c340: 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; } 2c342: 82 2d mov r24, r2 2c344: 0f 94 c5 8c call 0x3198a ; 0x3198a 2c348: 20 e0 ldi r18, 0x00 ; 0 2c34a: 30 e0 ldi r19, 0x00 ; 0 2c34c: 48 eb ldi r20, 0xB8 ; 184 2c34e: 51 e4 ldi r21, 0x41 ; 65 2c350: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2c354: 9b 01 movw r18, r22 2c356: 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; 2c358: c3 01 movw r24, r6 2c35a: b2 01 movw r22, r4 2c35c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c360: 20 e0 ldi r18, 0x00 ; 0 2c362: 30 e0 ldi r19, 0x00 ; 0 2c364: 48 e0 ldi r20, 0x08 ; 8 2c366: 52 e4 ldi r21, 0x42 ; 66 2c368: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c36c: 6b 01 movw r12, r22 2c36e: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 2c370: 20 e0 ldi r18, 0x00 ; 0 2c372: 30 e0 ldi r19, 0x00 ; 0 2c374: 40 ec ldi r20, 0xC0 ; 192 2c376: 50 e4 ldi r21, 0x40 ; 64 2c378: c5 01 movw r24, r10 2c37a: b4 01 movw r22, r8 2c37c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c380: 20 e0 ldi r18, 0x00 ; 0 2c382: 30 e0 ldi r19, 0x00 ; 0 2c384: 48 e0 ldi r20, 0x08 ; 8 2c386: 52 e4 ldi r21, 0x42 ; 66 2c388: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c38c: 69 83 std Y+1, r22 ; 0x01 2c38e: 7a 83 std Y+2, r23 ; 0x02 2c390: 8b 83 std Y+3, r24 ; 0x03 2c392: 9c 83 std Y+4, r25 ; 0x04 2c394: 0f 94 0b a4 call 0x34816 ; 0x34816 2c398: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> if (j < 0) { 2c39c: 77 fd sbrc r23, 7 2c39e: da c0 rjmp .+436 ; 0x2c554 2c3a0: 7a 87 std Y+10, r23 ; 0x0a 2c3a2: 69 87 std Y+9, r22 ; 0x09 2c3a4: 66 30 cpi r22, 0x06 ; 6 2c3a6: 71 05 cpc r23, r1 2c3a8: 24 f0 brlt .+8 ; 0x2c3b2 2c3aa: e5 e0 ldi r30, 0x05 ; 5 2c3ac: f0 e0 ldi r31, 0x00 ; 0 2c3ae: fa 87 std Y+10, r31 ; 0x0a 2c3b0: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 2c3b2: 89 85 ldd r24, Y+9 ; 0x09 2c3b4: 0f 94 c5 8c call 0x3198a ; 0x3198a 2c3b8: 20 e0 ldi r18, 0x00 ; 0 2c3ba: 30 e0 ldi r19, 0x00 ; 0 2c3bc: 40 ea ldi r20, 0xA0 ; 160 2c3be: 50 e4 ldi r21, 0x40 ; 64 2c3c0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2c3c4: 9b 01 movw r18, r22 2c3c6: 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; 2c3c8: c5 01 movw r24, r10 2c3ca: b4 01 movw r22, r8 2c3cc: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c3d0: 20 e0 ldi r18, 0x00 ; 0 2c3d2: 30 e0 ldi r19, 0x00 ; 0 2c3d4: 48 e0 ldi r20, 0x08 ; 8 2c3d6: 52 e4 ldi r21, 0x42 ; 66 2c3d8: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2c3dc: 69 83 std Y+1, r22 ; 0x01 2c3de: 7a 83 std Y+2, r23 ; 0x02 2c3e0: 8b 83 std Y+3, r24 ; 0x03 2c3e2: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 2c3e4: a7 01 movw r20, r14 2c3e6: 96 01 movw r18, r12 2c3e8: 60 e0 ldi r22, 0x00 ; 0 2c3ea: 70 e0 ldi r23, 0x00 ; 0 2c3ec: 80 e8 ldi r24, 0x80 ; 128 2c3ee: 9f e3 ldi r25, 0x3F ; 63 2c3f0: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c3f4: 2b 01 movw r4, r22 2c3f6: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 2c3f8: 91 01 movw r18, r2 2c3fa: 2f 5f subi r18, 0xFF ; 255 2c3fc: 3f 4f sbci r19, 0xFF ; 255 2c3fe: 3e 83 std Y+6, r19 ; 0x06 2c400: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 2c402: 89 85 ldd r24, Y+9 ; 0x09 2c404: 9a 85 ldd r25, Y+10 ; 0x0a 2c406: 01 96 adiw r24, 0x01 ; 1 2c408: 98 87 std Y+8, r25 ; 0x08 2c40a: 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]; 2c40c: 27 e0 ldi r18, 0x07 ; 7 2c40e: e9 85 ldd r30, Y+9 ; 0x09 2c410: fa 85 ldd r31, Y+10 ; 0x0a 2c412: 2e 9f mul r18, r30 2c414: 80 01 movw r16, r0 2c416: 2f 9f mul r18, r31 2c418: 10 0d add r17, r0 2c41a: 11 24 eor r1, r1 2c41c: f8 01 movw r30, r16 2c41e: e2 0d add r30, r2 2c420: f3 1d adc r31, r3 2c422: ee 0f add r30, r30 2c424: ff 1f adc r31, r31 2c426: ee 0f add r30, r30 2c428: ff 1f adc r31, r31 2c42a: e4 56 subi r30, 0x64 ; 100 2c42c: fd 4e sbci r31, 0xED ; 237 2c42e: 21 81 ldd r18, Z+1 ; 0x01 2c430: 32 81 ldd r19, Z+2 ; 0x02 2c432: 43 81 ldd r20, Z+3 ; 0x03 2c434: 54 81 ldd r21, Z+4 ; 0x04 2c436: c3 01 movw r24, r6 2c438: b2 01 movw r22, r4 2c43a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c43e: 4b 01 movw r8, r22 2c440: 5c 01 movw r10, r24 2c442: ed 81 ldd r30, Y+5 ; 0x05 2c444: fe 81 ldd r31, Y+6 ; 0x06 2c446: e0 0f add r30, r16 2c448: f1 1f adc r31, r17 2c44a: ee 0f add r30, r30 2c44c: ff 1f adc r31, r31 2c44e: ee 0f add r30, r30 2c450: ff 1f adc r31, r31 2c452: e4 56 subi r30, 0x64 ; 100 2c454: fd 4e sbci r31, 0xED ; 237 2c456: 21 81 ldd r18, Z+1 ; 0x01 2c458: 32 81 ldd r19, Z+2 ; 0x02 2c45a: 43 81 ldd r20, Z+3 ; 0x03 2c45c: 54 81 ldd r21, Z+4 ; 0x04 2c45e: c7 01 movw r24, r14 2c460: b6 01 movw r22, r12 2c462: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c466: 9b 01 movw r18, r22 2c468: ac 01 movw r20, r24 2c46a: c5 01 movw r24, r10 2c46c: b4 01 movw r22, r8 2c46e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2c472: 4b 01 movw r8, r22 2c474: 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; 2c476: 29 81 ldd r18, Y+1 ; 0x01 2c478: 3a 81 ldd r19, Y+2 ; 0x02 2c47a: 4b 81 ldd r20, Y+3 ; 0x03 2c47c: 5c 81 ldd r21, Y+4 ; 0x04 2c47e: 60 e0 ldi r22, 0x00 ; 0 2c480: 70 e0 ldi r23, 0x00 ; 0 2c482: 80 e8 ldi r24, 0x80 ; 128 2c484: 9f e3 ldi r25, 0x3F ; 63 2c486: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2c48a: 9b 01 movw r18, r22 2c48c: ac 01 movw r20, r24 2c48e: c5 01 movw r24, r10 2c490: b4 01 movw r22, r8 2c492: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c496: 4b 01 movw r8, r22 2c498: 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]; 2c49a: 27 e0 ldi r18, 0x07 ; 7 2c49c: ef 81 ldd r30, Y+7 ; 0x07 2c49e: f8 85 ldd r31, Y+8 ; 0x08 2c4a0: 2e 9f mul r18, r30 2c4a2: c0 01 movw r24, r0 2c4a4: 2f 9f mul r18, r31 2c4a6: 90 0d add r25, r0 2c4a8: 11 24 eor r1, r1 2c4aa: 9a 87 std Y+10, r25 ; 0x0a 2c4ac: 89 87 std Y+9, r24 ; 0x09 2c4ae: fc 01 movw r30, r24 2c4b0: e2 0d add r30, r2 2c4b2: f3 1d adc r31, r3 2c4b4: ee 0f add r30, r30 2c4b6: ff 1f adc r31, r31 2c4b8: ee 0f add r30, r30 2c4ba: ff 1f adc r31, r31 2c4bc: e4 56 subi r30, 0x64 ; 100 2c4be: fd 4e sbci r31, 0xED ; 237 2c4c0: 21 81 ldd r18, Z+1 ; 0x01 2c4c2: 32 81 ldd r19, Z+2 ; 0x02 2c4c4: 43 81 ldd r20, Z+3 ; 0x03 2c4c6: 54 81 ldd r21, Z+4 ; 0x04 2c4c8: c3 01 movw r24, r6 2c4ca: b2 01 movw r22, r4 2c4cc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c4d0: 2b 01 movw r4, r22 2c4d2: 3c 01 movw r6, r24 2c4d4: 89 85 ldd r24, Y+9 ; 0x09 2c4d6: 9a 85 ldd r25, Y+10 ; 0x0a 2c4d8: ed 81 ldd r30, Y+5 ; 0x05 2c4da: fe 81 ldd r31, Y+6 ; 0x06 2c4dc: 8e 0f add r24, r30 2c4de: 9f 1f adc r25, r31 2c4e0: 88 0f add r24, r24 2c4e2: 99 1f adc r25, r25 2c4e4: 88 0f add r24, r24 2c4e6: 99 1f adc r25, r25 2c4e8: 84 56 subi r24, 0x64 ; 100 2c4ea: 9d 4e sbci r25, 0xED ; 237 2c4ec: fc 01 movw r30, r24 2c4ee: 21 81 ldd r18, Z+1 ; 0x01 2c4f0: 32 81 ldd r19, Z+2 ; 0x02 2c4f2: 43 81 ldd r20, Z+3 ; 0x03 2c4f4: 54 81 ldd r21, Z+4 ; 0x04 2c4f6: c7 01 movw r24, r14 2c4f8: b6 01 movw r22, r12 2c4fa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c4fe: 9b 01 movw r18, r22 2c500: ac 01 movw r20, r24 2c502: c3 01 movw r24, r6 2c504: b2 01 movw r22, r4 2c506: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> return (1.f-t) * z0 + t * z1; 2c50a: 29 81 ldd r18, Y+1 ; 0x01 2c50c: 3a 81 ldd r19, Y+2 ; 0x02 2c50e: 4b 81 ldd r20, Y+3 ; 0x03 2c510: 5c 81 ldd r21, Y+4 ; 0x04 2c512: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2c516: 9b 01 movw r18, r22 2c518: ac 01 movw r20, r24 2c51a: c5 01 movw r24, r10 2c51c: b4 01 movw r22, r8 2c51e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> } 2c522: 2a 96 adiw r28, 0x0a ; 10 2c524: 0f b6 in r0, 0x3f ; 63 2c526: f8 94 cli 2c528: de bf out 0x3e, r29 ; 62 2c52a: 0f be out 0x3f, r0 ; 63 2c52c: cd bf out 0x3d, r28 ; 61 2c52e: df 91 pop r29 2c530: cf 91 pop r28 2c532: 1f 91 pop r17 2c534: 0f 91 pop r16 2c536: ff 90 pop r15 2c538: ef 90 pop r14 2c53a: df 90 pop r13 2c53c: cf 90 pop r12 2c53e: bf 90 pop r11 2c540: af 90 pop r10 2c542: 9f 90 pop r9 2c544: 8f 90 pop r8 2c546: 7f 90 pop r7 2c548: 6f 90 pop r6 2c54a: 5f 90 pop r5 2c54c: 4f 90 pop r4 2c54e: 3f 90 pop r3 2c550: 2f 90 pop r2 2c552: 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; 2c554: 1a 86 std Y+10, r1 ; 0x0a 2c556: 19 86 std Y+9, r1 ; 0x09 2c558: 45 cf rjmp .-374 ; 0x2c3e4 0002c55a : 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) { 2c55a: 1f 93 push r17 2c55c: cf 93 push r28 2c55e: df 93 push r29 2c560: 00 d0 rcall .+0 ; 0x2c562 2c562: 1f 92 push r1 2c564: 1f 92 push r1 2c566: cd b7 in r28, 0x3d ; 61 2c568: de b7 in r29, 0x3e ; 62 2c56a: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 2c56c: 48 2f mov r20, r24 2c56e: 62 e5 ldi r22, 0x52 ; 82 2c570: ce 01 movw r24, r28 2c572: 01 96 adiw r24, 0x01 ; 1 2c574: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c578: 49 81 ldd r20, Y+1 ; 0x01 2c57a: 5a 81 ldd r21, Y+2 ; 0x02 2c57c: 6b 81 ldd r22, Y+3 ; 0x03 2c57e: 7c 81 ldd r23, Y+4 ; 0x04 2c580: 8d 81 ldd r24, Y+5 ; 0x05 2c582: 0f 94 78 3c call 0x278f0 ; 0x278f0 scopeState = nextState; 2c586: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c58a: 0f 90 pop r0 2c58c: 0f 90 pop r0 2c58e: 0f 90 pop r0 2c590: 0f 90 pop r0 2c592: 0f 90 pop r0 2c594: df 91 pop r29 2c596: cf 91 pop r28 2c598: 1f 91 pop r17 2c59a: 08 95 ret 0002c59c : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 2c59c: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 2c5a0: e5 e0 ldi r30, 0x05 ; 5 2c5a2: fe e9 ldi r31, 0x9E ; 158 2c5a4: 84 91 lpm r24, Z 2c5a6: 67 e0 ldi r22, 0x07 ; 7 2c5a8: 0d 94 ad 62 jmp 0x2c55a ; 0x2c55a 0002c5ac : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 2c5ac: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c5b0: ae 2f mov r26, r30 2c5b2: b0 e0 ldi r27, 0x00 ; 0 2c5b4: aa 0f add r26, r26 2c5b6: bb 1f adc r27, r27 2c5b8: a3 59 subi r26, 0x93 ; 147 2c5ba: bd 4e sbci r27, 0xED ; 237 2c5bc: 20 91 40 12 lds r18, 0x1240 ; 0x801240 2c5c0: 30 91 41 12 lds r19, 0x1241 ; 0x801241 2c5c4: 2d 93 st X+, r18 2c5c6: 3c 93 st X, r19 ++regIndex; 2c5c8: ef 5f subi r30, 0xFF ; 255 2c5ca: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs16Count) { 2c5ce: e2 30 cpi r30, 0x02 ; 2 2c5d0: 40 f4 brcc .+16 ; 0x2c5e2 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c5d2: f0 e0 ldi r31, 0x00 ; 0 2c5d4: e4 51 subi r30, 0x14 ; 20 2c5d6: f2 46 sbci r31, 0x62 ; 98 2c5d8: 84 91 lpm r24, Z 2c5da: 68 e0 ldi r22, 0x08 ; 8 2c5dc: 0f 94 ad 62 call 0x2c55a ; 0x2c55a } return ScopeState::Reading16bitRegisters; 2c5e0: 88 e0 ldi r24, 0x08 ; 8 } 2c5e2: 08 95 ret 0002c5e4 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 2c5e4: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c5e8: ae 2f mov r26, r30 2c5ea: b0 e0 ldi r27, 0x00 ; 0 2c5ec: a6 59 subi r26, 0x96 ; 150 2c5ee: bd 4e sbci r27, 0xED ; 237 2c5f0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c5f4: 8c 93 st X, r24 ++regIndex; 2c5f6: ef 5f subi r30, 0xFF ; 255 2c5f8: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs8Count) { 2c5fc: e3 30 cpi r30, 0x03 ; 3 2c5fe: 40 f0 brcs .+16 ; 0x2c610 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 2c600: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c604: ec ee ldi r30, 0xEC ; 236 2c606: fd e9 ldi r31, 0x9D ; 157 2c608: 84 91 lpm r24, Z 2c60a: 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); 2c60c: 0d 94 ad 62 jmp 0x2c55a ; 0x2c55a 2c610: f0 e0 ldi r31, 0x00 ; 0 2c612: eb 5f subi r30, 0xFB ; 251 2c614: f1 46 sbci r31, 0x61 ; 97 2c616: 84 91 lpm r24, Z 2c618: 67 e0 ldi r22, 0x07 ; 7 2c61a: f8 cf rjmp .-16 ; 0x2c60c 0002c61c : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 2c61c: cf 93 push r28 2c61e: df 93 push r29 2c620: 00 d0 rcall .+0 ; 0x2c622 2c622: 00 d0 rcall .+0 ; 0x2c624 2c624: 00 d0 rcall .+0 ; 0x2c626 2c626: 1f 92 push r1 2c628: cd b7 in r28, 0x3d ; 61 2c62a: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 2c62c: 80 91 2f 12 lds r24, 0x122F ; 0x80122f 2c630: 82 34 cpi r24, 0x42 ; 66 2c632: 09 f4 brne .+2 ; 0x2c636 2c634: 46 c0 rjmp .+140 ; 0x2c6c2 2c636: b8 f5 brcc .+110 ; 0x2c6a6 2c638: 88 23 and r24, r24 2c63a: 09 f4 brne .+2 ; 0x2c63e 2c63c: 72 c0 rjmp .+228 ; 0x2c722 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 2c63e: 84 e0 ldi r24, 0x04 ; 4 2c640: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2c644: 85 e0 ldi r24, 0x05 ; 5 2c646: ef e2 ldi r30, 0x2F ; 47 2c648: f2 e1 ldi r31, 0x12 ; 18 2c64a: de 01 movw r26, r28 2c64c: 16 96 adiw r26, 0x06 ; 6 2c64e: 01 90 ld r0, Z+ 2c650: 0d 92 st X+, r0 2c652: 8a 95 dec r24 2c654: e1 f7 brne .-8 ; 0x2c64e StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2c656: 85 e0 ldi r24, 0x05 ; 5 2c658: fe 01 movw r30, r28 2c65a: 36 96 adiw r30, 0x06 ; 6 2c65c: aa e2 ldi r26, 0x2A ; 42 2c65e: b2 e1 ldi r27, 0x12 ; 18 2c660: 01 90 ld r0, Z+ 2c662: 0d 92 st X+, r0 2c664: 8a 95 dec r24 2c666: e1 f7 brne .-8 ; 0x2c660 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 2c668: 40 e0 ldi r20, 0x00 ; 0 2c66a: 60 e0 ldi r22, 0x00 ; 0 2c66c: ce 01 movw r24, r28 2c66e: 01 96 adiw r24, 0x01 ; 1 2c670: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c674: 85 e0 ldi r24, 0x05 ; 5 2c676: fe 01 movw r30, r28 2c678: 31 96 adiw r30, 0x01 ; 1 2c67a: af e2 ldi r26, 0x2F ; 47 2c67c: b2 e1 ldi r27, 0x12 ; 18 2c67e: 01 90 ld r0, Z+ 2c680: 0d 92 st X+, r0 2c682: 8a 95 dec r24 2c684: e1 f7 brne .-8 ; 0x2c67e void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2c686: 85 e0 ldi r24, 0x05 ; 5 2c688: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2c68c: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2c690: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2c694: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2c698: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2c69c: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2c6a0: 0f 94 78 3c call 0x278f0 ; 0x278f0 2c6a4: 2e c0 rjmp .+92 ; 0x2c702 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 2c6a6: 82 35 cpi r24, 0x52 ; 82 2c6a8: b1 f1 breq .+108 ; 0x2c716 2c6aa: 87 35 cpi r24, 0x57 ; 87 2c6ac: 41 f6 brne .-112 ; 0x2c63e 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); 2c6ae: 60 91 31 12 lds r22, 0x1231 ; 0x801231 2c6b2: 70 91 32 12 lds r23, 0x1232 ; 0x801232 2c6b6: 4c e0 ldi r20, 0x0C ; 12 2c6b8: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c6bc: 0f 94 e3 3c call 0x279c6 ; 0x279c6 2c6c0: 11 c0 rjmp .+34 ; 0x2c6e4 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 2c6c2: 40 91 30 12 lds r20, 0x1230 ; 0x801230 2c6c6: 62 e4 ldi r22, 0x42 ; 66 2c6c8: ce 01 movw r24, r28 2c6ca: 01 96 adiw r24, 0x01 ; 1 2c6cc: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c6d0: 49 81 ldd r20, Y+1 ; 0x01 2c6d2: 5a 81 ldd r21, Y+2 ; 0x02 2c6d4: 6b 81 ldd r22, Y+3 ; 0x03 2c6d6: 7c 81 ldd r23, Y+4 ; 0x04 2c6d8: 8d 81 ldd r24, Y+5 ; 0x05 2c6da: 0f 94 78 3c call 0x278f0 ; 0x278f0 scopeState = ScopeState::ButtonSent; 2c6de: 8a e0 ldi r24, 0x0A ; 10 2c6e0: 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); 2c6e4: 40 e0 ldi r20, 0x00 ; 0 2c6e6: 60 e0 ldi r22, 0x00 ; 0 2c6e8: ce 01 movw r24, r28 2c6ea: 01 96 adiw r24, 0x01 ; 1 2c6ec: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c6f0: 85 e0 ldi r24, 0x05 ; 5 2c6f2: fe 01 movw r30, r28 2c6f4: 31 96 adiw r30, 0x01 ; 1 2c6f6: af e2 ldi r26, 0x2F ; 47 2c6f8: b2 e1 ldi r27, 0x12 ; 18 2c6fa: 01 90 ld r0, Z+ 2c6fc: 0d 92 st X+, r0 2c6fe: 8a 95 dec r24 2c700: e1 f7 brne .-8 ; 0x2c6fa default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 2c702: 81 e0 ldi r24, 0x01 ; 1 } } 2c704: 2a 96 adiw r28, 0x0a ; 10 2c706: 0f b6 in r0, 0x3f ; 63 2c708: f8 94 cli 2c70a: de bf out 0x3e, r29 ; 62 2c70c: 0f be out 0x3f, r0 ; 63 2c70e: cd bf out 0x3d, r28 ; 61 2c710: df 91 pop r29 2c712: cf 91 pop r28 2c714: 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); 2c716: 6b e0 ldi r22, 0x0B ; 11 2c718: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c71c: 0f 94 ad 62 call 0x2c55a ; 0x2c55a 2c720: e1 cf rjmp .-62 ; 0x2c6e4 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 2c722: 80 e0 ldi r24, 0x00 ; 0 2c724: ef cf rjmp .-34 ; 0x2c704 0002c726 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 2c726: cf 93 push r28 2c728: df 93 push r29 2c72a: 00 d0 rcall .+0 ; 0x2c72c 2c72c: 1f 92 push r1 2c72e: 1f 92 push r1 2c730: cd b7 in r28, 0x3d ; 61 2c732: de b7 in r29, 0x3e ; 62 2c734: 49 83 std Y+1, r20 ; 0x01 2c736: 5a 83 std Y+2, r21 ; 0x02 2c738: 6b 83 std Y+3, r22 ; 0x03 2c73a: 7c 83 std Y+4, r23 ; 0x04 2c73c: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 2c73e: 85 e0 ldi r24, 0x05 ; 5 2c740: fe 01 movw r30, r28 2c742: 31 96 adiw r30, 0x01 ; 1 2c744: af e2 ldi r26, 0x2F ; 47 2c746: b2 e1 ldi r27, 0x12 ; 18 2c748: 01 90 ld r0, Z+ 2c74a: 0d 92 st X+, r0 2c74c: 8a 95 dec r24 2c74e: e1 f7 brne .-8 ; 0x2c748 if (!ExpectsResponse()) { 2c750: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2c754: 87 ff sbrs r24, 7 2c756: 09 c0 rjmp .+18 ; 0x2c76a ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 2c758: 0f 90 pop r0 2c75a: 0f 90 pop r0 2c75c: 0f 90 pop r0 2c75e: 0f 90 pop r0 2c760: 0f 90 pop r0 2c762: df 91 pop r29 2c764: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 2c766: 0d 94 0e 63 jmp 0x2c61c ; 0x2c61c } // otherwise wait for an empty window to activate the request } 2c76a: 0f 90 pop r0 2c76c: 0f 90 pop r0 2c76e: 0f 90 pop r0 2c770: 0f 90 pop r0 2c772: 0f 90 pop r0 2c774: df 91 pop r29 2c776: cf 91 pop r28 2c778: 08 95 ret 0002c77a : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2c77a: cf 93 push r28 2c77c: df 93 push r29 2c77e: 00 d0 rcall .+0 ; 0x2c780 2c780: 1f 92 push r1 2c782: 1f 92 push r1 2c784: cd b7 in r28, 0x3d ; 61 2c786: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2c788: 48 2f mov r20, r24 2c78a: 68 e5 ldi r22, 0x58 ; 88 2c78c: ce 01 movw r24, r28 2c78e: 01 96 adiw r24, 0x01 ; 1 2c790: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c794: 49 81 ldd r20, Y+1 ; 0x01 2c796: 5a 81 ldd r21, Y+2 ; 0x02 2c798: 6b 81 ldd r22, Y+3 ; 0x03 2c79a: 7c 81 ldd r23, Y+4 ; 0x04 2c79c: 8d 81 ldd r24, Y+5 ; 0x05 2c79e: 0f 94 93 63 call 0x2c726 ; 0x2c726 } 2c7a2: 0f 90 pop r0 2c7a4: 0f 90 pop r0 2c7a6: 0f 90 pop r0 2c7a8: 0f 90 pop r0 2c7aa: 0f 90 pop r0 2c7ac: df 91 pop r29 2c7ae: cf 91 pop r28 2c7b0: 08 95 ret 0002c7b2 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 2c7b2: 1f 93 push r17 2c7b4: cf 93 push r28 2c7b6: df 93 push r29 2c7b8: 00 d0 rcall .+0 ; 0x2c7ba 2c7ba: 1f 92 push r1 2c7bc: 1f 92 push r1 2c7be: cd b7 in r28, 0x3d ; 61 2c7c0: de b7 in r29, 0x3e ; 62 2c7c2: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 2c7c4: 48 2f mov r20, r24 2c7c6: 63 e5 ldi r22, 0x53 ; 83 2c7c8: ce 01 movw r24, r28 2c7ca: 01 96 adiw r24, 0x01 ; 1 2c7cc: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c7d0: 49 81 ldd r20, Y+1 ; 0x01 2c7d2: 5a 81 ldd r21, Y+2 ; 0x02 2c7d4: 6b 81 ldd r22, Y+3 ; 0x03 2c7d6: 7c 81 ldd r23, Y+4 ; 0x04 2c7d8: 8d 81 ldd r24, Y+5 ; 0x05 2c7da: 0f 94 78 3c call 0x278f0 ; 0x278f0 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 2c7de: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c7e2: 0f 90 pop r0 2c7e4: 0f 90 pop r0 2c7e6: 0f 90 pop r0 2c7e8: 0f 90 pop r0 2c7ea: 0f 90 pop r0 2c7ec: df 91 pop r29 2c7ee: cf 91 pop r28 2c7f0: 1f 91 pop r17 2c7f2: 08 95 ret 0002c7f4 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 2c7f4: 1f 93 push r17 2c7f6: cf 93 push r28 2c7f8: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 2c7fa: e1 e0 ldi r30, 0x01 ; 1 2c7fc: f1 e0 ldi r31, 0x01 ; 1 2c7fe: 80 81 ld r24, Z 2c800: 8e 7f andi r24, 0xFE ; 254 2c802: 80 83 st Z, r24 PORTH |= 0x01; 2c804: e2 e0 ldi r30, 0x02 ; 2 2c806: f1 e0 ldi r31, 0x01 ; 1 2c808: 80 81 ld r24, Z 2c80a: 81 60 ori r24, 0x01 ; 1 2c80c: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 2c80e: ef ea ldi r30, 0xAF ; 175 2c810: fd e0 ldi r31, 0x0D ; 13 2c812: 90 e1 ldi r25, 0x10 ; 16 2c814: 90 83 st Z, r25 ptr[1] = 0; 2c816: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 2c818: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 2c81a: e0 ed ldi r30, 0xD0 ; 208 2c81c: f0 e0 ldi r31, 0x00 ; 0 2c81e: 80 81 ld r24, Z 2c820: 82 60 ori r24, 0x02 ; 2 2c822: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 2c824: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 2c828: e1 ed ldi r30, 0xD1 ; 209 2c82a: f0 e0 ldi r31, 0x00 ; 0 2c82c: 88 e1 ldi r24, 0x18 ; 24 2c82e: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 2c830: 80 81 ld r24, Z 2c832: 80 68 ori r24, 0x80 ; 128 2c834: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 2c836: e7 e0 ldi r30, 0x07 ; 7 2c838: f2 e1 ldi r31, 0x12 ; 18 2c83a: 85 ef ldi r24, 0xF5 ; 245 2c83c: 97 ef ldi r25, 0xF7 ; 247 2c83e: 91 87 std Z+9, r25 ; 0x09 2c840: 80 87 std Z+8, r24 ; 0x08 2c842: 8d ed ldi r24, 0xDD ; 221 2c844: 97 ef ldi r25, 0xF7 ; 247 2c846: 93 87 std Z+11, r25 ; 0x0b 2c848: 82 87 std Z+10, r24 ; 0x0a 2c84a: 13 e0 ldi r17, 0x03 ; 3 2c84c: 13 83 std Z+3, r17 ; 0x03 2c84e: 15 86 std Z+13, r1 ; 0x0d 2c850: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c852: 80 e0 ldi r24, 0x00 ; 0 2c854: 0f 94 bd 63 call 0x2c77a ; 0x2c77a mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 2c858: 83 e6 ldi r24, 0x63 ; 99 2c85a: 0f 94 08 42 call 0x28410 ; 0x28410 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2c85e: 85 e8 ldi r24, 0x85 ; 133 2c860: 9c e9 ldi r25, 0x9C ; 156 2c862: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 retryAttempts = MAX_RETRIES; 2c866: c5 e2 ldi r28, 0x25 ; 37 2c868: d2 e1 ldi r29, 0x12 ; 18 2c86a: 10 93 79 12 sts 0x1279, r17 ; 0x801279 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2c86e: 8a e0 ldi r24, 0x0A ; 10 2c870: 9e e9 ldi r25, 0x9E ; 158 2c872: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 /// @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; } 2c876: 8a e0 ldi r24, 0x0A ; 10 2c878: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 2c87a: 82 e0 ldi r24, 0x02 ; 2 2c87c: 80 93 94 12 sts 0x1294, r24 ; 0x801294 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2c880: 81 e0 ldi r24, 0x01 ; 1 2c882: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 2c884: 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; 2c886: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2c888: 86 e0 ldi r24, 0x06 ; 6 2c88a: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 2c88c: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 2c88e: df 91 pop r29 2c890: cf 91 pop r28 2c892: 1f 91 pop r17 2c894: 0d 94 d9 63 jmp 0x2c7b2 ; 0x2c7b2 0002c898 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 2c898: cf 93 push r28 2c89a: df 93 push r29 2c89c: 00 d0 rcall .+0 ; 0x2c89e 2c89e: 1f 92 push r1 2c8a0: 1f 92 push r1 2c8a2: cd b7 in r28, 0x3d ; 61 2c8a4: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 2c8a6: 40 e0 ldi r20, 0x00 ; 0 2c8a8: 61 e5 ldi r22, 0x51 ; 81 2c8aa: ce 01 movw r24, r28 2c8ac: 01 96 adiw r24, 0x01 ; 1 2c8ae: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c8b2: 49 81 ldd r20, Y+1 ; 0x01 2c8b4: 5a 81 ldd r21, Y+2 ; 0x02 2c8b6: 6b 81 ldd r22, Y+3 ; 0x03 2c8b8: 7c 81 ldd r23, Y+4 ; 0x04 2c8ba: 8d 81 ldd r24, Y+5 ; 0x05 2c8bc: 0f 94 78 3c call 0x278f0 ; 0x278f0 scopeState = ScopeState::QuerySent; 2c8c0: 84 e0 ldi r24, 0x04 ; 4 2c8c2: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c8c6: 0f 90 pop r0 2c8c8: 0f 90 pop r0 2c8ca: 0f 90 pop r0 2c8cc: 0f 90 pop r0 2c8ce: 0f 90 pop r0 2c8d0: df 91 pop r29 2c8d2: cf 91 pop r28 2c8d4: 08 95 ret 0002c8d6 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 2c8d6: cf 93 push r28 2c8d8: df 93 push r29 2c8da: 00 d0 rcall .+0 ; 0x2c8dc 2c8dc: 1f 92 push r1 2c8de: 1f 92 push r1 2c8e0: cd b7 in r28, 0x3d ; 61 2c8e2: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 2c8e4: 0f 94 96 88 call 0x3112c ; 0x3112c 2c8e8: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2c8ec: 48 2f mov r20, r24 2c8ee: 66 e6 ldi r22, 0x66 ; 102 2c8f0: ce 01 movw r24, r28 2c8f2: 01 96 adiw r24, 0x01 ; 1 2c8f4: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c8f8: 49 81 ldd r20, Y+1 ; 0x01 2c8fa: 5a 81 ldd r21, Y+2 ; 0x02 2c8fc: 6b 81 ldd r22, Y+3 ; 0x03 2c8fe: 7c 81 ldd r23, Y+4 ; 0x04 2c900: 8d 81 ldd r24, Y+5 ; 0x05 2c902: 0f 94 78 3c call 0x278f0 ; 0x278f0 scopeState = ScopeState::FilamentSensorStateSent; 2c906: 86 e0 ldi r24, 0x06 ; 6 2c908: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c90c: 0f 90 pop r0 2c90e: 0f 90 pop r0 2c910: 0f 90 pop r0 2c912: 0f 90 pop r0 2c914: 0f 90 pop r0 2c916: df 91 pop r29 2c918: cf 91 pop r28 2c91a: 08 95 ret 0002c91c : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 2c91c: cf 93 push r28 2c91e: df 93 push r29 2c920: 00 d0 rcall .+0 ; 0x2c922 2c922: 1f 92 push r1 2c924: 1f 92 push r1 2c926: cd b7 in r28, 0x3d ; 61 2c928: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 2c92a: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2c92e: 85 34 cpi r24, 0x45 ; 69 2c930: f1 f0 breq .+60 ; 0x2c96e 2c932: 20 f4 brcc .+8 ; 0x2c93c 2c934: 82 34 cpi r24, 0x42 ; 66 2c936: 51 f1 breq .+84 ; 0x2c98c } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 2c938: 85 e0 ldi r24, 0x05 ; 5 2c93a: 11 c0 rjmp .+34 ; 0x2c95e } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 2c93c: 86 34 cpi r24, 0x46 ; 70 2c93e: 71 f1 breq .+92 ; 0x2c99c 2c940: 80 35 cpi r24, 0x50 ; 80 2c942: d1 f7 brne .-12 ; 0x2c938 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 2c944: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c948: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2c94c: 81 e0 ldi r24, 0x01 ; 1 2c94e: 90 e0 ldi r25, 0x00 ; 0 2c950: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c954: 80 93 65 12 sts 0x1265, r24 ; 0x801265 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 2c958: 0f 94 6b 64 call 0x2c8d6 ; 0x2c8d6 return Processing; 2c95c: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 2c95e: 0f 90 pop r0 2c960: 0f 90 pop r0 2c962: 0f 90 pop r0 2c964: 0f 90 pop r0 2c966: 0f 90 pop r0 2c968: df 91 pop r29 2c96a: cf 91 pop r28 2c96c: 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; 2c96e: 8c e0 ldi r24, 0x0C ; 12 2c970: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2c974: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c978: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2c97c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c980: 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(); 2c984: 0f 94 6b 64 call 0x2c8d6 ; 0x2c8d6 return CommandError; 2c988: 87 e0 ldi r24, 0x07 ; 7 2c98a: e9 cf rjmp .-46 ; 0x2c95e 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); 2c98c: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c990: 80 93 68 12 sts 0x1268, r24 ; 0x801268 SendAndUpdateFilamentSensor(); 2c994: 0f 94 6b 64 call 0x2c8d6 ; 0x2c8d6 return ButtonPushed; 2c998: 8b e0 ldi r24, 0x0B ; 11 2c99a: e1 cf rjmp .-62 ; 0x2c95e 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) { 2c99c: 90 91 2a 12 lds r25, 0x122A ; 0x80122a 2c9a0: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2c9a4: 98 13 cpse r25, r24 2c9a6: 22 c0 rjmp .+68 ; 0x2c9ec 2c9a8: 90 91 2b 12 lds r25, 0x122B ; 0x80122b 2c9ac: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2c9b0: 98 13 cpse r25, r24 2c9b2: 1c c0 rjmp .+56 ; 0x2c9ec progressCode = ProgressCode::OK; 2c9b4: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::OK; 2c9b8: 81 e0 ldi r24, 0x01 ; 1 2c9ba: 90 e0 ldi r25, 0x00 ; 0 2c9bc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c9c0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 scopeState = ScopeState::Ready; 2c9c4: 82 e8 ldi r24, 0x82 ; 130 2c9c6: 80 93 28 12 sts 0x1228, r24 ; 0x801228 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 2c9ca: 40 e0 ldi r20, 0x00 ; 0 2c9cc: 60 e0 ldi r22, 0x00 ; 0 2c9ce: ce 01 movw r24, r28 2c9d0: 01 96 adiw r24, 0x01 ; 1 2c9d2: 0f 94 53 88 call 0x310a6 ; 0x310a6 2c9d6: 85 e0 ldi r24, 0x05 ; 5 2c9d8: fe 01 movw r30, r28 2c9da: 31 96 adiw r30, 0x01 ; 1 2c9dc: aa e2 ldi r26, 0x2A ; 42 2c9de: b2 e1 ldi r27, 0x12 ; 18 2c9e0: 01 90 ld r0, Z+ 2c9e2: 0d 92 st X+, r0 2c9e4: 8a 95 dec r24 2c9e6: e1 f7 brne .-8 ; 0x2c9e0 2c9e8: 82 e0 ldi r24, 0x02 ; 2 2c9ea: b9 cf rjmp .-142 ; 0x2c95e return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 2c9ec: 83 e0 ldi r24, 0x03 ; 3 2c9ee: b7 cf rjmp .-146 ; 0x2c95e 0002c9f0 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 2c9f0: 1f 93 push r17 2c9f2: cf 93 push r28 2c9f4: df 93 push r29 2c9f6: 00 d0 rcall .+0 ; 0x2c9f8 2c9f8: 1f 92 push r1 2c9fa: 1f 92 push r1 2c9fc: cd b7 in r28, 0x3d ; 61 2c9fe: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 2ca00: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 2ca04: 81 11 cpse r24, r1 2ca06: 2a c0 rjmp .+84 ; 0x2ca5c auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 2ca08: 10 91 8f 12 lds r17, 0x128F ; 0x80128f 2ca0c: 1f 3f cpi r17, 0xFF ; 255 2ca0e: 91 f5 brne .+100 ; 0x2ca74 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 2ca10: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2ca14: 81 11 cpse r24, r1 2ca16: 60 c0 rjmp .+192 ; 0x2cad8 2ca18: 1f 3f cpi r17, 0xFF ; 255 2ca1a: b9 f0 breq .+46 ; 0x2ca4a inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 2ca1c: 81 e0 ldi r24, 0x01 ; 1 2ca1e: 90 e0 ldi r25, 0x00 ; 0 2ca20: 90 93 26 12 sts 0x1226, r25 ; 0x801226 2ca24: 80 93 25 12 sts 0x1225, r24 ; 0x801225 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 2ca28: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 2ca2c: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c lastErrorSource = ErrorSource::ErrorSourceNone; 2ca30: 8f ef ldi r24, 0xFF ; 255 2ca32: 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) { 2ca36: 13 30 cpi r17, 0x03 ; 3 2ca38: 09 f4 brne .+2 ; 0x2ca3c 2ca3a: 82 c0 rjmp .+260 ; 0x2cb40 2ca3c: f8 f0 brcs .+62 ; 0x2ca7c 2ca3e: 16 30 cpi r17, 0x06 ; 6 2ca40: 08 f4 brcc .+2 ; 0x2ca44 2ca42: 7b c0 rjmp .+246 ; 0x2cb3a 2ca44: 17 30 cpi r17, 0x07 ; 7 2ca46: 09 f4 brne .+2 ; 0x2ca4a 2ca48: 7f c0 rjmp .+254 ; 0x2cb48 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 2ca4a: 0f 90 pop r0 2ca4c: 0f 90 pop r0 2ca4e: 0f 90 pop r0 2ca50: 0f 90 pop r0 2ca52: 0f 90 pop r0 2ca54: df 91 pop r29 2ca56: cf 91 pop r28 2ca58: 1f 91 pop r17 2ca5a: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 2ca5c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2ca60: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2ca64: 0f 94 23 8b call 0x31646 ; 0x31646 2ca68: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 2ca6a: 10 92 ae 0d sts 0x0DAE, r1 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 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) { 2ca6e: 8f 3f cpi r24, 0xFF ; 255 2ca70: 79 f6 brne .-98 ; 0x2ca10 2ca72: ca cf rjmp .-108 ; 0x2ca08 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 2ca74: 8f ef ldi r24, 0xFF ; 255 2ca76: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f 2ca7a: ca cf rjmp .-108 ; 0x2ca10 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 2ca7c: 8e e6 ldi r24, 0x6E ; 110 2ca7e: 9c e9 ldi r25, 0x9C ; 156 2ca80: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 2ca84: 81 2f mov r24, r17 2ca86: 90 e0 ldi r25, 0x00 ; 0 2ca88: 0f 94 00 42 call 0x28400 ; 0x28400 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 2ca8c: 0f 94 c6 6a call 0x2d58c ; 0x2d58c if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 2ca90: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2ca94: 81 30 cpi r24, 0x01 ; 1 2ca96: 89 f4 brne .+34 ; 0x2caba ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 2ca98: 87 e6 ldi r24, 0x67 ; 103 2ca9a: 9c e9 ldi r25, 0x9C ; 156 2ca9c: 0f 94 86 88 call 0x3110c ; 0x3110c void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 2caa0: 41 2f mov r20, r17 2caa2: 62 e4 ldi r22, 0x42 ; 66 2caa4: ce 01 movw r24, r28 2caa6: 01 96 adiw r24, 0x01 ; 1 2caa8: 0f 94 53 88 call 0x310a6 ; 0x310a6 2caac: 49 81 ldd r20, Y+1 ; 0x01 2caae: 5a 81 ldd r21, Y+2 ; 0x02 2cab0: 6b 81 ldd r22, Y+3 ; 0x03 2cab2: 7c 81 ldd r23, Y+4 ; 0x04 2cab4: 8d 81 ldd r24, Y+5 ; 0x05 2cab6: 0f 94 93 63 call 0x2c726 ; 0x2c726 } // 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) { 2caba: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2cabe: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2cac2: 84 30 cpi r24, 0x04 ; 4 2cac4: 20 e8 ldi r18, 0x80 ; 128 2cac6: 92 07 cpc r25, r18 2cac8: 21 f0 breq .+8 ; 0x2cad2 2caca: 89 30 cpi r24, 0x09 ; 9 2cacc: 90 48 sbci r25, 0x80 ; 128 2cace: 09 f0 breq .+2 ; 0x2cad2 2cad0: bc cf rjmp .-136 ; 0x2ca4a case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 2cad2: 0f 94 4b 3f call 0x27e96 ; 0x27e96 2cad6: b9 cf rjmp .-142 ; 0x2ca4a // 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) { 2cad8: 19 30 cpi r17, 0x09 ; 9 2cada: 08 f0 brcs .+2 ; 0x2cade 2cadc: b6 cf rjmp .-148 ; 0x2ca4a 2cade: e1 2f mov r30, r17 2cae0: f0 e0 ldi r31, 0x00 ; 0 2cae2: 88 27 eor r24, r24 2cae4: e9 58 subi r30, 0x89 ; 137 2cae6: fa 49 sbci r31, 0x9A ; 154 2cae8: 8e 4f sbci r24, 0xFE ; 254 2caea: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 2caee: bb 37 cpi r27, 0x7B ; 123 2caf0: bb 37 cpi r27, 0x7B ; 123 2caf2: bb 37 cpi r27, 0x7B ; 123 2caf4: ab 38 cpi r26, 0x8B ; 139 2caf6: bd 37 cpi r27, 0x7D ; 125 2caf8: bd 37 cpi r27, 0x7D ; 125 2cafa: 15 37 cpi r17, 0x75 ; 117 2cafc: db 37 cpi r29, 0x7B ; 123 2cafe: d5 37 cpi r29, 0x75 ; 117 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 2cb00: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2cb04: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2cb08: 87 38 cpi r24, 0x87 ; 135 2cb0a: 20 e8 ldi r18, 0x80 ; 128 2cb0c: 92 07 cpc r25, r18 2cb0e: 21 f0 breq .+8 ; 0x2cb18 2cb10: 87 30 cpi r24, 0x07 ; 7 2cb12: 91 48 sbci r25, 0x81 ; 129 2cb14: 09 f0 breq .+2 ; 0x2cb18 2cb16: 99 cf rjmp .-206 ; 0x2ca4a // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2cb18: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cb1c: 84 30 cpi r24, 0x04 ; 4 2cb1e: 21 f4 brne .+8 ; 0x2cb28 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 2cb20: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2cb24: 81 11 cpse r24, r1 2cb26: 91 cf rjmp .-222 ; 0x2ca4a // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 2cb28: 81 e0 ldi r24, 0x01 ; 1 2cb2a: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> menu_submenu(tuneIdlerStallguardThresholdMenu); 2cb2e: 60 e0 ldi r22, 0x00 ; 0 2cb30: 89 e1 ldi r24, 0x19 ; 25 2cb32: 98 e3 ldi r25, 0x38 ; 56 2cb34: 0f 94 89 95 call 0x32b12 ; 0x32b12 2cb38: 88 cf rjmp .-240 ; 0x2ca4a } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 2cb3a: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2cb3e: 85 cf rjmp .-246 ; 0x2ca4a break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2cb40: 80 e0 ldi r24, 0x00 ; 0 2cb42: 0f 94 bd 63 call 0x2c77a ; 0x2c77a 2cb46: 81 cf rjmp .-254 ; 0x2ca4a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2cb48: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2cb4c: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2cb50: 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); 2cb54: 60 e0 ldi r22, 0x00 ; 0 2cb56: 8c ea ldi r24, 0xAC ; 172 2cb58: 9c e0 ldi r25, 0x0C ; 12 2cb5a: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 2cb5e: 0f 94 ee 41 call 0x283dc ; 0x283dc 2cb62: 73 cf rjmp .-282 ; 0x2ca4a 0002cb64 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 2cb64: 4f 92 push r4 2cb66: 5f 92 push r5 2cb68: 6f 92 push r6 2cb6a: 7f 92 push r7 2cb6c: 8f 92 push r8 2cb6e: 9f 92 push r9 2cb70: af 92 push r10 2cb72: bf 92 push r11 2cb74: cf 92 push r12 2cb76: df 92 push r13 2cb78: ef 92 push r14 2cb7a: ff 92 push r15 2cb7c: 0f 93 push r16 2cb7e: 1f 93 push r17 2cb80: cf 93 push r28 2cb82: df 93 push r29 2cb84: cd b7 in r28, 0x3d ; 61 2cb86: de b7 in r29, 0x3e ; 62 2cb88: a0 97 sbiw r28, 0x20 ; 32 2cb8a: 0f b6 in r0, 0x3f ; 63 2cb8c: f8 94 cli 2cb8e: de bf out 0x3e, r29 ; 62 2cb90: 0f be out 0x3f, r0 ; 63 2cb92: cd bf out 0x3d, r28 ; 61 2cb94: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 2cb96: 0f 94 f8 64 call 0x2c9f0 ; 0x2c9f0 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 2cb9a: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cb9e: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 2cba0: 0f 94 0e 63 call 0x2c61c ; 0x2c61c 2cba4: 90 91 28 12 lds r25, 0x1228 ; 0x801228 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 2cba8: 97 ff sbrs r25, 7 2cbaa: 7d c0 rjmp .+250 ; 0x2cca6 // we are waiting for something switch (currentScope) { 2cbac: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cbb0: 82 30 cpi r24, 0x02 ; 2 2cbb2: b1 f0 breq .+44 ; 0x2cbe0 2cbb4: 08 f4 brcc .+2 ; 0x2cbb8 2cbb6: 75 c0 rjmp .+234 ; 0x2cca2 2cbb8: 83 30 cpi r24, 0x03 ; 3 2cbba: e1 f1 breq .+120 ; 0x2cc34 2cbbc: 84 30 cpi r24, 0x04 ; 4 2cbbe: 09 f4 brne .+2 ; 0x2cbc2 2cbc0: 54 c0 rjmp .+168 ; 0x2cc6a 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 2cbc2: 0f 94 0e 63 call 0x2c61c ; 0x2c61c 2cbc6: 81 11 cpse r24, r1 2cbc8: 6b c3 rjmp .+1750 ; 0x2d2a0 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 2cbca: 82 e0 ldi r24, 0x02 ; 2 2cbcc: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2cbd0: 83 e0 ldi r24, 0x03 ; 3 2cbd2: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2cbd6: 82 e8 ldi r24, 0x82 ; 130 2cbd8: 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()) { 2cbdc: 12 e0 ldi r17, 0x02 ; 2 2cbde: db c2 rjmp .+1462 ; 0x2d196 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cbe0: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2cbe4: ab 01 movw r20, r22 2cbe6: bc 01 movw r22, r24 2cbe8: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cbec: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cbf0: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cbf4: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cbf8: 88 51 subi r24, 0x18 ; 24 2cbfa: 9c 4f sbci r25, 0xFC ; 252 2cbfc: af 4f sbci r26, 0xFF ; 255 2cbfe: 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 2cc00: 48 17 cp r20, r24 2cc02: 59 07 cpc r21, r25 2cc04: 6a 07 cpc r22, r26 2cc06: 7b 07 cpc r23, r27 2cc08: 08 f4 brcc .+2 ; 0x2cc0c 2cc0a: 4b c0 rjmp .+150 ; 0x2cca2 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 2cc0c: 87 e0 ldi r24, 0x07 ; 7 2cc0e: 92 e1 ldi r25, 0x12 ; 18 2cc10: 0f 94 68 9f call 0x33ed0 ; 0x33ed0 while (uart->read() != -1) 2cc14: 01 96 adiw r24, 0x01 ; 1 2cc16: d1 f7 brne .-12 ; 0x2cc0c initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2cc18: 81 e0 ldi r24, 0x01 ; 1 2cc1a: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2cc1e: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2cc22: 10 92 49 12 sts 0x1249, r1 ; 0x801249 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2cc26: 86 e0 ldi r24, 0x06 ; 6 2cc28: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2cc2c: 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); 2cc2e: 0f 94 d9 63 call 0x2c7b2 ; 0x2c7b2 2cc32: 37 c0 rjmp .+110 ; 0x2cca2 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 2cc34: 92 38 cpi r25, 0x82 ; 130 2cc36: 29 f6 brne .-118 ; 0x2cbc2 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cc38: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2cc3c: ab 01 movw r20, r22 2cc3e: bc 01 movw r22, r24 2cc40: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cc44: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cc48: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cc4c: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cc50: 88 51 subi r24, 0x18 ; 24 2cc52: 9c 4f sbci r25, 0xFC ; 252 2cc54: af 4f sbci r26, 0xFF ; 255 2cc56: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 2cc58: 48 17 cp r20, r24 2cc5a: 59 07 cpc r21, r25 2cc5c: 6a 07 cpc r22, r26 2cc5e: 7b 07 cpc r23, r27 2cc60: 08 f4 brcc .+2 ; 0x2cc64 2cc62: af cf rjmp .-162 ; 0x2cbc2 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 2cc64: 0f 94 4c 64 call 0x2c898 ; 0x2c898 2cc68: 1c c0 rjmp .+56 ; 0x2cca2 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cc6a: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2cc6e: ab 01 movw r20, r22 2cc70: bc 01 movw r22, r24 2cc72: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cc76: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cc7a: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cc7e: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cc82: 88 51 subi r24, 0x18 ; 24 2cc84: 9c 4f sbci r25, 0xFC ; 252 2cc86: af 4f sbci r26, 0xFF ; 255 2cc88: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 2cc8a: 48 17 cp r20, r24 2cc8c: 59 07 cpc r21, r25 2cc8e: 6a 07 cpc r22, r26 2cc90: 7b 07 cpc r23, r27 2cc92: 40 f7 brcc .-48 ; 0x2cc64 }; 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(); 2cc94: 0f 94 96 88 call 0x3112c ; 0x3112c if (fs != lastFSensor) { 2cc98: 90 91 69 12 lds r25, 0x1269 ; 0x801269 2cc9c: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 2cc9e: 0f 94 6b 64 call 0x2c8d6 ; 0x2c8d6 // 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; 2cca2: 10 e0 ldi r17, 0x00 ; 0 2cca4: 78 c2 rjmp .+1264 ; 0x2d196 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 2cca6: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 2cca8: d1 2c mov r13, r1 2ccaa: 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; 2ccac: 99 24 eor r9, r9 2ccae: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2ccb0: 55 e0 ldi r21, 0x05 ; 5 2ccb2: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2ccb4: 63 e0 ldi r22, 0x03 ; 3 2ccb6: 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; 2ccb8: 74 e0 ldi r23, 0x04 ; 4 2ccba: 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; 2ccbc: e2 e0 ldi r30, 0x02 ; 2 2ccbe: 6e 2e mov r6, r30 2ccc0: 66 c0 rjmp .+204 ; 0x2cd8e ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2ccc2: 23 30 cpi r18, 0x03 ; 3 2ccc4: 09 f4 brne .+2 ; 0x2ccc8 2ccc6: e0 c0 rjmp .+448 ; 0x2ce88 2ccc8: 24 30 cpi r18, 0x04 ; 4 2ccca: 09 f0 breq .+2 ; 0x2ccce 2cccc: 83 c0 rjmp .+262 ; 0x2cdd4 } 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'); 2ccce: 20 ed ldi r18, 0xD0 ; 208 2ccd0: 28 0f add r18, r24 2ccd2: 2a 30 cpi r18, 0x0A ; 10 2ccd4: 08 f4 brcc .+2 ; 0x2ccd8 2ccd6: f8 c0 rjmp .+496 ; 0x2cec8 2ccd8: 2f e9 ldi r18, 0x9F ; 159 2ccda: 28 0f add r18, r24 2ccdc: 26 30 cpi r18, 0x06 ; 6 2ccde: 08 f4 brcc .+2 ; 0x2cce2 2cce0: f3 c0 rjmp .+486 ; 0x2cec8 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cce2: 8a 30 cpi r24, 0x0A ; 10 2cce4: 09 f0 breq .+2 ; 0x2cce8 2cce6: fa c0 rjmp .+500 ; 0x2cedc 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()) { 2cce8: 40 90 4e 12 lds r4, 0x124E ; 0x80124e 2ccec: 8a e4 ldi r24, 0x4A ; 74 2ccee: 92 e1 ldi r25, 0x12 ; 18 2ccf0: 0f 94 42 88 call 0x31084 ; 0x31084 2ccf4: 48 12 cpse r4, r24 2ccf6: b8 c0 rjmp .+368 ; 0x2ce68 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 2ccf8: 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; } 2ccfc: 88 e0 ldi r24, 0x08 ; 8 2ccfe: ea e4 ldi r30, 0x4A ; 74 2cd00: f2 e1 ldi r31, 0x12 ; 18 2cd02: de 01 movw r26, r28 2cd04: 51 96 adiw r26, 0x11 ; 17 2cd06: 01 90 ld r0, Z+ 2cd08: 0d 92 st X+, r0 2cd0a: 8a 95 dec r24 2cd0c: e1 f7 brne .-8 ; 0x2cd06 2cd0e: 88 e0 ldi r24, 0x08 ; 8 2cd10: fe 01 movw r30, r28 2cd12: 71 96 adiw r30, 0x11 ; 17 2cd14: de 01 movw r26, r28 2cd16: 59 96 adiw r26, 0x19 ; 25 2cd18: 01 90 ld r0, Z+ 2cd1a: 0d 92 st X+, r0 2cd1c: 8a 95 dec r24 2cd1e: e1 f7 brne .-8 ; 0x2cd18 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 2cd20: 88 e0 ldi r24, 0x08 ; 8 2cd22: fe 01 movw r30, r28 2cd24: 79 96 adiw r30, 0x19 ; 25 2cd26: aa e3 ldi r26, 0x3A ; 58 2cd28: b2 e1 ldi r27, 0x12 ; 18 2cd2a: 01 90 ld r0, Z+ 2cd2c: 0d 92 st X+, r0 2cd2e: 8a 95 dec r24 2cd30: e1 f7 brne .-8 ; 0x2cd2a } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 2cd32: 8c e3 ldi r24, 0x3C ; 60 2cd34: 89 83 std Y+1, r24 ; 0x01 2cd36: fe 01 movw r30, r28 2cd38: 32 96 adiw r30, 0x02 ; 2 2cd3a: a2 e5 ldi r26, 0x52 ; 82 2cd3c: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 2cd3e: 20 e0 ldi r18, 0x00 ; 0 2cd40: cf 01 movw r24, r30 2cd42: 52 16 cp r5, r18 2cd44: 09 f4 brne .+2 ; 0x2cd48 2cd46: cd c0 rjmp .+410 ; 0x2cee2 uint8_t b = lastReceivedBytes[i]; 2cd48: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 2cd4a: 40 ee ldi r20, 0xE0 ; 224 2cd4c: 43 0f add r20, r19 2cd4e: 40 36 cpi r20, 0x60 ; 96 2cd50: 08 f0 brcs .+2 ; 0x2cd54 b = '.'; 2cd52: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 2cd54: 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) { 2cd56: 2f 5f subi r18, 0xFF ; 255 2cd58: f4 cf rjmp .-24 ; 0x2cd42 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cd5a: 8e 34 cpi r24, 0x4E ; 78 2cd5c: 08 f0 brcs .+2 ; 0x2cd60 2cd5e: 56 c0 rjmp .+172 ; 0x2ce0c 2cd60: 8b 34 cpi r24, 0x4B ; 75 2cd62: 08 f0 brcs .+2 ; 0x2cd66 2cd64: 46 c0 rjmp .+140 ; 0x2cdf2 2cd66: 82 34 cpi r24, 0x42 ; 66 2cd68: 09 f4 brne .+2 ; 0x2cd6c 2cd6a: 43 c0 rjmp .+134 ; 0x2cdf2 2cd6c: e0 f5 brcc .+120 ; 0x2cde6 2cd6e: 8a 30 cpi r24, 0x0A ; 10 2cd70: 59 f0 breq .+22 ; 0x2cd88 2cd72: 8d 30 cpi r24, 0x0D ; 13 2cd74: 49 f0 breq .+18 ; 0x2cd88 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cd76: 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') { 2cd7a: a1 10 cpse r10, r1 2cd7c: 05 c1 rjmp .+522 ; 0x2cf88 2cd7e: 1f 36 cpi r17, 0x6F ; 111 2cd80: 09 f0 breq .+2 ; 0x2cd84 2cd82: fe c3 rjmp .+2044 ; 0x2d580 ++ok; 2cd84: aa 24 eor r10, r10 2cd86: 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; 2cd88: 4f ef ldi r20, 0xFF ; 255 2cd8a: c4 1a sub r12, r20 2cd8c: d4 0a sbc r13, r20 2cd8e: 87 e0 ldi r24, 0x07 ; 7 2cd90: 92 e1 ldi r25, 0x12 ; 18 2cd92: 0f 94 68 9f call 0x33ed0 ; 0x33ed0 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) { 2cd96: 97 fd sbrc r25, 7 2cd98: 00 c1 rjmp .+512 ; 0x2cf9a ++bytesConsumed; RecordReceivedByte(c); 2cd9a: 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]; 2cd9c: 20 91 62 12 lds r18, 0x1262 ; 0x801262 2cda0: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 2cda2: f9 01 movw r30, r18 2cda4: eb 5d subi r30, 0xDB ; 219 2cda6: fd 4e sbci r31, 0xED ; 237 2cda8: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 2cdaa: 79 01 movw r14, r18 2cdac: ef ef ldi r30, 0xFF ; 255 2cdae: ee 1a sub r14, r30 2cdb0: fe 0a sbc r15, r30 2cdb2: ff e0 ldi r31, 0x0F ; 15 2cdb4: ef 22 and r14, r31 2cdb6: ff 24 eor r15, r15 2cdb8: 5e 2c mov r5, r14 2cdba: e0 92 62 12 sts 0x1262, r14 ; 0x801262 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cdbe: 20 91 49 12 lds r18, 0x1249 ; 0x801249 2cdc2: 22 30 cpi r18, 0x02 ; 2 2cdc4: 09 f4 brne .+2 ; 0x2cdc8 2cdc6: 48 c0 rjmp .+144 ; 0x2ce58 2cdc8: 08 f0 brcs .+2 ; 0x2cdcc 2cdca: 7b cf rjmp .-266 ; 0x2ccc2 2cdcc: 22 23 and r18, r18 2cdce: 29 f2 breq .-118 ; 0x2cd5a 2cdd0: 21 30 cpi r18, 0x01 ; 1 2cdd2: 51 f1 breq .+84 ; 0x2ce28 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cdd4: 1a 30 cpi r17, 0x0A ; 10 2cdd6: 09 f4 brne .+2 ; 0x2cdda 2cdd8: 8f cf rjmp .-226 ; 0x2ccf8 2cdda: 1d 30 cpi r17, 0x0D ; 13 2cddc: 09 f4 brne .+2 ; 0x2cde0 2cdde: 8c cf rjmp .-232 ; 0x2ccf8 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cde0: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cde4: ca cf rjmp .-108 ; 0x2cd7a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cde6: 85 34 cpi r24, 0x45 ; 69 2cde8: 30 f2 brcs .-116 ; 0x2cd76 2cdea: 87 34 cpi r24, 0x47 ; 71 2cdec: 10 f0 brcs .+4 ; 0x2cdf2 2cdee: 88 34 cpi r24, 0x48 ; 72 2cdf0: 11 f6 brne .-124 ; 0x2cd76 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 2cdf2: 80 93 4a 12 sts 0x124A, r24 ; 0x80124a responseMsg.request.value = 0; 2cdf6: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b responseMsg.request.value2 = 0; 2cdfa: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2cdfe: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c responseMsg.request.crc8 = 0; 2ce02: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e rspState = ResponseStates::RequestValue; 2ce06: 90 92 49 12 sts 0x1249, r9 ; 0x801249 2ce0a: be cf rjmp .-132 ; 0x2cd88 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2ce0c: 89 35 cpi r24, 0x59 ; 89 2ce0e: 40 f4 brcc .+16 ; 0x2ce20 2ce10: 87 35 cpi r24, 0x57 ; 87 2ce12: 78 f7 brcc .-34 ; 0x2cdf2 2ce14: 20 eb ldi r18, 0xB0 ; 176 2ce16: 28 0f add r18, r24 2ce18: 26 30 cpi r18, 0x06 ; 6 2ce1a: 08 f0 brcs .+2 ; 0x2ce1e 2ce1c: ac cf rjmp .-168 ; 0x2cd76 2ce1e: e9 cf rjmp .-46 ; 0x2cdf2 2ce20: 86 36 cpi r24, 0x66 ; 102 2ce22: 09 f0 breq .+2 ; 0x2ce26 2ce24: a8 cf rjmp .-176 ; 0x2cd76 2ce26: e5 cf rjmp .-54 ; 0x2cdf2 } 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'); 2ce28: 20 ed ldi r18, 0xD0 ; 208 2ce2a: 28 0f add r18, r24 2ce2c: 2a 30 cpi r18, 0x0A ; 10 2ce2e: 50 f0 brcs .+20 ; 0x2ce44 2ce30: 2f e9 ldi r18, 0x9F ; 159 2ce32: 28 0f add r18, r24 2ce34: 26 30 cpi r18, 0x06 ; 6 2ce36: 30 f0 brcs .+12 ; 0x2ce44 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 2ce38: 80 32 cpi r24, 0x20 ; 32 2ce3a: 09 f0 breq .+2 ; 0x2ce3e 2ce3c: 9c cf rjmp .-200 ; 0x2cd76 rspState = ResponseStates::ParamCode; 2ce3e: 60 92 49 12 sts 0x1249, r6 ; 0x801249 2ce42: a2 cf rjmp .-188 ; 0x2cd88 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 2ce44: 0f 94 21 88 call 0x31042 ; 0x31042 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 2ce48: 90 91 4b 12 lds r25, 0x124B ; 0x80124b 2ce4c: 92 95 swap r25 2ce4e: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 2ce50: 89 0f add r24, r25 2ce52: 80 93 4b 12 sts 0x124B, r24 ; 0x80124b 2ce56: 98 cf rjmp .-208 ; 0x2cd88 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2ce58: 87 34 cpi r24, 0x47 ; 71 2ce5a: 48 f4 brcc .+18 ; 0x2ce6e 2ce5c: 85 34 cpi r24, 0x45 ; 69 2ce5e: 58 f4 brcc .+22 ; 0x2ce76 2ce60: 2f eb ldi r18, 0xBF ; 191 2ce62: 28 0f add r18, r24 2ce64: 22 30 cpi r18, 0x02 ; 2 2ce66: 38 f0 brcs .+14 ; 0x2ce76 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2ce68: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2ce6c: 84 cf rjmp .-248 ; 0x2cd76 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2ce6e: 80 35 cpi r24, 0x50 ; 80 2ce70: 11 f0 breq .+4 ; 0x2ce76 2ce72: 82 35 cpi r24, 0x52 ; 82 2ce74: c9 f7 brne .-14 ; 0x2ce68 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2ce76: 80 92 49 12 sts 0x1249, r8 ; 0x801249 responseMsg.paramCode = (ResponseMsgParamCodes)c; 2ce7a: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f responseMsg.paramValue = 0; 2ce7e: 10 92 51 12 sts 0x1251, r1 ; 0x801251 2ce82: 10 92 50 12 sts 0x1250, r1 ; 0x801250 2ce86: 80 cf rjmp .-256 ; 0x2cd88 2ce88: 20 ed ldi r18, 0xD0 ; 208 2ce8a: 28 0f add r18, r24 2ce8c: 2a 30 cpi r18, 0x0A ; 10 2ce8e: 48 f0 brcs .+18 ; 0x2cea2 2ce90: 2f e9 ldi r18, 0x9F ; 159 2ce92: 28 0f add r18, r24 2ce94: 26 30 cpi r18, 0x06 ; 6 2ce96: 28 f0 brcs .+10 ; 0x2cea2 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 2ce98: 8a 32 cpi r24, 0x2A ; 42 2ce9a: 31 f7 brne .-52 ; 0x2ce68 rspState = ResponseStates::CRC; 2ce9c: 70 92 49 12 sts 0x1249, r7 ; 0x801249 2cea0: 73 cf rjmp .-282 ; 0x2cd88 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 2cea2: 0f 94 21 88 call 0x31042 ; 0x31042 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 2cea6: 20 91 50 12 lds r18, 0x1250 ; 0x801250 2ceaa: 30 91 51 12 lds r19, 0x1251 ; 0x801251 2ceae: 44 e0 ldi r20, 0x04 ; 4 2ceb0: 22 0f add r18, r18 2ceb2: 33 1f adc r19, r19 2ceb4: 4a 95 dec r20 2ceb6: e1 f7 brne .-8 ; 0x2ceb0 responseMsg.paramValue += Char2Nibble(c); 2ceb8: 82 0f add r24, r18 2ceba: 93 2f mov r25, r19 2cebc: 91 1d adc r25, r1 2cebe: 90 93 51 12 sts 0x1251, r25 ; 0x801251 2cec2: 80 93 50 12 sts 0x1250, r24 ; 0x801250 2cec6: 60 cf rjmp .-320 ; 0x2cd88 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 2cec8: 0f 94 21 88 call 0x31042 ; 0x31042 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 2cecc: 90 91 4e 12 lds r25, 0x124E ; 0x80124e 2ced0: 92 95 swap r25 2ced2: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 2ced4: 89 0f add r24, r25 2ced6: 80 93 4e 12 sts 0x124E, r24 ; 0x80124e 2ceda: 56 cf rjmp .-340 ; 0x2cd88 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cedc: 8d 30 cpi r24, 0x0D ; 13 2cede: 21 f6 brne .-120 ; 0x2ce68 2cee0: 03 cf rjmp .-506 ; 0x2cce8 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 2cee2: e8 0e add r14, r24 2cee4: f9 1e adc r15, r25 2cee6: f7 01 movw r30, r14 2cee8: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 2ceea: 10 92 62 12 sts 0x1262, r1 ; 0x801262 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 2ceee: 87 e7 ldi r24, 0x77 ; 119 2cef0: 9e e9 ldi r25, 0x9E ; 158 2cef2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2cef6: 81 e7 ldi r24, 0x71 ; 113 2cef8: 9e e9 ldi r25, 0x9E ; 158 2cefa: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2cefe: ce 01 movw r24, r28 2cf00: 01 96 adiw r24, 0x01 ; 1 2cf02: 0f 94 5d 9a call 0x334ba ; 0x334ba 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 2cf06: 0f 94 72 3b call 0x276e4 ; 0x276e4 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 2cf0a: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cf0e: 81 30 cpi r24, 0x01 ; 1 2cf10: 09 f4 brne .+2 ; 0x2cf14 2cf12: 74 c0 rjmp .+232 ; 0x2cffc 2cf14: 08 f4 brcc .+2 ; 0x2cf18 2cf16: c5 ce rjmp .-630 ; 0x2cca2 2cf18: 83 30 cpi r24, 0x03 ; 3 2cf1a: 09 f4 brne .+2 ; 0x2cf1e 2cf1c: d1 c0 rjmp .+418 ; 0x2d0c0 2cf1e: 84 30 cpi r24, 0x04 ; 4 2cf20: 09 f0 breq .+2 ; 0x2cf24 2cf22: 4f ce rjmp .-866 ; 0x2cbc2 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2cf24: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cf28: 86 30 cpi r24, 0x06 ; 6 2cf2a: 09 f4 brne .+2 ; 0x2cf2e 2cf2c: 6c c1 rjmp .+728 ; 0x2d206 2cf2e: 08 f0 brcs .+2 ; 0x2cf32 2cf30: 93 c1 rjmp .+806 ; 0x2d258 2cf32: 84 30 cpi r24, 0x04 ; 4 2cf34: 09 f4 brne .+2 ; 0x2cf38 2cf36: 09 c1 rjmp .+530 ; 0x2d14a 2cf38: 85 30 cpi r24, 0x05 ; 5 2cf3a: 09 f0 breq .+2 ; 0x2cf3e 2cf3c: cc c0 rjmp .+408 ; 0x2d0d6 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 2cf3e: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cf42: 81 34 cpi r24, 0x41 ; 65 2cf44: 09 f4 brne .+2 ; 0x2cf48 2cf46: 96 c1 rjmp .+812 ; 0x2d274 2cf48: 82 35 cpi r24, 0x52 ; 82 2cf4a: 09 f0 breq .+2 ; 0x2cf4e 2cf4c: c4 c0 rjmp .+392 ; 0x2d0d6 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 2cf4e: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::PROTOCOL_ERROR; 2cf52: 8d e2 ldi r24, 0x2D ; 45 2cf54: 90 e8 ldi r25, 0x80 ; 128 2cf56: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2cf5a: 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")); 2cf5e: 87 ed ldi r24, 0xD7 ; 215 2cf60: 9b e9 ldi r25, 0x9B ; 155 2cf62: 0f 94 8f 3b call 0x2771e ; 0x2771e void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2cf66: 85 e0 ldi r24, 0x05 ; 5 2cf68: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2cf6c: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2cf70: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2cf74: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2cf78: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2cf7c: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2cf80: 0f 94 78 3c call 0x278f0 ; 0x278f0 2cf84: 16 e0 ldi r17, 0x06 ; 6 2cf86: 07 c1 rjmp .+526 ; 0x2d196 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') { 2cf88: 1b 36 cpi r17, 0x6B ; 107 2cf8a: 09 f0 breq .+2 ; 0x2cf8e 2cf8c: f9 c2 rjmp .+1522 ; 0x2d580 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")); 2cf8e: 88 eb ldi r24, 0xB8 ; 184 2cf90: 9b e9 ldi r25, 0x9B ; 155 2cf92: 0f 94 8f 3b call 0x2771e ; 0x2771e 2cf96: 18 e0 ldi r17, 0x08 ; 8 2cf98: fe c0 rjmp .+508 ; 0x2d196 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 2cf9a: cd 28 or r12, r13 2cf9c: 19 f0 breq .+6 ; 0x2cfa4 RecordUARTActivity(); // something has happened on the UART, update the timeout record 2cf9e: 0f 94 72 3b call 0x276e4 ; 0x276e4 2cfa2: 7f ce rjmp .-770 ; 0x2cca2 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cfa4: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2cfa8: ab 01 movw r20, r22 2cfaa: bc 01 movw r22, r24 2cfac: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cfb0: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cfb4: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cfb8: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cfbc: 80 53 subi r24, 0x30 ; 48 2cfbe: 98 4f sbci r25, 0xF8 ; 248 2cfc0: af 4f sbci r26, 0xFF ; 255 2cfc2: 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) { 2cfc4: 48 17 cp r20, r24 2cfc6: 59 07 cpc r21, r25 2cfc8: 6a 07 cpc r22, r26 2cfca: 7b 07 cpc r23, r27 2cfcc: 08 f4 brcc .+2 ; 0x2cfd0 2cfce: 69 ce rjmp .-814 ; 0x2cca2 2cfd0: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cfd4: 88 23 and r24, r24 2cfd6: 09 f4 brne .+2 ; 0x2cfda 2cfd8: 64 ce rjmp .-824 ; 0x2cca2 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 2cfda: 10 92 49 12 sts 0x1249, r1 ; 0x801249 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2cfde: 81 e0 ldi r24, 0x01 ; 1 2cfe0: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2cfe4: 80 93 27 12 sts 0x1227, r24 ; 0x801227 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2cfe8: 86 e0 ldi r24, 0x06 ; 6 2cfea: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2cfee: 80 e0 ldi r24, 0x00 ; 0 2cff0: 0f 94 d9 63 call 0x2c7b2 ; 0x2c7b2 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2cff4: 64 e0 ldi r22, 0x04 ; 4 2cff6: 80 e9 ldi r24, 0x90 ; 144 2cff8: 9b e9 ldi r25, 0x9B ; 155 2cffa: 79 c0 rjmp .+242 ; 0x2d0ee return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 2cffc: 10 91 28 12 lds r17, 0x1228 ; 0x801228 2d000: 13 30 cpi r17, 0x03 ; 3 2d002: b1 f1 breq .+108 ; 0x2d070 2d004: 60 f0 brcs .+24 ; 0x2d01e 2d006: 16 30 cpi r17, 0x06 ; 6 2d008: 09 f4 brne .+2 ; 0x2d00c 2d00a: 50 c0 rjmp .+160 ; 0x2d0ac 2d00c: 19 30 cpi r17, 0x09 ; 9 2d00e: 09 f0 breq .+2 ; 0x2d012 2d010: be cf rjmp .-132 ; 0x2cf8e // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 2d012: 0f 94 a2 3d call 0x27b44 ; 0x27b44 2d016: 88 23 and r24, r24 2d018: 09 f4 brne .+2 ; 0x2d01c 2d01a: 43 ce rjmp .-890 ; 0x2cca2 2d01c: 40 ce rjmp .-896 ; 0x2cc9e void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 2d01e: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2d022: 83 35 cpi r24, 0x53 ; 83 2d024: 21 f4 brne .+8 ; 0x2d02e 2d026: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2d02a: 18 17 cp r17, r24 2d02c: 11 f0 breq .+4 ; 0x2d032 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 2d02e: 81 2f mov r24, r17 2d030: fe cd rjmp .-1028 ; 0x2cc2e 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; 2d032: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d036: e1 2f mov r30, r17 2d038: f0 e0 ldi r31, 0x00 ; 0 2d03a: df 01 movw r26, r30 2d03c: ac 58 subi r26, 0x8C ; 140 2d03e: bd 4e sbci r27, 0xED ; 237 2d040: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 2d042: eb 54 subi r30, 0x4B ; 75 2d044: f4 46 sbci r31, 0x64 ; 100 2d046: e4 91 lpm r30, Z 2d048: 8e 17 cp r24, r30 2d04a: 41 f0 breq .+16 ; 0x2d05c if (--retries == 0) { 2d04c: 80 91 29 12 lds r24, 0x1229 ; 0x801229 2d050: 81 50 subi r24, 0x01 ; 1 2d052: 80 93 29 12 sts 0x1229, r24 ; 0x801229 2d056: 81 11 cpse r24, r1 2d058: ea cf rjmp .-44 ; 0x2d02e 2d05a: 99 cf rjmp .-206 ; 0x2cf8e SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2d05c: 8a e0 ldi r24, 0x0A ; 10 2d05e: 9e e9 ldi r25, 0x9E ; 158 2d060: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 /// @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; } 2d064: 8a e0 ldi r24, 0x0A ; 10 2d066: 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); 2d06a: 81 e0 ldi r24, 0x01 ; 1 2d06c: 81 0f add r24, r17 2d06e: df cd rjmp .-1090 ; 0x2cc2e 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) { 2d070: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2d074: 83 35 cpi r24, 0x53 ; 83 2d076: 21 f4 brne .+8 ; 0x2d080 2d078: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2d07c: 83 30 cpi r24, 0x03 ; 3 2d07e: 11 f0 breq .+4 ; 0x2d084 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 2d080: 83 e0 ldi r24, 0x03 ; 3 2d082: d5 cd rjmp .-1110 ; 0x2cc2e } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 2d084: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d088: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2d08c: 90 93 78 12 sts 0x1278, r25 ; 0x801278 2d090: 80 93 77 12 sts 0x1277, r24 ; 0x801277 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 2d094: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2d098: e8 e0 ldi r30, 0x08 ; 8 2d09a: fe e9 ldi r31, 0x9E ; 158 2d09c: 84 91 lpm r24, Z 2d09e: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2d0a2: 70 e0 ldi r23, 0x00 ; 0 2d0a4: 49 e0 ldi r20, 0x09 ; 9 2d0a6: 0f 94 e3 3c call 0x279c6 ; 0x279c6 2d0aa: fb cd rjmp .-1034 ; 0x2cca2 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 2d0ac: 82 e0 ldi r24, 0x02 ; 2 2d0ae: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2d0b2: 83 e0 ldi r24, 0x03 ; 3 2d0b4: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2d0b8: 82 e8 ldi r24, 0x82 ; 130 2d0ba: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2d0be: d2 cd rjmp .-1116 ; 0x2cc64 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2d0c0: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2d0c4: 88 30 cpi r24, 0x08 ; 8 2d0c6: 09 f4 brne .+2 ; 0x2d0ca 2d0c8: b7 c0 rjmp .+366 ; 0x2d238 2d0ca: a8 f4 brcc .+42 ; 0x2d0f6 2d0cc: 84 30 cpi r24, 0x04 ; 4 2d0ce: d9 f0 breq .+54 ; 0x2d106 2d0d0: 87 30 cpi r24, 0x07 ; 7 2d0d2: 09 f4 brne .+2 ; 0x2d0d6 2d0d4: ae c0 rjmp .+348 ; 0x2d232 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 2d0d6: 81 e0 ldi r24, 0x01 ; 1 2d0d8: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::DelayedRestart; 2d0dc: 82 e0 ldi r24, 0x02 ; 2 2d0de: 80 93 27 12 sts 0x1227, r24 ; 0x801227 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 2d0e2: 83 e8 ldi r24, 0x83 ; 131 2d0e4: 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); 2d0e8: 65 e0 ldi r22, 0x05 ; 5 2d0ea: 86 ea ldi r24, 0xA6 ; 166 2d0ec: 9b e9 ldi r25, 0x9B ; 155 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2d0ee: 0f 94 00 3c call 0x27800 ; 0x27800 2d0f2: 18 2f mov r17, r24 2d0f4: 50 c0 rjmp .+160 ; 0x2d196 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2d0f6: 8a 30 cpi r24, 0x0A ; 10 2d0f8: 09 f4 brne .+2 ; 0x2d0fc 2d0fa: a7 c0 rjmp .+334 ; 0x2d24a 2d0fc: 60 f3 brcs .-40 ; 0x2d0d6 2d0fe: 8d 30 cpi r24, 0x0D ; 13 2d100: 08 f4 brcc .+2 ; 0x2d104 2d102: 5f cd rjmp .-1346 ; 0x2cbc2 2d104: e8 cf rjmp .-48 ; 0x2d0d6 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) { 2d106: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2d10a: 8e 34 cpi r24, 0x4E ; 78 2d10c: 60 f5 brcc .+88 ; 0x2d166 2d10e: 8b 34 cpi r24, 0x4B ; 75 2d110: 10 f4 brcc .+4 ; 0x2d116 2d112: 85 34 cpi r24, 0x45 ; 69 2d114: 01 f7 brne .-64 ; 0x2d0d6 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 2d116: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d11a: 86 34 cpi r24, 0x46 ; 70 2d11c: 09 f4 brne .+2 ; 0x2d120 2d11e: 73 c0 rjmp .+230 ; 0x2d206 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 2d120: 84 e0 ldi r24, 0x04 ; 4 2d122: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2d126: 85 e0 ldi r24, 0x05 ; 5 2d128: ea e3 ldi r30, 0x3A ; 58 2d12a: f2 e1 ldi r31, 0x12 ; 18 2d12c: de 01 movw r26, r28 2d12e: 11 96 adiw r26, 0x01 ; 1 2d130: 01 90 ld r0, Z+ 2d132: 0d 92 st X+, r0 2d134: 8a 95 dec r24 2d136: e1 f7 brne .-8 ; 0x2d130 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2d138: 85 e0 ldi r24, 0x05 ; 5 2d13a: fe 01 movw r30, r28 2d13c: 31 96 adiw r30, 0x01 ; 1 2d13e: aa e2 ldi r26, 0x2A ; 42 2d140: b2 e1 ldi r27, 0x12 ; 18 2d142: 01 90 ld r0, Z+ 2d144: 0d 92 st X+, r0 2d146: 8a 95 dec r24 2d148: e1 f7 brne .-8 ; 0x2d142 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 2d14a: 0f 94 8e 64 call 0x2c91c ; 0x2c91c 2d14e: 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) { 2d150: 85 30 cpi r24, 0x05 ; 5 2d152: 09 f2 breq .-126 ; 0x2d0d6 2d154: 08 f0 brcs .+2 ; 0x2d158 2d156: 9c c0 rjmp .+312 ; 0x2d290 2d158: 82 30 cpi r24, 0x02 ; 2 2d15a: 09 f4 brne .+2 ; 0x2d15e 2d15c: 32 cd rjmp .-1436 ; 0x2cbc2 2d15e: 84 30 cpi r24, 0x04 ; 4 2d160: 09 f4 brne .+2 ; 0x2d164 2d162: 3b cf rjmp .-394 ; 0x2cfda 2d164: 18 c0 rjmp .+48 ; 0x2d196 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) { 2d166: 84 35 cpi r24, 0x54 ; 84 2d168: 08 f4 brcc .+2 ; 0x2d16c 2d16a: b5 cf rjmp .-150 ; 0x2d0d6 2d16c: 86 35 cpi r24, 0x56 ; 86 2d16e: 98 f2 brcs .-90 ; 0x2d116 2d170: 88 35 cpi r24, 0x58 ; 88 2d172: 09 f0 breq .+2 ; 0x2d176 2d174: b0 cf rjmp .-160 ; 0x2d0d6 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) { 2d176: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d17a: 86 34 cpi r24, 0x46 ; 70 2d17c: 89 f1 breq .+98 ; 0x2d1e0 2d17e: 80 35 cpi r24, 0x50 ; 80 2d180: c1 f1 breq .+112 ; 0x2d1f2 2d182: 82 34 cpi r24, 0x42 ; 66 2d184: 09 f0 breq .+2 ; 0x2d188 2d186: 42 c0 rjmp .+132 ; 0x2d20c 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); 2d188: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d18c: 80 93 68 12 sts 0x1268, r24 ; 0x801268 StartReading8bitRegisters(); 2d190: 0f 94 ce 62 call 0x2c59c ; 0x2c59c return ButtonPushed; 2d194: 1b e0 ldi r17, 0x0B ; 11 2d196: 80 91 25 12 lds r24, 0x1225 ; 0x801225 2d19a: 90 91 26 12 lds r25, 0x1226 ; 0x801226 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 2d19e: 81 30 cpi r24, 0x01 ; 1 2d1a0: 91 05 cpc r25, r1 2d1a2: 09 f0 breq .+2 ; 0x2d1a6 2d1a4: f0 c1 rjmp .+992 ; 0x2d586 const StepStatus ss = logic.Step(); switch (ss) { 2d1a6: 12 30 cpi r17, 0x02 ; 2 2d1a8: 09 f4 brne .+2 ; 0x2d1ac 2d1aa: 90 c0 rjmp .+288 ; 0x2d2cc 2d1ac: 08 f0 brcs .+2 ; 0x2d1b0 2d1ae: 7d c0 rjmp .+250 ; 0x2d2aa 2d1b0: 11 23 and r17, r17 2d1b2: 09 f4 brne .+2 ; 0x2d1b6 2d1b4: 1a c1 rjmp .+564 ; 0x2d3ea case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d1b6: 00 23 and r16, r16 2d1b8: 09 f4 brne .+2 ; 0x2d1bc 2d1ba: e6 c0 rjmp .+460 ; 0x2d388 switch (ss) { 2d1bc: 17 30 cpi r17, 0x07 ; 7 2d1be: 09 f4 brne .+2 ; 0x2d1c2 2d1c0: c6 c1 rjmp .+908 ; 0x2d54e 2d1c2: 08 f0 brcs .+2 ; 0x2d1c6 2d1c4: ba c1 rjmp .+884 ; 0x2d53a 2d1c6: 14 30 cpi r17, 0x04 ; 4 2d1c8: 09 f4 brne .+2 ; 0x2d1cc 2d1ca: c9 c1 rjmp .+914 ; 0x2d55e 2d1cc: 15 30 cpi r17, 0x05 ; 5 2d1ce: 09 f0 breq .+2 ; 0x2d1d2 2d1d0: db c0 rjmp .+438 ; 0x2d388 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 2d1d2: 82 e0 ldi r24, 0x02 ; 2 2d1d4: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 2d1d8: 60 e0 ldi r22, 0x00 ; 0 2d1da: 8d e2 ldi r24, 0x2D ; 45 2d1dc: 90 e8 ldi r25, 0x80 ; 128 2d1de: bc c1 rjmp .+888 ; 0x2d558 // 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) { 2d1e0: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d1e4: 88 23 and r24, r24 2d1e6: 29 f0 breq .+10 ; 0x2d1f2 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2d1e8: 82 e8 ldi r24, 0x82 ; 130 2d1ea: 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; 2d1ee: 13 e0 ldi r17, 0x03 ; 3 2d1f0: d2 cf rjmp .-92 ; 0x2d196 } [[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); 2d1f2: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d1f6: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2d1fa: 81 e0 ldi r24, 0x01 ; 1 2d1fc: 90 e0 ldi r25, 0x00 ; 0 2d1fe: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d202: 80 93 65 12 sts 0x1265, r24 ; 0x801265 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 2d206: 0f 94 ce 62 call 0x2c59c ; 0x2c59c 2d20a: 4b cd rjmp .-1386 ; 0x2cca2 // 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; 2d20c: 8c e0 ldi r24, 0x0C ; 12 2d20e: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2d212: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d216: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2d21a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d21e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 StartReading8bitRegisters(); // continue Idle state without restarting the communication 2d222: 0f 94 ce 62 call 0x2c59c ; 0x2c59c // @@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")); 2d226: 89 ec ldi r24, 0xC9 ; 201 2d228: 9b e9 ldi r25, 0x9B ; 155 2d22a: 0f 94 8f 3b call 0x2771e ; 0x2771e 2d22e: 17 e0 ldi r17, 0x07 ; 7 2d230: b2 cf rjmp .-156 ; 0x2d196 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 2d232: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 2d236: 35 cd rjmp .-1430 ; 0x2cca2 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 2d238: 82 e8 ldi r24, 0x82 ; 130 2d23a: 0f 94 d6 62 call 0x2c5ac ; 0x2c5ac 2d23e: 80 93 28 12 sts 0x1228, r24 ; 0x801228 return scopeState == ScopeState::Ready ? Finished : Processing; 2d242: 82 38 cpi r24, 0x82 ; 130 2d244: 09 f0 breq .+2 ; 0x2d248 2d246: 2d cd rjmp .-1446 ; 0x2cca2 2d248: bc cc rjmp .-1672 ; 0x2cbc2 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d24a: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d24e: 81 34 cpi r24, 0x41 ; 65 2d250: d1 f6 brne .-76 ; 0x2d206 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d252: 0f 94 7d 3b call 0x276fa ; 0x276fa 2d256: d7 cf rjmp .-82 ; 0x2d206 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2d258: 88 30 cpi r24, 0x08 ; 8 2d25a: b1 f0 breq .+44 ; 0x2d288 2d25c: 50 f3 brcs .-44 ; 0x2d232 2d25e: 8a 30 cpi r24, 0x0A ; 10 2d260: 09 f0 breq .+2 ; 0x2d264 2d262: 39 cf rjmp .-398 ; 0x2d0d6 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d264: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d268: 81 34 cpi r24, 0x41 ; 65 2d26a: 09 f0 breq .+2 ; 0x2d26e 2d26c: 18 cd rjmp .-1488 ; 0x2cc9e // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d26e: 0f 94 7d 3b call 0x276fa ; 0x276fa 2d272: 15 cd rjmp .-1494 ; 0x2cc9e 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; 2d274: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::RUNNING; 2d278: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2d27c: 10 92 65 12 sts 0x1265, r1 ; 0x801265 scopeState = ScopeState::Wait; 2d280: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 2d282: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2d286: 0d cd rjmp .-1510 ; 0x2cca2 2d288: 81 e8 ldi r24, 0x81 ; 129 2d28a: 0f 94 d6 62 call 0x2c5ac ; 0x2c5ac 2d28e: f9 cf rjmp .-14 ; 0x2d282 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 2d290: 87 30 cpi r24, 0x07 ; 7 2d292: 49 f2 breq .-110 ; 0x2d226 2d294: 08 f4 brcc .+2 ; 0x2d298 2d296: 63 ce rjmp .-826 ; 0x2cf5e 2d298: 88 30 cpi r24, 0x08 ; 8 2d29a: 09 f4 brne .+2 ; 0x2d29e 2d29c: 78 ce rjmp .-784 ; 0x2cf8e 2d29e: 7b cf rjmp .-266 ; 0x2d196 // 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()) { 2d2a0: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2d2a4: 87 fd sbrc r24, 7 2d2a6: 9a cc rjmp .-1740 ; 0x2cbdc 2d2a8: fc cc rjmp .-1544 ; 0x2cca2 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 2d2aa: 13 30 cpi r17, 0x03 ; 3 2d2ac: 09 f4 brne .+2 ; 0x2d2b0 2d2ae: 6c c0 rjmp .+216 ; 0x2d388 2d2b0: 1b 30 cpi r17, 0x0B ; 11 2d2b2: 09 f0 breq .+2 ; 0x2d2b6 2d2b4: 80 cf rjmp .-256 ; 0x2d1b6 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 2d2b6: 80 91 68 12 lds r24, 0x1268 ; 0x801268 2d2ba: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f LogEchoEvent_P(PSTR("MMU Button pushed")); 2d2be: 88 ee ldi r24, 0xE8 ; 232 2d2c0: 9b e9 ldi r25, 0x9B ; 155 2d2c2: 0f 94 86 88 call 0x3110c ; 0x3110c CheckUserInput(); // Process the button immediately 2d2c6: 0f 94 f8 64 call 0x2c9f0 ; 0x2c9f0 2d2ca: 5e c0 rjmp .+188 ; 0x2d388 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 2d2cc: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d2d0: 81 11 cpse r24, r1 2d2d2: 5a c0 rjmp .+180 ; 0x2d388 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() 2d2d4: 0e 94 49 61 call 0xc292 ; 0xc292 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 2d2d8: 88 23 and r24, r24 2d2da: 09 f4 brne .+2 ; 0x2d2de 2d2dc: 55 c0 rjmp .+170 ; 0x2d388 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 2d2de: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.491> 2d2e2: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 2d2e6: 88 35 cpi r24, 0x58 ; 88 2d2e8: 92 40 sbci r25, 0x02 ; 2 2d2ea: 09 f4 brne .+2 ; 0x2d2ee 2d2ec: 4d c0 rjmp .+154 ; 0x2d388 && !saved_printing 2d2ee: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d2f2: 81 11 cpse r24, r1 2d2f4: 49 c0 rjmp .+146 ; 0x2d388 && !mesh_bed_leveling_flag 2d2f6: 80 91 06 12 lds r24, 0x1206 ; 0x801206 2d2fa: 81 11 cpse r24, r1 2d2fc: 45 c0 rjmp .+138 ; 0x2d388 && !homing_flag 2d2fe: 80 91 05 12 lds r24, 0x1205 ; 0x801205 2d302: 81 11 cpse r24, r1 2d304: 41 c0 rjmp .+130 ; 0x2d388 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 2d306: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2d30a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2d30e: 98 17 cp r25, r24 2d310: d9 f1 breq .+118 ; 0x2d388 { uint8_t block_index = block_buffer_tail; 2d312: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } #endif bool e_active() { unsigned char e_active = 0; 2d316: 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++; 2d318: 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) 2d31a: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2d31e: 38 17 cp r19, r24 2d320: 89 f0 breq .+34 ; 0x2d344 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 2d322: 28 9f mul r18, r24 2d324: f0 01 movw r30, r0 2d326: 11 24 eor r1, r1 2d328: e8 53 subi r30, 0x38 ; 56 2d32a: f9 4f sbci r31, 0xF9 ; 249 2d32c: 44 85 ldd r20, Z+12 ; 0x0c 2d32e: 55 85 ldd r21, Z+13 ; 0x0d 2d330: 66 85 ldd r22, Z+14 ; 0x0e 2d332: 77 85 ldd r23, Z+15 ; 0x0f 2d334: 45 2b or r20, r21 2d336: 46 2b or r20, r22 2d338: 47 2b or r20, r23 2d33a: 09 f0 breq .+2 ; 0x2d33e 2d33c: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 2d33e: 8f 5f subi r24, 0xFF ; 255 2d340: 8f 70 andi r24, 0x0F ; 15 2d342: eb cf rjmp .-42 ; 0x2d31a && e_active(); 2d344: 99 23 and r25, r25 2d346: 01 f1 breq .+64 ; 0x2d388 SERIAL_ECHOLNPGM("FINDA filament runout!"); 2d348: 89 e7 ldi r24, 0x79 ; 121 2d34a: 9b e9 ldi r25, 0x9B ; 155 2d34c: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 2d350: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d354: 81 11 cpse r24, r1 2d356: 05 c0 rjmp .+10 ; 0x2d362 2d358: 60 e0 ldi r22, 0x00 ; 0 2d35a: 70 e0 ldi r23, 0x00 ; 0 2d35c: cb 01 movw r24, r22 2d35e: 0f 94 47 42 call 0x2848e ; 0x2848e marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 2d362: 60 e0 ldi r22, 0x00 ; 0 2d364: 70 e0 ldi r23, 0x00 ; 0 2d366: cb 01 movw r24, r22 2d368: 0e 94 c1 61 call 0xc382 ; 0xc382 2d36c: 86 ed ldi r24, 0xD6 ; 214 2d36e: 9e e0 ldi r25, 0x0E ; 14 2d370: 0f 94 3c a1 call 0x34278 ; 0x34278 2d374: 81 30 cpi r24, 0x01 ; 1 2d376: 21 f4 brne .+8 ; 0x2d380 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 2d378: 0f 94 e8 41 call 0x283d0 ; 0x283d0 2d37c: 8f 3f cpi r24, 0xFF ; 255 2d37e: 91 f5 brne .+100 ; 0x2d3e4 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 2d380: 8f e1 ldi r24, 0x1F ; 31 2d382: 9c e6 ldi r25, 0x6C ; 108 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 2d384: 0f 94 b4 43 call 0x28768 ; 0x28768 break; } } } if (logic.Running()) { 2d388: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2d38c: 82 30 cpi r24, 0x02 ; 2 2d38e: 19 f4 brne .+6 ; 0x2d396 state = xState::Active; 2d390: 81 e0 ldi r24, 0x01 ; 1 2d392: 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 2d396: 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) { 2d39a: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> 2d39e: 88 23 and r24, r24 2d3a0: 51 f0 breq .+20 ; 0x2d3b6 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2d3a2: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 2d3a6: 81 11 cpse r24, r1 2d3a8: 06 c0 rjmp .+12 ; 0x2d3b6 2d3aa: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2d3ae: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2d3b2: 0f 94 e9 89 call 0x313d2 ; 0x313d2 CheckErrorScreenUserInput(); } 2d3b6: a0 96 adiw r28, 0x20 ; 32 2d3b8: 0f b6 in r0, 0x3f ; 63 2d3ba: f8 94 cli 2d3bc: de bf out 0x3e, r29 ; 62 2d3be: 0f be out 0x3f, r0 ; 63 2d3c0: cd bf out 0x3d, r28 ; 61 2d3c2: df 91 pop r29 2d3c4: cf 91 pop r28 2d3c6: 1f 91 pop r17 2d3c8: 0f 91 pop r16 2d3ca: ff 90 pop r15 2d3cc: ef 90 pop r14 2d3ce: df 90 pop r13 2d3d0: cf 90 pop r12 2d3d2: bf 90 pop r11 2d3d4: af 90 pop r10 2d3d6: 9f 90 pop r9 2d3d8: 8f 90 pop r8 2d3da: 7f 90 pop r7 2d3dc: 6f 90 pop r6 2d3de: 5f 90 pop r5 2d3e0: 4f 90 pop r4 2d3e2: 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 2d3e4: 8f e6 ldi r24, 0x6F ; 111 2d3e6: 9b e9 ldi r25, 0x9B ; 155 2d3e8: cd cf rjmp .-102 ; 0x2d384 2d3ea: 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) { 2d3ee: 80 91 8b 12 lds r24, 0x128B ; 0x80128b 2d3f2: 08 17 cp r16, r24 2d3f4: 09 f4 brne .+2 ; 0x2d3f8 2d3f6: 49 c0 rjmp .+146 ; 0x2d48a // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2d3f8: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d3fc: 84 30 cpi r24, 0x04 ; 4 2d3fe: b9 f4 brne .+46 ; 0x2d42e break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 2d400: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d404: 88 23 and r24, r24 2d406: 99 f0 breq .+38 ; 0x2d42e custom_message_type = CustomMsg::MMUProgress; 2d408: 89 e0 ldi r24, 0x09 ; 9 2d40a: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d40e: e5 e3 ldi r30, 0x35 ; 53 2d410: fb e9 ldi r31, 0x9B ; 155 }; 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])) 2d412: 0e 31 cpi r16, 0x1E ; 30 2d414: 30 f4 brcc .+12 ; 0x2d422 2d416: e0 2f mov r30, r16 2d418: f0 e0 ldi r31, 0x00 ; 0 2d41a: ee 0f add r30, r30 2d41c: ff 1f adc r31, r31 2d41e: eb 5c subi r30, 0xCB ; 203 2d420: f4 46 sbci r31, 0x64 ; 100 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d422: 85 91 lpm r24, Z+ 2d424: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2d426: 0e 94 32 6d call 0xda64 ; 0xda64 2d42a: 0e 94 93 e6 call 0x1cd26 ; 0x1cd26 2d42e: e5 e3 ldi r30, 0x35 ; 53 2d430: fb e9 ldi r31, 0x9B ; 155 }; 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])) 2d432: 0e 31 cpi r16, 0x1E ; 30 2d434: 30 f4 brcc .+12 ; 0x2d442 2d436: e0 2f mov r30, r16 2d438: f0 e0 ldi r31, 0x00 ; 0 2d43a: ee 0f add r30, r30 2d43c: ff 1f adc r31, r31 2d43e: eb 5c subi r30, 0xCB ; 203 2d440: f4 46 sbci r31, 0x64 ; 100 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d442: 85 91 lpm r24, Z+ 2d444: 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))); 2d446: 02 96 adiw r24, 0x02 ; 2 2d448: 0f 94 86 88 call 0x3110c ; 0x3110c } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 2d44c: 00 93 8b 12 sts 0x128B, r16 ; 0x80128b switch (pc) { 2d450: 03 30 cpi r16, 0x03 ; 3 2d452: 49 f0 breq .+18 ; 0x2d466 2d454: 0c 31 cpi r16, 0x1C ; 28 2d456: 09 f0 breq .+2 ; 0x2d45a 2d458: 97 cf rjmp .-210 ; 0x2d388 2d45a: 0f 94 a0 22 call 0x24540 ; 0x24540 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 2d45e: 81 e0 ldi r24, 0x01 ; 1 2d460: 80 93 96 12 sts 0x1296, r24 ; 0x801296 2d464: 91 cf rjmp .-222 ; 0x2d388 2d466: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d46a: 84 30 cpi r24, 0x04 ; 4 2d46c: 31 f4 brne .+12 ; 0x2d47a ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 2d46e: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d472: 84 55 subi r24, 0x54 ; 84 2d474: 82 30 cpi r24, 0x02 ; 2 2d476: 08 f4 brcc .+2 ; 0x2d47a 2d478: 87 cf rjmp .-242 ; 0x2d388 2d47a: 0f 94 a0 22 call 0x24540 ; 0x24540 // 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; 2d47e: 81 e0 ldi r24, 0x01 ; 1 2d480: 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(); 2d484: 0f 94 4b 3f call 0x27e96 ; 0x27e96 2d488: 7f cf rjmp .-258 ; 0x2d388 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) { 2d48a: 03 30 cpi r16, 0x03 ; 3 2d48c: 71 f1 breq .+92 ; 0x2d4ea 2d48e: 0c 31 cpi r16, 0x1C ; 28 2d490: 09 f0 breq .+2 ; 0x2d494 2d492: 7a cf rjmp .-268 ; 0x2d388 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 2d494: 80 91 96 12 lds r24, 0x1296 ; 0x801296 2d498: 88 23 and r24, r24 2d49a: 09 f4 brne .+2 ; 0x2d49e 2d49c: 75 cf rjmp .-278 ; 0x2d388 switch (WhereIsFilament()) { 2d49e: 0f 94 96 88 call 0x3112c ; 0x3112c 2d4a2: 88 23 and r24, r24 2d4a4: b1 f1 breq .+108 ; 0x2d512 2d4a6: 81 30 cpi r24, 0x01 ; 1 2d4a8: 09 f0 breq .+2 ; 0x2d4ac 2d4aa: 6e cf rjmp .-292 ; 0x2d388 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 2d4ac: 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(); 2d4b0: 0f 94 4a 87 call 0x30e94 ; 0x30e94 // 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; 2d4b4: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 2d4b8: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d4bc: 70 e0 ldi r23, 0x00 ; 0 2d4be: 90 e0 ldi r25, 0x00 ; 0 2d4c0: 80 e0 ldi r24, 0x00 ; 0 2d4c2: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2d4c6: 6b 01 movw r12, r22 2d4c8: 7c 01 movw r14, r24 2d4ca: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2d4ce: 70 e0 ldi r23, 0x00 ; 0 2d4d0: 6e 5f subi r22, 0xFE ; 254 2d4d2: 7f 4f sbci r23, 0xFF ; 255 2d4d4: 07 2e mov r0, r23 2d4d6: 00 0c add r0, r0 2d4d8: 88 0b sbc r24, r24 2d4da: 99 0b sbc r25, r25 2d4dc: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2d4e0: a7 01 movw r20, r14 2d4e2: 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()); 2d4e4: 0f 94 62 88 call 0x310c4 ; 0x310c4 2d4e8: 4f cf rjmp .-354 ; 0x2d388 } 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 2d4ea: 80 91 97 12 lds r24, 0x1297 ; 0x801297 2d4ee: 88 23 and r24, r24 2d4f0: 09 f4 brne .+2 ; 0x2d4f4 2d4f2: 4a cf rjmp .-364 ; 0x2d388 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); 2d4f4: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d4f8: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d4fc: 98 13 cpse r25, r24 2d4fe: 44 cf rjmp .-376 ; 0x2d388 switch (WhereIsFilament()) { 2d500: 0f 94 96 88 call 0x3112c ; 0x3112c 2d504: 81 50 subi r24, 0x01 ; 1 2d506: 83 30 cpi r24, 0x03 ; 3 2d508: 08 f4 brcc .+2 ; 0x2d50c 2d50a: bc cf rjmp .-136 ; 0x2d484 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; 2d50c: 10 92 97 12 sts 0x1297, r1 ; 0x801297 2d510: 3b cf rjmp .-394 ; 0x2d388 2d512: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d516: 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 2d51a: 98 13 cpse r25, r24 2d51c: 35 cf rjmp .-406 ; 0x2d388 // 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()); 2d51e: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d522: 70 e0 ldi r23, 0x00 ; 0 2d524: 90 e0 ldi r25, 0x00 ; 0 2d526: 80 e0 ldi r24, 0x00 ; 0 2d528: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2d52c: 9b 01 movw r18, r22 2d52e: ac 01 movw r20, r24 2d530: 60 e0 ldi r22, 0x00 ; 0 2d532: 70 e0 ldi r23, 0x00 ; 0 2d534: 8f ea ldi r24, 0xAF ; 175 2d536: 93 e4 ldi r25, 0x43 ; 67 2d538: d5 cf rjmp .-86 ; 0x2d4e4 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 2d53a: 18 30 cpi r17, 0x08 ; 8 2d53c: b9 f0 breq .+46 ; 0x2d56c 2d53e: 19 30 cpi r17, 0x09 ; 9 2d540: 09 f0 breq .+2 ; 0x2d544 2d542: 22 cf rjmp .-444 ; 0x2d388 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 2d544: 60 e0 ldi r22, 0x00 ; 0 2d546: 0f 94 07 50 call 0x2a00e ; 0x2a00e 2d54a: 19 e0 ldi r17, 0x09 ; 9 2d54c: 1d cf rjmp .-454 ; 0x2d388 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 2d54e: 61 e0 ldi r22, 0x01 ; 1 2d550: 80 91 65 12 lds r24, 0x1265 ; 0x801265 2d554: 90 91 66 12 lds r25, 0x1266 ; 0x801266 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d558: 0f 94 07 50 call 0x2a00e ; 0x2a00e 2d55c: 15 cf rjmp .-470 ; 0x2d388 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 2d55e: 82 e0 ldi r24, 0x02 ; 2 2d560: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 2d564: 60 e0 ldi r22, 0x00 ; 0 2d566: 8e e2 ldi r24, 0x2E ; 46 2d568: 90 e8 ldi r25, 0x80 ; 128 2d56a: f6 cf rjmp .-20 ; 0x2d558 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2d56c: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2d570: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2d574: 10 92 27 12 sts 0x1227, r1 ; 0x801227 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d578: 60 e0 ldi r22, 0x00 ; 0 2d57a: 8c e2 ldi r24, 0x2C ; 44 2d57c: 90 e8 ldi r25, 0x80 ; 128 2d57e: ec cf rjmp .-40 ; 0x2d558 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 2d580: 0f 94 72 3b call 0x276e4 ; 0x276e4 2d584: a8 cd rjmp .-1200 ; 0x2d0d6 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d586: 00 23 and r16, r16 2d588: 01 f3 breq .-64 ; 0x2d54a 2d58a: dc cf rjmp .-72 ; 0x2d544 0002d58c : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 2d58c: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d590: 82 ff sbrs r24, 2 2d592: 07 c0 rjmp .+14 ; 0x2d5a2 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 2d594: 8b 7f andi r24, 0xFB ; 251 2d596: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 2d59a: 86 ed ldi r24, 0xD6 ; 214 2d59c: 9c e9 ldi r25, 0x9C ; 156 2d59e: 0f 94 86 88 call 0x3110c ; 0x3110c } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 2d5a2: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d5a6: 81 ff sbrs r24, 1 2d5a8: 52 c0 rjmp .+164 ; 0x2d64e 2d5aa: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d5ae: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d5b2: 89 2b or r24, r25 2d5b4: 09 f4 brne .+2 ; 0x2d5b8 2d5b6: 4b c0 rjmp .+150 ; 0x2d64e LogEchoEvent_P(PSTR("Resuming Temp")); 2d5b8: 88 ec ldi r24, 0xC8 ; 200 2d5ba: 9c e9 ldi r25, 0x9C ; 156 2d5bc: 0f 94 86 88 call 0x3110c ; 0x3110c // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 2d5c0: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d5c4: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d5c8: 0f 94 00 42 call 0x28400 ; 0x28400 mmu_print_saved &= ~(SavedState::Cooldown); 2d5cc: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d5d0: 8d 7f andi r24, 0xFD ; 253 2d5d2: 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; 2d5d6: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d5da: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d5de: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 2d5e2: 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)); 2d5e6: 87 ed ldi r24, 0xD7 ; 215 2d5e8: 9a e5 ldi r25, 0x5A ; 90 2d5ea: 0e 94 32 6d call 0xda64 ; 0xda64 2d5ee: 0f 94 f4 0a call 0x215e8 ; 0x215e8 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)); 2d5f2: 48 e9 ldi r20, 0x98 ; 152 2d5f4: 5c e9 ldi r21, 0x9C ; 156 2d5f6: 62 e0 ldi r22, 0x02 ; 2 2d5f8: 80 e0 ldi r24, 0x00 ; 0 2d5fa: 0e 94 10 6a call 0xd420 ; 0xd420 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2d5fe: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2d602: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2d606: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2d60a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2d60e: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2d612: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 2d616: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 2d61a: c9 01 movw r24, r18 2d61c: 86 1b sub r24, r22 2d61e: 97 0b sbc r25, r23 2d620: 06 97 sbiw r24, 0x06 ; 6 2d622: 6c f0 brlt .+26 ; 0x2d63e void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 2d624: 81 e0 ldi r24, 0x01 ; 1 2d626: 0e 94 89 7a call 0xf512 ; 0xf512 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); 2d62a: 80 e0 ldi r24, 0x00 ; 0 2d62c: 0f 94 b2 65 call 0x2cb64 ; 0x2cb64 ReportErrorHookDynamicRender(); 2d630: 0f 94 bf 87 call 0x30f7e ; 0x30f7e void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2d634: 84 e6 ldi r24, 0x64 ; 100 2d636: 90 e0 ldi r25, 0x00 ; 0 2d638: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 2d63c: e0 cf rjmp .-64 ; 0x2d5fe }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 2d63e: 0f 94 95 87 call 0x30f2a ; 0x30f2a LogEchoEvent_P(PSTR("Hotend temperature reached")); 2d642: 8d ea ldi r24, 0xAD ; 173 2d644: 9c e9 ldi r25, 0x9C ; 156 2d646: 0f 94 86 88 call 0x3110c ; 0x3110c void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 2d64a: 0c 94 2f 6a jmp 0xd45e ; 0xd45e ScreenClear(); } } 2d64e: 08 95 ret 0002d650 : /// 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) { 2d650: 0f 93 push r16 2d652: 1f 93 push r17 2d654: cf 93 push r28 2d656: df 93 push r29 2d658: 00 d0 rcall .+0 ; 0x2d65a 2d65a: 1f 92 push r1 2d65c: 1f 92 push r1 2d65e: cd b7 in r28, 0x3d ; 61 2d660: de b7 in r29, 0x3e ; 62 2d662: 18 2f mov r17, r24 2d664: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 2d666: 10 92 95 12 sts 0x1295, r1 ; 0x801295 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 2d66a: 83 e0 ldi r24, 0x03 ; 3 2d66c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 2d670: 19 82 std Y+1, r1 ; 0x01 2d672: 1a 82 std Y+2, r1 ; 0x02 2d674: 1b 82 std Y+3, r1 ; 0x03 2d676: 1c 82 std Y+4, r1 ; 0x04 2d678: 1d 82 std Y+5, r1 ; 0x05 2d67a: 90 e0 ldi r25, 0x00 ; 0 2d67c: 80 e0 ldi r24, 0x00 ; 0 2d67e: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 // - 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) { 2d682: 90 91 95 12 lds r25, 0x1295 ; 0x801295 2d686: 89 81 ldd r24, Y+1 ; 0x01 2d688: 92 ff sbrs r25, 2 2d68a: 37 c0 rjmp .+110 ; 0x2d6fa if (!nozzleTimeout.running()) { 2d68c: 81 11 cpse r24, r1 2d68e: 1e c0 rjmp .+60 ; 0x2d6cc nozzleTimeout.start(); 2d690: ce 01 movw r24, r28 2d692: 01 96 adiw r24, 0x01 ; 1 2d694: 0f 94 fb 11 call 0x223f6 ; 0x223f6 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 2d698: 8a ea ldi r24, 0xAA ; 170 2d69a: 9a e9 ldi r25, 0x9A ; 154 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d69c: 0f 94 86 88 call 0x3110c ; 0x3110c } switch (logicStepLastStatus) { 2d6a0: e0 91 93 12 lds r30, 0x1293 ; 0x801293 2d6a4: e2 50 subi r30, 0x02 ; 2 2d6a6: ea 30 cpi r30, 0x0A ; 10 2d6a8: 40 f7 brcc .-48 ; 0x2d67a 2d6aa: f0 e0 ldi r31, 0x00 ; 0 2d6ac: 88 27 eor r24, r24 2d6ae: e4 5a subi r30, 0xA4 ; 164 2d6b0: f4 49 sbci r31, 0x94 ; 148 2d6b2: 8e 4f sbci r24, 0xFE ; 254 2d6b4: 0d 94 4c a2 jmp 0x34498 ; 0x34498 <__tablejump2__> 2d6b8: 9f 38 cpi r25, 0x8F ; 143 2d6ba: df 37 cpi r29, 0x7F ; 127 2d6bc: 23 38 cpi r18, 0x83 ; 131 2d6be: 23 38 cpi r18, 0x83 ; 131 2d6c0: d3 37 cpi r29, 0x73 ; 115 2d6c2: 23 38 cpi r18, 0x83 ; 131 2d6c4: 93 37 cpi r25, 0x73 ; 115 2d6c6: fd 37 cpi r31, 0x7D ; 125 2d6c8: b3 38 cpi r27, 0x83 ; 131 2d6ca: 23 38 cpi r18, 0x83 ; 131 if (mmu_print_saved & SavedState::CooldownPending) { if (!nozzleTimeout.running()) { nozzleTimeout.start(); LogEchoEvent_P(PSTR("Cooling Timeout started")); } else if (nozzleTimeout.expired(DEFAULT_SAFETYTIMER_TIME_MINS * 60 * 1000ul)) { // mins->msec. 2d6cc: 40 e4 ldi r20, 0x40 ; 64 2d6ce: 57 e7 ldi r21, 0x77 ; 119 2d6d0: 6b e1 ldi r22, 0x1B ; 27 2d6d2: 70 e0 ldi r23, 0x00 ; 0 2d6d4: ce 01 movw r24, r28 2d6d6: 01 96 adiw r24, 0x01 ; 1 2d6d8: 0f 94 3c 10 call 0x22078 ; 0x22078 ::expired(unsigned long)> 2d6dc: 88 23 and r24, r24 2d6de: 01 f3 breq .-64 ; 0x2d6a0 mmu_print_saved &= ~(SavedState::CooldownPending); 2d6e0: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d6e4: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 2d6e6: 82 60 ori r24, 0x02 ; 2 2d6e8: 80 93 95 12 sts 0x1295, r24 ; 0x801295 2d6ec: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2d6f0: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 2d6f4: 8a e9 ldi r24, 0x9A ; 154 2d6f6: 9a e9 ldi r25, 0x9A ; 154 2d6f8: d1 cf rjmp .-94 ; 0x2d69c } } else if (nozzleTimeout.running()) { 2d6fa: 88 23 and r24, r24 2d6fc: 89 f2 breq .-94 ; 0x2d6a0 2d6fe: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d700: 84 e8 ldi r24, 0x84 ; 132 2d702: 9a e9 ldi r25, 0x9A ; 154 2d704: cb cf rjmp .-106 ; 0x2d69c 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(); 2d706: 0f 94 c6 6a call 0x2d58c ; 0x2d58c ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 2d70a: 0f 94 71 3f call 0x27ee2 ; 0x27ee2 if (!TuneMenuEntered()) { 2d70e: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 2d712: 81 11 cpse r24, r1 2d714: 07 c0 rjmp .+14 ; 0x2d724 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2d716: 85 e8 ldi r24, 0x85 ; 133 2d718: 9c e9 ldi r25, 0x9C ; 156 2d71a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 retryAttempts = MAX_RETRIES; 2d71e: 83 e0 ldi r24, 0x03 ; 3 2d720: 80 93 79 12 sts 0x1279, r24 ; 0x801279 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d724: 0f 94 a0 22 call 0x24540 ; 0x24540 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; 2d728: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 2d72a: 0f 90 pop r0 2d72c: 0f 90 pop r0 2d72e: 0f 90 pop r0 2d730: 0f 90 pop r0 2d732: 0f 90 pop r0 2d734: df 91 pop r29 2d736: cf 91 pop r28 2d738: 1f 91 pop r17 2d73a: 0f 91 pop r16 2d73c: 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(); 2d73e: 0f 94 f8 64 call 0x2c9f0 ; 0x2c9f0 2d742: f2 cf rjmp .-28 ; 0x2d728 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 2d744: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 2d748: 81 11 cpse r24, r1 2d74a: 97 cf rjmp .-210 ; 0x2d67a // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 2d74c: 81 2f mov r24, r17 2d74e: 0f 94 bb 3f call 0x27f76 ; 0x27f76 SaveHotendTemp(turn_off_nozzle); 2d752: 80 2f mov r24, r16 2d754: 0f 94 55 3f call 0x27eaa ; 0x27eaa CheckUserInput(); 2d758: 0f 94 f8 64 call 0x2c9f0 ; 0x2c9f0 2d75c: 8e cf rjmp .-228 ; 0x2d67a } 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(); 2d75e: 0f 94 c6 6a call 0x2d58c ; 0x2d58c ResumeUnpark(); 2d762: 0f 94 71 3f call 0x27ee2 ; 0x27ee2 2d766: 89 cf rjmp .-238 ; 0x2d67a } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 2d768: 80 e0 ldi r24, 0x00 ; 0 2d76a: df cf rjmp .-66 ; 0x2d72a 0002d76c : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 2d76c: cf 93 push r28 2d76e: df 93 push r29 2d770: 00 d0 rcall .+0 ; 0x2d772 2d772: 1f 92 push r1 2d774: 1f 92 push r1 2d776: cd b7 in r28, 0x3d ; 61 2d778: 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; 2d77a: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2d77e: 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)); 2d782: 62 e1 ldi r22, 0x12 ; 18 2d784: 84 ef ldi r24, 0xF4 ; 244 2d786: 99 e9 ldi r25, 0x99 ; 153 2d788: 0f 94 eb 54 call 0x2a9d6 ; 0x2a9d6 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(); 2d78c: 0f 94 60 88 call 0x310c0 ; 0x310c0 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 2d790: 40 e0 ldi r20, 0x00 ; 0 2d792: 65 e5 ldi r22, 0x55 ; 85 2d794: ce 01 movw r24, r28 2d796: 01 96 adiw r24, 0x01 ; 1 2d798: 0f 94 53 88 call 0x310a6 ; 0x310a6 2d79c: 49 81 ldd r20, Y+1 ; 0x01 2d79e: 5a 81 ldd r21, Y+2 ; 0x02 2d7a0: 6b 81 ldd r22, Y+3 ; 0x03 2d7a2: 7c 81 ldd r23, Y+4 ; 0x04 2d7a4: 8d 81 ldd r24, Y+5 ; 0x05 2d7a6: 0f 94 93 63 call 0x2c726 ; 0x2c726 logic.UnloadFilament(); if (manage_response(false, true)) { 2d7aa: 61 e0 ldi r22, 0x01 ; 1 2d7ac: 80 e0 ldi r24, 0x00 ; 0 2d7ae: 0f 94 28 6b call 0x2d650 ; 0x2d650 2d7b2: 81 11 cpse r24, r1 2d7b4: 03 c0 rjmp .+6 ; 0x2d7bc break; } IncrementMMUFails(); 2d7b6: 0f 94 b7 87 call 0x30f6e ; 0x30f6e 2d7ba: e8 cf rjmp .-48 ; 0x2d78c 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); 2d7bc: 83 e0 ldi r24, 0x03 ; 3 2d7be: 0f 94 fd 2c call 0x259fa ; 0x259fa } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 2d7c2: 83 e6 ldi r24, 0x63 ; 99 2d7c4: 0f 94 08 42 call 0x28410 ; 0x28410 tool_change_extruder = MMU2_NO_TOOL; 2d7c8: 83 e6 ldi r24, 0x63 ; 99 2d7ca: 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(); } 2d7ce: 84 e8 ldi r24, 0x84 ; 132 2d7d0: 96 e1 ldi r25, 0x16 ; 22 2d7d2: 0e 94 71 6e call 0xdce2 ; 0xdce2 } 2d7d6: 0f 90 pop r0 2d7d8: 0f 90 pop r0 2d7da: 0f 90 pop r0 2d7dc: 0f 90 pop r0 2d7de: 0f 90 pop r0 2d7e0: df 91 pop r29 2d7e2: cf 91 pop r28 2d7e4: 08 95 ret 0002d7e6 : bool MMU2::unload() { 2d7e6: cf 93 push r28 if (!WaitForMMUReady()) { 2d7e8: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 2d7ec: c8 2f mov r28, r24 2d7ee: 88 23 and r24, r24 2d7f0: 79 f0 breq .+30 ; 0x2d810 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 2d7f2: 88 ec ldi r24, 0xC8 ; 200 2d7f4: 90 e0 ldi r25, 0x00 ; 0 2d7f6: 0f 94 df 8b call 0x317be ; 0x317be (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> 2d7fa: 82 e0 ldi r24, 0x02 ; 2 2d7fc: 0f 94 fd 2c call 0x259fa ; 0x259fa struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d800: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 2d804: 0f 94 b6 6b call 0x2d76c ; 0x2d76c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d808: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 2d80c: 0f 94 95 87 call 0x30f2a ; 0x30f2a return true; } 2d810: 8c 2f mov r24, r28 2d812: cf 91 pop r28 2d814: 08 95 ret 0002d816 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 2d816: 0f 93 push r16 2d818: 1f 93 push r17 2d81a: cf 93 push r28 2d81c: df 93 push r29 2d81e: 00 d0 rcall .+0 ; 0x2d820 2d820: 1f 92 push r1 2d822: 1f 92 push r1 2d824: cd b7 in r28, 0x3d ; 61 2d826: de b7 in r29, 0x3e ; 62 2d828: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 2d82a: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 2d82e: 18 2f mov r17, r24 2d830: 88 23 and r24, r24 2d832: 49 f1 breq .+82 ; 0x2d886 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 2d834: 84 ec ldi r24, 0xC4 ; 196 2d836: 9a e5 ldi r25, 0x5A ; 90 2d838: 0e 94 32 6d call 0xda64 ; 0xda64 2d83c: 60 2f mov r22, r16 2d83e: 0f 94 98 87 call 0x30f30 ; 0x30f30 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d842: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 2d846: 0f 94 60 88 call 0x310c0 ; 0x310c0 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 2d84a: 40 2f mov r20, r16 2d84c: 6c e4 ldi r22, 0x4C ; 76 2d84e: ce 01 movw r24, r28 2d850: 01 96 adiw r24, 0x01 ; 1 2d852: 0f 94 53 88 call 0x310a6 ; 0x310a6 2d856: 49 81 ldd r20, Y+1 ; 0x01 2d858: 5a 81 ldd r21, Y+2 ; 0x02 2d85a: 6b 81 ldd r22, Y+3 ; 0x03 2d85c: 7c 81 ldd r23, Y+4 ; 0x04 2d85e: 8d 81 ldd r24, Y+5 ; 0x05 2d860: 0f 94 93 63 call 0x2c726 ; 0x2c726 logic.LoadFilament(slot); if (manage_response(false, false)) { 2d864: 60 e0 ldi r22, 0x00 ; 0 2d866: 80 e0 ldi r24, 0x00 ; 0 2d868: 0f 94 28 6b call 0x2d650 ; 0x2d650 2d86c: 18 2f mov r17, r24 2d86e: 81 11 cpse r24, r1 2d870: 03 c0 rjmp .+6 ; 0x2d878 break; } IncrementMMUFails(); 2d872: 0f 94 b7 87 call 0x30f6e ; 0x30f6e 2d876: e7 cf rjmp .-50 ; 0x2d846 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); 2d878: 83 e0 ldi r24, 0x03 ; 3 2d87a: 0f 94 fd 2c call 0x259fa ; 0x259fa explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d87e: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d882: 0f 94 95 87 call 0x30f2a ; 0x30f2a return true; } 2d886: 81 2f mov r24, r17 2d888: 0f 90 pop r0 2d88a: 0f 90 pop r0 2d88c: 0f 90 pop r0 2d88e: 0f 90 pop r0 2d890: 0f 90 pop r0 2d892: df 91 pop r29 2d894: cf 91 pop r28 2d896: 1f 91 pop r17 2d898: 0f 91 pop r16 2d89a: 08 95 ret 0002d89c : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 2d89c: ff 92 push r15 2d89e: 0f 93 push r16 2d8a0: 1f 93 push r17 2d8a2: cf 93 push r28 2d8a4: df 93 push r29 2d8a6: 00 d0 rcall .+0 ; 0x2d8a8 2d8a8: 1f 92 push r1 2d8aa: 1f 92 push r1 2d8ac: cd b7 in r28, 0x3d ; 61 2d8ae: de b7 in r29, 0x3e ; 62 2d8b0: 08 2f mov r16, r24 2d8b2: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 2d8b4: 0f 94 14 55 call 0x2aa28 ; 0x2aa28 2d8b8: 18 2f mov r17, r24 2d8ba: 88 23 and r24, r24 2d8bc: b1 f1 breq .+108 ; 0x2d92a return false; } if (enableFullScreenMsg) { 2d8be: ff 20 and r15, r15 2d8c0: 39 f0 breq .+14 ; 0x2d8d0 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 2d8c2: 83 eb ldi r24, 0xB3 ; 179 2d8c4: 9a e5 ldi r25, 0x5A ; 90 2d8c6: 0e 94 32 6d call 0xda64 ; 0xda64 2d8ca: 60 2f mov r22, r16 2d8cc: 0f 94 98 87 call 0x30f30 ; 0x30f30 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 2d8d0: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d8d4: 81 11 cpse r24, r1 unload(); 2d8d6: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d8da: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 2d8de: 0f 94 60 88 call 0x310c0 ; 0x310c0 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 2d8e2: 40 2f mov r20, r16 2d8e4: 65 e4 ldi r22, 0x45 ; 69 2d8e6: ce 01 movw r24, r28 2d8e8: 01 96 adiw r24, 0x01 ; 1 2d8ea: 0f 94 53 88 call 0x310a6 ; 0x310a6 2d8ee: 49 81 ldd r20, Y+1 ; 0x01 2d8f0: 5a 81 ldd r21, Y+2 ; 0x02 2d8f2: 6b 81 ldd r22, Y+3 ; 0x03 2d8f4: 7c 81 ldd r23, Y+4 ; 0x04 2d8f6: 8d 81 ldd r24, Y+5 ; 0x05 2d8f8: 0f 94 93 63 call 0x2c726 ; 0x2c726 logic.EjectFilament(slot); if (manage_response(false, true)) { 2d8fc: 61 e0 ldi r22, 0x01 ; 1 2d8fe: 80 e0 ldi r24, 0x00 ; 0 2d900: 0f 94 28 6b call 0x2d650 ; 0x2d650 2d904: 18 2f mov r17, r24 2d906: 81 11 cpse r24, r1 2d908: 03 c0 rjmp .+6 ; 0x2d910 break; } IncrementMMUFails(); 2d90a: 0f 94 b7 87 call 0x30f6e ; 0x30f6e 2d90e: e7 cf rjmp .-50 ; 0x2d8de } SetCurrentTool(MMU2_NO_TOOL); 2d910: 83 e6 ldi r24, 0x63 ; 99 2d912: 0f 94 08 42 call 0x28410 ; 0x28410 tool_change_extruder = MMU2_NO_TOOL; 2d916: 83 e6 ldi r24, 0x63 ; 99 2d918: 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); 2d91c: 83 e0 ldi r24, 0x03 ; 3 2d91e: 0f 94 fd 2c call 0x259fa ; 0x259fa explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d922: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 2d926: 0f 94 95 87 call 0x30f2a ; 0x30f2a return true; } 2d92a: 81 2f mov r24, r17 2d92c: 0f 90 pop r0 2d92e: 0f 90 pop r0 2d930: 0f 90 pop r0 2d932: 0f 90 pop r0 2d934: 0f 90 pop r0 2d936: df 91 pop r29 2d938: cf 91 pop r28 2d93a: 1f 91 pop r17 2d93c: 0f 91 pop r16 2d93e: ff 90 pop r15 2d940: 08 95 ret 0002d942 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 2d942: 1f 93 push r17 2d944: cf 93 push r28 2d946: df 93 push r29 2d948: 00 d0 rcall .+0 ; 0x2d94a 2d94a: 1f 92 push r1 2d94c: 1f 92 push r1 2d94e: cd b7 in r28, 0x3d ; 61 2d950: de b7 in r29, 0x3e ; 62 2d952: 18 2f mov r17, r24 for (;;) { Disable_E0(); 2d954: 0f 94 60 88 call 0x310c0 ; 0x310c0 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 2d958: 41 2f mov r20, r17 2d95a: 6b e4 ldi r22, 0x4B ; 75 2d95c: ce 01 movw r24, r28 2d95e: 01 96 adiw r24, 0x01 ; 1 2d960: 0f 94 53 88 call 0x310a6 ; 0x310a6 2d964: 49 81 ldd r20, Y+1 ; 0x01 2d966: 5a 81 ldd r21, Y+2 ; 0x02 2d968: 6b 81 ldd r22, Y+3 ; 0x03 2d96a: 7c 81 ldd r23, Y+4 ; 0x04 2d96c: 8d 81 ldd r24, Y+5 ; 0x05 2d96e: 0f 94 93 63 call 0x2c726 ; 0x2c726 logic.CutFilament(slot); if (manage_response(false, true)) { 2d972: 61 e0 ldi r22, 0x01 ; 1 2d974: 80 e0 ldi r24, 0x00 ; 0 2d976: 0f 94 28 6b call 0x2d650 ; 0x2d650 2d97a: 81 11 cpse r24, r1 2d97c: 03 c0 rjmp .+6 ; 0x2d984 break; } IncrementMMUFails(); 2d97e: 0f 94 b7 87 call 0x30f6e ; 0x30f6e 2d982: e8 cf rjmp .-48 ; 0x2d954 } } 2d984: 0f 90 pop r0 2d986: 0f 90 pop r0 2d988: 0f 90 pop r0 2d98a: 0f 90 pop r0 2d98c: 0f 90 pop r0 2d98e: df 91 pop r29 2d990: cf 91 pop r28 2d992: 1f 91 pop r17 2d994: 08 95 ret 0002d996 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 2d996: cf 93 push r28 2d998: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 2d99a: 84 ea ldi r24, 0xA4 ; 164 2d99c: 9a e5 ldi r25, 0x5A ; 90 2d99e: 0e 94 32 6d call 0xda64 ; 0xda64 2d9a2: 6c 2f mov r22, r28 2d9a4: 0f 94 98 87 call 0x30f30 ; 0x30f30 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 2d9a8: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d9ac: 81 11 cpse r24, r1 unload(); 2d9ae: 0f 94 f3 6b call 0x2d7e6 ; 0x2d7e6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d9b2: 0f 94 e0 54 call 0x2a9c0 ; 0x2a9c0 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 2d9b6: 8c 2f mov r24, r28 2d9b8: 0f 94 a1 6c call 0x2d942 ; 0x2d942 SetCurrentTool(MMU2_NO_TOOL); 2d9bc: 83 e6 ldi r24, 0x63 ; 99 2d9be: 0f 94 08 42 call 0x28410 ; 0x28410 tool_change_extruder = MMU2_NO_TOOL; 2d9c2: 83 e6 ldi r24, 0x63 ; 99 2d9c4: 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); 2d9c8: 83 e0 ldi r24, 0x03 ; 3 2d9ca: 0f 94 fd 2c call 0x259fa ; 0x259fa explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d9ce: 0f 94 09 55 call 0x2aa12 ; 0x2aa12 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d9d2: 0f 94 95 87 call 0x30f2a ; 0x30f2a return true; } 2d9d6: 81 e0 ldi r24, 0x01 ; 1 2d9d8: cf 91 pop r28 2d9da: 08 95 ret 0002d9dc : /// 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; 2d9dc: 86 27 eor r24, r22 2d9de: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2d9e0: 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) { 2d9e2: 38 2f mov r19, r24 2d9e4: 88 0f add r24, r24 2d9e6: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 2d9e8: 82 27 eor r24, r18 2d9ea: 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++) { 2d9ec: d1 f7 brne .-12 ; 0x2d9e2 } else { data <<= 1U; } } return data; } 2d9ee: 08 95 ret 0002d9f0 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 2d9f0: 8f e0 ldi r24, 0x0F ; 15 2d9f2: 90 ea ldi r25, 0xA0 ; 160 2d9f4: 0c 94 db 70 jmp 0xe1b6 ; 0xe1b6 0002d9f8 : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 2d9f8: cf 93 push r28 2d9fa: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 2d9fc: 89 e0 ldi r24, 0x09 ; 9 2d9fe: 90 ea ldi r25, 0xA0 ; 160 2da00: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 2da04: 8c 2f mov r24, r28 2da06: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2da0a: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 2da0c: cf 91 pop r28 2da0e: 0c 94 c2 70 jmp 0xe184 ; 0xe184 0002da12 : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 2da12: cf 93 push r28 2da14: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 2da16: 82 ed ldi r24, 0xD2 ; 210 2da18: 9f e9 ldi r25, 0x9F ; 159 2da1a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 2da1e: 8c 2f mov r24, r28 2da20: 0e 94 c2 70 call 0xe184 ; 0xe184 2da24: 8d e5 ldi r24, 0x5D ; 93 2da26: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 2da2a: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 2da2c: 0d 94 f8 6c jmp 0x2d9f0 ; 0x2d9f0 0002da30 : // 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) { 2da30: 2f 92 push r2 2da32: 3f 92 push r3 2da34: 4f 92 push r4 2da36: 5f 92 push r5 2da38: 6f 92 push r6 2da3a: 7f 92 push r7 2da3c: 8f 92 push r8 2da3e: 9f 92 push r9 2da40: af 92 push r10 2da42: bf 92 push r11 2da44: cf 92 push r12 2da46: df 92 push r13 2da48: ef 92 push r14 2da4a: ff 92 push r15 2da4c: 0f 93 push r16 2da4e: 1f 93 push r17 2da50: cf 93 push r28 2da52: df 93 push r29 2da54: cd b7 in r28, 0x3d ; 61 2da56: de b7 in r29, 0x3e ; 62 2da58: a1 97 sbiw r28, 0x21 ; 33 2da5a: 0f b6 in r0, 0x3f ; 63 2da5c: f8 94 cli 2da5e: de bf out 0x3e, r29 ; 62 2da60: 0f be out 0x3f, r0 ; 63 2da62: cd bf out 0x3d, r28 ; 61 2da64: 1c 01 movw r2, r24 2da66: 48 01 movw r8, r16 2da68: 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) 2da6a: fc 01 movw r30, r24 2da6c: e8 5b subi r30, 0xB8 ; 184 2da6e: ff 4f sbci r31, 0xFF ; 255 2da70: c0 80 ld r12, Z 2da72: d1 80 ldd r13, Z+1 ; 0x01 2da74: e2 80 ldd r14, Z+2 ; 0x02 2da76: f3 80 ldd r15, Z+3 ; 0x03 2da78: 9a 01 movw r18, r20 2da7a: ab 01 movw r20, r22 2da7c: c7 01 movw r24, r14 2da7e: b6 01 movw r22, r12 2da80: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2da84: 0f 94 42 a3 call 0x34684 ; 0x34684 2da88: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2da8c: 8b 01 movw r16, r22 2da8e: 8d 83 std Y+5, r24 ; 0x05 2da90: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 2da92: a5 01 movw r20, r10 2da94: 94 01 movw r18, r8 2da96: c7 01 movw r24, r14 2da98: b6 01 movw r22, r12 2da9a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2da9e: 0f 94 42 a3 call 0x34684 ; 0x34684 2daa2: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2daa6: 36 2f mov r19, r22 2daa8: 27 2f mov r18, r23 2daaa: a8 01 movw r20, r16 2daac: 6d 81 ldd r22, Y+5 ; 0x05 2daae: 79 81 ldd r23, Y+1 ; 0x01 2dab0: 48 37 cpi r20, 0x78 ; 120 2dab2: 51 05 cpc r21, r1 2dab4: 61 05 cpc r22, r1 2dab6: 71 05 cpc r23, r1 2dab8: 20 f4 brcc .+8 ; 0x2dac2 2daba: 48 e7 ldi r20, 0x78 ; 120 2dabc: 50 e0 ldi r21, 0x00 ; 0 2dabe: 60 e0 ldi r22, 0x00 ; 0 2dac0: 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) 2dac2: d1 01 movw r26, r2 2dac4: d6 96 adiw r26, 0x36 ; 54 2dac6: 8d 90 ld r8, X+ 2dac8: 9d 90 ld r9, X+ 2daca: ad 90 ld r10, X+ 2dacc: bc 90 ld r11, X 2dace: d9 97 sbiw r26, 0x39 ; 57 2dad0: 8f 8a std Y+23, r8 ; 0x17 2dad2: 98 8e std Y+24, r9 ; 0x18 2dad4: a9 8e std Y+25, r10 ; 0x19 2dad6: ba 8e std Y+26, r11 ; 0x1a 2dad8: 48 15 cp r20, r8 2dada: 59 05 cpc r21, r9 2dadc: 6a 05 cpc r22, r10 2dade: 7b 05 cpc r23, r11 2dae0: 20 f4 brcc .+8 ; 0x2daea 2dae2: 4f 8b std Y+23, r20 ; 0x17 2dae4: 58 8f std Y+24, r21 ; 0x18 2dae6: 69 8f std Y+25, r22 ; 0x19 2dae8: 7a 8f std Y+26, r23 ; 0x1a 2daea: 43 2f mov r20, r19 2daec: 52 2f mov r21, r18 2daee: bc 01 movw r22, r24 2daf0: 48 37 cpi r20, 0x78 ; 120 2daf2: 51 05 cpc r21, r1 2daf4: 61 05 cpc r22, r1 2daf6: 71 05 cpc r23, r1 2daf8: 20 f4 brcc .+8 ; 0x2db02 2dafa: 48 e7 ldi r20, 0x78 ; 120 2dafc: 50 e0 ldi r21, 0x00 ; 0 2dafe: 60 e0 ldi r22, 0x00 ; 0 2db00: 70 e0 ldi r23, 0x00 ; 0 2db02: 18 2d mov r17, r8 2db04: 09 2d mov r16, r9 2db06: a9 a2 std Y+33, r10 ; 0x21 2db08: b8 a2 std Y+32, r11 ; 0x20 2db0a: 48 15 cp r20, r8 2db0c: 59 05 cpc r21, r9 2db0e: 6a 05 cpc r22, r10 2db10: 7b 05 cpc r23, r11 2db12: 20 f4 brcc .+8 ; 0x2db1c 2db14: 14 2f mov r17, r20 2db16: 05 2f mov r16, r21 2db18: 69 a3 std Y+33, r22 ; 0x21 2db1a: 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; 2db1c: f1 01 movw r30, r2 2db1e: ee 5b subi r30, 0xBE ; 190 2db20: ff 4f sbci r31, 0xFF ; 255 2db22: c0 80 ld r12, Z 2db24: d1 80 ldd r13, Z+1 ; 0x01 2db26: e2 80 ldd r14, Z+2 ; 0x02 2db28: f3 80 ldd r15, Z+3 ; 0x03 2db2a: cd 82 std Y+5, r12 ; 0x05 2db2c: de 82 std Y+6, r13 ; 0x06 2db2e: ef 82 std Y+7, r14 ; 0x07 2db30: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 2db32: cd 28 or r12, r13 2db34: ce 28 or r12, r14 2db36: cf 28 or r12, r15 2db38: 41 f4 brne .+16 ; 0x2db4a // Don't allow zero acceleration. acceleration = 1; 2db3a: c1 2c mov r12, r1 2db3c: d1 2c mov r13, r1 2db3e: 76 01 movw r14, r12 2db40: c3 94 inc r12 2db42: cd 82 std Y+5, r12 ; 0x05 2db44: de 82 std Y+6, r13 ; 0x06 2db46: ef 82 std Y+7, r14 ; 0x07 2db48: 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; 2db4a: 2f 89 ldd r18, Y+23 ; 0x17 2db4c: 38 8d ldd r19, Y+24 ; 0x18 2db4e: 49 8d ldd r20, Y+25 ; 0x19 2db50: 5a 8d ldd r21, Y+26 ; 0x1a 2db52: b9 01 movw r22, r18 2db54: ca 01 movw r24, r20 2db56: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 2db5a: 6d 87 std Y+13, r22 ; 0x0d 2db5c: 7e 87 std Y+14, r23 ; 0x0e 2db5e: 8f 87 std Y+15, r24 ; 0x0f 2db60: 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; 2db62: a5 01 movw r20, r10 2db64: 94 01 movw r18, r8 2db66: c5 01 movw r24, r10 2db68: b4 01 movw r22, r8 2db6a: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 2db6e: 2b 01 movw r4, r22 2db70: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 2db72: 21 2f mov r18, r17 2db74: 30 2f mov r19, r16 2db76: 49 a1 ldd r20, Y+33 ; 0x21 2db78: 58 a1 ldd r21, Y+32 ; 0x20 2db7a: 61 2f mov r22, r17 2db7c: 70 2f mov r23, r16 2db7e: ca 01 movw r24, r20 2db80: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 2db84: 69 8b std Y+17, r22 ; 0x11 2db86: 7a 8b std Y+18, r23 ; 0x12 2db88: 8b 8b std Y+19, r24 ; 0x13 2db8a: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 2db8c: cd 80 ldd r12, Y+5 ; 0x05 2db8e: de 80 ldd r13, Y+6 ; 0x06 2db90: ef 80 ldd r14, Y+7 ; 0x07 2db92: f8 84 ldd r15, Y+8 ; 0x08 2db94: cc 0c add r12, r12 2db96: dd 1c adc r13, r13 2db98: ee 1c adc r14, r14 2db9a: ff 1c adc r15, r15 2db9c: c9 86 std Y+9, r12 ; 0x09 2db9e: da 86 std Y+10, r13 ; 0x0a 2dba0: eb 86 std Y+11, r14 ; 0x0b 2dba2: 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; 2dba4: c3 01 movw r24, r6 2dba6: b2 01 movw r22, r4 2dba8: 61 50 subi r22, 0x01 ; 1 2dbaa: 71 09 sbc r23, r1 2dbac: 81 09 sbc r24, r1 2dbae: 91 09 sbc r25, r1 2dbb0: cd 84 ldd r12, Y+13 ; 0x0d 2dbb2: de 84 ldd r13, Y+14 ; 0x0e 2dbb4: ef 84 ldd r14, Y+15 ; 0x0f 2dbb6: f8 88 ldd r15, Y+16 ; 0x10 2dbb8: 6c 19 sub r22, r12 2dbba: 7d 09 sbc r23, r13 2dbbc: 8e 09 sbc r24, r14 2dbbe: 9f 09 sbc r25, r15 2dbc0: c9 84 ldd r12, Y+9 ; 0x09 2dbc2: da 84 ldd r13, Y+10 ; 0x0a 2dbc4: eb 84 ldd r14, Y+11 ; 0x0b 2dbc6: fc 84 ldd r15, Y+12 ; 0x0c 2dbc8: 6c 0d add r22, r12 2dbca: 7d 1d adc r23, r13 2dbcc: 8e 1d adc r24, r14 2dbce: 9f 1d adc r25, r15 2dbd0: a7 01 movw r20, r14 2dbd2: 96 01 movw r18, r12 2dbd4: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 2dbd8: 69 01 movw r12, r18 2dbda: 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; 2dbdc: c3 01 movw r24, r6 2dbde: b2 01 movw r22, r4 2dbe0: 29 89 ldd r18, Y+17 ; 0x11 2dbe2: 3a 89 ldd r19, Y+18 ; 0x12 2dbe4: 4b 89 ldd r20, Y+19 ; 0x13 2dbe6: 5c 89 ldd r21, Y+20 ; 0x14 2dbe8: 62 1b sub r22, r18 2dbea: 73 0b sbc r23, r19 2dbec: 84 0b sbc r24, r20 2dbee: 95 0b sbc r25, r21 2dbf0: 29 85 ldd r18, Y+9 ; 0x09 2dbf2: 3a 85 ldd r19, Y+10 ; 0x0a 2dbf4: 4b 85 ldd r20, Y+11 ; 0x0b 2dbf6: 5c 85 ldd r21, Y+12 ; 0x0c 2dbf8: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 2dbfc: 29 01 movw r4, r18 2dbfe: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 2dc00: d7 01 movw r26, r14 2dc02: c6 01 movw r24, r12 2dc04: 84 0d add r24, r4 2dc06: 95 1d adc r25, r5 2dc08: a6 1d adc r26, r6 2dc0a: b7 1d adc r27, r7 2dc0c: 8c 8f std Y+28, r24 ; 0x1c 2dc0e: 9d 8f std Y+29, r25 ; 0x1d 2dc10: ae 8f std Y+30, r26 ; 0x1e 2dc12: 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) { 2dc14: f1 01 movw r30, r2 2dc16: e4 5b subi r30, 0xB4 ; 180 2dc18: ff 4f sbci r31, 0xFF ; 255 2dc1a: 90 81 ld r25, Z 2dc1c: 9b 8f std Y+27, r25 ; 0x1b 2dc1e: 99 23 and r25, r25 2dc20: 09 f4 brne .+2 ; 0x2dc24 2dc22: 8d c0 rjmp .+282 ; 0x2dd3e final_adv_steps = final_rate * block->adv_comp; 2dc24: 61 2f mov r22, r17 2dc26: 70 2f mov r23, r16 2dc28: 89 a1 ldd r24, Y+33 ; 0x21 2dc2a: 98 a1 ldd r25, Y+32 ; 0x20 2dc2c: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2dc30: f1 01 movw r30, r2 2dc32: ec 5a subi r30, 0xAC ; 172 2dc34: ff 4f sbci r31, 0xFF ; 255 2dc36: 20 81 ld r18, Z 2dc38: 31 81 ldd r19, Z+1 ; 0x01 2dc3a: 42 81 ldd r20, Z+2 ; 0x02 2dc3c: 53 81 ldd r21, Z+3 ; 0x03 2dc3e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2dc42: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2dc46: 6d 8b std Y+21, r22 ; 0x15 2dc48: 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) { 2dc4a: d1 01 movw r26, r2 2dc4c: 50 96 adiw r26, 0x10 ; 16 2dc4e: 2d 91 ld r18, X+ 2dc50: 3d 91 ld r19, X+ 2dc52: 4d 91 ld r20, X+ 2dc54: 5c 91 ld r21, X 2dc56: 53 97 sbiw r26, 0x13 ; 19 2dc58: 29 83 std Y+1, r18 ; 0x01 2dc5a: 3a 83 std Y+2, r19 ; 0x02 2dc5c: 4b 83 std Y+3, r20 ; 0x03 2dc5e: 5c 83 std Y+4, r21 ; 0x04 2dc60: 8c 8d ldd r24, Y+28 ; 0x1c 2dc62: 9d 8d ldd r25, Y+29 ; 0x1d 2dc64: ae 8d ldd r26, Y+30 ; 0x1e 2dc66: bf 8d ldd r27, Y+31 ; 0x1f 2dc68: 82 17 cp r24, r18 2dc6a: 93 07 cpc r25, r19 2dc6c: a4 07 cpc r26, r20 2dc6e: b5 07 cpc r27, r21 2dc70: 08 f0 brcs .+2 ; 0x2dc74 2dc72: 68 c0 rjmp .+208 ; 0x2dd44 plateau_steps = block->step_event_count.wide - accel_decel_steps; 2dc74: 29 01 movw r4, r18 2dc76: 3a 01 movw r6, r20 2dc78: 48 1a sub r4, r24 2dc7a: 59 0a sbc r5, r25 2dc7c: 6a 0a sbc r6, r26 2dc7e: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 2dc80: 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; 2dc82: 40 e0 ldi r20, 0x00 ; 0 2dc84: 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) 2dc86: 99 23 and r25, r25 2dc88: 89 f0 breq .+34 ; 0x2dcac max_adv_steps = block->nominal_rate * block->adv_comp; 2dc8a: c5 01 movw r24, r10 2dc8c: b4 01 movw r22, r8 2dc8e: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2dc92: f1 01 movw r30, r2 2dc94: ec 5a subi r30, 0xAC ; 172 2dc96: ff 4f sbci r31, 0xFF ; 255 2dc98: 20 81 ld r18, Z 2dc9a: 31 81 ldd r19, Z+1 ; 0x01 2dc9c: 42 81 ldd r20, Z+2 ; 0x02 2dc9e: 53 81 ldd r21, Z+3 ; 0x03 2dca0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2dca4: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2dca8: 46 2f mov r20, r22 2dcaa: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 2dcac: 3f b7 in r19, 0x3f ; 63 2dcae: 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. 2dcb0: f1 01 movw r30, r2 2dcb2: e9 5b subi r30, 0xB9 ; 185 2dcb4: ff 4f sbci r31, 0xFF ; 255 2dcb6: 20 81 ld r18, Z 2dcb8: 21 11 cpse r18, r1 2dcba: 27 c0 rjmp .+78 ; 0x2dd0a block->accelerate_until = accelerate_steps; 2dcbc: d1 01 movw r26, r2 2dcbe: 59 96 adiw r26, 0x19 ; 25 2dcc0: cd 92 st X+, r12 2dcc2: dd 92 st X+, r13 2dcc4: ed 92 st X+, r14 2dcc6: fc 92 st X, r15 2dcc8: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 2dcca: c4 0c add r12, r4 2dccc: d5 1c adc r13, r5 2dcce: e6 1c adc r14, r6 2dcd0: f7 1c adc r15, r7 2dcd2: f1 01 movw r30, r2 2dcd4: c5 8e std Z+29, r12 ; 0x1d 2dcd6: d6 8e std Z+30, r13 ; 0x1e 2dcd8: e7 8e std Z+31, r14 ; 0x1f 2dcda: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 2dcdc: cf 88 ldd r12, Y+23 ; 0x17 2dcde: c2 ae std Z+58, r12 ; 0x3a 2dce0: d8 8c ldd r13, Y+24 ; 0x18 2dce2: d3 ae std Z+59, r13 ; 0x3b 2dce4: e9 8c ldd r14, Y+25 ; 0x19 2dce6: e4 ae std Z+60, r14 ; 0x3c 2dce8: fa 8c ldd r15, Y+26 ; 0x1a 2dcea: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 2dcec: fe 96 adiw r30, 0x3e ; 62 2dcee: 10 83 st Z, r17 2dcf0: 01 83 std Z+1, r16 ; 0x01 2dcf2: c9 a0 ldd r12, Y+33 ; 0x21 2dcf4: c2 82 std Z+2, r12 ; 0x02 2dcf6: d8 a0 ldd r13, Y+32 ; 0x20 2dcf8: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 2dcfa: 73 96 adiw r30, 0x13 ; 19 2dcfc: ed 88 ldd r14, Y+21 ; 0x15 2dcfe: e0 82 st Z, r14 2dd00: fe 88 ldd r15, Y+22 ; 0x16 2dd02: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 2dd04: 32 97 sbiw r30, 0x02 ; 2 2dd06: 40 83 st Z, r20 2dd08: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 2dd0a: 3f bf out 0x3f, r19 ; 63 } 2dd0c: a1 96 adiw r28, 0x21 ; 33 2dd0e: 0f b6 in r0, 0x3f ; 63 2dd10: f8 94 cli 2dd12: de bf out 0x3e, r29 ; 62 2dd14: 0f be out 0x3f, r0 ; 63 2dd16: cd bf out 0x3d, r28 ; 61 2dd18: df 91 pop r29 2dd1a: cf 91 pop r28 2dd1c: 1f 91 pop r17 2dd1e: 0f 91 pop r16 2dd20: ff 90 pop r15 2dd22: ef 90 pop r14 2dd24: df 90 pop r13 2dd26: cf 90 pop r12 2dd28: bf 90 pop r11 2dd2a: af 90 pop r10 2dd2c: 9f 90 pop r9 2dd2e: 8f 90 pop r8 2dd30: 7f 90 pop r7 2dd32: 6f 90 pop r6 2dd34: 5f 90 pop r5 2dd36: 4f 90 pop r4 2dd38: 3f 90 pop r3 2dd3a: 2f 90 pop r2 2dd3c: 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; 2dd3e: 1d 8a std Y+21, r1 ; 0x15 2dd40: 1e 8a std Y+22, r1 ; 0x16 2dd42: 83 cf rjmp .-250 ; 0x2dc4a #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; 2dd44: 2d 81 ldd r18, Y+5 ; 0x05 2dd46: 3e 81 ldd r19, Y+6 ; 0x06 2dd48: 4f 81 ldd r20, Y+7 ; 0x07 2dd4a: 58 85 ldd r21, Y+8 ; 0x08 2dd4c: 82 e0 ldi r24, 0x02 ; 2 2dd4e: 22 0f add r18, r18 2dd50: 33 1f adc r19, r19 2dd52: 44 1f adc r20, r20 2dd54: 55 1f adc r21, r21 2dd56: 8a 95 dec r24 2dd58: d1 f7 brne .-12 ; 0x2dd4e 2dd5a: 89 81 ldd r24, Y+1 ; 0x01 2dd5c: 9a 81 ldd r25, Y+2 ; 0x02 2dd5e: ab 81 ldd r26, Y+3 ; 0x03 2dd60: bc 81 ldd r27, Y+4 ; 0x04 2dd62: 81 70 andi r24, 0x01 ; 1 2dd64: 99 27 eor r25, r25 2dd66: aa 27 eor r26, r26 2dd68: bb 27 eor r27, r27 2dd6a: 8d 83 std Y+5, r24 ; 0x05 2dd6c: 9e 83 std Y+6, r25 ; 0x06 2dd6e: af 83 std Y+7, r26 ; 0x07 2dd70: b8 87 std Y+8, r27 ; 0x08 2dd72: 89 80 ldd r8, Y+1 ; 0x01 2dd74: 9a 80 ldd r9, Y+2 ; 0x02 2dd76: ab 80 ldd r10, Y+3 ; 0x03 2dd78: bc 80 ldd r11, Y+4 ; 0x04 2dd7a: b6 94 lsr r11 2dd7c: a7 94 ror r10 2dd7e: 97 94 ror r9 2dd80: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 2dd82: cd 84 ldd r12, Y+13 ; 0x0d 2dd84: de 84 ldd r13, Y+14 ; 0x0e 2dd86: ef 84 ldd r14, Y+15 ; 0x0f 2dd88: f8 88 ldd r15, Y+16 ; 0x10 2dd8a: 89 89 ldd r24, Y+17 ; 0x11 2dd8c: 9a 89 ldd r25, Y+18 ; 0x12 2dd8e: ab 89 ldd r26, Y+19 ; 0x13 2dd90: bc 89 ldd r27, Y+20 ; 0x14 2dd92: 8c 15 cp r24, r12 2dd94: 9d 05 cpc r25, r13 2dd96: ae 05 cpc r26, r14 2dd98: bf 05 cpc r27, r15 2dd9a: 08 f4 brcc .+2 ; 0x2dd9e 2dd9c: 6f c0 rjmp .+222 ; 0x2de7c // 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; 2dd9e: 6c 01 movw r12, r24 2dda0: 7d 01 movw r14, r26 2dda2: 91 e0 ldi r25, 0x01 ; 1 2dda4: c9 1a sub r12, r25 2dda6: d1 08 sbc r13, r1 2dda8: e1 08 sbc r14, r1 2ddaa: f1 08 sbc r15, r1 2ddac: 8d 85 ldd r24, Y+13 ; 0x0d 2ddae: 9e 85 ldd r25, Y+14 ; 0x0e 2ddb0: af 85 ldd r26, Y+15 ; 0x0f 2ddb2: b8 89 ldd r27, Y+16 ; 0x10 2ddb4: c8 1a sub r12, r24 2ddb6: d9 0a sbc r13, r25 2ddb8: ea 0a sbc r14, r26 2ddba: fb 0a sbc r15, r27 2ddbc: c7 01 movw r24, r14 2ddbe: b6 01 movw r22, r12 2ddc0: 62 0f add r22, r18 2ddc2: 73 1f adc r23, r19 2ddc4: 84 1f adc r24, r20 2ddc6: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 2ddc8: cd 80 ldd r12, Y+5 ; 0x05 2ddca: de 80 ldd r13, Y+6 ; 0x06 2ddcc: ef 80 ldd r14, Y+7 ; 0x07 2ddce: f8 84 ldd r15, Y+8 ; 0x08 2ddd0: cd 28 or r12, r13 2ddd2: ce 28 or r12, r14 2ddd4: cf 28 or r12, r15 2ddd6: 41 f0 breq .+16 ; 0x2dde8 accelerate_steps += acceleration_x2; 2ddd8: c9 84 ldd r12, Y+9 ; 0x09 2ddda: da 84 ldd r13, Y+10 ; 0x0a 2dddc: eb 84 ldd r14, Y+11 ; 0x0b 2ddde: fc 84 ldd r15, Y+12 ; 0x0c 2dde0: 6c 0d add r22, r12 2dde2: 7d 1d adc r23, r13 2dde4: 8e 1d adc r24, r14 2dde6: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 2dde8: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 2ddec: 75 01 movw r14, r10 2ddee: 64 01 movw r12, r8 2ddf0: c2 0e add r12, r18 2ddf2: d3 1e adc r13, r19 2ddf4: e4 1e adc r14, r20 2ddf6: f5 1e adc r15, r21 2ddf8: 29 81 ldd r18, Y+1 ; 0x01 2ddfa: 3a 81 ldd r19, Y+2 ; 0x02 2ddfc: 4b 81 ldd r20, Y+3 ; 0x03 2ddfe: 5c 81 ldd r21, Y+4 ; 0x04 2de00: 2c 15 cp r18, r12 2de02: 3d 05 cpc r19, r13 2de04: 4e 05 cpc r20, r14 2de06: 5f 05 cpc r21, r15 2de08: 10 f4 brcc .+4 ; 0x2de0e 2de0a: 69 01 movw r12, r18 2de0c: 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) { 2de0e: 2b 8d ldd r18, Y+27 ; 0x1b 2de10: 22 23 and r18, r18 2de12: 09 f4 brne .+2 ; 0x2de16 2de14: 69 c0 rjmp .+210 ; 0x2dee8 if(!accelerate_steps || !decelerate_steps) { 2de16: c1 14 cp r12, r1 2de18: d1 04 cpc r13, r1 2de1a: e1 04 cpc r14, r1 2de1c: f1 04 cpc r15, r1 2de1e: 09 f4 brne .+2 ; 0x2de22 2de20: 66 c0 rjmp .+204 ; 0x2deee // 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; 2de22: 4d 89 ldd r20, Y+21 ; 0x15 2de24: 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) { 2de26: 41 14 cp r4, r1 2de28: 51 04 cpc r5, r1 2de2a: 61 04 cpc r6, r1 2de2c: 71 04 cpc r7, r1 2de2e: 09 f4 brne .+2 ; 0x2de32 2de30: 3d cf rjmp .-390 ; 0x2dcac // 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); 2de32: a7 01 movw r20, r14 2de34: 96 01 movw r18, r12 2de36: 69 85 ldd r22, Y+9 ; 0x09 2de38: 7a 85 ldd r23, Y+10 ; 0x0a 2de3a: 8b 85 ldd r24, Y+11 ; 0x0b 2de3c: 9c 85 ldd r25, Y+12 ; 0x0c 2de3e: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 2de42: 2d 85 ldd r18, Y+13 ; 0x0d 2de44: 3e 85 ldd r19, Y+14 ; 0x0e 2de46: 4f 85 ldd r20, Y+15 ; 0x0f 2de48: 58 89 ldd r21, Y+16 ; 0x10 2de4a: 62 0f add r22, r18 2de4c: 73 1f adc r23, r19 2de4e: 84 1f adc r24, r20 2de50: 95 1f adc r25, r21 2de52: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2de56: 0f 94 32 a6 call 0x34c64 ; 0x34c64 max_adv_steps = max_rate * block->adv_comp; 2de5a: f1 01 movw r30, r2 2de5c: ec 5a subi r30, 0xAC ; 172 2de5e: ff 4f sbci r31, 0xFF ; 255 2de60: 20 81 ld r18, Z 2de62: 31 81 ldd r19, Z+1 ; 0x01 2de64: 42 81 ldd r20, Z+2 ; 0x02 2de66: 53 81 ldd r21, Z+3 ; 0x03 2de68: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2de6c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2de70: 46 2f mov r20, r22 2de72: 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; 2de74: 41 2c mov r4, r1 2de76: 51 2c mov r5, r1 2de78: 32 01 movw r6, r4 2de7a: 18 cf rjmp .-464 ; 0x2dcac 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; 2de7c: 6d 85 ldd r22, Y+13 ; 0x0d 2de7e: 7e 85 ldd r23, Y+14 ; 0x0e 2de80: 8f 85 ldd r24, Y+15 ; 0x0f 2de82: 98 89 ldd r25, Y+16 ; 0x10 2de84: c9 88 ldd r12, Y+17 ; 0x11 2de86: da 88 ldd r13, Y+18 ; 0x12 2de88: eb 88 ldd r14, Y+19 ; 0x13 2de8a: fc 88 ldd r15, Y+20 ; 0x14 2de8c: 6c 19 sub r22, r12 2de8e: 7d 09 sbc r23, r13 2de90: 8e 09 sbc r24, r14 2de92: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 2de94: cd 80 ldd r12, Y+5 ; 0x05 2de96: de 80 ldd r13, Y+6 ; 0x06 2de98: ef 80 ldd r14, Y+7 ; 0x07 2de9a: f8 84 ldd r15, Y+8 ; 0x08 2de9c: cd 28 or r12, r13 2de9e: ce 28 or r12, r14 2dea0: cf 28 or r12, r15 2dea2: 41 f0 breq .+16 ; 0x2deb4 decelerate_steps += acceleration_x2; 2dea4: c9 84 ldd r12, Y+9 ; 0x09 2dea6: da 84 ldd r13, Y+10 ; 0x0a 2dea8: eb 84 ldd r14, Y+11 ; 0x0b 2deaa: fc 84 ldd r15, Y+12 ; 0x0c 2deac: 6c 0d add r22, r12 2deae: 7d 1d adc r23, r13 2deb0: 8e 1d adc r24, r14 2deb2: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 2deb4: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 2deb8: 82 0e add r8, r18 2deba: 93 1e adc r9, r19 2debc: a4 1e adc r10, r20 2debe: b5 1e adc r11, r21 2dec0: 49 80 ldd r4, Y+1 ; 0x01 2dec2: 5a 80 ldd r5, Y+2 ; 0x02 2dec4: 6b 80 ldd r6, Y+3 ; 0x03 2dec6: 7c 80 ldd r7, Y+4 ; 0x04 2dec8: 84 14 cp r8, r4 2deca: 95 04 cpc r9, r5 2decc: a6 04 cpc r10, r6 2dece: b7 04 cpc r11, r7 2ded0: 10 f4 brcc .+4 ; 0x2ded6 2ded2: 24 01 movw r4, r8 2ded4: 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; 2ded6: c9 80 ldd r12, Y+1 ; 0x01 2ded8: da 80 ldd r13, Y+2 ; 0x02 2deda: eb 80 ldd r14, Y+3 ; 0x03 2dedc: fc 80 ldd r15, Y+4 ; 0x04 2dede: c4 18 sub r12, r4 2dee0: d5 08 sbc r13, r5 2dee2: e6 08 sbc r14, r6 2dee4: f7 08 sbc r15, r7 2dee6: 93 cf rjmp .-218 ; 0x2de0e // 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; 2dee8: 40 e0 ldi r20, 0x00 ; 0 2deea: 80 e0 ldi r24, 0x00 ; 0 2deec: c3 cf rjmp .-122 ; 0x2de74 #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; 2deee: 4d 89 ldd r20, Y+21 ; 0x15 2def0: 8e 89 ldd r24, Y+22 ; 0x16 2def2: c0 cf rjmp .-128 ; 0x2de74 0002def4 : /// @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) { 2def4: 0f 93 push r16 2def6: 1f 93 push r17 2def8: cf 93 push r28 2defa: df 93 push r29 2defc: eb 01 movw r28, r22 2defe: 14 2f mov r17, r20 2df00: 05 2f mov r16, r21 lcd_putc(chr); 2df02: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_puts_P(str); 2df06: ce 01 movw r24, r28 2df08: 0e 94 e7 69 call 0xd3ce ; 0xd3ce lcd_putc(':'); 2df0c: 8a e3 ldi r24, 0x3A ; 58 2df0e: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 2df12: ce 01 movw r24, r28 2df14: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 2df18: 9e e0 ldi r25, 0x0E ; 14 2df1a: 98 1b sub r25, r24 2df1c: 89 2f mov r24, r25 2df1e: 0e 94 f2 69 call 0xd3e4 ; 0xd3e4 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 2df22: 0f 93 push r16 2df24: 1f 93 push r17 2df26: 84 e9 ldi r24, 0x94 ; 148 2df28: 9e e9 ldi r25, 0x9E ; 158 2df2a: 9f 93 push r25 2df2c: 8f 93 push r24 2df2e: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 2df32: 0f 90 pop r0 2df34: 0f 90 pop r0 2df36: 0f 90 pop r0 2df38: 0f 90 pop r0 } 2df3a: df 91 pop r29 2df3c: cf 91 pop r28 2df3e: 1f 91 pop r17 2df40: 0f 91 pop r16 2df42: 08 95 ret 0002df44 : * \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) { 2df44: 0f 93 push r16 2df46: 1f 93 push r17 2df48: cf 93 push r28 2df4a: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2df4c: fc 01 movw r30, r24 2df4e: 23 81 ldd r18, Z+3 ; 0x03 2df50: 22 23 and r18, r18 2df52: 31 f0 breq .+12 ; 0x2df60 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2df54: 80 e0 ldi r24, 0x00 ; 0 } 2df56: df 91 pop r29 2df58: cf 91 pop r28 2df5a: 1f 91 pop r17 2df5c: 0f 91 pop r16 2df5e: 08 95 ret 2df60: 8b 01 movw r16, r22 2df62: ec 01 movw r28, r24 2df64: fb 01 movw r30, r22 2df66: 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)) { 2df68: 80 31 cpi r24, 0x10 ; 16 2df6a: 39 f5 brne .+78 ; 0x2dfba type_ = FAT_FILE_TYPE_ROOT_FIXED; 2df6c: 82 e0 ldi r24, 0x02 ; 2 2df6e: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2df70: 1d 8a std Y+21, r1 ; 0x15 2df72: 1e 8a std Y+22, r1 ; 0x16 2df74: 1f 8a std Y+23, r1 ; 0x17 2df76: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2df78: 80 8d ldd r24, Z+24 ; 0x18 2df7a: 91 8d ldd r25, Z+25 ; 0x19 2df7c: b0 e0 ldi r27, 0x00 ; 0 2df7e: a0 e0 ldi r26, 0x00 ; 0 2df80: 25 e0 ldi r18, 0x05 ; 5 2df82: 88 0f add r24, r24 2df84: 99 1f adc r25, r25 2df86: aa 1f adc r26, r26 2df88: bb 1f adc r27, r27 2df8a: 2a 95 dec r18 2df8c: d1 f7 brne .-12 ; 0x2df82 2df8e: 89 8b std Y+17, r24 ; 0x11 2df90: 9a 8b std Y+18, r25 ; 0x12 2df92: ab 8b std Y+19, r26 ; 0x13 2df94: 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; 2df96: 1a 8f std Y+26, r17 ; 0x1a 2df98: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2df9a: 81 e0 ldi r24, 0x01 ; 1 2df9c: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2df9e: 1c 82 std Y+4, r1 ; 0x04 2dfa0: 1d 82 std Y+5, r1 ; 0x05 2dfa2: 1e 82 std Y+6, r1 ; 0x06 2dfa4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2dfa6: 18 86 std Y+8, r1 ; 0x08 2dfa8: 19 86 std Y+9, r1 ; 0x09 2dfaa: 1a 86 std Y+10, r1 ; 0x0a 2dfac: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2dfae: 1c 86 std Y+12, r1 ; 0x0c 2dfb0: 1d 86 std Y+13, r1 ; 0x0d 2dfb2: 1e 86 std Y+14, r1 ; 0x0e 2dfb4: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2dfb6: 18 8a std Y+16, r1 ; 0x10 2dfb8: ce cf rjmp .-100 ; 0x2df56 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) { 2dfba: 80 32 cpi r24, 0x20 ; 32 2dfbc: 59 f6 brne .-106 ; 0x2df54 type_ = FAT_FILE_TYPE_ROOT32; 2dfbe: 83 e0 ldi r24, 0x03 ; 3 2dfc0: 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_;} 2dfc2: 42 8d ldd r20, Z+26 ; 0x1a 2dfc4: 53 8d ldd r21, Z+27 ; 0x1b 2dfc6: 64 8d ldd r22, Z+28 ; 0x1c 2dfc8: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2dfca: 4d 8b std Y+21, r20 ; 0x15 2dfcc: 5e 8b std Y+22, r21 ; 0x16 2dfce: 6f 8b std Y+23, r22 ; 0x17 2dfd0: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2dfd2: 9e 01 movw r18, r28 2dfd4: 2f 5e subi r18, 0xEF ; 239 2dfd6: 3f 4f sbci r19, 0xFF ; 255 2dfd8: c8 01 movw r24, r16 2dfda: 0f 94 13 38 call 0x27026 ; 0x27026 2dfde: 81 11 cpse r24, r1 2dfe0: da cf rjmp .-76 ; 0x2df96 2dfe2: b8 cf rjmp .-144 ; 0x2df54 0002dfe4 : * * \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() { 2dfe4: cf 93 push r28 2dfe6: df 93 push r29 2dfe8: ec 01 movw r28, r24 bool rtn = sync(); 2dfea: 0f 94 5e 39 call 0x272bc ; 0x272bc type_ = FAT_FILE_TYPE_CLOSED; 2dfee: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2dff0: df 91 pop r29 2dff2: cf 91 pop r28 2dff4: 08 95 ret 0002dff6 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2dff6: cf 93 push r28 2dff8: df 93 push r29 2dffa: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2dffc: 46 2f mov r20, r22 2dffe: 41 70 andi r20, 0x01 ; 1 2e000: 6c 85 ldd r22, Y+12 ; 0x0c 2e002: 7d 85 ldd r23, Y+13 ; 0x0d 2e004: 8e 85 ldd r24, Y+14 ; 0x0e 2e006: 9f 85 ldd r25, Y+15 ; 0x0f 2e008: 0f 94 c1 36 call 0x26d82 ; 0x26d82 2e00c: 88 23 and r24, r24 2e00e: 51 f0 breq .+20 ; 0x2e024 return vol_->cache()->dir + dirIndex_; 2e010: 88 89 ldd r24, Y+16 ; 0x10 2e012: 20 e2 ldi r18, 0x20 ; 32 2e014: 82 9f mul r24, r18 2e016: c0 01 movw r24, r0 2e018: 11 24 eor r1, r1 2e01a: 87 52 subi r24, 0x27 ; 39 2e01c: 92 4f sbci r25, 0xF2 ; 242 fail: return 0; } 2e01e: df 91 pop r29 2e020: cf 91 pop r28 2e022: 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; 2e024: 90 e0 ldi r25, 0x00 ; 0 2e026: 80 e0 ldi r24, 0x00 ; 0 2e028: fa cf rjmp .-12 ; 0x2e01e 0002e02a : * \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) { 2e02a: cf 93 push r28 2e02c: df 93 push r29 2e02e: eb 01 movw r28, r22 2e030: fc 01 movw r30, r24 2e032: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2e034: 21 11 cpse r18, r1 2e036: 04 c0 rjmp .+8 ; 0x2e040 2e038: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2e03a: df 91 pop r29 2e03c: cf 91 pop r28 2e03e: 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; 2e040: 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()) { 2e042: 22 30 cpi r18, 0x02 ; 2 2e044: 28 f4 brcc .+10 ; 0x2e050 name[0] = '/'; 2e046: 8f e2 ldi r24, 0x2F ; 47 2e048: 88 83 st Y, r24 name[1] = '\0'; 2e04a: 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; 2e04c: 81 e0 ldi r24, 0x01 ; 1 2e04e: f5 cf rjmp .-22 ; 0x2e03a name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2e050: 60 e0 ldi r22, 0x00 ; 0 2e052: 0f 94 fb 6f call 0x2dff6 ; 0x2dff6 if (!p) return false; 2e056: 00 97 sbiw r24, 0x00 ; 0 2e058: 79 f3 breq .-34 ; 0x2e038 2e05a: 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; 2e05c: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2e05e: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2e060: 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; 2e062: 2d 91 ld r18, X+ 2e064: 20 32 cpi r18, 0x20 ; 32 2e066: 99 f0 breq .+38 ; 0x2e08e if (i == 8) name[j++] = '.'; 2e068: 88 30 cpi r24, 0x08 ; 8 2e06a: 31 f4 brne .+12 ; 0x2e078 2e06c: 9e 01 movw r18, r28 2e06e: 26 0f add r18, r22 2e070: 31 1d adc r19, r1 2e072: f9 01 movw r30, r18 2e074: 90 83 st Z, r25 2e076: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2e078: 9e 01 movw r18, r28 2e07a: 26 0f add r18, r22 2e07c: 31 1d adc r19, r1 2e07e: ad 01 movw r20, r26 2e080: 41 50 subi r20, 0x01 ; 1 2e082: 51 09 sbc r21, r1 2e084: fa 01 movw r30, r20 2e086: 40 81 ld r20, Z 2e088: f9 01 movw r30, r18 2e08a: 40 83 st Z, r20 2e08c: 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++) { 2e08e: 8f 5f subi r24, 0xFF ; 255 2e090: 8b 30 cpi r24, 0x0B ; 11 2e092: 39 f7 brne .-50 ; 0x2e062 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2e094: fe 01 movw r30, r28 2e096: e6 0f add r30, r22 2e098: f1 1d adc r31, r1 2e09a: 10 82 st Z, r1 2e09c: d7 cf rjmp .-82 ; 0x2e04c 0002e09e : 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() { 2e09e: 3f 92 push r3 2e0a0: 4f 92 push r4 2e0a2: 5f 92 push r5 2e0a4: 6f 92 push r6 2e0a6: 7f 92 push r7 2e0a8: 8f 92 push r8 2e0aa: 9f 92 push r9 2e0ac: af 92 push r10 2e0ae: bf 92 push r11 2e0b0: cf 92 push r12 2e0b2: df 92 push r13 2e0b4: ef 92 push r14 2e0b6: ff 92 push r15 2e0b8: 0f 93 push r16 2e0ba: 1f 93 push r17 2e0bc: cf 93 push r28 2e0be: df 93 push r29 2e0c0: cd b7 in r28, 0x3d ; 61 2e0c2: de b7 in r29, 0x3e ; 62 2e0c4: 2c 97 sbiw r28, 0x0c ; 12 2e0c6: 0f b6 in r0, 0x3f ; 63 2e0c8: f8 94 cli 2e0ca: de bf out 0x3e, r29 ; 62 2e0cc: 0f be out 0x3f, r0 ; 63 2e0ce: cd bf out 0x3d, r28 ; 61 2e0d0: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2e0d2: dc 01 movw r26, r24 2e0d4: 59 96 adiw r26, 0x19 ; 25 2e0d6: 8d 90 ld r8, X+ 2e0d8: 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; 2e0da: f4 01 movw r30, r8 2e0dc: 81 85 ldd r24, Z+9 ; 0x09 2e0de: 92 85 ldd r25, Z+10 ; 0x0a 2e0e0: a3 85 ldd r26, Z+11 ; 0x0b 2e0e2: b4 85 ldd r27, Z+12 ; 0x0c 2e0e4: 9c 01 movw r18, r24 2e0e6: ad 01 movw r20, r26 2e0e8: 2f 5f subi r18, 0xFF ; 255 2e0ea: 3f 4f sbci r19, 0xFF ; 255 2e0ec: 4f 4f sbci r20, 0xFF ; 255 2e0ee: 5f 4f sbci r21, 0xFF ; 255 2e0f0: 29 87 std Y+9, r18 ; 0x09 2e0f2: 3a 87 std Y+10, r19 ; 0x0a 2e0f4: 4b 87 std Y+11, r20 ; 0x0b 2e0f6: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2e0f8: d5 01 movw r26, r10 2e0fa: 14 96 adiw r26, 0x04 ; 4 2e0fc: 4d 90 ld r4, X+ 2e0fe: 5d 90 ld r5, X+ 2e100: 6d 90 ld r6, X+ 2e102: 7c 90 ld r7, X 2e104: 17 97 sbiw r26, 0x07 ; 7 2e106: 41 14 cp r4, r1 2e108: 51 04 cpc r5, r1 2e10a: 61 04 cpc r6, r1 2e10c: 71 04 cpc r7, r1 2e10e: 09 f4 brne .+2 ; 0x2e112 2e110: 59 c0 rjmp .+178 ; 0x2e1c4 // try to make file contiguous bgnCluster = *curCluster + 1; 2e112: bf ef ldi r27, 0xFF ; 255 2e114: 4b 1a sub r4, r27 2e116: 5b 0a sbc r5, r27 2e118: 6b 0a sbc r6, r27 2e11a: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2e11c: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2e11e: 73 01 movw r14, r6 2e120: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2e122: 1d 82 std Y+5, r1 ; 0x05 2e124: 1e 82 std Y+6, r1 ; 0x06 2e126: 1f 82 std Y+7, r1 ; 0x07 2e128: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2e12a: f4 01 movw r30, r8 2e12c: 81 85 ldd r24, Z+9 ; 0x09 2e12e: 92 85 ldd r25, Z+10 ; 0x0a 2e130: a3 85 ldd r26, Z+11 ; 0x0b 2e132: b4 85 ldd r27, Z+12 ; 0x0c 2e134: 2d 81 ldd r18, Y+5 ; 0x05 2e136: 3e 81 ldd r19, Y+6 ; 0x06 2e138: 4f 81 ldd r20, Y+7 ; 0x07 2e13a: 58 85 ldd r21, Y+8 ; 0x08 2e13c: 28 17 cp r18, r24 2e13e: 39 07 cpc r19, r25 2e140: 4a 07 cpc r20, r26 2e142: 5b 07 cpc r21, r27 2e144: 08 f0 brcs .+2 ; 0x2e148 2e146: 56 c0 rjmp .+172 ; 0x2e1f4 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2e148: 89 85 ldd r24, Y+9 ; 0x09 2e14a: 9a 85 ldd r25, Y+10 ; 0x0a 2e14c: ab 85 ldd r26, Y+11 ; 0x0b 2e14e: bc 85 ldd r27, Y+12 ; 0x0c 2e150: 8c 15 cp r24, r12 2e152: 9d 05 cpc r25, r13 2e154: ae 05 cpc r26, r14 2e156: bf 05 cpc r27, r15 2e158: 50 f4 brcc .+20 ; 0x2e16e bgnCluster = endCluster = 2; 2e15a: 82 e0 ldi r24, 0x02 ; 2 2e15c: c8 2e mov r12, r24 2e15e: d1 2c mov r13, r1 2e160: e1 2c mov r14, r1 2e162: f1 2c mov r15, r1 2e164: 92 e0 ldi r25, 0x02 ; 2 2e166: 49 2e mov r4, r25 2e168: 51 2c mov r5, r1 2e16a: 61 2c mov r6, r1 2e16c: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2e16e: 9e 01 movw r18, r28 2e170: 2f 5f subi r18, 0xFF ; 255 2e172: 3f 4f sbci r19, 0xFF ; 255 2e174: b7 01 movw r22, r14 2e176: a6 01 movw r20, r12 2e178: c4 01 movw r24, r8 2e17a: 0f 94 90 37 call 0x26f20 ; 0x26f20 2e17e: 88 23 and r24, r24 2e180: c9 f1 breq .+114 ; 0x2e1f4 if (f != 0) { 2e182: 89 81 ldd r24, Y+1 ; 0x01 2e184: 9a 81 ldd r25, Y+2 ; 0x02 2e186: ab 81 ldd r26, Y+3 ; 0x03 2e188: bc 81 ldd r27, Y+4 ; 0x04 2e18a: 89 2b or r24, r25 2e18c: 8a 2b or r24, r26 2e18e: 8b 2b or r24, r27 2e190: 01 f1 breq .+64 ; 0x2e1d2 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2e192: 26 01 movw r4, r12 2e194: 37 01 movw r6, r14 2e196: 9f ef ldi r25, 0xFF ; 255 2e198: 49 1a sub r4, r25 2e19a: 59 0a sbc r5, r25 2e19c: 69 0a sbc r6, r25 2e19e: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2e1a0: 2d 81 ldd r18, Y+5 ; 0x05 2e1a2: 3e 81 ldd r19, Y+6 ; 0x06 2e1a4: 4f 81 ldd r20, Y+7 ; 0x07 2e1a6: 58 85 ldd r21, Y+8 ; 0x08 2e1a8: 2f 5f subi r18, 0xFF ; 255 2e1aa: 3f 4f sbci r19, 0xFF ; 255 2e1ac: 4f 4f sbci r20, 0xFF ; 255 2e1ae: 5f 4f sbci r21, 0xFF ; 255 2e1b0: 2d 83 std Y+5, r18 ; 0x05 2e1b2: 3e 83 std Y+6, r19 ; 0x06 2e1b4: 4f 83 std Y+7, r20 ; 0x07 2e1b6: 58 87 std Y+8, r21 ; 0x08 2e1b8: 3f ef ldi r19, 0xFF ; 255 2e1ba: c3 1a sub r12, r19 2e1bc: d3 0a sbc r13, r19 2e1be: e3 0a sbc r14, r19 2e1c0: f3 0a sbc r15, r19 2e1c2: b3 cf rjmp .-154 ; 0x2e12a // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2e1c4: 40 80 ld r4, Z 2e1c6: 51 80 ldd r5, Z+1 ; 0x01 2e1c8: 62 80 ldd r6, Z+2 ; 0x02 2e1ca: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2e1cc: 33 24 eor r3, r3 2e1ce: 33 94 inc r3 2e1d0: a6 cf rjmp .-180 ; 0x2e11e 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) { 2e1d2: c4 14 cp r12, r4 2e1d4: d5 04 cpc r13, r5 2e1d6: e6 04 cpc r14, r6 2e1d8: f7 04 cpc r15, r7 2e1da: 11 f7 brne .-60 ; 0x2e1a0 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); 2e1dc: 0f ef ldi r16, 0xFF ; 255 2e1de: 1f ef ldi r17, 0xFF ; 255 2e1e0: 2f ef ldi r18, 0xFF ; 255 2e1e2: 3f e0 ldi r19, 0x0F ; 15 2e1e4: b7 01 movw r22, r14 2e1e6: a6 01 movw r20, r12 2e1e8: c4 01 movw r24, r8 2e1ea: 0f 94 fe 36 call 0x26dfc ; 0x26dfc 2e1ee: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2e1f0: 81 11 cpse r24, r1 2e1f2: 1a c0 rjmp .+52 ; 0x2e228 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2e1f4: 71 2c mov r7, r1 } 2e1f6: 87 2d mov r24, r7 2e1f8: 2c 96 adiw r28, 0x0c ; 12 2e1fa: 0f b6 in r0, 0x3f ; 63 2e1fc: f8 94 cli 2e1fe: de bf out 0x3e, r29 ; 62 2e200: 0f be out 0x3f, r0 ; 63 2e202: cd bf out 0x3d, r28 ; 61 2e204: df 91 pop r29 2e206: cf 91 pop r28 2e208: 1f 91 pop r17 2e20a: 0f 91 pop r16 2e20c: ff 90 pop r15 2e20e: ef 90 pop r14 2e210: df 90 pop r13 2e212: cf 90 pop r12 2e214: bf 90 pop r11 2e216: af 90 pop r10 2e218: 9f 90 pop r9 2e21a: 8f 90 pop r8 2e21c: 7f 90 pop r7 2e21e: 6f 90 pop r6 2e220: 5f 90 pop r5 2e222: 4f 90 pop r4 2e224: 3f 90 pop r3 2e226: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2e228: f5 01 movw r30, r10 2e22a: 44 81 ldd r20, Z+4 ; 0x04 2e22c: 55 81 ldd r21, Z+5 ; 0x05 2e22e: 66 81 ldd r22, Z+6 ; 0x06 2e230: 77 81 ldd r23, Z+7 ; 0x07 2e232: 41 15 cp r20, r1 2e234: 51 05 cpc r21, r1 2e236: 61 05 cpc r22, r1 2e238: 71 05 cpc r23, r1 2e23a: 39 f0 breq .+14 ; 0x2e24a // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2e23c: 97 01 movw r18, r14 2e23e: 86 01 movw r16, r12 2e240: c4 01 movw r24, r8 2e242: 0f 94 fe 36 call 0x26dfc ; 0x26dfc 2e246: 88 23 and r24, r24 2e248: a9 f2 breq .-86 ; 0x2e1f4 } // return first cluster number to caller *curCluster = bgnCluster; 2e24a: d5 01 movw r26, r10 2e24c: 14 96 adiw r26, 0x04 ; 4 2e24e: cd 92 st X+, r12 2e250: dd 92 st X+, r13 2e252: ed 92 st X+, r14 2e254: fc 92 st X, r15 2e256: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2e258: 33 20 and r3, r3 2e25a: 51 f0 breq .+20 ; 0x2e270 2e25c: d7 01 movw r26, r14 2e25e: c6 01 movw r24, r12 2e260: 01 96 adiw r24, 0x01 ; 1 2e262: a1 1d adc r26, r1 2e264: b1 1d adc r27, r1 2e266: f4 01 movw r30, r8 2e268: 80 83 st Z, r24 2e26a: 91 83 std Z+1, r25 ; 0x01 2e26c: a2 83 std Z+2, r26 ; 0x02 2e26e: 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) { 2e270: f5 01 movw r30, r10 2e272: 85 89 ldd r24, Z+21 ; 0x15 2e274: 96 89 ldd r25, Z+22 ; 0x16 2e276: a7 89 ldd r26, Z+23 ; 0x17 2e278: b0 8d ldd r27, Z+24 ; 0x18 2e27a: 89 2b or r24, r25 2e27c: 8a 2b or r24, r26 2e27e: 8b 2b or r24, r27 2e280: 09 f0 breq .+2 ; 0x2e284 2e282: b9 cf rjmp .-142 ; 0x2e1f6 firstCluster_ = curCluster_; 2e284: c5 8a std Z+21, r12 ; 0x15 2e286: d6 8a std Z+22, r13 ; 0x16 2e288: e7 8a std Z+23, r14 ; 0x17 2e28a: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2e28c: 81 81 ldd r24, Z+1 ; 0x01 2e28e: 80 68 ori r24, 0x80 ; 128 2e290: 81 83 std Z+1, r24 ; 0x01 2e292: b1 cf rjmp .-158 ; 0x2e1f6 0002e294 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2e294: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e296: 0d b4 in r0, 0x2d ; 45 2e298: 07 fe sbrs r0, 7 2e29a: fd cf rjmp .-6 ; 0x2e296 } 2e29c: 08 95 ret 0002e29e : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2e29e: 8f ef ldi r24, 0xFF ; 255 2e2a0: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e2a2: 0d b4 in r0, 0x2d ; 45 2e2a4: 07 fe sbrs r0, 7 2e2a6: fd cf rjmp .-6 ; 0x2e2a2 return SPDR; 2e2a8: 8e b5 in r24, 0x2e ; 46 } 2e2aa: 08 95 ret 0002e2ac : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2e2ac: 8f 92 push r8 2e2ae: 9f 92 push r9 2e2b0: af 92 push r10 2e2b2: bf 92 push r11 2e2b4: ef 92 push r14 2e2b6: ff 92 push r15 2e2b8: 0f 93 push r16 2e2ba: 1f 93 push r17 2e2bc: cf 93 push r28 2e2be: 7c 01 movw r14, r24 2e2c0: c6 2f mov r28, r22 2e2c2: 49 01 movw r8, r18 2e2c4: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2e2c6: fc 01 movw r30, r24 2e2c8: 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); 2e2ca: 89 2f mov r24, r25 2e2cc: 80 6a ori r24, 0xA0 ; 160 2e2ce: 86 95 lsr r24 2e2d0: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e2d2: 90 fd sbrc r25, 0 2e2d4: 03 c0 rjmp .+6 ; 0x2e2dc 2e2d6: 81 e0 ldi r24, 0x01 ; 1 2e2d8: 96 30 cpi r25, 0x06 ; 6 2e2da: 09 f4 brne .+2 ; 0x2e2de 2e2dc: 80 e0 ldi r24, 0x00 ; 0 2e2de: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2e2e0: 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); 2e2e2: 8c e2 ldi r24, 0x2C ; 44 2e2e4: 91 e0 ldi r25, 0x01 ; 1 2e2e6: 0f 94 1f 42 call 0x2843e ; 0x2843e // send command spiSend(cmd | 0x40); 2e2ea: 8c 2f mov r24, r28 2e2ec: 80 64 ori r24, 0x40 ; 64 2e2ee: 0f 94 4a 71 call 0x2e294 ; 0x2e294 2e2f2: 08 e1 ldi r16, 0x18 ; 24 2e2f4: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2e2f6: d5 01 movw r26, r10 2e2f8: c4 01 movw r24, r8 2e2fa: 00 2e mov r0, r16 2e2fc: 04 c0 rjmp .+8 ; 0x2e306 2e2fe: b6 95 lsr r27 2e300: a7 95 ror r26 2e302: 97 95 ror r25 2e304: 87 95 ror r24 2e306: 0a 94 dec r0 2e308: d2 f7 brpl .-12 ; 0x2e2fe 2e30a: 0f 94 4a 71 call 0x2e294 ; 0x2e294 2e30e: 08 50 subi r16, 0x08 ; 8 2e310: 11 09 sbc r17, r1 2e312: 08 3f cpi r16, 0xF8 ; 248 2e314: ff ef ldi r31, 0xFF ; 255 2e316: 1f 07 cpc r17, r31 2e318: 71 f7 brne .-36 ; 0x2e2f6 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2e31a: 85 e9 ldi r24, 0x95 ; 149 2e31c: cc 23 and r28, r28 2e31e: 21 f0 breq .+8 ; 0x2e328 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2e320: 87 e8 ldi r24, 0x87 ; 135 2e322: c8 30 cpi r28, 0x08 ; 8 2e324: 09 f0 breq .+2 ; 0x2e328 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e326: 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); 2e328: 0f 94 4a 71 call 0x2e294 ; 0x2e294 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2e32c: cc 30 cpi r28, 0x0C ; 12 2e32e: 11 f4 brne .+4 ; 0x2e334 2e330: 0f 94 4f 71 call 0x2e29e ; 0x2e29e // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e334: 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 */ } 2e336: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e33a: f7 01 movw r30, r14 2e33c: 82 83 std Z+2, r24 ; 0x02 2e33e: 87 ff sbrs r24, 7 2e340: 04 c0 rjmp .+8 ; 0x2e34a 2e342: cf 3f cpi r28, 0xFF ; 255 2e344: 11 f0 breq .+4 ; 0x2e34a 2e346: cf 5f subi r28, 0xFF ; 255 2e348: f6 cf rjmp .-20 ; 0x2e336 return status_; } 2e34a: cf 91 pop r28 2e34c: 1f 91 pop r17 2e34e: 0f 91 pop r16 2e350: ff 90 pop r15 2e352: ef 90 pop r14 2e354: bf 90 pop r11 2e356: af 90 pop r10 2e358: 9f 90 pop r9 2e35a: 8f 90 pop r8 2e35c: 08 95 ret 0002e35e : * \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) { 2e35e: 0f 93 push r16 2e360: 1f 93 push r17 2e362: cf 93 push r28 2e364: df 93 push r29 2e366: ec 01 movw r28, r24 2e368: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2e36a: 8b 81 ldd r24, Y+3 ; 0x03 2e36c: 83 30 cpi r24, 0x03 ; 3 2e36e: 39 f0 breq .+14 ; 0x2e37e 2e370: 89 e0 ldi r24, 0x09 ; 9 2e372: 44 0f add r20, r20 2e374: 55 1f adc r21, r21 2e376: 66 1f adc r22, r22 2e378: 77 1f adc r23, r23 2e37a: 8a 95 dec r24 2e37c: d1 f7 brne .-12 ; 0x2e372 if (cardCommand(CMD24, blockNumber)) { 2e37e: 9a 01 movw r18, r20 2e380: ab 01 movw r20, r22 2e382: 68 e1 ldi r22, 0x18 ; 24 2e384: ce 01 movw r24, r28 2e386: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 2e38a: 88 23 and r24, r24 2e38c: 19 f0 breq .+6 ; 0x2e394 2e38e: 86 e0 ldi r24, 0x06 ; 6 2e390: 88 83 st Y, r24 2e392: 39 c0 rjmp .+114 ; 0x2e406 } //------------------------------------------------------------------------------ /** 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; 2e394: 8e ef ldi r24, 0xFE ; 254 2e396: 8e bd out 0x2e, r24 ; 46 2e398: f8 01 movw r30, r16 2e39a: c8 01 movw r24, r16 2e39c: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e39e: 0d b4 in r0, 0x2d ; 45 2e3a0: 07 fe sbrs r0, 7 2e3a2: fd cf rjmp .-6 ; 0x2e39e SPDR = buf[i]; 2e3a4: 20 81 ld r18, Z 2e3a6: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e3a8: 0d b4 in r0, 0x2d ; 45 2e3aa: 07 fe sbrs r0, 7 2e3ac: fd cf rjmp .-6 ; 0x2e3a8 SPDR = buf[i + 1]; 2e3ae: 21 81 ldd r18, Z+1 ; 0x01 2e3b0: 2e bd out 0x2e, r18 ; 46 2e3b2: 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) { 2e3b4: e8 17 cp r30, r24 2e3b6: f9 07 cpc r31, r25 2e3b8: 91 f7 brne .-28 ; 0x2e39e 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 */ } 2e3ba: 0d b4 in r0, 0x2d ; 45 2e3bc: 07 fe sbrs r0, 7 2e3be: fd cf rjmp .-6 ; 0x2e3ba //------------------------------------------------------------------------------ // 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 2e3c0: 8f ef ldi r24, 0xFF ; 255 2e3c2: 0f 94 4a 71 call 0x2e294 ; 0x2e294 spiSend(0xff); // dummy crc 2e3c6: 8f ef ldi r24, 0xFF ; 255 2e3c8: 0f 94 4a 71 call 0x2e294 ; 0x2e294 status_ = spiRec(); 2e3cc: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e3d0: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2e3d2: 8f 71 andi r24, 0x1F ; 31 2e3d4: 85 30 cpi r24, 0x05 ; 5 2e3d6: 99 f4 brne .+38 ; 0x2e3fe goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2e3d8: 88 e5 ldi r24, 0x58 ; 88 2e3da: 92 e0 ldi r25, 0x02 ; 2 2e3dc: 0f 94 1f 42 call 0x2843e ; 0x2843e 2e3e0: 18 2f mov r17, r24 2e3e2: 87 e1 ldi r24, 0x17 ; 23 2e3e4: 11 23 and r17, r17 2e3e6: a1 f2 breq .-88 ; 0x2e390 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2e3e8: 20 e0 ldi r18, 0x00 ; 0 2e3ea: 30 e0 ldi r19, 0x00 ; 0 2e3ec: a9 01 movw r20, r18 2e3ee: 6d e0 ldi r22, 0x0D ; 13 2e3f0: ce 01 movw r24, r28 2e3f2: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 2e3f6: 88 23 and r24, r24 2e3f8: 51 f0 breq .+20 ; 0x2e40e 2e3fa: 86 e1 ldi r24, 0x16 ; 22 2e3fc: c9 cf rjmp .-110 ; 0x2e390 2e3fe: 83 e1 ldi r24, 0x13 ; 19 2e400: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2e402: 0f 94 1d 42 call 0x2843a ; 0x2843a } chipSelectHigh(); return true; fail: chipSelectHigh(); 2e406: 0f 94 1d 42 call 0x2843a ; 0x2843a return false; 2e40a: 10 e0 ldi r17, 0x00 ; 0 2e40c: 06 c0 rjmp .+12 ; 0x2e41a 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()) { 2e40e: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e412: 81 11 cpse r24, r1 2e414: f2 cf rjmp .-28 ; 0x2e3fa error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2e416: 0f 94 1d 42 call 0x2843a ; 0x2843a return true; fail: chipSelectHigh(); return false; } 2e41a: 81 2f mov r24, r17 2e41c: df 91 pop r29 2e41e: cf 91 pop r28 2e420: 1f 91 pop r17 2e422: 0f 91 pop r16 2e424: 08 95 ret 0002e426 : * \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) { 2e426: 2f 92 push r2 2e428: 3f 92 push r3 2e42a: 4f 92 push r4 2e42c: 5f 92 push r5 2e42e: 6f 92 push r6 2e430: 7f 92 push r7 2e432: 8f 92 push r8 2e434: 9f 92 push r9 2e436: af 92 push r10 2e438: bf 92 push r11 2e43a: cf 92 push r12 2e43c: df 92 push r13 2e43e: ef 92 push r14 2e440: ff 92 push r15 2e442: 0f 93 push r16 2e444: 1f 93 push r17 2e446: cf 93 push r28 2e448: df 93 push r29 2e44a: ec 01 movw r28, r24 2e44c: 2a 01 movw r4, r20 2e44e: 3b 01 movw r6, r22 2e450: 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; 2e452: 8b 81 ldd r24, Y+3 ; 0x03 2e454: 83 30 cpi r24, 0x03 ; 3 2e456: 39 f0 breq .+14 ; 0x2e466 2e458: 69 e0 ldi r22, 0x09 ; 9 2e45a: 44 0c add r4, r4 2e45c: 55 1c adc r5, r5 2e45e: 66 1c adc r6, r6 2e460: 77 1c adc r7, r7 2e462: 6a 95 dec r22 2e464: d1 f7 brne .-12 ; 0x2e45a retry2: 2e466: 43 e0 ldi r20, 0x03 ; 3 2e468: 94 2e mov r9, r20 2e46a: 56 01 movw r10, r12 2e46c: 81 e0 ldi r24, 0x01 ; 1 2e46e: a8 1a sub r10, r24 2e470: 8e ef ldi r24, 0xFE ; 254 2e472: b8 0a sbc r11, r24 2e474: 16 01 movw r2, r12 2e476: ee ef ldi r30, 0xFE ; 254 2e478: 3e 1a sub r3, r30 2e47a: 54 e0 ldi r21, 0x04 ; 4 2e47c: 85 2e mov r8, r21 retryCnt --; 2e47e: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2e480: a3 01 movw r20, r6 2e482: 92 01 movw r18, r4 2e484: 61 e1 ldi r22, 0x11 ; 17 2e486: ce 01 movw r24, r28 2e488: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 2e48c: 88 23 and r24, r24 2e48e: 79 f0 breq .+30 ; 0x2e4ae 2e490: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2e492: 99 20 and r9, r9 2e494: 09 f4 brne .+2 ; 0x2e498 2e496: 7a c0 rjmp .+244 ; 0x2e58c if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2e498: 0f 94 1d 42 call 0x2843a ; 0x2843a cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2e49c: 20 e0 ldi r18, 0x00 ; 0 2e49e: 30 e0 ldi r19, 0x00 ; 0 2e4a0: a9 01 movw r20, r18 2e4a2: 6c e0 ldi r22, 0x0C ; 12 2e4a4: ce 01 movw r24, r28 2e4a6: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac errorCode_ = 0; 2e4aa: 18 82 st Y, r1 2e4ac: e8 cf rjmp .-48 ; 0x2e47e #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2e4ae: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2e4b2: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2e4b4: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e4b8: 8a 83 std Y+2, r24 ; 0x02 2e4ba: 8f 3f cpi r24, 0xFF ; 255 2e4bc: 91 f4 brne .+36 ; 0x2e4e2 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2e4be: 0f 94 ce 0f call 0x21f9c ; 0x21f9c 2e4c2: 60 1b sub r22, r16 2e4c4: 71 0b sbc r23, r17 2e4c6: 6d 32 cpi r22, 0x2D ; 45 2e4c8: 71 40 sbci r23, 0x01 ; 1 2e4ca: a0 f3 brcs .-24 ; 0x2e4b4 2e4cc: 81 e1 ldi r24, 0x11 ; 17 2e4ce: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2e4d0: 0f 94 1d 42 call 0x2843a ; 0x2843a // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e4d4: 8c 81 ldd r24, Y+4 ; 0x04 2e4d6: 88 23 and r24, r24 2e4d8: e1 f2 breq .-72 ; 0x2e492 spiSend(0XFF); 2e4da: 8f ef ldi r24, 0xFF ; 255 2e4dc: 0f 94 4a 71 call 0x2e294 ; 0x2e294 2e4e0: d8 cf rjmp .-80 ; 0x2e492 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2e4e2: 8e 3f cpi r24, 0xFE ; 254 2e4e4: 11 f0 breq .+4 ; 0x2e4ea 2e4e6: 8f e0 ldi r24, 0x0F ; 15 2e4e8: f2 cf rjmp .-28 ; 0x2e4ce //------------------------------------------------------------------------------ /** 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; 2e4ea: 8f ef ldi r24, 0xFF ; 255 2e4ec: 8e bd out 0x2e, r24 ; 46 2e4ee: d6 01 movw r26, r12 2e4f0: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e4f2: 0d b4 in r0, 0x2d ; 45 2e4f4: 07 fe sbrs r0, 7 2e4f6: fd cf rjmp .-6 ; 0x2e4f2 buf[i] = SPDR; 2e4f8: 9e b5 in r25, 0x2e ; 46 2e4fa: 91 93 st Z+, r25 SPDR = 0XFF; 2e4fc: 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++) { 2e4fe: ea 15 cp r30, r10 2e500: fb 05 cpc r31, r11 2e502: b9 f7 brne .-18 ; 0x2e4f2 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e504: 0d b4 in r0, 0x2d ; 45 2e506: 07 fe sbrs r0, 7 2e508: fd cf rjmp .-6 ; 0x2e504 buf[nbyte] = SPDR; 2e50a: 8e b5 in r24, 0x2e ; 46 2e50c: f5 01 movw r30, r10 2e50e: 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; 2e510: f1 2c mov r15, r1 2e512: 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); 2e514: 8d 91 ld r24, X+ 2e516: ef 2d mov r30, r15 2e518: ff 27 eor r31, r31 2e51a: e8 27 eor r30, r24 2e51c: ee 0f add r30, r30 2e51e: ff 1f adc r31, r31 2e520: e8 58 subi r30, 0x88 ; 136 2e522: ff 45 sbci r31, 0x5F ; 95 2e524: 85 91 lpm r24, Z+ 2e526: 94 91 lpm r25, Z 2e528: fe 2c mov r15, r14 2e52a: ee 24 eor r14, r14 2e52c: e8 26 eor r14, r24 2e52e: 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++) { 2e530: 2a 16 cp r2, r26 2e532: 3b 06 cpc r3, r27 2e534: 79 f7 brne .-34 ; 0x2e514 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2e536: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e53a: 08 2f mov r16, r24 2e53c: 10 e0 ldi r17, 0x00 ; 0 2e53e: 10 2f mov r17, r16 2e540: 00 27 eor r16, r16 recvCrc |= spiRec(); 2e542: 0f 94 4f 71 call 0x2e29e ; 0x2e29e 2e546: 08 2b or r16, r24 if (calcCrc != recvCrc) 2e548: 0e 15 cp r16, r14 2e54a: 1f 05 cpc r17, r15 2e54c: 19 f0 breq .+6 ; 0x2e554 2e54e: f0 e2 ldi r31, 0x20 ; 32 2e550: f8 83 st Y, r31 2e552: be cf rjmp .-132 ; 0x2e4d0 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2e554: 0f 94 1d 42 call 0x2843a ; 0x2843a // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e558: cc 81 ldd r28, Y+4 ; 0x04 2e55a: cc 23 and r28, r28 2e55c: d9 f0 breq .+54 ; 0x2e594 spiSend(0XFF); 2e55e: 8f ef ldi r24, 0xFF ; 255 2e560: 0f 94 4a 71 call 0x2e294 ; 0x2e294 #endif fail: chipSelectHigh(); return false; } 2e564: 8c 2f mov r24, r28 2e566: df 91 pop r29 2e568: cf 91 pop r28 2e56a: 1f 91 pop r17 2e56c: 0f 91 pop r16 2e56e: ff 90 pop r15 2e570: ef 90 pop r14 2e572: df 90 pop r13 2e574: cf 90 pop r12 2e576: bf 90 pop r11 2e578: af 90 pop r10 2e57a: 9f 90 pop r9 2e57c: 8f 90 pop r8 2e57e: 7f 90 pop r7 2e580: 6f 90 pop r6 2e582: 5f 90 pop r5 2e584: 4f 90 pop r4 2e586: 3f 90 pop r3 2e588: 2f 90 pop r2 2e58a: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2e58c: 0f 94 1d 42 call 0x2843a ; 0x2843a return false; 2e590: c0 e0 ldi r28, 0x00 ; 0 2e592: e8 cf rjmp .-48 ; 0x2e564 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2e594: c1 e0 ldi r28, 0x01 ; 1 2e596: e6 cf rjmp .-52 ; 0x2e564 0002e598 : * 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) { 2e598: 2f 92 push r2 2e59a: 3f 92 push r3 2e59c: 4f 92 push r4 2e59e: 5f 92 push r5 2e5a0: 6f 92 push r6 2e5a2: 7f 92 push r7 2e5a4: 8f 92 push r8 2e5a6: 9f 92 push r9 2e5a8: af 92 push r10 2e5aa: bf 92 push r11 2e5ac: cf 92 push r12 2e5ae: df 92 push r13 2e5b0: ef 92 push r14 2e5b2: ff 92 push r15 2e5b4: 0f 93 push r16 2e5b6: 1f 93 push r17 2e5b8: cf 93 push r28 2e5ba: df 93 push r29 2e5bc: 00 d0 rcall .+0 ; 0x2e5be 2e5be: 1f 92 push r1 2e5c0: cd b7 in r28, 0x3d ; 61 2e5c2: de b7 in r29, 0x3e ; 62 2e5c4: 9c 83 std Y+4, r25 ; 0x04 2e5c6: 8b 83 std Y+3, r24 ; 0x03 2e5c8: 4b 01 movw r8, r22 2e5ca: 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; 2e5cc: dc 01 movw r26, r24 2e5ce: 13 96 adiw r26, 0x03 ; 3 2e5d0: 8c 91 ld r24, X 2e5d2: 81 11 cpse r24, r1 2e5d4: 19 c0 rjmp .+50 ; 0x2e608 toRead -= n; } return nbyte; fail: return -1; 2e5d6: 8f ef ldi r24, 0xFF ; 255 2e5d8: 9f ef ldi r25, 0xFF ; 255 } 2e5da: 0f 90 pop r0 2e5dc: 0f 90 pop r0 2e5de: 0f 90 pop r0 2e5e0: 0f 90 pop r0 2e5e2: df 91 pop r29 2e5e4: cf 91 pop r28 2e5e6: 1f 91 pop r17 2e5e8: 0f 91 pop r16 2e5ea: ff 90 pop r15 2e5ec: ef 90 pop r14 2e5ee: df 90 pop r13 2e5f0: cf 90 pop r12 2e5f2: bf 90 pop r11 2e5f4: af 90 pop r10 2e5f6: 9f 90 pop r9 2e5f8: 8f 90 pop r8 2e5fa: 7f 90 pop r7 2e5fc: 6f 90 pop r6 2e5fe: 5f 90 pop r5 2e600: 4f 90 pop r4 2e602: 3f 90 pop r3 2e604: 2f 90 pop r2 2e606: 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; 2e608: eb 81 ldd r30, Y+3 ; 0x03 2e60a: fc 81 ldd r31, Y+4 ; 0x04 2e60c: 81 81 ldd r24, Z+1 ; 0x01 2e60e: 80 ff sbrs r24, 0 2e610: e2 cf rjmp .-60 ; 0x2e5d6 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2e612: 01 89 ldd r16, Z+17 ; 0x11 2e614: 12 89 ldd r17, Z+18 ; 0x12 2e616: 23 89 ldd r18, Z+19 ; 0x13 2e618: 34 89 ldd r19, Z+20 ; 0x14 2e61a: 40 85 ldd r20, Z+8 ; 0x08 2e61c: 51 85 ldd r21, Z+9 ; 0x09 2e61e: 62 85 ldd r22, Z+10 ; 0x0a 2e620: 73 85 ldd r23, Z+11 ; 0x0b 2e622: c7 01 movw r24, r14 2e624: b0 e0 ldi r27, 0x00 ; 0 2e626: a0 e0 ldi r26, 0x00 ; 0 2e628: 28 01 movw r4, r16 2e62a: 39 01 movw r6, r18 2e62c: 44 1a sub r4, r20 2e62e: 55 0a sbc r5, r21 2e630: 66 0a sbc r6, r22 2e632: 77 0a sbc r7, r23 2e634: 84 15 cp r24, r4 2e636: 95 05 cpc r25, r5 2e638: a6 05 cpc r26, r6 2e63a: b7 05 cpc r27, r7 2e63c: 18 f0 brcs .+6 ; 0x2e644 nbyte = fileSize_ - curPosition_; 2e63e: 78 01 movw r14, r16 2e640: e4 1a sub r14, r20 2e642: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2e644: 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; 2e646: 8b 81 ldd r24, Y+3 ; 0x03 2e648: 9c 81 ldd r25, Y+4 ; 0x04 2e64a: 04 96 adiw r24, 0x04 ; 4 2e64c: 9a 83 std Y+2, r25 ; 0x02 2e64e: 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; 2e650: 61 2c mov r6, r1 2e652: 32 e0 ldi r19, 0x02 ; 2 2e654: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2e656: c1 14 cp r12, r1 2e658: d1 04 cpc r13, r1 2e65a: 09 f4 brne .+2 ; 0x2e65e 2e65c: b7 c0 rjmp .+366 ; 0x2e7cc offset = curPosition_ & 0X1FF; // offset in block 2e65e: ab 81 ldd r26, Y+3 ; 0x03 2e660: bc 81 ldd r27, Y+4 ; 0x04 2e662: 18 96 adiw r26, 0x08 ; 8 2e664: 4d 91 ld r20, X+ 2e666: 5d 91 ld r21, X+ 2e668: 6d 91 ld r22, X+ 2e66a: 7c 91 ld r23, X 2e66c: 1b 97 sbiw r26, 0x0b ; 11 2e66e: 5a 01 movw r10, r20 2e670: b1 e0 ldi r27, 0x01 ; 1 2e672: bb 22 and r11, r27 2e674: eb 81 ldd r30, Y+3 ; 0x03 2e676: fc 81 ldd r31, Y+4 ; 0x04 2e678: 81 8d ldd r24, Z+25 ; 0x19 2e67a: 92 8d ldd r25, Z+26 ; 0x1a 2e67c: 1a 01 movw r2, r20 2e67e: 2b 01 movw r4, r22 2e680: 29 e0 ldi r18, 0x09 ; 9 2e682: 56 94 lsr r5 2e684: 47 94 ror r4 2e686: 37 94 ror r3 2e688: 27 94 ror r2 2e68a: 2a 95 dec r18 2e68c: d1 f7 brne .-12 ; 0x2e682 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2e68e: 23 81 ldd r18, Z+3 ; 0x03 2e690: 22 30 cpi r18, 0x02 ; 2 2e692: 91 f5 brne .+100 ; 0x2e6f8 block = vol_->rootDirStart() + (curPosition_ >> 9); 2e694: dc 01 movw r26, r24 2e696: 5a 96 adiw r26, 0x1a ; 26 2e698: 6d 91 ld r22, X+ 2e69a: 7d 91 ld r23, X+ 2e69c: 8d 91 ld r24, X+ 2e69e: 9c 91 ld r25, X 2e6a0: 5d 97 sbiw r26, 0x1d ; 29 2e6a2: 62 0d add r22, r2 2e6a4: 73 1d adc r23, r3 2e6a6: 84 1d adc r24, r4 2e6a8: 95 1d adc r25, r5 2e6aa: 83 01 movw r16, r6 2e6ac: 0a 19 sub r16, r10 2e6ae: 1b 09 sbc r17, r11 2e6b0: c0 16 cp r12, r16 2e6b2: d1 06 cpc r13, r17 2e6b4: 08 f4 brcc .+2 ; 0x2e6b8 2e6b6: 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()) { 2e6b8: 01 15 cp r16, r1 2e6ba: b2 e0 ldi r27, 0x02 ; 2 2e6bc: 1b 07 cpc r17, r27 2e6be: 71 f4 brne .+28 ; 0x2e6dc 2e6c0: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 2e6c4: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 2e6c8: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 2e6cc: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 2e6d0: 62 17 cp r22, r18 2e6d2: 73 07 cpc r23, r19 2e6d4: 84 07 cpc r24, r20 2e6d6: 95 07 cpc r25, r21 2e6d8: 09 f0 breq .+2 ; 0x2e6dc 2e6da: 59 c0 rjmp .+178 ; 0x2e78e 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; 2e6dc: 40 e0 ldi r20, 0x00 ; 0 2e6de: 0f 94 c1 36 call 0x26d82 ; 0x26d82 2e6e2: 88 23 and r24, r24 2e6e4: 09 f4 brne .+2 ; 0x2e6e8 2e6e6: 77 cf rjmp .-274 ; 0x2e5d6 uint8_t* src = vol_->cache()->data + offset; 2e6e8: b5 01 movw r22, r10 2e6ea: 67 52 subi r22, 0x27 ; 39 2e6ec: 72 4f sbci r23, 0xF2 ; 242 memcpy(dst, src, n); 2e6ee: a8 01 movw r20, r16 2e6f0: c4 01 movw r24, r8 2e6f2: 0f 94 65 a7 call 0x34eca ; 0x34eca 2e6f6: 57 c0 rjmp .+174 ; 0x2e7a6 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);} 2e6f8: fc 01 movw r30, r24 2e6fa: 14 81 ldd r17, Z+4 ; 0x04 2e6fc: 11 50 subi r17, 0x01 ; 1 2e6fe: 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) { 2e700: a1 14 cp r10, r1 2e702: b1 04 cpc r11, r1 2e704: 81 f4 brne .+32 ; 0x2e726 2e706: 11 11 cpse r17, r1 2e708: 0e c0 rjmp .+28 ; 0x2e726 // start of new cluster if (curPosition_ == 0) { 2e70a: 45 2b or r20, r21 2e70c: 46 2b or r20, r22 2e70e: 47 2b or r20, r23 2e710: 79 f5 brne .+94 ; 0x2e770 // use first cluster in file curCluster_ = firstCluster_; 2e712: eb 81 ldd r30, Y+3 ; 0x03 2e714: fc 81 ldd r31, Y+4 ; 0x04 2e716: 85 89 ldd r24, Z+21 ; 0x15 2e718: 96 89 ldd r25, Z+22 ; 0x16 2e71a: a7 89 ldd r26, Z+23 ; 0x17 2e71c: b0 8d ldd r27, Z+24 ; 0x18 2e71e: 84 83 std Z+4, r24 ; 0x04 2e720: 95 83 std Z+5, r25 ; 0x05 2e722: a6 83 std Z+6, r26 ; 0x06 2e724: 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; 2e726: ab 81 ldd r26, Y+3 ; 0x03 2e728: bc 81 ldd r27, Y+4 ; 0x04 2e72a: 59 96 adiw r26, 0x19 ; 25 2e72c: ed 91 ld r30, X+ 2e72e: fc 91 ld r31, X 2e730: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2e732: 14 96 adiw r26, 0x04 ; 4 2e734: 6d 91 ld r22, X+ 2e736: 7d 91 ld r23, X+ 2e738: 8d 91 ld r24, X+ 2e73a: 9c 91 ld r25, X 2e73c: 17 97 sbiw r26, 0x07 ; 7 2e73e: 62 50 subi r22, 0x02 ; 2 2e740: 71 09 sbc r23, r1 2e742: 81 09 sbc r24, r1 2e744: 91 09 sbc r25, r1 2e746: 25 85 ldd r18, Z+13 ; 0x0d 2e748: 04 c0 rjmp .+8 ; 0x2e752 2e74a: 66 0f add r22, r22 2e74c: 77 1f adc r23, r23 2e74e: 88 1f adc r24, r24 2e750: 99 1f adc r25, r25 2e752: 2a 95 dec r18 2e754: d2 f7 brpl .-12 ; 0x2e74a 2e756: 26 85 ldd r18, Z+14 ; 0x0e 2e758: 37 85 ldd r19, Z+15 ; 0x0f 2e75a: 40 89 ldd r20, Z+16 ; 0x10 2e75c: 51 89 ldd r21, Z+17 ; 0x11 2e75e: 62 0f add r22, r18 2e760: 73 1f adc r23, r19 2e762: 84 1f adc r24, r20 2e764: 95 1f adc r25, r21 2e766: 61 0f add r22, r17 2e768: 71 1d adc r23, r1 2e76a: 81 1d adc r24, r1 2e76c: 91 1d adc r25, r1 2e76e: 9d cf rjmp .-198 ; 0x2e6aa if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2e770: ab 81 ldd r26, Y+3 ; 0x03 2e772: bc 81 ldd r27, Y+4 ; 0x04 2e774: 14 96 adiw r26, 0x04 ; 4 2e776: 4d 91 ld r20, X+ 2e778: 5d 91 ld r21, X+ 2e77a: 6d 91 ld r22, X+ 2e77c: 7c 91 ld r23, X 2e77e: 17 97 sbiw r26, 0x07 ; 7 2e780: 29 81 ldd r18, Y+1 ; 0x01 2e782: 3a 81 ldd r19, Y+2 ; 0x02 2e784: 0f 94 90 37 call 0x26f20 ; 0x26f20 2e788: 81 11 cpse r24, r1 2e78a: cd cf rjmp .-102 ; 0x2e726 2e78c: 24 cf rjmp .-440 ; 0x2e5d6 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);} 2e78e: 94 01 movw r18, r8 2e790: ab 01 movw r20, r22 2e792: bc 01 movw r22, r24 2e794: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e798: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e79c: 0f 94 13 72 call 0x2e426 ; 0x2e426 // 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; 2e7a0: 88 23 and r24, r24 2e7a2: 09 f4 brne .+2 ; 0x2e7a6 2e7a4: 18 cf rjmp .-464 ; 0x2e5d6 // 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; 2e7a6: 80 0e add r8, r16 2e7a8: 91 1e adc r9, r17 curPosition_ += n; 2e7aa: eb 81 ldd r30, Y+3 ; 0x03 2e7ac: fc 81 ldd r31, Y+4 ; 0x04 2e7ae: 80 85 ldd r24, Z+8 ; 0x08 2e7b0: 91 85 ldd r25, Z+9 ; 0x09 2e7b2: a2 85 ldd r26, Z+10 ; 0x0a 2e7b4: b3 85 ldd r27, Z+11 ; 0x0b 2e7b6: 80 0f add r24, r16 2e7b8: 91 1f adc r25, r17 2e7ba: a1 1d adc r26, r1 2e7bc: b1 1d adc r27, r1 2e7be: 80 87 std Z+8, r24 ; 0x08 2e7c0: 91 87 std Z+9, r25 ; 0x09 2e7c2: a2 87 std Z+10, r26 ; 0x0a 2e7c4: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2e7c6: c0 1a sub r12, r16 2e7c8: d1 0a sbc r13, r17 2e7ca: 45 cf rjmp .-374 ; 0x2e656 } return nbyte; 2e7cc: c7 01 movw r24, r14 2e7ce: 05 cf rjmp .-502 ; 0x2e5da 0002e7d0 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e7d0: 4f 92 push r4 2e7d2: 5f 92 push r5 2e7d4: 6f 92 push r6 2e7d6: 7f 92 push r7 2e7d8: af 92 push r10 2e7da: bf 92 push r11 2e7dc: cf 92 push r12 2e7de: df 92 push r13 2e7e0: ef 92 push r14 2e7e2: ff 92 push r15 2e7e4: 0f 93 push r16 2e7e6: 1f 93 push r17 2e7e8: cf 93 push r28 2e7ea: df 93 push r29 2e7ec: 1f 92 push r1 2e7ee: cd b7 in r28, 0x3d ; 61 2e7f0: de b7 in r29, 0x3e ; 62 2e7f2: 8c 01 movw r16, r24 2e7f4: 7b 01 movw r14, r22 2e7f6: 5a 01 movw r10, r20 2e7f8: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2e7fa: db 01 movw r26, r22 2e7fc: 59 96 adiw r26, 0x19 ; 25 2e7fe: 8d 91 ld r24, X+ 2e800: 9c 91 ld r25, X 2e802: f8 01 movw r30, r16 2e804: 92 8f std Z+26, r25 ; 0x1a 2e806: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2e808: cb 01 movw r24, r22 2e80a: 0e 94 b7 70 call 0xe16e ; 0xe16e } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2e80e: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2e810: f7 01 movw r30, r14 2e812: 80 85 ldd r24, Z+8 ; 0x08 2e814: 91 85 ldd r25, Z+9 ; 0x09 2e816: a2 85 ldd r26, Z+10 ; 0x0a 2e818: b3 85 ldd r27, Z+11 ; 0x0b 2e81a: 41 89 ldd r20, Z+17 ; 0x11 2e81c: 52 89 ldd r21, Z+18 ; 0x12 2e81e: 63 89 ldd r22, Z+19 ; 0x13 2e820: 74 89 ldd r23, Z+20 ; 0x14 2e822: 84 17 cp r24, r20 2e824: 95 07 cpc r25, r21 2e826: a6 07 cpc r26, r22 2e828: b7 07 cpc r27, r23 2e82a: 08 f0 brcs .+2 ; 0x2e82e 2e82c: 52 c0 rjmp .+164 ; 0x2e8d2 index = 0XF & (dirFile->curPosition_ >> 5); 2e82e: 55 e0 ldi r21, 0x05 ; 5 2e830: b6 95 lsr r27 2e832: a7 95 ror r26 2e834: 97 95 ror r25 2e836: 87 95 ror r24 2e838: 5a 95 dec r21 2e83a: d1 f7 brne .-12 ; 0x2e830 2e83c: f8 2f mov r31, r24 2e83e: ff 70 andi r31, 0x0F ; 15 2e840: 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; 2e842: d7 01 movw r26, r14 2e844: 13 96 adiw r26, 0x03 ; 3 2e846: 8c 91 ld r24, X 2e848: 82 30 cpi r24, 0x02 ; 2 2e84a: 10 f4 brcc .+4 ; 0x2e850 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2e84c: 80 e0 ldi r24, 0x00 ; 0 2e84e: db c0 rjmp .+438 ; 0x2ea06 * \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; 2e850: 41 e0 ldi r20, 0x01 ; 1 2e852: 50 e0 ldi r21, 0x00 ; 0 2e854: be 01 movw r22, r28 2e856: 6f 5f subi r22, 0xFF ; 255 2e858: 7f 4f sbci r23, 0xFF ; 255 2e85a: c7 01 movw r24, r14 2e85c: 0f 94 cc 72 call 0x2e598 ; 0x2e598 2e860: 01 97 sbiw r24, 0x01 ; 1 2e862: a1 f7 brne .-24 ; 0x2e84c // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2e864: f7 01 movw r30, r14 2e866: 80 85 ldd r24, Z+8 ; 0x08 2e868: 91 85 ldd r25, Z+9 ; 0x09 2e86a: a2 85 ldd r26, Z+10 ; 0x0a 2e86c: b3 85 ldd r27, Z+11 ; 0x0b 2e86e: 4f 96 adiw r24, 0x1f ; 31 2e870: a1 1d adc r26, r1 2e872: b1 1d adc r27, r1 2e874: 80 87 std Z+8, r24 ; 0x08 2e876: 91 87 std Z+9, r25 ; 0x09 2e878: a2 87 std Z+10, r26 ; 0x0a 2e87a: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2e87c: f0 e2 ldi r31, 0x20 ; 32 2e87e: df 9e mul r13, r31 2e880: b0 01 movw r22, r0 2e882: 11 24 eor r1, r1 2e884: 67 52 subi r22, 0x27 ; 39 2e886: 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; 2e888: 61 15 cp r22, r1 2e88a: 71 05 cpc r23, r1 2e88c: f9 f2 breq .-66 ; 0x2e84c if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2e88e: db 01 movw r26, r22 2e890: 8c 91 ld r24, X 2e892: 88 23 and r24, r24 2e894: 41 f0 breq .+16 ; 0x2e8a6 2e896: 85 3e cpi r24, 0xE5 ; 229 2e898: 09 f0 breq .+2 ; 0x2e89c 2e89a: 4c c0 rjmp .+152 ; 0x2e934 // remember first empty slot if (!emptyFound) { 2e89c: 77 20 and r7, r7 2e89e: 29 f0 breq .+10 ; 0x2e8aa return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e8a0: 77 24 eor r7, r7 2e8a2: 73 94 inc r7 2e8a4: b5 cf rjmp .-150 ; 0x2e810 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) { 2e8a6: 71 10 cpse r7, r1 2e8a8: 0e c0 rjmp .+28 ; 0x2e8c6 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2e8aa: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2e8ae: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2e8b2: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2e8b6: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2e8ba: f8 01 movw r30, r16 2e8bc: 84 87 std Z+12, r24 ; 0x0c 2e8be: 95 87 std Z+13, r25 ; 0x0d 2e8c0: a6 87 std Z+14, r26 ; 0x0e 2e8c2: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2e8c4: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2e8c6: db 01 movw r26, r22 2e8c8: 8c 91 ld r24, X 2e8ca: 81 11 cpse r24, r1 2e8cc: e9 cf rjmp .-46 ; 0x2e8a0 2e8ce: 77 24 eor r7, r7 2e8d0: 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; 2e8d2: 8c 2d mov r24, r12 2e8d4: 82 74 andi r24, 0x42 ; 66 2e8d6: 82 34 cpi r24, 0x42 ; 66 2e8d8: 09 f0 breq .+2 ; 0x2e8dc 2e8da: b8 cf rjmp .-144 ; 0x2e84c if (emptyFound) { 2e8dc: 77 20 and r7, r7 2e8de: 09 f4 brne .+2 ; 0x2e8e2 2e8e0: a2 c0 rjmp .+324 ; 0x2ea26 index = dirIndex_; 2e8e2: f8 01 movw r30, r16 2e8e4: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2e8e6: 61 e0 ldi r22, 0x01 ; 1 2e8e8: c8 01 movw r24, r16 2e8ea: 0f 94 fb 6f call 0x2dff6 ; 0x2dff6 if (!p) goto fail; 2e8ee: 00 97 sbiw r24, 0x00 ; 0 2e8f0: 09 f4 brne .+2 ; 0x2e8f4 2e8f2: ac cf rjmp .-168 ; 0x2e84c // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2e8f4: 20 e2 ldi r18, 0x20 ; 32 2e8f6: dc 01 movw r26, r24 2e8f8: 1d 92 st X+, r1 2e8fa: 2a 95 dec r18 2e8fc: e9 f7 brne .-6 ; 0x2e8f8 memcpy(p->name, dname, 11); 2e8fe: 2b e0 ldi r18, 0x0B ; 11 2e900: f5 01 movw r30, r10 2e902: dc 01 movw r26, r24 2e904: 01 90 ld r0, Z+ 2e906: 0d 92 st X+, r0 2e908: 2a 95 dec r18 2e90a: e1 f7 brne .-8 ; 0x2e904 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2e90c: 21 e2 ldi r18, 0x21 ; 33 2e90e: 38 e2 ldi r19, 0x28 ; 40 2e910: fc 01 movw r30, r24 2e912: 31 8b std Z+17, r19 ; 0x11 2e914: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2e916: 40 e0 ldi r20, 0x00 ; 0 2e918: 58 e0 ldi r21, 0x08 ; 8 2e91a: 57 87 std Z+15, r21 ; 0x0f 2e91c: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2e91e: 33 8b std Z+19, r19 ; 0x13 2e920: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2e922: 31 8f std Z+25, r19 ; 0x19 2e924: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2e926: 57 8b std Z+23, r21 ; 0x17 2e928: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2e92a: 0f 94 82 36 call 0x26d04 ; 0x26d04 2e92e: 81 11 cpse r24, r1 2e930: 09 c0 rjmp .+18 ; 0x2e944 2e932: 8c cf rjmp .-232 ; 0x2e84c dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2e934: 4b e0 ldi r20, 0x0B ; 11 2e936: 50 e0 ldi r21, 0x00 ; 0 2e938: c5 01 movw r24, r10 2e93a: 0f 94 58 a7 call 0x34eb0 ; 0x34eb0 2e93e: 89 2b or r24, r25 2e940: 09 f0 breq .+2 ; 0x2e944 2e942: 66 cf rjmp .-308 ; 0x2e810 } //------------------------------------------------------------------------------ // 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]; 2e944: f0 e2 ldi r31, 0x20 ; 32 2e946: df 9e mul r13, r31 2e948: d0 01 movw r26, r0 2e94a: 11 24 eor r1, r1 2e94c: 9d 01 movw r18, r26 2e94e: 27 52 subi r18, 0x27 ; 39 2e950: 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)) { 2e952: f9 01 movw r30, r18 2e954: 83 85 ldd r24, Z+11 ; 0x0b 2e956: 81 71 andi r24, 0x11 ; 17 2e958: 21 f0 breq .+8 ; 0x2e962 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2e95a: 8c 2d mov r24, r12 2e95c: 82 71 andi r24, 0x12 ; 18 2e95e: 09 f0 breq .+2 ; 0x2e962 2e960: fc c0 rjmp .+504 ; 0x2eb5a } //------------------------------------------------------------------------------ // 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]; 2e962: f8 01 movw r30, r16 2e964: 81 8d ldd r24, Z+25 ; 0x19 2e966: 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(); 2e968: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 2e96c: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 2e970: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 2e974: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 2e978: 44 87 std Z+12, r20 ; 0x0c 2e97a: 55 87 std Z+13, r21 ; 0x0d 2e97c: 66 87 std Z+14, r22 ; 0x0e 2e97e: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2e980: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2e982: fd 01 movw r30, r26 2e984: e7 52 subi r30, 0x27 ; 39 2e986: f2 4f sbci r31, 0xF2 ; 242 2e988: 44 88 ldd r4, Z+20 ; 0x14 2e98a: 55 88 ldd r5, Z+21 ; 0x15 2e98c: 71 2c mov r7, r1 2e98e: 61 2c mov r6, r1 2e990: 32 01 movw r6, r4 2e992: 55 24 eor r5, r5 2e994: 44 24 eor r4, r4 2e996: d8 01 movw r26, r16 2e998: 55 96 adiw r26, 0x15 ; 21 2e99a: 4d 92 st X+, r4 2e99c: 5d 92 st X+, r5 2e99e: 6d 92 st X+, r6 2e9a0: 7c 92 st X, r7 2e9a2: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2e9a4: 42 8d ldd r20, Z+26 ; 0x1a 2e9a6: 53 8d ldd r21, Z+27 ; 0x1b 2e9a8: 70 e0 ldi r23, 0x00 ; 0 2e9aa: 60 e0 ldi r22, 0x00 ; 0 2e9ac: 44 29 or r20, r4 2e9ae: 55 29 or r21, r5 2e9b0: 66 29 or r22, r6 2e9b2: 77 29 or r23, r7 2e9b4: 55 96 adiw r26, 0x15 ; 21 2e9b6: 4d 93 st X+, r20 2e9b8: 5d 93 st X+, r21 2e9ba: 6d 93 st X+, r22 2e9bc: 7c 93 st X, r23 2e9be: 58 97 sbiw r26, 0x18 ; 24 2e9c0: d9 01 movw r26, r18 2e9c2: 1b 96 adiw r26, 0x0b ; 11 2e9c4: 2c 91 ld r18, X 2e9c6: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2e9c8: 09 f0 breq .+2 ; 0x2e9cc 2e9ca: b9 c0 rjmp .+370 ; 0x2eb3e fileSize_ = p->fileSize; 2e9cc: 84 8d ldd r24, Z+28 ; 0x1c 2e9ce: 95 8d ldd r25, Z+29 ; 0x1d 2e9d0: a6 8d ldd r26, Z+30 ; 0x1e 2e9d2: b7 8d ldd r27, Z+31 ; 0x1f 2e9d4: f8 01 movw r30, r16 2e9d6: 81 8b std Z+17, r24 ; 0x11 2e9d8: 92 8b std Z+18, r25 ; 0x12 2e9da: a3 8b std Z+19, r26 ; 0x13 2e9dc: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2e9de: 81 e0 ldi r24, 0x01 ; 1 2e9e0: 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; 2e9e2: 8c 2d mov r24, r12 2e9e4: 8f 70 andi r24, 0x0F ; 15 2e9e6: f8 01 movw r30, r16 2e9e8: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2e9ea: 14 82 std Z+4, r1 ; 0x04 2e9ec: 15 82 std Z+5, r1 ; 0x05 2e9ee: 16 82 std Z+6, r1 ; 0x06 2e9f0: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2e9f2: 10 86 std Z+8, r1 ; 0x08 2e9f4: 11 86 std Z+9, r1 ; 0x09 2e9f6: 12 86 std Z+10, r1 ; 0x0a 2e9f8: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2e9fa: 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; 2e9fc: c4 fe sbrs r12, 4 2e9fe: 03 c0 rjmp .+6 ; 0x2ea06 2ea00: c8 01 movw r24, r16 2ea02: 0f 94 34 45 call 0x28a68 ; 0x28a68 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2ea06: 0f 90 pop r0 2ea08: df 91 pop r29 2ea0a: cf 91 pop r28 2ea0c: 1f 91 pop r17 2ea0e: 0f 91 pop r16 2ea10: ff 90 pop r15 2ea12: ef 90 pop r14 2ea14: df 90 pop r13 2ea16: cf 90 pop r12 2ea18: bf 90 pop r11 2ea1a: af 90 pop r10 2ea1c: 7f 90 pop r7 2ea1e: 6f 90 pop r6 2ea20: 5f 90 pop r5 2ea22: 4f 90 pop r4 2ea24: 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; 2ea26: d7 01 movw r26, r14 2ea28: 13 96 adiw r26, 0x03 ; 3 2ea2a: 8c 91 ld r24, X 2ea2c: 13 97 sbiw r26, 0x03 ; 3 2ea2e: 82 30 cpi r24, 0x02 ; 2 2ea30: 09 f4 brne .+2 ; 0x2ea34 2ea32: 0c cf rjmp .-488 ; 0x2e84c // 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; 2ea34: 51 96 adiw r26, 0x11 ; 17 2ea36: 8d 91 ld r24, X+ 2ea38: 9d 91 ld r25, X+ 2ea3a: 0d 90 ld r0, X+ 2ea3c: bc 91 ld r27, X 2ea3e: a0 2d mov r26, r0 2ea40: 80 3e cpi r24, 0xE0 ; 224 2ea42: 9f 4f sbci r25, 0xFF ; 255 2ea44: af 41 sbci r26, 0x1F ; 31 2ea46: b1 05 cpc r27, r1 2ea48: 08 f0 brcs .+2 ; 0x2ea4c 2ea4a: 00 cf rjmp .-512 ; 0x2e84c if (!addCluster()) goto fail; 2ea4c: c7 01 movw r24, r14 2ea4e: 0f 94 4f 70 call 0x2e09e ; 0x2e09e 2ea52: 88 23 and r24, r24 2ea54: 09 f4 brne .+2 ; 0x2ea58 2ea56: fa ce rjmp .-524 ; 0x2e84c if (!vol_->cacheFlush()) goto fail; 2ea58: 0f 94 82 36 call 0x26d04 ; 0x26d04 2ea5c: 88 23 and r24, r24 2ea5e: 09 f4 brne .+2 ; 0x2ea62 2ea60: f5 ce rjmp .-534 ; 0x2e84c block = vol_->clusterStartBlock(curCluster_); 2ea62: d7 01 movw r26, r14 2ea64: 59 96 adiw r26, 0x19 ; 25 2ea66: ed 91 ld r30, X+ 2ea68: fc 91 ld r31, X 2ea6a: 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_);} 2ea6c: 14 96 adiw r26, 0x04 ; 4 2ea6e: 4d 90 ld r4, X+ 2ea70: 5d 90 ld r5, X+ 2ea72: 6d 90 ld r6, X+ 2ea74: 7c 90 ld r7, X 2ea76: 17 97 sbiw r26, 0x07 ; 7 2ea78: b2 e0 ldi r27, 0x02 ; 2 2ea7a: 4b 1a sub r4, r27 2ea7c: 51 08 sbc r5, r1 2ea7e: 61 08 sbc r6, r1 2ea80: 71 08 sbc r7, r1 2ea82: 85 85 ldd r24, Z+13 ; 0x0d 2ea84: 04 c0 rjmp .+8 ; 0x2ea8e 2ea86: 44 0c add r4, r4 2ea88: 55 1c adc r5, r5 2ea8a: 66 1c adc r6, r6 2ea8c: 77 1c adc r7, r7 2ea8e: 8a 95 dec r24 2ea90: d2 f7 brpl .-12 ; 0x2ea86 2ea92: 86 85 ldd r24, Z+14 ; 0x0e 2ea94: 97 85 ldd r25, Z+15 ; 0x0f 2ea96: a0 89 ldd r26, Z+16 ; 0x10 2ea98: b1 89 ldd r27, Z+17 ; 0x11 2ea9a: 48 0e add r4, r24 2ea9c: 59 1e adc r5, r25 2ea9e: 6a 1e adc r6, r26 2eaa0: 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; 2eaa2: 81 e0 ldi r24, 0x01 ; 1 2eaa4: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2eaa8: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2eaac: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2eab0: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2eab4: 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); 2eab8: e9 ed ldi r30, 0xD9 ; 217 2eaba: fd e0 ldi r31, 0x0D ; 13 2eabc: 80 e0 ldi r24, 0x00 ; 0 2eabe: 92 e0 ldi r25, 0x02 ; 2 2eac0: df 01 movw r26, r30 2eac2: 9c 01 movw r18, r24 2eac4: 1d 92 st X+, r1 2eac6: 21 50 subi r18, 0x01 ; 1 2eac8: 30 40 sbci r19, 0x00 ; 0 2eaca: e1 f7 brne .-8 ; 0x2eac4 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2eacc: dd 24 eor r13, r13 2eace: d3 94 inc r13 2ead0: d7 01 movw r26, r14 2ead2: 59 96 adiw r26, 0x19 ; 25 2ead4: ed 91 ld r30, X+ 2ead6: fc 91 ld r31, X 2ead8: 84 81 ldd r24, Z+4 ; 0x04 2eada: d8 16 cp r13, r24 2eadc: 98 f4 brcc .+38 ; 0x2eb04 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); 2eade: 29 ed ldi r18, 0xD9 ; 217 2eae0: 3d e0 ldi r19, 0x0D ; 13 2eae2: b3 01 movw r22, r6 2eae4: a2 01 movw r20, r4 2eae6: 4d 0d add r20, r13 2eae8: 51 1d adc r21, r1 2eaea: 61 1d adc r22, r1 2eaec: 71 1d adc r23, r1 2eaee: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2eaf2: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2eaf6: 0f 94 af 71 call 0x2e35e ; 0x2e35e if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2eafa: 88 23 and r24, r24 2eafc: 09 f4 brne .+2 ; 0x2eb00 2eafe: a6 ce rjmp .-692 ; 0x2e84c // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2eb00: d3 94 inc r13 2eb02: e6 cf rjmp .-52 ; 0x2ead0 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2eb04: 25 85 ldd r18, Z+13 ; 0x0d 2eb06: 80 e0 ldi r24, 0x00 ; 0 2eb08: 92 e0 ldi r25, 0x02 ; 2 2eb0a: a0 e0 ldi r26, 0x00 ; 0 2eb0c: b0 e0 ldi r27, 0x00 ; 0 2eb0e: 04 c0 rjmp .+8 ; 0x2eb18 2eb10: 88 0f add r24, r24 2eb12: 99 1f adc r25, r25 2eb14: aa 1f adc r26, r26 2eb16: bb 1f adc r27, r27 2eb18: 2a 95 dec r18 2eb1a: d2 f7 brpl .-12 ; 0x2eb10 2eb1c: f7 01 movw r30, r14 2eb1e: 41 89 ldd r20, Z+17 ; 0x11 2eb20: 52 89 ldd r21, Z+18 ; 0x12 2eb22: 63 89 ldd r22, Z+19 ; 0x13 2eb24: 74 89 ldd r23, Z+20 ; 0x14 2eb26: 84 0f add r24, r20 2eb28: 95 1f adc r25, r21 2eb2a: a6 1f adc r26, r22 2eb2c: b7 1f adc r27, r23 2eb2e: 81 8b std Z+17, r24 ; 0x11 2eb30: 92 8b std Z+18, r25 ; 0x12 2eb32: a3 8b std Z+19, r26 ; 0x13 2eb34: 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; 2eb36: 89 ed ldi r24, 0xD9 ; 217 2eb38: 9d e0 ldi r25, 0x0D ; 13 index = 0; 2eb3a: d1 2c mov r13, r1 2eb3c: db ce rjmp .-586 ; 0x2e8f4 // 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)) { 2eb3e: 20 31 cpi r18, 0x10 ; 16 2eb40: 61 f4 brne .+24 ; 0x2eb5a if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2eb42: 98 01 movw r18, r16 2eb44: 2f 5e subi r18, 0xEF ; 239 2eb46: 3f 4f sbci r19, 0xFF ; 255 2eb48: 0f 94 13 38 call 0x27026 ; 0x27026 2eb4c: 88 23 and r24, r24 2eb4e: 29 f0 breq .+10 ; 0x2eb5a type_ = FAT_FILE_TYPE_SUBDIR; 2eb50: 84 e0 ldi r24, 0x04 ; 4 2eb52: d8 01 movw r26, r16 2eb54: 13 96 adiw r26, 0x03 ; 3 2eb56: 8c 93 st X, r24 2eb58: 44 cf rjmp .-376 ; 0x2e9e2 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2eb5a: d8 01 movw r26, r16 2eb5c: 13 96 adiw r26, 0x03 ; 3 2eb5e: 1c 92 st X, r1 2eb60: 75 ce rjmp .-790 ; 0x2e84c 0002eb62 : } #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; } 2eb62: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb 2eb66: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc 2eb6a: bc 01 movw r22, r24 2eb6c: c9 01 movw r24, r18 2eb6e: 8f 51 subi r24, 0x1F ; 31 2eb70: 90 4f sbci r25, 0xF0 ; 240 2eb72: 0f 94 43 9f call 0x33e86 ; 0x33e86 2eb76: 9c 01 movw r18, r24 2eb78: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 2eb7c: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2eb80: 81 e0 ldi r24, 0x01 ; 1 2eb82: 23 2b or r18, r19 2eb84: 09 f4 brne .+2 ; 0x2eb88 2eb86: 80 e0 ldi r24, 0x00 ; 0 2eb88: 08 95 ret 0002eb8a : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2eb8a: 60 91 a8 0d lds r22, 0x0DA8 ; 0x800da8 uint8_t _block_buffer_tail = block_buffer_tail; 2eb8e: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 uint16_t sdlen = 0; 2eb92: 30 e0 ldi r19, 0x00 ; 0 2eb94: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2eb96: 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) 2eb98: 96 17 cp r25, r22 2eb9a: 61 f0 breq .+24 ; 0x2ebb4 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2eb9c: 89 9f mul r24, r25 2eb9e: f0 01 movw r30, r0 2eba0: 11 24 eor r1, r1 2eba2: ec 5c subi r30, 0xCC ; 204 2eba4: f8 4f sbci r31, 0xF8 ; 248 2eba6: 40 81 ld r20, Z 2eba8: 51 81 ldd r21, Z+1 ; 0x01 2ebaa: 24 0f add r18, r20 2ebac: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2ebae: 9f 5f subi r25, 0xFF ; 255 2ebb0: 9f 70 andi r25, 0x0F ; 15 2ebb2: f2 cf rjmp .-28 ; 0x2eb98 } return sdlen; } 2ebb4: c9 01 movw r24, r18 2ebb6: 08 95 ret 0002ebb8 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2ebb8: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2ebbc: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 2ebc0: 32 17 cp r19, r18 2ebc2: 91 f0 breq .+36 ; 0x2ebe8 // 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; 2ebc4: 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) 2ebc8: e1 11 cpse r30, r1 2ebca: 01 c0 rjmp .+2 ; 0x2ebce block_index = BLOCK_BUFFER_SIZE; 2ebcc: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2ebce: 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; 2ebd0: 2e e6 ldi r18, 0x6E ; 110 2ebd2: e2 9f mul r30, r18 2ebd4: f0 01 movw r30, r0 2ebd6: 11 24 eor r1, r1 2ebd8: ec 5c subi r30, 0xCC ; 204 2ebda: f8 4f sbci r31, 0xF8 ; 248 2ebdc: 20 81 ld r18, Z 2ebde: 31 81 ldd r19, Z+1 ; 0x01 2ebe0: 82 0f add r24, r18 2ebe2: 93 1f adc r25, r19 2ebe4: 91 83 std Z+1, r25 ; 0x01 2ebe6: 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. } } 2ebe8: 08 95 ret 0002ebea : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2ebea: cf 92 push r12 2ebec: df 92 push r13 2ebee: ef 92 push r14 2ebf0: ff 92 push r15 2ebf2: 0f 93 push r16 2ebf4: 1f 93 push r17 2ebf6: cf 93 push r28 2ebf8: df 93 push r29 2ebfa: 06 e3 ldi r16, 0x36 ; 54 2ebfc: 14 e0 ldi r17, 0x04 ; 4 2ebfe: c5 ee ldi r28, 0xE5 ; 229 2ec00: d6 e1 ldi r29, 0x16 ; 22 2ec02: 85 ef ldi r24, 0xF5 ; 245 2ec04: c8 2e mov r12, r24 2ec06: 86 e1 ldi r24, 0x16 ; 22 2ec08: d8 2e mov r13, r24 2ec0a: 78 01 movw r14, r16 2ec0c: 0c 5f subi r16, 0xFC ; 252 2ec0e: 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]; 2ec10: f7 01 movw r30, r14 2ec12: 60 a1 ldd r22, Z+32 ; 0x20 2ec14: 71 a1 ldd r23, Z+33 ; 0x21 2ec16: 82 a1 ldd r24, Z+34 ; 0x22 2ec18: 93 a1 ldd r25, Z+35 ; 0x23 2ec1a: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2ec1e: f7 01 movw r30, r14 2ec20: 20 81 ld r18, Z 2ec22: 31 81 ldd r19, Z+1 ; 0x01 2ec24: 42 81 ldd r20, Z+2 ; 0x02 2ec26: 53 81 ldd r21, Z+3 ; 0x03 2ec28: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ec2c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2ec30: 69 93 st Y+, r22 2ec32: 79 93 st Y+, r23 2ec34: 89 93 st Y+, r24 2ec36: 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++) 2ec38: cc 16 cp r12, r28 2ec3a: dd 06 cpc r13, r29 2ec3c: 31 f7 brne .-52 ; 0x2ec0a max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2ec3e: df 91 pop r29 2ec40: cf 91 pop r28 2ec42: 1f 91 pop r17 2ec44: 0f 91 pop r16 2ec46: ff 90 pop r15 2ec48: ef 90 pop r14 2ec4a: df 90 pop r13 2ec4c: cf 90 pop r12 2ec4e: 08 95 ret 0002ec50 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2ec50: fc 01 movw r30, r24 2ec52: 40 81 ld r20, Z 2ec54: 51 81 ldd r21, Z+1 ; 0x01 2ec56: 62 81 ldd r22, Z+2 ; 0x02 2ec58: 73 81 ldd r23, Z+3 ; 0x03 2ec5a: 40 93 10 04 sts 0x0410, r20 ; 0x800410 2ec5e: 50 93 11 04 sts 0x0411, r21 ; 0x800411 2ec62: 60 93 12 04 sts 0x0412, r22 ; 0x800412 2ec66: 70 93 13 04 sts 0x0413, r23 ; 0x800413 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2ec6a: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2ec6e: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2ec72: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2ec76: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2ec7a: 60 81 ld r22, Z 2ec7c: 71 81 ldd r23, Z+1 ; 0x01 2ec7e: 82 81 ldd r24, Z+2 ; 0x02 2ec80: 93 81 ldd r25, Z+3 ; 0x03 2ec82: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ec86: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2ec8a: e6 ea ldi r30, 0xA6 ; 166 2ec8c: f6 e0 ldi r31, 0x06 ; 6 2ec8e: 64 87 std Z+12, r22 ; 0x0c 2ec90: 75 87 std Z+13, r23 ; 0x0d 2ec92: 86 87 std Z+14, r24 ; 0x0e 2ec94: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2ec96: 8f b7 in r24, 0x3f ; 63 2ec98: f8 94 cli count_position[E_AXIS] = e; 2ec9a: 44 85 ldd r20, Z+12 ; 0x0c 2ec9c: 55 85 ldd r21, Z+13 ; 0x0d 2ec9e: 66 85 ldd r22, Z+14 ; 0x0e 2eca0: 77 85 ldd r23, Z+15 ; 0x0f 2eca2: 40 93 c2 06 sts 0x06C2, r20 ; 0x8006c2 2eca6: 50 93 c3 06 sts 0x06C3, r21 ; 0x8006c3 2ecaa: 60 93 c4 06 sts 0x06C4, r22 ; 0x8006c4 2ecae: 70 93 c5 06 sts 0x06C5, r23 ; 0x8006c5 CRITICAL_SECTION_END; 2ecb2: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2ecb4: 08 95 ret 0002ecb6 : // 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; 2ecb6: fc 01 movw r30, r24 2ecb8: 40 81 ld r20, Z 2ecba: 51 81 ldd r21, Z+1 ; 0x01 2ecbc: 62 81 ldd r22, Z+2 ; 0x02 2ecbe: 73 81 ldd r23, Z+3 ; 0x03 2ecc0: 40 93 0c 04 sts 0x040C, r20 ; 0x80040c 2ecc4: 50 93 0d 04 sts 0x040D, r21 ; 0x80040d 2ecc8: 60 93 0e 04 sts 0x040E, r22 ; 0x80040e 2eccc: 70 93 0f 04 sts 0x040F, r23 ; 0x80040f #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ecd0: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2ecd4: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2ecd8: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2ecdc: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2ece0: 60 81 ld r22, Z 2ece2: 71 81 ldd r23, Z+1 ; 0x01 2ece4: 82 81 ldd r24, Z+2 ; 0x02 2ece6: 93 81 ldd r25, Z+3 ; 0x03 2ece8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ecec: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2ecf0: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 2ecf4: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 2ecf8: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 2ecfc: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 st_set_position(position); 2ed00: 0d 94 d3 54 jmp 0x2a9a6 ; 0x2a9a6 0002ed04 : // 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) { 2ed04: 2f 92 push r2 2ed06: 3f 92 push r3 2ed08: 4f 92 push r4 2ed0a: 5f 92 push r5 2ed0c: 6f 92 push r6 2ed0e: 7f 92 push r7 2ed10: 8f 92 push r8 2ed12: 9f 92 push r9 2ed14: af 92 push r10 2ed16: bf 92 push r11 2ed18: cf 92 push r12 2ed1a: df 92 push r13 2ed1c: ef 92 push r14 2ed1e: ff 92 push r15 2ed20: 0f 93 push r16 2ed22: 1f 93 push r17 2ed24: cf 93 push r28 2ed26: df 93 push r29 2ed28: cd b7 in r28, 0x3d ; 61 2ed2a: de b7 in r29, 0x3e ; 62 2ed2c: c4 58 subi r28, 0x84 ; 132 2ed2e: d1 09 sbc r29, r1 2ed30: 0f b6 in r0, 0x3f ; 63 2ed32: f8 94 cli 2ed34: de bf out 0x3e, r29 ; 62 2ed36: 0f be out 0x3f, r0 ; 63 2ed38: cd bf out 0x3d, r28 ; 61 2ed3a: 69 a3 std Y+33, r22 ; 0x21 2ed3c: 7a a3 std Y+34, r23 ; 0x22 2ed3e: 8b a3 std Y+35, r24 ; 0x23 2ed40: 9c a3 std Y+36, r25 ; 0x24 2ed42: 2d a3 std Y+37, r18 ; 0x25 2ed44: 3e a3 std Y+38, r19 ; 0x26 2ed46: 4f a3 std Y+39, r20 ; 0x27 2ed48: 58 a7 std Y+40, r21 ; 0x28 2ed4a: a7 96 adiw r28, 0x27 ; 39 2ed4c: ec ae std Y+60, r14 ; 0x3c 2ed4e: fd ae std Y+61, r15 ; 0x3d 2ed50: 0e af std Y+62, r16 ; 0x3e 2ed52: 1f af std Y+63, r17 ; 0x3f 2ed54: a7 97 sbiw r28, 0x27 ; 39 2ed56: a9 96 adiw r28, 0x29 ; 41 2ed58: df ae std Y+63, r13 ; 0x3f 2ed5a: ce ae std Y+62, r12 ; 0x3e 2ed5c: a9 97 sbiw r28, 0x29 ; 41 2ed5e: 89 ae std Y+57, r8 ; 0x39 2ed60: 99 aa std Y+49, r9 ; 0x31 2ed62: ad ae std Y+61, r10 ; 0x3d 2ed64: bd aa std Y+53, r11 ; 0x35 2ed66: c6 56 subi r28, 0x66 ; 102 2ed68: df 4f sbci r29, 0xFF ; 255 2ed6a: 08 81 ld r16, Y 2ed6c: 19 81 ldd r17, Y+1 ; 0x01 2ed6e: ca 59 subi r28, 0x9A ; 154 2ed70: 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); 2ed72: 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) 2ed76: 8f 5f subi r24, 0xFF ; 255 2ed78: a0 96 adiw r28, 0x20 ; 32 2ed7a: 8f af std Y+63, r24 ; 0x3f 2ed7c: a0 97 sbiw r28, 0x20 ; 32 2ed7e: 80 31 cpi r24, 0x10 ; 16 2ed80: 19 f4 brne .+6 ; 0x2ed88 block_index = 0; 2ed82: a0 96 adiw r28, 0x20 ; 32 2ed84: 1f ae std Y+63, r1 ; 0x3f 2ed86: 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) { 2ed88: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2ed8c: a0 96 adiw r28, 0x20 ; 32 2ed8e: 2f ad ldd r18, Y+63 ; 0x3f 2ed90: a0 97 sbiw r28, 0x20 ; 32 2ed92: 82 13 cpse r24, r18 2ed94: 0f c0 rjmp .+30 ; 0x2edb4 do { manage_heater(); 2ed96: 0f 94 af 32 call 0x2655e ; 0x2655e // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2ed9a: 80 e0 ldi r24, 0x00 ; 0 2ed9c: 0e 94 89 7a call 0xf512 ; 0xf512 lcd_update(0); 2eda0: 80 e0 ldi r24, 0x00 ; 0 2eda2: 0e 94 c3 69 call 0xd386 ; 0xd386 } while (block_buffer_tail == next_buffer_head); 2eda6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2edaa: a0 96 adiw r28, 0x20 ; 32 2edac: 3f ad ldd r19, Y+63 ; 0x3f 2edae: a0 97 sbiw r28, 0x20 ; 32 2edb0: 83 17 cp r24, r19 2edb2: 89 f3 breq .-30 ; 0x2ed96 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 2edb4: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 2edb8: a1 96 adiw r28, 0x21 ; 33 2edba: 4f af std Y+63, r20 ; 0x3f 2edbc: a1 97 sbiw r28, 0x21 ; 33 2edbe: 44 23 and r20, r20 2edc0: 11 f1 breq .+68 ; 0x2ee06 // avoid planning the block early if aborted SERIAL_ECHO_START; 2edc2: 87 e7 ldi r24, 0x77 ; 119 2edc4: 9e e9 ldi r25, 0x9E ; 158 2edc6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n("Move aborted")); 2edca: 8b e1 ldi r24, 0x1B ; 27 2edcc: 9d e6 ldi r25, 0x6D ; 109 2edce: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // 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(); } 2edd2: cc 57 subi r28, 0x7C ; 124 2edd4: df 4f sbci r29, 0xFF ; 255 2edd6: 0f b6 in r0, 0x3f ; 63 2edd8: f8 94 cli 2edda: de bf out 0x3e, r29 ; 62 2eddc: 0f be out 0x3f, r0 ; 63 2edde: cd bf out 0x3d, r28 ; 61 2ede0: df 91 pop r29 2ede2: cf 91 pop r28 2ede4: 1f 91 pop r17 2ede6: 0f 91 pop r16 2ede8: ff 90 pop r15 2edea: ef 90 pop r14 2edec: df 90 pop r13 2edee: cf 90 pop r12 2edf0: bf 90 pop r11 2edf2: af 90 pop r10 2edf4: 9f 90 pop r9 2edf6: 8f 90 pop r8 2edf8: 7f 90 pop r7 2edfa: 6f 90 pop r6 2edfc: 5f 90 pop r5 2edfe: 4f 90 pop r4 2ee00: 3f 90 pop r3 2ee02: 2f 90 pop r2 2ee04: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 2ee06: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2ee0a: 29 2e mov r2, r25 2ee0c: 31 2c mov r3, r1 2ee0e: 8e e6 ldi r24, 0x6E ; 110 2ee10: 98 9f mul r25, r24 2ee12: d0 01 movw r26, r0 2ee14: 11 24 eor r1, r1 2ee16: a3 96 adiw r28, 0x23 ; 35 2ee18: bf af std Y+63, r27 ; 0x3f 2ee1a: ae af std Y+62, r26 ; 0x3e 2ee1c: 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; 2ee1e: cd 01 movw r24, r26 2ee20: 88 53 subi r24, 0x38 ; 56 2ee22: 99 4f sbci r25, 0xF9 ; 249 2ee24: fc 01 movw r30, r24 2ee26: e9 5b subi r30, 0xB9 ; 185 2ee28: ff 4f sbci r31, 0xFF ; 255 2ee2a: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 2ee2c: 84 59 subi r24, 0x94 ; 148 2ee2e: 9f 4f sbci r25, 0xFF ; 255 2ee30: fc 01 movw r30, r24 2ee32: 11 82 std Z+1, r1 ; 0x01 2ee34: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 2ee36: 01 15 cp r16, r1 2ee38: 11 05 cpc r17, r1 2ee3a: 11 f4 brne .+4 ; 0x2ee40 2ee3c: 0d 94 6f 81 jmp 0x302de ; 0x302de memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 2ee40: 80 e1 ldi r24, 0x10 ; 16 2ee42: f8 01 movw r30, r16 2ee44: a0 5e subi r26, 0xE0 ; 224 2ee46: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 2ee48: 01 90 ld r0, Z+ 2ee4a: 0d 92 st X+, r0 2ee4c: 8a 95 dec r24 2ee4e: e1 f7 brne .-8 ; 0x2ee48 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 2ee50: 8e e6 ldi r24, 0x6E ; 110 2ee52: 82 9d mul r24, r2 2ee54: 80 01 movw r16, r0 2ee56: 83 9d mul r24, r3 2ee58: 10 0d add r17, r0 2ee5a: 11 24 eor r1, r1 2ee5c: 08 53 subi r16, 0x38 ; 56 2ee5e: 19 4f sbci r17, 0xF9 ; 249 2ee60: f8 01 movw r30, r16 2ee62: e8 59 subi r30, 0x98 ; 152 2ee64: ff 4f sbci r31, 0xFF ; 255 2ee66: c4 56 subi r28, 0x64 ; 100 2ee68: df 4f sbci r29, 0xFF ; 255 2ee6a: 88 81 ld r24, Y 2ee6c: 99 81 ldd r25, Y+1 ; 0x01 2ee6e: cc 59 subi r28, 0x9C ; 156 2ee70: d0 40 sbci r29, 0x00 ; 0 2ee72: 91 83 std Z+1, r25 ; 0x01 2ee74: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 2ee76: 06 59 subi r16, 0x96 ; 150 2ee78: 1f 4f sbci r17, 0xFF ; 255 2ee7a: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2ee7e: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2ee82: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2ee86: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2ee8a: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2ee8e: d8 01 movw r26, r16 2ee90: 6d 93 st X+, r22 2ee92: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 2ee94: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> 2ee98: 88 23 and r24, r24 2ee9a: a9 f0 breq .+42 ; 0x2eec6 { position[E_AXIS] = 0; 2ee9c: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 2eea0: 10 92 b3 06 sts 0x06B3, r1 ; 0x8006b3 2eea4: 10 92 b4 06 sts 0x06B4, r1 ; 0x8006b4 2eea8: 10 92 b5 06 sts 0x06B5, r1 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 2eeac: 10 92 10 04 sts 0x0410, r1 ; 0x800410 2eeb0: 10 92 11 04 sts 0x0411, r1 ; 0x800411 2eeb4: 10 92 12 04 sts 0x0412, r1 ; 0x800412 2eeb8: 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; 2eebc: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = true; 2eec0: 81 e0 ldi r24, 0x01 ; 1 2eec2: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } // Apply the machine correction matrix. world2machine(x, y); 2eec6: be 01 movw r22, r28 2eec8: 6b 5d subi r22, 0xDB ; 219 2eeca: 7f 4f sbci r23, 0xFF ; 255 2eecc: ce 01 movw r24, r28 2eece: 81 96 adiw r24, 0x21 ; 33 2eed0: 0e 94 7f 63 call 0xc6fe ; 0xc6fe // 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]); 2eed4: c9 a0 ldd r12, Y+33 ; 0x21 2eed6: da a0 ldd r13, Y+34 ; 0x22 2eed8: eb a0 ldd r14, Y+35 ; 0x23 2eeda: fc a0 ldd r15, Y+36 ; 0x24 2eedc: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2eee0: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2eee4: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2eee8: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2eeec: c7 01 movw r24, r14 2eeee: b6 01 movw r22, r12 2eef0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2eef4: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2eef8: c3 58 subi r28, 0x83 ; 131 2eefa: df 4f sbci r29, 0xFF ; 255 2eefc: 68 83 st Y, r22 2eefe: 79 83 std Y+1, r23 ; 0x01 2ef00: 8a 83 std Y+2, r24 ; 0x02 2ef02: 9b 83 std Y+3, r25 ; 0x03 2ef04: cd 57 subi r28, 0x7D ; 125 2ef06: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2ef08: 8d a0 ldd r8, Y+37 ; 0x25 2ef0a: 9e a0 ldd r9, Y+38 ; 0x26 2ef0c: af a0 ldd r10, Y+39 ; 0x27 2ef0e: b8 a4 ldd r11, Y+40 ; 0x28 2ef10: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2ef14: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2ef18: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2ef1c: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2ef20: c5 01 movw r24, r10 2ef22: b4 01 movw r22, r8 2ef24: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ef28: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2ef2c: cf 57 subi r28, 0x7F ; 127 2ef2e: df 4f sbci r29, 0xFF ; 255 2ef30: 68 83 st Y, r22 2ef32: 79 83 std Y+1, r23 ; 0x01 2ef34: 8a 83 std Y+2, r24 ; 0x02 2ef36: 9b 83 std Y+3, r25 ; 0x03 2ef38: c1 58 subi r28, 0x81 ; 129 2ef3a: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 2ef3c: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 2ef40: 88 23 and r24, r24 2ef42: 11 f4 brne .+4 ; 0x2ef48 2ef44: 0d 94 76 81 jmp 0x302ec ; 0x302ec target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 2ef48: a5 01 movw r20, r10 2ef4a: 94 01 movw r18, r8 2ef4c: c7 01 movw r24, r14 2ef4e: b6 01 movw r22, r12 2ef50: 0f 94 68 61 call 0x2c2d0 ; 0x2c2d0 2ef54: a7 96 adiw r28, 0x27 ; 39 2ef56: 2c ad ldd r18, Y+60 ; 0x3c 2ef58: 3d ad ldd r19, Y+61 ; 0x3d 2ef5a: 4e ad ldd r20, Y+62 ; 0x3e 2ef5c: 5f ad ldd r21, Y+63 ; 0x3f 2ef5e: a7 97 sbiw r28, 0x27 ; 39 2ef60: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2ef64: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2ef68: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2ef6c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2ef70: 50 91 41 04 lds r21, 0x0441 ; 0x800441 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ef74: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ef78: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2ef7c: e5 96 adiw r28, 0x35 ; 53 2ef7e: 6c af std Y+60, r22 ; 0x3c 2ef80: 7d af std Y+61, r23 ; 0x3d 2ef82: 8e af std Y+62, r24 ; 0x3e 2ef84: 9f af std Y+63, r25 ; 0x3f 2ef86: 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]); 2ef88: a9 96 adiw r28, 0x29 ; 41 2ef8a: ee ad ldd r30, Y+62 ; 0x3e 2ef8c: ff ad ldd r31, Y+63 ; 0x3f 2ef8e: a9 97 sbiw r28, 0x29 ; 41 2ef90: 80 80 ld r8, Z 2ef92: 91 80 ldd r9, Z+1 ; 0x01 2ef94: a2 80 ldd r10, Z+2 ; 0x02 2ef96: b3 80 ldd r11, Z+3 ; 0x03 2ef98: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2ef9c: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2efa0: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2efa4: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2efa8: c5 01 movw r24, r10 2efaa: b4 01 movw r22, r8 2efac: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2efb0: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2efb4: ad 96 adiw r28, 0x2d ; 45 2efb6: 6c af std Y+60, r22 ; 0x3c 2efb8: 7d af std Y+61, r23 ; 0x3d 2efba: 8e af std Y+62, r24 ; 0x3e 2efbc: 9f af std Y+63, r25 ; 0x3f 2efbe: 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]; 2efc0: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2efc4: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2efc8: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2efcc: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2efd0: ad 96 adiw r28, 0x2d ; 45 2efd2: 4c ac ldd r4, Y+60 ; 0x3c 2efd4: 5d ac ldd r5, Y+61 ; 0x3d 2efd6: 6e ac ldd r6, Y+62 ; 0x3e 2efd8: 7f ac ldd r7, Y+63 ; 0x3f 2efda: ad 97 sbiw r28, 0x2d ; 45 2efdc: 48 1a sub r4, r24 2efde: 59 0a sbc r5, r25 2efe0: 6a 0a sbc r6, r26 2efe2: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 2efe4: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 2efe8: 90 91 a7 06 lds r25, 0x06A7 ; 0x8006a7 2efec: a0 91 a8 06 lds r26, 0x06A8 ; 0x8006a8 2eff0: b0 91 a9 06 lds r27, 0x06A9 ; 0x8006a9 2eff4: c3 58 subi r28, 0x83 ; 131 2eff6: df 4f sbci r29, 0xFF ; 255 2eff8: c8 80 ld r12, Y 2effa: d9 80 ldd r13, Y+1 ; 0x01 2effc: ea 80 ldd r14, Y+2 ; 0x02 2effe: fb 80 ldd r15, Y+3 ; 0x03 2f000: cd 57 subi r28, 0x7D ; 125 2f002: d0 40 sbci r29, 0x00 ; 0 2f004: c8 1a sub r12, r24 2f006: d9 0a sbc r13, r25 2f008: ea 0a sbc r14, r26 2f00a: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 2f00c: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 2f010: 90 91 ab 06 lds r25, 0x06AB ; 0x8006ab 2f014: a0 91 ac 06 lds r26, 0x06AC ; 0x8006ac 2f018: b0 91 ad 06 lds r27, 0x06AD ; 0x8006ad 2f01c: cf 57 subi r28, 0x7F ; 127 2f01e: df 4f sbci r29, 0xFF ; 255 2f020: 28 81 ld r18, Y 2f022: 39 81 ldd r19, Y+1 ; 0x01 2f024: 4a 81 ldd r20, Y+2 ; 0x02 2f026: 5b 81 ldd r21, Y+3 ; 0x03 2f028: c1 58 subi r28, 0x81 ; 129 2f02a: d0 40 sbci r29, 0x00 ; 0 2f02c: 28 1b sub r18, r24 2f02e: 39 0b sbc r19, r25 2f030: 4a 0b sbc r20, r26 2f032: 5b 0b sbc r21, r27 2f034: 29 a7 std Y+41, r18 ; 0x29 2f036: 3a a7 std Y+42, r19 ; 0x2a 2f038: 4b a7 std Y+43, r20 ; 0x2b 2f03a: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 2f03c: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 2f040: 90 91 af 06 lds r25, 0x06AF ; 0x8006af 2f044: a0 91 b0 06 lds r26, 0x06B0 ; 0x8006b0 2f048: b0 91 b1 06 lds r27, 0x06B1 ; 0x8006b1 2f04c: e5 96 adiw r28, 0x35 ; 53 2f04e: 2c ad ldd r18, Y+60 ; 0x3c 2f050: 3d ad ldd r19, Y+61 ; 0x3d 2f052: 4e ad ldd r20, Y+62 ; 0x3e 2f054: 5f ad ldd r21, Y+63 ; 0x3f 2f056: e5 97 sbiw r28, 0x35 ; 53 2f058: 28 1b sub r18, r24 2f05a: 39 0b sbc r19, r25 2f05c: 4a 0b sbc r20, r26 2f05e: 5b 0b sbc r21, r27 2f060: 2d a7 std Y+45, r18 ; 0x2d 2f062: 3e a7 std Y+46, r19 ; 0x2e 2f064: 4f a7 std Y+47, r20 ; 0x2f 2f066: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 2f068: 41 14 cp r4, r1 2f06a: 51 04 cpc r5, r1 2f06c: 61 04 cpc r6, r1 2f06e: 71 04 cpc r7, r1 2f070: 09 f4 brne .+2 ; 0x2f074 2f072: 80 c0 rjmp .+256 ; 0x2f174 { if((int)degHotend(active_extruder) 2f078: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2f07c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2f080: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2f084: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2f088: 20 91 57 02 lds r18, 0x0257 ; 0x800257 2f08c: 30 91 58 02 lds r19, 0x0258 ; 0x800258 2f090: 62 17 cp r22, r18 2f092: 73 07 cpc r23, r19 2f094: 0c f5 brge .+66 ; 0x2f0d8 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2f096: ad 96 adiw r28, 0x2d ; 45 2f098: 8c ad ldd r24, Y+60 ; 0x3c 2f09a: 9d ad ldd r25, Y+61 ; 0x3d 2f09c: ae ad ldd r26, Y+62 ; 0x3e 2f09e: bf ad ldd r27, Y+63 ; 0x3f 2f0a0: ad 97 sbiw r28, 0x2d ; 45 2f0a2: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 2f0a6: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 2f0aa: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 2f0ae: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2f0b2: 80 92 10 04 sts 0x0410, r8 ; 0x800410 2f0b6: 90 92 11 04 sts 0x0411, r9 ; 0x800411 2f0ba: a0 92 12 04 sts 0x0412, r10 ; 0x800412 2f0be: b0 92 13 04 sts 0x0413, r11 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2f0c2: 87 e7 ldi r24, 0x77 ; 119 2f0c4: 9e e9 ldi r25, 0x9E ; 158 2f0c6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2f0ca: 81 e0 ldi r24, 0x01 ; 1 2f0cc: 9d e6 ldi r25, 0x6D ; 109 2f0ce: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 { 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 2f0d2: 41 2c mov r4, r1 2f0d4: 51 2c mov r5, r1 2f0d6: 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) 2f0d8: c3 01 movw r24, r6 2f0da: b2 01 movw r22, r4 2f0dc: 77 fe sbrs r7, 7 2f0de: 07 c0 rjmp .+14 ; 0x2f0ee 2f0e0: 66 27 eor r22, r22 2f0e2: 77 27 eor r23, r23 2f0e4: cb 01 movw r24, r22 2f0e6: 64 19 sub r22, r4 2f0e8: 75 09 sbc r23, r5 2f0ea: 86 09 sbc r24, r6 2f0ec: 97 09 sbc r25, r7 2f0ee: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2f0f2: 4b 01 movw r8, r22 2f0f4: 5c 01 movw r10, r24 2f0f6: 20 e0 ldi r18, 0x00 ; 0 2f0f8: 30 e0 ldi r19, 0x00 ; 0 2f0fa: 48 ee ldi r20, 0xE8 ; 232 2f0fc: 53 e4 ldi r21, 0x43 ; 67 2f0fe: 60 91 42 04 lds r22, 0x0442 ; 0x800442 2f102: 70 91 43 04 lds r23, 0x0443 ; 0x800443 2f106: 80 91 44 04 lds r24, 0x0444 ; 0x800444 2f10a: 90 91 45 04 lds r25, 0x0445 ; 0x800445 2f10e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f112: 9b 01 movw r18, r22 2f114: ac 01 movw r20, r24 2f116: c5 01 movw r24, r10 2f118: b4 01 movw r22, r8 2f11a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2f11e: 18 16 cp r1, r24 2f120: 4c f5 brge .+82 ; 0x2f174 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2f122: ad 96 adiw r28, 0x2d ; 45 2f124: 2c ad ldd r18, Y+60 ; 0x3c 2f126: 3d ad ldd r19, Y+61 ; 0x3d 2f128: 4e ad ldd r20, Y+62 ; 0x3e 2f12a: 5f ad ldd r21, Y+63 ; 0x3f 2f12c: ad 97 sbiw r28, 0x2d ; 45 2f12e: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2f132: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2f136: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2f13a: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2f13e: a9 96 adiw r28, 0x29 ; 41 2f140: ee ad ldd r30, Y+62 ; 0x3e 2f142: ff ad ldd r31, Y+63 ; 0x3f 2f144: a9 97 sbiw r28, 0x29 ; 41 2f146: 80 81 ld r24, Z 2f148: 91 81 ldd r25, Z+1 ; 0x01 2f14a: a2 81 ldd r26, Z+2 ; 0x02 2f14c: b3 81 ldd r27, Z+3 ; 0x03 2f14e: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2f152: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2f156: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2f15a: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2f15e: 87 e7 ldi r24, 0x77 ; 119 2f160: 9e e9 ldi r25, 0x9E ; 158 2f162: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 2f166: 83 ee ldi r24, 0xE3 ; 227 2f168: 9c e6 ldi r25, 0x6C ; 108 2f16a: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 { 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 2f16e: 41 2c mov r4, r1 2f170: 51 2c mov r5, r1 2f172: 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); 2f174: 8e e6 ldi r24, 0x6E ; 110 2f176: 82 9d mul r24, r2 2f178: f0 01 movw r30, r0 2f17a: 83 9d mul r24, r3 2f17c: f0 0d add r31, r0 2f17e: 11 24 eor r1, r1 2f180: e8 53 subi r30, 0x38 ; 56 2f182: f9 4f sbci r31, 0xF9 ; 249 2f184: d7 01 movw r26, r14 2f186: c6 01 movw r24, r12 2f188: f7 fe sbrs r15, 7 2f18a: 07 c0 rjmp .+14 ; 0x2f19a 2f18c: 88 27 eor r24, r24 2f18e: 99 27 eor r25, r25 2f190: dc 01 movw r26, r24 2f192: 8c 19 sub r24, r12 2f194: 9d 09 sbc r25, r13 2f196: ae 09 sbc r26, r14 2f198: bf 09 sbc r27, r15 2f19a: 80 83 st Z, r24 2f19c: 91 83 std Z+1, r25 ; 0x01 2f19e: a2 83 std Z+2, r26 ; 0x02 2f1a0: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 2f1a2: 8e e6 ldi r24, 0x6E ; 110 2f1a4: 82 9d mul r24, r2 2f1a6: f0 01 movw r30, r0 2f1a8: 83 9d mul r24, r3 2f1aa: f0 0d add r31, r0 2f1ac: 11 24 eor r1, r1 2f1ae: e8 53 subi r30, 0x38 ; 56 2f1b0: f9 4f sbci r31, 0xF9 ; 249 2f1b2: 89 a5 ldd r24, Y+41 ; 0x29 2f1b4: 9a a5 ldd r25, Y+42 ; 0x2a 2f1b6: ab a5 ldd r26, Y+43 ; 0x2b 2f1b8: bc a5 ldd r27, Y+44 ; 0x2c 2f1ba: b7 ff sbrs r27, 7 2f1bc: 07 c0 rjmp .+14 ; 0x2f1cc 2f1be: b0 95 com r27 2f1c0: a0 95 com r26 2f1c2: 90 95 com r25 2f1c4: 81 95 neg r24 2f1c6: 9f 4f sbci r25, 0xFF ; 255 2f1c8: af 4f sbci r26, 0xFF ; 255 2f1ca: bf 4f sbci r27, 0xFF ; 255 2f1cc: 84 83 std Z+4, r24 ; 0x04 2f1ce: 95 83 std Z+5, r25 ; 0x05 2f1d0: a6 83 std Z+6, r26 ; 0x06 2f1d2: 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); 2f1d4: 8e e6 ldi r24, 0x6E ; 110 2f1d6: 82 9d mul r24, r2 2f1d8: f0 01 movw r30, r0 2f1da: 83 9d mul r24, r3 2f1dc: f0 0d add r31, r0 2f1de: 11 24 eor r1, r1 2f1e0: e8 53 subi r30, 0x38 ; 56 2f1e2: f9 4f sbci r31, 0xF9 ; 249 2f1e4: 8d a5 ldd r24, Y+45 ; 0x2d 2f1e6: 9e a5 ldd r25, Y+46 ; 0x2e 2f1e8: af a5 ldd r26, Y+47 ; 0x2f 2f1ea: b8 a9 ldd r27, Y+48 ; 0x30 2f1ec: b7 ff sbrs r27, 7 2f1ee: 07 c0 rjmp .+14 ; 0x2f1fe 2f1f0: b0 95 com r27 2f1f2: a0 95 com r26 2f1f4: 90 95 com r25 2f1f6: 81 95 neg r24 2f1f8: 9f 4f sbci r25, 0xFF ; 255 2f1fa: af 4f sbci r26, 0xFF ; 255 2f1fc: bf 4f sbci r27, 0xFF ; 255 2f1fe: 80 87 std Z+8, r24 ; 0x08 2f200: 91 87 std Z+9, r25 ; 0x09 2f202: a2 87 std Z+10, r26 ; 0x0a 2f204: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 2f206: b3 01 movw r22, r6 2f208: a2 01 movw r20, r4 2f20a: 77 fe sbrs r7, 7 2f20c: 07 c0 rjmp .+14 ; 0x2f21c 2f20e: 44 27 eor r20, r20 2f210: 55 27 eor r21, r21 2f212: ba 01 movw r22, r20 2f214: 44 19 sub r20, r4 2f216: 55 09 sbc r21, r5 2f218: 66 09 sbc r22, r6 2f21a: 77 09 sbc r23, r7 2f21c: 8e e6 ldi r24, 0x6E ; 110 2f21e: 82 9d mul r24, r2 2f220: f0 01 movw r30, r0 2f222: 83 9d mul r24, r3 2f224: f0 0d add r31, r0 2f226: 11 24 eor r1, r1 2f228: e8 53 subi r30, 0x38 ; 56 2f22a: f9 4f sbci r31, 0xF9 ; 249 2f22c: 44 87 std Z+12, r20 ; 0x0c 2f22e: 55 87 std Z+13, r21 ; 0x0d 2f230: 66 87 std Z+14, r22 ; 0x0e 2f232: 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))); 2f234: 00 81 ld r16, Z 2f236: 11 81 ldd r17, Z+1 ; 0x01 2f238: 22 81 ldd r18, Z+2 ; 0x02 2f23a: 33 81 ldd r19, Z+3 ; 0x03 2f23c: 84 81 ldd r24, Z+4 ; 0x04 2f23e: 95 81 ldd r25, Z+5 ; 0x05 2f240: a6 81 ldd r26, Z+6 ; 0x06 2f242: b7 81 ldd r27, Z+7 ; 0x07 2f244: 80 17 cp r24, r16 2f246: 91 07 cpc r25, r17 2f248: a2 07 cpc r26, r18 2f24a: b3 07 cpc r27, r19 2f24c: 14 f4 brge .+4 ; 0x2f252 2f24e: d9 01 movw r26, r18 2f250: c8 01 movw r24, r16 2f252: ee e6 ldi r30, 0x6E ; 110 2f254: be 2e mov r11, r30 2f256: b2 9c mul r11, r2 2f258: f0 01 movw r30, r0 2f25a: b3 9c mul r11, r3 2f25c: f0 0d add r31, r0 2f25e: 11 24 eor r1, r1 2f260: e8 53 subi r30, 0x38 ; 56 2f262: f9 4f sbci r31, 0xF9 ; 249 2f264: 80 84 ldd r8, Z+8 ; 0x08 2f266: 91 84 ldd r9, Z+9 ; 0x09 2f268: a2 84 ldd r10, Z+10 ; 0x0a 2f26a: b3 84 ldd r11, Z+11 ; 0x0b 2f26c: 88 15 cp r24, r8 2f26e: 99 05 cpc r25, r9 2f270: aa 05 cpc r26, r10 2f272: bb 05 cpc r27, r11 2f274: 14 f4 brge .+4 ; 0x2f27a 2f276: d5 01 movw r26, r10 2f278: c4 01 movw r24, r8 2f27a: 84 17 cp r24, r20 2f27c: 95 07 cpc r25, r21 2f27e: a6 07 cpc r26, r22 2f280: b7 07 cpc r27, r23 2f282: 14 f4 brge .+4 ; 0x2f288 2f284: db 01 movw r26, r22 2f286: ca 01 movw r24, r20 2f288: 4e e6 ldi r20, 0x6E ; 110 2f28a: 42 9d mul r20, r2 2f28c: f0 01 movw r30, r0 2f28e: 43 9d mul r20, r3 2f290: f0 0d add r31, r0 2f292: 11 24 eor r1, r1 2f294: e8 53 subi r30, 0x38 ; 56 2f296: f9 4f sbci r31, 0xF9 ; 249 2f298: 80 8b std Z+16, r24 ; 0x10 2f29a: 91 8b std Z+17, r25 ; 0x11 2f29c: a2 8b std Z+18, r26 ; 0x12 2f29e: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 2f2a0: 06 97 sbiw r24, 0x06 ; 6 2f2a2: a1 05 cpc r26, r1 2f2a4: b1 05 cpc r27, r1 2f2a6: 0c f4 brge .+2 ; 0x2f2aa 2f2a8: 94 cd rjmp .-1240 ; 0x2edd2 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 2f2aa: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 2f2ae: df 01 movw r26, r30 2f2b0: aa 5b subi r26, 0xBA ; 186 2f2b2: bf 4f sbci r27, 0xFF ; 255 2f2b4: 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); 2f2b6: f7 fe sbrs r15, 7 2f2b8: 02 c0 rjmp .+4 ; 0x2f2be 2f2ba: 0d 94 86 81 jmp 0x3030c ; 0x3030c } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 2f2be: 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); 2f2c0: 89 a5 ldd r24, Y+41 ; 0x29 2f2c2: 9a a5 ldd r25, Y+42 ; 0x2a 2f2c4: ab a5 ldd r26, Y+43 ; 0x2b 2f2c6: bc a5 ldd r27, Y+44 ; 0x2c 2f2c8: b7 ff sbrs r27, 7 2f2ca: 0b c0 rjmp .+22 ; 0x2f2e2 2f2cc: 8e e6 ldi r24, 0x6E ; 110 2f2ce: 82 9d mul r24, r2 2f2d0: f0 01 movw r30, r0 2f2d2: 83 9d mul r24, r3 2f2d4: f0 0d add r31, r0 2f2d6: 11 24 eor r1, r1 2f2d8: e8 53 subi r30, 0x38 ; 56 2f2da: f9 4f sbci r31, 0xF9 ; 249 2f2dc: 80 8d ldd r24, Z+24 ; 0x18 2f2de: 82 60 ori r24, 0x02 ; 2 2f2e0: 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); 2f2e2: 8d a5 ldd r24, Y+45 ; 0x2d 2f2e4: 9e a5 ldd r25, Y+46 ; 0x2e 2f2e6: af a5 ldd r26, Y+47 ; 0x2f 2f2e8: b8 a9 ldd r27, Y+48 ; 0x30 2f2ea: b7 ff sbrs r27, 7 2f2ec: 0b c0 rjmp .+22 ; 0x2f304 2f2ee: 8e e6 ldi r24, 0x6E ; 110 2f2f0: 82 9d mul r24, r2 2f2f2: f0 01 movw r30, r0 2f2f4: 83 9d mul r24, r3 2f2f6: f0 0d add r31, r0 2f2f8: 11 24 eor r1, r1 2f2fa: e8 53 subi r30, 0x38 ; 56 2f2fc: f9 4f sbci r31, 0xF9 ; 249 2f2fe: 80 8d ldd r24, Z+24 ; 0x18 2f300: 84 60 ori r24, 0x04 ; 4 2f302: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 2f304: 77 fe sbrs r7, 7 2f306: 0b c0 rjmp .+22 ; 0x2f31e 2f308: 8e e6 ldi r24, 0x6E ; 110 2f30a: 82 9d mul r24, r2 2f30c: f0 01 movw r30, r0 2f30e: 83 9d mul r24, r3 2f310: f0 0d add r31, r0 2f312: 11 24 eor r1, r1 2f314: e8 53 subi r30, 0x38 ; 56 2f316: f9 4f sbci r31, 0xF9 ; 249 2f318: 80 8d ldd r24, Z+24 ; 0x18 2f31a: 88 60 ori r24, 0x08 ; 8 2f31c: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 2f31e: 01 2b or r16, r17 2f320: 02 2b or r16, r18 2f322: 03 2b or r16, r19 2f324: 09 f0 breq .+2 ; 0x2f328 2f326: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 2f328: 8e e6 ldi r24, 0x6E ; 110 2f32a: 82 9d mul r24, r2 2f32c: f0 01 movw r30, r0 2f32e: 83 9d mul r24, r3 2f330: f0 0d add r31, r0 2f332: 11 24 eor r1, r1 2f334: e8 53 subi r30, 0x38 ; 56 2f336: f9 4f sbci r31, 0xF9 ; 249 2f338: 84 81 ldd r24, Z+4 ; 0x04 2f33a: 95 81 ldd r25, Z+5 ; 0x05 2f33c: a6 81 ldd r26, Z+6 ; 0x06 2f33e: b7 81 ldd r27, Z+7 ; 0x07 2f340: 89 2b or r24, r25 2f342: 8a 2b or r24, r26 2f344: 8b 2b or r24, r27 2f346: 09 f0 breq .+2 ; 0x2f34a 2f348: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 2f34a: 8e e6 ldi r24, 0x6E ; 110 2f34c: 82 9d mul r24, r2 2f34e: f0 01 movw r30, r0 2f350: 83 9d mul r24, r3 2f352: f0 0d add r31, r0 2f354: 11 24 eor r1, r1 2f356: e8 53 subi r30, 0x38 ; 56 2f358: f9 4f sbci r31, 0xF9 ; 249 2f35a: 80 85 ldd r24, Z+8 ; 0x08 2f35c: 91 85 ldd r25, Z+9 ; 0x09 2f35e: a2 85 ldd r26, Z+10 ; 0x0a 2f360: b3 85 ldd r27, Z+11 ; 0x0b 2f362: 89 2b or r24, r25 2f364: 8a 2b or r24, r26 2f366: 8b 2b or r24, r27 2f368: 09 f0 breq .+2 ; 0x2f36c 2f36a: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 2f36c: 8e e6 ldi r24, 0x6E ; 110 2f36e: 82 9d mul r24, r2 2f370: f0 01 movw r30, r0 2f372: 83 9d mul r24, r3 2f374: f0 0d add r31, r0 2f376: 11 24 eor r1, r1 2f378: e8 53 subi r30, 0x38 ; 56 2f37a: f9 4f sbci r31, 0xF9 ; 249 2f37c: 84 85 ldd r24, Z+12 ; 0x0c 2f37e: 95 85 ldd r25, Z+13 ; 0x0d 2f380: a6 85 ldd r26, Z+14 ; 0x0e 2f382: b7 85 ldd r27, Z+15 ; 0x0f 2f384: 89 2b or r24, r25 2f386: 8a 2b or r24, r26 2f388: 8b 2b or r24, r27 2f38a: 09 f0 breq .+2 ; 0x2f38e 2f38c: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 2f38e: 8e e6 ldi r24, 0x6E ; 110 2f390: 82 9d mul r24, r2 2f392: f0 01 movw r30, r0 2f394: 83 9d mul r24, r3 2f396: f0 0d add r31, r0 2f398: 11 24 eor r1, r1 2f39a: e8 53 subi r30, 0x38 ; 56 2f39c: f9 4f sbci r31, 0xF9 ; 249 2f39e: 24 85 ldd r18, Z+12 ; 0x0c 2f3a0: 35 85 ldd r19, Z+13 ; 0x0d 2f3a2: 46 85 ldd r20, Z+14 ; 0x0e 2f3a4: 57 85 ldd r21, Z+15 ; 0x0f 2f3a6: 2a 96 adiw r28, 0x0a ; 10 2f3a8: 2c af std Y+60, r18 ; 0x3c 2f3aa: 3d af std Y+61, r19 ; 0x3d 2f3ac: 4e af std Y+62, r20 ; 0x3e 2f3ae: 5f af std Y+63, r21 ; 0x3f 2f3b0: 2a 97 sbiw r28, 0x0a ; 10 2f3b2: 23 2b or r18, r19 2f3b4: 24 2b or r18, r20 2f3b6: 25 2b or r18, r21 2f3b8: 09 f0 breq .+2 ; 0x2f3bc 2f3ba: ac c7 rjmp .+3928 ; 0x30314 { if(feed_rate 2f3c0: b0 90 73 04 lds r11, 0x0473 ; 0x800473 2f3c4: 00 91 74 04 lds r16, 0x0474 ; 0x800474 2f3c8: 10 91 75 04 lds r17, 0x0475 ; 0x800475 } else { if(feed_rate 2f3dc: 18 16 cp r1, r24 2f3de: 24 f4 brge .+8 ; 0x2f3e8 2f3e0: a9 ae std Y+57, r10 ; 0x39 2f3e2: b9 aa std Y+49, r11 ; 0x31 2f3e4: 0d af std Y+61, r16 ; 0x3d 2f3e6: 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]; 2f3e8: c7 01 movw r24, r14 2f3ea: b6 01 movw r22, r12 2f3ec: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2f3f0: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2f3f4: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2f3f8: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2f3fc: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2f400: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f404: 4b 01 movw r8, r22 2f406: 5c 01 movw r10, r24 2f408: 89 82 std Y+1, r8 ; 0x01 2f40a: 9a 82 std Y+2, r9 ; 0x02 2f40c: ab 82 std Y+3, r10 ; 0x03 2f40e: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 2f410: 69 a5 ldd r22, Y+41 ; 0x29 2f412: 7a a5 ldd r23, Y+42 ; 0x2a 2f414: 8b a5 ldd r24, Y+43 ; 0x2b 2f416: 9c a5 ldd r25, Y+44 ; 0x2c 2f418: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2f41c: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2f420: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2f424: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2f428: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2f42c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f430: 6b 01 movw r12, r22 2f432: 7c 01 movw r14, r24 2f434: cd 82 std Y+5, r12 ; 0x05 2f436: de 82 std Y+6, r13 ; 0x06 2f438: ef 82 std Y+7, r14 ; 0x07 2f43a: 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]; 2f43c: 6d a5 ldd r22, Y+45 ; 0x2d 2f43e: 7e a5 ldd r23, Y+46 ; 0x2e 2f440: 8f a5 ldd r24, Y+47 ; 0x2f 2f442: 98 a9 ldd r25, Y+48 ; 0x30 2f444: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2f448: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2f44c: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2f450: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2f454: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2f458: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f45c: 22 96 adiw r28, 0x02 ; 2 2f45e: 6c af std Y+60, r22 ; 0x3c 2f460: 7d af std Y+61, r23 ; 0x3d 2f462: 8e af std Y+62, r24 ; 0x3e 2f464: 9f af std Y+63, r25 ; 0x3f 2f466: 22 97 sbiw r28, 0x02 ; 2 2f468: 69 87 std Y+9, r22 ; 0x09 2f46a: 7a 87 std Y+10, r23 ; 0x0a 2f46c: 8b 87 std Y+11, r24 ; 0x0b 2f46e: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 2f470: c3 01 movw r24, r6 2f472: b2 01 movw r22, r4 2f474: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 2f478: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2f47c: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2f480: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2f484: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2f488: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f48c: 26 96 adiw r28, 0x06 ; 6 2f48e: 6c af std Y+60, r22 ; 0x3c 2f490: 7d af std Y+61, r23 ; 0x3d 2f492: 8e af std Y+62, r24 ; 0x3e 2f494: 9f af std Y+63, r25 ; 0x3f 2f496: 26 97 sbiw r28, 0x06 ; 6 2f498: 6d 87 std Y+13, r22 ; 0x0d 2f49a: 7e 87 std Y+14, r23 ; 0x0e 2f49c: 8f 87 std Y+15, r24 ; 0x0f 2f49e: 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 ) 2f4a0: 8e e6 ldi r24, 0x6E ; 110 2f4a2: 82 9d mul r24, r2 2f4a4: f0 01 movw r30, r0 2f4a6: 83 9d mul r24, r3 2f4a8: f0 0d add r31, r0 2f4aa: 11 24 eor r1, r1 2f4ac: e8 53 subi r30, 0x38 ; 56 2f4ae: f9 4f sbci r31, 0xF9 ; 249 2f4b0: 80 81 ld r24, Z 2f4b2: 91 81 ldd r25, Z+1 ; 0x01 2f4b4: a2 81 ldd r26, Z+2 ; 0x02 2f4b6: b3 81 ldd r27, Z+3 ; 0x03 2f4b8: 2e 96 adiw r28, 0x0e ; 14 2f4ba: 8c af std Y+60, r24 ; 0x3c 2f4bc: 9d af std Y+61, r25 ; 0x3d 2f4be: ae af std Y+62, r26 ; 0x3e 2f4c0: bf af std Y+63, r27 ; 0x3f 2f4c2: 2e 97 sbiw r28, 0x0e ; 14 2f4c4: 06 97 sbiw r24, 0x06 ; 6 2f4c6: a1 05 cpc r26, r1 2f4c8: b1 05 cpc r27, r1 2f4ca: 0c f0 brlt .+2 ; 0x2f4ce 2f4cc: 2c c7 rjmp .+3672 ; 0x30326 2f4ce: 84 81 ldd r24, Z+4 ; 0x04 2f4d0: 95 81 ldd r25, Z+5 ; 0x05 2f4d2: a6 81 ldd r26, Z+6 ; 0x06 2f4d4: b7 81 ldd r27, Z+7 ; 0x07 2f4d6: 06 97 sbiw r24, 0x06 ; 6 2f4d8: a1 05 cpc r26, r1 2f4da: b1 05 cpc r27, r1 2f4dc: 0c f0 brlt .+2 ; 0x2f4e0 2f4de: 23 c7 rjmp .+3654 ; 0x30326 2f4e0: 80 85 ldd r24, Z+8 ; 0x08 2f4e2: 91 85 ldd r25, Z+9 ; 0x09 2f4e4: a2 85 ldd r26, Z+10 ; 0x0a 2f4e6: b3 85 ldd r27, Z+11 ; 0x0b 2f4e8: 06 97 sbiw r24, 0x06 ; 6 2f4ea: a1 05 cpc r26, r1 2f4ec: b1 05 cpc r27, r1 2f4ee: 0c f0 brlt .+2 ; 0x2f4f2 2f4f0: 1a c7 rjmp .+3636 ; 0x30326 { block->millimeters = fabs(delta_mm[E_AXIS]); 2f4f2: 26 96 adiw r28, 0x06 ; 6 2f4f4: 8c ad ldd r24, Y+60 ; 0x3c 2f4f6: 9d ad ldd r25, Y+61 ; 0x3d 2f4f8: ae ad ldd r26, Y+62 ; 0x3e 2f4fa: bf ad ldd r27, Y+63 ; 0x3f 2f4fc: 26 97 sbiw r28, 0x06 ; 6 2f4fe: bf 77 andi r27, 0x7F ; 127 2f500: 85 a7 std Z+45, r24 ; 0x2d 2f502: 96 a7 std Z+46, r25 ; 0x2e 2f504: a7 a7 std Z+47, r26 ; 0x2f 2f506: 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 2f508: 8e e6 ldi r24, 0x6E ; 110 2f50a: 82 9d mul r24, r2 2f50c: f0 01 movw r30, r0 2f50e: 83 9d mul r24, r3 2f510: f0 0d add r31, r0 2f512: 11 24 eor r1, r1 2f514: e8 53 subi r30, 0x38 ; 56 2f516: f9 4f sbci r31, 0xF9 ; 249 2f518: 45 a4 ldd r4, Z+45 ; 0x2d 2f51a: 56 a4 ldd r5, Z+46 ; 0x2e 2f51c: 67 a4 ldd r6, Z+47 ; 0x2f 2f51e: 70 a8 ldd r7, Z+48 ; 0x30 2f520: a3 01 movw r20, r6 2f522: 92 01 movw r18, r4 2f524: 60 e0 ldi r22, 0x00 ; 0 2f526: 70 e0 ldi r23, 0x00 ; 0 2f528: 80 e8 ldi r24, 0x80 ; 128 2f52a: 9f e3 ldi r25, 0x3F ; 63 2f52c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 2f530: 29 ad ldd r18, Y+57 ; 0x39 2f532: 39 a9 ldd r19, Y+49 ; 0x31 2f534: 4d ad ldd r20, Y+61 ; 0x3d 2f536: 5d a9 ldd r21, Y+53 ; 0x35 2f538: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f53c: 6b 01 movw r12, r22 2f53e: 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); 2f540: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2f544: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2f548: 89 1b sub r24, r25 2f54a: 8f 70 andi r24, 0x0F ; 15 2f54c: 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)) { 2f54e: 82 50 subi r24, 0x02 ; 2 2f550: 86 30 cpi r24, 0x06 ; 6 2f552: 08 f0 brcs .+2 ; 0x2f556 2f554: 40 c0 rjmp .+128 ; 0x2f5d6 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 2f556: a7 01 movw r20, r14 2f558: 96 01 movw r18, r12 2f55a: 60 e0 ldi r22, 0x00 ; 0 2f55c: 74 e2 ldi r23, 0x24 ; 36 2f55e: 84 e7 ldi r24, 0x74 ; 116 2f560: 99 e4 ldi r25, 0x49 ; 73 2f562: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f566: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 2f56a: 4b 01 movw r8, r22 2f56c: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 2f56e: 80 91 76 04 lds r24, 0x0476 ; 0x800476 2f572: 90 91 77 04 lds r25, 0x0477 ; 0x800477 2f576: a0 91 78 04 lds r26, 0x0478 ; 0x800478 2f57a: b0 91 79 04 lds r27, 0x0479 ; 0x800479 2f57e: 88 16 cp r8, r24 2f580: 99 06 cpc r9, r25 2f582: aa 06 cpc r10, r26 2f584: bb 06 cpc r11, r27 2f586: 38 f5 brcc .+78 ; 0x2f5d6 // 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)); 2f588: bc 01 movw r22, r24 2f58a: cd 01 movw r24, r26 2f58c: 68 19 sub r22, r8 2f58e: 79 09 sbc r23, r9 2f590: 8a 09 sbc r24, r10 2f592: 9b 09 sbc r25, r11 2f594: 66 0f add r22, r22 2f596: 77 1f adc r23, r23 2f598: 88 1f adc r24, r24 2f59a: 99 1f adc r25, r25 2f59c: ad ad ldd r26, Y+61 ; 0x3d 2f59e: 2a 2f mov r18, r26 2f5a0: 30 e0 ldi r19, 0x00 ; 0 2f5a2: 50 e0 ldi r21, 0x00 ; 0 2f5a4: 40 e0 ldi r20, 0x00 ; 0 2f5a6: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 2f5aa: ca 01 movw r24, r20 2f5ac: b9 01 movw r22, r18 2f5ae: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2f5b2: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 2f5b6: 68 0d add r22, r8 2f5b8: 79 1d adc r23, r9 2f5ba: 8a 1d adc r24, r10 2f5bc: 9b 1d adc r25, r11 2f5be: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2f5c2: 9b 01 movw r18, r22 2f5c4: ac 01 movw r20, r24 2f5c6: 60 e0 ldi r22, 0x00 ; 0 2f5c8: 74 e2 ldi r23, 0x24 ; 36 2f5ca: 84 e7 ldi r24, 0x74 ; 116 2f5cc: 99 e4 ldi r25, 0x49 ; 73 2f5ce: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f5d2: 6b 01 movw r12, r22 2f5d4: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 2f5d6: a3 01 movw r20, r6 2f5d8: 92 01 movw r18, r4 2f5da: c7 01 movw r24, r14 2f5dc: b6 01 movw r22, r12 2f5de: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f5e2: 6d ab std Y+53, r22 ; 0x35 2f5e4: 7e ab std Y+54, r23 ; 0x36 2f5e6: 8f ab std Y+55, r24 ; 0x37 2f5e8: 98 af std Y+56, r25 ; 0x38 2f5ea: 8e e6 ldi r24, 0x6E ; 110 2f5ec: 82 9d mul r24, r2 2f5ee: 80 01 movw r16, r0 2f5f0: 83 9d mul r24, r3 2f5f2: 10 0d add r17, r0 2f5f4: 11 24 eor r1, r1 2f5f6: 08 53 subi r16, 0x38 ; 56 2f5f8: 19 4f sbci r17, 0xF9 ; 249 2f5fa: 2d a9 ldd r18, Y+53 ; 0x35 2f5fc: 3e a9 ldd r19, Y+54 ; 0x36 2f5fe: 4f a9 ldd r20, Y+55 ; 0x37 2f600: 58 ad ldd r21, Y+56 ; 0x38 2f602: d8 01 movw r26, r16 2f604: 91 96 adiw r26, 0x21 ; 33 2f606: 2d 93 st X+, r18 2f608: 3d 93 st X+, r19 2f60a: 4d 93 st X+, r20 2f60c: 5c 93 st X, r21 2f60e: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 2f610: 50 96 adiw r26, 0x10 ; 16 2f612: 6d 91 ld r22, X+ 2f614: 7d 91 ld r23, X+ 2f616: 8d 91 ld r24, X+ 2f618: 9c 91 ld r25, X 2f61a: 53 97 sbiw r26, 0x13 ; 19 2f61c: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2f620: 69 af std Y+57, r22 ; 0x39 2f622: 7a af std Y+58, r23 ; 0x3a 2f624: 8b af std Y+59, r24 ; 0x3b 2f626: 9c af std Y+60, r25 ; 0x3c 2f628: 9b 01 movw r18, r22 2f62a: ac 01 movw r20, r24 2f62c: c7 01 movw r24, r14 2f62e: b6 01 movw r22, r12 2f630: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f634: 0f 94 42 a3 call 0x34684 ; 0x34684 2f638: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2f63c: 62 96 adiw r28, 0x12 ; 18 2f63e: 6c af std Y+60, r22 ; 0x3c 2f640: 7d af std Y+61, r23 ; 0x3d 2f642: 8e af std Y+62, r24 ; 0x3e 2f644: 9f af std Y+63, r25 ; 0x3f 2f646: 62 97 sbiw r28, 0x12 ; 18 2f648: f8 01 movw r30, r16 2f64a: 66 ab std Z+54, r22 ; 0x36 2f64c: 77 ab std Z+55, r23 ; 0x37 2f64e: 80 af std Z+56, r24 ; 0x38 2f650: 91 af std Z+57, r25 ; 0x39 2f652: 9e 01 movw r18, r28 2f654: 2f 5f subi r18, 0xFF ; 255 2f656: 3f 4f sbci r19, 0xFF ; 255 2f658: 3a ab std Y+50, r19 ; 0x32 2f65a: 29 ab std Y+49, r18 ; 0x31 2f65c: ae 01 movw r20, r28 2f65e: 4f 5e subi r20, 0xEF ; 239 2f660: 5f 4f sbci r21, 0xFF ; 255 2f662: 6e 96 adiw r28, 0x1e ; 30 2f664: 5f af std Y+63, r21 ; 0x3f 2f666: 4e af std Y+62, r20 ; 0x3e 2f668: 6e 97 sbiw r28, 0x1e ; 30 2f66a: 86 e4 ldi r24, 0x46 ; 70 2f66c: 94 e0 ldi r25, 0x04 ; 4 2f66e: 68 96 adiw r28, 0x18 ; 24 2f670: 9f af std Y+63, r25 ; 0x3f 2f672: 8e af std Y+62, r24 ; 0x3e 2f674: 68 97 sbiw r28, 0x18 ; 24 2f676: 6c 96 adiw r28, 0x1c ; 28 2f678: 5f af std Y+63, r21 ; 0x3f 2f67a: 4e af std Y+62, r20 ; 0x3e 2f67c: 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 2f67e: 19 a6 std Y+41, r1 ; 0x29 2f680: 1d a6 std Y+45, r1 ; 0x2d 2f682: 00 e8 ldi r16, 0x80 ; 128 2f684: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 2f686: a9 a9 ldd r26, Y+49 ; 0x31 2f688: ba a9 ldd r27, Y+50 ; 0x32 2f68a: 2d 91 ld r18, X+ 2f68c: 3d 91 ld r19, X+ 2f68e: 4d 91 ld r20, X+ 2f690: 5d 91 ld r21, X+ 2f692: ba ab std Y+50, r27 ; 0x32 2f694: a9 ab std Y+49, r26 ; 0x31 2f696: c7 01 movw r24, r14 2f698: b6 01 movw r22, r12 2f69a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f69e: 6c 96 adiw r28, 0x1c ; 28 2f6a0: ee ad ldd r30, Y+62 ; 0x3e 2f6a2: ff ad ldd r31, Y+63 ; 0x3f 2f6a4: 6c 97 sbiw r28, 0x1c ; 28 2f6a6: 61 93 st Z+, r22 2f6a8: 71 93 st Z+, r23 2f6aa: 81 93 st Z+, r24 2f6ac: 91 93 st Z+, r25 2f6ae: 6c 96 adiw r28, 0x1c ; 28 2f6b0: ff af std Y+63, r31 ; 0x3f 2f6b2: ee af std Y+62, r30 ; 0x3e 2f6b4: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 2f6b6: 4b 01 movw r8, r22 2f6b8: 5c 01 movw r10, r24 2f6ba: e8 94 clt 2f6bc: b7 f8 bld r11, 7 2f6be: 68 96 adiw r28, 0x18 ; 24 2f6c0: ae ad ldd r26, Y+62 ; 0x3e 2f6c2: bf ad ldd r27, Y+63 ; 0x3f 2f6c4: 68 97 sbiw r28, 0x18 ; 24 2f6c6: 2d 91 ld r18, X+ 2f6c8: 3d 91 ld r19, X+ 2f6ca: 4d 91 ld r20, X+ 2f6cc: 5d 91 ld r21, X+ 2f6ce: 68 96 adiw r28, 0x18 ; 24 2f6d0: bf af std Y+63, r27 ; 0x3f 2f6d2: ae af std Y+62, r26 ; 0x3e 2f6d4: 68 97 sbiw r28, 0x18 ; 24 2f6d6: 66 96 adiw r28, 0x16 ; 22 2f6d8: 2c af std Y+60, r18 ; 0x3c 2f6da: 3d af std Y+61, r19 ; 0x3d 2f6dc: 4e af std Y+62, r20 ; 0x3e 2f6de: 5f af std Y+63, r21 ; 0x3f 2f6e0: 66 97 sbiw r28, 0x16 ; 22 2f6e2: c5 01 movw r24, r10 2f6e4: b4 01 movw r22, r8 2f6e6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2f6ea: 18 16 cp r1, r24 2f6ec: b4 f4 brge .+44 ; 0x2f71a { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 2f6ee: a5 01 movw r20, r10 2f6f0: 94 01 movw r18, r8 2f6f2: 66 96 adiw r28, 0x16 ; 22 2f6f4: 6c ad ldd r22, Y+60 ; 0x3c 2f6f6: 7d ad ldd r23, Y+61 ; 0x3d 2f6f8: 8e ad ldd r24, Y+62 ; 0x3e 2f6fa: 9f ad ldd r25, Y+63 ; 0x3f 2f6fc: 66 97 sbiw r28, 0x16 ; 22 2f6fe: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f702: 4b 01 movw r8, r22 2f704: 5c 01 movw r10, r24 2f706: 29 a5 ldd r18, Y+41 ; 0x29 2f708: 3d a5 ldd r19, Y+45 ; 0x2d 2f70a: a8 01 movw r20, r16 2f70c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2f710: 18 16 cp r1, r24 2f712: 1c f0 brlt .+6 ; 0x2f71a 2f714: 89 a6 std Y+41, r8 ; 0x29 2f716: 9d a6 std Y+45, r9 ; 0x2d 2f718: 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++) 2f71a: 6e 96 adiw r28, 0x1e ; 30 2f71c: ee ad ldd r30, Y+62 ; 0x3e 2f71e: ff ad ldd r31, Y+63 ; 0x3f 2f720: 6e 97 sbiw r28, 0x1e ; 30 2f722: 29 a9 ldd r18, Y+49 ; 0x31 2f724: 3a a9 ldd r19, Y+50 ; 0x32 2f726: e2 17 cp r30, r18 2f728: f3 07 cpc r31, r19 2f72a: 09 f0 breq .+2 ; 0x2f72e 2f72c: ac cf rjmp .-168 ; 0x2f686 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 2f72e: 20 e0 ldi r18, 0x00 ; 0 2f730: 30 e0 ldi r19, 0x00 ; 0 2f732: 40 e8 ldi r20, 0x80 ; 128 2f734: 5f e3 ldi r21, 0x3F ; 63 2f736: 69 a5 ldd r22, Y+41 ; 0x29 2f738: 7d a5 ldd r23, Y+45 ; 0x2d 2f73a: c8 01 movw r24, r16 2f73c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2f740: 87 ff sbrs r24, 7 2f742: 50 c0 rjmp .+160 ; 0x2f7e4 2f744: 6e 96 adiw r28, 0x1e ; 30 2f746: ae ac ldd r10, Y+62 ; 0x3e 2f748: bf ac ldd r11, Y+63 ; 0x3f 2f74a: 6e 97 sbiw r28, 0x1e ; 30 2f74c: 30 e1 ldi r19, 0x10 ; 16 2f74e: a3 0e add r10, r19 2f750: b1 1c adc r11, r1 2f752: 6e 96 adiw r28, 0x1e ; 30 2f754: ce ac ldd r12, Y+62 ; 0x3e 2f756: df ac ldd r13, Y+63 ; 0x3f 2f758: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 2f75a: d6 01 movw r26, r12 2f75c: 6d 91 ld r22, X+ 2f75e: 7d 91 ld r23, X+ 2f760: 8d 91 ld r24, X+ 2f762: 9d 91 ld r25, X+ 2f764: 6d 01 movw r12, r26 2f766: 7d 01 movw r14, r26 2f768: b4 e0 ldi r27, 0x04 ; 4 2f76a: eb 1a sub r14, r27 2f76c: f1 08 sbc r15, r1 2f76e: 29 a5 ldd r18, Y+41 ; 0x29 2f770: 3d a5 ldd r19, Y+45 ; 0x2d 2f772: a8 01 movw r20, r16 2f774: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f778: f7 01 movw r30, r14 2f77a: 60 83 st Z, r22 2f77c: 71 83 std Z+1, r23 ; 0x01 2f77e: 82 83 std Z+2, r24 ; 0x02 2f780: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 2f782: ac 14 cp r10, r12 2f784: bd 04 cpc r11, r13 2f786: 49 f7 brne .-46 ; 0x2f75a { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 2f788: 2e e6 ldi r18, 0x6E ; 110 2f78a: 22 9d mul r18, r2 2f78c: c0 01 movw r24, r0 2f78e: 23 9d mul r18, r3 2f790: 90 0d add r25, r0 2f792: 11 24 eor r1, r1 2f794: 9c 01 movw r18, r24 2f796: 28 53 subi r18, 0x38 ; 56 2f798: 39 4f sbci r19, 0xF9 ; 249 2f79a: 79 01 movw r14, r18 2f79c: 29 a5 ldd r18, Y+41 ; 0x29 2f79e: 3d a5 ldd r19, Y+45 ; 0x2d 2f7a0: a8 01 movw r20, r16 2f7a2: 6d a9 ldd r22, Y+53 ; 0x35 2f7a4: 7e a9 ldd r23, Y+54 ; 0x36 2f7a6: 8f a9 ldd r24, Y+55 ; 0x37 2f7a8: 98 ad ldd r25, Y+56 ; 0x38 2f7aa: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f7ae: d7 01 movw r26, r14 2f7b0: 91 96 adiw r26, 0x21 ; 33 2f7b2: 6d 93 st X+, r22 2f7b4: 7d 93 st X+, r23 2f7b6: 8d 93 st X+, r24 2f7b8: 9c 93 st X, r25 2f7ba: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 2f7bc: 62 96 adiw r28, 0x12 ; 18 2f7be: 6c ad ldd r22, Y+60 ; 0x3c 2f7c0: 7d ad ldd r23, Y+61 ; 0x3d 2f7c2: 8e ad ldd r24, Y+62 ; 0x3e 2f7c4: 9f ad ldd r25, Y+63 ; 0x3f 2f7c6: 62 97 sbiw r28, 0x12 ; 18 2f7c8: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2f7cc: 29 a5 ldd r18, Y+41 ; 0x29 2f7ce: 3d a5 ldd r19, Y+45 ; 0x2d 2f7d0: a8 01 movw r20, r16 2f7d2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f7d6: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2f7da: f7 01 movw r30, r14 2f7dc: 66 ab std Z+54, r22 ; 0x36 2f7de: 77 ab std Z+55, r23 ; 0x37 2f7e0: 80 af std Z+56, r24 ; 0x38 2f7e2: 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; 2f7e4: a3 01 movw r20, r6 2f7e6: 92 01 movw r18, r4 2f7e8: 69 ad ldd r22, Y+57 ; 0x39 2f7ea: 7a ad ldd r23, Y+58 ; 0x3a 2f7ec: 8b ad ldd r24, Y+59 ; 0x3b 2f7ee: 9c ad ldd r25, Y+60 ; 0x3c 2f7f0: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f7f4: 69 a7 std Y+41, r22 ; 0x29 2f7f6: 7a a7 std Y+42, r23 ; 0x2a 2f7f8: 8b a7 std Y+43, r24 ; 0x2b 2f7fa: 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) 2f7fc: 2e 96 adiw r28, 0x0e ; 14 2f7fe: 2c ad ldd r18, Y+60 ; 0x3c 2f800: 3d ad ldd r19, Y+61 ; 0x3d 2f802: 4e ad ldd r20, Y+62 ; 0x3e 2f804: 5f ad ldd r21, Y+63 ; 0x3f 2f806: 2e 97 sbiw r28, 0x0e ; 14 2f808: 23 2b or r18, r19 2f80a: 24 2b or r18, r20 2f80c: 25 2b or r18, r21 2f80e: 09 f0 breq .+2 ; 0x2f812 2f810: b9 c5 rjmp .+2930 ; 0x30384 2f812: 8e e6 ldi r24, 0x6E ; 110 2f814: 82 9d mul r24, r2 2f816: 80 01 movw r16, r0 2f818: 83 9d mul r24, r3 2f81a: 10 0d add r17, r0 2f81c: 11 24 eor r1, r1 2f81e: 08 53 subi r16, 0x38 ; 56 2f820: 19 4f sbci r17, 0xF9 ; 249 2f822: f8 01 movw r30, r16 2f824: 84 81 ldd r24, Z+4 ; 0x04 2f826: 95 81 ldd r25, Z+5 ; 0x05 2f828: a6 81 ldd r26, Z+6 ; 0x06 2f82a: b7 81 ldd r27, Z+7 ; 0x07 2f82c: 89 2b or r24, r25 2f82e: 8a 2b or r24, r26 2f830: 8b 2b or r24, r27 2f832: 09 f0 breq .+2 ; 0x2f836 2f834: a7 c5 rjmp .+2894 ; 0x30384 2f836: 80 85 ldd r24, Z+8 ; 0x08 2f838: 91 85 ldd r25, Z+9 ; 0x09 2f83a: a2 85 ldd r26, Z+10 ; 0x0a 2f83c: b3 85 ldd r27, Z+11 ; 0x0b 2f83e: 89 2b or r24, r25 2f840: 8a 2b or r24, r26 2f842: 8b 2b or r24, r27 2f844: 09 f0 breq .+2 ; 0x2f848 2f846: 9e c5 rjmp .+2876 ; 0x30384 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 2f848: 20 91 6a 04 lds r18, 0x046A ; 0x80046a 2f84c: 30 91 6b 04 lds r19, 0x046B ; 0x80046b 2f850: 40 91 6c 04 lds r20, 0x046C ; 0x80046c 2f854: 50 91 6d 04 lds r21, 0x046D ; 0x80046d 2f858: 69 a5 ldd r22, Y+41 ; 0x29 2f85a: 7a a5 ldd r23, Y+42 ; 0x2a 2f85c: 8b a5 ldd r24, Y+43 ; 0x2b 2f85e: 9c a5 ldd r25, Y+44 ; 0x2c 2f860: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f864: 0f 94 42 a3 call 0x34684 ; 0x34684 2f868: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2f86c: 2b 01 movw r4, r22 2f86e: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 2f870: f8 01 movw r30, r16 2f872: e4 5b subi r30, 0xB4 ; 180 2f874: ff 4f sbci r31, 0xFF ; 255 2f876: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 2f878: 6a 96 adiw r28, 0x1a ; 26 2f87a: 1c ae std Y+60, r1 ; 0x3c 2f87c: 1d ae std Y+61, r1 ; 0x3d 2f87e: 1e ae std Y+62, r1 ; 0x3e 2f880: 1f ae std Y+63, r1 ; 0x3f 2f882: 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; 2f884: 8e e6 ldi r24, 0x6E ; 110 2f886: 82 9d mul r24, r2 2f888: 80 01 movw r16, r0 2f88a: 83 9d mul r24, r3 2f88c: 10 0d add r17, r0 2f88e: 11 24 eor r1, r1 2f890: 08 53 subi r16, 0x38 ; 56 2f892: 19 4f sbci r17, 0xF9 ; 249 2f894: f8 01 movw r30, r16 2f896: ee 5b subi r30, 0xBE ; 190 2f898: ff 4f sbci r31, 0xFF ; 255 2f89a: 40 82 st Z, r4 2f89c: 51 82 std Z+1, r5 ; 0x01 2f89e: 62 82 std Z+2, r6 ; 0x02 2f8a0: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 2f8a2: c3 01 movw r24, r6 2f8a4: b2 01 movw r22, r4 2f8a6: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2f8aa: 6b 01 movw r12, r22 2f8ac: 7c 01 movw r14, r24 2f8ae: 29 a5 ldd r18, Y+41 ; 0x29 2f8b0: 3a a5 ldd r19, Y+42 ; 0x2a 2f8b2: 4b a5 ldd r20, Y+43 ; 0x2b 2f8b4: 5c a5 ldd r21, Y+44 ; 0x2c 2f8b6: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f8ba: e1 96 adiw r28, 0x31 ; 49 2f8bc: 6c af std Y+60, r22 ; 0x3c 2f8be: 7d af std Y+61, r23 ; 0x3d 2f8c0: 8e af std Y+62, r24 ; 0x3e 2f8c2: 9f af std Y+63, r25 ; 0x3f 2f8c4: e1 97 sbiw r28, 0x31 ; 49 2f8c6: f8 01 movw r30, r16 2f8c8: 61 ab std Z+49, r22 ; 0x31 2f8ca: 72 ab std Z+50, r23 ; 0x32 2f8cc: 83 ab std Z+51, r24 ; 0x33 2f8ce: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 2f8d0: 2d eb ldi r18, 0xBD ; 189 2f8d2: 37 e3 ldi r19, 0x37 ; 55 2f8d4: 46 e0 ldi r20, 0x06 ; 6 2f8d6: 51 e4 ldi r21, 0x41 ; 65 2f8d8: c7 01 movw r24, r14 2f8da: b6 01 movw r22, r12 2f8dc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f8e0: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2f8e4: d8 01 movw r26, r16 2f8e6: 54 96 adiw r26, 0x14 ; 20 2f8e8: 6d 93 st X+, r22 2f8ea: 7d 93 st X+, r23 2f8ec: 8d 93 st X+, r24 2f8ee: 9c 93 st X, r25 2f8f0: 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; 2f8f2: 91 96 adiw r26, 0x21 ; 33 2f8f4: bc 91 ld r27, X 2f8f6: 27 96 adiw r28, 0x07 ; 7 2f8f8: bf af std Y+63, r27 ; 0x3f 2f8fa: 27 97 sbiw r28, 0x07 ; 7 2f8fc: f8 01 movw r30, r16 2f8fe: f2 a1 ldd r31, Z+34 ; 0x22 2f900: 2b 96 adiw r28, 0x0b ; 11 2f902: ff af std Y+63, r31 ; 0x3f 2f904: 2b 97 sbiw r28, 0x0b ; 11 2f906: d8 01 movw r26, r16 2f908: 93 96 adiw r26, 0x23 ; 35 2f90a: bc 91 ld r27, X 2f90c: 2f 96 adiw r28, 0x0f ; 15 2f90e: bf af std Y+63, r27 ; 0x3f 2f910: 2f 97 sbiw r28, 0x0f ; 15 2f912: f8 01 movw r30, r16 2f914: f4 a1 ldd r31, Z+36 ; 0x24 2f916: 63 96 adiw r28, 0x13 ; 19 2f918: ff af std Y+63, r31 ; 0x3f 2f91a: 63 97 sbiw r28, 0x13 ; 19 2f91c: 2a e7 ldi r18, 0x7A ; 122 2f91e: 34 e0 ldi r19, 0x04 ; 4 2f920: ed 96 adiw r28, 0x3d ; 61 2f922: 3f af std Y+63, r19 ; 0x3f 2f924: 2e af std Y+62, r18 ; 0x3e 2f926: ed 97 sbiw r28, 0x3d ; 61 2f928: 6e 96 adiw r28, 0x1e ; 30 2f92a: 4e ac ldd r4, Y+62 ; 0x3e 2f92c: 5f ac ldd r5, Y+63 ; 0x3f 2f92e: 6e 97 sbiw r28, 0x1e ; 30 2f930: 30 e1 ldi r19, 0x10 ; 16 2f932: 43 0e add r4, r19 2f934: 51 1c adc r5, r1 2f936: 0a e7 ldi r16, 0x7A ; 122 2f938: 14 e0 ldi r17, 0x04 ; 4 2f93a: 6e 96 adiw r28, 0x1e ; 30 2f93c: 6e ac ldd r6, Y+62 ; 0x3e 2f93e: 7f ac ldd r7, Y+63 ; 0x3f 2f940: 6e 97 sbiw r28, 0x1e ; 30 2f942: 27 96 adiw r28, 0x07 ; 7 2f944: 4f ad ldd r20, Y+63 ; 0x3f 2f946: 27 97 sbiw r28, 0x07 ; 7 2f948: 49 a7 std Y+41, r20 ; 0x29 2f94a: 2b 96 adiw r28, 0x0b ; 11 2f94c: 5f ad ldd r21, Y+63 ; 0x3f 2f94e: 2b 97 sbiw r28, 0x0b ; 11 2f950: 5d a7 std Y+45, r21 ; 0x2d 2f952: b9 af std Y+57, r27 ; 0x39 2f954: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 2f956: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 2f958: d3 01 movw r26, r6 2f95a: 8d 90 ld r8, X+ 2f95c: 9d 90 ld r9, X+ 2f95e: ad 90 ld r10, X+ 2f960: bd 90 ld r11, X+ 2f962: 3d 01 movw r6, r26 2f964: e8 94 clt 2f966: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 2f968: f8 01 movw r30, r16 2f96a: c1 90 ld r12, Z+ 2f96c: d1 90 ld r13, Z+ 2f96e: e1 90 ld r14, Z+ 2f970: f1 90 ld r15, Z+ 2f972: 8f 01 movw r16, r30 2f974: a5 01 movw r20, r10 2f976: 94 01 movw r18, r8 2f978: c7 01 movw r24, r14 2f97a: b6 01 movw r22, r12 2f97c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2f980: 87 ff sbrs r24, 7 2f982: 3a c0 rjmp .+116 ; 0x2f9f8 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 2f984: fd a9 ldd r31, Y+53 ; 0x35 2f986: ff 23 and r31, r31 2f988: 09 f4 brne .+2 ; 0x2f98c 2f98a: 7e c6 rjmp .+3324 ; 0x30688 // 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; 2f98c: 29 a5 ldd r18, Y+41 ; 0x29 2f98e: 3d a5 ldd r19, Y+45 ; 0x2d 2f990: 49 ad ldd r20, Y+57 ; 0x39 2f992: 59 a9 ldd r21, Y+49 ; 0x31 2f994: c5 01 movw r24, r10 2f996: b4 01 movw r22, r8 2f998: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f99c: 4b 01 movw r8, r22 2f99e: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 2f9a0: a7 01 movw r20, r14 2f9a2: 96 01 movw r18, r12 2f9a4: 27 96 adiw r28, 0x07 ; 7 2f9a6: 6f ad ldd r22, Y+63 ; 0x3f 2f9a8: 27 97 sbiw r28, 0x07 ; 7 2f9aa: 2b 96 adiw r28, 0x0b ; 11 2f9ac: 7f ad ldd r23, Y+63 ; 0x3f 2f9ae: 2b 97 sbiw r28, 0x0b ; 11 2f9b0: 2f 96 adiw r28, 0x0f ; 15 2f9b2: 8f ad ldd r24, Y+63 ; 0x3f 2f9b4: 2f 97 sbiw r28, 0x0f ; 15 2f9b6: 63 96 adiw r28, 0x13 ; 19 2f9b8: 9f ad ldd r25, Y+63 ; 0x3f 2f9ba: 63 97 sbiw r28, 0x13 ; 19 2f9bc: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f9c0: 6b 01 movw r12, r22 2f9c2: 7c 01 movw r14, r24 if (jerk > mjerk) { 2f9c4: ac 01 movw r20, r24 2f9c6: 9b 01 movw r18, r22 2f9c8: c5 01 movw r24, r10 2f9ca: b4 01 movw r22, r8 2f9cc: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2f9d0: 18 16 cp r1, r24 2f9d2: 94 f4 brge .+36 ; 0x2f9f8 safe_speed *= mjerk / jerk; 2f9d4: a5 01 movw r20, r10 2f9d6: 94 01 movw r18, r8 2f9d8: c7 01 movw r24, r14 2f9da: b6 01 movw r22, r12 2f9dc: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2f9e0: 9b 01 movw r18, r22 2f9e2: ac 01 movw r20, r24 2f9e4: 69 a5 ldd r22, Y+41 ; 0x29 2f9e6: 7d a5 ldd r23, Y+45 ; 0x2d 2f9e8: 89 ad ldd r24, Y+57 ; 0x39 2f9ea: 99 a9 ldd r25, Y+49 ; 0x31 2f9ec: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2f9f0: 69 a7 std Y+41, r22 ; 0x29 2f9f2: 7d a7 std Y+45, r23 ; 0x2d 2f9f4: 89 af std Y+57, r24 ; 0x39 2f9f6: 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) { 2f9f8: 46 14 cp r4, r6 2f9fa: 57 04 cpc r5, r7 2f9fc: 09 f0 breq .+2 ; 0x2fa00 2f9fe: ac cf rjmp .-168 ; 0x2f958 } } } // Reset the block flag. block->flag = 0; 2fa00: 8e e6 ldi r24, 0x6E ; 110 2fa02: 82 9d mul r24, r2 2fa04: f0 01 movw r30, r0 2fa06: 83 9d mul r24, r3 2fa08: f0 0d add r31, r0 2fa0a: 11 24 eor r1, r1 2fa0c: e8 53 subi r30, 0x38 ; 56 2fa0e: f9 4f sbci r31, 0xF9 ; 249 2fa10: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 2fa12: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> 2fa16: 88 23 and r24, r24 2fa18: 21 f0 breq .+8 ; 0x2fa22 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 2fa1a: 80 e1 ldi r24, 0x10 ; 16 2fa1c: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 2fa1e: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> 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) { 2fa22: 3d ad ldd r19, Y+61 ; 0x3d 2fa24: 32 30 cpi r19, 0x02 ; 2 2fa26: 08 f4 brcc .+2 ; 0x2fa2a 2fa28: 8f c6 rjmp .+3358 ; 0x30748 2fa2a: 40 91 f0 03 lds r20, 0x03F0 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 2fa2e: 6b 96 adiw r28, 0x1b ; 27 2fa30: 4f af std Y+63, r20 ; 0x3f 2fa32: 6b 97 sbiw r28, 0x1b ; 27 2fa34: 50 91 f1 03 lds r21, 0x03F1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 2fa38: 6f 96 adiw r28, 0x1f ; 31 2fa3a: 5f af std Y+63, r21 ; 0x3f 2fa3c: 6f 97 sbiw r28, 0x1f ; 31 2fa3e: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 2fa42: 10 91 f3 03 lds r17, 0x03F3 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> 2fa46: 27 e1 ldi r18, 0x17 ; 23 2fa48: 37 eb ldi r19, 0xB7 ; 183 2fa4a: 41 ed ldi r20, 0xD1 ; 209 2fa4c: 58 e3 ldi r21, 0x38 ; 56 2fa4e: 6b 96 adiw r28, 0x1b ; 27 2fa50: 6f ad ldd r22, Y+63 ; 0x3f 2fa52: 6b 97 sbiw r28, 0x1b ; 27 2fa54: 6f 96 adiw r28, 0x1f ; 31 2fa56: 7f ad ldd r23, Y+63 ; 0x3f 2fa58: 6f 97 sbiw r28, 0x1f ; 31 2fa5a: c8 01 movw r24, r16 2fa5c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fa60: 18 16 cp r1, r24 2fa62: 0c f0 brlt .+2 ; 0x2fa66 2fa64: 71 c6 rjmp .+3298 ; 0x30748 // 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); 2fa66: 6b 96 adiw r28, 0x1b ; 27 2fa68: 2f ad ldd r18, Y+63 ; 0x3f 2fa6a: 6b 97 sbiw r28, 0x1b ; 27 2fa6c: 6f 96 adiw r28, 0x1f ; 31 2fa6e: 3f ad ldd r19, Y+63 ; 0x3f 2fa70: 6f 97 sbiw r28, 0x1f ; 31 2fa72: a8 01 movw r20, r16 2fa74: 27 96 adiw r28, 0x07 ; 7 2fa76: 6f ad ldd r22, Y+63 ; 0x3f 2fa78: 27 97 sbiw r28, 0x07 ; 7 2fa7a: 2b 96 adiw r28, 0x0b ; 11 2fa7c: 7f ad ldd r23, Y+63 ; 0x3f 2fa7e: 2b 97 sbiw r28, 0x0b ; 11 2fa80: 2f 96 adiw r28, 0x0f ; 15 2fa82: 8f ad ldd r24, Y+63 ; 0x3f 2fa84: 2f 97 sbiw r28, 0x0f ; 15 2fa86: 63 96 adiw r28, 0x13 ; 19 2fa88: 9f ad ldd r25, Y+63 ; 0x3f 2fa8a: 63 97 sbiw r28, 0x13 ; 19 2fa8c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2fa90: 87 ff sbrs r24, 7 2fa92: 01 c6 rjmp .+3074 ; 0x30696 2fa94: 6b 96 adiw r28, 0x1b ; 27 2fa96: 2f ad ldd r18, Y+63 ; 0x3f 2fa98: 6b 97 sbiw r28, 0x1b ; 27 2fa9a: 6f 96 adiw r28, 0x1f ; 31 2fa9c: 3f ad ldd r19, Y+63 ; 0x3f 2fa9e: 6f 97 sbiw r28, 0x1f ; 31 2faa0: a8 01 movw r20, r16 2faa2: 27 96 adiw r28, 0x07 ; 7 2faa4: 6f ad ldd r22, Y+63 ; 0x3f 2faa6: 27 97 sbiw r28, 0x07 ; 7 2faa8: 2b 96 adiw r28, 0x0b ; 11 2faaa: 7f ad ldd r23, Y+63 ; 0x3f 2faac: 2b 97 sbiw r28, 0x0b ; 11 2faae: 2f 96 adiw r28, 0x0f ; 15 2fab0: 8f ad ldd r24, Y+63 ; 0x3f 2fab2: 2f 97 sbiw r28, 0x0f ; 15 2fab4: 63 96 adiw r28, 0x13 ; 19 2fab6: 9f ad ldd r25, Y+63 ; 0x3f 2fab8: 63 97 sbiw r28, 0x13 ; 19 2faba: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2fabe: eb 96 adiw r28, 0x3b ; 59 2fac0: 6c af std Y+60, r22 ; 0x3c 2fac2: 7d af std Y+61, r23 ; 0x3d 2fac4: 8e af std Y+62, r24 ; 0x3e 2fac6: 9f af std Y+63, r25 ; 0x3f 2fac8: 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; 2faca: 27 96 adiw r28, 0x07 ; 7 2facc: 8f ad ldd r24, Y+63 ; 0x3f 2face: 27 97 sbiw r28, 0x07 ; 7 2fad0: 8d af std Y+61, r24 ; 0x3d 2fad2: 2b 96 adiw r28, 0x0b ; 11 2fad4: 9f ad ldd r25, Y+63 ; 0x3f 2fad6: 2b 97 sbiw r28, 0x0b ; 11 2fad8: 9d ab std Y+53, r25 ; 0x35 2fada: 2f 96 adiw r28, 0x0f ; 15 2fadc: af ad ldd r26, Y+63 ; 0x3f 2fade: 2f 97 sbiw r28, 0x0f ; 15 2fae0: ae af std Y+62, r26 ; 0x3e 2fae2: 63 96 adiw r28, 0x13 ; 19 2fae4: bf ad ldd r27, Y+63 ; 0x3f 2fae6: 63 97 sbiw r28, 0x13 ; 19 2fae8: 23 96 adiw r28, 0x03 ; 3 2faea: bf af std Y+63, r27 ; 0x3f 2faec: 23 97 sbiw r28, 0x03 ; 3 2faee: 24 ef ldi r18, 0xF4 ; 244 2faf0: 33 e0 ldi r19, 0x03 ; 3 2faf2: e7 96 adiw r28, 0x37 ; 55 2faf4: 3f af std Y+63, r19 ; 0x3f 2faf6: 2e af std Y+62, r18 ; 0x3e 2faf8: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 2fafa: 41 2c mov r4, r1 2fafc: 51 2c mov r5, r1 2fafe: 30 e8 ldi r19, 0x80 ; 128 2fb00: 63 2e mov r6, r19 2fb02: 3f e3 ldi r19, 0x3F ; 63 2fb04: 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]; 2fb06: e7 96 adiw r28, 0x37 ; 55 2fb08: ae ad ldd r26, Y+62 ; 0x3e 2fb0a: bf ad ldd r27, Y+63 ; 0x3f 2fb0c: e7 97 sbiw r28, 0x37 ; 55 2fb0e: 8d 90 ld r8, X+ 2fb10: 9d 90 ld r9, X+ 2fb12: ad 90 ld r10, X+ 2fb14: bd 90 ld r11, X+ 2fb16: e7 96 adiw r28, 0x37 ; 55 2fb18: bf af std Y+63, r27 ; 0x3f 2fb1a: ae af std Y+62, r26 ; 0x3e 2fb1c: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 2fb1e: 6e 96 adiw r28, 0x1e ; 30 2fb20: ee ad ldd r30, Y+62 ; 0x3e 2fb22: ff ad ldd r31, Y+63 ; 0x3f 2fb24: 6e 97 sbiw r28, 0x1e ; 30 2fb26: c1 90 ld r12, Z+ 2fb28: d1 90 ld r13, Z+ 2fb2a: e1 90 ld r14, Z+ 2fb2c: f1 90 ld r15, Z+ 2fb2e: 6e 96 adiw r28, 0x1e ; 30 2fb30: ff af std Y+63, r31 ; 0x3f 2fb32: ee af std Y+62, r30 ; 0x3e 2fb34: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 2fb36: 6b 96 adiw r28, 0x1b ; 27 2fb38: 2f ad ldd r18, Y+63 ; 0x3f 2fb3a: 6b 97 sbiw r28, 0x1b ; 27 2fb3c: 6f 96 adiw r28, 0x1f ; 31 2fb3e: 3f ad ldd r19, Y+63 ; 0x3f 2fb40: 6f 97 sbiw r28, 0x1f ; 31 2fb42: a8 01 movw r20, r16 2fb44: 27 96 adiw r28, 0x07 ; 7 2fb46: 6f ad ldd r22, Y+63 ; 0x3f 2fb48: 27 97 sbiw r28, 0x07 ; 7 2fb4a: 2b 96 adiw r28, 0x0b ; 11 2fb4c: 7f ad ldd r23, Y+63 ; 0x3f 2fb4e: 2b 97 sbiw r28, 0x0b ; 11 2fb50: 2f 96 adiw r28, 0x0f ; 15 2fb52: 8f ad ldd r24, Y+63 ; 0x3f 2fb54: 2f 97 sbiw r28, 0x0f ; 15 2fb56: 63 96 adiw r28, 0x13 ; 19 2fb58: 9f ad ldd r25, Y+63 ; 0x3f 2fb5a: 63 97 sbiw r28, 0x13 ; 19 2fb5c: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2fb60: 87 ff sbrs r24, 7 2fb62: 0c c0 rjmp .+24 ; 0x2fb7c v_exit *= smaller_speed_factor; 2fb64: eb 96 adiw r28, 0x3b ; 59 2fb66: 2c ad ldd r18, Y+60 ; 0x3c 2fb68: 3d ad ldd r19, Y+61 ; 0x3d 2fb6a: 4e ad ldd r20, Y+62 ; 0x3e 2fb6c: 5f ad ldd r21, Y+63 ; 0x3f 2fb6e: eb 97 sbiw r28, 0x3b ; 59 2fb70: c5 01 movw r24, r10 2fb72: b4 01 movw r22, r8 2fb74: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fb78: 4b 01 movw r8, r22 2fb7a: 5c 01 movw r10, r24 if (limited) { 2fb7c: a1 96 adiw r28, 0x21 ; 33 2fb7e: ff ad ldd r31, Y+63 ; 0x3f 2fb80: a1 97 sbiw r28, 0x21 ; 33 2fb82: ff 23 and r31, r31 2fb84: 81 f0 breq .+32 ; 0x2fba6 v_exit *= v_factor; 2fb86: a3 01 movw r20, r6 2fb88: 92 01 movw r18, r4 2fb8a: c5 01 movw r24, r10 2fb8c: b4 01 movw r22, r8 2fb8e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fb92: 4b 01 movw r8, r22 2fb94: 5c 01 movw r10, r24 v_entry *= v_factor; 2fb96: a3 01 movw r20, r6 2fb98: 92 01 movw r18, r4 2fb9a: c7 01 movw r24, r14 2fb9c: b6 01 movw r22, r12 2fb9e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fba2: 6b 01 movw r12, r22 2fba4: 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) ? 2fba6: a7 01 movw r20, r14 2fba8: 96 01 movw r18, r12 2fbaa: c5 01 movw r24, r10 2fbac: b4 01 movw r22, r8 2fbae: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 2fbb2: 20 e0 ldi r18, 0x00 ; 0 2fbb4: 30 e0 ldi r19, 0x00 ; 0 2fbb6: 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) ? 2fbb8: 18 16 cp r1, r24 2fbba: 0c f0 brlt .+2 ; 0x2fbbe 2fbbc: a3 c5 rjmp .+2886 ; 0x30704 ((v_entry > 0.f || v_exit < 0.f) ? 2fbbe: c7 01 movw r24, r14 2fbc0: b6 01 movw r22, r12 2fbc2: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fbc6: 18 16 cp r1, r24 2fbc8: 4c f0 brlt .+18 ; 0x2fbdc 2fbca: 20 e0 ldi r18, 0x00 ; 0 2fbcc: 30 e0 ldi r19, 0x00 ; 0 2fbce: a9 01 movw r20, r18 2fbd0: c5 01 movw r24, r10 2fbd2: b4 01 movw r22, r8 2fbd4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2fbd8: 87 ff sbrs r24, 7 2fbda: 85 c5 rjmp .+2826 ; 0x306e6 2fbdc: a7 01 movw r20, r14 2fbde: 96 01 movw r18, r12 2fbe0: c5 01 movw r24, r10 2fbe2: 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) ? 2fbe4: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2fbe8: 6b 01 movw r12, r22 2fbea: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 2fbec: ed 96 adiw r28, 0x3d ; 61 2fbee: ae ad ldd r26, Y+62 ; 0x3e 2fbf0: bf ad ldd r27, Y+63 ; 0x3f 2fbf2: ed 97 sbiw r28, 0x3d ; 61 2fbf4: 8d 90 ld r8, X+ 2fbf6: 9d 90 ld r9, X+ 2fbf8: ad 90 ld r10, X+ 2fbfa: bd 90 ld r11, X+ 2fbfc: ed 96 adiw r28, 0x3d ; 61 2fbfe: bf af std Y+63, r27 ; 0x3f 2fc00: ae af std Y+62, r26 ; 0x3e 2fc02: ed 97 sbiw r28, 0x3d ; 61 2fc04: a5 01 movw r20, r10 2fc06: 94 01 movw r18, r8 2fc08: c7 01 movw r24, r14 2fc0a: b6 01 movw r22, r12 2fc0c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fc10: 18 16 cp r1, r24 2fc12: 94 f4 brge .+36 ; 0x2fc38 v_factor *= cs.max_jerk[axis] / jerk; 2fc14: a7 01 movw r20, r14 2fc16: 96 01 movw r18, r12 2fc18: c5 01 movw r24, r10 2fc1a: b4 01 movw r22, r8 2fc1c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2fc20: 9b 01 movw r18, r22 2fc22: ac 01 movw r20, r24 2fc24: c3 01 movw r24, r6 2fc26: b2 01 movw r22, r4 2fc28: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fc2c: 2b 01 movw r4, r22 2fc2e: 3c 01 movw r6, r24 limited = true; 2fc30: b1 e0 ldi r27, 0x01 ; 1 2fc32: a1 96 adiw r28, 0x21 ; 33 2fc34: bf af std Y+63, r27 ; 0x3f 2fc36: 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) { 2fc38: e4 e0 ldi r30, 0x04 ; 4 2fc3a: f4 e0 ldi r31, 0x04 ; 4 2fc3c: e7 96 adiw r28, 0x37 ; 55 2fc3e: 2e ad ldd r18, Y+62 ; 0x3e 2fc40: 3f ad ldd r19, Y+63 ; 0x3f 2fc42: e7 97 sbiw r28, 0x37 ; 55 2fc44: e2 17 cp r30, r18 2fc46: f3 07 cpc r31, r19 2fc48: 09 f0 breq .+2 ; 0x2fc4c 2fc4a: 5d cf rjmp .-326 ; 0x2fb06 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 2fc4c: a1 96 adiw r28, 0x21 ; 33 2fc4e: 3f ad ldd r19, Y+63 ; 0x3f 2fc50: a1 97 sbiw r28, 0x21 ; 33 2fc52: 33 23 and r19, r19 2fc54: 81 f0 breq .+32 ; 0x2fc76 vmax_junction *= v_factor; 2fc56: a3 01 movw r20, r6 2fc58: 92 01 movw r18, r4 2fc5a: 6d ad ldd r22, Y+61 ; 0x3d 2fc5c: 7d a9 ldd r23, Y+53 ; 0x35 2fc5e: 8e ad ldd r24, Y+62 ; 0x3e 2fc60: 23 96 adiw r28, 0x03 ; 3 2fc62: 9f ad ldd r25, Y+63 ; 0x3f 2fc64: 23 97 sbiw r28, 0x03 ; 3 2fc66: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fc6a: 6d af std Y+61, r22 ; 0x3d 2fc6c: 7d ab std Y+53, r23 ; 0x35 2fc6e: 8e af std Y+62, r24 ; 0x3e 2fc70: 23 96 adiw r28, 0x03 ; 3 2fc72: 9f af std Y+63, r25 ; 0x3f 2fc74: 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; 2fc76: 24 ea ldi r18, 0xA4 ; 164 2fc78: 30 e7 ldi r19, 0x70 ; 112 2fc7a: 4d e7 ldi r20, 0x7D ; 125 2fc7c: 5f e3 ldi r21, 0x3F ; 63 2fc7e: 6d ad ldd r22, Y+61 ; 0x3d 2fc80: 7d a9 ldd r23, Y+53 ; 0x35 2fc82: 8e ad ldd r24, Y+62 ; 0x3e 2fc84: 23 96 adiw r28, 0x03 ; 3 2fc86: 9f ad ldd r25, Y+63 ; 0x3f 2fc88: 23 97 sbiw r28, 0x03 ; 3 2fc8a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fc8e: 6b 01 movw r12, r22 2fc90: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 2fc92: ac 01 movw r20, r24 2fc94: 9b 01 movw r18, r22 2fc96: 60 91 dd 16 lds r22, 0x16DD ; 0x8016dd 2fc9a: 70 91 de 16 lds r23, 0x16DE ; 0x8016de 2fc9e: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2fca2: 90 91 e0 16 lds r25, 0x16E0 ; 0x8016e0 2fca6: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fcaa: 18 16 cp r1, r24 2fcac: fc f4 brge .+62 ; 0x2fcec 2fcae: 29 a5 ldd r18, Y+41 ; 0x29 2fcb0: 3d a5 ldd r19, Y+45 ; 0x2d 2fcb2: 49 ad ldd r20, Y+57 ; 0x39 2fcb4: 59 a9 ldd r21, Y+49 ; 0x31 2fcb6: c7 01 movw r24, r14 2fcb8: b6 01 movw r22, r12 2fcba: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2fcbe: 87 ff sbrs r24, 7 2fcc0: 15 c0 rjmp .+42 ; 0x2fcec // 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; 2fcc2: 8e e6 ldi r24, 0x6E ; 110 2fcc4: 82 9d mul r24, r2 2fcc6: f0 01 movw r30, r0 2fcc8: 83 9d mul r24, r3 2fcca: f0 0d add r31, r0 2fccc: 11 24 eor r1, r1 2fcce: e8 53 subi r30, 0x38 ; 56 2fcd0: f9 4f sbci r31, 0xF9 ; 249 2fcd2: 85 a9 ldd r24, Z+53 ; 0x35 2fcd4: 84 60 ori r24, 0x04 ; 4 2fcd6: 85 ab std Z+53, r24 ; 0x35 2fcd8: 49 a5 ldd r20, Y+41 ; 0x29 2fcda: 4d af std Y+61, r20 ; 0x3d 2fcdc: 5d a5 ldd r21, Y+45 ; 0x2d 2fcde: 5d ab std Y+53, r21 ; 0x35 2fce0: 89 ad ldd r24, Y+57 ; 0x39 2fce2: 8e af std Y+62, r24 ; 0x3e 2fce4: 99 a9 ldd r25, Y+49 ; 0x31 2fce6: 23 96 adiw r28, 0x03 ; 3 2fce8: 9f af std Y+63, r25 ; 0x3f 2fcea: 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; 2fcec: 8e e6 ldi r24, 0x6E ; 110 2fcee: 82 9d mul r24, r2 2fcf0: 80 01 movw r16, r0 2fcf2: 83 9d mul r24, r3 2fcf4: 10 0d add r17, r0 2fcf6: 11 24 eor r1, r1 2fcf8: 08 53 subi r16, 0x38 ; 56 2fcfa: 19 4f sbci r17, 0xF9 ; 249 2fcfc: 8d ad ldd r24, Y+61 ; 0x3d 2fcfe: 9d a9 ldd r25, Y+53 ; 0x35 2fd00: ae ad ldd r26, Y+62 ; 0x3e 2fd02: 23 96 adiw r28, 0x03 ; 3 2fd04: bf ad ldd r27, Y+63 ; 0x3f 2fd06: 23 97 sbiw r28, 0x03 ; 3 2fd08: f8 01 movw r30, r16 2fd0a: 81 a7 std Z+41, r24 ; 0x29 2fd0c: 92 a7 std Z+42, r25 ; 0x2a 2fd0e: a3 a7 std Z+43, r26 ; 0x2b 2fd10: 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); 2fd12: 29 a5 ldd r18, Y+41 ; 0x29 2fd14: 3d a5 ldd r19, Y+45 ; 0x2d 2fd16: 49 ad ldd r20, Y+57 ; 0x39 2fd18: 59 a9 ldd r21, Y+49 ; 0x31 2fd1a: 69 a5 ldd r22, Y+41 ; 0x29 2fd1c: 7d a5 ldd r23, Y+45 ; 0x2d 2fd1e: 89 ad ldd r24, Y+57 ; 0x39 2fd20: 99 a9 ldd r25, Y+49 ; 0x31 2fd22: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fd26: 6b 01 movw r12, r22 2fd28: 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); 2fd2a: e1 96 adiw r28, 0x31 ; 49 2fd2c: 6c ad ldd r22, Y+60 ; 0x3c 2fd2e: 7d ad ldd r23, Y+61 ; 0x3d 2fd30: 8e ad ldd r24, Y+62 ; 0x3e 2fd32: 9f ad ldd r25, Y+63 ; 0x3f 2fd34: e1 97 sbiw r28, 0x31 ; 49 2fd36: 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); 2fd38: 9b 01 movw r18, r22 2fd3a: ac 01 movw r20, r24 2fd3c: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 2fd40: d8 01 movw r26, r16 2fd42: 9d 96 adiw r26, 0x2d ; 45 2fd44: 2d 91 ld r18, X+ 2fd46: 3d 91 ld r19, X+ 2fd48: 4d 91 ld r20, X+ 2fd4a: 5c 91 ld r21, X 2fd4c: d0 97 sbiw r26, 0x30 ; 48 2fd4e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2fd52: 9b 01 movw r18, r22 2fd54: ac 01 movw r20, r24 2fd56: c7 01 movw r24, r14 2fd58: b6 01 movw r22, r12 2fd5a: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 2fd5e: 0f 94 32 a6 call 0x34c64 ; 0x34c64 2fd62: d6 2e mov r13, r22 2fd64: e7 2e mov r14, r23 2fd66: 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); 2fd68: 2d ad ldd r18, Y+61 ; 0x3d 2fd6a: 3d a9 ldd r19, Y+53 ; 0x35 2fd6c: 4e ad ldd r20, Y+62 ; 0x3e 2fd6e: 23 96 adiw r28, 0x03 ; 3 2fd70: 5f ad ldd r21, Y+63 ; 0x3f 2fd72: 23 97 sbiw r28, 0x03 ; 3 2fd74: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fd78: 18 16 cp r1, r24 2fd7a: 34 f0 brlt .+12 ; 0x2fd88 2fd7c: dd ae std Y+61, r13 ; 0x3d 2fd7e: ed aa std Y+53, r14 ; 0x35 2fd80: 0e af std Y+62, r16 ; 0x3e 2fd82: 23 96 adiw r28, 0x03 ; 3 2fd84: 1f af std Y+63, r17 ; 0x3f 2fd86: 23 97 sbiw r28, 0x03 ; 3 2fd88: 8e e6 ldi r24, 0x6E ; 110 2fd8a: 82 9d mul r24, r2 2fd8c: f0 01 movw r30, r0 2fd8e: 83 9d mul r24, r3 2fd90: f0 0d add r31, r0 2fd92: 11 24 eor r1, r1 2fd94: e8 53 subi r30, 0x38 ; 56 2fd96: f9 4f sbci r31, 0xF9 ; 249 2fd98: 8d ad ldd r24, Y+61 ; 0x3d 2fd9a: 9d a9 ldd r25, Y+53 ; 0x35 2fd9c: ae ad ldd r26, Y+62 ; 0x3e 2fd9e: 23 96 adiw r28, 0x03 ; 3 2fda0: bf ad ldd r27, Y+63 ; 0x3f 2fda2: 23 97 sbiw r28, 0x03 ; 3 2fda4: 85 a3 std Z+37, r24 ; 0x25 2fda6: 96 a3 std Z+38, r25 ; 0x26 2fda8: a7 a3 std Z+39, r26 ; 0x27 2fdaa: 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; 2fdac: f5 a8 ldd r15, Z+53 ; 0x35 2fdae: 2d 2d mov r18, r13 2fdb0: 3e 2d mov r19, r14 2fdb2: a8 01 movw r20, r16 2fdb4: 27 96 adiw r28, 0x07 ; 7 2fdb6: 6f ad ldd r22, Y+63 ; 0x3f 2fdb8: 27 97 sbiw r28, 0x07 ; 7 2fdba: 2b 96 adiw r28, 0x0b ; 11 2fdbc: 7f ad ldd r23, Y+63 ; 0x3f 2fdbe: 2b 97 sbiw r28, 0x0b ; 11 2fdc0: 2f 96 adiw r28, 0x0f ; 15 2fdc2: 8f ad ldd r24, Y+63 ; 0x3f 2fdc4: 2f 97 sbiw r28, 0x0f ; 15 2fdc6: 63 96 adiw r28, 0x13 ; 19 2fdc8: 9f ad ldd r25, Y+63 ; 0x3f 2fdca: 63 97 sbiw r28, 0x13 ; 19 2fdcc: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 2fdd0: 18 16 cp r1, r24 2fdd2: 0c f4 brge .+2 ; 0x2fdd6 2fdd4: cf c4 rjmp .+2462 ; 0x30774 2fdd6: 83 e0 ldi r24, 0x03 ; 3 2fdd8: 9e e6 ldi r25, 0x6E ; 110 2fdda: 92 9d mul r25, r2 2fddc: 80 01 movw r16, r0 2fdde: 93 9d mul r25, r3 2fde0: 10 0d add r17, r0 2fde2: 11 24 eor r1, r1 2fde4: 08 53 subi r16, 0x38 ; 56 2fde6: 19 4f sbci r17, 0xF9 ; 249 2fde8: f8 2a or r15, r24 2fdea: f8 01 movw r30, r16 2fdec: 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[] 2fdee: 80 e1 ldi r24, 0x10 ; 16 2fdf0: fe 01 movw r30, r28 2fdf2: 71 96 adiw r30, 0x11 ; 17 2fdf4: a4 ef ldi r26, 0xF4 ; 244 2fdf6: b3 e0 ldi r27, 0x03 ; 3 2fdf8: 01 90 ld r0, Z+ 2fdfa: 0d 92 st X+, r0 2fdfc: 8a 95 dec r24 2fdfe: e1 f7 brne .-8 ; 0x2fdf8 previous_nominal_speed = block->nominal_speed; 2fe00: 27 96 adiw r28, 0x07 ; 7 2fe02: 8f ad ldd r24, Y+63 ; 0x3f 2fe04: 27 97 sbiw r28, 0x07 ; 7 2fe06: 2b 96 adiw r28, 0x0b ; 11 2fe08: 9f ad ldd r25, Y+63 ; 0x3f 2fe0a: 2b 97 sbiw r28, 0x0b ; 11 2fe0c: 2f 96 adiw r28, 0x0f ; 15 2fe0e: af ad ldd r26, Y+63 ; 0x3f 2fe10: 2f 97 sbiw r28, 0x0f ; 15 2fe12: 63 96 adiw r28, 0x13 ; 19 2fe14: bf ad ldd r27, Y+63 ; 0x3f 2fe16: 63 97 sbiw r28, 0x13 ; 19 2fe18: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 2fe1c: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 2fe20: a0 93 f2 03 sts 0x03F2, r26 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 2fe24: b0 93 f3 03 sts 0x03F3, r27 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> previous_safe_speed = safe_speed; 2fe28: 89 a5 ldd r24, Y+41 ; 0x29 2fe2a: 9d a5 ldd r25, Y+45 ; 0x2d 2fe2c: a9 ad ldd r26, Y+57 ; 0x39 2fe2e: b9 a9 ldd r27, Y+49 ; 0x31 2fe30: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 2fe34: 90 93 de 16 sts 0x16DE, r25 ; 0x8016de 2fe38: a0 93 df 16 sts 0x16DF, r26 ; 0x8016df 2fe3c: 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; 2fe40: d8 01 movw r26, r16 2fe42: d6 96 adiw r26, 0x36 ; 54 2fe44: 6d 91 ld r22, X+ 2fe46: 7d 91 ld r23, X+ 2fe48: 8d 91 ld r24, X+ 2fe4a: 9c 91 ld r25, X 2fe4c: d9 97 sbiw r26, 0x39 ; 57 2fe4e: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 2fe52: 27 96 adiw r28, 0x07 ; 7 2fe54: 2f ad ldd r18, Y+63 ; 0x3f 2fe56: 27 97 sbiw r28, 0x07 ; 7 2fe58: 2b 96 adiw r28, 0x0b ; 11 2fe5a: 3f ad ldd r19, Y+63 ; 0x3f 2fe5c: 2b 97 sbiw r28, 0x0b ; 11 2fe5e: 2f 96 adiw r28, 0x0f ; 15 2fe60: 4f ad ldd r20, Y+63 ; 0x3f 2fe62: 2f 97 sbiw r28, 0x0f ; 15 2fe64: 63 96 adiw r28, 0x13 ; 19 2fe66: 5f ad ldd r21, Y+63 ; 0x3f 2fe68: 63 97 sbiw r28, 0x13 ; 19 2fe6a: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2fe6e: 2b 01 movw r4, r22 2fe70: 3c 01 movw r6, r24 2fe72: f8 01 movw r30, r16 2fe74: e8 5b subi r30, 0xB8 ; 184 2fe76: ff 4f sbci r31, 0xFF ; 255 2fe78: 40 82 st Z, r4 2fe7a: 51 82 std Z+1, r5 ; 0x01 2fe7c: 62 82 std Z+2, r6 ; 0x02 2fe7e: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 2fe80: 34 96 adiw r30, 0x04 ; 4 2fe82: 80 81 ld r24, Z 2fe84: 88 23 and r24, r24 2fe86: 09 f4 brne .+2 ; 0x2fe8a 2fe88: 89 c0 rjmp .+274 ; 0x2ff9c // 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)) 2fe8a: 20 91 e1 16 lds r18, 0x16E1 ; 0x8016e1 2fe8e: 30 91 e2 16 lds r19, 0x16E2 ; 0x8016e2 2fe92: 40 91 e3 16 lds r20, 0x16E3 ; 0x8016e3 2fe96: 50 91 e4 16 lds r21, 0x16E4 ; 0x8016e4 2fe9a: 6a 96 adiw r28, 0x1a ; 26 2fe9c: 6c ad ldd r22, Y+60 ; 0x3c 2fe9e: 7d ad ldd r23, Y+61 ; 0x3d 2fea0: 8e ad ldd r24, Y+62 ; 0x3e 2fea2: 9f ad ldd r25, Y+63 ; 0x3f 2fea4: 6a 97 sbiw r28, 0x1a ; 26 2fea6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2feaa: 4b 01 movw r8, r22 2feac: 5c 01 movw r10, r24 2feae: c0 90 42 04 lds r12, 0x0442 ; 0x800442 2feb2: d0 90 43 04 lds r13, 0x0443 ; 0x800443 2feb6: e0 90 44 04 lds r14, 0x0444 ; 0x800444 2feba: f0 90 45 04 lds r15, 0x0445 ; 0x800445 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2febe: 0c 5a subi r16, 0xAC ; 172 2fec0: 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)) 2fec2: a7 01 movw r20, r14 2fec4: 96 01 movw r18, r12 2fec6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2feca: a3 01 movw r20, r6 2fecc: 92 01 movw r18, r4 2fece: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2fed2: f8 01 movw r30, r16 2fed4: 60 83 st Z, r22 2fed6: 71 83 std Z+1, r23 ; 0x01 2fed8: 82 83 std Z+2, r24 ; 0x02 2feda: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 2fedc: 20 e0 ldi r18, 0x00 ; 0 2fede: 30 e0 ldi r19, 0x00 ; 0 2fee0: a9 01 movw r20, r18 2fee2: 6a 96 adiw r28, 0x1a ; 26 2fee4: 6c ad ldd r22, Y+60 ; 0x3c 2fee6: 7d ad ldd r23, Y+61 ; 0x3d 2fee8: 8e ad ldd r24, Y+62 ; 0x3e 2feea: 9f ad ldd r25, Y+63 ; 0x3f 2feec: 6a 97 sbiw r28, 0x1a ; 26 2feee: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2fef2: 18 16 cp r1, r24 2fef4: 0c f0 brlt .+2 ; 0x2fef8 2fef6: 40 c4 rjmp .+2176 ; 0x30778 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 2fef8: a5 01 movw r20, r10 2fefa: 94 01 movw r18, r8 2fefc: e1 96 adiw r28, 0x31 ; 49 2fefe: 6c ad ldd r22, Y+60 ; 0x3c 2ff00: 7d ad ldd r23, Y+61 ; 0x3d 2ff02: 8e ad ldd r24, Y+62 ; 0x3e 2ff04: 9f ad ldd r25, Y+63 ; 0x3f 2ff06: e1 97 sbiw r28, 0x31 ; 49 2ff08: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ff0c: a7 01 movw r20, r14 2ff0e: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 2ff10: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ff14: 6b 01 movw r12, r22 2ff16: 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; 2ff18: 20 e0 ldi r18, 0x00 ; 0 2ff1a: 30 e4 ldi r19, 0x40 ; 64 2ff1c: 4c e1 ldi r20, 0x1C ; 28 2ff1e: 57 e4 ldi r21, 0x47 ; 71 2ff20: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2ff24: 18 16 cp r1, r24 2ff26: 3c f4 brge .+14 ; 0x2ff36 2ff28: c1 2c mov r12, r1 2ff2a: 20 e4 ldi r18, 0x40 ; 64 2ff2c: d2 2e mov r13, r18 2ff2e: 2c e1 ldi r18, 0x1C ; 28 2ff30: e2 2e mov r14, r18 2ff32: 27 e4 ldi r18, 0x47 ; 71 2ff34: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 2ff36: a7 01 movw r20, r14 2ff38: 96 01 movw r18, r12 2ff3a: 60 e0 ldi r22, 0x00 ; 0 2ff3c: 74 e2 ldi r23, 0x24 ; 36 2ff3e: 84 ef ldi r24, 0xF4 ; 244 2ff40: 99 e4 ldi r25, 0x49 ; 73 2ff42: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 2ff46: 4b 01 movw r8, r22 2ff48: 5c 01 movw r10, r24 if (advance_speed > 20000) { 2ff4a: 20 e0 ldi r18, 0x00 ; 0 2ff4c: 30 e4 ldi r19, 0x40 ; 64 2ff4e: 4c e9 ldi r20, 0x9C ; 156 2ff50: 56 e4 ldi r21, 0x46 ; 70 2ff52: c7 01 movw r24, r14 2ff54: b6 01 movw r22, r12 2ff56: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 2ff5a: 18 16 cp r1, r24 2ff5c: 0c f0 brlt .+2 ; 0x2ff60 2ff5e: 17 c4 rjmp .+2094 ; 0x3078e block->advance_rate = advance_rate * 4; 2ff60: 8e e6 ldi r24, 0x6E ; 110 2ff62: 82 9d mul r24, r2 2ff64: 80 01 movw r16, r0 2ff66: 83 9d mul r24, r3 2ff68: 10 0d add r17, r0 2ff6a: 11 24 eor r1, r1 2ff6c: 08 53 subi r16, 0x38 ; 56 2ff6e: 19 4f sbci r17, 0xF9 ; 249 2ff70: 78 01 movw r14, r16 2ff72: fd e4 ldi r31, 0x4D ; 77 2ff74: ef 0e add r14, r31 2ff76: f1 1c adc r15, r1 2ff78: 20 e0 ldi r18, 0x00 ; 0 2ff7a: 30 e0 ldi r19, 0x00 ; 0 2ff7c: 40 e8 ldi r20, 0x80 ; 128 2ff7e: 50 e4 ldi r21, 0x40 ; 64 2ff80: c5 01 movw r24, r10 2ff82: b4 01 movw r22, r8 2ff84: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 2ff88: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 2ff8c: d7 01 movw r26, r14 2ff8e: 6d 93 st X+, r22 2ff90: 7c 93 st X, r23 block->advance_step_loops = 4; 2ff92: f8 01 movw r30, r16 2ff94: ed 5a subi r30, 0xAD ; 173 2ff96: ff 4f sbci r31, 0xFF ; 255 2ff98: 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; 2ff9a: 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); 2ff9c: 09 a5 ldd r16, Y+41 ; 0x29 2ff9e: 1d a5 ldd r17, Y+45 ; 0x2d 2ffa0: 29 ad ldd r18, Y+57 ; 0x39 2ffa2: 39 a9 ldd r19, Y+49 ; 0x31 2ffa4: 4d ad ldd r20, Y+61 ; 0x3d 2ffa6: 5d a9 ldd r21, Y+53 ; 0x35 2ffa8: 6e ad ldd r22, Y+62 ; 0x3e 2ffaa: 23 96 adiw r28, 0x03 ; 3 2ffac: 7f ad ldd r23, Y+63 ; 0x3f 2ffae: 23 97 sbiw r28, 0x03 ; 3 2ffb0: a3 96 adiw r28, 0x23 ; 35 2ffb2: 8e ad ldd r24, Y+62 ; 0x3e 2ffb4: 9f ad ldd r25, Y+63 ; 0x3f 2ffb6: a3 97 sbiw r28, 0x23 ; 35 2ffb8: 88 53 subi r24, 0x38 ; 56 2ffba: 99 4f sbci r25, 0xF9 ; 249 2ffbc: 0f 94 18 6d call 0x2da30 ; 0x2da30 if (block->step_event_count.wide <= 32767) 2ffc0: 8e e6 ldi r24, 0x6E ; 110 2ffc2: 82 9d mul r24, r2 2ffc4: f0 01 movw r30, r0 2ffc6: 83 9d mul r24, r3 2ffc8: f0 0d add r31, r0 2ffca: 11 24 eor r1, r1 2ffcc: e8 53 subi r30, 0x38 ; 56 2ffce: f9 4f sbci r31, 0xF9 ; 249 2ffd0: 80 89 ldd r24, Z+16 ; 0x10 2ffd2: 91 89 ldd r25, Z+17 ; 0x11 2ffd4: a2 89 ldd r26, Z+18 ; 0x12 2ffd6: b3 89 ldd r27, Z+19 ; 0x13 2ffd8: 81 15 cp r24, r1 2ffda: 90 48 sbci r25, 0x80 ; 128 2ffdc: a1 05 cpc r26, r1 2ffde: b1 05 cpc r27, r1 2ffe0: 18 f4 brcc .+6 ; 0x2ffe8 block->flag |= BLOCK_FLAG_DDA_LOWRES; 2ffe2: 85 a9 ldd r24, Z+53 ; 0x35 2ffe4: 88 60 ori r24, 0x08 ; 8 2ffe6: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2ffe8: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2ffea: 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; 2ffec: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 2fff0: 91 11 cpse r25, r1 2fff2: 93 c4 rjmp .+2342 ; 0x3091a block_buffer_head = next_buffer_head; 2fff4: a0 96 adiw r28, 0x20 ; 32 2fff6: 3f ad ldd r19, Y+63 ; 0x3f 2fff8: a0 97 sbiw r28, 0x20 ; 32 2fffa: 30 93 a8 0d sts 0x0DA8, r19 ; 0x800da8 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2fffe: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 30000: c3 58 subi r28, 0x83 ; 131 30002: df 4f sbci r29, 0xFF ; 255 30004: 88 81 ld r24, Y 30006: 99 81 ldd r25, Y+1 ; 0x01 30008: aa 81 ldd r26, Y+2 ; 0x02 3000a: bb 81 ldd r27, Y+3 ; 0x03 3000c: cd 57 subi r28, 0x7D ; 125 3000e: d0 40 sbci r29, 0x00 ; 0 30010: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 30014: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 30018: a0 93 a8 06 sts 0x06A8, r26 ; 0x8006a8 3001c: b0 93 a9 06 sts 0x06A9, r27 ; 0x8006a9 30020: cf 57 subi r28, 0x7F ; 127 30022: df 4f sbci r29, 0xFF ; 255 30024: 28 81 ld r18, Y 30026: 39 81 ldd r19, Y+1 ; 0x01 30028: 4a 81 ldd r20, Y+2 ; 0x02 3002a: 5b 81 ldd r21, Y+3 ; 0x03 3002c: c1 58 subi r28, 0x81 ; 129 3002e: d0 40 sbci r29, 0x00 ; 0 30030: 20 93 aa 06 sts 0x06AA, r18 ; 0x8006aa 30034: 30 93 ab 06 sts 0x06AB, r19 ; 0x8006ab 30038: 40 93 ac 06 sts 0x06AC, r20 ; 0x8006ac 3003c: 50 93 ad 06 sts 0x06AD, r21 ; 0x8006ad 30040: e5 96 adiw r28, 0x35 ; 53 30042: 8c ad ldd r24, Y+60 ; 0x3c 30044: 9d ad ldd r25, Y+61 ; 0x3d 30046: ae ad ldd r26, Y+62 ; 0x3e 30048: bf ad ldd r27, Y+63 ; 0x3f 3004a: e5 97 sbiw r28, 0x35 ; 53 3004c: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 30050: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af 30054: a0 93 b0 06 sts 0x06B0, r26 ; 0x8006b0 30058: b0 93 b1 06 sts 0x06B1, r27 ; 0x8006b1 3005c: ad 96 adiw r28, 0x2d ; 45 3005e: 2c ad ldd r18, Y+60 ; 0x3c 30060: 3d ad ldd r19, Y+61 ; 0x3d 30062: 4e ad ldd r20, Y+62 ; 0x3e 30064: 5f ad ldd r21, Y+63 ; 0x3f 30066: ad 97 sbiw r28, 0x2d ; 45 30068: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 3006c: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 30070: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 30074: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 30078: 89 a1 ldd r24, Y+33 ; 0x21 3007a: 9a a1 ldd r25, Y+34 ; 0x22 3007c: ab a1 ldd r26, Y+35 ; 0x23 3007e: bc a1 ldd r27, Y+36 ; 0x24 30080: 80 93 04 04 sts 0x0404, r24 ; 0x800404 30084: 90 93 05 04 sts 0x0405, r25 ; 0x800405 30088: a0 93 06 04 sts 0x0406, r26 ; 0x800406 3008c: b0 93 07 04 sts 0x0407, r27 ; 0x800407 position_float[Y_AXIS] = y; 30090: 8d a1 ldd r24, Y+37 ; 0x25 30092: 9e a1 ldd r25, Y+38 ; 0x26 30094: af a1 ldd r26, Y+39 ; 0x27 30096: b8 a5 ldd r27, Y+40 ; 0x28 30098: 80 93 08 04 sts 0x0408, r24 ; 0x800408 3009c: 90 93 09 04 sts 0x0409, r25 ; 0x800409 300a0: a0 93 0a 04 sts 0x040A, r26 ; 0x80040a 300a4: b0 93 0b 04 sts 0x040B, r27 ; 0x80040b position_float[Z_AXIS] = z; 300a8: a7 96 adiw r28, 0x27 ; 39 300aa: 8c ad ldd r24, Y+60 ; 0x3c 300ac: 9d ad ldd r25, Y+61 ; 0x3d 300ae: ae ad ldd r26, Y+62 ; 0x3e 300b0: bf ad ldd r27, Y+63 ; 0x3f 300b2: a7 97 sbiw r28, 0x27 ; 39 300b4: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c 300b8: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 300bc: a0 93 0e 04 sts 0x040E, r26 ; 0x80040e 300c0: b0 93 0f 04 sts 0x040F, r27 ; 0x80040f position_float[E_AXIS] = e; 300c4: a9 96 adiw r28, 0x29 ; 41 300c6: ee ad ldd r30, Y+62 ; 0x3e 300c8: ff ad ldd r31, Y+63 ; 0x3f 300ca: a9 97 sbiw r28, 0x29 ; 41 300cc: 80 81 ld r24, Z 300ce: 91 81 ldd r25, Z+1 ; 0x01 300d0: a2 81 ldd r26, Z+2 ; 0x02 300d2: b3 81 ldd r27, Z+3 ; 0x03 300d4: 80 93 10 04 sts 0x0410, r24 ; 0x800410 300d8: 90 93 11 04 sts 0x0411, r25 ; 0x800411 300dc: a0 93 12 04 sts 0x0412, r26 ; 0x800412 300e0: 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; 300e4: 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); 300e8: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 300ec: 8f 19 sub r24, r15 300ee: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 300f0: 83 30 cpi r24, 0x03 ; 3 300f2: 40 f1 brcs .+80 ; 0x30144 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 300f4: 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) 300f8: 11 11 cpse r17, r1 300fa: 01 c0 rjmp .+2 ; 0x300fe block_index = BLOCK_BUFFER_SIZE; 300fc: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 300fe: 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; 30100: fe e6 ldi r31, 0x6E ; 110 30102: 1f 9f mul r17, r31 30104: c0 01 movw r24, r0 30106: 11 24 eor r1, r1 30108: 9c 01 movw r18, r24 3010a: 28 53 subi r18, 0x38 ; 56 3010c: 39 4f sbci r19, 0xF9 ; 249 3010e: 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) 30110: 11 11 cpse r17, r1 30112: 01 c0 rjmp .+2 ; 0x30116 block_index = BLOCK_BUFFER_SIZE; 30114: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 30116: 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)); 30118: 3e e6 ldi r19, 0x6E ; 110 3011a: 13 9f mul r17, r19 3011c: c0 01 movw r24, r0 3011e: 11 24 eor r1, r1 30120: ac 01 movw r20, r24 30122: 48 53 subi r20, 0x38 ; 56 30124: 59 4f sbci r21, 0xF9 ; 249 30126: 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)); 30128: 9e e6 ldi r25, 0x6E ; 110 3012a: 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) { 3012c: f1 16 cp r15, r17 3012e: 69 f0 breq .+26 ; 0x3014a if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 30130: d6 01 movw r26, r12 30132: d5 96 adiw r26, 0x35 ; 53 30134: 0c 91 ld r16, X 30136: 02 ff sbrs r16, 2 30138: 7e c3 rjmp .+1788 ; 0x30836 // 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); 3013a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 3013e: 81 1b sub r24, r17 30140: 8f 70 andi r24, 0x0F ; 15 30142: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 30144: 82 30 cpi r24, 0x02 ; 2 30146: 08 f4 brcc .+2 ; 0x3014a 30148: a3 c0 rjmp .+326 ; 0x30290 // 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; 3014a: 3e e6 ldi r19, 0x6E ; 110 3014c: f3 9e mul r15, r19 3014e: c0 01 movw r24, r0 30150: 11 24 eor r1, r1 30152: ac 01 movw r20, r24 30154: 48 53 subi r20, 0x38 ; 56 30156: 59 4f sbci r21, 0xF9 ; 249 30158: 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) 3015a: f3 94 inc r15 3015c: 50 e1 ldi r21, 0x10 ; 16 3015e: f5 12 cpse r15, r21 30160: 01 c0 rjmp .+2 ; 0x30164 block_index = 0; 30162: 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)); 30164: ae e6 ldi r26, 0x6E ; 110 30166: fa 9e mul r15, r26 30168: c0 01 movw r24, r0 3016a: 11 24 eor r1, r1 3016c: fc 01 movw r30, r24 3016e: e8 53 subi r30, 0x38 ; 56 30170: f9 4f sbci r31, 0xF9 ; 249 30172: 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)); 30174: 8e e6 ldi r24, 0x6E ; 110 30176: 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) { 30178: d5 01 movw r26, r10 3017a: d5 96 adiw r26, 0x35 ; 53 3017c: 8c 91 ld r24, X 3017e: d5 97 sbiw r26, 0x35 ; 53 30180: 81 fd sbrc r24, 1 30182: 5a c0 rjmp .+180 ; 0x30238 30184: 95 96 adiw r26, 0x25 ; 37 30186: 4d 90 ld r4, X+ 30188: 5d 90 ld r5, X+ 3018a: 6d 90 ld r6, X+ 3018c: 7c 90 ld r7, X 3018e: 98 97 sbiw r26, 0x28 ; 40 30190: f6 01 movw r30, r12 30192: 95 a0 ldd r9, Z+37 ; 0x25 30194: e6 a0 ldd r14, Z+38 ; 0x26 30196: 07 a1 ldd r16, Z+39 ; 0x27 30198: 10 a5 ldd r17, Z+40 ; 0x28 3019a: 29 2d mov r18, r9 3019c: 3e 2d mov r19, r14 3019e: a8 01 movw r20, r16 301a0: c3 01 movw r24, r6 301a2: b2 01 movw r22, r4 301a4: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 301a8: 87 ff sbrs r24, 7 301aa: 46 c0 rjmp .+140 ; 0x30238 // 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); 301ac: a3 01 movw r20, r6 301ae: 92 01 movw r18, r4 301b0: c3 01 movw r24, r6 301b2: b2 01 movw r22, r4 301b4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 301b8: 2b 01 movw r4, r22 301ba: 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)); 301bc: d5 01 movw r26, r10 301be: d1 96 adiw r26, 0x31 ; 49 301c0: 6d 91 ld r22, X+ 301c2: 7d 91 ld r23, X+ 301c4: 8d 91 ld r24, X+ 301c6: 9c 91 ld r25, X 301c8: d4 97 sbiw r26, 0x34 ; 52 301ca: 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); 301cc: 9b 01 movw r18, r22 301ce: ac 01 movw r20, r24 301d0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 301d4: f5 01 movw r30, r10 301d6: 25 a5 ldd r18, Z+45 ; 0x2d 301d8: 36 a5 ldd r19, Z+46 ; 0x2e 301da: 47 a5 ldd r20, Z+47 ; 0x2f 301dc: 50 a9 ldd r21, Z+48 ; 0x30 301de: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 301e2: 9b 01 movw r18, r22 301e4: ac 01 movw r20, r24 301e6: c3 01 movw r24, r6 301e8: b2 01 movw r22, r4 301ea: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 301ee: 0f 94 32 a6 call 0x34c64 ; 0x34c64 301f2: 2b 01 movw r4, r22 301f4: 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)); 301f6: 9b 01 movw r18, r22 301f8: ac 01 movw r20, r24 301fa: 69 2d mov r22, r9 301fc: 7e 2d mov r23, r14 301fe: c8 01 movw r24, r16 30200: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 30204: 87 ff sbrs r24, 7 30206: 03 c0 rjmp .+6 ; 0x3020e 30208: 49 2c mov r4, r9 3020a: 5e 2c mov r5, r14 3020c: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 3020e: 92 01 movw r18, r4 30210: a3 01 movw r20, r6 30212: 69 2d mov r22, r9 30214: 7e 2d mov r23, r14 30216: c8 01 movw r24, r16 30218: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 3021c: 88 23 and r24, r24 3021e: 61 f0 breq .+24 ; 0x30238 30220: d6 01 movw r26, r12 30222: d5 96 adiw r26, 0x35 ; 53 30224: 2c 91 ld r18, X current->entry_speed = entry_speed; 30226: c2 01 movw r24, r4 30228: d3 01 movw r26, r6 3022a: f6 01 movw r30, r12 3022c: 85 a3 std Z+37, r24 ; 0x25 3022e: 96 a3 std Z+38, r25 ; 0x26 30230: a7 a3 std Z+39, r26 ; 0x27 30232: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 30234: 21 60 ori r18, 0x01 ; 1 30236: 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) { 30238: d5 01 movw r26, r10 3023a: d5 96 adiw r26, 0x35 ; 53 3023c: 8c 91 ld r24, X 3023e: d5 97 sbiw r26, 0x35 ; 53 30240: f6 01 movw r30, r12 30242: 95 a9 ldd r25, Z+53 ; 0x35 30244: 89 2b or r24, r25 30246: 80 ff sbrs r24, 0 30248: 14 c0 rjmp .+40 ; 0x30272 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 3024a: 05 a1 ldd r16, Z+37 ; 0x25 3024c: 16 a1 ldd r17, Z+38 ; 0x26 3024e: 27 a1 ldd r18, Z+39 ; 0x27 30250: 30 a5 ldd r19, Z+40 ; 0x28 30252: 95 96 adiw r26, 0x25 ; 37 30254: 4d 91 ld r20, X+ 30256: 5d 91 ld r21, X+ 30258: 6d 91 ld r22, X+ 3025a: 7c 91 ld r23, X 3025c: 98 97 sbiw r26, 0x28 ; 40 3025e: c5 01 movw r24, r10 30260: 0f 94 18 6d call 0x2da30 ; 0x2da30 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 30264: d5 01 movw r26, r10 30266: d5 96 adiw r26, 0x35 ; 53 30268: 8c 91 ld r24, X 3026a: d5 97 sbiw r26, 0x35 ; 53 3026c: 8e 7f andi r24, 0xFE ; 254 3026e: d5 96 adiw r26, 0x35 ; 53 30270: 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) 30272: f3 94 inc r15 30274: b0 e1 ldi r27, 0x10 ; 16 30276: fb 12 cpse r15, r27 30278: 01 c0 rjmp .+2 ; 0x3027c block_index = 0; 3027a: 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)); 3027c: f8 9c mul r15, r8 3027e: c0 01 movw r24, r0 30280: 11 24 eor r1, r1 30282: 88 53 subi r24, 0x38 ; 56 30284: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 30286: 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; 3028a: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 3028c: f2 12 cpse r15, r18 3028e: 43 c3 rjmp .+1670 ; 0x30916 } // 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); 30290: 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) 30294: 81 11 cpse r24, r1 30296: 01 c0 rjmp .+2 ; 0x3029a block_index = BLOCK_BUFFER_SIZE; 30298: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 3029a: 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); 3029c: ee e6 ldi r30, 0x6E ; 110 3029e: 8e 9f mul r24, r30 302a0: c0 01 movw r24, r0 302a2: 11 24 eor r1, r1 302a4: 9c 01 movw r18, r24 302a6: 28 53 subi r18, 0x38 ; 56 302a8: 39 4f sbci r19, 0xF9 ; 249 302aa: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 302ac: d9 01 movw r26, r18 302ae: 95 96 adiw r26, 0x25 ; 37 302b0: 4d 91 ld r20, X+ 302b2: 5d 91 ld r21, X+ 302b4: 6d 91 ld r22, X+ 302b6: 7c 91 ld r23, X 302b8: 98 97 sbiw r26, 0x28 ; 40 302ba: 09 a5 ldd r16, Y+41 ; 0x29 302bc: 1d a5 ldd r17, Y+45 ; 0x2d 302be: 29 ad ldd r18, Y+57 ; 0x39 302c0: 39 a9 ldd r19, Y+49 ; 0x31 302c2: c7 01 movw r24, r14 302c4: 0f 94 18 6d call 0x2da30 ; 0x2da30 current->flag &= ~BLOCK_FLAG_RECALCULATE; 302c8: f7 01 movw r30, r14 302ca: 85 a9 ldd r24, Z+53 ; 0x35 302cc: 8e 7f andi r24, 0xFE ; 254 302ce: 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(); 302d0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 302d4: 82 60 ori r24, 0x02 ; 2 302d6: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 302da: 0d 94 e9 76 jmp 0x2edd2 ; 0x2edd2 // 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)); 302de: a0 5e subi r26, 0xE0 ; 224 302e0: b8 4f sbci r27, 0xF8 ; 248 302e2: 80 e1 ldi r24, 0x10 ; 16 302e4: e5 ef ldi r30, 0xF5 ; 245 302e6: f1 e1 ldi r31, 0x11 ; 17 302e8: 0d 94 24 77 jmp 0x2ee48 ; 0x2ee48 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]); 302ec: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 302f0: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 302f4: 40 91 40 04 lds r20, 0x0440 ; 0x800440 302f8: 50 91 41 04 lds r21, 0x0441 ; 0x800441 302fc: a7 96 adiw r28, 0x27 ; 39 302fe: 6c ad ldd r22, Y+60 ; 0x3c 30300: 7d ad ldd r23, Y+61 ; 0x3d 30302: 8e ad ldd r24, Y+62 ; 0x3e 30304: 9f ad ldd r25, Y+63 ; 0x3f 30306: a7 97 sbiw r28, 0x27 ; 39 30308: 0d 94 ba 77 jmp 0x2ef74 ; 0x2ef74 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); 3030c: 81 e0 ldi r24, 0x01 ; 1 3030e: 80 8f std Z+24, r24 ; 0x18 30310: 0d 94 60 79 jmp 0x2f2c0 ; 0x2f2c0 { if(feed_rate 30318: b0 90 6f 04 lds r11, 0x046F ; 0x80046f 3031c: 00 91 70 04 lds r16, 0x0470 ; 0x800470 30320: 10 91 71 04 lds r17, 0x0471 ; 0x800471 30324: 53 c8 rjmp .-3930 ; 0x2f3cc 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])); 30326: c5 01 movw r24, r10 30328: b4 01 movw r22, r8 3032a: 0f 94 05 9c call 0x3380a ; 0x3380a 3032e: 4b 01 movw r8, r22 30330: 5c 01 movw r10, r24 30332: c7 01 movw r24, r14 30334: b6 01 movw r22, r12 30336: 0f 94 05 9c call 0x3380a ; 0x3380a 3033a: 9b 01 movw r18, r22 3033c: ac 01 movw r20, r24 3033e: c5 01 movw r24, r10 30340: b4 01 movw r22, r8 30342: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 30346: 6b 01 movw r12, r22 30348: 7c 01 movw r14, r24 3034a: 22 96 adiw r28, 0x02 ; 2 3034c: 6c ad ldd r22, Y+60 ; 0x3c 3034e: 7d ad ldd r23, Y+61 ; 0x3d 30350: 8e ad ldd r24, Y+62 ; 0x3e 30352: 9f ad ldd r25, Y+63 ; 0x3f 30354: 22 97 sbiw r28, 0x02 ; 2 30356: 0f 94 05 9c call 0x3380a ; 0x3380a 3035a: 9b 01 movw r18, r22 3035c: ac 01 movw r20, r24 3035e: c7 01 movw r24, r14 30360: b6 01 movw r22, r12 30362: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 30366: 0f 94 32 a6 call 0x34c64 ; 0x34c64 3036a: 2e e6 ldi r18, 0x6E ; 110 3036c: 22 9d mul r18, r2 3036e: f0 01 movw r30, r0 30370: 23 9d mul r18, r3 30372: f0 0d add r31, r0 30374: 11 24 eor r1, r1 30376: e8 53 subi r30, 0x38 ; 56 30378: f9 4f sbci r31, 0xF9 ; 249 3037a: 65 a7 std Z+45, r22 ; 0x2d 3037c: 76 a7 std Z+46, r23 ; 0x2e 3037e: 87 a7 std Z+47, r24 ; 0x2f 30380: 90 ab std Z+48, r25 ; 0x30 30382: c2 c8 rjmp .-3708 ; 0x2f508 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 30384: 2a 96 adiw r28, 0x0a ; 10 30386: 2c ad ldd r18, Y+60 ; 0x3c 30388: 3d ad ldd r19, Y+61 ; 0x3d 3038a: 4e ad ldd r20, Y+62 ; 0x3e 3038c: 5f ad ldd r21, Y+63 ; 0x3f 3038e: 2a 97 sbiw r28, 0x0a ; 10 30390: 23 2b or r18, r19 30392: 24 2b or r18, r20 30394: 25 2b or r18, r21 30396: 09 f4 brne .+2 ; 0x3039a 30398: 0e c1 rjmp .+540 ; 0x305b6 3039a: 60 91 66 04 lds r22, 0x0466 ; 0x800466 3039e: 70 91 67 04 lds r23, 0x0467 ; 0x800467 303a2: 80 91 68 04 lds r24, 0x0468 ; 0x800468 303a6: 90 91 69 04 lds r25, 0x0469 ; 0x800469 303aa: 29 a5 ldd r18, Y+41 ; 0x29 303ac: 3a a5 ldd r19, Y+42 ; 0x2a 303ae: 4b a5 ldd r20, Y+43 ; 0x2b 303b0: 5c a5 ldd r21, Y+44 ; 0x2c 303b2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 303b6: 0f 94 42 a3 call 0x34684 ; 0x34684 303ba: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 303be: 2b 01 movw r4, r22 303c0: 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 303c2: 80 91 e1 16 lds r24, 0x16E1 ; 0x8016e1 303c6: 90 91 e2 16 lds r25, 0x16E2 ; 0x8016e2 303ca: a0 91 e3 16 lds r26, 0x16E3 ; 0x8016e3 303ce: b0 91 e4 16 lds r27, 0x16E4 ; 0x8016e4 303d2: 8d a7 std Y+45, r24 ; 0x2d 303d4: 9e a7 std Y+46, r25 ; 0x2e 303d6: af a7 std Y+47, r26 ; 0x2f 303d8: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 303da: 20 e0 ldi r18, 0x00 ; 0 303dc: 30 e0 ldi r19, 0x00 ; 0 303de: a9 01 movw r20, r18 303e0: bc 01 movw r22, r24 303e2: cd 01 movw r24, r26 303e4: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 303e8: 18 16 cp r1, r24 303ea: 0c f0 brlt .+2 ; 0x303ee 303ec: ed c0 rjmp .+474 ; 0x305c8 * 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 303ee: 20 e0 ldi r18, 0x00 ; 0 303f0: 30 e0 ldi r19, 0x00 ; 0 303f2: a9 01 movw r20, r18 303f4: 26 96 adiw r28, 0x06 ; 6 303f6: 6c ad ldd r22, Y+60 ; 0x3c 303f8: 7d ad ldd r23, Y+61 ; 0x3d 303fa: 8e ad ldd r24, Y+62 ; 0x3e 303fc: 9f ad ldd r25, Y+63 ; 0x3f 303fe: 26 97 sbiw r28, 0x06 ; 6 30400: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 30404: 87 fd sbrc r24, 7 30406: e0 c0 rjmp .+448 ; 0x305c8 && fabs(delta_mm[Z_AXIS]) < 0.5; 30408: 22 96 adiw r28, 0x02 ; 2 3040a: 6c ad ldd r22, Y+60 ; 0x3c 3040c: 7d ad ldd r23, Y+61 ; 0x3d 3040e: 8e ad ldd r24, Y+62 ; 0x3e 30410: 9f ad ldd r25, Y+63 ; 0x3f 30412: 22 97 sbiw r28, 0x02 ; 2 30414: 9f 77 andi r25, 0x7F ; 127 30416: 20 e0 ldi r18, 0x00 ; 0 30418: 30 e0 ldi r19, 0x00 ; 0 3041a: 40 e0 ldi r20, 0x00 ; 0 3041c: 5f e3 ldi r21, 0x3F ; 63 3041e: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 30422: 87 ff sbrs r24, 7 30424: d1 c0 rjmp .+418 ; 0x305c8 * * 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 30426: 8e e6 ldi r24, 0x6E ; 110 30428: 82 9d mul r24, r2 3042a: 80 01 movw r16, r0 3042c: 83 9d mul r24, r3 3042e: 10 0d add r17, r0 30430: 11 24 eor r1, r1 30432: 0c 5e subi r16, 0xEC ; 236 30434: 18 4f sbci r17, 0xF8 ; 248 30436: 81 e0 ldi r24, 0x01 ; 1 30438: d8 01 movw r26, r16 3043a: 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]) 3043c: 20 91 04 04 lds r18, 0x0404 ; 0x800404 30440: 30 91 05 04 lds r19, 0x0405 ; 0x800405 30444: 40 91 06 04 lds r20, 0x0406 ; 0x800406 30448: 50 91 07 04 lds r21, 0x0407 ; 0x800407 3044c: 69 a1 ldd r22, Y+33 ; 0x21 3044e: 7a a1 ldd r23, Y+34 ; 0x22 30450: 8b a1 ldd r24, Y+35 ; 0x23 30452: 9c a1 ldd r25, Y+36 ; 0x24 30454: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 30458: 69 ab std Y+49, r22 ; 0x31 3045a: 7a ab std Y+50, r23 ; 0x32 3045c: 8b ab std Y+51, r24 ; 0x33 3045e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 30460: 20 91 08 04 lds r18, 0x0408 ; 0x800408 30464: 30 91 09 04 lds r19, 0x0409 ; 0x800409 30468: 40 91 0a 04 lds r20, 0x040A ; 0x80040a 3046c: 50 91 0b 04 lds r21, 0x040B ; 0x80040b 30470: 6d a1 ldd r22, Y+37 ; 0x25 30472: 7e a1 ldd r23, Y+38 ; 0x26 30474: 8f a1 ldd r24, Y+39 ; 0x27 30476: 98 a5 ldd r25, Y+40 ; 0x28 30478: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 3047c: 4b 01 movw r8, r22 3047e: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 30480: 20 91 0c 04 lds r18, 0x040C ; 0x80040c 30484: 30 91 0d 04 lds r19, 0x040D ; 0x80040d 30488: 40 91 0e 04 lds r20, 0x040E ; 0x80040e 3048c: 50 91 0f 04 lds r21, 0x040F ; 0x80040f 30490: a7 96 adiw r28, 0x27 ; 39 30492: 6c ad ldd r22, Y+60 ; 0x3c 30494: 7d ad ldd r23, Y+61 ; 0x3d 30496: 8e ad ldd r24, Y+62 ; 0x3e 30498: 9f ad ldd r25, Y+63 ; 0x3f 3049a: a7 97 sbiw r28, 0x27 ; 39 3049c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 304a0: 6b 01 movw r12, r22 304a2: 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]) 304a4: 29 a9 ldd r18, Y+49 ; 0x31 304a6: 3a a9 ldd r19, Y+50 ; 0x32 304a8: 4b a9 ldd r20, Y+51 ; 0x33 304aa: 5c a9 ldd r21, Y+52 ; 0x34 304ac: ca 01 movw r24, r20 304ae: b9 01 movw r22, r18 304b0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 304b4: 69 ab std Y+49, r22 ; 0x31 304b6: 7a ab std Y+50, r23 ; 0x32 304b8: 8b ab std Y+51, r24 ; 0x33 304ba: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 304bc: a5 01 movw r20, r10 304be: 94 01 movw r18, r8 304c0: c5 01 movw r24, r10 304c2: b4 01 movw r22, r8 304c4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 304c8: 9b 01 movw r18, r22 304ca: ac 01 movw r20, r24 304cc: 69 a9 ldd r22, Y+49 ; 0x31 304ce: 7a a9 ldd r23, Y+50 ; 0x32 304d0: 8b a9 ldd r24, Y+51 ; 0x33 304d2: 9c a9 ldd r25, Y+52 ; 0x34 304d4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 304d8: 4b 01 movw r8, r22 304da: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 304dc: a7 01 movw r20, r14 304de: 96 01 movw r18, r12 304e0: c7 01 movw r24, r14 304e2: b6 01 movw r22, r12 304e4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 304e8: 9b 01 movw r18, r22 304ea: ac 01 movw r20, r24 304ec: c5 01 movw r24, r10 304ee: b4 01 movw r22, r8 304f0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__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]) 304f4: 0f 94 32 a6 call 0x34c64 ; 0x34c64 304f8: 6b 01 movw r12, r22 304fa: 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]); 304fc: 20 91 10 04 lds r18, 0x0410 ; 0x800410 30500: 30 91 11 04 lds r19, 0x0411 ; 0x800411 30504: 40 91 12 04 lds r20, 0x0412 ; 0x800412 30508: 50 91 13 04 lds r21, 0x0413 ; 0x800413 3050c: a9 96 adiw r28, 0x29 ; 41 3050e: ee ad ldd r30, Y+62 ; 0x3e 30510: ff ad ldd r31, Y+63 ; 0x3f 30512: a9 97 sbiw r28, 0x29 ; 41 30514: 60 81 ld r22, Z 30516: 71 81 ldd r23, Z+1 ; 0x01 30518: 82 81 ldd r24, Z+2 ; 0x02 3051a: 93 81 ldd r25, Z+3 ; 0x03 3051c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__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; 30520: a7 01 movw r20, r14 30522: 96 01 movw r18, r12 30524: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 30528: 6a 96 adiw r28, 0x1a ; 26 3052a: 6c af std Y+60, r22 ; 0x3c 3052c: 7d af std Y+61, r23 ; 0x3d 3052e: 8e af std Y+62, r24 ; 0x3e 30530: 9f af std Y+63, r25 ; 0x3f 30532: 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) 30534: 20 e0 ldi r18, 0x00 ; 0 30536: 30 e0 ldi r19, 0x00 ; 0 30538: 40 e4 ldi r20, 0x40 ; 64 3053a: 50 e4 ldi r21, 0x40 ; 64 3053c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 30540: 18 16 cp r1, r24 30542: 0c f4 brge .+2 ; 0x30546 30544: 9e c0 rjmp .+316 ; 0x30682 block->use_advance_lead = false; else if (e_D_ratio > 0) { 30546: 20 e0 ldi r18, 0x00 ; 0 30548: 30 e0 ldi r19, 0x00 ; 0 3054a: a9 01 movw r20, r18 3054c: 6a 96 adiw r28, 0x1a ; 26 3054e: 6c ad ldd r22, Y+60 ; 0x3c 30550: 7d ad ldd r23, Y+61 ; 0x3d 30552: 8e ad ldd r24, Y+62 ; 0x3e 30554: 9f ad ldd r25, Y+63 ; 0x3f 30556: 6a 97 sbiw r28, 0x1a ; 26 30558: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 3055c: 18 16 cp r1, r24 3055e: 0c f0 brlt .+2 ; 0x30562 30560: 42 c0 rjmp .+132 ; 0x305e6 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 30562: 6a 96 adiw r28, 0x1a ; 26 30564: 2c ad ldd r18, Y+60 ; 0x3c 30566: 3d ad ldd r19, Y+61 ; 0x3d 30568: 4e ad ldd r20, Y+62 ; 0x3e 3056a: 5f ad ldd r21, Y+63 ; 0x3f 3056c: 6a 97 sbiw r28, 0x1a ; 26 3056e: 6d a5 ldd r22, Y+45 ; 0x2d 30570: 7e a5 ldd r23, Y+46 ; 0x2e 30572: 8f a5 ldd r24, Y+47 ; 0x2f 30574: 98 a9 ldd r25, Y+48 ; 0x30 30576: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 3057a: 9b 01 movw r18, r22 3057c: ac 01 movw r20, r24 3057e: 60 91 86 04 lds r22, 0x0486 ; 0x800486 30582: 70 91 87 04 lds r23, 0x0487 ; 0x800487 30586: 80 91 88 04 lds r24, 0x0488 ; 0x800488 3058a: 90 91 89 04 lds r25, 0x0489 ; 0x800489 3058e: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 30592: 29 a5 ldd r18, Y+41 ; 0x29 30594: 3a a5 ldd r19, Y+42 ; 0x2a 30596: 4b a5 ldd r20, Y+43 ; 0x2b 30598: 5c a5 ldd r21, Y+44 ; 0x2c 3059a: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 3059e: 0f 94 42 a3 call 0x34684 ; 0x34684 305a2: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 305a6: 64 15 cp r22, r4 305a8: 75 05 cpc r23, r5 305aa: 86 05 cpc r24, r6 305ac: 97 05 cpc r25, r7 305ae: d8 f4 brcc .+54 ; 0x305e6 305b0: 2b 01 movw r4, r22 305b2: 3c 01 movw r6, r24 305b4: 18 c0 rjmp .+48 ; 0x305e6 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 305b6: 60 91 f2 04 lds r22, 0x04F2 ; 0x8004f2 305ba: 70 91 f3 04 lds r23, 0x04F3 ; 0x8004f3 305be: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 305c2: 90 91 f5 04 lds r25, 0x04F5 ; 0x8004f5 305c6: f1 ce rjmp .-542 ; 0x303aa * * 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 305c8: 8e e6 ldi r24, 0x6E ; 110 305ca: 82 9d mul r24, r2 305cc: f0 01 movw r30, r0 305ce: 83 9d mul r24, r3 305d0: f0 0d add r31, r0 305d2: 11 24 eor r1, r1 305d4: ec 5e subi r30, 0xEC ; 236 305d6: f8 4f sbci r31, 0xF8 ; 248 305d8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 305da: 6a 96 adiw r28, 0x1a ; 26 305dc: 1c ae std Y+60, r1 ; 0x3c 305de: 1d ae std Y+61, r1 ; 0x3d 305e0: 1e ae std Y+62, r1 ; 0x3e 305e2: 1f ae std Y+63, r1 ; 0x3f 305e4: 6a 97 sbiw r28, 0x1a ; 26 305e6: 10 e0 ldi r17, 0x00 ; 0 305e8: 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) 305ea: a3 96 adiw r28, 0x23 ; 35 305ec: ee ad ldd r30, Y+62 ; 0x3e 305ee: ff ad ldd r31, Y+63 ; 0x3f 305f0: a3 97 sbiw r28, 0x23 ; 35 305f2: e0 0f add r30, r16 305f4: f1 1f adc r31, r17 305f6: e8 53 subi r30, 0x38 ; 56 305f8: f9 4f sbci r31, 0xF9 ; 249 305fa: c0 80 ld r12, Z 305fc: d1 80 ldd r13, Z+1 ; 0x01 305fe: e2 80 ldd r14, Z+2 ; 0x02 30600: f3 80 ldd r15, Z+3 ; 0x03 30602: c1 14 cp r12, r1 30604: d1 04 cpc r13, r1 30606: e1 04 cpc r14, r1 30608: f1 04 cpc r15, r1 3060a: a1 f1 breq .+104 ; 0x30674 3060c: f8 01 movw r30, r16 3060e: eb 51 subi r30, 0x1B ; 27 30610: f9 4e sbci r31, 0xE9 ; 233 30612: 60 81 ld r22, Z 30614: 71 81 ldd r23, Z+1 ; 0x01 30616: 82 81 ldd r24, Z+2 ; 0x02 30618: 93 81 ldd r25, Z+3 ; 0x03 3061a: 64 15 cp r22, r4 3061c: 75 05 cpc r23, r5 3061e: 86 05 cpc r24, r6 30620: 97 05 cpc r25, r7 30622: 40 f5 brcc .+80 ; 0x30674 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 30624: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 30628: 29 ad ldd r18, Y+57 ; 0x39 3062a: 3a ad ldd r19, Y+58 ; 0x3a 3062c: 4b ad ldd r20, Y+59 ; 0x3b 3062e: 5c ad ldd r21, Y+60 ; 0x3c 30630: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30634: 4b 01 movw r8, r22 30636: 5c 01 movw r10, r24 30638: c7 01 movw r24, r14 3063a: b6 01 movw r22, r12 3063c: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 30640: 9b 01 movw r18, r22 30642: ac 01 movw r20, r24 30644: c5 01 movw r24, r10 30646: b4 01 movw r22, r8 30648: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 3064c: 6b 01 movw r12, r22 3064e: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 30650: c3 01 movw r24, r6 30652: b2 01 movw r22, r4 30654: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 30658: 9b 01 movw r18, r22 3065a: ac 01 movw r20, r24 3065c: c7 01 movw r24, r14 3065e: b6 01 movw r22, r12 30660: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 30664: 87 ff sbrs r24, 7 30666: 06 c0 rjmp .+12 ; 0x30674 30668: c7 01 movw r24, r14 3066a: b6 01 movw r22, r12 3066c: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 30670: 2b 01 movw r4, r22 30672: 3c 01 movw r6, r24 30674: 0c 5f subi r16, 0xFC ; 252 30676: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 30678: 00 31 cpi r16, 0x10 ; 16 3067a: 11 05 cpc r17, r1 3067c: 09 f0 breq .+2 ; 0x30680 3067e: b5 cf rjmp .-150 ; 0x305ea 30680: 01 c9 rjmp .-3582 ; 0x2f884 // 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; 30682: d8 01 movw r26, r16 30684: 1c 92 st X, r1 30686: af cf rjmp .-162 ; 0x305e6 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 30688: c9 a6 std Y+41, r12 ; 0x29 3068a: dd a6 std Y+45, r13 ; 0x2d 3068c: e9 ae std Y+57, r14 ; 0x39 3068e: f9 aa std Y+49, r15 ; 0x31 limited = true; 30690: 21 e0 ldi r18, 0x01 ; 1 30692: 2d ab std Y+53, r18 ; 0x35 30694: b1 c9 rjmp .-3230 ; 0x2f9f8 // 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); 30696: 27 96 adiw r28, 0x07 ; 7 30698: 2f ad ldd r18, Y+63 ; 0x3f 3069a: 27 97 sbiw r28, 0x07 ; 7 3069c: 2b 96 adiw r28, 0x0b ; 11 3069e: 3f ad ldd r19, Y+63 ; 0x3f 306a0: 2b 97 sbiw r28, 0x0b ; 11 306a2: 2f 96 adiw r28, 0x0f ; 15 306a4: 4f ad ldd r20, Y+63 ; 0x3f 306a6: 2f 97 sbiw r28, 0x0f ; 15 306a8: 63 96 adiw r28, 0x13 ; 19 306aa: 5f ad ldd r21, Y+63 ; 0x3f 306ac: 63 97 sbiw r28, 0x13 ; 19 306ae: 6b 96 adiw r28, 0x1b ; 27 306b0: 6f ad ldd r22, Y+63 ; 0x3f 306b2: 6b 97 sbiw r28, 0x1b ; 27 306b4: 6f 96 adiw r28, 0x1f ; 31 306b6: 7f ad ldd r23, Y+63 ; 0x3f 306b8: 6f 97 sbiw r28, 0x1f ; 31 306ba: c8 01 movw r24, r16 306bc: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 306c0: eb 96 adiw r28, 0x3b ; 59 306c2: 6c af std Y+60, r22 ; 0x3c 306c4: 7d af std Y+61, r23 ; 0x3d 306c6: 8e af std Y+62, r24 ; 0x3e 306c8: 9f af std Y+63, r25 ; 0x3f 306ca: 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; 306cc: 6b 96 adiw r28, 0x1b ; 27 306ce: ef ad ldd r30, Y+63 ; 0x3f 306d0: 6b 97 sbiw r28, 0x1b ; 27 306d2: ed af std Y+61, r30 ; 0x3d 306d4: 6f 96 adiw r28, 0x1f ; 31 306d6: ff ad ldd r31, Y+63 ; 0x3f 306d8: 6f 97 sbiw r28, 0x1f ; 31 306da: fd ab std Y+53, r31 ; 0x35 306dc: 0e af std Y+62, r16 ; 0x3e 306de: 23 96 adiw r28, 0x03 ; 3 306e0: 1f af std Y+63, r17 ; 0x3f 306e2: 23 97 sbiw r28, 0x03 ; 3 306e4: 04 ca rjmp .-3064 ; 0x2faee (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 306e6: f7 fa bst r15, 7 306e8: f0 94 com r15 306ea: f7 f8 bld r15, 7 306ec: f0 94 com r15 306ee: a5 01 movw r20, r10 306f0: 94 01 movw r18, r8 306f2: c7 01 movw r24, r14 306f4: b6 01 movw r22, r12 306f6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 306fa: 87 ff sbrs r24, 7 306fc: 77 ca rjmp .-2834 ; 0x2fbec // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 306fe: 75 01 movw r14, r10 30700: 64 01 movw r12, r8 30702: 74 ca rjmp .-2840 ; 0x2fbec // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 30704: c7 01 movw r24, r14 30706: b6 01 movw r22, r12 30708: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 3070c: 87 fd sbrc r24, 7 3070e: 09 c0 rjmp .+18 ; 0x30722 30710: 20 e0 ldi r18, 0x00 ; 0 30712: 30 e0 ldi r19, 0x00 ; 0 30714: a9 01 movw r20, r18 30716: c5 01 movw r24, r10 30718: b4 01 movw r22, r8 3071a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 3071e: 18 16 cp r1, r24 30720: 2c f4 brge .+10 ; 0x3072c 30722: a5 01 movw r20, r10 30724: 94 01 movw r18, r8 30726: c7 01 movw r24, r14 30728: b6 01 movw r22, r12 3072a: 5c ca rjmp .-2888 ; 0x2fbe4 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 3072c: b7 fa bst r11, 7 3072e: b0 94 com r11 30730: b7 f8 bld r11, 7 30732: b0 94 com r11 30734: a7 01 movw r20, r14 30736: 96 01 movw r18, r12 30738: c5 01 movw r24, r10 3073a: b4 01 movw r22, r8 3073c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 30740: 18 16 cp r1, r24 30742: 0c f0 brlt .+2 ; 0x30746 30744: 53 ca rjmp .-2906 ; 0x2fbec 30746: db cf rjmp .-74 ; 0x306fe // 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; 30748: 8e e6 ldi r24, 0x6E ; 110 3074a: 82 9d mul r24, r2 3074c: f0 01 movw r30, r0 3074e: 83 9d mul r24, r3 30750: f0 0d add r31, r0 30752: 11 24 eor r1, r1 30754: e8 53 subi r30, 0x38 ; 56 30756: f9 4f sbci r31, 0xF9 ; 249 30758: 85 a9 ldd r24, Z+53 ; 0x35 3075a: 84 60 ori r24, 0x04 ; 4 3075c: 85 ab std Z+53, r24 ; 0x35 3075e: a9 a5 ldd r26, Y+41 ; 0x29 30760: ad af std Y+61, r26 ; 0x3d 30762: bd a5 ldd r27, Y+45 ; 0x2d 30764: bd ab std Y+53, r27 ; 0x35 30766: e9 ad ldd r30, Y+57 ; 0x39 30768: ee af std Y+62, r30 ; 0x3e 3076a: f9 a9 ldd r31, Y+49 ; 0x31 3076c: 23 96 adiw r28, 0x03 ; 3 3076e: ff af std Y+63, r31 ; 0x3f 30770: 23 97 sbiw r28, 0x03 ; 3 30772: bc ca rjmp .-2696 ; 0x2fcec // 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; 30774: 81 e0 ldi r24, 0x01 ; 1 30776: 30 cb rjmp .-2464 ; 0x2fdd8 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]; 30778: 20 91 86 04 lds r18, 0x0486 ; 0x800486 3077c: 30 91 87 04 lds r19, 0x0487 ; 0x800487 30780: 40 91 88 04 lds r20, 0x0488 ; 0x800488 30784: 50 91 89 04 lds r21, 0x0489 ; 0x800489 30788: c7 01 movw r24, r14 3078a: b6 01 movw r22, r12 3078c: c1 cb rjmp .-2174 ; 0x2ff10 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) { 3078e: 20 e0 ldi r18, 0x00 ; 0 30790: 30 e4 ldi r19, 0x40 ; 64 30792: 4c e1 ldi r20, 0x1C ; 28 30794: 56 e4 ldi r21, 0x46 ; 70 30796: c7 01 movw r24, r14 30798: b6 01 movw r22, r12 3079a: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 3079e: 18 16 cp r1, r24 307a0: d4 f4 brge .+52 ; 0x307d6 block->advance_rate = advance_rate * 2; 307a2: 8e e6 ldi r24, 0x6E ; 110 307a4: 82 9d mul r24, r2 307a6: 80 01 movw r16, r0 307a8: 83 9d mul r24, r3 307aa: 10 0d add r17, r0 307ac: 11 24 eor r1, r1 307ae: 08 53 subi r16, 0x38 ; 56 307b0: 19 4f sbci r17, 0xF9 ; 249 307b2: 78 01 movw r14, r16 307b4: bd e4 ldi r27, 0x4D ; 77 307b6: eb 0e add r14, r27 307b8: f1 1c adc r15, r1 307ba: a5 01 movw r20, r10 307bc: 94 01 movw r18, r8 307be: c5 01 movw r24, r10 307c0: b4 01 movw r22, r8 307c2: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 307c6: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 307ca: f7 01 movw r30, r14 307cc: 71 83 std Z+1, r23 ; 0x01 307ce: 60 83 st Z, r22 block->advance_step_loops = 2; 307d0: 36 96 adiw r30, 0x06 ; 6 307d2: 82 e0 ldi r24, 0x02 ; 2 307d4: e2 cb rjmp .-2108 ; 0x2ff9a } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 307d6: 20 e0 ldi r18, 0x00 ; 0 307d8: 3f ef ldi r19, 0xFF ; 255 307da: 4f e7 ldi r20, 0x7F ; 127 307dc: 57 e4 ldi r21, 0x47 ; 71 307de: c5 01 movw r24, r10 307e0: b4 01 movw r22, r8 307e2: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 307e6: 87 ff sbrs r24, 7 307e8: 19 c0 rjmp .+50 ; 0x3081c block->advance_rate = advance_rate; 307ea: 8e e6 ldi r24, 0x6E ; 110 307ec: 82 9d mul r24, r2 307ee: 80 01 movw r16, r0 307f0: 83 9d mul r24, r3 307f2: 10 0d add r17, r0 307f4: 11 24 eor r1, r1 307f6: 0b 5e subi r16, 0xEB ; 235 307f8: 18 4f sbci r17, 0xF8 ; 248 307fa: c5 01 movw r24, r10 307fc: b4 01 movw r22, r8 307fe: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 30802: d8 01 movw r26, r16 30804: 6d 93 st X+, r22 30806: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 30808: 8e e6 ldi r24, 0x6E ; 110 3080a: 82 9d mul r24, r2 3080c: f0 01 movw r30, r0 3080e: 83 9d mul r24, r3 30810: f0 0d add r31, r0 30812: 11 24 eor r1, r1 30814: e5 5e subi r30, 0xE5 ; 229 30816: f8 4f sbci r31, 0xF8 ; 248 30818: 81 e0 ldi r24, 0x01 ; 1 3081a: bf cb rjmp .-2178 ; 0x2ff9a { // 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; 3081c: 8e e6 ldi r24, 0x6E ; 110 3081e: 82 9d mul r24, r2 30820: f0 01 movw r30, r0 30822: 83 9d mul r24, r3 30824: f0 0d add r31, r0 30826: 11 24 eor r1, r1 30828: eb 5e subi r30, 0xEB ; 235 3082a: f8 4f sbci r31, 0xF8 ; 248 3082c: 8f ef ldi r24, 0xFF ; 255 3082e: 9f ef ldi r25, 0xFF ; 255 30830: 91 83 std Z+1, r25 ; 0x01 30832: 80 83 st Z, r24 30834: e9 cf rjmp .-46 ; 0x30808 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) { 30836: f6 01 movw r30, r12 30838: 71 a4 ldd r7, Z+41 ; 0x29 3083a: 82 a4 ldd r8, Z+42 ; 0x2a 3083c: 93 a4 ldd r9, Z+43 ; 0x2b 3083e: e4 a4 ldd r14, Z+44 ; 0x2c 30840: 27 2d mov r18, r7 30842: 38 2d mov r19, r8 30844: 49 2d mov r20, r9 30846: 5e 2d mov r21, r14 30848: 65 a1 ldd r22, Z+37 ; 0x25 3084a: 76 a1 ldd r23, Z+38 ; 0x26 3084c: 87 a1 ldd r24, Z+39 ; 0x27 3084e: 90 a5 ldd r25, Z+40 ; 0x28 30850: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 30854: 88 23 and r24, r24 30856: 09 f4 brne .+2 ; 0x3085a 30858: 51 c0 rjmp .+162 ; 0x308fc // 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) ? 3085a: 01 fd sbrc r16, 1 3085c: 44 c0 rjmp .+136 ; 0x308e6 3085e: d5 01 movw r26, r10 30860: 95 96 adiw r26, 0x25 ; 37 30862: 2d 90 ld r2, X+ 30864: 3d 90 ld r3, X+ 30866: 4d 90 ld r4, X+ 30868: 5c 90 ld r5, X 3086a: 98 97 sbiw r26, 0x28 ; 40 3086c: a2 01 movw r20, r4 3086e: 91 01 movw r18, r2 30870: 67 2d mov r22, r7 30872: 78 2d mov r23, r8 30874: 89 2d mov r24, r9 30876: 9e 2d mov r25, r14 30878: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 3087c: 18 16 cp r1, r24 3087e: 9c f5 brge .+102 ; 0x308e6 // 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); 30880: a2 01 movw r20, r4 30882: 91 01 movw r18, r2 30884: c2 01 movw r24, r4 30886: b1 01 movw r22, r2 30888: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 3088c: 1b 01 movw r2, r22 3088e: 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)); 30890: f6 01 movw r30, r12 30892: 61 a9 ldd r22, Z+49 ; 0x31 30894: 72 a9 ldd r23, Z+50 ; 0x32 30896: 83 a9 ldd r24, Z+51 ; 0x33 30898: 94 a9 ldd r25, Z+52 ; 0x34 3089a: 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); 3089c: 9b 01 movw r18, r22 3089e: ac 01 movw r20, r24 308a0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 308a4: d6 01 movw r26, r12 308a6: 9d 96 adiw r26, 0x2d ; 45 308a8: 2d 91 ld r18, X+ 308aa: 3d 91 ld r19, X+ 308ac: 4d 91 ld r20, X+ 308ae: 5c 91 ld r21, X 308b0: d0 97 sbiw r26, 0x30 ; 48 308b2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 308b6: 9b 01 movw r18, r22 308b8: ac 01 movw r20, r24 308ba: c2 01 movw r24, r4 308bc: b1 01 movw r22, r2 308be: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 308c2: 0f 94 32 a6 call 0x34c64 ; 0x34c64 308c6: 2b 01 movw r4, r22 308c8: 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)); 308ca: 9b 01 movw r18, r22 308cc: ac 01 movw r20, r24 308ce: 67 2d mov r22, r7 308d0: 78 2d mov r23, r8 308d2: 89 2d mov r24, r9 308d4: 9e 2d mov r25, r14 308d6: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 308da: 87 fd sbrc r24, 7 308dc: 04 c0 rjmp .+8 ; 0x308e6 308de: 74 2c mov r7, r4 308e0: 85 2c mov r8, r5 308e2: 9a 2c mov r9, r10 308e4: 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) ? 308e6: 87 2d mov r24, r7 308e8: 98 2d mov r25, r8 308ea: a9 2d mov r26, r9 308ec: be 2d mov r27, r14 308ee: f6 01 movw r30, r12 308f0: 85 a3 std Z+37, r24 ; 0x25 308f2: 96 a3 std Z+38, r25 ; 0x26 308f4: a7 a3 std Z+39, r26 ; 0x27 308f6: 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; 308f8: 01 60 ori r16, 0x01 ; 1 308fa: 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) 308fc: 11 11 cpse r17, r1 308fe: 01 c0 rjmp .+2 ; 0x30902 block_index = BLOCK_BUFFER_SIZE; 30900: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 30902: 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)); 30904: 16 9d mul r17, r6 30906: c0 01 movw r24, r0 30908: 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; 3090a: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 3090c: 9c 01 movw r18, r24 3090e: 28 53 subi r18, 0x38 ; 56 30910: 39 4f sbci r19, 0xF9 ; 249 30912: 69 01 movw r12, r18 30914: 0b cc rjmp .-2026 ; 0x3012c 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)); 30916: 6c 01 movw r12, r24 30918: 2f cc rjmp .-1954 ; 0x30178 3091a: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 3091c: 0d 94 e9 76 jmp 0x2edd2 ; 0x2edd2 00030920 : 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(){ 30920: 4f 92 push r4 30922: 5f 92 push r5 30924: 6f 92 push r6 30926: 7f 92 push r7 30928: 8f 92 push r8 3092a: 9f 92 push r9 3092c: af 92 push r10 3092e: bf 92 push r11 30930: cf 92 push r12 30932: df 92 push r13 30934: ef 92 push r14 30936: ff 92 push r15 30938: cf 93 push r28 3093a: df 93 push r29 3093c: cd b7 in r28, 0x3d ; 61 3093e: de b7 in r29, 0x3e ; 62 30940: 2c 97 sbiw r28, 0x0c ; 12 30942: 0f b6 in r0, 0x3f ; 63 30944: f8 94 cli 30946: de bf out 0x3e, r29 ; 62 30948: 0f be out 0x3f, r0 ; 63 3094a: 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]); 3094c: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 30950: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 30954: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 30958: f0 90 00 12 lds r15, 0x1200 ; 0x801200 3095c: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 30960: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa 30964: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb 30968: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc 3096c: 40 91 f5 11 lds r20, 0x11F5 ; 0x8011f5 30970: 50 91 f6 11 lds r21, 0x11F6 ; 0x8011f6 30974: 60 91 f7 11 lds r22, 0x11F7 ; 0x8011f7 30978: 70 91 f8 11 lds r23, 0x11F8 ; 0x8011f8 3097c: 4d 83 std Y+5, r20 ; 0x05 3097e: 5e 83 std Y+6, r21 ; 0x06 30980: 6f 83 std Y+7, r22 ; 0x07 30982: 78 87 std Y+8, r23 ; 0x08 30984: 89 83 std Y+1, r24 ; 0x01 30986: 9a 83 std Y+2, r25 ; 0x02 30988: ab 83 std Y+3, r26 ; 0x03 3098a: 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); 3098c: be 01 movw r22, r28 3098e: 6f 5f subi r22, 0xFF ; 255 30990: 7f 4f sbci r23, 0xFF ; 255 30992: ce 01 movw r24, r28 30994: 05 96 adiw r24, 0x05 ; 5 30996: 0e 94 7f 63 call 0xc6fe ; 0xc6fe position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 3099a: 4d 80 ldd r4, Y+5 ; 0x05 3099c: 5e 80 ldd r5, Y+6 ; 0x06 3099e: 6f 80 ldd r6, Y+7 ; 0x07 309a0: 78 84 ldd r7, Y+8 ; 0x08 309a2: 20 91 36 04 lds r18, 0x0436 ; 0x800436 309a6: 30 91 37 04 lds r19, 0x0437 ; 0x800437 309aa: 40 91 38 04 lds r20, 0x0438 ; 0x800438 309ae: 50 91 39 04 lds r21, 0x0439 ; 0x800439 309b2: c3 01 movw r24, r6 309b4: b2 01 movw r22, r4 309b6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 309ba: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 309be: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 309c2: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 309c6: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 309ca: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 309ce: 89 80 ldd r8, Y+1 ; 0x01 309d0: 9a 80 ldd r9, Y+2 ; 0x02 309d2: ab 80 ldd r10, Y+3 ; 0x03 309d4: bc 80 ldd r11, Y+4 ; 0x04 309d6: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 309da: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 309de: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 309e2: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 309e6: c5 01 movw r24, r10 309e8: b4 01 movw r22, r8 309ea: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 309ee: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 309f2: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 309f6: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 309fa: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 309fe: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 30a02: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30a06: 88 23 and r24, r24 30a08: 09 f4 brne .+2 ; 0x30a0c 30a0a: 8c c0 rjmp .+280 ; 0x30b24 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 30a0c: a5 01 movw r20, r10 30a0e: 94 01 movw r18, r8 30a10: c3 01 movw r24, r6 30a12: b2 01 movw r22, r4 30a14: 0f 94 68 61 call 0x2c2d0 ; 0x2c2d0 30a18: 9b 01 movw r18, r22 30a1a: ac 01 movw r20, r24 30a1c: c7 01 movw r24, r14 30a1e: b6 01 movw r22, r12 30a20: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 30a24: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30a28: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 30a2c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 30a30: 50 91 41 04 lds r21, 0x0441 ; 0x800441 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 30a34: 0f 94 09 9c call 0x33812 ; 0x33812 <__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 ? 30a38: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 30a3c: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30a40: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30a44: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30a48: 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]); 30a4c: 80 91 01 12 lds r24, 0x1201 ; 0x801201 30a50: 90 91 02 12 lds r25, 0x1202 ; 0x801202 30a54: a0 91 03 12 lds r26, 0x1203 ; 0x801203 30a58: b0 91 04 12 lds r27, 0x1204 ; 0x801204 30a5c: 89 87 std Y+9, r24 ; 0x09 30a5e: 9a 87 std Y+10, r25 ; 0x0a 30a60: ab 87 std Y+11, r26 ; 0x0b 30a62: bc 87 std Y+12, r27 ; 0x0c 30a64: 20 91 42 04 lds r18, 0x0442 ; 0x800442 30a68: 30 91 43 04 lds r19, 0x0443 ; 0x800443 30a6c: 40 91 44 04 lds r20, 0x0444 ; 0x800444 30a70: 50 91 45 04 lds r21, 0x0445 ; 0x800445 30a74: bc 01 movw r22, r24 30a76: cd 01 movw r24, r26 30a78: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30a7c: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 30a80: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30a84: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 30a88: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 30a8c: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 30a90: 40 92 04 04 sts 0x0404, r4 ; 0x800404 30a94: 50 92 05 04 sts 0x0405, r5 ; 0x800405 30a98: 60 92 06 04 sts 0x0406, r6 ; 0x800406 30a9c: 70 92 07 04 sts 0x0407, r7 ; 0x800407 position_float[Y_AXIS] = y; 30aa0: 80 92 08 04 sts 0x0408, r8 ; 0x800408 30aa4: 90 92 09 04 sts 0x0409, r9 ; 0x800409 30aa8: a0 92 0a 04 sts 0x040A, r10 ; 0x80040a 30aac: b0 92 0b 04 sts 0x040B, r11 ; 0x80040b position_float[Z_AXIS] = z; 30ab0: c0 92 0c 04 sts 0x040C, r12 ; 0x80040c 30ab4: d0 92 0d 04 sts 0x040D, r13 ; 0x80040d 30ab8: e0 92 0e 04 sts 0x040E, r14 ; 0x80040e 30abc: f0 92 0f 04 sts 0x040F, r15 ; 0x80040f position_float[E_AXIS] = e; 30ac0: 89 85 ldd r24, Y+9 ; 0x09 30ac2: 9a 85 ldd r25, Y+10 ; 0x0a 30ac4: ab 85 ldd r26, Y+11 ; 0x0b 30ac6: bc 85 ldd r27, Y+12 ; 0x0c 30ac8: 80 93 10 04 sts 0x0410, r24 ; 0x800410 30acc: 90 93 11 04 sts 0x0411, r25 ; 0x800411 30ad0: a0 93 12 04 sts 0x0412, r26 ; 0x800412 30ad4: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif st_set_position(position); 30ad8: 0f 94 d3 54 call 0x2a9a6 ; 0x2a9a6 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 30adc: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 30ae0: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 30ae4: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 30ae8: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 30aec: e4 ef ldi r30, 0xF4 ; 244 30aee: f3 e0 ldi r31, 0x03 ; 3 30af0: 80 e1 ldi r24, 0x10 ; 16 30af2: df 01 movw r26, r30 30af4: 1d 92 st X+, r1 30af6: 8a 95 dec r24 30af8: e9 f7 brne .-6 ; 0x30af4 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]); } 30afa: 2c 96 adiw r28, 0x0c ; 12 30afc: 0f b6 in r0, 0x3f ; 63 30afe: f8 94 cli 30b00: de bf out 0x3e, r29 ; 62 30b02: 0f be out 0x3f, r0 ; 63 30b04: cd bf out 0x3d, r28 ; 61 30b06: df 91 pop r29 30b08: cf 91 pop r28 30b0a: ff 90 pop r15 30b0c: ef 90 pop r14 30b0e: df 90 pop r13 30b10: cf 90 pop r12 30b12: bf 90 pop r11 30b14: af 90 pop r10 30b16: 9f 90 pop r9 30b18: 8f 90 pop r8 30b1a: 7f 90 pop r7 30b1c: 6f 90 pop r6 30b1e: 5f 90 pop r5 30b20: 4f 90 pop r4 30b22: 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]); 30b24: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30b28: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 30b2c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 30b30: 50 91 41 04 lds r21, 0x0441 ; 0x800441 30b34: c7 01 movw r24, r14 30b36: b6 01 movw r22, r12 30b38: 7d cf rjmp .-262 ; 0x30a34 00030b3a : 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) { 30b3a: 8f 92 push r8 30b3c: 9f 92 push r9 30b3e: af 92 push r10 30b40: bf 92 push r11 30b42: cf 92 push r12 30b44: df 92 push r13 30b46: ef 92 push r14 30b48: ff 92 push r15 30b4a: 0f 93 push r16 30b4c: 1f 93 push r17 30b4e: 4b 01 movw r8, r22 30b50: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 30b52: e3 e9 ldi r30, 0x93 ; 147 30b54: f6 e0 ldi r31, 0x06 ; 6 30b56: e0 84 ldd r14, Z+8 ; 0x08 30b58: f1 84 ldd r15, Z+9 ; 0x09 30b5a: 02 85 ldd r16, Z+10 ; 0x0a 30b5c: 13 85 ldd r17, Z+11 ; 0x0b 30b5e: 24 81 ldd r18, Z+4 ; 0x04 30b60: 35 81 ldd r19, Z+5 ; 0x05 30b62: 46 81 ldd r20, Z+6 ; 0x06 30b64: 57 81 ldd r21, Z+7 ; 0x07 30b66: 60 81 ld r22, Z 30b68: 71 81 ldd r23, Z+1 ; 0x01 30b6a: 82 81 ldd r24, Z+2 ; 0x02 30b6c: 93 81 ldd r25, Z+3 ; 0x03 30b6e: 1f 92 push r1 30b70: 1f 92 push r1 30b72: 1f 92 push r1 30b74: 1f 92 push r1 30b76: ef e9 ldi r30, 0x9F ; 159 30b78: ce 2e mov r12, r30 30b7a: e6 e0 ldi r30, 0x06 ; 6 30b7c: de 2e mov r13, r30 30b7e: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 30b82: 0f 90 pop r0 30b84: 0f 90 pop r0 30b86: 0f 90 pop r0 30b88: 0f 90 pop r0 } 30b8a: 1f 91 pop r17 30b8c: 0f 91 pop r16 30b8e: ff 90 pop r15 30b90: ef 90 pop r14 30b92: df 90 pop r13 30b94: cf 90 pop r12 30b96: bf 90 pop r11 30b98: af 90 pop r10 30b9a: 9f 90 pop r9 30b9c: 8f 90 pop r8 30b9e: 08 95 ret 00030ba0 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 30ba0: 8f 92 push r8 30ba2: 9f 92 push r9 30ba4: af 92 push r10 30ba6: bf 92 push r11 30ba8: cf 92 push r12 30baa: df 92 push r13 30bac: ef 92 push r14 30bae: ff 92 push r15 30bb0: 0f 93 push r16 30bb2: 1f 93 push r17 30bb4: 4b 01 movw r8, r22 30bb6: 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); 30bb8: e5 ef ldi r30, 0xF5 ; 245 30bba: f1 e1 ldi r31, 0x11 ; 17 30bbc: e0 84 ldd r14, Z+8 ; 0x08 30bbe: f1 84 ldd r15, Z+9 ; 0x09 30bc0: 02 85 ldd r16, Z+10 ; 0x0a 30bc2: 13 85 ldd r17, Z+11 ; 0x0b 30bc4: 24 81 ldd r18, Z+4 ; 0x04 30bc6: 35 81 ldd r19, Z+5 ; 0x05 30bc8: 46 81 ldd r20, Z+6 ; 0x06 30bca: 57 81 ldd r21, Z+7 ; 0x07 30bcc: 60 81 ld r22, Z 30bce: 71 81 ldd r23, Z+1 ; 0x01 30bd0: 82 81 ldd r24, Z+2 ; 0x02 30bd2: 93 81 ldd r25, Z+3 ; 0x03 30bd4: 1f 92 push r1 30bd6: 1f 92 push r1 30bd8: 1f 92 push r1 30bda: 1f 92 push r1 30bdc: e1 e0 ldi r30, 0x01 ; 1 30bde: ce 2e mov r12, r30 30be0: e2 e1 ldi r30, 0x12 ; 18 30be2: de 2e mov r13, r30 30be4: 0f 94 82 76 call 0x2ed04 ; 0x2ed04 30be8: 0f 90 pop r0 30bea: 0f 90 pop r0 30bec: 0f 90 pop r0 30bee: 0f 90 pop r0 } 30bf0: 1f 91 pop r17 30bf2: 0f 91 pop r16 30bf4: ff 90 pop r15 30bf6: ef 90 pop r14 30bf8: df 90 pop r13 30bfa: cf 90 pop r12 30bfc: bf 90 pop r11 30bfe: af 90 pop r10 30c00: 9f 90 pop r9 30c02: 8f 90 pop r8 30c04: 08 95 ret 00030c06 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 30c06: 4f 92 push r4 30c08: 5f 92 push r5 30c0a: 6f 92 push r6 30c0c: 7f 92 push r7 30c0e: 8f 92 push r8 30c10: 9f 92 push r9 30c12: af 92 push r10 30c14: bf 92 push r11 30c16: cf 92 push r12 30c18: df 92 push r13 30c1a: ef 92 push r14 30c1c: ff 92 push r15 30c1e: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 30c20: 80 e0 ldi r24, 0x00 ; 0 30c22: 0f 94 7e 22 call 0x244fc ; 0x244fc 30c26: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30c2a: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30c2e: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 30c32: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = st_get_position(Y_AXIS); 30c36: 81 e0 ldi r24, 0x01 ; 1 30c38: 0f 94 7e 22 call 0x244fc ; 0x244fc 30c3c: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30c40: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 30c44: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 30c48: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad position[Z_AXIS] = st_get_position(Z_AXIS); 30c4c: 82 e0 ldi r24, 0x02 ; 2 30c4e: 0f 94 7e 22 call 0x244fc ; 0x244fc 30c52: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30c56: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30c5a: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30c5e: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 position[E_AXIS] = st_get_position(E_AXIS); 30c62: 83 e0 ldi r24, 0x03 ; 3 30c64: 0f 94 7e 22 call 0x244fc ; 0x244fc 30c68: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30c6c: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 30c70: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 30c74: 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); 30c78: 80 e0 ldi r24, 0x00 ; 0 30c7a: 0f 94 8c 22 call 0x24518 ; 0x24518 30c7e: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30c82: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30c86: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30c8a: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 30c8e: 81 e0 ldi r24, 0x01 ; 1 30c90: 0f 94 8c 22 call 0x24518 ; 0x24518 30c94: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30c98: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30c9c: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30ca0: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 30ca4: 82 e0 ldi r24, 0x02 ; 2 30ca6: 0f 94 8c 22 call 0x24518 ; 0x24518 30caa: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30cae: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30cb2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30cb6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 current_position[E_AXIS] = st_get_position_mm(E_AXIS); 30cba: 83 e0 ldi r24, 0x03 ; 3 30cbc: 0f 94 8c 22 call 0x24518 ; 0x24518 30cc0: 60 93 01 12 sts 0x1201, r22 ; 0x801201 30cc4: 70 93 02 12 sts 0x1202, r23 ; 0x801202 30cc8: 80 93 03 12 sts 0x1203, r24 ; 0x801203 30ccc: 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) { 30cd0: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30cd4: 88 23 and r24, r24 30cd6: 31 f1 breq .+76 ; 0x30d24 #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]); 30cd8: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 30cdc: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa 30ce0: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb 30ce4: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc 30ce8: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30cec: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30cf0: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30cf4: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30cf8: 0f 94 68 61 call 0x2c2d0 ; 0x2c2d0 30cfc: 9b 01 movw r18, r22 30cfe: ac 01 movw r20, r24 30d00: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 30d04: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 30d08: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 30d0c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 30d10: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 30d14: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30d18: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30d1c: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30d20: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 30d24: c0 91 dc 16 lds r28, 0x16DC ; 0x8016dc 30d28: cc 23 and r28, r28 30d2a: 09 f4 brne .+2 ; 0x30d2e 30d2c: 9a c0 rjmp .+308 ; 0x30e62 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 30d2e: c0 ff sbrs r28, 0 30d30: 34 c0 rjmp .+104 ; 0x30d9a // Then add the offset. x -= world2machine_shift[0]; 30d32: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 30d36: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 30d3a: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 30d3e: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 30d42: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30d46: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30d4a: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30d4e: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30d52: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 30d56: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30d5a: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30d5e: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30d62: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y -= world2machine_shift[1]; 30d66: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 30d6a: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 30d6e: 40 91 da 16 lds r20, 0x16DA ; 0x8016da 30d72: 50 91 db 16 lds r21, 0x16DB ; 0x8016db 30d76: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 30d7a: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 30d7e: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 30d82: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 30d86: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 30d8a: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30d8e: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30d92: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30d96: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 30d9a: c1 ff sbrs r28, 1 30d9c: 62 c0 rjmp .+196 ; 0x30e62 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 30d9e: 80 90 f5 11 lds r8, 0x11F5 ; 0x8011f5 30da2: 90 90 f6 11 lds r9, 0x11F6 ; 0x8011f6 30da6: a0 90 f7 11 lds r10, 0x11F7 ; 0x8011f7 30daa: b0 90 f8 11 lds r11, 0x11F8 ; 0x8011f8 30dae: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 30db2: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 30db6: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 30dba: 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; 30dbe: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc 30dc2: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd 30dc6: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce 30dca: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf 30dce: c5 01 movw r24, r10 30dd0: b4 01 movw r22, r8 30dd2: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30dd6: 2b 01 movw r4, r22 30dd8: 3c 01 movw r6, r24 30dda: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 30dde: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 30de2: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 30de6: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 30dea: c7 01 movw r24, r14 30dec: b6 01 movw r22, r12 30dee: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30df2: 9b 01 movw r18, r22 30df4: ac 01 movw r20, r24 30df6: c3 01 movw r24, r6 30df8: b2 01 movw r22, r4 30dfa: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 30dfe: 2b 01 movw r4, r22 30e00: 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; 30e02: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 30e06: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 30e0a: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 30e0e: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 30e12: c5 01 movw r24, r10 30e14: b4 01 movw r22, r8 30e16: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30e1a: 4b 01 movw r8, r22 30e1c: 5c 01 movw r10, r24 30e1e: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 30e22: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 30e26: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca 30e2a: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb 30e2e: c7 01 movw r24, r14 30e30: b6 01 movw r22, r12 30e32: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 30e36: 9b 01 movw r18, r22 30e38: ac 01 movw r20, r24 30e3a: c5 01 movw r24, r10 30e3c: b4 01 movw r22, r8 30e3e: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 30e42: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30e46: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30e4a: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30e4e: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y = out_y; 30e52: 40 92 f9 11 sts 0x11F9, r4 ; 0x8011f9 30e56: 50 92 fa 11 sts 0x11FA, r5 ; 0x8011fa 30e5a: 60 92 fb 11 sts 0x11FB, r6 ; 0x8011fb 30e5e: 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(); 30e62: 0e 94 b7 61 call 0xc36e ; 0xc36e #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 30e66: 80 e1 ldi r24, 0x10 ; 16 30e68: e5 ef ldi r30, 0xF5 ; 245 30e6a: f1 e1 ldi r31, 0x11 ; 17 30e6c: a4 e0 ldi r26, 0x04 ; 4 30e6e: b4 e0 ldi r27, 0x04 ; 4 30e70: 01 90 ld r0, Z+ 30e72: 0d 92 st X+, r0 30e74: 8a 95 dec r24 30e76: e1 f7 brne .-8 ; 0x30e70 #endif } 30e78: cf 91 pop r28 30e7a: ff 90 pop r15 30e7c: ef 90 pop r14 30e7e: df 90 pop r13 30e80: cf 90 pop r12 30e82: bf 90 pop r11 30e84: af 90 pop r10 30e86: 9f 90 pop r9 30e88: 8f 90 pop r8 30e8a: 7f 90 pop r7 30e8c: 6f 90 pop r6 30e8e: 5f 90 pop r5 30e90: 4f 90 pop r4 30e92: 08 95 ret 00030e94 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 30e94: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30e98: 8d 7f andi r24, 0xFD ; 253 30e9a: 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(); 30e9e: 0f 94 03 86 call 0x30c06 ; 0x30c06 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 30ea2: 81 e0 ldi r24, 0x01 ; 1 30ea4: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 30ea8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30eac: 8d 7f andi r24, 0xFD ; 253 30eae: 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); 30eb2: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30eb6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (blocks_queued()) plan_discard_current_block(); 30eba: 98 17 cp r25, r24 30ebc: 69 f0 breq .+26 ; 0x30ed8 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) { 30ebe: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30ec2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30ec6: 98 17 cp r25, r24 30ec8: a1 f3 breq .-24 ; 0x30eb2 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 30eca: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30ece: 8f 5f subi r24, 0xFF ; 255 30ed0: 8f 70 andi r24, 0x0F ; 15 30ed2: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 30ed6: ed cf rjmp .-38 ; 0x30eb2 current_block = NULL; 30ed8: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 30edc: 10 92 e4 11 sts 0x11E4, r1 ; 0x8011e4 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 30ee0: 8f ef ldi r24, 0xFF ; 255 30ee2: 9f ef ldi r25, 0xFF ; 255 30ee4: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 30ee8: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> current_adv_steps = 0; 30eec: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 30ef0: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> #endif st_reset_timer(); 30ef4: 0f 94 ac 22 call 0x24558 ; 0x24558 ENABLE_STEPPER_DRIVER_INTERRUPT(); 30ef8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30efc: 82 60 ori r24, 0x02 ; 2 30efe: 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; 30f02: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 30f06: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 30f0a: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 30f0e: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 30f12: e4 ef ldi r30, 0xF4 ; 244 30f14: f3 e0 ldi r31, 0x03 ; 3 30f16: 80 e1 ldi r24, 0x10 ; 16 30f18: df 01 movw r26, r30 30f1a: 1d 92 st X+, r1 30f1c: 8a 95 dec r24 30f1e: e9 f7 brne .-6 ; 0x30f1a // Reset position sync requests plan_reset_next_e_queue = false; 30f20: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = false; 30f24: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } 30f28: 08 95 ret 00030f2a : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 30f2a: 81 e0 ldi r24, 0x01 ; 1 30f2c: 0c 94 41 6a jmp 0xd482 ; 0xd482 00030f30 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 30f30: 0f 93 push r16 30f32: 1f 93 push r17 30f34: cf 93 push r28 30f36: 8c 01 movw r16, r24 30f38: c6 2f mov r28, r22 lcd_update_enable(false); 30f3a: 80 e0 ldi r24, 0x00 ; 0 30f3c: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 30f40: 0e 94 2f 6a call 0xd45e ; 0xd45e lcd_puts_at_P(0, 1, pgmS); 30f44: a8 01 movw r20, r16 30f46: 61 e0 ldi r22, 0x01 ; 1 30f48: 80 e0 ldi r24, 0x00 ; 0 30f4a: 0e 94 10 6a call 0xd420 ; 0xd420 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 30f4e: 80 e2 ldi r24, 0x20 ; 32 30f50: 0e 94 ab 6a call 0xd556 ; 0xd556 lcd_print(' '); lcd_print(slot + 1); 30f54: 6c 2f mov r22, r28 30f56: 70 e0 ldi r23, 0x00 ; 0 30f58: 6f 5f subi r22, 0xFF ; 255 30f5a: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 30f5c: 07 2e mov r0, r23 30f5e: 00 0c add r0, r0 30f60: 88 0b sbc r24, r24 30f62: 99 0b sbc r25, r25 } 30f64: cf 91 pop r28 30f66: 1f 91 pop r17 30f68: 0f 91 pop r16 30f6a: 0c 94 b5 6b jmp 0xd76a ; 0xd76a 00030f6e : 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); 30f6e: 82 ed ldi r24, 0xD2 ; 210 30f70: 9e e0 ldi r25, 0x0E ; 14 30f72: 0e 94 8d 6f call 0xdf1a ; 0xdf1a eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 30f76: 83 ed ldi r24, 0xD3 ; 211 30f78: 9e e0 ldi r25, 0x0E ; 14 30f7a: 0c 94 80 6f jmp 0xdf00 ; 0xdf00 00030f7e : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 30f7e: 41 e0 ldi r20, 0x01 ; 1 30f80: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 30f84: 81 11 cpse r24, r1 30f86: 01 c0 rjmp .+2 ; 0x30f8a 30f88: 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'); 30f8a: 40 5d subi r20, 0xD0 ; 208 30f8c: 62 e0 ldi r22, 0x02 ; 2 30f8e: 83 e0 ldi r24, 0x03 ; 3 30f90: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 30f94: 0e 94 f4 c3 call 0x187e8 ; 0x187e8 30f98: 40 e3 ldi r20, 0x30 ; 48 30f9a: 48 0f add r20, r24 30f9c: 62 e0 ldi r22, 0x02 ; 2 30f9e: 88 e0 ldi r24, 0x08 ; 8 30fa0: 0e 94 1c 6a call 0xd438 ; 0xd438 // print active/changing filament slot lcd_set_cursor(10, 2); 30fa4: 62 e0 ldi r22, 0x02 ; 2 30fa6: 8a e0 ldi r24, 0x0A ; 10 30fa8: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcdui_print_extruder(); 30fac: 0f 94 28 0d call 0x21a50 ; 0x21a50 // Print active extruder temperature lcd_set_cursor(16, 2); 30fb0: 62 e0 ldi r22, 0x02 ; 2 30fb2: 80 e1 ldi r24, 0x10 ; 16 30fb4: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 30fb8: 20 e0 ldi r18, 0x00 ; 0 30fba: 30 e0 ldi r19, 0x00 ; 0 30fbc: 40 e0 ldi r20, 0x00 ; 0 30fbe: 5f e3 ldi r21, 0x3F ; 63 30fc0: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 30fc4: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 30fc8: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 30fcc: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 30fd0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 30fd4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> 30fd8: 7f 93 push r23 30fda: 6f 93 push r22 30fdc: 80 ec ldi r24, 0xC0 ; 192 30fde: 9e e9 ldi r25, 0x9E ; 158 30fe0: 9f 93 push r25 30fe2: 8f 93 push r24 30fe4: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 30fe8: 0f 90 pop r0 30fea: 0f 90 pop r0 30fec: 0f 90 pop r0 30fee: 0f 90 pop r0 } 30ff0: 08 95 ret 00030ff2 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 30ff2: 8a 30 cpi r24, 0x0A ; 10 30ff4: 20 f0 brcs .+8 ; 0x30ffe 30ff6: 80 31 cpi r24, 0x10 ; 16 30ff8: 20 f4 brcc .+8 ; 0x31002 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 30ffa: 89 5a subi r24, 0xA9 ; 169 30ffc: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 30ffe: 80 5d subi r24, 0xD0 ; 208 31000: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 31002: 80 e0 ldi r24, 0x00 ; 0 } } 31004: 08 95 ret 00031006 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 31006: 0f 93 push r16 31008: 1f 93 push r17 3100a: cf 93 push r28 3100c: df 93 push r29 3100e: 08 2f mov r16, r24 31010: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 31012: 90 e0 ldi r25, 0x00 ; 0 31014: 24 e0 ldi r18, 0x04 ; 4 31016: 95 95 asr r25 31018: 87 95 ror r24 3101a: 2a 95 dec r18 3101c: e1 f7 brne .-8 ; 0x31016 uint8_t charsOut = 1; 3101e: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 31020: 00 97 sbiw r24, 0x00 ; 0 31022: 21 f0 breq .+8 ; 0x3102c *dst = Nibble2Char(v); 31024: 0f 94 f9 87 call 0x30ff2 ; 0x30ff2 31028: 89 93 st Y+, r24 ++dst; charsOut = 2; 3102a: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 3102c: 80 2f mov r24, r16 3102e: 8f 70 andi r24, 0x0F ; 15 31030: 0f 94 f9 87 call 0x30ff2 ; 0x30ff2 31034: 88 83 st Y, r24 return charsOut; } 31036: 81 2f mov r24, r17 31038: df 91 pop r29 3103a: cf 91 pop r28 3103c: 1f 91 pop r17 3103e: 0f 91 pop r16 31040: 08 95 ret 00031042 : } 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) { 31042: 80 33 cpi r24, 0x30 ; 48 31044: 30 f0 brcs .+12 ; 0x31052 31046: 8a 33 cpi r24, 0x3A ; 58 31048: 30 f0 brcs .+12 ; 0x31056 3104a: 9f e9 ldi r25, 0x9F ; 159 3104c: 98 0f add r25, r24 3104e: 96 30 cpi r25, 0x06 ; 6 31050: 20 f0 brcs .+8 ; 0x3105a case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 31052: 80 e0 ldi r24, 0x00 ; 0 } } 31054: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 31056: 80 53 subi r24, 0x30 ; 48 31058: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 3105a: 87 55 subi r24, 0x57 ; 87 3105c: 08 95 ret 0003105e : /// 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 { 3105e: cf 93 push r28 31060: df 93 push r29 31062: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 31064: 68 81 ld r22, Y 31066: 80 e0 ldi r24, 0x00 ; 0 31068: 0f 94 ee 6c call 0x2d9dc ; 0x2d9dc crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 3106c: 69 81 ldd r22, Y+1 ; 0x01 3106e: 0f 94 ee 6c call 0x2d9dc ; 0x2d9dc crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 31072: 6a 81 ldd r22, Y+2 ; 0x02 31074: 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]); 31076: 0f 94 ee 6c call 0x2d9dc ; 0x2d9dc 3107a: 6c 2f mov r22, r28 return crc; } 3107c: df 91 pop r29 3107e: cf 91 pop r28 31080: 0d 94 ee 6c jmp 0x2d9dc ; 0x2d9dc 00031084 : 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 { 31084: cf 93 push r28 31086: df 93 push r29 31088: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 3108a: 0f 94 2f 88 call 0x3105e ; 0x3105e crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 3108e: 6d 81 ldd r22, Y+5 ; 0x05 31090: 0f 94 ee 6c call 0x2d9dc ; 0x2d9dc crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 31094: 6e 81 ldd r22, Y+6 ; 0x06 31096: cf 81 ldd r28, Y+7 ; 0x07 31098: 0f 94 ee 6c call 0x2d9dc ; 0x2d9dc 3109c: 6c 2f mov r22, r28 return crc; } 3109e: df 91 pop r29 310a0: cf 91 pop r28 310a2: 0d 94 ee 6c jmp 0x2d9dc ; 0x2d9dc 000310a6 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 310a6: cf 93 push r28 310a8: df 93 push r29 310aa: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 310ac: 68 83 st Y, r22 310ae: 49 83 std Y+1, r20 ; 0x01 310b0: 1b 82 std Y+3, r1 ; 0x03 310b2: 1a 82 std Y+2, r1 ; 0x02 310b4: 0f 94 2f 88 call 0x3105e ; 0x3105e 310b8: 8c 83 std Y+4, r24 ; 0x04 } 310ba: df 91 pop r29 310bc: cf 91 pop r28 310be: 08 95 ret 000310c0 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 310c0: 14 9a sbi 0x02, 4 ; 2 } 310c2: 08 95 ret 000310c4 : 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) { 310c4: cf 92 push r12 310c6: df 92 push r13 310c8: ef 92 push r14 310ca: ff 92 push r15 310cc: cf 93 push r28 310ce: df 93 push r29 310d0: 69 01 movw r12, r18 310d2: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 310d4: c5 ef ldi r28, 0xF5 ; 245 310d6: d1 e1 ldi r29, 0x11 ; 17 310d8: 9b 01 movw r18, r22 310da: ac 01 movw r20, r24 310dc: 6c 85 ldd r22, Y+12 ; 0x0c 310de: 7d 85 ldd r23, Y+13 ; 0x0d 310e0: 8e 85 ldd r24, Y+14 ; 0x0e 310e2: 9f 85 ldd r25, Y+15 ; 0x0f 310e4: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 310e8: 6c 87 std Y+12, r22 ; 0x0c 310ea: 7d 87 std Y+13, r23 ; 0x0d 310ec: 8e 87 std Y+14, r24 ; 0x0e 310ee: 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); 310f0: c7 01 movw r24, r14 310f2: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 310f4: df 91 pop r29 310f6: cf 91 pop r28 310f8: ff 90 pop r15 310fa: ef 90 pop r14 310fc: df 90 pop r13 310fe: 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); 31100: 0d 94 d0 85 jmp 0x30ba0 ; 0x30ba0 00031104 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 31104: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 31108: 0d 94 a0 22 jmp 0x24540 ; 0x24540 0003110c : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 3110c: cf 93 push r28 3110e: df 93 push r29 31110: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 31112: 87 e7 ldi r24, 0x77 ; 119 31114: 9e e9 ldi r25, 0x9E ; 158 31116: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_MMU2(); 3111a: 8a eb ldi r24, 0xBA ; 186 3111c: 9e e9 ldi r25, 0x9E ; 158 3111e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHOLNRPGM(msg); 31122: ce 01 movw r24, r28 } 31124: df 91 pop r29 31126: 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); 31128: 0c 94 d4 72 jmp 0xe5a8 ; 0xe5a8 0003112c : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 3112c: 0c 94 f4 c3 jmp 0x187e8 ; 0x187e8 00031130 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31130: 89 32 cpi r24, 0x29 ; 41 31132: 20 e8 ldi r18, 0x80 ; 128 31134: 92 07 cpc r25, r18 31136: 09 f4 brne .+2 ; 0x3113a 31138: 97 c0 rjmp .+302 ; 0x31268 3113a: 08 f0 brcs .+2 ; 0x3113e 3113c: 48 c0 rjmp .+144 ; 0x311ce 3113e: 86 30 cpi r24, 0x06 ; 6 31140: 60 e8 ldi r22, 0x80 ; 128 31142: 96 07 cpc r25, r22 31144: 09 f4 brne .+2 ; 0x31148 31146: 9a c0 rjmp .+308 ; 0x3127c 31148: 30 f5 brcc .+76 ; 0x31196 3114a: 83 30 cpi r24, 0x03 ; 3 3114c: 40 e8 ldi r20, 0x80 ; 128 3114e: 94 07 cpc r25, r20 31150: 09 f4 brne .+2 ; 0x31154 31152: 80 c0 rjmp .+256 ; 0x31254 31154: a8 f4 brcc .+42 ; 0x31180 31156: 81 30 cpi r24, 0x01 ; 1 31158: 20 e8 ldi r18, 0x80 ; 128 3115a: 92 07 cpc r25, r18 3115c: 09 f4 brne .+2 ; 0x31160 3115e: 17 c1 rjmp .+558 ; 0x3138e 31160: 82 30 cpi r24, 0x02 ; 2 31162: 40 e8 ldi r20, 0x80 ; 128 31164: 94 07 cpc r25, r20 31166: 09 f4 brne .+2 ; 0x3116a 31168: 73 c0 rjmp .+230 ; 0x31250 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); 3116a: 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)) { 3116c: 86 ff sbrs r24, 6 3116e: 8e c0 rjmp .+284 ; 0x3128c 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); 31170: 22 27 eor r18, r18 31172: 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) { 31174: 21 15 cp r18, r1 31176: 32 4c sbci r19, 0xC2 ; 194 31178: 09 f0 breq .+2 ; 0x3117c 3117a: 9e c0 rjmp .+316 ; 0x312b8 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 3117c: 8e e1 ldi r24, 0x1E ; 30 3117e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31180: 84 30 cpi r24, 0x04 ; 4 31182: 60 e8 ldi r22, 0x80 ; 128 31184: 96 07 cpc r25, r22 31186: 09 f4 brne .+2 ; 0x3118a 31188: 67 c0 rjmp .+206 ; 0x31258 3118a: 85 30 cpi r24, 0x05 ; 5 3118c: 20 e8 ldi r18, 0x80 ; 128 3118e: 92 07 cpc r25, r18 31190: 61 f7 brne .-40 ; 0x3116a 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); 31192: 84 e2 ldi r24, 0x24 ; 36 31194: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31196: 8a 30 cpi r24, 0x0A ; 10 31198: 40 e8 ldi r20, 0x80 ; 128 3119a: 94 07 cpc r25, r20 3119c: 09 f4 brne .+2 ; 0x311a0 3119e: 5e c0 rjmp .+188 ; 0x3125c 311a0: 58 f4 brcc .+22 ; 0x311b8 311a2: 88 30 cpi r24, 0x08 ; 8 311a4: 20 e8 ldi r18, 0x80 ; 128 311a6: 92 07 cpc r25, r18 311a8: 09 f4 brne .+2 ; 0x311ac 311aa: 6e c0 rjmp .+220 ; 0x31288 311ac: 89 30 cpi r24, 0x09 ; 9 311ae: 40 e8 ldi r20, 0x80 ; 128 311b0: 94 07 cpc r25, r20 311b2: d9 f6 brne .-74 ; 0x3116a 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); 311b4: 85 e0 ldi r24, 0x05 ; 5 311b6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 311b8: 8c 30 cpi r24, 0x0C ; 12 311ba: 60 e8 ldi r22, 0x80 ; 128 311bc: 96 07 cpc r25, r22 311be: 09 f4 brne .+2 ; 0x311c2 311c0: 51 c0 rjmp .+162 ; 0x31264 311c2: 8d 30 cpi r24, 0x0D ; 13 311c4: 20 e8 ldi r18, 0x80 ; 128 311c6: 92 07 cpc r25, r18 311c8: 81 f6 brne .-96 ; 0x3116a 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); 311ca: 81 e2 ldi r24, 0x21 ; 33 311cc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 311ce: 8f 32 cpi r24, 0x2F ; 47 311d0: 40 e8 ldi r20, 0x80 ; 128 311d2: 94 07 cpc r25, r20 311d4: 09 f4 brne .+2 ; 0x311d8 311d6: 56 c0 rjmp .+172 ; 0x31284 311d8: e0 f4 brcc .+56 ; 0x31212 311da: 8c 32 cpi r24, 0x2C ; 44 311dc: 20 e8 ldi r18, 0x80 ; 128 311de: 92 07 cpc r25, r18 311e0: 09 f4 brne .+2 ; 0x311e4 311e2: 4e c0 rjmp .+156 ; 0x31280 311e4: 58 f4 brcc .+22 ; 0x311fc 311e6: 8a 32 cpi r24, 0x2A ; 42 311e8: 60 e8 ldi r22, 0x80 ; 128 311ea: 96 07 cpc r25, r22 311ec: c9 f1 breq .+114 ; 0x31260 311ee: 8b 32 cpi r24, 0x2B ; 43 311f0: 20 e8 ldi r18, 0x80 ; 128 311f2: 92 07 cpc r25, r18 311f4: 09 f0 breq .+2 ; 0x311f8 311f6: b9 cf rjmp .-142 ; 0x3116a 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); 311f8: 86 e2 ldi r24, 0x26 ; 38 311fa: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 311fc: 8d 32 cpi r24, 0x2D ; 45 311fe: 40 e8 ldi r20, 0x80 ; 128 31200: 94 07 cpc r25, r20 31202: d1 f1 breq .+116 ; 0x31278 31204: 8e 32 cpi r24, 0x2E ; 46 31206: 60 e8 ldi r22, 0x80 ; 128 31208: 96 07 cpc r25, r22 3120a: 09 f0 breq .+2 ; 0x3120e 3120c: ae cf rjmp .-164 ; 0x3116a 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); 3120e: 82 e2 ldi r24, 0x22 ; 34 31210: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31212: 87 38 cpi r24, 0x87 ; 135 31214: 20 e8 ldi r18, 0x80 ; 128 31216: 92 07 cpc r25, r18 31218: 49 f1 breq .+82 ; 0x3126c 3121a: 58 f4 brcc .+22 ; 0x31232 3121c: 87 34 cpi r24, 0x47 ; 71 3121e: 60 e8 ldi r22, 0x80 ; 128 31220: 96 07 cpc r25, r22 31222: 29 f0 breq .+10 ; 0x3122e 31224: 8b 34 cpi r24, 0x4B ; 75 31226: 20 e8 ldi r18, 0x80 ; 128 31228: 92 07 cpc r25, r18 3122a: 09 f0 breq .+2 ; 0x3122e 3122c: 9e cf rjmp .-196 ; 0x3116a 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); 3122e: 84 e0 ldi r24, 0x04 ; 4 31230: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31232: 87 30 cpi r24, 0x07 ; 7 31234: 41 e8 ldi r20, 0x81 ; 129 31236: 94 07 cpc r25, r20 31238: d9 f0 breq .+54 ; 0x31270 3123a: 8b 30 cpi r24, 0x0B ; 11 3123c: 61 e8 ldi r22, 0x81 ; 129 3123e: 96 07 cpc r25, r22 31240: c9 f0 breq .+50 ; 0x31274 31242: 8b 38 cpi r24, 0x8B ; 139 31244: 20 e8 ldi r18, 0x80 ; 128 31246: 92 07 cpc r25, r18 31248: 09 f0 breq .+2 ; 0x3124c 3124a: 8f cf rjmp .-226 ; 0x3116a 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); 3124c: 89 e0 ldi r24, 0x09 ; 9 3124e: 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); 31250: 81 e0 ldi r24, 0x01 ; 1 31252: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 31254: 82 e0 ldi r24, 0x02 ; 2 31256: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 31258: 83 e0 ldi r24, 0x03 ; 3 3125a: 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); 3125c: 86 e0 ldi r24, 0x06 ; 6 3125e: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 31260: 87 e0 ldi r24, 0x07 ; 7 31262: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 31264: 8a e2 ldi r24, 0x2A ; 42 31266: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 31268: 8b e2 ldi r24, 0x2B ; 43 3126a: 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); 3126c: 88 e0 ldi r24, 0x08 ; 8 3126e: 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); 31270: 8a e0 ldi r24, 0x0A ; 10 31272: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 31274: 8b e0 ldi r24, 0x0B ; 11 31276: 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); 31278: 83 e2 ldi r24, 0x23 ; 35 3127a: 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); 3127c: 85 e2 ldi r24, 0x25 ; 37 3127e: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 31280: 87 e2 ldi r24, 0x27 ; 39 31282: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 31284: 88 e2 ldi r24, 0x28 ; 40 31286: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 31288: 89 e2 ldi r24, 0x29 ; 41 3128a: 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)) { 3128c: 87 ff sbrs r24, 7 3128e: 07 c0 rjmp .+14 ; 0x3129e 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); 31290: 22 27 eor r18, r18 31292: 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) { 31294: 21 15 cp r18, r1 31296: 32 4c sbci r19, 0xC2 ; 194 31298: a1 f5 brne .+104 ; 0x31302 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 3129a: 8f e1 ldi r24, 0x1F ; 31 3129c: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3129e: 22 27 eor r18, r18 312a0: 31 70 andi r19, 0x01 ; 1 312a2: 90 ff sbrs r25, 0 312a4: 52 c0 rjmp .+164 ; 0x3134a 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); 312a6: ac 01 movw r20, r24 312a8: 44 27 eor r20, r20 312aa: 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) { 312ac: 41 15 cp r20, r1 312ae: 52 4c sbci r21, 0xC2 ; 194 312b0: 09 f0 breq .+2 ; 0x312b4 312b2: 4b c0 rjmp .+150 ; 0x3134a return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 312b4: 80 e2 ldi r24, 0x20 ; 32 312b6: 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; 312b8: 9c 01 movw r18, r24 312ba: 22 27 eor r18, r18 312bc: 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)) { 312be: 23 2b or r18, r19 312c0: 09 f0 breq .+2 ; 0x312c4 312c2: 67 c0 rjmp .+206 ; 0x31392 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; 312c4: 9c 01 movw r18, r24 312c6: 22 27 eor r18, r18 312c8: 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)) { 312ca: 23 2b or r18, r19 312cc: 09 f0 breq .+2 ; 0x312d0 312ce: 63 c0 rjmp .+198 ; 0x31396 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; 312d0: 9c 01 movw r18, r24 312d2: 22 27 eor r18, r18 312d4: 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)) { 312d6: 23 2b or r18, r19 312d8: 09 f0 breq .+2 ; 0x312dc 312da: 5f c0 rjmp .+190 ; 0x3139a 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; 312dc: 9c 01 movw r18, r24 312de: 22 27 eor r18, r18 312e0: 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)) { 312e2: 23 2b or r18, r19 312e4: 09 f0 breq .+2 ; 0x312e8 312e6: 5b c0 rjmp .+182 ; 0x3139e 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; 312e8: 9c 01 movw r18, r24 312ea: 22 27 eor r18, r18 312ec: 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)) { 312ee: 23 2b or r18, r19 312f0: 09 f0 breq .+2 ; 0x312f4 312f2: 57 c0 rjmp .+174 ; 0x313a2 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; 312f4: 88 27 eor r24, r24 312f6: 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)) { 312f8: 89 2b or r24, r25 312fa: 09 f4 brne .+2 ; 0x312fe 312fc: 68 c0 rjmp .+208 ; 0x313ce return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 312fe: 8f e0 ldi r24, 0x0F ; 15 31300: 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; 31302: 9c 01 movw r18, r24 31304: 22 27 eor r18, r18 31306: 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)) { 31308: 23 2b or r18, r19 3130a: 09 f0 breq .+2 ; 0x3130e 3130c: 4c c0 rjmp .+152 ; 0x313a6 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; 3130e: 9c 01 movw r18, r24 31310: 22 27 eor r18, r18 31312: 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)) { 31314: 23 2b or r18, r19 31316: 09 f0 breq .+2 ; 0x3131a 31318: 48 c0 rjmp .+144 ; 0x313aa 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; 3131a: 9c 01 movw r18, r24 3131c: 22 27 eor r18, r18 3131e: 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)) { 31320: 23 2b or r18, r19 31322: 09 f0 breq .+2 ; 0x31326 31324: 44 c0 rjmp .+136 ; 0x313ae 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; 31326: 9c 01 movw r18, r24 31328: 22 27 eor r18, r18 3132a: 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)) { 3132c: 23 2b or r18, r19 3132e: 09 f0 breq .+2 ; 0x31332 31330: 40 c0 rjmp .+128 ; 0x313b2 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; 31332: 9c 01 movw r18, r24 31334: 22 27 eor r18, r18 31336: 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)) { 31338: 23 2b or r18, r19 3133a: e9 f5 brne .+122 ; 0x313b6 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; 3133c: 88 27 eor r24, r24 3133e: 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)) { 31340: 89 2b or r24, r25 31342: 09 f4 brne .+2 ; 0x31346 31344: 44 c0 rjmp .+136 ; 0x313ce return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 31346: 80 e1 ldi r24, 0x10 ; 16 31348: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3134a: 23 2b or r18, r19 3134c: 09 f4 brne .+2 ; 0x31350 3134e: 3f c0 rjmp .+126 ; 0x313ce 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; 31350: 9c 01 movw r18, r24 31352: 22 27 eor r18, r18 31354: 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)) { 31356: 23 2b or r18, r19 31358: 81 f5 brne .+96 ; 0x313ba 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; 3135a: 9c 01 movw r18, r24 3135c: 22 27 eor r18, r18 3135e: 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)) { 31360: 23 2b or r18, r19 31362: 69 f5 brne .+90 ; 0x313be 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; 31364: 9c 01 movw r18, r24 31366: 22 27 eor r18, r18 31368: 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)) { 3136a: 23 2b or r18, r19 3136c: 51 f5 brne .+84 ; 0x313c2 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; 3136e: 9c 01 movw r18, r24 31370: 22 27 eor r18, r18 31372: 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)) { 31374: 23 2b or r18, r19 31376: 39 f5 brne .+78 ; 0x313c6 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; 31378: 9c 01 movw r18, r24 3137a: 22 27 eor r18, r18 3137c: 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)) { 3137e: 23 2b or r18, r19 31380: 21 f5 brne .+72 ; 0x313ca 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; 31382: 88 27 eor r24, r24 31384: 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)) { 31386: 89 2b or r24, r25 31388: 11 f1 breq .+68 ; 0x313ce return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 3138a: 81 e1 ldi r24, 0x11 ; 17 3138c: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 3138e: 80 e0 ldi r24, 0x00 ; 0 31390: 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); 31392: 82 e1 ldi r24, 0x12 ; 18 31394: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 31396: 85 e1 ldi r24, 0x15 ; 21 31398: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 3139a: 88 e1 ldi r24, 0x18 ; 24 3139c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 3139e: 8b e1 ldi r24, 0x1B ; 27 313a0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 313a2: 8c e0 ldi r24, 0x0C ; 12 313a4: 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); 313a6: 83 e1 ldi r24, 0x13 ; 19 313a8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 313aa: 86 e1 ldi r24, 0x16 ; 22 313ac: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 313ae: 89 e1 ldi r24, 0x19 ; 25 313b0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 313b2: 8c e1 ldi r24, 0x1C ; 28 313b4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 313b6: 8d e0 ldi r24, 0x0D ; 13 313b8: 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); 313ba: 84 e1 ldi r24, 0x14 ; 20 313bc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 313be: 87 e1 ldi r24, 0x17 ; 23 313c0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 313c2: 8a e1 ldi r24, 0x1A ; 26 313c4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 313c6: 8d e1 ldi r24, 0x1D ; 29 313c8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 313ca: 8e e0 ldi r24, 0x0E ; 14 313cc: 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); 313ce: 8c e2 ldi r24, 0x2C ; 44 } 313d0: 08 95 ret 000313d2 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 313d2: cf 92 push r12 313d4: df 92 push r13 313d6: ef 92 push r14 313d8: ff 92 push r15 313da: 0f 93 push r16 313dc: 1f 93 push r17 313de: cf 93 push r28 313e0: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 313e2: 20 91 65 12 lds r18, 0x1265 ; 0x801265 313e6: 30 91 66 12 lds r19, 0x1266 ; 0x801266 313ea: 21 30 cpi r18, 0x01 ; 1 313ec: 31 05 cpc r19, r1 313ee: 39 f4 brne .+14 ; 0x313fe 313f0: 20 91 8e 12 lds r18, 0x128E ; 0x80128e 313f4: 21 30 cpi r18, 0x01 ; 1 313f6: 19 f4 brne .+6 ; 0x313fe // 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; 313f8: 22 e0 ldi r18, 0x02 ; 2 313fa: 20 93 c3 16 sts 0x16C3, r18 ; 0x8016c3 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 313fe: 0f 94 98 88 call 0x31130 ; 0x31130 31402: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 31404: 80 91 c3 16 lds r24, 0x16C3 ; 0x8016c3 31408: 81 30 cpi r24, 0x01 ; 1 3140a: 09 f4 brne .+2 ; 0x3140e 3140c: 64 c0 rjmp .+200 ; 0x314d6 3140e: 60 f0 brcs .+24 ; 0x31428 31410: 82 30 cpi r24, 0x02 ; 2 31412: 09 f4 brne .+2 ; 0x31416 31414: f4 c0 rjmp .+488 ; 0x315fe ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 31416: df 91 pop r29 31418: cf 91 pop r28 3141a: 1f 91 pop r17 3141c: 0f 91 pop r16 3141e: ff 90 pop r15 31420: ef 90 pop r14 31422: df 90 pop r13 31424: cf 90 pop r12 31426: 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); 31428: 84 e0 ldi r24, 0x04 ; 4 3142a: 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); 3142e: 0d 2f mov r16, r29 31430: 10 e0 ldi r17, 0x00 ; 0 31432: f8 01 movw r30, r16 31434: ec 5d subi r30, 0xDC ; 220 31436: f0 46 sbci r31, 0x60 ; 96 31438: 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); 3143a: fc 2e mov r15, r28 3143c: f2 94 swap r15 3143e: 6f e0 ldi r22, 0x0F ; 15 31440: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 31442: 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); 31444: 80 e0 ldi r24, 0x00 ; 0 31446: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_clear(); 3144a: 0e 94 2f 6a call 0xd45e ; 0xd45e // 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); 3144e: 00 0f add r16, r16 31450: 11 1f adc r17, r17 31452: f8 01 movw r30, r16 31454: ef 5a subi r30, 0xAF ; 175 31456: f0 46 sbci r31, 0x60 ; 96 31458: c5 90 lpm r12, Z+ 3145a: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 3145c: 03 5f subi r16, 0xF3 ; 243 3145e: 13 46 sbci r17, 0x63 ; 99 31460: f8 01 movw r30, r16 31462: 85 91 lpm r24, Z+ 31464: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 31466: 0e 94 32 6d call 0xda64 ; 0xda64 3146a: df 92 push r13 3146c: cf 92 push r12 3146e: 9f 93 push r25 31470: 8f 93 push r24 31472: 8d eb ldi r24, 0xBD ; 189 31474: 9f e9 ldi r25, 0x9F ; 159 31476: 9f 93 push r25 31478: 8f 93 push r24 3147a: 0e 94 d5 69 call 0xd3aa ; 0xd3aa 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)); 3147e: 48 e9 ldi r20, 0x98 ; 152 31480: 5c e9 ldi r21, 0x9C ; 156 31482: 62 e0 ldi r22, 0x02 ; 2 31484: 80 e0 ldi r24, 0x00 ; 0 31486: 0e 94 10 6a call 0xd420 ; 0xd420 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()); 3148a: 0f 90 pop r0 3148c: 0f 90 pop r0 3148e: 0f 90 pop r0 31490: 0f 90 pop r0 31492: 0f 90 pop r0 31494: 0f 90 pop r0 31496: f1 10 cpse r15, r1 31498: c6 c0 rjmp .+396 ; 0x31626 3149a: 10 e0 ldi r17, 0x00 ; 0 3149c: 00 e0 ldi r16, 0x00 ; 0 3149e: 42 e1 ldi r20, 0x12 ; 18 314a0: e4 2e mov r14, r20 314a2: 51 ee ldi r21, 0xE1 ; 225 314a4: c5 2e mov r12, r21 314a6: 5c e6 ldi r21, 0x6C ; 108 314a8: 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); 314aa: ec 2f mov r30, r28 314ac: f0 e0 ldi r31, 0x00 ; 0 314ae: ee 0f add r30, r30 314b0: ff 1f adc r31, r31 314b2: e7 55 subi r30, 0x57 ; 87 314b4: f0 46 sbci r31, 0x60 ; 96 314b6: 85 91 lpm r24, Z+ 314b8: 94 91 lpm r25, Z 314ba: 0e 94 32 6d call 0xda64 ; 0xda64 314be: bc 01 movw r22, r24 314c0: 81 e0 ldi r24, 0x01 ; 1 314c2: f1 10 cpse r15, r1 314c4: 01 c0 rjmp .+2 ; 0x314c8 314c6: 80 e0 ldi r24, 0x00 ; 0 314c8: 2e 2d mov r18, r14 314ca: a6 01 movw r20, r12 314cc: 0f 94 a3 0a call 0x21546 ; 0x21546 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 314d0: 81 e0 ldi r24, 0x01 ; 1 314d2: 80 93 c3 16 sts 0x16C3, r24 ; 0x8016c3 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 314d6: 81 e0 ldi r24, 0x01 ; 1 314d8: 80 93 c6 06 sts 0x06C6, r24 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> ReportErrorHookDynamicRender(); // Render dynamic characters 314dc: 0f 94 bf 87 call 0x30f7e ; 0x30f7e sound_wait_for_user(); 314e0: 0f 94 1f 36 call 0x26c3e ; 0x26c3e 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); 314e4: 0d 2f mov r16, r29 314e6: 10 e0 ldi r17, 0x00 ; 0 314e8: f8 01 movw r30, r16 314ea: ec 5d subi r30, 0xDC ; 220 314ec: f0 46 sbci r31, 0x60 ; 96 314ee: 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); 314f0: dc 2f mov r29, r28 314f2: d2 95 swap r29 314f4: 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; 314f6: 80 91 bb 16 lds r24, 0x16BB ; 0x8016bb 314fa: 81 11 cpse r24, r1 314fc: 09 c0 rjmp .+18 ; 0x31510 314fe: 81 e0 ldi r24, 0x01 ; 1 31500: d1 11 cpse r29, r1 31502: 01 c0 rjmp .+2 ; 0x31506 31504: 80 e0 ldi r24, 0x00 ; 0 31506: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3150a: 81 e0 ldi r24, 0x01 ; 1 3150c: 80 93 bb 16 sts 0x16BB, r24 ; 0x8016bb static int8_t choice_selected = -1; if (reset_button_selection) { 31510: 80 91 b9 16 lds r24, 0x16B9 ; 0x8016b9 31514: 88 23 and r24, r24 31516: 41 f0 breq .+16 ; 0x31528 // 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; 31518: 81 e0 ldi r24, 0x01 ; 1 3151a: d1 11 cpse r29, r1 3151c: 01 c0 rjmp .+2 ; 0x31520 3151e: 80 e0 ldi r24, 0x00 ; 0 31520: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba choice_selected = -1; reset_button_selection = 0; 31524: 10 92 b9 16 sts 0x16B9, r1 ; 0x8016b9 } // Check if knob was rotated if (lcd_encoder) { 31528: 20 91 06 05 lds r18, 0x0506 ; 0x800506 3152c: 30 91 07 05 lds r19, 0x0507 ; 0x800507 31530: 21 15 cp r18, r1 31532: 31 05 cpc r19, r1 31534: b9 f1 breq .+110 ; 0x315a4 31536: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) { // third_choice is not nullptr, safe to dereference 3153a: dd 23 and r29, r29 3153c: 61 f0 breq .+24 ; 0x31556 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 3153e: 37 ff sbrs r19, 7 31540: 06 c0 rjmp .+12 ; 0x3154e 31542: 88 23 and r24, r24 31544: 69 f0 breq .+26 ; 0x31560 // Rotating knob counter clockwise current_selection--; 31546: 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; 31548: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3154c: 09 c0 rjmp .+18 ; 0x31560 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) { 3154e: 82 30 cpi r24, 0x02 ; 2 31550: 39 f0 breq .+14 ; 0x31560 // Rotating knob clockwise current_selection++; 31552: 8f 5f subi r24, 0xFF ; 255 31554: f9 cf rjmp .-14 ; 0x31548 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 31556: 37 ff sbrs r19, 7 31558: 41 c0 rjmp .+130 ; 0x315dc 3155a: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 3155c: 10 92 ba 16 sts 0x16BA, r1 ; 0x8016ba //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 31560: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 31564: 4e e3 ldi r20, 0x3E ; 62 31566: 81 11 cpse r24, r1 31568: 40 e2 ldi r20, 0x20 ; 32 3156a: 63 e0 ldi r22, 0x03 ; 3 3156c: 80 e0 ldi r24, 0x00 ; 0 3156e: 0e 94 1c 6a call 0xd438 ; 0xd438 31572: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) 31576: dd 23 and r29, r29 31578: b1 f1 breq .+108 ; 0x315e6 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 3157a: 4e e3 ldi r20, 0x3E ; 62 3157c: 81 30 cpi r24, 0x01 ; 1 3157e: 09 f0 breq .+2 ; 0x31582 31580: 40 e2 ldi r20, 0x20 ; 32 31582: 63 e0 ldi r22, 0x03 ; 3 31584: 89 e0 ldi r24, 0x09 ; 9 31586: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 3158a: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 3158e: 82 30 cpi r24, 0x02 ; 2 31590: 61 f5 brne .+88 ; 0x315ea } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 31592: 4e e3 ldi r20, 0x3E ; 62 31594: 63 e0 ldi r22, 0x03 ; 3 31596: 82 e1 ldi r24, 0x12 ; 18 31598: 0e 94 1c 6a call 0xd438 ; 0xd438 } // Consume rotation event lcd_encoder = 0; 3159c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 315a0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 315a4: 0e 94 19 6c call 0xd832 ; 0xd832 315a8: 88 23 and r24, r24 315aa: 09 f4 brne .+2 ; 0x315ae 315ac: 34 cf rjmp .-408 ; 0x31416 choice_selected = current_selection; 315ae: 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 315b2: d1 11 cpse r29, r1 315b4: 1c c0 rjmp .+56 ; 0x315ee 315b6: 81 30 cpi r24, 0x01 ; 1 315b8: 89 f5 brne .+98 ; 0x3161c 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); 315ba: f8 01 movw r30, r16 315bc: ee 0f add r30, r30 315be: ff 1f adc r31, r31 315c0: e6 53 subi r30, 0x36 ; 54 315c2: f1 46 sbci r31, 0x61 ; 97 315c4: 85 91 lpm r24, Z+ 315c6: 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))); 315c8: 0e 94 32 6d call 0xda64 ; 0xda64 315cc: 0f 94 7b 0b call 0x216f6 ; 0x216f6 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 315d0: 81 e0 ldi r24, 0x01 ; 1 315d2: 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; 315d6: 10 92 c3 16 sts 0x16C3, r1 ; 0x8016c3 315da: 1d cf rjmp .-454 ; 0x31416 } } 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) { 315dc: 81 30 cpi r24, 0x01 ; 1 315de: 09 f4 brne .+2 ; 0x315e2 315e0: bf cf rjmp .-130 ; 0x31560 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 315e2: 81 e0 ldi r24, 0x01 ; 1 315e4: b1 cf rjmp .-158 ; 0x31548 { 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 ? '>': ' '); 315e6: 81 30 cpi r24, 0x01 ; 1 315e8: a1 f2 breq .-88 ; 0x31592 315ea: 40 e2 ldi r20, 0x20 ; 32 315ec: d3 cf rjmp .-90 ; 0x31594 // 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 315ee: 82 30 cpi r24, 0x02 ; 2 315f0: 21 f3 breq .-56 ; 0x315ba { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 315f2: 81 30 cpi r24, 0x01 ; 1 315f4: 99 f4 brne .+38 ; 0x3161c return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 315f6: d0 93 ae 0d sts 0x0DAE, r29 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 315fa: 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); 315fe: 81 e0 ldi r24, 0x01 ; 1 31600: 0e 94 41 6a call 0xd482 ; 0xd482 lcd_return_to_status(); 31604: 0e 94 3f fe call 0x1fc7e ; 0x1fc7e 31608: 10 92 2b 05 sts 0x052B, r1 ; 0x80052b <_ZL10beep_timer.lto_priv.454> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 3160c: 10 92 2e 05 sts 0x052E, r1 ; 0x80052e <_ZL6bFirst.lto_priv.455> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 31610: 10 92 c6 06 sts 0x06C6, r1 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> KEEPALIVE_STATE(IN_HANDLER); 31614: 82 e0 ldi r24, 0x02 ; 2 31616: 80 93 78 02 sts 0x0278, r24 ; 0x800278 3161a: dd cf rjmp .-70 ; 0x315d6 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); 3161c: cf 70 andi r28, 0x0F ; 15 3161e: c0 93 ae 0d sts 0x0DAE, r28 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 31622: 81 e0 ldi r24, 0x01 ; 1 31624: ea cf rjmp .-44 ; 0x315fa 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); 31626: ef 2d mov r30, r15 31628: f0 e0 ldi r31, 0x00 ; 0 3162a: ee 0f add r30, r30 3162c: ff 1f adc r31, r31 3162e: e7 55 subi r30, 0x57 ; 87 31630: f0 46 sbci r31, 0x60 ; 96 31632: 85 91 lpm r24, Z+ 31634: 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()); 31636: 0e 94 32 6d call 0xda64 ; 0xda64 3163a: 6c 01 movw r12, r24 3163c: 01 ee ldi r16, 0xE1 ; 225 3163e: 1c e6 ldi r17, 0x6C ; 108 31640: 99 e0 ldi r25, 0x09 ; 9 31642: e9 2e mov r14, r25 31644: 32 cf rjmp .-412 ; 0x314aa 00031646 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 31646: 0f 94 98 88 call 0x31130 ; 0x31130 // 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); 3164a: e8 2f mov r30, r24 3164c: f0 e0 ldi r31, 0x00 ; 0 3164e: ee 0f add r30, r30 31650: ff 1f adc r31, r31 31652: ef 5a subi r30, 0xAF ; 175 31654: f0 46 sbci r31, 0x60 ; 96 31656: 25 91 lpm r18, Z+ 31658: 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) ) { 3165a: 23 33 cpi r18, 0x33 ; 51 3165c: 81 e0 ldi r24, 0x01 ; 1 3165e: 38 07 cpc r19, r24 31660: 08 f0 brcs .+2 ; 0x31664 31662: 41 c0 rjmp .+130 ; 0x316e6 31664: 2d 32 cpi r18, 0x2D ; 45 31666: 81 e0 ldi r24, 0x01 ; 1 31668: 38 07 cpc r19, r24 3166a: 78 f5 brcc .+94 ; 0x316ca 3166c: 2e 37 cpi r18, 0x7E ; 126 3166e: 31 05 cpc r19, r1 31670: 09 f4 brne .+2 ; 0x31674 31672: 83 c0 rjmp .+262 ; 0x3177a 31674: f0 f4 brcc .+60 ; 0x316b2 31676: 2c 36 cpi r18, 0x6C ; 108 31678: 31 05 cpc r19, r1 3167a: 09 f4 brne .+2 ; 0x3167e 3167c: 85 c0 rjmp .+266 ; 0x31788 3167e: 30 f4 brcc .+12 ; 0x3168c 31680: 25 36 cpi r18, 0x65 ; 101 31682: 31 05 cpc r19, r1 31684: 08 f0 brcs .+2 ; 0x31688 31686: 79 c0 rjmp .+242 ; 0x3177a default: break; } return Buttons::NoButton; 31688: 8f ef ldi r24, 0xFF ; 255 3168a: 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) ) { 3168c: 24 37 cpi r18, 0x74 ; 116 3168e: 31 05 cpc r19, r1 31690: 09 f4 brne .+2 ; 0x31694 31692: 73 c0 rjmp .+230 ; 0x3177a 31694: 2d 37 cpi r18, 0x7D ; 125 31696: 31 05 cpc r19, r1 31698: 19 f0 breq .+6 ; 0x316a0 3169a: 23 37 cpi r18, 0x73 ; 115 3169c: 31 05 cpc r19, r1 3169e: a1 f7 brne .-24 ; 0x31688 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 316a0: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 316a4: 81 30 cpi r24, 0x01 ; 1 316a6: 09 f4 brne .+2 ; 0x316aa 316a8: 6d c0 rjmp .+218 ; 0x31784 316aa: 87 30 cpi r24, 0x07 ; 7 316ac: 69 f7 brne .-38 ; 0x31688 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 316ae: 88 e0 ldi r24, 0x08 ; 8 316b0: 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) ) { 316b2: 23 3d cpi r18, 0xD3 ; 211 316b4: 31 05 cpc r19, r1 316b6: 09 f4 brne .+2 ; 0x316ba 316b8: 6e c0 rjmp .+220 ; 0x31796 316ba: 50 f4 brcc .+20 ; 0x316d0 316bc: 29 3c cpi r18, 0xC9 ; 201 316be: 31 05 cpc r19, r1 316c0: 09 f4 brne .+2 ; 0x316c4 316c2: 69 c0 rjmp .+210 ; 0x31796 316c4: 2a 3c cpi r18, 0xCA ; 202 316c6: 31 05 cpc r19, r1 316c8: f9 f6 brne .-66 ; 0x31688 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) { 316ca: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 316ce: 67 c0 rjmp .+206 ; 0x3179e // 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) ) { 316d0: 2d 3d cpi r18, 0xDD ; 221 316d2: 31 05 cpc r19, r1 316d4: 09 f4 brne .+2 ; 0x316d8 316d6: 5f c0 rjmp .+190 ; 0x31796 316d8: 2e 3d cpi r18, 0xDE ; 222 316da: 31 05 cpc r19, r1 316dc: b1 f3 breq .-20 ; 0x316ca 316de: 24 3d cpi r18, 0xD4 ; 212 316e0: 31 05 cpc r19, r1 316e2: 91 f6 brne .-92 ; 0x31688 316e4: f2 cf rjmp .-28 ; 0x316ca 316e6: 25 3f cpi r18, 0xF5 ; 245 316e8: 81 e0 ldi r24, 0x01 ; 1 316ea: 38 07 cpc r19, r24 316ec: 09 f4 brne .+2 ; 0x316f0 316ee: 5c c0 rjmp .+184 ; 0x317a8 316f0: f8 f4 brcc .+62 ; 0x31730 316f2: 26 34 cpi r18, 0x46 ; 70 316f4: 81 e0 ldi r24, 0x01 ; 1 316f6: 38 07 cpc r19, r24 316f8: 58 f4 brcc .+22 ; 0x31710 316fa: 21 34 cpi r18, 0x41 ; 65 316fc: 81 e0 ldi r24, 0x01 ; 1 316fe: 38 07 cpc r19, r24 31700: 20 f7 brcc .-56 ; 0x316ca 31702: 27 53 subi r18, 0x37 ; 55 31704: 31 40 sbci r19, 0x01 ; 1 31706: 25 30 cpi r18, 0x05 ; 5 31708: 31 05 cpc r19, r1 3170a: 08 f0 brcs .+2 ; 0x3170e 3170c: bd cf rjmp .-134 ; 0x31688 3170e: dd cf rjmp .-70 ; 0x316ca 31710: 21 59 subi r18, 0x91 ; 145 31712: 31 40 sbci r19, 0x01 ; 1 31714: 22 30 cpi r18, 0x02 ; 2 31716: 31 05 cpc r19, r1 31718: 08 f0 brcs .+2 ; 0x3171c 3171a: b6 cf rjmp .-148 ; 0x31688 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 3171c: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 31720: 83 30 cpi r24, 0x03 ; 3 31722: 09 f4 brne .+2 ; 0x31726 31724: 3f c0 rjmp .+126 ; 0x317a4 31726: 89 30 cpi r24, 0x09 ; 9 31728: 09 f0 breq .+2 ; 0x3172c 3172a: ae cf rjmp .-164 ; 0x31688 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 3172c: 87 e0 ldi r24, 0x07 ; 7 3172e: 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) ) { 31730: 29 3f cpi r18, 0xF9 ; 249 31732: 81 e0 ldi r24, 0x01 ; 1 31734: 38 07 cpc r19, r24 31736: 49 f2 breq .-110 ; 0x316ca 31738: 70 f4 brcc .+28 ; 0x31756 3173a: 27 3f cpi r18, 0xF7 ; 247 3173c: 81 e0 ldi r24, 0x01 ; 1 3173e: 38 07 cpc r19, r24 31740: 21 f2 breq .-120 ; 0x316ca 31742: 60 f7 brcc .-40 ; 0x3171c break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 31744: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 31748: 83 30 cpi r24, 0x03 ; 3 3174a: 61 f1 breq .+88 ; 0x317a4 3174c: 88 30 cpi r24, 0x08 ; 8 3174e: 09 f0 breq .+2 ; 0x31752 31750: 9b cf rjmp .-202 ; 0x31688 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 31752: 86 e0 ldi r24, 0x06 ; 6 31754: 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) ) { 31756: 2b 3f cpi r18, 0xFB ; 251 31758: 81 e0 ldi r24, 0x01 ; 1 3175a: 38 07 cpc r19, r24 3175c: a9 f0 breq .+42 ; 0x31788 3175e: 68 f0 brcs .+26 ; 0x3177a 31760: 2c 3f cpi r18, 0xFC ; 252 31762: 31 40 sbci r19, 0x01 ; 1 31764: 09 f0 breq .+2 ; 0x31768 31766: 90 cf rjmp .-224 ; 0x31688 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 31768: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3176c: 85 30 cpi r24, 0x05 ; 5 3176e: 89 f0 breq .+34 ; 0x31792 31770: 86 30 cpi r24, 0x06 ; 6 31772: 09 f0 breq .+2 ; 0x31776 31774: 89 cf rjmp .-238 ; 0x31688 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 31776: 85 e0 ldi r24, 0x05 ; 5 31778: 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) { 3177a: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3177e: 81 30 cpi r24, 0x01 ; 1 31780: 09 f0 breq .+2 ; 0x31784 31782: 82 cf rjmp .-252 ; 0x31688 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; 31784: 81 e0 ldi r24, 0x01 ; 1 31786: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 31788: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3178c: 82 30 cpi r24, 0x02 ; 2 3178e: d1 f3 breq .-12 ; 0x31784 31790: 7b cf rjmp .-266 ; 0x31688 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 31792: 84 e0 ldi r24, 0x04 ; 4 31794: 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) { 31796: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3179a: 82 30 cpi r24, 0x02 ; 2 3179c: 61 f0 breq .+24 ; 0x317b6 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) { 3179e: 83 30 cpi r24, 0x03 ; 3 317a0: 09 f0 breq .+2 ; 0x317a4 317a2: 72 cf rjmp .-284 ; 0x31688 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; 317a4: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 317a6: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 317a8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 317ac: 82 30 cpi r24, 0x02 ; 2 317ae: 29 f0 breq .+10 ; 0x317ba 317b0: 84 30 cpi r24, 0x04 ; 4 317b2: 09 f0 breq .+2 ; 0x317b6 317b4: 69 cf rjmp .-302 ; 0x31688 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; 317b6: 82 e0 ldi r24, 0x02 ; 2 317b8: 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; 317ba: 80 e0 ldi r24, 0x00 ; 0 317bc: 08 95 ret 000317be (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 317be: cf 93 push r28 317c0: df 93 push r29 317c2: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 317c4: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 317c8: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 317cc: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 317d0: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 317d4: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 317d8: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 317dc: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 317e0: c9 01 movw r24, r18 317e2: 86 1b sub r24, r22 317e4: 97 0b sbc r25, r23 317e6: 06 97 sbiw r24, 0x06 ; 6 317e8: 24 f0 brlt .+8 ; 0x317f2 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 317ea: ce 01 movw r24, r28 317ec: 0e 94 d0 7c call 0xf9a0 ; 0xf9a0 317f0: e9 cf rjmp .-46 ; 0x317c4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]+0x6> f(); safe_delay_keep_alive(delay); } } 317f2: df 91 pop r29 317f4: cf 91 pop r28 317f6: 08 95 ret 000317f8 : } //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) { 317f8: cf 93 push r28 317fa: df 93 push r29 317fc: 00 d0 rcall .+0 ; 0x317fe 317fe: 00 d0 rcall .+0 ; 0x31800 31800: 1f 92 push r1 31802: cd b7 in r28, 0x3d ; 61 31804: 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)) 31806: 87 30 cpi r24, 0x07 ; 7 31808: 50 f5 brcc .+84 ; 0x3185e 3180a: 67 30 cpi r22, 0x07 ; 7 3180c: 40 f5 brcc .+80 ; 0x3185e return false; uint8_t valid_points_mask[7] = { 3180e: 97 e0 ldi r25, 0x07 ; 7 31810: ed eb ldi r30, 0xBD ; 189 31812: f2 e0 ldi r31, 0x02 ; 2 31814: de 01 movw r26, r28 31816: 11 96 adiw r26, 0x01 ; 1 31818: 01 90 ld r0, Z+ 3181a: 0d 92 st X+, r0 3181c: 9a 95 dec r25 3181e: e1 f7 brne .-8 ; 0x31818 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 31820: 46 e0 ldi r20, 0x06 ; 6 31822: 50 e0 ldi r21, 0x00 ; 0 31824: fa 01 movw r30, r20 31826: e6 1b sub r30, r22 31828: f1 09 sbc r31, r1 3182a: 21 e0 ldi r18, 0x01 ; 1 3182c: 30 e0 ldi r19, 0x00 ; 0 3182e: 2c 0f add r18, r28 31830: 3d 1f adc r19, r29 31832: e2 0f add r30, r18 31834: f3 1f adc r31, r19 31836: 20 81 ld r18, Z 31838: 30 e0 ldi r19, 0x00 ; 0 3183a: 48 1b sub r20, r24 3183c: 51 09 sbc r21, r1 3183e: c9 01 movw r24, r18 31840: 02 c0 rjmp .+4 ; 0x31846 31842: 95 95 asr r25 31844: 87 95 ror r24 31846: 4a 95 dec r20 31848: e2 f7 brpl .-8 ; 0x31842 3184a: 81 70 andi r24, 0x01 ; 1 } 3184c: 27 96 adiw r28, 0x07 ; 7 3184e: 0f b6 in r0, 0x3f ; 63 31850: f8 94 cli 31852: de bf out 0x3e, r29 ; 62 31854: 0f be out 0x3f, r0 ; 63 31856: cd bf out 0x3d, r28 ; 61 31858: df 91 pop r29 3185a: cf 91 pop r28 3185c: 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; 3185e: 80 e0 ldi r24, 0x00 ; 0 31860: f5 cf rjmp .-22 ; 0x3184c 00031862 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 31862: 0f 93 push r16 31864: 1f 93 push r17 31866: cf 93 push r28 31868: df 93 push r29 3186a: 00 d0 rcall .+0 ; 0x3186c 3186c: 1f 92 push r1 3186e: cd b7 in r28, 0x3d ; 61 31870: de b7 in r29, 0x3e ; 62 31872: 9b 01 movw r18, r22 31874: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 31876: 05 ef ldi r16, 0xF5 ; 245 31878: 11 e1 ldi r17, 0x11 ; 17 3187a: f8 01 movw r30, r16 3187c: 60 85 ldd r22, Z+8 ; 0x08 3187e: 71 85 ldd r23, Z+9 ; 0x09 31880: 82 85 ldd r24, Z+10 ; 0x0a 31882: 93 85 ldd r25, Z+11 ; 0x0b 31884: 69 83 std Y+1, r22 ; 0x01 31886: 7a 83 std Y+2, r23 ; 0x02 31888: 8b 83 std Y+3, r24 ; 0x03 3188a: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 3188c: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 31890: f8 01 movw r30, r16 31892: 60 87 std Z+8, r22 ; 0x08 31894: 71 87 std Z+9, r23 ; 0x09 31896: 82 87 std Z+10, r24 ; 0x0a 31898: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 3189a: 65 e5 ldi r22, 0x55 ; 85 3189c: 75 e5 ldi r23, 0x55 ; 85 3189e: 85 e5 ldi r24, 0x55 ; 85 318a0: 91 e4 ldi r25, 0x41 ; 65 318a2: 0f 94 d0 85 call 0x30ba0 ; 0x30ba0 st_synchronize(); 318a6: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[Z_AXIS] = curpos_z; 318aa: 89 81 ldd r24, Y+1 ; 0x01 318ac: 9a 81 ldd r25, Y+2 ; 0x02 318ae: ab 81 ldd r26, Y+3 ; 0x03 318b0: bc 81 ldd r27, Y+4 ; 0x04 318b2: f8 01 movw r30, r16 318b4: 80 87 std Z+8, r24 ; 0x08 318b6: 91 87 std Z+9, r25 ; 0x09 318b8: a2 87 std Z+10, r26 ; 0x0a 318ba: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 318bc: ce 01 movw r24, r28 318be: 01 96 adiw r24, 0x01 ; 1 318c0: 0f 94 5b 76 call 0x2ecb6 ; 0x2ecb6 } 318c4: 0f 90 pop r0 318c6: 0f 90 pop r0 318c8: 0f 90 pop r0 318ca: 0f 90 pop r0 318cc: df 91 pop r29 318ce: cf 91 pop r28 318d0: 1f 91 pop r17 318d2: 0f 91 pop r16 318d4: 08 95 ret 000318d6 : 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])); 318d6: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> 318da: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 318de: 07 2e mov r0, r23 318e0: 00 0c add r0, r0 318e2: 88 0b sbc r24, r24 318e4: 99 0b sbc r25, r25 318e6: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 318ea: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 318ee: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 318f2: 40 91 40 04 lds r20, 0x0440 ; 0x800440 318f6: 50 91 41 04 lds r21, 0x0441 ; 0x800441 318fa: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 318fe: 0f 94 31 8c call 0x31862 ; 0x31862 babystepLoadZ = 0; 31902: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 31906: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> } 3190a: 08 95 ret 0003190c : return sampled; } void go_home_with_z_lift() { 3190c: cf 93 push r28 3190e: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31910: 0e 94 4a 60 call 0xc094 ; 0xc094 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31914: c5 ef ldi r28, 0xF5 ; 245 31916: d1 e1 ldi r29, 0x11 ; 17 31918: 80 e0 ldi r24, 0x00 ; 0 3191a: 90 e0 ldi r25, 0x00 ; 0 3191c: a0 ea ldi r26, 0xA0 ; 160 3191e: b0 e4 ldi r27, 0x40 ; 64 31920: 88 87 std Y+8, r24 ; 0x08 31922: 99 87 std Y+9, r25 ; 0x09 31924: aa 87 std Y+10, r26 ; 0x0a 31926: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 31928: 65 e5 ldi r22, 0x55 ; 85 3192a: 75 e5 ldi r23, 0x55 ; 85 3192c: 85 e5 ldi r24, 0x55 ; 85 3192e: 91 e4 ldi r25, 0x41 ; 65 31930: 0f 94 82 88 call 0x31104 ; 0x31104 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 31934: 8d ec ldi r24, 0xCD ; 205 31936: 9c ec ldi r25, 0xCC ; 204 31938: ac e4 ldi r26, 0x4C ; 76 3193a: be e3 ldi r27, 0x3E ; 62 3193c: 88 83 st Y, r24 3193e: 99 83 std Y+1, r25 ; 0x01 31940: aa 83 std Y+2, r26 ; 0x02 31942: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 31944: 83 e3 ldi r24, 0x33 ; 51 31946: 93 e3 ldi r25, 0x33 ; 51 31948: a3 e7 ldi r26, 0x73 ; 115 3194a: b0 ec ldi r27, 0xC0 ; 192 3194c: 8c 83 std Y+4, r24 ; 0x04 3194e: 9d 83 std Y+5, r25 ; 0x05 31950: ae 83 std Y+6, r26 ; 0x06 31952: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31954: 69 ef ldi r22, 0xF9 ; 249 31956: 71 e1 ldi r23, 0x11 ; 17 31958: ce 01 movw r24, r28 3195a: 0e 94 27 64 call 0xc84e ; 0xc84e go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 3195e: 60 e0 ldi r22, 0x00 ; 0 31960: 70 e0 ldi r23, 0x00 ; 0 31962: 86 e1 ldi r24, 0x16 ; 22 31964: 93 e4 ldi r25, 0x43 ; 67 31966: 0f 94 82 88 call 0x31104 ; 0x31104 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 3196a: 8a e9 ldi r24, 0x9A ; 154 3196c: 99 e9 ldi r25, 0x99 ; 153 3196e: a9 e1 ldi r26, 0x19 ; 25 31970: be e3 ldi r27, 0x3E ; 62 31972: 88 87 std Y+8, r24 ; 0x08 31974: 99 87 std Y+9, r25 ; 0x09 31976: aa 87 std Y+10, r26 ; 0x0a 31978: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 3197a: 65 e5 ldi r22, 0x55 ; 85 3197c: 75 e5 ldi r23, 0x55 ; 85 3197e: 85 e5 ldi r24, 0x55 ; 85 31980: 91 e4 ldi r25, 0x41 ; 65 } 31982: df 91 pop r29 31984: 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); 31986: 0d 94 82 88 jmp 0x31104 ; 0x31104 0003198a : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 3198a: 68 2f mov r22, r24 3198c: 70 e0 ldi r23, 0x00 ; 0 3198e: 90 e0 ldi r25, 0x00 ; 0 31990: 80 e0 ldi r24, 0x00 ; 0 31992: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 31996: 20 e0 ldi r18, 0x00 ; 0 31998: 30 e0 ldi r19, 0x00 ; 0 3199a: 48 e0 ldi r20, 0x08 ; 8 3199c: 52 e4 ldi r21, 0x42 ; 66 3199e: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 319a2: 20 e0 ldi r18, 0x00 ; 0 319a4: 30 e0 ldi r19, 0x00 ; 0 319a6: 40 e8 ldi r20, 0x80 ; 128 319a8: 5f e3 ldi r21, 0x3F ; 63 319aa: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> } 319ae: 08 95 ret 000319b0 : // 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() { 319b0: 2f 92 push r2 319b2: 3f 92 push r3 319b4: 4f 92 push r4 319b6: 5f 92 push r5 319b8: 6f 92 push r6 319ba: 7f 92 push r7 319bc: 8f 92 push r8 319be: 9f 92 push r9 319c0: af 92 push r10 319c2: bf 92 push r11 319c4: cf 92 push r12 319c6: df 92 push r13 319c8: ef 92 push r14 319ca: ff 92 push r15 319cc: 0f 93 push r16 319ce: 1f 93 push r17 319d0: cf 93 push r28 319d2: df 93 push r29 319d4: 00 d0 rcall .+0 ; 0x319d6 319d6: 00 d0 rcall .+0 ; 0x319d8 319d8: cd b7 in r28, 0x3d ; 61 319da: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 319dc: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 319e0: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 319e2: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 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); 319e6: 80 e0 ldi r24, 0x00 ; 0 319e8: 0f 94 d8 2c call 0x259b0 ; 0x259b0 319ec: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 319ee: 0e 94 4a 60 call 0xc094 ; 0xc094 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 319f2: 89 e8 ldi r24, 0x89 ; 137 319f4: 98 e4 ldi r25, 0x48 ; 72 319f6: 0e 94 32 6d call 0xda64 ; 0xda64 319fa: 0f 94 f4 0a call 0x215e8 ; 0x215e8 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 319fe: 4d ed ldi r20, 0xDD ; 221 31a00: 5c e6 ldi r21, 0x6C ; 108 31a02: 63 e0 ldi r22, 0x03 ; 3 31a04: 80 e0 ldi r24, 0x00 ; 0 31a06: 0e 94 10 6a call 0xd420 ; 0xd420 31a0a: 81 e0 ldi r24, 0x01 ; 1 31a0c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> // 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; 31a10: 80 e0 ldi r24, 0x00 ; 0 31a12: 90 e0 ldi r25, 0x00 ; 0 31a14: a0 ea ldi r26, 0xA0 ; 160 31a16: b0 e4 ldi r27, 0x40 ; 64 31a18: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 31a1c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 31a20: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 31a24: b0 93 00 12 sts 0x1200, r27 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 31a28: 65 e5 ldi r22, 0x55 ; 85 31a2a: 75 e5 ldi r23, 0x55 ; 85 31a2c: 85 e5 ldi r24, 0x55 ; 85 31a2e: 91 e4 ldi r25, 0x41 ; 65 31a30: 0f 94 82 88 call 0x31104 ; 0x31104 31a34: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> check_Z_crash(); #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 31a38: 80 e0 ldi r24, 0x00 ; 0 31a3a: 90 e0 ldi r25, 0x00 ; 0 31a3c: a0 e8 ldi r26, 0x80 ; 128 31a3e: bf e3 ldi r27, 0x3F ; 63 31a40: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 31a44: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 31a48: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 31a4c: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = BED_Y0; 31a50: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 31a54: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 31a58: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 31a5c: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31a60: 69 ef ldi r22, 0xF9 ; 249 31a62: 71 e1 ldi r23, 0x11 ; 17 31a64: 85 ef ldi r24, 0xF5 ; 245 31a66: 91 e1 ldi r25, 0x11 ; 17 31a68: 0e 94 27 64 call 0xc84e ; 0xc84e go_to_current(homing_feedrate[X_AXIS]/60); 31a6c: 60 e0 ldi r22, 0x00 ; 0 31a6e: 70 e0 ldi r23, 0x00 ; 0 31a70: 88 e4 ldi r24, 0x48 ; 72 31a72: 92 e4 ldi r25, 0x42 ; 66 31a74: 0f 94 82 88 call 0x31104 ; 0x31104 set_destination_to_current(); 31a78: 0e 94 b7 61 call 0xc36e ; 0xc36e homeaxis(Z_AXIS); 31a7c: 82 e0 ldi r24, 0x02 ; 2 31a7e: 0f 94 1c 55 call 0x2aa38 ; 0x2aa38 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31a82: 43 e0 ldi r20, 0x03 ; 3 31a84: 60 e0 ldi r22, 0x00 ; 0 31a86: 70 e0 ldi r23, 0x00 ; 0 31a88: 80 e2 ldi r24, 0x20 ; 32 31a8a: 91 ec ldi r25, 0xC1 ; 193 31a8c: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 31a90: 81 11 cpse r24, r1 31a92: 06 c0 rjmp .+12 ; 0x31aa0 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)); 31a94: 89 ee ldi r24, 0xE9 ; 233 31a96: 92 e6 ldi r25, 0x62 ; 98 31a98: 0e 94 32 6d call 0xda64 ; 0xda64 31a9c: 0e 94 60 73 call 0xe6c0 ; 0xe6c0 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 31aa0: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31aa4: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31aa8: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 31aac: b0 91 00 12 lds r27, 0x1200 ; 0x801200 31ab0: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d 31ab4: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e 31ab8: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f 31abc: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 31ac0: e2 e0 ldi r30, 0x02 ; 2 31ac2: f0 e0 ldi r31, 0x00 ; 0 31ac4: fa 83 std Y+2, r31 ; 0x02 31ac6: 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; 31ac8: c1 2c mov r12, r1 31aca: d1 2c mov r13, r1 31acc: 30 ea ldi r19, 0xA0 ; 160 31ace: e3 2e mov r14, r19 31ad0: 30 e4 ldi r19, 0x40 ; 64 31ad2: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31ad4: 43 e0 ldi r20, 0x03 ; 3 31ad6: 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 31ad8: 52 e0 ldi r21, 0x02 ; 2 31ada: 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); 31adc: 05 eb ldi r16, 0xB5 ; 181 31ade: 1e e9 ldi r17, 0x9E ; 158 31ae0: 67 e0 ldi r22, 0x07 ; 7 31ae2: 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(); 31ae4: 0e 94 4a 60 call 0xc094 ; 0xc094 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31ae8: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 31aec: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 31af0: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 31af4: f0 92 00 12 sts 0x1200, r15 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 31af8: 65 e5 ldi r22, 0x55 ; 85 31afa: 75 e5 ldi r23, 0x55 ; 85 31afc: 85 e5 ldi r24, 0x55 ; 85 31afe: 91 e4 ldi r25, 0x41 ; 65 31b00: 0f 94 82 88 call 0x31104 ; 0x31104 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31b04: 29 81 ldd r18, Y+1 ; 0x01 31b06: 21 50 subi r18, 0x01 ; 1 31b08: 82 2f mov r24, r18 31b0a: 6b 2d mov r22, r11 31b0c: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 31b10: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 31b12: 82 2f mov r24, r18 31b14: 0f 94 f7 a1 call 0x343ee ; 0x343ee <__divmodqi4> 31b18: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 31b1a: 80 ff sbrs r24, 0 31b1c: 03 c0 rjmp .+6 ; 0x31b24 31b1e: f9 2d mov r31, r9 31b20: f8 19 sub r31, r8 31b22: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 31b24: 88 2d mov r24, r8 31b26: 88 0f add r24, r24 31b28: 88 0d add r24, r8 31b2a: 0f 94 c5 8c call 0x3198a ; 0x3198a 31b2e: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 31b32: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 31b36: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 31b3a: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = BED_Y(iy * 3); 31b3e: 87 2d mov r24, r7 31b40: 88 0f add r24, r24 31b42: 87 0d add r24, r7 31b44: 0f 94 c5 8c call 0x3198a ; 0x3198a 31b48: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 31b4c: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 31b50: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 31b54: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31b58: 69 ef ldi r22, 0xF9 ; 249 31b5a: 71 e1 ldi r23, 0x11 ; 17 31b5c: 85 ef ldi r24, 0xF5 ; 245 31b5e: 91 e1 ldi r25, 0x11 ; 17 31b60: 0e 94 27 64 call 0xc84e ; 0xc84e go_to_current(homing_feedrate[X_AXIS]/60); 31b64: 60 e0 ldi r22, 0x00 ; 0 31b66: 70 e0 ldi r23, 0x00 ; 0 31b68: 88 e4 ldi r24, 0x48 ; 72 31b6a: 92 e4 ldi r25, 0x42 ; 66 31b6c: 0f 94 82 88 call 0x31104 ; 0x31104 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 31b70: 63 e0 ldi r22, 0x03 ; 3 31b72: 80 e0 ldi r24, 0x00 ; 0 31b74: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 31b78: 8a 81 ldd r24, Y+2 ; 0x02 31b7a: 8f 93 push r24 31b7c: 99 81 ldd r25, Y+1 ; 0x01 31b7e: 9f 93 push r25 31b80: 1f 93 push r17 31b82: 0f 93 push r16 31b84: 0e 94 d5 69 call 0xd3aa ; 0xd3aa #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31b88: 43 e0 ldi r20, 0x03 ; 3 31b8a: 60 e0 ldi r22, 0x00 ; 0 31b8c: 70 e0 ldi r23, 0x00 ; 0 31b8e: 80 e2 ldi r24, 0x20 ; 32 31b90: 91 ec ldi r25, 0xC1 ; 193 31b92: 0f 94 5b 57 call 0x2aeb6 ; 0x2aeb6 31b96: 58 2e mov r5, r24 31b98: 0f 90 pop r0 31b9a: 0f 90 pop r0 31b9c: 0f 90 pop r0 31b9e: 0f 90 pop r0 31ba0: 88 23 and r24, r24 31ba2: 09 f4 brne .+2 ; 0x31ba6 31ba4: 77 cf rjmp .-274 ; 0x31a94 31ba6: a7 9c mul r10, r7 31ba8: f0 01 movw r30, r0 31baa: 11 24 eor r1, r1 31bac: e8 0d add r30, r8 31bae: f1 1d adc r31, r1 31bb0: ee 0f add r30, r30 31bb2: ff 1f adc r31, r31 31bb4: ee 0f add r30, r30 31bb6: ff 1f adc r31, r31 31bb8: e4 56 subi r30, 0x64 ; 100 31bba: fd 4e sbci r31, 0xED ; 237 31bbc: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31bc0: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31bc4: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 31bc8: b0 91 00 12 lds r27, 0x1200 ; 0x801200 31bcc: 81 83 std Z+1, r24 ; 0x01 31bce: 92 83 std Z+2, r25 ; 0x02 31bd0: a3 83 std Z+3, r26 ; 0x03 31bd2: b4 83 std Z+4, r27 ; 0x04 31bd4: e9 81 ldd r30, Y+1 ; 0x01 31bd6: fa 81 ldd r31, Y+2 ; 0x02 31bd8: 31 96 adiw r30, 0x01 ; 1 31bda: fa 83 std Y+2, r31 ; 0x02 31bdc: 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) { 31bde: 3a 97 sbiw r30, 0x0a ; 10 31be0: 09 f0 breq .+2 ; 0x31be4 31be2: 80 cf rjmp .-256 ; 0x31ae4 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 31be4: 60 90 9d 12 lds r6, 0x129D ; 0x80129d 31be8: 70 90 9e 12 lds r7, 0x129E ; 0x80129e 31bec: 80 90 9f 12 lds r8, 0x129F ; 0x80129f 31bf0: 90 90 a0 12 lds r9, 0x12A0 ; 0x8012a0 float zmax = zmin; 31bf4: 46 2c mov r4, r6 31bf6: a7 2c mov r10, r7 31bf8: b8 2c mov r11, r8 31bfa: 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]; 31bfc: 1e 82 std Y+6, r1 ; 0x06 31bfe: 1d 82 std Y+5, r1 ; 0x05 31c00: 0c e9 ldi r16, 0x9C ; 156 31c02: 12 e1 ldi r17, 0x12 ; 18 31c04: 8d 81 ldd r24, Y+5 ; 0x05 31c06: 9e 81 ldd r25, Y+6 ; 0x06 31c08: 83 56 subi r24, 0x63 ; 99 31c0a: 9d 4e sbci r25, 0xED ; 237 31c0c: 9a 83 std Y+2, r25 ; 0x02 31c0e: 89 83 std Y+1, r24 ; 0x01 31c10: 93 e0 ldi r25, 0x03 ; 3 31c12: 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]); 31c14: e9 81 ldd r30, Y+1 ; 0x01 31c16: fa 81 ldd r31, Y+2 ; 0x02 31c18: c1 90 ld r12, Z+ 31c1a: d1 90 ld r13, Z+ 31c1c: e1 90 ld r14, Z+ 31c1e: f1 90 ld r15, Z+ 31c20: fa 83 std Y+2, r31 ; 0x02 31c22: e9 83 std Y+1, r30 ; 0x01 31c24: 93 01 movw r18, r6 31c26: a4 01 movw r20, r8 31c28: c7 01 movw r24, r14 31c2a: b6 01 movw r22, r12 31c2c: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 31c30: 18 16 cp r1, r24 31c32: 14 f0 brlt .+4 ; 0x31c38 31c34: 36 01 movw r6, r12 31c36: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 31c38: 24 2d mov r18, r4 31c3a: 3a 2d mov r19, r10 31c3c: 4b 2d mov r20, r11 31c3e: 52 2d mov r21, r2 31c40: c7 01 movw r24, r14 31c42: b6 01 movw r22, r12 31c44: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31c48: 87 fd sbrc r24, 7 31c4a: 04 c0 rjmp .+8 ; 0x31c54 31c4c: 4c 2c mov r4, r12 31c4e: ad 2c mov r10, r13 31c50: be 2c mov r11, r14 31c52: 2f 2c mov r2, r15 31c54: 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) { 31c56: 31 10 cpse r3, r1 31c58: dd cf rjmp .-70 ; 0x31c14 31c5a: 8d 81 ldd r24, Y+5 ; 0x05 31c5c: 9e 81 ldd r25, Y+6 ; 0x06 31c5e: 4c 96 adiw r24, 0x1c ; 28 31c60: 9e 83 std Y+6, r25 ; 0x06 31c62: 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) 31c64: 84 35 cpi r24, 0x54 ; 84 31c66: 91 05 cpc r25, r1 31c68: 59 f6 brne .-106 ; 0x31c00 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) { 31c6a: 93 01 movw r18, r6 31c6c: a4 01 movw r20, r8 31c6e: 64 2d mov r22, r4 31c70: 7a 2d mov r23, r10 31c72: 8b 2d mov r24, r11 31c74: 92 2d mov r25, r2 31c76: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 31c7a: 20 e0 ldi r18, 0x00 ; 0 31c7c: 30 e0 ldi r19, 0x00 ; 0 31c7e: 40 e4 ldi r20, 0x40 ; 64 31c80: 50 e4 ldi r21, 0x40 ; 64 31c82: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 31c86: 18 16 cp r1, r24 31c88: 2c f5 brge .+74 ; 0x31cd4 // 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!"); 31c8a: 88 e9 ldi r24, 0x98 ; 152 31c8c: 9e e9 ldi r25, 0x9E ; 158 31c8e: 0e 94 d4 72 call 0xe5a8 ; 0xe5a8 // 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; 31c92: 51 2c mov r5, r1 31c94: fc 81 ldd r31, Y+4 ; 0x04 31c96: f0 93 77 02 sts 0x0277, r31 ; 0x800277 <_ZL14check_endstops.lto_priv.362> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31c9a: 8b 81 ldd r24, Y+3 ; 0x03 31c9c: 0f 94 d8 2c call 0x259b0 ; 0x259b0 #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 31ca0: 85 2d mov r24, r5 31ca2: 26 96 adiw r28, 0x06 ; 6 31ca4: 0f b6 in r0, 0x3f ; 63 31ca6: f8 94 cli 31ca8: de bf out 0x3e, r29 ; 62 31caa: 0f be out 0x3f, r0 ; 63 31cac: cd bf out 0x3d, r28 ; 61 31cae: df 91 pop r29 31cb0: cf 91 pop r28 31cb2: 1f 91 pop r17 31cb4: 0f 91 pop r16 31cb6: ff 90 pop r15 31cb8: ef 90 pop r14 31cba: df 90 pop r13 31cbc: cf 90 pop r12 31cbe: bf 90 pop r11 31cc0: af 90 pop r10 31cc2: 9f 90 pop r9 31cc4: 8f 90 pop r8 31cc6: 7f 90 pop r7 31cc8: 6f 90 pop r6 31cca: 5f 90 pop r5 31ccc: 4f 90 pop r4 31cce: 3f 90 pop r3 31cd0: 2f 90 pop r2 31cd2: 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) 31cd4: 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; 31cd6: 85 ec ldi r24, 0xC5 ; 197 31cd8: e8 2e mov r14, r24 31cda: 8f e0 ldi r24, 0x0F ; 15 31cdc: f8 2e mov r15, r24 31cde: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31ce0: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 31ce2: 9d 81 ldd r25, Y+5 ; 0x05 31ce4: 91 11 cpse r25, r1 31ce6: 03 c0 rjmp .+6 ; 0x31cee 31ce8: e9 81 ldd r30, Y+1 ; 0x01 31cea: ee 23 and r30, r30 31cec: 29 f1 breq .+74 ; 0x31d38 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 31cee: 20 91 9d 12 lds r18, 0x129D ; 0x80129d 31cf2: 30 91 9e 12 lds r19, 0x129E ; 0x80129e 31cf6: 40 91 9f 12 lds r20, 0x129F ; 0x80129f 31cfa: 50 91 a0 12 lds r21, 0x12A0 ; 0x8012a0 31cfe: f6 01 movw r30, r12 31d00: 61 81 ldd r22, Z+1 ; 0x01 31d02: 72 81 ldd r23, Z+2 ; 0x02 31d04: 83 81 ldd r24, Z+3 ; 0x03 31d06: 94 81 ldd r25, Z+4 ; 0x04 31d08: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 31d0c: 20 e0 ldi r18, 0x00 ; 0 31d0e: 30 e0 ldi r19, 0x00 ; 0 31d10: 48 ec ldi r20, 0xC8 ; 200 31d12: 52 e4 ldi r21, 0x42 ; 66 31d14: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31d18: 20 e0 ldi r18, 0x00 ; 0 31d1a: 30 e0 ldi r19, 0x00 ; 0 31d1c: 40 e0 ldi r20, 0x00 ; 0 31d1e: 5f e3 ldi r21, 0x3F ; 63 31d20: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 31d24: 0f 94 0b a4 call 0x34816 ; 0x34816 31d28: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 31d2c: c7 01 movw r24, r14 31d2e: 0f 94 7e a1 call 0x342fc ; 0x342fc SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 31d32: f2 e0 ldi r31, 0x02 ; 2 31d34: ef 0e add r14, r31 31d36: f1 1c adc r15, r1 31d38: 84 e0 ldi r24, 0x04 ; 4 31d3a: c8 0e add r12, r24 31d3c: d1 1c adc r13, r1 31d3e: 9d 81 ldd r25, Y+5 ; 0x05 31d40: 9f 5f subi r25, 0xFF ; 255 31d42: 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) { 31d44: 93 30 cpi r25, 0x03 ; 3 31d46: 69 f6 brne .-102 ; 0x31ce2 31d48: 04 5e subi r16, 0xE4 ; 228 31d4a: 1f 4f sbci r17, 0xFF ; 255 31d4c: e9 81 ldd r30, Y+1 ; 0x01 31d4e: ef 5f subi r30, 0xFF ; 255 31d50: 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) 31d52: e3 30 cpi r30, 0x03 ; 3 31d54: 21 f6 brne .-120 ; 0x31cde #endif addr += 2; } } mbl.reset(); 31d56: 0f 94 51 57 call 0x2aea2 ; 0x2aea2 go_home_with_z_lift(); 31d5a: 0f 94 86 8c call 0x3190c ; 0x3190c 31d5e: 9a cf rjmp .-204 ; 0x31c94 00031d60 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 31d60: 82 e0 ldi r24, 0x02 ; 2 31d62: 0f 94 8c 22 call 0x24518 ; 0x24518 31d66: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 31d6a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 31d6e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 31d72: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_z_position(current_position[Z_AXIS]); 31d76: 8d ef ldi r24, 0xFD ; 253 31d78: 91 e1 ldi r25, 0x11 ; 17 31d7a: 0d 94 5b 76 jmp 0x2ecb6 ; 0x2ecb6 00031d7e : * 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() { 31d7e: 4f 92 push r4 31d80: 5f 92 push r5 31d82: 6f 92 push r6 31d84: 7f 92 push r7 31d86: 8f 92 push r8 31d88: 9f 92 push r9 31d8a: af 92 push r10 31d8c: bf 92 push r11 31d8e: cf 92 push r12 31d90: df 92 push r13 31d92: ef 92 push r14 31d94: ff 92 push r15 31d96: 0f 93 push r16 31d98: 1f 93 push r17 31d9a: cf 93 push r28 31d9c: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 31d9e: 05 ef ldi r16, 0xF5 ; 245 31da0: 11 e1 ldi r17, 0x11 ; 17 31da2: c4 ed ldi r28, 0xD4 ; 212 31da4: d6 e1 ldi r29, 0x16 ; 22 31da6: 28 81 ld r18, Y 31da8: 39 81 ldd r19, Y+1 ; 0x01 31daa: 4a 81 ldd r20, Y+2 ; 0x02 31dac: 5b 81 ldd r21, Y+3 ; 0x03 31dae: f8 01 movw r30, r16 31db0: 60 81 ld r22, Z 31db2: 71 81 ldd r23, Z+1 ; 0x01 31db4: 82 81 ldd r24, Z+2 ; 0x02 31db6: 93 81 ldd r25, Z+3 ; 0x03 31db8: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 31dbc: 4b 01 movw r8, r22 31dbe: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 31dc0: 2c 81 ldd r18, Y+4 ; 0x04 31dc2: 3d 81 ldd r19, Y+5 ; 0x05 31dc4: 4e 81 ldd r20, Y+6 ; 0x06 31dc6: 5f 81 ldd r21, Y+7 ; 0x07 31dc8: f8 01 movw r30, r16 31dca: 64 81 ldd r22, Z+4 ; 0x04 31dcc: 75 81 ldd r23, Z+5 ; 0x05 31dce: 86 81 ldd r24, Z+6 ; 0x06 31dd0: 97 81 ldd r25, Z+7 ; 0x07 31dd2: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 31dd6: 6b 01 movw r12, r22 31dd8: 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; 31dda: c4 ec ldi r28, 0xC4 ; 196 31ddc: d6 e1 ldi r29, 0x16 ; 22 31dde: 28 81 ld r18, Y 31de0: 39 81 ldd r19, Y+1 ; 0x01 31de2: 4a 81 ldd r20, Y+2 ; 0x02 31de4: 5b 81 ldd r21, Y+3 ; 0x03 31de6: c5 01 movw r24, r10 31de8: b4 01 movw r22, r8 31dea: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31dee: 2b 01 movw r4, r22 31df0: 3c 01 movw r6, r24 31df2: 2c 81 ldd r18, Y+4 ; 0x04 31df4: 3d 81 ldd r19, Y+5 ; 0x05 31df6: 4e 81 ldd r20, Y+6 ; 0x06 31df8: 5f 81 ldd r21, Y+7 ; 0x07 31dfa: c7 01 movw r24, r14 31dfc: b6 01 movw r22, r12 31dfe: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31e02: 9b 01 movw r18, r22 31e04: ac 01 movw r20, r24 31e06: c3 01 movw r24, r6 31e08: b2 01 movw r22, r4 31e0a: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 31e0e: f8 01 movw r30, r16 31e10: 60 83 st Z, r22 31e12: 71 83 std Z+1, r23 ; 0x01 31e14: 82 83 std Z+2, r24 ; 0x02 31e16: 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; 31e18: 28 85 ldd r18, Y+8 ; 0x08 31e1a: 39 85 ldd r19, Y+9 ; 0x09 31e1c: 4a 85 ldd r20, Y+10 ; 0x0a 31e1e: 5b 85 ldd r21, Y+11 ; 0x0b 31e20: c5 01 movw r24, r10 31e22: b4 01 movw r22, r8 31e24: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31e28: 4b 01 movw r8, r22 31e2a: 5c 01 movw r10, r24 31e2c: 2c 85 ldd r18, Y+12 ; 0x0c 31e2e: 3d 85 ldd r19, Y+13 ; 0x0d 31e30: 4e 85 ldd r20, Y+14 ; 0x0e 31e32: 5f 85 ldd r21, Y+15 ; 0x0f 31e34: c7 01 movw r24, r14 31e36: b6 01 movw r22, r12 31e38: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31e3c: 9b 01 movw r18, r22 31e3e: ac 01 movw r20, r24 31e40: c5 01 movw r24, r10 31e42: b4 01 movw r22, r8 31e44: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 31e48: f8 01 movw r30, r16 31e4a: 64 83 std Z+4, r22 ; 0x04 31e4c: 75 83 std Z+5, r23 ; 0x05 31e4e: 86 83 std Z+6, r24 ; 0x06 31e50: 97 83 std Z+7, r25 ; 0x07 } 31e52: df 91 pop r29 31e54: cf 91 pop r28 31e56: 1f 91 pop r17 31e58: 0f 91 pop r16 31e5a: ff 90 pop r15 31e5c: ef 90 pop r14 31e5e: df 90 pop r13 31e60: cf 90 pop r12 31e62: bf 90 pop r11 31e64: af 90 pop r10 31e66: 9f 90 pop r9 31e68: 8f 90 pop r8 31e6a: 7f 90 pop r7 31e6c: 6f 90 pop r6 31e6e: 5f 90 pop r5 31e70: 4f 90 pop r4 31e72: 08 95 ret 00031e74 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 31e74: 4f 92 push r4 31e76: 5f 92 push r5 31e78: 6f 92 push r6 31e7a: 7f 92 push r7 31e7c: 8f 92 push r8 31e7e: 9f 92 push r9 31e80: af 92 push r10 31e82: bf 92 push r11 31e84: cf 92 push r12 31e86: df 92 push r13 31e88: ef 92 push r14 31e8a: ff 92 push r15 31e8c: 0f 93 push r16 31e8e: 1f 93 push r17 31e90: cf 93 push r28 31e92: df 93 push r29 31e94: 00 d0 rcall .+0 ; 0x31e96 31e96: 00 d0 rcall .+0 ; 0x31e98 31e98: 1f 92 push r1 31e9a: 1f 92 push r1 31e9c: cd b7 in r28, 0x3d ; 61 31e9e: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 31ea0: dc 01 movw r26, r24 31ea2: cd 90 ld r12, X+ 31ea4: dd 90 ld r13, X+ 31ea6: ed 90 ld r14, X+ 31ea8: fc 90 ld r15, X 31eaa: 13 97 sbiw r26, 0x03 ; 3 31eac: c0 92 a9 16 sts 0x16A9, r12 ; 0x8016a9 31eb0: d0 92 aa 16 sts 0x16AA, r13 ; 0x8016aa 31eb4: e0 92 ab 16 sts 0x16AB, r14 ; 0x8016ab 31eb8: f0 92 ac 16 sts 0x16AC, r15 ; 0x8016ac world2machine_rotation_and_skew[1][0] = vec_x[1]; 31ebc: 14 96 adiw r26, 0x04 ; 4 31ebe: 0d 91 ld r16, X+ 31ec0: 1d 91 ld r17, X+ 31ec2: 2d 91 ld r18, X+ 31ec4: 3c 91 ld r19, X 31ec6: 17 97 sbiw r26, 0x07 ; 7 31ec8: 09 83 std Y+1, r16 ; 0x01 31eca: 1a 83 std Y+2, r17 ; 0x02 31ecc: 2b 83 std Y+3, r18 ; 0x03 31ece: 3c 83 std Y+4, r19 ; 0x04 31ed0: 00 93 b1 16 sts 0x16B1, r16 ; 0x8016b1 31ed4: 10 93 b2 16 sts 0x16B2, r17 ; 0x8016b2 31ed8: 20 93 b3 16 sts 0x16B3, r18 ; 0x8016b3 31edc: 30 93 b4 16 sts 0x16B4, r19 ; 0x8016b4 world2machine_rotation_and_skew[0][1] = vec_y[0]; 31ee0: db 01 movw r26, r22 31ee2: 0d 91 ld r16, X+ 31ee4: 1d 91 ld r17, X+ 31ee6: 2d 91 ld r18, X+ 31ee8: 3c 91 ld r19, X 31eea: 13 97 sbiw r26, 0x03 ; 3 31eec: 0d 83 std Y+5, r16 ; 0x05 31eee: 1e 83 std Y+6, r17 ; 0x06 31ef0: 2f 83 std Y+7, r18 ; 0x07 31ef2: 38 87 std Y+8, r19 ; 0x08 31ef4: 00 93 ad 16 sts 0x16AD, r16 ; 0x8016ad 31ef8: 10 93 ae 16 sts 0x16AE, r17 ; 0x8016ae 31efc: 20 93 af 16 sts 0x16AF, r18 ; 0x8016af 31f00: 30 93 b0 16 sts 0x16B0, r19 ; 0x8016b0 world2machine_rotation_and_skew[1][1] = vec_y[1]; 31f04: 14 96 adiw r26, 0x04 ; 4 31f06: 4d 90 ld r4, X+ 31f08: 5d 90 ld r5, X+ 31f0a: 6d 90 ld r6, X+ 31f0c: 7c 90 ld r7, X 31f0e: 17 97 sbiw r26, 0x07 ; 7 31f10: 40 92 b5 16 sts 0x16B5, r4 ; 0x8016b5 31f14: 50 92 b6 16 sts 0x16B6, r5 ; 0x8016b6 31f18: 60 92 b7 16 sts 0x16B7, r6 ; 0x8016b7 31f1c: 70 92 b8 16 sts 0x16B8, r7 ; 0x8016b8 world2machine_shift[0] = cntr[0]; 31f20: fa 01 movw r30, r20 31f22: 60 81 ld r22, Z 31f24: 71 81 ldd r23, Z+1 ; 0x01 31f26: 82 81 ldd r24, Z+2 ; 0x02 31f28: 93 81 ldd r25, Z+3 ; 0x03 31f2a: 60 93 d4 16 sts 0x16D4, r22 ; 0x8016d4 31f2e: 70 93 d5 16 sts 0x16D5, r23 ; 0x8016d5 31f32: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 31f36: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 world2machine_shift[1] = cntr[1]; 31f3a: 84 80 ldd r8, Z+4 ; 0x04 31f3c: 95 80 ldd r9, Z+5 ; 0x05 31f3e: a6 80 ldd r10, Z+6 ; 0x06 31f40: b7 80 ldd r11, Z+7 ; 0x07 31f42: 80 92 d8 16 sts 0x16D8, r8 ; 0x8016d8 31f46: 90 92 d9 16 sts 0x16D9, r9 ; 0x8016d9 31f4a: a0 92 da 16 sts 0x16DA, r10 ; 0x8016da 31f4e: 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) 31f52: 20 e0 ldi r18, 0x00 ; 0 31f54: 30 e0 ldi r19, 0x00 ; 0 31f56: a9 01 movw r20, r18 31f58: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31f5c: 81 11 cpse r24, r1 31f5e: aa c0 rjmp .+340 ; 0x320b4 31f60: 20 e0 ldi r18, 0x00 ; 0 31f62: 30 e0 ldi r19, 0x00 ; 0 31f64: a9 01 movw r20, r18 31f66: c5 01 movw r24, r10 31f68: b4 01 movw r22, r8 31f6a: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31f6e: 81 11 cpse r24, r1 31f70: a1 c0 rjmp .+322 ; 0x320b4 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; 31f72: 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 || 31f76: 20 e0 ldi r18, 0x00 ; 0 31f78: 30 e0 ldi r19, 0x00 ; 0 31f7a: 40 e8 ldi r20, 0x80 ; 128 31f7c: 5f e3 ldi r21, 0x3F ; 63 31f7e: c7 01 movw r24, r14 31f80: b6 01 movw r22, r12 31f82: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31f86: 81 11 cpse r24, r1 31f88: 21 c0 rjmp .+66 ; 0x31fcc 31f8a: 20 e0 ldi r18, 0x00 ; 0 31f8c: 30 e0 ldi r19, 0x00 ; 0 31f8e: a9 01 movw r20, r18 31f90: 6d 81 ldd r22, Y+5 ; 0x05 31f92: 7e 81 ldd r23, Y+6 ; 0x06 31f94: 8f 81 ldd r24, Y+7 ; 0x07 31f96: 98 85 ldd r25, Y+8 ; 0x08 31f98: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31f9c: 81 11 cpse r24, r1 31f9e: 16 c0 rjmp .+44 ; 0x31fcc 31fa0: 20 e0 ldi r18, 0x00 ; 0 31fa2: 30 e0 ldi r19, 0x00 ; 0 31fa4: a9 01 movw r20, r18 31fa6: 69 81 ldd r22, Y+1 ; 0x01 31fa8: 7a 81 ldd r23, Y+2 ; 0x02 31faa: 8b 81 ldd r24, Y+3 ; 0x03 31fac: 9c 81 ldd r25, Y+4 ; 0x04 31fae: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31fb2: 81 11 cpse r24, r1 31fb4: 0b c0 rjmp .+22 ; 0x31fcc world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 31fb6: 20 e0 ldi r18, 0x00 ; 0 31fb8: 30 e0 ldi r19, 0x00 ; 0 31fba: 40 e8 ldi r20, 0x80 ; 128 31fbc: 5f e3 ldi r21, 0x3F ; 63 31fbe: c3 01 movw r24, r6 31fc0: b2 01 movw r22, r4 31fc2: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 31fc6: 88 23 and r24, r24 31fc8: 09 f4 brne .+2 ; 0x31fcc 31fca: 78 c0 rjmp .+240 ; 0x320bc // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 31fcc: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31fd0: 82 60 ori r24, 0x02 ; 2 31fd2: 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]; 31fd6: a3 01 movw r20, r6 31fd8: 92 01 movw r18, r4 31fda: c7 01 movw r24, r14 31fdc: b6 01 movw r22, r12 31fde: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31fe2: 4b 01 movw r8, r22 31fe4: 5c 01 movw r10, r24 31fe6: 2d 81 ldd r18, Y+5 ; 0x05 31fe8: 3e 81 ldd r19, Y+6 ; 0x06 31fea: 4f 81 ldd r20, Y+7 ; 0x07 31fec: 58 85 ldd r21, Y+8 ; 0x08 31fee: 69 81 ldd r22, Y+1 ; 0x01 31ff0: 7a 81 ldd r23, Y+2 ; 0x02 31ff2: 8b 81 ldd r24, Y+3 ; 0x03 31ff4: 9c 81 ldd r25, Y+4 ; 0x04 31ff6: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 31ffa: 9b 01 movw r18, r22 31ffc: ac 01 movw r20, r24 31ffe: c5 01 movw r24, r10 32000: b4 01 movw r22, r8 32002: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 32006: 4b 01 movw r8, r22 32008: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 3200a: ac 01 movw r20, r24 3200c: 9b 01 movw r18, r22 3200e: c3 01 movw r24, r6 32010: b2 01 movw r22, r4 32012: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 32016: 60 93 c4 16 sts 0x16C4, r22 ; 0x8016c4 3201a: 70 93 c5 16 sts 0x16C5, r23 ; 0x8016c5 3201e: 80 93 c6 16 sts 0x16C6, r24 ; 0x8016c6 32022: 90 93 c7 16 sts 0x16C7, r25 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 32026: 6d 81 ldd r22, Y+5 ; 0x05 32028: 7e 81 ldd r23, Y+6 ; 0x06 3202a: 8f 81 ldd r24, Y+7 ; 0x07 3202c: 98 85 ldd r25, Y+8 ; 0x08 3202e: 90 58 subi r25, 0x80 ; 128 32030: a5 01 movw r20, r10 32032: 94 01 movw r18, r8 32034: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 32038: 60 93 c8 16 sts 0x16C8, r22 ; 0x8016c8 3203c: 70 93 c9 16 sts 0x16C9, r23 ; 0x8016c9 32040: 80 93 ca 16 sts 0x16CA, r24 ; 0x8016ca 32044: 90 93 cb 16 sts 0x16CB, r25 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 32048: 69 81 ldd r22, Y+1 ; 0x01 3204a: 7a 81 ldd r23, Y+2 ; 0x02 3204c: 8b 81 ldd r24, Y+3 ; 0x03 3204e: 9c 81 ldd r25, Y+4 ; 0x04 32050: 90 58 subi r25, 0x80 ; 128 32052: a5 01 movw r20, r10 32054: 94 01 movw r18, r8 32056: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 3205a: 60 93 cc 16 sts 0x16CC, r22 ; 0x8016cc 3205e: 70 93 cd 16 sts 0x16CD, r23 ; 0x8016cd 32062: 80 93 ce 16 sts 0x16CE, r24 ; 0x8016ce 32066: 90 93 cf 16 sts 0x16CF, r25 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 3206a: a5 01 movw r20, r10 3206c: 94 01 movw r18, r8 3206e: c7 01 movw r24, r14 32070: b6 01 movw r22, r12 32072: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__divsf3> 32076: 60 93 d0 16 sts 0x16D0, r22 ; 0x8016d0 3207a: 70 93 d1 16 sts 0x16D1, r23 ; 0x8016d1 3207e: 80 93 d2 16 sts 0x16D2, r24 ; 0x8016d2 32082: 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; } } 32086: 28 96 adiw r28, 0x08 ; 8 32088: 0f b6 in r0, 0x3f ; 63 3208a: f8 94 cli 3208c: de bf out 0x3e, r29 ; 62 3208e: 0f be out 0x3f, r0 ; 63 32090: cd bf out 0x3d, r28 ; 61 32092: df 91 pop r29 32094: cf 91 pop r28 32096: 1f 91 pop r17 32098: 0f 91 pop r16 3209a: ff 90 pop r15 3209c: ef 90 pop r14 3209e: df 90 pop r13 320a0: cf 90 pop r12 320a2: bf 90 pop r11 320a4: af 90 pop r10 320a6: 9f 90 pop r9 320a8: 8f 90 pop r8 320aa: 7f 90 pop r7 320ac: 6f 90 pop r6 320ae: 5f 90 pop r5 320b0: 4f 90 pop r4 320b2: 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; 320b4: 81 e0 ldi r24, 0x01 ; 1 320b6: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc 320ba: 5d cf rjmp .-326 ; 0x31f76 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; 320bc: 80 e0 ldi r24, 0x00 ; 0 320be: 90 e0 ldi r25, 0x00 ; 0 320c0: a0 e8 ldi r26, 0x80 ; 128 320c2: bf e3 ldi r27, 0x3F ; 63 320c4: 80 93 c4 16 sts 0x16C4, r24 ; 0x8016c4 320c8: 90 93 c5 16 sts 0x16C5, r25 ; 0x8016c5 320cc: a0 93 c6 16 sts 0x16C6, r26 ; 0x8016c6 320d0: b0 93 c7 16 sts 0x16C7, r27 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = 0.f; 320d4: 10 92 c8 16 sts 0x16C8, r1 ; 0x8016c8 320d8: 10 92 c9 16 sts 0x16C9, r1 ; 0x8016c9 320dc: 10 92 ca 16 sts 0x16CA, r1 ; 0x8016ca 320e0: 10 92 cb 16 sts 0x16CB, r1 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = 0.f; 320e4: 10 92 cc 16 sts 0x16CC, r1 ; 0x8016cc 320e8: 10 92 cd 16 sts 0x16CD, r1 ; 0x8016cd 320ec: 10 92 ce 16 sts 0x16CE, r1 ; 0x8016ce 320f0: 10 92 cf 16 sts 0x16CF, r1 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = 1.f; 320f4: 80 93 d0 16 sts 0x16D0, r24 ; 0x8016d0 320f8: 90 93 d1 16 sts 0x16D1, r25 ; 0x8016d1 320fc: a0 93 d2 16 sts 0x16D2, r26 ; 0x8016d2 32100: b0 93 d3 16 sts 0x16D3, r27 ; 0x8016d3 32104: c0 cf rjmp .-128 ; 0x32086 00032106 : * * 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() { 32106: cf 93 push r28 32108: df 93 push r29 3210a: cd b7 in r28, 0x3d ; 61 3210c: de b7 in r29, 0x3e ; 62 3210e: 68 97 sbiw r28, 0x18 ; 24 32110: 0f b6 in r0, 0x3f ; 63 32112: f8 94 cli 32114: de bf out 0x3e, r29 ; 62 32116: 0f be out 0x3f, r0 ; 63 32118: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 3211a: 80 e0 ldi r24, 0x00 ; 0 3211c: 90 e0 ldi r25, 0x00 ; 0 3211e: a0 e8 ldi r26, 0x80 ; 128 32120: bf e3 ldi r27, 0x3F ; 63 32122: 89 83 std Y+1, r24 ; 0x01 32124: 9a 83 std Y+2, r25 ; 0x02 32126: ab 83 std Y+3, r26 ; 0x03 32128: bc 83 std Y+4, r27 ; 0x04 3212a: 1d 82 std Y+5, r1 ; 0x05 3212c: 1e 82 std Y+6, r1 ; 0x06 3212e: 1f 82 std Y+7, r1 ; 0x07 32130: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 32132: 19 86 std Y+9, r1 ; 0x09 32134: 1a 86 std Y+10, r1 ; 0x0a 32136: 1b 86 std Y+11, r1 ; 0x0b 32138: 1c 86 std Y+12, r1 ; 0x0c 3213a: 8d 87 std Y+13, r24 ; 0x0d 3213c: 9e 87 std Y+14, r25 ; 0x0e 3213e: af 87 std Y+15, r26 ; 0x0f 32140: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 32142: 19 8a std Y+17, r1 ; 0x11 32144: 1a 8a std Y+18, r1 ; 0x12 32146: 1b 8a std Y+19, r1 ; 0x13 32148: 1c 8a std Y+20, r1 ; 0x14 3214a: 1d 8a std Y+21, r1 ; 0x15 3214c: 1e 8a std Y+22, r1 ; 0x16 3214e: 1f 8a std Y+23, r1 ; 0x17 32150: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 32152: ae 01 movw r20, r28 32154: 4f 5e subi r20, 0xEF ; 239 32156: 5f 4f sbci r21, 0xFF ; 255 32158: be 01 movw r22, r28 3215a: 67 5f subi r22, 0xF7 ; 247 3215c: 7f 4f sbci r23, 0xFF ; 255 3215e: ce 01 movw r24, r28 32160: 01 96 adiw r24, 0x01 ; 1 32162: 0f 94 3a 8f call 0x31e74 ; 0x31e74 } 32166: 68 96 adiw r28, 0x18 ; 24 32168: 0f b6 in r0, 0x3f ; 63 3216a: f8 94 cli 3216c: de bf out 0x3e, r29 ; 62 3216e: 0f be out 0x3f, r0 ; 63 32170: cd bf out 0x3d, r28 ; 61 32172: df 91 pop r29 32174: cf 91 pop r28 32176: 08 95 ret 00032178 : * * 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) { 32178: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 3217c: 88 23 and r24, r24 3217e: d1 f0 breq .+52 ; 0x321b4 world2machine_reset(); 32180: 0f 94 83 90 call 0x32106 ; 0x32106 st_synchronize(); 32184: 0f 94 a0 22 call 0x24540 ; 0x24540 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 32188: 80 e0 ldi r24, 0x00 ; 0 3218a: 0f 94 8c 22 call 0x24518 ; 0x24518 3218e: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 32192: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 32196: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 3219a: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 3219e: 81 e0 ldi r24, 0x01 ; 1 321a0: 0f 94 8c 22 call 0x24518 ; 0x24518 321a4: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 321a8: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 321ac: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 321b0: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } } 321b4: 08 95 ret 000321b6 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 321b6: 4f ef ldi r20, 0xFF ; 255 321b8: 5f ef ldi r21, 0xFF ; 255 321ba: ba 01 movw r22, r20 321bc: 85 ee ldi r24, 0xE5 ; 229 321be: 9f e0 ldi r25, 0x0F ; 15 321c0: 0f 94 72 a1 call 0x342e4 ; 0x342e4 321c4: 4f ef ldi r20, 0xFF ; 255 321c6: 5f ef ldi r21, 0xFF ; 255 321c8: ba 01 movw r22, r20 321ca: 89 ee ldi r24, 0xE9 ; 233 321cc: 9f e0 ldi r25, 0x0F ; 15 321ce: 0f 94 72 a1 call 0x342e4 ; 0x342e4 321d2: 4f ef ldi r20, 0xFF ; 255 321d4: 5f ef ldi r21, 0xFF ; 255 321d6: ba 01 movw r22, r20 321d8: 8d ed ldi r24, 0xDD ; 221 321da: 9f e0 ldi r25, 0x0F ; 15 321dc: 0f 94 72 a1 call 0x342e4 ; 0x342e4 321e0: 4f ef ldi r20, 0xFF ; 255 321e2: 5f ef ldi r21, 0xFF ; 255 321e4: ba 01 movw r22, r20 321e6: 81 ee ldi r24, 0xE1 ; 225 321e8: 9f e0 ldi r25, 0x0F ; 15 321ea: 0f 94 72 a1 call 0x342e4 ; 0x342e4 321ee: 4f ef ldi r20, 0xFF ; 255 321f0: 5f ef ldi r21, 0xFF ; 255 321f2: ba 01 movw r22, r20 321f4: 85 ed ldi r24, 0xD5 ; 213 321f6: 9f e0 ldi r25, 0x0F ; 15 321f8: 0f 94 72 a1 call 0x342e4 ; 0x342e4 321fc: 4f ef ldi r20, 0xFF ; 255 321fe: 5f ef ldi r21, 0xFF ; 255 32200: ba 01 movw r22, r20 32202: 89 ed ldi r24, 0xD9 ; 217 32204: 9f e0 ldi r25, 0x0F ; 15 32206: 0f 94 72 a1 call 0x342e4 ; 0x342e4 3220a: 4f ef ldi r20, 0xFF ; 255 3220c: 5f ef ldi r21, 0xFF ; 255 3220e: ba 01 movw r22, r20 32210: 85 ec ldi r24, 0xC5 ; 197 32212: 9f e0 ldi r25, 0x0F ; 15 32214: 0f 94 72 a1 call 0x342e4 ; 0x342e4 32218: 4f ef ldi r20, 0xFF ; 255 3221a: 5f ef ldi r21, 0xFF ; 255 3221c: ba 01 movw r22, r20 3221e: 89 ec ldi r24, 0xC9 ; 201 32220: 9f e0 ldi r25, 0x0F ; 15 32222: 0f 94 72 a1 call 0x342e4 ; 0x342e4 32226: 4f ef ldi r20, 0xFF ; 255 32228: 5f ef ldi r21, 0xFF ; 255 3222a: ba 01 movw r22, r20 3222c: 8d ec ldi r24, 0xCD ; 205 3222e: 9f e0 ldi r25, 0x0F ; 15 32230: 0f 94 72 a1 call 0x342e4 ; 0x342e4 32234: 4f ef ldi r20, 0xFF ; 255 32236: 5f ef ldi r21, 0xFF ; 255 32238: ba 01 movw r22, r20 3223a: 81 ed ldi r24, 0xD1 ; 209 3223c: 9f e0 ldi r25, 0x0F ; 15 3223e: 0d 94 72 a1 jmp 0x342e4 ; 0x342e4 00032242 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 32242: 4f 92 push r4 32244: 5f 92 push r5 32246: 6f 92 push r6 32248: 7f 92 push r7 3224a: 8f 92 push r8 3224c: 9f 92 push r9 3224e: af 92 push r10 32250: bf 92 push r11 32252: cf 92 push r12 32254: df 92 push r13 32256: ef 92 push r14 32258: ff 92 push r15 3225a: 1f 93 push r17 3225c: cf 93 push r28 3225e: df 93 push r29 32260: cd b7 in r28, 0x3d ; 61 32262: de b7 in r29, 0x3e ; 62 32264: a8 97 sbiw r28, 0x28 ; 40 32266: 0f b6 in r0, 0x3f ; 63 32268: f8 94 cli 3226a: de bf out 0x3e, r29 ; 62 3226c: 0f be out 0x3f, r0 ; 63 3226e: 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); 32270: 48 e0 ldi r20, 0x08 ; 8 32272: 50 e0 ldi r21, 0x00 ; 0 32274: 6d ed ldi r22, 0xDD ; 221 32276: 7f e0 ldi r23, 0x0F ; 15 32278: ce 01 movw r24, r28 3227a: 01 96 adiw r24, 0x01 ; 1 3227c: 0f 94 2c a1 call 0x34258 ; 0x34258 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 32280: 48 e0 ldi r20, 0x08 ; 8 32282: 50 e0 ldi r21, 0x00 ; 0 32284: 65 ed ldi r22, 0xD5 ; 213 32286: 7f e0 ldi r23, 0x0F ; 15 32288: ce 01 movw r24, r28 3228a: 09 96 adiw r24, 0x09 ; 9 3228c: 0f 94 2c a1 call 0x34258 ; 0x34258 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 32290: 48 e0 ldi r20, 0x08 ; 8 32292: 50 e0 ldi r21, 0x00 ; 0 32294: 65 ee ldi r22, 0xE5 ; 229 32296: 7f e0 ldi r23, 0x0F ; 15 32298: ce 01 movw r24, r28 3229a: 41 96 adiw r24, 0x11 ; 17 3229c: 0f 94 2c a1 call 0x34258 ; 0x34258 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 322a0: 89 89 ldd r24, Y+17 ; 0x11 322a2: 9a 89 ldd r25, Y+18 ; 0x12 322a4: ab 89 ldd r26, Y+19 ; 0x13 322a6: bc 89 ldd r27, Y+20 ; 0x14 322a8: 89 a3 std Y+33, r24 ; 0x21 322aa: 9a a3 std Y+34, r25 ; 0x22 322ac: ab a3 std Y+35, r26 ; 0x23 322ae: bc a3 std Y+36, r27 ; 0x24 322b0: 8f 3f cpi r24, 0xFF ; 255 322b2: 9f 4f sbci r25, 0xFF ; 255 322b4: af 4f sbci r26, 0xFF ; 255 322b6: bf 4f sbci r27, 0xFF ; 255 322b8: 09 f4 brne .+2 ; 0x322bc 322ba: b1 c0 rjmp .+354 ; 0x3241e 322bc: 8d 89 ldd r24, Y+21 ; 0x15 322be: 9e 89 ldd r25, Y+22 ; 0x16 322c0: af 89 ldd r26, Y+23 ; 0x17 322c2: b8 8d ldd r27, Y+24 ; 0x18 322c4: 8d a3 std Y+37, r24 ; 0x25 322c6: 9e a3 std Y+38, r25 ; 0x26 322c8: af a3 std Y+39, r26 ; 0x27 322ca: b8 a7 std Y+40, r27 ; 0x28 322cc: 8f 3f cpi r24, 0xFF ; 255 322ce: 9f 4f sbci r25, 0xFF ; 255 322d0: af 4f sbci r26, 0xFF ; 255 322d2: bf 4f sbci r27, 0xFF ; 255 322d4: 09 f4 brne .+2 ; 0x322d8 322d6: a3 c0 rjmp .+326 ; 0x3241e 322d8: 89 80 ldd r8, Y+1 ; 0x01 322da: 9a 80 ldd r9, Y+2 ; 0x02 322dc: ab 80 ldd r10, Y+3 ; 0x03 322de: bc 80 ldd r11, Y+4 ; 0x04 322e0: 8f ef ldi r24, 0xFF ; 255 322e2: 88 16 cp r8, r24 322e4: 98 06 cpc r9, r24 322e6: a8 06 cpc r10, r24 322e8: b8 06 cpc r11, r24 322ea: 09 f4 brne .+2 ; 0x322ee 322ec: 98 c0 rjmp .+304 ; 0x3241e 322ee: 8d 81 ldd r24, Y+5 ; 0x05 322f0: 9e 81 ldd r25, Y+6 ; 0x06 322f2: af 81 ldd r26, Y+7 ; 0x07 322f4: b8 85 ldd r27, Y+8 ; 0x08 322f6: 89 8f std Y+25, r24 ; 0x19 322f8: 9a 8f std Y+26, r25 ; 0x1a 322fa: ab 8f std Y+27, r26 ; 0x1b 322fc: bc 8f std Y+28, r27 ; 0x1c 322fe: 8f 3f cpi r24, 0xFF ; 255 32300: 9f 4f sbci r25, 0xFF ; 255 32302: af 4f sbci r26, 0xFF ; 255 32304: bf 4f sbci r27, 0xFF ; 255 32306: 09 f4 brne .+2 ; 0x3230a 32308: 8a c0 rjmp .+276 ; 0x3241e 3230a: c9 84 ldd r12, Y+9 ; 0x09 3230c: da 84 ldd r13, Y+10 ; 0x0a 3230e: eb 84 ldd r14, Y+11 ; 0x0b 32310: fc 84 ldd r15, Y+12 ; 0x0c 32312: 8f ef ldi r24, 0xFF ; 255 32314: c8 16 cp r12, r24 32316: d8 06 cpc r13, r24 32318: e8 06 cpc r14, r24 3231a: f8 06 cpc r15, r24 3231c: 09 f4 brne .+2 ; 0x32320 3231e: 7f c0 rjmp .+254 ; 0x3241e 32320: 8d 85 ldd r24, Y+13 ; 0x0d 32322: 9e 85 ldd r25, Y+14 ; 0x0e 32324: af 85 ldd r26, Y+15 ; 0x0f 32326: b8 89 ldd r27, Y+16 ; 0x10 32328: 8d 8f std Y+29, r24 ; 0x1d 3232a: 9e 8f std Y+30, r25 ; 0x1e 3232c: af 8f std Y+31, r26 ; 0x1f 3232e: b8 a3 std Y+32, r27 ; 0x20 32330: 8f 3f cpi r24, 0xFF ; 255 32332: 9f 4f sbci r25, 0xFF ; 255 32334: af 4f sbci r26, 0xFF ; 255 32336: bf 4f sbci r27, 0xFF ; 255 32338: 09 f4 brne .+2 ; 0x3233c 3233a: 71 c0 rjmp .+226 ; 0x3241e reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 3233c: 29 8d ldd r18, Y+25 ; 0x19 3233e: 3a 8d ldd r19, Y+26 ; 0x1a 32340: 4b 8d ldd r20, Y+27 ; 0x1b 32342: 5c 8d ldd r21, Y+28 ; 0x1c 32344: c5 01 movw r24, r10 32346: b4 01 movw r22, r8 32348: 0f 94 00 a5 call 0x34a00 ; 0x34a00 3234c: 2b 01 movw r4, r22 3234e: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 32350: 26 e6 ldi r18, 0x66 ; 102 32352: 36 e6 ldi r19, 0x66 ; 102 32354: 46 e6 ldi r20, 0x66 ; 102 32356: 5f e3 ldi r21, 0x3F ; 63 32358: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__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; 3235c: 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) 3235e: 87 fd sbrc r24, 7 32360: 0b c0 rjmp .+22 ; 0x32378 32362: 2d ec ldi r18, 0xCD ; 205 32364: 3c ec ldi r19, 0xCC ; 204 32366: 4c e8 ldi r20, 0x8C ; 140 32368: 5f e3 ldi r21, 0x3F ; 63 3236a: c3 01 movw r24, r6 3236c: b2 01 movw r22, r4 3236e: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 32372: 18 16 cp r1, r24 32374: 0c f0 brlt .+2 ; 0x32378 32376: 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]); 32378: 2d 8d ldd r18, Y+29 ; 0x1d 3237a: 3e 8d ldd r19, Y+30 ; 0x1e 3237c: 4f 8d ldd r20, Y+31 ; 0x1f 3237e: 58 a1 ldd r21, Y+32 ; 0x20 32380: c7 01 movw r24, r14 32382: b6 01 movw r22, r12 32384: 0f 94 00 a5 call 0x34a00 ; 0x34a00 32388: 2b 01 movw r4, r22 3238a: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 3238c: 26 e6 ldi r18, 0x66 ; 102 3238e: 36 e6 ldi r19, 0x66 ; 102 32390: 46 e6 ldi r20, 0x66 ; 102 32392: 5f e3 ldi r21, 0x3F ; 63 32394: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 32398: 87 fd sbrc r24, 7 3239a: 7f c0 rjmp .+254 ; 0x3249a 3239c: 2d ec ldi r18, 0xCD ; 205 3239e: 3c ec ldi r19, 0xCC ; 204 323a0: 4c e8 ldi r20, 0x8C ; 140 323a2: 5f e3 ldi r21, 0x3F ; 63 323a4: c3 01 movw r24, r6 323a6: b2 01 movw r22, r4 323a8: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 323ac: 18 16 cp r1, r24 323ae: 0c f4 brge .+2 ; 0x323b2 323b0: 74 c0 rjmp .+232 ; 0x3249a 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]); 323b2: 2d a1 ldd r18, Y+37 ; 0x25 323b4: 3e a1 ldd r19, Y+38 ; 0x26 323b6: 4f a1 ldd r20, Y+39 ; 0x27 323b8: 58 a5 ldd r21, Y+40 ; 0x28 323ba: 69 a1 ldd r22, Y+33 ; 0x21 323bc: 7a a1 ldd r23, Y+34 ; 0x22 323be: 8b a1 ldd r24, Y+35 ; 0x23 323c0: 9c a1 ldd r25, Y+36 ; 0x24 323c2: 0f 94 00 a5 call 0x34a00 ; 0x34a00 if (l > 15.f) 323c6: 20 e0 ldi r18, 0x00 ; 0 323c8: 30 e0 ldi r19, 0x00 ; 0 323ca: 40 e7 ldi r20, 0x70 ; 112 323cc: 51 e4 ldi r21, 0x41 ; 65 323ce: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 323d2: 18 16 cp r1, r24 323d4: 0c f4 brge .+2 ; 0x323d8 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 323d6: 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]; 323d8: a5 01 movw r20, r10 323da: 94 01 movw r18, r8 323dc: c7 01 movw r24, r14 323de: b6 01 movw r22, r12 323e0: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 323e4: 6b 01 movw r12, r22 323e6: 7c 01 movw r14, r24 323e8: 2d 8d ldd r18, Y+29 ; 0x1d 323ea: 3e 8d ldd r19, Y+30 ; 0x1e 323ec: 4f 8d ldd r20, Y+31 ; 0x1f 323ee: 58 a1 ldd r21, Y+32 ; 0x20 323f0: 69 8d ldd r22, Y+25 ; 0x19 323f2: 7a 8d ldd r23, Y+26 ; 0x1a 323f4: 8b 8d ldd r24, Y+27 ; 0x1b 323f6: 9c 8d ldd r25, Y+28 ; 0x1c 323f8: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 323fc: 9b 01 movw r18, r22 323fe: ac 01 movw r20, r24 32400: c7 01 movw r24, r14 32402: b6 01 movw r22, r12 32404: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> if (fabs(l) > 0.1f) 32408: 9f 77 andi r25, 0x7F ; 127 3240a: 2d ec ldi r18, 0xCD ; 205 3240c: 3c ec ldi r19, 0xCC ; 204 3240e: 4c ec ldi r20, 0xCC ; 204 32410: 5d e3 ldi r21, 0x3D ; 61 32412: 0f 94 ed a4 call 0x349da ; 0x349da <__gesf2> 32416: 18 16 cp r1, r24 32418: 14 f0 brlt .+4 ; 0x3241e #endif reset = true; } } if (reset) 3241a: 11 23 and r17, r17 3241c: f1 f0 breq .+60 ; 0x3245a { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 3241e: 0f 94 db 90 call 0x321b6 ; 0x321b6 * @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; 32422: 80 e0 ldi r24, 0x00 ; 0 32424: 90 e0 ldi r25, 0x00 ; 0 32426: a0 e8 ldi r26, 0x80 ; 128 32428: bf e3 ldi r27, 0x3F ; 63 3242a: 89 83 std Y+1, r24 ; 0x01 3242c: 9a 83 std Y+2, r25 ; 0x02 3242e: ab 83 std Y+3, r26 ; 0x03 32430: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 32432: 1d 82 std Y+5, r1 ; 0x05 32434: 1e 82 std Y+6, r1 ; 0x06 32436: 1f 82 std Y+7, r1 ; 0x07 32438: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 3243a: 19 86 std Y+9, r1 ; 0x09 3243c: 1a 86 std Y+10, r1 ; 0x0a 3243e: 1b 86 std Y+11, r1 ; 0x0b 32440: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 32442: 8d 87 std Y+13, r24 ; 0x0d 32444: 9e 87 std Y+14, r25 ; 0x0e 32446: af 87 std Y+15, r26 ; 0x0f 32448: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 3244a: 19 8a std Y+17, r1 ; 0x11 3244c: 1a 8a std Y+18, r1 ; 0x12 3244e: 1b 8a std Y+19, r1 ; 0x13 32450: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 32452: 1d 8a std Y+21, r1 ; 0x15 32454: 1e 8a std Y+22, r1 ; 0x16 32456: 1f 8a std Y+23, r1 ; 0x17 32458: 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); 3245a: ae 01 movw r20, r28 3245c: 4f 5e subi r20, 0xEF ; 239 3245e: 5f 4f sbci r21, 0xFF ; 255 32460: be 01 movw r22, r28 32462: 67 5f subi r22, 0xF7 ; 247 32464: 7f 4f sbci r23, 0xFF ; 255 32466: ce 01 movw r24, r28 32468: 01 96 adiw r24, 0x01 ; 1 3246a: 0f 94 3a 8f call 0x31e74 ; 0x31e74 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 3246e: a8 96 adiw r28, 0x28 ; 40 32470: 0f b6 in r0, 0x3f ; 63 32472: f8 94 cli 32474: de bf out 0x3e, r29 ; 62 32476: 0f be out 0x3f, r0 ; 63 32478: cd bf out 0x3d, r28 ; 61 3247a: df 91 pop r29 3247c: cf 91 pop r28 3247e: 1f 91 pop r17 32480: ff 90 pop r15 32482: ef 90 pop r14 32484: df 90 pop r13 32486: cf 90 pop r12 32488: bf 90 pop r11 3248a: af 90 pop r10 3248c: 9f 90 pop r9 3248e: 8f 90 pop r8 32490: 7f 90 pop r7 32492: 6f 90 pop r6 32494: 5f 90 pop r5 32496: 4f 90 pop r4 32498: 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; 3249a: 11 e0 ldi r17, 0x01 ; 1 3249c: 8a cf rjmp .-236 ; 0x323b2 0003249e : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 3249e: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 324a0: 24 e1 ldi r18, 0x14 ; 20 324a2: ac 01 movw r20, r24 324a4: 24 9f mul r18, r20 324a6: c0 01 movw r24, r0 324a8: 25 9f mul r18, r21 324aa: 90 0d add r25, r0 324ac: 11 24 eor r1, r1 324ae: 60 91 a7 16 lds r22, 0x16A7 ; 0x8016a7 324b2: 70 91 a8 16 lds r23, 0x16A8 ; 0x8016a8 324b6: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 324ba: c6 2f mov r28, r22 324bc: 65 31 cpi r22, 0x15 ; 21 324be: 08 f0 brcs .+2 ; 0x324c2 324c0: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 324c2: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 324c6: 8c 17 cp r24, r28 324c8: 48 f4 brcc .+18 ; 0x324dc } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 324ca: 8f ef ldi r24, 0xFF ; 255 324cc: 0e 94 ab 6a call 0xd556 ; 0xd556 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 324d0: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 324d4: 8f 5f subi r24, 0xFF ; 255 324d6: 80 93 a6 16 sts 0x16A6, r24 ; 0x8016a6 324da: f3 cf rjmp .-26 ; 0x324c2 } } 324dc: cf 91 pop r28 324de: 08 95 ret 000324e0 : void menu_progressbar_finish(void) { progressbar_total = 1; 324e0: 81 e0 ldi r24, 0x01 ; 1 324e2: 90 e0 ldi r25, 0x00 ; 0 324e4: 90 93 a8 16 sts 0x16A8, r25 ; 0x8016a8 324e8: 80 93 a7 16 sts 0x16A7, r24 ; 0x8016a7 menu_progressbar_update(1); 324ec: 0f 94 4f 92 call 0x3249e ; 0x3249e _delay(300); 324f0: 6c e2 ldi r22, 0x2C ; 44 324f2: 71 e0 ldi r23, 0x01 ; 1 324f4: 80 e0 ldi r24, 0x00 ; 0 324f6: 90 e0 ldi r25, 0x00 ; 0 324f8: 0d 94 d5 0d jmp 0x21baa ; 0x21baa 000324fc : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 324fc: 0f 93 push r16 324fe: 1f 93 push r17 32500: cf 93 push r28 32502: df 93 push r29 32504: 8c 01 movw r16, r24 32506: eb 01 movw r28, r22 lcd_clear(); 32508: 0e 94 2f 6a call 0xd45e ; 0xd45e progressbar_block_count = 0; 3250c: 10 92 a6 16 sts 0x16A6, r1 ; 0x8016a6 progressbar_total = total; 32510: 10 93 a8 16 sts 0x16A8, r17 ; 0x8016a8 32514: 00 93 a7 16 sts 0x16A7, r16 ; 0x8016a7 lcd_set_cursor(0, 1); 32518: 61 e0 ldi r22, 0x01 ; 1 3251a: 80 e0 ldi r24, 0x00 ; 0 3251c: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print_pad_P(title, LCD_WIDTH); 32520: 64 e1 ldi r22, 0x14 ; 20 32522: ce 01 movw r24, r28 32524: 0e 94 d1 6b call 0xd7a2 ; 0xd7a2 lcd_set_cursor(0, 2); 32528: 62 e0 ldi r22, 0x02 ; 2 3252a: 80 e0 ldi r24, 0x00 ; 0 } 3252c: df 91 pop r29 3252e: cf 91 pop r28 32530: 1f 91 pop r17 32532: 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); 32534: 0c 94 fc 69 jmp 0xd3f8 ; 0xd3f8 00032538 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 32538: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3253c: 90 91 30 04 lds r25, 0x0430 ; 0x800430 32540: 89 13 cpse r24, r25 32542: 0b c0 rjmp .+22 ; 0x3255a 32544: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 32548: 99 23 and r25, r25 3254a: 39 f0 breq .+14 ; 0x3255a 3254c: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32550: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32554: 82 17 cp r24, r18 32556: 13 06 cpc r1, r19 32558: 39 f0 breq .+14 ; 0x32568 3255a: 81 e0 ldi r24, 0x01 ; 1 3255c: 90 91 92 03 lds r25, 0x0392 ; 0x800392 32560: 91 11 cpse r25, r1 32562: 03 c0 rjmp .+6 ; 0x3256a 32564: 80 e0 ldi r24, 0x00 ; 0 32566: 08 95 ret 32568: 81 e0 ldi r24, 0x01 ; 1 } 3256a: 08 95 ret 0003256c : //! @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) { 3256c: 0f 93 push r16 3256e: 1f 93 push r17 32570: cf 93 push r28 32572: df 93 push r29 32574: 8c 01 movw r16, r24 32576: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 32578: 8b e5 ldi r24, 0x5B ; 91 3257a: 94 e4 ldi r25, 0x44 ; 68 3257c: 0e 94 32 6d call 0xda64 ; 0xda64 32580: 9f 93 push r25 32582: 8f 93 push r24 32584: 8d e8 ldi r24, 0x8D ; 141 32586: 9e e9 ldi r25, 0x9E ; 158 32588: 9f 93 push r25 3258a: 8f 93 push r24 3258c: df 93 push r29 3258e: cf 93 push r28 32590: 0f 94 53 a0 call 0x340a6 ; 0x340a6 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 32594: c8 0f add r28, r24 32596: d1 1d adc r29, r1 32598: 47 e0 ldi r20, 0x07 ; 7 3259a: 50 e0 ldi r21, 0x00 ; 0 3259c: b8 01 movw r22, r16 3259e: ce 01 movw r24, r28 325a0: 0f 94 2c a1 call 0x34258 ; 0x34258 //index += 7; buffer.c[index + 7] = '\0'; 325a4: 1f 82 std Y+7, r1 ; 0x07 325a6: 0f 90 pop r0 325a8: 0f 90 pop r0 325aa: 0f 90 pop r0 325ac: 0f 90 pop r0 325ae: 0f 90 pop r0 325b0: 0f 90 pop r0 } 325b2: df 91 pop r29 325b4: cf 91 pop r28 325b6: 1f 91 pop r17 325b8: 0f 91 pop r16 325ba: 08 95 ret 000325bc : 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)?'>':' '; 325bc: 20 91 31 04 lds r18, 0x0431 ; 0x800431 325c0: 80 91 06 05 lds r24, 0x0506 ; 0x800506 325c4: 90 91 07 05 lds r25, 0x0507 ; 0x800507 325c8: 28 17 cp r18, r24 325ca: 19 06 cpc r1, r25 325cc: 11 f0 breq .+4 ; 0x325d2 325ce: 80 e2 ldi r24, 0x20 ; 32 325d0: 08 95 ret 325d2: 8e e3 ldi r24, 0x3E ; 62 } 325d4: 08 95 ret 000325d6 : static void menu_draw_item_puts_P(char type_char, const char* str) { 325d6: 0f 93 push r16 325d8: 1f 93 push r17 325da: cf 93 push r28 325dc: c8 2f mov r28, r24 325de: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 325e0: 0f 94 de 92 call 0x325bc ; 0x325bc 325e4: 48 2f mov r20, r24 325e6: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 325ea: 80 e0 ldi r24, 0x00 ; 0 325ec: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_print_pad_P(str, LCD_WIDTH - 2); 325f0: 62 e1 ldi r22, 0x12 ; 18 325f2: c8 01 movw r24, r16 325f4: 0e 94 d1 6b call 0xd7a2 ; 0xd7a2 lcd_putc(type_char); 325f8: 8c 2f mov r24, r28 } 325fa: cf 91 pop r28 325fc: 1f 91 pop r17 325fe: 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); 32600: 0c 94 eb 69 jmp 0xd3d6 ; 0xd3d6 00032604 : } } void menu_item_ret(void) { lcd_draw_update = 2; 32604: 82 e0 ldi r24, 0x02 ; 2 32606: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_item++; 3260a: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3260e: 8f 5f subi r24, 0xFF ; 255 32610: 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 32614: 84 e0 ldi r24, 0x04 ; 4 32616: 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 3261a: 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 3261e: 10 92 2f 04 sts 0x042F, r1 ; 0x80042f } 32622: 08 95 ret 00032624 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 32624: cf 93 push r28 32626: df 93 push r29 if (menu_item == menu_line) 32628: 30 91 31 04 lds r19, 0x0431 ; 0x800431 3262c: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32630: 32 13 cpse r19, r18 32632: 20 c0 rjmp .+64 ; 0x32674 32634: eb 01 movw r28, r22 32636: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32638: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3263c: 88 23 and r24, r24 3263e: 19 f0 breq .+6 ; 0x32646 32640: 80 e2 ldi r24, 0x20 ; 32 32642: 0f 94 eb 92 call 0x325d6 ; 0x325d6 if (menu_clicked && (lcd_encoder == menu_item)) 32646: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 3264a: 88 23 and r24, r24 3264c: 99 f0 breq .+38 ; 0x32674 3264e: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32652: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32656: 90 91 07 05 lds r25, 0x0507 ; 0x800507 3265a: 28 17 cp r18, r24 3265c: 19 06 cpc r1, r25 3265e: 51 f4 brne .+20 ; 0x32674 { if (str_gcode) enquecommand_P(str_gcode); 32660: 20 97 sbiw r28, 0x00 ; 0 32662: 21 f0 breq .+8 ; 0x3266c 32664: 61 e0 ldi r22, 0x01 ; 1 32666: ce 01 movw r24, r28 32668: 0e 94 37 7d call 0xfa6e ; 0xfa6e menu_item_ret(); return; } } menu_item++; } 3266c: df 91 pop r29 3266e: 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(); 32670: 0d 94 02 93 jmp 0x32604 ; 0x32604 return; } } menu_item++; 32674: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32678: 8f 5f subi r24, 0xFF ; 255 3267a: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 3267e: df 91 pop r29 32680: cf 91 pop r28 32682: 08 95 ret 00032684 : //! @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) { 32684: ef 92 push r14 32686: ff 92 push r15 32688: 0f 93 push r16 3268a: 1f 93 push r17 3268c: cf 93 push r28 3268e: df 93 push r29 if (menu_item == menu_line) 32690: 70 91 31 04 lds r23, 0x0431 ; 0x800431 32694: 30 91 30 04 lds r19, 0x0430 ; 0x800430 32698: 73 13 cpse r23, r19 3269a: 3f c0 rjmp .+126 ; 0x3271a 3269c: 12 2f mov r17, r18 3269e: ea 01 movw r28, r20 326a0: 06 2f mov r16, r22 326a2: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 326a4: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 326a8: 88 23 and r24, r24 326aa: d1 f0 breq .+52 ; 0x326e0 } 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()); 326ac: 0f 94 de 92 call 0x325bc ; 0x325bc 326b0: 48 2f mov r20, r24 326b2: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 326b6: 80 e0 ldi r24, 0x00 ; 0 326b8: 0e 94 1c 6a call 0xd438 ; 0xd438 uint8_t len = lcd_print_pad_P(str, max_strlen); 326bc: 61 e1 ldi r22, 0x11 ; 17 326be: c7 01 movw r24, r14 326c0: 0e 94 d1 6b call 0xd7a2 ; 0xd7a2 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 326c4: 40 2f mov r20, r16 326c6: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 326ca: 93 e1 ldi r25, 0x13 ; 19 326cc: 98 1b sub r25, r24 326ce: 89 2f mov r24, r25 326d0: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 326d4: 40 e2 ldi r20, 0x20 ; 32 326d6: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 326da: 83 e1 ldi r24, 0x13 ; 19 326dc: 0e 94 1c 6a call 0xd438 ; 0xd438 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)) 326e0: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 326e4: 88 23 and r24, r24 326e6: c9 f0 breq .+50 ; 0x3271a 326e8: 20 91 31 04 lds r18, 0x0431 ; 0x800431 326ec: 80 91 06 05 lds r24, 0x0506 ; 0x800506 326f0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 326f4: 28 17 cp r18, r24 326f6: 19 06 cpc r1, r25 326f8: 81 f4 brne .+32 ; 0x3271a { lcd_update_enabled = 0; 326fa: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(fn_par); 326fe: 81 2f mov r24, r17 32700: fe 01 movw r30, r28 32702: 19 95 eicall lcd_update_enabled = 1; 32704: 81 e0 ldi r24, 0x01 ; 1 32706: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 3270a: df 91 pop r29 3270c: cf 91 pop r28 3270e: 1f 91 pop r17 32710: 0f 91 pop r16 32712: ff 90 pop r15 32714: 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(); 32716: 0d 94 02 93 jmp 0x32604 ; 0x32604 return; } } menu_item++; 3271a: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3271e: 8f 5f subi r24, 0xFF ; 255 32720: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32724: df 91 pop r29 32726: cf 91 pop r28 32728: 1f 91 pop r17 3272a: 0f 91 pop r16 3272c: ff 90 pop r15 3272e: ef 90 pop r14 32730: 08 95 ret 00032732 : 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) { 32732: cf 93 push r28 32734: df 93 push r29 if (menu_item == menu_line) 32736: 30 91 31 04 lds r19, 0x0431 ; 0x800431 3273a: 20 91 30 04 lds r18, 0x0430 ; 0x800430 3273e: 32 13 cpse r19, r18 32740: 21 c0 rjmp .+66 ; 0x32784 32742: eb 01 movw r28, r22 32744: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32746: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3274a: 88 23 and r24, r24 3274c: 19 f0 breq .+6 ; 0x32754 3274e: 80 e2 ldi r24, 0x20 ; 32 32750: 0f 94 eb 92 call 0x325d6 ; 0x325d6 if (menu_clicked && (lcd_encoder == menu_item)) 32754: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32758: 88 23 and r24, r24 3275a: a1 f0 breq .+40 ; 0x32784 3275c: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32760: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32764: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32768: 28 17 cp r18, r24 3276a: 19 06 cpc r1, r25 3276c: 59 f4 brne .+22 ; 0x32784 { lcd_update_enabled = 0; 3276e: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 32772: fe 01 movw r30, r28 32774: 19 95 eicall lcd_update_enabled = 1; 32776: 81 e0 ldi r24, 0x01 ; 1 32778: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 3277c: df 91 pop r29 3277e: 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(); 32780: 0d 94 02 93 jmp 0x32604 ; 0x32604 return; } } menu_item++; 32784: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32788: 8f 5f subi r24, 0xFF ; 255 3278a: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 3278e: df 91 pop r29 32790: cf 91 pop r28 32792: 08 95 ret 00032794 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 32794: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32798: 20 91 30 04 lds r18, 0x0430 ; 0x800430 3279c: 32 13 cpse r19, r18 3279e: 19 c0 rjmp .+50 ; 0x327d2 327a0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 327a2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 327a6: 88 23 and r24, r24 327a8: 19 f0 breq .+6 ; 0x327b0 327aa: 80 e2 ldi r24, 0x20 ; 32 327ac: 0f 94 eb 92 call 0x325d6 ; 0x325d6 if (menu_clicked && (lcd_encoder == menu_item)) 327b0: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 327b4: 88 23 and r24, r24 327b6: 69 f0 breq .+26 ; 0x327d2 327b8: 20 91 31 04 lds r18, 0x0431 ; 0x800431 327bc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 327c0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 327c4: 28 17 cp r18, r24 327c6: 19 06 cpc r1, r25 327c8: 21 f4 brne .+8 ; 0x327d2 { menu_item_ret(); 327ca: 0f 94 02 93 call 0x32604 ; 0x32604 return 1; 327ce: 81 e0 ldi r24, 0x01 ; 1 327d0: 08 95 ret } } menu_item++; 327d2: 80 91 31 04 lds r24, 0x0431 ; 0x800431 327d6: 8f 5f subi r24, 0xFF ; 255 327d8: 80 93 31 04 sts 0x0431, r24 ; 0x800431 return 0; 327dc: 80 e0 ldi r24, 0x00 ; 0 } 327de: 08 95 ret 000327e0 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 327e0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 327e4: 84 30 cpi r24, 0x04 ; 4 327e6: 38 f5 brcc .+78 ; 0x32836 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 327e8: 80 91 31 04 lds r24, 0x0431 ; 0x800431 327ec: 90 e0 ldi r25, 0x00 ; 0 327ee: 20 91 06 05 lds r18, 0x0506 ; 0x800506 327f2: 30 91 07 05 lds r19, 0x0507 ; 0x800507 327f6: 28 17 cp r18, r24 327f8: 39 07 cpc r19, r25 327fa: 44 f0 brlt .+16 ; 0x3280c { lcd_encoder = menu_item - 1; 327fc: 01 97 sbiw r24, 0x01 ; 1 327fe: 90 93 07 05 sts 0x0507, r25 ; 0x800507 32802: 80 93 06 05 sts 0x0506, r24 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 32806: 87 e0 ldi r24, 0x07 ; 7 32808: 0f 94 fd 2c call 0x259fa ; 0x259fa } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3280c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32810: 20 91 60 03 lds r18, 0x0360 ; 0x800360 32814: 30 e0 ldi r19, 0x00 ; 0 32816: 2d 5f subi r18, 0xFD ; 253 32818: 3f 4f sbci r19, 0xFF ; 255 3281a: 82 17 cp r24, r18 3281c: 13 06 cpc r1, r19 3281e: 59 f0 breq .+22 ; 0x32836 32820: 54 f0 brlt .+20 ; 0x32836 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 32822: 9d ef ldi r25, 0xFD ; 253 32824: 98 0f add r25, r24 32826: 90 93 60 03 sts 0x0360, r25 ; 0x800360 menu_line = menu_top - 1; 3282a: 84 50 subi r24, 0x04 ; 4 3282c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_row = -1; 32830: 8f ef ldi r24, 0xFF ; 255 32832: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e } } 32836: 08 95 ret 00032838 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 32838: 80 91 06 05 lds r24, 0x0506 ; 0x800506 3283c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32840: 97 ff sbrs r25, 7 32842: 07 c0 rjmp .+14 ; 0x32852 { lcd_encoder = 0; 32844: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32848: 10 92 06 05 sts 0x0506, r1 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3284c: 87 e0 ldi r24, 0x07 ; 7 3284e: 0f 94 fd 2c call 0x259fa ; 0x259fa } if (lcd_encoder < menu_top) 32852: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32856: 90 91 07 05 lds r25, 0x0507 ; 0x800507 3285a: 20 91 60 03 lds r18, 0x0360 ; 0x800360 3285e: 28 17 cp r18, r24 32860: 19 06 cpc r1, r25 32862: 19 f0 breq .+6 ; 0x3286a 32864: 14 f0 brlt .+4 ; 0x3286a menu_top = lcd_encoder; 32866: 80 93 60 03 sts 0x0360, r24 ; 0x800360 menu_line = menu_top; 3286a: 80 91 60 03 lds r24, 0x0360 ; 0x800360 3286e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_clicked = lcd_clicked(); // Consume click event 32872: 0e 94 19 6c call 0xd832 ; 0xd832 32876: 80 93 2f 04 sts 0x042F, r24 ; 0x80042f } 3287a: 08 95 ret 0003287c : 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)); 3287c: e4 e6 ldi r30, 0x64 ; 100 3287e: f3 e0 ldi r31, 0x03 ; 3 32880: 80 e2 ldi r24, 0x20 ; 32 32882: df 01 movw r26, r30 32884: 1d 92 st X+, r1 32886: 8a 95 dec r24 32888: e9 f7 brne .-6 ; 0x32884 } 3288a: 08 95 ret 0003288c : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3288c: cf 93 push r28 CRITICAL_SECTION_START; 3288e: 3f b7 in r19, 0x3f ; 63 32890: f8 94 cli if (menu_menu != menu) 32892: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 32896: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 3289a: e8 17 cp r30, r24 3289c: f9 07 cpc r31, r25 3289e: c9 f0 breq .+50 ; 0x328d2 328a0: c4 2f mov r28, r20 { menu_menu = menu; 328a2: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 328a6: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 lcd_encoder = encoder; 328aa: 70 93 07 05 sts 0x0507, r23 ; 0x800507 328ae: 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 328b2: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_draw_update = 2; // Full LCD re-draw 328b6: 82 e0 ldi r24, 0x02 ; 2 328b8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b CRITICAL_SECTION_END; 328bc: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 328be: 22 23 and r18, r18 328c0: 19 f0 breq .+6 ; 0x328c8 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 328c2: 80 e0 ldi r24, 0x00 ; 0 328c4: 0f 94 fd 2c call 0x259fa ; 0x259fa if (reset_menu_state) menu_data_reset(); 328c8: cc 23 and r28, r28 328ca: 21 f0 breq .+8 ; 0x328d4 } else CRITICAL_SECTION_END; } 328cc: 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(); 328ce: 0d 94 3e 94 jmp 0x3287c ; 0x3287c } else CRITICAL_SECTION_END; 328d2: 3f bf out 0x3f, r19 ; 63 } 328d4: cf 91 pop r28 328d6: 08 95 ret 000328d8 : 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) { 328d8: 7f 92 push r7 328da: 8f 92 push r8 328dc: 9f 92 push r9 328de: af 92 push r10 328e0: bf 92 push r11 328e2: cf 92 push r12 328e4: df 92 push r13 328e6: ef 92 push r14 328e8: ff 92 push r15 328ea: 0f 93 push r16 328ec: 1f 93 push r17 328ee: cf 93 push r28 328f0: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 328f2: e0 91 31 04 lds r30, 0x0431 ; 0x800431 328f6: 50 91 30 04 lds r21, 0x0430 ; 0x800430 328fa: e5 13 cpse r30, r21 328fc: 73 c0 rjmp .+230 ; 0x329e4 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 328fe: fb 01 movw r30, r22 32900: 48 30 cpi r20, 0x08 ; 8 32902: 09 f0 breq .+2 ; 0x32906 32904: 6c c0 rjmp .+216 ; 0x329de 32906: c0 81 ld r28, Z 32908: d0 e0 ldi r29, 0x00 ; 0 3290a: 49 01 movw r8, r18 3290c: 74 2e mov r7, r20 3290e: 6b 01 movw r12, r22 32910: 5c 01 movw r10, r24 if (lcd_draw_update) 32912: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32916: 88 23 and r24, r24 32918: 59 f0 breq .+22 ; 0x32930 { lcd_set_cursor(0, menu_row); 3291a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3291e: 80 e0 ldi r24, 0x00 ; 0 32920: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 menu_draw_P(menu_selection_mark(), str, cur_val); 32924: 0f 94 de 92 call 0x325bc ; 0x325bc 32928: ae 01 movw r20, r28 3292a: b5 01 movw r22, r10 3292c: 0f 94 7a 6f call 0x2def4 ; 0x2def4 } if (menu_clicked && (lcd_encoder == menu_item)) 32930: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32934: 88 23 and r24, r24 32936: 09 f4 brne .+2 ; 0x3293a 32938: 55 c0 rjmp .+170 ; 0x329e4 3293a: 90 91 31 04 lds r25, 0x0431 ; 0x800431 3293e: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32942: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32946: 92 17 cp r25, r18 32948: 13 06 cpc r1, r19 3294a: 09 f0 breq .+2 ; 0x3294e 3294c: 4b c0 rjmp .+150 ; 0x329e4 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3294e: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32952: 87 30 cpi r24, 0x07 ; 7 32954: d8 f4 brcc .+54 ; 0x3298c { menu_stack[menu_depth].menu = menu_menu; 32956: 28 2f mov r18, r24 32958: 30 e0 ldi r19, 0x00 ; 0 3295a: f9 01 movw r30, r18 3295c: ee 0f add r30, r30 3295e: ff 1f adc r31, r31 32960: e2 0f add r30, r18 32962: f3 1f adc r31, r19 32964: ef 56 subi r30, 0x6F ; 111 32966: f9 4e sbci r31, 0xE9 ; 233 32968: 20 91 d0 03 lds r18, 0x03D0 ; 0x8003d0 3296c: 30 91 d1 03 lds r19, 0x03D1 ; 0x8003d1 32970: 31 83 std Z+1, r19 ; 0x01 32972: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 32974: 8f 5f subi r24, 0xFF ; 255 32976: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 3297a: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3297c: 20 e0 ldi r18, 0x00 ; 0 3297e: 40 e0 ldi r20, 0x00 ; 0 32980: 70 e0 ldi r23, 0x00 ; 0 32982: 60 e0 ldi r22, 0x00 ; 0 32984: 8b e3 ldi r24, 0x3B ; 59 32986: 97 e3 ldi r25, 0x37 ; 55 32988: 0f 94 46 94 call 0x3288c ; 0x3288c 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; 3298c: b0 92 65 03 sts 0x0365, r11 ; 0x800365 32990: a0 92 64 03 sts 0x0364, r10 ; 0x800364 _md->editValuePtr = pval; 32994: d0 92 68 03 sts 0x0368, r13 ; 0x800368 32998: c0 92 67 03 sts 0x0367, r12 ; 0x800367 _md->editValueBits = pbits; 3299c: 70 92 66 03 sts 0x0366, r7 ; 0x800366 _md->currentValue = cur_val; 329a0: d0 93 6a 03 sts 0x036A, r29 ; 0x80036a 329a4: c0 93 69 03 sts 0x0369, r28 ; 0x800369 _md->minEditValue = min_val; 329a8: 90 92 6c 03 sts 0x036C, r9 ; 0x80036c 329ac: 80 92 6b 03 sts 0x036B, r8 ; 0x80036b _md->maxEditValue = max_val; 329b0: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e 329b4: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d _md->minJumpValue = jmp_val; 329b8: f0 92 70 03 sts 0x0370, r15 ; 0x800370 329bc: e0 92 6f 03 sts 0x036F, r14 ; 0x80036f menu_item_ret(); return; } } menu_item++; } 329c0: df 91 pop r29 329c2: cf 91 pop r28 329c4: 1f 91 pop r17 329c6: 0f 91 pop r16 329c8: ff 90 pop r15 329ca: ef 90 pop r14 329cc: df 90 pop r13 329ce: cf 90 pop r12 329d0: bf 90 pop r11 329d2: af 90 pop r10 329d4: 9f 90 pop r9 329d6: 8f 90 pop r8 329d8: 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(); 329da: 0d 94 02 93 jmp 0x32604 ; 0x32604 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)); 329de: c0 81 ld r28, Z 329e0: d1 81 ldd r29, Z+1 ; 0x01 329e2: 93 cf rjmp .-218 ; 0x3290a _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 329e4: 80 91 31 04 lds r24, 0x0431 ; 0x800431 329e8: 8f 5f subi r24, 0xFF ; 255 329ea: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 329ee: df 91 pop r29 329f0: cf 91 pop r28 329f2: 1f 91 pop r17 329f4: 0f 91 pop r16 329f6: ff 90 pop r15 329f8: ef 90 pop r14 329fa: df 90 pop r13 329fc: cf 90 pop r12 329fe: bf 90 pop r11 32a00: af 90 pop r10 32a02: 9f 90 pop r9 32a04: 8f 90 pop r8 32a06: 7f 90 pop r7 32a08: 08 95 ret 00032a0a <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 32a0a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32a0e: 88 23 and r24, r24 32a10: 09 f4 brne .+2 ; 0x32a14 <_menu_edit_P()+0xa> 32a12: 52 c0 rjmp .+164 ; 0x32ab8 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 32a14: 20 91 6f 03 lds r18, 0x036F ; 0x80036f 32a18: 30 91 70 03 lds r19, 0x0370 ; 0x800370 32a1c: 80 91 6b 03 lds r24, 0x036B ; 0x80036b 32a20: 90 91 6c 03 lds r25, 0x036C ; 0x80036c 32a24: 21 15 cp r18, r1 32a26: 31 05 cpc r19, r1 32a28: d9 f0 breq .+54 ; 0x32a60 <_menu_edit_P()+0x56> 32a2a: 40 91 06 05 lds r20, 0x0506 ; 0x800506 32a2e: 50 91 07 05 lds r21, 0x0507 ; 0x800507 32a32: 41 15 cp r20, r1 32a34: 51 05 cpc r21, r1 32a36: a1 f0 breq .+40 ; 0x32a60 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 32a38: 7c f0 brlt .+30 ; 0x32a58 <_menu_edit_P()+0x4e> 32a3a: 40 91 69 03 lds r20, 0x0369 ; 0x800369 32a3e: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 32a42: 48 17 cp r20, r24 32a44: 59 07 cpc r21, r25 32a46: 41 f4 brne .+16 ; 0x32a58 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 32a48: 30 93 6a 03 sts 0x036A, r19 ; 0x80036a 32a4c: 20 93 69 03 sts 0x0369, r18 ; 0x800369 lcd_encoder = 0; 32a50: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32a54: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 32a58: 10 92 70 03 sts 0x0370, r1 ; 0x800370 32a5c: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f } _md->currentValue += lcd_encoder; 32a60: 20 91 69 03 lds r18, 0x0369 ; 0x800369 32a64: 30 91 6a 03 lds r19, 0x036A ; 0x80036a 32a68: 40 91 06 05 lds r20, 0x0506 ; 0x800506 32a6c: 50 91 07 05 lds r21, 0x0507 ; 0x800507 32a70: 24 0f add r18, r20 32a72: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 32a74: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32a78: 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); 32a7c: 28 17 cp r18, r24 32a7e: 39 07 cpc r19, r25 32a80: 44 f0 brlt .+16 ; 0x32a92 <_menu_edit_P()+0x88> 32a82: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 32a86: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 32a8a: 28 17 cp r18, r24 32a8c: 39 07 cpc r19, r25 32a8e: 0c f4 brge .+2 ; 0x32a92 <_menu_edit_P()+0x88> 32a90: c9 01 movw r24, r18 32a92: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 32a96: 80 93 69 03 sts 0x0369, r24 ; 0x800369 lcd_set_cursor(0, 1); 32a9a: 61 e0 ldi r22, 0x01 ; 1 32a9c: 80 e0 ldi r24, 0x00 ; 0 32a9e: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 menu_draw_P(' ', _md->editLabel, _md->currentValue); 32aa2: 40 91 69 03 lds r20, 0x0369 ; 0x800369 32aa6: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 32aaa: 60 91 64 03 lds r22, 0x0364 ; 0x800364 32aae: 70 91 65 03 lds r23, 0x0365 ; 0x800365 32ab2: 80 e2 ldi r24, 0x20 ; 32 32ab4: 0f 94 7a 6f call 0x2def4 ; 0x2def4 } if (lcd_clicked()) 32ab8: 0e 94 19 6c call 0xd832 ; 0xd832 32abc: 88 23 and r24, r24 32abe: 41 f1 breq .+80 ; 0x32b10 <_menu_edit_P()+0x106> 32ac0: e0 91 67 03 lds r30, 0x0367 ; 0x800367 32ac4: f0 91 68 03 lds r31, 0x0368 ; 0x800368 32ac8: 80 91 69 03 lds r24, 0x0369 ; 0x800369 32acc: 90 91 6a 03 lds r25, 0x036A ; 0x80036a { if (_md->editValueBits == 8) 32ad0: 20 91 66 03 lds r18, 0x0366 ; 0x800366 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 32ad4: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 32ad6: 28 30 cpi r18, 0x08 ; 8 32ad8: c9 f4 brne .+50 ; 0x32b0c <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 32ada: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32ade: 88 23 and r24, r24 32ae0: b9 f0 breq .+46 ; 0x32b10 <_menu_edit_P()+0x106> { menu_depth--; 32ae2: 81 50 subi r24, 0x01 ; 1 32ae4: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 32ae8: 90 e0 ldi r25, 0x00 ; 0 32aea: fc 01 movw r30, r24 32aec: ee 0f add r30, r30 32aee: ff 1f adc r31, r31 32af0: e8 0f add r30, r24 32af2: f9 1f adc r31, r25 32af4: ef 56 subi r30, 0x6F ; 111 32af6: f9 4e sbci r31, 0xE9 ; 233 32af8: 62 81 ldd r22, Z+2 ; 0x02 32afa: 06 2e mov r0, r22 32afc: 00 0c add r0, r0 32afe: 77 0b sbc r23, r23 32b00: 20 e0 ldi r18, 0x00 ; 0 32b02: 40 e0 ldi r20, 0x00 ; 0 32b04: 80 81 ld r24, Z 32b06: 91 81 ldd r25, Z+1 ; 0x01 32b08: 0d 94 46 94 jmp 0x3288c ; 0x3288c if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 32b0c: 91 83 std Z+1, r25 ; 0x01 32b0e: e5 cf rjmp .-54 ; 0x32ada <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 32b10: 08 95 ret 00032b12 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 32b12: dc 01 movw r26, r24 32b14: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 32b16: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 32b1a: 97 30 cpi r25, 0x07 ; 7 32b1c: d8 f4 brcc .+54 ; 0x32b54 { menu_stack[menu_depth].menu = menu_menu; 32b1e: 49 2f mov r20, r25 32b20: 50 e0 ldi r21, 0x00 ; 0 32b22: fa 01 movw r30, r20 32b24: ee 0f add r30, r30 32b26: ff 1f adc r31, r31 32b28: e4 0f add r30, r20 32b2a: f5 1f adc r31, r21 32b2c: ef 56 subi r30, 0x6F ; 111 32b2e: f9 4e sbci r31, 0xE9 ; 233 32b30: 40 91 d0 03 lds r20, 0x03D0 ; 0x8003d0 32b34: 50 91 d1 03 lds r21, 0x03D1 ; 0x8003d1 32b38: 51 83 std Z+1, r21 ; 0x01 32b3a: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 32b3c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32b40: 9f 5f subi r25, 0xFF ; 255 32b42: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 32b46: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 32b48: 41 e0 ldi r20, 0x01 ; 1 32b4a: 70 e0 ldi r23, 0x00 ; 0 32b4c: 60 e0 ldi r22, 0x00 ; 0 32b4e: cd 01 movw r24, r26 32b50: 0d 94 46 94 jmp 0x3288c ; 0x3288c } } 32b54: 08 95 ret 00032b56 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 32b56: 8f 92 push r8 32b58: 9f 92 push r9 32b5a: af 92 push r10 32b5c: bf 92 push r11 32b5e: cf 92 push r12 32b60: df 92 push r13 32b62: ef 92 push r14 32b64: ff 92 push r15 32b66: 0f 93 push r16 32b68: 1f 93 push r17 32b6a: cf 93 push r28 32b6c: df 93 push r29 if (menu_item == menu_line) 32b6e: e0 91 31 04 lds r30, 0x0431 ; 0x800431 32b72: 30 91 30 04 lds r19, 0x0430 ; 0x800430 32b76: e3 13 cpse r30, r19 32b78: 73 c0 rjmp .+230 ; 0x32c60 32b7a: c2 2f mov r28, r18 32b7c: 6a 01 movw r12, r20 32b7e: 7b 01 movw r14, r22 32b80: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 32b82: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32b86: 88 23 and r24, r24 32b88: a1 f1 breq .+104 ; 0x32bf2 32b8a: 0f 94 de 92 call 0x325bc ; 0x325bc 32b8e: 01 e0 ldi r16, 0x01 ; 1 32b90: 8e 33 cpi r24, 0x3E ; 62 32b92: 09 f0 breq .+2 ; 0x32b96 32b94: 00 e0 ldi r16, 0x00 ; 0 32b96: 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; 32b98: 80 2f mov r24, r16 32b9a: 82 70 andi r24, 0x02 ; 2 32b9c: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 32b9e: e1 14 cp r14, r1 32ba0: f1 04 cpc r15, r1 32ba2: 09 f4 brne .+2 ; 0x32ba6 32ba4: 6f c0 rjmp .+222 ; 0x32c84 32ba6: e7 01 movw r28, r14 32ba8: 90 e2 ldi r25, 0x20 ; 32 32baa: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 32bac: 88 20 and r8, r8 32bae: 09 f4 brne .+2 ; 0x32bb2 32bb0: 41 c0 rjmp .+130 ; 0x32c34 32bb2: ce 01 movw r24, r28 32bb4: 0f 94 fa 9e call 0x33df4 ; 0x33df4 <__strlen_P> 32bb8: 14 e0 ldi r17, 0x04 ; 4 32bba: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 32bbc: 4e e3 ldi r20, 0x3E ; 62 32bbe: 00 ff sbrs r16, 0 32bc0: 40 e2 ldi r20, 0x20 ; 32 32bc2: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32bc6: 80 e0 ldi r24, 0x00 ; 0 32bc8: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_print_pad_P(str, LCD_WIDTH - len); 32bcc: 64 e1 ldi r22, 0x14 ; 20 32bce: 61 1b sub r22, r17 32bd0: c5 01 movw r24, r10 32bd2: 0e 94 d1 6b call 0xd7a2 ; 0xd7a2 lcd_putc('['); 32bd6: 8b e5 ldi r24, 0x5B ; 91 32bd8: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 if (is_progmem) { lcd_puts_P(toggle); 32bdc: 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) 32bde: 88 20 and r8, r8 32be0: 89 f1 breq .+98 ; 0x32c44 { lcd_puts_P(toggle); 32be2: 0e 94 e7 69 call 0xd3ce ; 0xd3ce } else { lcd_print(toggle); } lcd_putc(']'); 32be6: 8d e5 ldi r24, 0x5D ; 93 32be8: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 lcd_putc(eol); 32bec: 89 2d mov r24, r9 32bee: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 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)) 32bf2: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32bf6: 88 23 and r24, r24 32bf8: 99 f1 breq .+102 ; 0x32c60 32bfa: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32bfe: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32c02: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32c06: 28 17 cp r18, r24 32c08: 19 06 cpc r1, r25 32c0a: 51 f5 brne .+84 ; 0x32c60 { if (toggle == NULL) // print N/A warning message 32c0c: ef 28 or r14, r15 32c0e: e9 f4 brne .+58 ; 0x32c4a { menu_submenu(func); 32c10: 60 e0 ldi r22, 0x00 ; 0 32c12: c6 01 movw r24, r12 32c14: 0f 94 89 95 call 0x32b12 ; 0x32b12 menu_item_ret(); return; } } menu_item++; } 32c18: df 91 pop r29 32c1a: cf 91 pop r28 32c1c: 1f 91 pop r17 32c1e: 0f 91 pop r16 32c20: ff 90 pop r15 32c22: ef 90 pop r14 32c24: df 90 pop r13 32c26: cf 90 pop r12 32c28: bf 90 pop r11 32c2a: af 90 pop r10 32c2c: 9f 90 pop r9 32c2e: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 32c30: 0d 94 02 93 jmp 0x32604 ; 0x32604 //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)); 32c34: fe 01 movw r30, r28 32c36: 01 90 ld r0, Z+ 32c38: 00 20 and r0, r0 32c3a: e9 f7 brne .-6 ; 0x32c36 32c3c: ec 1b sub r30, r28 32c3e: 13 e0 ldi r17, 0x03 ; 3 32c40: 1e 0f add r17, r30 32c42: bc cf rjmp .-136 ; 0x32bbc lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 32c44: 0e 94 03 6c call 0xd806 ; 0xd806 32c48: ce cf rjmp .-100 ; 0x32be6 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 32c4a: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 32c4e: c1 14 cp r12, r1 32c50: d1 04 cpc r13, r1 32c52: 11 f0 breq .+4 ; 0x32c58 32c54: f6 01 movw r30, r12 32c56: 19 95 eicall lcd_update_enabled = 1; 32c58: 81 e0 ldi r24, 0x01 ; 1 32c5a: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 32c5e: dc cf rjmp .-72 ; 0x32c18 } menu_item_ret(); return; } } menu_item++; 32c60: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32c64: 8f 5f subi r24, 0xFF ; 255 32c66: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32c6a: df 91 pop r29 32c6c: cf 91 pop r28 32c6e: 1f 91 pop r17 32c70: 0f 91 pop r16 32c72: ff 90 pop r15 32c74: ef 90 pop r14 32c76: df 90 pop r13 32c78: cf 90 pop r12 32c7a: bf 90 pop r11 32c7c: af 90 pop r10 32c7e: 9f 90 pop r9 32c80: 8f 90 pop r8 32c82: 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); 32c84: 8d ed ldi r24, 0xDD ; 221 32c86: 9d e3 ldi r25, 0x3D ; 61 32c88: 0e 94 32 6d call 0xda64 ; 0xda64 32c8c: 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] : ' '; 32c8e: 8e e7 ldi r24, 0x7E ; 126 32c90: 98 2e mov r9, r24 32c92: 8c cf rjmp .-232 ; 0x32bac 00032c94 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 32c94: 0f 93 push r16 32c96: 1f 93 push r17 32c98: cf 93 push r28 32c9a: df 93 push r29 32c9c: cd b7 in r28, 0x3d ; 61 32c9e: de b7 in r29, 0x3e ; 62 32ca0: 63 97 sbiw r28, 0x13 ; 19 32ca2: 0f b6 in r0, 0x3f ; 63 32ca4: f8 94 cli 32ca6: de bf out 0x3e, r29 ; 62 32ca8: 0f be out 0x3f, r0 ; 63 32caa: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 32cac: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32cb0: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32cb4: 32 13 cpse r19, r18 32cb6: 38 c0 rjmp .+112 ; 0x32d28 32cb8: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 32cba: 20 91 5b 02 lds r18, 0x025B ; 0x80025b 32cbe: 22 23 and r18, r18 32cc0: a9 f0 breq .+42 ; 0x32cec static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 32cc2: be 01 movw r22, r28 32cc4: 6f 5f subi r22, 0xFF ; 255 32cc6: 7f 4f sbci r23, 0xFF ; 255 32cc8: 0f 94 b6 92 call 0x3256c ; 0x3256c lcd_putc_at(0, menu_row, menu_selection_mark()); 32ccc: 0f 94 de 92 call 0x325bc ; 0x325bc 32cd0: 48 2f mov r20, r24 32cd2: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32cd6: 80 e0 ldi r24, 0x00 ; 0 32cd8: 0e 94 1c 6a call 0xd438 ; 0xd438 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 32cdc: 62 e1 ldi r22, 0x12 ; 18 32cde: ce 01 movw r24, r28 32ce0: 01 96 adiw r24, 0x01 ; 1 32ce2: 0e 94 eb 6b call 0xd7d6 ; 0xd7d6 lcd_putc(type_char); 32ce6: 8e e7 ldi r24, 0x7E ; 126 32ce8: 0e 94 eb 69 call 0xd3d6 ; 0xd3d6 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)) 32cec: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32cf0: 88 23 and r24, r24 32cf2: d1 f0 breq .+52 ; 0x32d28 32cf4: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32cf8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32cfc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32d00: 28 17 cp r18, r24 32d02: 19 06 cpc r1, r25 32d04: 89 f4 brne .+34 ; 0x32d28 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); 32d06: 60 e0 ldi r22, 0x00 ; 0 32d08: c8 01 movw r24, r16 32d0a: 0f 94 89 95 call 0x32b12 ; 0x32b12 menu_item_ret(); 32d0e: 0f 94 02 93 call 0x32604 ; 0x32604 menu_item_ret(); return; } } menu_item++; } 32d12: 63 96 adiw r28, 0x13 ; 19 32d14: 0f b6 in r0, 0x3f ; 63 32d16: f8 94 cli 32d18: de bf out 0x3e, r29 ; 62 32d1a: 0f be out 0x3f, r0 ; 63 32d1c: cd bf out 0x3d, r28 ; 61 32d1e: df 91 pop r29 32d20: cf 91 pop r28 32d22: 1f 91 pop r17 32d24: 0f 91 pop r16 32d26: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 32d28: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32d2c: 8f 5f subi r24, 0xFF ; 255 32d2e: 80 93 31 04 sts 0x0431, r24 ; 0x800431 32d32: ef cf rjmp .-34 ; 0x32d12 00032d34 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 32d34: cf 93 push r28 32d36: df 93 push r29 if (menu_item == menu_line) 32d38: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32d3c: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32d40: 32 13 cpse r19, r18 32d42: 1e c0 rjmp .+60 ; 0x32d80 32d44: eb 01 movw r28, r22 32d46: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 32d48: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32d4c: 88 23 and r24, r24 32d4e: 19 f0 breq .+6 ; 0x32d56 32d50: 8e e7 ldi r24, 0x7E ; 126 32d52: 0f 94 eb 92 call 0x325d6 ; 0x325d6 if (menu_clicked && (lcd_encoder == menu_item)) 32d56: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32d5a: 88 23 and r24, r24 32d5c: 89 f0 breq .+34 ; 0x32d80 32d5e: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32d62: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32d66: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32d6a: 28 17 cp r18, r24 32d6c: 19 06 cpc r1, r25 32d6e: 41 f4 brne .+16 ; 0x32d80 { menu_submenu(submenu); 32d70: 60 e0 ldi r22, 0x00 ; 0 32d72: ce 01 movw r24, r28 32d74: 0f 94 89 95 call 0x32b12 ; 0x32b12 menu_item_ret(); return; } } menu_item++; } 32d78: df 91 pop r29 32d7a: 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(); 32d7c: 0d 94 02 93 jmp 0x32604 ; 0x32604 return; } } menu_item++; 32d80: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32d84: 8f 5f subi r24, 0xFF ; 255 32d86: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32d8a: df 91 pop r29 32d8c: cf 91 pop r28 32d8e: 08 95 ret 00032d90 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 32d90: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32d92: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32d96: 98 17 cp r25, r24 32d98: a8 f4 brcc .+42 ; 0x32dc4 32d9a: 89 1b sub r24, r25 32d9c: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 32da0: 90 e0 ldi r25, 0x00 ; 0 32da2: fc 01 movw r30, r24 32da4: ee 0f add r30, r30 32da6: ff 1f adc r31, r31 32da8: e8 0f add r30, r24 32daa: f9 1f adc r31, r25 32dac: ef 56 subi r30, 0x6F ; 111 32dae: f9 4e sbci r31, 0xE9 ; 233 32db0: 62 81 ldd r22, Z+2 ; 0x02 32db2: 06 2e mov r0, r22 32db4: 00 0c add r0, r0 32db6: 77 0b sbc r23, r23 32db8: 20 e0 ldi r18, 0x00 ; 0 32dba: 41 e0 ldi r20, 0x01 ; 1 32dbc: 80 81 ld r24, Z 32dbe: 91 81 ldd r25, Z+1 ; 0x01 32dc0: 0d 94 46 94 jmp 0x3288c ; 0x3288c } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32dc4: 80 e0 ldi r24, 0x00 ; 0 32dc6: ea cf rjmp .-44 ; 0x32d9c 00032dc8 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 32dc8: 81 e0 ldi r24, 0x01 ; 1 32dca: 0d 94 c8 96 jmp 0x32d90 ; 0x32d90 00032dce : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 32dce: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32dd2: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32dd6: 32 13 cpse r19, r18 32dd8: 19 c0 rjmp .+50 ; 0x32e0c 32dda: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 32ddc: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32de0: 88 23 and r24, r24 32de2: 19 f0 breq .+6 ; 0x32dea 32de4: 83 e8 ldi r24, 0x83 ; 131 32de6: 0f 94 eb 92 call 0x325d6 ; 0x325d6 if (menu_clicked && (lcd_encoder == menu_item)) 32dea: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32dee: 88 23 and r24, r24 32df0: 69 f0 breq .+26 ; 0x32e0c 32df2: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32df6: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32dfa: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32dfe: 28 17 cp r18, r24 32e00: 19 06 cpc r1, r25 32e02: 21 f4 brne .+8 ; 0x32e0c { menu_back(); 32e04: 0f 94 e4 96 call 0x32dc8 ; 0x32dc8 menu_item_ret(); 32e08: 0d 94 02 93 jmp 0x32604 ; 0x32604 return; } } menu_item++; 32e0c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32e10: 8f 5f subi r24, 0xFF ; 255 32e12: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32e16: 08 95 ret 00032e18 : }; 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() { 32e18: ef 92 push r14 32e1a: ff 92 push r15 32e1c: 0f 93 push r16 32e1e: 1f 93 push r17 32e20: cf 93 push r28 32e22: df 93 push r29 32e24: 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) 32e28: 80 91 71 03 lds r24, 0x0371 ; 0x800371 32e2c: 81 11 cpse r24, r1 32e2e: 23 c0 rjmp .+70 ; 0x32e76 { _md->status = 1; // Menu entered for the first time 32e30: 81 e0 ldi r24, 0x01 ; 1 32e32: 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; 32e36: 81 e0 ldi r24, 0x01 ; 1 32e38: 90 e0 ldi r25, 0x00 ; 0 32e3a: 20 91 65 12 lds r18, 0x1265 ; 0x801265 32e3e: 30 91 66 12 lds r19, 0x1266 ; 0x801266 32e42: 27 30 cpi r18, 0x07 ; 7 32e44: 31 48 sbci r19, 0x81 ; 129 32e46: 11 f0 breq .+4 ; 0x32e4c 32e48: 90 e0 ldi r25, 0x00 ; 0 32e4a: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 32e4c: bc 01 movw r22, r24 32e4e: 66 0f add r22, r22 32e50: 77 1f adc r23, r23 32e52: 68 0f add r22, r24 32e54: 79 1f adc r23, r25 32e56: 6c 53 subi r22, 0x3C ; 60 32e58: 71 46 sbci r23, 0x61 ; 97 32e5a: 43 e0 ldi r20, 0x03 ; 3 32e5c: 50 e0 ldi r21, 0x00 ; 0 32e5e: 83 e7 ldi r24, 0x73 ; 115 32e60: 93 e0 ldi r25, 0x03 ; 3 32e62: 0f 94 d6 9e call 0x33dac ; 0x33dac // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 32e66: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32e6a: 0e 94 89 f7 call 0x1ef12 ; 0x1ef12 _md->currentValue = mmu2.GetLastReadRegisterValue(); 32e6e: 80 91 90 12 lds r24, 0x1290 ; 0x801290 32e72: 80 93 72 03 sts 0x0372, r24 ; 0x800372 } MENU_BEGIN(); 32e76: 0f 94 1c 94 call 0x32838 ; 0x32838 32e7a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 32e7e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32e82: 84 30 cpi r24, 0x04 ; 4 32e84: e0 f5 brcc .+120 ; 0x32efe 32e86: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 32e8a: 0f 94 9c 92 call 0x32538 ; 0x32538 32e8e: 88 23 and r24, r24 32e90: 89 f0 breq .+34 ; 0x32eb4 32e92: 60 91 72 03 lds r22, 0x0372 ; 0x800372 32e96: 70 e0 ldi r23, 0x00 ; 0 32e98: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32e9c: 0e 94 97 bf call 0x17f2e ; 0x17f2e 32ea0: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32ea4: df 91 pop r29 32ea6: cf 91 pop r28 32ea8: 1f 91 pop r17 32eaa: 0f 91 pop r16 32eac: ff 90 pop r15 32eae: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 32eb0: 0c 94 3f fe jmp 0x1fc7e ; 0x1fc7e mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 32eb4: 8a e4 ldi r24, 0x4A ; 74 32eb6: 93 e6 ldi r25, 0x63 ; 99 32eb8: 0e 94 32 6d call 0xda64 ; 0xda64 32ebc: 0f 94 e7 96 call 0x32dce ; 0x32dce MENU_ITEM_EDIT_int3_P( 32ec0: 00 91 75 03 lds r16, 0x0375 ; 0x800375 32ec4: 10 e0 ldi r17, 0x00 ; 0 32ec6: c0 91 74 03 lds r28, 0x0374 ; 0x800374 32eca: d0 e0 ldi r29, 0x00 ; 0 32ecc: 8c e3 ldi r24, 0x3C ; 60 32ece: 93 e6 ldi r25, 0x63 ; 99 32ed0: 0e 94 32 6d call 0xda64 ; 0xda64 32ed4: f1 2c mov r15, r1 32ed6: e1 2c mov r14, r1 32ed8: 9e 01 movw r18, r28 32eda: 48 e0 ldi r20, 0x08 ; 8 32edc: 62 e7 ldi r22, 0x72 ; 114 32ede: 73 e0 ldi r23, 0x03 ; 3 32ee0: 0f 94 6c 94 call 0x328d8 ; 0x328d8 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 32ee4: 0f 94 f0 93 call 0x327e0 ; 0x327e0 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 32ee8: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32eec: 8f 5f subi r24, 0xFF ; 255 32eee: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 32ef2: 80 91 30 04 lds r24, 0x0430 ; 0x800430 32ef6: 8f 5f subi r24, 0xFF ; 255 32ef8: 80 93 30 04 sts 0x0430, r24 ; 0x800430 32efc: c0 cf rjmp .-128 ; 0x32e7e &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32efe: df 91 pop r29 32f00: cf 91 pop r28 32f02: 1f 91 pop r17 32f04: 0f 91 pop r16 32f06: ff 90 pop r15 32f08: ef 90 pop r14 32f0a: 08 95 ret 00032f0c : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 32f0c: 0e 94 19 6c call 0xd832 ; 0xd832 32f10: 81 11 cpse r24, r1 menu_back(); 32f12: 0d 94 e4 96 jmp 0x32dc8 ; 0x32dc8 } 32f16: 08 95 ret 00032f18 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 32f18: 8f 92 push r8 32f1a: 9f 92 push r9 32f1c: af 92 push r10 32f1e: bf 92 push r11 32f20: ef 92 push r14 32f22: ff 92 push r15 32f24: 0f 93 push r16 32f26: 1f 93 push r17 32f28: cf 93 push r28 32f2a: df 93 push r29 32f2c: cd b7 in r28, 0x3d ; 61 32f2e: de b7 in r29, 0x3e ; 62 32f30: a0 97 sbiw r28, 0x20 ; 32 32f32: 0f b6 in r0, 0x3f ; 63 32f34: f8 94 cli 32f36: de bf out 0x3e, r29 ; 62 32f38: 0f be out 0x3f, r0 ; 63 32f3a: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 32f3c: 61 15 cp r22, r1 32f3e: 71 05 cpc r23, r1 32f40: 81 05 cpc r24, r1 32f42: 91 05 cpc r25, r1 32f44: 99 f4 brne .+38 ; 0x32f6c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32f46: 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)); } 32f48: a0 96 adiw r28, 0x20 ; 32 32f4a: 0f b6 in r0, 0x3f ; 63 32f4c: f8 94 cli 32f4e: de bf out 0x3e, r29 ; 62 32f50: 0f be out 0x3f, r0 ; 63 32f52: cd bf out 0x3d, r28 ; 61 32f54: df 91 pop r29 32f56: cf 91 pop r28 32f58: 1f 91 pop r17 32f5a: 0f 91 pop r16 32f5c: ff 90 pop r15 32f5e: ef 90 pop r14 32f60: bf 90 pop r11 32f62: af 90 pop r10 32f64: 9f 90 pop r9 32f66: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32f68: 0c 94 c2 70 jmp 0xe184 ; 0xe184 // 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; 32f6c: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32f6e: 84 2e mov r8, r20 32f70: 91 2c mov r9, r1 32f72: b1 2c mov r11, r1 32f74: a1 2c mov r10, r1 32f76: 9e 01 movw r18, r28 32f78: 2f 5f subi r18, 0xFF ; 255 32f7a: 3f 4f sbci r19, 0xFF ; 255 32f7c: 79 01 movw r14, r18 32f7e: a5 01 movw r20, r10 32f80: 94 01 movw r18, r8 32f82: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 32f86: f7 01 movw r30, r14 32f88: e0 0f add r30, r16 32f8a: f1 1d adc r31, r1 32f8c: 60 83 st Z, r22 n /= base; 32f8e: b9 01 movw r22, r18 32f90: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32f92: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 32f94: 61 15 cp r22, r1 32f96: 71 05 cpc r23, r1 32f98: 81 05 cpc r24, r1 32f9a: 91 05 cpc r25, r1 32f9c: 81 f7 brne .-32 ; 0x32f7e 32f9e: 0e 0d add r16, r14 32fa0: 1f 2d mov r17, r15 32fa2: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 32fa4: e0 16 cp r14, r16 32fa6: f1 06 cpc r15, r17 32fa8: 59 f0 breq .+22 ; 0x32fc0 print((char) (buf[i - 1] < 10 ? 32faa: f8 01 movw r30, r16 32fac: 82 91 ld r24, -Z 32fae: 8f 01 movw r16, r30 32fb0: 8a 30 cpi r24, 0x0A ; 10 32fb2: 20 f4 brcc .+8 ; 0x32fbc '0' + buf[i - 1] : 32fb4: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32fb6: 0e 94 c2 70 call 0xe184 ; 0xe184 32fba: f4 cf rjmp .-24 ; 0x32fa4 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 32fbc: 89 5c subi r24, 0xC9 ; 201 32fbe: fb cf rjmp .-10 ; 0x32fb6 } 32fc0: a0 96 adiw r28, 0x20 ; 32 32fc2: 0f b6 in r0, 0x3f ; 63 32fc4: f8 94 cli 32fc6: de bf out 0x3e, r29 ; 62 32fc8: 0f be out 0x3f, r0 ; 63 32fca: cd bf out 0x3d, r28 ; 61 32fcc: df 91 pop r29 32fce: cf 91 pop r28 32fd0: 1f 91 pop r17 32fd2: 0f 91 pop r16 32fd4: ff 90 pop r15 32fd6: ef 90 pop r14 32fd8: bf 90 pop r11 32fda: af 90 pop r10 32fdc: 9f 90 pop r9 32fde: 8f 90 pop r8 32fe0: 08 95 ret 00032fe2 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 32fe2: 87 e1 ldi r24, 0x17 ; 23 32fe4: 90 ea ldi r25, 0xA0 ; 160 32fe6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 32fea: 85 ea ldi r24, 0xA5 ; 165 32fec: 9d e0 ldi r25, 0x0D ; 13 32fee: 0f 94 4a a1 call 0x34294 ; 0x34294 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 32ff2: bc 01 movw r22, r24 32ff4: 90 e0 ldi r25, 0x00 ; 0 32ff6: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32ff8: 4a e0 ldi r20, 0x0A ; 10 32ffa: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ffe: 8d e5 ldi r24, 0x5D ; 93 33000: 0c 94 c2 70 jmp 0xe184 ; 0xe184 00033004 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 33004: cf 92 push r12 33006: df 92 push r13 33008: ef 92 push r14 3300a: ff 92 push r15 3300c: 6b 01 movw r12, r22 3300e: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 33010: f7 fe sbrs r15, 7 33012: 0b c0 rjmp .+22 ; 0x3302a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33014: 8d e2 ldi r24, 0x2D ; 45 33016: 0e 94 c2 70 call 0xe184 ; 0xe184 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3301a: f0 94 com r15 3301c: e0 94 com r14 3301e: d0 94 com r13 33020: c0 94 com r12 33022: c1 1c adc r12, r1 33024: d1 1c adc r13, r1 33026: e1 1c adc r14, r1 33028: f1 1c adc r15, r1 } printNumber(n, 10); 3302a: 4a e0 ldi r20, 0x0A ; 10 3302c: c7 01 movw r24, r14 3302e: b6 01 movw r22, r12 } else { printNumber(n, base); } } 33030: ff 90 pop r15 33032: ef 90 pop r14 33034: df 90 pop r13 33036: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 33038: 0d 94 8c 97 jmp 0x32f18 ; 0x32f18 0003303c : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 3303c: cf 93 push r28 3303e: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33040: 8b e7 ldi r24, 0x7B ; 123 33042: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 33046: 8c 2f mov r24, r28 33048: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 3304c: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 33050: 83 e0 ldi r24, 0x03 ; 3 33052: 90 ea ldi r25, 0xA0 ; 160 33054: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 33058: 60 91 84 06 lds r22, 0x0684 ; 0x800684 3305c: 70 91 85 06 lds r23, 0x0685 ; 0x800685 33060: 80 91 86 06 lds r24, 0x0686 ; 0x800686 33064: 90 91 87 06 lds r25, 0x0687 ; 0x800687 33068: 4a e0 ldi r20, 0x0A ; 10 3306a: 0f 94 8c 97 call 0x32f18 ; 0x32f18 SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 3306e: 8c ef ldi r24, 0xFC ; 252 33070: 9f e9 ldi r25, 0x9F ; 159 33072: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 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;}; 33076: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 3307a: 88 23 and r24, r24 3307c: 09 f4 brne .+2 ; 0x33080 3307e: 5e c0 rjmp .+188 ; 0x3313c 33080: 80 91 77 16 lds r24, 0x1677 ; 0x801677 33084: 90 91 78 16 lds r25, 0x1678 ; 0x801678 33088: a0 91 79 16 lds r26, 0x1679 ; 0x801679 3308c: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 33090: 00 97 sbiw r24, 0x00 ; 0 33092: a1 05 cpc r26, r1 33094: b1 05 cpc r27, r1 33096: 09 f4 brne .+2 ; 0x3309a 33098: 51 c0 rjmp .+162 ; 0x3313c 3309a: bc 01 movw r22, r24 3309c: cd 01 movw r24, r26 3309e: 6d 59 subi r22, 0x9D ; 157 330a0: 7f 4f sbci r23, 0xFF ; 255 330a2: 8f 4f sbci r24, 0xFF ; 255 330a4: 9f 4f sbci r25, 0xFF ; 255 330a6: 24 e6 ldi r18, 0x64 ; 100 330a8: 30 e0 ldi r19, 0x00 ; 0 330aa: 40 e0 ldi r20, 0x00 ; 0 330ac: 50 e0 ldi r21, 0x00 ; 0 330ae: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 330b2: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 330b6: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 330ba: 80 91 80 16 lds r24, 0x1680 ; 0x801680 330be: 90 91 81 16 lds r25, 0x1681 ; 0x801681 330c2: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 330c6: 62 2f mov r22, r18 330c8: 70 e0 ldi r23, 0x00 ; 0 330ca: 90 e0 ldi r25, 0x00 ; 0 330cc: 80 e0 ldi r24, 0x00 ; 0 330ce: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 330d2: 85 ef ldi r24, 0xF5 ; 245 330d4: 9f e9 ldi r25, 0x9F ; 159 330d6: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 330da: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 330de: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 330e2: 07 2e mov r0, r23 330e4: 00 0c add r0, r0 330e6: 88 0b sbc r24, r24 330e8: 99 0b sbc r25, r25 330ea: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 330ee: 8e ee ldi r24, 0xEE ; 238 330f0: 9f e9 ldi r25, 0x9F ; 159 330f2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 330f6: 80 91 81 13 lds r24, 0x1381 ; 0x801381 330fa: 81 11 cpse r24, r1 330fc: 21 c0 rjmp .+66 ; 0x33140 330fe: 8c e6 ldi r24, 0x6C ; 108 33100: 93 e1 ldi r25, 0x13 ; 19 33102: 0e 94 2b 7d call 0xfa56 ; 0xfa56 SERIAL_ECHOPGM("][TIM:"); 33106: 87 ee ldi r24, 0xE7 ; 231 33108: 9f e9 ldi r25, 0x9F ; 159 3310a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 if (print_job_timer.isRunning()) { 3310e: 80 91 59 03 lds r24, 0x0359 ; 0x800359 33112: 81 30 cpi r24, 0x01 ; 1 33114: c1 f4 brne .+48 ; 0x33146 SERIAL_ECHO(print_job_timer.duration()); 33116: 0f 94 c4 1c call 0x23988 ; 0x23988 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3311a: 4a e0 ldi r20, 0x0A ; 10 3311c: 0f 94 8c 97 call 0x32f18 ; 0x32f18 } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 33120: 80 ee ldi r24, 0xE0 ; 224 33122: 9f e9 ldi r25, 0x9F ; 159 33124: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 33128: 89 ed ldi r24, 0xD9 ; 217 3312a: 9f e9 ldi r25, 0x9F ; 159 3312c: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33130: 8d e5 ldi r24, 0x5D ; 93 33132: 0e 94 c2 70 call 0xe184 ; 0xe184 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 33136: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 33138: 0d 94 f1 97 jmp 0x32fe2 ; 0x32fe2 3313c: 20 e0 ldi r18, 0x00 ; 0 3313e: c3 cf rjmp .-122 ; 0x330c6 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); 33140: 81 e8 ldi r24, 0x81 ; 129 33142: 93 e1 ldi r25, 0x13 ; 19 33144: de cf rjmp .-68 ; 0x33102 33146: 60 e0 ldi r22, 0x00 ; 0 33148: 70 e0 ldi r23, 0x00 ; 0 3314a: cb 01 movw r24, r22 3314c: 0f 94 02 98 call 0x33004 ; 0x33004 33150: e7 cf rjmp .-50 ; 0x33120 00033152 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 33152: 8f 92 push r8 33154: 9f 92 push r9 33156: af 92 push r10 33158: bf 92 push r11 3315a: cf 92 push r12 3315c: df 92 push r13 3315e: ef 92 push r14 33160: ff 92 push r15 33162: cf 93 push r28 33164: 6b 01 movw r12, r22 33166: 7c 01 movw r14, r24 33168: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3316a: 20 e0 ldi r18, 0x00 ; 0 3316c: 30 e0 ldi r19, 0x00 ; 0 3316e: a9 01 movw r20, r18 33170: 0f 94 59 a3 call 0x346b2 ; 0x346b2 <__cmpsf2> 33174: 87 ff sbrs r24, 7 33176: 07 c0 rjmp .+14 ; 0x33186 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33178: 8d e2 ldi r24, 0x2D ; 45 3317a: 0e 94 c2 70 call 0xe184 ; 0xe184 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3317e: f7 fa bst r15, 7 33180: f0 94 com r15 33182: f7 f8 bld r15, 7 33184: 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; 33194: 20 e0 ldi r18, 0x00 ; 0 33196: 30 e0 ldi r19, 0x00 ; 0 33198: 40 e2 ldi r20, 0x20 ; 32 3319a: 51 e4 ldi r21, 0x41 ; 65 3319c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__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; 331a4: 9b 01 movw r18, r22 331a6: ac 01 movw r20, r24 331a8: c7 01 movw r24, r14 331aa: b6 01 movw r22, r12 331ac: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 331b0: 6b 01 movw r12, r22 331b2: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 331b4: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 331b8: 4b 01 movw r8, r22 331ba: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 331bc: 4a e0 ldi r20, 0x0A ; 10 331be: 0f 94 8c 97 call 0x32f18 ; 0x32f18 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) 331c2: cc 23 and r28, r28 331c4: 91 f1 breq .+100 ; 0x3322a 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; 331c6: c5 01 movw r24, r10 331c8: b4 01 movw r22, r8 331ca: 0f 94 c8 9b call 0x33790 ; 0x33790 <__floatunsisf> 331ce: 9b 01 movw r18, r22 331d0: ac 01 movw r20, r24 331d2: c7 01 movw r24, r14 331d4: b6 01 movw r22, r12 331d6: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 331da: 6b 01 movw r12, r22 331dc: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 331de: 8e e2 ldi r24, 0x2E ; 46 331e0: 0e 94 c2 70 call 0xe184 ; 0xe184 // 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) 331e4: c1 50 subi r28, 0x01 ; 1 331e6: 08 f1 brcs .+66 ; 0x3322a { remainder *= 10.0; 331e8: 20 e0 ldi r18, 0x00 ; 0 331ea: 30 e0 ldi r19, 0x00 ; 0 331ec: 40 e2 ldi r20, 0x20 ; 32 331ee: 51 e4 ldi r21, 0x41 ; 65 331f0: c7 01 movw r24, r14 331f2: b6 01 movw r22, r12 331f4: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 331f8: 4b 01 movw r8, r22 331fa: 5c 01 movw r10, r24 int toPrint = int(remainder); 331fc: 0f 94 d5 a3 call 0x347aa ; 0x347aa <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 33200: 6b 01 movw r12, r22 33202: 77 0f add r23, r23 33204: ee 08 sbc r14, r14 33206: ff 08 sbc r15, r15 33208: c7 01 movw r24, r14 3320a: b6 01 movw r22, r12 3320c: 0f 94 02 98 call 0x33004 ; 0x33004 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 33210: c7 01 movw r24, r14 33212: b6 01 movw r22, r12 33214: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 33218: 9b 01 movw r18, r22 3321a: ac 01 movw r20, r24 3321c: c5 01 movw r24, r10 3321e: b4 01 movw r22, r8 33220: 0f 94 63 a2 call 0x344c6 ; 0x344c6 <__subsf3> 33224: 6b 01 movw r12, r22 33226: 7c 01 movw r14, r24 33228: dd cf rjmp .-70 ; 0x331e4 } } 3322a: cf 91 pop r28 3322c: ff 90 pop r15 3322e: ef 90 pop r14 33230: df 90 pop r13 33232: cf 90 pop r12 33234: bf 90 pop r11 33236: af 90 pop r10 33238: 9f 90 pop r9 3323a: 8f 90 pop r8 3323c: 08 95 ret 0003323e : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 3323e: 82 e3 ldi r24, 0x32 ; 50 33240: 90 ea ldi r25, 0xA0 ; 160 33242: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 33246: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 3324a: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 3324e: 07 2e mov r0, r23 33250: 00 0c add r0, r0 33252: 88 0b sbc r24, r24 33254: 99 0b sbc r25, r25 33256: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 3325a: 8b e2 ldi r24, 0x2B ; 43 3325c: 90 ea ldi r25, 0xA0 ; 160 3325e: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 33262: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 33266: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 3326a: 07 2e mov r0, r23 3326c: 00 0c add r0, r0 3326e: 88 0b sbc r24, r24 33270: 99 0b sbc r25, r25 33272: 0f 94 02 98 call 0x33004 ; 0x33004 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 33276: 84 e2 ldi r24, 0x24 ; 36 33278: 90 ea ldi r25, 0xA0 ; 160 3327a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 3327e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 33282: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 33286: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 3328a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 3328e: 42 e0 ldi r20, 0x02 ; 2 33290: 0f 94 a9 98 call 0x33152 ; 0x33152 SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 33294: 8d e1 ldi r24, 0x1D ; 29 33296: 90 ea ldi r25, 0xA0 ; 160 33298: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 3329c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 332a0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 332a4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 332a8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 332ac: 42 e0 ldi r20, 0x02 ; 2 332ae: 0f 94 a9 98 call 0x33152 ; 0x33152 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 332b2: 8d e5 ldi r24, 0x5D ; 93 332b4: 0c 94 c2 70 jmp 0xe184 ; 0xe184 000332b8 : 332b8: 8a e0 ldi r24, 0x0A ; 10 332ba: 0c 94 c2 70 jmp 0xe184 ; 0xe184 000332be : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 332be: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 332c0: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca 332c4: 99 23 and r25, r25 332c6: 09 f4 brne .+2 ; 0x332ca 332c8: f6 c0 rjmp .+492 ; 0x334b6 332ca: c8 2f mov r28, r24 return; switch (_message) { 332cc: 87 30 cpi r24, 0x07 ; 7 332ce: 09 f4 brne .+2 ; 0x332d2 332d0: be c0 rjmp .+380 ; 0x3344e 332d2: 08 f0 brcs .+2 ; 0x332d6 332d4: 46 c0 rjmp .+140 ; 0x33362 332d6: 83 30 cpi r24, 0x03 ; 3 332d8: 09 f4 brne .+2 ; 0x332dc 332da: ed c0 rjmp .+474 ; 0x334b6 332dc: 80 f5 brcc .+96 ; 0x3333e 332de: 81 30 cpi r24, 0x01 ; 1 332e0: 09 f4 brne .+2 ; 0x332e4 332e2: 88 c0 rjmp .+272 ; 0x333f4 332e4: 08 f4 brcc .+2 ; 0x332e8 332e6: 60 c0 rjmp .+192 ; 0x333a8 332e8: 8b e7 ldi r24, 0x7B ; 123 332ea: 0e 94 c2 70 call 0xe184 ; 0xe184 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 332ee: 83 e0 ldi r24, 0x03 ; 3 332f0: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 332f4: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 332f8: 8d e7 ldi r24, 0x7D ; 125 332fa: 0e 94 c2 70 call 0xe184 ; 0xe184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 332fe: 0f 94 5c 99 call 0x332b8 ; 0x332b8 SERIAL_ECHOLN('}'); status_number = 3; 33302: c3 e0 ldi r28, 0x03 ; 3 33304: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.494> farm_timer = 1; 33308: 81 e0 ldi r24, 0x01 ; 1 3330a: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 3330e: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33312: 81 11 cpse r24, r1 33314: 05 c0 rjmp .+10 ; 0x33320 33316: 80 91 62 03 lds r24, 0x0362 ; 0x800362 3331a: 88 23 and r24, r24 3331c: 09 f4 brne .+2 ; 0x33320 3331e: 78 c0 rjmp .+240 ; 0x33410 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33320: 8b e7 ldi r24, 0x7B ; 123 33322: 0e 94 c2 70 call 0xe184 ; 0xe184 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 33326: 84 e0 ldi r24, 0x04 ; 4 33328: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 3332c: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 4; 33330: 84 e0 ldi r24, 0x04 ; 4 33332: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> SERIAL_ECHO('{'); prusa_stat_printerstatus(3); prusa_stat_farm_number(); status_number = 3; } farm_timer = 1; 33336: 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; 33338: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 3333c: 1e c0 rjmp .+60 ; 0x3337a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 3333e: 85 30 cpi r24, 0x05 ; 5 33340: 09 f4 brne .+2 ; 0x33344 33342: 71 c0 rjmp .+226 ; 0x33426 // 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:"); 33344: 8a e6 ldi r24, 0x6A ; 106 33346: 90 ea ldi r25, 0xA0 ; 160 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33348: c6 30 cpi r28, 0x06 ; 6 3334a: 08 f4 brcc .+2 ; 0x3334e 3334c: 6e c0 rjmp .+220 ; 0x3342a prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 3334e: 83 e5 ldi r24, 0x53 ; 83 33350: 90 ea ldi r25, 0xA0 ; 160 33352: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 prusa_stat_farm_number(); 33356: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 8; 3335a: 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; 3335c: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 33360: 74 c0 rjmp .+232 ; 0x3344a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33362: 86 31 cpi r24, 0x16 ; 22 33364: 09 f4 brne .+2 ; 0x33368 33366: 9b c0 rjmp .+310 ; 0x3349e 33368: 70 f4 brcc .+28 ; 0x33386 3336a: 84 31 cpi r24, 0x14 ; 20 3336c: 09 f4 brne .+2 ; 0x33370 3336e: 80 c0 rjmp .+256 ; 0x33470 33370: 08 f0 brcs .+2 ; 0x33374 33372: 89 c0 rjmp .+274 ; 0x33486 33374: 88 30 cpi r24, 0x08 ; 8 33376: 09 f4 brne .+2 ; 0x3337a 33378: 72 c0 rjmp .+228 ; 0x3345e 3337a: 8d e7 ldi r24, 0x7D ; 125 3337c: 0e 94 c2 70 call 0xe184 ; 0xe184 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 33380: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 33382: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33386: 8b 35 cpi r24, 0x5B ; 91 33388: 09 f4 brne .+2 ; 0x3338c 3338a: 91 c0 rjmp .+290 ; 0x334ae 3338c: 30 f4 brcc .+12 ; 0x3339a prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 3338e: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33390: ca 35 cpi r28, 0x5A ; 90 33392: 99 f7 brne .-26 ; 0x3337a break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 33394: 0f 94 09 6d call 0x2da12 ; 0x2da12 33398: f0 cf rjmp .-32 ; 0x3337a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 3339a: 8c 35 cpi r24, 0x5C ; 92 3339c: 09 f4 brne .+2 ; 0x333a0 3339e: 89 c0 rjmp .+274 ; 0x334b2 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 333a0: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 333a2: cd 35 cpi r28, 0x5D ; 93 333a4: b9 f3 breq .-18 ; 0x33394 333a6: e9 cf rjmp .-46 ; 0x3337a case 0: // default message if (busy_state == PAUSED_FOR_USER) { 333a8: 80 91 78 02 lds r24, 0x0278 ; 0x800278 333ac: 84 30 cpi r24, 0x04 ; 4 333ae: 21 f4 brne .+8 ; 0x333b8 prusa_statistics_case0(15); 333b0: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 333b2: 0f 94 1e 98 call 0x3303c ; 0x3303c 333b6: e1 cf rjmp .-62 ; 0x3337a switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 333b8: 0e 94 3e 61 call 0xc27c ; 0xc27c 333bc: 88 23 and r24, r24 333be: 11 f0 breq .+4 ; 0x333c4 prusa_statistics_case0(14); 333c0: 8e e0 ldi r24, 0x0E ; 14 333c2: f7 cf rjmp .-18 ; 0x333b2 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 333c4: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 333c8: 81 11 cpse r24, r1 333ca: 04 c0 rjmp .+8 ; 0x333d4 333cc: 80 91 62 03 lds r24, 0x0362 ; 0x800362 333d0: 88 23 and r24, r24 333d2: 11 f0 breq .+4 ; 0x333d8 prusa_statistics_case0(4); 333d4: 84 e0 ldi r24, 0x04 ; 4 333d6: ed cf rjmp .-38 ; 0x333b2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 333d8: 8b e7 ldi r24, 0x7B ; 123 333da: 0e 94 c2 70 call 0xe184 ; 0xe184 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 333de: 81 e0 ldi r24, 0x01 ; 1 333e0: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 333e4: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 prusa_stat_diameter(); 333e8: 0f 94 f1 97 call 0x32fe2 ; 0x32fe2 status_number = 1; 333ec: 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; 333ee: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 333f2: c3 cf rjmp .-122 ; 0x3337a 333f4: 8b e7 ldi r24, 0x7B ; 123 333f6: 0e 94 c2 70 call 0xe184 ; 0xe184 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 333fa: 82 e0 ldi r24, 0x02 ; 2 333fc: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 33400: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 2; 33404: 82 e0 ldi r24, 0x02 ; 2 33406: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> farm_timer = 1; 3340a: c0 93 76 02 sts 0x0276, r28 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 3340e: b5 cf rjmp .-150 ; 0x3337a 33410: 8b e7 ldi r24, 0x7B ; 123 33412: 0e 94 c2 70 call 0xe184 ; 0xe184 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 33416: 83 e0 ldi r24, 0x03 ; 3 33418: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 3341c: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 3; 33420: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 33424: 88 cf rjmp .-240 ; 0x33336 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 33426: 8c e5 ldi r24, 0x5C ; 92 33428: 90 ea ldi r25, 0xA0 ; 160 // 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:"); 3342a: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 3342e: 60 e0 ldi r22, 0x00 ; 0 33430: 70 e0 ldi r23, 0x00 ; 0 33432: cb 01 movw r24, r22 33434: 0f 94 02 98 call 0x33004 ; 0x33004 33438: 8d e5 ldi r24, 0x5D ; 93 3343a: 0e 94 c2 70 call 0xe184 ; 0xe184 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 3343e: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 33442: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 33446: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 farm_timer = 2; 3344a: 82 e0 ldi r24, 0x02 ; 2 3344c: 75 cf rjmp .-278 ; 0x33338 prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 3344e: 8a e4 ldi r24, 0x4A ; 74 33450: 90 ea ldi r25, 0xA0 ; 160 33452: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 prusa_stat_farm_number(); 33456: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 9; 3345a: 89 e0 ldi r24, 0x09 ; 9 3345c: 7f cf rjmp .-258 ; 0x3335c farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 3345e: 81 e4 ldi r24, 0x41 ; 65 33460: 90 ea ldi r25, 0xA0 ; 160 33462: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 prusa_stat_farm_number(); 33466: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 0; 3346a: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 3346e: ed cf rjmp .-38 ; 0x3344a 33470: 8b e7 ldi r24, 0x7B ; 123 33472: 0e 94 c2 70 call 0xe184 ; 0xe184 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 33476: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 3347a: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 prusa_stat_farm_number(); 3347e: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 farm_timer = 4; 33482: 84 e0 ldi r24, 0x04 ; 4 33484: 59 cf rjmp .-334 ; 0x33338 33486: 8b e7 ldi r24, 0x7B ; 123 33488: 0e 94 c2 70 call 0xe184 ; 0xe184 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 3348c: 0f 94 1f 99 call 0x3323e ; 0x3323e prusa_stat_farm_number(); 33490: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 prusa_stat_printerstatus(status_number); 33494: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 33498: 0f 94 fc 6c call 0x2d9f8 ; 0x2d9f8 3349c: 6e cf rjmp .-292 ; 0x3337a break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 3349e: 88 e3 ldi r24, 0x38 ; 56 334a0: 90 ea ldi r25, 0xA0 ; 160 334a2: 0e 94 db 70 call 0xe1b6 ; 0xe1b6 prusa_stat_farm_number(); 334a6: 0f 94 f8 6c call 0x2d9f0 ; 0x2d9f0 status_number = 5; 334aa: 85 e0 ldi r24, 0x05 ; 5 334ac: a0 cf rjmp .-192 ; 0x333ee case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 334ae: 82 e3 ldi r24, 0x32 ; 50 334b0: 71 cf rjmp .-286 ; 0x33394 break; case 92: // Error - Min temp prusa_statistics_err('3'); 334b2: 83 e3 ldi r24, 0x33 ; 51 334b4: 6f cf rjmp .-290 ; 0x33394 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 334b6: cf 91 pop r28 334b8: 08 95 ret 000334ba : 334ba: 0e 94 2b 7d call 0xfa56 ; 0xfa56 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 334be: 0d 94 5c 99 jmp 0x332b8 ; 0x332b8 000334c2 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 334c2: 1f 92 push r1 334c4: 0f 92 push r0 334c6: 0f b6 in r0, 0x3f ; 63 334c8: 0f 92 push r0 334ca: 11 24 eor r1, r1 334cc: 0b b6 in r0, 0x3b ; 59 334ce: 0f 92 push r0 334d0: 2f 93 push r18 334d2: 3f 93 push r19 334d4: 4f 93 push r20 334d6: 6f 93 push r22 334d8: 7f 93 push r23 334da: 8f 93 push r24 334dc: 9f 93 push r25 334de: ef 93 push r30 334e0: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 334e6: 84 ff sbrs r24, 4 334e8: 12 c0 rjmp .+36 ; 0x3350e <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 334ea: 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 } } 334ee: ff 91 pop r31 334f0: ef 91 pop r30 334f2: 9f 91 pop r25 334f4: 8f 91 pop r24 334f6: 7f 91 pop r23 334f8: 6f 91 pop r22 334fa: 4f 91 pop r20 334fc: 3f 91 pop r19 334fe: 2f 91 pop r18 33500: 0f 90 pop r0 33502: 0b be out 0x3b, r0 ; 59 33504: 0f 90 pop r0 33506: 0f be out 0x3f, r0 ; 63 33508: 0f 90 pop r0 3350a: 1f 90 pop r1 3350c: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3350e: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 33512: 80 91 04 05 lds r24, 0x0504 ; 0x800504 33516: 81 30 cpi r24, 0x01 ; 1 33518: 51 f7 brne .-44 ; 0x334ee <__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; 3351a: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 3351e: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 33522: c9 01 movw r24, r18 33524: 01 96 adiw r24, 0x01 ; 1 33526: 8f 77 andi r24, 0x7F ; 127 33528: 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) { 3352a: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 3352e: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 33532: 86 17 cp r24, r22 33534: 97 07 cpc r25, r23 33536: d9 f2 breq .-74 ; 0x334ee <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 33538: 21 5d subi r18, 0xD1 ; 209 3353a: 3a 4f sbci r19, 0xFA ; 250 3353c: f9 01 movw r30, r18 3353e: 40 83 st Z, r20 rx_buffer.head = i; 33540: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 33544: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 33548: d2 cf rjmp .-92 ; 0x334ee <__vector_36+0x2c> 0003354a <__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) { 3354a: 1f 92 push r1 3354c: 0f 92 push r0 3354e: 0f b6 in r0, 0x3f ; 63 33550: 0f 92 push r0 33552: 11 24 eor r1, r1 33554: 0b b6 in r0, 0x3b ; 59 33556: 0f 92 push r0 33558: 2f 93 push r18 3355a: 3f 93 push r19 3355c: 4f 93 push r20 3355e: 6f 93 push r22 33560: 7f 93 push r23 33562: 8f 93 push r24 33564: 9f 93 push r25 33566: ef 93 push r30 33568: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3356e: 84 ff sbrs r24, 4 33570: 12 c0 rjmp .+36 ; 0x33596 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 33572: 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 } } 33576: ff 91 pop r31 33578: ef 91 pop r30 3357a: 9f 91 pop r25 3357c: 8f 91 pop r24 3357e: 7f 91 pop r23 33580: 6f 91 pop r22 33582: 4f 91 pop r20 33584: 3f 91 pop r19 33586: 2f 91 pop r18 33588: 0f 90 pop r0 3358a: 0b be out 0x3b, r0 ; 59 3358c: 0f 90 pop r0 3358e: 0f be out 0x3f, r0 ; 63 33590: 0f 90 pop r0 33592: 1f 90 pop r1 33594: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 33596: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3359a: 80 91 04 05 lds r24, 0x0504 ; 0x800504 3359e: 81 11 cpse r24, r1 335a0: ea cf rjmp .-44 ; 0x33576 <__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; 335a2: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 335a6: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 335aa: c9 01 movw r24, r18 335ac: 01 96 adiw r24, 0x01 ; 1 335ae: 8f 77 andi r24, 0x7F ; 127 335b0: 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) { 335b2: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 335b6: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 335ba: 86 17 cp r24, r22 335bc: 97 07 cpc r25, r23 335be: d9 f2 breq .-74 ; 0x33576 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 335c0: 21 5d subi r18, 0xD1 ; 209 335c2: 3a 4f sbci r19, 0xFA ; 250 335c4: f9 01 movw r30, r18 335c6: 40 83 st Z, r20 rx_buffer.head = i; 335c8: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 335cc: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 335d0: d2 cf rjmp .-92 ; 0x33576 <__vector_25+0x2c> 000335d2 : * 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) { 335d2: 2f 92 push r2 335d4: 3f 92 push r3 335d6: 4f 92 push r4 335d8: 5f 92 push r5 335da: 6f 92 push r6 335dc: 7f 92 push r7 335de: 8f 92 push r8 335e0: 9f 92 push r9 335e2: af 92 push r10 335e4: bf 92 push r11 335e6: cf 92 push r12 335e8: df 92 push r13 335ea: ef 92 push r14 335ec: ff 92 push r15 335ee: 0f 93 push r16 335f0: 1f 93 push r17 335f2: cf 93 push r28 335f4: df 93 push r29 335f6: cd b7 in r28, 0x3d ; 61 335f8: de b7 in r29, 0x3e ; 62 335fa: c2 54 subi r28, 0x42 ; 66 335fc: d1 09 sbc r29, r1 335fe: 0f b6 in r0, 0x3f ; 63 33600: f8 94 cli 33602: de bf out 0x3e, r29 ; 62 33604: 0f be out 0x3f, r0 ; 63 33606: cd bf out 0x3d, r28 ; 61 33608: 4c 01 movw r8, r24 3360a: 5b 01 movw r10, r22 3360c: 6a 01 movw r12, r20 3360e: 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) {} 33610: 19 82 std Y+1, r1 ; 0x01 33612: 1c 82 std Y+4, r1 ; 0x04 33614: 1c 8e std Y+28, r1 ; 0x1c 33616: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 33618: 67 2b or r22, r23 3361a: 21 f5 brne .+72 ; 0x33664 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3361c: 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; 3361e: ce 01 movw r24, r28 33620: 4c 96 adiw r24, 0x1c ; 28 33622: 0e 94 bc 70 call 0xe178 ; 0xe178 33626: ce 01 movw r24, r28 33628: 01 96 adiw r24, 0x01 ; 1 3362a: 0e 94 bc 70 call 0xe178 ; 0xe178 } return open(parent, dname, oflag); fail: return false; } 3362e: 81 2f mov r24, r17 33630: ce 5b subi r28, 0xBE ; 190 33632: df 4f sbci r29, 0xFF ; 255 33634: 0f b6 in r0, 0x3f ; 63 33636: f8 94 cli 33638: de bf out 0x3e, r29 ; 62 3363a: 0f be out 0x3f, r0 ; 63 3363c: cd bf out 0x3d, r28 ; 61 3363e: df 91 pop r29 33640: cf 91 pop r28 33642: 1f 91 pop r17 33644: 0f 91 pop r16 33646: ff 90 pop r15 33648: ef 90 pop r14 3364a: df 90 pop r13 3364c: cf 90 pop r12 3364e: bf 90 pop r11 33650: af 90 pop r10 33652: 9f 90 pop r9 33654: 8f 90 pop r8 33656: 7f 90 pop r7 33658: 6f 90 pop r6 3365a: 5f 90 pop r5 3365c: 4f 90 pop r4 3365e: 3f 90 pop r3 33660: 2f 90 pop r2 33662: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 33664: fc 01 movw r30, r24 33666: 83 81 ldd r24, Z+3 ; 0x03 33668: 81 11 cpse r24, r1 3366a: d8 cf rjmp .-80 ; 0x3361c if (*path == '/') { 3366c: fa 01 movw r30, r20 3366e: 80 81 ld r24, Z 33670: 8f 32 cpi r24, 0x2F ; 47 33672: c1 f4 brne .+48 ; 0x336a4 33674: ca 01 movw r24, r20 33676: 6c 01 movw r12, r24 33678: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3367a: f6 01 movw r30, r12 3367c: 20 81 ld r18, Z 3367e: 2f 32 cpi r18, 0x2F ; 47 33680: d1 f3 breq .-12 ; 0x33676 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; 33682: f5 01 movw r30, r10 33684: 83 81 ldd r24, Z+3 ; 0x03 33686: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 33688: 82 30 cpi r24, 0x02 ; 2 3368a: 60 f0 brcs .+24 ; 0x336a4 if (!dir2.openRoot(dirFile->vol_)) goto fail; 3368c: 61 8d ldd r22, Z+25 ; 0x19 3368e: 72 8d ldd r23, Z+26 ; 0x1a 33690: ce 01 movw r24, r28 33692: 4c 96 adiw r24, 0x1c ; 28 33694: 0f 94 a2 6f call 0x2df44 ; 0x2df44 parent = &dir2; 33698: 8e 01 movw r16, r28 3369a: 04 5e subi r16, 0xE4 ; 228 3369c: 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; 3369e: 81 11 cpse r24, r1 336a0: 02 c0 rjmp .+4 ; 0x336a6 336a2: bc cf rjmp .-136 ; 0x3361c // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 336a4: 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; 336a6: ce 01 movw r24, r28 336a8: 01 96 adiw r24, 0x01 ; 1 336aa: 7c 01 movw r14, r24 336ac: 3c 01 movw r6, r24 336ae: 2e 01 movw r4, r28 336b0: 9c e1 ldi r25, 0x1C ; 28 336b2: 49 0e add r4, r25 336b4: 51 1c adc r5, r1 336b6: 23 96 adiw r28, 0x03 ; 3 336b8: ef ae std Y+63, r14 ; 0x3f 336ba: 23 97 sbiw r28, 0x03 ; 3 336bc: 2f 2c mov r2, r15 336be: fe 01 movw r30, r28 336c0: f7 96 adiw r30, 0x37 ; 55 336c2: cf 01 movw r24, r30 336c4: 0b 96 adiw r24, 0x0b ; 11 336c6: 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++] = ' '; 336c8: 20 e2 ldi r18, 0x20 ; 32 336ca: 21 93 st Z+, r18 336cc: e8 17 cp r30, r24 336ce: f9 07 cpc r31, r25 336d0: d9 f7 brne .-10 ; 0x336c8 336d2: 96 01 movw r18, r12 i = 0; 336d4: 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 336d6: 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 != '/') { 336d8: d9 01 movw r26, r18 336da: 8d 91 ld r24, X+ 336dc: 88 23 and r24, r24 336de: 49 f1 breq .+82 ; 0x33732 336e0: 8f 32 cpi r24, 0x2F ; 47 336e2: 39 f1 breq .+78 ; 0x33732 c = *str++; 336e4: 28 2f mov r18, r24 if (c == '.') { 336e6: 8e 32 cpi r24, 0x2E ; 46 336e8: 39 f4 brne .+14 ; 0x336f8 if (n == 10) goto fail; // only one dot allowed 336ea: 6a 30 cpi r22, 0x0A ; 10 336ec: 09 f4 brne .+2 ; 0x336f0 336ee: 96 cf rjmp .-212 ; 0x3361c n = 10; // max index for full 8.3 name i = 8; // place for extension 336f0: 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 336f2: 6a e0 ldi r22, 0x0A ; 10 336f4: 9d 01 movw r18, r26 336f6: f0 cf rjmp .-32 ; 0x336d8 336f8: e8 e7 ldi r30, 0x78 ; 120 336fa: f2 ea ldi r31, 0xA2 ; 162 //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; 336fc: 34 91 lpm r19, Z 336fe: 33 23 and r19, r19 33700: 21 f0 breq .+8 ; 0x3370a 33702: 31 96 adiw r30, 0x01 ; 1 33704: 83 13 cpse r24, r19 33706: fa cf rjmp .-12 ; 0x336fc 33708: 89 cf rjmp .-238 ; 0x3361c // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3370a: 69 17 cp r22, r25 3370c: 08 f4 brcc .+2 ; 0x33710 3370e: 86 cf rjmp .-244 ; 0x3361c 33710: 3f ed ldi r19, 0xDF ; 223 33712: 38 0f add r19, r24 33714: 3e 35 cpi r19, 0x5E ; 94 33716: 08 f0 brcs .+2 ; 0x3371a 33718: 81 cf rjmp .-254 ; 0x3361c // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3371a: 3f e9 ldi r19, 0x9F ; 159 3371c: 38 0f add r19, r24 3371e: 3a 31 cpi r19, 0x1A ; 26 33720: 10 f4 brcc .+4 ; 0x33726 33722: 20 ee ldi r18, 0xE0 ; 224 33724: 28 0f add r18, r24 33726: fa 01 movw r30, r20 33728: e9 0f add r30, r25 3372a: f1 1d adc r31, r1 3372c: 20 83 st Z, r18 3372e: 9f 5f subi r25, 0xFF ; 255 33730: e1 cf rjmp .-62 ; 0x336f4 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 33732: 8f a9 ldd r24, Y+55 ; 0x37 33734: 80 32 cpi r24, 0x20 ; 32 33736: 09 f4 brne .+2 ; 0x3373a 33738: 71 cf rjmp .-286 ; 0x3361c 3373a: 69 01 movw r12, r18 while (*path == '/') path++; 3373c: f9 01 movw r30, r18 3373e: 80 81 ld r24, Z 33740: 2f 5f subi r18, 0xFF ; 255 33742: 3f 4f sbci r19, 0xFF ; 255 33744: 8f 32 cpi r24, 0x2F ; 47 33746: c9 f3 breq .-14 ; 0x3373a if (!*path) break; 33748: 88 23 and r24, r24 3374a: d9 f0 breq .+54 ; 0x33782 if (!sub->open(parent, dname, O_READ)) goto fail; 3374c: 21 e0 ldi r18, 0x01 ; 1 3374e: b8 01 movw r22, r16 33750: c7 01 movw r24, r14 33752: 0f 94 e8 73 call 0x2e7d0 ; 0x2e7d0 33756: 88 23 and r24, r24 33758: 09 f4 brne .+2 ; 0x3375c 3375a: 60 cf rjmp .-320 ; 0x3361c if (parent != dirFile) parent->close(); 3375c: 0a 15 cp r16, r10 3375e: 1b 05 cpc r17, r11 33760: 19 f0 breq .+6 ; 0x33768 33762: c8 01 movw r24, r16 33764: 0f 94 f2 6f call 0x2dfe4 ; 0x2dfe4 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 33768: 94 2d mov r25, r4 3376a: 85 2d mov r24, r5 3376c: 6e 14 cp r6, r14 3376e: 7f 04 cpc r7, r15 33770: 21 f0 breq .+8 ; 0x3377a 33772: 23 96 adiw r28, 0x03 ; 3 33774: 9f ad ldd r25, Y+63 ; 0x3f 33776: 23 97 sbiw r28, 0x03 ; 3 33778: 82 2d mov r24, r2 3377a: 87 01 movw r16, r14 3377c: e9 2e mov r14, r25 3377e: f8 2e mov r15, r24 33780: 9e cf rjmp .-196 ; 0x336be } return open(parent, dname, oflag); 33782: 23 2d mov r18, r3 33784: b8 01 movw r22, r16 33786: c4 01 movw r24, r8 33788: 0f 94 e8 73 call 0x2e7d0 ; 0x2e7d0 3378c: 18 2f mov r17, r24 3378e: 47 cf rjmp .-370 ; 0x3361e 00033790 <__floatunsisf>: 33790: e8 94 clt 33792: 09 c0 rjmp .+18 ; 0x337a6 <__floatsisf+0x12> 00033794 <__floatsisf>: 33794: 97 fb bst r25, 7 33796: 3e f4 brtc .+14 ; 0x337a6 <__floatsisf+0x12> 33798: 90 95 com r25 3379a: 80 95 com r24 3379c: 70 95 com r23 3379e: 61 95 neg r22 337a0: 7f 4f sbci r23, 0xFF ; 255 337a2: 8f 4f sbci r24, 0xFF ; 255 337a4: 9f 4f sbci r25, 0xFF ; 255 337a6: 99 23 and r25, r25 337a8: a9 f0 breq .+42 ; 0x337d4 <__floatsisf+0x40> 337aa: f9 2f mov r31, r25 337ac: 96 e9 ldi r25, 0x96 ; 150 337ae: bb 27 eor r27, r27 337b0: 93 95 inc r25 337b2: f6 95 lsr r31 337b4: 87 95 ror r24 337b6: 77 95 ror r23 337b8: 67 95 ror r22 337ba: b7 95 ror r27 337bc: f1 11 cpse r31, r1 337be: f8 cf rjmp .-16 ; 0x337b0 <__floatsisf+0x1c> 337c0: fa f4 brpl .+62 ; 0x33800 <__floatsisf+0x6c> 337c2: bb 0f add r27, r27 337c4: 11 f4 brne .+4 ; 0x337ca <__floatsisf+0x36> 337c6: 60 ff sbrs r22, 0 337c8: 1b c0 rjmp .+54 ; 0x33800 <__floatsisf+0x6c> 337ca: 6f 5f subi r22, 0xFF ; 255 337cc: 7f 4f sbci r23, 0xFF ; 255 337ce: 8f 4f sbci r24, 0xFF ; 255 337d0: 9f 4f sbci r25, 0xFF ; 255 337d2: 16 c0 rjmp .+44 ; 0x33800 <__floatsisf+0x6c> 337d4: 88 23 and r24, r24 337d6: 11 f0 breq .+4 ; 0x337dc <__floatsisf+0x48> 337d8: 96 e9 ldi r25, 0x96 ; 150 337da: 11 c0 rjmp .+34 ; 0x337fe <__floatsisf+0x6a> 337dc: 77 23 and r23, r23 337de: 21 f0 breq .+8 ; 0x337e8 <__floatsisf+0x54> 337e0: 9e e8 ldi r25, 0x8E ; 142 337e2: 87 2f mov r24, r23 337e4: 76 2f mov r23, r22 337e6: 05 c0 rjmp .+10 ; 0x337f2 <__floatsisf+0x5e> 337e8: 66 23 and r22, r22 337ea: 71 f0 breq .+28 ; 0x33808 <__floatsisf+0x74> 337ec: 96 e8 ldi r25, 0x86 ; 134 337ee: 86 2f mov r24, r22 337f0: 70 e0 ldi r23, 0x00 ; 0 337f2: 60 e0 ldi r22, 0x00 ; 0 337f4: 2a f0 brmi .+10 ; 0x33800 <__floatsisf+0x6c> 337f6: 9a 95 dec r25 337f8: 66 0f add r22, r22 337fa: 77 1f adc r23, r23 337fc: 88 1f adc r24, r24 337fe: da f7 brpl .-10 ; 0x337f6 <__floatsisf+0x62> 33800: 88 0f add r24, r24 33802: 96 95 lsr r25 33804: 87 95 ror r24 33806: 97 f9 bld r25, 7 33808: 08 95 ret 0003380a : 3380a: 9b 01 movw r18, r22 3380c: ac 01 movw r20, r24 3380e: 0d 94 09 9c jmp 0x33812 ; 0x33812 <__mulsf3> 00033812 <__mulsf3>: 33812: 0f 94 1c 9c call 0x33838 ; 0x33838 <__mulsf3x> 33816: 0d 94 8d 9c jmp 0x3391a ; 0x3391a <__fp_round> 3381a: 0f 94 7f 9c call 0x338fe ; 0x338fe <__fp_pscA> 3381e: 38 f0 brcs .+14 ; 0x3382e <__mulsf3+0x1c> 33820: 0f 94 86 9c call 0x3390c ; 0x3390c <__fp_pscB> 33824: 20 f0 brcs .+8 ; 0x3382e <__mulsf3+0x1c> 33826: 95 23 and r25, r21 33828: 11 f0 breq .+4 ; 0x3382e <__mulsf3+0x1c> 3382a: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 3382e: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 33832: 11 24 eor r1, r1 33834: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 00033838 <__mulsf3x>: 33838: 0f 94 9e 9c call 0x3393c ; 0x3393c <__fp_split3> 3383c: 70 f3 brcs .-36 ; 0x3381a <__mulsf3+0x8> 0003383e <__mulsf3_pse>: 3383e: 95 9f mul r25, r21 33840: c1 f3 breq .-16 ; 0x33832 <__mulsf3+0x20> 33842: 95 0f add r25, r21 33844: 50 e0 ldi r21, 0x00 ; 0 33846: 55 1f adc r21, r21 33848: 62 9f mul r22, r18 3384a: f0 01 movw r30, r0 3384c: 72 9f mul r23, r18 3384e: bb 27 eor r27, r27 33850: f0 0d add r31, r0 33852: b1 1d adc r27, r1 33854: 63 9f mul r22, r19 33856: aa 27 eor r26, r26 33858: f0 0d add r31, r0 3385a: b1 1d adc r27, r1 3385c: aa 1f adc r26, r26 3385e: 64 9f mul r22, r20 33860: 66 27 eor r22, r22 33862: b0 0d add r27, r0 33864: a1 1d adc r26, r1 33866: 66 1f adc r22, r22 33868: 82 9f mul r24, r18 3386a: 22 27 eor r18, r18 3386c: b0 0d add r27, r0 3386e: a1 1d adc r26, r1 33870: 62 1f adc r22, r18 33872: 73 9f mul r23, r19 33874: b0 0d add r27, r0 33876: a1 1d adc r26, r1 33878: 62 1f adc r22, r18 3387a: 83 9f mul r24, r19 3387c: a0 0d add r26, r0 3387e: 61 1d adc r22, r1 33880: 22 1f adc r18, r18 33882: 74 9f mul r23, r20 33884: 33 27 eor r19, r19 33886: a0 0d add r26, r0 33888: 61 1d adc r22, r1 3388a: 23 1f adc r18, r19 3388c: 84 9f mul r24, r20 3388e: 60 0d add r22, r0 33890: 21 1d adc r18, r1 33892: 82 2f mov r24, r18 33894: 76 2f mov r23, r22 33896: 6a 2f mov r22, r26 33898: 11 24 eor r1, r1 3389a: 9f 57 subi r25, 0x7F ; 127 3389c: 50 40 sbci r21, 0x00 ; 0 3389e: 9a f0 brmi .+38 ; 0x338c6 <__mulsf3_pse+0x88> 338a0: f1 f0 breq .+60 ; 0x338de <__mulsf3_pse+0xa0> 338a2: 88 23 and r24, r24 338a4: 4a f0 brmi .+18 ; 0x338b8 <__mulsf3_pse+0x7a> 338a6: ee 0f add r30, r30 338a8: ff 1f adc r31, r31 338aa: bb 1f adc r27, r27 338ac: 66 1f adc r22, r22 338ae: 77 1f adc r23, r23 338b0: 88 1f adc r24, r24 338b2: 91 50 subi r25, 0x01 ; 1 338b4: 50 40 sbci r21, 0x00 ; 0 338b6: a9 f7 brne .-22 ; 0x338a2 <__mulsf3_pse+0x64> 338b8: 9e 3f cpi r25, 0xFE ; 254 338ba: 51 05 cpc r21, r1 338bc: 80 f0 brcs .+32 ; 0x338de <__mulsf3_pse+0xa0> 338be: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 338c2: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 338c6: 5f 3f cpi r21, 0xFF ; 255 338c8: e4 f3 brlt .-8 ; 0x338c2 <__mulsf3_pse+0x84> 338ca: 98 3e cpi r25, 0xE8 ; 232 338cc: d4 f3 brlt .-12 ; 0x338c2 <__mulsf3_pse+0x84> 338ce: 86 95 lsr r24 338d0: 77 95 ror r23 338d2: 67 95 ror r22 338d4: b7 95 ror r27 338d6: f7 95 ror r31 338d8: e7 95 ror r30 338da: 9f 5f subi r25, 0xFF ; 255 338dc: c1 f7 brne .-16 ; 0x338ce <__mulsf3_pse+0x90> 338de: fe 2b or r31, r30 338e0: 88 0f add r24, r24 338e2: 91 1d adc r25, r1 338e4: 96 95 lsr r25 338e6: 87 95 ror r24 338e8: 97 f9 bld r25, 7 338ea: 08 95 ret 000338ec <__fp_inf>: 338ec: 97 f9 bld r25, 7 338ee: 9f 67 ori r25, 0x7F ; 127 338f0: 80 e8 ldi r24, 0x80 ; 128 338f2: 70 e0 ldi r23, 0x00 ; 0 338f4: 60 e0 ldi r22, 0x00 ; 0 338f6: 08 95 ret 000338f8 <__fp_nan>: 338f8: 9f ef ldi r25, 0xFF ; 255 338fa: 80 ec ldi r24, 0xC0 ; 192 338fc: 08 95 ret 000338fe <__fp_pscA>: 338fe: 00 24 eor r0, r0 33900: 0a 94 dec r0 33902: 16 16 cp r1, r22 33904: 17 06 cpc r1, r23 33906: 18 06 cpc r1, r24 33908: 09 06 cpc r0, r25 3390a: 08 95 ret 0003390c <__fp_pscB>: 3390c: 00 24 eor r0, r0 3390e: 0a 94 dec r0 33910: 12 16 cp r1, r18 33912: 13 06 cpc r1, r19 33914: 14 06 cpc r1, r20 33916: 05 06 cpc r0, r21 33918: 08 95 ret 0003391a <__fp_round>: 3391a: 09 2e mov r0, r25 3391c: 03 94 inc r0 3391e: 00 0c add r0, r0 33920: 11 f4 brne .+4 ; 0x33926 <__fp_round+0xc> 33922: 88 23 and r24, r24 33924: 52 f0 brmi .+20 ; 0x3393a <__fp_round+0x20> 33926: bb 0f add r27, r27 33928: 40 f4 brcc .+16 ; 0x3393a <__fp_round+0x20> 3392a: bf 2b or r27, r31 3392c: 11 f4 brne .+4 ; 0x33932 <__fp_round+0x18> 3392e: 60 ff sbrs r22, 0 33930: 04 c0 rjmp .+8 ; 0x3393a <__fp_round+0x20> 33932: 6f 5f subi r22, 0xFF ; 255 33934: 7f 4f sbci r23, 0xFF ; 255 33936: 8f 4f sbci r24, 0xFF ; 255 33938: 9f 4f sbci r25, 0xFF ; 255 3393a: 08 95 ret 0003393c <__fp_split3>: 3393c: 57 fd sbrc r21, 7 3393e: 90 58 subi r25, 0x80 ; 128 33940: 44 0f add r20, r20 33942: 55 1f adc r21, r21 33944: 59 f0 breq .+22 ; 0x3395c <__fp_splitA+0x10> 33946: 5f 3f cpi r21, 0xFF ; 255 33948: 71 f0 breq .+28 ; 0x33966 <__fp_splitA+0x1a> 3394a: 47 95 ror r20 0003394c <__fp_splitA>: 3394c: 88 0f add r24, r24 3394e: 97 fb bst r25, 7 33950: 99 1f adc r25, r25 33952: 61 f0 breq .+24 ; 0x3396c <__fp_splitA+0x20> 33954: 9f 3f cpi r25, 0xFF ; 255 33956: 79 f0 breq .+30 ; 0x33976 <__fp_splitA+0x2a> 33958: 87 95 ror r24 3395a: 08 95 ret 3395c: 12 16 cp r1, r18 3395e: 13 06 cpc r1, r19 33960: 14 06 cpc r1, r20 33962: 55 1f adc r21, r21 33964: f2 cf rjmp .-28 ; 0x3394a <__fp_split3+0xe> 33966: 46 95 lsr r20 33968: f1 df rcall .-30 ; 0x3394c <__fp_splitA> 3396a: 08 c0 rjmp .+16 ; 0x3397c <__fp_splitA+0x30> 3396c: 16 16 cp r1, r22 3396e: 17 06 cpc r1, r23 33970: 18 06 cpc r1, r24 33972: 99 1f adc r25, r25 33974: f1 cf rjmp .-30 ; 0x33958 <__fp_splitA+0xc> 33976: 86 95 lsr r24 33978: 71 05 cpc r23, r1 3397a: 61 05 cpc r22, r1 3397c: 08 94 sec 3397e: 08 95 ret 00033980 <__fp_zero>: 33980: e8 94 clt 00033982 <__fp_szero>: 33982: bb 27 eor r27, r27 33984: 66 27 eor r22, r22 33986: 77 27 eor r23, r23 33988: cb 01 movw r24, r22 3398a: 97 f9 bld r25, 7 3398c: 08 95 ret 0003398e : 3398e: 3f 92 push r3 33990: 4f 92 push r4 33992: 5f 92 push r5 33994: 6f 92 push r6 33996: 7f 92 push r7 33998: 8f 92 push r8 3399a: 9f 92 push r9 3399c: af 92 push r10 3399e: bf 92 push r11 339a0: cf 92 push r12 339a2: df 92 push r13 339a4: ef 92 push r14 339a6: ff 92 push r15 339a8: 0f 93 push r16 339aa: 1f 93 push r17 339ac: cf 93 push r28 339ae: df 93 push r29 339b0: 5c 01 movw r10, r24 339b2: 6b 01 movw r12, r22 339b4: 7a 01 movw r14, r20 339b6: 61 15 cp r22, r1 339b8: 71 05 cpc r23, r1 339ba: 19 f0 breq .+6 ; 0x339c2 339bc: fb 01 movw r30, r22 339be: 91 83 std Z+1, r25 ; 0x01 339c0: 80 83 st Z, r24 339c2: e1 14 cp r14, r1 339c4: f1 04 cpc r15, r1 339c6: 51 f0 breq .+20 ; 0x339dc 339c8: c7 01 movw r24, r14 339ca: 02 97 sbiw r24, 0x02 ; 2 339cc: 83 97 sbiw r24, 0x23 ; 35 339ce: 30 f0 brcs .+12 ; 0x339dc 339d0: 40 e0 ldi r20, 0x00 ; 0 339d2: 30 e0 ldi r19, 0x00 ; 0 339d4: 20 e0 ldi r18, 0x00 ; 0 339d6: 90 e0 ldi r25, 0x00 ; 0 339d8: 6b c0 rjmp .+214 ; 0x33ab0 339da: 5e 01 movw r10, r28 339dc: e5 01 movw r28, r10 339de: 21 96 adiw r28, 0x01 ; 1 339e0: f5 01 movw r30, r10 339e2: 10 81 ld r17, Z 339e4: 81 2f mov r24, r17 339e6: 90 e0 ldi r25, 0x00 ; 0 339e8: 0f 94 cd 9e call 0x33d9a ; 0x33d9a 339ec: 89 2b or r24, r25 339ee: a9 f7 brne .-22 ; 0x339da 339f0: 1d 32 cpi r17, 0x2D ; 45 339f2: 01 f5 brne .+64 ; 0x33a34 339f4: 21 96 adiw r28, 0x01 ; 1 339f6: f5 01 movw r30, r10 339f8: 11 81 ldd r17, Z+1 ; 0x01 339fa: 01 e0 ldi r16, 0x01 ; 1 339fc: e1 14 cp r14, r1 339fe: f1 04 cpc r15, r1 33a00: 09 f4 brne .+2 ; 0x33a04 33a02: e6 c0 rjmp .+460 ; 0x33bd0 33a04: f0 e1 ldi r31, 0x10 ; 16 33a06: ef 16 cp r14, r31 33a08: f1 04 cpc r15, r1 33a0a: 09 f0 breq .+2 ; 0x33a0e 33a0c: 88 c0 rjmp .+272 ; 0x33b1e 33a0e: 10 33 cpi r17, 0x30 ; 48 33a10: 59 f4 brne .+22 ; 0x33a28 33a12: 88 81 ld r24, Y 33a14: 8f 7d andi r24, 0xDF ; 223 33a16: 88 35 cpi r24, 0x58 ; 88 33a18: 09 f0 breq .+2 ; 0x33a1c 33a1a: 7c c0 rjmp .+248 ; 0x33b14 33a1c: 19 81 ldd r17, Y+1 ; 0x01 33a1e: 22 96 adiw r28, 0x02 ; 2 33a20: 02 60 ori r16, 0x02 ; 2 33a22: f0 e1 ldi r31, 0x10 ; 16 33a24: ef 2e mov r14, r31 33a26: f1 2c mov r15, r1 33a28: 81 2c mov r8, r1 33a2a: 91 2c mov r9, r1 33a2c: a1 2c mov r10, r1 33a2e: 88 e0 ldi r24, 0x08 ; 8 33a30: b8 2e mov r11, r24 33a32: 92 c0 rjmp .+292 ; 0x33b58 33a34: 1b 32 cpi r17, 0x2B ; 43 33a36: 21 f4 brne .+8 ; 0x33a40 33a38: e5 01 movw r28, r10 33a3a: 22 96 adiw r28, 0x02 ; 2 33a3c: f5 01 movw r30, r10 33a3e: 11 81 ldd r17, Z+1 ; 0x01 33a40: 00 e0 ldi r16, 0x00 ; 0 33a42: dc cf rjmp .-72 ; 0x339fc 33a44: ea e0 ldi r30, 0x0A ; 10 33a46: ee 16 cp r14, r30 33a48: f1 04 cpc r15, r1 33a4a: 09 f4 brne .+2 ; 0x33a4e 33a4c: c7 c0 rjmp .+398 ; 0x33bdc 33a4e: f0 e1 ldi r31, 0x10 ; 16 33a50: ef 16 cp r14, r31 33a52: f1 04 cpc r15, r1 33a54: 09 f0 breq .+2 ; 0x33a58 33a56: 73 c0 rjmp .+230 ; 0x33b3e 33a58: e7 cf rjmp .-50 ; 0x33a28 33a5a: 78 e0 ldi r23, 0x08 ; 8 33a5c: e7 2e mov r14, r23 33a5e: f1 2c mov r15, r1 33a60: 81 2c mov r8, r1 33a62: 91 2c mov r9, r1 33a64: a1 2c mov r10, r1 33a66: 60 e1 ldi r22, 0x10 ; 16 33a68: b6 2e mov r11, r22 33a6a: 76 c0 rjmp .+236 ; 0x33b58 33a6c: 21 e0 ldi r18, 0x01 ; 1 33a6e: ad c0 rjmp .+346 ; 0x33bca 33a70: 30 2f mov r19, r16 33a72: 31 70 andi r19, 0x01 ; 1 33a74: c1 14 cp r12, r1 33a76: d1 04 cpc r13, r1 33a78: 31 f0 breq .+12 ; 0x33a86 33a7a: 22 23 and r18, r18 33a7c: 71 f1 breq .+92 ; 0x33ada 33a7e: 21 97 sbiw r28, 0x01 ; 1 33a80: f6 01 movw r30, r12 33a82: d1 83 std Z+1, r29 ; 0x01 33a84: c0 83 st Z, r28 33a86: 27 ff sbrs r18, 7 33a88: 2e c0 rjmp .+92 ; 0x33ae6 33a8a: 60 e0 ldi r22, 0x00 ; 0 33a8c: 70 e0 ldi r23, 0x00 ; 0 33a8e: 80 e0 ldi r24, 0x00 ; 0 33a90: 90 e8 ldi r25, 0x80 ; 128 33a92: 31 11 cpse r19, r1 33a94: 04 c0 rjmp .+8 ; 0x33a9e 33a96: 6f ef ldi r22, 0xFF ; 255 33a98: 7f ef ldi r23, 0xFF ; 255 33a9a: 8f ef ldi r24, 0xFF ; 255 33a9c: 9f e7 ldi r25, 0x7F ; 127 33a9e: 22 e2 ldi r18, 0x22 ; 34 33aa0: 30 e0 ldi r19, 0x00 ; 0 33aa2: 30 93 f9 16 sts 0x16F9, r19 ; 0x8016f9 33aa6: 20 93 f8 16 sts 0x16F8, r18 ; 0x8016f8 33aaa: 46 2f mov r20, r22 33aac: 37 2f mov r19, r23 33aae: 28 2f mov r18, r24 33ab0: 64 2f mov r22, r20 33ab2: 73 2f mov r23, r19 33ab4: 82 2f mov r24, r18 33ab6: df 91 pop r29 33ab8: cf 91 pop r28 33aba: 1f 91 pop r17 33abc: 0f 91 pop r16 33abe: ff 90 pop r15 33ac0: ef 90 pop r14 33ac2: df 90 pop r13 33ac4: cf 90 pop r12 33ac6: bf 90 pop r11 33ac8: af 90 pop r10 33aca: 9f 90 pop r9 33acc: 8f 90 pop r8 33ace: 7f 90 pop r7 33ad0: 6f 90 pop r6 33ad2: 5f 90 pop r5 33ad4: 4f 90 pop r4 33ad6: 3f 90 pop r3 33ad8: 08 95 ret 33ada: 01 ff sbrs r16, 1 33adc: 04 c0 rjmp .+8 ; 0x33ae6 33ade: 22 97 sbiw r28, 0x02 ; 2 33ae0: f6 01 movw r30, r12 33ae2: d1 83 std Z+1, r29 ; 0x01 33ae4: c0 83 st Z, r28 33ae6: 33 23 and r19, r19 33ae8: 41 f0 breq .+16 ; 0x33afa 33aea: 90 95 com r25 33aec: 80 95 com r24 33aee: 70 95 com r23 33af0: 61 95 neg r22 33af2: 7f 4f sbci r23, 0xFF ; 255 33af4: 8f 4f sbci r24, 0xFF ; 255 33af6: 9f 4f sbci r25, 0xFF ; 255 33af8: d8 cf rjmp .-80 ; 0x33aaa 33afa: 97 ff sbrs r25, 7 33afc: d6 cf rjmp .-84 ; 0x33aaa 33afe: 82 e2 ldi r24, 0x22 ; 34 33b00: 90 e0 ldi r25, 0x00 ; 0 33b02: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 33b06: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 33b0a: 6f ef ldi r22, 0xFF ; 255 33b0c: 7f ef ldi r23, 0xFF ; 255 33b0e: 8f ef ldi r24, 0xFF ; 255 33b10: 9f e7 ldi r25, 0x7F ; 127 33b12: cb cf rjmp .-106 ; 0x33aaa 33b14: 10 e3 ldi r17, 0x30 ; 48 33b16: e1 14 cp r14, r1 33b18: f1 04 cpc r15, r1 33b1a: 09 f4 brne .+2 ; 0x33b1e 33b1c: 9e cf rjmp .-196 ; 0x33a5a 33b1e: 28 e0 ldi r18, 0x08 ; 8 33b20: e2 16 cp r14, r18 33b22: f1 04 cpc r15, r1 33b24: 09 f4 brne .+2 ; 0x33b28 33b26: 9c cf rjmp .-200 ; 0x33a60 33b28: 0c f0 brlt .+2 ; 0x33b2c 33b2a: 8c cf rjmp .-232 ; 0x33a44 33b2c: 81 2c mov r8, r1 33b2e: 91 2c mov r9, r1 33b30: a1 2c mov r10, r1 33b32: e0 e4 ldi r30, 0x40 ; 64 33b34: be 2e mov r11, r30 33b36: 82 e0 ldi r24, 0x02 ; 2 33b38: e8 16 cp r14, r24 33b3a: f1 04 cpc r15, r1 33b3c: 69 f0 breq .+26 ; 0x33b58 33b3e: 60 e0 ldi r22, 0x00 ; 0 33b40: 70 e0 ldi r23, 0x00 ; 0 33b42: 80 e0 ldi r24, 0x00 ; 0 33b44: 90 e8 ldi r25, 0x80 ; 128 33b46: 97 01 movw r18, r14 33b48: 0f 2c mov r0, r15 33b4a: 00 0c add r0, r0 33b4c: 44 0b sbc r20, r20 33b4e: 55 0b sbc r21, r21 33b50: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 33b54: 49 01 movw r8, r18 33b56: 5a 01 movw r10, r20 33b58: 20 e0 ldi r18, 0x00 ; 0 33b5a: 60 e0 ldi r22, 0x00 ; 0 33b5c: 70 e0 ldi r23, 0x00 ; 0 33b5e: cb 01 movw r24, r22 33b60: 27 01 movw r4, r14 33b62: 0f 2c mov r0, r15 33b64: 00 0c add r0, r0 33b66: 66 08 sbc r6, r6 33b68: 77 08 sbc r7, r7 33b6a: fe 01 movw r30, r28 33b6c: 50 ed ldi r21, 0xD0 ; 208 33b6e: 35 2e mov r3, r21 33b70: 31 0e add r3, r17 33b72: 39 e0 ldi r19, 0x09 ; 9 33b74: 33 15 cp r19, r3 33b76: 70 f4 brcc .+28 ; 0x33b94 33b78: 3f eb ldi r19, 0xBF ; 191 33b7a: 31 0f add r19, r17 33b7c: 49 ec ldi r20, 0xC9 ; 201 33b7e: 34 2e mov r3, r20 33b80: 3a 31 cpi r19, 0x1A ; 26 33b82: 38 f0 brcs .+14 ; 0x33b92 33b84: 3f e9 ldi r19, 0x9F ; 159 33b86: 31 0f add r19, r17 33b88: 3a 31 cpi r19, 0x1A ; 26 33b8a: 08 f0 brcs .+2 ; 0x33b8e 33b8c: 71 cf rjmp .-286 ; 0x33a70 33b8e: 39 ea ldi r19, 0xA9 ; 169 33b90: 33 2e mov r3, r19 33b92: 31 0e add r3, r17 33b94: 3e 14 cp r3, r14 33b96: 1f 04 cpc r1, r15 33b98: 0c f0 brlt .+2 ; 0x33b9c 33b9a: 6a cf rjmp .-300 ; 0x33a70 33b9c: 27 fd sbrc r18, 7 33b9e: 15 c0 rjmp .+42 ; 0x33bca 33ba0: 86 16 cp r8, r22 33ba2: 97 06 cpc r9, r23 33ba4: a8 06 cpc r10, r24 33ba6: b9 06 cpc r11, r25 33ba8: 78 f0 brcs .+30 ; 0x33bc8 33baa: a3 01 movw r20, r6 33bac: 92 01 movw r18, r4 33bae: 0f 94 9f a1 call 0x3433e ; 0x3433e <__mulsi3> 33bb2: 63 0d add r22, r3 33bb4: 71 1d adc r23, r1 33bb6: 81 1d adc r24, r1 33bb8: 91 1d adc r25, r1 33bba: 61 30 cpi r22, 0x01 ; 1 33bbc: 71 05 cpc r23, r1 33bbe: 81 05 cpc r24, r1 33bc0: 20 e8 ldi r18, 0x80 ; 128 33bc2: 92 07 cpc r25, r18 33bc4: 08 f4 brcc .+2 ; 0x33bc8 33bc6: 52 cf rjmp .-348 ; 0x33a6c 33bc8: 2f ef ldi r18, 0xFF ; 255 33bca: 21 96 adiw r28, 0x01 ; 1 33bcc: 10 81 ld r17, Z 33bce: cd cf rjmp .-102 ; 0x33b6a 33bd0: 10 33 cpi r17, 0x30 ; 48 33bd2: 09 f4 brne .+2 ; 0x33bd6 33bd4: 1e cf rjmp .-452 ; 0x33a12 33bd6: 2a e0 ldi r18, 0x0A ; 10 33bd8: e2 2e mov r14, r18 33bda: f1 2c mov r15, r1 33bdc: 9c ec ldi r25, 0xCC ; 204 33bde: 89 2e mov r8, r25 33be0: 98 2c mov r9, r8 33be2: a8 2c mov r10, r8 33be4: 9c e0 ldi r25, 0x0C ; 12 33be6: b9 2e mov r11, r25 33be8: b7 cf rjmp .-146 ; 0x33b58 00033bea <__ftoa_engine>: 33bea: 28 30 cpi r18, 0x08 ; 8 33bec: 08 f0 brcs .+2 ; 0x33bf0 <__ftoa_engine+0x6> 33bee: 27 e0 ldi r18, 0x07 ; 7 33bf0: 33 27 eor r19, r19 33bf2: da 01 movw r26, r20 33bf4: 99 0f add r25, r25 33bf6: 31 1d adc r19, r1 33bf8: 87 fd sbrc r24, 7 33bfa: 91 60 ori r25, 0x01 ; 1 33bfc: 00 96 adiw r24, 0x00 ; 0 33bfe: 61 05 cpc r22, r1 33c00: 71 05 cpc r23, r1 33c02: 39 f4 brne .+14 ; 0x33c12 <__ftoa_engine+0x28> 33c04: 32 60 ori r19, 0x02 ; 2 33c06: 2e 5f subi r18, 0xFE ; 254 33c08: 3d 93 st X+, r19 33c0a: 30 e3 ldi r19, 0x30 ; 48 33c0c: 2a 95 dec r18 33c0e: e1 f7 brne .-8 ; 0x33c08 <__ftoa_engine+0x1e> 33c10: 08 95 ret 33c12: 9f 3f cpi r25, 0xFF ; 255 33c14: 30 f0 brcs .+12 ; 0x33c22 <__ftoa_engine+0x38> 33c16: 80 38 cpi r24, 0x80 ; 128 33c18: 71 05 cpc r23, r1 33c1a: 61 05 cpc r22, r1 33c1c: 09 f0 breq .+2 ; 0x33c20 <__ftoa_engine+0x36> 33c1e: 3c 5f subi r19, 0xFC ; 252 33c20: 3c 5f subi r19, 0xFC ; 252 33c22: 3d 93 st X+, r19 33c24: 91 30 cpi r25, 0x01 ; 1 33c26: 08 f0 brcs .+2 ; 0x33c2a <__ftoa_engine+0x40> 33c28: 80 68 ori r24, 0x80 ; 128 33c2a: 91 1d adc r25, r1 33c2c: df 93 push r29 33c2e: cf 93 push r28 33c30: 1f 93 push r17 33c32: 0f 93 push r16 33c34: ff 92 push r15 33c36: ef 92 push r14 33c38: 19 2f mov r17, r25 33c3a: 98 7f andi r25, 0xF8 ; 248 33c3c: 96 95 lsr r25 33c3e: e9 2f mov r30, r25 33c40: 96 95 lsr r25 33c42: 96 95 lsr r25 33c44: e9 0f add r30, r25 33c46: ff 27 eor r31, r31 33c48: e0 5b subi r30, 0xB0 ; 176 33c4a: fd 48 sbci r31, 0x8D ; 141 33c4c: 99 27 eor r25, r25 33c4e: 33 27 eor r19, r19 33c50: ee 24 eor r14, r14 33c52: ff 24 eor r15, r15 33c54: a7 01 movw r20, r14 33c56: e7 01 movw r28, r14 33c58: 05 90 lpm r0, Z+ 33c5a: 08 94 sec 33c5c: 07 94 ror r0 33c5e: 28 f4 brcc .+10 ; 0x33c6a <__ftoa_engine+0x80> 33c60: 36 0f add r19, r22 33c62: e7 1e adc r14, r23 33c64: f8 1e adc r15, r24 33c66: 49 1f adc r20, r25 33c68: 51 1d adc r21, r1 33c6a: 66 0f add r22, r22 33c6c: 77 1f adc r23, r23 33c6e: 88 1f adc r24, r24 33c70: 99 1f adc r25, r25 33c72: 06 94 lsr r0 33c74: a1 f7 brne .-24 ; 0x33c5e <__ftoa_engine+0x74> 33c76: 05 90 lpm r0, Z+ 33c78: 07 94 ror r0 33c7a: 28 f4 brcc .+10 ; 0x33c86 <__ftoa_engine+0x9c> 33c7c: e7 0e add r14, r23 33c7e: f8 1e adc r15, r24 33c80: 49 1f adc r20, r25 33c82: 56 1f adc r21, r22 33c84: c1 1d adc r28, r1 33c86: 77 0f add r23, r23 33c88: 88 1f adc r24, r24 33c8a: 99 1f adc r25, r25 33c8c: 66 1f adc r22, r22 33c8e: 06 94 lsr r0 33c90: a1 f7 brne .-24 ; 0x33c7a <__ftoa_engine+0x90> 33c92: 05 90 lpm r0, Z+ 33c94: 07 94 ror r0 33c96: 28 f4 brcc .+10 ; 0x33ca2 <__ftoa_engine+0xb8> 33c98: f8 0e add r15, r24 33c9a: 49 1f adc r20, r25 33c9c: 56 1f adc r21, r22 33c9e: c7 1f adc r28, r23 33ca0: d1 1d adc r29, r1 33ca2: 88 0f add r24, r24 33ca4: 99 1f adc r25, r25 33ca6: 66 1f adc r22, r22 33ca8: 77 1f adc r23, r23 33caa: 06 94 lsr r0 33cac: a1 f7 brne .-24 ; 0x33c96 <__ftoa_engine+0xac> 33cae: 05 90 lpm r0, Z+ 33cb0: 07 94 ror r0 33cb2: 20 f4 brcc .+8 ; 0x33cbc <__ftoa_engine+0xd2> 33cb4: 49 0f add r20, r25 33cb6: 56 1f adc r21, r22 33cb8: c7 1f adc r28, r23 33cba: d8 1f adc r29, r24 33cbc: 99 0f add r25, r25 33cbe: 66 1f adc r22, r22 33cc0: 77 1f adc r23, r23 33cc2: 88 1f adc r24, r24 33cc4: 06 94 lsr r0 33cc6: a9 f7 brne .-22 ; 0x33cb2 <__ftoa_engine+0xc8> 33cc8: 84 91 lpm r24, Z 33cca: 10 95 com r17 33ccc: 17 70 andi r17, 0x07 ; 7 33cce: 41 f0 breq .+16 ; 0x33ce0 <__ftoa_engine+0xf6> 33cd0: d6 95 lsr r29 33cd2: c7 95 ror r28 33cd4: 57 95 ror r21 33cd6: 47 95 ror r20 33cd8: f7 94 ror r15 33cda: e7 94 ror r14 33cdc: 1a 95 dec r17 33cde: c1 f7 brne .-16 ; 0x33cd0 <__ftoa_engine+0xe6> 33ce0: e6 ef ldi r30, 0xF6 ; 246 33ce2: f1 e7 ldi r31, 0x71 ; 113 33ce4: 68 94 set 33ce6: 15 90 lpm r1, Z+ 33ce8: 15 91 lpm r17, Z+ 33cea: 35 91 lpm r19, Z+ 33cec: 65 91 lpm r22, Z+ 33cee: 95 91 lpm r25, Z+ 33cf0: 05 90 lpm r0, Z+ 33cf2: 7f e2 ldi r23, 0x2F ; 47 33cf4: 73 95 inc r23 33cf6: e1 18 sub r14, r1 33cf8: f1 0a sbc r15, r17 33cfa: 43 0b sbc r20, r19 33cfc: 56 0b sbc r21, r22 33cfe: c9 0b sbc r28, r25 33d00: d0 09 sbc r29, r0 33d02: c0 f7 brcc .-16 ; 0x33cf4 <__ftoa_engine+0x10a> 33d04: e1 0c add r14, r1 33d06: f1 1e adc r15, r17 33d08: 43 1f adc r20, r19 33d0a: 56 1f adc r21, r22 33d0c: c9 1f adc r28, r25 33d0e: d0 1d adc r29, r0 33d10: 7e f4 brtc .+30 ; 0x33d30 <__ftoa_engine+0x146> 33d12: 70 33 cpi r23, 0x30 ; 48 33d14: 11 f4 brne .+4 ; 0x33d1a <__ftoa_engine+0x130> 33d16: 8a 95 dec r24 33d18: e6 cf rjmp .-52 ; 0x33ce6 <__ftoa_engine+0xfc> 33d1a: e8 94 clt 33d1c: 01 50 subi r16, 0x01 ; 1 33d1e: 30 f0 brcs .+12 ; 0x33d2c <__ftoa_engine+0x142> 33d20: 08 0f add r16, r24 33d22: 0a f4 brpl .+2 ; 0x33d26 <__ftoa_engine+0x13c> 33d24: 00 27 eor r16, r16 33d26: 02 17 cp r16, r18 33d28: 08 f4 brcc .+2 ; 0x33d2c <__ftoa_engine+0x142> 33d2a: 20 2f mov r18, r16 33d2c: 23 95 inc r18 33d2e: 02 2f mov r16, r18 33d30: 7a 33 cpi r23, 0x3A ; 58 33d32: 28 f0 brcs .+10 ; 0x33d3e <__ftoa_engine+0x154> 33d34: 79 e3 ldi r23, 0x39 ; 57 33d36: 7d 93 st X+, r23 33d38: 2a 95 dec r18 33d3a: e9 f7 brne .-6 ; 0x33d36 <__ftoa_engine+0x14c> 33d3c: 10 c0 rjmp .+32 ; 0x33d5e <__ftoa_engine+0x174> 33d3e: 7d 93 st X+, r23 33d40: 2a 95 dec r18 33d42: 89 f6 brne .-94 ; 0x33ce6 <__ftoa_engine+0xfc> 33d44: 06 94 lsr r0 33d46: 97 95 ror r25 33d48: 67 95 ror r22 33d4a: 37 95 ror r19 33d4c: 17 95 ror r17 33d4e: 17 94 ror r1 33d50: e1 18 sub r14, r1 33d52: f1 0a sbc r15, r17 33d54: 43 0b sbc r20, r19 33d56: 56 0b sbc r21, r22 33d58: c9 0b sbc r28, r25 33d5a: d0 09 sbc r29, r0 33d5c: 98 f0 brcs .+38 ; 0x33d84 <__ftoa_engine+0x19a> 33d5e: 23 95 inc r18 33d60: 7e 91 ld r23, -X 33d62: 73 95 inc r23 33d64: 7a 33 cpi r23, 0x3A ; 58 33d66: 08 f0 brcs .+2 ; 0x33d6a <__ftoa_engine+0x180> 33d68: 70 e3 ldi r23, 0x30 ; 48 33d6a: 7c 93 st X, r23 33d6c: 20 13 cpse r18, r16 33d6e: b8 f7 brcc .-18 ; 0x33d5e <__ftoa_engine+0x174> 33d70: 7e 91 ld r23, -X 33d72: 70 61 ori r23, 0x10 ; 16 33d74: 7d 93 st X+, r23 33d76: 30 f0 brcs .+12 ; 0x33d84 <__ftoa_engine+0x19a> 33d78: 83 95 inc r24 33d7a: 71 e3 ldi r23, 0x31 ; 49 33d7c: 7d 93 st X+, r23 33d7e: 70 e3 ldi r23, 0x30 ; 48 33d80: 2a 95 dec r18 33d82: e1 f7 brne .-8 ; 0x33d7c <__ftoa_engine+0x192> 33d84: 11 24 eor r1, r1 33d86: ef 90 pop r14 33d88: ff 90 pop r15 33d8a: 0f 91 pop r16 33d8c: 1f 91 pop r17 33d8e: cf 91 pop r28 33d90: df 91 pop r29 33d92: 99 27 eor r25, r25 33d94: 87 fd sbrc r24, 7 33d96: 90 95 com r25 33d98: 08 95 ret 00033d9a : 33d9a: 91 11 cpse r25, r1 33d9c: 0d 94 29 a1 jmp 0x34252 ; 0x34252 <__ctype_isfalse> 33da0: 80 32 cpi r24, 0x20 ; 32 33da2: 19 f0 breq .+6 ; 0x33daa 33da4: 89 50 subi r24, 0x09 ; 9 33da6: 85 50 subi r24, 0x05 ; 5 33da8: c8 f7 brcc .-14 ; 0x33d9c 33daa: 08 95 ret 00033dac : 33dac: fb 01 movw r30, r22 33dae: dc 01 movw r26, r24 33db0: 02 c0 rjmp .+4 ; 0x33db6 33db2: 05 90 lpm r0, Z+ 33db4: 0d 92 st X+, r0 33db6: 41 50 subi r20, 0x01 ; 1 33db8: 50 40 sbci r21, 0x00 ; 0 33dba: d8 f7 brcc .-10 ; 0x33db2 33dbc: 08 95 ret 00033dbe : 33dbe: fb 01 movw r30, r22 33dc0: dc 01 movw r26, r24 33dc2: 0d 90 ld r0, X+ 33dc4: 00 20 and r0, r0 33dc6: e9 f7 brne .-6 ; 0x33dc2 33dc8: 11 97 sbiw r26, 0x01 ; 1 33dca: 05 90 lpm r0, Z+ 33dcc: 0d 92 st X+, r0 33dce: 00 20 and r0, r0 33dd0: e1 f7 brne .-8 ; 0x33dca 33dd2: 08 95 ret 00033dd4 : 33dd4: fb 01 movw r30, r22 33dd6: dc 01 movw r26, r24 33dd8: 8d 91 ld r24, X+ 33dda: 05 90 lpm r0, Z+ 33ddc: 80 19 sub r24, r0 33dde: 01 10 cpse r0, r1 33de0: d9 f3 breq .-10 ; 0x33dd8 33de2: 99 0b sbc r25, r25 33de4: 08 95 ret 00033de6 : 33de6: fb 01 movw r30, r22 33de8: dc 01 movw r26, r24 33dea: 05 90 lpm r0, Z+ 33dec: 0d 92 st X+, r0 33dee: 00 20 and r0, r0 33df0: e1 f7 brne .-8 ; 0x33dea 33df2: 08 95 ret 00033df4 <__strlen_P>: 33df4: fc 01 movw r30, r24 33df6: 05 90 lpm r0, Z+ 33df8: 00 20 and r0, r0 33dfa: e9 f7 brne .-6 ; 0x33df6 <__strlen_P+0x2> 33dfc: 80 95 com r24 33dfe: 90 95 com r25 33e00: 8e 0f add r24, r30 33e02: 9f 1f adc r25, r31 33e04: 08 95 ret 00033e06 : 33e06: fb 01 movw r30, r22 33e08: dc 01 movw r26, r24 33e0a: 41 50 subi r20, 0x01 ; 1 33e0c: 50 40 sbci r21, 0x00 ; 0 33e0e: 88 f0 brcs .+34 ; 0x33e32 33e10: 8d 91 ld r24, X+ 33e12: 81 34 cpi r24, 0x41 ; 65 33e14: 1c f0 brlt .+6 ; 0x33e1c 33e16: 8b 35 cpi r24, 0x5B ; 91 33e18: 0c f4 brge .+2 ; 0x33e1c 33e1a: 80 5e subi r24, 0xE0 ; 224 33e1c: 65 91 lpm r22, Z+ 33e1e: 61 34 cpi r22, 0x41 ; 65 33e20: 1c f0 brlt .+6 ; 0x33e28 33e22: 6b 35 cpi r22, 0x5B ; 91 33e24: 0c f4 brge .+2 ; 0x33e28 33e26: 60 5e subi r22, 0xE0 ; 224 33e28: 86 1b sub r24, r22 33e2a: 61 11 cpse r22, r1 33e2c: 71 f3 breq .-36 ; 0x33e0a 33e2e: 99 0b sbc r25, r25 33e30: 08 95 ret 33e32: 88 1b sub r24, r24 33e34: fc cf rjmp .-8 ; 0x33e2e 00033e36 : 33e36: fb 01 movw r30, r22 33e38: dc 01 movw r26, r24 33e3a: 41 50 subi r20, 0x01 ; 1 33e3c: 50 40 sbci r21, 0x00 ; 0 33e3e: 30 f0 brcs .+12 ; 0x33e4c 33e40: 8d 91 ld r24, X+ 33e42: 05 90 lpm r0, Z+ 33e44: 80 19 sub r24, r0 33e46: 19 f4 brne .+6 ; 0x33e4e 33e48: 00 20 and r0, r0 33e4a: b9 f7 brne .-18 ; 0x33e3a 33e4c: 88 1b sub r24, r24 33e4e: 99 0b sbc r25, r25 33e50: 08 95 ret 00033e52 : 33e52: fb 01 movw r30, r22 33e54: dc 01 movw r26, r24 33e56: 41 50 subi r20, 0x01 ; 1 33e58: 50 40 sbci r21, 0x00 ; 0 33e5a: 48 f0 brcs .+18 ; 0x33e6e 33e5c: 05 90 lpm r0, Z+ 33e5e: 0d 92 st X+, r0 33e60: 00 20 and r0, r0 33e62: c9 f7 brne .-14 ; 0x33e56 33e64: 01 c0 rjmp .+2 ; 0x33e68 33e66: 1d 92 st X+, r1 33e68: 41 50 subi r20, 0x01 ; 1 33e6a: 50 40 sbci r21, 0x00 ; 0 33e6c: e0 f7 brcc .-8 ; 0x33e66 33e6e: 08 95 ret 00033e70 : 33e70: fc 01 movw r30, r24 33e72: 05 90 lpm r0, Z+ 33e74: 61 50 subi r22, 0x01 ; 1 33e76: 70 40 sbci r23, 0x00 ; 0 33e78: 01 10 cpse r0, r1 33e7a: d8 f7 brcc .-10 ; 0x33e72 33e7c: 80 95 com r24 33e7e: 90 95 com r25 33e80: 8e 0f add r24, r30 33e82: 9f 1f adc r25, r31 33e84: 08 95 ret 00033e86 : 33e86: fb 01 movw r30, r22 33e88: 55 91 lpm r21, Z+ 33e8a: 55 23 and r21, r21 33e8c: a9 f0 breq .+42 ; 0x33eb8 33e8e: bf 01 movw r22, r30 33e90: dc 01 movw r26, r24 33e92: 4d 91 ld r20, X+ 33e94: 45 17 cp r20, r21 33e96: 41 11 cpse r20, r1 33e98: e1 f7 brne .-8 ; 0x33e92 33e9a: 59 f4 brne .+22 ; 0x33eb2 33e9c: cd 01 movw r24, r26 33e9e: 05 90 lpm r0, Z+ 33ea0: 00 20 and r0, r0 33ea2: 49 f0 breq .+18 ; 0x33eb6 33ea4: 4d 91 ld r20, X+ 33ea6: 40 15 cp r20, r0 33ea8: 41 11 cpse r20, r1 33eaa: c9 f3 breq .-14 ; 0x33e9e 33eac: fb 01 movw r30, r22 33eae: 41 11 cpse r20, r1 33eb0: ef cf rjmp .-34 ; 0x33e90 33eb2: 81 e0 ldi r24, 0x01 ; 1 33eb4: 90 e0 ldi r25, 0x00 ; 0 33eb6: 01 97 sbiw r24, 0x01 ; 1 33eb8: 08 95 ret 00033eba : 33eba: fc 01 movw r30, r24 33ebc: 61 50 subi r22, 0x01 ; 1 33ebe: 70 40 sbci r23, 0x00 ; 0 33ec0: 01 90 ld r0, Z+ 33ec2: 01 10 cpse r0, r1 33ec4: d8 f7 brcc .-10 ; 0x33ebc 33ec6: 80 95 com r24 33ec8: 90 95 com r25 33eca: 8e 0f add r24, r30 33ecc: 9f 1f adc r25, r31 33ece: 08 95 ret 00033ed0 : 33ed0: cf 93 push r28 33ed2: df 93 push r29 33ed4: ec 01 movw r28, r24 33ed6: 2b 81 ldd r18, Y+3 ; 0x03 33ed8: 20 ff sbrs r18, 0 33eda: 1a c0 rjmp .+52 ; 0x33f10 33edc: 26 ff sbrs r18, 6 33ede: 0c c0 rjmp .+24 ; 0x33ef8 33ee0: 2f 7b andi r18, 0xBF ; 191 33ee2: 2b 83 std Y+3, r18 ; 0x03 33ee4: 8e 81 ldd r24, Y+6 ; 0x06 33ee6: 9f 81 ldd r25, Y+7 ; 0x07 33ee8: 01 96 adiw r24, 0x01 ; 1 33eea: 9f 83 std Y+7, r25 ; 0x07 33eec: 8e 83 std Y+6, r24 ; 0x06 33eee: 8a 81 ldd r24, Y+2 ; 0x02 33ef0: 90 e0 ldi r25, 0x00 ; 0 33ef2: df 91 pop r29 33ef4: cf 91 pop r28 33ef6: 08 95 ret 33ef8: 22 ff sbrs r18, 2 33efa: 18 c0 rjmp .+48 ; 0x33f2c 33efc: e8 81 ld r30, Y 33efe: f9 81 ldd r31, Y+1 ; 0x01 33f00: 80 81 ld r24, Z 33f02: 08 2e mov r0, r24 33f04: 00 0c add r0, r0 33f06: 99 0b sbc r25, r25 33f08: 00 97 sbiw r24, 0x00 ; 0 33f0a: 29 f4 brne .+10 ; 0x33f16 33f0c: 20 62 ori r18, 0x20 ; 32 33f0e: 2b 83 std Y+3, r18 ; 0x03 33f10: 8f ef ldi r24, 0xFF ; 255 33f12: 9f ef ldi r25, 0xFF ; 255 33f14: ee cf rjmp .-36 ; 0x33ef2 33f16: 31 96 adiw r30, 0x01 ; 1 33f18: f9 83 std Y+1, r31 ; 0x01 33f1a: e8 83 st Y, r30 33f1c: 2e 81 ldd r18, Y+6 ; 0x06 33f1e: 3f 81 ldd r19, Y+7 ; 0x07 33f20: 2f 5f subi r18, 0xFF ; 255 33f22: 3f 4f sbci r19, 0xFF ; 255 33f24: 3f 83 std Y+7, r19 ; 0x07 33f26: 2e 83 std Y+6, r18 ; 0x06 33f28: 99 27 eor r25, r25 33f2a: e3 cf rjmp .-58 ; 0x33ef2 33f2c: ea 85 ldd r30, Y+10 ; 0x0a 33f2e: fb 85 ldd r31, Y+11 ; 0x0b 33f30: 19 95 eicall 33f32: 97 ff sbrs r25, 7 33f34: f3 cf rjmp .-26 ; 0x33f1c 33f36: 2b 81 ldd r18, Y+3 ; 0x03 33f38: 01 96 adiw r24, 0x01 ; 1 33f3a: 21 f0 breq .+8 ; 0x33f44 33f3c: 80 e2 ldi r24, 0x20 ; 32 33f3e: 82 2b or r24, r18 33f40: 8b 83 std Y+3, r24 ; 0x03 33f42: e6 cf rjmp .-52 ; 0x33f10 33f44: 80 e1 ldi r24, 0x10 ; 16 33f46: fb cf rjmp .-10 ; 0x33f3e 00033f48 : 33f48: 0f 93 push r16 33f4a: 1f 93 push r17 33f4c: cf 93 push r28 33f4e: df 93 push r29 33f50: 18 2f mov r17, r24 33f52: 09 2f mov r16, r25 33f54: eb 01 movw r28, r22 33f56: 8b 81 ldd r24, Y+3 ; 0x03 33f58: 81 fd sbrc r24, 1 33f5a: 09 c0 rjmp .+18 ; 0x33f6e 33f5c: 1f ef ldi r17, 0xFF ; 255 33f5e: 0f ef ldi r16, 0xFF ; 255 33f60: 81 2f mov r24, r17 33f62: 90 2f mov r25, r16 33f64: df 91 pop r29 33f66: cf 91 pop r28 33f68: 1f 91 pop r17 33f6a: 0f 91 pop r16 33f6c: 08 95 ret 33f6e: 82 ff sbrs r24, 2 33f70: 14 c0 rjmp .+40 ; 0x33f9a 33f72: 2e 81 ldd r18, Y+6 ; 0x06 33f74: 3f 81 ldd r19, Y+7 ; 0x07 33f76: 8c 81 ldd r24, Y+4 ; 0x04 33f78: 9d 81 ldd r25, Y+5 ; 0x05 33f7a: 28 17 cp r18, r24 33f7c: 39 07 cpc r19, r25 33f7e: 3c f4 brge .+14 ; 0x33f8e 33f80: e8 81 ld r30, Y 33f82: f9 81 ldd r31, Y+1 ; 0x01 33f84: cf 01 movw r24, r30 33f86: 01 96 adiw r24, 0x01 ; 1 33f88: 99 83 std Y+1, r25 ; 0x01 33f8a: 88 83 st Y, r24 33f8c: 10 83 st Z, r17 33f8e: 8e 81 ldd r24, Y+6 ; 0x06 33f90: 9f 81 ldd r25, Y+7 ; 0x07 33f92: 01 96 adiw r24, 0x01 ; 1 33f94: 9f 83 std Y+7, r25 ; 0x07 33f96: 8e 83 std Y+6, r24 ; 0x06 33f98: e3 cf rjmp .-58 ; 0x33f60 33f9a: e8 85 ldd r30, Y+8 ; 0x08 33f9c: f9 85 ldd r31, Y+9 ; 0x09 33f9e: 81 2f mov r24, r17 33fa0: 19 95 eicall 33fa2: 89 2b or r24, r25 33fa4: a1 f3 breq .-24 ; 0x33f8e 33fa6: da cf rjmp .-76 ; 0x33f5c 00033fa8 : 33fa8: ef 92 push r14 33faa: ff 92 push r15 33fac: 0f 93 push r16 33fae: 1f 93 push r17 33fb0: cf 93 push r28 33fb2: df 93 push r29 33fb4: 8c 01 movw r16, r24 33fb6: 7b 01 movw r14, r22 33fb8: db 01 movw r26, r22 33fba: 13 96 adiw r26, 0x03 ; 3 33fbc: 8c 91 ld r24, X 33fbe: d0 e0 ldi r29, 0x00 ; 0 33fc0: c0 e0 ldi r28, 0x00 ; 0 33fc2: 81 fd sbrc r24, 1 33fc4: 0f c0 rjmp .+30 ; 0x33fe4 33fc6: cf ef ldi r28, 0xFF ; 255 33fc8: df ef ldi r29, 0xFF ; 255 33fca: 10 c0 rjmp .+32 ; 0x33fec 33fcc: d7 01 movw r26, r14 33fce: 18 96 adiw r26, 0x08 ; 8 33fd0: ed 91 ld r30, X+ 33fd2: fc 91 ld r31, X 33fd4: b7 01 movw r22, r14 33fd6: 19 95 eicall 33fd8: 89 2b or r24, r25 33fda: 11 f0 breq .+4 ; 0x33fe0 33fdc: cf ef ldi r28, 0xFF ; 255 33fde: df ef ldi r29, 0xFF ; 255 33fe0: 0f 5f subi r16, 0xFF ; 255 33fe2: 1f 4f sbci r17, 0xFF ; 255 33fe4: f8 01 movw r30, r16 33fe6: 84 91 lpm r24, Z 33fe8: 81 11 cpse r24, r1 33fea: f0 cf rjmp .-32 ; 0x33fcc 33fec: ce 01 movw r24, r28 33fee: df 91 pop r29 33ff0: cf 91 pop r28 33ff2: 1f 91 pop r17 33ff4: 0f 91 pop r16 33ff6: ff 90 pop r15 33ff8: ef 90 pop r14 33ffa: 08 95 ret 00033ffc : 33ffc: 0f 93 push r16 33ffe: 1f 93 push r17 34000: cf 93 push r28 34002: df 93 push r29 34004: cd b7 in r28, 0x3d ; 61 34006: de b7 in r29, 0x3e ; 62 34008: ae 01 movw r20, r28 3400a: 48 5f subi r20, 0xF8 ; 248 3400c: 5f 4f sbci r21, 0xFF ; 255 3400e: da 01 movw r26, r20 34010: 6d 91 ld r22, X+ 34012: 7d 91 ld r23, X+ 34014: ad 01 movw r20, r26 34016: 0e ef ldi r16, 0xFE ; 254 34018: 16 e1 ldi r17, 0x16 ; 22 3401a: f8 01 movw r30, r16 3401c: 82 81 ldd r24, Z+2 ; 0x02 3401e: 93 81 ldd r25, Z+3 ; 0x03 34020: dc 01 movw r26, r24 34022: 13 96 adiw r26, 0x03 ; 3 34024: 2c 91 ld r18, X 34026: 13 97 sbiw r26, 0x03 ; 3 34028: 28 60 ori r18, 0x08 ; 8 3402a: 13 96 adiw r26, 0x03 ; 3 3402c: 2c 93 st X, r18 3402e: 0e 94 76 51 call 0xa2ec ; 0xa2ec 34032: d8 01 movw r26, r16 34034: 12 96 adiw r26, 0x02 ; 2 34036: ed 91 ld r30, X+ 34038: fc 91 ld r31, X 3403a: 23 81 ldd r18, Z+3 ; 0x03 3403c: 27 7f andi r18, 0xF7 ; 247 3403e: 23 83 std Z+3, r18 ; 0x03 34040: df 91 pop r29 34042: cf 91 pop r28 34044: 1f 91 pop r17 34046: 0f 91 pop r16 34048: 08 95 ret 0003404a : 3404a: 0f 93 push r16 3404c: 1f 93 push r17 3404e: cf 93 push r28 34050: df 93 push r29 34052: 8c 01 movw r16, r24 34054: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 34058: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 3405c: 83 81 ldd r24, Z+3 ; 0x03 3405e: d0 e0 ldi r29, 0x00 ; 0 34060: c0 e0 ldi r28, 0x00 ; 0 34062: 81 fd sbrc r24, 1 34064: 0a c0 rjmp .+20 ; 0x3407a 34066: cf ef ldi r28, 0xFF ; 255 34068: df ef ldi r29, 0xFF ; 255 3406a: 17 c0 rjmp .+46 ; 0x3409a 3406c: 19 95 eicall 3406e: 89 2b or r24, r25 34070: 11 f0 breq .+4 ; 0x34076 34072: cf ef ldi r28, 0xFF ; 255 34074: df ef ldi r29, 0xFF ; 255 34076: 0f 5f subi r16, 0xFF ; 255 34078: 1f 4f sbci r17, 0xFF ; 255 3407a: f8 01 movw r30, r16 3407c: 84 91 lpm r24, Z 3407e: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 34082: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 34086: db 01 movw r26, r22 34088: 18 96 adiw r26, 0x08 ; 8 3408a: ed 91 ld r30, X+ 3408c: fc 91 ld r31, X 3408e: 81 11 cpse r24, r1 34090: ed cf rjmp .-38 ; 0x3406c 34092: 8a e0 ldi r24, 0x0A ; 10 34094: 19 95 eicall 34096: 89 2b or r24, r25 34098: 31 f7 brne .-52 ; 0x34066 3409a: ce 01 movw r24, r28 3409c: df 91 pop r29 3409e: cf 91 pop r28 340a0: 1f 91 pop r17 340a2: 0f 91 pop r16 340a4: 08 95 ret 000340a6 : 340a6: 0f 93 push r16 340a8: 1f 93 push r17 340aa: cf 93 push r28 340ac: df 93 push r29 340ae: cd b7 in r28, 0x3d ; 61 340b0: de b7 in r29, 0x3e ; 62 340b2: 2e 97 sbiw r28, 0x0e ; 14 340b4: 0f b6 in r0, 0x3f ; 63 340b6: f8 94 cli 340b8: de bf out 0x3e, r29 ; 62 340ba: 0f be out 0x3f, r0 ; 63 340bc: cd bf out 0x3d, r28 ; 61 340be: 0e 89 ldd r16, Y+22 ; 0x16 340c0: 1f 89 ldd r17, Y+23 ; 0x17 340c2: 8e e0 ldi r24, 0x0E ; 14 340c4: 8c 83 std Y+4, r24 ; 0x04 340c6: 1a 83 std Y+2, r17 ; 0x02 340c8: 09 83 std Y+1, r16 ; 0x01 340ca: 8f ef ldi r24, 0xFF ; 255 340cc: 9f e7 ldi r25, 0x7F ; 127 340ce: 9e 83 std Y+6, r25 ; 0x06 340d0: 8d 83 std Y+5, r24 ; 0x05 340d2: ae 01 movw r20, r28 340d4: 46 5e subi r20, 0xE6 ; 230 340d6: 5f 4f sbci r21, 0xFF ; 255 340d8: 68 8d ldd r22, Y+24 ; 0x18 340da: 79 8d ldd r23, Y+25 ; 0x19 340dc: ce 01 movw r24, r28 340de: 01 96 adiw r24, 0x01 ; 1 340e0: 0e 94 76 51 call 0xa2ec ; 0xa2ec 340e4: 2f 81 ldd r18, Y+7 ; 0x07 340e6: 38 85 ldd r19, Y+8 ; 0x08 340e8: 02 0f add r16, r18 340ea: 13 1f adc r17, r19 340ec: f8 01 movw r30, r16 340ee: 10 82 st Z, r1 340f0: 2e 96 adiw r28, 0x0e ; 14 340f2: 0f b6 in r0, 0x3f ; 63 340f4: f8 94 cli 340f6: de bf out 0x3e, r29 ; 62 340f8: 0f be out 0x3f, r0 ; 63 340fa: cd bf out 0x3d, r28 ; 61 340fc: df 91 pop r29 340fe: cf 91 pop r28 34100: 1f 91 pop r17 34102: 0f 91 pop r16 34104: 08 95 ret 00034106 : 34106: cf 93 push r28 34108: df 93 push r29 3410a: ec 01 movw r28, r24 3410c: 8b 81 ldd r24, Y+3 ; 0x03 3410e: 88 60 ori r24, 0x08 ; 8 34110: 8b 83 std Y+3, r24 ; 0x03 34112: ce 01 movw r24, r28 34114: 0e 94 76 51 call 0xa2ec ; 0xa2ec 34118: 2b 81 ldd r18, Y+3 ; 0x03 3411a: 27 7f andi r18, 0xF7 ; 247 3411c: 2b 83 std Y+3, r18 ; 0x03 3411e: df 91 pop r29 34120: cf 91 pop r28 34122: 08 95 ret 00034124 : 34124: 0f 93 push r16 34126: 1f 93 push r17 34128: cf 93 push r28 3412a: df 93 push r29 3412c: cd b7 in r28, 0x3d ; 61 3412e: de b7 in r29, 0x3e ; 62 34130: 2e 97 sbiw r28, 0x0e ; 14 34132: 0f b6 in r0, 0x3f ; 63 34134: f8 94 cli 34136: de bf out 0x3e, r29 ; 62 34138: 0f be out 0x3f, r0 ; 63 3413a: cd bf out 0x3d, r28 ; 61 3413c: 8c 01 movw r16, r24 3413e: fa 01 movw r30, r20 34140: 8e e0 ldi r24, 0x0E ; 14 34142: 8c 83 std Y+4, r24 ; 0x04 34144: 1a 83 std Y+2, r17 ; 0x02 34146: 09 83 std Y+1, r16 ; 0x01 34148: 77 ff sbrs r23, 7 3414a: 02 c0 rjmp .+4 ; 0x34150 3414c: 60 e0 ldi r22, 0x00 ; 0 3414e: 70 e8 ldi r23, 0x80 ; 128 34150: 61 50 subi r22, 0x01 ; 1 34152: 71 09 sbc r23, r1 34154: 7e 83 std Y+6, r23 ; 0x06 34156: 6d 83 std Y+5, r22 ; 0x05 34158: a9 01 movw r20, r18 3415a: bf 01 movw r22, r30 3415c: ce 01 movw r24, r28 3415e: 01 96 adiw r24, 0x01 ; 1 34160: 0e 94 76 51 call 0xa2ec ; 0xa2ec 34164: 4d 81 ldd r20, Y+5 ; 0x05 34166: 5e 81 ldd r21, Y+6 ; 0x06 34168: 57 fd sbrc r21, 7 3416a: 0a c0 rjmp .+20 ; 0x34180 3416c: 2f 81 ldd r18, Y+7 ; 0x07 3416e: 38 85 ldd r19, Y+8 ; 0x08 34170: 42 17 cp r20, r18 34172: 53 07 cpc r21, r19 34174: 0c f4 brge .+2 ; 0x34178 34176: 9a 01 movw r18, r20 34178: 02 0f add r16, r18 3417a: 13 1f adc r17, r19 3417c: f8 01 movw r30, r16 3417e: 10 82 st Z, r1 34180: 2e 96 adiw r28, 0x0e ; 14 34182: 0f b6 in r0, 0x3f ; 63 34184: f8 94 cli 34186: de bf out 0x3e, r29 ; 62 34188: 0f be out 0x3f, r0 ; 63 3418a: cd bf out 0x3d, r28 ; 61 3418c: df 91 pop r29 3418e: cf 91 pop r28 34190: 1f 91 pop r17 34192: 0f 91 pop r16 34194: 08 95 ret 00034196 <__ultoa_invert>: 34196: fa 01 movw r30, r20 34198: aa 27 eor r26, r26 3419a: 28 30 cpi r18, 0x08 ; 8 3419c: 51 f1 breq .+84 ; 0x341f2 <__ultoa_invert+0x5c> 3419e: 20 31 cpi r18, 0x10 ; 16 341a0: 81 f1 breq .+96 ; 0x34202 <__ultoa_invert+0x6c> 341a2: e8 94 clt 341a4: 6f 93 push r22 341a6: 6e 7f andi r22, 0xFE ; 254 341a8: 6e 5f subi r22, 0xFE ; 254 341aa: 7f 4f sbci r23, 0xFF ; 255 341ac: 8f 4f sbci r24, 0xFF ; 255 341ae: 9f 4f sbci r25, 0xFF ; 255 341b0: af 4f sbci r26, 0xFF ; 255 341b2: b1 e0 ldi r27, 0x01 ; 1 341b4: 3e d0 rcall .+124 ; 0x34232 <__ultoa_invert+0x9c> 341b6: b4 e0 ldi r27, 0x04 ; 4 341b8: 3c d0 rcall .+120 ; 0x34232 <__ultoa_invert+0x9c> 341ba: 67 0f add r22, r23 341bc: 78 1f adc r23, r24 341be: 89 1f adc r24, r25 341c0: 9a 1f adc r25, r26 341c2: a1 1d adc r26, r1 341c4: 68 0f add r22, r24 341c6: 79 1f adc r23, r25 341c8: 8a 1f adc r24, r26 341ca: 91 1d adc r25, r1 341cc: a1 1d adc r26, r1 341ce: 6a 0f add r22, r26 341d0: 71 1d adc r23, r1 341d2: 81 1d adc r24, r1 341d4: 91 1d adc r25, r1 341d6: a1 1d adc r26, r1 341d8: 20 d0 rcall .+64 ; 0x3421a <__ultoa_invert+0x84> 341da: 09 f4 brne .+2 ; 0x341de <__ultoa_invert+0x48> 341dc: 68 94 set 341de: 3f 91 pop r19 341e0: 2a e0 ldi r18, 0x0A ; 10 341e2: 26 9f mul r18, r22 341e4: 11 24 eor r1, r1 341e6: 30 19 sub r19, r0 341e8: 30 5d subi r19, 0xD0 ; 208 341ea: 31 93 st Z+, r19 341ec: de f6 brtc .-74 ; 0x341a4 <__ultoa_invert+0xe> 341ee: cf 01 movw r24, r30 341f0: 08 95 ret 341f2: 46 2f mov r20, r22 341f4: 47 70 andi r20, 0x07 ; 7 341f6: 40 5d subi r20, 0xD0 ; 208 341f8: 41 93 st Z+, r20 341fa: b3 e0 ldi r27, 0x03 ; 3 341fc: 0f d0 rcall .+30 ; 0x3421c <__ultoa_invert+0x86> 341fe: c9 f7 brne .-14 ; 0x341f2 <__ultoa_invert+0x5c> 34200: f6 cf rjmp .-20 ; 0x341ee <__ultoa_invert+0x58> 34202: 46 2f mov r20, r22 34204: 4f 70 andi r20, 0x0F ; 15 34206: 40 5d subi r20, 0xD0 ; 208 34208: 4a 33 cpi r20, 0x3A ; 58 3420a: 18 f0 brcs .+6 ; 0x34212 <__ultoa_invert+0x7c> 3420c: 49 5d subi r20, 0xD9 ; 217 3420e: 31 fd sbrc r19, 1 34210: 40 52 subi r20, 0x20 ; 32 34212: 41 93 st Z+, r20 34214: 02 d0 rcall .+4 ; 0x3421a <__ultoa_invert+0x84> 34216: a9 f7 brne .-22 ; 0x34202 <__ultoa_invert+0x6c> 34218: ea cf rjmp .-44 ; 0x341ee <__ultoa_invert+0x58> 3421a: b4 e0 ldi r27, 0x04 ; 4 3421c: a6 95 lsr r26 3421e: 97 95 ror r25 34220: 87 95 ror r24 34222: 77 95 ror r23 34224: 67 95 ror r22 34226: ba 95 dec r27 34228: c9 f7 brne .-14 ; 0x3421c <__ultoa_invert+0x86> 3422a: 00 97 sbiw r24, 0x00 ; 0 3422c: 61 05 cpc r22, r1 3422e: 71 05 cpc r23, r1 34230: 08 95 ret 34232: 9b 01 movw r18, r22 34234: ac 01 movw r20, r24 34236: 0a 2e mov r0, r26 34238: 06 94 lsr r0 3423a: 57 95 ror r21 3423c: 47 95 ror r20 3423e: 37 95 ror r19 34240: 27 95 ror r18 34242: ba 95 dec r27 34244: c9 f7 brne .-14 ; 0x34238 <__ultoa_invert+0xa2> 34246: 62 0f add r22, r18 34248: 73 1f adc r23, r19 3424a: 84 1f adc r24, r20 3424c: 95 1f adc r25, r21 3424e: a0 1d adc r26, r0 34250: 08 95 ret 00034252 <__ctype_isfalse>: 34252: 99 27 eor r25, r25 34254: 88 27 eor r24, r24 00034256 <__ctype_istrue>: 34256: 08 95 ret 00034258 : 34258: dc 01 movw r26, r24 3425a: cb 01 movw r24, r22 0003425c : 3425c: fc 01 movw r30, r24 3425e: f9 99 sbic 0x1f, 1 ; 31 34260: fe cf rjmp .-4 ; 0x3425e 34262: 06 c0 rjmp .+12 ; 0x34270 34264: f2 bd out 0x22, r31 ; 34 34266: e1 bd out 0x21, r30 ; 33 34268: f8 9a sbi 0x1f, 0 ; 31 3426a: 31 96 adiw r30, 0x01 ; 1 3426c: 00 b4 in r0, 0x20 ; 32 3426e: 0d 92 st X+, r0 34270: 41 50 subi r20, 0x01 ; 1 34272: 50 40 sbci r21, 0x00 ; 0 34274: b8 f7 brcc .-18 ; 0x34264 34276: 08 95 ret 00034278 : 34278: f9 99 sbic 0x1f, 1 ; 31 3427a: fe cf rjmp .-4 ; 0x34278 3427c: 92 bd out 0x22, r25 ; 34 3427e: 81 bd out 0x21, r24 ; 33 34280: f8 9a sbi 0x1f, 0 ; 31 34282: 99 27 eor r25, r25 34284: 80 b5 in r24, 0x20 ; 32 34286: 08 95 ret 00034288 : 34288: a6 e1 ldi r26, 0x16 ; 22 3428a: b0 e0 ldi r27, 0x00 ; 0 3428c: 44 e0 ldi r20, 0x04 ; 4 3428e: 50 e0 ldi r21, 0x00 ; 0 34290: 0d 94 2e a1 jmp 0x3425c ; 0x3425c 00034294 : 34294: a8 e1 ldi r26, 0x18 ; 24 34296: b0 e0 ldi r27, 0x00 ; 0 34298: 42 e0 ldi r20, 0x02 ; 2 3429a: 50 e0 ldi r21, 0x00 ; 0 3429c: 0d 94 2e a1 jmp 0x3425c ; 0x3425c 000342a0 : 342a0: dc 01 movw r26, r24 342a2: a4 0f add r26, r20 342a4: b5 1f adc r27, r21 342a6: 41 50 subi r20, 0x01 ; 1 342a8: 50 40 sbci r21, 0x00 ; 0 342aa: 48 f0 brcs .+18 ; 0x342be 342ac: cb 01 movw r24, r22 342ae: 84 0f add r24, r20 342b0: 95 1f adc r25, r21 342b2: 2e 91 ld r18, -X 342b4: 0f 94 61 a1 call 0x342c2 ; 0x342c2 342b8: 41 50 subi r20, 0x01 ; 1 342ba: 50 40 sbci r21, 0x00 ; 0 342bc: d0 f7 brcc .-12 ; 0x342b2 342be: 08 95 ret 000342c0 : 342c0: 26 2f mov r18, r22 000342c2 : 342c2: f9 99 sbic 0x1f, 1 ; 31 342c4: fe cf rjmp .-4 ; 0x342c2 342c6: 92 bd out 0x22, r25 ; 34 342c8: 81 bd out 0x21, r24 ; 33 342ca: f8 9a sbi 0x1f, 0 ; 31 342cc: 01 97 sbiw r24, 0x01 ; 1 342ce: 00 b4 in r0, 0x20 ; 32 342d0: 02 16 cp r0, r18 342d2: 39 f0 breq .+14 ; 0x342e2 342d4: 1f ba out 0x1f, r1 ; 31 342d6: 20 bd out 0x20, r18 ; 32 342d8: 0f b6 in r0, 0x3f ; 63 342da: f8 94 cli 342dc: fa 9a sbi 0x1f, 2 ; 31 342de: f9 9a sbi 0x1f, 1 ; 31 342e0: 0f be out 0x3f, r0 ; 63 342e2: 08 95 ret 000342e4 : 342e4: 03 96 adiw r24, 0x03 ; 3 342e6: 27 2f mov r18, r23 342e8: 0f 94 61 a1 call 0x342c2 ; 0x342c2 342ec: 0f 94 60 a1 call 0x342c0 ; 0x342c0 342f0: 25 2f mov r18, r21 342f2: 0f 94 61 a1 call 0x342c2 ; 0x342c2 342f6: 24 2f mov r18, r20 342f8: 0d 94 61 a1 jmp 0x342c2 ; 0x342c2 000342fc : 342fc: 01 96 adiw r24, 0x01 ; 1 342fe: 27 2f mov r18, r23 34300: 0f 94 61 a1 call 0x342c2 ; 0x342c2 34304: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 00034308 : 34308: 26 2f mov r18, r22 0003430a : 3430a: f9 99 sbic 0x1f, 1 ; 31 3430c: fe cf rjmp .-4 ; 0x3430a 3430e: 1f ba out 0x1f, r1 ; 31 34310: 92 bd out 0x22, r25 ; 34 34312: 81 bd out 0x21, r24 ; 33 34314: 20 bd out 0x20, r18 ; 32 34316: 0f b6 in r0, 0x3f ; 63 34318: f8 94 cli 3431a: fa 9a sbi 0x1f, 2 ; 31 3431c: f9 9a sbi 0x1f, 1 ; 31 3431e: 0f be out 0x3f, r0 ; 63 34320: 01 96 adiw r24, 0x01 ; 1 34322: 08 95 ret 00034324 : 34324: 24 2f mov r18, r20 34326: 0f 94 85 a1 call 0x3430a ; 0x3430a 3432a: 25 2f mov r18, r21 3432c: 0f 94 85 a1 call 0x3430a ; 0x3430a 34330: 0d 94 9a a1 jmp 0x34334 ; 0x34334 00034334 : 34334: 0f 94 84 a1 call 0x34308 ; 0x34308 34338: 27 2f mov r18, r23 3433a: 0d 94 85 a1 jmp 0x3430a ; 0x3430a 0003433e <__mulsi3>: 3433e: db 01 movw r26, r22 34340: 8f 93 push r24 34342: 9f 93 push r25 34344: 0f 94 d1 a1 call 0x343a2 ; 0x343a2 <__muluhisi3> 34348: bf 91 pop r27 3434a: af 91 pop r26 3434c: a2 9f mul r26, r18 3434e: 80 0d add r24, r0 34350: 91 1d adc r25, r1 34352: a3 9f mul r26, r19 34354: 90 0d add r25, r0 34356: b2 9f mul r27, r18 34358: 90 0d add r25, r0 3435a: 11 24 eor r1, r1 3435c: 08 95 ret 0003435e <__udivmodsi4>: 3435e: a1 e2 ldi r26, 0x21 ; 33 34360: 1a 2e mov r1, r26 34362: aa 1b sub r26, r26 34364: bb 1b sub r27, r27 34366: fd 01 movw r30, r26 34368: 0d c0 rjmp .+26 ; 0x34384 <__udivmodsi4_ep> 0003436a <__udivmodsi4_loop>: 3436a: aa 1f adc r26, r26 3436c: bb 1f adc r27, r27 3436e: ee 1f adc r30, r30 34370: ff 1f adc r31, r31 34372: a2 17 cp r26, r18 34374: b3 07 cpc r27, r19 34376: e4 07 cpc r30, r20 34378: f5 07 cpc r31, r21 3437a: 20 f0 brcs .+8 ; 0x34384 <__udivmodsi4_ep> 3437c: a2 1b sub r26, r18 3437e: b3 0b sbc r27, r19 34380: e4 0b sbc r30, r20 34382: f5 0b sbc r31, r21 00034384 <__udivmodsi4_ep>: 34384: 66 1f adc r22, r22 34386: 77 1f adc r23, r23 34388: 88 1f adc r24, r24 3438a: 99 1f adc r25, r25 3438c: 1a 94 dec r1 3438e: 69 f7 brne .-38 ; 0x3436a <__udivmodsi4_loop> 34390: 60 95 com r22 34392: 70 95 com r23 34394: 80 95 com r24 34396: 90 95 com r25 34398: 9b 01 movw r18, r22 3439a: ac 01 movw r20, r24 3439c: bd 01 movw r22, r26 3439e: cf 01 movw r24, r30 343a0: 08 95 ret 000343a2 <__muluhisi3>: 343a2: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 343a6: a5 9f mul r26, r21 343a8: 90 0d add r25, r0 343aa: b4 9f mul r27, r20 343ac: 90 0d add r25, r0 343ae: a4 9f mul r26, r20 343b0: 80 0d add r24, r0 343b2: 91 1d adc r25, r1 343b4: 11 24 eor r1, r1 343b6: 08 95 ret 000343b8 <__umulhisi3>: 343b8: a2 9f mul r26, r18 343ba: b0 01 movw r22, r0 343bc: b3 9f mul r27, r19 343be: c0 01 movw r24, r0 343c0: a3 9f mul r26, r19 343c2: 70 0d add r23, r0 343c4: 81 1d adc r24, r1 343c6: 11 24 eor r1, r1 343c8: 91 1d adc r25, r1 343ca: b2 9f mul r27, r18 343cc: 70 0d add r23, r0 343ce: 81 1d adc r24, r1 343d0: 11 24 eor r1, r1 343d2: 91 1d adc r25, r1 343d4: 08 95 ret 000343d6 <__udivmodqi4>: 343d6: 99 1b sub r25, r25 343d8: 79 e0 ldi r23, 0x09 ; 9 343da: 04 c0 rjmp .+8 ; 0x343e4 <__udivmodqi4_ep> 000343dc <__udivmodqi4_loop>: 343dc: 99 1f adc r25, r25 343de: 96 17 cp r25, r22 343e0: 08 f0 brcs .+2 ; 0x343e4 <__udivmodqi4_ep> 343e2: 96 1b sub r25, r22 000343e4 <__udivmodqi4_ep>: 343e4: 88 1f adc r24, r24 343e6: 7a 95 dec r23 343e8: c9 f7 brne .-14 ; 0x343dc <__udivmodqi4_loop> 343ea: 80 95 com r24 343ec: 08 95 ret 000343ee <__divmodqi4>: 343ee: 87 fb bst r24, 7 343f0: 08 2e mov r0, r24 343f2: 06 26 eor r0, r22 343f4: 87 fd sbrc r24, 7 343f6: 81 95 neg r24 343f8: 67 fd sbrc r22, 7 343fa: 61 95 neg r22 343fc: 0f 94 eb a1 call 0x343d6 ; 0x343d6 <__udivmodqi4> 34400: 0e f4 brtc .+2 ; 0x34404 <__divmodqi4_1> 34402: 91 95 neg r25 00034404 <__divmodqi4_1>: 34404: 07 fc sbrc r0, 7 34406: 81 95 neg r24 00034408 <__divmodqi4_exit>: 34408: 08 95 ret 0003440a <__udivmodhi4>: 3440a: aa 1b sub r26, r26 3440c: bb 1b sub r27, r27 3440e: 51 e1 ldi r21, 0x11 ; 17 34410: 07 c0 rjmp .+14 ; 0x34420 <__udivmodhi4_ep> 00034412 <__udivmodhi4_loop>: 34412: aa 1f adc r26, r26 34414: bb 1f adc r27, r27 34416: a6 17 cp r26, r22 34418: b7 07 cpc r27, r23 3441a: 10 f0 brcs .+4 ; 0x34420 <__udivmodhi4_ep> 3441c: a6 1b sub r26, r22 3441e: b7 0b sbc r27, r23 00034420 <__udivmodhi4_ep>: 34420: 88 1f adc r24, r24 34422: 99 1f adc r25, r25 34424: 5a 95 dec r21 34426: a9 f7 brne .-22 ; 0x34412 <__udivmodhi4_loop> 34428: 80 95 com r24 3442a: 90 95 com r25 3442c: bc 01 movw r22, r24 3442e: cd 01 movw r24, r26 34430: 08 95 ret 00034432 <__divmodhi4>: 34432: 97 fb bst r25, 7 34434: 07 2e mov r0, r23 34436: 16 f4 brtc .+4 ; 0x3443c <__divmodhi4+0xa> 34438: 00 94 com r0 3443a: 07 d0 rcall .+14 ; 0x3444a <__divmodhi4_neg1> 3443c: 77 fd sbrc r23, 7 3443e: 09 d0 rcall .+18 ; 0x34452 <__divmodhi4_neg2> 34440: 0f 94 05 a2 call 0x3440a ; 0x3440a <__udivmodhi4> 34444: 07 fc sbrc r0, 7 34446: 05 d0 rcall .+10 ; 0x34452 <__divmodhi4_neg2> 34448: 3e f4 brtc .+14 ; 0x34458 <__divmodhi4_exit> 0003444a <__divmodhi4_neg1>: 3444a: 90 95 com r25 3444c: 81 95 neg r24 3444e: 9f 4f sbci r25, 0xFF ; 255 34450: 08 95 ret 00034452 <__divmodhi4_neg2>: 34452: 70 95 com r23 34454: 61 95 neg r22 34456: 7f 4f sbci r23, 0xFF ; 255 00034458 <__divmodhi4_exit>: 34458: 08 95 ret 0003445a <__divmodsi4>: 3445a: 05 2e mov r0, r21 3445c: 97 fb bst r25, 7 3445e: 1e f4 brtc .+6 ; 0x34466 <__divmodsi4+0xc> 34460: 00 94 com r0 34462: 0f 94 44 a2 call 0x34488 ; 0x34488 <__negsi2> 34466: 57 fd sbrc r21, 7 34468: 07 d0 rcall .+14 ; 0x34478 <__divmodsi4_neg2> 3446a: 0f 94 af a1 call 0x3435e ; 0x3435e <__udivmodsi4> 3446e: 07 fc sbrc r0, 7 34470: 03 d0 rcall .+6 ; 0x34478 <__divmodsi4_neg2> 34472: 4e f4 brtc .+18 ; 0x34486 <__divmodsi4_exit> 34474: 0d 94 44 a2 jmp 0x34488 ; 0x34488 <__negsi2> 00034478 <__divmodsi4_neg2>: 34478: 50 95 com r21 3447a: 40 95 com r20 3447c: 30 95 com r19 3447e: 21 95 neg r18 34480: 3f 4f sbci r19, 0xFF ; 255 34482: 4f 4f sbci r20, 0xFF ; 255 34484: 5f 4f sbci r21, 0xFF ; 255 00034486 <__divmodsi4_exit>: 34486: 08 95 ret 00034488 <__negsi2>: 34488: 90 95 com r25 3448a: 80 95 com r24 3448c: 70 95 com r23 3448e: 61 95 neg r22 34490: 7f 4f sbci r23, 0xFF ; 255 34492: 8f 4f sbci r24, 0xFF ; 255 34494: 9f 4f sbci r25, 0xFF ; 255 34496: 08 95 ret 00034498 <__tablejump2__>: 34498: ee 0f add r30, r30 3449a: ff 1f adc r31, r31 3449c: 88 1f adc r24, r24 3449e: 8b bf out 0x3b, r24 ; 59 344a0: 07 90 elpm r0, Z+ 344a2: f6 91 elpm r31, Z 344a4: e0 2d mov r30, r0 344a6: 19 94 eijmp 000344a8 <__mulhisi3>: 344a8: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 344ac: 33 23 and r19, r19 344ae: 12 f4 brpl .+4 ; 0x344b4 <__mulhisi3+0xc> 344b0: 8a 1b sub r24, r26 344b2: 9b 0b sbc r25, r27 344b4: 0d 94 5e a2 jmp 0x344bc ; 0x344bc <__usmulhisi3_tail> 000344b8 <__usmulhisi3>: 344b8: 0f 94 dc a1 call 0x343b8 ; 0x343b8 <__umulhisi3> 000344bc <__usmulhisi3_tail>: 344bc: b7 ff sbrs r27, 7 344be: 08 95 ret 344c0: 82 1b sub r24, r18 344c2: 93 0b sbc r25, r19 344c4: 08 95 ret 000344c6 <__subsf3>: 344c6: 50 58 subi r21, 0x80 ; 128 000344c8 <__addsf3>: 344c8: bb 27 eor r27, r27 344ca: aa 27 eor r26, r26 344cc: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 344d0: 0d 94 8d 9c jmp 0x3391a ; 0x3391a <__fp_round> 344d4: 0f 94 7f 9c call 0x338fe ; 0x338fe <__fp_pscA> 344d8: 38 f0 brcs .+14 ; 0x344e8 <__addsf3+0x20> 344da: 0f 94 86 9c call 0x3390c ; 0x3390c <__fp_pscB> 344de: 20 f0 brcs .+8 ; 0x344e8 <__addsf3+0x20> 344e0: 39 f4 brne .+14 ; 0x344f0 <__addsf3+0x28> 344e2: 9f 3f cpi r25, 0xFF ; 255 344e4: 19 f4 brne .+6 ; 0x344ec <__addsf3+0x24> 344e6: 26 f4 brtc .+8 ; 0x344f0 <__addsf3+0x28> 344e8: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 344ec: 0e f4 brtc .+2 ; 0x344f0 <__addsf3+0x28> 344ee: e0 95 com r30 344f0: e7 fb bst r30, 7 344f2: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 000344f6 <__addsf3x>: 344f6: e9 2f mov r30, r25 344f8: 0f 94 9e 9c call 0x3393c ; 0x3393c <__fp_split3> 344fc: 58 f3 brcs .-42 ; 0x344d4 <__addsf3+0xc> 344fe: ba 17 cp r27, r26 34500: 62 07 cpc r22, r18 34502: 73 07 cpc r23, r19 34504: 84 07 cpc r24, r20 34506: 95 07 cpc r25, r21 34508: 20 f0 brcs .+8 ; 0x34512 <__addsf3x+0x1c> 3450a: 79 f4 brne .+30 ; 0x3452a <__addsf3x+0x34> 3450c: a6 f5 brtc .+104 ; 0x34576 <__addsf3x+0x80> 3450e: 0d 94 c0 9c jmp 0x33980 ; 0x33980 <__fp_zero> 34512: 0e f4 brtc .+2 ; 0x34516 <__addsf3x+0x20> 34514: e0 95 com r30 34516: 0b 2e mov r0, r27 34518: ba 2f mov r27, r26 3451a: a0 2d mov r26, r0 3451c: 0b 01 movw r0, r22 3451e: b9 01 movw r22, r18 34520: 90 01 movw r18, r0 34522: 0c 01 movw r0, r24 34524: ca 01 movw r24, r20 34526: a0 01 movw r20, r0 34528: 11 24 eor r1, r1 3452a: ff 27 eor r31, r31 3452c: 59 1b sub r21, r25 3452e: 99 f0 breq .+38 ; 0x34556 <__addsf3x+0x60> 34530: 59 3f cpi r21, 0xF9 ; 249 34532: 50 f4 brcc .+20 ; 0x34548 <__addsf3x+0x52> 34534: 50 3e cpi r21, 0xE0 ; 224 34536: 68 f1 brcs .+90 ; 0x34592 <__addsf3x+0x9c> 34538: 1a 16 cp r1, r26 3453a: f0 40 sbci r31, 0x00 ; 0 3453c: a2 2f mov r26, r18 3453e: 23 2f mov r18, r19 34540: 34 2f mov r19, r20 34542: 44 27 eor r20, r20 34544: 58 5f subi r21, 0xF8 ; 248 34546: f3 cf rjmp .-26 ; 0x3452e <__addsf3x+0x38> 34548: 46 95 lsr r20 3454a: 37 95 ror r19 3454c: 27 95 ror r18 3454e: a7 95 ror r26 34550: f0 40 sbci r31, 0x00 ; 0 34552: 53 95 inc r21 34554: c9 f7 brne .-14 ; 0x34548 <__addsf3x+0x52> 34556: 7e f4 brtc .+30 ; 0x34576 <__addsf3x+0x80> 34558: 1f 16 cp r1, r31 3455a: ba 0b sbc r27, r26 3455c: 62 0b sbc r22, r18 3455e: 73 0b sbc r23, r19 34560: 84 0b sbc r24, r20 34562: ba f0 brmi .+46 ; 0x34592 <__addsf3x+0x9c> 34564: 91 50 subi r25, 0x01 ; 1 34566: a1 f0 breq .+40 ; 0x34590 <__addsf3x+0x9a> 34568: ff 0f add r31, r31 3456a: bb 1f adc r27, r27 3456c: 66 1f adc r22, r22 3456e: 77 1f adc r23, r23 34570: 88 1f adc r24, r24 34572: c2 f7 brpl .-16 ; 0x34564 <__addsf3x+0x6e> 34574: 0e c0 rjmp .+28 ; 0x34592 <__addsf3x+0x9c> 34576: ba 0f add r27, r26 34578: 62 1f adc r22, r18 3457a: 73 1f adc r23, r19 3457c: 84 1f adc r24, r20 3457e: 48 f4 brcc .+18 ; 0x34592 <__addsf3x+0x9c> 34580: 87 95 ror r24 34582: 77 95 ror r23 34584: 67 95 ror r22 34586: b7 95 ror r27 34588: f7 95 ror r31 3458a: 9e 3f cpi r25, 0xFE ; 254 3458c: 08 f0 brcs .+2 ; 0x34590 <__addsf3x+0x9a> 3458e: b0 cf rjmp .-160 ; 0x344f0 <__addsf3+0x28> 34590: 93 95 inc r25 34592: 88 0f add r24, r24 34594: 08 f0 brcs .+2 ; 0x34598 <__addsf3x+0xa2> 34596: 99 27 eor r25, r25 34598: ee 0f add r30, r30 3459a: 97 95 ror r25 3459c: 87 95 ror r24 3459e: 08 95 ret 345a0: 0f 94 7f 9c call 0x338fe ; 0x338fe <__fp_pscA> 345a4: 60 f0 brcs .+24 ; 0x345be <__addsf3x+0xc8> 345a6: 80 e8 ldi r24, 0x80 ; 128 345a8: 91 e0 ldi r25, 0x01 ; 1 345aa: 09 f4 brne .+2 ; 0x345ae <__addsf3x+0xb8> 345ac: 9e ef ldi r25, 0xFE ; 254 345ae: 0f 94 86 9c call 0x3390c ; 0x3390c <__fp_pscB> 345b2: 28 f0 brcs .+10 ; 0x345be <__addsf3x+0xc8> 345b4: 40 e8 ldi r20, 0x80 ; 128 345b6: 51 e0 ldi r21, 0x01 ; 1 345b8: 71 f4 brne .+28 ; 0x345d6 345ba: 5e ef ldi r21, 0xFE ; 254 345bc: 0c c0 rjmp .+24 ; 0x345d6 345be: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 345c2: 0d 94 c0 9c jmp 0x33980 ; 0x33980 <__fp_zero> 000345c6 : 345c6: e9 2f mov r30, r25 345c8: e0 78 andi r30, 0x80 ; 128 345ca: 0f 94 9e 9c call 0x3393c ; 0x3393c <__fp_split3> 345ce: 40 f3 brcs .-48 ; 0x345a0 <__addsf3x+0xaa> 345d0: 09 2e mov r0, r25 345d2: 05 2a or r0, r21 345d4: b1 f3 breq .-20 ; 0x345c2 <__addsf3x+0xcc> 345d6: 26 17 cp r18, r22 345d8: 37 07 cpc r19, r23 345da: 48 07 cpc r20, r24 345dc: 59 07 cpc r21, r25 345de: 38 f0 brcs .+14 ; 0x345ee 345e0: 0e 2e mov r0, r30 345e2: 07 f8 bld r0, 7 345e4: e0 25 eor r30, r0 345e6: 69 f0 breq .+26 ; 0x34602 345e8: e0 25 eor r30, r0 345ea: e0 64 ori r30, 0x40 ; 64 345ec: 0a c0 rjmp .+20 ; 0x34602 345ee: ef 63 ori r30, 0x3F ; 63 345f0: 07 f8 bld r0, 7 345f2: 00 94 com r0 345f4: 07 fa bst r0, 7 345f6: db 01 movw r26, r22 345f8: b9 01 movw r22, r18 345fa: 9d 01 movw r18, r26 345fc: dc 01 movw r26, r24 345fe: ca 01 movw r24, r20 34600: ad 01 movw r20, r26 34602: ef 93 push r30 34604: 0f 94 7a a3 call 0x346f4 ; 0x346f4 <__divsf3_pse> 34608: 0f 94 8d 9c call 0x3391a ; 0x3391a <__fp_round> 3460c: 0f 94 13 a3 call 0x34626 ; 0x34626 34610: 5f 91 pop r21 34612: 55 23 and r21, r21 34614: 39 f0 breq .+14 ; 0x34624 34616: 2b ed ldi r18, 0xDB ; 219 34618: 3f e0 ldi r19, 0x0F ; 15 3461a: 49 e4 ldi r20, 0x49 ; 73 3461c: 50 fd sbrc r21, 0 3461e: 49 ec ldi r20, 0xC9 ; 201 34620: 0d 94 64 a2 jmp 0x344c8 ; 0x344c8 <__addsf3> 34624: 08 95 ret 00034626 : 34626: df 93 push r29 34628: dd 27 eor r29, r29 3462a: b9 2f mov r27, r25 3462c: bf 77 andi r27, 0x7F ; 127 3462e: 40 e8 ldi r20, 0x80 ; 128 34630: 5f e3 ldi r21, 0x3F ; 63 34632: 16 16 cp r1, r22 34634: 17 06 cpc r1, r23 34636: 48 07 cpc r20, r24 34638: 5b 07 cpc r21, r27 3463a: 18 f4 brcc .+6 ; 0x34642 3463c: d9 2f mov r29, r25 3463e: 0f 94 5f a5 call 0x34abe ; 0x34abe 34642: 9f 93 push r25 34644: 8f 93 push r24 34646: 7f 93 push r23 34648: 6f 93 push r22 3464a: 0f 94 05 9c call 0x3380a ; 0x3380a 3464e: e8 e2 ldi r30, 0x28 ; 40 34650: fd e6 ldi r31, 0x6D ; 109 34652: 0f 94 6f a4 call 0x348de ; 0x348de <__fp_powser> 34656: 0f 94 8d 9c call 0x3391a ; 0x3391a <__fp_round> 3465a: 2f 91 pop r18 3465c: 3f 91 pop r19 3465e: 4f 91 pop r20 34660: 5f 91 pop r21 34662: 0f 94 1c 9c call 0x33838 ; 0x33838 <__mulsf3x> 34666: dd 23 and r29, r29 34668: 51 f0 breq .+20 ; 0x3467e 3466a: 90 58 subi r25, 0x80 ; 128 3466c: a2 ea ldi r26, 0xA2 ; 162 3466e: 2a ed ldi r18, 0xDA ; 218 34670: 3f e0 ldi r19, 0x0F ; 15 34672: 49 ec ldi r20, 0xC9 ; 201 34674: 5f e3 ldi r21, 0x3F ; 63 34676: d0 78 andi r29, 0x80 ; 128 34678: 5d 27 eor r21, r29 3467a: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 3467e: df 91 pop r29 34680: 0d 94 8d 9c jmp 0x3391a ; 0x3391a <__fp_round> 00034684 : 34684: 0f 94 d5 a4 call 0x349aa ; 0x349aa <__fp_trunc> 34688: 90 f0 brcs .+36 ; 0x346ae 3468a: 9f 37 cpi r25, 0x7F ; 127 3468c: 48 f4 brcc .+18 ; 0x346a0 3468e: 91 11 cpse r25, r1 34690: 16 f4 brtc .+4 ; 0x34696 34692: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 34696: 60 e0 ldi r22, 0x00 ; 0 34698: 70 e0 ldi r23, 0x00 ; 0 3469a: 80 e8 ldi r24, 0x80 ; 128 3469c: 9f e3 ldi r25, 0x3F ; 63 3469e: 08 95 ret 346a0: 26 f0 brts .+8 ; 0x346aa 346a2: 1b 16 cp r1, r27 346a4: 61 1d adc r22, r1 346a6: 71 1d adc r23, r1 346a8: 81 1d adc r24, r1 346aa: 0d 94 46 a4 jmp 0x3488c ; 0x3488c <__fp_mintl> 346ae: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 000346b2 <__cmpsf2>: 346b2: 0f 94 22 a4 call 0x34844 ; 0x34844 <__fp_cmp> 346b6: 08 f4 brcc .+2 ; 0x346ba <__cmpsf2+0x8> 346b8: 81 e0 ldi r24, 0x01 ; 1 346ba: 08 95 ret 000346bc : 346bc: 0f 94 98 a4 call 0x34930 ; 0x34930 <__fp_rempio2> 346c0: e3 95 inc r30 346c2: 0d 94 c1 a4 jmp 0x34982 ; 0x34982 <__fp_sinus> 000346c6 <__divsf3>: 346c6: 0f 94 77 a3 call 0x346ee ; 0x346ee <__divsf3x> 346ca: 0d 94 8d 9c jmp 0x3391a ; 0x3391a <__fp_round> 346ce: 0f 94 86 9c call 0x3390c ; 0x3390c <__fp_pscB> 346d2: 58 f0 brcs .+22 ; 0x346ea <__divsf3+0x24> 346d4: 0f 94 7f 9c call 0x338fe ; 0x338fe <__fp_pscA> 346d8: 40 f0 brcs .+16 ; 0x346ea <__divsf3+0x24> 346da: 29 f4 brne .+10 ; 0x346e6 <__divsf3+0x20> 346dc: 5f 3f cpi r21, 0xFF ; 255 346de: 29 f0 breq .+10 ; 0x346ea <__divsf3+0x24> 346e0: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 346e4: 51 11 cpse r21, r1 346e6: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 346ea: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 000346ee <__divsf3x>: 346ee: 0f 94 9e 9c call 0x3393c ; 0x3393c <__fp_split3> 346f2: 68 f3 brcs .-38 ; 0x346ce <__divsf3+0x8> 000346f4 <__divsf3_pse>: 346f4: 99 23 and r25, r25 346f6: b1 f3 breq .-20 ; 0x346e4 <__divsf3+0x1e> 346f8: 55 23 and r21, r21 346fa: 91 f3 breq .-28 ; 0x346e0 <__divsf3+0x1a> 346fc: 95 1b sub r25, r21 346fe: 55 0b sbc r21, r21 34700: bb 27 eor r27, r27 34702: aa 27 eor r26, r26 34704: 62 17 cp r22, r18 34706: 73 07 cpc r23, r19 34708: 84 07 cpc r24, r20 3470a: 38 f0 brcs .+14 ; 0x3471a <__divsf3_pse+0x26> 3470c: 9f 5f subi r25, 0xFF ; 255 3470e: 5f 4f sbci r21, 0xFF ; 255 34710: 22 0f add r18, r18 34712: 33 1f adc r19, r19 34714: 44 1f adc r20, r20 34716: aa 1f adc r26, r26 34718: a9 f3 breq .-22 ; 0x34704 <__divsf3_pse+0x10> 3471a: 35 d0 rcall .+106 ; 0x34786 <__divsf3_pse+0x92> 3471c: 0e 2e mov r0, r30 3471e: 3a f0 brmi .+14 ; 0x3472e <__divsf3_pse+0x3a> 34720: e0 e8 ldi r30, 0x80 ; 128 34722: 32 d0 rcall .+100 ; 0x34788 <__divsf3_pse+0x94> 34724: 91 50 subi r25, 0x01 ; 1 34726: 50 40 sbci r21, 0x00 ; 0 34728: e6 95 lsr r30 3472a: 00 1c adc r0, r0 3472c: ca f7 brpl .-14 ; 0x34720 <__divsf3_pse+0x2c> 3472e: 2b d0 rcall .+86 ; 0x34786 <__divsf3_pse+0x92> 34730: fe 2f mov r31, r30 34732: 29 d0 rcall .+82 ; 0x34786 <__divsf3_pse+0x92> 34734: 66 0f add r22, r22 34736: 77 1f adc r23, r23 34738: 88 1f adc r24, r24 3473a: bb 1f adc r27, r27 3473c: 26 17 cp r18, r22 3473e: 37 07 cpc r19, r23 34740: 48 07 cpc r20, r24 34742: ab 07 cpc r26, r27 34744: b0 e8 ldi r27, 0x80 ; 128 34746: 09 f0 breq .+2 ; 0x3474a <__divsf3_pse+0x56> 34748: bb 0b sbc r27, r27 3474a: 80 2d mov r24, r0 3474c: bf 01 movw r22, r30 3474e: ff 27 eor r31, r31 34750: 93 58 subi r25, 0x83 ; 131 34752: 5f 4f sbci r21, 0xFF ; 255 34754: 3a f0 brmi .+14 ; 0x34764 <__divsf3_pse+0x70> 34756: 9e 3f cpi r25, 0xFE ; 254 34758: 51 05 cpc r21, r1 3475a: 78 f0 brcs .+30 ; 0x3477a <__divsf3_pse+0x86> 3475c: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 34760: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 34764: 5f 3f cpi r21, 0xFF ; 255 34766: e4 f3 brlt .-8 ; 0x34760 <__divsf3_pse+0x6c> 34768: 98 3e cpi r25, 0xE8 ; 232 3476a: d4 f3 brlt .-12 ; 0x34760 <__divsf3_pse+0x6c> 3476c: 86 95 lsr r24 3476e: 77 95 ror r23 34770: 67 95 ror r22 34772: b7 95 ror r27 34774: f7 95 ror r31 34776: 9f 5f subi r25, 0xFF ; 255 34778: c9 f7 brne .-14 ; 0x3476c <__divsf3_pse+0x78> 3477a: 88 0f add r24, r24 3477c: 91 1d adc r25, r1 3477e: 96 95 lsr r25 34780: 87 95 ror r24 34782: 97 f9 bld r25, 7 34784: 08 95 ret 34786: e1 e0 ldi r30, 0x01 ; 1 34788: 66 0f add r22, r22 3478a: 77 1f adc r23, r23 3478c: 88 1f adc r24, r24 3478e: bb 1f adc r27, r27 34790: 62 17 cp r22, r18 34792: 73 07 cpc r23, r19 34794: 84 07 cpc r24, r20 34796: ba 07 cpc r27, r26 34798: 20 f0 brcs .+8 ; 0x347a2 <__divsf3_pse+0xae> 3479a: 62 1b sub r22, r18 3479c: 73 0b sbc r23, r19 3479e: 84 0b sbc r24, r20 347a0: ba 0b sbc r27, r26 347a2: ee 1f adc r30, r30 347a4: 88 f7 brcc .-30 ; 0x34788 <__divsf3_pse+0x94> 347a6: e0 95 com r30 347a8: 08 95 ret 000347aa <__fixsfsi>: 347aa: 0f 94 dc a3 call 0x347b8 ; 0x347b8 <__fixunssfsi> 347ae: 68 94 set 347b0: b1 11 cpse r27, r1 347b2: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 347b6: 08 95 ret 000347b8 <__fixunssfsi>: 347b8: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 347bc: 88 f0 brcs .+34 ; 0x347e0 <__fixunssfsi+0x28> 347be: 9f 57 subi r25, 0x7F ; 127 347c0: 98 f0 brcs .+38 ; 0x347e8 <__fixunssfsi+0x30> 347c2: b9 2f mov r27, r25 347c4: 99 27 eor r25, r25 347c6: b7 51 subi r27, 0x17 ; 23 347c8: b0 f0 brcs .+44 ; 0x347f6 <__fixunssfsi+0x3e> 347ca: e1 f0 breq .+56 ; 0x34804 <__fixunssfsi+0x4c> 347cc: 66 0f add r22, r22 347ce: 77 1f adc r23, r23 347d0: 88 1f adc r24, r24 347d2: 99 1f adc r25, r25 347d4: 1a f0 brmi .+6 ; 0x347dc <__fixunssfsi+0x24> 347d6: ba 95 dec r27 347d8: c9 f7 brne .-14 ; 0x347cc <__fixunssfsi+0x14> 347da: 14 c0 rjmp .+40 ; 0x34804 <__fixunssfsi+0x4c> 347dc: b1 30 cpi r27, 0x01 ; 1 347de: 91 f0 breq .+36 ; 0x34804 <__fixunssfsi+0x4c> 347e0: 0f 94 c0 9c call 0x33980 ; 0x33980 <__fp_zero> 347e4: b1 e0 ldi r27, 0x01 ; 1 347e6: 08 95 ret 347e8: 0d 94 c0 9c jmp 0x33980 ; 0x33980 <__fp_zero> 347ec: 67 2f mov r22, r23 347ee: 78 2f mov r23, r24 347f0: 88 27 eor r24, r24 347f2: b8 5f subi r27, 0xF8 ; 248 347f4: 39 f0 breq .+14 ; 0x34804 <__fixunssfsi+0x4c> 347f6: b9 3f cpi r27, 0xF9 ; 249 347f8: cc f3 brlt .-14 ; 0x347ec <__fixunssfsi+0x34> 347fa: 86 95 lsr r24 347fc: 77 95 ror r23 347fe: 67 95 ror r22 34800: b3 95 inc r27 34802: d9 f7 brne .-10 ; 0x347fa <__fixunssfsi+0x42> 34804: 3e f4 brtc .+14 ; 0x34814 <__fixunssfsi+0x5c> 34806: 90 95 com r25 34808: 80 95 com r24 3480a: 70 95 com r23 3480c: 61 95 neg r22 3480e: 7f 4f sbci r23, 0xFF ; 255 34810: 8f 4f sbci r24, 0xFF ; 255 34812: 9f 4f sbci r25, 0xFF ; 255 34814: 08 95 ret 00034816 : 34816: 0f 94 d5 a4 call 0x349aa ; 0x349aa <__fp_trunc> 3481a: 90 f0 brcs .+36 ; 0x34840 3481c: 9f 37 cpi r25, 0x7F ; 127 3481e: 48 f4 brcc .+18 ; 0x34832 34820: 91 11 cpse r25, r1 34822: 16 f0 brts .+4 ; 0x34828 34824: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 34828: 60 e0 ldi r22, 0x00 ; 0 3482a: 70 e0 ldi r23, 0x00 ; 0 3482c: 80 e8 ldi r24, 0x80 ; 128 3482e: 9f eb ldi r25, 0xBF ; 191 34830: 08 95 ret 34832: 26 f4 brtc .+8 ; 0x3483c 34834: 1b 16 cp r1, r27 34836: 61 1d adc r22, r1 34838: 71 1d adc r23, r1 3483a: 81 1d adc r24, r1 3483c: 0d 94 46 a4 jmp 0x3488c ; 0x3488c <__fp_mintl> 34840: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 00034844 <__fp_cmp>: 34844: 99 0f add r25, r25 34846: 00 08 sbc r0, r0 34848: 55 0f add r21, r21 3484a: aa 0b sbc r26, r26 3484c: e0 e8 ldi r30, 0x80 ; 128 3484e: fe ef ldi r31, 0xFE ; 254 34850: 16 16 cp r1, r22 34852: 17 06 cpc r1, r23 34854: e8 07 cpc r30, r24 34856: f9 07 cpc r31, r25 34858: c0 f0 brcs .+48 ; 0x3488a <__fp_cmp+0x46> 3485a: 12 16 cp r1, r18 3485c: 13 06 cpc r1, r19 3485e: e4 07 cpc r30, r20 34860: f5 07 cpc r31, r21 34862: 98 f0 brcs .+38 ; 0x3488a <__fp_cmp+0x46> 34864: 62 1b sub r22, r18 34866: 73 0b sbc r23, r19 34868: 84 0b sbc r24, r20 3486a: 95 0b sbc r25, r21 3486c: 39 f4 brne .+14 ; 0x3487c <__fp_cmp+0x38> 3486e: 0a 26 eor r0, r26 34870: 61 f0 breq .+24 ; 0x3488a <__fp_cmp+0x46> 34872: 23 2b or r18, r19 34874: 24 2b or r18, r20 34876: 25 2b or r18, r21 34878: 21 f4 brne .+8 ; 0x34882 <__fp_cmp+0x3e> 3487a: 08 95 ret 3487c: 0a 26 eor r0, r26 3487e: 09 f4 brne .+2 ; 0x34882 <__fp_cmp+0x3e> 34880: a1 40 sbci r26, 0x01 ; 1 34882: a6 95 lsr r26 34884: 8f ef ldi r24, 0xFF ; 255 34886: 81 1d adc r24, r1 34888: 81 1d adc r24, r1 3488a: 08 95 ret 0003488c <__fp_mintl>: 3488c: 88 23 and r24, r24 3488e: 71 f4 brne .+28 ; 0x348ac <__fp_mintl+0x20> 34890: 77 23 and r23, r23 34892: 21 f0 breq .+8 ; 0x3489c <__fp_mintl+0x10> 34894: 98 50 subi r25, 0x08 ; 8 34896: 87 2b or r24, r23 34898: 76 2f mov r23, r22 3489a: 07 c0 rjmp .+14 ; 0x348aa <__fp_mintl+0x1e> 3489c: 66 23 and r22, r22 3489e: 11 f4 brne .+4 ; 0x348a4 <__fp_mintl+0x18> 348a0: 99 27 eor r25, r25 348a2: 0d c0 rjmp .+26 ; 0x348be <__fp_mintl+0x32> 348a4: 90 51 subi r25, 0x10 ; 16 348a6: 86 2b or r24, r22 348a8: 70 e0 ldi r23, 0x00 ; 0 348aa: 60 e0 ldi r22, 0x00 ; 0 348ac: 2a f0 brmi .+10 ; 0x348b8 <__fp_mintl+0x2c> 348ae: 9a 95 dec r25 348b0: 66 0f add r22, r22 348b2: 77 1f adc r23, r23 348b4: 88 1f adc r24, r24 348b6: da f7 brpl .-10 ; 0x348ae <__fp_mintl+0x22> 348b8: 88 0f add r24, r24 348ba: 96 95 lsr r25 348bc: 87 95 ror r24 348be: 97 f9 bld r25, 7 348c0: 08 95 ret 000348c2 <__fp_mpack>: 348c2: 9f 3f cpi r25, 0xFF ; 255 348c4: 31 f0 breq .+12 ; 0x348d2 <__fp_mpack_finite+0xc> 000348c6 <__fp_mpack_finite>: 348c6: 91 50 subi r25, 0x01 ; 1 348c8: 20 f4 brcc .+8 ; 0x348d2 <__fp_mpack_finite+0xc> 348ca: 87 95 ror r24 348cc: 77 95 ror r23 348ce: 67 95 ror r22 348d0: b7 95 ror r27 348d2: 88 0f add r24, r24 348d4: 91 1d adc r25, r1 348d6: 96 95 lsr r25 348d8: 87 95 ror r24 348da: 97 f9 bld r25, 7 348dc: 08 95 ret 000348de <__fp_powser>: 348de: df 93 push r29 348e0: cf 93 push r28 348e2: 1f 93 push r17 348e4: 0f 93 push r16 348e6: ff 92 push r15 348e8: ef 92 push r14 348ea: df 92 push r13 348ec: 7b 01 movw r14, r22 348ee: 8c 01 movw r16, r24 348f0: 68 94 set 348f2: 06 c0 rjmp .+12 ; 0x34900 <__fp_powser+0x22> 348f4: da 2e mov r13, r26 348f6: ef 01 movw r28, r30 348f8: 0f 94 1c 9c call 0x33838 ; 0x33838 <__mulsf3x> 348fc: fe 01 movw r30, r28 348fe: e8 94 clt 34900: a5 91 lpm r26, Z+ 34902: 25 91 lpm r18, Z+ 34904: 35 91 lpm r19, Z+ 34906: 45 91 lpm r20, Z+ 34908: 55 91 lpm r21, Z+ 3490a: a6 f3 brts .-24 ; 0x348f4 <__fp_powser+0x16> 3490c: ef 01 movw r28, r30 3490e: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 34912: fe 01 movw r30, r28 34914: 97 01 movw r18, r14 34916: a8 01 movw r20, r16 34918: da 94 dec r13 3491a: 69 f7 brne .-38 ; 0x348f6 <__fp_powser+0x18> 3491c: df 90 pop r13 3491e: ef 90 pop r14 34920: ff 90 pop r15 34922: 0f 91 pop r16 34924: 1f 91 pop r17 34926: cf 91 pop r28 34928: df 91 pop r29 3492a: 08 95 ret 3492c: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 00034930 <__fp_rempio2>: 34930: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34934: d8 f3 brcs .-10 ; 0x3492c <__fp_powser+0x4e> 34936: e8 94 clt 34938: e0 e0 ldi r30, 0x00 ; 0 3493a: bb 27 eor r27, r27 3493c: 9f 57 subi r25, 0x7F ; 127 3493e: f0 f0 brcs .+60 ; 0x3497c <__fp_rempio2+0x4c> 34940: 2a ed ldi r18, 0xDA ; 218 34942: 3f e0 ldi r19, 0x0F ; 15 34944: 49 ec ldi r20, 0xC9 ; 201 34946: 06 c0 rjmp .+12 ; 0x34954 <__fp_rempio2+0x24> 34948: ee 0f add r30, r30 3494a: bb 0f add r27, r27 3494c: 66 1f adc r22, r22 3494e: 77 1f adc r23, r23 34950: 88 1f adc r24, r24 34952: 28 f0 brcs .+10 ; 0x3495e <__fp_rempio2+0x2e> 34954: b2 3a cpi r27, 0xA2 ; 162 34956: 62 07 cpc r22, r18 34958: 73 07 cpc r23, r19 3495a: 84 07 cpc r24, r20 3495c: 28 f0 brcs .+10 ; 0x34968 <__fp_rempio2+0x38> 3495e: b2 5a subi r27, 0xA2 ; 162 34960: 62 0b sbc r22, r18 34962: 73 0b sbc r23, r19 34964: 84 0b sbc r24, r20 34966: e3 95 inc r30 34968: 9a 95 dec r25 3496a: 72 f7 brpl .-36 ; 0x34948 <__fp_rempio2+0x18> 3496c: 80 38 cpi r24, 0x80 ; 128 3496e: 30 f4 brcc .+12 ; 0x3497c <__fp_rempio2+0x4c> 34970: 9a 95 dec r25 34972: bb 0f add r27, r27 34974: 66 1f adc r22, r22 34976: 77 1f adc r23, r23 34978: 88 1f adc r24, r24 3497a: d2 f7 brpl .-12 ; 0x34970 <__fp_rempio2+0x40> 3497c: 90 48 sbci r25, 0x80 ; 128 3497e: 0d 94 63 a4 jmp 0x348c6 ; 0x348c6 <__fp_mpack_finite> 00034982 <__fp_sinus>: 34982: ef 93 push r30 34984: e0 ff sbrs r30, 0 34986: 07 c0 rjmp .+14 ; 0x34996 <__fp_sinus+0x14> 34988: a2 ea ldi r26, 0xA2 ; 162 3498a: 2a ed ldi r18, 0xDA ; 218 3498c: 3f e0 ldi r19, 0x0F ; 15 3498e: 49 ec ldi r20, 0xC9 ; 201 34990: 5f eb ldi r21, 0xBF ; 191 34992: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 34996: 0f 94 8d 9c call 0x3391a ; 0x3391a <__fp_round> 3499a: 0f 90 pop r0 3499c: 03 94 inc r0 3499e: 01 fc sbrc r0, 1 349a0: 90 58 subi r25, 0x80 ; 128 349a2: e5 e5 ldi r30, 0x55 ; 85 349a4: fd e6 ldi r31, 0x6D ; 109 349a6: 0d 94 b8 a6 jmp 0x34d70 ; 0x34d70 <__fp_powsodd> 000349aa <__fp_trunc>: 349aa: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 349ae: a0 f0 brcs .+40 ; 0x349d8 <__fp_trunc+0x2e> 349b0: be e7 ldi r27, 0x7E ; 126 349b2: b9 17 cp r27, r25 349b4: 88 f4 brcc .+34 ; 0x349d8 <__fp_trunc+0x2e> 349b6: bb 27 eor r27, r27 349b8: 9f 38 cpi r25, 0x8F ; 143 349ba: 60 f4 brcc .+24 ; 0x349d4 <__fp_trunc+0x2a> 349bc: 16 16 cp r1, r22 349be: b1 1d adc r27, r1 349c0: 67 2f mov r22, r23 349c2: 78 2f mov r23, r24 349c4: 88 27 eor r24, r24 349c6: 98 5f subi r25, 0xF8 ; 248 349c8: f7 cf rjmp .-18 ; 0x349b8 <__fp_trunc+0xe> 349ca: 86 95 lsr r24 349cc: 77 95 ror r23 349ce: 67 95 ror r22 349d0: b1 1d adc r27, r1 349d2: 93 95 inc r25 349d4: 96 39 cpi r25, 0x96 ; 150 349d6: c8 f3 brcs .-14 ; 0x349ca <__fp_trunc+0x20> 349d8: 08 95 ret 000349da <__gesf2>: 349da: 0f 94 22 a4 call 0x34844 ; 0x34844 <__fp_cmp> 349de: 08 f4 brcc .+2 ; 0x349e2 <__gesf2+0x8> 349e0: 8f ef ldi r24, 0xFF ; 255 349e2: 08 95 ret 349e4: 0f 94 7f 9c call 0x338fe ; 0x338fe <__fp_pscA> 349e8: 29 f0 breq .+10 ; 0x349f4 <__gesf2+0x1a> 349ea: 0f 94 86 9c call 0x3390c ; 0x3390c <__fp_pscB> 349ee: 11 f0 breq .+4 ; 0x349f4 <__gesf2+0x1a> 349f0: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 349f4: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 349f8: b9 01 movw r22, r18 349fa: ca 01 movw r24, r20 349fc: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 00034a00 : 34a00: 9f 77 andi r25, 0x7F ; 127 34a02: 5f 77 andi r21, 0x7F ; 127 34a04: 0f 94 9e 9c call 0x3393c ; 0x3393c <__fp_split3> 34a08: 68 f3 brcs .-38 ; 0x349e4 <__gesf2+0xa> 34a0a: 99 23 and r25, r25 34a0c: a9 f3 breq .-22 ; 0x349f8 <__gesf2+0x1e> 34a0e: 55 23 and r21, r21 34a10: a9 f3 breq .-22 ; 0x349fc <__gesf2+0x22> 34a12: ff 27 eor r31, r31 34a14: 95 17 cp r25, r21 34a16: 58 f4 brcc .+22 ; 0x34a2e 34a18: e5 2f mov r30, r21 34a1a: e9 1b sub r30, r25 34a1c: ed 30 cpi r30, 0x0D ; 13 34a1e: 60 f7 brcc .-40 ; 0x349f8 <__gesf2+0x1e> 34a20: 5e 3b cpi r21, 0xBE ; 190 34a22: 10 f0 brcs .+4 ; 0x34a28 34a24: f1 e4 ldi r31, 0x41 ; 65 34a26: 1c c0 rjmp .+56 ; 0x34a60 34a28: 90 34 cpi r25, 0x40 ; 64 34a2a: e0 f4 brcc .+56 ; 0x34a64 34a2c: 0a c0 rjmp .+20 ; 0x34a42 34a2e: e9 2f mov r30, r25 34a30: e5 1b sub r30, r21 34a32: ed 30 cpi r30, 0x0D ; 13 34a34: 18 f7 brcc .-58 ; 0x349fc <__gesf2+0x22> 34a36: 9e 3b cpi r25, 0xBE ; 190 34a38: 10 f0 brcs .+4 ; 0x34a3e 34a3a: f1 e4 ldi r31, 0x41 ; 65 34a3c: 11 c0 rjmp .+34 ; 0x34a60 34a3e: 50 34 cpi r21, 0x40 ; 64 34a40: 88 f4 brcc .+34 ; 0x34a64 34a42: f9 ea ldi r31, 0xA9 ; 169 34a44: 88 23 and r24, r24 34a46: 2a f0 brmi .+10 ; 0x34a52 34a48: 9a 95 dec r25 34a4a: 66 0f add r22, r22 34a4c: 77 1f adc r23, r23 34a4e: 88 1f adc r24, r24 34a50: da f7 brpl .-10 ; 0x34a48 34a52: 44 23 and r20, r20 34a54: 2a f0 brmi .+10 ; 0x34a60 34a56: 5a 95 dec r21 34a58: 22 0f add r18, r18 34a5a: 33 1f adc r19, r19 34a5c: 44 1f adc r20, r20 34a5e: da f7 brpl .-10 ; 0x34a56 34a60: 9f 1b sub r25, r31 34a62: 5f 1b sub r21, r31 34a64: ff 93 push r31 34a66: 1f 93 push r17 34a68: 0f 93 push r16 34a6a: ff 92 push r15 34a6c: ef 92 push r14 34a6e: 79 01 movw r14, r18 34a70: 8a 01 movw r16, r20 34a72: bb 27 eor r27, r27 34a74: ab 2f mov r26, r27 34a76: 9b 01 movw r18, r22 34a78: ac 01 movw r20, r24 34a7a: 0f 94 1f 9c call 0x3383e ; 0x3383e <__mulsf3_pse> 34a7e: 97 01 movw r18, r14 34a80: a8 01 movw r20, r16 34a82: bf 93 push r27 34a84: 7b 01 movw r14, r22 34a86: 8c 01 movw r16, r24 34a88: aa 27 eor r26, r26 34a8a: ba 2f mov r27, r26 34a8c: b9 01 movw r22, r18 34a8e: ca 01 movw r24, r20 34a90: 0f 94 1f 9c call 0x3383e ; 0x3383e <__mulsf3_pse> 34a94: af 91 pop r26 34a96: 97 01 movw r18, r14 34a98: a8 01 movw r20, r16 34a9a: ef 90 pop r14 34a9c: ff 90 pop r15 34a9e: 0f 91 pop r16 34aa0: 1f 91 pop r17 34aa2: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 34aa6: 0f 94 8d 9c call 0x3391a ; 0x3391a <__fp_round> 34aaa: 0f 94 32 a6 call 0x34c64 ; 0x34c64 34aae: 4f 91 pop r20 34ab0: 40 ff sbrs r20, 0 34ab2: 08 95 ret 34ab4: 55 27 eor r21, r21 34ab6: 47 fd sbrc r20, 7 34ab8: 50 95 com r21 34aba: 0d 94 6b a5 jmp 0x34ad6 ; 0x34ad6 00034abe : 34abe: 9b 01 movw r18, r22 34ac0: ac 01 movw r20, r24 34ac2: 60 e0 ldi r22, 0x00 ; 0 34ac4: 70 e0 ldi r23, 0x00 ; 0 34ac6: 80 e8 ldi r24, 0x80 ; 128 34ac8: 9f e3 ldi r25, 0x3F ; 63 34aca: 0d 94 63 a3 jmp 0x346c6 ; 0x346c6 <__divsf3> 34ace: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 34ad2: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 00034ad6 : 34ad6: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34ada: d8 f3 brcs .-10 ; 0x34ad2 34adc: 99 23 and r25, r25 34ade: c9 f3 breq .-14 ; 0x34ad2 34ae0: 94 0f add r25, r20 34ae2: 51 1d adc r21, r1 34ae4: a3 f3 brvs .-24 ; 0x34ace 34ae6: 91 50 subi r25, 0x01 ; 1 34ae8: 50 40 sbci r21, 0x00 ; 0 34aea: 94 f0 brlt .+36 ; 0x34b10 34aec: 59 f0 breq .+22 ; 0x34b04 34aee: 88 23 and r24, r24 34af0: 32 f0 brmi .+12 ; 0x34afe 34af2: 66 0f add r22, r22 34af4: 77 1f adc r23, r23 34af6: 88 1f adc r24, r24 34af8: 91 50 subi r25, 0x01 ; 1 34afa: 50 40 sbci r21, 0x00 ; 0 34afc: c1 f7 brne .-16 ; 0x34aee 34afe: 9e 3f cpi r25, 0xFE ; 254 34b00: 51 05 cpc r21, r1 34b02: 2c f7 brge .-54 ; 0x34ace 34b04: 88 0f add r24, r24 34b06: 91 1d adc r25, r1 34b08: 96 95 lsr r25 34b0a: 87 95 ror r24 34b0c: 97 f9 bld r25, 7 34b0e: 08 95 ret 34b10: 5f 3f cpi r21, 0xFF ; 255 34b12: ac f0 brlt .+42 ; 0x34b3e 34b14: 98 3e cpi r25, 0xE8 ; 232 34b16: 9c f0 brlt .+38 ; 0x34b3e 34b18: bb 27 eor r27, r27 34b1a: 86 95 lsr r24 34b1c: 77 95 ror r23 34b1e: 67 95 ror r22 34b20: b7 95 ror r27 34b22: 08 f4 brcc .+2 ; 0x34b26 34b24: b1 60 ori r27, 0x01 ; 1 34b26: 93 95 inc r25 34b28: c1 f7 brne .-16 ; 0x34b1a 34b2a: bb 0f add r27, r27 34b2c: 58 f7 brcc .-42 ; 0x34b04 34b2e: 11 f4 brne .+4 ; 0x34b34 34b30: 60 ff sbrs r22, 0 34b32: e8 cf rjmp .-48 ; 0x34b04 34b34: 6f 5f subi r22, 0xFF ; 255 34b36: 7f 4f sbci r23, 0xFF ; 255 34b38: 8f 4f sbci r24, 0xFF ; 255 34b3a: 9f 4f sbci r25, 0xFF ; 255 34b3c: e3 cf rjmp .-58 ; 0x34b04 34b3e: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 00034b42 : 34b42: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34b46: 58 f1 brcs .+86 ; 0x34b9e 34b48: 9e 57 subi r25, 0x7E ; 126 34b4a: 60 f1 brcs .+88 ; 0x34ba4 34b4c: 98 51 subi r25, 0x18 ; 24 34b4e: a0 f0 brcs .+40 ; 0x34b78 34b50: e9 f0 breq .+58 ; 0x34b8c 34b52: 98 30 cpi r25, 0x08 ; 8 34b54: 20 f5 brcc .+72 ; 0x34b9e 34b56: 09 2e mov r0, r25 34b58: 99 27 eor r25, r25 34b5a: 66 0f add r22, r22 34b5c: 77 1f adc r23, r23 34b5e: 88 1f adc r24, r24 34b60: 99 1f adc r25, r25 34b62: 0a 94 dec r0 34b64: d1 f7 brne .-12 ; 0x34b5a 34b66: 12 c0 rjmp .+36 ; 0x34b8c 34b68: 06 2e mov r0, r22 34b6a: 67 2f mov r22, r23 34b6c: 78 2f mov r23, r24 34b6e: 88 27 eor r24, r24 34b70: 98 5f subi r25, 0xF8 ; 248 34b72: 11 f4 brne .+4 ; 0x34b78 34b74: 00 0c add r0, r0 34b76: 07 c0 rjmp .+14 ; 0x34b86 34b78: 99 3f cpi r25, 0xF9 ; 249 34b7a: b4 f3 brlt .-20 ; 0x34b68 34b7c: 86 95 lsr r24 34b7e: 77 95 ror r23 34b80: 67 95 ror r22 34b82: 93 95 inc r25 34b84: d9 f7 brne .-10 ; 0x34b7c 34b86: 61 1d adc r22, r1 34b88: 71 1d adc r23, r1 34b8a: 81 1d adc r24, r1 34b8c: 3e f4 brtc .+14 ; 0x34b9c 34b8e: 90 95 com r25 34b90: 80 95 com r24 34b92: 70 95 com r23 34b94: 61 95 neg r22 34b96: 7f 4f sbci r23, 0xFF ; 255 34b98: 8f 4f sbci r24, 0xFF ; 255 34b9a: 9f 4f sbci r25, 0xFF ; 255 34b9c: 08 95 ret 34b9e: 68 94 set 34ba0: 0d 94 c1 9c jmp 0x33982 ; 0x33982 <__fp_szero> 34ba4: 0d 94 c0 9c jmp 0x33980 ; 0x33980 <__fp_zero> 00034ba8 : 34ba8: fa 01 movw r30, r20 34baa: ee 0f add r30, r30 34bac: ff 1f adc r31, r31 34bae: 30 96 adiw r30, 0x00 ; 0 34bb0: 21 05 cpc r18, r1 34bb2: 31 05 cpc r19, r1 34bb4: a1 f1 breq .+104 ; 0x34c1e 34bb6: 61 15 cp r22, r1 34bb8: 71 05 cpc r23, r1 34bba: 61 f4 brne .+24 ; 0x34bd4 34bbc: 80 38 cpi r24, 0x80 ; 128 34bbe: bf e3 ldi r27, 0x3F ; 63 34bc0: 9b 07 cpc r25, r27 34bc2: 49 f1 breq .+82 ; 0x34c16 34bc4: 68 94 set 34bc6: 90 38 cpi r25, 0x80 ; 128 34bc8: 81 05 cpc r24, r1 34bca: 61 f0 breq .+24 ; 0x34be4 34bcc: 80 38 cpi r24, 0x80 ; 128 34bce: bf ef ldi r27, 0xFF ; 255 34bd0: 9b 07 cpc r25, r27 34bd2: 41 f0 breq .+16 ; 0x34be4 34bd4: 99 23 and r25, r25 34bd6: 4a f5 brpl .+82 ; 0x34c2a 34bd8: ff 3f cpi r31, 0xFF ; 255 34bda: e1 05 cpc r30, r1 34bdc: 31 05 cpc r19, r1 34bde: 21 05 cpc r18, r1 34be0: 19 f1 breq .+70 ; 0x34c28 34be2: e8 94 clt 34be4: 08 94 sec 34be6: e7 95 ror r30 34be8: d9 01 movw r26, r18 34bea: aa 23 and r26, r26 34bec: 29 f4 brne .+10 ; 0x34bf8 34bee: ab 2f mov r26, r27 34bf0: be 2f mov r27, r30 34bf2: f8 5f subi r31, 0xF8 ; 248 34bf4: d0 f3 brcs .-12 ; 0x34bea 34bf6: 10 c0 rjmp .+32 ; 0x34c18 34bf8: ff 5f subi r31, 0xFF ; 255 34bfa: 70 f4 brcc .+28 ; 0x34c18 34bfc: a6 95 lsr r26 34bfe: e0 f7 brcc .-8 ; 0x34bf8 34c00: f7 39 cpi r31, 0x97 ; 151 34c02: 50 f0 brcs .+20 ; 0x34c18 34c04: 19 f0 breq .+6 ; 0x34c0c 34c06: ff 3a cpi r31, 0xAF ; 175 34c08: 38 f4 brcc .+14 ; 0x34c18 34c0a: 9f 77 andi r25, 0x7F ; 127 34c0c: 9f 93 push r25 34c0e: 0d d0 rcall .+26 ; 0x34c2a 34c10: 0f 90 pop r0 34c12: 07 fc sbrc r0, 7 34c14: 90 58 subi r25, 0x80 ; 128 34c16: 08 95 ret 34c18: 46 f0 brts .+16 ; 0x34c2a 34c1a: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 34c1e: 60 e0 ldi r22, 0x00 ; 0 34c20: 70 e0 ldi r23, 0x00 ; 0 34c22: 80 e8 ldi r24, 0x80 ; 128 34c24: 9f e3 ldi r25, 0x3F ; 63 34c26: 08 95 ret 34c28: 4f e7 ldi r20, 0x7F ; 127 34c2a: 9f 77 andi r25, 0x7F ; 127 34c2c: 5f 93 push r21 34c2e: 4f 93 push r20 34c30: 3f 93 push r19 34c32: 2f 93 push r18 34c34: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 34c38: 2f 91 pop r18 34c3a: 3f 91 pop r19 34c3c: 4f 91 pop r20 34c3e: 5f 91 pop r21 34c40: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 34c44: 0d 94 7f a6 jmp 0x34cfe ; 0x34cfe 00034c48 : 34c48: 9f 93 push r25 34c4a: 0f 94 98 a4 call 0x34930 ; 0x34930 <__fp_rempio2> 34c4e: 0f 90 pop r0 34c50: 07 fc sbrc r0, 7 34c52: ee 5f subi r30, 0xFE ; 254 34c54: 0d 94 c1 a4 jmp 0x34982 ; 0x34982 <__fp_sinus> 34c58: 19 f4 brne .+6 ; 0x34c60 34c5a: 16 f4 brtc .+4 ; 0x34c60 34c5c: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 34c60: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 00034c64 : 34c64: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34c68: b8 f3 brcs .-18 ; 0x34c58 34c6a: 99 23 and r25, r25 34c6c: c9 f3 breq .-14 ; 0x34c60 34c6e: b6 f3 brts .-20 ; 0x34c5c 34c70: 9f 57 subi r25, 0x7F ; 127 34c72: 55 0b sbc r21, r21 34c74: 87 ff sbrs r24, 7 34c76: 0f 94 b1 a6 call 0x34d62 ; 0x34d62 <__fp_norm2> 34c7a: 00 24 eor r0, r0 34c7c: a0 e6 ldi r26, 0x60 ; 96 34c7e: 40 ea ldi r20, 0xA0 ; 160 34c80: 90 01 movw r18, r0 34c82: 80 58 subi r24, 0x80 ; 128 34c84: 56 95 lsr r21 34c86: 97 95 ror r25 34c88: 28 f4 brcc .+10 ; 0x34c94 34c8a: 80 5c subi r24, 0xC0 ; 192 34c8c: 66 0f add r22, r22 34c8e: 77 1f adc r23, r23 34c90: 88 1f adc r24, r24 34c92: 20 f0 brcs .+8 ; 0x34c9c 34c94: 26 17 cp r18, r22 34c96: 37 07 cpc r19, r23 34c98: 48 07 cpc r20, r24 34c9a: 30 f4 brcc .+12 ; 0x34ca8 34c9c: 62 1b sub r22, r18 34c9e: 73 0b sbc r23, r19 34ca0: 84 0b sbc r24, r20 34ca2: 20 29 or r18, r0 34ca4: 31 29 or r19, r1 34ca6: 4a 2b or r20, r26 34ca8: a6 95 lsr r26 34caa: 17 94 ror r1 34cac: 07 94 ror r0 34cae: 20 25 eor r18, r0 34cb0: 31 25 eor r19, r1 34cb2: 4a 27 eor r20, r26 34cb4: 58 f7 brcc .-42 ; 0x34c8c 34cb6: 66 0f add r22, r22 34cb8: 77 1f adc r23, r23 34cba: 88 1f adc r24, r24 34cbc: 20 f0 brcs .+8 ; 0x34cc6 34cbe: 26 17 cp r18, r22 34cc0: 37 07 cpc r19, r23 34cc2: 48 07 cpc r20, r24 34cc4: 30 f4 brcc .+12 ; 0x34cd2 34cc6: 62 0b sbc r22, r18 34cc8: 73 0b sbc r23, r19 34cca: 84 0b sbc r24, r20 34ccc: 20 0d add r18, r0 34cce: 31 1d adc r19, r1 34cd0: 41 1d adc r20, r1 34cd2: a0 95 com r26 34cd4: 81 f7 brne .-32 ; 0x34cb6 34cd6: b9 01 movw r22, r18 34cd8: 84 2f mov r24, r20 34cda: 91 58 subi r25, 0x81 ; 129 34cdc: 88 0f add r24, r24 34cde: 96 95 lsr r25 34ce0: 87 95 ror r24 34ce2: 08 95 ret 00034ce4 <__unordsf2>: 34ce4: 0f 94 22 a4 call 0x34844 ; 0x34844 <__fp_cmp> 34ce8: 88 0b sbc r24, r24 34cea: 99 0b sbc r25, r25 34cec: 08 95 ret 34cee: 29 f4 brne .+10 ; 0x34cfa <__unordsf2+0x16> 34cf0: 16 f0 brts .+4 ; 0x34cf6 <__unordsf2+0x12> 34cf2: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 34cf6: 0d 94 c0 9c jmp 0x33980 ; 0x33980 <__fp_zero> 34cfa: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 00034cfe : 34cfe: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34d02: a8 f3 brcs .-22 ; 0x34cee <__unordsf2+0xa> 34d04: 96 38 cpi r25, 0x86 ; 134 34d06: a0 f7 brcc .-24 ; 0x34cf0 <__unordsf2+0xc> 34d08: 07 f8 bld r0, 7 34d0a: 0f 92 push r0 34d0c: e8 94 clt 34d0e: 2b e3 ldi r18, 0x3B ; 59 34d10: 3a ea ldi r19, 0xAA ; 170 34d12: 48 eb ldi r20, 0xB8 ; 184 34d14: 5f e7 ldi r21, 0x7F ; 127 34d16: 0f 94 1f 9c call 0x3383e ; 0x3383e <__mulsf3_pse> 34d1a: 0f 92 push r0 34d1c: 0f 92 push r0 34d1e: 0f 92 push r0 34d20: 4d b7 in r20, 0x3d ; 61 34d22: 5e b7 in r21, 0x3e ; 62 34d24: 0f 92 push r0 34d26: 0f 94 1c a7 call 0x34e38 ; 0x34e38 34d2a: e3 e7 ldi r30, 0x73 ; 115 34d2c: fd e6 ldi r31, 0x6D ; 109 34d2e: 0f 94 6f a4 call 0x348de ; 0x348de <__fp_powser> 34d32: 4f 91 pop r20 34d34: 5f 91 pop r21 34d36: ef 91 pop r30 34d38: ff 91 pop r31 34d3a: e5 95 asr r30 34d3c: ee 1f adc r30, r30 34d3e: ff 1f adc r31, r31 34d40: 49 f0 breq .+18 ; 0x34d54 34d42: fe 57 subi r31, 0x7E ; 126 34d44: e0 68 ori r30, 0x80 ; 128 34d46: 44 27 eor r20, r20 34d48: ee 0f add r30, r30 34d4a: 44 1f adc r20, r20 34d4c: fa 95 dec r31 34d4e: e1 f7 brne .-8 ; 0x34d48 34d50: 41 95 neg r20 34d52: 55 0b sbc r21, r21 34d54: 0f 94 6b a5 call 0x34ad6 ; 0x34ad6 34d58: 0f 90 pop r0 34d5a: 07 fe sbrs r0, 7 34d5c: 0d 94 5f a5 jmp 0x34abe ; 0x34abe 34d60: 08 95 ret 00034d62 <__fp_norm2>: 34d62: 91 50 subi r25, 0x01 ; 1 34d64: 50 40 sbci r21, 0x00 ; 0 34d66: 66 0f add r22, r22 34d68: 77 1f adc r23, r23 34d6a: 88 1f adc r24, r24 34d6c: d2 f7 brpl .-12 ; 0x34d62 <__fp_norm2> 34d6e: 08 95 ret 00034d70 <__fp_powsodd>: 34d70: 9f 93 push r25 34d72: 8f 93 push r24 34d74: 7f 93 push r23 34d76: 6f 93 push r22 34d78: ff 93 push r31 34d7a: ef 93 push r30 34d7c: 9b 01 movw r18, r22 34d7e: ac 01 movw r20, r24 34d80: 0f 94 09 9c call 0x33812 ; 0x33812 <__mulsf3> 34d84: ef 91 pop r30 34d86: ff 91 pop r31 34d88: 0f 94 6f a4 call 0x348de ; 0x348de <__fp_powser> 34d8c: 2f 91 pop r18 34d8e: 3f 91 pop r19 34d90: 4f 91 pop r20 34d92: 5f 91 pop r21 34d94: 0d 94 09 9c jmp 0x33812 ; 0x33812 <__mulsf3> 34d98: 16 f0 brts .+4 ; 0x34d9e <__fp_powsodd+0x2e> 34d9a: 0d 94 61 a4 jmp 0x348c2 ; 0x348c2 <__fp_mpack> 34d9e: 0d 94 7c 9c jmp 0x338f8 ; 0x338f8 <__fp_nan> 34da2: 68 94 set 34da4: 0d 94 76 9c jmp 0x338ec ; 0x338ec <__fp_inf> 00034da8 : 34da8: 0f 94 a6 9c call 0x3394c ; 0x3394c <__fp_splitA> 34dac: a8 f3 brcs .-22 ; 0x34d98 <__fp_powsodd+0x28> 34dae: 99 23 and r25, r25 34db0: c1 f3 breq .-16 ; 0x34da2 <__fp_powsodd+0x32> 34db2: ae f3 brts .-22 ; 0x34d9e <__fp_powsodd+0x2e> 34db4: df 93 push r29 34db6: cf 93 push r28 34db8: 1f 93 push r17 34dba: 0f 93 push r16 34dbc: ff 92 push r15 34dbe: c9 2f mov r28, r25 34dc0: dd 27 eor r29, r29 34dc2: 88 23 and r24, r24 34dc4: 2a f0 brmi .+10 ; 0x34dd0 34dc6: 21 97 sbiw r28, 0x01 ; 1 34dc8: 66 0f add r22, r22 34dca: 77 1f adc r23, r23 34dcc: 88 1f adc r24, r24 34dce: da f7 brpl .-10 ; 0x34dc6 34dd0: 20 e0 ldi r18, 0x00 ; 0 34dd2: 30 e0 ldi r19, 0x00 ; 0 34dd4: 40 e8 ldi r20, 0x80 ; 128 34dd6: 5f eb ldi r21, 0xBF ; 191 34dd8: 9f e3 ldi r25, 0x3F ; 63 34dda: 88 39 cpi r24, 0x98 ; 152 34ddc: 20 f0 brcs .+8 ; 0x34de6 34dde: 80 3e cpi r24, 0xE0 ; 224 34de0: 38 f0 brcs .+14 ; 0x34df0 34de2: 21 96 adiw r28, 0x01 ; 1 34de4: 8f 77 andi r24, 0x7F ; 127 34de6: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 34dea: eb e9 ldi r30, 0x9B ; 155 34dec: fd e6 ldi r31, 0x6D ; 109 34dee: 04 c0 rjmp .+8 ; 0x34df8 34df0: 0f 94 64 a2 call 0x344c8 ; 0x344c8 <__addsf3> 34df4: e8 ec ldi r30, 0xC8 ; 200 34df6: fd e6 ldi r31, 0x6D ; 109 34df8: 0f 94 6f a4 call 0x348de ; 0x348de <__fp_powser> 34dfc: 8b 01 movw r16, r22 34dfe: be 01 movw r22, r28 34e00: ec 01 movw r28, r24 34e02: fb 2e mov r15, r27 34e04: 6f 57 subi r22, 0x7F ; 127 34e06: 71 09 sbc r23, r1 34e08: 75 95 asr r23 34e0a: 77 1f adc r23, r23 34e0c: 88 0b sbc r24, r24 34e0e: 99 0b sbc r25, r25 34e10: 0f 94 ca 9b call 0x33794 ; 0x33794 <__floatsisf> 34e14: 28 e1 ldi r18, 0x18 ; 24 34e16: 32 e7 ldi r19, 0x72 ; 114 34e18: 41 e3 ldi r20, 0x31 ; 49 34e1a: 5f e3 ldi r21, 0x3F ; 63 34e1c: 0f 94 1c 9c call 0x33838 ; 0x33838 <__mulsf3x> 34e20: af 2d mov r26, r15 34e22: 98 01 movw r18, r16 34e24: ae 01 movw r20, r28 34e26: ff 90 pop r15 34e28: 0f 91 pop r16 34e2a: 1f 91 pop r17 34e2c: cf 91 pop r28 34e2e: df 91 pop r29 34e30: 0f 94 7b a2 call 0x344f6 ; 0x344f6 <__addsf3x> 34e34: 0d 94 8d 9c jmp 0x3391a ; 0x3391a <__fp_round> 00034e38 : 34e38: fa 01 movw r30, r20 34e3a: dc 01 movw r26, r24 34e3c: aa 0f add r26, r26 34e3e: bb 1f adc r27, r27 34e40: 9b 01 movw r18, r22 34e42: ac 01 movw r20, r24 34e44: bf 57 subi r27, 0x7F ; 127 34e46: 28 f4 brcc .+10 ; 0x34e52 34e48: 22 27 eor r18, r18 34e4a: 33 27 eor r19, r19 34e4c: 44 27 eor r20, r20 34e4e: 50 78 andi r21, 0x80 ; 128 34e50: 20 c0 rjmp .+64 ; 0x34e92 34e52: b7 51 subi r27, 0x17 ; 23 34e54: 90 f4 brcc .+36 ; 0x34e7a 34e56: ab 2f mov r26, r27 34e58: 00 24 eor r0, r0 34e5a: 46 95 lsr r20 34e5c: 37 95 ror r19 34e5e: 27 95 ror r18 34e60: 01 1c adc r0, r1 34e62: a3 95 inc r26 34e64: d2 f3 brmi .-12 ; 0x34e5a 34e66: 00 20 and r0, r0 34e68: 71 f0 breq .+28 ; 0x34e86 34e6a: 22 0f add r18, r18 34e6c: 33 1f adc r19, r19 34e6e: 44 1f adc r20, r20 34e70: b3 95 inc r27 34e72: da f3 brmi .-10 ; 0x34e6a 34e74: 0e d0 rcall .+28 ; 0x34e92 34e76: 0d 94 63 a2 jmp 0x344c6 ; 0x344c6 <__subsf3> 34e7a: 61 30 cpi r22, 0x01 ; 1 34e7c: 71 05 cpc r23, r1 34e7e: a0 e8 ldi r26, 0x80 ; 128 34e80: 8a 07 cpc r24, r26 34e82: b9 46 sbci r27, 0x69 ; 105 34e84: 30 f4 brcc .+12 ; 0x34e92 34e86: 9b 01 movw r18, r22 34e88: ac 01 movw r20, r24 34e8a: 66 27 eor r22, r22 34e8c: 77 27 eor r23, r23 34e8e: 88 27 eor r24, r24 34e90: 90 78 andi r25, 0x80 ; 128 34e92: 30 96 adiw r30, 0x00 ; 0 34e94: 21 f0 breq .+8 ; 0x34e9e 34e96: 20 83 st Z, r18 34e98: 31 83 std Z+1, r19 ; 0x01 34e9a: 42 83 std Z+2, r20 ; 0x02 34e9c: 53 83 std Z+3, r21 ; 0x03 34e9e: 08 95 ret 00034ea0 : 34ea0: 91 11 cpse r25, r1 34ea2: 08 95 ret 34ea4: 81 54 subi r24, 0x41 ; 65 34ea6: 8a 51 subi r24, 0x1A ; 26 34ea8: 08 f4 brcc .+2 ; 0x34eac 34eaa: 80 5e subi r24, 0xE0 ; 224 34eac: 85 5a subi r24, 0xA5 ; 165 34eae: 08 95 ret 00034eb0 : 34eb0: fb 01 movw r30, r22 34eb2: dc 01 movw r26, r24 34eb4: 04 c0 rjmp .+8 ; 0x34ebe 34eb6: 8d 91 ld r24, X+ 34eb8: 01 90 ld r0, Z+ 34eba: 80 19 sub r24, r0 34ebc: 21 f4 brne .+8 ; 0x34ec6 34ebe: 41 50 subi r20, 0x01 ; 1 34ec0: 50 40 sbci r21, 0x00 ; 0 34ec2: c8 f7 brcc .-14 ; 0x34eb6 34ec4: 88 1b sub r24, r24 34ec6: 99 0b sbc r25, r25 34ec8: 08 95 ret 00034eca : 34eca: fb 01 movw r30, r22 34ecc: dc 01 movw r26, r24 34ece: 02 c0 rjmp .+4 ; 0x34ed4 34ed0: 01 90 ld r0, Z+ 34ed2: 0d 92 st X+, r0 34ed4: 41 50 subi r20, 0x01 ; 1 34ed6: 50 40 sbci r21, 0x00 ; 0 34ed8: d8 f7 brcc .-10 ; 0x34ed0 34eda: 08 95 ret 00034edc : 34edc: dc 01 movw r26, r24 34ede: 01 c0 rjmp .+2 ; 0x34ee2 34ee0: 6d 93 st X+, r22 34ee2: 41 50 subi r20, 0x01 ; 1 34ee4: 50 40 sbci r21, 0x00 ; 0 34ee6: e0 f7 brcc .-8 ; 0x34ee0 34ee8: 08 95 ret 00034eea : 34eea: fb 01 movw r30, r22 34eec: dc 01 movw r26, r24 34eee: 8d 91 ld r24, X+ 34ef0: 81 34 cpi r24, 0x41 ; 65 34ef2: 1c f0 brlt .+6 ; 0x34efa 34ef4: 8b 35 cpi r24, 0x5B ; 91 34ef6: 0c f4 brge .+2 ; 0x34efa 34ef8: 80 5e subi r24, 0xE0 ; 224 34efa: 61 91 ld r22, Z+ 34efc: 61 34 cpi r22, 0x41 ; 65 34efe: 1c f0 brlt .+6 ; 0x34f06 34f00: 6b 35 cpi r22, 0x5B ; 91 34f02: 0c f4 brge .+2 ; 0x34f06 34f04: 60 5e subi r22, 0xE0 ; 224 34f06: 86 1b sub r24, r22 34f08: 61 11 cpse r22, r1 34f0a: 89 f3 breq .-30 ; 0x34eee 34f0c: 99 0b sbc r25, r25 34f0e: 08 95 ret 00034f10 : 34f10: fb 01 movw r30, r22 34f12: dc 01 movw r26, r24 34f14: 0d 90 ld r0, X+ 34f16: 00 20 and r0, r0 34f18: e9 f7 brne .-6 ; 0x34f14 34f1a: 11 97 sbiw r26, 0x01 ; 1 34f1c: 01 90 ld r0, Z+ 34f1e: 0d 92 st X+, r0 34f20: 00 20 and r0, r0 34f22: e1 f7 brne .-8 ; 0x34f1c 34f24: 08 95 ret 00034f26 : 34f26: fc 01 movw r30, r24 34f28: 81 91 ld r24, Z+ 34f2a: 86 17 cp r24, r22 34f2c: 21 f0 breq .+8 ; 0x34f36 34f2e: 88 23 and r24, r24 34f30: d9 f7 brne .-10 ; 0x34f28 34f32: 99 27 eor r25, r25 34f34: 08 95 ret 34f36: 31 97 sbiw r30, 0x01 ; 1 34f38: cf 01 movw r24, r30 34f3a: 08 95 ret 00034f3c : 34f3c: fb 01 movw r30, r22 34f3e: dc 01 movw r26, r24 34f40: 8d 91 ld r24, X+ 34f42: 01 90 ld r0, Z+ 34f44: 80 19 sub r24, r0 34f46: 01 10 cpse r0, r1 34f48: d9 f3 breq .-10 ; 0x34f40 34f4a: 99 0b sbc r25, r25 34f4c: 08 95 ret 00034f4e : 34f4e: fb 01 movw r30, r22 34f50: dc 01 movw r26, r24 34f52: 01 90 ld r0, Z+ 34f54: 0d 92 st X+, r0 34f56: 00 20 and r0, r0 34f58: e1 f7 brne .-8 ; 0x34f52 34f5a: 08 95 ret 00034f5c : 34f5c: fb 01 movw r30, r22 34f5e: dc 01 movw r26, r24 34f60: 41 50 subi r20, 0x01 ; 1 34f62: 50 40 sbci r21, 0x00 ; 0 34f64: 30 f0 brcs .+12 ; 0x34f72 34f66: 8d 91 ld r24, X+ 34f68: 01 90 ld r0, Z+ 34f6a: 80 19 sub r24, r0 34f6c: 19 f4 brne .+6 ; 0x34f74 34f6e: 00 20 and r0, r0 34f70: b9 f7 brne .-18 ; 0x34f60 34f72: 88 1b sub r24, r24 34f74: 99 0b sbc r25, r25 34f76: 08 95 ret 00034f78 : 34f78: fb 01 movw r30, r22 34f7a: dc 01 movw r26, r24 34f7c: 41 50 subi r20, 0x01 ; 1 34f7e: 50 40 sbci r21, 0x00 ; 0 34f80: 48 f0 brcs .+18 ; 0x34f94 34f82: 01 90 ld r0, Z+ 34f84: 0d 92 st X+, r0 34f86: 00 20 and r0, r0 34f88: c9 f7 brne .-14 ; 0x34f7c 34f8a: 01 c0 rjmp .+2 ; 0x34f8e 34f8c: 1d 92 st X+, r1 34f8e: 41 50 subi r20, 0x01 ; 1 34f90: 50 40 sbci r21, 0x00 ; 0 34f92: e0 f7 brcc .-8 ; 0x34f8c 34f94: 08 95 ret 00034f96 : 34f96: 0f 93 push r16 34f98: 1f 93 push r17 34f9a: cf 93 push r28 34f9c: df 93 push r29 34f9e: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 34fa2: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 34fa6: 23 81 ldd r18, Z+3 ; 0x03 34fa8: ec 01 movw r28, r24 34faa: 10 e0 ldi r17, 0x00 ; 0 34fac: 00 e0 ldi r16, 0x00 ; 0 34fae: 21 fd sbrc r18, 1 34fb0: 08 c0 rjmp .+16 ; 0x34fc2 34fb2: 0f ef ldi r16, 0xFF ; 255 34fb4: 1f ef ldi r17, 0xFF ; 255 34fb6: 14 c0 rjmp .+40 ; 0x34fe0 34fb8: 19 95 eicall 34fba: 89 2b or r24, r25 34fbc: 11 f0 breq .+4 ; 0x34fc2 34fbe: 0f ef ldi r16, 0xFF ; 255 34fc0: 1f ef ldi r17, 0xFF ; 255 34fc2: 89 91 ld r24, Y+ 34fc4: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 34fc8: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 34fcc: db 01 movw r26, r22 34fce: 18 96 adiw r26, 0x08 ; 8 34fd0: ed 91 ld r30, X+ 34fd2: fc 91 ld r31, X 34fd4: 81 11 cpse r24, r1 34fd6: f0 cf rjmp .-32 ; 0x34fb8 34fd8: 8a e0 ldi r24, 0x0A ; 10 34fda: 19 95 eicall 34fdc: 89 2b or r24, r25 34fde: 49 f7 brne .-46 ; 0x34fb2 34fe0: c8 01 movw r24, r16 34fe2: df 91 pop r29 34fe4: cf 91 pop r28 34fe6: 1f 91 pop r17 34fe8: 0f 91 pop r16 34fea: 08 95 ret 00034fec <__do_global_dtors>: 34fec: 11 e5 ldi r17, 0x51 ; 81 34fee: c2 e4 ldi r28, 0x42 ; 66 34ff0: d1 e5 ldi r29, 0x51 ; 81 34ff2: 00 e0 ldi r16, 0x00 ; 0 34ff4: 06 c0 rjmp .+12 ; 0x35002 <__do_global_dtors+0x16> 34ff6: 80 2f mov r24, r16 34ff8: fe 01 movw r30, r28 34ffa: 0f 94 4c a2 call 0x34498 ; 0x34498 <__tablejump2__> 34ffe: 21 96 adiw r28, 0x01 ; 1 35000: 01 1d adc r16, r1 35002: c3 34 cpi r28, 0x43 ; 67 35004: d1 07 cpc r29, r17 35006: 80 e0 ldi r24, 0x00 ; 0 35008: 08 07 cpc r16, r24 3500a: a9 f7 brne .-22 ; 0x34ff6 <__do_global_dtors+0xa> 3500c: f8 94 cli 0003500e <__stop_program>: 3500e: ff cf rjmp .-2 ; 0x3500e <__stop_program>