MK25S-RAMBo10a_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 4e 75 jmp 0xea9c ; 0xea9c <__vector_12> 34: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 38: 0d 94 a3 14 jmp 0x22946 ; 0x22946 <__vector_14> 3c: 0d 94 e7 11 jmp 0x223ce ; 0x223ce <__vector_15> 40: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 44: 0d 94 3c 22 jmp 0x24478 ; 0x24478 <__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 ce 6d jmp 0xdb9c ; 0xdb9c <__vector_23> 60: 0c 94 74 51 jmp 0xa2e8 ; 0xa2e8 <__bad_interrupt> 64: 0d 94 e6 99 jmp 0x333cc ; 0x333cc <__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 f5 7d jmp 0xfbea ; 0xfbea <__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 ed 16 jmp 0x22dda ; 0x22dda <__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 a2 99 jmp 0x33344 ; 0x33344 <__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 42 0d jmp 0x21a84 ; 0x21a84 <__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 37 0d jmp 0x21a6e ; 0x21a6e <__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 f7 0c jmp 0x219ee ; 0x219ee <__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: 0c 94 2b fe jmp 0x1fc56 ; 0x1fc56 6dfa: 0c 94 9c f6 jmp 0x1ed38 ; 0x1ed38 6dfe: 0d 94 de 64 jmp 0x2c9bc ; 0x2c9bc 6e02: 0d 94 b1 0e jmp 0x21d62 ; 0x21d62 6e06: 0c 94 ec b0 jmp 0x161d8 ; 0x161d8 6e0a: 0d 94 0f 2f jmp 0x25e1e ; 0x25e1e 6e0e: 0c 94 36 6e jmp 0xdc6c ; 0xdc6c <__vector_23+0xd0> 6e12: 0d 94 3e 07 jmp 0x20e7c ; 0x20e7c 6e16: 0d 94 e0 2e jmp 0x25dc0 ; 0x25dc0 6e1a: 0c 94 7d e9 jmp 0x1d2fa ; 0x1d2fa 6e1e: 0c 94 02 ea jmp 0x1d404 ; 0x1d404 6e22: 0c 94 19 b5 jmp 0x16a32 ; 0x16a32 ()> 6e26: 0c 94 0f b3 jmp 0x1661e ; 0x1661e 6e2a: 0d 94 b6 00 jmp 0x2016c ; 0x2016c 6e2e: 0d 94 ca 30 jmp 0x26194 ; 0x26194 6e32: 0d 94 c1 64 jmp 0x2c982 ; 0x2c982 6e36: 0d 94 f2 2e jmp 0x25de4 ; 0x25de4 6e3a: 0c 94 b4 fe jmp 0x1fd68 ; 0x1fd68 6e3e: 0d 94 66 01 jmp 0x202cc ; 0x202cc 6e42: 0c 94 56 e6 jmp 0x1ccac ; 0x1ccac 6e46: 0c 94 63 bc jmp 0x178c6 ; 0x178c6 6e4a: 0c 94 82 bc jmp 0x17904 ; 0x17904 6e4e: 0d 94 b4 10 jmp 0x22168 ; 0x22168 6e52: 0d 94 fb 03 jmp 0x207f6 ; 0x207f6 6e56: 0c 94 1b b3 jmp 0x16636 ; 0x16636 6e5a: 0c 94 6d ff jmp 0x1feda ; 0x1feda 6e5e: 0c 94 8e bb jmp 0x1771c ; 0x1771c 6e62: 0d 94 a6 01 jmp 0x2034c ; 0x2034c 6e66: 0c 94 05 b5 jmp 0x16a0a ; 0x16a0a ()> 6e6a: 0d 94 6b 2e jmp 0x25cd6 ; 0x25cd6 6e6e: 0c 94 0c c1 jmp 0x18218 ; 0x18218 6e72: 0d 94 cc 39 jmp 0x27398 ; 0x27398 6e76: 0c 94 67 fc jmp 0x1f8ce ; 0x1f8ce 6e7a: 0c 94 95 b1 jmp 0x1632a ; 0x1632a 6e7e: 0d 94 41 31 jmp 0x26282 ; 0x26282 6e82: 0c 94 47 fc jmp 0x1f88e ; 0x1f88e 6e86: 0c 94 e8 b0 jmp 0x161d0 ; 0x161d0 6e8a: 0d 94 04 0c jmp 0x21808 ; 0x21808 6e8e: 0d 94 11 31 jmp 0x26222 ; 0x26222 6e92: 0c 94 ef fb jmp 0x1f7de ; 0x1f7de 6e96: 0d 94 31 31 jmp 0x26262 ; 0x26262 6e9a: 0c 94 e0 70 jmp 0xe1c0 ; 0xe1c0 6e9e: 0c 94 b0 b3 jmp 0x16760 ; 0x16760 6ea2: 0d 94 6f 39 jmp 0x272de ; 0x272de 6ea6: 0c 94 ae e2 jmp 0x1c55c ; 0x1c55c 6eaa: 0d 94 dc 04 jmp 0x209b8 ; 0x209b8 6eae: 0c 94 ac b8 jmp 0x17158 ; 0x17158 6eb2: 0d 94 98 30 jmp 0x26130 ; 0x26130 6eb6: 0d 94 7f 64 jmp 0x2c8fe ; 0x2c8fe 6eba: 0c 94 7b fc jmp 0x1f8f6 ; 0x1f8f6 6ebe: 0c 94 85 fc jmp 0x1f90a ; 0x1f90a 6ec2: 0d 94 39 31 jmp 0x26272 ; 0x26272 6ec6: 0c 94 17 c6 jmp 0x18c2e ; 0x18c2e 6eca: 0c 94 e2 5e jmp 0xbdc4 ; 0xbdc4 <_GLOBAL__sub_D_card> 6ece: 0c 94 d2 ba jmp 0x175a4 ; 0x175a4 6ed2: 0d 94 e8 06 jmp 0x20dd0 ; 0x20dd0 6ed6: 0c 94 77 ea jmp 0x1d4ee ; 0x1d4ee 6eda: 0c 94 5c b4 jmp 0x168b8 ; 0x168b8 6ede: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 6ee2: 0c 94 33 fc jmp 0x1f866 ; 0x1f866 6ee6: 0c 94 fa fd jmp 0x1fbf4 ; 0x1fbf4 6eea: 0d 94 c4 30 jmp 0x26188 ; 0x26188 6eee: 0d 94 52 0f jmp 0x21ea4 ; 0x21ea4 6ef2: 0c 94 97 fd jmp 0x1fb2e ; 0x1fb2e 6ef6: 0d 94 51 31 jmp 0x262a2 ; 0x262a2 6efa: 0d 94 10 11 jmp 0x22220 ; 0x22220 6efe: 0c 94 14 b5 jmp 0x16a28 ; 0x16a28 ()> 6f02: 0c 94 24 ef jmp 0x1de48 ; 0x1de48 6f06: 0d 94 20 01 jmp 0x20240 ; 0x20240 6f0a: 0d 94 c9 2e jmp 0x25d92 ; 0x25d92 6f0e: 0c 94 fd ea jmp 0x1d5fa ; 0x1d5fa 6f12: 0c 94 bb c0 jmp 0x18176 ; 0x18176 6f16: 0d 94 49 31 jmp 0x26292 ; 0x26292 6f1a: 0c 94 0a b5 jmp 0x16a14 ; 0x16a14 ()> 6f1e: 0c 94 fa b0 jmp 0x161f4 ; 0x161f4 6f22: 0c 94 8f b1 jmp 0x1631e ; 0x1631e 6f26: 0c 94 c8 bb jmp 0x17790 ; 0x17790 6f2a: 0c 94 2a b3 jmp 0x16654 ; 0x16654 6f2e: 0c 94 fd c3 jmp 0x187fa ; 0x187fa 6f32: 0c 94 ad fc jmp 0x1f95a ; 0x1f95a 6f36: 0d 94 80 0d jmp 0x21b00 ; 0x21b00 6f3a: 0c 94 9f ea jmp 0x1d53e ; 0x1d53e 6f3e: 0d 94 71 06 jmp 0x20ce2 ; 0x20ce2 6f42: 0c 94 3d fc jmp 0x1f87a ; 0x1f87a 6f46: 0d 94 f5 6a jmp 0x2d5ea ; 0x2d5ea 6f4a: 0c 94 a2 e2 jmp 0x1c544 ; 0x1c544 6f4e: 0c 94 3e c1 jmp 0x1827c ; 0x1827c 6f52: 0c 94 a3 f7 jmp 0x1ef46 ; 0x1ef46 6f56: 0c 94 1e b5 jmp 0x16a3c ; 0x16a3c ()> 6f5a: 0d 94 61 02 jmp 0x204c2 ; 0x204c2 6f5e: 0d 94 21 31 jmp 0x26242 ; 0x26242 6f62: 0d 94 ef 08 jmp 0x211de ; 0x211de 6f66: 0c 94 7f fd jmp 0x1fafe ; 0x1fafe 6f6a: 0c 94 7e fe jmp 0x1fcfc ; 0x1fcfc 6f6e: 0d 94 e3 6a jmp 0x2d5c6 ; 0x2d5c6 6f72: 0c 94 ac c0 jmp 0x18158 ; 0x18158 6f76: 0c 94 23 b5 jmp 0x16a46 ; 0x16a46 ()> 6f7a: 0c 94 b3 f6 jmp 0x1ed66 ; 0x1ed66 6f7e: 0d 94 97 04 jmp 0x2092e ; 0x2092e 6f82: 0d 94 4a 1d jmp 0x23a94 ; 0x23a94 6f86: 0c 94 a2 fd jmp 0x1fb44 ; 0x1fb44 6f8a: 0c 94 5b bc jmp 0x178b6 ; 0x178b6 6f8e: 0c 94 81 ea jmp 0x1d502 ; 0x1d502 6f92: 0c 94 77 bc jmp 0x178ee ; 0x178ee 6f96: 0d 94 3d 0a jmp 0x2147a ; 0x2147a 6f9a: 0d 94 92 04 jmp 0x20924 ; 0x20924 6f9e: 0d 94 c7 30 jmp 0x2618e ; 0x2618e 6fa2: 0d 94 e0 6a jmp 0x2d5c0 ; 0x2d5c0 6fa6: 0c 94 cf c0 jmp 0x1819e ; 0x1819e 6faa: 0c 94 e0 fd jmp 0x1fbc0 ; 0x1fbc0 6fae: 0d 94 c7 10 jmp 0x2218e ; 0x2218e 6fb2: 0c 94 c6 e7 jmp 0x1cf8c ; 0x1cf8c 6fb6: 0d 94 fe 30 jmp 0x261fc ; 0x261fc 6fba: 0c 94 f6 e2 jmp 0x1c5ec ; 0x1c5ec 6fbe: 0d 94 af 2e jmp 0x25d5e ; 0x25d5e 6fc2: 0c 94 e7 e2 jmp 0x1c5ce ; 0x1c5ce 6fc6: 0d 94 5e 2f jmp 0x25ebc ; 0x25ebc 6fca: 0c 94 c3 b0 jmp 0x16186 ; 0x16186 6fce: 0c 94 f9 e2 jmp 0x1c5f2 ; 0x1c5f2 6fd2: 0c 94 d4 bb jmp 0x177a8 ; 0x177a8 6fd6: 0d 94 5b 30 jmp 0x260b6 ; 0x260b6 6fda: 0d 94 19 31 jmp 0x26232 ; 0x26232 6fde: 0c 94 50 b7 jmp 0x16ea0 ; 0x16ea0 6fe2: 0c 94 39 c6 jmp 0x18c72 ; 0x18c72 6fe6: 0c 94 da b0 jmp 0x161b4 ; 0x161b4 6fea: 0c 94 c6 b0 jmp 0x1618c ; 0x1618c 6fee: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 6ff2: 0c 94 c6 e2 jmp 0x1c58c ; 0x1c58c 6ff6: 0c 94 12 6e jmp 0xdc24 ; 0xdc24 <__vector_23+0x88> 6ffa: 0c 94 3f 6e jmp 0xdc7e ; 0xdc7e <__vector_23+0xe2> 6ffe: 0c 94 20 6e jmp 0xdc40 ; 0xdc40 <__vector_23+0xa4> 7002: 0d 94 46 12 jmp 0x2248c ; 0x2248c 7006: 0c 94 fc e2 jmp 0x1c5f8 ; 0x1c5f8 700a: 0c 94 9e f6 jmp 0x1ed3c ; 0x1ed3c 700e: 0c 94 74 6e jmp 0xdce8 ; 0xdce8 <__vector_23+0x14c> 7012: 0c 94 b1 c0 jmp 0x18162 ; 0x18162 7016: 0c 94 08 e3 jmp 0x1c610 ; 0x1c610 701a: 0d 94 66 64 jmp 0x2c8cc ; 0x2c8cc 701e: 0c 94 19 6c jmp 0xd832 ; 0xd832 7022: 0c 94 8b fd jmp 0x1fb16 ; 0x1fb16 7026: 0c 94 24 fe jmp 0x1fc48 ; 0x1fc48 702a: 0c 94 53 bc jmp 0x178a6 ; 0x178a6 702e: 0d 94 6a 1c jmp 0x238d4 ; 0x238d4 7032: 0c 94 93 bc jmp 0x17926 ; 0x17926 7036: 0d 94 4d 96 jmp 0x32c9a ; 0x32c9a 703a: 0c 94 f2 b0 jmp 0x161e4 ; 0x161e4 703e: 0c 94 40 fe jmp 0x1fc80 ; 0x1fc80 7042: 0c 94 f3 c0 jmp 0x181e6 ; 0x181e6 7046: 0d 94 29 31 jmp 0x26252 ; 0x26252 704a: 0c 94 c5 6f jmp 0xdf8a ; 0xdf8a 704e: 0c 94 42 ba jmp 0x17484 ; 0x17484 7052: 0c 94 cc e7 jmp 0x1cf98 ; 0x1cf98 7056: 0c 94 ce bb jmp 0x1779c ; 0x1779c 705a: 0c 94 72 b6 jmp 0x16ce4 ; 0x16ce4 705e: 0d 94 83 06 jmp 0x20d06 ; 0x20d06 7062: 0d 94 b9 02 jmp 0x20572 ; 0x20572 7066: 0d 94 fb 30 jmp 0x261f6 ; 0x261f6 706a: 0c 94 71 fc jmp 0x1f8e2 ; 0x1f8e2 706e: 0c 94 10 ef jmp 0x1de20 ; 0x1de20 7072: 0c 94 12 e9 jmp 0x1d224 ; 0x1d224 7076: 0d 94 f0 6a jmp 0x2d5e0 ; 0x2d5e0 707a: 0c 94 32 fe jmp 0x1fc64 ; 0x1fc64 707e: 0c 94 b7 b0 jmp 0x1616e ; 0x1616e 7082: 0d 94 f8 30 jmp 0x261f0 ; 0x261f0 7086: 0c 94 51 fc jmp 0x1f8a2 ; 0x1f8a2 708a: 0c 94 85 ea jmp 0x1d50a ; 0x1d50a 708e: 0c 94 9c fc jmp 0x1f938 ; 0x1f938 7092: 0c 94 f9 ff jmp 0x1fff2 ; 0x1fff2 7096: 0d 94 59 31 jmp 0x262b2 ; 0x262b2 709a: 0c 94 41 b3 jmp 0x16682 ; 0x16682 709e: 0d 94 c1 0c jmp 0x21982 ; 0x21982 70a2: 0c 94 cb bb jmp 0x17796 ; 0x17796 70a6: 0c 94 67 b5 jmp 0x16ace ; 0x16ace 70aa: 0d 94 1b 30 jmp 0x26036 ; 0x26036 70ae: 0c 94 d1 bb jmp 0x177a2 ; 0x177a2 70b2: 0c 94 07 6e jmp 0xdc0e ; 0xdc0e <__vector_23+0x72> 70b6: 0c 94 ca b5 jmp 0x16b94 ; 0x16b94 70ba: 0c 94 bb b0 jmp 0x16176 ; 0x16176 70be: 0c 94 bb f7 jmp 0x1ef76 ; 0x1ef76 70c2: 0d 94 3f 2e jmp 0x25c7e ; 0x25c7e 70c6: 0c 94 89 ea jmp 0x1d512 ; 0x1d512 70ca: 0c 94 2a c1 jmp 0x18254 ; 0x18254 70ce: 0d 94 43 11 jmp 0x22286 ; 0x22286 70d2: 0d 94 e7 6a jmp 0x2d5ce ; 0x2d5ce 70d6: 0d 94 58 30 jmp 0x260b0 ; 0x260b0 70da: 0d 94 c4 6a jmp 0x2d588 ; 0x2d588 70de: 0c 94 f6 b0 jmp 0x161ec ; 0x161ec 70e2: 0c 94 c5 c0 jmp 0x1818a ; 0x1818a 70e6: 0d 94 5f 2e jmp 0x25cbe ; 0x25cbe 70ea: 0c 94 fd c0 jmp 0x181fa ; 0x181fa 70ee: 0d 94 54 11 jmp 0x222a8 ; 0x222a8 70f2: 0c 94 0f b5 jmp 0x16a1e ; 0x16a1e ()> 70f6: 0d 94 33 30 jmp 0x26066 ; 0x26066 70fa: 0d 94 8a 04 jmp 0x20914 ; 0x20914 70fe: 0d 94 46 94 jmp 0x3288c ; 0x3288c <_menu_edit_P()> 7102: 0c 94 39 fe jmp 0x1fc72 ; 0x1fc72 7106: 0c 94 96 bc jmp 0x1792c ; 0x1792c 710a: 0c 94 d6 b0 jmp 0x161ac ; 0x161ac 710e: 0c 94 c4 fd jmp 0x1fb88 ; 0x1fb88 7112: 0c 94 df c0 jmp 0x181be ; 0x181be 7116: 0c 94 5d b0 jmp 0x160ba ; 0x160ba 711a: 0c 94 dd bb jmp 0x177ba ; 0x177ba 711e: 0c 94 7d ea jmp 0x1d4fa ; 0x1d4fa 7122: 0d 94 fb 2e jmp 0x25df6 ; 0x25df6 7126: 0d 94 01 31 jmp 0x26202 ; 0x26202 712a: 0d 94 62 30 jmp 0x260c4 ; 0x260c4 712e: 0d 94 fa 01 jmp 0x203f4 ; 0x203f4 7132: 0d 94 e4 2e jmp 0x25dc8 ; 0x25dc8 7136: 0d 94 7a 06 jmp 0x20cf4 ; 0x20cf4 713a: 0c 94 6b bc jmp 0x178d6 ; 0x178d6 713e: 0c 94 5b fc jmp 0x1f8b6 ; 0x1f8b6 7142: 0c 94 ad ef jmp 0x1df5a ; 0x1df5a 7146: 0c 94 d0 b0 jmp 0x161a0 ; 0x161a0 714a: 0c 94 91 bc jmp 0x17922 ; 0x17922 714e: 0c 94 36 b3 jmp 0x1666c ; 0x1666c 7152: 0d 94 65 30 jmp 0x260ca ; 0x260ca 7156: 0c 94 c8 ba jmp 0x17590 ; 0x17590 715a: 0c 94 79 e9 jmp 0x1d2f2 ; 0x1d2f2 715e: 0c 94 20 c1 jmp 0x18240 ; 0x18240 7162: 0c 94 c5 bb jmp 0x1778a ; 0x1778a 7166: 0c 94 d7 c0 jmp 0x181ae ; 0x181ae 716a: 0c 94 f3 e2 jmp 0x1c5e6 ; 0x1c5e6 716e: 0c 94 92 b6 jmp 0x16d24 ; 0x16d24 7172: 0d 94 7e 6a jmp 0x2d4fc ; 0x2d4fc 7176: 0c 94 e3 b5 jmp 0x16bc6 ; 0x16bc6 717a: 0c 94 a4 c0 jmp 0x18148 ; 0x18148 717e: 0d 94 e5 64 jmp 0x2c9ca ; 0x2c9ca 7182: 0c 94 51 b5 jmp 0x16aa2 ; 0x16aa2 7186: 0c 94 cc b0 jmp 0x16198 ; 0x16198 718a: 0d 94 75 2e jmp 0x25cea ; 0x25cea 718e: 0d 94 da 2e jmp 0x25db4 ; 0x25db4 7192: 0d 94 e1 64 jmp 0x2c9c2 ; 0x2c9c2 7196: 0d 94 09 31 jmp 0x26212 ; 0x26212 719a: 0c 94 fe eb jmp 0x1d7fc ; 0x1d7fc 719e: 0c 94 de b0 jmp 0x161bc ; 0x161bc 71a2: 0c 94 bf b0 jmp 0x1617e ; 0x1617e 71a6: 0d 94 70 11 jmp 0x222e0 ; 0x222e0 71aa: 0c 94 ed 6d jmp 0xdbda ; 0xdbda <__vector_23+0x3e> 71ae: 0c 94 f1 b0 jmp 0x161e2 ; 0x161e2 71b2: 0c 94 3d f7 jmp 0x1ee7a ; 0x1ee7a 71b6: 0c 94 e7 fd jmp 0x1fbce ; 0x1fbce 71ba: 0c 94 b1 b0 jmp 0x16162 ; 0x16162 71be: 0c 94 e4 b0 jmp 0x161c8 ; 0x161c8 71c2: 0c 94 62 6e jmp 0xdcc4 ; 0xdcc4 <__vector_23+0x128> 71c6: 0c 94 00 b5 jmp 0x16a00 ; 0x16a00 ()> 71ca: 0d 94 3b 07 jmp 0x20e76 ; 0x20e76 71ce: 0d 94 dc 21 jmp 0x243b8 ; 0x243b8 71d2: 0c 94 7a b4 jmp 0x168f4 ; 0x168f4 71d6: 0c 94 34 c1 jmp 0x18268 ; 0x18268 71da: 0c 94 fe b0 jmp 0x161fc ; 0x161fc 71de: 0c 94 e9 c0 jmp 0x181d2 ; 0x181d2 71e2: 0c 94 db fc jmp 0x1f9b6 ; 0x1f9b6 71e6: 0d 94 b5 3f jmp 0x27f6a ; 0x27f6a 71ea: 0c 94 fd ba jmp 0x175fa ; 0x175fa 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 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 Bo10a-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 30 61 00 RAMBo10a. 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: f3 38 cpi r31, 0x83 ; 131 0000a284 <__ctors_end>: a284: e2 5e subi r30, 0xE2 ; 226 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: e2 e9 ldi r30, 0x92 ; 146 a29e: fe e4 ldi r31, 0x4E ; 78 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 8d a1 call 0x3431a ; 0x3431a <__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 99 d8 call 0x1b132 ; 0x1b132
a2e4: 0d 94 37 a7 jmp 0x34e6e ; 0x34e6e <__do_global_dtors> 0000a2e8 <__bad_interrupt>: a2e8: 0c 94 46 75 jmp 0xea8c ; 0xea8c <__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 36 9d call 0x33a6c ; 0x33a6c <__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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 79 9e call 0x33cf2 ; 0x33cf2 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 9e 9e call 0x33d3c ; 0x33d3c 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 0c a0 call 0x34018 ; 0x34018 <__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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 0c a0 call 0x34018 ; 0x34018 <__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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 e5 9e call 0x33dca ; 0x33dca 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 9a a2 call 0x34534 ; 0x34534 <__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 3f 9f call 0x33e7e ; 0x33e7e 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 7d a0 call 0x340fa ; 0x340fa 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 d4 a6 call 0x34da8 ; 0x34da8 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 08 9c call 0x33810 ; 0x33810 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 08 9c call 0x33810 ; 0x33810 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 3f 9f call 0x33e7e ; 0x33e7e 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 7d a0 jmp 0x340fa ; 0x340fa 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 08 9c jmp 0x33810 ; 0x33810 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 a1 a0 call 0x34142 ; 0x34142 ac5c: 60 e0 ldi r22, 0x00 ; 0 ac5e: 88 e6 ldi r24, 0x68 ; 104 ac60: 9f e0 ldi r25, 0x0F ; 15 ac62: 0f 94 a1 a0 call 0x34142 ; 0x34142 ac66: 60 e0 ldi r22, 0x00 ; 0 ac68: 85 e6 ldi r24, 0x65 ; 101 ac6a: 9f e0 ldi r25, 0x0F ; 15 ac6c: 0f 94 a1 a0 call 0x34142 ; 0x34142 ac70: 60 e0 ldi r22, 0x00 ; 0 ac72: 84 e6 ldi r24, 0x64 ; 100 ac74: 9f e0 ldi r25, 0x0F ; 15 ac76: 0f 94 a1 a0 call 0x34142 ; 0x34142 ac7a: 60 e0 ldi r22, 0x00 ; 0 ac7c: 82 ed ldi r24, 0xD2 ; 210 ac7e: 9e e0 ldi r25, 0x0E ; 14 ac80: 0f 94 a1 a0 call 0x34142 ; 0x34142 ac84: 60 e0 ldi r22, 0x00 ; 0 ac86: 8f ec ldi r24, 0xCF ; 207 ac88: 9e e0 ldi r25, 0x0E ; 14 ac8a: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 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 af a6 call 0x34d5e ; 0x34d5e // 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 0b 9b call 0x33616 ; 0x33616 <__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 0b 9b call 0x33616 ; 0x33616 <__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 2e a4 call 0x3485c ; 0x3485c <__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 a4 a1 call 0x34348 ; 0x34348 <__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 a4 a1 call 0x34348 ; 0x34348 <__subsf3> aecc: a5 01 movw r20, r10 aece: 94 01 movw r18, r8 aed0: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 a4 a1 call 0x34348 ; 0x34348 <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 a4 a1 call 0x34348 ; 0x34348 <__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 a4 a2 call 0x34548 ; 0x34548 <__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 9a a2 call 0x34534 ; 0x34534 <__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 2e a4 call 0x3485c ; 0x3485c <__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 9a a2 call 0x34534 ; 0x34534 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 15 a5 call 0x34a2a ; 0x34a2a 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 a4 a1 call 0x34348 ; 0x34348 <__subsf3> b2bc: a3 01 movw r20, r6 b2be: 92 01 movw r18, r4 b2c0: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 a4 a2 call 0x34548 ; 0x34548 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a4 a2 call 0x34548 ; 0x34548 <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 a5 a1 call 0x3434a ; 0x3434a <__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 a5 a1 call 0x3434a ; 0x3434a <__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 8b a0 call 0x34116 ; 0x34116 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 4c 6b jmp 0x2d698 ; 0x2d698 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 8f 6b jmp 0x2d71e ; 0x2d71e 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 7d a0 call 0x340fa ; 0x340fa 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 55 54 call 0x2a8aa ; 0x2a8aa 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 0c 6c jmp 0x2d818 ; 0x2d818 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 0e 9e call 0x33c1c ; 0x33c1c 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 44 9e call 0x33c88 ; 0x33c88 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 44 9e call 0x33c88 ; 0x33c88 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 12 a1 call 0x34224 ; 0x34224 <__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 09 9b call 0x33612 ; 0x33612 <__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 9a a2 call 0x34534 ; 0x34534 <__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 4a 9b call 0x33694 ; 0x33694 <__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 9a a2 call 0x34534 ; 0x34534 <__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 9a a2 call 0x34534 ; 0x34534 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a5 a1 call 0x3434a ; 0x3434a <__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 9a a2 call 0x34534 ; 0x34534 <__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 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> b90e: 8d 2d mov r24, r13 b910: 0f 94 61 21 call 0x242c2 ; 0x242c2 //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 2e a4 call 0x3485c ; 0x3485c <__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 2e a4 call 0x3485c ; 0x3485c <__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 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> b9c6: 8d 2d mov r24, r13 b9c8: 0f 94 61 21 call 0x242c2 ; 0x242c2 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 a4 a1 call 0x34348 ; 0x34348 <__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 a4 a2 call 0x34548 ; 0x34548 <__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 4a 9b call 0x33694 ; 0x33694 <__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 4a 9b call 0x33694 ; 0x33694 <__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 a4 a1 call 0x34348 ; 0x34348 <__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 a5 a1 call 0x3434a ; 0x3434a <__addsf3> st_current_set(i, tmp_motor[i]); ba5e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> ba62: 8b 8d ldd r24, Y+27 ; 0x1b ba64: 0f 94 61 21 call 0x242c2 ; 0x242c2 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 e5 9e jmp 0x33dca ; 0x33dca 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: 2f b7 in r18, 0x3f ; 63 babe: 84 ff sbrs r24, 4 bac0: 1e c0 rjmp .+60 ; 0xbafe bac2: f8 94 cli bac4: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bac8: 92 60 ori r25, 0x02 ; 2 baca: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bace: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D5, value & 0x20); bad0: 2f b7 in r18, 0x3f ; 63 bad2: 85 ff sbrs r24, 5 bad4: 19 c0 rjmp .+50 ; 0xbb08 bad6: f8 94 cli bad8: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> badc: 91 60 ori r25, 0x01 ; 1 bade: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bae2: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D6, value & 0x40); bae4: 86 ff sbrs r24, 6 bae6: 15 c0 rjmp .+42 ; 0xbb12 bae8: 45 9a sbi 0x08, 5 ; 8 WRITE(LCD_PINS_D7, value & 0x80); baea: 87 ff sbrs r24, 7 baec: 14 c0 rjmp .+40 ; 0xbb16 baee: 46 9a sbi 0x08, 6 ; 8 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); baf0: 73 9a sbi 0x0e, 3 ; 14 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); baf2: 85 e0 ldi r24, 0x05 ; 5 baf4: 8a 95 dec r24 baf6: f1 f7 brne .-4 ; 0xbaf4 baf8: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); bafa: 73 98 cbi 0x0e, 3 ; 14 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } bafc: 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); bafe: f8 94 cli bb00: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bb04: 9d 7f andi r25, 0xFD ; 253 bb06: e1 cf rjmp .-62 ; 0xbaca WRITE(LCD_PINS_D5, value & 0x20); bb08: f8 94 cli bb0a: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bb0e: 9e 7f andi r25, 0xFE ; 254 bb10: e6 cf rjmp .-52 ; 0xbade WRITE(LCD_PINS_D6, value & 0x40); bb12: 45 98 cbi 0x08, 5 ; 8 bb14: ea cf rjmp .-44 ; 0xbaea WRITE(LCD_PINS_D7, value & 0x80); bb16: 46 98 cbi 0x08, 6 ; 8 bb18: eb cf rjmp .-42 ; 0xbaf0 0000bb1a : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { bb1a: 0f 93 push r16 bb1c: 1f 93 push r17 bb1e: cf 93 push r28 bb20: df 93 push r29 bb22: c8 2f mov r28, r24 bb24: d6 2f mov r29, r22 bb26: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); bb28: 60 ff sbrs r22, 0 bb2a: 15 c0 rjmp .+42 ; 0xbb56 bb2c: 5f 9a sbi 0x0b, 7 ; 11 bb2e: 8a e1 ldi r24, 0x1A ; 26 bb30: 8a 95 dec r24 bb32: f1 f7 brne .-4 ; 0xbb30 bb34: 00 c0 rjmp .+0 ; 0xbb36 _delay_us(5); lcd_writebits(data); bb36: 8c 2f mov r24, r28 bb38: 0e 94 5e 5d call 0xbabc ; 0xbabc #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { bb3c: d1 fd sbrc r29, 1 bb3e: 04 c0 rjmp .+8 ; 0xbb48 // _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 bb40: 8c 2f mov r24, r28 bb42: 82 95 swap r24 bb44: 0e 94 5e 5d call 0xbabc ; 0xbabc } #endif delayMicroseconds(duration); bb48: c8 01 movw r24, r16 } bb4a: df 91 pop r29 bb4c: cf 91 pop r28 bb4e: 1f 91 pop r17 bb50: 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); bb52: 0c 94 d9 bf jmp 0x17fb2 ; 0x17fb2 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); bb56: 5f 98 cbi 0x0b, 7 ; 11 bb58: ea cf rjmp .-44 ; 0xbb2e 0000bb5a : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { bb5a: cf 92 push r12 bb5c: df 92 push r13 bb5e: ef 92 push r14 bb60: ff 92 push r15 bb62: cf 93 push r28 bb64: df 93 push r29 bb66: ec 01 movw r28, r24 bb68: 6a 01 movw r12, r20 bb6a: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) bb6c: 0f 94 85 a0 call 0x3410a ; 0x3410a bb70: 6f 3f cpi r22, 0xFF ; 255 bb72: 7f 4f sbci r23, 0xFF ; 255 bb74: 8f 4f sbci r24, 0xFF ; 255 bb76: 9f 4f sbci r25, 0xFF ; 255 bb78: 59 f4 brne .+22 ; 0xbb90 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); bb7a: b7 01 movw r22, r14 bb7c: a6 01 movw r20, r12 bb7e: 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); } bb80: df 91 pop r29 bb82: cf 91 pop r28 bb84: ff 90 pop r15 bb86: ef 90 pop r14 bb88: df 90 pop r13 bb8a: 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); bb8c: 0d 94 d3 a0 jmp 0x341a6 ; 0x341a6 } 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); } bb90: df 91 pop r29 bb92: cf 91 pop r28 bb94: ff 90 pop r15 bb96: ef 90 pop r14 bb98: df 90 pop r13 bb9a: cf 90 pop r12 bb9c: 08 95 ret 0000bb9e : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { bb9e: 7f 92 push r7 bba0: 8f 92 push r8 bba2: 9f 92 push r9 bba4: af 92 push r10 bba6: bf 92 push r11 bba8: cf 92 push r12 bbaa: df 92 push r13 bbac: ef 92 push r14 bbae: ff 92 push r15 bbb0: 0f 93 push r16 bbb2: 1f 93 push r17 bbb4: cf 93 push r28 bbb6: df 93 push r29 bbb8: cd b7 in r28, 0x3d ; 61 bbba: de b7 in r29, 0x3e ; 62 bbbc: 60 97 sbiw r28, 0x10 ; 16 bbbe: 0f b6 in r0, 0x3f ; 63 bbc0: f8 94 cli bbc2: de bf out 0x3e, r29 ; 62 bbc4: 0f be out 0x3f, r0 ; 63 bbc6: cd bf out 0x3d, r28 ; 61 bbc8: 5c 01 movw r10, r24 bbca: 6b 01 movw r12, r22 bbcc: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bbce: 81 e0 ldi r24, 0x01 ; 1 bbd0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); bbd4: 1f 93 push r17 bbd6: 0f 93 push r16 bbd8: 1f 92 push r1 bbda: 2f 93 push r18 bbdc: 8f e3 ldi r24, 0x3F ; 63 bbde: 94 e6 ldi r25, 0x64 ; 100 bbe0: 9f 93 push r25 bbe2: 8f 93 push r24 bbe4: 0f 94 3f 9f call 0x33e7e ; 0x33e7e daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bbe8: 81 e4 ldi r24, 0x41 ; 65 bbea: 0e 94 b6 55 call 0xab6c ; 0xab6c bbee: 0f 90 pop r0 bbf0: 0f 90 pop r0 bbf2: 0f 90 pop r0 bbf4: 0f 90 pop r0 bbf6: 0f 90 pop r0 bbf8: 0f 90 pop r0 bbfa: 88 23 and r24, r24 bbfc: 89 f0 breq .+34 ; 0xbc20 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bbfe: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 bc02: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 bc06: fc 01 movw r30, r24 bc08: 21 81 ldd r18, Z+1 ; 0x01 bc0a: 28 37 cpi r18, 0x78 ; 120 bc0c: 09 f0 breq .+2 ; 0xbc10 bc0e: 56 c0 rjmp .+172 ; 0xbcbc bc10: 40 e1 ldi r20, 0x10 ; 16 bc12: 50 e0 ldi r21, 0x00 ; 0 bc14: 70 e0 ldi r23, 0x00 ; 0 bc16: 60 e0 ldi r22, 0x00 ; 0 bc18: 02 96 adiw r24, 0x02 ; 2 bc1a: 0f 94 08 9c call 0x33810 ; 0x33810 bc1e: 5b 01 movw r10, r22 if (code_seen('C')) bc20: 83 e4 ldi r24, 0x43 ; 67 bc22: 0e 94 b6 55 call 0xab6c ; 0xab6c bc26: 88 23 and r24, r24 bc28: 09 f4 brne .+2 ; 0xbc2c bc2a: 4d c0 rjmp .+154 ; 0xbcc6 count = code_value_long(); bc2c: 0e 94 1e 56 call 0xac3c ; 0xac3c bc30: 4b 01 movw r8, r22 bc32: 75 01 movw r14, r10 bc34: ca 14 cp r12, r10 bc36: db 04 cpc r13, r11 bc38: 08 f4 brcc .+2 ; 0xbc3c bc3a: 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) bc3c: c4 01 movw r24, r8 bc3e: 8e 0d add r24, r14 bc40: 9f 1d adc r25, r15 bc42: c8 16 cp r12, r24 bc44: d9 06 cpc r13, r25 bc46: 18 f0 brcs .+6 ; 0xbc4e bc48: 8e 15 cp r24, r14 bc4a: 9f 05 cpc r25, r15 bc4c: 18 f4 brcc .+6 ; 0xbc54 count = addr_end - addr_start; bc4e: 46 01 movw r8, r12 bc50: 8e 18 sub r8, r14 bc52: 9f 08 sbc r9, r15 if (code_seen('X')) bc54: 88 e5 ldi r24, 0x58 ; 88 bc56: 0e 94 b6 55 call 0xab6c ; 0xab6c bc5a: 88 23 and r24, r24 bc5c: 09 f4 brne .+2 ; 0xbc60 bc5e: 71 c0 rjmp .+226 ; 0xbd42 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bc60: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 bc64: 30 91 f6 16 lds r19, 0x16F6 ; 0x8016f6 bc68: 2f 5f subi r18, 0xFF ; 255 bc6a: 3f 4f sbci r19, 0xFF ; 255 bc6c: ce 01 movw r24, r28 bc6e: 01 96 adiw r24, 0x01 ; 1 bc70: 5c 01 movw r10, r24 bc72: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bc74: d1 2c mov r13, r1 bc76: c1 2c mov r12, r1 bc78: f9 01 movw r30, r18 while (*hex) bc7a: 80 81 ld r24, Z bc7c: 2f 5f subi r18, 0xFF ; 255 bc7e: 3f 4f sbci r19, 0xFF ; 255 bc80: 88 23 and r24, r24 bc82: b9 f1 breq .+110 ; 0xbcf2 { if (count && (parsed >= count)) break; bc84: 90 e1 ldi r25, 0x10 ; 16 bc86: c9 16 cp r12, r25 bc88: d1 04 cpc r13, r1 bc8a: 99 f1 breq .+102 ; 0xbcf2 char c = *(hex++); if (c == ' ') continue; bc8c: 80 32 cpi r24, 0x20 ; 32 bc8e: a1 f3 breq .-24 ; 0xbc78 if (c == '\n') break; bc90: 8a 30 cpi r24, 0x0A ; 10 bc92: 79 f1 breq .+94 ; 0xbcf2 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bc94: 90 ed ldi r25, 0xD0 ; 208 bc96: 98 0f add r25, r24 bc98: 9a 30 cpi r25, 0x0A ; 10 bc9a: c8 f4 brcc .+50 ; 0xbcce bc9c: 82 95 swap r24 bc9e: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bca0: 9f 01 movw r18, r30 bca2: 2e 5f subi r18, 0xFE ; 254 bca4: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bca6: 91 81 ldd r25, Z+1 ; 0x01 bca8: 40 ed ldi r20, 0xD0 ; 208 bcaa: 49 0f add r20, r25 bcac: 4a 30 cpi r20, 0x0A ; 10 bcae: b8 f4 brcc .+46 ; 0xbcde bcb0: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bcb2: 8d 93 st X+, r24 parsed++; bcb4: ef ef ldi r30, 0xFF ; 255 bcb6: ce 1a sub r12, r30 bcb8: de 0a sbc r13, r30 bcba: de cf rjmp .-68 ; 0xbc78 { 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(); bcbc: 0e 94 8e 5a call 0xb51c ; 0xb51c bcc0: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> bcc4: ac cf rjmp .-168 ; 0xbc1e 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 bcc6: 88 24 eor r8, r8 bcc8: 8a 94 dec r8 bcca: 98 2c mov r9, r8 bccc: b2 cf rjmp .-156 ; 0xbc32 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); bcce: 9f e9 ldi r25, 0x9F ; 159 bcd0: 98 0f add r25, r24 bcd2: 96 30 cpi r25, 0x06 ; 6 bcd4: 58 f4 brcc .+22 ; 0xbcec bcd6: 82 95 swap r24 bcd8: 80 7f andi r24, 0xF0 ; 240 bcda: 80 57 subi r24, 0x70 ; 112 bcdc: e1 cf rjmp .-62 ; 0xbca0 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bcde: 4f e9 ldi r20, 0x9F ; 159 bce0: 49 0f add r20, r25 bce2: 46 30 cpi r20, 0x06 ; 6 bce4: 18 f4 brcc .+6 ; 0xbcec bce6: 97 55 subi r25, 0x57 ; 87 bce8: 89 2b or r24, r25 bcea: e3 cf rjmp .-58 ; 0xbcb2 else return -parsed; bcec: d1 94 neg r13 bcee: c1 94 neg r12 bcf0: 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++) bcf2: 91 2c mov r9, r1 bcf4: 81 2c mov r8, r1 bcf6: c8 14 cp r12, r8 bcf8: d9 04 cpc r13, r9 bcfa: 91 f0 breq .+36 ; 0xbd20 bcfc: f5 01 movw r30, r10 bcfe: 61 91 ld r22, Z+ bd00: 5f 01 movw r10, r30 bd02: c4 01 movw r24, r8 bd04: 8e 0d add r24, r14 bd06: 9f 1d adc r25, r15 { switch (type) bd08: f1 e0 ldi r31, 0x01 ; 1 bd0a: 7f 16 cp r7, r31 bd0c: 31 f0 breq .+12 ; 0xbd1a { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bd0e: fc 01 movw r30, r24 bd10: 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++) bd12: ff ef ldi r31, 0xFF ; 255 bd14: 8f 1a sub r8, r31 bd16: 9f 0a sbc r9, r31 bd18: ee cf rjmp .-36 ; 0xbcf6 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); bd1a: 0f 94 c5 a0 call 0x3418a ; 0x3418a bd1e: f9 cf rjmp .-14 ; 0xbd12 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); bd20: ff 92 push r15 bd22: ef 92 push r14 bd24: 1f 93 push r17 bd26: 0f 93 push r16 bd28: 9f 92 push r9 bd2a: 8f 92 push r8 bd2c: 85 e1 ldi r24, 0x15 ; 21 bd2e: 94 e6 ldi r25, 0x64 ; 100 bd30: 9f 93 push r25 bd32: 8f 93 push r24 bd34: 0f 94 3f 9f call 0x33e7e ; 0x33e7e bd38: 0f b6 in r0, 0x3f ; 63 bd3a: f8 94 cli bd3c: de bf out 0x3e, r29 ; 62 bd3e: 0f be out 0x3f, r0 ; 63 bd40: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); bd42: 47 2d mov r20, r7 bd44: b4 01 movw r22, r8 bd46: c7 01 movw r24, r14 } bd48: 60 96 adiw r28, 0x10 ; 16 bd4a: 0f b6 in r0, 0x3f ; 63 bd4c: f8 94 cli bd4e: de bf out 0x3e, r29 ; 62 bd50: 0f be out 0x3f, r0 ; 63 bd52: cd bf out 0x3d, r28 ; 61 bd54: df 91 pop r29 bd56: cf 91 pop r28 bd58: 1f 91 pop r17 bd5a: 0f 91 pop r16 bd5c: ff 90 pop r15 bd5e: ef 90 pop r14 bd60: df 90 pop r13 bd62: cf 90 pop r12 bd64: bf 90 pop r11 bd66: af 90 pop r10 bd68: 9f 90 pop r9 bd6a: 8f 90 pop r8 bd6c: 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); bd6e: 0d 94 83 52 jmp 0x2a506 ; 0x2a506 0000bd72 : /// 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)); bd72: 80 e1 ldi r24, 0x10 ; 16 bd74: e5 ef ldi r30, 0xF5 ; 245 bd76: f1 e1 ldi r31, 0x11 ; 17 bd78: a0 e9 ldi r26, 0x90 ; 144 bd7a: b2 e0 ldi r27, 0x02 ; 2 bd7c: 01 90 ld r0, Z+ bd7e: 0d 92 st X+, r0 bd80: 8a 95 dec r24 bd82: e1 f7 brne .-8 ; 0xbd7c saved_feedmultiply2 = feedmultiply; //save feedmultiply bd84: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bd88: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bd8c: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> bd90: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); bd94: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 bd98: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 bd9c: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 bda0: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); bda4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed bda8: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; bdac: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb bdb0: 83 fb bst r24, 3 bdb2: 88 27 eor r24, r24 bdb4: 80 f9 bld r24, 0 bdb6: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; bdba: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bdbe: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 isPartialBackupAvailable = true; } bdc2: 08 95 ret 0000bdc4 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } bdc4: cf 93 push r28 bdc6: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { bdc8: 8a ef ldi r24, 0xFA ; 250 bdca: 95 e1 ldi r25, 0x15 ; 21 bdcc: 0e 94 c6 70 call 0xe18c ; 0xe18c #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader bdd0: 88 e3 ldi r24, 0x38 ; 56 bdd2: 94 e1 ldi r25, 0x14 ; 20 bdd4: 89 2b or r24, r25 bdd6: 51 f0 breq .+20 ; 0xbdec <_GLOBAL__sub_D_card+0x28> bdd8: ca e0 ldi r28, 0x0A ; 10 bdda: d5 e1 ldi r29, 0x15 ; 21 bddc: a3 97 sbiw r28, 0x23 ; 35 bdde: ce 01 movw r24, r28 bde0: 0e 94 c6 70 call 0xe18c ; 0xe18c bde4: 84 e1 ldi r24, 0x14 ; 20 bde6: c8 33 cpi r28, 0x38 ; 56 bde8: d8 07 cpc r29, r24 bdea: c1 f7 brne .-16 ; 0xbddc <_GLOBAL__sub_D_card+0x18> bdec: 85 e1 ldi r24, 0x15 ; 21 bdee: 94 e1 ldi r25, 0x14 ; 20 bdf0: 0e 94 c6 70 call 0xe18c ; 0xe18c bdf4: 80 ef ldi r24, 0xF0 ; 240 bdf6: 93 e1 ldi r25, 0x13 ; 19 bdf8: df 91 pop r29 bdfa: cf 91 pop r28 bdfc: 0c 94 c6 70 jmp 0xe18c ; 0xe18c 0000be00 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { be00: cf 93 push r28 be02: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; be04: c5 ef ldi r28, 0xF5 ; 245 be06: d1 e1 ldi r29, 0x11 ; 17 be08: 20 e0 ldi r18, 0x00 ; 0 be0a: 30 e0 ldi r19, 0x00 ; 0 be0c: 48 ec ldi r20, 0xC8 ; 200 be0e: 51 e4 ldi r21, 0x41 ; 65 be10: 6c 85 ldd r22, Y+12 ; 0x0c be12: 7d 85 ldd r23, Y+13 ; 0x0d be14: 8e 85 ldd r24, Y+14 ; 0x0e be16: 9f 85 ldd r25, Y+15 ; 0x0f be18: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> be1c: 6c 87 std Y+12, r22 ; 0x0c be1e: 7d 87 std Y+13, r23 ; 0x0d be20: 8e 87 std Y+14, r24 ; 0x0e be22: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); be24: 63 e3 ldi r22, 0x33 ; 51 be26: 73 e3 ldi r23, 0x33 ; 51 be28: 83 e5 ldi r24, 0x53 ; 83 be2a: 90 e4 ldi r25, 0x40 ; 64 } be2c: df 91 pop r29 be2e: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); be30: 0d 94 11 85 jmp 0x30a22 ; 0x30a22 0000be34 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); be34: 60 e0 ldi r22, 0x00 ; 0 be36: 85 ea ldi r24, 0xA5 ; 165 be38: 9f e0 ldi r25, 0x0F ; 15 be3a: 0f 94 a1 a0 call 0x34142 ; 0x34142 be3e: 60 e0 ldi r22, 0x00 ; 0 be40: 8f e7 ldi r24, 0x7F ; 127 be42: 9c e0 ldi r25, 0x0C ; 12 be44: 0f 94 a1 a0 call 0x34142 ; 0x34142 // 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; be48: 80 e0 ldi r24, 0x00 ; 0 be4a: 90 e0 ldi r25, 0x00 ; 0 be4c: a0 e8 ldi r26, 0x80 ; 128 be4e: bf eb ldi r27, 0xBF ; 191 be50: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e be54: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f be58: a0 93 80 02 sts 0x0280, r26 ; 0x800280 be5c: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; be60: 82 e0 ldi r24, 0x02 ; 2 be62: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; be66: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 } be6a: 08 95 ret 0000be6c : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) be6c: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef be70: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 be74: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 be78: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 be7c: 28 17 cp r18, r24 be7e: 39 07 cpc r19, r25 be80: 71 f0 breq .+28 ; 0xbe9e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; be82: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 be86: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; be8a: 81 e0 ldi r24, 0x01 ; 1 be8c: 80 93 99 03 sts 0x0399, r24 ; 0x800399 wait_for_heater(_millis(), active_extruder); be90: 0f 94 46 0f call 0x21e8c ; 0x21e8c be94: 0f 94 36 4e call 0x29c6c ; 0x29c6c heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; be98: 82 e0 ldi r24, 0x02 ; 2 be9a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } } be9e: 08 95 ret 0000bea0 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { bea0: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 bea4: 88 23 and r24, r24 bea6: 41 f0 breq .+16 ; 0xbeb8 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; bea8: 80 91 8e 02 lds r24, 0x028E ; 0x80028e beac: 90 91 8f 02 lds r25, 0x028F ; 0x80028f beb0: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> beb4: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> } beb8: 08 95 ret 0000beba : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { beba: cf 92 push r12 bebc: df 92 push r13 bebe: ef 92 push r14 bec0: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); bec2: c0 90 ca 04 lds r12, 0x04CA ; 0x8004ca bec6: d0 90 cb 04 lds r13, 0x04CB ; 0x8004cb beca: e0 90 cc 04 lds r14, 0x04CC ; 0x8004cc bece: 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) { bed2: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 bed6: 88 23 and r24, r24 bed8: 09 f4 brne .+2 ; 0xbedc beda: 4e c0 rjmp .+156 ; 0xbf78 bedc: 20 e0 ldi r18, 0x00 ; 0 bede: 30 e0 ldi r19, 0x00 ; 0 bee0: a9 01 movw r20, r18 bee2: c7 01 movw r24, r14 bee4: b6 01 movw r22, r12 bee6: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> beea: 18 16 cp r1, r24 beec: 0c f0 brlt .+2 ; 0xbef0 beee: 44 c0 rjmp .+136 ; 0xbf78 float area = M_PI * diameter * diameter * 0.25; bef0: 2b ed ldi r18, 0xDB ; 219 bef2: 3f e0 ldi r19, 0x0F ; 15 bef4: 49 e4 ldi r20, 0x49 ; 73 bef6: 50 e4 ldi r21, 0x40 ; 64 bef8: c7 01 movw r24, r14 befa: b6 01 movw r22, r12 befc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> bf00: a7 01 movw r20, r14 bf02: 96 01 movw r18, r12 bf04: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> bf08: 20 e0 ldi r18, 0x00 ; 0 bf0a: 30 e0 ldi r19, 0x00 ; 0 bf0c: 40 e8 ldi r20, 0x80 ; 128 bf0e: 5e e3 ldi r21, 0x3E ; 62 bf10: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> bf14: 9b 01 movw r18, r22 bf16: ac 01 movw r20, r24 out = 1.f / area; bf18: 60 e0 ldi r22, 0x00 ; 0 bf1a: 70 e0 ldi r23, 0x00 ; 0 bf1c: 80 e8 ldi r24, 0x80 ; 128 bf1e: 9f e3 ldi r25, 0x3F ; 63 bf20: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> bf24: 6b 01 movw r12, r22 bf26: 7c 01 movw r14, r24 } if (extrudemultiply != 100) bf28: 60 91 59 02 lds r22, 0x0259 ; 0x800259 bf2c: 70 91 5a 02 lds r23, 0x025A ; 0x80025a bf30: 64 36 cpi r22, 0x64 ; 100 bf32: 71 05 cpc r23, r1 bf34: a1 f0 breq .+40 ; 0xbf5e out *= float(extrudemultiply) * 0.01f; bf36: 07 2e mov r0, r23 bf38: 00 0c add r0, r0 bf3a: 88 0b sbc r24, r24 bf3c: 99 0b sbc r25, r25 bf3e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> bf42: 2a e0 ldi r18, 0x0A ; 10 bf44: 37 ed ldi r19, 0xD7 ; 215 bf46: 43 e2 ldi r20, 0x23 ; 35 bf48: 5c e3 ldi r21, 0x3C ; 60 bf4a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> bf4e: 9b 01 movw r18, r22 bf50: ac 01 movw r20, r24 bf52: c7 01 movw r24, r14 bf54: b6 01 movw r22, r12 bf56: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> bf5a: 6b 01 movw r12, r22 bf5c: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); bf5e: c0 92 10 02 sts 0x0210, r12 ; 0x800210 bf62: d0 92 11 02 sts 0x0211, r13 ; 0x800211 bf66: e0 92 12 02 sts 0x0212, r14 ; 0x800212 bf6a: 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 } bf6e: ff 90 pop r15 bf70: ef 90 pop r14 bf72: df 90 pop r13 bf74: cf 90 pop r12 bf76: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; bf78: c1 2c mov r12, r1 bf7a: d1 2c mov r13, r1 bf7c: 80 e8 ldi r24, 0x80 ; 128 bf7e: e8 2e mov r14, r24 bf80: 8f e3 ldi r24, 0x3F ; 63 bf82: f8 2e mov r15, r24 bf84: d1 cf rjmp .-94 ; 0xbf28 0000bf86 : } } #endif //FAST_PWM_FAN void save_statistics() { bf86: 8f 92 push r8 bf88: 9f 92 push r9 bf8a: af 92 push r10 bf8c: bf 92 push r11 bf8e: cf 92 push r12 bf90: df 92 push r13 bf92: ef 92 push r14 bf94: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter bf96: 81 ef ldi r24, 0xF1 ; 241 bf98: 9f e0 ldi r25, 0x0F ; 15 bf9a: 0f 94 55 48 call 0x290aa ; 0x290aa bf9e: 6b 01 movw r12, r22 bfa0: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min bfa2: 8d ee ldi r24, 0xED ; 237 bfa4: 9f e0 ldi r25, 0x0F ; 15 bfa6: 0f 94 55 48 call 0x290aa ; 0x290aa bfaa: 4b 01 movw r8, r22 bfac: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; bfae: 0f 94 38 1c call 0x23870 ; 0x23870 bfb2: 2c e3 ldi r18, 0x3C ; 60 bfb4: 30 e0 ldi r19, 0x00 ; 0 bfb6: 40 e0 ldi r20, 0x00 ; 0 bfb8: 50 e0 ldi r21, 0x00 ; 0 bfba: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min bfbe: ba 01 movw r22, r20 bfc0: a9 01 movw r20, r18 bfc2: 48 0d add r20, r8 bfc4: 59 1d adc r21, r9 bfc6: 6a 1d adc r22, r10 bfc8: 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); bfca: 8d ee ldi r24, 0xED ; 237 bfcc: 9f e0 ldi r25, 0x0F ; 15 bfce: 0f 94 b3 a0 call 0x34166 ; 0x34166 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); bfd2: 60 91 84 06 lds r22, 0x0684 ; 0x800684 bfd6: 70 91 85 06 lds r23, 0x0685 ; 0x800685 bfda: 80 91 86 06 lds r24, 0x0686 ; 0x800686 bfde: 90 91 87 06 lds r25, 0x0687 ; 0x800687 bfe2: 28 ee ldi r18, 0xE8 ; 232 bfe4: 33 e0 ldi r19, 0x03 ; 3 bfe6: 40 e0 ldi r20, 0x00 ; 0 bfe8: 50 e0 ldi r21, 0x00 ; 0 bfea: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> bfee: ba 01 movw r22, r20 bff0: a9 01 movw r20, r18 bff2: 4c 0d add r20, r12 bff4: 5d 1d adc r21, r13 bff6: 6e 1d adc r22, r14 bff8: 7f 1d adc r23, r15 bffa: 81 ef ldi r24, 0xF1 ; 241 bffc: 9f e0 ldi r25, 0x0F ; 15 bffe: 0f 94 b3 a0 call 0x34166 ; 0x34166 print_job_timer.reset(); c002: 0f 94 0d 20 call 0x2401a ; 0x2401a total_filament_used = 0; c006: 10 92 84 06 sts 0x0684, r1 ; 0x800684 c00a: 10 92 85 06 sts 0x0685, r1 ; 0x800685 c00e: 10 92 86 06 sts 0x0686, r1 ; 0x800686 c012: 10 92 87 06 sts 0x0687, r1 ; 0x800687 if (MMU2::mmu2.Enabled()) { c016: 80 91 94 12 lds r24, 0x1294 ; 0x801294 c01a: 81 30 cpi r24, 0x01 ; 1 c01c: 81 f4 brne .+32 ; 0xc03e eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); c01e: 60 91 98 12 lds r22, 0x1298 ; 0x801298 c022: 70 91 99 12 lds r23, 0x1299 ; 0x801299 c026: 90 e0 ldi r25, 0x00 ; 0 c028: 80 e0 ldi r24, 0x00 ; 0 c02a: 0f 94 3d 48 call 0x2907a ; 0x2907a /// @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; }; c02e: 10 92 99 12 sts 0x1299, r1 ; 0x801299 c032: 10 92 98 12 sts 0x1298, r1 ; 0x801298 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } c036: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b c03a: 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 } } c03e: ff 90 pop r15 c040: ef 90 pop r14 c042: df 90 pop r13 c044: cf 90 pop r12 c046: bf 90 pop r11 c048: af 90 pop r10 c04a: 9f 90 pop r9 c04c: 8f 90 pop r8 c04e: 08 95 ret 0000c050 : } #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); c050: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 c054: 1f 92 push r1 c056: 8f 93 push r24 c058: 80 91 40 03 lds r24, 0x0340 ; 0x800340 c05c: 1f 92 push r1 c05e: 8f 93 push r24 c060: e5 e8 ldi r30, 0x85 ; 133 c062: f3 e0 ldi r31, 0x03 ; 3 c064: 42 81 ldd r20, Z+2 ; 0x02 c066: 53 81 ldd r21, Z+3 ; 0x03 c068: 2c e3 ldi r18, 0x3C ; 60 c06a: 24 9f mul r18, r20 c06c: c0 01 movw r24, r0 c06e: 25 9f mul r18, r21 c070: 90 0d add r25, r0 c072: 11 24 eor r1, r1 c074: 9f 93 push r25 c076: 8f 93 push r24 c078: 40 81 ld r20, Z c07a: 51 81 ldd r21, Z+1 ; 0x01 c07c: 24 9f mul r18, r20 c07e: c0 01 movw r24, r0 c080: 25 9f mul r18, r21 c082: 90 0d add r25, r0 c084: 11 24 eor r1, r1 c086: 9f 93 push r25 c088: 8f 93 push r24 c08a: 86 ed ldi r24, 0xD6 ; 214 c08c: 94 e6 ldi r25, 0x64 ; 100 c08e: 9f 93 push r25 c090: 8f 93 push r24 c092: 0f 94 3f 9f call 0x33e7e ; 0x33e7e c096: 8d b7 in r24, 0x3d ; 61 c098: 9e b7 in r25, 0x3e ; 62 c09a: 0a 96 adiw r24, 0x0a ; 10 c09c: 0f b6 in r0, 0x3f ; 63 c09e: f8 94 cli c0a0: 9e bf out 0x3e, r25 ; 62 c0a2: 0f be out 0x3f, r0 ; 63 c0a4: 8d bf out 0x3d, r24 ; 61 } c0a6: 08 95 ret 0000c0a8 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); c0a8: 8a e4 ldi r24, 0x4A ; 74 c0aa: 93 e0 ldi r25, 0x03 ; 3 c0ac: 0d 94 73 11 jmp 0x222e6 ; 0x222e6 ::start()> 0000c0b0 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; c0b0: 20 e0 ldi r18, 0x00 ; 0 c0b2: 30 e0 ldi r19, 0x00 ; 0 c0b4: 40 e7 ldi r20, 0x70 ; 112 c0b6: 52 e4 ldi r21, 0x42 ; 66 c0b8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> } c0bc: 08 95 ret 0000c0be : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; c0be: 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; c0c2: 40 91 3b 03 lds r20, 0x033B ; 0x80033b c0c6: 50 91 3c 03 lds r21, 0x033C ; 0x80033c c0ca: 60 91 3d 03 lds r22, 0x033D ; 0x80033d c0ce: 70 91 3e 03 lds r23, 0x033E ; 0x80033e c0d2: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a c0d6: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b c0da: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c c0de: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; c0e2: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c0e6: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c0ea: 8a e4 ldi r24, 0x4A ; 74 c0ec: 93 e0 ldi r25, 0x03 ; 3 c0ee: 0d 94 73 11 jmp 0x222e6 ; 0x222e6 ::start()> 0000c0f2 : 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) { c0f2: 1f 93 push r17 c0f4: cf 93 push r28 c0f6: df 93 push r29 c0f8: 18 2f mov r17, r24 saved_feedrate = feedrate; c0fa: 80 91 7a 02 lds r24, 0x027A ; 0x80027a c0fe: 90 91 7b 02 lds r25, 0x027B ; 0x80027b c102: a0 91 7c 02 lds r26, 0x027C ; 0x80027c c106: b0 91 7d 02 lds r27, 0x027D ; 0x80027d c10a: 80 93 3b 03 sts 0x033B, r24 ; 0x80033b c10e: 90 93 3c 03 sts 0x033C, r25 ; 0x80033c c112: a0 93 3d 03 sts 0x033D, r26 ; 0x80033d c116: b0 93 3e 03 sts 0x033E, r27 ; 0x80033e int l_feedmultiply = feedmultiply; c11a: c0 91 8e 02 lds r28, 0x028E ; 0x80028e c11e: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; c122: 84 e6 ldi r24, 0x64 ; 100 c124: 90 e0 ldi r25, 0x00 ; 0 c126: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c12a: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c12e: 8a e4 ldi r24, 0x4A ; 74 c130: 93 e0 ldi r25, 0x03 ; 3 c132: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> c136: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(enable_endstops_now); return l_feedmultiply; } c13a: ce 01 movw r24, r28 c13c: df 91 pop r29 c13e: cf 91 pop r28 c140: 1f 91 pop r17 c142: 08 95 ret 0000c144 : 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) { c144: cf 92 push r12 c146: df 92 push r13 c148: ef 92 push r14 c14a: ff 92 push r15 c14c: 0f 93 push r16 c14e: 1f 93 push r17 c150: cf 93 push r28 c152: 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); c154: 90 e0 ldi r25, 0x00 ; 0 c156: ec 01 movw r28, r24 c158: cc 0f add r28, r28 c15a: dd 1f adc r29, r29 c15c: cc 0f add r28, r28 c15e: dd 1f adc r29, r29 c160: fe 01 movw r30, r28 c162: eb 5e subi r30, 0xEB ; 235 c164: 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); c166: 25 91 lpm r18, Z+ c168: 35 91 lpm r19, Z+ c16a: 45 91 lpm r20, Z+ c16c: 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]; c16e: fe 01 movw r30, r28 c170: e6 57 subi r30, 0x76 ; 118 c172: fb 4f sbci r31, 0xFB ; 251 c174: c0 80 ld r12, Z c176: d1 80 ldd r13, Z+1 ; 0x01 c178: e2 80 ldd r14, Z+2 ; 0x02 c17a: f3 80 ldd r15, Z+3 ; 0x03 c17c: 8e 01 movw r16, r28 c17e: 0b 50 subi r16, 0x0B ; 11 c180: 1e 4e sbci r17, 0xEE ; 238 c182: c7 01 movw r24, r14 c184: b6 01 movw r22, r12 c186: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c18a: f8 01 movw r30, r16 c18c: 60 83 st Z, r22 c18e: 71 83 std Z+1, r23 ; 0x01 c190: 82 83 std Z+2, r24 ; 0x02 c192: 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); c194: fe 01 movw r30, r28 c196: e7 5f subi r30, 0xF7 ; 247 c198: 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); c19a: 25 91 lpm r18, Z+ c19c: 35 91 lpm r19, Z+ c19e: 45 91 lpm r20, Z+ c1a0: 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]; c1a2: 8e 01 movw r16, r28 c1a4: 0c 5d subi r16, 0xDC ; 220 c1a6: 1d 4f sbci r17, 0xFD ; 253 c1a8: c7 01 movw r24, r14 c1aa: b6 01 movw r22, r12 c1ac: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c1b0: f8 01 movw r30, r16 c1b2: 60 83 st Z, r22 c1b4: 71 83 std Z+1, r23 ; 0x01 c1b6: 82 83 std Z+2, r24 ; 0x02 c1b8: 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); c1ba: fe 01 movw r30, r28 c1bc: e3 50 subi r30, 0x03 ; 3 c1be: 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); c1c0: 25 91 lpm r18, Z+ c1c2: 35 91 lpm r19, Z+ c1c4: 45 91 lpm r20, Z+ c1c6: 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]; c1c8: c8 5e subi r28, 0xE8 ; 232 c1ca: dd 4f sbci r29, 0xFD ; 253 c1cc: c7 01 movw r24, r14 c1ce: b6 01 movw r22, r12 c1d0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c1d4: 68 83 st Y, r22 c1d6: 79 83 std Y+1, r23 ; 0x01 c1d8: 8a 83 std Y+2, r24 ; 0x02 c1da: 9b 83 std Y+3, r25 ; 0x03 } c1dc: df 91 pop r29 c1de: cf 91 pop r28 c1e0: 1f 91 pop r17 c1e2: 0f 91 pop r16 c1e4: ff 90 pop r15 c1e6: ef 90 pop r14 c1e8: df 90 pop r13 c1ea: cf 90 pop r12 c1ec: 08 95 ret 0000c1ee : c1ee: 40 e0 ldi r20, 0x00 ; 0 c1f0: 50 e0 ldi r21, 0x00 ; 0 c1f2: ba 01 movw r22, r20 c1f4: 8d ee ldi r24, 0xED ; 237 c1f6: 9f e0 ldi r25, 0x0F ; 15 c1f8: 0f 94 b3 a0 call 0x34166 ; 0x34166 c1fc: 40 e0 ldi r20, 0x00 ; 0 c1fe: 50 e0 ldi r21, 0x00 ; 0 c200: ba 01 movw r22, r20 c202: 81 ef ldi r24, 0xF1 ; 241 c204: 9f e0 ldi r25, 0x0F ; 15 c206: 0f 94 b3 a0 call 0x34166 ; 0x34166 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(); c20a: 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); c20e: 70 e0 ldi r23, 0x00 ; 0 c210: 60 e0 ldi r22, 0x00 ; 0 c212: 85 e0 ldi r24, 0x05 ; 5 c214: 9f e0 ldi r25, 0x0F ; 15 c216: 0f 94 bf a0 call 0x3417e ; 0x3417e c21a: 70 e0 ldi r23, 0x00 ; 0 c21c: 60 e0 ldi r22, 0x00 ; 0 c21e: 83 e0 ldi r24, 0x03 ; 3 c220: 9f e0 ldi r25, 0x0F ; 15 c222: 0f 94 bf a0 call 0x3417e ; 0x3417e c226: 70 e0 ldi r23, 0x00 ; 0 c228: 60 e0 ldi r22, 0x00 ; 0 c22a: 81 e0 ldi r24, 0x01 ; 1 c22c: 9f e0 ldi r25, 0x0F ; 15 c22e: 0f 94 bf a0 call 0x3417e ; 0x3417e c232: 70 e0 ldi r23, 0x00 ; 0 c234: 60 e0 ldi r22, 0x00 ; 0 c236: 8f ef ldi r24, 0xFF ; 255 c238: 9e e0 ldi r25, 0x0E ; 14 c23a: 0f 94 bf a0 call 0x3417e ; 0x3417e c23e: 70 e0 ldi r23, 0x00 ; 0 c240: 60 e0 ldi r22, 0x00 ; 0 c242: 83 ed ldi r24, 0xD3 ; 211 c244: 9e e0 ldi r25, 0x0E ; 14 c246: 0f 94 bf a0 call 0x3417e ; 0x3417e c24a: 70 e0 ldi r23, 0x00 ; 0 c24c: 60 e0 ldi r22, 0x00 ; 0 c24e: 80 ed ldi r24, 0xD0 ; 208 c250: 9e e0 ldi r25, 0x0E ; 14 c252: 0f 94 bf a0 call 0x3417e ; 0x3417e if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); c256: 40 e0 ldi r20, 0x00 ; 0 c258: 50 e0 ldi r21, 0x00 ; 0 c25a: ba 01 movw r22, r20 c25c: 88 ea ldi r24, 0xA8 ; 168 c25e: 9c e0 ldi r25, 0x0C ; 12 c260: 0d 94 b3 a0 jmp 0x34166 ; 0x34166 0000c264 : wdt_disable(); } } void softReset(void) { cli(); c264: 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" ); c266: 88 e1 ldi r24, 0x18 ; 24 c268: 9f e0 ldi r25, 0x0F ; 15 c26a: 0f b6 in r0, 0x3f ; 63 c26c: f8 94 cli c26e: a8 95 wdr c270: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c274: 0f be out 0x3f, r0 ; 63 c276: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c27a: ff cf rjmp .-2 ; 0xc27a 0000c27c : } #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); c27c: 85 ea ldi r24, 0xA5 ; 165 c27e: 9f e0 ldi r25, 0x0F ; 15 c280: 0f 94 7d a0 call 0x340fa ; 0x340fa c284: 91 e0 ldi r25, 0x01 ; 1 c286: 81 11 cpse r24, r1 c288: 01 c0 rjmp .+2 ; 0xc28c c28a: 90 e0 ldi r25, 0x00 ; 0 } c28c: 89 2f mov r24, r25 c28e: 08 95 ret 0000c290 : 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(); c290: 80 91 9b 03 lds r24, 0x039B ; 0x80039b c294: 81 11 cpse r24, r1 c296: 06 c0 rjmp .+12 ; 0xc2a4 c298: 81 e0 ldi r24, 0x01 ; 1 c29a: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c29e: 92 30 cpi r25, 0x02 ; 2 c2a0: 09 f0 breq .+2 ; 0xc2a4 c2a2: 80 e0 ldi r24, 0x00 ; 0 } c2a4: 08 95 ret 0000c2a6 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); c2a6: 80 91 6a 13 lds r24, 0x136A ; 0x80136a c2aa: 81 11 cpse r24, r1 c2ac: 0a c0 rjmp .+20 ; 0xc2c2 c2ae: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 c2b2: 81 11 cpse r24, r1 c2b4: 06 c0 rjmp .+12 ; 0xc2c2 c2b6: 81 e0 ldi r24, 0x01 ; 1 c2b8: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c2bc: 91 30 cpi r25, 0x01 ; 1 c2be: 09 f0 breq .+2 ; 0xc2c2 c2c0: 80 e0 ldi r24, 0x00 ; 0 } c2c2: 08 95 ret 0000c2c4 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { c2c4: cf 93 push r28 c2c6: df 93 push r29 return ( !homing_flag c2c8: c0 91 05 12 lds r28, 0x1205 ; 0x801205 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c2cc: c1 11 cpse r28, r1 c2ce: 1f c0 rjmp .+62 ; 0xc30e && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag c2d0: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c2d4: 81 11 cpse r24, r1 c2d6: 1c c0 rjmp .+56 ; 0xc310 && !printingIsPaused() c2d8: 0e 94 48 61 call 0xc290 ; 0xc290 c2dc: 81 11 cpse r24, r1 c2de: 18 c0 rjmp .+48 ; 0xc310 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c2e0: d0 91 c8 0d lds r29, 0x0DC8 ; 0x800dc8 c2e4: d4 30 cpi r29, 0x04 ; 4 c2e6: 61 f4 brne .+24 ; 0xc300 c2e8: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 c2ec: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 c2f0: 89 2b or r24, r25 c2f2: 91 f4 brne .+36 ; 0xc318 c2f4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed c2f8: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee c2fc: 89 2b or r24, r25 c2fe: 61 f4 brne .+24 ; 0xc318 || printJobOngoing() c300: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 c304: c8 2f mov r28, r24 c306: 81 11 cpse r24, r1 c308: 03 c0 rjmp .+6 ; 0xc310 || lcd_commands_type == LcdCommands::Idle c30a: c1 e0 ldi r28, 0x01 ; 1 c30c: 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) c30e: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } c310: 8c 2f mov r24, r28 c312: df 91 pop r29 c314: cf 91 pop r28 c316: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c318: c1 e0 ldi r28, 0x01 ; 1 c31a: fa cf rjmp .-12 ; 0xc310 0000c31c : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); c31c: 0e 94 62 61 call 0xc2c4 ; 0xc2c4 c320: 88 23 and r24, r24 c322: 89 f0 breq .+34 ; 0xc346 c324: 20 e0 ldi r18, 0x00 ; 0 c326: 30 e0 ldi r19, 0x00 ; 0 c328: 40 e0 ldi r20, 0x00 ; 0 c32a: 50 e4 ldi r21, 0x40 ; 64 c32c: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd c330: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe c334: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff c338: 90 91 00 12 lds r25, 0x1200 ; 0x801200 c33c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> c340: 88 1f adc r24, r24 c342: 88 27 eor r24, r24 c344: 88 1f adc r24, r24 } c346: 08 95 ret 0000c348 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() c348: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; c34c: 81 11 cpse r24, r1 c34e: 18 c0 rjmp .+48 ; 0xc380 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() c350: 0e 94 48 61 call 0xc290 ; 0xc290 c354: 81 11 cpse r24, r1 c356: 14 c0 rjmp .+40 ; 0xc380 || saved_printing c358: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 c35c: 81 11 cpse r24, r1 c35e: 10 c0 rjmp .+32 ; 0xc380 || (lcd_commands_type != LcdCommands::Idle) c360: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 c364: 81 11 cpse r24, r1 c366: 0b c0 rjmp .+22 ; 0xc37e || MMU2::mmu2.MMU_PRINT_SAVED() c368: 80 91 95 12 lds r24, 0x1295 ; 0x801295 c36c: 81 11 cpse r24, r1 c36e: 07 c0 rjmp .+14 ; 0xc37e || homing_flag c370: 80 91 05 12 lds r24, 0x1205 ; 0x801205 c374: 81 11 cpse r24, r1 c376: 04 c0 rjmp .+8 ; 0xc380 || mesh_bed_leveling_flag; c378: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c37c: 08 95 ret c37e: 81 e0 ldi r24, 0x01 ; 1 } c380: 08 95 ret 0000c382 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } c382: 80 e1 ldi r24, 0x10 ; 16 c384: e5 ef ldi r30, 0xF5 ; 245 c386: f1 e1 ldi r31, 0x11 ; 17 c388: a3 e9 ldi r26, 0x93 ; 147 c38a: b6 e0 ldi r27, 0x06 ; 6 c38c: 01 90 ld r0, Z+ c38e: 0d 92 st X+, r0 c390: 8a 95 dec r24 c392: e1 f7 brne .-8 ; 0xc38c c394: 08 95 ret 0000c396 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { c396: 4f 92 push r4 c398: 5f 92 push r5 c39a: 6f 92 push r6 c39c: 7f 92 push r7 c39e: 8f 92 push r8 c3a0: 9f 92 push r9 c3a2: af 92 push r10 c3a4: bf 92 push r11 c3a6: cf 92 push r12 c3a8: df 92 push r13 c3aa: ef 92 push r14 c3ac: ff 92 push r15 c3ae: 0f 93 push r16 c3b0: 1f 93 push r17 c3b2: cf 93 push r28 c3b4: df 93 push r29 c3b6: 00 d0 rcall .+0 ; 0xc3b8 c3b8: 00 d0 rcall .+0 ; 0xc3ba c3ba: 1f 92 push r1 c3bc: 1f 92 push r1 c3be: cd b7 in r28, 0x3d ; 61 c3c0: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; c3c2: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 c3c6: 22 23 and r18, r18 c3c8: 09 f4 brne .+2 ; 0xc3cc c3ca: 73 c1 rjmp .+742 ; 0xc6b2 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; c3cc: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c3d0: 22 30 cpi r18, 0x02 ; 2 c3d2: 09 f4 brne .+2 ; 0xc3d6 c3d4: 6e c1 rjmp .+732 ; 0xc6b2 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb c3d6: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c3da: 21 30 cpi r18, 0x01 ; 1 c3dc: 11 f4 brne .+4 ; 0xc3e2 c3de: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c c3e2: 2b 01 movw r4, r22 c3e4: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; c3e6: 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) c3ea: 10 91 ec 11 lds r17, 0x11EC ; 0x8011ec c3ee: 60 91 8a 03 lds r22, 0x038A ; 0x80038a c3f2: 70 91 8b 03 lds r23, 0x038B ; 0x80038b c3f6: 80 91 8c 03 lds r24, 0x038C ; 0x80038c c3fa: 90 91 8d 03 lds r25, 0x038D ; 0x80038d c3fe: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> c402: 61 17 cp r22, r17 c404: 31 f0 breq .+12 ; 0xc412 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; c406: 81 2f mov r24, r17 c408: 90 e0 ldi r25, 0x00 ; 0 c40a: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee c40e: 80 93 ed 11 sts 0x11ED, r24 ; 0x8011ed setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); c412: 0e 94 36 5f call 0xbe6c ; 0xbe6c // Restore saved fan speed fanSpeed = saved_fan_speed; c416: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 c41a: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; c41e: 90 91 eb 11 lds r25, 0x11EB ; 0x8011eb c422: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea c426: 81 95 neg r24 c428: 89 27 eor r24, r25 c42a: 88 70 andi r24, 0x08 ; 8 c42c: 89 27 eor r24, r25 c42e: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb float e = saved_pos[E_AXIS] - e_move; c432: a3 01 movw r20, r6 c434: 92 01 movw r18, r4 c436: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c43a: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c43e: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c442: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c446: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> c44a: 6d 83 std Y+5, r22 ; 0x05 c44c: 7e 83 std Y+6, r23 ; 0x06 c44e: 8f 83 std Y+7, r24 ; 0x07 c450: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); c452: ce 01 movw r24, r28 c454: 05 96 adiw r24, 0x05 ; 5 c456: 0f 94 69 75 call 0x2ead2 ; 0x2ead2 #ifdef FANCHECK fans_check_enabled = false; c45a: 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) c45e: 20 e0 ldi r18, 0x00 ; 0 c460: 30 e0 ldi r19, 0x00 ; 0 c462: 40 e8 ldi r20, 0x80 ; 128 c464: 5f eb ldi r21, 0xBF ; 191 c466: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c46a: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c46e: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c472: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c476: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> c47a: 81 11 cpse r24, r1 c47c: 20 c0 rjmp .+64 ; 0xc4be { saved_pos[X_AXIS] = current_position[X_AXIS]; c47e: 80 91 f5 11 lds r24, 0x11F5 ; 0x8011f5 c482: 90 91 f6 11 lds r25, 0x11F6 ; 0x8011f6 c486: a0 91 f7 11 lds r26, 0x11F7 ; 0x8011f7 c48a: b0 91 f8 11 lds r27, 0x11F8 ; 0x8011f8 c48e: 80 93 90 02 sts 0x0290, r24 ; 0x800290 c492: 90 93 91 02 sts 0x0291, r25 ; 0x800291 c496: a0 93 92 02 sts 0x0292, r26 ; 0x800292 c49a: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; c49e: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 c4a2: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa c4a6: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb c4aa: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc c4ae: 80 93 94 02 sts 0x0294, r24 ; 0x800294 c4b2: 90 93 95 02 sts 0x0295, r25 ; 0x800295 c4b6: a0 93 96 02 sts 0x0296, r26 ; 0x800296 c4ba: 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); c4be: a3 01 movw r20, r6 c4c0: 92 01 movw r18, r4 c4c2: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c4c6: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c4ca: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c4ce: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c4d2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> c4d6: 69 83 std Y+1, r22 ; 0x01 c4d8: 7a 83 std Y+2, r23 ; 0x02 c4da: 8b 83 std Y+3, r24 ; 0x03 c4dc: 9c 83 std Y+4, r25 ; 0x04 c4de: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd c4e2: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe c4e6: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff c4ea: 10 91 00 12 lds r17, 0x1200 ; 0x801200 c4ee: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c4f2: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c4f6: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c4fa: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c4fe: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c502: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c506: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c50a: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c50e: 1f 92 push r1 c510: 1f 92 push r1 c512: 1f 92 push r1 c514: 1f 92 push r1 c516: e2 e6 ldi r30, 0x62 ; 98 c518: 8e 2e mov r8, r30 c51a: e7 e2 ldi r30, 0x27 ; 39 c51c: 9e 2e mov r9, r30 c51e: e6 e7 ldi r30, 0x76 ; 118 c520: ae 2e mov r10, r30 c522: e2 e4 ldi r30, 0x42 ; 66 c524: be 2e mov r11, r30 c526: fe 01 movw r30, r28 c528: 31 96 adiw r30, 0x01 ; 1 c52a: 6f 01 movw r12, r30 c52c: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 //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); c530: a3 01 movw r20, r6 c532: 92 01 movw r18, r4 c534: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c538: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c53c: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c540: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c544: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> c548: 69 83 std Y+1, r22 ; 0x01 c54a: 7a 83 std Y+2, r23 ; 0x02 c54c: 8b 83 std Y+3, r24 ; 0x03 c54e: 9c 83 std Y+4, r25 ; 0x04 c550: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c554: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c558: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c55c: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c560: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c564: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c568: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c56c: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c570: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c574: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c578: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c57c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c580: 1f 92 push r1 c582: 1f 92 push r1 c584: 1f 92 push r1 c586: 1f 92 push r1 c588: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 //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); c58c: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c590: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c594: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c598: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c59c: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c5a0: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c5a4: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c5a8: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c5ac: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c5b0: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c5b4: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c5b8: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c5bc: 1f 92 push r1 c5be: 1f 92 push r1 c5c0: 1f 92 push r1 c5c2: 1f 92 push r1 c5c4: 81 2c mov r8, r1 c5c6: 91 2c mov r9, r1 c5c8: f8 ee ldi r31, 0xE8 ; 232 c5ca: af 2e mov r10, r31 c5cc: f2 e4 ldi r31, 0x42 ; 66 c5ce: bf 2e mov r11, r31 c5d0: ac e9 ldi r26, 0x9C ; 156 c5d2: ca 2e mov r12, r26 c5d4: a2 e0 ldi r26, 0x02 ; 2 c5d6: da 2e mov r13, r26 c5d8: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 st_synchronize(); c5dc: 0f 94 14 22 call 0x24428 ; 0x24428 #ifdef FANCHECK fans_check_enabled = true; c5e0: 11 e0 ldi r17, 0x01 ; 1 c5e2: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; c5e6: 60 91 e2 11 lds r22, 0x11E2 ; 0x8011e2 c5ea: 70 91 e3 11 lds r23, 0x11E3 ; 0x8011e3 c5ee: 90 e0 ldi r25, 0x00 ; 0 c5f0: 80 e0 ldi r24, 0x00 ; 0 c5f2: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> c5f6: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a c5fa: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b c5fe: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c c602: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; c606: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> c60a: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> c60e: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c612: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); c616: 80 e1 ldi r24, 0x10 ; 16 c618: e0 e9 ldi r30, 0x90 ; 144 c61a: f2 e0 ldi r31, 0x02 ; 2 c61c: a5 ef ldi r26, 0xF5 ; 245 c61e: b1 e1 ldi r27, 0x11 ; 17 c620: 01 90 ld r0, Z+ c622: 0d 92 st X+, r0 c624: 8a 95 dec r24 c626: e1 f7 brne .-8 ; 0xc620 set_destination_to_current(); c628: 0e 94 c1 61 call 0xc382 ; 0xc382 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing c62c: 80 91 79 02 lds r24, 0x0279 ; 0x800279 c630: 0f b6 in r0, 0x3f ; 63 c632: f8 94 cli c634: de bf out 0x3e, r29 ; 62 c636: 0f be out 0x3f, r0 ; 63 c638: cd bf out 0x3d, r28 ; 61 c63a: 81 11 cpse r24, r1 c63c: 51 c0 rjmp .+162 ; 0xc6e0 card.setIndex(saved_sdpos); c63e: 60 91 d8 11 lds r22, 0x11D8 ; 0x8011d8 c642: 70 91 d9 11 lds r23, 0x11D9 ; 0x8011d9 c646: 80 91 da 11 lds r24, 0x11DA ; 0x8011da c64a: 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);}; c64e: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e c652: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f c656: 80 93 80 16 sts 0x1680, r24 ; 0x801680 c65a: 90 93 81 16 sts 0x1681, r25 ; 0x801681 c65e: 0f 94 94 43 call 0x28728 ; 0x28728 sdpos_atomic = saved_sdpos; c662: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c666: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c66a: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c66e: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c672: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc c676: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd c67a: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de c67e: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df card.sdprinting = true; c682: 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); c686: 60 e0 ldi r22, 0x00 ; 0 c688: 85 ea ldi r24, 0xA5 ; 165 c68a: 9f e0 ldi r25, 0x0F ; 15 c68c: 0f 94 a1 a0 call 0x34142 ; 0x34142 c690: 60 e0 ldi r22, 0x00 ; 0 c692: 8f e7 ldi r24, 0x7F ; 127 c694: 9c e0 ldi r25, 0x0C ; 12 c696: 0f 94 a1 a0 call 0x34142 ; 0x34142 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); c69a: 8b e0 ldi r24, 0x0B ; 11 c69c: 9c e6 ldi r25, 0x6C ; 108 c69e: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c6a2: 82 e0 ldi r24, 0x02 ; 2 c6a4: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c6a8: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 planner_aborted = true; // unroll the stack c6ac: 81 e0 ldi r24, 0x01 ; 1 c6ae: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } c6b2: 28 96 adiw r28, 0x08 ; 8 c6b4: 0f b6 in r0, 0x3f ; 63 c6b6: f8 94 cli c6b8: de bf out 0x3e, r29 ; 62 c6ba: 0f be out 0x3f, r0 ; 63 c6bc: cd bf out 0x3d, r28 ; 61 c6be: df 91 pop r29 c6c0: cf 91 pop r28 c6c2: 1f 91 pop r17 c6c4: 0f 91 pop r16 c6c6: ff 90 pop r15 c6c8: ef 90 pop r14 c6ca: df 90 pop r13 c6cc: cf 90 pop r12 c6ce: bf 90 pop r11 c6d0: af 90 pop r10 c6d2: 9f 90 pop r9 c6d4: 8f 90 pop r8 c6d6: 7f 90 pop r7 c6d8: 6f 90 pop r6 c6da: 5f 90 pop r5 c6dc: 4f 90 pop r4 c6de: 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 c6e0: 81 30 cpi r24, 0x01 ; 1 c6e2: 89 f6 brne .-94 ; 0xc686 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing c6e4: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c6e8: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c6ec: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c6f0: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c6f4: 80 93 d1 11 sts 0x11D1, r24 ; 0x8011d1 c6f8: 90 93 d2 11 sts 0x11D2, r25 ; 0x8011d2 c6fc: a0 93 d3 11 sts 0x11D3, r26 ; 0x8011d3 c700: b0 93 d4 11 sts 0x11D4, r27 ; 0x8011d4 serial_count = 0; c704: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb c708: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda FlushSerialRequestResend(); c70c: 0e 94 6d 55 call 0xaada ; 0xaada c710: ba cf rjmp .-140 ; 0xc686 0000c712 : 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) { c712: 3f 92 push r3 c714: 4f 92 push r4 c716: 5f 92 push r5 c718: 6f 92 push r6 c71a: 7f 92 push r7 c71c: 8f 92 push r8 c71e: 9f 92 push r9 c720: af 92 push r10 c722: bf 92 push r11 c724: cf 92 push r12 c726: df 92 push r13 c728: ef 92 push r14 c72a: ff 92 push r15 c72c: 0f 93 push r16 c72e: 1f 93 push r17 c730: cf 93 push r28 c732: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { c734: 30 90 dc 16 lds r3, 0x16DC ; 0x8016dc c738: 33 20 and r3, r3 c73a: 09 f4 brne .+2 ; 0xc73e c73c: 80 c0 rjmp .+256 ; 0xc83e c73e: 8b 01 movw r16, r22 c740: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c742: 31 fe sbrs r3, 1 c744: 54 c0 rjmp .+168 ; 0xc7ee // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; c746: 88 80 ld r8, Y c748: 99 80 ldd r9, Y+1 ; 0x01 c74a: aa 80 ldd r10, Y+2 ; 0x02 c74c: bb 80 ldd r11, Y+3 ; 0x03 c74e: fb 01 movw r30, r22 c750: c0 80 ld r12, Z c752: d1 80 ldd r13, Z+1 ; 0x01 c754: e2 80 ldd r14, Z+2 ; 0x02 c756: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; c758: 20 91 b1 16 lds r18, 0x16B1 ; 0x8016b1 c75c: 30 91 b2 16 lds r19, 0x16B2 ; 0x8016b2 c760: 40 91 b3 16 lds r20, 0x16B3 ; 0x8016b3 c764: 50 91 b4 16 lds r21, 0x16B4 ; 0x8016b4 c768: c5 01 movw r24, r10 c76a: b4 01 movw r22, r8 c76c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> c770: 2b 01 movw r4, r22 c772: 3c 01 movw r6, r24 c774: 20 91 b5 16 lds r18, 0x16B5 ; 0x8016b5 c778: 30 91 b6 16 lds r19, 0x16B6 ; 0x8016b6 c77c: 40 91 b7 16 lds r20, 0x16B7 ; 0x8016b7 c780: 50 91 b8 16 lds r21, 0x16B8 ; 0x8016b8 c784: c7 01 movw r24, r14 c786: b6 01 movw r22, r12 c788: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> c78c: 9b 01 movw r18, r22 c78e: ac 01 movw r20, r24 c790: c3 01 movw r24, r6 c792: b2 01 movw r22, r4 c794: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c798: 2b 01 movw r4, r22 c79a: 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; c79c: 20 91 a9 16 lds r18, 0x16A9 ; 0x8016a9 c7a0: 30 91 aa 16 lds r19, 0x16AA ; 0x8016aa c7a4: 40 91 ab 16 lds r20, 0x16AB ; 0x8016ab c7a8: 50 91 ac 16 lds r21, 0x16AC ; 0x8016ac c7ac: c5 01 movw r24, r10 c7ae: b4 01 movw r22, r8 c7b0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> c7b4: 4b 01 movw r8, r22 c7b6: 5c 01 movw r10, r24 c7b8: 20 91 ad 16 lds r18, 0x16AD ; 0x8016ad c7bc: 30 91 ae 16 lds r19, 0x16AE ; 0x8016ae c7c0: 40 91 af 16 lds r20, 0x16AF ; 0x8016af c7c4: 50 91 b0 16 lds r21, 0x16B0 ; 0x8016b0 c7c8: c7 01 movw r24, r14 c7ca: b6 01 movw r22, r12 c7cc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> c7d0: 9b 01 movw r18, r22 c7d2: ac 01 movw r20, r24 c7d4: c5 01 movw r24, r10 c7d6: b4 01 movw r22, r8 c7d8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; c7dc: 68 83 st Y, r22 c7de: 79 83 std Y+1, r23 ; 0x01 c7e0: 8a 83 std Y+2, r24 ; 0x02 c7e2: 9b 83 std Y+3, r25 ; 0x03 y = out_y; c7e4: f8 01 movw r30, r16 c7e6: 40 82 st Z, r4 c7e8: 51 82 std Z+1, r5 ; 0x01 c7ea: 62 82 std Z+2, r6 ; 0x02 c7ec: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { c7ee: 30 fe sbrs r3, 0 c7f0: 26 c0 rjmp .+76 ; 0xc83e // Then add the offset. x += world2machine_shift[0]; c7f2: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c7f6: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c7fa: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c7fe: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c802: 68 81 ld r22, Y c804: 79 81 ldd r23, Y+1 ; 0x01 c806: 8a 81 ldd r24, Y+2 ; 0x02 c808: 9b 81 ldd r25, Y+3 ; 0x03 c80a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c80e: 68 83 st Y, r22 c810: 79 83 std Y+1, r23 ; 0x01 c812: 8a 83 std Y+2, r24 ; 0x02 c814: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; c816: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c81a: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c81e: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c822: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c826: f8 01 movw r30, r16 c828: 60 81 ld r22, Z c82a: 71 81 ldd r23, Z+1 ; 0x01 c82c: 82 81 ldd r24, Z+2 ; 0x02 c82e: 93 81 ldd r25, Z+3 ; 0x03 c830: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> c834: f8 01 movw r30, r16 c836: 60 83 st Z, r22 c838: 71 83 std Z+1, r23 ; 0x01 c83a: 82 83 std Z+2, r24 ; 0x02 c83c: 93 83 std Z+3, r25 ; 0x03 } } } c83e: df 91 pop r29 c840: cf 91 pop r28 c842: 1f 91 pop r17 c844: 0f 91 pop r16 c846: ff 90 pop r15 c848: ef 90 pop r14 c84a: df 90 pop r13 c84c: cf 90 pop r12 c84e: bf 90 pop r11 c850: af 90 pop r10 c852: 9f 90 pop r9 c854: 8f 90 pop r8 c856: 7f 90 pop r7 c858: 6f 90 pop r6 c85a: 5f 90 pop r5 c85c: 4f 90 pop r4 c85e: 3f 90 pop r3 c860: 08 95 ret 0000c862 : } } } inline bool world2machine_clamp(float &x, float &y) { c862: 2f 92 push r2 c864: 3f 92 push r3 c866: 4f 92 push r4 c868: 5f 92 push r5 c86a: 6f 92 push r6 c86c: 7f 92 push r7 c86e: 8f 92 push r8 c870: 9f 92 push r9 c872: af 92 push r10 c874: bf 92 push r11 c876: cf 92 push r12 c878: df 92 push r13 c87a: ef 92 push r14 c87c: ff 92 push r15 c87e: 0f 93 push r16 c880: 1f 93 push r17 c882: cf 93 push r28 c884: df 93 push r29 c886: 00 d0 rcall .+0 ; 0xc888 c888: 00 d0 rcall .+0 ; 0xc88a c88a: 1f 92 push r1 c88c: 1f 92 push r1 c88e: cd b7 in r28, 0x3d ; 61 c890: de b7 in r29, 0x3e ; 62 c892: 8c 01 movw r16, r24 c894: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; c896: fc 01 movw r30, r24 c898: 80 81 ld r24, Z c89a: 91 81 ldd r25, Z+1 ; 0x01 c89c: a2 81 ldd r26, Z+2 ; 0x02 c89e: b3 81 ldd r27, Z+3 ; 0x03 c8a0: 89 83 std Y+1, r24 ; 0x01 c8a2: 9a 83 std Y+2, r25 ; 0x02 c8a4: ab 83 std Y+3, r26 ; 0x03 c8a6: bc 83 std Y+4, r27 ; 0x04 out_y = y; c8a8: fb 01 movw r30, r22 c8aa: 80 81 ld r24, Z c8ac: 91 81 ldd r25, Z+1 ; 0x01 c8ae: a2 81 ldd r26, Z+2 ; 0x02 c8b0: b3 81 ldd r27, Z+3 ; 0x03 c8b2: 8d 83 std Y+5, r24 ; 0x05 c8b4: 9e 83 std Y+6, r25 ; 0x06 c8b6: af 83 std Y+7, r26 ; 0x07 c8b8: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); c8ba: be 01 movw r22, r28 c8bc: 6b 5f subi r22, 0xFB ; 251 c8be: 7f 4f sbci r23, 0xFF ; 255 c8c0: ce 01 movw r24, r28 c8c2: 01 96 adiw r24, 0x01 ; 1 c8c4: 0e 94 89 63 call 0xc712 ; 0xc712 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { c8c8: c9 80 ldd r12, Y+1 ; 0x01 c8ca: da 80 ldd r13, Y+2 ; 0x02 c8cc: eb 80 ldd r14, Y+3 ; 0x03 c8ce: fc 80 ldd r15, Y+4 ; 0x04 c8d0: 20 e0 ldi r18, 0x00 ; 0 c8d2: 30 e0 ldi r19, 0x00 ; 0 c8d4: a9 01 movw r20, r18 c8d6: c7 01 movw r24, r14 c8d8: b6 01 movw r22, r12 c8da: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> c8de: 87 ff sbrs r24, 7 c8e0: 35 c0 rjmp .+106 ; 0xc94c tmpx = X_MIN_POS; c8e2: 19 82 std Y+1, r1 ; 0x01 c8e4: 1a 82 std Y+2, r1 ; 0x02 c8e6: 1b 82 std Y+3, r1 ; 0x03 c8e8: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; c8ea: ff 24 eor r15, r15 c8ec: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { c8ee: 8d 80 ldd r8, Y+5 ; 0x05 c8f0: 9e 80 ldd r9, Y+6 ; 0x06 c8f2: af 80 ldd r10, Y+7 ; 0x07 c8f4: b8 84 ldd r11, Y+8 ; 0x08 c8f6: 20 e0 ldi r18, 0x00 ; 0 c8f8: 30 e0 ldi r19, 0x00 ; 0 c8fa: 40 e8 ldi r20, 0x80 ; 128 c8fc: 50 ec ldi r21, 0xC0 ; 192 c8fe: c5 01 movw r24, r10 c900: b4 01 movw r22, r8 c902: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> c906: 87 ff sbrs r24, 7 c908: 35 c0 rjmp .+106 ; 0xc974 tmpy = Y_MIN_POS; c90a: 80 e0 ldi r24, 0x00 ; 0 c90c: 90 e0 ldi r25, 0x00 ; 0 c90e: a0 e8 ldi r26, 0x80 ; 128 c910: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; c912: 8d 83 std Y+5, r24 ; 0x05 c914: 9e 83 std Y+6, r25 ; 0x06 c916: af 83 std Y+7, r26 ; 0x07 c918: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); c91a: cd 80 ldd r12, Y+5 ; 0x05 c91c: de 80 ldd r13, Y+6 ; 0x06 c91e: ef 80 ldd r14, Y+7 ; 0x07 c920: f8 84 ldd r15, Y+8 ; 0x08 c922: 89 80 ldd r8, Y+1 ; 0x01 c924: 9a 80 ldd r9, Y+2 ; 0x02 c926: ab 80 ldd r10, Y+3 ; 0x03 c928: 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) { c92a: 70 90 dc 16 lds r7, 0x16DC ; 0x8016dc c92e: 71 10 cpse r7, r1 c930: 4c c0 rjmp .+152 ; 0xc9ca // No correction. out_x = x; c932: f8 01 movw r30, r16 c934: 80 82 st Z, r8 c936: 91 82 std Z+1, r9 ; 0x01 c938: a2 82 std Z+2, r10 ; 0x02 c93a: b3 82 std Z+3, r11 ; 0x03 out_y = y; c93c: f1 01 movw r30, r2 c93e: c0 82 st Z, r12 c940: d1 82 std Z+1, r13 ; 0x01 c942: e2 82 std Z+2, r14 ; 0x02 c944: 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) { c946: ff 24 eor r15, r15 c948: f3 94 inc r15 c94a: 25 c0 rjmp .+74 ; 0xc996 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) { c94c: 20 e0 ldi r18, 0x00 ; 0 c94e: 30 e0 ldi r19, 0x00 ; 0 c950: 4a e7 ldi r20, 0x7A ; 122 c952: 53 e4 ldi r21, 0x43 ; 67 c954: c7 01 movw r24, r14 c956: b6 01 movw r22, r12 c958: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; c95c: 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) { c95e: 18 16 cp r1, r24 c960: 34 f6 brge .-116 ; 0xc8ee tmpx = X_MAX_POS; c962: 80 e0 ldi r24, 0x00 ; 0 c964: 90 e0 ldi r25, 0x00 ; 0 c966: aa e7 ldi r26, 0x7A ; 122 c968: b3 e4 ldi r27, 0x43 ; 67 c96a: 89 83 std Y+1, r24 ; 0x01 c96c: 9a 83 std Y+2, r25 ; 0x02 c96e: ab 83 std Y+3, r26 ; 0x03 c970: bc 83 std Y+4, r27 ; 0x04 c972: bb cf rjmp .-138 ; 0xc8ea } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { c974: 20 e0 ldi r18, 0x00 ; 0 c976: 30 e0 ldi r19, 0x00 ; 0 c978: 42 e5 ldi r20, 0x52 ; 82 c97a: 53 e4 ldi r21, 0x43 ; 67 c97c: c5 01 movw r24, r10 c97e: b4 01 movw r22, r8 c980: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> c984: 18 16 cp r1, r24 c986: 2c f4 brge .+10 ; 0xc992 tmpy = Y_MAX_POS; c988: 80 e0 ldi r24, 0x00 ; 0 c98a: 90 e0 ldi r25, 0x00 ; 0 c98c: a2 e5 ldi r26, 0x52 ; 82 c98e: b3 e4 ldi r27, 0x43 ; 67 c990: c0 cf rjmp .-128 ; 0xc912 clamped = true; } if (clamped) c992: f1 10 cpse r15, r1 c994: c2 cf rjmp .-124 ; 0xc91a machine2world(tmpx, tmpy, x, y); return clamped; } c996: 8f 2d mov r24, r15 c998: 28 96 adiw r28, 0x08 ; 8 c99a: 0f b6 in r0, 0x3f ; 63 c99c: f8 94 cli c99e: de bf out 0x3e, r29 ; 62 c9a0: 0f be out 0x3f, r0 ; 63 c9a2: cd bf out 0x3d, r28 ; 61 c9a4: df 91 pop r29 c9a6: cf 91 pop r28 c9a8: 1f 91 pop r17 c9aa: 0f 91 pop r16 c9ac: ff 90 pop r15 c9ae: ef 90 pop r14 c9b0: df 90 pop r13 c9b2: cf 90 pop r12 c9b4: bf 90 pop r11 c9b6: af 90 pop r10 c9b8: 9f 90 pop r9 c9ba: 8f 90 pop r8 c9bc: 7f 90 pop r7 c9be: 6f 90 pop r6 c9c0: 5f 90 pop r5 c9c2: 4f 90 pop r4 c9c4: 3f 90 pop r3 c9c6: 2f 90 pop r2 c9c8: 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) { c9ca: 70 fe sbrs r7, 0 c9cc: 1c c0 rjmp .+56 ; 0xca06 // Then add the offset. x -= world2machine_shift[0]; c9ce: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c9d2: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c9d6: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c9da: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c9de: c5 01 movw r24, r10 c9e0: b4 01 movw r22, r8 c9e2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> c9e6: 4b 01 movw r8, r22 c9e8: 5c 01 movw r10, r24 y -= world2machine_shift[1]; c9ea: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c9ee: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c9f2: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c9f6: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c9fa: c7 01 movw r24, r14 c9fc: b6 01 movw r22, r12 c9fe: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> ca02: 6b 01 movw r12, r22 ca04: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { ca06: 71 fe sbrs r7, 1 ca08: 9e cf rjmp .-196 ; 0xc946 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; ca0a: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 ca0e: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 ca12: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 ca16: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 ca1a: c5 01 movw r24, r10 ca1c: b4 01 movw r22, r8 ca1e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> ca22: 2b 01 movw r4, r22 ca24: 3c 01 movw r6, r24 ca26: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 ca2a: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 ca2e: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca ca32: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb ca36: c7 01 movw r24, r14 ca38: b6 01 movw r22, r12 ca3a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> ca3e: 9b 01 movw r18, r22 ca40: ac 01 movw r20, r24 ca42: c3 01 movw r24, r6 ca44: b2 01 movw r22, r4 ca46: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> ca4a: f8 01 movw r30, r16 ca4c: 60 83 st Z, r22 ca4e: 71 83 std Z+1, r23 ; 0x01 ca50: 82 83 std Z+2, r24 ; 0x02 ca52: 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; ca54: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc ca58: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd ca5c: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce ca60: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf ca64: c5 01 movw r24, r10 ca66: b4 01 movw r22, r8 ca68: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> ca6c: 4b 01 movw r8, r22 ca6e: 5c 01 movw r10, r24 ca70: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 ca74: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 ca78: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 ca7c: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 ca80: c7 01 movw r24, r14 ca82: b6 01 movw r22, r12 ca84: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> ca88: 9b 01 movw r18, r22 ca8a: ac 01 movw r20, r24 ca8c: c5 01 movw r24, r10 ca8e: b4 01 movw r22, r8 ca90: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> ca94: f1 01 movw r30, r2 ca96: 60 83 st Z, r22 ca98: 71 83 std Z+1, r23 ; 0x01 ca9a: 82 83 std Z+2, r24 ; 0x02 ca9c: 93 83 std Z+3, r25 ; 0x03 ca9e: 53 cf rjmp .-346 ; 0xc946 0000caa0 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { caa0: cf 92 push r12 caa2: df 92 push r13 caa4: ef 92 push r14 caa6: ff 92 push r15 caa8: cf 93 push r28 caaa: df 93 push r29 caac: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); caae: bc 01 movw r22, r24 cab0: 6c 5f subi r22, 0xFC ; 252 cab2: 7f 4f sbci r23, 0xFF ; 255 cab4: 0e 94 31 64 call 0xc862 ; 0xc862 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; cab8: c0 90 2c 02 lds r12, 0x022C ; 0x80022c cabc: d0 90 2d 02 lds r13, 0x022D ; 0x80022d cac0: e0 90 2e 02 lds r14, 0x022E ; 0x80022e cac4: f0 90 2f 02 lds r15, 0x022F ; 0x80022f cac8: a7 01 movw r20, r14 caca: 96 01 movw r18, r12 cacc: 68 85 ldd r22, Y+8 ; 0x08 cace: 79 85 ldd r23, Y+9 ; 0x09 cad0: 8a 85 ldd r24, Y+10 ; 0x0a cad2: 9b 85 ldd r25, Y+11 ; 0x0b cad4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> cad8: 87 ff sbrs r24, 7 cada: 04 c0 rjmp .+8 ; 0xcae4 cadc: c8 86 std Y+8, r12 ; 0x08 cade: d9 86 std Y+9, r13 ; 0x09 cae0: ea 86 std Y+10, r14 ; 0x0a cae2: 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]; cae4: c0 90 20 02 lds r12, 0x0220 ; 0x800220 cae8: d0 90 21 02 lds r13, 0x0221 ; 0x800221 caec: e0 90 22 02 lds r14, 0x0222 ; 0x800222 caf0: f0 90 23 02 lds r15, 0x0223 ; 0x800223 caf4: a7 01 movw r20, r14 caf6: 96 01 movw r18, r12 caf8: 68 85 ldd r22, Y+8 ; 0x08 cafa: 79 85 ldd r23, Y+9 ; 0x09 cafc: 8a 85 ldd r24, Y+10 ; 0x0a cafe: 9b 85 ldd r25, Y+11 ; 0x0b cb00: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> cb04: 18 16 cp r1, r24 cb06: 24 f4 brge .+8 ; 0xcb10 cb08: c8 86 std Y+8, r12 ; 0x08 cb0a: d9 86 std Y+9, r13 ; 0x09 cb0c: ea 86 std Y+10, r14 ; 0x0a cb0e: fb 86 std Y+11, r15 ; 0x0b } } cb10: df 91 pop r29 cb12: cf 91 pop r28 cb14: ff 90 pop r15 cb16: ef 90 pop r14 cb18: df 90 pop r13 cb1a: cf 90 pop r12 cb1c: 08 95 ret 0000cb1e : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { cb1e: 2f 92 push r2 cb20: 3f 92 push r3 cb22: 4f 92 push r4 cb24: 5f 92 push r5 cb26: 6f 92 push r6 cb28: 7f 92 push r7 cb2a: 8f 92 push r8 cb2c: 9f 92 push r9 cb2e: af 92 push r10 cb30: bf 92 push r11 cb32: cf 92 push r12 cb34: df 92 push r13 cb36: ef 92 push r14 cb38: ff 92 push r15 cb3a: 0f 93 push r16 cb3c: 1f 93 push r17 cb3e: cf 93 push r28 cb40: df 93 push r29 cb42: cd b7 in r28, 0x3d ; 61 cb44: de b7 in r29, 0x3e ; 62 cb46: a2 97 sbiw r28, 0x22 ; 34 cb48: 0f b6 in r0, 0x3f ; 63 cb4a: f8 94 cli cb4c: de bf out 0x3e, r29 ; 62 cb4e: 0f be out 0x3f, r0 ; 63 cb50: cd bf out 0x3d, r28 ; 61 cb52: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); cb54: 83 e9 ldi r24, 0x93 ; 147 cb56: 96 e0 ldi r25, 0x06 ; 6 cb58: 0e 94 50 65 call 0xcaa0 ; 0xcaa0 previous_millis_cmd.start(); cb5c: 8a e4 ldi r24, 0x4A ; 74 cb5e: 93 e0 ldi r25, 0x03 ; 3 cb60: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::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])) { cb64: 40 90 f5 11 lds r4, 0x11F5 ; 0x8011f5 cb68: 50 90 f6 11 lds r5, 0x11F6 ; 0x8011f6 cb6c: 60 90 f7 11 lds r6, 0x11F7 ; 0x8011f7 cb70: 70 90 f8 11 lds r7, 0x11F8 ; 0x8011f8 cb74: c0 90 93 06 lds r12, 0x0693 ; 0x800693 cb78: d0 90 94 06 lds r13, 0x0694 ; 0x800694 cb7c: e0 90 95 06 lds r14, 0x0695 ; 0x800695 cb80: f0 90 96 06 lds r15, 0x0696 ; 0x800696 cb84: a7 01 movw r20, r14 cb86: 96 01 movw r18, r12 cb88: c3 01 movw r24, r6 cb8a: b2 01 movw r22, r4 cb8c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> cb90: 81 11 cpse r24, r1 cb92: 3f c0 rjmp .+126 ; 0xcc12 cb94: 20 91 97 06 lds r18, 0x0697 ; 0x800697 cb98: 30 91 98 06 lds r19, 0x0698 ; 0x800698 cb9c: 40 91 99 06 lds r20, 0x0699 ; 0x800699 cba0: 50 91 9a 06 lds r21, 0x069A ; 0x80069a cba4: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 cba8: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa cbac: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb cbb0: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc cbb4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> cbb8: 81 11 cpse r24, r1 cbba: 2b c0 rjmp .+86 ; 0xcc12 plan_buffer_line_destinationXYZE(feedrate/60); cbbc: 20 e0 ldi r18, 0x00 ; 0 cbbe: 30 e0 ldi r19, 0x00 ; 0 cbc0: 40 e7 ldi r20, 0x70 ; 112 cbc2: 52 e4 ldi r21, 0x42 ; 66 cbc4: 60 91 7a 02 lds r22, 0x027A ; 0x80027a cbc8: 70 91 7b 02 lds r23, 0x027B ; 0x80027b cbcc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c cbd0: 90 91 7d 02 lds r25, 0x027D ; 0x80027d cbd4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> cbd8: 0f 94 de 84 call 0x309bc ; 0x309bc #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); cbdc: 0e 94 37 55 call 0xaa6e ; 0xaa6e } cbe0: a2 96 adiw r28, 0x22 ; 34 cbe2: 0f b6 in r0, 0x3f ; 63 cbe4: f8 94 cli cbe6: de bf out 0x3e, r29 ; 62 cbe8: 0f be out 0x3f, r0 ; 63 cbea: cd bf out 0x3d, r28 ; 61 cbec: df 91 pop r29 cbee: cf 91 pop r28 cbf0: 1f 91 pop r17 cbf2: 0f 91 pop r16 cbf4: ff 90 pop r15 cbf6: ef 90 pop r14 cbf8: df 90 pop r13 cbfa: cf 90 pop r12 cbfc: bf 90 pop r11 cbfe: af 90 pop r10 cc00: 9f 90 pop r9 cc02: 8f 90 pop r8 cc04: 7f 90 pop r7 cc06: 6f 90 pop r6 cc08: 5f 90 pop r5 cc0a: 4f 90 pop r4 cc0c: 3f 90 pop r3 cc0e: 2f 90 pop r2 cc10: 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); cc12: 60 91 8e 02 lds r22, 0x028E ; 0x80028e cc16: 70 91 8f 02 lds r23, 0x028F ; 0x80028f cc1a: 07 2e mov r0, r23 cc1c: 00 0c add r0, r0 cc1e: 88 0b sbc r24, r24 cc20: 99 0b sbc r25, r25 cc22: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> cc26: 20 91 7a 02 lds r18, 0x027A ; 0x80027a cc2a: 30 91 7b 02 lds r19, 0x027B ; 0x80027b cc2e: 40 91 7c 02 lds r20, 0x027C ; 0x80027c cc32: 50 91 7d 02 lds r21, 0x027D ; 0x80027d cc36: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> cc3a: 2e e3 ldi r18, 0x3E ; 62 cc3c: 33 ec ldi r19, 0xC3 ; 195 cc3e: 4e e2 ldi r20, 0x2E ; 46 cc40: 59 e3 ldi r21, 0x39 ; 57 cc42: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> cc46: 6f 83 std Y+7, r22 ; 0x07 cc48: 78 87 std Y+8, r23 ; 0x08 cc4a: 89 87 std Y+9, r24 ; 0x09 cc4c: 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) { cc4e: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cc52: 88 23 and r24, r24 cc54: 09 f4 brne .+2 ; 0xcc58 cc56: 0f c1 rjmp .+542 ; 0xce76 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]; cc58: a3 01 movw r20, r6 cc5a: 92 01 movw r18, r4 cc5c: c7 01 movw r24, r14 cc5e: b6 01 movw r22, r12 cc60: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cc64: 2b 01 movw r4, r22 cc66: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; cc68: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cc6c: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cc70: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb cc74: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc cc78: 60 91 97 06 lds r22, 0x0697 ; 0x800697 cc7c: 70 91 98 06 lds r23, 0x0698 ; 0x800698 cc80: 80 91 99 06 lds r24, 0x0699 ; 0x800699 cc84: 90 91 9a 06 lds r25, 0x069A ; 0x80069a cc88: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cc8c: 6b 87 std Y+11, r22 ; 0x0b cc8e: 7c 87 std Y+12, r23 ; 0x0c cc90: 8d 87 std Y+13, r24 ; 0x0d cc92: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); cc94: c3 01 movw r24, r6 cc96: b2 01 movw r22, r4 cc98: 9f 77 andi r25, 0x7F ; 127 cc9a: 2b 85 ldd r18, Y+11 ; 0x0b cc9c: 3c 85 ldd r19, Y+12 ; 0x0c cc9e: 4d 85 ldd r20, Y+13 ; 0x0d cca0: 5e 85 ldd r21, Y+14 ; 0x0e cca2: 5f 77 andi r21, 0x7F ; 127 cca4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> cca8: 6b 01 movw r12, r22 ccaa: 7c 01 movw r14, r24 if (len > 0) ccac: 20 e0 ldi r18, 0x00 ; 0 ccae: 30 e0 ldi r19, 0x00 ; 0 ccb0: a9 01 movw r20, r18 ccb2: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> ccb6: 18 16 cp r1, r24 ccb8: 0c f0 brlt .+2 ; 0xccbc ccba: dd c0 rjmp .+442 ; 0xce76 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); ccbc: 20 e0 ldi r18, 0x00 ; 0 ccbe: 30 e0 ldi r19, 0x00 ; 0 ccc0: 40 ef ldi r20, 0xF0 ; 240 ccc2: 51 e4 ldi r21, 0x41 ; 65 ccc4: c7 01 movw r24, r14 ccc6: b6 01 movw r22, r12 ccc8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> cccc: 0f 94 83 a2 call 0x34506 ; 0x34506 ccd0: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> ccd4: 7e 83 std Y+6, r23 ; 0x06 ccd6: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { ccd8: 62 30 cpi r22, 0x02 ; 2 ccda: 71 05 cpc r23, r1 ccdc: 08 f4 brcc .+2 ; 0xcce0 ccde: cb c0 rjmp .+406 ; 0xce76 cce0: 21 14 cp r2, r1 cce2: 31 04 cpc r3, r1 cce4: 09 f4 brne .+2 ; 0xcce8 cce6: c7 c0 rjmp .+398 ; 0xce76 float dz = z - current_position[Z_AXIS]; cce8: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd ccec: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe ccf0: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff ccf4: 50 91 00 12 lds r21, 0x1200 ; 0x801200 ccf8: 60 91 9b 06 lds r22, 0x069B ; 0x80069b ccfc: 70 91 9c 06 lds r23, 0x069C ; 0x80069c cd00: 80 91 9d 06 lds r24, 0x069D ; 0x80069d cd04: 90 91 9e 06 lds r25, 0x069E ; 0x80069e cd08: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cd0c: 6f 87 std Y+15, r22 ; 0x0f cd0e: 78 8b std Y+16, r23 ; 0x10 cd10: 89 8b std Y+17, r24 ; 0x11 cd12: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; cd14: 20 91 01 12 lds r18, 0x1201 ; 0x801201 cd18: 30 91 02 12 lds r19, 0x1202 ; 0x801202 cd1c: 40 91 03 12 lds r20, 0x1203 ; 0x801203 cd20: 50 91 04 12 lds r21, 0x1204 ; 0x801204 cd24: 60 91 9f 06 lds r22, 0x069F ; 0x80069f cd28: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 cd2c: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 cd30: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 cd34: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cd38: 6b 8b std Y+19, r22 ; 0x13 cd3a: 7c 8b std Y+20, r23 ; 0x14 cd3c: 8d 8b std Y+21, r24 ; 0x15 cd3e: 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); cd40: ad 81 ldd r26, Y+5 ; 0x05 cd42: be 81 ldd r27, Y+6 ; 0x06 cd44: cd 01 movw r24, r26 cd46: b0 e0 ldi r27, 0x00 ; 0 cd48: a0 e0 ldi r26, 0x00 ; 0 cd4a: 8f 8f std Y+31, r24 ; 0x1f cd4c: 98 a3 std Y+32, r25 ; 0x20 cd4e: a9 a3 std Y+33, r26 ; 0x21 cd50: 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) { cd52: 2d 81 ldd r18, Y+5 ; 0x05 cd54: 3e 81 ldd r19, Y+6 ; 0x06 cd56: 22 16 cp r2, r18 cd58: 33 06 cpc r3, r19 cd5a: 08 f0 brcs .+2 ; 0xcd5e cd5c: 8c c0 rjmp .+280 ; 0xce76 float t = float(i) / float(n_segments); cd5e: b1 01 movw r22, r2 cd60: 90 e0 ldi r25, 0x00 ; 0 cd62: 80 e0 ldi r24, 0x00 ; 0 cd64: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> cd68: 6b 01 movw r12, r22 cd6a: 7c 01 movw r14, r24 cd6c: 6f 8d ldd r22, Y+31 ; 0x1f cd6e: 78 a1 ldd r23, Y+32 ; 0x20 cd70: 89 a1 ldd r24, Y+33 ; 0x21 cd72: 9a a1 ldd r25, Y+34 ; 0x22 cd74: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> cd78: 9b 01 movw r18, r22 cd7a: ac 01 movw r20, r24 cd7c: c7 01 movw r24, r14 cd7e: b6 01 movw r22, r12 cd80: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> cd84: 6b 01 movw r12, r22 cd86: 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, cd88: ac 01 movw r20, r24 cd8a: 9b 01 movw r18, r22 cd8c: 6b 89 ldd r22, Y+19 ; 0x13 cd8e: 7c 89 ldd r23, Y+20 ; 0x14 cd90: 8d 89 ldd r24, Y+21 ; 0x15 cd92: 9e 89 ldd r25, Y+22 ; 0x16 cd94: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> cd98: 9b 01 movw r18, r22 cd9a: ac 01 movw r20, r24 cd9c: 60 91 01 12 lds r22, 0x1201 ; 0x801201 cda0: 70 91 02 12 lds r23, 0x1202 ; 0x801202 cda4: 80 91 03 12 lds r24, 0x1203 ; 0x801203 cda8: 90 91 04 12 lds r25, 0x1204 ; 0x801204 cdac: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> cdb0: 69 83 std Y+1, r22 ; 0x01 cdb2: 7a 83 std Y+2, r23 ; 0x02 cdb4: 8b 83 std Y+3, r24 ; 0x03 cdb6: 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, cdb8: a7 01 movw r20, r14 cdba: 96 01 movw r18, r12 cdbc: 6f 85 ldd r22, Y+15 ; 0x0f cdbe: 78 89 ldd r23, Y+16 ; 0x10 cdc0: 89 89 ldd r24, Y+17 ; 0x11 cdc2: 9a 89 ldd r25, Y+18 ; 0x12 cdc4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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, cdc8: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd cdcc: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe cdd0: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff cdd4: 50 91 00 12 lds r21, 0x1200 ; 0x801200 cdd8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> cddc: 6f 8b std Y+23, r22 ; 0x17 cdde: 78 8f std Y+24, r23 ; 0x18 cde0: 89 8f std Y+25, r24 ; 0x19 cde2: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, cde4: a7 01 movw r20, r14 cde6: 96 01 movw r18, r12 cde8: 6b 85 ldd r22, Y+11 ; 0x0b cdea: 7c 85 ldd r23, Y+12 ; 0x0c cdec: 8d 85 ldd r24, Y+13 ; 0x0d cdee: 9e 85 ldd r25, Y+14 ; 0x0e cdf0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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, cdf4: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cdf8: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cdfc: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb ce00: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc ce04: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> ce08: 6b 8f std Y+27, r22 ; 0x1b ce0a: 7c 8f std Y+28, r23 ; 0x1c ce0c: 8d 8f std Y+29, r24 ; 0x1d ce0e: 9e 8f std Y+30, r25 ; 0x1e ce10: a7 01 movw r20, r14 ce12: 96 01 movw r18, r12 ce14: c3 01 movw r24, r6 ce16: b2 01 movw r22, r4 ce18: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> ce1c: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 ce20: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 ce24: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 ce28: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 ce2c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> ce30: 3f 92 push r3 ce32: 2f 92 push r2 ce34: a5 ef ldi r26, 0xF5 ; 245 ce36: b1 e1 ldi r27, 0x11 ; 17 ce38: bf 93 push r27 ce3a: af 93 push r26 ce3c: 8f 80 ldd r8, Y+7 ; 0x07 ce3e: 98 84 ldd r9, Y+8 ; 0x08 ce40: a9 84 ldd r10, Y+9 ; 0x09 ce42: ba 84 ldd r11, Y+10 ; 0x0a ce44: de 01 movw r26, r28 ce46: 11 96 adiw r26, 0x01 ; 1 ce48: 6d 01 movw r12, r26 ce4a: ef 88 ldd r14, Y+23 ; 0x17 ce4c: f8 8c ldd r15, Y+24 ; 0x18 ce4e: 09 8d ldd r16, Y+25 ; 0x19 ce50: 1a 8d ldd r17, Y+26 ; 0x1a ce52: 2b 8d ldd r18, Y+27 ; 0x1b ce54: 3c 8d ldd r19, Y+28 ; 0x1c ce56: 4d 8d ldd r20, Y+29 ; 0x1d ce58: 5e 8d ldd r21, Y+30 ; 0x1e ce5a: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 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) ce5e: 0f 90 pop r0 ce60: 0f 90 pop r0 ce62: 0f 90 pop r0 ce64: 0f 90 pop r0 ce66: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac ce6a: 81 11 cpse r24, r1 ce6c: b7 ce rjmp .-658 ; 0xcbdc 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) { ce6e: bf ef ldi r27, 0xFF ; 255 ce70: 2b 1a sub r2, r27 ce72: 3b 0a sbc r3, r27 ce74: 6e cf rjmp .-292 ; 0xcd52 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); ce76: e0 90 9b 06 lds r14, 0x069B ; 0x80069b ce7a: f0 90 9c 06 lds r15, 0x069C ; 0x80069c ce7e: 00 91 9d 06 lds r16, 0x069D ; 0x80069d ce82: 10 91 9e 06 lds r17, 0x069E ; 0x80069e ce86: 20 91 97 06 lds r18, 0x0697 ; 0x800697 ce8a: 30 91 98 06 lds r19, 0x0698 ; 0x800698 ce8e: 40 91 99 06 lds r20, 0x0699 ; 0x800699 ce92: 50 91 9a 06 lds r21, 0x069A ; 0x80069a ce96: 60 91 93 06 lds r22, 0x0693 ; 0x800693 ce9a: 70 91 94 06 lds r23, 0x0694 ; 0x800694 ce9e: 80 91 95 06 lds r24, 0x0695 ; 0x800695 cea2: 90 91 96 06 lds r25, 0x0696 ; 0x800696 cea6: 1f 92 push r1 cea8: 1f 92 push r1 ceaa: e5 ef ldi r30, 0xF5 ; 245 ceac: f1 e1 ldi r31, 0x11 ; 17 ceae: ff 93 push r31 ceb0: ef 93 push r30 ceb2: 8f 80 ldd r8, Y+7 ; 0x07 ceb4: 98 84 ldd r9, Y+8 ; 0x08 ceb6: a9 84 ldd r10, Y+9 ; 0x09 ceb8: ba 84 ldd r11, Y+10 ; 0x0a ceba: ef e9 ldi r30, 0x9F ; 159 cebc: ce 2e mov r12, r30 cebe: e6 e0 ldi r30, 0x06 ; 6 cec0: de 2e mov r13, r30 cec2: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 cec6: 0f 90 pop r0 cec8: 0f 90 pop r0 ceca: 0f 90 pop r0 cecc: 0f 90 pop r0 cece: 86 ce rjmp .-756 ; 0xcbdc 0000ced0 : /// @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) { ced0: cf 92 push r12 ced2: df 92 push r13 ced4: ef 92 push r14 ced6: ff 92 push r15 ced8: cf 93 push r28 float travel_z = current_position[Z_AXIS]; ceda: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd cede: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cee2: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff cee6: f0 90 00 12 lds r15, 0x1200 ; 0x801200 // Prepare to move Z axis current_position[Z_AXIS] += delta; ceea: a7 01 movw r20, r14 ceec: 96 01 movw r18, r12 ceee: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> cef2: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cef6: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cefa: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff cefe: 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); cf02: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) cf04: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 cf08: 91 11 cpse r25, r1 cf0a: 02 c0 rjmp .+4 ; 0xcf10 cf0c: 84 ff sbrs r24, 4 cf0e: 26 c0 rjmp .+76 ; 0xcf5c { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); cf10: 85 ef ldi r24, 0xF5 ; 245 cf12: 91 e1 ldi r25, 0x11 ; 17 cf14: 0e 94 50 65 call 0xcaa0 ; 0xcaa0 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); cf18: 60 91 4e 04 lds r22, 0x044E ; 0x80044e cf1c: 70 91 4f 04 lds r23, 0x044F ; 0x80044f cf20: 80 91 50 04 lds r24, 0x0450 ; 0x800450 cf24: 90 91 51 04 lds r25, 0x0451 ; 0x800451 cf28: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); cf2c: 0f 94 14 22 call 0x24428 ; 0x24428 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; cf30: a7 01 movw r20, r14 cf32: 96 01 movw r18, r12 cf34: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd cf38: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe cf3c: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff cf40: 90 91 00 12 lds r25, 0x1200 ; 0x801200 cf44: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cf48: 6b 01 movw r12, r22 cf4a: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } cf4c: c7 01 movw r24, r14 cf4e: b6 01 movw r22, r12 cf50: cf 91 pop r28 cf52: ff 90 pop r15 cf54: ef 90 pop r14 cf56: df 90 pop r13 cf58: cf 90 pop r12 cf5a: 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(); cf5c: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); cf5e: 0f 94 14 22 call 0x24428 ; 0x24428 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); cf62: 81 e0 ldi r24, 0x01 ; 1 cf64: 0f 94 4c 2c call 0x25898 ; 0x25898 cf68: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); cf6a: 65 e5 ldi r22, 0x55 ; 85 cf6c: 75 e5 ldi r23, 0x55 ; 85 cf6e: 85 e5 ldi r24, 0x55 ; 85 cf70: 91 e4 ldi r25, 0x41 ; 65 cf72: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); cf76: 0f 94 14 22 call 0x24428 ; 0x24428 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; cf7a: 82 e0 ldi r24, 0x02 ; 2 cf7c: 0f 94 00 22 call 0x24400 ; 0x24400 cf80: a7 01 movw r20, r14 cf82: 96 01 movw r18, r12 cf84: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cf88: 6b 01 movw r12, r22 cf8a: 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); cf8c: 8c 2f mov r24, r28 cf8e: 0f 94 4c 2c call 0x25898 ; 0x25898 cf92: dc cf rjmp .-72 ; 0xcf4c 0000cf94 : // // 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) { cf94: 8f 92 push r8 cf96: 9f 92 push r9 cf98: af 92 push r10 cf9a: bf 92 push r11 cf9c: cf 92 push r12 cf9e: df 92 push r13 cfa0: ef 92 push r14 cfa2: ff 92 push r15 cfa4: 4b 01 movw r8, r22 cfa6: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) cfa8: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd cfac: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cfb0: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff cfb4: f0 90 00 12 lds r15, 0x1200 ; 0x801200 cfb8: ac 01 movw r20, r24 cfba: 9b 01 movw r18, r22 cfbc: c7 01 movw r24, r14 cfbe: b6 01 movw r22, r12 cfc0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> cfc4: 87 ff sbrs r24, 7 cfc6: 11 c0 rjmp .+34 ; 0xcfea return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); cfc8: a5 01 movw r20, r10 cfca: 94 01 movw r18, r8 cfcc: c7 01 movw r24, r14 cfce: b6 01 movw r22, r12 cfd0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> cfd4: 9f 77 andi r25, 0x7F ; 127 } 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 { 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)); cfe6: 0c 94 68 67 jmp 0xced0 ; 0xced0 } cfea: ff 90 pop r15 cfec: ef 90 pop r14 cfee: df 90 pop r13 cff0: cf 90 pop r12 cff2: bf 90 pop r11 cff4: af 90 pop r10 cff6: 9f 90 pop r9 cff8: 8f 90 pop r8 cffa: 08 95 ret 0000cffc : #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 { cffc: 2f 92 push r2 cffe: 3f 92 push r3 d000: 4f 92 push r4 d002: 5f 92 push r5 d004: 6f 92 push r6 d006: 7f 92 push r7 d008: 8f 92 push r8 d00a: 9f 92 push r9 d00c: af 92 push r10 d00e: bf 92 push r11 d010: cf 92 push r12 d012: df 92 push r13 d014: ef 92 push r14 d016: ff 92 push r15 d018: 0f 93 push r16 d01a: 1f 93 push r17 d01c: cf 93 push r28 d01e: df 93 push r29 d020: 00 d0 rcall .+0 ; 0xd022 d022: 1f 92 push r1 d024: 1f 92 push r1 d026: cd b7 in r28, 0x3d ; 61 d028: de b7 in r29, 0x3e ; 62 d02a: d8 2e mov r13, r24 d02c: 2a 01 movw r4, r20 d02e: 3b 01 movw r6, r22 d030: 32 2e mov r3, r18 d032: e9 82 std Y+1, r14 ; 0x01 d034: fa 82 std Y+2, r15 ; 0x02 d036: 0b 83 std Y+3, r16 ; 0x03 d038: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); d03a: 0f 94 14 22 call 0x24428 ; 0x24428 homing_flag = true; d03e: 81 e0 ldi r24, 0x01 ; 1 d040: 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; d044: fc 2c mov r15, r12 d046: e3 2c mov r14, r3 d048: d3 10 cpse r13, r3 d04a: 10 c0 rjmp .+32 ; 0xd06c d04c: ed 2c mov r14, r13 d04e: dc 10 cpse r13, r12 d050: 0d c0 rjmp .+26 ; 0xd06c // 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); d052: 60 e0 ldi r22, 0x00 ; 0 d054: 70 e0 ldi r23, 0x00 ; 0 d056: 80 ea ldi r24, 0xA0 ; 160 d058: 90 e4 ldi r25, 0x40 ; 64 d05a: 0e 94 ca 67 call 0xcf94 ; 0xcf94 // 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; d05e: ff 24 eor r15, r15 d060: f3 94 inc r15 d062: ee 24 eor r14, r14 d064: e3 94 inc r14 d066: 22 24 eor r2, r2 d068: 23 94 inc r2 d06a: 01 c0 rjmp .+2 ; 0xd06e 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; d06c: 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(); d06e: 0f 94 fd 8f call 0x31ffa ; 0x31ffa // 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; d072: 80 91 9c 12 lds r24, 0x129C ; 0x80129c d076: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; d078: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); d07c: 82 e0 ldi r24, 0x02 ; 2 d07e: 0f 94 00 22 call 0x24400 ; 0x24400 d082: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d086: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d08a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d08e: 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) d092: f1 10 cpse r15, r1 babystep_undo(); d094: 0f 94 ac 8b call 0x31758 ; 0x31758 int l_feedmultiply = setup_for_endstop_move(); d098: 81 e0 ldi r24, 0x01 ; 1 d09a: 0e 94 79 60 call 0xc0f2 ; 0xc0f2 d09e: 8c 01 movw r16, r24 set_destination_to_current(); d0a0: 0e 94 c1 61 call 0xc382 ; 0xc382 feedrate = 0.0; d0a4: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a d0a8: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b d0ac: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c d0b0: 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); d0b4: 22 20 and r2, r2 d0b6: 19 f0 breq .+6 ; 0xd0be d0b8: 80 e0 ldi r24, 0x00 ; 0 d0ba: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba if(home_y) homeaxis(Y_AXIS); d0be: ee 20 and r14, r14 d0c0: 19 f0 breq .+6 ; 0xd0c8 d0c2: 81 e0 ldi r24, 0x01 ; 1 d0c4: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba #endif //TMC2130 if(home_x_axis && home_x_value != 0) d0c8: dd 20 and r13, r13 d0ca: e9 f0 breq .+58 ; 0xd106 d0cc: 41 14 cp r4, r1 d0ce: 51 04 cpc r5, r1 d0d0: 61 04 cpc r6, r1 d0d2: 71 04 cpc r7, r1 d0d4: c1 f0 breq .+48 ; 0xd106 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; d0d6: c3 01 movw r24, r6 d0d8: b2 01 movw r22, r4 d0da: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> d0de: 9b 01 movw r18, r22 d0e0: ac 01 movw r20, r24 d0e2: 60 91 8a 04 lds r22, 0x048A ; 0x80048a d0e6: 70 91 8b 04 lds r23, 0x048B ; 0x80048b d0ea: 80 91 8c 04 lds r24, 0x048C ; 0x80048c d0ee: 90 91 8d 04 lds r25, 0x048D ; 0x80048d d0f2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> d0f6: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 d0fa: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 d0fe: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 d102: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if(home_y_axis && home_y_value != 0) d106: 33 20 and r3, r3 d108: 01 f1 breq .+64 ; 0xd14a d10a: 89 81 ldd r24, Y+1 ; 0x01 d10c: 9a 81 ldd r25, Y+2 ; 0x02 d10e: ab 81 ldd r26, Y+3 ; 0x03 d110: bc 81 ldd r27, Y+4 ; 0x04 d112: 00 97 sbiw r24, 0x00 ; 0 d114: a1 05 cpc r26, r1 d116: b1 05 cpc r27, r1 d118: c1 f0 breq .+48 ; 0xd14a current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; d11a: bc 01 movw r22, r24 d11c: cd 01 movw r24, r26 d11e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> d122: 9b 01 movw r18, r22 d124: ac 01 movw r20, r24 d126: 60 91 8e 04 lds r22, 0x048E ; 0x80048e d12a: 70 91 8f 04 lds r23, 0x048F ; 0x80048f d12e: 80 91 90 04 lds r24, 0x0490 ; 0x800490 d132: 90 91 91 04 lds r25, 0x0491 ; 0x800491 d136: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> d13a: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 d13e: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa d142: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb d146: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { d14a: ff 20 and r15, r15 d14c: 09 f4 brne .+2 ; 0xd150 d14e: 99 c0 rjmp .+306 ; 0xd282 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); d150: 60 e0 ldi r22, 0x00 ; 0 d152: 70 e0 ldi r23, 0x00 ; 0 d154: 80 ea ldi r24, 0xA0 ; 160 d156: 90 e4 ldi r25, 0x40 ; 64 d158: 0e 94 ca 67 call 0xcf94 ; 0xcf94 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); d15c: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 d160: 81 11 cpse r24, r1 d162: 02 c0 rjmp .+4 ; 0xd168 d164: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); d168: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 d16c: 81 11 cpse r24, r1 d16e: 03 c0 rjmp .+6 ; 0xd176 d170: 81 e0 ldi r24, 0x01 ; 1 d172: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); d176: 0f 94 62 90 call 0x320c4 ; 0x320c4 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); d17a: e3 e5 ldi r30, 0x53 ; 83 d17c: f9 e8 ldi r31, 0x89 ; 137 d17e: 85 91 lpm r24, Z+ d180: 95 91 lpm r25, Z+ d182: a5 91 lpm r26, Z+ d184: b4 91 lpm r27, Z d186: ef e4 ldi r30, 0x4F ; 79 d188: f9 e8 ldi r31, 0x89 ; 137 d18a: 45 91 lpm r20, Z+ d18c: 55 91 lpm r21, Z+ d18e: 65 91 lpm r22, Z+ d190: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d192: 40 93 93 06 sts 0x0693, r20 ; 0x800693 d196: 50 93 94 06 sts 0x0694, r21 ; 0x800694 d19a: 60 93 95 06 sts 0x0695, r22 ; 0x800695 d19e: 70 93 96 06 sts 0x0696, r23 ; 0x800696 out_y = y; d1a2: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d1a6: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d1aa: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d1ae: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a world2machine(out_x, out_y); d1b2: 67 e9 ldi r22, 0x97 ; 151 d1b4: 76 e0 ldi r23, 0x06 ; 6 d1b6: 83 e9 ldi r24, 0x93 ; 147 d1b8: 96 e0 ldi r25, 0x06 ; 6 d1ba: 0e 94 89 63 call 0xc712 ; 0xc712 world2machine_reset(); d1be: 0f 94 c4 8f call 0x31f88 ; 0x31f88 if (destination[Y_AXIS] < Y_MIN_POS) d1c2: 20 e0 ldi r18, 0x00 ; 0 d1c4: 30 e0 ldi r19, 0x00 ; 0 d1c6: 40 e8 ldi r20, 0x80 ; 128 d1c8: 50 ec ldi r21, 0xC0 ; 192 d1ca: 60 91 97 06 lds r22, 0x0697 ; 0x800697 d1ce: 70 91 98 06 lds r23, 0x0698 ; 0x800698 d1d2: 80 91 99 06 lds r24, 0x0699 ; 0x800699 d1d6: 90 91 9a 06 lds r25, 0x069A ; 0x80069a d1da: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> d1de: 87 ff sbrs r24, 7 d1e0: 0c c0 rjmp .+24 ; 0xd1fa destination[Y_AXIS] = Y_MIN_POS; d1e2: 80 e0 ldi r24, 0x00 ; 0 d1e4: 90 e0 ldi r25, 0x00 ; 0 d1e6: a0 e8 ldi r26, 0x80 ; 128 d1e8: b0 ec ldi r27, 0xC0 ; 192 d1ea: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d1ee: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d1f2: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d1f6: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a feedrate = homing_feedrate[X_AXIS] / 20; d1fa: 80 e0 ldi r24, 0x00 ; 0 d1fc: 90 e0 ldi r25, 0x00 ; 0 d1fe: a6 e1 ldi r26, 0x16 ; 22 d200: b3 e4 ldi r27, 0x43 ; 67 d202: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a d206: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b d20a: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c d20e: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d d212: 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(); d216: 0f 94 d1 83 call 0x307a2 ; 0x307a2 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); d21a: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d21e: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d222: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d226: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d22a: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); d22e: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[X_AXIS] = destination[X_AXIS]; d232: 80 91 93 06 lds r24, 0x0693 ; 0x800693 d236: 90 91 94 06 lds r25, 0x0694 ; 0x800694 d23a: a0 91 95 06 lds r26, 0x0695 ; 0x800695 d23e: b0 91 96 06 lds r27, 0x0696 ; 0x800696 d242: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 d246: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 d24a: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 d24e: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = destination[Y_AXIS]; d252: 80 91 97 06 lds r24, 0x0697 ; 0x800697 d256: 90 91 98 06 lds r25, 0x0698 ; 0x800698 d25a: a0 91 99 06 lds r26, 0x0699 ; 0x800699 d25e: b0 91 9a 06 lds r27, 0x069A ; 0x80069a d262: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 d266: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa d26a: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb d26e: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc d272: 81 e0 ldi r24, 0x01 ; 1 d274: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(true); endstops_hit_on_purpose(); d278: 0f 94 68 2c call 0x258d0 ; 0x258d0 homeaxis(Z_AXIS); d27c: 82 e0 ldi r24, 0x02 ; 2 d27e: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) d282: cc 20 and r12, r12 d284: e9 f0 breq .+58 ; 0xd2c0 d286: 81 14 cp r8, r1 d288: 91 04 cpc r9, r1 d28a: a1 04 cpc r10, r1 d28c: b1 04 cpc r11, r1 d28e: c1 f0 breq .+48 ; 0xd2c0 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; d290: c5 01 movw r24, r10 d292: b4 01 movw r22, r8 d294: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> d298: 9b 01 movw r18, r22 d29a: ac 01 movw r20, r24 d29c: 60 91 92 04 lds r22, 0x0492 ; 0x800492 d2a0: 70 91 93 04 lds r23, 0x0493 ; 0x800493 d2a4: 80 91 94 04 lds r24, 0x0494 ; 0x800494 d2a8: 90 91 95 04 lds r25, 0x0495 ; 0x800495 d2ac: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> d2b0: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d2b4: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d2b8: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d2bc: 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(); d2c0: 0f 94 d1 83 call 0x307a2 ; 0x307a2 clean_up_after_endstop_move(l_feedmultiply); d2c4: c8 01 movw r24, r16 d2c6: 0e 94 5f 60 call 0xc0be ; 0xc0be endstops_hit_on_purpose(); d2ca: 0f 94 68 2c call 0x258d0 ; 0x258d0 // Load the machine correction matrix world2machine_initialize(); d2ce: 0f 94 62 90 call 0x320c4 ; 0x320c4 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); d2d2: 0f 94 00 8e call 0x31c00 ; 0x31c00 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) d2d6: d1 10 cpse r13, r1 d2d8: 07 c0 rjmp .+14 ; 0xd2e8 d2da: 31 10 cpse r3, r1 d2dc: 05 c0 rjmp .+10 ; 0xd2e8 d2de: 8b 8d ldd r24, Y+27 ; 0x1b d2e0: 81 11 cpse r24, r1 d2e2: 02 c0 rjmp .+4 ; 0xd2e8 d2e4: cc 20 and r12, r12 d2e6: 39 f1 breq .+78 ; 0xd336 { if (! home_z && mbl_was_active) { d2e8: f1 10 cpse r15, r1 d2ea: 25 c0 rjmp .+74 ; 0xd336 d2ec: 9d 81 ldd r25, Y+5 ; 0x05 d2ee: 99 23 and r25, r25 d2f0: 11 f1 breq .+68 ; 0xd336 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; d2f2: 81 e0 ldi r24, 0x01 ; 1 d2f4: 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)); d2f8: 0f 94 00 22 call 0x24400 ; 0x24400 d2fc: 6b 01 movw r12, r22 d2fe: 7c 01 movw r14, r24 d300: 80 e0 ldi r24, 0x00 ; 0 d302: 0f 94 00 22 call 0x24400 ; 0x24400 d306: a7 01 movw r20, r14 d308: 96 01 movw r18, r12 d30a: 0f 94 a9 60 call 0x2c152 ; 0x2c152 d30e: 9b 01 movw r18, r22 d310: ac 01 movw r20, r24 d312: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd d316: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe d31a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff d31e: 90 91 00 12 lds r25, 0x1200 ; 0x801200 d322: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> d326: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d32a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d32e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d332: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } #endif prusa_statistics(20); d336: 84 e1 ldi r24, 0x14 ; 20 d338: 0f 94 a0 98 call 0x33140 ; 0x33140 st_synchronize(); d33c: 0f 94 14 22 call 0x24428 ; 0x24428 homing_flag = false; d340: 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 } d344: 0f 90 pop r0 d346: 0f 90 pop r0 d348: 0f 90 pop r0 d34a: 0f 90 pop r0 d34c: 0f 90 pop r0 d34e: df 91 pop r29 d350: cf 91 pop r28 d352: 1f 91 pop r17 d354: 0f 91 pop r16 d356: ff 90 pop r15 d358: ef 90 pop r14 d35a: df 90 pop r13 d35c: cf 90 pop r12 d35e: bf 90 pop r11 d360: af 90 pop r10 d362: 9f 90 pop r9 d364: 8f 90 pop r8 d366: 7f 90 pop r7 d368: 6f 90 pop r6 d36a: 5f 90 pop r5 d36c: 4f 90 pop r4 d36e: 3f 90 pop r3 d370: 2f 90 pop r2 d372: 08 95 ret 0000d374 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { d374: e3 e3 ldi r30, 0x33 ; 51 d376: 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; d378: 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]; d37a: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty d37c: 8f 37 cpi r24, 0x7F ; 127 d37e: 31 f0 breq .+12 ; 0xd38c d380: df 01 movw r26, r30 d382: 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 d384: 87 ff sbrs r24, 7 d386: 07 c0 rjmp .+14 ; 0xd396 lcd_custom_characters[i] = c & 0x7F; d388: 8f 77 andi r24, 0x7F ; 127 d38a: 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++) { d38c: 83 e0 ldi r24, 0x03 ; 3 d38e: eb 33 cpi r30, 0x3B ; 59 d390: f8 07 cpc r31, r24 d392: 99 f7 brne .-26 ; 0xd37a for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } d394: 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; d396: 9c 93 st X, r25 d398: f9 cf rjmp .-14 ; 0xd38c 0000d39a : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) d39a: 90 91 5b 02 lds r25, 0x025B ; 0x80025b d39e: 98 17 cp r25, r24 d3a0: 10 f4 brcc .+4 ; 0xd3a6 lcd_draw_update = lcdDrawUpdateOverride; d3a2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b if (!lcd_update_enabled) return; d3a6: 80 91 5c 02 lds r24, 0x025C ; 0x80025c d3aa: 88 23 and r24, r24 d3ac: 39 f0 breq .+14 ; 0xd3bc if (lcd_lcdupdate_func) d3ae: e0 91 d2 03 lds r30, 0x03D2 ; 0x8003d2 d3b2: f0 91 d3 03 lds r31, 0x03D3 ; 0x8003d3 d3b6: 30 97 sbiw r30, 0x00 ; 0 d3b8: 09 f0 breq .+2 ; 0xd3bc lcd_lcdupdate_func(); d3ba: 19 94 eijmp } d3bc: 08 95 ret 0000d3be : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { d3be: cf 93 push r28 d3c0: df 93 push r29 d3c2: cd b7 in r28, 0x3d ; 61 d3c4: de b7 in r29, 0x3e ; 62 d3c6: ae 01 movw r20, r28 d3c8: 4a 5f subi r20, 0xFA ; 250 d3ca: 5f 4f sbci r21, 0xFF ; 255 d3cc: fa 01 movw r30, r20 d3ce: 61 91 ld r22, Z+ d3d0: 71 91 ld r23, Z+ d3d2: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); d3d4: 80 ec ldi r24, 0xC0 ; 192 d3d6: 93 e0 ldi r25, 0x03 ; 3 d3d8: 0f 94 c4 9f call 0x33f88 ; 0x33f88 va_end(args); return ret; } d3dc: df 91 pop r29 d3de: cf 91 pop r28 d3e0: 08 95 ret 0000d3e2 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); d3e2: 60 ec ldi r22, 0xC0 ; 192 d3e4: 73 e0 ldi r23, 0x03 ; 3 d3e6: 0d 94 15 9f jmp 0x33e2a ; 0x33e2a 0000d3ea : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); d3ea: 60 ec ldi r22, 0xC0 ; 192 d3ec: 73 e0 ldi r23, 0x03 ; 3 d3ee: 08 2e mov r0, r24 d3f0: 00 0c add r0, r0 d3f2: 99 0b sbc r25, r25 d3f4: 0d 94 e5 9e jmp 0x33dca ; 0x33dca 0000d3f8 : va_end(args); return ret; } void lcd_space(uint8_t n) { d3f8: cf 93 push r28 d3fa: c8 2f mov r28, r24 while (n--) lcd_putc(' '); d3fc: c1 50 subi r28, 0x01 ; 1 d3fe: 20 f0 brcs .+8 ; 0xd408 d400: 80 e2 ldi r24, 0x20 ; 32 d402: 0e 94 f5 69 call 0xd3ea ; 0xd3ea d406: fa cf rjmp .-12 ; 0xd3fc } d408: cf 91 pop r28 d40a: 08 95 ret 0000d40c : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { d40c: cf 93 push r28 d40e: c8 2f mov r28, r24 d410: 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); d412: 64 30 cpi r22, 0x04 ; 4 d414: 08 f0 brcs .+2 ; 0xd418 d416: 83 e0 ldi r24, 0x03 ; 3 d418: 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); d41c: 0e 94 41 55 call 0xaa82 ; 0xaa82 d420: 8c 0f add r24, r28 lcd_ddram_address = addr; d422: 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); d426: 44 e6 ldi r20, 0x64 ; 100 d428: 50 e0 ldi r21, 0x00 ; 0 d42a: 60 e0 ldi r22, 0x00 ; 0 d42c: 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); } d42e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d430: 0c 94 8d 5d jmp 0xbb1a ; 0xbb1a 0000d434 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { d434: cf 93 push r28 d436: df 93 push r29 d438: ea 01 movw r28, r20 lcd_set_cursor(c, r); d43a: 0e 94 06 6a call 0xd40c ; 0xd40c return fputs_P(str, lcdout); d43e: 60 ec ldi r22, 0xC0 ; 192 d440: 73 e0 ldi r23, 0x03 ; 3 d442: ce 01 movw r24, r28 } d444: df 91 pop r29 d446: 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); d448: 0d 94 15 9f jmp 0x33e2a ; 0x33e2a 0000d44c : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { d44c: cf 93 push r28 d44e: c4 2f mov r28, r20 lcd_set_cursor(c, r); d450: 0e 94 06 6a call 0xd40c ; 0xd40c return fputc(ch, lcdout); d454: 60 ec ldi r22, 0xC0 ; 192 d456: 73 e0 ldi r23, 0x03 ; 3 d458: 8c 2f mov r24, r28 d45a: cc 0f add r28, r28 d45c: 99 0b sbc r25, r25 } d45e: 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); d460: 0d 94 e5 9e jmp 0x33dca ; 0x33dca 0000d464 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); d464: 60 e0 ldi r22, 0x00 ; 0 d466: 80 e0 ldi r24, 0x00 ; 0 d468: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_ddram_address = 0; d46c: 10 92 31 03 sts 0x0331, r1 ; 0x800331 } d470: 08 95 ret 0000d472 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d472: 40 e4 ldi r20, 0x40 ; 64 d474: 56 e0 ldi r21, 0x06 ; 6 d476: 60 e0 ldi r22, 0x00 ; 0 d478: 81 e0 ldi r24, 0x01 ; 1 d47a: 0e 94 8d 5d call 0xbb1a ; 0xbb1a // 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; d47e: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d482: 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)); d486: 48 e0 ldi r20, 0x08 ; 8 d488: 50 e0 ldi r21, 0x00 ; 0 d48a: 6f e7 ldi r22, 0x7F ; 127 d48c: 70 e0 ldi r23, 0x00 ; 0 d48e: 83 e3 ldi r24, 0x33 ; 51 d490: 93 e0 ldi r25, 0x03 ; 3 d492: 0d 94 af a6 jmp 0x34d5e ; 0x34d5e 0000d496 : } 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) d496: 90 91 5c 02 lds r25, 0x025C ; 0x80025c d49a: 98 17 cp r25, r24 d49c: 09 f1 breq .+66 ; 0xd4e0 { lcd_update_enabled = enabled; d49e: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c if (enabled) d4a2: 88 23 and r24, r24 d4a4: e9 f0 breq .+58 ; 0xd4e0 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; d4a6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 d4aa: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_encoder_diff = 0; d4ae: 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(); d4b2: 81 eb ldi r24, 0xB1 ; 177 d4b4: 93 e0 ldi r25, 0x03 ; 3 d4b6: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; d4ba: 0f 94 46 0f call 0x21e8c ; 0x21e8c d4be: 61 50 subi r22, 0x01 ; 1 d4c0: 71 09 sbc r23, r1 d4c2: 81 09 sbc r24, r1 d4c4: 91 09 sbc r25, r1 d4c6: 60 93 93 03 sts 0x0393, r22 ; 0x800393 d4ca: 70 93 94 03 sts 0x0394, r23 ; 0x800394 d4ce: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d4d2: 90 93 96 03 sts 0x0396, r25 ; 0x800396 // Full update. lcd_clear(); d4d6: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_update(2); d4da: 82 e0 ldi r24, 0x02 ; 2 d4dc: 0c 94 cd 69 jmp 0xd39a ; 0xd39a } else { // Clear the LCD always, or let it to the caller? } } } d4e0: 08 95 ret 0000d4e2 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { d4e2: cf 93 push r28 d4e4: c8 2f mov r28, r24 lcd_currline = 0; d4e6: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d4ea: 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)); d4ee: 48 e0 ldi r20, 0x08 ; 8 d4f0: 50 e0 ldi r21, 0x00 ; 0 d4f2: 6f e7 ldi r22, 0x7F ; 127 d4f4: 70 e0 ldi r23, 0x00 ; 0 d4f6: 83 e3 ldi r24, 0x33 ; 51 d4f8: 93 e0 ldi r25, 0x03 ; 3 d4fa: 0f 94 af a6 call 0x34d5e ; 0x34d5e 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 d4fe: 44 e9 ldi r20, 0x94 ; 148 d500: 51 e1 ldi r21, 0x11 ; 17 d502: 62 e0 ldi r22, 0x02 ; 2 d504: 80 e3 ldi r24, 0x30 ; 48 d506: 0e 94 8d 5d call 0xbb1a ; 0xbb1a // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d50a: 46 e9 ldi r20, 0x96 ; 150 d50c: 50 e0 ldi r21, 0x00 ; 0 d50e: 62 e0 ldi r22, 0x02 ; 2 d510: 80 e3 ldi r24, 0x30 ; 48 d512: 0e 94 8d 5d call 0xbb1a ; 0xbb1a // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d516: 46 e9 ldi r20, 0x96 ; 150 d518: 50 e0 ldi r21, 0x00 ; 0 d51a: 62 e0 ldi r22, 0x02 ; 2 d51c: 80 e3 ldi r24, 0x30 ; 48 d51e: 0e 94 8d 5d call 0xbb1a ; 0xbb1a #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); d522: 46 e9 ldi r20, 0x96 ; 150 d524: 50 e0 ldi r21, 0x00 ; 0 d526: 62 e0 ldi r22, 0x02 ; 2 d528: 80 e2 ldi r24, 0x20 ; 32 d52a: 0e 94 8d 5d call 0xbb1a ; 0xbb1a #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); d52e: 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); d532: 44 e6 ldi r20, 0x64 ; 100 d534: 50 e0 ldi r21, 0x00 ; 0 d536: 60 e0 ldi r22, 0x00 ; 0 d538: 80 62 ori r24, 0x20 ; 32 d53a: 0e 94 8d 5d call 0xbb1a ; 0xbb1a } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; d53e: 84 e0 ldi r24, 0x04 ; 4 d540: 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); d544: 44 e6 ldi r20, 0x64 ; 100 d546: 50 e0 ldi r21, 0x00 ; 0 d548: 60 e0 ldi r22, 0x00 ; 0 d54a: 8c e0 ldi r24, 0x0C ; 12 d54c: 0e 94 8d 5d call 0xbb1a ; 0xbb1a 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(); d550: c1 11 cpse r28, r1 d552: 0e 94 39 6a call 0xd472 ; 0xd472 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d556: 44 e6 ldi r20, 0x64 ; 100 d558: 50 e0 ldi r21, 0x00 ; 0 d55a: 60 e0 ldi r22, 0x00 ; 0 d55c: 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); } d55e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d560: 0c 94 8d 5d jmp 0xbb1a ; 0xbb1a 0000d564 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); d564: 81 e0 ldi r24, 0x01 ; 1 d566: 0c 94 71 6a jmp 0xd4e2 ; 0xd4e2 0000d56a : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { d56a: cf 92 push r12 d56c: df 92 push r13 d56e: ff 92 push r15 d570: 0f 93 push r16 d572: 1f 93 push r17 d574: cf 93 push r28 d576: df 93 push r29 d578: 00 d0 rcall .+0 ; 0xd57a d57a: 00 d0 rcall .+0 ; 0xd57c d57c: 1f 92 push r1 d57e: 1f 92 push r1 d580: cd b7 in r28, 0x3d ; 61 d582: de b7 in r29, 0x3e ; 62 if (value == '\n') { d584: 8a 30 cpi r24, 0x0A ; 10 d586: d9 f4 brne .+54 ; 0xd5be if (lcd_currline > 3) lcd_currline = -1; d588: 80 91 32 03 lds r24, 0x0332 ; 0x800332 d58c: 84 30 cpi r24, 0x04 ; 4 d58e: 18 f0 brcs .+6 ; 0xd596 d590: 8f ef ldi r24, 0xFF ; 255 d592: 80 93 32 03 sts 0x0332, r24 ; 0x800332 lcd_set_cursor(0, lcd_currline + 1); // LF d596: 60 91 32 03 lds r22, 0x0332 ; 0x800332 d59a: 6f 5f subi r22, 0xFF ; 255 d59c: 80 e0 ldi r24, 0x00 ; 0 d59e: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } d5a2: 28 96 adiw r28, 0x08 ; 8 d5a4: 0f b6 in r0, 0x3f ; 63 d5a6: f8 94 cli d5a8: de bf out 0x3e, r29 ; 62 d5aa: 0f be out 0x3f, r0 ; 63 d5ac: cd bf out 0x3d, r28 ; 61 d5ae: df 91 pop r29 d5b0: cf 91 pop r28 d5b2: 1f 91 pop r17 d5b4: 0f 91 pop r16 d5b6: ff 90 pop r15 d5b8: df 90 pop r13 d5ba: cf 90 pop r12 d5bc: 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))) { d5be: 90 e8 ldi r25, 0x80 ; 128 d5c0: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); d5c2: 44 e6 ldi r20, 0x64 ; 100 d5c4: 50 e0 ldi r21, 0x00 ; 0 d5c6: 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))) { d5c8: 9a 34 cpi r25, 0x4A ; 74 d5ca: 08 f5 brcc .+66 ; 0xd60e // 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. d5cc: 48 2f mov r20, r24 d5ce: 40 58 subi r20, 0x80 ; 128 d5d0: 55 0b sbc r21, r21 d5d2: 9a 01 movw r18, r20 d5d4: 96 e0 ldi r25, 0x06 ; 6 d5d6: 92 9f mul r25, r18 d5d8: a0 01 movw r20, r0 d5da: 93 9f mul r25, r19 d5dc: 50 0d add r21, r0 d5de: 11 24 eor r1, r1 d5e0: fa 01 movw r30, r20 d5e2: e4 5f subi r30, 0xF4 ; 244 d5e4: fa 48 sbci r31, 0x8A ; 138 d5e6: f4 90 lpm r15, Z d5e8: e3 e3 ldi r30, 0x33 ; 51 d5ea: f3 e0 ldi r31, 0x03 ; 3 d5ec: 30 e0 ldi r19, 0x00 ; 0 d5ee: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; d5f0: 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)) { d5f2: 61 91 ld r22, Z+ d5f4: 78 2f mov r23, r24 d5f6: 76 27 eor r23, r22 d5f8: 7f 77 andi r23, 0x7F ; 127 d5fa: 89 f4 brne .+34 ; 0xd61e lcd_custom_characters[i] = c; // mark the custom character as used d5fc: f9 01 movw r30, r18 d5fe: ed 5c subi r30, 0xCD ; 205 d600: fc 4f sbci r31, 0xFC ; 252 d602: 80 83 st Z, r24 d604: 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); d606: 44 e6 ldi r20, 0x64 ; 100 d608: 50 e0 ldi r21, 0x00 ; 0 d60a: 61 e0 ldi r22, 0x01 ; 1 d60c: 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); d60e: 0e 94 8d 5d call 0xbb1a ; 0xbb1a lcd_ddram_address++; // no need for preventing ddram overflow d612: 80 91 31 03 lds r24, 0x0331 ; 0x800331 d616: 8f 5f subi r24, 0xFF ; 255 d618: 80 93 31 03 sts 0x0331, r24 ; 0x800331 d61c: c2 cf rjmp .-124 ; 0xd5a2 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 d61e: 6f 37 cpi r22, 0x7F ; 127 d620: 09 f0 breq .+2 ; 0xd624 d622: 3c c0 rjmp .+120 ; 0xd69c lcd_custom_characters[i] = c; // mark the custom character as used d624: f9 01 movw r30, r18 d626: ed 5c subi r30, 0xCD ; 205 d628: fc 4f sbci r31, 0xFC ; 252 d62a: 80 83 st Z, r24 slotToUse = i; d62c: 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; d62e: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); d630: fa 01 movw r30, r20 d632: e9 5f subi r30, 0xF9 ; 249 d634: fa 48 sbci r31, 0x8A ; 138 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); d636: 8e 01 movw r16, r28 d638: 0f 5f subi r16, 0xFF ; 255 d63a: 1f 4f sbci r17, 0xFF ; 255 d63c: d8 01 movw r26, r16 d63e: 95 91 lpm r25, Z+ d640: 88 e0 ldi r24, 0x08 ; 8 d642: 18 2e mov r1, r24 0000d644 : d644: 10 fe sbrs r1, 0 d646: 05 90 lpm r0, Z+ d648: 02 94 swap r0 d64a: 80 2d mov r24, r0 d64c: 97 95 ror r25 d64e: 88 1f adc r24, r24 d650: 8d 93 st X+, r24 d652: 1a 94 dec r1 d654: b9 f7 brne .-18 ; 0xd644 lcd_command(LCD_SETCGRAMADDR | (location << 3)); d656: bf 2d mov r27, r15 d658: e8 e0 ldi r30, 0x08 ; 8 d65a: be 02 muls r27, r30 d65c: c0 01 movw r24, r0 d65e: 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); d660: 44 e6 ldi r20, 0x64 ; 100 d662: 50 e0 ldi r21, 0x00 ; 0 d664: 60 e0 ldi r22, 0x00 ; 0 d666: 80 64 ori r24, 0x40 ; 64 d668: 0e 94 8d 5d call 0xbb1a ; 0xbb1a d66c: 6e 01 movw r12, r28 d66e: f9 e0 ldi r31, 0x09 ; 9 d670: cf 0e add r12, r31 d672: 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); d674: 44 e6 ldi r20, 0x64 ; 100 d676: 50 e0 ldi r21, 0x00 ; 0 d678: 61 e0 ldi r22, 0x01 ; 1 d67a: d8 01 movw r26, r16 d67c: 8d 91 ld r24, X+ d67e: 8d 01 movw r16, r26 d680: 0e 94 8d 5d call 0xbb1a ; 0xbb1a : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { d684: c0 16 cp r12, r16 d686: d1 06 cpc r13, r17 d688: a9 f7 brne .-22 ; 0xd674 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address d68a: 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); d68e: 44 e6 ldi r20, 0x64 ; 100 d690: 50 e0 ldi r21, 0x00 ; 0 d692: 60 e0 ldi r22, 0x00 ; 0 d694: 80 68 ori r24, 0x80 ; 128 d696: 0e 94 8d 5d call 0xbb1a ; 0xbb1a d69a: b5 cf rjmp .-150 ; 0xd606 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 d69c: 67 ff sbrs r22, 7 slotToUse = i; d69e: 92 2f mov r25, r18 d6a0: 2f 5f subi r18, 0xFF ; 255 d6a2: 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++) { d6a4: 28 30 cpi r18, 0x08 ; 8 d6a6: 31 05 cpc r19, r1 d6a8: 09 f0 breq .+2 ; 0xd6ac d6aa: a3 cf rjmp .-186 ; 0xd5f2 } // 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) { d6ac: 9f 3f cpi r25, 0xFF ; 255 d6ae: 09 f0 breq .+2 ; 0xd6b2 d6b0: be cf rjmp .-132 ; 0xd62e d6b2: a9 cf rjmp .-174 ; 0xd606 0000d6b4 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { d6b4: 8f 92 push r8 d6b6: 9f 92 push r9 d6b8: af 92 push r10 d6ba: bf 92 push r11 d6bc: ef 92 push r14 d6be: ff 92 push r15 d6c0: 0f 93 push r16 d6c2: 1f 93 push r17 d6c4: cf 93 push r28 d6c6: df 93 push r29 d6c8: cd b7 in r28, 0x3d ; 61 d6ca: de b7 in r29, 0x3e ; 62 d6cc: a0 97 sbiw r28, 0x20 ; 32 d6ce: 0f b6 in r0, 0x3f ; 63 d6d0: f8 94 cli d6d2: de bf out 0x3e, r29 ; 62 d6d4: 0f be out 0x3f, r0 ; 63 d6d6: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) d6d8: 61 15 cp r22, r1 d6da: 71 05 cpc r23, r1 d6dc: 81 05 cpc r24, r1 d6de: 91 05 cpc r25, r1 d6e0: 99 f4 brne .+38 ; 0xd708 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d6e2: 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)); } d6e4: a0 96 adiw r28, 0x20 ; 32 d6e6: 0f b6 in r0, 0x3f ; 63 d6e8: f8 94 cli d6ea: de bf out 0x3e, r29 ; 62 d6ec: 0f be out 0x3f, r0 ; 63 d6ee: cd bf out 0x3d, r28 ; 61 d6f0: df 91 pop r29 d6f2: cf 91 pop r28 d6f4: 1f 91 pop r17 d6f6: 0f 91 pop r16 d6f8: ff 90 pop r15 d6fa: ef 90 pop r14 d6fc: bf 90 pop r11 d6fe: af 90 pop r10 d700: 9f 90 pop r9 d702: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d704: 0c 94 b5 6a jmp 0xd56a ; 0xd56a } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; d708: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d70a: 84 2e mov r8, r20 d70c: 91 2c mov r9, r1 d70e: b1 2c mov r11, r1 d710: a1 2c mov r10, r1 d712: 9e 01 movw r18, r28 d714: 2f 5f subi r18, 0xFF ; 255 d716: 3f 4f sbci r19, 0xFF ; 255 d718: 79 01 movw r14, r18 d71a: a5 01 movw r20, r10 d71c: 94 01 movw r18, r8 d71e: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> d722: f7 01 movw r30, r14 d724: e0 0f add r30, r16 d726: f1 1d adc r31, r1 d728: 60 83 st Z, r22 n /= base; d72a: b9 01 movw r22, r18 d72c: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d72e: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) d730: 61 15 cp r22, r1 d732: 71 05 cpc r23, r1 d734: 81 05 cpc r24, r1 d736: 91 05 cpc r25, r1 d738: 81 f7 brne .-32 ; 0xd71a d73a: 0e 0d add r16, r14 d73c: 1f 2d mov r17, r15 d73e: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) d740: e0 16 cp r14, r16 d742: f1 06 cpc r15, r17 d744: 59 f0 breq .+22 ; 0xd75c lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); d746: f8 01 movw r30, r16 d748: 82 91 ld r24, -Z d74a: 8f 01 movw r16, r30 d74c: 8a 30 cpi r24, 0x0A ; 10 d74e: 20 f4 brcc .+8 ; 0xd758 d750: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d752: 0e 94 b5 6a call 0xd56a ; 0xd56a d756: f4 cf rjmp .-24 ; 0xd740 { 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)); d758: 89 5c subi r24, 0xC9 ; 201 d75a: fb cf rjmp .-10 ; 0xd752 } d75c: a0 96 adiw r28, 0x20 ; 32 d75e: 0f b6 in r0, 0x3f ; 63 d760: f8 94 cli d762: de bf out 0x3e, r29 ; 62 d764: 0f be out 0x3f, r0 ; 63 d766: cd bf out 0x3d, r28 ; 61 d768: df 91 pop r29 d76a: cf 91 pop r28 d76c: 1f 91 pop r17 d76e: 0f 91 pop r16 d770: ff 90 pop r15 d772: ef 90 pop r14 d774: bf 90 pop r11 d776: af 90 pop r10 d778: 9f 90 pop r9 d77a: 8f 90 pop r8 d77c: 08 95 ret 0000d77e : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) d77e: cf 92 push r12 d780: df 92 push r13 d782: ef 92 push r14 d784: ff 92 push r15 d786: 6b 01 movw r12, r22 d788: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) d78a: f7 fe sbrs r15, 7 d78c: 0b c0 rjmp .+22 ; 0xd7a4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d78e: 8d e2 ldi r24, 0x2D ; 45 d790: 0e 94 b5 6a call 0xd56a ; 0xd56a else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; d794: f0 94 com r15 d796: e0 94 com r14 d798: d0 94 com r13 d79a: c0 94 com r12 d79c: c1 1c adc r12, r1 d79e: d1 1c adc r13, r1 d7a0: e1 1c adc r14, r1 d7a2: f1 1c adc r15, r1 } lcd_printNumber(n, 10); d7a4: 4a e0 ldi r20, 0x0A ; 10 d7a6: c7 01 movw r24, r14 d7a8: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } d7aa: ff 90 pop r15 d7ac: ef 90 pop r14 d7ae: df 90 pop r13 d7b0: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); d7b2: 0c 94 5a 6b jmp 0xd6b4 ; 0xd6b4 0000d7b6 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { d7b6: 0f 93 push r16 d7b8: 1f 93 push r17 d7ba: cf 93 push r28 d7bc: 8c 01 movw r16, r24 d7be: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { d7c0: cc 23 and r28, r28 d7c2: 59 f0 breq .+22 ; 0xd7da d7c4: f8 01 movw r30, r16 d7c6: 24 91 lpm r18, Z d7c8: 22 23 and r18, r18 d7ca: 39 f0 breq .+14 ; 0xd7da lcd_write(pgm_read_byte(s++)); d7cc: 0f 5f subi r16, 0xFF ; 255 d7ce: 1f 4f sbci r17, 0xFF ; 255 d7d0: 84 91 lpm r24, Z d7d2: 0e 94 b5 6a call 0xd56a ; 0xd56a --len; d7d6: c1 50 subi r28, 0x01 ; 1 d7d8: f3 cf rjmp .-26 ; 0xd7c0 } lcd_space(len); d7da: 8c 2f mov r24, r28 d7dc: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 return len; } d7e0: 8c 2f mov r24, r28 d7e2: cf 91 pop r28 d7e4: 1f 91 pop r17 d7e6: 0f 91 pop r16 d7e8: 08 95 ret 0000d7ea : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { d7ea: 0f 93 push r16 d7ec: 1f 93 push r17 d7ee: cf 93 push r28 d7f0: 8c 01 movw r16, r24 d7f2: c6 2f mov r28, r22 while (len && *s) { d7f4: cc 23 and r28, r28 d7f6: 49 f0 breq .+18 ; 0xd80a d7f8: f8 01 movw r30, r16 d7fa: 81 91 ld r24, Z+ d7fc: 8f 01 movw r16, r30 d7fe: 88 23 and r24, r24 d800: 21 f0 breq .+8 ; 0xd80a lcd_write(*(s++)); d802: 0e 94 b5 6a call 0xd56a ; 0xd56a --len; d806: c1 50 subi r28, 0x01 ; 1 d808: f5 cf rjmp .-22 ; 0xd7f4 } lcd_space(len); d80a: 8c 2f mov r24, r28 d80c: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 return len; } d810: 8c 2f mov r24, r28 d812: cf 91 pop r28 d814: 1f 91 pop r17 d816: 0f 91 pop r16 d818: 08 95 ret 0000d81a : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { d81a: cf 93 push r28 d81c: df 93 push r29 d81e: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); d820: 89 91 ld r24, Y+ d822: 88 23 and r24, r24 d824: 19 f0 breq .+6 ; 0xd82c d826: 0e 94 b5 6a call 0xd56a ; 0xd56a d82a: fa cf rjmp .-12 ; 0xd820 } d82c: df 91 pop r29 d82e: cf 91 pop r28 d830: 08 95 ret 0000d832 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); d832: 0e 94 b5 6a call 0xd56a ; 0xd56a return 0; } d836: 90 e0 ldi r25, 0x00 ; 0 d838: 80 e0 ldi r24, 0x00 ; 0 d83a: 08 95 ret 0000d83c : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; d83c: 10 92 63 03 sts 0x0363, r1 ; 0x800363 lcd_longpress_trigger = 0; d840: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } d844: 08 95 ret 0000d846 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { d846: cf 93 push r28 bool clicked = LCD_CLICKED; d848: 80 91 63 03 lds r24, 0x0363 ; 0x800363 d84c: c1 e0 ldi r28, 0x01 ; 1 d84e: 81 11 cpse r24, r1 d850: 04 c0 rjmp .+8 ; 0xd85a d852: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } d854: 8c 2f mov r24, r28 d856: cf 91 pop r28 d858: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); d85a: 0e 94 1e 6c call 0xd83c ; 0xd83c d85e: fa cf rjmp .-12 ; 0xd854 0000d860 : 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); d860: 8e ef ldi r24, 0xFE ; 254 d862: 9f e0 ldi r25, 0x0F ; 15 d864: 0f 94 7d a0 call 0x340fa ; 0x340fa return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); d868: 8e 3f cpi r24, 0xFE ; 254 d86a: 39 f0 breq .+14 ; 0xd87a d86c: 91 e0 ldi r25, 0x01 ; 1 d86e: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d872: 28 13 cpse r18, r24 d874: 90 e0 ldi r25, 0x00 ; 0 d876: 89 2f mov r24, r25 d878: 08 95 ret d87a: 80 e0 ldi r24, 0x00 ; 0 } d87c: 08 95 ret 0000d87e : return _n("??"); } void lang_reset(void) { lang_selected = 0; d87e: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); d882: 6e ef ldi r22, 0xFE ; 254 d884: 8e ef ldi r24, 0xFE ; 254 d886: 9f e0 ldi r25, 0x0F ; 15 d888: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0000d88c : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d88c: 85 37 cpi r24, 0x75 ; 117 d88e: 28 e6 ldi r18, 0x68 ; 104 d890: 92 07 cpc r25, r18 d892: 09 f4 brne .+2 ; 0xd896 d894: 59 c0 rjmp .+178 ; 0xd948 d896: f8 f4 brcc .+62 ; 0xd8d6 d898: 8e 36 cpi r24, 0x6E ; 110 d89a: 25 e6 ldi r18, 0x65 ; 101 d89c: 92 07 cpc r25, r18 d89e: 09 f4 brne .+2 ; 0xd8a2 d8a0: 59 c0 rjmp .+178 ; 0xd954 d8a2: 50 f4 brcc .+20 ; 0xd8b8 d8a4: 83 37 cpi r24, 0x73 ; 115 d8a6: 23 e6 ldi r18, 0x63 ; 99 d8a8: 92 07 cpc r25, r18 d8aa: b1 f1 breq .+108 ; 0xd918 d8ac: 85 36 cpi r24, 0x65 ; 101 d8ae: 94 46 sbci r25, 0x64 ; 100 d8b0: b1 f1 breq .+108 ; 0xd91e //#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("??"); d8b2: 84 e5 ldi r24, 0x54 ; 84 d8b4: 94 e6 ldi r25, 0x64 ; 100 d8b6: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8b8: 82 37 cpi r24, 0x72 ; 114 d8ba: 26 e6 ldi r18, 0x66 ; 102 d8bc: 92 07 cpc r25, r18 d8be: 91 f1 breq .+100 ; 0xd924 d8c0: 82 37 cpi r24, 0x72 ; 114 d8c2: 28 e6 ldi r18, 0x68 ; 104 d8c4: 92 07 cpc r25, r18 d8c6: 09 f4 brne .+2 ; 0xd8ca d8c8: 42 c0 rjmp .+132 ; 0xd94e d8ca: 83 37 cpi r24, 0x73 ; 115 d8cc: 95 46 sbci r25, 0x65 ; 101 d8ce: 89 f7 brne .-30 ; 0xd8b2 { 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"); d8d0: 8b ea ldi r24, 0xAB ; 171 d8d2: 94 e6 ldi r25, 0x64 ; 100 d8d4: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8d6: 8c 36 cpi r24, 0x6C ; 108 d8d8: 20 e7 ldi r18, 0x70 ; 112 d8da: 92 07 cpc r25, r18 d8dc: 31 f1 breq .+76 ; 0xd92a d8de: 70 f4 brcc .+28 ; 0xd8fc d8e0: 8c 36 cpi r24, 0x6C ; 108 d8e2: 2e e6 ldi r18, 0x6E ; 110 d8e4: 92 07 cpc r25, r18 d8e6: 21 f1 breq .+72 ; 0xd930 d8e8: 8f 36 cpi r24, 0x6F ; 111 d8ea: 2e e6 ldi r18, 0x6E ; 110 d8ec: 92 07 cpc r25, r18 d8ee: 31 f1 breq .+76 ; 0xd93c d8f0: 84 37 cpi r24, 0x74 ; 116 d8f2: 99 46 sbci r25, 0x69 ; 105 d8f4: f1 f6 brne .-68 ; 0xd8b2 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"); d8f6: 89 e9 ldi r24, 0x99 ; 153 d8f8: 94 e6 ldi r25, 0x64 ; 100 d8fa: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d8fc: 8b 36 cpi r24, 0x6B ; 107 d8fe: 23 e7 ldi r18, 0x73 ; 115 d900: 92 07 cpc r25, r18 d902: f9 f0 breq .+62 ; 0xd942 d904: 86 37 cpi r24, 0x76 ; 118 d906: 23 e7 ldi r18, 0x73 ; 115 d908: 92 07 cpc r25, r18 d90a: a9 f0 breq .+42 ; 0xd936 d90c: 8f 36 cpi r24, 0x6F ; 111 d90e: 92 47 sbci r25, 0x72 ; 114 d910: 81 f6 brne .-96 ; 0xd8b2 #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 d912: 87 e5 ldi r24, 0x57 ; 87 d914: 94 e6 ldi r25, 0x64 ; 100 d916: 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"); d918: 8b eb ldi r24, 0xBB ; 187 d91a: 94 e6 ldi r25, 0x64 ; 100 d91c: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); d91e: 83 eb ldi r24, 0xB3 ; 179 d920: 94 e6 ldi r25, 0x64 ; 100 d922: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); d924: 82 ea ldi r24, 0xA2 ; 162 d926: 94 e6 ldi r25, 0x64 ; 100 d928: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); d92a: 82 e9 ldi r24, 0x92 ; 146 d92c: 94 e6 ldi r25, 0x64 ; 100 d92e: 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 d930: 87 e8 ldi r24, 0x87 ; 135 d932: 94 e6 ldi r25, 0x64 ; 100 d934: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution d936: 8f e7 ldi r24, 0x7F ; 127 d938: 94 e6 ldi r25, 0x64 ; 100 d93a: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution d93c: 89 e7 ldi r24, 0x79 ; 121 d93e: 94 e6 ldi r25, 0x64 ; 100 d940: 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 d942: 8e e6 ldi r24, 0x6E ; 110 d944: 94 e6 ldi r25, 0x64 ; 100 d946: 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 d948: 87 e6 ldi r24, 0x67 ; 103 d94a: 94 e6 ldi r25, 0x64 ; 100 d94c: 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 d94e: 8e e5 ldi r24, 0x5E ; 94 d950: 94 e6 ldi r25, 0x64 ; 100 d952: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); d954: 83 ec ldi r24, 0xC3 ; 195 d956: 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("??"); } d958: 08 95 ret 0000d95a : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) d95a: e3 e0 ldi r30, 0x03 ; 3 d95c: f5 e7 ldi r31, 0x75 ; 117 d95e: 85 91 lpm r24, Z+ d960: 95 91 lpm r25, Z+ d962: a5 91 lpm r26, Z+ d964: b4 91 lpm r27, Z d966: 8f 3f cpi r24, 0xFF ; 255 d968: 9f 4f sbci r25, 0xFF ; 255 d96a: af 4f sbci r26, 0xFF ; 255 d96c: bf 4f sbci r27, 0xFF ; 255 d96e: b1 f0 breq .+44 ; 0xd99c 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; d970: 20 e0 ldi r18, 0x00 ; 0 d972: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) d974: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d976: f9 01 movw r30, r18 d978: 45 91 lpm r20, Z+ d97a: 55 91 lpm r21, Z+ d97c: 65 91 lpm r22, Z+ d97e: 74 91 lpm r23, Z d980: 45 3a cpi r20, 0xA5 ; 165 d982: 5a 45 sbci r21, 0x5A ; 90 d984: 64 4b sbci r22, 0xB4 ; 180 d986: 7b 44 sbci r23, 0x4B ; 75 d988: 09 f0 breq .+2 ; 0xd98c d98a: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); d98c: f9 01 movw r30, r18 d98e: 34 96 adiw r30, 0x04 ; 4 d990: 45 91 lpm r20, Z+ d992: 54 91 lpm r21, Z d994: 24 0f add r18, r20 d996: 35 1f adc r19, r21 count++; d998: 8f 5f subi r24, 0xFF ; 255 d99a: ed cf rjmp .-38 ; 0xd976 } 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 d99c: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } d99e: 08 95 ret 0000d9a0 : 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) { d9a0: 0f 93 push r16 d9a2: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language d9a4: 81 11 cpse r24, r1 d9a6: 13 c0 rjmp .+38 ; 0xd9ce { lang_table = 0; d9a8: 10 92 2e 03 sts 0x032E, r1 ; 0x80032e d9ac: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; d9b0: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) d9b4: 90 91 2f 03 lds r25, 0x032F ; 0x80032f d9b8: 98 13 cpse r25, r24 d9ba: 5c c0 rjmp .+184 ; 0xda74 d9bc: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); d9be: 8e ef ldi r24, 0xFE ; 254 d9c0: 9f e0 ldi r25, 0x0F ; 15 d9c2: 0f 94 a1 a0 call 0x34142 ; 0x34142 return 1; d9c6: 81 e0 ldi r24, 0x01 ; 1 } return 0; } d9c8: 1f 91 pop r17 d9ca: 0f 91 pop r16 d9cc: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) d9ce: 81 30 cpi r24, 0x01 ; 1 d9d0: 89 f7 brne .-30 ; 0xd9b4 { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d9d2: e0 e0 ldi r30, 0x00 ; 0 d9d4: f1 e0 ldi r31, 0x01 ; 1 d9d6: 45 91 lpm r20, Z+ d9d8: 55 91 lpm r21, Z+ d9da: 65 91 lpm r22, Z+ d9dc: 74 91 lpm r23, Z d9de: 45 3a cpi r20, 0xA5 ; 165 d9e0: 5a 45 sbci r21, 0x5A ; 90 d9e2: 64 4b sbci r22, 0xB4 ; 180 d9e4: 7b 44 sbci r23, 0x4B ; 75 d9e6: 31 f7 brne .-52 ; 0xd9b4 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); d9e8: e4 e0 ldi r30, 0x04 ; 4 d9ea: f1 e0 ldi r31, 0x01 ; 1 d9ec: a5 91 lpm r26, Z+ d9ee: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); d9f0: e8 e0 ldi r30, 0x08 ; 8 d9f2: f1 e0 ldi r31, 0x01 ; 1 d9f4: 65 91 lpm r22, Z+ d9f6: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) d9f8: 50 e0 ldi r21, 0x00 ; 0 d9fa: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; d9fc: 30 e0 ldi r19, 0x00 ; 0 d9fe: 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++) da00: a4 17 cp r26, r20 da02: b5 07 cpc r27, r21 da04: 29 f5 brne .+74 ; 0xda50 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum da06: 26 1b sub r18, r22 da08: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes da0a: 32 27 eor r19, r18 da0c: 23 27 eor r18, r19 da0e: 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)) da10: 62 17 cp r22, r18 da12: 73 07 cpc r23, r19 da14: 09 f0 breq .+2 ; 0xda18 da16: ce cf rjmp .-100 ; 0xd9b4 if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid da18: ec e0 ldi r30, 0x0C ; 12 da1a: f1 e0 ldi r31, 0x01 ; 1 da1c: 05 91 lpm r16, Z+ da1e: 15 91 lpm r17, Z+ da20: 25 91 lpm r18, Z+ da22: 34 91 lpm r19, Z da24: e3 e0 ldi r30, 0x03 ; 3 da26: f5 e7 ldi r31, 0x75 ; 117 da28: 45 91 lpm r20, Z+ da2a: 55 91 lpm r21, Z+ da2c: 65 91 lpm r22, Z+ da2e: 74 91 lpm r23, Z da30: 04 17 cp r16, r20 da32: 15 07 cpc r17, r21 da34: 26 07 cpc r18, r22 da36: 37 07 cpc r19, r23 da38: 09 f0 breq .+2 ; 0xda3c da3a: bc cf rjmp .-136 ; 0xd9b4 { lang_table = (lang_table_t*)table; // set table pointer da3c: 20 e0 ldi r18, 0x00 ; 0 da3e: 31 e0 ldi r19, 0x01 ; 1 da40: 30 93 2e 03 sts 0x032E, r19 ; 0x80032e da44: 20 93 2d 03 sts 0x032D, r18 ; 0x80032d lang_selected = lang; // set language id da48: 91 e0 ldi r25, 0x01 ; 1 da4a: 90 93 2f 03 sts 0x032F, r25 ; 0x80032f da4e: b2 cf rjmp .-156 ; 0xd9b4 { 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); da50: fa 01 movw r30, r20 da52: e0 50 subi r30, 0x00 ; 0 da54: ff 4f sbci r31, 0xFF ; 255 da56: e4 91 lpm r30, Z da58: f0 e0 ldi r31, 0x00 ; 0 da5a: 98 e0 ldi r25, 0x08 ; 8 da5c: 40 fd sbrc r20, 0 da5e: 90 e0 ldi r25, 0x00 ; 0 da60: 02 c0 rjmp .+4 ; 0xda66 da62: ee 0f add r30, r30 da64: ff 1f adc r31, r31 da66: 9a 95 dec r25 da68: e2 f7 brpl .-8 ; 0xda62 da6a: 2e 0f add r18, r30 da6c: 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++) da6e: 4f 5f subi r20, 0xFF ; 255 da70: 5f 4f sbci r21, 0xFF ; 255 da72: c6 cf rjmp .-116 ; 0xda00 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; da74: 80 e0 ldi r24, 0x00 ; 0 da76: a8 cf rjmp .-176 ; 0xd9c8 0000da78 : //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. da78: 20 91 2f 03 lds r18, 0x032F ; 0x80032f da7c: 21 11 cpse r18, r1 da7e: 04 c0 rjmp .+8 ; 0xda88 da80: fc 01 movw r30, r24 da82: 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 } da84: cf 01 movw r24, r30 da86: 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. da88: 40 91 2d 03 lds r20, 0x032D ; 0x80032d da8c: 50 91 2e 03 lds r21, 0x032E ; 0x80032e da90: 41 15 cp r20, r1 da92: 51 05 cpc r21, r1 da94: a9 f3 breq .-22 ; 0xda80 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id da96: fc 01 movw r30, r24 da98: 25 91 lpm r18, Z+ da9a: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. da9c: 2f 3f cpi r18, 0xFF ; 255 da9e: 32 07 cpc r19, r18 daa0: 79 f3 breq .-34 ; 0xda80 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset daa2: f9 01 movw r30, r18 daa4: 38 96 adiw r30, 0x08 ; 8 daa6: ee 0f add r30, r30 daa8: ff 1f adc r31, r31 daaa: e4 0f add r30, r20 daac: f5 1f adc r31, r21 daae: 25 91 lpm r18, Z+ dab0: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character dab2: fa 01 movw r30, r20 dab4: e2 0f add r30, r18 dab6: f3 1f adc r31, r19 dab8: 24 91 lpm r18, Z daba: 22 23 and r18, r18 dabc: 09 f3 breq .-62 ; 0xda80 dabe: e2 cf rjmp .-60 ; 0xda84 0000dac0 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { dac0: cf 93 push r28 dac2: df 93 push r29 dac4: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; dac6: 20 e0 ldi r18, 0x00 ; 0 dac8: 30 e0 ldi r19, 0x00 ; 0 daca: 4c e8 ldi r20, 0x8C ; 140 dacc: 52 e4 ldi r21, 0x42 ; 66 dace: 60 91 01 12 lds r22, 0x1201 ; 0x801201 dad2: 70 91 02 12 lds r23, 0x1202 ; 0x801202 dad6: 80 91 03 12 lds r24, 0x1203 ; 0x801203 dada: 90 91 04 12 lds r25, 0x1204 ; 0x801204 dade: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> dae2: 60 93 01 12 sts 0x1201, r22 ; 0x801201 dae6: 70 93 02 12 sts 0x1202, r23 ; 0x801202 daea: 80 93 03 12 sts 0x1203, r24 ; 0x801203 daee: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); daf2: 60 e0 ldi r22, 0x00 ; 0 daf4: 70 e0 ldi r23, 0x00 ; 0 daf6: 80 ea ldi r24, 0xA0 ; 160 daf8: 91 e4 ldi r25, 0x41 ; 65 dafa: 0f 94 11 85 call 0x30a22 ; 0x30a22 load_filament_final_feed(); dafe: 0e 94 00 5f call 0xbe00 ; 0xbe00 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); db02: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); db06: 84 ec ldi r24, 0xC4 ; 196 db08: 9a e5 ldi r25, 0x5A ; 90 db0a: 0e 94 3c 6d call 0xda78 ; 0xda78 db0e: ac 01 movw r20, r24 db10: 60 e0 ldi r22, 0x00 ; 0 db12: 80 e0 ldi r24, 0x00 ; 0 db14: 0e 94 1a 6a call 0xd434 ; 0xd434 if (filament_name[0]) { db18: 88 81 ld r24, Y db1a: 88 23 and r24, r24 db1c: 39 f0 breq .+14 ; 0xdb2c lcd_set_cursor(0, 1); db1e: 61 e0 ldi r22, 0x01 ; 1 db20: 80 e0 ldi r24, 0x00 ; 0 db22: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print(filament_name); db26: ce 01 movw r24, r28 db28: 0e 94 0d 6c call 0xd81a ; 0xd81a } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); db2c: 86 eb ldi r24, 0xB6 ; 182 db2e: 99 e3 ldi r25, 0x39 ; 57 db30: 0e 94 3c 6d call 0xda78 ; 0xda78 db34: ac 01 movw r20, r24 db36: 62 e0 ldi r22, 0x02 ; 2 db38: 80 e0 ldi r24, 0x00 ; 0 db3a: 0e 94 1a 6a call 0xd434 ; 0xd434 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 db3e: 83 e4 ldi r24, 0x43 ; 67 db40: 9b e2 ldi r25, 0x2B ; 43 db42: 0f 94 dd 0b call 0x217ba ; 0x217ba lcd_loading_filament(filament_name); st_synchronize(); } db46: df 91 pop r29 db48: 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(); db4a: 0d 94 14 22 jmp 0x24428 ; 0x24428 0000db4e : * 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; db4e: 0f 94 30 41 call 0x28260 ; 0x28260 db52: 8f 3f cpi r24, 0xFF ; 255 db54: 11 f1 breq .+68 ; 0xdb9a lcd_update_enable(false); db56: 80 e0 ldi r24, 0x00 ; 0 db58: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); db5c: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); db60: 80 e2 ldi r24, 0x20 ; 32 db62: 97 e5 ldi r25, 0x57 ; 87 db64: 0e 94 3c 6d call 0xda78 ; 0xda78 db68: ac 01 movw r20, r24 db6a: 61 e0 ldi r22, 0x01 ; 1 db6c: 80 e0 ldi r24, 0x00 ; 0 db6e: 0e 94 1a 6a call 0xd434 ; 0xd434 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); db72: 80 e2 ldi r24, 0x20 ; 32 db74: 0e 94 b5 6a call 0xd56a ; 0xd56a lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); db78: 0f 94 30 41 call 0x28260 ; 0x28260 db7c: 68 2f mov r22, r24 db7e: 70 e0 ldi r23, 0x00 ; 0 db80: 6f 5f subi r22, 0xFF ; 255 db82: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); db84: 07 2e mov r0, r23 db86: 00 0c add r0, r0 db88: 88 0b sbc r24, r24 db8a: 99 0b sbc r25, r25 db8c: 0e 94 bf 6b call 0xd77e ; 0xd77e // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); db90: 0f 94 34 6b call 0x2d668 ; 0x2d668 lcd_update_enable(true); db94: 81 e0 ldi r24, 0x01 ; 1 db96: 0c 94 4b 6a jmp 0xd496 ; 0xd496 } db9a: 08 95 ret 0000db9c <__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 { db9c: 1f 92 push r1 db9e: 0f 92 push r0 dba0: 0f b6 in r0, 0x3f ; 63 dba2: 0f 92 push r0 dba4: 11 24 eor r1, r1 dba6: 0b b6 in r0, 0x3b ; 59 dba8: 0f 92 push r0 dbaa: 2f 93 push r18 dbac: 8f 93 push r24 dbae: 9f 93 push r25 dbb0: ef 93 push r30 dbb2: ff 93 push r31 switch(state){ dbb4: e0 91 28 03 lds r30, 0x0328 ; 0x800328 dbb8: e8 30 cpi r30, 0x08 ; 8 dbba: e8 f4 brcc .+58 ; 0xdbf6 <__vector_23+0x5a> dbbc: f0 e0 ldi r31, 0x00 ; 0 dbbe: 88 27 eor r24, r24 dbc0: eb 51 subi r30, 0x1B ; 27 dbc2: f2 49 sbci r31, 0x92 ; 146 dbc4: 8f 4f sbci r24, 0xFF ; 255 dbc6: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> dbca: ed 6d ori r30, 0xDD ; 221 dbcc: 07 6e ori r16, 0xE7 ; 231 dbce: 12 6e ori r17, 0xE2 ; 226 dbd0: 20 6e ori r18, 0xE0 ; 224 dbd2: 36 6e ori r19, 0xE6 ; 230 dbd4: 3f 6e ori r19, 0xEF ; 239 dbd6: 62 6e ori r22, 0xE2 ; 226 dbd8: 74 6e ori r23, 0xE4 ; 228 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin dbda: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dbde: 81 11 cpse r24, r1 dbe0: 0a c0 rjmp .+20 ; 0xdbf6 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! dbe2: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dbe6: 88 0f add r24, r24 dbe8: 80 93 27 03 sts 0x0327, r24 ; 0x800327 if( pwm != 0 ){ dbec: 88 23 and r24, r24 dbee: 19 f0 breq .+6 ; 0xdbf6 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period dbf0: 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 dbf2: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } dbf6: ff 91 pop r31 dbf8: ef 91 pop r30 dbfa: 9f 91 pop r25 dbfc: 8f 91 pop r24 dbfe: 2f 91 pop r18 dc00: 0f 90 pop r0 dc02: 0b be out 0x3b, r0 ; 59 dc04: 0f 90 pop r0 dc06: 0f be out 0x3f, r0 ; 63 dc08: 0f 90 pop r0 dc0a: 1f 90 pop r1 dc0c: 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) dc0e: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dc12: 8f 5f subi r24, 0xFF ; 255 dc14: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter > pwm ){ dc18: 90 91 27 03 lds r25, 0x0327 ; 0x800327 dc1c: 98 17 cp r25, r24 dc1e: 58 f3 brcs .-42 ; 0xdbf6 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 dc20: 82 e0 ldi r24, 0x02 ; 2 dc22: e7 cf rjmp .-50 ; 0xdbf2 <__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 dc24: 83 e0 ldi r24, 0x03 ; 3 dc26: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE dc2a: 8f e0 ldi r24, 0x0F ; 15 dc2c: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle dc30: 8f ef ldi r24, 0xFF ; 255 dc32: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz dc34: 81 e0 ldi r24, 0x01 ; 1 dc36: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) dc38: 84 b5 in r24, 0x24 ; 36 dc3a: 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 dc3c: 84 bd out 0x24, r24 ; 36 dc3e: db cf rjmp .-74 ; 0xdbf6 <__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; dc40: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dc44: 82 95 swap r24 dc46: 80 7f andi r24, 0xF0 ; 240 dc48: 81 95 neg r24 dc4a: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ dc4c: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dc50: 88 23 and r24, r24 dc52: 21 f0 breq .+8 ; 0xdc5c <__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; dc54: 81 50 subi r24, 0x01 ; 1 dc56: 80 93 25 03 sts 0x0325, r24 ; 0x800325 dc5a: cd cf rjmp .-102 ; 0xdbf6 <__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; dc5c: 84 e0 ldi r24, 0x04 ; 4 dc5e: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty dc62: 8f ef ldi r24, 0xFF ; 255 dc64: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle dc66: 8e ef ldi r24, 0xFE ; 254 dc68: 86 bd out 0x26, r24 ; 38 dc6a: c5 cf rjmp .-118 ; 0xdbf6 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; dc6c: 85 e0 ldi r24, 0x05 ; 5 dc6e: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty dc72: 8f ef ldi r24, 0xFF ; 255 dc74: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle dc76: 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 dc78: 82 e0 ldi r24, 0x02 ; 2 dc7a: 85 bd out 0x25, r24 ; 37 dc7c: bc cf rjmp .-136 ; 0xdbf6 <__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; dc7e: 2f ef ldi r18, 0xFF ; 255 dc80: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin dc82: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dc86: 81 11 cpse r24, r1 dc88: b6 cf rjmp .-148 ; 0xdbf6 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less dc8a: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dc8e: 8f 5f subi r24, 0xFF ; 255 dc90: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter < pwm ){ dc94: 90 91 27 03 lds r25, 0x0327 ; 0x800327 dc98: 89 17 cp r24, r25 dc9a: 08 f4 brcc .+2 ; 0xdc9e <__vector_23+0x102> dc9c: ac cf rjmp .-168 ; 0xdbf6 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain dc9e: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dca2: 90 e0 ldi r25, 0x00 ; 0 dca4: 8f 37 cpi r24, 0x7F ; 127 dca6: 91 05 cpc r25, r1 dca8: 0c f0 brlt .+2 ; 0xdcac <__vector_23+0x110> dcaa: a5 cf rjmp .-182 ; 0xdbf6 <__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; dcac: 86 e0 ldi r24, 0x06 ; 6 dcae: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE dcb2: 8f e0 ldi r24, 0x0F ; 15 dcb4: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle dcb8: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz dcba: 81 e0 ldi r24, 0x01 ; 1 dcbc: 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 dcbe: 84 b5 in r24, 0x24 ; 36 dcc0: 80 61 ori r24, 0x10 ; 16 dcc2: bc cf rjmp .-136 ; 0xdc3c <__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 dcc4: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dcc8: 82 95 swap r24 dcca: 80 7f andi r24, 0xF0 ; 240 dccc: 81 95 neg r24 dcce: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ dcd0: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dcd4: 81 11 cpse r24, r1 dcd6: be cf rjmp .-132 ; 0xdc54 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; dcd8: 87 e0 ldi r24, 0x07 ; 7 dcda: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes dcde: 80 e8 ldi r24, 0x80 ; 128 dce0: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dce2: 8f ef ldi r24, 0xFF ; 255 dce4: 88 bd out 0x28, r24 ; 40 dce6: 87 cf rjmp .-242 ; 0xdbf6 <__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 dce8: 10 92 28 03 sts 0x0328, r1 ; 0x800328 TCNT0 = 128; dcec: 80 e8 ldi r24, 0x80 ; 128 dcee: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dcf0: 8f ef ldi r24, 0xFF ; 255 dcf2: 88 bd out 0x28, r24 ; 40 dcf4: c1 cf rjmp .-126 ; 0xdc78 <__vector_23+0xdc> 0000dcf6 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { dcf6: cf 93 push r28 dcf8: df 93 push r29 dcfa: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); dcfc: 87 e6 ldi r24, 0x67 ; 103 dcfe: 9f e0 ldi r25, 0x0F ; 15 dd00: 0f 94 7d a0 call 0x340fa ; 0x340fa dd04: 91 e0 ldi r25, 0x01 ; 1 dd06: 81 11 cpse r24, r1 dd08: 01 c0 rjmp .+2 ; 0xdd0c dd0a: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { dd0c: 81 e0 ldi r24, 0x01 ; 1 dd0e: 28 81 ld r18, Y dd10: 21 11 cpse r18, r1 dd12: 01 c0 rjmp .+2 ; 0xdd16 dd14: 80 e0 ldi r24, 0x00 ; 0 dd16: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; dd18: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); dd1a: 87 e0 ldi r24, 0x07 ; 7 dd1c: 9f e0 ldi r25, 0x0F ; 15 dd1e: 0f 94 7d a0 call 0x340fa ; 0x340fa dd22: 91 e0 ldi r25, 0x01 ; 1 dd24: 81 11 cpse r24, r1 dd26: 01 c0 rjmp .+2 ; 0xdd2a dd28: 90 e0 ldi r25, 0x00 ; 0 dd2a: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); dd2c: 85 ed ldi r24, 0xD5 ; 213 dd2e: 9e e0 ldi r25, 0x0E ; 14 dd30: 0f 94 7d a0 call 0x340fa ; 0x340fa dd34: 91 e0 ldi r25, 0x01 ; 1 dd36: 81 11 cpse r24, r1 dd38: 01 c0 rjmp .+2 ; 0xdd3c dd3a: 90 e0 ldi r25, 0x00 ; 0 dd3c: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); dd3e: 87 e4 ldi r24, 0x47 ; 71 dd40: 9d e0 ldi r25, 0x0D ; 13 dd42: 0f 94 7d a0 call 0x340fa ; 0x340fa if (sensorActionOnError == SensorActionOnError::_Undef) { dd46: 8f 3f cpi r24, 0xFF ; 255 dd48: 21 f0 breq .+8 ; 0xdd52 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); dd4a: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } dd4c: df 91 pop r29 dd4e: cf 91 pop r28 dd50: 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; dd52: 18 86 std Y+8, r1 ; 0x08 dd54: fb cf rjmp .-10 ; 0xdd4c 0000dd56 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { dd56: cf 93 push r28 dd58: c8 2f mov r28, r24 dd5a: 68 2f mov r22, r24 dd5c: 87 e6 ldi r24, 0x67 ; 103 dd5e: 9f e0 ldi r25, 0x0F ; 15 dd60: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { dd64: cc 23 and r28, r28 dd66: 19 f0 breq .+6 ; 0xdd6e fsensor.init(); } else { fsensor.deinit(); } } dd68: 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(); dd6a: 0d 94 dc 52 jmp 0x2a5b8 ; 0x2a5b8 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 dd6e: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup dd70: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; dd72: 10 92 84 16 sts 0x1684, r1 ; 0x801684 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } dd76: cf 91 pop r28 dd78: 08 95 ret 0000dd7a : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; dd7a: 10 92 84 03 sts 0x0384, r1 ; 0x800384 extruder_autofan_last_check = _millis(); dd7e: 0f 94 46 0f call 0x21e8c ; 0x21e8c dd82: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d dd86: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e dd8a: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f dd8e: 90 93 90 16 sts 0x1690, r25 ; 0x801690 } dd92: 08 95 ret 0000dd94 : 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; dd94: 80 93 24 03 sts 0x0324, r24 ; 0x800324 newFanSpeed = 0; if (fanState & 0x01) dd98: 80 fd sbrc r24, 0 dd9a: 1c c0 rjmp .+56 ; 0xddd4 { //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; dd9c: 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); dda0: 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) dda4: 8f ef ldi r24, 0xFF ; 255 dda6: 82 0f add r24, r18 dda8: 8e 3f cpi r24, 0xFE ; 254 ddaa: e8 f0 brcs .+58 ; 0xdde6 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); ddac: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ddb0: 87 7f andi r24, 0xF7 ; 247 ddb2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; ddb6: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ddba: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); ddbe: 9f b7 in r25, 0x3f ; 63 ddc0: 22 23 and r18, r18 ddc2: 61 f0 breq .+24 ; 0xdddc ddc4: f8 94 cli ddc6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ddca: 80 62 ori r24, 0x20 ; 32 ddcc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ddd0: 9f bf out 0x3f, r25 ; 63 ddd2: 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; ddd4: 8f ef ldi r24, 0xFF ; 255 ddd6: 80 93 40 03 sts 0x0340, r24 ; 0x800340 ddda: e2 cf rjmp .-60 ; 0xdda0 dddc: f8 94 cli ddde: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dde2: 8f 7d andi r24, 0xDF ; 223 dde4: f3 cf rjmp .-26 ; 0xddcc 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; dde6: ef b7 in r30, 0x3f ; 63 dde8: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ddea: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ddee: 88 60 ori r24, 0x08 ; 8 ddf0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ddf4: 30 e0 ldi r19, 0x00 ; 0 ddf6: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ddfa: 4f ef ldi r20, 0xFF ; 255 ddfc: 50 e0 ldi r21, 0x00 ; 0 ddfe: 81 ff sbrs r24, 1 de00: 04 c0 rjmp .+8 ; 0xde0a de02: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> de06: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> de0a: 24 9f mul r18, r20 de0c: c0 01 movw r24, r0 de0e: 25 9f mul r18, r21 de10: 90 0d add r25, r0 de12: 34 9f mul r19, r20 de14: 90 0d add r25, r0 de16: 11 24 eor r1, r1 de18: 6f ef ldi r22, 0xFF ; 255 de1a: 70 e0 ldi r23, 0x00 ; 0 de1c: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> de20: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> de24: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; de28: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } de2a: 08 95 ret 0000de2c : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { de2c: 1f 93 push r17 de2e: cf 93 push r28 de30: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) de32: d0 91 24 03 lds r29, 0x0324 ; 0x800324 de36: d1 fd sbrc r29, 1 de38: 1d c0 rjmp .+58 ; 0xde74 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; de3a: 10 91 9a 03 lds r17, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; de3e: c1 e0 ldi r28, 0x01 ; 1 de40: 20 e0 ldi r18, 0x00 ; 0 de42: 30 e0 ldi r19, 0x00 ; 0 de44: 48 e4 ldi r20, 0x48 ; 72 de46: 52 e4 ldi r21, 0x42 ; 66 de48: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 de4c: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 de50: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 de54: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 de58: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> de5c: 18 16 cp r1, r24 de5e: 0c f0 brlt .+2 ; 0xde62 de60: 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; de62: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; de64: cd 2b or r28, r29 de66: 81 e0 ldi r24, 0x01 ; 1 de68: 11 11 cpse r17, r1 de6a: 01 c0 rjmp .+2 ; 0xde6e de6c: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); de6e: c8 2b or r28, r24 de70: c0 93 24 03 sts 0x0324, r28 ; 0x800324 } setExtruderAutoFanState(fanState); de74: 80 91 24 03 lds r24, 0x0324 ; 0x800324 #endif } de78: df 91 pop r29 de7a: cf 91 pop r28 de7c: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); de7e: 0c 94 ca 6e jmp 0xdd94 ; 0xdd94 0000de82 : 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) { de82: ef 92 push r14 de84: ff 92 push r15 de86: 0f 93 push r16 de88: 1f 93 push r17 de8a: cf 93 push r28 de8c: df 93 push r29 de8e: ec 01 movw r28, r24 de90: 8b 01 movw r16, r22 de92: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) de94: 0e 94 9b 55 call 0xab36 ; 0xab36 de98: 81 11 cpse r24, r1 de9a: 0b c0 rjmp .+22 ; 0xdeb2 #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); de9c: a8 01 movw r20, r16 de9e: be 01 movw r22, r28 dea0: 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); } dea2: df 91 pop r29 dea4: cf 91 pop r28 dea6: 1f 91 pop r17 dea8: 0f 91 pop r16 deaa: ff 90 pop r15 deac: 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); deae: 0d 94 91 a0 jmp 0x34122 ; 0x34122 } 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); } deb2: df 91 pop r29 deb4: cf 91 pop r28 deb6: 1f 91 pop r17 deb8: 0f 91 pop r16 deba: ff 90 pop r15 debc: ef 90 pop r14 debe: 08 95 ret 0000dec0 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { dec0: 0f 93 push r16 dec2: 1f 93 push r17 dec4: cf 93 push r28 dec6: df 93 push r29 dec8: 8c 01 movw r16, r24 deca: d6 2f mov r29, r22 decc: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); dece: 0f 94 8b a0 call 0x34116 ; 0x34116 if (val == EEPROM_EMPTY_VALUE16) { ded2: 8f 3f cpi r24, 0xFF ; 255 ded4: 98 07 cpc r25, r24 ded6: 39 f4 brne .+14 ; 0xdee6 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); ded8: 6d 2f mov r22, r29 deda: 7c 2f mov r23, r28 dedc: c8 01 movw r24, r16 dede: 0f 94 db a0 call 0x341b6 ; 0x341b6 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; dee2: 8d 2f mov r24, r29 dee4: 9c 2f mov r25, r28 } return val; } dee6: df 91 pop r29 dee8: cf 91 pop r28 deea: 1f 91 pop r17 deec: 0f 91 pop r16 deee: 08 95 ret 0000def0 : 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) { def0: 0f 93 push r16 def2: 1f 93 push r17 def4: cf 93 push r28 def6: 8c 01 movw r16, r24 def8: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); defa: 0f 94 7d a0 call 0x340fa ; 0x340fa if (val == EEPROM_EMPTY_VALUE) { defe: 8f 3f cpi r24, 0xFF ; 255 df00: 29 f4 brne .+10 ; 0xdf0c 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); df02: 6c 2f mov r22, r28 df04: c8 01 movw r24, r16 df06: 0f 94 c5 a0 call 0x3418a ; 0x3418a 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; df0a: 8c 2f mov r24, r28 } return val; } df0c: cf 91 pop r28 df0e: 1f 91 pop r17 df10: 0f 91 pop r16 df12: 08 95 ret 0000df14 : 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) { df14: cf 93 push r28 df16: df 93 push r29 df18: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); df1a: 0f 94 8b a0 call 0x34116 ; 0x34116 df1e: bc 01 movw r22, r24 df20: 6f 5f subi r22, 0xFF ; 255 df22: 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); df24: 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); } df26: df 91 pop r29 df28: 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); df2a: 0d 94 db a0 jmp 0x341b6 ; 0x341b6 0000df2e : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { df2e: cf 93 push r28 df30: df 93 push r29 df32: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); df34: 0f 94 7d a0 call 0x340fa ; 0x340fa df38: 61 e0 ldi r22, 0x01 ; 1 df3a: 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); df3c: 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); } df3e: df 91 pop r29 df40: 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); df42: 0d 94 c5 a0 jmp 0x3418a ; 0x3418a 0000df46 : 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); df46: 2b e0 ldi r18, 0x0B ; 11 df48: 82 9f mul r24, r18 df4a: c0 01 movw r24, r0 df4c: 11 24 eor r1, r1 df4e: 80 5b subi r24, 0xB0 ; 176 df50: 92 4f sbci r25, 0xF2 ; 242 df52: 0f 94 8b a0 call 0x34116 ; 0x34116 df56: 21 e0 ldi r18, 0x01 ; 1 df58: 01 96 adiw r24, 0x01 ; 1 df5a: 09 f4 brne .+2 ; 0xdf5e df5c: 20 e0 ldi r18, 0x00 ; 0 } df5e: 82 2f mov r24, r18 df60: 08 95 ret 0000df62 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { df62: cf 93 push r28 df64: df 93 push r29 df66: c8 2f mov r28, r24 df68: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; df6a: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; df6c: c8 30 cpi r28, 0x08 ; 8 df6e: 0c f0 brlt .+2 ; 0xdf72 df70: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; df72: 8c 2f mov r24, r28 df74: 0e 94 a3 6f call 0xdf46 ; 0xdf46 df78: 81 11 cpse r24, r1 df7a: 03 c0 rjmp .+6 ; 0xdf82 df7c: 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) df7e: a9 f7 brne .-22 ; 0xdf6a { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; df80: cf ef ldi r28, 0xFF ; 255 } df82: 8c 2f mov r24, r28 df84: df 91 pop r29 df86: cf 91 pop r28 df88: 08 95 ret 0000df8a : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); df8a: 81 ea ldi r24, 0xA1 ; 161 df8c: 9d e0 ldi r25, 0x0D ; 13 df8e: 0f 94 7d a0 call 0x340fa ; 0x340fa sheet = eeprom_next_initialized_sheet(sheet); df92: 0e 94 b1 6f call 0xdf62 ; 0xdf62 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); df96: 87 fd sbrc r24, 7 df98: 05 c0 rjmp .+10 ; 0xdfa4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); df9a: 68 2f mov r22, r24 df9c: 81 ea ldi r24, 0xA1 ; 161 df9e: 9d e0 ldi r25, 0x0D ; 13 dfa0: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 { 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); } dfa4: 08 95 ret 0000dfa6 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { dfa6: 0f 93 push r16 dfa8: 1f 93 push r17 dfaa: cf 93 push r28 dfac: c8 2f mov r28, r24 dfae: 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")); dfb0: 66 eb ldi r22, 0xB6 ; 182 dfb2: 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) dfb4: 82 30 cpi r24, 0x02 ; 2 dfb6: 70 f0 brcs .+28 ; 0xdfd4 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); dfb8: 6f ea ldi r22, 0xAF ; 175 dfba: 74 e7 ldi r23, 0x74 ; 116 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) dfbc: 84 30 cpi r24, 0x04 ; 4 dfbe: 50 f0 brcs .+20 ; 0xdfd4 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); dfc0: 67 ea ldi r22, 0xA7 ; 167 dfc2: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) dfc4: 84 30 cpi r24, 0x04 ; 4 dfc6: 31 f0 breq .+12 ; 0xdfd4 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); dfc8: 6f e9 ldi r22, 0x9F ; 159 dfca: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) dfcc: 85 30 cpi r24, 0x05 ; 5 dfce: 11 f0 breq .+4 ; 0xdfd4 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); dfd0: 68 e9 ldi r22, 0x98 ; 152 dfd2: 74 e7 ldi r23, 0x74 ; 116 dfd4: c8 01 movw r24, r16 dfd6: 0f 94 34 9e call 0x33c68 ; 0x33c68 } if (index <4 || index >5) dfda: 8c ef ldi r24, 0xFC ; 252 dfdc: 8c 0f add r24, r28 dfde: 82 30 cpi r24, 0x02 ; 2 dfe0: 28 f0 brcs .+10 ; 0xdfec { sheetName.c[6] = '0' + ((index % 2)+1); dfe2: c1 70 andi r28, 0x01 ; 1 dfe4: cf 5c subi r28, 0xCF ; 207 dfe6: f8 01 movw r30, r16 dfe8: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; dfea: 17 82 std Z+7, r1 ; 0x07 } } dfec: cf 91 pop r28 dfee: 1f 91 pop r17 dff0: 0f 91 pop r16 dff2: 08 95 ret 0000dff4 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); dff4: 61 e0 ldi r22, 0x01 ; 1 dff6: 80 ec ldi r24, 0xC0 ; 192 dff8: 9f e0 ldi r25, 0x0F ; 15 dffa: 0f 94 a1 a0 call 0x34142 ; 0x34142 dffe: 60 e0 ldi r22, 0x00 ; 0 e000: 8f eb ldi r24, 0xBF ; 191 e002: 9f e0 ldi r25, 0x0F ; 15 e004: 0f 94 a1 a0 call 0x34142 ; 0x34142 e008: 60 e0 ldi r22, 0x00 ; 0 e00a: 8e eb ldi r24, 0xBE ; 190 e00c: 9f e0 ldi r25, 0x0F ; 15 e00e: 0f 94 a1 a0 call 0x34142 ; 0x34142 e012: 60 e0 ldi r22, 0x00 ; 0 e014: 8d eb ldi r24, 0xBD ; 189 e016: 9f e0 ldi r25, 0x0F ; 15 e018: 0f 94 a1 a0 call 0x34142 ; 0x34142 e01c: 60 e0 ldi r22, 0x00 ; 0 e01e: 8c eb ldi r24, 0xBC ; 188 e020: 9f e0 ldi r25, 0x0F ; 15 e022: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0000e026 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { e026: cf 93 push r28 e028: c8 2f mov r28, r24 print_hex_nibble(val >> 4); e02a: 82 95 swap r24 e02c: 8f 70 andi r24, 0x0F ; 15 e02e: 0e 94 51 5d call 0xbaa2 ; 0xbaa2 print_hex_nibble(val & 15); e032: 8c 2f mov r24, r28 e034: 8f 70 andi r24, 0x0F ; 15 } e036: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); e038: 0c 94 51 5d jmp 0xbaa2 ; 0xbaa2 0000e03c : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) e03c: 40 91 cf 11 lds r20, 0x11CF ; 0x8011cf e040: 50 91 d0 11 lds r21, 0x11D0 ; 0x8011d0 return 0; e044: 90 e0 ldi r25, 0x00 ; 0 e046: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) e048: 41 15 cp r20, r1 e04a: 51 05 cpc r21, r1 e04c: b1 f1 breq .+108 ; 0xe0ba char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { e04e: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb e052: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; e056: 90 e0 ldi r25, 0x00 ; 0 e058: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { e05a: f9 01 movw r30, r18 e05c: e2 52 subi r30, 0x22 ; 34 e05e: f0 4f sbci r31, 0xF0 ; 240 e060: a0 81 ld r26, Z e062: a2 30 cpi r26, 0x02 ; 2 e064: 21 f4 brne .+8 ; 0xe06e sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; e066: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; e068: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; e06a: 86 0f add r24, r22 e06c: 97 1f adc r25, r23 } if (-- _buflen == 0) e06e: 41 50 subi r20, 0x01 ; 1 e070: 51 09 sbc r21, r1 e072: 19 f1 breq .+70 ; 0xe0ba e074: f9 01 movw r30, r18 e076: ef 51 subi r30, 0x1F ; 31 e078: 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) ; e07a: a1 91 ld r26, Z+ e07c: 9f 01 movw r18, r30 e07e: 2e 5d subi r18, 0xDE ; 222 e080: 3f 40 sbci r19, 0x0F ; 15 e082: a1 11 cpse r26, r1 e084: fa cf rjmp .-12 ; 0xe07a e086: f9 01 movw r30, r18 e088: e2 52 subi r30, 0x22 ; 34 e08a: 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) ; e08c: 2d 3e cpi r18, 0xED ; 237 e08e: a1 e0 ldi r26, 0x01 ; 1 e090: 3a 07 cpc r19, r26 e092: 30 f4 brcc .+12 ; 0xe0a0 e094: a1 91 ld r26, Z+ e096: a1 11 cpse r26, r1 e098: e0 cf rjmp .-64 ; 0xe05a e09a: 2f 5f subi r18, 0xFF ; 255 e09c: 3f 4f sbci r19, 0xFF ; 255 e09e: f6 cf rjmp .-20 ; 0xe08c // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { e0a0: 2d 3e cpi r18, 0xED ; 237 e0a2: e1 e0 ldi r30, 0x01 ; 1 e0a4: 3e 07 cpc r19, r30 e0a6: c9 f6 brne .-78 ; 0xe05a e0a8: ee ed ldi r30, 0xDE ; 222 e0aa: ff e0 ldi r31, 0x0F ; 15 e0ac: 9f 01 movw r18, r30 e0ae: 2e 5d subi r18, 0xDE ; 222 e0b0: 3f 40 sbci r19, 0x0F ; 15 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; e0b2: a1 91 ld r26, Z+ e0b4: aa 23 and r26, r26 e0b6: d1 f3 breq .-12 ; 0xe0ac e0b8: d0 cf rjmp .-96 ; 0xe05a } } return sdlen; } e0ba: 08 95 ret 0000e0bc : // 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) { e0bc: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e0c0: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e0c4: 18 16 cp r1, r24 e0c6: 19 06 cpc r1, r25 e0c8: 0c f0 brlt .+2 ; 0xe0cc e0ca: 43 c0 rjmp .+134 ; 0xe152 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { e0cc: 01 97 sbiw r24, 0x01 ; 1 e0ce: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 e0d2: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf e0d6: 89 2b or r24, r25 e0d8: a1 f4 brne .+40 ; 0xe102 // Empty buffer. if (serial_count == 0) e0da: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda e0de: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb e0e2: 89 2b or r24, r25 e0e4: 21 f4 brne .+8 ; 0xe0ee // No serial communication is pending. Reset both pointers to zero. bufindw = 0; e0e6: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e0ea: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> bufindr = bufindw; e0ee: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> e0f2: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e0f6: 90 93 cc 11 sts 0x11CC, r25 ; 0x8011cc e0fa: 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; e0fe: 81 e0 ldi r24, 0x01 ; 1 e100: 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) ; e102: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb e106: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc e10a: 03 96 adiw r24, 0x03 ; 3 e10c: fc 01 movw r30, r24 e10e: e2 52 subi r30, 0x22 ; 34 e110: f0 4f sbci r31, 0xF0 ; 240 e112: 20 81 ld r18, Z e114: 01 96 adiw r24, 0x01 ; 1 e116: 21 11 cpse r18, r1 e118: f9 cf rjmp .-14 ; 0xe10c e11a: fc 01 movw r30, r24 e11c: e2 52 subi r30, 0x22 ; 34 e11e: 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) ; e120: 8d 3e cpi r24, 0xED ; 237 e122: 21 e0 ldi r18, 0x01 ; 1 e124: 92 07 cpc r25, r18 e126: 40 f4 brcc .+16 ; 0xe138 e128: 41 91 ld r20, Z+ e12a: 9c 01 movw r18, r24 e12c: 2f 5f subi r18, 0xFF ; 255 e12e: 3f 4f sbci r19, 0xFF ; 255 e130: 41 11 cpse r20, r1 e132: e1 cf rjmp .-62 ; 0xe0f6 e134: c9 01 movw r24, r18 e136: f4 cf rjmp .-24 ; 0xe120 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { e138: ee ed ldi r30, 0xDE ; 222 e13a: ff e0 ldi r31, 0x0F ; 15 e13c: 8d 3e cpi r24, 0xED ; 237 e13e: 21 e0 ldi r18, 0x01 ; 1 e140: 92 07 cpc r25, r18 e142: c9 f6 brne .-78 ; 0xe0f6 e144: cf 01 movw r24, r30 e146: 8e 5d subi r24, 0xDE ; 222 e148: 9f 40 sbci r25, 0x0F ; 15 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; e14a: 21 91 ld r18, Z+ e14c: 22 23 and r18, r18 e14e: d1 f3 breq .-12 ; 0xe144 e150: d2 cf rjmp .-92 ; 0xe0f6 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; e152: 80 e0 ldi r24, 0x00 ; 0 } e154: 08 95 ret 0000e156 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; e156: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) e158: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; e15a: 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; e15c: db 01 movw r26, r22 e15e: 4d 91 ld r20, X+ e160: bd 01 movw r22, r26 e162: 40 32 cpi r20, 0x20 ; 32 e164: 49 f0 breq .+18 ; 0xe178 if (i == 8) e166: 28 30 cpi r18, 0x08 ; 8 e168: 11 f4 brne .+4 ; 0xe16e { *pos++='.'; e16a: 30 83 st Z, r19 e16c: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; e16e: db 01 movw r26, r22 e170: 11 97 sbiw r26, 0x01 ; 1 e172: 4c 91 ld r20, X e174: 40 83 st Z, r20 e176: 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++) e178: 2f 5f subi r18, 0xFF ; 255 e17a: 2b 30 cpi r18, 0x0B ; 11 e17c: 79 f7 brne .-34 ; 0xe15c { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; e17e: 10 82 st Z, r1 return buffer; } e180: 08 95 ret 0000e182 : 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);} e182: 40 e0 ldi r20, 0x00 ; 0 e184: 50 e0 ldi r21, 0x00 ; 0 e186: ba 01 movw r22, r20 e188: 0d 94 db 38 jmp 0x271b6 ; 0x271b6 0000e18c : 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();} e18c: fc 01 movw r30, r24 e18e: 23 81 ldd r18, Z+3 ; 0x03 e190: 21 11 cpse r18, r1 e192: 0d 94 33 6f jmp 0x2de66 ; 0x2de66 e196: 08 95 ret 0000e198 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) e198: 90 91 04 05 lds r25, 0x0504 ; 0x800504 e19c: 91 11 cpse r25, r1 e19e: 07 c0 rjmp .+14 ; 0xe1ae { while (!((M_UCSRxA) & (1 << M_UDREx))); e1a0: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> e1a4: 95 ff sbrs r25, 5 e1a6: fc cf rjmp .-8 ; 0xe1a0 M_UDRx = c; e1a8: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> e1ac: 08 95 ret } else if (selectedSerialPort == 1) e1ae: 91 30 cpi r25, 0x01 ; 1 e1b0: 31 f4 brne .+12 ; 0xe1be { while (!((UCSR1A) & (1 << UDRE1))); e1b2: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> e1b6: 95 ff sbrs r25, 5 e1b8: fc cf rjmp .-8 ; 0xe1b2 UDR1 = c; e1ba: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } e1be: 08 95 ret 0000e1c0 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); e1c0: 0e 94 cc 70 call 0xe198 ; 0xe198 return 0; } e1c4: 90 e0 ldi r25, 0x00 ; 0 e1c6: 80 e0 ldi r24, 0x00 ; 0 e1c8: 08 95 ret 0000e1ca : 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) { e1ca: cf 93 push r28 e1cc: df 93 push r29 e1ce: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { e1d0: fe 01 movw r30, r28 e1d2: 84 91 lpm r24, Z e1d4: 88 23 and r24, r24 e1d6: 21 f0 breq .+8 ; 0xe1e0 MYSERIAL.write((char)ch); e1d8: 0e 94 cc 70 call 0xe198 ; 0xe198 ++str; e1dc: 21 96 adiw r28, 0x01 ; 1 e1de: f8 cf rjmp .-16 ; 0xe1d0 } } e1e0: df 91 pop r29 e1e2: cf 91 pop r28 e1e4: 08 95 ret 0000e1e6 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { e1e6: cf 92 push r12 e1e8: df 92 push r13 e1ea: ef 92 push r14 e1ec: 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]; e1ee: c0 90 c4 0d lds r12, 0x0DC4 ; 0x800dc4 e1f2: d0 90 c5 0d lds r13, 0x0DC5 ; 0x800dc5 e1f6: e0 90 c6 0d lds r14, 0x0DC6 ; 0x800dc6 e1fa: f0 90 c7 0d lds r15, 0x0DC7 ; 0x800dc7 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); e1fe: 89 e0 ldi r24, 0x09 ; 9 e200: 99 e7 ldi r25, 0x79 ; 121 e202: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e206: 42 e0 ldi r20, 0x02 ; 2 e208: c7 01 movw r24, r14 e20a: b6 01 movw r22, r12 e20c: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); e210: 81 e0 ldi r24, 0x01 ; 1 e212: 99 e7 ldi r25, 0x79 ; 121 e214: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e218: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e21c: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e220: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e224: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e228: 41 e0 ldi r20, 0x01 ; 1 e22a: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } e22e: ff 90 pop r15 e230: ef 90 pop r14 e232: df 90 pop r13 e234: 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(); e236: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 0000e23a : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { e23a: 4f 92 push r4 e23c: 5f 92 push r5 e23e: 6f 92 push r6 e240: 7f 92 push r7 e242: 8f 92 push r8 e244: 9f 92 push r9 e246: af 92 push r10 e248: bf 92 push r11 e24a: cf 92 push r12 e24c: df 92 push r13 e24e: ef 92 push r14 e250: ff 92 push r15 e252: 0f 93 push r16 e254: 1f 93 push r17 e256: cf 93 push r28 e258: df 93 push r29 e25a: cc 24 eor r12, r12 e25c: ca 94 dec r12 e25e: dc 2c mov r13, r12 e260: 76 01 movw r14, r12 e262: 0e ea ldi r16, 0xAE ; 174 e264: 1f e0 ldi r17, 0x0F ; 15 e266: 93 e2 ldi r25, 0x23 ; 35 e268: 89 2e mov r8, r25 e26a: 91 2c mov r9, r1 e26c: a1 2c mov r10, r1 e26e: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; e270: 41 2c mov r4, r1 e272: 51 2c mov r5, r1 e274: 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; e276: d0 e0 ldi r29, 0x00 ; 0 e278: 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) { e27a: 8f ef ldi r24, 0xFF ; 255 e27c: c8 16 cp r12, r24 e27e: 09 f4 brne .+2 ; 0xe282 e280: 5d c0 rjmp .+186 ; 0xe33c usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); e282: c8 01 movw r24, r16 e284: 0f 94 8b a0 call 0x34116 ; 0x34116 e288: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; e28a: bc 01 movw r22, r24 e28c: 99 0f add r25, r25 e28e: 88 0b sbc r24, r24 e290: 99 0b sbc r25, r25 e292: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e296: 20 91 3e 04 lds r18, 0x043E ; 0x80043e e29a: 30 91 3f 04 lds r19, 0x043F ; 0x80043f e29e: 40 91 40 04 lds r20, 0x0440 ; 0x800440 e2a2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 e2a6: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> e2aa: 2b 01 movw r4, r22 e2ac: 3c 01 movw r6, r24 e2ae: c7 01 movw r24, r14 e2b0: b6 01 movw r22, r12 e2b2: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); e2b6: 8d e5 ldi r24, 0x5D ; 93 e2b8: 98 e7 ldi r25, 0x78 ; 120 e2ba: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e2be: c5 01 movw r24, r10 e2c0: b4 01 movw r22, r8 e2c2: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); e2c6: 8d e5 ldi r24, 0x5D ; 93 e2c8: 98 e7 ldi r25, 0x78 ; 120 e2ca: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e2ce: be 01 movw r22, r28 e2d0: 0d 2e mov r0, r29 e2d2: 00 0c add r0, r0 e2d4: 88 0b sbc r24, r24 e2d6: 99 0b sbc r25, r25 e2d8: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); e2dc: 8d e5 ldi r24, 0x5D ; 93 e2de: 98 e7 ldi r25, 0x78 ; 120 e2e0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(mm * 1000); e2e4: 20 e0 ldi r18, 0x00 ; 0 e2e6: 30 e0 ldi r19, 0x00 ; 0 e2e8: 4a e7 ldi r20, 0x7A ; 122 e2ea: 54 e4 ldi r21, 0x44 ; 68 e2ec: c3 01 movw r24, r6 e2ee: b2 01 movw r22, r4 e2f0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> e2f4: 0f 94 2b 41 call 0x28256 ; 0x28256 e2f8: 85 e0 ldi r24, 0x05 ; 5 e2fa: 88 0e add r8, r24 e2fc: 91 1c adc r9, r1 e2fe: a1 1c adc r10, r1 e300: b1 1c adc r11, r1 e302: 0e 5f subi r16, 0xFE ; 254 e304: 1f 4f sbci r17, 0xFF ; 255 e306: 8f ef ldi r24, 0xFF ; 255 e308: c8 1a sub r12, r24 e30a: d8 0a sbc r13, r24 e30c: e8 0a sbc r14, r24 e30e: 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++) { e310: 0a 3b cpi r16, 0xBA ; 186 e312: 8f e0 ldi r24, 0x0F ; 15 e314: 18 07 cpc r17, r24 e316: 09 f0 breq .+2 ; 0xe31a e318: b0 cf rjmp .-160 ; 0xe27a SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } e31a: df 91 pop r29 e31c: cf 91 pop r28 e31e: 1f 91 pop r17 e320: 0f 91 pop r16 e322: ff 90 pop r15 e324: ef 90 pop r14 e326: df 90 pop r13 e328: cf 90 pop r12 e32a: bf 90 pop r11 e32c: af 90 pop r10 e32e: 9f 90 pop r9 e330: 8f 90 pop r8 e332: 7f 90 pop r7 e334: 6f 90 pop r6 e336: 5f 90 pop r5 e338: 4f 90 pop r4 e33a: 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); e33c: 8d ed ldi r24, 0xDD ; 221 e33e: 9d e3 ldi r25, 0x3D ; 61 e340: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e344: b8 cf rjmp .-144 ; 0xe2b6 0000e346 : /// @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) { e346: 88 23 and r24, r24 e348: 71 f1 breq .+92 ; 0xe3a6 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); e34a: 81 e5 ldi r24, 0x51 ; 81 e34c: 98 e7 ldi r25, 0x78 ; 120 e34e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e352: 60 91 23 12 lds r22, 0x1223 ; 0x801223 e356: 70 e0 ldi r23, 0x00 ; 0 e358: 90 e0 ldi r25, 0x00 ; 0 e35a: 80 e0 ldi r24, 0x00 ; 0 e35c: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; e360: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e364: 84 30 cpi r24, 0x04 ; 4 e366: d8 f0 brcs .+54 ; 0xe39e e368: 10 92 23 12 sts 0x1223, r1 ; 0x801223 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); e36c: 8c e4 ldi r24, 0x4C ; 76 e36e: 98 e7 ldi r25, 0x78 ; 120 e370: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN((int)currentMMUSlot); e374: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e378: 90 e0 ldi r25, 0x00 ; 0 e37a: 0f 94 48 41 call 0x28290 ; 0x28290 return currentMMUSlot; e37e: 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; e382: 20 91 ef 11 lds r18, 0x11EF ; 0x8011ef e386: 30 91 f0 11 lds r19, 0x11F0 ; 0x8011f0 e38a: 30 93 f2 11 sts 0x11F2, r19 ; 0x8011f2 e38e: 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); e392: 0e 94 cb f6 call 0x1ed96 ; 0x1ed96 load_filament_final_feed(); // @@TODO verify e396: 0e 94 00 5f call 0xbe00 ; 0xbe00 st_synchronize(); e39a: 0d 94 14 22 jmp 0x24428 ; 0x24428 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; e39e: 8f 5f subi r24, 0xFF ; 255 e3a0: 80 93 23 12 sts 0x1223, r24 ; 0x801223 e3a4: e3 cf rjmp .-58 ; 0xe36c 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); e3a6: 86 e8 ldi r24, 0x86 ; 134 e3a8: 9e e3 ldi r25, 0x3E ; 62 e3aa: 0e 94 3c 6d call 0xda78 ; 0xda78 e3ae: 70 e0 ldi r23, 0x00 ; 0 e3b0: 60 e0 ldi r22, 0x00 ; 0 e3b2: 0e 94 e5 bc call 0x179ca ; 0x179ca e3b6: e5 cf rjmp .-54 ; 0xe382 0000e3b8 : return final_result; } void gcode_M114() { e3b8: cf 93 push r28 e3ba: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); e3bc: 89 e4 ldi r24, 0x49 ; 73 e3be: 98 e7 ldi r25, 0x78 ; 120 e3c0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL(current_position[X_AXIS]); e3c4: c5 ef ldi r28, 0xF5 ; 245 e3c6: d1 e1 ldi r29, 0x11 ; 17 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e3c8: 68 81 ld r22, Y e3ca: 79 81 ldd r23, Y+1 ; 0x01 e3cc: 8a 81 ldd r24, Y+2 ; 0x02 e3ce: 9b 81 ldd r25, Y+3 ; 0x03 e3d0: 42 e0 ldi r20, 0x02 ; 2 e3d2: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" Y:"); e3d6: 85 e4 ldi r24, 0x45 ; 69 e3d8: 98 e7 ldi r25, 0x78 ; 120 e3da: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e3de: 6c 81 ldd r22, Y+4 ; 0x04 e3e0: 7d 81 ldd r23, Y+5 ; 0x05 e3e2: 8e 81 ldd r24, Y+6 ; 0x06 e3e4: 9f 81 ldd r25, Y+7 ; 0x07 e3e6: 42 e0 ldi r20, 0x02 ; 2 e3e8: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); e3ec: 81 e4 ldi r24, 0x41 ; 65 e3ee: 98 e7 ldi r25, 0x78 ; 120 e3f0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e3f4: 68 85 ldd r22, Y+8 ; 0x08 e3f6: 79 85 ldd r23, Y+9 ; 0x09 e3f8: 8a 85 ldd r24, Y+10 ; 0x0a e3fa: 9b 85 ldd r25, Y+11 ; 0x0b e3fc: 42 e0 ldi r20, 0x02 ; 2 e3fe: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); e402: 8d e3 ldi r24, 0x3D ; 61 e404: 98 e7 ldi r25, 0x78 ; 120 e406: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e40a: 6c 85 ldd r22, Y+12 ; 0x0c e40c: 7d 85 ldd r23, Y+13 ; 0x0d e40e: 8e 85 ldd r24, Y+14 ; 0x0e e410: 9f 85 ldd r25, Y+15 ; 0x0f e412: 42 e0 ldi r20, 0x02 ; 2 e414: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X e418: 8b ec ldi r24, 0xCB ; 203 e41a: 94 e6 ldi r25, 0x64 ; 100 e41c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); e420: 80 e0 ldi r24, 0x00 ; 0 e422: 0f 94 f2 21 call 0x243e4 ; 0x243e4 e426: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e42a: c2 e3 ldi r28, 0x32 ; 50 e42c: d4 e0 ldi r29, 0x04 ; 4 e42e: 2c 81 ldd r18, Y+4 ; 0x04 e430: 3d 81 ldd r19, Y+5 ; 0x05 e432: 4e 81 ldd r20, Y+6 ; 0x06 e434: 5f 81 ldd r21, Y+7 ; 0x07 e436: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> e43a: 42 e0 ldi r20, 0x02 ; 2 e43c: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" Y:"); e440: 89 e3 ldi r24, 0x39 ; 57 e442: 98 e7 ldi r25, 0x78 ; 120 e444: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); e448: 81 e0 ldi r24, 0x01 ; 1 e44a: 0f 94 f2 21 call 0x243e4 ; 0x243e4 e44e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e452: 28 85 ldd r18, Y+8 ; 0x08 e454: 39 85 ldd r19, Y+9 ; 0x09 e456: 4a 85 ldd r20, Y+10 ; 0x0a e458: 5b 85 ldd r21, Y+11 ; 0x0b e45a: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> e45e: 42 e0 ldi r20, 0x02 ; 2 e460: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" Z:"); e464: 85 e3 ldi r24, 0x35 ; 53 e466: 98 e7 ldi r25, 0x78 ; 120 e468: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); e46c: 82 e0 ldi r24, 0x02 ; 2 e46e: 0f 94 f2 21 call 0x243e4 ; 0x243e4 e472: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e476: 2c 85 ldd r18, Y+12 ; 0x0c e478: 3d 85 ldd r19, Y+13 ; 0x0d e47a: 4e 85 ldd r20, Y+14 ; 0x0e e47c: 5f 85 ldd r21, Y+15 ; 0x0f e47e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> e482: 42 e0 ldi r20, 0x02 ; 2 e484: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" E:"); e488: 81 e3 ldi r24, 0x31 ; 49 e48a: 98 e7 ldi r25, 0x78 ; 120 e48c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); e490: 83 e0 ldi r24, 0x03 ; 3 e492: 0f 94 f2 21 call 0x243e4 ; 0x243e4 e496: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e49a: 28 89 ldd r18, Y+16 ; 0x10 e49c: 39 89 ldd r19, Y+17 ; 0x11 e49e: 4a 89 ldd r20, Y+18 ; 0x12 e4a0: 5b 89 ldd r21, Y+19 ; 0x13 e4a2: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> } e4a6: df 91 pop r29 e4a8: 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]); e4aa: 0d 94 2b 41 jmp 0x28256 ; 0x28256 0000e4ae : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); e4ae: 80 e4 ldi r24, 0x40 ; 64 e4b0: 97 e7 ldi r25, 0x77 ; 119 e4b2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e4b6: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e4ba: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e4be: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e4c2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e4c6: 41 e0 ldi r20, 0x01 ; 1 e4c8: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e4cc: 8d e3 ldi r24, 0x3D ; 61 e4ce: 97 e7 ldi r25, 0x77 ; 119 e4d0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e4d4: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e4d8: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e4dc: 07 2e mov r0, r23 e4de: 00 0c add r0, r0 e4e0: 88 0b sbc r24, r24 e4e2: 99 0b sbc r25, r25 e4e4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e4e8: 41 e0 ldi r20, 0x01 ; 1 e4ea: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); e4ee: 89 e3 ldi r24, 0x39 ; 57 e4f0: 97 e7 ldi r25, 0x77 ; 119 e4f2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e4f6: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e4fa: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e4fe: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e502: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e506: 41 e0 ldi r20, 0x01 ; 1 e508: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); e50c: 86 e3 ldi r24, 0x36 ; 54 e50e: 97 e7 ldi r25, 0x77 ; 119 e510: 0e 94 e5 70 call 0xe1ca ; 0xe1ca }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; e514: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed e518: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee e51c: 07 2e mov r0, r23 e51e: 00 0c add r0, r0 e520: 88 0b sbc r24, r24 e522: 99 0b sbc r25, r25 e524: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e528: 41 e0 ldi r20, 0x01 ; 1 e52a: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); e52e: 81 e3 ldi r24, 0x31 ; 49 e530: 97 e7 ldi r25, 0x77 ; 119 e532: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e536: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e53a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e53e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e542: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e546: 41 e0 ldi r20, 0x01 ; 1 e548: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e54c: 8e e2 ldi r24, 0x2E ; 46 e54e: 97 e7 ldi r25, 0x77 ; 119 e550: 0e 94 e5 70 call 0xe1ca ; 0xe1ca return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e554: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e558: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e55c: 07 2e mov r0, r23 e55e: 00 0c add r0, r0 e560: 88 0b sbc r24, r24 e562: 99 0b sbc r25, r25 e564: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> e568: 41 e0 ldi r20, 0x01 ; 1 e56a: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); e56e: 8a e2 ldi r24, 0x2A ; 42 e570: 97 e7 ldi r25, 0x77 ; 119 e572: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e576: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> e57a: 70 e0 ldi r23, 0x00 ; 0 e57c: 90 e0 ldi r25, 0x00 ; 0 e57e: 80 e0 ldi r24, 0x00 ; 0 e580: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); e584: 85 e2 ldi r24, 0x25 ; 37 e586: 97 e7 ldi r25, 0x77 ; 119 e588: 0e 94 e5 70 call 0xe1ca ; 0xe1ca e58c: 60 91 5b 06 lds r22, 0x065B ; 0x80065b e590: 70 e0 ldi r23, 0x00 ; 0 e592: 90 e0 ldi r25, 0x00 ; 0 e594: 80 e0 ldi r24, 0x00 ; 0 e596: 0f 94 43 97 call 0x32e86 ; 0x32e86 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); e59a: 81 e2 ldi r24, 0x21 ; 33 e59c: 97 e7 ldi r25, 0x77 ; 119 e59e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e5a2: 60 91 8e 06 lds r22, 0x068E ; 0x80068e e5a6: 70 91 8f 06 lds r23, 0x068F ; 0x80068f e5aa: 80 91 90 06 lds r24, 0x0690 ; 0x800690 e5ae: 90 91 91 06 lds r25, 0x0691 ; 0x800691 e5b2: 41 e0 ldi r20, 0x01 ; 1 e5b4: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); e5b8: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 0000e5bc : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); e5bc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca MYSERIAL.println(); e5c0: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 0000e5c4 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { e5c4: 8f 92 push r8 e5c6: 9f 92 push r9 e5c8: af 92 push r10 e5ca: bf 92 push r11 e5cc: cf 92 push r12 e5ce: df 92 push r13 e5d0: ef 92 push r14 e5d2: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); e5d4: 0f 94 46 0f call 0x21e8c ; 0x21e8c e5d8: 6b 01 movw r12, r22 e5da: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { e5dc: 20 91 32 02 lds r18, 0x0232 ; 0x800232 e5e0: 22 23 and r18, r18 e5e2: 09 f1 breq .+66 ; 0xe626 e5e4: 40 91 78 02 lds r20, 0x0278 ; 0x800278 e5e8: 41 30 cpi r20, 0x01 ; 1 e5ea: e9 f0 breq .+58 ; 0xe626 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; e5ec: 80 91 14 02 lds r24, 0x0214 ; 0x800214 e5f0: 90 91 15 02 lds r25, 0x0215 ; 0x800215 e5f4: a0 91 16 02 lds r26, 0x0216 ; 0x800216 e5f8: b0 91 17 02 lds r27, 0x0217 ; 0x800217 e5fc: 46 01 movw r8, r12 e5fe: 57 01 movw r10, r14 e600: 88 1a sub r8, r24 e602: 99 0a sbc r9, r25 e604: aa 0a sbc r10, r26 e606: bb 0a sbc r11, r27 e608: 30 e0 ldi r19, 0x00 ; 0 e60a: a8 ee ldi r26, 0xE8 ; 232 e60c: b3 e0 ldi r27, 0x03 ; 3 e60e: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> e612: 86 16 cp r8, r22 e614: 97 06 cpc r9, r23 e616: a8 06 cpc r10, r24 e618: b9 06 cpc r11, r25 e61a: 6c f0 brlt .+26 ; 0xe636 switch (busy_state) { e61c: 44 30 cpi r20, 0x04 ; 4 e61e: 31 f1 breq .+76 ; 0xe66c e620: 9c f4 brge .+38 ; 0xe648 e622: 42 30 cpi r20, 0x02 ; 2 e624: d4 f4 brge .+52 ; 0xe65a break; default: break; } } prev_busy_signal_ms = ms; e626: c0 92 14 02 sts 0x0214, r12 ; 0x800214 e62a: d0 92 15 02 sts 0x0215, r13 ; 0x800215 e62e: e0 92 16 02 sts 0x0216, r14 ; 0x800216 e632: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } e636: ff 90 pop r15 e638: ef 90 pop r14 e63a: df 90 pop r13 e63c: cf 90 pop r12 e63e: bf 90 pop r11 e640: af 90 pop r10 e642: 9f 90 pop r9 e644: 8f 90 pop r8 e646: 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) { e648: 45 30 cpi r20, 0x05 ; 5 e64a: 69 f7 brne .-38 ; 0xe626 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; e64c: 87 e7 ldi r24, 0x77 ; 119 e64e: 9e e9 ldi r25, 0x9E ; 158 e650: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("busy: paused for input"); e654: 8c e0 ldi r24, 0x0C ; 12 e656: 99 e7 ldi r25, 0x79 ; 121 e658: 06 c0 rjmp .+12 ; 0xe666 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; e65a: 87 e7 ldi r24, 0x77 ; 119 e65c: 9e e9 ldi r25, 0x9E ; 158 e65e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("busy: processing"); e662: 89 e3 ldi r24, 0x39 ; 57 e664: 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"); e666: 0e 94 de 72 call 0xe5bc ; 0xe5bc e66a: dd cf rjmp .-70 ; 0xe626 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; e66c: 87 e7 ldi r24, 0x77 ; 119 e66e: 9e e9 ldi r25, 0x9E ; 158 e670: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("busy: paused for user"); e674: 83 e2 ldi r24, 0x23 ; 35 e676: 99 e7 ldi r25, 0x79 ; 121 e678: f6 cf rjmp .-20 ; 0xe666 0000e67a : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { e67a: 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))); e67c: 81 ea ldi r24, 0xA1 ; 161 e67e: 9d e0 ldi r25, 0x0D ; 13 e680: 0f 94 7d a0 call 0x340fa ; 0x340fa } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> e684: cb e0 ldi r28, 0x0B ; 11 e686: 8c 9f mul r24, r28 e688: c0 01 movw r24, r0 e68a: 11 24 eor r1, r1 e68c: 80 5b subi r24, 0xB0 ; 176 e68e: 92 4f sbci r25, 0xF2 ; 242 e690: 0f 94 8b a0 call 0x34116 ; 0x34116 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { e694: 81 56 subi r24, 0x61 ; 97 e696: 90 4f sbci r25, 0xF0 ; 240 e698: 80 3a cpi r24, 0xA0 ; 160 e69a: 9f 40 sbci r25, 0x0F ; 15 e69c: c8 f0 brcs .+50 ; 0xe6d0 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"); e69e: 88 ed ldi r24, 0xD8 ; 216 e6a0: 98 e7 ldi r25, 0x78 ; 120 e6a2: 0e 94 de 72 call 0xe5bc ; 0xe5bc eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), e6a6: 81 ea ldi r24, 0xA1 ; 161 e6a8: 9d e0 ldi r25, 0x0D ; 13 e6aa: 0f 94 7d a0 call 0x340fa ; 0x340fa 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-> e6ae: 8c 9f mul r24, r28 e6b0: c0 01 movw r24, r0 e6b2: 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); e6b4: 70 e0 ldi r23, 0x00 ; 0 e6b6: 60 e0 ldi r22, 0x00 ; 0 e6b8: 80 5b subi r24, 0xB0 ; 176 e6ba: 92 4f sbci r25, 0xF2 ; 242 e6bc: 0f 94 db a0 call 0x341b6 ; 0x341b6 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.")); e6c0: 8b e9 ldi r24, 0x9B ; 155 e6c2: 98 e7 ldi r25, 0x78 ; 120 e6c4: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_update_enable(true); e6c8: 81 e0 ldi r24, 0x01 ; 1 } } e6ca: 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); e6cc: 0c 94 4b 6a jmp 0xd496 ; 0xd496 } } e6d0: cf 91 pop r28 e6d2: 08 95 ret 0000e6d4 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { e6d4: ec 01 movw r28, r24 cli(); // Stop interrupts e6d6: f8 94 cli disable_heater(); e6d8: 0f 94 31 12 call 0x22462 ; 0x22462 disable_x(); e6dc: 17 9a sbi 0x02, 7 ; 2 e6de: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); e6e2: 16 9a sbi 0x02, 6 ; 2 e6e4: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 poweroff_z(); disable_e0(); e6e8: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; e6ea: 8a e5 ldi r24, 0x5A ; 90 e6ec: 9e e9 ldi r25, 0x9E ; 158 e6ee: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); e6f2: 8c e7 ldi r24, 0x7C ; 124 e6f4: 98 e7 ldi r25, 0x78 ; 120 e6f6: 0e 94 de 72 call 0xe5bc ; 0xe5bc if (full_screen_message != NULL) { e6fa: 20 97 sbiw r28, 0x00 ; 0 e6fc: 79 f0 breq .+30 ; 0xe71c SERIAL_ERRORLNRPGM(full_screen_message); e6fe: ce 01 movw r24, r28 e700: 0e 94 de 72 call 0xe5bc ; 0xe5bc e704: be 01 movw r22, r28 e706: 85 e9 ldi r24, 0x95 ; 149 e708: 9c e0 ldi r25, 0x0C ; 12 e70a: 0f 94 db a0 call 0x341b6 ; 0x341b6 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); e70e: 62 e4 ldi r22, 0x42 ; 66 e710: 84 e9 ldi r24, 0x94 ; 148 e712: 9c e0 ldi r25, 0x0C ; 12 e714: 0f 94 c5 a0 call 0x3418a ; 0x3418a // 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(); e718: 0e 94 32 61 call 0xc264 ; 0xc264 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); e71c: c4 e7 ldi r28, 0x74 ; 116 e71e: d8 e7 ldi r29, 0x78 ; 120 e720: f1 cf rjmp .-30 ; 0xe704 0000e722 : // 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(); e722: 8a e4 ldi r24, 0x4A ; 74 e724: 93 e0 ldi r25, 0x03 ; 3 e726: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) e72a: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e72e: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e732: 89 2b or r24, r25 e734: 79 f0 breq .+30 ; 0xe754 e736: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb e73a: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc e73e: e2 52 subi r30, 0x22 ; 34 e740: f0 4f sbci r31, 0xF0 ; 240 e742: 80 81 ld r24, Z e744: 81 30 cpi r24, 0x01 ; 1 e746: 11 f0 breq .+4 ; 0xe74c e748: 86 30 cpi r24, 0x06 ; 6 e74a: 21 f4 brne .+8 ; 0xe754 SERIAL_PROTOCOLLNRPGM(MSG_OK); e74c: 85 ed ldi r24, 0xD5 ; 213 e74e: 99 e6 ldi r25, 0x69 ; 105 e750: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc } e754: 08 95 ret 0000e756 : void cmdqueue_reset() { while (buflen) e756: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e75a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e75e: 89 2b or r24, r25 e760: 29 f0 breq .+10 ; 0xe76c { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); e762: 0e 94 91 73 call 0xe722 ; 0xe722 cmdqueue_pop_front(); e766: 0e 94 5e 70 call 0xe0bc ; 0xe0bc e76a: f5 cf rjmp .-22 ; 0xe756 } bufindr = 0; e76c: 10 92 cc 11 sts 0x11CC, r1 ; 0x8011cc e770: 10 92 cb 11 sts 0x11CB, r1 ; 0x8011cb bufindw = 0; e774: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> e778: 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; e77c: 81 e0 ldi r24, 0x01 ; 1 e77e: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } e782: 08 95 ret 0000e784 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { e784: ef 92 push r14 e786: ff 92 push r15 e788: 0f 93 push r16 e78a: 1f 93 push r17 e78c: cf 93 push r28 e78e: df 93 push r29 if (mbl.active) { e790: 80 91 9c 12 lds r24, 0x129C ; 0x80129c e794: 88 23 and r24, r24 e796: 89 f1 breq .+98 ; 0xe7fa } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); e798: 86 e0 ldi r24, 0x06 ; 6 e79a: 98 e7 ldi r25, 0x78 ; 120 e79c: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); e7a0: 80 ef ldi r24, 0xF0 ; 240 e7a2: 97 e7 ldi r25, 0x77 ; 119 e7a4: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLLNPGM("Measured points:"); e7a8: 8f ed ldi r24, 0xDF ; 223 e7aa: 97 e7 ldi r25, 0x77 ; 119 e7ac: 0e 94 de 72 call 0xe5bc ; 0xe5bc for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { e7b0: c7 e0 ldi r28, 0x07 ; 7 e7b2: dc e1 ldi r29, 0x1C ; 28 e7b4: c1 50 subi r28, 0x01 ; 1 e7b6: 58 f1 brcs .+86 ; 0xe80e e7b8: cd 9f mul r28, r29 e7ba: 70 01 movw r14, r0 e7bc: 11 24 eor r1, r1 e7be: 01 e0 ldi r16, 0x01 ; 1 e7c0: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); e7c2: 8c ed ldi r24, 0xDC ; 220 e7c4: 97 e7 ldi r25, 0x77 ; 119 e7c6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL_F(z_values[y][x], 5); e7ca: f8 01 movw r30, r16 e7cc: ee 0f add r30, r30 e7ce: ff 1f adc r31, r31 e7d0: ee 0f add r30, r30 e7d2: ff 1f adc r31, r31 e7d4: ee 0d add r30, r14 e7d6: ff 1d adc r31, r15 e7d8: e7 56 subi r30, 0x67 ; 103 e7da: fd 4e sbci r31, 0xED ; 237 e7dc: 60 81 ld r22, Z e7de: 71 81 ldd r23, Z+1 ; 0x01 e7e0: 82 81 ldd r24, Z+2 ; 0x02 e7e2: 93 81 ldd r25, Z+3 ; 0x03 e7e4: 45 e0 ldi r20, 0x05 ; 5 e7e6: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 e7ea: 0f 5f subi r16, 0xFF ; 255 e7ec: 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++) { e7ee: 08 30 cpi r16, 0x08 ; 8 e7f0: 11 05 cpc r17, r1 e7f2: 39 f7 brne .-50 ; 0xe7c2 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); e7f4: 0f 94 9d 98 call 0x3313a ; 0x3313a e7f8: dd cf rjmp .-70 ; 0xe7b4 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e7fa: 83 e1 ldi r24, 0x13 ; 19 e7fc: 98 e7 ldi r25, 0x78 ; 120 return; } e7fe: df 91 pop r29 e800: cf 91 pop r28 e802: 1f 91 pop r17 e804: 0f 91 pop r16 e806: ff 90 pop r15 e808: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e80a: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc return; } e80e: df 91 pop r29 e810: cf 91 pop r28 e812: 1f 91 pop r17 e814: 0f 91 pop r16 e816: ff 90 pop r15 e818: ef 90 pop r14 e81a: 08 95 ret 0000e81c : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { e81c: cf 92 push r12 e81e: df 92 push r13 e820: ef 92 push r14 e822: ff 92 push r15 e824: 6b 01 movw r12, r22 e826: 7c 01 movw r14, r24 la10c_orig_jerk = j; e828: c0 92 29 03 sts 0x0329, r12 ; 0x800329 e82c: d0 92 2a 03 sts 0x032A, r13 ; 0x80032a e830: e0 92 2b 03 sts 0x032B, r14 ; 0x80032b e834: f0 92 2c 03 sts 0x032C, r15 ; 0x80032c if(la10c_mode != LA10C_LA10) e838: 80 91 45 03 lds r24, 0x0345 ; 0x800345 e83c: 82 30 cpi r24, 0x02 ; 2 e83e: b1 f4 brne .+44 ; 0xe86c 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) e840: 20 e0 ldi r18, 0x00 ; 0 e842: 30 e0 ldi r19, 0x00 ; 0 e844: 40 e9 ldi r20, 0x90 ; 144 e846: 50 e4 ldi r21, 0x40 ; 64 e848: c7 01 movw r24, r14 e84a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> e84e: 87 ff sbrs r24, 7 e850: 14 c0 rjmp .+40 ; 0xe87a e852: 80 91 62 04 lds r24, 0x0462 ; 0x800462 e856: 90 91 63 04 lds r25, 0x0463 ; 0x800463 e85a: a0 91 64 04 lds r26, 0x0464 ; 0x800464 e85e: b0 91 65 04 lds r27, 0x0465 ; 0x800465 e862: 80 3d cpi r24, 0xD0 ; 208 e864: 97 40 sbci r25, 0x07 ; 7 e866: a1 05 cpc r26, r1 e868: b1 05 cpc r27, r1 e86a: 20 f5 brcc .+72 ; 0xe8b4 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } e86c: c7 01 movw r24, r14 e86e: b6 01 movw r22, r12 e870: ff 90 pop r15 e872: ef 90 pop r14 e874: df 90 pop r13 e876: cf 90 pop r12 e878: 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: e87a: 2a e9 ldi r18, 0x9A ; 154 e87c: 39 e9 ldi r19, 0x99 ; 153 e87e: 49 e9 ldi r20, 0x99 ; 153 e880: 5e e3 ldi r21, 0x3E ; 62 e882: c7 01 movw r24, r14 e884: b6 01 movw r22, r12 e886: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> e88a: 87 ff sbrs r24, 7 e88c: 0a c0 rjmp .+20 ; 0xe8a2 e88e: 20 e0 ldi r18, 0x00 ; 0 e890: 30 e0 ldi r19, 0x00 ; 0 e892: 48 e3 ldi r20, 0x38 ; 56 e894: 51 e4 ldi r21, 0x41 ; 65 e896: c7 01 movw r24, r14 e898: b6 01 movw r22, r12 e89a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> e89e: 6b 01 movw r12, r22 e8a0: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); e8a2: 8a ee ldi r24, 0xEA ; 234 e8a4: 94 e7 ldi r25, 0x74 ; 116 e8a6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(j); e8aa: c7 01 movw r24, r14 e8ac: b6 01 movw r22, r12 e8ae: 0f 94 2b 41 call 0x28256 ; 0x28256 e8b2: dc cf rjmp .-72 ; 0xe86c // 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: e8b4: 2a e9 ldi r18, 0x9A ; 154 e8b6: 39 e9 ldi r19, 0x99 ; 153 e8b8: 49 e9 ldi r20, 0x99 ; 153 e8ba: 5e e3 ldi r21, 0x3E ; 62 e8bc: c7 01 movw r24, r14 e8be: b6 01 movw r22, r12 e8c0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> e8c4: 87 fd sbrc r24, 7 e8c6: e3 cf rjmp .-58 ; 0xe88e j < 4.5? j * 0.25 + 3.375: e8c8: 20 e0 ldi r18, 0x00 ; 0 e8ca: 30 e0 ldi r19, 0x00 ; 0 e8cc: 40 e8 ldi r20, 0x80 ; 128 e8ce: 5e e3 ldi r21, 0x3E ; 62 e8d0: c7 01 movw r24, r14 e8d2: b6 01 movw r22, r12 e8d4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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: e8d8: 20 e0 ldi r18, 0x00 ; 0 e8da: 30 e0 ldi r19, 0x00 ; 0 e8dc: 48 e5 ldi r20, 0x58 ; 88 e8de: 50 e4 ldi r21, 0x40 ; 64 e8e0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> e8e4: dc cf rjmp .-72 ; 0xe89e 0000e8e6 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { e8e6: cf 92 push r12 e8e8: df 92 push r13 e8ea: ef 92 push r14 e8ec: ff 92 push r15 e8ee: cf 93 push r28 if(mode == la10c_mode) return; e8f0: 90 91 45 03 lds r25, 0x0345 ; 0x800345 e8f4: 98 17 cp r25, r24 e8f6: b9 f1 breq .+110 ; 0xe966 e8f8: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) e8fa: c0 90 29 03 lds r12, 0x0329 ; 0x800329 e8fe: d0 90 2a 03 lds r13, 0x032A ; 0x80032a e902: e0 90 2b 03 lds r14, 0x032B ; 0x80032b e906: f0 90 2c 03 lds r15, 0x032C ; 0x80032c e90a: 20 e0 ldi r18, 0x00 ; 0 e90c: 30 e0 ldi r19, 0x00 ; 0 e90e: a9 01 movw r20, r18 e910: c7 01 movw r24, r14 e912: b6 01 movw r22, r12 e914: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> e918: 88 23 and r24, r24 e91a: 41 f0 breq .+16 ; 0xe92c cs.max_jerk[E_AXIS] = la10c_orig_jerk; e91c: c0 92 86 04 sts 0x0486, r12 ; 0x800486 e920: d0 92 87 04 sts 0x0487, r13 ; 0x800487 e924: e0 92 88 04 sts 0x0488, r14 ; 0x800488 e928: f0 92 89 04 sts 0x0489, r15 ; 0x800489 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); e92c: 8d ec ldi r24, 0xCD ; 205 e92e: 94 e7 ldi r25, 0x74 ; 116 e930: 0e 94 e5 70 call 0xe1ca ; 0xe1ca switch(mode) e934: c1 30 cpi r28, 0x01 ; 1 e936: 11 f1 breq .+68 ; 0xe97c e938: e0 f0 brcs .+56 ; 0xe972 e93a: c2 30 cpi r28, 0x02 ; 2 e93c: 11 f1 breq .+68 ; 0xe982 { 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; e93e: 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]); e942: 60 91 86 04 lds r22, 0x0486 ; 0x800486 e946: 70 91 87 04 lds r23, 0x0487 ; 0x800487 e94a: 80 91 88 04 lds r24, 0x0488 ; 0x800488 e94e: 90 91 89 04 lds r25, 0x0489 ; 0x800489 e952: 0e 94 0e 74 call 0xe81c ; 0xe81c e956: 60 93 86 04 sts 0x0486, r22 ; 0x800486 e95a: 70 93 87 04 sts 0x0487, r23 ; 0x800487 e95e: 80 93 88 04 sts 0x0488, r24 ; 0x800488 e962: 90 93 89 04 sts 0x0489, r25 ; 0x800489 } e966: cf 91 pop r28 e968: ff 90 pop r15 e96a: ef 90 pop r14 e96c: df 90 pop r13 e96e: cf 90 pop r12 e970: 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; e972: 85 ec ldi r24, 0xC5 ; 197 e974: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e976: 0e 94 de 72 call 0xe5bc ; 0xe5bc e97a: e1 cf rjmp .-62 ; 0xe93e SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; e97c: 81 ec ldi r24, 0xC1 ; 193 e97e: 94 e7 ldi r25, 0x74 ; 116 e980: fa cf rjmp .-12 ; 0xe976 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e982: 8d eb ldi r24, 0xBD ; 189 e984: 94 e7 ldi r25, 0x74 ; 116 e986: f7 cf rjmp .-18 ; 0xe976 0000e988 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); e988: 0f 94 14 22 call 0x24428 ; 0x24428 disable_x(); e98c: 17 9a sbi 0x02, 7 ; 2 e98e: e3 ea ldi r30, 0xA3 ; 163 e990: f6 e0 ldi r31, 0x06 ; 6 e992: 10 82 st Z, r1 disable_y(); e994: 16 9a sbi 0x02, 6 ; 2 e996: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); e998: 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); } e99a: 80 e0 ldi r24, 0x00 ; 0 e99c: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; e9a0: 8f ef ldi r24, 0xFF ; 255 e9a2: 9f ef ldi r25, 0xFF ; 255 e9a4: 90 93 75 02 sts 0x0275, r25 ; 0x800275 e9a8: 80 93 74 02 sts 0x0274, r24 ; 0x800274 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; e9ac: 2f ef ldi r18, 0xFF ; 255 e9ae: 20 93 71 02 sts 0x0271, r18 ; 0x800271 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; e9b2: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e e9b6: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; e9ba: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; e9be: 90 93 73 02 sts 0x0273, r25 ; 0x800273 e9c2: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; e9c6: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c e9ca: 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(); } e9ce: 08 95 ret 0000e9d0 : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { e9d0: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); e9d2: f8 94 cli // sample SP/PC sp = SP; e9d4: cd b7 in r28, 0x3d ; 61 e9d6: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); e9d8: 00 d0 rcall .+0 ; 0xe9da e9da: cf 90 pop r12 e9dc: df 90 pop r13 e9de: ef 90 pop r14 e9e0: 88 e1 ldi r24, 0x18 ; 24 e9e2: 99 e2 ldi r25, 0x29 ; 41 e9e4: 0f b6 in r0, 0x3f ; 63 e9e6: f8 94 cli e9e8: a8 95 wdr e9ea: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> e9ee: 0f be out 0x3f, r0 ; 63 e9f0: 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); e9f4: 9f b7 in r25, 0x3f ; 63 e9f6: f8 94 cli e9f8: e2 e0 ldi r30, 0x02 ; 2 e9fa: f1 e0 ldi r31, 0x01 ; 1 e9fc: 80 81 ld r24, Z e9fe: 88 60 ori r24, 0x08 ; 8 ea00: 80 83 st Z, r24 ea02: 9f bf out 0x3f, r25 ; 63 disable_heater(); ea04: 0f 94 31 12 call 0x22462 ; 0x22462 // 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"); ea08: 8c e7 ldi r24, 0x7C ; 124 ea0a: 94 e7 ldi r25, 0x74 ; 116 ea0c: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_ECHOPGM("error: "); ea10: 84 e7 ldi r24, 0x74 ; 116 ea12: 94 e7 ldi r25, 0x74 ; 116 ea14: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); ea18: 61 2f mov r22, r17 ea1a: 70 e0 ldi r23, 0x00 ; 0 ea1c: 90 e0 ldi r25, 0x00 ; 0 ea1e: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); ea20: 4a e0 ldi r20, 0x0A ; 10 ea22: 0f 94 cd 96 call 0x32d9a ; 0x32d9a MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); ea26: 80 e7 ldi r24, 0x70 ; 112 ea28: 94 e7 ldi r25, 0x74 ; 116 ea2a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); ea2e: 8e 2d mov r24, r14 ea30: b6 01 movw r22, r12 ea32: 90 e0 ldi r25, 0x00 ; 0 ea34: 40 e1 ldi r20, 0x10 ; 16 ea36: 0f 94 cd 96 call 0x32d9a ; 0x32d9a 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"); ea3a: 8c e6 ldi r24, 0x6C ; 108 ea3c: 94 e7 ldi r25, 0x74 ; 116 ea3e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); ea42: be 01 movw r22, r28 ea44: 90 e0 ldi r25, 0x00 ; 0 ea46: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); ea48: 40 e1 ldi r20, 0x10 ; 16 ea4a: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); ea4e: 0f 94 9d 98 call 0x3313a ; 0x3313a MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); ea52: 40 e0 ldi r20, 0x00 ; 0 ea54: 60 e0 ldi r22, 0x00 ; 0 ea56: 72 e2 ldi r23, 0x22 ; 34 ea58: 90 e0 ldi r25, 0x00 ; 0 ea5a: 80 e0 ldi r24, 0x00 ; 0 ea5c: 0f 94 83 52 call 0x2a506 ; 0x2a506 SERIAL_ECHOLNRPGM(MSG_OK); ea60: 85 ed ldi r24, 0xD5 ; 213 ea62: 99 e6 ldi r25, 0x69 ; 105 ea64: 0e 94 de 72 call 0xe5bc ; 0xe5bc // reset soon softReset(); ea68: 0e 94 32 61 call 0xc264 ; 0xc264 0000ea6c : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { ea6c: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); ea6e: 72 9a sbi 0x0e, 2 ; 14 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ea70: 68 2f mov r22, r24 ea72: 83 e0 ldi r24, 0x03 ; 3 ea74: 9d e0 ldi r25, 0x0D ; 13 ea76: 0f 94 a1 a0 call 0x34142 ; 0x34142 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) ea7a: 80 91 7c 06 lds r24, 0x067C ; 0x80067c ea7e: 88 23 and r24, r24 ea80: 19 f0 breq .+6 ; 0xea88 serial_dump_and_reset(reason); ea82: 8c 2f mov r24, r28 ea84: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 #endif softReset(); ea88: 0e 94 32 61 call 0xc264 ; 0xc264 0000ea8c <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { ea8c: 1f 92 push r1 ea8e: 0f 92 push r0 ea90: 0f b6 in r0, 0x3f ; 63 ea92: 0f 92 push r0 ea94: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); ea96: 83 e0 ldi r24, 0x03 ; 3 ea98: 0e 94 36 75 call 0xea6c ; 0xea6c 0000ea9c <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { ea9c: 1f 92 push r1 ea9e: 0f 92 push r0 eaa0: 0f b6 in r0, 0x3f ; 63 eaa2: 0f 92 push r0 eaa4: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); eaa6: 82 e0 ldi r24, 0x02 ; 2 eaa8: 0e 94 36 75 call 0xea6c ; 0xea6c 0000eaac : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); eaac: 41 ed ldi r20, 0xD1 ; 209 eaae: 50 e0 ldi r21, 0x00 ; 0 eab0: 6b e9 ldi r22, 0x9B ; 155 eab2: 73 e7 ldi r23, 0x73 ; 115 eab4: 82 e3 ldi r24, 0x32 ; 50 eab6: 94 e0 ldi r25, 0x04 ; 4 eab8: 0f 94 17 9e call 0x33c2e ; 0x33c2e // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); eabc: 0f 94 36 75 call 0x2ea6c ; 0x2ea6c #ifdef PIDTEMP updatePID(); eac0: 0f 94 68 18 call 0x230d0 ; 0x230d0 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); eac4: 0e 94 5d 5f call 0xbeba ; 0xbeba SERIAL_ECHO_START; eac8: 87 e7 ldi r24, 0x77 ; 119 eaca: 9e e9 ldi r25, 0x9E ; 158 eacc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); ead0: 89 e7 ldi r24, 0x79 ; 121 ead2: 93 e7 ldi r25, 0x73 ; 115 ead4: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 0000ead8 : //! @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)); ead8: 44 e0 ldi r20, 0x04 ; 4 eada: 50 e0 ldi r21, 0x00 ; 0 eadc: 64 e1 ldi r22, 0x14 ; 20 eade: 70 e0 ldi r23, 0x00 ; 0 eae0: 82 e3 ldi r24, 0x32 ; 50 eae2: 94 e0 ldi r25, 0x04 ; 4 eae4: 0f 94 6d a0 call 0x340da ; 0x340da // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match eae8: 43 e0 ldi r20, 0x03 ; 3 eaea: 50 e0 ldi r21, 0x00 ; 0 eaec: 6b e9 ldi r22, 0x9B ; 155 eaee: 73 e7 ldi r23, 0x73 ; 115 eaf0: 82 e3 ldi r24, 0x32 ; 50 eaf2: 94 e0 ldi r25, 0x04 ; 4 eaf4: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 eaf8: 89 2b or r24, r25 eafa: 09 f0 breq .+2 ; 0xeafe eafc: 5d c0 rjmp .+186 ; 0xebb8 { // 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)); eafe: ef e5 ldi r30, 0x5F ; 95 eb00: f4 e7 ldi r31, 0x74 ; 116 eb02: 45 91 lpm r20, Z+ eb04: 55 91 lpm r21, Z+ eb06: 65 91 lpm r22, Z+ eb08: 74 91 lpm r23, Z eb0a: 88 ed ldi r24, 0xD8 ; 216 eb0c: 90 e0 ldi r25, 0x00 ; 0 eb0e: 0e 94 ad 5d call 0xbb5a ; 0xbb5a eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); eb12: e3 e6 ldi r30, 0x63 ; 99 eb14: f4 e7 ldi r31, 0x74 ; 116 eb16: 45 91 lpm r20, Z+ eb18: 55 91 lpm r21, Z+ eb1a: 65 91 lpm r22, Z+ eb1c: 74 91 lpm r23, Z eb1e: 8c ed ldi r24, 0xDC ; 220 eb20: 90 e0 ldi r25, 0x00 ; 0 eb22: 0e 94 ad 5d call 0xbb5a ; 0xbb5a eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); eb26: e7 e6 ldi r30, 0x67 ; 103 eb28: f4 e7 ldi r31, 0x74 ; 116 eb2a: 64 91 lpm r22, Z eb2c: 80 ee ldi r24, 0xE0 ; 224 eb2e: 90 e0 ldi r25, 0x00 ; 0 eb30: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); eb34: e8 e6 ldi r30, 0x68 ; 104 eb36: f4 e7 ldi r31, 0x74 ; 116 eb38: 65 91 lpm r22, Z+ eb3a: 74 91 lpm r23, Z eb3c: 81 ee ldi r24, 0xE1 ; 225 eb3e: 90 e0 ldi r25, 0x00 ; 0 eb40: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); eb44: ea e6 ldi r30, 0x6A ; 106 eb46: f4 e7 ldi r31, 0x74 ; 116 eb48: 65 91 lpm r22, Z+ eb4a: 74 91 lpm r23, Z eb4c: 83 ee ldi r24, 0xE3 ; 227 eb4e: 90 e0 ldi r25, 0x00 ; 0 eb50: 0e 94 60 6f call 0xdec0 ; 0xdec0 // 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)); eb54: eb e5 ldi r30, 0x5B ; 91 eb56: f4 e7 ldi r31, 0x74 ; 116 eb58: 45 91 lpm r20, Z+ eb5a: 55 91 lpm r21, Z+ eb5c: 65 91 lpm r22, Z+ eb5e: 74 91 lpm r23, Z eb60: 84 ed ldi r24, 0xD4 ; 212 eb62: 90 e0 ldi r25, 0x00 ; 0 eb64: 0e 94 ad 5d call 0xbb5a ; 0xbb5a // 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); eb68: 47 e3 ldi r20, 0x37 ; 55 eb6a: 54 e7 ldi r21, 0x74 ; 116 eb6c: 60 e1 ldi r22, 0x10 ; 16 eb6e: 70 e0 ldi r23, 0x00 ; 0 eb70: 80 eb ldi r24, 0xB0 ; 176 eb72: 90 e0 ldi r25, 0x00 ; 0 eb74: 0e 94 41 6f call 0xde82 ; 0xde82 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); eb78: 47 e4 ldi r20, 0x47 ; 71 eb7a: 54 e7 ldi r21, 0x74 ; 116 eb7c: 60 e1 ldi r22, 0x10 ; 16 eb7e: 70 e0 ldi r23, 0x00 ; 0 eb80: 80 ec ldi r24, 0xC0 ; 192 eb82: 90 e0 ldi r25, 0x00 ; 0 eb84: 0e 94 41 6f call 0xde82 ; 0xde82 #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)); eb88: 41 ed ldi r20, 0xD1 ; 209 eb8a: 50 e0 ldi r21, 0x00 ; 0 eb8c: 64 e1 ldi r22, 0x14 ; 20 eb8e: 70 e0 ldi r23, 0x00 ; 0 eb90: 82 e3 ldi r24, 0x32 ; 50 eb92: 94 e0 ldi r25, 0x04 ; 4 eb94: 0f 94 6d a0 call 0x340da ; 0x340da calculate_extruder_multipliers(); eb98: 0e 94 5d 5f call 0xbeba ; 0xbeba 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(); eb9c: 0f 94 36 75 call 0x2ea6c ; 0x2ea6c // Call updatePID (similar to when we have processed M301) updatePID(); eba0: 0f 94 68 18 call 0x230d0 ; 0x230d0 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; eba4: 87 e7 ldi r24, 0x77 ; 119 eba6: 9e e9 ldi r25, 0x9E ; 158 eba8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("Stored settings retrieved"); ebac: 8f e5 ldi r24, 0x5F ; 95 ebae: 93 e7 ldi r25, 0x73 ; 115 ebb0: 0e 94 de 72 call 0xe5bc ; 0xe5bc ebb4: 81 e0 ldi r24, 0x01 ; 1 ebb6: 08 95 ret } else { Config_ResetDefault(); ebb8: 0e 94 56 75 call 0xeaac ; 0xeaac //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))) { ebbc: 64 e0 ldi r22, 0x04 ; 4 ebbe: 70 e0 ldi r23, 0x00 ; 0 ebc0: 84 e1 ldi r24, 0x14 ; 20 ebc2: 90 e0 ldi r25, 0x00 ; 0 ebc4: 0e 94 9b 55 call 0xab36 ; 0xab36 ebc8: 91 e0 ldi r25, 0x01 ; 1 ebca: 89 27 eor r24, r25 return false; } } return true; } ebcc: 08 95 ret 0000ebce : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); ebce: 6b e9 ldi r22, 0x9B ; 155 ebd0: 73 e7 ldi r23, 0x73 ; 115 ebd2: 82 e3 ldi r24, 0x32 ; 50 ebd4: 94 e0 ldi r25, 0x04 ; 4 ebd6: 0f 94 34 9e call 0x33c68 ; 0x33c68 #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); ebda: 41 ed ldi r20, 0xD1 ; 209 ebdc: 50 e0 ldi r21, 0x00 ; 0 ebde: 64 e1 ldi r22, 0x14 ; 20 ebe0: 70 e0 ldi r23, 0x00 ; 0 ebe2: 82 e3 ldi r24, 0x32 ; 50 ebe4: 94 e0 ldi r25, 0x04 ; 4 ebe6: 0f 94 91 a0 call 0x34122 ; 0x34122 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; ebea: 87 e7 ldi r24, 0x77 ; 119 ebec: 9e e9 ldi r25, 0x9E ; 158 ebee: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM("Settings Stored"); ebf2: 8f e4 ldi r24, 0x4F ; 79 ebf4: 93 e7 ldi r25, 0x73 ; 115 ebf6: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 0000ebfa : { cmdbuffer_front_already_processed = true; } void get_command() { ebfa: 2f 92 push r2 ebfc: 3f 92 push r3 ebfe: 4f 92 push r4 ec00: 5f 92 push r5 ec02: 6f 92 push r6 ec04: 7f 92 push r7 ec06: 8f 92 push r8 ec08: 9f 92 push r9 ec0a: af 92 push r10 ec0c: bf 92 push r11 ec0e: cf 92 push r12 ec10: df 92 push r13 ec12: ef 92 push r14 ec14: ff 92 push r15 ec16: 0f 93 push r16 ec18: 1f 93 push r17 ec1a: cf 93 push r28 ec1c: df 93 push r29 ec1e: cd b7 in r28, 0x3d ; 61 ec20: de b7 in r29, 0x3e ; 62 ec22: a0 97 sbiw r28, 0x20 ; 32 ec24: 0f b6 in r0, 0x3f ; 63 ec26: f8 94 cli ec28: de bf out 0x3e, r29 ; 62 ec2a: 0f be out 0x3f, r0 ; 63 ec2c: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) ec2e: 8f e5 ldi r24, 0x5F ; 95 ec30: 90 e0 ldi r25, 0x00 ; 0 ec32: 0e 94 47 56 call 0xac8e ; 0xac8e ec36: 88 23 and r24, r24 ec38: 09 f4 brne .+2 ; 0xec3c ec3a: a1 c0 rjmp .+322 ; 0xed7e return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size ec3c: 0e 94 4b 55 call 0xaa96 ; 0xaa96 ec40: 8f 37 cpi r24, 0x7F ; 127 ec42: 91 05 cpc r25, r1 ec44: 61 f4 brne .+24 ; 0xec5e // 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; ec46: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 ec4a: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 ec4e: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 ec52: 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 ec56: 80 e4 ldi r24, 0x40 ; 64 ec58: 93 e7 ldi r25, 0x73 ; 115 ec5a: 0e 94 de 72 call 0xe5bc ; 0xe5bc ec5e: 6e 01 movw r12, r28 ec60: 4f e1 ldi r20, 0x1F ; 31 ec62: c4 0e add r12, r20 ec64: 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; ec66: 99 24 eor r9, r9 ec68: 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 ec6a: 0e 94 4b 55 call 0xaa96 ; 0xaa96 ec6e: 18 16 cp r1, r24 ec70: 19 06 cpc r1, r25 ec72: 0c f0 brlt .+2 ; 0xec76 ec74: 78 c0 rjmp .+240 ; 0xed66 ec76: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 ec7a: 88 23 and r24, r24 ec7c: 29 f0 breq .+10 ; 0xec88 ec7e: 0e 94 48 61 call 0xc290 ; 0xc290 ec82: 88 23 and r24, r24 ec84: 09 f4 brne .+2 ; 0xec88 ec86: 6f c0 rjmp .+222 ; 0xed66 ec88: 80 91 61 03 lds r24, 0x0361 ; 0x800361 ec8c: 81 11 cpse r24, r1 ec8e: 6b c0 rjmp .+214 ; 0xed66 } 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) { ec90: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 ec94: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 ec98: 80 91 af 05 lds r24, 0x05AF ; 0x8005af ec9c: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 eca0: 82 17 cp r24, r18 eca2: 93 07 cpc r25, r19 eca4: 11 f3 breq .-60 ; 0xec6a return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; eca6: f9 01 movw r30, r18 eca8: e1 5d subi r30, 0xD1 ; 209 ecaa: fa 4f sbci r31, 0xFA ; 250 ecac: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; ecae: 2f 5f subi r18, 0xFF ; 255 ecb0: 3f 4f sbci r19, 0xFF ; 255 ecb2: 2f 77 andi r18, 0x7F ; 127 ecb4: 33 27 eor r19, r19 ecb6: 30 93 b2 05 sts 0x05B2, r19 ; 0x8005b2 ecba: 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)) { ecbe: 8f 3f cpi r24, 0xFF ; 255 ecc0: 09 f0 breq .+2 ; 0xecc4 ecc2: 79 c0 rjmp .+242 ; 0xedb6 if (mp_cmd_count > 0) { ecc4: 80 91 1b 03 lds r24, 0x031B ; 0x80031b ecc8: 88 23 and r24, r24 ecca: 09 f4 brne .+2 ; 0xecce eccc: 71 c0 rjmp .+226 ; 0xedb0 mp_cmd_active = 1; ecce: 90 92 1a 03 sts 0x031A, r9 ; 0x80031a mp_cmd_count = 0; ecd2: 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}; ecd6: 1f 8e std Y+31, r1 ; 0x1f ecd8: 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) { ecda: 80 90 1e 03 lds r8, 0x031E ; 0x80031e ecde: 88 20 and r8, r8 ece0: 21 f2 breq .-120 ; 0xec6a 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]; ece2: 80 91 1c 03 lds r24, 0x031C ; 0x80031c ece6: 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) ece8: f1 e0 ldi r31, 0x01 ; 1 ecea: f8 15 cp r31, r8 ecec: 18 f4 brcc .+6 ; 0xecf4 out[i] = (char)mp_char_out_buf[i]; ecee: 80 91 1d 03 lds r24, 0x031D ; 0x80031d ecf2: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; ecf4: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e ecf8: 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]; ecfa: 82 2d mov r24, r2 ecfc: 8c 19 sub r24, r12 ecfe: 88 15 cp r24, r8 ed00: 08 f0 brcs .+2 ; 0xed04 ed02: b3 cf rjmp .-154 ; 0xec6a ed04: f1 01 movw r30, r2 ed06: 11 91 ld r17, Z+ ed08: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); ed0a: 81 e2 ldi r24, 0x21 ; 33 ed0c: 93 e0 ldi r25, 0x03 ; 3 ed0e: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> if (serial_char < 0) ed12: 17 fd sbrc r17, 7 ed14: f2 cf rjmp .-28 ; 0xecfa ed16: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ed1a: 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' || ed1e: 1a 30 cpi r17, 0x0A ; 10 ed20: 09 f4 brne .+2 ; 0xed24 ed22: 4b c1 rjmp .+662 ; 0xefba ed24: 1d 30 cpi r17, 0x0D ; 13 ed26: 09 f4 brne .+2 ; 0xed2a ed28: 48 c1 rjmp .+656 ; 0xefba serial_char == '\r' || ed2a: 8f 35 cpi r24, 0x5F ; 95 ed2c: 91 05 cpc r25, r1 ed2e: 0c f0 brlt .+2 ; 0xed32 ed30: 49 c1 rjmp .+658 ; 0xefc4 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; ed32: 1b 33 cpi r17, 0x3B ; 59 ed34: 11 f4 brne .+4 ; 0xed3a ed36: 90 92 20 03 sts 0x0320, r9 ; 0x800320 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; ed3a: 20 91 20 03 lds r18, 0x0320 ; 0x800320 ed3e: 21 11 cpse r18, r1 ed40: dc cf rjmp .-72 ; 0xecfa ed42: 9c 01 movw r18, r24 ed44: 2f 5f subi r18, 0xFF ; 255 ed46: 3f 4f sbci r19, 0xFF ; 255 ed48: 30 93 db 0f sts 0x0FDB, r19 ; 0x800fdb ed4c: 20 93 da 0f sts 0x0FDA, r18 ; 0x800fda ed50: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> ed54: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> ed58: 22 52 subi r18, 0x22 ; 34 ed5a: 30 4f sbci r19, 0xF0 ; 240 ed5c: 82 0f add r24, r18 ed5e: 93 1f adc r25, r19 ed60: fc 01 movw r30, r24 ed62: 13 83 std Z+3, r17 ; 0x03 ed64: ca cf rjmp .-108 ; 0xecfa #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { ed66: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ed6a: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb ed6e: 18 16 cp r1, r24 ed70: 19 06 cpc r1, r25 ed72: 0c f4 brge .+2 ; 0xed76 ed74: 51 c2 rjmp .+1186 ; 0xf218 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ ed76: 80 91 6a 13 lds r24, 0x136A ; 0x80136a ed7a: 81 11 cpse r24, r1 ed7c: 67 c2 rjmp .+1230 ; 0xf24c prusa_statistics(6); } } #endif //SDSUPPORT } ed7e: a0 96 adiw r28, 0x20 ; 32 ed80: 0f b6 in r0, 0x3f ; 63 ed82: f8 94 cli ed84: de bf out 0x3e, r29 ; 62 ed86: 0f be out 0x3f, r0 ; 63 ed88: cd bf out 0x3d, r28 ; 61 ed8a: df 91 pop r29 ed8c: cf 91 pop r28 ed8e: 1f 91 pop r17 ed90: 0f 91 pop r16 ed92: ff 90 pop r15 ed94: ef 90 pop r14 ed96: df 90 pop r13 ed98: cf 90 pop r12 ed9a: bf 90 pop r11 ed9c: af 90 pop r10 ed9e: 9f 90 pop r9 eda0: 8f 90 pop r8 eda2: 7f 90 pop r7 eda4: 6f 90 pop r6 eda6: 5f 90 pop r5 eda8: 4f 90 pop r4 edaa: 3f 90 pop r3 edac: 2f 90 pop r2 edae: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; edb0: 90 92 1b 03 sts 0x031B, r9 ; 0x80031b edb4: 90 cf rjmp .-224 ; 0xecd6 return; } if (mp_cmd_active > 0) { edb6: 90 91 1a 03 lds r25, 0x031A ; 0x80031a edba: 99 23 and r25, r25 edbc: 09 f4 brne .+2 ; 0xedc0 edbe: 58 c0 rjmp .+176 ; 0xee70 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { edc0: 89 3f cpi r24, 0xF9 ; 249 edc2: e9 f1 breq .+122 ; 0xee3e edc4: 70 f5 brcc .+92 ; 0xee22 edc6: 86 3f cpi r24, 0xF6 ; 246 edc8: 09 f4 brne .+2 ; 0xedcc edca: 4a c0 rjmp .+148 ; 0xee60 edcc: 87 3f cpi r24, 0xF7 ; 247 edce: 09 f4 brne .+2 ; 0xedd2 edd0: 43 c0 rjmp .+134 ; 0xee58 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. edd2: 8b e0 ldi r24, 0x0B ; 11 edd4: 93 e7 ldi r25, 0x73 ; 115 edd6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca // 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); edda: 86 e0 ldi r24, 0x06 ; 6 eddc: 93 e7 ldi r25, 0x73 ; 115 edde: 0e 94 e5 70 call 0xe1ca ; 0xe1ca // Echo current state if (mp_config & MPConfig_Active) ede2: 10 91 19 03 lds r17, 0x0319 ; 0x800319 SERIAL_ECHOPGM(" ON"); ede6: 82 e0 ldi r24, 0x02 ; 2 ede8: 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) edea: 10 fd sbrc r17, 0 edec: 02 c0 rjmp .+4 ; 0xedf2 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); edee: 8d ef ldi r24, 0xFD ; 253 edf0: 92 e7 ldi r25, 0x72 ; 114 edf2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (mp_config & MPConfig_NoSpaces) edf6: 01 2f mov r16, r17 edf8: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces edfa: 88 ef ldi r24, 0xF8 ; 248 edfc: 92 e7 ldi r25, 0x72 ; 114 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) edfe: 11 fd sbrc r17, 1 ee00: 02 c0 rjmp .+4 ; 0xee06 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces ee02: 83 ef ldi r24, 0xF3 ; 243 ee04: 92 e7 ldi r25, 0x72 ; 114 ee06: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM(""); ee0a: 82 ef ldi r24, 0xF2 ; 242 ee0c: 92 e7 ldi r25, 0x72 ; 114 ee0e: 0e 94 de 72 call 0xe5bc ; 0xe5bc // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) ee12: 00 23 and r16, r16 ee14: 49 f1 breq .+82 ; 0xee68 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); ee16: 85 e4 ldi r24, 0x45 ; 69 ee18: 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; ee1c: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a ee20: 5a cf rjmp .-332 ; 0xecd6 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { ee22: 8a 3f cpi r24, 0xFA ; 250 ee24: 41 f0 breq .+16 ; 0xee36 ee26: 8b 3f cpi r24, 0xFB ; 251 ee28: a1 f6 brne .-88 ; 0xedd2 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; ee2a: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee2e: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ee30: 80 93 19 03 sts 0x0319, r24 ; 0x800319 ee34: ce cf rjmp .-100 ; 0xedd2 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); ee36: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee3a: 8e 7f andi r24, 0xFE ; 254 ee3c: f9 cf rjmp .-14 ; 0xee30 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; ee3e: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e mp_cmd_active = MPCommand_None; ee42: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a mp_config = MPConfig_None; ee46: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_char_buf = 0; ee4a: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_cmd_count = 0; ee4e: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b mp_cmd_active = 0; mp_full_char_queue = 0; ee52: 10 92 17 03 sts 0x0317, r1 ; 0x800317 ee56: bd cf rjmp .-134 ; 0xedd2 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; ee58: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee5c: 82 60 ori r24, 0x02 ; 2 ee5e: e8 cf rjmp .-48 ; 0xee30 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ee60: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ee64: 8d 7f andi r24, 0xFD ; 253 ee66: e4 cf rjmp .-56 ; 0xee30 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; ee68: 90 e2 ldi r25, 0x20 ; 32 ee6a: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> ee6e: d6 cf rjmp .-84 ; 0xee1c mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { ee70: 90 91 1b 03 lds r25, 0x031B ; 0x80031b ee74: 30 91 19 03 lds r19, 0x0319 ; 0x800319 ee78: 99 23 and r25, r25 ee7a: 31 f1 breq .+76 ; 0xeec8 ee7c: 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) { ee80: 30 ff sbrs r19, 0 ee82: 49 c0 rjmp .+146 ; 0xef16 if (mp_full_char_queue > 0) { ee84: 20 91 17 03 lds r18, 0x0317 ; 0x800317 ee88: 22 23 and r18, r18 ee8a: 09 f4 brne .+2 ; 0xee8e ee8c: 40 c0 rjmp .+128 ; 0xef0e #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; ee8e: 91 e0 ldi r25, 0x01 ; 1 ee90: 9e 0f add r25, r30 ee92: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee96: ae 2f mov r26, r30 ee98: b0 e0 ldi r27, 0x00 ; 0 ee9a: a4 5e subi r26, 0xE4 ; 228 ee9c: bc 4f sbci r27, 0xFC ; 252 ee9e: ff ef ldi r31, 0xFF ; 255 eea0: 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) { eea2: 40 91 18 03 lds r20, 0x0318 ; 0x800318 eea6: 44 23 and r20, r20 eea8: 51 f0 breq .+20 ; 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; eeaa: ee 5f subi r30, 0xFE ; 254 eeac: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e eeb0: e9 2f mov r30, r25 eeb2: f0 e0 ldi r31, 0x00 ; 0 eeb4: e4 5e subi r30, 0xE4 ; 228 eeb6: fc 4f sbci r31, 0xFC ; 252 eeb8: 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; eeba: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; eebe: 21 50 subi r18, 0x01 ; 1 eec0: 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; eec4: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b eec8: 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) { eecc: 30 ff sbrs r19, 0 eece: 6c c0 rjmp .+216 ; 0xefa8 if (mp_full_char_queue > 0) { eed0: 90 91 17 03 lds r25, 0x0317 ; 0x800317 eed4: 99 23 and r25, r25 eed6: 49 f1 breq .+82 ; 0xef2a #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; eed8: 21 e0 ldi r18, 0x01 ; 1 eeda: 2e 0f add r18, r30 eedc: 20 93 1e 03 sts 0x031E, r18 ; 0x80031e eee0: ae 2f mov r26, r30 eee2: b0 e0 ldi r27, 0x00 ; 0 eee4: a4 5e subi r26, 0xE4 ; 228 eee6: bc 4f sbci r27, 0xFC ; 252 eee8: 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) { eeea: 80 91 18 03 lds r24, 0x0318 ; 0x800318 eeee: 88 23 and r24, r24 eef0: 51 f0 breq .+20 ; 0xef06 #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; eef2: ee 5f subi r30, 0xFE ; 254 eef4: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e eef8: e2 2f mov r30, r18 eefa: f0 e0 ldi r31, 0x00 ; 0 eefc: e4 5e subi r30, 0xE4 ; 228 eefe: fc 4f sbci r31, 0xFC ; 252 ef00: 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; ef02: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; ef06: 91 50 subi r25, 0x01 ; 1 ef08: 90 93 17 03 sts 0x0317, r25 ; 0x800317 ef0c: e4 ce rjmp .-568 ; 0xecd6 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; ef0e: 42 e0 ldi r20, 0x02 ; 2 ef10: 40 93 17 03 sts 0x0317, r20 ; 0x800317 ef14: d7 cf rjmp .-82 ; 0xeec4 #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; ef16: 91 e0 ldi r25, 0x01 ; 1 ef18: 9e 0f add r25, r30 ef1a: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ef1e: f0 e0 ldi r31, 0x00 ; 0 ef20: e4 5e subi r30, 0xE4 ; 228 ef22: fc 4f sbci r31, 0xFC ; 252 ef24: 9f ef ldi r25, 0xFF ; 255 ef26: 90 83 st Z, r25 ef28: cd cf rjmp .-102 ; 0xeec4 ef2a: a8 2f mov r26, r24 ef2c: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; ef2e: 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; ef30: 21 e0 ldi r18, 0x01 ; 1 ef32: af 30 cpi r26, 0x0F ; 15 ef34: 29 f0 breq .+10 ; 0xef40 ef36: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char ef38: a0 50 subi r26, 0x00 ; 0 ef3a: be 4f sbci r27, 0xFE ; 254 ef3c: 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; ef3e: 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; ef40: 48 2f mov r20, r24 ef42: 40 7f andi r20, 0xF0 ; 240 ef44: 40 3f cpi r20, 0xF0 ; 240 ef46: 59 f4 brne .+22 ; 0xef5e ef48: 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) { ef4a: 20 ff sbrs r18, 0 ef4c: 13 c0 rjmp .+38 ; 0xef74 ++mp_full_char_queue; ef4e: 90 92 17 03 sts 0x0317, r9 ; 0x800317 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ef52: 21 ff sbrs r18, 1 ef54: 0c c0 rjmp .+24 ; 0xef6e ef56: e2 e0 ldi r30, 0x02 ; 2 ef58: e0 93 17 03 sts 0x0317, r30 ; 0x800317 ef5c: bc ce rjmp .-648 ; 0xecd6 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 ef5e: 82 95 swap r24 ef60: 8f 70 andi r24, 0x0F ; 15 ef62: a8 2f mov r26, r24 ef64: b0 e0 ldi r27, 0x00 ; 0 ef66: a0 50 subi r26, 0x00 ; 0 ef68: be 4f sbci r27, 0xFE ; 254 ef6a: 9c 91 ld r25, X ef6c: ee cf rjmp .-36 ; 0xef4a 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]; ef6e: 90 93 18 03 sts 0x0318, r25 ; 0x800318 ef72: b1 ce rjmp .-670 ; 0xecd6 #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; ef74: 81 e0 ldi r24, 0x01 ; 1 ef76: 8e 0f add r24, r30 ef78: 80 93 1e 03 sts 0x031E, r24 ; 0x80031e ef7c: ae 2f mov r26, r30 ef7e: b0 e0 ldi r27, 0x00 ; 0 ef80: a4 5e subi r26, 0xE4 ; 228 ef82: bc 4f sbci r27, 0xFC ; 252 ef84: 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') { ef86: 3a 30 cpi r19, 0x0A ; 10 ef88: 09 f4 brne .+2 ; 0xef8c ef8a: a5 ce rjmp .-694 ; 0xecd6 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ef8c: 21 ff sbrs r18, 1 ef8e: 03 c0 rjmp .+6 ; 0xef96 ef90: 90 92 17 03 sts 0x0317, r9 ; 0x800317 ef94: a0 ce rjmp .-704 ; 0xecd6 #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; ef96: ee 5f subi r30, 0xFE ; 254 ef98: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ef9c: e8 2f mov r30, r24 ef9e: f0 e0 ldi r31, 0x00 ; 0 efa0: e4 5e subi r30, 0xE4 ; 228 efa2: fc 4f sbci r31, 0xFC ; 252 efa4: 90 83 st Z, r25 efa6: 97 ce rjmp .-722 ; 0xecd6 efa8: 91 e0 ldi r25, 0x01 ; 1 efaa: 9e 0f add r25, r30 efac: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e efb0: f0 e0 ldi r31, 0x00 ; 0 efb2: e4 5e subi r30, 0xE4 ; 228 efb4: fc 4f sbci r31, 0xFC ; 252 efb6: 80 83 st Z, r24 efb8: 8e ce rjmp .-740 ; 0xecd6 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line efba: 00 97 sbiw r24, 0x00 ; 0 efbc: 19 f4 brne .+6 ; 0xefc4 comment_mode = false; //for new command efbe: 10 92 20 03 sts 0x0320, r1 ; 0x800320 efc2: dd ce rjmp .-582 ; 0xed7e efc4: 00 91 dc 0f lds r16, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> efc8: 10 91 dd 0f lds r17, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string efcc: 0f 51 subi r16, 0x1F ; 31 efce: 10 4f sbci r17, 0xF0 ; 240 efd0: 80 0f add r24, r16 efd2: 91 1f adc r25, r17 efd4: fc 01 movw r30, r24 efd6: 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) efd8: 1a 83 std Y+2, r17 ; 0x02 efda: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ efdc: 80 91 20 03 lds r24, 0x0320 ; 0x800320 efe0: 81 11 cpse r24, r1 efe2: fd c0 rjmp .+506 ; 0xf1de long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { efe4: f8 01 movw r30, r16 efe6: 80 81 ld r24, Z efe8: 8e 34 cpi r24, 0x4E ; 78 efea: 09 f0 breq .+2 ; 0xefee efec: 84 c0 rjmp .+264 ; 0xf0f6 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); efee: 4a e0 ldi r20, 0x0A ; 10 eff0: 50 e0 ldi r21, 0x00 ; 0 eff2: be 01 movw r22, r28 eff4: 6f 5f subi r22, 0xFF ; 255 eff6: 7f 4f sbci r23, 0xFF ; 255 eff8: c8 01 movw r24, r16 effa: 01 96 adiw r24, 0x01 ; 1 effc: 0f 94 08 9c call 0x33810 ; 0x33810 f000: 2b 01 movw r4, r22 f002: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; f004: e9 80 ldd r14, Y+1 ; 0x01 f006: fa 80 ldd r15, Y+2 ; 0x02 f008: f7 01 movw r30, r14 f00a: 80 81 ld r24, Z f00c: 80 32 cpi r24, 0x20 ; 32 f00e: 31 f4 brne .+12 ; 0xf01c f010: ff ef ldi r31, 0xFF ; 255 f012: ef 1a sub r14, r31 f014: ff 0a sbc r15, r31 f016: fa 82 std Y+2, r15 ; 0x02 f018: e9 82 std Y+1, r14 ; 0x01 f01a: f4 cf rjmp .-24 ; 0xf004 // 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)) { f01c: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 f020: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 f024: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 f028: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 f02c: 01 96 adiw r24, 0x01 ; 1 f02e: a1 1d adc r26, r1 f030: b1 1d adc r27, r1 f032: 84 15 cp r24, r4 f034: 95 05 cpc r25, r5 f036: a6 05 cpc r26, r6 f038: b7 05 cpc r27, r7 f03a: 49 f0 breq .+18 ; 0xf04e f03c: 44 e0 ldi r20, 0x04 ; 4 f03e: 50 e0 ldi r21, 0x00 ; 0 f040: 6b e3 ldi r22, 0x3B ; 59 f042: 73 e7 ldi r23, 0x73 ; 115 f044: c7 01 movw r24, r14 f046: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 f04a: 89 2b or r24, r25 f04c: a1 f4 brne .+40 ; 0xf076 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) f04e: 6a e2 ldi r22, 0x2A ; 42 f050: 70 e0 ldi r23, 0x00 ; 0 f052: c7 01 movw r24, r14 f054: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 f058: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 f05c: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 f060: 00 97 sbiw r24, 0x00 ; 0 f062: 09 f4 brne .+2 ; 0xf066 f064: 41 c0 rjmp .+130 ; 0xf0e8 f066: f8 01 movw r30, r16 { byte checksum = 0; f068: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) f06a: 8e 17 cp r24, r30 f06c: 9f 07 cpc r25, r31 f06e: f1 f0 breq .+60 ; 0xf0ac checksum = checksum^(*p++); f070: 21 91 ld r18, Z+ f072: f2 26 eor r15, r18 f074: fa cf rjmp .-12 ; 0xf06a 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; f076: 8a e5 ldi r24, 0x5A ; 90 f078: 9e e9 ldi r25, 0x9E ; 158 f07a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO f07e: 82 ee ldi r24, 0xE2 ; 226 f080: 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 f082: 0e 94 e5 70 call 0xe1ca ; 0xe1ca f086: 60 91 d1 11 lds r22, 0x11D1 ; 0x8011d1 f08a: 70 91 d2 11 lds r23, 0x11D2 ; 0x8011d2 f08e: 80 91 d3 11 lds r24, 0x11D3 ; 0x8011d3 f092: 90 91 d4 11 lds r25, 0x11D4 ; 0x8011d4 f096: 0f 94 43 97 call 0x32e86 ; 0x32e86 } void MarlinSerial::println(long n, int base) { print(n, base); println(); f09a: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); f09e: 0e 94 6d 55 call 0xaada ; 0xaada serial_count = 0; f0a2: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f0a6: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda f0aa: 69 ce rjmp .-814 ; 0xed7e { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { f0ac: 0e 94 d8 55 call 0xabb0 ; 0xabb0 f0b0: f8 16 cp r15, r24 f0b2: 19 06 cpc r1, r25 f0b4: 39 f0 breq .+14 ; 0xf0c4 SERIAL_ERROR_START; f0b6: 8a e5 ldi r24, 0x5A ; 90 f0b8: 9e e9 ldi r25, 0x9E ; 158 f0ba: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH f0be: 83 ec ldi r24, 0xC3 ; 195 f0c0: 93 e6 ldi r25, 0x63 ; 99 f0c2: df cf rjmp .-66 ; 0xf082 FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; f0c4: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 f0c8: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 f0cc: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) f0ce: e9 80 ldd r14, Y+1 ; 0x01 f0d0: fa 80 ldd r15, Y+2 ; 0x02 f0d2: 66 e3 ldi r22, 0x36 ; 54 f0d4: 73 e7 ldi r23, 0x73 ; 115 f0d6: c7 01 movw r24, r14 f0d8: 0f 94 2b 9e call 0x33c56 ; 0x33c56 f0dc: 89 2b or r24, r25 f0de: 39 f5 brne .+78 ; 0xf12e kill(MSG_M112_KILL); f0e0: 89 e2 ldi r24, 0x29 ; 41 f0e2: 96 e6 ldi r25, 0x66 ; 102 f0e4: 0e 94 6a 73 call 0xe6d4 ; 0xe6d4 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; f0e8: 8a e5 ldi r24, 0x5A ; 90 f0ea: 9e e9 ldi r25, 0x9E ; 158 f0ec: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM f0f0: 89 e9 ldi r24, 0x99 ; 153 f0f2: 93 e6 ldi r25, 0x63 ; 99 f0f4: c6 cf rjmp .-116 ; 0xf082 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; f0f6: 89 81 ldd r24, Y+1 ; 0x01 f0f8: 9a 81 ldd r25, Y+2 ; 0x02 f0fa: fc 01 movw r30, r24 f0fc: 20 81 ld r18, Z f0fe: 20 32 cpi r18, 0x20 ; 32 f100: 21 f4 brne .+8 ; 0xf10a f102: 01 96 adiw r24, 0x01 ; 1 f104: 9a 83 std Y+2, r25 ; 0x02 f106: 89 83 std Y+1, r24 ; 0x01 f108: f6 cf rjmp .-20 ; 0xf0f6 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) f10a: 6a e2 ldi r22, 0x2A ; 42 f10c: 70 e0 ldi r23, 0x00 ; 0 f10e: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 f112: 89 2b or r24, r25 f114: 39 f0 breq .+14 ; 0xf124 { SERIAL_ERROR_START; f116: 8a e5 ldi r24, 0x5A ; 90 f118: 9e e9 ldi r25, 0x9E ; 158 f11a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM f11e: 8f e6 ldi r24, 0x6F ; 111 f120: 93 e6 ldi r25, 0x63 ; 99 f122: af cf rjmp .-162 ; 0xf082 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 f124: 44 24 eor r4, r4 f126: 4a 94 dec r4 f128: 54 2c mov r5, r4 f12a: 32 01 movw r6, r4 f12c: d0 cf rjmp .-96 ; 0xf0ce 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) f12e: 44 e0 ldi r20, 0x04 ; 4 f130: 50 e0 ldi r21, 0x00 ; 0 f132: 61 e3 ldi r22, 0x31 ; 49 f134: 73 e7 ldi r23, 0x73 ; 115 f136: c7 01 movw r24, r14 f138: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 f13c: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { f13e: f7 01 movw r30, r14 f140: 80 81 ld r24, Z f142: 87 34 cpi r24, 0x47 ; 71 f144: 81 f4 brne .+32 ; 0xf166 f146: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> f14a: 85 30 cpi r24, 0x05 ; 5 f14c: 61 f0 breq .+24 ; 0xf166 usb_timer.start(); f14e: 85 ed ldi r24, 0xD5 ; 213 f150: 91 e1 ldi r25, 0x11 ; 17 f152: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; f156: f6 e0 ldi r31, 0x06 ; 6 f158: 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); f15c: 60 e0 ldi r22, 0x00 ; 0 f15e: 85 ea ldi r24, 0xA5 ; 165 f160: 9f e0 ldi r25, 0x0F ; 15 f162: 0f 94 a1 a0 call 0x34142 ; 0x34142 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) { f166: ab 28 or r10, r11 f168: 21 f0 breq .+8 ; 0xf172 f16a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce f16e: 81 11 cpse r24, r1 f170: 98 cf rjmp .-208 ; 0xf0a2 } // 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; f172: 26 e0 ldi r18, 0x06 ; 6 f174: 77 fc sbrc r7, 7 f176: 21 e0 ldi r18, 0x01 ; 1 f178: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f17c: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f180: fc 01 movw r30, r24 f182: e2 52 subi r30, 0x22 ; 34 f184: f0 4f sbci r31, 0xF0 ; 240 f186: 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) f188: 49 81 ldd r20, Y+1 ; 0x01 f18a: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; f18c: 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) f18e: da 01 movw r26, r20 f190: 40 17 cp r20, r16 f192: 51 07 cpc r21, r17 f194: a1 f5 brne .+104 ; 0xf1fe cmd_len = strlen(cmd_start) + 1; f196: 01 90 ld r0, Z+ f198: 00 20 and r0, r0 f19a: e9 f7 brne .-6 ; 0xf196 f19c: 9f 01 movw r18, r30 f19e: 20 1b sub r18, r16 f1a0: 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; f1a2: 03 96 adiw r24, 0x03 ; 3 f1a4: 28 0f add r18, r24 f1a6: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) f1a8: 2d 3e cpi r18, 0xED ; 237 f1aa: f1 e0 ldi r31, 0x01 ; 1 f1ac: 3f 07 cpc r19, r31 f1ae: 79 f1 breq .+94 ; 0xf20e // 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; f1b0: 30 93 dd 0f sts 0x0FDD, r19 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f1b4: 20 93 dc 0f sts 0x0FDC, r18 ; 0x800fdc <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f1b8: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f1bc: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f1c0: 01 96 adiw r24, 0x01 ; 1 f1c2: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f1c6: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf // Update the processed gcode line if (gcode_N >= 0) f1ca: 77 fc sbrc r7, 7 f1cc: 08 c0 rjmp .+16 ; 0xf1de gcode_LastN = gcode_N; f1ce: 40 92 d1 11 sts 0x11D1, r4 ; 0x8011d1 f1d2: 50 92 d2 11 sts 0x11D2, r5 ; 0x8011d2 f1d6: 60 92 d3 11 sts 0x11D3, r6 ; 0x8011d3 f1da: 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 f1de: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f1e2: 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)) f1e6: 0e 94 4b 55 call 0xaa96 ; 0xaa96 f1ea: 89 2b or r24, r25 f1ec: 09 f4 brne .+2 ; 0xf1f0 f1ee: c7 cd rjmp .-1138 ; 0xed7e f1f0: 8f e5 ldi r24, 0x5F ; 95 f1f2: 90 e0 ldi r25, 0x00 ; 0 f1f4: 0e 94 47 56 call 0xac8e ; 0xac8e f1f8: 81 11 cpse r24, r1 f1fa: 7f cd rjmp .-1282 ; 0xecfa f1fc: c0 cd rjmp .-1152 ; 0xed7e 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]; } f1fe: 6d 91 ld r22, X+ f200: 61 93 st Z+, r22 f202: 9d 01 movw r18, r26 f204: 24 1b sub r18, r20 f206: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); f208: 61 11 cpse r22, r1 f20a: f9 cf rjmp .-14 ; 0xf1fe f20c: ca cf rjmp .-108 ; 0xf1a2 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; f20e: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f212: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> f216: d0 cf rjmp .-96 ; 0xf1b8 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { f218: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f21c: 60 e2 ldi r22, 0x20 ; 32 f21e: 73 e0 ldi r23, 0x03 ; 3 f220: 81 11 cpse r24, r1 f222: 02 c0 rjmp .+4 ; 0xf228 f224: 60 ed ldi r22, 0xD0 ; 208 f226: 77 e0 ldi r23, 0x07 ; 7 f228: 81 e2 ldi r24, 0x21 ; 33 f22a: 93 e0 ldi r25, 0x03 ; 3 f22c: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> f230: 88 23 and r24, r24 f232: 09 f4 brne .+2 ; 0xf236 f234: a0 cd rjmp .-1216 ; 0xed76 comment_mode = false; f236: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; f23a: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f23e: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda SERIAL_ECHOLNPGM("RX timeout"); f242: 86 e2 ldi r24, 0x26 ; 38 f244: 93 e7 ldi r25, 0x73 ; 115 f246: 0e 94 de 72 call 0xe5bc ; 0xe5bc f24a: 99 cd rjmp .-1230 ; 0xed7e return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ f24c: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f250: 88 23 and r24, r24 f252: 09 f4 brne .+2 ; 0xf256 f254: 94 cd rjmp .-1240 ; 0xed7e f256: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda f25a: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb f25e: 89 2b or r24, r25 f260: 09 f0 breq .+2 ; 0xf264 f262: 8d cd rjmp .-1254 ; 0xed7e //'#' 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; f264: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f268: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f26c: 89 2b or r24, r25 f26e: 11 f4 brne .+4 ; 0xf274 f270: 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; f274: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f276: 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) { f278: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f27c: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f280: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f284: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f288: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f28c: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f290: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f294: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f298: 48 17 cp r20, r24 f29a: 59 07 cpc r21, r25 f29c: 6a 07 cpc r22, r26 f29e: 7b 07 cpc r23, r27 f2a0: 08 f0 brcs .+2 ; 0xf2a4 f2a2: c1 c0 rjmp .+386 ; 0xf426 f2a4: 80 91 1f 03 lds r24, 0x031F ; 0x80031f f2a8: 81 11 cpse r24, r1 f2aa: bd c0 rjmp .+378 ; 0xf426 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); f2ac: 0f 94 6c 48 call 0x290d8 ; 0x290d8 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_;} f2b0: 40 91 02 16 lds r20, 0x1602 ; 0x801602 f2b4: 50 91 03 16 lds r21, 0x1603 ; 0x801603 f2b8: 60 91 04 16 lds r22, 0x1604 ; 0x801604 f2bc: 70 91 05 16 lds r23, 0x1605 ; 0x801605 sdpos = file.curPosition(); f2c0: 40 93 7e 16 sts 0x167E, r20 ; 0x80167e f2c4: 50 93 7f 16 sts 0x167F, r21 ; 0x80167f f2c8: 60 93 80 16 sts 0x1680, r22 ; 0x801680 f2cc: 70 93 81 16 sts 0x1681, r23 ; 0x801681 f2d0: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda f2d4: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' f2d8: 8a 30 cpi r24, 0x0A ; 10 f2da: 61 f0 breq .+24 ; 0xf2f4 || serial_char == '\r' f2dc: 8d 30 cpi r24, 0x0D ; 13 f2de: 51 f0 breq .+20 ; 0xf2f4 || serial_char == '#' f2e0: 83 32 cpi r24, 0x23 ; 35 f2e2: 09 f4 brne .+2 ; 0xf2e6 f2e4: 87 c0 rjmp .+270 ; 0xf3f4 || serial_count >= (MAX_CMD_SIZE - 1) f2e6: 2f 35 cpi r18, 0x5F ; 95 f2e8: 31 05 cpc r19, r1 f2ea: 24 f4 brge .+8 ; 0xf2f4 || n==-1 f2ec: 8f 3f cpi r24, 0xFF ; 255 f2ee: 98 07 cpc r25, r24 f2f0: 09 f0 breq .+2 ; 0xf2f4 f2f2: 87 c0 rjmp .+270 ; 0xf402 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) f2f4: 21 15 cp r18, r1 f2f6: 31 05 cpc r19, r1 f2f8: 09 f4 brne .+2 ; 0xf2fc f2fa: 41 cd rjmp .-1406 ; 0xed7e 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); }; f2fc: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f300: 81 11 cpse r24, r1 f302: 03 c0 rjmp .+6 ; 0xf30a f304: 40 e0 ldi r20, 0x00 ; 0 f306: 50 e0 ldi r21, 0x00 ; 0 f308: 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; f30a: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc f30e: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd f312: 48 1b sub r20, r24 f314: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; f316: a0 91 dc 0f lds r26, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f31a: b0 91 dd 0f lds r27, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f31e: fd 01 movw r30, r26 f320: e2 52 subi r30, 0x22 ; 34 f322: f0 4f sbci r31, 0xF0 ; 240 f324: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; f326: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; f328: 52 83 std Z+2, r21 ; 0x02 f32a: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string f32c: 22 52 subi r18, 0x22 ; 34 f32e: 30 4f sbci r19, 0xF0 ; 240 f330: f9 01 movw r30, r18 f332: ea 0f add r30, r26 f334: fb 1f adc r31, r27 f336: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); f338: a2 52 subi r26, 0x22 ; 34 f33a: b0 4f sbci r27, 0xF0 ; 240 f33c: fd 01 movw r30, r26 f33e: 01 90 ld r0, Z+ f340: 00 20 and r0, r0 f342: e9 f7 brne .-6 ; 0xf33e f344: 31 97 sbiw r30, 0x01 ; 1 f346: ea 1b sub r30, r26 f348: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); f34a: 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; f34c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f350: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f354: 01 96 adiw r24, 0x01 ; 1 f356: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f35a: 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); f35e: 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; f360: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f364: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f368: e8 0f add r30, r24 f36a: f9 2f mov r31, r25 f36c: f1 1d adc r31, r1 f36e: f0 93 dd 0f sts 0x0FDD, r31 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f372: e0 93 dc 0f sts 0x0FDC, r30 ; 0x800fdc <_ZL7bufindw.lto_priv.514> f376: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f37a: 88 23 and r24, r24 f37c: 09 f4 brne .+2 ; 0xf380 f37e: 3d c0 rjmp .+122 ; 0xf3fa f380: 80 91 7e 16 lds r24, 0x167E ; 0x80167e f384: 90 91 7f 16 lds r25, 0x167F ; 0x80167f f388: a0 91 80 16 lds r26, 0x1680 ; 0x801680 f38c: b0 91 81 16 lds r27, 0x1681 ; 0x801681 sdpos_atomic = card.get_sdpos(); f390: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc f394: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd f398: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de f39c: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df if (bufindw == sizeof(cmdbuffer)) f3a0: ed 3e cpi r30, 0xED ; 237 f3a2: f1 40 sbci r31, 0x01 ; 1 f3a4: 21 f4 brne .+8 ; 0xf3ae bufindw = 0; f3a6: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f3aa: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> sei(); f3ae: 78 94 sei comment_mode = false; //for new command f3b0: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; //clear buffer f3b4: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f3b8: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda if(card.eof()) break; f3bc: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f3c0: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f3c4: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f3c8: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f3cc: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f3d0: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f3d4: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f3d8: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f3dc: 48 17 cp r20, r24 f3de: 59 07 cpc r21, r25 f3e0: 6a 07 cpc r22, r26 f3e2: 7b 07 cpc r23, r27 f3e4: 00 f5 brcc .+64 ; 0xf426 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) f3e6: 8f e5 ldi r24, 0x5F ; 95 f3e8: 90 e0 ldi r25, 0x00 ; 0 f3ea: 0e 94 47 56 call 0xac8e ; 0xac8e f3ee: 81 11 cpse r24, r1 f3f0: 43 cf rjmp .-378 ; 0xf278 f3f2: c5 cc rjmp .-1654 ; 0xed7e || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f3f4: 00 93 1f 03 sts 0x031F, r16 ; 0x80031f f3f8: 7d cf rjmp .-262 ; 0xf2f4 f3fa: 80 e0 ldi r24, 0x00 ; 0 f3fc: 90 e0 ldi r25, 0x00 ; 0 f3fe: dc 01 movw r26, r24 f400: c7 cf rjmp .-114 ; 0xf390 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; f402: a9 01 movw r20, r18 f404: 4f 5f subi r20, 0xFF ; 255 f406: 5f 4f sbci r21, 0xFF ; 255 f408: 50 93 db 0f sts 0x0FDB, r21 ; 0x800fdb f40c: 40 93 da 0f sts 0x0FDA, r20 ; 0x800fda f410: 40 91 dc 0f lds r20, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> f414: 50 91 dd 0f lds r21, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> f418: 42 52 subi r20, 0x22 ; 34 f41a: 50 4f sbci r21, 0xF0 ; 240 f41c: 24 0f add r18, r20 f41e: 35 1f adc r19, r21 f420: f9 01 movw r30, r18 f422: 83 83 std Z+3, r24 ; 0x03 f424: 29 cf rjmp .-430 ; 0xf278 } } if(card.eof()) f426: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f42a: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f42e: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f432: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f436: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f43a: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f43e: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f442: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f446: 48 17 cp r20, r24 f448: 59 07 cpc r21, r25 f44a: 6a 07 cpc r22, r26 f44c: 7b 07 cpc r23, r27 f44e: 08 f4 brcc .+2 ; 0xf452 f450: 96 cc rjmp .-1748 ; 0xed7e { // 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()) f452: 0e 94 1e 70 call 0xe03c ; 0xe03c f456: 89 2b or r24, r25 f458: 09 f0 breq .+2 ; 0xf45c f45a: 91 cc rjmp .-1758 ; 0xed7e { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); f45c: 0f 94 82 41 call 0x28304 ; 0x28304 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED f460: 8c e5 ldi r24, 0x5C ; 92 f462: 93 e6 ldi r25, 0x63 ; 99 f464: 0e 94 de 72 call 0xe5bc ; 0xe5bc char time[30]; uint32_t t = print_job_timer.duration() / 60; f468: 0f 94 38 1c call 0x23870 ; 0x23870 f46c: 6b 01 movw r12, r22 f46e: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); f470: 0e 94 c3 5f call 0xbf86 ; 0xbf86 // 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; f474: 8c e3 ldi r24, 0x3C ; 60 f476: 88 2e mov r8, r24 f478: 91 2c mov r9, r1 f47a: a1 2c mov r10, r1 f47c: b1 2c mov r11, r1 f47e: c7 01 movw r24, r14 f480: b6 01 movw r22, r12 f482: a5 01 movw r20, r10 f484: 94 01 movw r18, r8 f486: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> int hours, minutes; minutes = t % 60; f48a: ca 01 movw r24, r20 f48c: b9 01 movw r22, r18 f48e: a5 01 movw r20, r10 f490: 94 01 movw r18, r8 f492: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f496: 7f 93 push r23 f498: 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; f49a: c7 01 movw r24, r14 f49c: b6 01 movw r22, r12 f49e: 20 e1 ldi r18, 0x10 ; 16 f4a0: 3e e0 ldi r19, 0x0E ; 14 f4a2: 40 e0 ldi r20, 0x00 ; 0 f4a4: 50 e0 ldi r21, 0x00 ; 0 f4a6: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f4aa: 3f 93 push r19 f4ac: 2f 93 push r18 f4ae: 82 e1 ldi r24, 0x12 ; 18 f4b0: 93 e7 ldi r25, 0x73 ; 115 f4b2: 9f 93 push r25 f4b4: 8f 93 push r24 f4b6: 8e 01 movw r16, r28 f4b8: 0f 5f subi r16, 0xFF ; 255 f4ba: 1f 4f sbci r17, 0xFF ; 255 f4bc: 1f 93 push r17 f4be: 0f 93 push r16 f4c0: 0f 94 94 9f call 0x33f28 ; 0x33f28 SERIAL_ECHO_START; f4c4: 87 e7 ldi r24, 0x77 ; 119 f4c6: 9e e9 ldi r25, 0x9E ; 158 f4c8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(time); f4cc: c8 01 movw r24, r16 f4ce: 0f 94 9e 99 call 0x3333c ; 0x3333c lcd_setstatus(time); f4d2: c8 01 movw r24, r16 f4d4: 0e 94 53 ef call 0x1dea6 ; 0x1dea6 card.printingHasFinished(); f4d8: 0f 94 dc 4c call 0x299b8 ; 0x299b8 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; f4dc: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) f4e0: 0f b6 in r0, 0x3f ; 63 f4e2: f8 94 cli f4e4: de bf out 0x3e, r29 ; 62 f4e6: 0f be out 0x3f, r0 ; 63 f4e8: cd bf out 0x3d, r28 ; 61 f4ea: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f4ee: 88 23 and r24, r24 f4f0: 59 f0 breq .+22 ; 0xf508 f4f2: 0f 94 af 43 call 0x2875e ; 0x2875e card.checkautostart(true); if (farm_mode) f4f6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f4fa: 88 23 and r24, r24 f4fc: 09 f4 brne .+2 ; 0xf500 f4fe: 3f cc rjmp .-1922 ; 0xed7e prusa_statistics(6); f500: 86 e0 ldi r24, 0x06 ; 6 f502: 0f 94 a0 98 call 0x33140 ; 0x33140 f506: 3b cc rjmp .-1930 ; 0xed7e { mount(); f508: 81 e0 ldi r24, 0x01 ; 1 f50a: 0f 94 1b 4d call 0x29a36 ; 0x29a36 if(!mounted) //fail f50e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f512: 81 11 cpse r24, r1 f514: ee cf rjmp .-36 ; 0xf4f2 f516: ef cf rjmp .-34 ; 0xf4f6 0000f518 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { f518: 0f 93 push r16 f51a: 1f 93 push r17 f51c: cf 93 push r28 f51e: df 93 push r29 f520: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { f522: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f526: 81 30 cpi r24, 0x01 ; 1 f528: 09 f4 brne .+2 ; 0xf52c f52a: 49 c0 rjmp .+146 ; 0xf5be f52c: 82 30 cpi r24, 0x02 ; 2 f52e: 09 f4 brne .+2 ; 0xf532 f530: 4d c0 rjmp .+154 ; 0xf5cc * * 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) f532: 0e 94 a4 61 call 0xc348 ; 0xc348 f536: 81 11 cpse r24, r1 f538: ec c0 rjmp .+472 ; 0xf712 f53a: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 f53e: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 f542: 00 97 sbiw r24, 0x00 ; 0 f544: 39 f4 brne .+14 ; 0xf554 f546: 20 91 ed 11 lds r18, 0x11ED ; 0x8011ed f54a: 30 91 ee 11 lds r19, 0x11EE ; 0x8011ee f54e: 23 2b or r18, r19 f550: 09 f4 brne .+2 ; 0xf554 f552: df c0 rjmp .+446 ; 0xf712 f554: 40 91 33 02 lds r20, 0x0233 ; 0x800233 f558: 50 91 34 02 lds r21, 0x0234 ; 0x800234 f55c: 60 91 35 02 lds r22, 0x0235 ; 0x800235 f560: 70 91 36 02 lds r23, 0x0236 ; 0x800236 f564: 41 15 cp r20, r1 f566: 51 05 cpc r21, r1 f568: 61 05 cpc r22, r1 f56a: 71 05 cpc r23, r1 f56c: 09 f4 brne .+2 ; 0xf570 f56e: d1 c0 rjmp .+418 ; 0xf712 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) f570: 89 2b or r24, r25 f572: 31 f4 brne .+12 ; 0xf580 f574: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed f578: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee f57c: 89 2b or r24, r25 f57e: 29 f0 breq .+10 ; 0xf58a f580: 80 91 1a 06 lds r24, 0x061A ; 0x80061a f584: 88 23 and r24, r24 f586: 09 f4 brne .+2 ; 0xf58a f588: 2c c1 rjmp .+600 ; 0xf7e2 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) f58a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f58e: 88 23 and r24, r24 f590: 21 f0 breq .+8 ; 0xf59a f592: 40 ee ldi r20, 0xE0 ; 224 f594: 52 e3 ldi r21, 0x32 ; 50 f596: 69 e2 ldi r22, 0x29 ; 41 f598: 70 e0 ldi r23, 0x00 ; 0 f59a: 8a e1 ldi r24, 0x1A ; 26 f59c: 96 e0 ldi r25, 0x06 ; 6 f59e: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> f5a2: 88 23 and r24, r24 f5a4: 09 f4 brne .+2 ; 0xf5a8 f5a6: b7 c0 rjmp .+366 ; 0xf716 { disable_heater(); f5a8: 0f 94 31 12 call 0x22462 ; 0x22462 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); f5ac: 80 e6 ldi r24, 0x60 ; 96 f5ae: 96 e3 ldi r25, 0x36 ; 54 f5b0: 0e 94 3c 6d call 0xda78 ; 0xda78 f5b4: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_return_to_status(); f5b8: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 f5bc: ac c0 rjmp .+344 ; 0xf716 case State::initializing: state = State::ready; // the IR sensor gets ready instantly as it's just a gpio read operation. f5be: 82 e0 ldi r24, 0x02 ; 2 f5c0: 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(); f5c4: 0e 94 f7 c3 call 0x187ee ; 0x187ee f5c8: 80 93 87 16 sts 0x1687, r24 ; 0x801687 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; f5cc: 10 92 88 16 sts 0x1688, r1 ; 0x801688 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) f5d0: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f5d4: 82 30 cpi r24, 0x02 ; 2 f5d6: 09 f0 breq .+2 ; 0xf5da f5d8: ac cf rjmp .-168 ; 0xf532 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f5da: 80 91 89 16 lds r24, 0x1689 ; 0x801689 f5de: 81 11 cpse r24, r1 f5e0: 3d c0 rjmp .+122 ; 0xf65c return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); f5e2: 0e 94 f7 c3 call 0x187ee ; 0x187ee f5e6: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { f5e8: 80 91 87 16 lds r24, 0x1687 ; 0x801687 f5ec: c8 17 cp r28, r24 f5ee: 09 f4 brne .+2 ; 0xf5f2 f5f0: a0 cf rjmp .-192 ; 0xf532 oldFilamentPresent = newFilamentPresent; f5f2: c0 93 87 16 sts 0x1687, r28 ; 0x801687 eventBlankingTimer.start(); f5f6: 89 e8 ldi r24, 0x89 ; 137 f5f8: 96 e1 ldi r25, 0x16 ; 22 f5fa: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> if (newFilamentPresent) { // filament insertion f5fe: cc 23 and r28, r28 f600: b1 f1 breq .+108 ; 0xf66e } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f602: 80 91 85 16 lds r24, 0x1685 ; 0x801685 f606: 88 23 and r24, r24 f608: 11 f1 breq .+68 ; 0xf64e return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) f60a: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f60e: 81 11 cpse r24, r1 f610: 1e c0 rjmp .+60 ; 0xf64e && !( f612: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f616: 81 30 cpi r24, 0x01 ; 1 f618: d1 f0 breq .+52 ; 0xf64e 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); f61a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f61e: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f622: 89 1b sub r24, r25 f624: 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 f626: 99 f4 brne .+38 ; 0xf64e || printJobOngoing() f628: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 f62c: 81 11 cpse r24, r1 f62e: 0f c0 rjmp .+30 ; 0xf64e || (lcd_commands_type == LcdCommands::Layer1Cal) f630: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f634: 84 30 cpi r24, 0x04 ; 4 f636: 59 f0 breq .+22 ; 0xf64e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f638: 8f e5 ldi r24, 0x5F ; 95 f63a: 9f e0 ldi r25, 0x0F ; 15 f63c: 0f 94 7d a0 call 0x340fa ; 0x340fa } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f640: 81 11 cpse r24, r1 f642: 05 c0 rjmp .+10 ; 0xf64e || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); f644: 61 e0 ldi r22, 0x01 ; 1 f646: 81 e4 ldi r24, 0x41 ; 65 f648: 98 e3 ldi r25, 0x38 ; 56 f64a: 0f 94 ca 94 call 0x32994 ; 0x32994 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; f64e: 81 e0 ldi r24, 0x01 ; 1 f650: 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. f654: 81 e0 ldi r24, 0x01 ; 1 f656: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b f65a: 6b cf rjmp .-298 ; 0xf532 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f65c: 64 e6 ldi r22, 0x64 ; 100 f65e: 70 e0 ldi r23, 0x00 ; 0 f660: 89 e8 ldi r24, 0x89 ; 137 f662: 96 e1 ldi r25, 0x16 ; 22 f664: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> f668: 81 11 cpse r24, r1 f66a: bb cf rjmp .-138 ; 0xf5e2 f66c: 62 cf rjmp .-316 ; 0xf532 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f66e: 80 91 86 16 lds r24, 0x1686 ; 0x801686 f672: 88 23 and r24, r24 f674: 79 f3 breq .-34 ; 0xf654 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) f676: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f67a: 81 11 cpse r24, r1 f67c: eb cf rjmp .-42 ; 0xf654 f67e: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f682: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f686: 89 1b sub r24, r25 f688: 8f 70 andi r24, 0x0F ; 15 && ( f68a: 21 f4 brne .+8 ; 0xf694 moves_planned() != 0 || printJobOngoing() f68c: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 f690: 88 23 and r24, r24 f692: 01 f3 breq .-64 ; 0xf654 ) && !( f694: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f698: 81 11 cpse r24, r1 f69a: dc cf rjmp .-72 ; 0xf654 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange f69c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f6a0: 81 30 cpi r24, 0x01 ; 1 f6a2: c1 f2 breq .-80 ; 0xf654 || (lcd_commands_type == LcdCommands::Layer1Cal) f6a4: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f6a8: 84 30 cpi r24, 0x04 ; 4 f6aa: a1 f2 breq .-88 ; 0xf654 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f6ac: 8f e5 ldi r24, 0x5F ; 95 f6ae: 9f e0 ldi r25, 0x0F ; 15 f6b0: 0f 94 7d a0 call 0x340fa ; 0x340fa && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f6b4: 81 11 cpse r24, r1 f6b6: ce cf rjmp .-100 ; 0xf654 } //! @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); f6b8: 8a e2 ldi r24, 0x2A ; 42 f6ba: 95 e6 ldi r25, 0x65 ; 101 f6bc: 9f 93 push r25 f6be: 8f 93 push r24 f6c0: 80 e1 ldi r24, 0x10 ; 16 f6c2: 95 e6 ldi r25, 0x65 ; 101 f6c4: 9f 93 push r25 f6c6: 8f 93 push r24 f6c8: 0f 94 3f 9f call 0x33e7e ; 0x33e7e void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; f6cc: 10 92 86 16 sts 0x1686, r1 ; 0x801686 autoLoadEnabled = false; f6d0: 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; f6d4: 0f 90 pop r0 f6d6: 0f 90 pop r0 f6d8: 0f 90 pop r0 f6da: 0f 90 pop r0 f6dc: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f6e0: 81 11 cpse r24, r1 f6e2: 05 c0 rjmp .+10 ; 0xf6ee f6e4: 60 e0 ldi r22, 0x00 ; 0 f6e6: 70 e0 ldi r23, 0x00 ; 0 f6e8: cb 01 movw r24, r22 f6ea: 0f 94 8f 41 call 0x2831e ; 0x2831e stop_and_save_print_to_ram(0, 0); restore_print_from_ram_and_continue(0); f6ee: 60 e0 ldi r22, 0x00 ; 0 f6f0: 70 e0 ldi r23, 0x00 ; 0 f6f2: cb 01 movw r24, r22 f6f4: 0e 94 cb 61 call 0xc396 ; 0xc396 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); f6f8: 85 e6 ldi r24, 0x65 ; 101 f6fa: 9f e0 ldi r25, 0x0F ; 15 f6fc: 0e 94 97 6f call 0xdf2e ; 0xdf2e eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); f700: 81 e0 ldi r24, 0x01 ; 1 f702: 9f e0 ldi r25, 0x0F ; 15 f704: 0e 94 8a 6f call 0xdf14 ; 0xdf14 enquecommand_front_P(MSG_M600); f708: 8f e1 ldi r24, 0x1F ; 31 f70a: 9c e6 ldi r25, 0x6C ; 108 f70c: 0f 94 f5 42 call 0x285ea ; 0x285ea f710: a1 cf rjmp .-190 ; 0xf654 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} f712: 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)){ f716: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f71a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f71e: 03 97 sbiw r24, 0x03 ; 3 f720: 14 f4 brge .+4 ; 0xf726 get_command(); f722: 0e 94 fd 75 call 0xebfa ; 0xebfa 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); f726: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f72a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) f72e: 98 17 cp r25, r24 f730: 81 f0 breq .+32 ; 0xf752 f732: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> f736: 86 30 cpi r24, 0x06 ; 6 f738: 61 f4 brne .+24 ; 0xf752 f73a: 68 e8 ldi r22, 0x88 ; 136 f73c: 73 e1 ldi r23, 0x13 ; 19 f73e: 85 ed ldi r24, 0xD5 ; 213 f740: 91 e1 ldi r25, 0x11 ; 17 f742: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> f746: 88 23 and r24, r24 f748: 21 f0 breq .+8 ; 0xf752 { // 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(); f74a: 85 ed ldi r24, 0xD5 ; 213 f74c: 91 e1 ldi r25, 0x11 ; 17 f74e: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) f752: 40 91 46 03 lds r20, 0x0346 ; 0x800346 f756: 50 91 47 03 lds r21, 0x0347 ; 0x800347 f75a: 60 91 48 03 lds r22, 0x0348 ; 0x800348 f75e: 70 91 49 03 lds r23, 0x0349 ; 0x800349 f762: 41 15 cp r20, r1 f764: 51 05 cpc r21, r1 f766: 61 05 cpc r22, r1 f768: 71 05 cpc r23, r1 f76a: 09 f0 breq .+2 ; 0xf76e f76c: 3f c0 rjmp .+126 ; 0xf7ec kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { f76e: 40 91 37 02 lds r20, 0x0237 ; 0x800237 f772: 50 91 38 02 lds r21, 0x0238 ; 0x800238 f776: 60 91 39 02 lds r22, 0x0239 ; 0x800239 f77a: 70 91 3a 02 lds r23, 0x023A ; 0x80023a f77e: 41 15 cp r20, r1 f780: 51 05 cpc r21, r1 f782: 61 05 cpc r22, r1 f784: 71 05 cpc r23, r1 f786: a9 f0 breq .+42 ; 0xf7b2 f788: 8a e4 ldi r24, 0x4A ; 74 f78a: 93 e0 ldi r25, 0x03 ; 3 f78c: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> f790: 88 23 and r24, r24 f792: 79 f0 breq .+30 ; 0xf7b2 f794: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f798: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 if(blocks_queued() == false && ignore_stepper_queue == false) { f79c: 98 13 cpse r25, r24 f79e: 09 c0 rjmp .+18 ; 0xf7b2 f7a0: d1 11 cpse r29, r1 f7a2: 07 c0 rjmp .+14 ; 0xf7b2 disable_x(); f7a4: 17 9a sbi 0x02, 7 ; 2 f7a6: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); f7aa: 16 9a sbi 0x02, 6 ; 2 f7ac: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); f7b0: 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; f7b2: c0 91 e9 11 lds r28, 0x11E9 ; 0x8011e9 block_t *block; if(block_buffer_tail != block_buffer_head) f7b6: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f7ba: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f7be: 98 17 cp r25, r24 f7c0: 01 f1 breq .+64 ; 0xf802 { uint8_t block_index = block_buffer_tail; f7c2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 tail_fan_speed = block_buffer[block_index].fan_speed; f7c6: 9e e6 ldi r25, 0x6E ; 110 f7c8: 89 9f mul r24, r25 f7ca: f0 01 movw r30, r0 f7cc: 11 24 eor r1, r1 f7ce: e2 5f subi r30, 0xF2 ; 242 f7d0: f8 4f sbci r31, 0xF8 ; 248 f7d2: c0 81 ld r28, Z while(block_index != block_buffer_head) f7d4: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f7d8: 98 17 cp r25, r24 f7da: 99 f0 breq .+38 ; 0xf802 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); f7dc: 8f 5f subi r24, 0xFF ; 255 f7de: 8f 70 andi r24, 0x0F ; 15 f7e0: f9 cf rjmp .-14 ; 0xf7d4 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); f7e2: 8a e1 ldi r24, 0x1A ; 26 f7e4: 96 e0 ldi r25, 0x06 ; 6 f7e6: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> f7ea: 95 cf rjmp .-214 ; 0xf716 // 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)) f7ec: 8a e4 ldi r24, 0x4A ; 74 f7ee: 93 e0 ldi r25, 0x03 ; 3 f7f0: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> f7f4: 88 23 and r24, r24 f7f6: 09 f4 brne .+2 ; 0xf7fa f7f8: ba cf rjmp .-140 ; 0xf76e kill(PSTR("Inactivity Shutdown")); f7fa: 80 e6 ldi r24, 0x60 ; 96 f7fc: 98 e7 ldi r25, 0x78 ; 120 f7fe: 0e 94 6a 73 call 0xe6d4 ; 0xe6d4 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) { f802: cc 23 and r28, r28 f804: 09 f4 brne .+2 ; 0xf808 f806: be c0 rjmp .+380 ; 0xf984 if (fan_kick_end == 0) { f808: 80 91 41 03 lds r24, 0x0341 ; 0x800341 f80c: 90 91 42 03 lds r25, 0x0342 ; 0x800342 f810: a0 91 43 03 lds r26, 0x0343 ; 0x800343 f814: b0 91 44 03 lds r27, 0x0344 ; 0x800344 f818: 89 2b or r24, r25 f81a: 8a 2b or r24, r26 f81c: 8b 2b or r24, r27 f81e: 81 f4 brne .+32 ; 0xf840 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; f820: 0f 94 46 0f call 0x21e8c ; 0x21e8c f824: 60 5e subi r22, 0xE0 ; 224 f826: 7c 4f sbci r23, 0xFC ; 252 f828: 8f 4f sbci r24, 0xFF ; 255 f82a: 9f 4f sbci r25, 0xFF ; 255 f82c: 60 93 41 03 sts 0x0341, r22 ; 0x800341 f830: 70 93 42 03 sts 0x0342, r23 ; 0x800342 f834: 80 93 43 03 sts 0x0343, r24 ; 0x800343 f838: 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; f83c: cf ef ldi r28, 0xFF ; 255 f83e: 0f c0 rjmp .+30 ; 0xf85e 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()) f840: 0f 94 46 0f call 0x21e8c ; 0x21e8c f844: 00 91 41 03 lds r16, 0x0341 ; 0x800341 f848: 10 91 42 03 lds r17, 0x0342 ; 0x800342 f84c: 20 91 43 03 lds r18, 0x0343 ; 0x800343 f850: 30 91 44 03 lds r19, 0x0344 ; 0x800344 f854: 60 17 cp r22, r16 f856: 71 07 cpc r23, r17 f858: 82 07 cpc r24, r18 f85a: 93 07 cpc r25, r19 f85c: 78 f3 brcs .-34 ; 0xf83c } 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 f85e: 80 91 84 03 lds r24, 0x0384 ; 0x800384 f862: 88 23 and r24, r24 f864: 09 f4 brne .+2 ; 0xf868 f866: 97 c0 rjmp .+302 ; 0xf996 fanSpeedBckp = tail_fan_speed; f868: 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) { f86c: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> f870: 81 11 cpse r24, r1 f872: 07 c0 rjmp .+14 ; 0xf882 return; } avoidRecursion = true; f874: 81 e0 ldi r24, 0x01 ; 1 f876: 80 93 2d 04 sts 0x042D, r24 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); f87a: 0f 94 f3 64 call 0x2c9e6 ; 0x2c9e6 avoidRecursion = false; f87e: 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) { f882: 80 91 13 06 lds r24, 0x0613 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> f886: 88 23 and r24, r24 f888: c9 f1 breq .+114 ; 0xf8fc lcd_backlight_wake_trigger = false; f88a: 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) { f88e: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); f890: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { f892: 80 91 11 06 lds r24, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> f896: 28 2f mov r18, r24 f898: 08 2e mov r0, r24 f89a: 00 0c add r0, r0 f89c: 33 0b sbc r19, r19 f89e: 37 ff sbrs r19, 7 f8a0: 03 c0 rjmp .+6 ; 0xf8a8 f8a2: 31 95 neg r19 f8a4: 21 95 neg r18 f8a6: 31 09 sbc r19, r1 f8a8: 24 30 cpi r18, 0x04 ; 4 f8aa: 31 05 cpc r19, r1 f8ac: 0c f4 brge .+2 ; 0xf8b0 f8ae: 76 c0 rjmp .+236 ; 0xf99c lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; f8b0: 98 2f mov r25, r24 f8b2: 87 ff sbrs r24, 7 f8b4: 02 c0 rjmp .+4 ; 0xf8ba f8b6: 93 e0 ldi r25, 0x03 ; 3 f8b8: 98 0f add r25, r24 f8ba: 95 95 asr r25 f8bc: 95 95 asr r25 f8be: 20 91 06 05 lds r18, 0x0506 ; 0x800506 f8c2: 30 91 07 05 lds r19, 0x0507 ; 0x800507 f8c6: 29 0f add r18, r25 f8c8: 31 1d adc r19, r1 f8ca: 97 fd sbrc r25, 7 f8cc: 3a 95 dec r19 f8ce: 30 93 07 05 sts 0x0507, r19 ; 0x800507 f8d2: 20 93 06 05 sts 0x0506, r18 ; 0x800506 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; f8d6: 83 78 andi r24, 0x83 ; 131 f8d8: 87 ff sbrs r24, 7 f8da: 03 c0 rjmp .+6 ; 0xf8e2 f8dc: 81 50 subi r24, 0x01 ; 1 f8de: 8c 6f ori r24, 0xFC ; 252 f8e0: 8f 5f subi r24, 0xFF ; 255 f8e2: 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; f8e6: 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); f8e8: 86 e0 ldi r24, 0x06 ; 6 f8ea: 0f 94 71 2c call 0x258e2 ; 0x258e2 if (lcd_draw_update == 0) { f8ee: 80 91 5b 02 lds r24, 0x025B ; 0x80025b f8f2: 81 11 cpse r24, r1 f8f4: 03 c0 rjmp .+6 ; 0xf8fc // Update LCD rendering at minimum lcd_draw_update = 1; f8f6: 81 e0 ldi r24, 0x01 ; 1 f8f8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) f8fc: 80 91 14 06 lds r24, 0x0614 ; 0x800614 f900: 88 23 and r24, r24 f902: 61 f0 breq .+24 ; 0xf91c { lcd_consume_click(); // Reset trigger to prevent recursion f904: 0e 94 1e 6c call 0xd83c ; 0xd83c // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) f908: e0 91 d4 03 lds r30, 0x03D4 ; 0x8003d4 f90c: f0 91 d5 03 lds r31, 0x03D5 ; 0x8003d5 f910: 30 97 sbiw r30, 0x00 ; 0 f912: 21 f0 breq .+8 ; 0xf91c f914: 80 91 5c 02 lds r24, 0x025C ; 0x80025c f918: 81 11 cpse r24, r1 { lcd_longpress_func(); f91a: 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); } f91c: 20 91 62 13 lds r18, 0x1362 ; 0x801362 f920: 30 e0 ldi r19, 0x00 ; 0 f922: a8 ee ldi r26, 0xE8 ; 232 f924: b3 e0 ldi r27, 0x03 ; 3 f926: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> f92a: ab 01 movw r20, r22 f92c: bc 01 movw r22, r24 f92e: 83 e6 ldi r24, 0x63 ; 99 f930: 93 e1 ldi r25, 0x13 ; 19 f932: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f936: 88 23 and r24, r24 f938: 99 f0 breq .+38 ; 0xf960 f93a: 80 91 61 13 lds r24, 0x1361 ; 0x801361 { if(autoReportFeatures.Temp()){ f93e: 80 fd sbrc r24, 0 gcode_M105(); f940: 0e 94 57 72 call 0xe4ae ; 0xe4ae f944: 80 91 61 13 lds r24, 0x1361 ; 0x801361 } if(autoReportFeatures.Pos()){ f948: 82 fd sbrc r24, 2 gcode_M114(); f94a: 0e 94 dc 71 call 0xe3b8 ; 0xe3b8 f94e: 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()){ f952: 81 fd sbrc r24, 1 gcode_M123(); f954: 0e 94 28 60 call 0xc050 ; 0xc050 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f958: 83 e6 ldi r24, 0x63 ; 99 f95a: 93 e1 ldi r25, 0x13 ; 19 f95c: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; f960: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f964: 81 11 cpse r24, r1 f966: 02 c0 rjmp .+4 ; 0xf96c f968: 0e 94 e2 72 call 0xe5c4 ; 0xe5c4 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); f96c: 40 e3 ldi r20, 0x30 ; 48 f96e: 55 e7 ldi r21, 0x75 ; 117 f970: 60 e0 ldi r22, 0x00 ; 0 f972: 70 e0 ldi r23, 0x00 ; 0 f974: 8a e5 ldi r24, 0x5A ; 90 f976: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } f978: df 91 pop r29 f97a: cf 91 pop r28 f97c: 1f 91 pop r17 f97e: 0f 91 pop r16 f980: 0d 94 b4 0f jmp 0x21f68 ; 0x21f68 ::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; f984: 10 92 41 03 sts 0x0341, r1 ; 0x800341 f988: 10 92 42 03 sts 0x0342, r1 ; 0x800342 f98c: 10 92 43 03 sts 0x0343, r1 ; 0x800343 f990: 10 92 44 03 sts 0x0344, r1 ; 0x800344 f994: 64 cf rjmp .-312 ; 0xf85e #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; f996: c0 93 05 05 sts 0x0505, r28 ; 0x800505 f99a: 68 cf rjmp .-304 ; 0xf86c 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; f99c: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> f9a0: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); f9a2: 80 e0 ldi r24, 0x00 ; 0 f9a4: a2 cf rjmp .-188 ; 0xf8ea 0000f9a6 : #endif #endif } void delay_keep_alive(unsigned int ms) { f9a6: cf 93 push r28 f9a8: df 93 push r29 f9aa: ec 01 movw r28, r24 for (;;) { manage_heater(); f9ac: 0f 94 f7 31 call 0x263ee ; 0x263ee // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); f9b0: 81 e0 ldi r24, 0x01 ; 1 f9b2: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); f9b6: 80 e0 ldi r24, 0x00 ; 0 f9b8: 0e 94 cd 69 call 0xd39a ; 0xd39a if (ms == 0) f9bc: 20 97 sbiw r28, 0x00 ; 0 f9be: 99 f0 breq .+38 ; 0xf9e6 break; else if (ms >= 50) { f9c0: c2 33 cpi r28, 0x32 ; 50 f9c2: d1 05 cpc r29, r1 f9c4: 40 f0 brcs .+16 ; 0xf9d6 _delay(50); f9c6: 62 e3 ldi r22, 0x32 ; 50 f9c8: 70 e0 ldi r23, 0x00 ; 0 f9ca: 80 e0 ldi r24, 0x00 ; 0 f9cc: 90 e0 ldi r25, 0x00 ; 0 f9ce: 0f 94 4d 0d call 0x21a9a ; 0x21a9a ms -= 50; f9d2: e2 97 sbiw r28, 0x32 ; 50 f9d4: eb cf rjmp .-42 ; 0xf9ac } else { _delay(ms); f9d6: be 01 movw r22, r28 f9d8: 90 e0 ldi r25, 0x00 ; 0 f9da: 80 e0 ldi r24, 0x00 ; 0 f9dc: 0f 94 4d 0d call 0x21a9a ; 0x21a9a ms = 0; f9e0: d0 e0 ldi r29, 0x00 ; 0 f9e2: c0 e0 ldi r28, 0x00 ; 0 f9e4: e3 cf rjmp .-58 ; 0xf9ac } } } f9e6: df 91 pop r29 f9e8: cf 91 pop r28 f9ea: 08 95 ret 0000f9ec : /// @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) { f9ec: cf 93 push r28 f9ee: df 93 push r29 f9f0: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f9f2: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); f9f4: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); f9f8: 81 e0 ldi r24, 0x01 ; 1 f9fa: 0e 94 8c 7a call 0xf518 ; 0xf518 f9fe: 80 91 92 12 lds r24, 0x1292 ; 0x801292 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) fa02: 8f 3f cpi r24, 0xFF ; 255 fa04: d9 f4 brne .+54 ; 0xfa3c // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { fa06: 80 91 27 12 lds r24, 0x1227 ; 0x801227 fa0a: 84 30 cpi r24, 0x04 ; 4 fa0c: 21 f4 brne .+8 ; 0xfa16 }; 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 fa0e: 80 91 2a 12 lds r24, 0x122A ; 0x80122a fa12: 81 11 cpse r24, r1 fa14: ef cf rjmp .-34 ; 0xf9f4 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 fa16: 80 91 65 12 lds r24, 0x1265 ; 0x801265 fa1a: 90 91 66 12 lds r25, 0x1266 ; 0x801266 fa1e: 01 97 sbiw r24, 0x01 ; 1 fa20: 49 f7 brne .-46 ; 0xf9f4 && lastErrorCode != ec) // The error code is not a duplicate fa22: 80 91 8c 12 lds r24, 0x128C ; 0x80128c fa26: 90 91 8d 12 lds r25, 0x128D ; 0x80128d fa2a: 89 32 cpi r24, 0x29 ; 41 fa2c: 90 48 sbci r25, 0x80 ; 128 fa2e: 11 f3 breq .-60 ; 0xf9f4 { ReportError(ec, ErrorSource::ErrorSourcePrinter); fa30: 60 e0 ldi r22, 0x00 ; 0 fa32: 89 e2 ldi r24, 0x29 ; 41 fa34: 90 e8 ldi r25, 0x80 ; 128 fa36: 0f 94 48 4f call 0x29e90 ; 0x29e90 fa3a: dc cf rjmp .-72 ; 0xf9f4 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; fa3c: d0 93 92 12 sts 0x1292, r29 ; 0x801292 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { fa40: 85 30 cpi r24, 0x05 ; 5 fa42: 39 f4 brne .+14 ; 0xfa52 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { fa44: cf 3f cpi r28, 0xFF ; 255 fa46: f9 f2 breq .-66 ; 0xfa06 MMU2::mmu2.eject_filament(eject_slot, true); fa48: 61 e0 ldi r22, 0x01 ; 1 fa4a: 8c 2f mov r24, r28 fa4c: 0f 94 8f 6b call 0x2d71e ; 0x2d71e fa50: d1 cf rjmp .-94 ; 0xf9f4 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) fa52: 84 30 cpi r24, 0x04 ; 4 fa54: c1 f6 brne .-80 ; 0xfa06 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } fa56: df 91 pop r29 fa58: cf 91 pop r28 fa5a: 08 95 ret 0000fa5c : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) fa5c: cf 93 push r28 fa5e: df 93 push r29 fa60: ec 01 movw r28, r24 { while (*str) fa62: 89 91 ld r24, Y+ fa64: 88 23 and r24, r24 fa66: 19 f0 breq .+6 ; 0xfa6e write(*str++); fa68: 0e 94 cc 70 call 0xe198 ; 0xe198 fa6c: fa cf rjmp .-12 ; 0xfa62 } fa6e: df 91 pop r29 fa70: cf 91 pop r28 fa72: 08 95 ret 0000fa74 : //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) { fa74: ff 92 push r15 fa76: 0f 93 push r16 fa78: 1f 93 push r17 fa7a: cf 93 push r28 fa7c: df 93 push r29 fa7e: ec 01 movw r28, r24 fa80: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); fa82: 66 23 and r22, r22 fa84: 09 f4 brne .+2 ; 0xfa88 fa86: 4b c0 rjmp .+150 ; 0xfb1e #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); fa88: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> fa8c: 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)) { fa8e: c8 01 movw r24, r16 fa90: 0e 94 47 56 call 0xac8e ; 0xac8e fa94: 88 23 and r24, r24 fa96: 09 f4 brne .+2 ; 0xfa9a fa98: 53 c0 rjmp .+166 ; 0xfb40 // 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; fa9a: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> fa9e: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> faa2: fc 01 movw r30, r24 faa4: e2 52 subi r30, 0x22 ; 34 faa6: f0 4f sbci r31, 0xF0 ; 240 faa8: 23 e0 ldi r18, 0x03 ; 3 faaa: 20 83 st Z, r18 faac: 8f 51 subi r24, 0x1F ; 31 faae: 90 4f sbci r25, 0xF0 ; 240 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); fab0: 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) fab2: ff 20 and r15, r15 fab4: e9 f1 breq .+122 ; 0xfb30 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); fab6: 0f 94 34 9e call 0x33c68 ; 0x33c68 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; faba: 87 e7 ldi r24, 0x77 ; 119 fabc: 9e e9 ldi r25, 0x9E ; 158 fabe: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(MSG_Enqueing); fac2: 81 e5 ldi r24, 0x51 ; 81 fac4: 93 e6 ldi r25, 0x63 ; 99 fac6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); faca: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> face: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); fad2: 8f 51 subi r24, 0x1F ; 31 fad4: 90 4f sbci r25, 0xF0 ; 240 fad6: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHOLNPGM("\""); fada: 80 ef ldi r24, 0xF0 ; 240 fadc: 92 e7 ldi r25, 0x72 ; 114 fade: 0e 94 de 72 call 0xe5bc ; 0xe5bc bufindw += len + (CMDHDRSIZE + 1); fae2: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> fae6: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> faea: 04 96 adiw r24, 0x04 ; 4 faec: 08 0f add r16, r24 faee: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) faf0: 0d 3e cpi r16, 0xED ; 237 faf2: 81 e0 ldi r24, 0x01 ; 1 faf4: 18 07 cpc r17, r24 faf6: f9 f0 breq .+62 ; 0xfb36 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); faf8: 10 93 dd 0f sts 0x0FDD, r17 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> fafc: 00 93 dc 0f sts 0x0FDC, r16 ; 0x800fdc <_ZL7bufindw.lto_priv.514> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; fb00: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf fb04: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 fb08: 01 96 adiw r24, 0x01 ; 1 fb0a: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 fb0e: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fb12: df 91 pop r29 fb14: cf 91 pop r28 fb16: 1f 91 pop r17 fb18: 0f 91 pop r16 fb1a: ff 90 pop r15 fb1c: 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); fb1e: fc 01 movw r30, r24 fb20: 01 90 ld r0, Z+ fb22: 00 20 and r0, r0 fb24: e9 f7 brne .-6 ; 0xfb20 fb26: 31 97 sbiw r30, 0x01 ; 1 fb28: 8f 01 movw r16, r30 fb2a: 08 1b sub r16, r24 fb2c: 19 0b sbc r17, r25 fb2e: af cf rjmp .-162 ; 0xfa8e // 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); fb30: 0f 94 e8 a6 call 0x34dd0 ; 0x34dd0 fb34: c2 cf rjmp .-124 ; 0xfaba SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; fb36: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> fb3a: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.514> fb3e: e0 cf rjmp .-64 ; 0xfb00 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; fb40: 8a e5 ldi r24, 0x5A ; 90 fb42: 9e e9 ldi r25, 0x9E ; 158 fb44: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(MSG_Enqueing); fb48: 81 e5 ldi r24, 0x51 ; 81 fb4a: 93 e6 ldi r25, 0x63 ; 99 fb4c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); fb50: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) fb52: ff 20 and r15, r15 fb54: 59 f0 breq .+22 ; 0xfb6c SERIAL_PROTOCOLRPGM(cmd); fb56: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fb5a: 88 e2 ldi r24, 0x28 ; 40 fb5c: 9e e9 ldi r25, 0x9E ; 158 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fb5e: df 91 pop r29 fb60: cf 91 pop r28 fb62: 1f 91 pop r17 fb64: 0f 91 pop r16 fb66: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fb68: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc fb6c: 0e 94 2e 7d call 0xfa5c ; 0xfa5c fb70: f4 cf rjmp .-24 ; 0xfb5a 0000fb72 : { 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) { fb72: 0f 93 push r16 fb74: 1f 93 push r17 fb76: cf 93 push r28 fb78: df 93 push r29 fb7a: d6 2f mov r29, r22 fb7c: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) fb7e: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); fb80: f8 01 movw r30, r16 fb82: 85 91 lpm r24, Z+ fb84: 94 91 lpm r25, Z fb86: 61 e0 ldi r22, 0x01 ; 1 fb88: 0e 94 3a 7d call 0xfa74 ; 0xfa74 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) fb8c: cf 5f subi r28, 0xFF ; 255 fb8e: 0e 5f subi r16, 0xFE ; 254 fb90: 1f 4f sbci r17, 0xFF ; 255 fb92: dc 13 cpse r29, r28 fb94: f5 cf rjmp .-22 ; 0xfb80 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } fb96: df 91 pop r29 fb98: cf 91 pop r28 fb9a: 1f 91 pop r17 fb9c: 0f 91 pop r16 fb9e: 08 95 ret 0000fba0 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { fba0: cf 93 push r28 fba2: df 93 push r29 fba4: cd b7 in r28, 0x3d ; 61 fba6: de b7 in r29, 0x3e ; 62 fba8: 6e 97 sbiw r28, 0x1e ; 30 fbaa: 0f b6 in r0, 0x3f ; 63 fbac: f8 94 cli fbae: de bf out 0x3e, r29 ; 62 fbb0: 0f be out 0x3f, r0 ; 63 fbb2: cd bf out 0x3d, r28 ; 61 fbb4: 9e 01 movw r18, r28 fbb6: 2c 5d subi r18, 0xDC ; 220 fbb8: 3f 4f sbci r19, 0xFF ; 255 fbba: f9 01 movw r30, r18 fbbc: 41 91 ld r20, Z+ fbbe: 51 91 ld r21, Z+ fbc0: 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); fbc2: 6e e1 ldi r22, 0x1E ; 30 fbc4: 70 e0 ldi r23, 0x00 ; 0 fbc6: ce 01 movw r24, r28 fbc8: 01 96 adiw r24, 0x01 ; 1 fbca: 0f 94 d3 9f call 0x33fa6 ; 0x33fa6 va_end(ap); enquecommand(cmd_buffer, false); fbce: 60 e0 ldi r22, 0x00 ; 0 fbd0: ce 01 movw r24, r28 fbd2: 01 96 adiw r24, 0x01 ; 1 fbd4: 0e 94 3a 7d call 0xfa74 ; 0xfa74 } fbd8: 6e 96 adiw r28, 0x1e ; 30 fbda: 0f b6 in r0, 0x3f ; 63 fbdc: f8 94 cli fbde: de bf out 0x3e, r29 ; 62 fbe0: 0f be out 0x3f, r0 ; 63 fbe2: cd bf out 0x3d, r28 ; 61 fbe4: df 91 pop r29 fbe6: cf 91 pop r28 fbe8: 08 95 ret 0000fbea <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { fbea: 1f 92 push r1 fbec: 0f 92 push r0 fbee: 0f b6 in r0, 0x3f ; 63 fbf0: 0f 92 push r0 fbf2: 11 24 eor r1, r1 fbf4: 0b b6 in r0, 0x3b ; 59 fbf6: 0f 92 push r0 fbf8: 2f 93 push r18 fbfa: 3f 93 push r19 fbfc: 4f 93 push r20 fbfe: 5f 93 push r21 fc00: 6f 93 push r22 fc02: 7f 93 push r23 fc04: 8f 93 push r24 fc06: 9f 93 push r25 fc08: af 93 push r26 fc0a: bf 93 push r27 fc0c: ef 93 push r30 fc0e: ff 93 push r31 adc_values[adc_channel] += ADC; fc10: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> fc14: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> fc18: e0 91 16 03 lds r30, 0x0316 ; 0x800316 fc1c: f0 e0 ldi r31, 0x00 ; 0 fc1e: ee 0f add r30, r30 fc20: ff 1f adc r31, r31 fc22: ea 5f subi r30, 0xFA ; 250 fc24: fc 4f sbci r31, 0xFC ; 252 fc26: 80 81 ld r24, Z fc28: 91 81 ldd r25, Z+1 ; 0x01 fc2a: 82 0f add r24, r18 fc2c: 93 1f adc r25, r19 fc2e: 91 83 std Z+1, r25 ; 0x01 fc30: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) fc32: 80 91 05 03 lds r24, 0x0305 ; 0x800305 fc36: 8f 5f subi r24, 0xFF ; 255 fc38: 80 93 05 03 sts 0x0305, r24 ; 0x800305 fc3c: 80 31 cpi r24, 0x10 ; 16 fc3e: e9 f5 brne .+122 ; 0xfcba <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { fc40: 80 91 16 03 lds r24, 0x0316 ; 0x800316 fc44: 8f 5f subi r24, 0xFF ; 255 fc46: 80 93 16 03 sts 0x0316, r24 ; 0x800316 fc4a: 88 30 cpi r24, 0x08 ; 8 fc4c: 71 f5 brne .+92 ; 0xfcaa <__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 fc4e: 80 91 06 03 lds r24, 0x0306 ; 0x800306 fc52: 90 91 07 03 lds r25, 0x0307 ; 0x800307 fc56: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a fc5a: 80 93 49 06 sts 0x0649, r24 ; 0x800649 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; fc5e: 80 91 0a 03 lds r24, 0x030A ; 0x80030a fc62: 90 91 0b 03 lds r25, 0x030B ; 0x80030b fc66: 90 93 4c 06 sts 0x064C, r25 ; 0x80064c fc6a: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; fc6e: 80 91 08 03 lds r24, 0x0308 ; 0x800308 fc72: 90 91 09 03 lds r25, 0x0309 ; 0x800309 fc76: 90 93 48 06 sts 0x0648, r25 ; 0x800648 fc7a: 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; fc7e: 81 e0 ldi r24, 0x01 ; 1 fc80: 80 93 63 06 sts 0x0663, r24 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> break; } } } ADCSRA |= (1 << ADSC); //start conversion } fc84: ff 91 pop r31 fc86: ef 91 pop r30 fc88: bf 91 pop r27 fc8a: af 91 pop r26 fc8c: 9f 91 pop r25 fc8e: 8f 91 pop r24 fc90: 7f 91 pop r23 fc92: 6f 91 pop r22 fc94: 5f 91 pop r21 fc96: 4f 91 pop r20 fc98: 3f 91 pop r19 fc9a: 2f 91 pop r18 fc9c: 0f 90 pop r0 fc9e: 0b be out 0x3b, r0 ; 59 fca0: 0f 90 pop r0 fca2: 0f be out 0x3f, r0 ; 63 fca4: 0f 90 pop r0 fca6: 1f 90 pop r1 fca8: 18 95 reti fcaa: 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)) { fcae: 4f e5 ldi r20, 0x5F ; 95 fcb0: 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) { fcb2: 8f 5f subi r24, 0xFF ; 255 fcb4: 41 f4 brne .+16 ; 0xfcc6 <__vector_29+0xdc> fcb6: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion fcba: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fcbe: 80 64 ori r24, 0x40 ; 64 fcc0: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fcc4: df cf rjmp .-66 ; 0xfc84 <__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)) { fcc6: 9a 01 movw r18, r20 fcc8: 08 2e mov r0, r24 fcca: 02 c0 rjmp .+4 ; 0xfcd0 <__vector_29+0xe6> fccc: 35 95 asr r19 fcce: 27 95 ror r18 fcd0: 0a 94 dec r0 fcd2: e2 f7 brpl .-8 ; 0xfccc <__vector_29+0xe2> fcd4: 20 ff sbrs r18, 0 fcd6: ed cf rjmp .-38 ; 0xfcb2 <__vector_29+0xc8> fcd8: 80 93 04 03 sts 0x0304, r24 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fcdc: 0e 94 58 55 call 0xaab0 ; 0xaab0 adc_count = 0; fce0: 10 92 05 03 sts 0x0305, r1 ; 0x800305 fce4: ea cf rjmp .-44 ; 0xfcba <__vector_29+0xd0> 0000fce6 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { fce6: cf 93 push r28 fce8: 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 fcea: ca e7 ldi r28, 0x7A ; 122 fcec: d0 e0 ldi r29, 0x00 ; 0 fcee: 88 81 ld r24, Y fcf0: 8f 7b andi r24, 0xBF ; 191 fcf2: 88 83 st Y, r24 adc_count = 0; fcf4: 10 92 05 03 sts 0x0305, r1 ; 0x800305 adc_channel = 0; fcf8: 10 92 16 03 sts 0x0316, r1 ; 0x800316 adc_channel_idx = first_channel_idx; fcfc: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fd00: 80 e0 ldi r24, 0x00 ; 0 fd02: 0e 94 58 55 call 0xaab0 ; 0xaab0 memset((void*)adc_values, 0, sizeof(adc_values)); fd06: e6 e0 ldi r30, 0x06 ; 6 fd08: f3 e0 ldi r31, 0x03 ; 3 fd0a: 80 e1 ldi r24, 0x10 ; 16 fd0c: df 01 movw r26, r30 fd0e: 1d 92 st X+, r1 fd10: 8a 95 dec r24 fd12: e9 f7 brne .-6 ; 0xfd0e ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion fd14: 88 81 ld r24, Y fd16: 80 64 ori r24, 0x40 ; 64 fd18: 88 83 st Y, r24 } fd1a: df 91 pop r29 fd1c: cf 91 pop r28 fd1e: 08 95 ret 0000fd20 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fd20: 2f 92 push r2 fd22: 3f 92 push r3 fd24: 4f 92 push r4 fd26: 5f 92 push r5 fd28: 6f 92 push r6 fd2a: 7f 92 push r7 fd2c: 8f 92 push r8 fd2e: 9f 92 push r9 fd30: af 92 push r10 fd32: bf 92 push r11 fd34: cf 92 push r12 fd36: df 92 push r13 fd38: ef 92 push r14 fd3a: ff 92 push r15 fd3c: 0f 93 push r16 fd3e: 1f 93 push r17 fd40: cf 93 push r28 fd42: df 93 push r29 fd44: cd b7 in r28, 0x3d ; 61 fd46: de b7 in r29, 0x3e ; 62 fd48: a4 97 sbiw r28, 0x24 ; 36 fd4a: 0f b6 in r0, 0x3f ; 63 fd4c: f8 94 cli fd4e: de bf out 0x3e, r29 ; 62 fd50: 0f be out 0x3f, r0 ; 63 fd52: 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(); fd54: 0f 94 14 22 call 0x24428 ; 0x24428 if (planner_aborted) fd58: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac fd5c: 81 11 cpse r24, r1 fd5e: 17 c0 rjmp .+46 ; 0xfd8e return; mesh_bed_leveling_flag = true; fd60: 81 e0 ldi r24, 0x01 ; 1 fd62: 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])) { fd66: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 fd6a: 88 23 and r24, r24 fd6c: 49 f0 breq .+18 ; 0xfd80 fd6e: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 fd72: 88 23 and r24, r24 fd74: 29 f0 breq .+10 ; 0xfd80 fd76: 20 91 a5 06 lds r18, 0x06A5 ; 0x8006a5 fd7a: 2f 83 std Y+7, r18 ; 0x07 fd7c: 21 11 cpse r18, r1 fd7e: 20 c0 rjmp .+64 ; 0xfdc0 // 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; fd80: 81 e0 ldi r24, 0x01 ; 1 fd82: 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); fd86: 86 eb ldi r24, 0xB6 ; 182 fd88: 98 e6 ldi r25, 0x68 ; 104 fd8a: 0f 94 f5 42 call 0x285ea ; 0x285ea custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fd8e: a4 96 adiw r28, 0x24 ; 36 fd90: 0f b6 in r0, 0x3f ; 63 fd92: f8 94 cli fd94: de bf out 0x3e, r29 ; 62 fd96: 0f be out 0x3f, r0 ; 63 fd98: cd bf out 0x3d, r28 ; 61 fd9a: df 91 pop r29 fd9c: cf 91 pop r28 fd9e: 1f 91 pop r17 fda0: 0f 91 pop r16 fda2: ff 90 pop r15 fda4: ef 90 pop r14 fda6: df 90 pop r13 fda8: cf 90 pop r12 fdaa: bf 90 pop r11 fdac: af 90 pop r10 fdae: 9f 90 pop r9 fdb0: 8f 90 pop r8 fdb2: 7f 90 pop r7 fdb4: 6f 90 pop r6 fdb6: 5f 90 pop r5 fdb8: 4f 90 pop r4 fdba: 3f 90 pop r3 fdbc: 2f 90 pop r2 fdbe: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fdc0: 8b ea ldi r24, 0xAB ; 171 fdc2: 9d e0 ldi r25, 0x0D ; 13 fdc4: 0f 94 7d a0 call 0x340fa ; 0x340fa fdc8: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fdca: 8e e4 ldi r24, 0x4E ; 78 fdcc: 0e 94 b6 55 call 0xab6c ; 0xab6c fdd0: 08 2f mov r16, r24 fdd2: 0e 94 cb 55 call 0xab96 ; 0xab96 fdd6: 8e 83 std Y+6, r24 ; 0x06 fdd8: 00 23 and r16, r16 fdda: 29 f0 breq .+10 ; 0xfde6 fddc: 87 30 cpi r24, 0x07 ; 7 fdde: 09 f4 brne .+2 ; 0xfde2 fde0: c9 c0 rjmp .+402 ; 0xff74 fde2: 83 30 cpi r24, 0x03 ; 3 fde4: 29 f0 breq .+10 ; 0xfdf0 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; fde6: 13 30 cpi r17, 0x03 ; 3 fde8: 09 f0 breq .+2 ; 0xfdec fdea: c3 c0 rjmp .+390 ; 0xff72 fdec: 63 e0 ldi r22, 0x03 ; 3 fdee: 6e 83 std Y+6, r22 ; 0x06 fdf0: 80 e0 ldi r24, 0x00 ; 0 fdf2: 90 e0 ldi r25, 0x00 ; 0 fdf4: a0 e8 ldi r26, 0x80 ; 128 fdf6: bf e3 ldi r27, 0x3F ; 63 fdf8: 8a 83 std Y+2, r24 ; 0x02 fdfa: 9b 83 std Y+3, r25 ; 0x03 fdfc: ac 83 std Y+4, r26 ; 0x04 fdfe: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fe00: 8a ea ldi r24, 0xAA ; 170 fe02: 9d e0 ldi r25, 0x0D ; 13 fe04: 0f 94 7d a0 call 0x340fa ; 0x340fa fe08: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fe0a: 83 e4 ldi r24, 0x43 ; 67 fe0c: 0e 94 b6 55 call 0xab6c ; 0xab6c fe10: 18 2f mov r17, r24 fe12: 0e 94 cb 55 call 0xab96 ; 0xab96 fe16: 11 23 and r17, r17 fe18: 29 f0 breq .+10 ; 0xfe24 fe1a: 88 23 and r24, r24 fe1c: 19 f0 breq .+6 ; 0xfe24 fe1e: 8b 30 cpi r24, 0x0B ; 11 fe20: 08 f4 brcc .+2 ; 0xfe24 fe22: 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; fe24: 88 e5 ldi r24, 0x58 ; 88 fe26: 0e 94 b6 55 call 0xab6c ; 0xab6c fe2a: 88 23 and r24, r24 fe2c: 09 f4 brne .+2 ; 0xfe30 fe2e: ab c0 rjmp .+342 ; 0xff86 fe30: 0e 94 8e 5a call 0xb51c ; 0xb51c fe34: 20 e0 ldi r18, 0x00 ; 0 fe36: 30 e0 ldi r19, 0x00 ; 0 fe38: 48 e0 ldi r20, 0x08 ; 8 fe3a: 52 e4 ldi r21, 0x42 ; 66 fe3c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> fe40: 20 e0 ldi r18, 0x00 ; 0 fe42: 30 e0 ldi r19, 0x00 ; 0 fe44: 48 eb ldi r20, 0xB8 ; 184 fe46: 51 e4 ldi r21, 0x41 ; 65 fe48: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> fe4c: 6a 87 std Y+10, r22 ; 0x0a fe4e: 7b 87 std Y+11, r23 ; 0x0b fe50: 8c 87 std Y+12, r24 ; 0x0c fe52: 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; fe54: 89 e5 ldi r24, 0x59 ; 89 fe56: 0e 94 b6 55 call 0xab6c ; 0xab6c fe5a: 88 23 and r24, r24 fe5c: 09 f4 brne .+2 ; 0xfe60 fe5e: 9c c0 rjmp .+312 ; 0xff98 fe60: 0e 94 8e 5a call 0xb51c ; 0xb51c fe64: 20 e0 ldi r18, 0x00 ; 0 fe66: 30 e0 ldi r19, 0x00 ; 0 fe68: 48 e0 ldi r20, 0x08 ; 8 fe6a: 52 e4 ldi r21, 0x42 ; 66 fe6c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> fe70: 20 e0 ldi r18, 0x00 ; 0 fe72: 30 e0 ldi r19, 0x00 ; 0 fe74: 40 ea ldi r20, 0xA0 ; 160 fe76: 50 e4 ldi r21, 0x40 ; 64 fe78: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> fe7c: 6c 8b std Y+20, r22 ; 0x14 fe7e: 7d 8b std Y+21, r23 ; 0x15 fe80: 8e 8b std Y+22, r24 ; 0x16 fe82: 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; fe84: 87 e5 ldi r24, 0x57 ; 87 fe86: 0e 94 b6 55 call 0xab6c ; 0xab6c fe8a: 88 23 and r24, r24 fe8c: 09 f4 brne .+2 ; 0xfe90 fe8e: 89 c0 rjmp .+274 ; 0xffa2 fe90: 0e 94 8e 5a call 0xb51c ; 0xb51c fe94: 2a 85 ldd r18, Y+10 ; 0x0a fe96: 3b 85 ldd r19, Y+11 ; 0x0b fe98: 4c 85 ldd r20, Y+12 ; 0x0c fe9a: 5d 85 ldd r21, Y+13 ; 0x0d fe9c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> fea0: 20 e0 ldi r18, 0x00 ; 0 fea2: 30 e0 ldi r19, 0x00 ; 0 fea4: 48 e8 ldi r20, 0x88 ; 136 fea6: 52 e4 ldi r21, 0x42 ; 66 fea8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> feac: 69 8f std Y+25, r22 ; 0x19 feae: 7a 8f std Y+26, r23 ; 0x1a feb0: 8b 8f std Y+27, r24 ; 0x1b feb2: 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; feb4: 88 e4 ldi r24, 0x48 ; 72 feb6: 0e 94 b6 55 call 0xab6c ; 0xab6c feba: 88 23 and r24, r24 febc: 09 f4 brne .+2 ; 0xfec0 febe: 7a c0 rjmp .+244 ; 0xffb4 fec0: 0e 94 8e 5a call 0xb51c ; 0xb51c fec4: 2c 89 ldd r18, Y+20 ; 0x14 fec6: 3d 89 ldd r19, Y+21 ; 0x15 fec8: 4e 89 ldd r20, Y+22 ; 0x16 feca: 5f 89 ldd r21, Y+23 ; 0x17 fecc: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> fed0: 20 e0 ldi r18, 0x00 ; 0 fed2: 30 e0 ldi r19, 0x00 ; 0 fed4: 48 e8 ldi r20, 0x88 ; 136 fed6: 52 e4 ldi r21, 0x42 ; 66 fed8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> fedc: 6d 8f std Y+29, r22 ; 0x1d fede: 7e 8f std Y+30, r23 ; 0x1e fee0: 8f 8f std Y+31, r24 ; 0x1f fee2: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fee4: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 mbl.z_values[0][0] = min_pos[Z_AXIS]; fee8: 80 91 2c 02 lds r24, 0x022C ; 0x80022c feec: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fef0: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fef4: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fef8: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d fefc: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e ff00: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f ff04: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); ff08: 0f 94 ac 8b call 0x31758 ; 0x31758 ff0c: 05 ec ldi r16, 0xC5 ; 197 ff0e: 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) ff10: c8 01 movw r24, r16 ff12: 0f 94 8b a0 call 0x34116 ; 0x34116 ff16: 01 96 adiw r24, 0x01 ; 1 ff18: 09 f0 breq .+2 ; 0xff1c ff1a: 51 c0 rjmp .+162 ; 0xffbe ff1c: 0e 5f subi r16, 0xFE ; 254 ff1e: 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) { ff20: 05 3d cpi r16, 0xD5 ; 213 ff22: 8f e0 ldi r24, 0x0F ; 15 ff24: 18 07 cpc r17, r24 ff26: a1 f7 brne .-24 ; 0xff10 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; ff28: 21 2c mov r2, r1 ff2a: ac e9 ldi r26, 0x9C ; 156 ff2c: b2 e1 ldi r27, 0x12 ; 18 ff2e: ba a3 std Y+34, r27 ; 0x22 ff30: 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; ff32: b9 87 std Y+9, r27 ; 0x09 ff34: a8 87 std Y+8, r26 ; 0x08 ff36: 51 2c mov r5, r1 ff38: 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; ff3a: 31 2c mov r3, r1 ff3c: 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)); ff3e: 84 2d mov r24, r4 ff40: 63 e0 ldi r22, 0x03 ; 3 ff42: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> ff46: 98 8b std Y+16, r25 ; 0x10 ff48: 68 84 ldd r6, Y+8 ; 0x08 ff4a: 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++) { ff4c: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); ff4e: f8 89 ldd r31, Y+16 ; 0x10 ff50: f1 11 cpse r31, r1 ff52: 37 c0 rjmp .+110 ; 0xffc2 ff54: 81 2f mov r24, r17 ff56: 63 e0 ldi r22, 0x03 ; 3 ff58: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> ff5c: 91 11 cpse r25, r1 ff5e: 31 c0 rjmp .+98 ; 0xffc2 if (isOn3x3Mesh) { if (has_z && (row || col)) { ff60: 21 10 cpse r2, r1 ff62: 3f c1 rjmp .+638 ; 0x101e2 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { ff64: 7e 81 ldd r23, Y+6 ; 0x06 ff66: 73 30 cpi r23, 0x03 ; 3 ff68: 09 f4 brne .+2 ; 0xff6c ff6a: 70 c0 rjmp .+224 ; 0x1004c ff6c: 8f 81 ldd r24, Y+7 ; 0x07 ff6e: 8e 87 std Y+14, r24 ; 0x0e ff70: 37 c0 rjmp .+110 ; 0xffe0 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; ff72: 1e 83 std Y+6, r17 ; 0x06 ff74: 6a e9 ldi r22, 0x9A ; 154 ff76: 79 e9 ldi r23, 0x99 ; 153 ff78: 89 e1 ldi r24, 0x19 ; 25 ff7a: 9f e3 ldi r25, 0x3F ; 63 ff7c: 6a 83 std Y+2, r22 ; 0x02 ff7e: 7b 83 std Y+3, r23 ; 0x03 ff80: 8c 83 std Y+4, r24 ; 0x04 ff82: 9d 83 std Y+5, r25 ; 0x05 ff84: 3d cf rjmp .-390 ; 0xfe00 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; ff86: 80 e0 ldi r24, 0x00 ; 0 ff88: 90 e0 ldi r25, 0x00 ; 0 ff8a: a0 e8 ldi r26, 0x80 ; 128 ff8c: bf ef ldi r27, 0xFF ; 255 ff8e: 8a 87 std Y+10, r24 ; 0x0a ff90: 9b 87 std Y+11, r25 ; 0x0b ff92: ac 87 std Y+12, r26 ; 0x0c ff94: bd 87 std Y+13, r27 ; 0x0d ff96: 5e cf rjmp .-324 ; 0xfe54 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; ff98: 60 e0 ldi r22, 0x00 ; 0 ff9a: 70 e0 ldi r23, 0x00 ; 0 ff9c: 80 e8 ldi r24, 0x80 ; 128 ff9e: 9f ef ldi r25, 0xFF ; 255 ffa0: 6d cf rjmp .-294 ; 0xfe7c const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; ffa2: 80 e0 ldi r24, 0x00 ; 0 ffa4: 90 e0 ldi r25, 0x00 ; 0 ffa6: a0 e8 ldi r26, 0x80 ; 128 ffa8: bf e7 ldi r27, 0x7F ; 127 ffaa: 89 8f std Y+25, r24 ; 0x19 ffac: 9a 8f std Y+26, r25 ; 0x1a ffae: ab 8f std Y+27, r26 ; 0x1b ffb0: bc 8f std Y+28, r27 ; 0x1c ffb2: 80 cf rjmp .-256 ; 0xfeb4 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; ffb4: 60 e0 ldi r22, 0x00 ; 0 ffb6: 70 e0 ldi r23, 0x00 ; 0 ffb8: 80 e8 ldi r24, 0x80 ; 128 ffba: 9f e7 ldi r25, 0x7F ; 127 ffbc: 8f cf rjmp .-226 ; 0xfedc ffbe: 2f 80 ldd r2, Y+7 ; 0x07 ffc0: b4 cf rjmp .-152 ; 0xff2a 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; } ffc2: 60 e0 ldi r22, 0x00 ; 0 ffc4: 70 e0 ldi r23, 0x00 ; 0 ffc6: 80 ec ldi r24, 0xC0 ; 192 ffc8: 9f e7 ldi r25, 0x7F ; 127 ffca: d3 01 movw r26, r6 ffcc: 11 96 adiw r26, 0x01 ; 1 ffce: 6d 93 st X+, r22 ffd0: 7d 93 st X+, r23 ffd2: 8d 93 st X+, r24 ffd4: 9c 93 st X, r25 ffd6: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { ffd8: be 81 ldd r27, Y+6 ; 0x06 ffda: b3 30 cpi r27, 0x03 ; 3 ffdc: c1 f1 breq .+112 ; 0x1004e ffde: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); ffe0: 81 2f mov r24, r17 ffe2: 0f 94 06 8c call 0x3180c ; 0x3180c ffe6: 4b 01 movw r8, r22 ffe8: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); ffea: 80 2f mov r24, r16 ffec: 0f 94 06 8c call 0x3180c ; 0x3180c fff0: 6b 01 movw r12, r22 fff2: 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)) { fff4: a5 01 movw r20, r10 fff6: 94 01 movw r18, r8 fff8: 6a 85 ldd r22, Y+10 ; 0x0a fffa: 7b 85 ldd r23, Y+11 ; 0x0b fffc: 8c 85 ldd r24, Y+12 ; 0x0c fffe: 9d 85 ldd r25, Y+13 ; 0x0d 10000: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10004: 18 16 cp r1, r24 10006: 0c f4 brge .+2 ; 0x1000a 10008: 1c c1 rjmp .+568 ; 0x10242 1000a: 29 8d ldd r18, Y+25 ; 0x19 1000c: 3a 8d ldd r19, Y+26 ; 0x1a 1000e: 4b 8d ldd r20, Y+27 ; 0x1b 10010: 5c 8d ldd r21, Y+28 ; 0x1c 10012: c5 01 movw r24, r10 10014: b4 01 movw r22, r8 10016: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1001a: 18 16 cp r1, r24 1001c: 0c f4 brge .+2 ; 0x10020 1001e: 11 c1 rjmp .+546 ; 0x10242 10020: a7 01 movw r20, r14 10022: 96 01 movw r18, r12 10024: 6c 89 ldd r22, Y+20 ; 0x14 10026: 7d 89 ldd r23, Y+21 ; 0x15 10028: 8e 89 ldd r24, Y+22 ; 0x16 1002a: 9f 89 ldd r25, Y+23 ; 0x17 1002c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10030: 18 16 cp r1, r24 10032: 0c f4 brge .+2 ; 0x10036 10034: 06 c1 rjmp .+524 ; 0x10242 10036: 2d 8d ldd r18, Y+29 ; 0x1d 10038: 3e 8d ldd r19, Y+30 ; 0x1e 1003a: 4f 8d ldd r20, Y+31 ; 0x1f 1003c: 58 a1 ldd r21, Y+32 ; 0x20 1003e: c7 01 movw r24, r14 10040: b6 01 movw r22, r12 10042: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10046: 18 16 cp r1, r24 10048: 0c f4 brge .+2 ; 0x1004c 1004a: fb c0 rjmp .+502 ; 0x10242 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 1004c: 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++) { 1004e: 1f 5f subi r17, 0xFF ; 255 10050: 24 e0 ldi r18, 0x04 ; 4 10052: 62 0e add r6, r18 10054: 71 1c adc r7, r1 10056: 17 30 cpi r17, 0x07 ; 7 10058: 09 f0 breq .+2 ; 0x1005c 1005a: 79 cf rjmp .-270 ; 0xff4e 1005c: 6f ef ldi r22, 0xFF ; 255 1005e: 46 1a sub r4, r22 10060: 56 0a sbc r5, r22 10062: 88 85 ldd r24, Y+8 ; 0x08 10064: 99 85 ldd r25, Y+9 ; 0x09 10066: 4c 96 adiw r24, 0x1c ; 28 10068: 99 87 std Y+9, r25 ; 0x09 1006a: 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++) { 1006c: 97 e0 ldi r25, 0x07 ; 7 1006e: 49 16 cp r4, r25 10070: 51 04 cpc r5, r1 10072: 09 f0 breq .+2 ; 0x10076 10074: 63 cf rjmp .-314 ; 0xff3c // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 10076: 0e 94 ce f0 call 0x1e19c ; 0x1e19c // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 1007a: a0 91 c7 06 lds r26, 0x06C7 ; 0x8006c7 1007e: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 10080: b0 91 ac 03 lds r27, 0x03AC ; 0x8003ac 10084: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 10086: 81 e0 ldi r24, 0x01 ; 1 10088: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = meshPointsToProbe + 10; 1008c: 8a e0 ldi r24, 0x0A ; 10 1008e: 83 0d add r24, r3 10090: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_update(1); 10094: 81 e0 ldi r24, 0x01 ; 1 10096: 0e 94 cd 69 call 0xd39a ; 0xd39a // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1009a: 80 e0 ldi r24, 0x00 ; 0 1009c: 90 e0 ldi r25, 0x00 ; 0 1009e: a0 ea ldi r26, 0xA0 ; 160 100a0: b0 e4 ldi r27, 0x40 ; 64 100a2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 100a6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 100aa: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 100ae: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 100b2: 65 e5 ldi r22, 0x55 ; 85 100b4: 75 e5 ldi r23, 0x55 ; 85 100b6: 85 e5 ldi r24, 0x55 ; 85 100b8: 91 e4 ldi r25, 0x41 ; 65 100ba: 0f 94 11 85 call 0x30a22 ; 0x30a22 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 100be: 80 e0 ldi r24, 0x00 ; 0 100c0: 0e 94 79 60 call 0xc0f2 ; 0xc0f2 100c4: 9c a3 std Y+36, r25 ; 0x24 100c6: 8b a3 std Y+35, r24 ; 0x23 100c8: 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 100ca: 83 2d mov r24, r3 100cc: 67 e0 ldi r22, 0x07 ; 7 100ce: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 100d2: f8 2e mov r15, r24 100d4: 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 100d6: 68 2f mov r22, r24 100d8: 70 e0 ldi r23, 0x00 ; 0 100da: 7f 87 std Y+15, r23 ; 0x0f 100dc: 6e 87 std Y+14, r22 ; 0x0e 100de: 80 ff sbrs r24, 0 100e0: 03 c0 rjmp .+6 ; 0x100e8 100e2: 76 e0 ldi r23, 0x06 ; 6 100e4: 79 1b sub r23, r25 100e6: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 100e8: 80 2f mov r24, r16 100ea: 63 e0 ldi r22, 0x03 ; 3 100ec: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 100f0: 91 11 cpse r25, r1 100f2: 05 c0 rjmp .+10 ; 0x100fe 100f4: 8f 2d mov r24, r15 100f6: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 100fa: 11 e0 ldi r17, 0x01 ; 1 100fc: 91 11 cpse r25, r1 100fe: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 10100: 80 2f mov r24, r16 10102: 0f 94 06 8c call 0x3180c ; 0x3180c 10106: 68 8b std Y+16, r22 ; 0x10 10108: 79 8b std Y+17, r23 ; 0x11 1010a: 8a 8b std Y+18, r24 ; 0x12 1010c: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 1010e: 8f 2d mov r24, r15 10110: 0f 94 06 8c call 0x3180c ; 0x3180c 10114: 4b 01 movw r8, r22 10116: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 10118: 8e 81 ldd r24, Y+6 ; 0x06 1011a: 83 30 cpi r24, 0x03 ; 3 1011c: 09 f0 breq .+2 ; 0x10120 1011e: 99 c0 rjmp .+306 ; 0x10252 if (!isOn3x3Mesh) { 10120: 11 11 cpse r17, r1 10122: c8 c0 rjmp .+400 ; 0x102b4 10124: 27 e0 ldi r18, 0x07 ; 7 10126: ae 85 ldd r26, Y+14 ; 0x0e 10128: bf 85 ldd r27, Y+15 ; 0x0f 1012a: 2a 9f mul r18, r26 1012c: f0 01 movw r30, r0 1012e: 2b 9f mul r18, r27 10130: f0 0d add r31, r0 10132: 11 24 eor r1, r1 10134: e0 0f add r30, r16 10136: f1 1d adc r31, r1 10138: ee 0f add r30, r30 1013a: ff 1f adc r31, r31 1013c: ee 0f add r30, r30 1013e: ff 1f adc r31, r31 10140: e4 56 subi r30, 0x64 ; 100 10142: fd 4e sbci r31, 0xED ; 237 10144: 60 e0 ldi r22, 0x00 ; 0 10146: 70 e0 ldi r23, 0x00 ; 0 10148: 80 ec ldi r24, 0xC0 ; 192 1014a: 9f e7 ldi r25, 0x7F ; 127 1014c: 61 83 std Z+1, r22 ; 0x01 1014e: 72 83 std Z+2, r23 ; 0x02 10150: 83 83 std Z+3, r24 ; 0x03 10152: 94 83 std Z+4, r25 ; 0x04 10154: 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) { 10156: e1 e3 ldi r30, 0x31 ; 49 10158: 3e 12 cpse r3, r30 1015a: b7 cf rjmp .-146 ; 0x100ca custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1015c: 80 e0 ldi r24, 0x00 ; 0 1015e: 90 e0 ldi r25, 0x00 ; 0 10160: a0 ea ldi r26, 0xA0 ; 160 10162: b0 e4 ldi r27, 0x40 ; 64 10164: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 10168: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1016c: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 10170: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10174: 65 e5 ldi r22, 0x55 ; 85 10176: 75 e5 ldi r23, 0x55 ; 85 10178: 85 e5 ldi r24, 0x55 ; 85 1017a: 91 e4 ldi r25, 0x41 ; 65 1017c: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 10180: 0f 94 14 22 call 0x24428 ; 0x24428 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 10184: b1 e3 ldi r27, 0x31 ; 49 10186: 3b 16 cp r3, r27 10188: 09 f4 brne .+2 ; 0x1018c 1018a: 3c c2 rjmp .+1144 ; 0x10604 if (g80_fail_cnt++ >= 1) { 1018c: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10190: 91 e0 ldi r25, 0x01 ; 1 10192: 98 0f add r25, r24 10194: 90 93 3f 03 sts 0x033F, r25 ; 0x80033f 10198: 88 23 and r24, r24 1019a: 09 f4 brne .+2 ; 0x1019e 1019c: d3 c1 rjmp .+934 ; 0x10544 print_stop(); 1019e: 60 e0 ldi r22, 0x00 ; 0 101a0: 80 e0 ldi r24, 0x00 ; 0 101a2: 0e 94 64 ef call 0x1dec8 ; 0x1dec8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 101a6: 84 e3 ldi r24, 0x34 ; 52 101a8: 96 e3 ldi r25, 0x36 ; 54 101aa: 0e 94 3c 6d call 0xda78 ; 0xda78 101ae: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_z_calibration_prompt(false); 101b2: 80 e0 ldi r24, 0x00 ; 0 101b4: 0f 94 4d 2f call 0x25e9a ; 0x25e9a current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 101b8: 81 e0 ldi r24, 0x01 ; 1 101ba: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 101be: 8b e0 ldi r24, 0x0B ; 11 101c0: 9c e6 ldi r25, 0x6C ; 108 101c2: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = custom_message_type_old; 101c6: 2f 81 ldd r18, Y+7 ; 0x07 101c8: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 custom_message_state = custom_message_state_old; 101cc: 68 85 ldd r22, Y+8 ; 0x08 101ce: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac lcd_update(2); 101d2: 82 e0 ldi r24, 0x02 ; 2 101d4: 0e 94 cd 69 call 0xd39a ; 0xd39a st_synchronize(); 101d8: 0f 94 14 22 call 0x24428 ; 0x24428 mesh_bed_leveling_flag = false; 101dc: 10 92 06 12 sts 0x1206, r1 ; 0x801206 101e0: d6 cd rjmp .-1108 ; 0xfd8e 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)) { 101e2: 01 11 cpse r16, r1 101e4: 03 c0 rjmp .+6 ; 0x101ec 101e6: 11 23 and r17, r17 101e8: 09 f4 brne .+2 ; 0x101ec 101ea: bc ce rjmp .-648 ; 0xff64 // 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))); 101ec: 81 2f mov r24, r17 101ee: 63 e0 ldi r22, 0x03 ; 3 101f0: 0f 94 38 a1 call 0x34270 ; 0x34270 <__divmodqi4> 101f4: 84 0d add r24, r4 101f6: 95 2d mov r25, r5 101f8: 91 1d adc r25, r1 101fa: 88 0f add r24, r24 101fc: 99 1f adc r25, r25 101fe: 8d 53 subi r24, 0x3D ; 61 10200: 90 4f sbci r25, 0xF0 ; 240 10202: 0f 94 8b a0 call 0x34116 ; 0x34116 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 10206: bc 01 movw r22, r24 10208: 99 0f add r25, r25 1020a: 88 0b sbc r24, r24 1020c: 99 0b sbc r25, r25 1020e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 10212: 2a e0 ldi r18, 0x0A ; 10 10214: 37 ed ldi r19, 0xD7 ; 215 10216: 43 e2 ldi r20, 0x23 ; 35 10218: 5c e3 ldi r21, 0x3C ; 60 1021a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1021e: 9b 01 movw r18, r22 10220: ac 01 movw r20, r24 10222: 60 91 9d 12 lds r22, 0x129D ; 0x80129d 10226: 70 91 9e 12 lds r23, 0x129E ; 0x80129e 1022a: 80 91 9f 12 lds r24, 0x129F ; 0x80129f 1022e: 90 91 a0 12 lds r25, 0x12A0 ; 0x8012a0 10232: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 10236: f3 01 movw r30, r6 10238: 61 83 std Z+1, r22 ; 0x01 1023a: 72 83 std Z+2, r23 ; 0x02 1023c: 83 83 std Z+3, r24 ; 0x03 1023e: 94 83 std Z+4, r25 ; 0x04 10240: 91 ce rjmp .-734 ; 0xff64 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)) { 10242: fe 85 ldd r31, Y+14 ; 0x0e 10244: ff 23 and r31, r31 10246: 09 f4 brne .+2 ; 0x1024a 10248: 02 cf rjmp .-508 ; 0x1004e 1024a: 22 20 and r2, r2 1024c: 09 f4 brne .+2 ; 0x10250 1024e: fe ce rjmp .-516 ; 0x1004c 10250: fe ce rjmp .-516 ; 0x1004e 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)) { 10252: 28 89 ldd r18, Y+16 ; 0x10 10254: 39 89 ldd r19, Y+17 ; 0x11 10256: 4a 89 ldd r20, Y+18 ; 0x12 10258: 5b 89 ldd r21, Y+19 ; 0x13 1025a: 6a 85 ldd r22, Y+10 ; 0x0a 1025c: 7b 85 ldd r23, Y+11 ; 0x0b 1025e: 8c 85 ldd r24, Y+12 ; 0x0c 10260: 9d 85 ldd r25, Y+13 ; 0x0d 10262: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10266: 18 16 cp r1, r24 10268: 04 f1 brlt .+64 ; 0x102aa 1026a: 28 89 ldd r18, Y+16 ; 0x10 1026c: 39 89 ldd r19, Y+17 ; 0x11 1026e: 4a 89 ldd r20, Y+18 ; 0x12 10270: 5b 89 ldd r21, Y+19 ; 0x13 10272: 69 8d ldd r22, Y+25 ; 0x19 10274: 7a 8d ldd r23, Y+26 ; 0x1a 10276: 8b 8d ldd r24, Y+27 ; 0x1b 10278: 9c 8d ldd r25, Y+28 ; 0x1c 1027a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1027e: 87 fd sbrc r24, 7 10280: 14 c0 rjmp .+40 ; 0x102aa 10282: a5 01 movw r20, r10 10284: 94 01 movw r18, r8 10286: 6c 89 ldd r22, Y+20 ; 0x14 10288: 7d 89 ldd r23, Y+21 ; 0x15 1028a: 8e 89 ldd r24, Y+22 ; 0x16 1028c: 9f 89 ldd r25, Y+23 ; 0x17 1028e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10292: 18 16 cp r1, r24 10294: 54 f0 brlt .+20 ; 0x102aa 10296: a5 01 movw r20, r10 10298: 94 01 movw r18, r8 1029a: 6d 8d ldd r22, Y+29 ; 0x1d 1029c: 7e 8d ldd r23, Y+30 ; 0x1e 1029e: 8f 8d ldd r24, Y+31 ; 0x1f 102a0: 98 a1 ldd r25, Y+32 ; 0x20 102a2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 102a6: 87 ff sbrs r24, 7 102a8: 05 c0 rjmp .+10 ; 0x102b4 102aa: 11 23 and r17, r17 102ac: 09 f4 brne .+2 ; 0x102b0 102ae: 52 cf rjmp .-348 ; 0x10154 102b0: 21 10 cpse r2, r1 102b2: 50 cf rjmp .-352 ; 0x10154 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 102b4: 10 e0 ldi r17, 0x00 ; 0 102b6: a7 e0 ldi r26, 0x07 ; 7 102b8: 8e 85 ldd r24, Y+14 ; 0x0e 102ba: 9f 85 ldd r25, Y+15 ; 0x0f 102bc: a8 9f mul r26, r24 102be: f0 01 movw r30, r0 102c0: a9 9f mul r26, r25 102c2: f0 0d add r31, r0 102c4: 11 24 eor r1, r1 102c6: e0 0f add r30, r16 102c8: f1 1f adc r31, r17 102ca: ee 0f add r30, r30 102cc: ff 1f adc r31, r31 102ce: ee 0f add r30, r30 102d0: ff 1f adc r31, r31 102d2: e4 56 subi r30, 0x64 ; 100 102d4: fd 4e sbci r31, 0xED ; 237 102d6: 41 80 ldd r4, Z+1 ; 0x01 102d8: 52 80 ldd r5, Z+2 ; 0x02 102da: 63 80 ldd r6, Z+3 ; 0x03 102dc: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 102de: c1 2c mov r12, r1 102e0: d1 2c mov r13, r1 102e2: e0 ea ldi r30, 0xA0 ; 160 102e4: ee 2e mov r14, r30 102e6: e0 e4 ldi r30, 0x40 ; 64 102e8: fe 2e mov r15, r30 102ea: 22 20 and r2, r2 102ec: 51 f0 breq .+20 ; 0x10302 102ee: 23 e3 ldi r18, 0x33 ; 51 102f0: 33 e3 ldi r19, 0x33 ; 51 102f2: 43 eb ldi r20, 0xB3 ; 179 102f4: 5e e3 ldi r21, 0x3E ; 62 102f6: c3 01 movw r24, r6 102f8: b2 01 movw r22, r4 102fa: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 102fe: 6b 01 movw r12, r22 10300: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 10302: a7 01 movw r20, r14 10304: 96 01 movw r18, r12 10306: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1030a: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1030e: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 10312: 90 91 00 12 lds r25, 0x1200 ; 0x801200 10316: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1031a: 87 ff sbrs r24, 7 1031c: 10 c0 rjmp .+32 ; 0x1033e current_position[Z_AXIS] = init_z_bckp; 1031e: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 10322: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 10326: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 1032a: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1032e: 65 e5 ldi r22, 0x55 ; 85 10330: 75 e5 ldi r23, 0x55 ; 85 10332: 85 e5 ldi r24, 0x55 ; 85 10334: 91 e4 ldi r25, 0x41 ; 65 10336: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1033a: 0f 94 14 22 call 0x24428 ; 0x24428 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 1033e: 68 89 ldd r22, Y+16 ; 0x10 10340: 79 89 ldd r23, Y+17 ; 0x11 10342: 8a 89 ldd r24, Y+18 ; 0x12 10344: 9b 89 ldd r25, Y+19 ; 0x13 10346: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1034a: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 1034e: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 10352: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = y_pos; 10356: 80 92 f9 11 sts 0x11F9, r8 ; 0x8011f9 1035a: 90 92 fa 11 sts 0x11FA, r9 ; 0x8011fa 1035e: a0 92 fb 11 sts 0x11FB, r10 ; 0x8011fb 10362: b0 92 fc 11 sts 0x11FC, r11 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 10366: 69 ef ldi r22, 0xF9 ; 249 10368: 71 e1 ldi r23, 0x11 ; 17 1036a: 85 ef ldi r24, 0xF5 ; 245 1036c: 91 e1 ldi r25, 0x11 ; 17 1036e: 0e 94 31 64 call 0xc862 ; 0xc862 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 10372: 60 e0 ldi r22, 0x00 ; 0 10374: 70 e0 ldi r23, 0x00 ; 0 10376: 86 e1 ldi r24, 0x16 ; 22 10378: 93 e4 ldi r25, 0x43 ; 67 1037a: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1037e: 0f 94 14 22 call 0x24428 ; 0x24428 if (planner_aborted) 10382: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 10386: 88 23 and r24, r24 10388: 39 f0 breq .+14 ; 0x10398 { custom_message_type = custom_message_type_old; 1038a: 7f 81 ldd r23, Y+7 ; 0x07 1038c: 70 93 c7 06 sts 0x06C7, r23 ; 0x8006c7 custom_message_state = custom_message_state_old; 10390: 88 85 ldd r24, Y+8 ; 0x08 10392: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 10396: fb cc rjmp .-1546 ; 0xfd8e 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 10398: 81 2c mov r8, r1 1039a: 91 2c mov r9, r1 1039c: 70 e2 ldi r23, 0x20 ; 32 1039e: a7 2e mov r10, r23 103a0: 71 ec ldi r23, 0xC1 ; 193 103a2: b7 2e mov r11, r23 103a4: 22 20 and r2, r2 103a6: 51 f0 breq .+20 ; 0x103bc 103a8: 2a 81 ldd r18, Y+2 ; 0x02 103aa: 3b 81 ldd r19, Y+3 ; 0x03 103ac: 4c 81 ldd r20, Y+4 ; 0x04 103ae: 5d 81 ldd r21, Y+5 ; 0x05 103b0: c3 01 movw r24, r6 103b2: b2 01 movw r22, r4 103b4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 103b8: 4b 01 movw r8, r22 103ba: 5c 01 movw r10, r24 103bc: 48 8d ldd r20, Y+24 ; 0x18 103be: c5 01 movw r24, r10 103c0: b4 01 movw r22, r8 103c2: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 103c6: 81 11 cpse r24, r1 103c8: 0b c0 rjmp .+22 ; 0x103e0 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)); 103ca: 89 ee ldi r24, 0xE9 ; 233 103cc: 92 e6 ldi r25, 0x62 ; 98 103ce: 0e 94 3c 6d call 0xda78 ; 0xda78 103d2: 9f 93 push r25 103d4: 8f 93 push r24 103d6: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 103da: 0f 90 pop r0 103dc: 0f 90 pop r0 103de: be ce rjmp .-644 ; 0x1015c // 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. 103e0: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 103e4: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 103e8: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 103ec: 50 91 00 12 lds r21, 0x1200 ; 0x801200 103f0: c7 01 movw r24, r14 103f2: b6 01 movw r22, r12 103f4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 103f8: 20 e0 ldi r18, 0x00 ; 0 103fa: 30 e0 ldi r19, 0x00 ; 0 103fc: a9 01 movw r20, r18 103fe: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 10402: 87 ff sbrs r24, 7 10404: 36 c0 rjmp .+108 ; 0x10472 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10406: 60 e0 ldi r22, 0x00 ; 0 10408: 70 e0 ldi r23, 0x00 ; 0 1040a: 80 ea ldi r24, 0xA0 ; 160 1040c: 90 e4 ldi r25, 0x40 ; 64 1040e: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 10412: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 10416: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1041a: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1041e: 65 e5 ldi r22, 0x55 ; 85 10420: 75 e5 ldi r23, 0x55 ; 85 10422: 85 e5 ldi r24, 0x55 ; 85 10424: 91 e4 ldi r25, 0x41 ; 65 10426: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1042a: 0f 94 14 22 call 0x24428 ; 0x24428 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 1042e: 48 8d ldd r20, Y+24 ; 0x18 10430: c5 01 movw r24, r10 10432: b4 01 movw r22, r8 10434: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 10438: 88 23 and r24, r24 1043a: 39 f2 breq .-114 ; 0x103ca printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 1043c: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 10440: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 10444: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 10448: 50 91 00 12 lds r21, 0x1200 ; 0x801200 1044c: 60 e0 ldi r22, 0x00 ; 0 1044e: 70 e0 ldi r23, 0x00 ; 0 10450: 80 ea ldi r24, 0xA0 ; 160 10452: 90 e4 ldi r25, 0x40 ; 64 10454: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 10458: 2d ec ldi r18, 0xCD ; 205 1045a: 3c ec ldi r19, 0xCC ; 204 1045c: 4c ec ldi r20, 0xCC ; 204 1045e: 5d e3 ldi r21, 0x3D ; 61 10460: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 10464: 87 ff sbrs r24, 7 10466: 05 c0 rjmp .+10 ; 0x10472 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 10468: 8d ea ldi r24, 0xAD ; 173 1046a: 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")); 1046c: 0f 94 66 9f call 0x33ecc ; 0x33ecc 10470: 75 ce rjmp .-790 ; 0x1015c 10472: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 10476: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 1047a: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 1047e: 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 10482: 22 20 and r2, r2 10484: a1 f0 breq .+40 ; 0x104ae 10486: a7 01 movw r20, r14 10488: 96 01 movw r18, r12 1048a: c3 01 movw r24, r6 1048c: b2 01 movw r22, r4 1048e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 10492: 9b 01 movw r18, r22 10494: ac 01 movw r20, r24 10496: 5f 77 andi r21, 0x7F ; 127 10498: 6a 81 ldd r22, Y+2 ; 0x02 1049a: 7b 81 ldd r23, Y+3 ; 0x03 1049c: 8c 81 ldd r24, Y+4 ; 0x04 1049e: 9d 81 ldd r25, Y+5 ; 0x05 104a0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 104a4: 87 ff sbrs r24, 7 104a6: 03 c0 rjmp .+6 ; 0x104ae puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 104a8: 84 e7 ldi r24, 0x74 ; 116 104aa: 97 e7 ldi r25, 0x77 ; 119 104ac: df cf rjmp .-66 ; 0x1046c } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 104ae: 8f ea ldi r24, 0xAF ; 175 104b0: 9f e0 ldi r25, 0x0F ; 15 104b2: 0f 94 7d a0 call 0x340fa ; 0x340fa 104b6: 88 23 and r24, r24 104b8: 09 f4 brne .+2 ; 0x104bc 104ba: 40 c0 rjmp .+128 ; 0x1053c 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); } 104bc: 86 ea ldi r24, 0xA6 ; 166 104be: 9f e0 ldi r25, 0x0F ; 15 104c0: 0f 94 7d a0 call 0x340fa ; 0x340fa if (!calibration_status_pinda()) return 0; 104c4: 88 23 and r24, r24 104c6: d1 f1 breq .+116 ; 0x1053c return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 104c8: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 104cc: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 104d0: 80 91 90 06 lds r24, 0x0690 ; 0x800690 104d4: 90 91 91 06 lds r25, 0x0691 ; 0x800691 104d8: 0e 94 8f 56 call 0xad1e ; 0xad1e 104dc: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 104e0: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 104e4: 40 91 40 04 lds r20, 0x0440 ; 0x800440 104e8: 50 91 41 04 lds r21, 0x0441 ; 0x800441 104ec: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 104f0: 9b 01 movw r18, r22 104f2: ac 01 movw r20, r24 104f4: e7 e0 ldi r30, 0x07 ; 7 104f6: ae 85 ldd r26, Y+14 ; 0x0e 104f8: bf 85 ldd r27, Y+15 ; 0x0f 104fa: ea 9f mul r30, r26 104fc: c0 01 movw r24, r0 104fe: eb 9f mul r30, r27 10500: 90 0d add r25, r0 10502: 11 24 eor r1, r1 10504: 08 0f add r16, r24 10506: 19 1f adc r17, r25 10508: 00 0f add r16, r16 1050a: 11 1f adc r17, r17 1050c: 00 0f add r16, r16 1050e: 11 1f adc r17, r17 10510: 04 56 subi r16, 0x64 ; 100 10512: 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; 10514: c7 01 movw r24, r14 10516: b6 01 movw r22, r12 10518: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1051c: d8 01 movw r26, r16 1051e: 11 96 adiw r26, 0x01 ; 1 10520: 6d 93 st X+, r22 10522: 7d 93 st X+, r23 10524: 8d 93 st X+, r24 10526: 9c 93 st X, r25 10528: 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--; 1052a: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1052e: 81 50 subi r24, 0x01 ; 1 10530: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac mesh_point++; lcd_update(1); 10534: 81 e0 ldi r24, 0x01 ; 1 10536: 0e 94 cd 69 call 0xd39a ; 0xd39a 1053a: 0c ce rjmp .-1000 ; 0x10154 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 1053c: 20 e0 ldi r18, 0x00 ; 0 1053e: 30 e0 ldi r19, 0x00 ; 0 10540: a9 01 movw r20, r18 10542: d8 cf rjmp .-80 ; 0x104f4 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); 10544: 85 e0 ldi r24, 0x05 ; 5 10546: 0f 94 71 2c call 0x258e2 ; 0x258e2 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; 1054a: c1 2c mov r12, r1 1054c: d1 2c mov r13, r1 1054e: 90 ea ldi r25, 0xA0 ; 160 10550: e9 2e mov r14, r25 10552: 90 e4 ldi r25, 0x40 ; 64 10554: 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)); 10556: 80 e0 ldi r24, 0x00 ; 0 10558: 96 e3 ldi r25, 0x36 ; 54 1055a: 0e 94 3c 6d call 0xda78 ; 0xda78 1055e: 0f 94 92 0a call 0x21524 ; 0x21524 #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 10562: 90 e0 ldi r25, 0x00 ; 0 10564: 80 e0 ldi r24, 0x00 ; 0 10566: 0f 94 3d 34 call 0x2687a ; 0x2687a lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 1056a: 81 e0 ldi r24, 0x01 ; 1 1056c: 0f 94 99 34 call 0x26932 ; 0x26932 #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); 10570: 80 e0 ldi r24, 0x00 ; 0 10572: 0f 94 4c 2c call 0x25898 ; 0x25898 10576: 18 2f mov r17, r24 raise_z(-1); 10578: 60 e0 ldi r22, 0x00 ; 0 1057a: 70 e0 ldi r23, 0x00 ; 0 1057c: 80 e8 ldi r24, 0x80 ; 128 1057e: 9f eb ldi r25, 0xBF ; 191 10580: 0e 94 68 67 call 0xced0 ; 0xced0 enable_z_endstop(true); 10584: 81 e0 ldi r24, 0x01 ; 1 10586: 0f 94 4c 2c call 0x25898 ; 0x25898 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1058a: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 1058e: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 10592: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 10596: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1059a: 65 e5 ldi r22, 0x55 ; 85 1059c: 75 e5 ldi r23, 0x55 ; 85 1059e: 85 e5 ldi r24, 0x55 ; 85 105a0: 91 e4 ldi r25, 0x41 ; 65 105a2: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 105a6: 0f 94 14 22 call 0x24428 ; 0x24428 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 105aa: 81 2f mov r24, r17 105ac: 0f 94 4c 2c call 0x25898 ; 0x25898 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 105b0: 82 e0 ldi r24, 0x02 ; 2 105b2: 0f 94 00 22 call 0x24400 ; 0x24400 105b6: 20 e0 ldi r18, 0x00 ; 0 105b8: 30 e0 ldi r19, 0x00 ; 0 105ba: 40 ea ldi r20, 0xA0 ; 160 105bc: 50 e4 ldi r21, 0x40 ; 64 105be: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 105c2: 18 16 cp r1, r24 105c4: 44 f2 brlt .-112 ; 0x10556 custom_message_type = custom_message_type_old; 105c6: ef 81 ldd r30, Y+7 ; 0x07 105c8: e0 93 c7 06 sts 0x06C7, r30 ; 0x8006c7 custom_message_state = custom_message_state_old; 105cc: f8 85 ldd r31, Y+8 ; 0x08 105ce: f0 93 ac 03 sts 0x03AC, r31 ; 0x8003ac lcd_update_enable(true); // display / status-line recovery 105d2: 81 e0 ldi r24, 0x01 ; 1 105d4: 0e 94 4b 6a call 0xd496 ; 0xd496 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); 105d8: dd 24 eor r13, r13 105da: d3 94 inc r13 105dc: df 92 push r13 105de: 81 2c mov r8, r1 105e0: 91 2c mov r9, r1 105e2: 54 01 movw r10, r8 105e4: cc 24 eor r12, r12 105e6: c3 94 inc r12 105e8: e1 2c mov r14, r1 105ea: f1 2c mov r15, r1 105ec: 87 01 movw r16, r14 105ee: 21 e0 ldi r18, 0x01 ; 1 105f0: 40 e0 ldi r20, 0x00 ; 0 105f2: 50 e0 ldi r21, 0x00 ; 0 105f4: ba 01 movw r22, r20 105f6: 81 e0 ldi r24, 0x01 ; 1 105f8: 0e 94 fe 67 call 0xcffc ; 0xcffc 105fc: d0 92 e6 11 sts 0x11E6, r13 ; 0x8011e6 10600: 0f 90 pop r0 10602: c5 cb rjmp .-2166 ; 0xfd8e 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. 10604: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f clean_up_after_endstop_move(l_feedmultiply); 10608: 8b a1 ldd r24, Y+35 ; 0x23 1060a: 9c a1 ldd r25, Y+36 ; 0x24 1060c: 0e 94 5f 60 call 0xc0be ; 0xc0be // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 10610: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 10614: 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)) 10618: 80 e1 ldi r24, 0x10 ; 16 1061a: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1061e: 88 23 and r24, r24 10620: 91 f0 breq .+36 ; 0x10646 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 10622: 0e 94 3d 73 call 0xe67a ; 0xe67a // 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))); 10626: 81 ea ldi r24, 0xA1 ; 161 10628: 9d e0 ldi r25, 0x0D ; 13 1062a: 0f 94 7d a0 call 0x340fa ; 0x340fa 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-> 1062e: 2b e0 ldi r18, 0x0B ; 11 10630: 82 9f mul r24, r18 10632: c0 01 movw r24, r0 10634: 11 24 eor r1, r1 10636: 80 5b subi r24, 0xB0 ; 176 10638: 92 4f sbci r25, 0xF2 ; 242 1063a: 0f 94 8b a0 call 0x34116 ; 0x34116 1063e: 90 93 2a 05 sts 0x052A, r25 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 10642: 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])); 10646: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> 1064a: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 1064e: 07 2e mov r0, r23 10650: 00 0c add r0, r0 10652: 88 0b sbc r24, r24 10654: 99 0b sbc r25, r25 10656: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1065a: 90 58 subi r25, 0x80 ; 128 1065c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 10660: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 10664: 40 91 40 04 lds r20, 0x0440 ; 0x800440 10668: 50 91 41 04 lds r21, 0x0441 ; 0x800441 1066c: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 10670: 0f 94 72 8b call 0x316e4 ; 0x316e4 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; 10674: 80 ec ldi r24, 0xC0 ; 192 10676: 9f e0 ldi r25, 0x0F ; 15 10678: 0f 94 7d a0 call 0x340fa ; 0x340fa 1067c: 91 e0 ldi r25, 0x01 ; 1 1067e: 81 30 cpi r24, 0x01 ; 1 10680: 09 f0 breq .+2 ; 0x10684 10682: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 10684: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 10686: 4f eb ldi r20, 0xBF ; 191 10688: 5f e0 ldi r21, 0x0F ; 15 1068a: 6c e4 ldi r22, 0x4C ; 76 1068c: ce 01 movw r24, r28 1068e: 01 96 adiw r24, 0x01 ; 1 10690: 0e 94 e5 55 call 0xabca ; 0xabca 10694: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 10696: 4e eb ldi r20, 0xBE ; 190 10698: 5f e0 ldi r21, 0x0F ; 15 1069a: 62 e5 ldi r22, 0x52 ; 82 1069c: ce 01 movw r24, r28 1069e: 01 96 adiw r24, 0x01 ; 1 106a0: 0e 94 e5 55 call 0xabca ; 0xabca 106a4: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 106a6: 4d eb ldi r20, 0xBD ; 189 106a8: 5f e0 ldi r21, 0x0F ; 15 106aa: 66 e4 ldi r22, 0x46 ; 70 106ac: ce 01 movw r24, r28 106ae: 01 96 adiw r24, 0x01 ; 1 106b0: 0e 94 e5 55 call 0xabca ; 0xabca 106b4: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 106b6: 4c eb ldi r20, 0xBC ; 188 106b8: 5f e0 ldi r21, 0x0F ; 15 106ba: 62 e4 ldi r22, 0x42 ; 66 106bc: ce 01 movw r24, r28 106be: 01 96 adiw r24, 0x01 ; 1 106c0: 0e 94 e5 55 call 0xabca ; 0xabca 106c4: 21 2f mov r18, r17 106c6: 11 0f add r17, r17 106c8: 33 0b sbc r19, r19 106ca: 08 2e mov r0, r24 106cc: 00 0c add r0, r0 106ce: 99 0b sbc r25, r25 106d0: 5c 01 movw r10, r24 106d2: a2 1a sub r10, r18 106d4: b3 0a sbc r11, r19 106d6: 8f 2d mov r24, r15 106d8: ff 0c add r15, r15 106da: 99 0b sbc r25, r25 106dc: 28 0f add r18, r24 106de: 39 1f adc r19, r25 106e0: 46 e0 ldi r20, 0x06 ; 6 106e2: 42 9f mul r20, r18 106e4: 60 01 movw r12, r0 106e6: 43 9f mul r20, r19 106e8: d0 0c add r13, r0 106ea: 11 24 eor r1, r1 106ec: f1 2c mov r15, r1 106ee: e1 2c mov r14, r1 106f0: 00 2e mov r0, r16 106f2: 00 0c add r0, r0 106f4: 11 0b sbc r17, r17 106f6: 08 1b sub r16, r24 106f8: 19 0b sbc r17, r25 106fa: b7 01 movw r22, r14 106fc: 63 56 subi r22, 0x63 ; 99 106fe: 7d 4e sbci r23, 0xED ; 237 10700: 3b 01 movw r6, r22 10702: 46 01 movw r8, r12 10704: 77 e0 ldi r23, 0x07 ; 7 10706: 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 * ( 10708: d3 01 movw r26, r6 1070a: 2d 90 ld r2, X+ 1070c: 3d 90 ld r3, X+ 1070e: 4d 90 ld r4, X+ 10710: 5d 90 ld r5, X+ 10712: 3d 01 movw r6, r26 10714: fd 01 movw r30, r26 10716: 34 97 sbiw r30, 0x04 ; 4 10718: fb 87 std Y+11, r31 ; 0x0b 1071a: ea 87 std Y+10, r30 ; 0x0a 1071c: b4 01 movw r22, r8 1071e: 09 2c mov r0, r9 10720: 00 0c add r0, r0 10722: 88 0b sbc r24, r24 10724: 99 0b sbc r25, r25 10726: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1072a: 2f e3 ldi r18, 0x3F ; 63 1072c: 33 ec ldi r19, 0xC3 ; 195 1072e: 4e e2 ldi r20, 0x2E ; 46 10730: 59 e3 ldi r21, 0x39 ; 57 10732: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 10736: a2 01 movw r20, r4 10738: 91 01 movw r18, r2 1073a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1073e: aa 85 ldd r26, Y+10 ; 0x0a 10740: bb 85 ldd r27, Y+11 ; 0x0b 10742: 6d 93 st X+, r22 10744: 7d 93 st X+, r23 10746: 8d 93 st X+, r24 10748: 9c 93 st X, r25 1074a: 13 97 sbiw r26, 0x03 ; 3 1074c: ba 81 ldd r27, Y+2 ; 0x02 1074e: b1 50 subi r27, 0x01 ; 1 10750: ba 83 std Y+2, r27 ; 0x02 10752: 80 0e add r8, r16 10754: 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++) { 10756: b1 11 cpse r27, r1 10758: d7 cf rjmp .-82 ; 0x10708 1075a: ca 0c add r12, r10 1075c: db 1c adc r13, r11 1075e: ec e1 ldi r30, 0x1C ; 28 10760: ee 0e add r14, r30 10762: 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++) { 10764: f4 ec ldi r31, 0xC4 ; 196 10766: ef 16 cp r14, r31 10768: f1 04 cpc r15, r1 1076a: 39 f6 brne .-114 ; 0x106fa + 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) 1076c: 0e 94 ce f0 call 0x1e19c ; 0x1e19c { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 10770: 8d e4 ldi r24, 0x4D ; 77 10772: 0e 94 b6 55 call 0xab6c ; 0xab6c 10776: 88 23 and r24, r24 10778: 09 f4 brne .+2 ; 0x1077c 1077a: 84 c0 rjmp .+264 ; 0x10884 1077c: 0e 94 cb 55 call 0xab96 ; 0xab96 if (nMeasPoints == 7 && useMagnetCompensation) { 10780: 2e 81 ldd r18, Y+6 ; 0x06 10782: 27 30 cpi r18, 0x07 ; 7 10784: 09 f0 breq .+2 ; 0x10788 10786: 94 c0 rjmp .+296 ; 0x108b0 10788: 88 23 and r24, r24 1078a: 09 f4 brne .+2 ; 0x1078e 1078c: 91 c0 rjmp .+290 ; 0x108b0 1078e: bb 24 eor r11, r11 10790: b3 94 inc r11 10792: aa 24 eor r10, r10 10794: aa 94 dec r10 10796: ab 0c add r10, r11 10798: 09 a1 ldd r16, Y+33 ; 0x21 1079a: 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++) { 1079c: 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++; } 1079e: 8e ef ldi r24, 0xFE ; 254 107a0: 88 2e mov r8, r24 107a2: 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)) { 107a4: 6a 2d mov r22, r10 107a6: 86 2d mov r24, r6 107a8: 0f 94 3d 8b call 0x3167a ; 0x3167a 107ac: 99 24 eor r9, r9 107ae: 93 94 inc r9 107b0: 96 0c add r9, r6 107b2: 81 11 cpse r24, r1 107b4: 6e c0 rjmp .+220 ; 0x10892 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++; } 107b6: 6b 2d mov r22, r11 107b8: 86 2d mov r24, r6 107ba: 0f 94 3d 8b call 0x3167a ; 0x3167a } 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; 107be: c1 2c mov r12, r1 107c0: d1 2c mov r13, r1 107c2: 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; 107c4: 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++; } 107c6: 88 23 and r24, r24 107c8: 81 f0 breq .+32 ; 0x107ea 107ca: 20 e0 ldi r18, 0x00 ; 0 107cc: 30 e0 ldi r19, 0x00 ; 0 107ce: a9 01 movw r20, r18 107d0: d8 01 movw r26, r16 107d2: 5d 96 adiw r26, 0x1d ; 29 107d4: 6d 91 ld r22, X+ 107d6: 7d 91 ld r23, X+ 107d8: 8d 91 ld r24, X+ 107da: 9c 91 ld r25, X 107dc: 90 97 sbiw r26, 0x20 ; 32 107de: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 107e2: 6b 01 movw r12, r22 107e4: 7c 01 movw r14, r24 107e6: 77 24 eor r7, r7 107e8: 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++; } 107ea: 68 2d mov r22, r8 107ec: 86 2d mov r24, r6 107ee: 0f 94 3d 8b call 0x3167a ; 0x3167a 107f2: 88 23 and r24, r24 107f4: 69 f0 breq .+26 ; 0x10810 107f6: f8 01 movw r30, r16 107f8: 7b 97 sbiw r30, 0x1b ; 27 107fa: 20 81 ld r18, Z 107fc: 31 81 ldd r19, Z+1 ; 0x01 107fe: 42 81 ldd r20, Z+2 ; 0x02 10800: 53 81 ldd r21, Z+3 ; 0x03 10802: c7 01 movw r24, r14 10804: b6 01 movw r22, r12 10806: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1080a: 6b 01 movw r12, r22 1080c: 7c 01 movw r14, r24 1080e: 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++; } 10810: 6a 2d mov r22, r10 10812: 89 2d mov r24, r9 10814: 0f 94 3d 8b call 0x3167a ; 0x3167a 10818: 88 23 and r24, r24 1081a: 61 f0 breq .+24 ; 0x10834 1081c: f8 01 movw r30, r16 1081e: 25 81 ldd r18, Z+5 ; 0x05 10820: 36 81 ldd r19, Z+6 ; 0x06 10822: 47 81 ldd r20, Z+7 ; 0x07 10824: 50 85 ldd r21, Z+8 ; 0x08 10826: c7 01 movw r24, r14 10828: b6 01 movw r22, r12 1082a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1082e: 6b 01 movw r12, r22 10830: 7c 01 movw r14, r24 10832: 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++; } 10834: 6a 2d mov r22, r10 10836: 8f ef ldi r24, 0xFF ; 255 10838: 86 0d add r24, r6 1083a: 0f 94 3d 8b call 0x3167a ; 0x3167a 1083e: 88 23 and r24, r24 10840: 31 f1 breq .+76 ; 0x1088e 10842: f8 01 movw r30, r16 10844: 33 97 sbiw r30, 0x03 ; 3 10846: 20 81 ld r18, Z 10848: 31 81 ldd r19, Z+1 ; 0x01 1084a: 42 81 ldd r20, Z+2 ; 0x02 1084c: 53 81 ldd r21, Z+3 ; 0x03 1084e: c7 01 movw r24, r14 10850: b6 01 movw r22, r12 10852: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 10856: 6b 01 movw r12, r22 10858: 7c 01 movw r14, r24 1085a: 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 1085c: 67 2d mov r22, r7 1085e: 70 e0 ldi r23, 0x00 ; 0 10860: 90 e0 ldi r25, 0x00 ; 0 10862: 80 e0 ldi r24, 0x00 ; 0 10864: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 10868: 9b 01 movw r18, r22 1086a: ac 01 movw r20, r24 1086c: c7 01 movw r24, r14 1086e: b6 01 movw r22, r12 10870: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 10874: d8 01 movw r26, r16 10876: 11 96 adiw r26, 0x01 ; 1 10878: 6d 93 st X+, r22 1087a: 7d 93 st X+, r23 1087c: 8d 93 st X+, r24 1087e: 9c 93 st X, r25 10880: 14 97 sbiw r26, 0x04 ; 4 10882: 07 c0 rjmp .+14 ; 0x10892 } 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); 10884: 8c ea ldi r24, 0xAC ; 172 10886: 9d e0 ldi r25, 0x0D ; 13 10888: 0f 94 7d a0 call 0x340fa ; 0x340fa 1088c: 79 cf rjmp .-270 ; 0x10780 1088e: 71 10 cpse r7, r1 10890: e5 cf rjmp .-54 ; 0x1085c //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++) { 10892: 69 2c mov r6, r9 10894: 0c 5f subi r16, 0xFC ; 252 10896: 1f 4f sbci r17, 0xFF ; 255 10898: b7 e0 ldi r27, 0x07 ; 7 1089a: 9b 12 cpse r9, r27 1089c: 83 cf rjmp .-250 ; 0x107a4 1089e: b3 94 inc r11 108a0: e9 a1 ldd r30, Y+33 ; 0x21 108a2: fa a1 ldd r31, Y+34 ; 0x22 108a4: 7c 96 adiw r30, 0x1c ; 28 108a6: fa a3 std Y+34, r31 ; 0x22 108a8: 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++) { 108aa: f8 e0 ldi r31, 0x08 ; 8 108ac: bf 12 cpse r11, r31 108ae: 71 cf rjmp .-286 ; 0x10792 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 108b0: 81 e0 ldi r24, 0x01 ; 1 108b2: 80 93 9c 12 sts 0x129C, r24 ; 0x80129c if (code_seen('O') && !code_value_uint8()) { 108b6: 8f e4 ldi r24, 0x4F ; 79 108b8: 0e 94 b6 55 call 0xab6c ; 0xab6c 108bc: 81 11 cpse r24, r1 108be: 03 c0 rjmp .+6 ; 0x108c6 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 108c0: 0f 94 c7 8b call 0x3178e ; 0x3178e 108c4: 79 cc rjmp .-1806 ; 0x101b8 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 108c6: 0e 94 cb 55 call 0xab96 ; 0xab96 108ca: 81 11 cpse r24, r1 108cc: f9 cf rjmp .-14 ; 0x108c0 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 108ce: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 108d2: 72 cc rjmp .-1820 ; 0x101b8 000108d4 : 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() 108d4: 2f 92 push r2 108d6: 3f 92 push r3 108d8: 4f 92 push r4 108da: 5f 92 push r5 108dc: 6f 92 push r6 108de: 7f 92 push r7 108e0: 8f 92 push r8 108e2: 9f 92 push r9 108e4: af 92 push r10 108e6: bf 92 push r11 108e8: cf 92 push r12 108ea: df 92 push r13 108ec: ef 92 push r14 108ee: ff 92 push r15 108f0: 0f 93 push r16 108f2: 1f 93 push r17 108f4: cf 93 push r28 108f6: df 93 push r29 108f8: cd b7 in r28, 0x3d ; 61 108fa: de b7 in r29, 0x3e ; 62 108fc: c3 56 subi r28, 0x63 ; 99 108fe: d1 09 sbc r29, r1 10900: 0f b6 in r0, 0x3f ; 63 10902: f8 94 cli 10904: de bf out 0x3e, r29 ; 62 10906: 0f be out 0x3f, r0 ; 63 10908: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 1090a: 82 e0 ldi r24, 0x02 ; 2 1090c: 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) { 10910: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 10914: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 10918: 0f 51 subi r16, 0x1F ; 31 1091a: 10 4f sbci r17, 0xF0 ; 240 1091c: 45 e0 ldi r20, 0x05 ; 5 1091e: 50 e0 ldi r21, 0x00 ; 0 10920: 61 ec ldi r22, 0xC1 ; 193 10922: 71 e8 ldi r23, 0x81 ; 129 10924: c8 01 movw r24, r16 10926: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 1092a: 89 2b or r24, r25 1092c: 09 f0 breq .+2 ; 0x10930 1092e: 9b c1 rjmp .+822 ; 0x10c66 eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 10930: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10934: 88 23 and r24, r24 10936: 09 f4 brne .+2 ; 0x1093a 10938: 4d c0 rjmp .+154 ; 0x109d4 return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 1093a: 8d eb ldi r24, 0xBD ; 189 1093c: 9e e7 ldi r25, 0x7E ; 126 1093e: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10942: 88 23 and r24, r24 10944: 79 f0 breq .+30 ; 0x10964 printf_P(_N("%u"), status_number); 10946: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 1094a: 1f 92 push r1 1094c: 8f 93 push r24 1094e: 84 eb ldi r24, 0xB4 ; 180 10950: 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); 10952: 9f 93 push r25 10954: 8f 93 push r24 10956: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 1095a: 0f 90 pop r0 1095c: 0f 90 pop r0 1095e: 0f 90 pop r0 10960: 0f 90 pop r0 10962: 08 c0 rjmp .+16 ; 0x10974 } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 10964: 89 eb ldi r24, 0xB9 ; 185 10966: 9e e7 ldi r25, 0x7E ; 126 10968: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 1096c: 88 23 and r24, r24 1096e: 41 f0 breq .+16 ; 0x10980 no_response = false; 10970: 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); 10974: 81 e0 ldi r24, 0x01 ; 1 10976: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 1097a: 0e 94 91 73 call 0xe722 ; 0xe722 1097e: 3a c2 rjmp .+1140 ; 0x10df4 trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 10980: 86 eb ldi r24, 0xB6 ; 182 10982: 9e e7 ldi r25, 0x7E ; 126 10984: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10988: 88 23 and r24, r24 1098a: 21 f1 breq .+72 ; 0x109d4 // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 1098c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10990: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10994: 61 e0 ldi r22, 0x01 ; 1 10996: 03 96 adiw r24, 0x03 ; 3 10998: 0f 94 a4 4b call 0x29748 ; 0x29748 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 1099c: 0f 94 6c 48 call 0x290d8 ; 0x290d8 109a0: 8c 01 movw r16, r24 sdpos = file.curPosition(); 109a2: 80 91 02 16 lds r24, 0x1602 ; 0x801602 109a6: 90 91 03 16 lds r25, 0x1603 ; 0x801603 109aa: a0 91 04 16 lds r26, 0x1604 ; 0x801604 109ae: b0 91 05 16 lds r27, 0x1605 ; 0x801605 109b2: 80 93 7e 16 sts 0x167E, r24 ; 0x80167e 109b6: 90 93 7f 16 sts 0x167F, r25 ; 0x80167f 109ba: a0 93 80 16 sts 0x1680, r26 ; 0x801680 109be: b0 93 81 16 sts 0x1681, r27 ; 0x801681 while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 109c2: 80 2f mov r24, r16 109c4: 0e 94 cc 70 call 0xe198 ; 0xe198 if (readByte == '\n') { 109c8: 0a 30 cpi r16, 0x0A ; 10 109ca: 11 05 cpc r17, r1 109cc: 39 f7 brne .-50 ; 0x1099c break; } } card.closefile(); 109ce: 0f 94 82 41 call 0x28304 ; 0x28304 109d2: d0 cf rjmp .-96 ; 0x10974 - `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"))) { 109d4: 87 eb ldi r24, 0xB7 ; 183 109d6: 91 e8 ldi r25, 0x81 ; 129 109d8: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 109dc: 81 11 cpse r24, r1 109de: ca cf rjmp .-108 ; 0x10974 gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 109e0: 83 eb ldi r24, 0xB3 ; 179 109e2: 91 e8 ldi r25, 0x81 ; 129 109e4: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 109e8: 88 23 and r24, r24 109ea: 21 f1 breq .+72 ; 0x10a34 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 109ec: 40 91 87 03 lds r20, 0x0387 ; 0x800387 109f0: 50 91 88 03 lds r21, 0x0388 ; 0x800388 109f4: 2c e3 ldi r18, 0x3C ; 60 109f6: 24 9f mul r18, r20 109f8: c0 01 movw r24, r0 109fa: 25 9f mul r18, r21 109fc: 90 0d add r25, r0 109fe: 11 24 eor r1, r1 10a00: 9f 93 push r25 10a02: 8f 93 push r24 10a04: 40 91 85 03 lds r20, 0x0385 ; 0x800385 10a08: 50 91 86 03 lds r21, 0x0386 ; 0x800386 10a0c: 24 9f mul r18, r20 10a0e: c0 01 movw r24, r0 10a10: 25 9f mul r18, r21 10a12: 90 0d add r25, r0 10a14: 11 24 eor r1, r1 10a16: 9f 93 push r25 10a18: 8f 93 push r24 10a1a: 82 ed ldi r24, 0xD2 ; 210 10a1c: 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); 10a1e: 9f 93 push r25 10a20: 8f 93 push r24 10a22: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 10a26: 0f 90 pop r0 10a28: 0f 90 pop r0 10a2a: 0f 90 pop r0 10a2c: 0f 90 pop r0 10a2e: 0f 90 pop r0 10a30: 0f 90 pop r0 10a32: a0 cf rjmp .-192 ; 0x10974 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 10a34: 8e ea ldi r24, 0xAE ; 174 10a36: 91 e8 ldi r25, 0x81 ; 129 10a38: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10a3c: 88 23 and r24, r24 10a3e: 11 f1 breq .+68 ; 0x10a84 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 10a40: 8c e8 ldi r24, 0x8C ; 140 10a42: 9f e0 ldi r25, 0x0F ; 15 10a44: 0f 94 7d a0 call 0x340fa ; 0x340fa 10a48: 81 11 cpse r24, r1 10a4a: 10 c0 rjmp .+32 ; 0x10a6c // M24 - Start SD print enquecommand_P(MSG_M24); 10a4c: 61 e0 ldi r22, 0x01 ; 1 10a4e: 89 e8 ldi r24, 0x89 ; 137 10a50: 9c e6 ldi r25, 0x6C ; 108 10a52: 0e 94 3a 7d call 0xfa74 ; 0xfa74 10a56: 60 e0 ldi r22, 0x00 ; 0 10a58: 85 ea ldi r24, 0xA5 ; 165 10a5a: 9f e0 ldi r25, 0x0F ; 15 10a5c: 0f 94 a1 a0 call 0x34142 ; 0x34142 10a60: 60 e0 ldi r22, 0x00 ; 0 10a62: 8f e7 ldi r24, 0x7F ; 127 10a64: 9c e0 ldi r25, 0x0C ; 12 10a66: 0f 94 a1 a0 call 0x34142 ; 0x34142 10a6a: 84 cf rjmp .-248 ; 0x10974 // 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) { 10a6c: 81 30 cpi r24, 0x01 ; 1 10a6e: 09 f0 breq .+2 ; 0x10a72 10a70: 81 cf rjmp .-254 ; 0x10974 // 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(); 10a72: 0f 94 28 20 call 0x24050 ; 0x24050 usb_timer.start(); 10a76: 85 ed ldi r24, 0xD5 ; 213 10a78: 91 e1 ldi r25, 0x11 ; 17 10a7a: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::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(); 10a7e: 0f 94 52 0f call 0x21ea4 ; 0x21ea4 10a82: 78 cf rjmp .-272 ; 0x10974 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 10a84: 87 ea ldi r24, 0xA7 ; 167 10a86: 91 e8 ldi r25, 0x81 ; 129 10a88: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10a8c: 88 23 and r24, r24 10a8e: 21 f0 breq .+8 ; 0x10a98 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 10a90: 80 e0 ldi r24, 0x00 ; 0 10a92: 0f 94 fe 62 call 0x2c5fc ; 0x2c5fc 10a96: 6e cf rjmp .-292 ; 0x10974 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 10a98: 81 ea ldi r24, 0xA1 ; 161 10a9a: 91 e8 ldi r25, 0x81 ; 129 10a9c: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10aa0: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 10aa2: 0e 94 32 61 call 0xc264 ; 0xc264 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 10aa6: 8e e9 ldi r24, 0x9E ; 158 10aa8: 91 e8 ldi r25, 0x81 ; 129 10aaa: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10aae: 88 23 and r24, r24 10ab0: a9 f0 breq .+42 ; 0x10adc char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 10ab2: 44 e1 ldi r20, 0x14 ; 20 10ab4: 50 e0 ldi r21, 0x00 ; 0 10ab6: 65 e1 ldi r22, 0x15 ; 21 10ab8: 7d e0 ldi r23, 0x0D ; 13 10aba: ce 01 movw r24, r28 10abc: 01 96 adiw r24, 0x01 ; 1 10abe: 0f 94 6d a0 call 0x340da ; 0x340da if (SN[19]) 10ac2: 8c 89 ldd r24, Y+20 ; 0x14 10ac4: 88 23 and r24, r24 10ac6: 29 f0 breq .+10 ; 0x10ad2 puts_P(PSTR("SN invalid")); 10ac8: 83 e9 ldi r24, 0x93 ; 147 10aca: 91 e8 ldi r25, 0x81 ; 129 10acc: 0f 94 66 9f call 0x33ecc ; 0x33ecc 10ad0: 51 cf rjmp .-350 ; 0x10974 else puts(SN); 10ad2: ce 01 movw r24, r28 10ad4: 01 96 adiw r24, 0x01 ; 1 10ad6: 0f 94 0c a7 call 0x34e18 ; 0x34e18 10ada: 4c cf rjmp .-360 ; 0x10974 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 10adc: 8f e8 ldi r24, 0x8F ; 143 10ade: 91 e8 ldi r25, 0x81 ; 129 10ae0: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10ae4: 88 23 and r24, r24 10ae6: 29 f0 breq .+10 ; 0x10af2 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 10ae8: 83 e8 ldi r24, 0x83 ; 131 10aea: 91 e8 ldi r25, 0x81 ; 129 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 10aec: 0e 94 de 72 call 0xe5bc ; 0xe5bc 10af0: 41 cf rjmp .-382 ; 0x10974 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 10af2: 8f e7 ldi r24, 0x7F ; 127 10af4: 91 e8 ldi r25, 0x81 ; 129 10af6: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10afa: 88 23 and r24, r24 10afc: 19 f0 breq .+6 ; 0x10b04 SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 10afe: 8f e5 ldi r24, 0x5F ; 95 10b00: 91 e8 ldi r25, 0x81 ; 129 10b02: f4 cf rjmp .-24 ; 0x10aec } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 10b04: 8a e5 ldi r24, 0x5A ; 90 10b06: 91 e8 ldi r25, 0x81 ; 129 10b08: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10b0c: 88 23 and r24, r24 10b0e: 19 f0 breq .+6 ; 0x10b16 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 10b10: 0e 94 3f 6c call 0xd87e ; 0xd87e 10b14: 2f cf rjmp .-418 ; 0x10974 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 10b16: 87 e5 ldi r24, 0x57 ; 87 10b18: 91 e8 ldi r25, 0x81 ; 129 10b1a: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10b1e: 88 23 and r24, r24 10b20: 79 f0 breq .+30 ; 0x10b40 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 10b22: 81 ea ldi r24, 0xA1 ; 161 10b24: 9d e0 ldi r25, 0x0D ; 13 10b26: 0f 94 7d a0 call 0x340fa ; 0x340fa 10b2a: 2b e0 ldi r18, 0x0B ; 11 10b2c: 82 9f mul r24, r18 10b2e: c0 01 movw r24, r0 10b30: 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); 10b32: 70 e0 ldi r23, 0x00 ; 0 10b34: 60 e0 ldi r22, 0x00 ; 0 10b36: 80 5b subi r24, 0xB0 ; 176 10b38: 92 4f sbci r25, 0xF2 ; 242 10b3a: 0f 94 bf a0 call 0x3417e ; 0x3417e 10b3e: 1a cf rjmp .-460 ; 0x10974 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 10b40: 84 e5 ldi r24, 0x54 ; 84 10b42: 91 e8 ldi r25, 0x81 ; 129 10b44: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10b48: 88 23 and r24, r24 10b4a: 51 f0 breq .+20 ; 0x10b60 // 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(); 10b4c: 0e 94 39 6a call 0xd472 ; 0xd472 Sound_MakeCustom(100,0,false); 10b50: 40 e0 ldi r20, 0x00 ; 0 10b52: 70 e0 ldi r23, 0x00 ; 0 10b54: 60 e0 ldi r22, 0x00 ; 0 10b56: 84 e6 ldi r24, 0x64 ; 100 10b58: 90 e0 ldi r25, 0x00 ; 0 10b5a: 0f 94 61 31 call 0x262c2 ; 0x262c2 10b5e: d8 cf rjmp .-80 ; 0x10b10 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 10b60: 80 e5 ldi r24, 0x50 ; 80 10b62: 91 e8 ldi r25, 0x81 ; 129 10b64: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10b68: 88 23 and r24, r24 10b6a: e1 f0 breq .+56 ; 0x10ba4 // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 10b6c: 86 e5 ldi r24, 0x56 ; 86 10b6e: 0e 94 b6 55 call 0xab6c ; 0xab6c 10b72: 88 23 and r24, r24 10b74: 09 f4 brne .+2 ; 0x10b78 10b76: fe ce rjmp .-516 ; 0x10974 bool value = code_value_short(); 10b78: 0e 94 d8 55 call 0xabb0 ; 0xabb0 10b7c: 11 e0 ldi r17, 0x01 ; 1 10b7e: 89 2b or r24, r25 10b80: 09 f4 brne .+2 ; 0x10b84 10b82: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 10b84: 0f 94 14 22 call 0x24428 ; 0x24428 if(value != mbl.active) { 10b88: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 10b8c: 90 e0 ldi r25, 0x00 ; 0 10b8e: 18 17 cp r17, r24 10b90: 19 06 cpc r1, r25 10b92: 09 f4 brne .+2 ; 0x10b96 10b94: ef ce rjmp .-546 ; 0x10974 mbl.active = value; 10b96: 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]); 10b9a: 8d ef ldi r24, 0xFD ; 253 10b9c: 91 e1 ldi r25, 0x11 ; 17 10b9e: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 10ba2: e8 ce rjmp .-560 ; 0x10974 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 10ba4: 89 e4 ldi r24, 0x49 ; 73 10ba6: 91 e8 ldi r25, 0x81 ; 129 10ba8: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10bac: 88 23 and r24, r24 10bae: 09 f4 brne .+2 ; 0x10bb2 10bb0: e1 ce rjmp .-574 ; 0x10974 uint16_t nDiameter; if(code_seen('D')) { 10bb2: 84 e4 ldi r24, 0x44 ; 68 10bb4: 0e 94 b6 55 call 0xab6c ; 0xab6c 10bb8: 88 23 and r24, r24 10bba: a1 f0 breq .+40 ; 0x10be4 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10bbc: 0e 94 8e 5a call 0xb51c ; 0xb51c 10bc0: 20 e0 ldi r18, 0x00 ; 0 10bc2: 30 e0 ldi r19, 0x00 ; 0 10bc4: 4a e7 ldi r20, 0x7A ; 122 10bc6: 54 e4 ldi r21, 0x44 ; 68 10bc8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 10bcc: 20 e0 ldi r18, 0x00 ; 0 10bce: 30 e0 ldi r19, 0x00 ; 0 10bd0: 40 e0 ldi r20, 0x00 ; 0 10bd2: 5f e3 ldi r21, 0x3F ; 63 10bd4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 10bd8: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> nozzle_diameter_check(nDiameter); 10bdc: cb 01 movw r24, r22 10bde: 0e 94 f0 ef call 0x1dfe0 ; 0x1dfe0 10be2: c8 ce rjmp .-624 ; 0x10974 } else if(code_seen_P(PSTR("set")) && farm_mode) { 10be4: 85 e4 ldi r24, 0x45 ; 69 10be6: 91 e8 ldi r25, 0x81 ; 129 10be8: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 10bec: 88 23 and r24, r24 10bee: 49 f1 breq .+82 ; 0x10c42 10bf0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10bf4: 88 23 and r24, r24 10bf6: 29 f1 breq .+74 ; 0x10c42 strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 10bf8: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10bfc: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10c00: 02 96 adiw r24, 0x02 ; 2 10c02: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 10c06: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10c0a: 0e 94 8e 5a call 0xb51c ; 0xb51c 10c0e: 6b 01 movw r12, r22 10c10: 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); 10c12: 6f ef ldi r22, 0xFF ; 255 10c14: 87 ea ldi r24, 0xA7 ; 167 10c16: 9d e0 ldi r25, 0x0D ; 13 10c18: 0f 94 a1 a0 call 0x34142 ; 0x34142 10c1c: 20 e0 ldi r18, 0x00 ; 0 10c1e: 30 e0 ldi r19, 0x00 ; 0 10c20: 4a e7 ldi r20, 0x7A ; 122 10c22: 54 e4 ldi r21, 0x44 ; 68 10c24: c7 01 movw r24, r14 10c26: b6 01 movw r22, r12 10c28: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 10c2c: 20 e0 ldi r18, 0x00 ; 0 10c2e: 30 e0 ldi r19, 0x00 ; 0 10c30: 40 e0 ldi r20, 0x00 ; 0 10c32: 5f e3 ldi r21, 0x3F ; 63 10c34: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 10c38: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10c3c: 85 ea ldi r24, 0xA5 ; 165 10c3e: 9d e0 ldi r25, 0x0D ; 13 10c40: 7c cf rjmp .-264 ; 0x10b3a 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); 10c42: 85 ea ldi r24, 0xA5 ; 165 10c44: 9d e0 ldi r25, 0x0D ; 13 10c46: 0f 94 8b a0 call 0x34116 ; 0x34116 10c4a: bc 01 movw r22, r24 10c4c: 90 e0 ldi r25, 0x00 ; 0 10c4e: 80 e0 ldi r24, 0x00 ; 0 10c50: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 10c54: 20 e0 ldi r18, 0x00 ; 0 10c56: 30 e0 ldi r19, 0x00 ; 0 10c58: 4a e7 ldi r20, 0x7A ; 122 10c5a: 54 e4 ldi r21, 0x44 ; 68 10c5c: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 10c60: 0f 94 2b 41 call 0x28256 ; 0x28256 10c64: 87 ce rjmp .-754 ; 0x10974 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 10c66: d8 01 movw r26, r16 10c68: 8c 91 ld r24, X 10c6a: 87 34 cpi r24, 0x47 ; 71 10c6c: 11 f0 breq .+4 ; 0x10c72 10c6e: 0c 94 5e 91 jmp 0x122bc ; 0x122bc { strchr_pointer = CMDBUFFER_CURRENT_STRING; 10c72: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 10c76: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 gcode_in_progress = code_value_short(); 10c7a: 0e 94 d8 55 call 0xabb0 ; 0xabb0 10c7e: 90 93 58 03 sts 0x0358, r25 ; 0x800358 10c82: 80 93 57 03 sts 0x0357, r24 ; 0x800357 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10c86: 8b 34 cpi r24, 0x4B ; 75 10c88: 91 05 cpc r25, r1 10c8a: 09 f4 brne .+2 ; 0x10c8e 10c8c: 45 c6 rjmp .+3210 ; 0x11918 10c8e: 0c f0 brlt .+2 ; 0x10c92 10c90: 4b c1 rjmp .+662 ; 0x10f28 10c92: 84 30 cpi r24, 0x04 ; 4 10c94: 91 05 cpc r25, r1 10c96: 09 f4 brne .+2 ; 0x10c9a 10c98: aa c5 rjmp .+2900 ; 0x117ee 10c9a: 0c f0 brlt .+2 ; 0x10c9e 10c9c: c5 c0 rjmp .+394 ; 0x10e28 10c9e: 97 fd sbrc r25, 7 10ca0: cf c0 rjmp .+414 ; 0x10e40 10ca2: 02 97 sbiw r24, 0x02 ; 2 10ca4: 0c f0 brlt .+2 ; 0x10ca8 10ca6: a2 c1 rjmp .+836 ; 0x10fec */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 10ca8: 0e 94 00 55 call 0xaa00 ; 0xaa00 10cac: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 10cae: 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 10cb2: 60 91 84 06 lds r22, 0x0684 ; 0x800684 10cb6: 70 91 85 06 lds r23, 0x0685 ; 0x800685 10cba: 80 91 86 06 lds r24, 0x0686 ; 0x800686 10cbe: 90 91 87 06 lds r25, 0x0687 ; 0x800687 10cc2: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 10cc6: 6b 01 movw r12, r22 10cc8: 7c 01 movw r14, r24 10cca: 40 90 01 12 lds r4, 0x1201 ; 0x801201 10cce: 50 90 02 12 lds r5, 0x1202 ; 0x801202 10cd2: 60 90 03 12 lds r6, 0x1203 ; 0x801203 10cd6: 70 90 04 12 lds r7, 0x1204 ; 0x801204 10cda: 80 90 9f 06 lds r8, 0x069F ; 0x80069f 10cde: 90 90 a0 06 lds r9, 0x06A0 ; 0x8006a0 10ce2: a0 90 a1 06 lds r10, 0x06A1 ; 0x8006a1 10ce6: b0 90 a2 06 lds r11, 0x06A2 ; 0x8006a2 10cea: a5 01 movw r20, r10 10cec: 94 01 movw r18, r8 10cee: c3 01 movw r24, r6 10cf0: b2 01 movw r22, r4 10cf2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 10cf6: 20 e0 ldi r18, 0x00 ; 0 10cf8: 30 e0 ldi r19, 0x00 ; 0 10cfa: 48 ec ldi r20, 0xC8 ; 200 10cfc: 52 e4 ldi r21, 0x42 ; 66 10cfe: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 10d02: 9b 01 movw r18, r22 10d04: ac 01 movw r20, r24 10d06: c7 01 movw r24, r14 10d08: b6 01 movw r22, r12 10d0a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10d0e: 18 16 cp r1, r24 10d10: d4 f4 brge .+52 ; 0x10d46 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 10d12: a3 01 movw r20, r6 10d14: 92 01 movw r18, r4 10d16: c5 01 movw r24, r10 10d18: b4 01 movw r22, r8 10d1a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 10d1e: 20 e0 ldi r18, 0x00 ; 0 10d20: 30 e0 ldi r19, 0x00 ; 0 10d22: 48 ec ldi r20, 0xC8 ; 200 10d24: 52 e4 ldi r21, 0x42 ; 66 10d26: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 10d2a: a7 01 movw r20, r14 10d2c: 96 01 movw r18, r12 10d2e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 10d32: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 10d36: 60 93 84 06 sts 0x0684, r22 ; 0x800684 10d3a: 70 93 85 06 sts 0x0685, r23 ; 0x800685 10d3e: 80 93 86 06 sts 0x0686, r24 ; 0x800686 10d42: 90 93 87 06 sts 0x0687, r25 ; 0x800687 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 10d46: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 10d4a: 88 23 and r24, r24 10d4c: 09 f4 brne .+2 ; 0x10d50 10d4e: 46 c1 rjmp .+652 ; 0x10fdc if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 10d50: 88 e5 ldi r24, 0x58 ; 88 10d52: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d56: 81 11 cpse r24, r1 10d58: 41 c1 rjmp .+642 ; 0x10fdc 10d5a: 89 e5 ldi r24, 0x59 ; 89 10d5c: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d60: 81 11 cpse r24, r1 10d62: 3c c1 rjmp .+632 ; 0x10fdc 10d64: 8a e5 ldi r24, 0x5A ; 90 10d66: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d6a: 81 11 cpse r24, r1 10d6c: 37 c1 rjmp .+622 ; 0x10fdc 10d6e: 85 e4 ldi r24, 0x45 ; 69 10d70: 0e 94 b6 55 call 0xab6c ; 0xab6c 10d74: 88 23 and r24, r24 10d76: 09 f4 brne .+2 ; 0x10d7a 10d78: 31 c1 rjmp .+610 ; 0x10fdc float echange=destination[E_AXIS]-current_position[E_AXIS]; 10d7a: 20 91 01 12 lds r18, 0x1201 ; 0x801201 10d7e: 30 91 02 12 lds r19, 0x1202 ; 0x801202 10d82: 40 91 03 12 lds r20, 0x1203 ; 0x801203 10d86: 50 91 04 12 lds r21, 0x1204 ; 0x801204 10d8a: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 10d8e: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 10d92: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 10d96: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 10d9a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 10d9e: 6b 01 movw r12, r22 10da0: 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 10da2: 2d ec ldi r18, 0xCD ; 205 10da4: 3c ec ldi r19, 0xCC ; 204 10da6: 4c ec ldi r20, 0xCC ; 204 10da8: 5d eb ldi r21, 0xBD ; 189 10daa: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 10dae: 87 ff sbrs r24, 7 10db0: 07 c1 rjmp .+526 ; 0x10fc0 10db2: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10db6: 81 11 cpse r24, r1 10db8: 0c 94 19 b0 jmp 0x16032 ; 0x16032 st_synchronize(); 10dbc: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 10dc0: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 10dc4: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 10dc8: a0 91 a1 06 lds r26, 0x06A1 ; 0x8006a1 10dcc: b0 91 a2 06 lds r27, 0x06A2 ; 0x8006a2 10dd0: 80 93 01 12 sts 0x1201, r24 ; 0x801201 10dd4: 90 93 02 12 sts 0x1202, r25 ; 0x801202 10dd8: a0 93 03 12 sts 0x1203, r26 ; 0x801203 10ddc: b0 93 04 12 sts 0x1204, r27 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 10de0: 81 e0 ldi r24, 0x01 ; 1 10de2: 92 e1 ldi r25, 0x12 ; 18 10de4: 0f 94 69 75 call 0x2ead2 ; 0x2ead2 retract(!retracted[active_extruder]); 10de8: 90 91 03 05 lds r25, 0x0503 ; 0x800503 10dec: 81 e0 ldi r24, 0x01 ; 1 10dee: 89 27 eor r24, r25 10df0: 0e 94 4e be call 0x17c9c ; 0x17c9c SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 10df4: cd 59 subi r28, 0x9D ; 157 10df6: df 4f sbci r29, 0xFF ; 255 10df8: 0f b6 in r0, 0x3f ; 63 10dfa: f8 94 cli 10dfc: de bf out 0x3e, r29 ; 62 10dfe: 0f be out 0x3f, r0 ; 63 10e00: cd bf out 0x3d, r28 ; 61 10e02: df 91 pop r29 10e04: cf 91 pop r28 10e06: 1f 91 pop r17 10e08: 0f 91 pop r16 10e0a: ff 90 pop r15 10e0c: ef 90 pop r14 10e0e: df 90 pop r13 10e10: cf 90 pop r12 10e12: bf 90 pop r11 10e14: af 90 pop r10 10e16: 9f 90 pop r9 10e18: 8f 90 pop r8 10e1a: 7f 90 pop r7 10e1c: 6f 90 pop r6 10e1e: 5f 90 pop r5 10e20: 4f 90 pop r4 10e22: 3f 90 pop r3 10e24: 2f 90 pop r2 10e26: 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) 10e28: 85 31 cpi r24, 0x15 ; 21 10e2a: 91 05 cpc r25, r1 10e2c: 09 f4 brne .+2 ; 0x10e30 10e2e: d9 c0 rjmp .+434 ; 0x10fe2 10e30: fc f4 brge .+62 ; 0x10e70 10e32: 8a 30 cpi r24, 0x0A ; 10 10e34: 91 05 cpc r25, r1 10e36: 09 f4 brne .+2 ; 0x10e3a 10e38: 23 c5 rjmp .+2630 ; 0x11880 10e3a: 0b 97 sbiw r24, 0x0b ; 11 10e3c: 09 f4 brne .+2 ; 0x10e40 10e3e: 24 c5 rjmp .+2632 ; 0x11888 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 10e40: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 10e44: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 10e48: 8f 51 subi r24, 0x1F ; 31 10e4a: 90 4f sbci r25, 0xF0 ; 240 10e4c: 9f 93 push r25 10e4e: 8f 93 push r24 10e50: 1f 92 push r1 10e52: 87 e4 ldi r24, 0x47 ; 71 10e54: 8f 93 push r24 10e56: 84 ef ldi r24, 0xF4 ; 244 10e58: 96 e6 ldi r25, 0x66 ; 102 10e5a: 9f 93 push r25 10e5c: 8f 93 push r24 10e5e: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 10e62: 0f 90 pop r0 10e64: 0f 90 pop r0 10e66: 0f 90 pop r0 10e68: 0f 90 pop r0 10e6a: 0f 90 pop r0 10e6c: 0f 90 pop r0 10e6e: b9 c0 rjmp .+370 ; 0x10fe2 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) 10e70: 8c 31 cpi r24, 0x1C ; 28 10e72: 91 05 cpc r25, r1 10e74: 09 f4 brne .+2 ; 0x10e78 10e76: 0a c5 rjmp .+2580 ; 0x1188c 10e78: 4e 97 sbiw r24, 0x1e ; 30 10e7a: 11 f7 brne .-60 ; 0x10e40 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 10e7c: 0f 94 14 22 call 0x24428 ; 0x24428 homing_flag = true; 10e80: 81 e0 ldi r24, 0x01 ; 1 10e82: 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(); 10e86: 0e 94 79 60 call 0xc0f2 ; 0xc0f2 10e8a: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 10e8c: 80 e0 ldi r24, 0x00 ; 0 10e8e: 90 e0 ldi r25, 0x00 ; 0 10e90: a8 e4 ldi r26, 0x48 ; 72 10e92: b4 e4 ldi r27, 0x44 ; 68 10e94: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 10e98: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 10e9c: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 10ea0: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 10ea4: 43 e0 ldi r20, 0x03 ; 3 10ea6: 60 e0 ldi r22, 0x00 ; 0 10ea8: 70 e0 ldi r23, 0x00 ; 0 10eaa: 80 e2 ldi r24, 0x20 ; 32 10eac: 91 ec ldi r25, 0xC1 ; 193 10eae: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 10eb2: 70 90 fd 11 lds r7, 0x11FD ; 0x8011fd 10eb6: 60 90 fe 11 lds r6, 0x11FE ; 0x8011fe 10eba: 50 90 ff 11 lds r5, 0x11FF ; 0x8011ff 10ebe: 40 90 00 12 lds r4, 0x1200 ; 0x801200 10ec2: b0 90 f9 11 lds r11, 0x11F9 ; 0x8011f9 10ec6: a0 90 fa 11 lds r10, 0x11FA ; 0x8011fa 10eca: 90 90 fb 11 lds r9, 0x11FB ; 0x8011fb 10ece: 80 90 fc 11 lds r8, 0x11FC ; 0x8011fc 10ed2: f0 90 f5 11 lds r15, 0x11F5 ; 0x8011f5 10ed6: e0 90 f6 11 lds r14, 0x11F6 ; 0x8011f6 10eda: d0 90 f7 11 lds r13, 0x11F7 ; 0x8011f7 10ede: c0 90 f8 11 lds r12, 0x11F8 ; 0x8011f8 10ee2: 8f e2 ldi r24, 0x2F ; 47 10ee4: 96 e5 ldi r25, 0x56 ; 86 10ee6: 0e 94 3c 6d call 0xda78 ; 0xda78 10eea: 4f 92 push r4 10eec: 5f 92 push r5 10eee: 6f 92 push r6 10ef0: 7f 92 push r7 10ef2: 8f 92 push r8 10ef4: 9f 92 push r9 10ef6: af 92 push r10 10ef8: bf 92 push r11 10efa: cf 92 push r12 10efc: df 92 push r13 10efe: ef 92 push r14 10f00: ff 92 push r15 10f02: 9f 93 push r25 10f04: 8f 93 push r24 10f06: 8d ea ldi r24, 0xAD ; 173 10f08: 97 e6 ldi r25, 0x67 ; 103 10f0a: 9f 93 push r25 10f0c: 8f 93 push r24 10f0e: 0f 94 3f 9f call 0x33e7e ; 0x33e7e clean_up_after_endstop_move(l_feedmultiply); 10f12: c8 01 movw r24, r16 10f14: 0e 94 5f 60 call 0xc0be ; 0xc0be homing_flag = false; 10f18: 10 92 05 12 sts 0x1205, r1 ; 0x801205 10f1c: 0f b6 in r0, 0x3f ; 63 10f1e: f8 94 cli 10f20: de bf out 0x3e, r29 ; 62 10f22: 0f be out 0x3f, r0 ; 63 10f24: cd bf out 0x3d, r28 ; 61 10f26: 5d c0 rjmp .+186 ; 0x10fe2 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) 10f28: 88 35 cpi r24, 0x58 ; 88 10f2a: 91 05 cpc r25, r1 10f2c: 09 f4 brne .+2 ; 0x10f30 10f2e: 59 c0 rjmp .+178 ; 0x10fe2 10f30: f4 f4 brge .+60 ; 0x10f6e 10f32: 81 35 cpi r24, 0x51 ; 81 10f34: 91 05 cpc r25, r1 10f36: 11 f4 brne .+4 ; 0x10f3c 10f38: 0c 94 a4 90 jmp 0x12148 ; 0x12148 10f3c: 5c f4 brge .+22 ; 0x10f54 10f3e: 8c 34 cpi r24, 0x4C ; 76 10f40: 91 05 cpc r25, r1 10f42: 09 f4 brne .+2 ; 0x10f46 10f44: 0c c5 rjmp .+2584 ; 0x1195e 10f46: 80 35 cpi r24, 0x50 ; 80 10f48: 91 05 cpc r25, r1 10f4a: 09 f0 breq .+2 ; 0x10f4e 10f4c: 79 cf rjmp .-270 ; 0x10e40 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 10f4e: 0e 94 90 7e call 0xfd20 ; 0xfd20 10f52: 47 c0 rjmp .+142 ; 0x10fe2 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) 10f54: 86 35 cpi r24, 0x56 ; 86 10f56: 91 05 cpc r25, r1 10f58: 11 f4 brne .+4 ; 0x10f5e 10f5a: 0c 94 a8 90 jmp 0x12150 ; 0x12150 10f5e: 87 35 cpi r24, 0x57 ; 87 10f60: 91 05 cpc r25, r1 10f62: 09 f0 breq .+2 ; 0x10f66 10f64: 6d cf rjmp .-294 ; 0x10e40 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 10f66: 80 e1 ldi r24, 0x10 ; 16 10f68: 0e 94 80 c6 call 0x18d00 ; 0x18d00 10f6c: 3a c0 rjmp .+116 ; 0x10fe2 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) 10f6e: 8c 35 cpi r24, 0x5C ; 92 10f70: 91 05 cpc r25, r1 10f72: 11 f4 brne .+4 ; 0x10f78 10f74: 0c 94 b4 90 jmp 0x12168 ; 0x12168 10f78: 74 f4 brge .+28 ; 0x10f96 10f7a: 8a 35 cpi r24, 0x5A ; 90 10f7c: 91 05 cpc r25, r1 10f7e: 11 f4 brne .+4 ; 0x10f84 10f80: 0c 94 ad 90 jmp 0x1215a ; 0x1215a 10f84: 8b 35 cpi r24, 0x5B ; 91 10f86: 91 05 cpc r25, r1 10f88: 09 f0 breq .+2 ; 0x10f8c 10f8a: 5a cf rjmp .-332 ; 0x10e40 /*! ### 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; 10f8c: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 10f90: 87 60 ori r24, 0x07 ; 7 10f92: 0c 94 b0 90 jmp 0x12160 ; 0x12160 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) 10f96: 82 36 cpi r24, 0x62 ; 98 10f98: 91 05 cpc r25, r1 10f9a: 11 f4 brne .+4 ; 0x10fa0 10f9c: 0c 94 4b 91 jmp 0x12296 ; 0x12296 10fa0: 83 36 cpi r24, 0x63 ; 99 10fa2: 91 05 cpc r25, r1 10fa4: 09 f0 breq .+2 ; 0x10fa8 10fa6: 4c cf rjmp .-360 ; 0x10e40 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 10fa8: 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); 10fac: 60 e0 ldi r22, 0x00 ; 0 10fae: 84 ec ldi r24, 0xC4 ; 196 10fb0: 9f e0 ldi r25, 0x0F ; 15 10fb2: 0f 94 a1 a0 call 0x34142 ; 0x34142 fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 10fb6: 82 e0 ldi r24, 0x02 ; 2 10fb8: 0e 94 cd 69 call 0xd39a ; 0xd39a 10fbc: 0c 94 5a 91 jmp 0x122b4 ; 0x122b4 #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 10fc0: 2d ec ldi r18, 0xCD ; 205 10fc2: 3c ec ldi r19, 0xCC ; 204 10fc4: 4c ec ldi r20, 0xCC ; 204 10fc6: 5d e3 ldi r21, 0x3D ; 61 10fc8: c7 01 movw r24, r14 10fca: b6 01 movw r22, r12 10fcc: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 10fd0: 18 16 cp r1, r24 10fd2: 24 f4 brge .+8 ; 0x10fdc 10fd4: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10fd8: 81 11 cpse r24, r1 10fda: f0 ce rjmp .-544 ; 0x10dbc } } } #endif //FWRETRACT prepare_move(start_segment_idx); 10fdc: c8 01 movw r24, r16 10fde: 0e 94 8f 65 call 0xcb1e ; 0xcb1e #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; 10fe2: 10 92 58 03 sts 0x0358, r1 ; 0x800358 10fe6: 10 92 57 03 sts 0x0357, r1 ; 0x800357 10fea: c4 cc rjmp .-1656 ; 0x10974 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 10fec: 0e 94 00 55 call 0xaa00 ; 0xaa00 10ff0: 2e 96 adiw r28, 0x0e ; 14 10ff2: 9f af std Y+63, r25 ; 0x3f 10ff4: 8e af std Y+62, r24 ; 0x3e 10ff6: 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 10ff8: 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; 10ffc: 89 e4 ldi r24, 0x49 ; 73 10ffe: 0e 94 b6 55 call 0xab6c ; 0xab6c 11002: 88 23 and r24, r24 11004: 09 f4 brne .+2 ; 0x11008 11006: a0 c3 rjmp .+1856 ; 0x11748 11008: 0e 94 8e 5a call 0xb51c ; 0xb51c 1100c: 60 93 4f 03 sts 0x034F, r22 ; 0x80034f 11010: 70 93 50 03 sts 0x0350, r23 ; 0x800350 11014: 80 93 51 03 sts 0x0351, r24 ; 0x800351 11018: 90 93 52 03 sts 0x0352, r25 ; 0x800352 offset[1] = code_seen('J') ? code_value() : 0.f; 1101c: 8a e4 ldi r24, 0x4A ; 74 1101e: 0e 94 b6 55 call 0xab6c ; 0xab6c 11022: c1 2c mov r12, r1 11024: d1 2c mov r13, r1 11026: 76 01 movw r14, r12 11028: 88 23 and r24, r24 1102a: 21 f0 breq .+8 ; 0x11034 1102c: 0e 94 8e 5a call 0xb51c ; 0xb51c 11030: 6b 01 movw r12, r22 11032: 7c 01 movw r14, r24 11034: c0 92 53 03 sts 0x0353, r12 ; 0x800353 11038: d0 92 54 03 sts 0x0354, r13 ; 0x800354 1103c: e0 92 55 03 sts 0x0355, r14 ; 0x800355 11040: f0 92 56 03 sts 0x0356, r15 ; 0x800356 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 11044: e0 91 57 03 lds r30, 0x0357 ; 0x800357 11048: f0 91 58 03 lds r31, 0x0358 ; 0x800358 1104c: a4 96 adiw r28, 0x24 ; 36 1104e: ff af std Y+63, r31 ; 0x3f 11050: ee af std Y+62, r30 ; 0x3e 11052: 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 11054: 80 90 4f 03 lds r8, 0x034F ; 0x80034f 11058: 90 90 50 03 lds r9, 0x0350 ; 0x800350 1105c: a0 90 51 03 lds r10, 0x0351 ; 0x800351 11060: b0 90 52 03 lds r11, 0x0352 ; 0x800352 11064: a7 01 movw r20, r14 11066: 96 01 movw r18, r12 11068: c5 01 movw r24, r10 1106a: b4 01 movw r22, r8 1106c: 0f 94 41 a4 call 0x34882 ; 0x34882 11070: 24 96 adiw r28, 0x04 ; 4 11072: 6c af std Y+60, r22 ; 0x3c 11074: 7d af std Y+61, r23 ; 0x3d 11076: 8e af std Y+62, r24 ; 0x3e 11078: 9f af std Y+63, r25 ; 0x3f 1107a: 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); 1107c: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 11080: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 11084: 07 2e mov r0, r23 11086: 00 0c add r0, r0 11088: 88 0b sbc r24, r24 1108a: 99 0b sbc r25, r25 1108c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 11090: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 11094: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 11098: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 1109c: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 110a0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 110a4: 2e e3 ldi r18, 0x3E ; 62 110a6: 33 ec ldi r19, 0xC3 ; 195 110a8: 4e e2 ldi r20, 0x2E ; 46 110aa: 59 e3 ldi r21, 0x39 ; 57 110ac: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 110b0: 68 af std Y+56, r22 ; 0x38 110b2: 79 af std Y+57, r23 ; 0x39 110b4: 8a af std Y+58, r24 ; 0x3a 110b6: 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)); 110b8: 80 e1 ldi r24, 0x10 ; 16 110ba: e5 ef ldi r30, 0xF5 ; 245 110bc: f1 e1 ldi r31, 0x11 ; 17 110be: de 01 movw r26, r28 110c0: 11 96 adiw r26, 0x01 ; 1 110c2: 01 90 ld r0, Z+ 110c4: 0d 92 st X+, r0 110c6: 8a 95 dec r24 110c8: e1 f7 brne .-8 ; 0x110c2 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 110ca: a5 01 movw r20, r10 110cc: 94 01 movw r18, r8 110ce: 50 58 subi r21, 0x80 ; 128 110d0: 28 a7 std Y+40, r18 ; 0x28 110d2: 39 a7 std Y+41, r19 ; 0x29 110d4: 4a a7 std Y+42, r20 ; 0x2a 110d6: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 110d8: d7 01 movw r26, r14 110da: c6 01 movw r24, r12 110dc: b0 58 subi r27, 0x80 ; 128 110de: 8c a7 std Y+44, r24 ; 0x2c 110e0: 9d a7 std Y+45, r25 ; 0x2d 110e2: ae a7 std Y+46, r26 ; 0x2e 110e4: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 110e6: 29 81 ldd r18, Y+1 ; 0x01 110e8: 3a 81 ldd r19, Y+2 ; 0x02 110ea: 4b 81 ldd r20, Y+3 ; 0x03 110ec: 5c 81 ldd r21, Y+4 ; 0x04 110ee: 28 96 adiw r28, 0x08 ; 8 110f0: 2c af std Y+60, r18 ; 0x3c 110f2: 3d af std Y+61, r19 ; 0x3d 110f4: 4e af std Y+62, r20 ; 0x3e 110f6: 5f af std Y+63, r21 ; 0x3f 110f8: 28 97 sbiw r28, 0x08 ; 8 110fa: c5 01 movw r24, r10 110fc: b4 01 movw r22, r8 110fe: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11102: 62 96 adiw r28, 0x12 ; 18 11104: 6c af std Y+60, r22 ; 0x3c 11106: 7d af std Y+61, r23 ; 0x3d 11108: 8e af std Y+62, r24 ; 0x3e 1110a: 9f af std Y+63, r25 ; 0x3f 1110c: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 1110e: 8d 81 ldd r24, Y+5 ; 0x05 11110: 9e 81 ldd r25, Y+6 ; 0x06 11112: af 81 ldd r26, Y+7 ; 0x07 11114: b8 85 ldd r27, Y+8 ; 0x08 11116: 2c 96 adiw r28, 0x0c ; 12 11118: 8c af std Y+60, r24 ; 0x3c 1111a: 9d af std Y+61, r25 ; 0x3d 1111c: ae af std Y+62, r26 ; 0x3e 1111e: bf af std Y+63, r27 ; 0x3f 11120: 2c 97 sbiw r28, 0x0c ; 12 11122: 9c 01 movw r18, r24 11124: ad 01 movw r20, r26 11126: c7 01 movw r24, r14 11128: b6 01 movw r22, r12 1112a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1112e: 66 96 adiw r28, 0x16 ; 22 11130: 6c af std Y+60, r22 ; 0x3c 11132: 7d af std Y+61, r23 ; 0x3d 11134: 8e af std Y+62, r24 ; 0x3e 11136: 9f af std Y+63, r25 ; 0x3f 11138: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 1113a: 29 85 ldd r18, Y+9 ; 0x09 1113c: 3a 85 ldd r19, Y+10 ; 0x0a 1113e: 4b 85 ldd r20, Y+11 ; 0x0b 11140: 5c 85 ldd r21, Y+12 ; 0x0c 11142: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 11146: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 1114a: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 1114e: 90 91 9e 06 lds r25, 0x069E ; 0x80069e 11152: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 11156: 6a 96 adiw r28, 0x1a ; 26 11158: 6c af std Y+60, r22 ; 0x3c 1115a: 7d af std Y+61, r23 ; 0x3d 1115c: 8e af std Y+62, r24 ; 0x3e 1115e: 9f af std Y+63, r25 ; 0x3f 11160: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 11162: 20 91 93 06 lds r18, 0x0693 ; 0x800693 11166: 30 91 94 06 lds r19, 0x0694 ; 0x800694 1116a: 40 91 95 06 lds r20, 0x0695 ; 0x800695 1116e: 50 91 96 06 lds r21, 0x0696 ; 0x800696 11172: 6e 96 adiw r28, 0x1e ; 30 11174: 2c af std Y+60, r18 ; 0x3c 11176: 3d af std Y+61, r19 ; 0x3d 11178: 4e af std Y+62, r20 ; 0x3e 1117a: 5f af std Y+63, r21 ; 0x3f 1117c: 6e 97 sbiw r28, 0x1e ; 30 1117e: 62 96 adiw r28, 0x12 ; 18 11180: 2c ad ldd r18, Y+60 ; 0x3c 11182: 3d ad ldd r19, Y+61 ; 0x3d 11184: 4e ad ldd r20, Y+62 ; 0x3e 11186: 5f ad ldd r21, Y+63 ; 0x3f 11188: 62 97 sbiw r28, 0x12 ; 18 1118a: 6e 96 adiw r28, 0x1e ; 30 1118c: 6c ad ldd r22, Y+60 ; 0x3c 1118e: 7d ad ldd r23, Y+61 ; 0x3d 11190: 8e ad ldd r24, Y+62 ; 0x3e 11192: 9f ad ldd r25, Y+63 ; 0x3f 11194: 6e 97 sbiw r28, 0x1e ; 30 11196: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1119a: 6b 01 movw r12, r22 1119c: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 1119e: 80 91 97 06 lds r24, 0x0697 ; 0x800697 111a2: 90 91 98 06 lds r25, 0x0698 ; 0x800698 111a6: a0 91 99 06 lds r26, 0x0699 ; 0x800699 111aa: b0 91 9a 06 lds r27, 0x069A ; 0x80069a 111ae: a2 96 adiw r28, 0x22 ; 34 111b0: 8c af std Y+60, r24 ; 0x3c 111b2: 9d af std Y+61, r25 ; 0x3d 111b4: ae af std Y+62, r26 ; 0x3e 111b6: bf af std Y+63, r27 ; 0x3f 111b8: a2 97 sbiw r28, 0x22 ; 34 111ba: 66 96 adiw r28, 0x16 ; 22 111bc: 2c ad ldd r18, Y+60 ; 0x3c 111be: 3d ad ldd r19, Y+61 ; 0x3d 111c0: 4e ad ldd r20, Y+62 ; 0x3e 111c2: 5f ad ldd r21, Y+63 ; 0x3f 111c4: 66 97 sbiw r28, 0x16 ; 22 111c6: bc 01 movw r22, r24 111c8: cd 01 movw r24, r26 111ca: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 111ce: 4b 01 movw r8, r22 111d0: 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; 111d2: 30 90 f6 04 lds r3, 0x04F6 ; 0x8004f6 111d6: 20 90 f7 04 lds r2, 0x04F7 ; 0x8004f7 111da: 90 91 f8 04 lds r25, 0x04F8 ; 0x8004f8 111de: 9c ab std Y+52, r25 ; 0x34 111e0: a0 91 f9 04 lds r26, 0x04F9 ; 0x8004f9 111e4: 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; 111e6: b0 91 fe 04 lds r27, 0x04FE ; 0x8004fe 111ea: 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); 111ec: a7 01 movw r20, r14 111ee: 96 01 movw r18, r12 111f0: 68 a5 ldd r22, Y+40 ; 0x28 111f2: 79 a5 ldd r23, Y+41 ; 0x29 111f4: 8a a5 ldd r24, Y+42 ; 0x2a 111f6: 9b a5 ldd r25, Y+43 ; 0x2b 111f8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 111fc: 2b 01 movw r4, r22 111fe: 3c 01 movw r6, r24 11200: a5 01 movw r20, r10 11202: 94 01 movw r18, r8 11204: 6c a5 ldd r22, Y+44 ; 0x2c 11206: 7d a5 ldd r23, Y+45 ; 0x2d 11208: 8e a5 ldd r24, Y+46 ; 0x2e 1120a: 9f a5 ldd r25, Y+47 ; 0x2f 1120c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11210: 9b 01 movw r18, r22 11212: ac 01 movw r20, r24 11214: c3 01 movw r24, r6 11216: b2 01 movw r22, r4 11218: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1121c: 2b 01 movw r4, r22 1121e: 3c 01 movw r6, r24 11220: a5 01 movw r20, r10 11222: 94 01 movw r18, r8 11224: 68 a5 ldd r22, Y+40 ; 0x28 11226: 79 a5 ldd r23, Y+41 ; 0x29 11228: 8a a5 ldd r24, Y+42 ; 0x2a 1122a: 9b a5 ldd r25, Y+43 ; 0x2b 1122c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11230: 4b 01 movw r8, r22 11232: 5c 01 movw r10, r24 11234: a7 01 movw r20, r14 11236: 96 01 movw r18, r12 11238: 6c a5 ldd r22, Y+44 ; 0x2c 1123a: 7d a5 ldd r23, Y+45 ; 0x2d 1123c: 8e a5 ldd r24, Y+46 ; 0x2e 1123e: 9f a5 ldd r25, Y+47 ; 0x2f 11240: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11244: 9b 01 movw r18, r22 11246: ac 01 movw r20, r24 11248: c5 01 movw r24, r10 1124a: b4 01 movw r22, r8 1124c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 11250: a3 01 movw r20, r6 11252: 92 01 movw r18, r4 11254: 0f 94 24 a2 call 0x34448 ; 0x34448 11258: 6b 01 movw r12, r22 1125a: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 1125c: 20 e0 ldi r18, 0x00 ; 0 1125e: 30 e0 ldi r19, 0x00 ; 0 11260: a9 01 movw r20, r18 11262: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 11266: 87 ff sbrs r24, 7 11268: 0a c0 rjmp .+20 ; 0x1127e 1126a: 2b ed ldi r18, 0xDB ; 219 1126c: 3f e0 ldi r19, 0x0F ; 15 1126e: 49 ec ldi r20, 0xC9 ; 201 11270: 50 e4 ldi r21, 0x40 ; 64 11272: c7 01 movw r24, r14 11274: b6 01 movw r22, r12 11276: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1127a: 6b 01 movw r12, r22 1127c: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 1127e: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 11282: 70 91 00 05 lds r23, 0x0500 ; 0x800500 11286: 61 15 cp r22, r1 11288: 71 05 cpc r23, r1 1128a: 09 f4 brne .+2 ; 0x1128e 1128c: 61 c2 rjmp .+1218 ; 0x11750 { // 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); 1128e: 90 e0 ldi r25, 0x00 ; 0 11290: 80 e0 ldi r24, 0x00 ; 0 11292: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 11296: 9b 01 movw r18, r22 11298: ac 01 movw r20, r24 1129a: 6b ed ldi r22, 0xDB ; 219 1129c: 7f e0 ldi r23, 0x0F ; 15 1129e: 89 ec ldi r24, 0xC9 ; 201 112a0: 90 e4 ldi r25, 0x40 ; 64 112a2: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 112a6: 24 96 adiw r28, 0x04 ; 4 112a8: 2c ad ldd r18, Y+60 ; 0x3c 112aa: 3d ad ldd r19, Y+61 ; 0x3d 112ac: 4e ad ldd r20, Y+62 ; 0x3e 112ae: 5f ad ldd r21, Y+63 ; 0x3f 112b0: 24 97 sbiw r28, 0x04 ; 4 112b2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 112b6: 5b 01 movw r10, r22 112b8: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 112ba: 60 91 01 05 lds r22, 0x0501 ; 0x800501 112be: 70 91 02 05 lds r23, 0x0502 ; 0x800502 112c2: 61 15 cp r22, r1 112c4: 71 05 cpc r23, r1 112c6: e1 f0 breq .+56 ; 0x11300 { // 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)); 112c8: 90 e0 ldi r25, 0x00 ; 0 112ca: 80 e0 ldi r24, 0x00 ; 0 112cc: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 112d0: 20 e0 ldi r18, 0x00 ; 0 112d2: 30 e0 ldi r19, 0x00 ; 0 112d4: 40 e7 ldi r20, 0x70 ; 112 112d6: 52 e4 ldi r21, 0x42 ; 66 112d8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 112dc: 9b 01 movw r18, r22 112de: ac 01 movw r20, r24 112e0: 68 ad ldd r22, Y+56 ; 0x38 112e2: 79 ad ldd r23, Y+57 ; 0x39 112e4: 8a ad ldd r24, Y+58 ; 0x3a 112e6: 9b ad ldd r25, Y+59 ; 0x3b 112e8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 112ec: 3b 01 movw r6, r22 112ee: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 112f0: 95 01 movw r18, r10 112f2: a8 01 movw r20, r16 112f4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 112f8: 87 ff sbrs r24, 7 112fa: 02 c0 rjmp .+4 ; 0x11300 mm_per_arc_segment = mm_per_arc_segment_sec; 112fc: 53 01 movw r10, r6 112fe: 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) 11300: 40 90 fa 04 lds r4, 0x04FA ; 0x8004fa 11304: 50 90 fb 04 lds r5, 0x04FB ; 0x8004fb 11308: 60 90 fc 04 lds r6, 0x04FC ; 0x8004fc 1130c: 70 90 fd 04 lds r7, 0x04FD ; 0x8004fd 11310: 95 01 movw r18, r10 11312: a8 01 movw r20, r16 11314: b2 01 movw r22, r4 11316: c3 01 movw r24, r6 11318: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1131c: 18 16 cp r1, r24 1131e: 84 f0 brlt .+32 ; 0x11340 { // 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) { 11320: 95 01 movw r18, r10 11322: a8 01 movw r20, r16 11324: 63 2d mov r22, r3 11326: 72 2d mov r23, r2 11328: 8c a9 ldd r24, Y+52 ; 0x34 1132a: 9c ad ldd r25, Y+60 ; 0x3c 1132c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 11330: 25 01 movw r4, r10 11332: 38 01 movw r6, r16 11334: 87 ff sbrs r24, 7 11336: 04 c0 rjmp .+8 ; 0x11340 // 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; 11338: 43 2c mov r4, r3 1133a: 52 2c mov r5, r2 1133c: 6c a8 ldd r6, Y+52 ; 0x34 1133e: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 11340: a4 96 adiw r28, 0x24 ; 36 11342: ee ad ldd r30, Y+62 ; 0x3e 11344: ff ad ldd r31, Y+63 ; 0x3f 11346: a4 97 sbiw r28, 0x24 ; 36 11348: 32 97 sbiw r30, 0x02 ; 2 1134a: 51 f4 brne .+20 ; 0x11360 1134c: 2b ed ldi r18, 0xDB ; 219 1134e: 3f e0 ldi r19, 0x0F ; 15 11350: 49 ec ldi r20, 0xC9 ; 201 11352: 50 e4 ldi r21, 0x40 ; 64 11354: c7 01 movw r24, r14 11356: b6 01 movw r22, r12 11358: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1135c: 6b 01 movw r12, r22 1135e: 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) 11360: 6e 96 adiw r28, 0x1e ; 30 11362: 2c ad ldd r18, Y+60 ; 0x3c 11364: 3d ad ldd r19, Y+61 ; 0x3d 11366: 4e ad ldd r20, Y+62 ; 0x3e 11368: 5f ad ldd r21, Y+63 ; 0x3f 1136a: 6e 97 sbiw r28, 0x1e ; 30 1136c: 28 96 adiw r28, 0x08 ; 8 1136e: 6c ad ldd r22, Y+60 ; 0x3c 11370: 7d ad ldd r23, Y+61 ; 0x3d 11372: 8e ad ldd r24, Y+62 ; 0x3e 11374: 9f ad ldd r25, Y+63 ; 0x3f 11376: 28 97 sbiw r28, 0x08 ; 8 11378: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1137c: 81 11 cpse r24, r1 1137e: 23 c0 rjmp .+70 ; 0x113c6 11380: a2 96 adiw r28, 0x22 ; 34 11382: 2c ad ldd r18, Y+60 ; 0x3c 11384: 3d ad ldd r19, Y+61 ; 0x3d 11386: 4e ad ldd r20, Y+62 ; 0x3e 11388: 5f ad ldd r21, Y+63 ; 0x3f 1138a: a2 97 sbiw r28, 0x22 ; 34 1138c: 2c 96 adiw r28, 0x0c ; 12 1138e: 6c ad ldd r22, Y+60 ; 0x3c 11390: 7d ad ldd r23, Y+61 ; 0x3d 11392: 8e ad ldd r24, Y+62 ; 0x3e 11394: 9f ad ldd r25, Y+63 ; 0x3f 11396: 2c 97 sbiw r28, 0x0c ; 12 11398: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1139c: 81 11 cpse r24, r1 1139e: 13 c0 rjmp .+38 ; 0x113c6 113a0: 20 e0 ldi r18, 0x00 ; 0 113a2: 30 e0 ldi r19, 0x00 ; 0 113a4: a9 01 movw r20, r18 113a6: c7 01 movw r24, r14 113a8: b6 01 movw r22, r12 113aa: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 113ae: 81 11 cpse r24, r1 113b0: 0a c0 rjmp .+20 ; 0x113c6 { angular_travel_total += 2 * M_PI; 113b2: 2b ed ldi r18, 0xDB ; 219 113b4: 3f e0 ldi r19, 0x0F ; 15 113b6: 49 ec ldi r20, 0xC9 ; 201 113b8: 50 e4 ldi r21, 0x40 ; 64 113ba: c7 01 movw r24, r14 113bc: b6 01 movw r22, r12 113be: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 113c2: 6b 01 movw r12, r22 113c4: 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)); 113c6: a7 01 movw r20, r14 113c8: 96 01 movw r18, r12 113ca: 24 96 adiw r28, 0x04 ; 4 113cc: 6c ad ldd r22, Y+60 ; 0x3c 113ce: 7d ad ldd r23, Y+61 ; 0x3d 113d0: 8e ad ldd r24, Y+62 ; 0x3e 113d2: 9f ad ldd r25, Y+63 ; 0x3f 113d4: 24 97 sbiw r28, 0x04 ; 4 113d6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 113da: 6a 96 adiw r28, 0x1a ; 26 113dc: 2c ad ldd r18, Y+60 ; 0x3c 113de: 3d ad ldd r19, Y+61 ; 0x3d 113e0: 4e ad ldd r20, Y+62 ; 0x3e 113e2: 5f ad ldd r21, Y+63 ; 0x3f 113e4: 6a 97 sbiw r28, 0x1a ; 26 113e6: 0f 94 41 a4 call 0x34882 ; 0x34882 113ea: 4b 01 movw r8, r22 113ec: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 113ee: 2f e6 ldi r18, 0x6F ; 111 113f0: 32 e1 ldi r19, 0x12 ; 18 113f2: 43 e8 ldi r20, 0x83 ; 131 113f4: 5a e3 ldi r21, 0x3A ; 58 113f6: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 113fa: 87 fd sbrc r24, 7 113fc: 9e c1 rjmp .+828 ; 0x1173a // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 113fe: 92 01 movw r18, r4 11400: a3 01 movw r20, r6 11402: c5 01 movw r24, r10 11404: b4 01 movw r22, r8 11406: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1140a: 0f 94 83 a2 call 0x34506 ; 0x34506 1140e: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 11412: 7d ab std Y+53, r23 ; 0x35 11414: 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) 11416: 62 30 cpi r22, 0x02 ; 2 11418: 71 05 cpc r23, r1 1141a: 08 f4 brcc .+2 ; 0x1141e 1141c: 5e c1 rjmp .+700 ; 0x116da 1141e: 2e 96 adiw r28, 0x0e ; 14 11420: 4e ad ldd r20, Y+62 ; 0x3e 11422: 5f ad ldd r21, Y+63 ; 0x3f 11424: 2e 97 sbiw r28, 0x0e ; 14 11426: 45 2b or r20, r21 11428: 09 f4 brne .+2 ; 0x1142c 1142a: 57 c1 rjmp .+686 ; 0x116da { // 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, 1142c: 90 e0 ldi r25, 0x00 ; 0 1142e: 80 e0 ldi r24, 0x00 ; 0 11430: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 11434: 4b 01 movw r8, r22 11436: 5c 01 movw r10, r24 11438: ac 01 movw r20, r24 1143a: 9b 01 movw r18, r22 1143c: c7 01 movw r24, r14 1143e: b6 01 movw r22, r12 11440: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 11444: 2b 01 movw r4, r22 11446: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 11448: a5 01 movw r20, r10 1144a: 94 01 movw r18, r8 1144c: 6a 96 adiw r28, 0x1a ; 26 1144e: 6c ad ldd r22, Y+60 ; 0x3c 11450: 7d ad ldd r23, Y+61 ; 0x3d 11452: 8e ad ldd r24, Y+62 ; 0x3e 11454: 9f ad ldd r25, Y+63 ; 0x3f 11456: 6a 97 sbiw r28, 0x1a ; 26 11458: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1145c: 28 96 adiw r28, 0x08 ; 8 1145e: 6c af std Y+60, r22 ; 0x3c 11460: 7d af std Y+61, r23 ; 0x3d 11462: 8e af std Y+62, r24 ; 0x3e 11464: 9f af std Y+63, r25 ; 0x3f 11466: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 11468: 2d 85 ldd r18, Y+13 ; 0x0d 1146a: 3e 85 ldd r19, Y+14 ; 0x0e 1146c: 4f 85 ldd r20, Y+15 ; 0x0f 1146e: 58 89 ldd r21, Y+16 ; 0x10 11470: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 11474: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 11478: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 1147c: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 11480: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 11484: a5 01 movw r20, r10 11486: 94 01 movw r18, r8 11488: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1148c: 2c 96 adiw r28, 0x0c ; 12 1148e: 6c af std Y+60, r22 ; 0x3c 11490: 7d af std Y+61, r23 ; 0x3d 11492: 8e af std Y+62, r24 ; 0x3e 11494: 9f af std Y+63, r25 ; 0x3f 11496: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 11498: a3 01 movw r20, r6 1149a: 92 01 movw r18, r4 1149c: c3 01 movw r24, r6 1149e: b2 01 movw r22, r4 114a0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 114a4: 6b 01 movw r12, r22 114a6: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 114a8: ac 01 movw r20, r24 114aa: 9b 01 movw r18, r22 114ac: c3 01 movw r24, r6 114ae: b2 01 movw r22, r4 114b0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 114b4: 20 e0 ldi r18, 0x00 ; 0 114b6: 30 e0 ldi r19, 0x00 ; 0 114b8: 40 ec ldi r20, 0xC0 ; 192 114ba: 50 e4 ldi r21, 0x40 ; 64 114bc: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 114c0: 9b 01 movw r18, r22 114c2: ac 01 movw r20, r24 114c4: c3 01 movw r24, r6 114c6: b2 01 movw r22, r4 114c8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 114cc: 6c af std Y+60, r22 ; 0x3c 114ce: 7d af std Y+61, r23 ; 0x3d 114d0: 8e af std Y+62, r24 ; 0x3e 114d2: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 114d4: 20 e0 ldi r18, 0x00 ; 0 114d6: 30 e0 ldi r19, 0x00 ; 0 114d8: 40 e0 ldi r20, 0x00 ; 0 114da: 5f e3 ldi r21, 0x3F ; 63 114dc: c7 01 movw r24, r14 114de: b6 01 movw r22, r12 114e0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 114e4: 9b 01 movw r18, r22 114e6: ac 01 movw r20, r24 114e8: 60 e0 ldi r22, 0x00 ; 0 114ea: 70 e0 ldi r23, 0x00 ; 0 114ec: 80 e8 ldi r24, 0x80 ; 128 114ee: 9f e3 ldi r25, 0x3F ; 63 114f0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 114f4: 24 96 adiw r28, 0x04 ; 4 114f6: 6c af std Y+60, r22 ; 0x3c 114f8: 7d af std Y+61, r23 ; 0x3d 114fa: 8e af std Y+62, r24 ; 0x3e 114fc: 9f af std Y+63, r25 ; 0x3f 114fe: 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++) { 11500: 22 24 eor r2, r2 11502: 23 94 inc r2 11504: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 11506: d8 a8 ldd r13, Y+48 ; 0x30 11508: da 94 dec r13 1150a: 58 a9 ldd r21, Y+48 ; 0x30 1150c: 51 11 cpse r21, r1 1150e: 25 c1 rjmp .+586 ; 0x1175a // 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); 11510: b1 01 movw r22, r2 11512: 90 e0 ldi r25, 0x00 ; 0 11514: 80 e0 ldi r24, 0x00 ; 0 11516: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 1151a: a3 01 movw r20, r6 1151c: 92 01 movw r18, r4 1151e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11522: 6b 01 movw r12, r22 11524: 7c 01 movw r14, r24 11526: 0f 94 9f a2 call 0x3453e ; 0x3453e 1152a: 6c a7 std Y+44, r22 ; 0x2c 1152c: 7d a7 std Y+45, r23 ; 0x2d 1152e: 8e a7 std Y+46, r24 ; 0x2e 11530: 9f a7 std Y+47, r25 ; 0x2f 11532: c7 01 movw r24, r14 11534: b6 01 movw r22, r12 11536: 0f 94 65 a5 call 0x34aca ; 0x34aca 1153a: 4b 01 movw r8, r22 1153c: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 1153e: c0 90 4f 03 lds r12, 0x034F ; 0x80034f 11542: d0 90 50 03 lds r13, 0x0350 ; 0x800350 11546: e0 90 51 03 lds r14, 0x0351 ; 0x800351 1154a: f0 90 52 03 lds r15, 0x0352 ; 0x800352 1154e: f7 fa bst r15, 7 11550: f0 94 com r15 11552: f7 f8 bld r15, 7 11554: f0 94 com r15 11556: 80 91 53 03 lds r24, 0x0353 ; 0x800353 1155a: 90 91 54 03 lds r25, 0x0354 ; 0x800354 1155e: a0 91 55 03 lds r26, 0x0355 ; 0x800355 11562: b0 91 56 03 lds r27, 0x0356 ; 0x800356 11566: 88 ab std Y+48, r24 ; 0x30 11568: 99 ab std Y+49, r25 ; 0x31 1156a: aa ab std Y+50, r26 ; 0x32 1156c: bb ab std Y+51, r27 ; 0x33 1156e: a7 01 movw r20, r14 11570: 96 01 movw r18, r12 11572: 6c a5 ldd r22, Y+44 ; 0x2c 11574: 7d a5 ldd r23, Y+45 ; 0x2d 11576: 8e a5 ldd r24, Y+46 ; 0x2e 11578: 9f a5 ldd r25, Y+47 ; 0x2f 1157a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1157e: 68 a7 std Y+40, r22 ; 0x28 11580: 79 a7 std Y+41, r23 ; 0x29 11582: 8a a7 std Y+42, r24 ; 0x2a 11584: 9b a7 std Y+43, r25 ; 0x2b 11586: 28 a9 ldd r18, Y+48 ; 0x30 11588: 39 a9 ldd r19, Y+49 ; 0x31 1158a: 4a a9 ldd r20, Y+50 ; 0x32 1158c: 5b a9 ldd r21, Y+51 ; 0x33 1158e: c5 01 movw r24, r10 11590: b4 01 movw r22, r8 11592: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11596: 9b 01 movw r18, r22 11598: ac 01 movw r20, r24 1159a: 68 a5 ldd r22, Y+40 ; 0x28 1159c: 79 a5 ldd r23, Y+41 ; 0x29 1159e: 8a a5 ldd r24, Y+42 ; 0x2a 115a0: 9b a5 ldd r25, Y+43 ; 0x2b 115a2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 115a6: 68 a7 std Y+40, r22 ; 0x28 115a8: 79 a7 std Y+41, r23 ; 0x29 115aa: 8a a7 std Y+42, r24 ; 0x2a 115ac: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 115ae: a7 01 movw r20, r14 115b0: 96 01 movw r18, r12 115b2: c5 01 movw r24, r10 115b4: b4 01 movw r22, r8 115b6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 115ba: 6b 01 movw r12, r22 115bc: 7c 01 movw r14, r24 115be: 28 a9 ldd r18, Y+48 ; 0x30 115c0: 39 a9 ldd r19, Y+49 ; 0x31 115c2: 4a a9 ldd r20, Y+50 ; 0x32 115c4: 5b a9 ldd r21, Y+51 ; 0x33 115c6: 6c a5 ldd r22, Y+44 ; 0x2c 115c8: 7d a5 ldd r23, Y+45 ; 0x2d 115ca: 8e a5 ldd r24, Y+46 ; 0x2e 115cc: 9f a5 ldd r25, Y+47 ; 0x2f 115ce: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 115d2: 9b 01 movw r18, r22 115d4: ac 01 movw r20, r24 115d6: c7 01 movw r24, r14 115d8: b6 01 movw r22, r12 115da: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 115de: 6c a7 std Y+44, r22 ; 0x2c 115e0: 7d a7 std Y+45, r23 ; 0x2d 115e2: 8e a7 std Y+46, r24 ; 0x2e 115e4: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 115e6: 90 91 fe 04 lds r25, 0x04FE ; 0x8004fe 115ea: 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; 115ec: 28 a5 ldd r18, Y+40 ; 0x28 115ee: 39 a5 ldd r19, Y+41 ; 0x29 115f0: 4a a5 ldd r20, Y+42 ; 0x2a 115f2: 5b a5 ldd r21, Y+43 ; 0x2b 115f4: 62 96 adiw r28, 0x12 ; 18 115f6: 6c ad ldd r22, Y+60 ; 0x3c 115f8: 7d ad ldd r23, Y+61 ; 0x3d 115fa: 8e ad ldd r24, Y+62 ; 0x3e 115fc: 9f ad ldd r25, Y+63 ; 0x3f 115fe: 62 97 sbiw r28, 0x12 ; 18 11600: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11604: 69 83 std Y+1, r22 ; 0x01 11606: 7a 83 std Y+2, r23 ; 0x02 11608: 8b 83 std Y+3, r24 ; 0x03 1160a: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 1160c: 2c a5 ldd r18, Y+44 ; 0x2c 1160e: 3d a5 ldd r19, Y+45 ; 0x2d 11610: 4e a5 ldd r20, Y+46 ; 0x2e 11612: 5f a5 ldd r21, Y+47 ; 0x2f 11614: 66 96 adiw r28, 0x16 ; 22 11616: 6c ad ldd r22, Y+60 ; 0x3c 11618: 7d ad ldd r23, Y+61 ; 0x3d 1161a: 8e ad ldd r24, Y+62 ; 0x3e 1161c: 9f ad ldd r25, Y+63 ; 0x3f 1161e: 66 97 sbiw r28, 0x16 ; 22 11620: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11624: 6d 83 std Y+5, r22 ; 0x05 11626: 7e 83 std Y+6, r23 ; 0x06 11628: 8f 83 std Y+7, r24 ; 0x07 1162a: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 1162c: 28 96 adiw r28, 0x08 ; 8 1162e: 2c ad ldd r18, Y+60 ; 0x3c 11630: 3d ad ldd r19, Y+61 ; 0x3d 11632: 4e ad ldd r20, Y+62 ; 0x3e 11634: 5f ad ldd r21, Y+63 ; 0x3f 11636: 28 97 sbiw r28, 0x08 ; 8 11638: 69 85 ldd r22, Y+9 ; 0x09 1163a: 7a 85 ldd r23, Y+10 ; 0x0a 1163c: 8b 85 ldd r24, Y+11 ; 0x0b 1163e: 9c 85 ldd r25, Y+12 ; 0x0c 11640: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11644: 69 87 std Y+9, r22 ; 0x09 11646: 7a 87 std Y+10, r23 ; 0x0a 11648: 8b 87 std Y+11, r24 ; 0x0b 1164a: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 1164c: 2c 96 adiw r28, 0x0c ; 12 1164e: 2c ad ldd r18, Y+60 ; 0x3c 11650: 3d ad ldd r19, Y+61 ; 0x3d 11652: 4e ad ldd r20, Y+62 ; 0x3e 11654: 5f ad ldd r21, Y+63 ; 0x3f 11656: 2c 97 sbiw r28, 0x0c ; 12 11658: 6d 85 ldd r22, Y+13 ; 0x0d 1165a: 7e 85 ldd r23, Y+14 ; 0x0e 1165c: 8f 85 ldd r24, Y+15 ; 0x0f 1165e: 98 89 ldd r25, Y+16 ; 0x10 11660: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11664: 6d 87 std Y+13, r22 ; 0x0d 11666: 7e 87 std Y+14, r23 ; 0x0e 11668: 8f 87 std Y+15, r24 ; 0x0f 1166a: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 1166c: ce 01 movw r24, r28 1166e: 01 96 adiw r24, 0x01 ; 1 11670: 0e 94 50 65 call 0xcaa0 ; 0xcaa0 // Insert the segment into the buffer if (i >= start_segment_idx) 11674: 2e 96 adiw r28, 0x0e ; 14 11676: ae ad ldd r26, Y+62 ; 0x3e 11678: bf ad ldd r27, Y+63 ; 0x3f 1167a: 2e 97 sbiw r28, 0x0e ; 14 1167c: 2a 16 cp r2, r26 1167e: 3b 06 cpc r3, r27 11680: f8 f0 brcs .+62 ; 0x116c0 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 11682: e9 84 ldd r14, Y+9 ; 0x09 11684: fa 84 ldd r15, Y+10 ; 0x0a 11686: 0b 85 ldd r16, Y+11 ; 0x0b 11688: 1c 85 ldd r17, Y+12 ; 0x0c 1168a: 2d 81 ldd r18, Y+5 ; 0x05 1168c: 3e 81 ldd r19, Y+6 ; 0x06 1168e: 4f 81 ldd r20, Y+7 ; 0x07 11690: 58 85 ldd r21, Y+8 ; 0x08 11692: 69 81 ldd r22, Y+1 ; 0x01 11694: 7a 81 ldd r23, Y+2 ; 0x02 11696: 8b 81 ldd r24, Y+3 ; 0x03 11698: 9c 81 ldd r25, Y+4 ; 0x04 1169a: 3f 92 push r3 1169c: 2f 92 push r2 1169e: e5 ef ldi r30, 0xF5 ; 245 116a0: f1 e1 ldi r31, 0x11 ; 17 116a2: ff 93 push r31 116a4: ef 93 push r30 116a6: 88 ac ldd r8, Y+56 ; 0x38 116a8: 99 ac ldd r9, Y+57 ; 0x39 116aa: aa ac ldd r10, Y+58 ; 0x3a 116ac: bb ac ldd r11, Y+59 ; 0x3b 116ae: fe 01 movw r30, r28 116b0: 3d 96 adiw r30, 0x0d ; 13 116b2: 6f 01 movw r12, r30 116b4: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 116b8: 0f 90 pop r0 116ba: 0f 90 pop r0 116bc: 0f 90 pop r0 116be: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 116c0: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 116c4: 81 11 cpse r24, r1 116c6: 39 c0 rjmp .+114 ; 0x1173a 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++) { 116c8: ff ef ldi r31, 0xFF ; 255 116ca: 2f 1a sub r2, r31 116cc: 3f 0a sbc r3, r31 116ce: 2c a9 ldd r18, Y+52 ; 0x34 116d0: 3d a9 ldd r19, Y+53 ; 0x35 116d2: 22 15 cp r18, r2 116d4: 33 05 cpc r19, r3 116d6: 09 f0 breq .+2 ; 0x116da 116d8: 16 cf rjmp .-468 ; 0x11506 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 116da: 83 e9 ldi r24, 0x93 ; 147 116dc: 96 e0 ldi r25, 0x06 ; 6 116de: 0e 94 50 65 call 0xcaa0 ; 0xcaa0 // 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); 116e2: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 116e6: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 116ea: 00 91 9d 06 lds r16, 0x069D ; 0x80069d 116ee: 10 91 9e 06 lds r17, 0x069E ; 0x80069e 116f2: 20 91 97 06 lds r18, 0x0697 ; 0x800697 116f6: 30 91 98 06 lds r19, 0x0698 ; 0x800698 116fa: 40 91 99 06 lds r20, 0x0699 ; 0x800699 116fe: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 11702: 60 91 93 06 lds r22, 0x0693 ; 0x800693 11706: 70 91 94 06 lds r23, 0x0694 ; 0x800694 1170a: 80 91 95 06 lds r24, 0x0695 ; 0x800695 1170e: 90 91 96 06 lds r25, 0x0696 ; 0x800696 11712: 1f 92 push r1 11714: 1f 92 push r1 11716: e5 ef ldi r30, 0xF5 ; 245 11718: f1 e1 ldi r31, 0x11 ; 17 1171a: ff 93 push r31 1171c: ef 93 push r30 1171e: 88 ac ldd r8, Y+56 ; 0x38 11720: 99 ac ldd r9, Y+57 ; 0x39 11722: aa ac ldd r10, Y+58 ; 0x3a 11724: bb ac ldd r11, Y+59 ; 0x3b 11726: ef e9 ldi r30, 0x9F ; 159 11728: ce 2e mov r12, r30 1172a: e6 e0 ldi r30, 0x06 ; 6 1172c: de 2e mov r13, r30 1172e: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 11732: 0f 90 pop r0 11734: 0f 90 pop r0 11736: 0f 90 pop r0 11738: 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(); 1173a: 0e 94 37 55 call 0xaa6e ; 0xaa6e previous_millis_cmd.start(); 1173e: 8a e4 ldi r24, 0x4A ; 74 11740: 93 e0 ldi r25, 0x03 ; 3 11742: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> 11746: 4d cc rjmp .-1894 ; 0x10fe2 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; 11748: 60 e0 ldi r22, 0x00 ; 0 1174a: 70 e0 ldi r23, 0x00 ; 0 1174c: cb 01 movw r24, r22 1174e: 5e cc rjmp .-1860 ; 0x1100c 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; 11750: a3 2c mov r10, r3 11752: b2 2c mov r11, r2 11754: 0c a9 ldd r16, Y+52 ; 0x34 11756: 1c ad ldd r17, Y+60 ; 0x3c 11758: b0 cd rjmp .-1184 ; 0x112ba // 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; 1175a: 28 a5 ldd r18, Y+40 ; 0x28 1175c: 39 a5 ldd r19, Y+41 ; 0x29 1175e: 4a a5 ldd r20, Y+42 ; 0x2a 11760: 5b a5 ldd r21, Y+43 ; 0x2b 11762: 6c ad ldd r22, Y+60 ; 0x3c 11764: 7d ad ldd r23, Y+61 ; 0x3d 11766: 8e ad ldd r24, Y+62 ; 0x3e 11768: 9f ad ldd r25, Y+63 ; 0x3f 1176a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1176e: 4b 01 movw r8, r22 11770: 5c 01 movw r10, r24 11772: 2c a5 ldd r18, Y+44 ; 0x2c 11774: 3d a5 ldd r19, Y+45 ; 0x2d 11776: 4e a5 ldd r20, Y+46 ; 0x2e 11778: 5f a5 ldd r21, Y+47 ; 0x2f 1177a: 24 96 adiw r28, 0x04 ; 4 1177c: 6c ad ldd r22, Y+60 ; 0x3c 1177e: 7d ad ldd r23, Y+61 ; 0x3d 11780: 8e ad ldd r24, Y+62 ; 0x3e 11782: 9f ad ldd r25, Y+63 ; 0x3f 11784: 24 97 sbiw r28, 0x04 ; 4 11786: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1178a: 9b 01 movw r18, r22 1178c: ac 01 movw r20, r24 1178e: c5 01 movw r24, r10 11790: b4 01 movw r22, r8 11792: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11796: 7b 01 movw r14, r22 11798: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 1179a: 28 a5 ldd r18, Y+40 ; 0x28 1179c: 39 a5 ldd r19, Y+41 ; 0x29 1179e: 4a a5 ldd r20, Y+42 ; 0x2a 117a0: 5b a5 ldd r21, Y+43 ; 0x2b 117a2: 24 96 adiw r28, 0x04 ; 4 117a4: 6c ad ldd r22, Y+60 ; 0x3c 117a6: 7d ad ldd r23, Y+61 ; 0x3d 117a8: 8e ad ldd r24, Y+62 ; 0x3e 117aa: 9f ad ldd r25, Y+63 ; 0x3f 117ac: 24 97 sbiw r28, 0x04 ; 4 117ae: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 117b2: 4b 01 movw r8, r22 117b4: 5c 01 movw r10, r24 117b6: 2c a5 ldd r18, Y+44 ; 0x2c 117b8: 3d a5 ldd r19, Y+45 ; 0x2d 117ba: 4e a5 ldd r20, Y+46 ; 0x2e 117bc: 5f a5 ldd r21, Y+47 ; 0x2f 117be: 6c ad ldd r22, Y+60 ; 0x3c 117c0: 7d ad ldd r23, Y+61 ; 0x3d 117c2: 8e ad ldd r24, Y+62 ; 0x3e 117c4: 9f ad ldd r25, Y+63 ; 0x3f 117c6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 117ca: 9b 01 movw r18, r22 117cc: ac 01 movw r20, r24 117ce: c5 01 movw r24, r10 117d0: b4 01 movw r22, r8 117d2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 117d6: 68 a7 std Y+40, r22 ; 0x28 117d8: 79 a7 std Y+41, r23 ; 0x29 117da: 8a a7 std Y+42, r24 ; 0x2a 117dc: 9b a7 std Y+43, r25 ; 0x2b 117de: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 117e0: c7 01 movw r24, r14 117e2: d8 01 movw r26, r16 117e4: 8c a7 std Y+44, r24 ; 0x2c 117e6: 9d a7 std Y+45, r25 ; 0x2d 117e8: ae a7 std Y+46, r26 ; 0x2e 117ea: bf a7 std Y+47, r27 ; 0x2f 117ec: ff ce rjmp .-514 ; 0x115ec - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 117ee: 80 e5 ldi r24, 0x50 ; 80 117f0: 0e 94 b6 55 call 0xab6c ; 0xab6c - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 117f4: c1 2c mov r12, r1 117f6: d1 2c mov r13, r1 117f8: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 117fa: 88 23 and r24, r24 117fc: 31 f0 breq .+12 ; 0x1180a 117fe: 0e 94 8e 5a call 0xb51c ; 0xb51c 11802: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 11806: 6b 01 movw r12, r22 11808: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 1180a: 83 e5 ldi r24, 0x53 ; 83 1180c: 0e 94 b6 55 call 0xab6c ; 0xab6c 11810: 88 23 and r24, r24 11812: 61 f0 breq .+24 ; 0x1182c 11814: 0e 94 8e 5a call 0xb51c ; 0xb51c 11818: 20 e0 ldi r18, 0x00 ; 0 1181a: 30 e0 ldi r19, 0x00 ; 0 1181c: 4a e7 ldi r20, 0x7A ; 122 1181e: 54 e4 ldi r21, 0x44 ; 68 11820: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11824: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 11828: 6b 01 movw r12, r22 1182a: 7c 01 movw r14, r24 if(codenum != 0) 1182c: c1 14 cp r12, r1 1182e: d1 04 cpc r13, r1 11830: e1 04 cpc r14, r1 11832: f1 04 cpc r15, r1 11834: 41 f0 breq .+16 ; 0x11846 { if(custom_message_type != CustomMsg::M117) 11836: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1183a: 87 30 cpi r24, 0x07 ; 7 1183c: 21 f0 breq .+8 ; 0x11846 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 1183e: 89 ec ldi r24, 0xC9 ; 201 11840: 97 e6 ldi r25, 0x67 ; 103 11842: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe } } st_synchronize(); 11846: 0f 94 14 22 call 0x24428 ; 0x24428 codenum += _millis(); // keep track of when we started waiting 1184a: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1184e: c6 0e add r12, r22 11850: d7 1e adc r13, r23 11852: e8 1e adc r14, r24 11854: f9 1e adc r15, r25 previous_millis_cmd.start(); 11856: 8a e4 ldi r24, 0x4A ; 74 11858: 93 e0 ldi r25, 0x03 ; 3 1185a: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> while(_millis() < codenum) { 1185e: 0f 94 46 0f call 0x21e8c ; 0x21e8c 11862: 6c 15 cp r22, r12 11864: 7d 05 cpc r23, r13 11866: 8e 05 cpc r24, r14 11868: 9f 05 cpc r25, r15 1186a: 08 f0 brcs .+2 ; 0x1186e 1186c: ba cb rjmp .-2188 ; 0x10fe2 manage_heater(); 1186e: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 11872: 80 e0 ldi r24, 0x00 ; 0 11874: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); 11878: 80 e0 ldi r24, 0x00 ; 0 1187a: 0e 94 cd 69 call 0xd39a ; 0xd39a 1187e: ef cf rjmp .-34 ; 0x1185e 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); 11880: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 11882: 0e 94 4e be call 0x17c9c ; 0x17c9c 11886: ad cb rjmp .-2214 ; 0x10fe2 11888: 80 e0 ldi r24, 0x00 ; 0 1188a: fb cf rjmp .-10 ; 0x11882 { 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]); 1188c: 88 e5 ldi r24, 0x58 ; 88 1188e: 0e 94 b6 55 call 0xab6c ; 0xab6c 11892: 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; 11894: 41 2c mov r4, r1 11896: 51 2c mov r5, r1 11898: 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(); 1189a: 88 23 and r24, r24 1189c: 21 f0 breq .+8 ; 0x118a6 1189e: 0e 94 1e 56 call 0xac3c ; 0xac3c 118a2: 2b 01 movw r4, r22 118a4: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 118a6: 89 e5 ldi r24, 0x59 ; 89 118a8: 0e 94 b6 55 call 0xab6c ; 0xab6c 118ac: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 118ae: 88 23 and r24, r24 118b0: 71 f1 breq .+92 ; 0x1190e 118b2: 0e 94 1e 56 call 0xac3c ; 0xac3c 118b6: 6c a7 std Y+44, r22 ; 0x2c 118b8: 7d a7 std Y+45, r23 ; 0x2d 118ba: 8e a7 std Y+46, r24 ; 0x2e 118bc: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 118be: 8a e5 ldi r24, 0x5A ; 90 118c0: 0e 94 b6 55 call 0xab6c ; 0xab6c 118c4: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 118c6: 81 2c mov r8, r1 118c8: 91 2c mov r9, r1 118ca: 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(); 118cc: 88 23 and r24, r24 118ce: 21 f0 breq .+8 ; 0x118d8 118d0: 0e 94 1e 56 call 0xac3c ; 0xac3c 118d4: 4b 01 movw r8, r22 118d6: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 118d8: 87 e5 ldi r24, 0x57 ; 87 118da: 0e 94 b6 55 call 0xab6c ; 0xab6c 118de: 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); 118e0: 8f 93 push r24 118e2: cd 2c mov r12, r13 118e4: ec a4 ldd r14, Y+44 ; 0x2c 118e6: fd a4 ldd r15, Y+45 ; 0x2d 118e8: 0e a5 ldd r16, Y+46 ; 0x2e 118ea: 1f a5 ldd r17, Y+47 ; 0x2f 118ec: 22 2d mov r18, r2 118ee: b3 01 movw r22, r6 118f0: a2 01 movw r20, r4 118f2: 83 2d mov r24, r3 118f4: 0e 94 fe 67 call 0xcffc ; 0xcffc #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 118f8: 0f 90 pop r0 118fa: 31 10 cpse r3, r1 118fc: 72 cb rjmp .-2332 ; 0x10fe2 118fe: 21 10 cpse r2, r1 11900: 70 cb rjmp .-2336 ; 0x10fe2 11902: 38 a5 ldd r19, Y+40 ; 0x28 11904: 31 11 cpse r19, r1 11906: 6d cb rjmp .-2342 ; 0x10fe2 11908: d1 10 cpse r13, r1 1190a: 6b cb rjmp .-2346 ; 0x10fe2 1190c: 20 cb rjmp .-2496 ; 0x10f4e - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 1190e: 1c a6 std Y+44, r1 ; 0x2c 11910: 1d a6 std Y+45, r1 ; 0x2d 11912: 1e a6 std Y+46, r1 ; 0x2e 11914: 1f a6 std Y+47, r1 ; 0x2f 11916: d3 cf rjmp .-90 ; 0x118be 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) 11918: 08 e2 ldi r16, 0x28 ; 40 1191a: 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)); 1191c: 94 ea ldi r25, 0xA4 ; 164 1191e: e9 2e mov r14, r25 11920: 97 e6 ldi r25, 0x67 ; 103 11922: f9 2e mov r15, r25 11924: 60 2f mov r22, r16 11926: 70 e0 ldi r23, 0x00 ; 0 11928: 90 e0 ldi r25, 0x00 ; 0 1192a: 80 e0 ldi r24, 0x00 ; 0 1192c: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 11930: 0e 94 8f 56 call 0xad1e ; 0xad1e 11934: 9f 93 push r25 11936: 8f 93 push r24 11938: 7f 93 push r23 1193a: 6f 93 push r22 1193c: 1f 93 push r17 1193e: 0f 93 push r16 11940: ff 92 push r15 11942: ef 92 push r14 11944: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 11948: 0f 5f subi r16, 0xFF ; 255 1194a: 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++) 1194c: 0f b6 in r0, 0x3f ; 63 1194e: f8 94 cli 11950: de bf out 0x3e, r29 ; 62 11952: 0f be out 0x3f, r0 ; 63 11954: cd bf out 0x3d, r28 ; 61 11956: 0f 36 cpi r16, 0x6F ; 111 11958: 11 05 cpc r17, r1 1195a: 21 f7 brne .-56 ; 0x11924 1195c: 42 cb rjmp .-2428 ; 0x10fe2 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 1195e: 0f 94 84 14 call 0x22908 ; 0x22908 11962: 81 11 cpse r24, r1 11964: 05 c0 rjmp .+10 ; 0x11970 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 11966: 81 e3 ldi r24, 0x31 ; 49 11968: 91 e8 ldi r25, 0x81 ; 129 1196a: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1196e: 39 cb rjmp .-2446 ; 0x10fe2 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 11970: 82 e0 ldi r24, 0x02 ; 2 11972: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 11976: 81 11 cpse r24, r1 11978: 07 c0 rjmp .+14 ; 0x11988 //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)); 1197a: 8b e2 ldi r24, 0x2B ; 43 1197c: 9a e3 ldi r25, 0x3A ; 58 1197e: 0e 94 3c 6d call 0xda78 ; 0xda78 11982: 0f 94 19 0b call 0x21632 ; 0x21632 11986: 2d cb rjmp .-2470 ; 0x10fe2 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 11988: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1198c: 88 23 and r24, r24 1198e: 41 f0 breq .+16 ; 0x119a0 11990: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 11994: 88 23 and r24, r24 11996: 21 f0 breq .+8 ; 0x119a0 11998: d0 90 a5 06 lds r13, 0x06A5 ; 0x8006a5 1199c: d1 10 cpse r13, r1 1199e: 08 c0 rjmp .+16 ; 0x119b0 119a0: 81 e0 ldi r24, 0x01 ; 1 119a2: 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); 119a6: 86 eb ldi r24, 0xB6 ; 182 119a8: 98 e6 ldi r25, 0x68 ; 104 119aa: 0f 94 f5 42 call 0x285ea ; 0x285ea 119ae: 19 cb rjmp .-2510 ; 0x10fe2 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 119b0: 82 ee ldi r24, 0xE2 ; 226 119b2: 99 e3 ldi r25, 0x39 ; 57 119b4: 0e 94 3c 6d call 0xda78 ; 0xda78 119b8: 0f 94 19 0b call 0x21632 ; 0x21632 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 119bc: 8b e9 ldi r24, 0x9B ; 155 119be: 91 e5 ldi r25, 0x51 ; 81 119c0: 0e 94 3c 6d call 0xda78 ; 0xda78 119c4: 41 e0 ldi r20, 0x01 ; 1 119c6: 60 e0 ldi r22, 0x00 ; 0 119c8: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (result == LCD_LEFT_BUTTON_CHOICE) 119cc: 81 11 cpse r24, r1 119ce: 6e c0 rjmp .+220 ; 0x11aac { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 119d0: 80 e0 ldi r24, 0x00 ; 0 119d2: 90 e0 ldi r25, 0x00 ; 0 119d4: a0 ea ldi r26, 0xA0 ; 160 119d6: b0 e4 ldi r27, 0x40 ; 64 119d8: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 119dc: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 119e0: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 119e4: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 119e8: 60 e0 ldi r22, 0x00 ; 0 119ea: 70 e0 ldi r23, 0x00 ; 0 119ec: 88 e4 ldi r24, 0x48 ; 72 119ee: 92 e4 ldi r25, 0x42 ; 66 119f0: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[Z_AXIS] = 50; 119f4: 80 e0 ldi r24, 0x00 ; 0 119f6: 90 e0 ldi r25, 0x00 ; 0 119f8: a8 e4 ldi r26, 0x48 ; 72 119fa: b2 e4 ldi r27, 0x42 ; 66 119fc: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11a00: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11a04: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11a08: b0 93 00 12 sts 0x1200, r27 ; 0x801200 current_position[Y_AXIS] = 180; 11a0c: 80 e0 ldi r24, 0x00 ; 0 11a0e: 90 e0 ldi r25, 0x00 ; 0 11a10: a4 e3 ldi r26, 0x34 ; 52 11a12: b3 e4 ldi r27, 0x43 ; 67 11a14: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11a18: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11a1c: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11a20: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11a24: 60 e0 ldi r22, 0x00 ; 0 11a26: 70 e0 ldi r23, 0x00 ; 0 11a28: 88 e4 ldi r24, 0x48 ; 72 11a2a: 92 e4 ldi r25, 0x42 ; 66 11a2c: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 11a30: 0f 94 14 22 call 0x24428 ; 0x24428 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 11a34: 81 e7 ldi r24, 0x71 ; 113 11a36: 91 e5 ldi r25, 0x51 ; 81 11a38: 0e 94 3c 6d call 0xda78 ; 0xda78 11a3c: 0f 94 19 0b call 0x21632 ; 0x21632 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11a40: e3 e5 ldi r30, 0x53 ; 83 11a42: f9 e8 ldi r31, 0x89 ; 137 11a44: 85 91 lpm r24, Z+ 11a46: 95 91 lpm r25, Z+ 11a48: a5 91 lpm r26, Z+ 11a4a: b4 91 lpm r27, Z 11a4c: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11a50: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11a54: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11a58: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11a5c: ef e4 ldi r30, 0x4F ; 79 11a5e: f9 e8 ldi r31, 0x89 ; 137 11a60: 85 91 lpm r24, Z+ 11a62: 95 91 lpm r25, Z+ 11a64: a5 91 lpm r26, Z+ 11a66: b4 91 lpm r27, Z 11a68: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11a6c: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11a70: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11a74: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(3000 / 60); 11a78: 60 e0 ldi r22, 0x00 ; 0 11a7a: 70 e0 ldi r23, 0x00 ; 0 11a7c: 88 e4 ldi r24, 0x48 ; 72 11a7e: 92 e4 ldi r25, 0x42 ; 66 11a80: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 11a84: 0f 94 14 22 call 0x24428 ; 0x24428 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); 11a88: 81 e0 ldi r24, 0x01 ; 1 11a8a: 8f 93 push r24 11a8c: 81 2c mov r8, r1 11a8e: 91 2c mov r9, r1 11a90: 54 01 movw r10, r8 11a92: cc 24 eor r12, r12 11a94: c3 94 inc r12 11a96: e1 2c mov r14, r1 11a98: f1 2c mov r15, r1 11a9a: 87 01 movw r16, r14 11a9c: 20 e0 ldi r18, 0x00 ; 0 11a9e: 40 e0 ldi r20, 0x00 ; 0 11aa0: 50 e0 ldi r21, 0x00 ; 0 11aa2: ba 01 movw r22, r20 11aa4: 80 e0 ldi r24, 0x00 ; 0 11aa6: 0e 94 fe 67 call 0xcffc ; 0xcffc 11aaa: 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)) { 11aac: 20 e0 ldi r18, 0x00 ; 0 11aae: 30 e0 ldi r19, 0x00 ; 0 11ab0: 4c e0 ldi r20, 0x0C ; 12 11ab2: 52 e4 ldi r21, 0x42 ; 66 11ab4: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11ab8: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11abc: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11ac0: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11ac4: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 11ac8: 18 16 cp r1, r24 11aca: 0c f0 brlt .+2 ; 0x11ace 11acc: 76 c0 rjmp .+236 ; 0x11bba 11ace: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 11ad2: 81 11 cpse r24, r1 11ad4: 72 c0 rjmp .+228 ; 0x11bba //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 11ad6: 80 e0 ldi r24, 0x00 ; 0 11ad8: 90 e0 ldi r25, 0x00 ; 0 11ada: a8 ec ldi r26, 0xC8 ; 200 11adc: b2 e4 ldi r27, 0x42 ; 66 11ade: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11ae2: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11ae6: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11aea: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11aee: 60 e0 ldi r22, 0x00 ; 0 11af0: 70 e0 ldi r23, 0x00 ; 0 11af2: 88 e4 ldi r24, 0x48 ; 72 11af4: 92 e4 ldi r25, 0x42 ; 66 11af6: 0f 94 11 85 call 0x30a22 ; 0x30a22 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 11afa: 0f 94 31 12 call 0x22462 ; 0x22462 LongTimer pinda_timeout; 11afe: 19 82 std Y+1, r1 ; 0x01 11b00: 1a 82 std Y+2, r1 ; 0x02 11b02: 1b 82 std Y+3, r1 ; 0x03 11b04: 1c 82 std Y+4, r1 ; 0x04 11b06: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 11b08: ce 01 movw r24, r28 11b0a: 01 96 adiw r24, 0x01 ; 1 11b0c: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::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); 11b10: 83 e2 ldi r24, 0x23 ; 35 11b12: f8 2e mov r15, r24 11b14: 0e ea ldi r16, 0xAE ; 174 11b16: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 11b18: 20 e0 ldi r18, 0x00 ; 0 11b1a: 30 e0 ldi r19, 0x00 ; 0 11b1c: 4c e0 ldi r20, 0x0C ; 12 11b1e: 52 e4 ldi r21, 0x42 ; 66 11b20: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11b24: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11b28: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11b2c: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11b30: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 11b34: 18 16 cp r1, r24 11b36: c4 f5 brge .+112 ; 0x11ba8 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 11b38: 84 e9 ldi r24, 0x94 ; 148 11b3a: 99 e3 ldi r25, 0x39 ; 57 11b3c: 0e 94 3c 6d call 0xda78 ; 0xda78 11b40: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 11b44: 42 e8 ldi r20, 0x82 ; 130 11b46: 64 e0 ldi r22, 0x04 ; 4 11b48: 80 e0 ldi r24, 0x00 ; 0 11b4a: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 11b4e: 1f 92 push r1 11b50: ff 92 push r15 11b52: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11b56: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11b5a: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11b5e: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11b62: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 11b66: 7f 93 push r23 11b68: 6f 93 push r22 11b6a: 1f 93 push r17 11b6c: 0f 93 push r16 11b6e: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_putc(LCD_STR_DEGREE[0]); 11b72: 81 e8 ldi r24, 0x81 ; 129 11b74: 0e 94 f5 69 call 0xd3ea ; 0xd3ea delay_keep_alive(1000); 11b78: 88 ee ldi r24, 0xE8 ; 232 11b7a: 93 e0 ldi r25, 0x03 ; 3 11b7c: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 serialecho_temperatures(); 11b80: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 11b84: 40 e0 ldi r20, 0x00 ; 0 11b86: 53 e5 ldi r21, 0x53 ; 83 11b88: 67 e0 ldi r22, 0x07 ; 7 11b8a: 70 e0 ldi r23, 0x00 ; 0 11b8c: ce 01 movw r24, r28 11b8e: 01 96 adiw r24, 0x01 ; 1 11b90: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> 11b94: 0f 90 pop r0 11b96: 0f 90 pop r0 11b98: 0f 90 pop r0 11b9a: 0f 90 pop r0 11b9c: 0f 90 pop r0 11b9e: 0f 90 pop r0 11ba0: 88 23 and r24, r24 11ba2: 09 f4 brne .+2 ; 0x11ba6 11ba4: b9 cf rjmp .-142 ; 0x11b18 target_temp_reached = false; 11ba6: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 11ba8: 81 e0 ldi r24, 0x01 ; 1 11baa: 0e 94 4b 6a call 0xd496 ; 0xd496 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 11bae: d1 10 cpse r13, r1 11bb0: 04 c0 rjmp .+8 ; 0x11bba lcd_temp_cal_show_result(false); 11bb2: 80 e0 ldi r24, 0x00 ; 0 11bb4: 0f 94 aa 0b call 0x21754 ; 0x21754 11bb8: 14 ca rjmp .-3032 ; 0x10fe2 break; } } st_synchronize(); 11bba: 0f 94 14 22 call 0x24428 ; 0x24428 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 11bbe: 81 e0 ldi r24, 0x01 ; 1 11bc0: 80 93 05 12 sts 0x1205, r24 ; 0x801205 lcd_update_enable(true); 11bc4: 0e 94 4b 6a call 0xd496 ; 0xd496 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 11bc8: 83 e1 ldi r24, 0x13 ; 19 11bca: 91 e8 ldi r25, 0x81 ; 129 11bcc: 0e 94 de 72 call 0xe5bc ; 0xe5bc float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 11bd0: 80 90 8e 06 lds r8, 0x068E ; 0x80068e 11bd4: 90 90 8f 06 lds r9, 0x068F ; 0x80068f 11bd8: a0 90 90 06 lds r10, 0x0690 ; 0x800690 11bdc: b0 90 91 06 lds r11, 0x0691 ; 0x800691 11be0: 20 e0 ldi r18, 0x00 ; 0 11be2: 30 e0 ldi r19, 0x00 ; 0 11be4: 40 ea ldi r20, 0xA0 ; 160 11be6: 50 e4 ldi r21, 0x40 ; 64 11be8: c5 01 movw r24, r10 11bea: b4 01 movw r22, r8 11bec: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 11bf0: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 11bf4: 25 e0 ldi r18, 0x05 ; 5 11bf6: 26 9f mul r18, r22 11bf8: a0 01 movw r20, r0 11bfa: 27 9f mul r18, r23 11bfc: 50 0d add r21, r0 11bfe: 11 24 eor r1, r1 11c00: ba 01 movw r22, r20 11c02: 55 0f add r21, r21 11c04: 88 0b sbc r24, r24 11c06: 99 0b sbc r25, r25 11c08: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 11c0c: 1b 01 movw r2, r22 11c0e: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 11c10: 20 e0 ldi r18, 0x00 ; 0 11c12: 30 e0 ldi r19, 0x00 ; 0 11c14: 4c e0 ldi r20, 0x0C ; 12 11c16: 52 e4 ldi r21, 0x42 ; 66 11c18: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 11c1c: 87 ff sbrs r24, 7 11c1e: 06 c0 rjmp .+12 ; 0x11c2c 11c20: 21 2c mov r2, r1 11c22: 31 2c mov r3, r1 11c24: 1c e0 ldi r17, 0x0C ; 12 11c26: e1 2e mov r14, r17 11c28: 02 e4 ldi r16, 0x42 ; 66 11c2a: f0 2e mov r15, r16 if (start_temp < current_temperature_pinda) start_temp += 5; 11c2c: 22 2d mov r18, r2 11c2e: 33 2d mov r19, r3 11c30: 4e 2d mov r20, r14 11c32: 5f 2d mov r21, r15 11c34: c5 01 movw r24, r10 11c36: b4 01 movw r22, r8 11c38: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 11c3c: 18 16 cp r1, r24 11c3e: 64 f4 brge .+24 ; 0x11c58 11c40: 20 e0 ldi r18, 0x00 ; 0 11c42: 30 e0 ldi r19, 0x00 ; 0 11c44: 40 ea ldi r20, 0xA0 ; 160 11c46: 50 e4 ldi r21, 0x40 ; 64 11c48: 62 2d mov r22, r2 11c4a: 73 2d mov r23, r3 11c4c: 8e 2d mov r24, r14 11c4e: 9f 2d mov r25, r15 11c50: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11c54: 1b 01 movw r2, r22 11c56: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 11c58: ff 92 push r15 11c5a: ef 92 push r14 11c5c: 3f 92 push r3 11c5e: 2f 92 push r2 11c60: 8b e8 ldi r24, 0x8B ; 139 11c62: 97 e6 ldi r25, 0x67 ; 103 11c64: 9f 93 push r25 11c66: 8f 93 push r24 11c68: 0f 94 3f 9f call 0x33e7e ; 0x33e7e setTargetBed(70 + (start_temp - 30)); 11c6c: 20 e0 ldi r18, 0x00 ; 0 11c6e: 30 e0 ldi r19, 0x00 ; 0 11c70: 40 ef ldi r20, 0xF0 ; 240 11c72: 51 e4 ldi r21, 0x41 ; 65 11c74: 62 2d mov r22, r2 11c76: 73 2d mov r23, r3 11c78: 8e 2d mov r24, r14 11c7a: 9f 2d mov r25, r15 11c7c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 11c80: 20 e0 ldi r18, 0x00 ; 0 11c82: 30 e0 ldi r19, 0x00 ; 0 11c84: 4c e8 ldi r20, 0x8C ; 140 11c86: 52 e4 ldi r21, 0x42 ; 66 11c88: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 11c8c: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 11c90: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11c94: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed custom_message_type = CustomMsg::TempCal; 11c98: 84 e0 ldi r24, 0x04 ; 4 11c9a: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 11c9e: 81 e0 ldi r24, 0x01 ; 1 11ca0: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 11ca4: 86 e3 ldi r24, 0x36 ; 54 11ca6: 9b e3 ldi r25, 0x3B ; 59 11ca8: 0e 94 3c 6d call 0xda78 ; 0xda78 11cac: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11cb0: 80 e0 ldi r24, 0x00 ; 0 11cb2: 90 e0 ldi r25, 0x00 ; 0 11cb4: a0 ea ldi r26, 0xA0 ; 160 11cb6: b0 e4 ldi r27, 0x40 ; 64 11cb8: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11cbc: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11cc0: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11cc4: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11cc8: 60 e0 ldi r22, 0x00 ; 0 11cca: 70 e0 ldi r23, 0x00 ; 0 11ccc: 88 e4 ldi r24, 0x48 ; 72 11cce: 92 e4 ldi r25, 0x42 ; 66 11cd0: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[X_AXIS] = PINDA_PREHEAT_X; 11cd4: 80 e0 ldi r24, 0x00 ; 0 11cd6: 90 e0 ldi r25, 0x00 ; 0 11cd8: a0 ea ldi r26, 0xA0 ; 160 11cda: b1 e4 ldi r27, 0x41 ; 65 11cdc: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11ce0: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11ce4: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11ce8: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11cec: 80 e0 ldi r24, 0x00 ; 0 11cee: 90 e0 ldi r25, 0x00 ; 0 11cf0: a0 e7 ldi r26, 0x70 ; 112 11cf2: b2 e4 ldi r27, 0x42 ; 66 11cf4: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11cf8: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11cfc: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11d00: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11d04: 60 e0 ldi r22, 0x00 ; 0 11d06: 70 e0 ldi r23, 0x00 ; 0 11d08: 88 e4 ldi r24, 0x48 ; 72 11d0a: 92 e4 ldi r25, 0x42 ; 66 11d0c: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11d10: 8a e9 ldi r24, 0x9A ; 154 11d12: 99 e9 ldi r25, 0x99 ; 153 11d14: a9 e1 ldi r26, 0x19 ; 25 11d16: be e3 ldi r27, 0x3E ; 62 11d18: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11d1c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11d20: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11d24: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11d28: 60 e0 ldi r22, 0x00 ; 0 11d2a: 70 e0 ldi r23, 0x00 ; 0 11d2c: 88 e4 ldi r24, 0x48 ; 72 11d2e: 92 e4 ldi r25, 0x42 ; 66 11d30: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 11d34: 0f 94 14 22 call 0x24428 ; 0x24428 11d38: 0f 90 pop r0 11d3a: 0f 90 pop r0 11d3c: 0f 90 pop r0 11d3e: 0f 90 pop r0 11d40: 0f 90 pop r0 11d42: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 11d44: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11d48: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11d4c: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11d50: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11d54: 62 2d mov r22, r2 11d56: 73 2d mov r23, r3 11d58: 8e 2d mov r24, r14 11d5a: 9f 2d mov r25, r15 11d5c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 11d60: 18 16 cp r1, r24 11d62: 3c f4 brge .+14 ; 0x11d72 { delay_keep_alive(1000); 11d64: 88 ee ldi r24, 0xE8 ; 232 11d66: 93 e0 ldi r25, 0x03 ; 3 11d68: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 serialecho_temperatures(); 11d6c: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 11d70: e9 cf rjmp .-46 ; 0x11d44 11d72: 60 e0 ldi r22, 0x00 ; 0 11d74: 86 ea ldi r24, 0xA6 ; 166 11d76: 9f e0 ldi r25, 0x0F ; 15 11d78: 0f 94 a1 a0 call 0x34142 ; 0x34142 } 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; 11d7c: 80 e0 ldi r24, 0x00 ; 0 11d7e: 90 e0 ldi r25, 0x00 ; 0 11d80: a0 ea ldi r26, 0xA0 ; 160 11d82: b0 e4 ldi r27, 0x40 ; 64 11d84: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11d88: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11d8c: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11d90: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11d94: 60 e0 ldi r22, 0x00 ; 0 11d96: 70 e0 ldi r23, 0x00 ; 0 11d98: 88 e4 ldi r24, 0x48 ; 72 11d9a: 92 e4 ldi r25, 0x42 ; 66 11d9c: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11da0: ef e4 ldi r30, 0x4F ; 79 11da2: f9 e8 ldi r31, 0x89 ; 137 11da4: 85 91 lpm r24, Z+ 11da6: 95 91 lpm r25, Z+ 11da8: a5 91 lpm r26, Z+ 11daa: b4 91 lpm r27, Z 11dac: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11db0: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11db4: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11db8: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11dbc: e3 e5 ldi r30, 0x53 ; 83 11dbe: f9 e8 ldi r31, 0x89 ; 137 11dc0: 85 91 lpm r24, Z+ 11dc2: 95 91 lpm r25, Z+ 11dc4: a5 91 lpm r26, Z+ 11dc6: b4 91 lpm r27, Z 11dc8: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11dcc: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11dd0: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11dd4: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11dd8: 60 e0 ldi r22, 0x00 ; 0 11dda: 70 e0 ldi r23, 0x00 ; 0 11ddc: 88 e4 ldi r24, 0x48 ; 72 11dde: 92 e4 ldi r25, 0x42 ; 66 11de0: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 11de4: 0f 94 14 22 call 0x24428 ; 0x24428 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 11de8: 43 e0 ldi r20, 0x03 ; 3 11dea: 60 e0 ldi r22, 0x00 ; 0 11dec: 70 e0 ldi r23, 0x00 ; 0 11dee: 80 e8 ldi r24, 0x80 ; 128 11df0: 9f eb ldi r25, 0xBF ; 191 11df2: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 if (find_z_result == false) { 11df6: 81 11 cpse r24, r1 11df8: 05 c0 rjmp .+10 ; 0x11e04 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); 11dfa: 0f 94 aa 0b call 0x21754 ; 0x21754 homing_flag = false; 11dfe: 10 92 05 12 sts 0x1205, r1 ; 0x801205 11e02: ef c8 rjmp .-3618 ; 0x10fe2 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 11e04: 90 91 fd 11 lds r25, 0x11FD ; 0x8011fd 11e08: 98 a7 std Y+40, r25 ; 0x28 11e0a: a0 91 fe 11 lds r26, 0x11FE ; 0x8011fe 11e0e: ac a7 std Y+44, r26 ; 0x2c 11e10: b0 91 ff 11 lds r27, 0x11FF ; 0x8011ff 11e14: b8 ab std Y+48, r27 ; 0x30 11e16: e0 91 00 12 lds r30, 0x1200 ; 0x801200 11e1a: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 11e1c: ef 93 push r30 11e1e: bf 93 push r27 11e20: af 93 push r26 11e22: 9f 93 push r25 11e24: 8e e7 ldi r24, 0x7E ; 126 11e26: 97 e6 ldi r25, 0x67 ; 103 11e28: 9f 93 push r25 11e2a: 8f 93 push r24 11e2c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 11e30: 0f 90 pop r0 11e32: 0f 90 pop r0 11e34: 0f 90 pop r0 11e36: 0f 90 pop r0 11e38: 0f 90 pop r0 11e3a: 0f 90 pop r0 11e3c: ae ea ldi r26, 0xAE ; 174 11e3e: 8a 2e mov r8, r26 11e40: af e0 ldi r26, 0x0F ; 15 11e42: 9a 2e mov r9, r26 11e44: b3 e2 ldi r27, 0x23 ; 35 11e46: cb 2e mov r12, r27 11e48: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 11e4a: 0f ef ldi r16, 0xFF ; 255 11e4c: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 11e4e: b6 01 movw r22, r12 11e50: 0d 2c mov r0, r13 11e52: 00 0c add r0, r0 11e54: 88 0b sbc r24, r24 11e56: 99 0b sbc r25, r25 11e58: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 11e5c: 2b 01 movw r4, r22 11e5e: 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)); 11e60: df 92 push r13 11e62: cf 92 push r12 11e64: c8 01 movw r24, r16 11e66: 02 96 adiw r24, 0x02 ; 2 11e68: 9f 93 push r25 11e6a: 8f 93 push r24 11e6c: 22 e4 ldi r18, 0x42 ; 66 11e6e: 37 e6 ldi r19, 0x67 ; 103 11e70: 3f 93 push r19 11e72: 2f 93 push r18 11e74: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 11e78: 58 01 movw r10, r16 11e7a: 5f ef ldi r21, 0xFF ; 255 11e7c: a5 1a sub r10, r21 11e7e: b5 0a sbc r11, r21 if (i >= 0) { 11e80: 0f 90 pop r0 11e82: 0f 90 pop r0 11e84: 0f 90 pop r0 11e86: 0f 90 pop r0 11e88: 0f 90 pop r0 11e8a: 0f 90 pop r0 11e8c: 11 f4 brne .+4 ; 0x11e92 11e8e: 0c 94 27 b0 jmp 0x1604e ; 0x1604e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11e92: 70 e0 ldi r23, 0x00 ; 0 11e94: 60 e0 ldi r22, 0x00 ; 0 11e96: c4 01 movw r24, r8 11e98: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 11e9c: a3 01 movw r20, r6 11e9e: 92 01 movw r18, r4 11ea0: 62 2d mov r22, r2 11ea2: 73 2d mov r23, r3 11ea4: 8e 2d mov r24, r14 11ea6: 9f 2d mov r25, r15 11ea8: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 11eac: 18 16 cp r1, r24 11eae: 44 f4 brge .+16 ; 0x11ec0 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 11eb0: 85 e0 ldi r24, 0x05 ; 5 11eb2: a8 16 cp r10, r24 11eb4: b1 04 cpc r11, r1 11eb6: 11 f0 breq .+4 ; 0x11ebc 11eb8: 0c 94 33 b0 jmp 0x16066 ; 0x16066 11ebc: 05 e0 ldi r16, 0x05 ; 5 11ebe: 10 e0 ldi r17, 0x00 ; 0 11ec0: 58 01 movw r10, r16 11ec2: 97 e2 ldi r25, 0x27 ; 39 11ec4: a9 1a sub r10, r25 11ec6: 98 ef ldi r25, 0xF8 ; 248 11ec8: b9 0a sbc r11, r25 11eca: aa 0c add r10, r10 11ecc: bb 1c adc r11, r11 11ece: 85 e0 ldi r24, 0x05 ; 5 11ed0: 80 9f mul r24, r16 11ed2: 10 01 movw r2, r0 11ed4: 81 9f mul r24, r17 11ed6: 30 0c add r3, r0 11ed8: 11 24 eor r1, r1 11eda: 0d 5f subi r16, 0xFD ; 253 11edc: 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; 11ede: ea e9 ldi r30, 0x9A ; 154 11ee0: 4e 2e mov r4, r30 11ee2: e9 e9 ldi r30, 0x99 ; 153 11ee4: 5e 2e mov r5, r30 11ee6: e9 e1 ldi r30, 0x19 ; 25 11ee8: 6e 2e mov r6, r30 11eea: ee e3 ldi r30, 0x3E ; 62 11eec: 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); 11eee: f9 e0 ldi r31, 0x09 ; 9 11ef0: 8f 2e mov r8, r31 11ef2: f7 e6 ldi r31, 0x67 ; 103 11ef4: 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++) 11ef6: c8 01 movw r24, r16 11ef8: 02 97 sbiw r24, 0x02 ; 2 11efa: 05 97 sbiw r24, 0x05 ; 5 11efc: 0c f0 brlt .+2 ; 0x11f00 11efe: d4 c0 rjmp .+424 ; 0x120a8 { float temp = (40 + i * 5); 11f00: b1 01 movw r22, r2 11f02: 63 5d subi r22, 0xD3 ; 211 11f04: 7f 4f sbci r23, 0xFF ; 255 11f06: 07 2e mov r0, r23 11f08: 00 0c add r0, r0 11f0a: 88 0b sbc r24, r24 11f0c: 99 0b sbc r25, r25 11f0e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 11f12: 6b 01 movw r12, r22 11f14: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 11f16: 1f 93 push r17 11f18: 0f 93 push r16 11f1a: a5 e3 ldi r26, 0x35 ; 53 11f1c: b7 e6 ldi r27, 0x67 ; 103 11f1e: bf 93 push r27 11f20: af 93 push r26 11f22: 0f 94 3f 9f call 0x33e7e ; 0x33e7e custom_message_state = i + 2; 11f26: 00 93 ac 03 sts 0x03AC, r16 ; 0x8003ac setTargetBed(50 + 10 * (temp - 30) / 5); 11f2a: 20 e0 ldi r18, 0x00 ; 0 11f2c: 30 e0 ldi r19, 0x00 ; 0 11f2e: 40 ef ldi r20, 0xF0 ; 240 11f30: 51 e4 ldi r21, 0x41 ; 65 11f32: c7 01 movw r24, r14 11f34: b6 01 movw r22, r12 11f36: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 11f3a: 20 e0 ldi r18, 0x00 ; 0 11f3c: 30 e0 ldi r19, 0x00 ; 0 11f3e: 40 e2 ldi r20, 0x20 ; 32 11f40: 51 e4 ldi r21, 0x41 ; 65 11f42: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 11f46: 20 e0 ldi r18, 0x00 ; 0 11f48: 30 e0 ldi r19, 0x00 ; 0 11f4a: 40 ea ldi r20, 0xA0 ; 160 11f4c: 50 e4 ldi r21, 0x40 ; 64 11f4e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 11f52: 20 e0 ldi r18, 0x00 ; 0 11f54: 30 e0 ldi r19, 0x00 ; 0 11f56: 48 e4 ldi r20, 0x48 ; 72 11f58: 52 e4 ldi r21, 0x42 ; 66 11f5a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 11f5e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 11f62: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11f66: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f6a: 80 e0 ldi r24, 0x00 ; 0 11f6c: 90 e0 ldi r25, 0x00 ; 0 11f6e: a0 ea ldi r26, 0xA0 ; 160 11f70: b0 e4 ldi r27, 0x40 ; 64 11f72: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11f76: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11f7a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11f7e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11f82: 60 e0 ldi r22, 0x00 ; 0 11f84: 70 e0 ldi r23, 0x00 ; 0 11f86: 88 e4 ldi r24, 0x48 ; 72 11f88: 92 e4 ldi r25, 0x42 ; 66 11f8a: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[X_AXIS] = PINDA_PREHEAT_X; 11f8e: 20 e0 ldi r18, 0x00 ; 0 11f90: 30 e0 ldi r19, 0x00 ; 0 11f92: 40 ea ldi r20, 0xA0 ; 160 11f94: 51 e4 ldi r21, 0x41 ; 65 11f96: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 11f9a: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 11f9e: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 11fa2: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11fa6: 80 e0 ldi r24, 0x00 ; 0 11fa8: 90 e0 ldi r25, 0x00 ; 0 11faa: a0 e7 ldi r26, 0x70 ; 112 11fac: b2 e4 ldi r27, 0x42 ; 66 11fae: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11fb2: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11fb6: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11fba: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11fbe: 60 e0 ldi r22, 0x00 ; 0 11fc0: 70 e0 ldi r23, 0x00 ; 0 11fc2: 88 e4 ldi r24, 0x48 ; 72 11fc4: 92 e4 ldi r25, 0x42 ; 66 11fc6: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11fca: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 11fce: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 11fd2: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 11fd6: 70 92 00 12 sts 0x1200, r7 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11fda: 60 e0 ldi r22, 0x00 ; 0 11fdc: 70 e0 ldi r23, 0x00 ; 0 11fde: 88 e4 ldi r24, 0x48 ; 72 11fe0: 92 e4 ldi r25, 0x42 ; 66 11fe2: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 11fe6: 0f 94 14 22 call 0x24428 ; 0x24428 11fea: 0f 90 pop r0 11fec: 0f 90 pop r0 11fee: 0f 90 pop r0 11ff0: 0f 90 pop r0 while (current_temperature_pinda < temp) 11ff2: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11ff6: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11ffa: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11ffe: 50 91 91 06 lds r21, 0x0691 ; 0x800691 12002: c7 01 movw r24, r14 12004: b6 01 movw r22, r12 12006: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1200a: 18 16 cp r1, r24 1200c: 3c f4 brge .+14 ; 0x1201c { delay_keep_alive(1000); 1200e: 88 ee ldi r24, 0xE8 ; 232 12010: 93 e0 ldi r25, 0x03 ; 3 12012: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 serialecho_temperatures(); 12016: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 1201a: eb cf rjmp .-42 ; 0x11ff2 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1201c: 80 e0 ldi r24, 0x00 ; 0 1201e: 90 e0 ldi r25, 0x00 ; 0 12020: a0 ea ldi r26, 0xA0 ; 160 12022: b0 e4 ldi r27, 0x40 ; 64 12024: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 12028: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1202c: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 12030: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 12034: 60 e0 ldi r22, 0x00 ; 0 12036: 70 e0 ldi r23, 0x00 ; 0 12038: 88 e4 ldi r24, 0x48 ; 72 1203a: 92 e4 ldi r25, 0x42 ; 66 1203c: 0f 94 11 85 call 0x30a22 ; 0x30a22 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 12040: ef e4 ldi r30, 0x4F ; 79 12042: f9 e8 ldi r31, 0x89 ; 137 12044: 85 91 lpm r24, Z+ 12046: 95 91 lpm r25, Z+ 12048: a5 91 lpm r26, Z+ 1204a: b4 91 lpm r27, Z 1204c: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 12050: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 12054: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 12058: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1205c: e3 e5 ldi r30, 0x53 ; 83 1205e: f9 e8 ldi r31, 0x89 ; 137 12060: 85 91 lpm r24, Z+ 12062: 95 91 lpm r25, Z+ 12064: a5 91 lpm r26, Z+ 12066: b4 91 lpm r27, Z 12068: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1206c: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 12070: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 12074: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 12078: 60 e0 ldi r22, 0x00 ; 0 1207a: 70 e0 ldi r23, 0x00 ; 0 1207c: 88 e4 ldi r24, 0x48 ; 72 1207e: 92 e4 ldi r25, 0x42 ; 66 12080: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 12084: 0f 94 14 22 call 0x24428 ; 0x24428 find_z_result = find_bed_induction_sensor_point_z(-1.f); 12088: 43 e0 ldi r20, 0x03 ; 3 1208a: 60 e0 ldi r22, 0x00 ; 0 1208c: 70 e0 ldi r23, 0x00 ; 0 1208e: 80 e8 ldi r24, 0x80 ; 128 12090: 9f eb ldi r25, 0xBF ; 191 12092: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 12096: 95 e0 ldi r25, 0x05 ; 5 12098: 29 0e add r2, r25 1209a: 31 1c adc r3, r1 1209c: 0f 5f subi r16, 0xFF ; 255 1209e: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 120a0: 81 11 cpse r24, r1 120a2: 04 c0 rjmp .+8 ; 0x120ac lcd_temp_cal_show_result(find_z_result); 120a4: 0f 94 aa 0b call 0x21754 ; 0x21754 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); 120a8: 81 e0 ldi r24, 0x01 ; 1 120aa: a7 ce rjmp .-690 ; 0x11dfa 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]); 120ac: 78 a5 ldd r23, Y+40 ; 0x28 120ae: 6c a5 ldd r22, Y+44 ; 0x2c 120b0: 98 a9 ldd r25, Y+48 ; 0x30 120b2: 88 ad ldd r24, Y+56 ; 0x38 120b4: 27 2f mov r18, r23 120b6: 36 2f mov r19, r22 120b8: 49 2f mov r20, r25 120ba: 58 2f mov r21, r24 120bc: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 120c0: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 120c4: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 120c8: 90 91 00 12 lds r25, 0x1200 ; 0x801200 120cc: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 120d0: f6 2e mov r15, r22 120d2: e7 2e mov r14, r23 120d4: d8 2e mov r13, r24 120d6: c9 2e mov r12, r25 120d8: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 120dc: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 120e0: 40 91 40 04 lds r20, 0x0440 ; 0x800440 120e4: 50 91 41 04 lds r21, 0x0441 ; 0x800441 120e8: d7 01 movw r26, r14 120ea: f6 01 movw r30, r12 120ec: 6b 2f mov r22, r27 120ee: 7a 2f mov r23, r26 120f0: 8f 2f mov r24, r31 120f2: 9e 2f mov r25, r30 120f4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 120f8: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 120fc: 6c ab std Y+52, r22 ; 0x34 120fe: 7d ab std Y+53, r23 ; 0x35 12100: 8e ab std Y+54, r24 ; 0x36 12102: 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); 12104: cf 92 push r12 12106: df 92 push r13 12108: ef 92 push r14 1210a: ff 92 push r15 1210c: 80 91 91 06 lds r24, 0x0691 ; 0x800691 12110: 8f 93 push r24 12112: 80 91 90 06 lds r24, 0x0690 ; 0x800690 12116: 8f 93 push r24 12118: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 1211c: 8f 93 push r24 1211e: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 12122: 8f 93 push r24 12124: 9f 92 push r9 12126: 8f 92 push r8 12128: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 1212c: 6c a9 ldd r22, Y+52 ; 0x34 1212e: 7d a9 ldd r23, Y+53 ; 0x35 12130: c5 01 movw r24, r10 12132: 0f 94 bf a0 call 0x3417e ; 0x3417e 12136: a2 e0 ldi r26, 0x02 ; 2 12138: aa 0e add r10, r26 1213a: b1 1c adc r11, r1 1213c: 0f b6 in r0, 0x3f ; 63 1213e: f8 94 cli 12140: de bf out 0x3e, r29 ; 62 12142: 0f be out 0x3f, r0 ; 63 12144: cd bf out 0x3d, r28 ; 61 12146: d7 ce rjmp .-594 ; 0x11ef6 /*! ### 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(); 12148: 0e 94 c2 73 call 0xe784 ; 0xe784 1214c: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 12150: 80 e1 ldi r24, 0x10 ; 16 12152: 0e 94 2b c6 call 0x18c56 ; 0x18c56 12156: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 /*! ### 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); 1215a: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 1215e: 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; 12160: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 12164: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 12168: 54 ec ldi r21, 0xC4 ; 196 1216a: c5 2e mov r12, r21 1216c: 52 e0 ldi r21, 0x02 ; 2 1216e: d5 2e mov r13, r21 12170: 8e 01 movw r16, r28 12172: 0c 5d subi r16, 0xDC ; 220 12174: 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) 12176: 58 01 movw r10, r16 12178: ee 24 eor r14, r14 1217a: e3 94 inc r14 1217c: 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]); 1217e: d6 01 movw r26, r12 12180: 8d 91 ld r24, X+ 12182: 6d 01 movw r12, r26 12184: 0e 94 b6 55 call 0xab6c ; 0xab6c 12188: f5 01 movw r30, r10 1218a: 81 93 st Z+, r24 1218c: 5f 01 movw r10, r30 if(codes[i]) 1218e: 88 23 and r24, r24 12190: 91 f0 breq .+36 ; 0x121b6 values[i] = code_value(); 12192: 0e 94 8e 5a call 0xb51c ; 0xb51c 12196: f7 01 movw r30, r14 12198: ee 0f add r30, r30 1219a: ff 1f adc r31, r31 1219c: ee 0f add r30, r30 1219e: ff 1f adc r31, r31 121a0: 34 97 sbiw r30, 0x04 ; 4 121a2: 21 e0 ldi r18, 0x01 ; 1 121a4: 30 e0 ldi r19, 0x00 ; 0 121a6: 2c 0f add r18, r28 121a8: 3d 1f adc r19, r29 121aa: e2 0f add r30, r18 121ac: f3 1f adc r31, r19 121ae: 60 83 st Z, r22 121b0: 71 83 std Z+1, r23 ; 0x01 121b2: 82 83 std Z+2, r24 ; 0x02 121b4: 93 83 std Z+3, r25 ; 0x03 121b6: 3f ef ldi r19, 0xFF ; 255 121b8: e3 1a sub r14, r19 121ba: 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) 121bc: 45 e0 ldi r20, 0x05 ; 5 121be: e4 16 cp r14, r20 121c0: f1 04 cpc r15, r1 121c2: e9 f6 brne .-70 ; 0x1217e codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 121c4: 9f a0 ldd r9, Y+39 ; 0x27 121c6: fc a0 ldd r15, Y+36 ; 0x24 121c8: 99 20 and r9, r9 121ca: 01 f1 breq .+64 ; 0x1220c 121cc: 20 e0 ldi r18, 0x00 ; 0 121ce: 30 e0 ldi r19, 0x00 ; 0 121d0: a9 01 movw r20, r18 121d2: 6d 85 ldd r22, Y+13 ; 0x0d 121d4: 7e 85 ldd r23, Y+14 ; 0x0e 121d6: 8f 85 ldd r24, Y+15 ; 0x0f 121d8: 98 89 ldd r25, Y+16 ; 0x10 121da: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 121de: 81 11 cpse r24, r1 121e0: 15 c0 rjmp .+42 ; 0x1220c 121e2: f1 10 cpse r15, r1 121e4: 13 c0 rjmp .+38 ; 0x1220c (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 121e6: 8d a1 ldd r24, Y+37 ; 0x25 121e8: 81 11 cpse r24, r1 121ea: 10 c0 rjmp .+32 ; 0x1220c 121ec: 8e a1 ldd r24, Y+38 ; 0x26 121ee: 81 11 cpse r24, r1 121f0: 0d c0 rjmp .+26 ; 0x1220c { // 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; 121f2: 10 92 01 12 sts 0x1201, r1 ; 0x801201 121f6: 10 92 02 12 sts 0x1202, r1 ; 0x801202 121fa: 10 92 03 12 sts 0x1203, r1 ; 0x801203 121fe: 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; 12202: 81 e0 ldi r24, 0x01 ; 1 12204: 80 93 ef 03 sts 0x03EF, r24 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> 12208: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 1220c: 0f 94 14 22 call 0x24428 ; 0x24428 12210: ce 01 movw r24, r28 12212: 01 96 adiw r24, 0x01 ; 1 12214: 5c 01 movw r10, r24 12216: 2a e8 ldi r18, 0x8A ; 138 12218: c2 2e mov r12, r18 1221a: 24 e0 ldi r18, 0x04 ; 4 1221c: d2 2e mov r13, r18 1221e: 35 ef ldi r19, 0xF5 ; 245 12220: e3 2e mov r14, r19 12222: 31 e1 ldi r19, 0x11 ; 17 12224: f3 2e mov r15, r19 12226: 38 01 movw r6, r16 12228: 93 e0 ldi r25, 0x03 ; 3 1222a: 69 0e add r6, r25 1222c: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 1222e: d8 01 movw r26, r16 12230: 8d 91 ld r24, X+ 12232: 8d 01 movw r16, r26 12234: 88 23 and r24, r24 12236: 89 f0 breq .+34 ; 0x1225a current_position[i] = values[i] + cs.add_homing[i]; 12238: f6 01 movw r30, r12 1223a: 20 81 ld r18, Z 1223c: 31 81 ldd r19, Z+1 ; 0x01 1223e: 42 81 ldd r20, Z+2 ; 0x02 12240: 53 81 ldd r21, Z+3 ; 0x03 12242: d5 01 movw r26, r10 12244: 6d 91 ld r22, X+ 12246: 7d 91 ld r23, X+ 12248: 8d 91 ld r24, X+ 1224a: 9c 91 ld r25, X 1224c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 12250: f7 01 movw r30, r14 12252: 60 83 st Z, r22 12254: 71 83 std Z+1, r23 ; 0x01 12256: 82 83 std Z+2, r24 ; 0x02 12258: 93 83 std Z+3, r25 ; 0x03 1225a: f4 e0 ldi r31, 0x04 ; 4 1225c: af 0e add r10, r31 1225e: b1 1c adc r11, r1 12260: 24 e0 ldi r18, 0x04 ; 4 12262: c2 0e add r12, r18 12264: d1 1c adc r13, r1 12266: 34 e0 ldi r19, 0x04 ; 4 12268: e3 0e add r14, r19 1226a: 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) 1226c: 60 16 cp r6, r16 1226e: 71 06 cpc r7, r17 12270: f1 f6 brne .-68 ; 0x1222e { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 12272: 99 20 and r9, r9 12274: 61 f0 breq .+24 ; 0x1228e current_position[E_AXIS] = values[E_AXIS]; 12276: 8d 85 ldd r24, Y+13 ; 0x0d 12278: 9e 85 ldd r25, Y+14 ; 0x0e 1227a: af 85 ldd r26, Y+15 ; 0x0f 1227c: b8 89 ldd r27, Y+16 ; 0x10 1227e: 80 93 01 12 sts 0x1201, r24 ; 0x801201 12282: 90 93 02 12 sts 0x1202, r25 ; 0x801202 12286: a0 93 03 12 sts 0x1203, r26 ; 0x801203 1228a: b0 93 04 12 sts 0x1204, r27 ; 0x801204 // Set all at once plan_set_position_curposXYZE(); 1228e: 0f 94 d1 83 call 0x307a2 ; 0x307a2 12292: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 return true; } void farm_gcode_g98() { farm_mode = 1; 12296: 81 e0 ldi r24, 0x01 ; 1 12298: 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); 1229c: 61 e0 ldi r22, 0x01 ; 1 1229e: 84 ec ldi r24, 0xC4 ; 196 122a0: 9f e0 ldi r25, 0x0F ; 15 122a2: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 122a6: 10 92 89 03 sts 0x0389, r1 ; 0x800389 122aa: 60 e0 ldi r22, 0x00 ; 0 122ac: 8f ef ldi r24, 0xFF ; 255 122ae: 9f e0 ldi r25, 0x0F ; 15 122b0: 0f 94 a1 a0 call 0x34142 ; 0x34142 } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 122b4: 0e 94 5c d8 call 0x1b0b8 ; 0x1b0b8 122b8: 0c 94 f1 87 jmp 0x10fe2 ; 0x10fe2 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 122bc: 8d 34 cpi r24, 0x4D ; 77 122be: 11 f0 breq .+4 ; 0x122c4 122c0: 0c 94 29 af jmp 0x15e52 ; 0x15e52 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 122c4: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 122c8: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 122cc: f8 01 movw r30, r16 122ce: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 122d0: 81 91 ld r24, Z+ 122d2: 80 32 cpi r24, 0x20 ; 32 122d4: e9 f3 breq .-6 ; 0x122d0 122d6: 89 30 cpi r24, 0x09 ; 9 122d8: d9 f3 breq .-10 ; 0x122d0 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 122da: 80 53 subi r24, 0x30 ; 48 122dc: 8a 30 cpi r24, 0x0A ; 10 122de: 30 f0 brcs .+12 ; 0x122ec printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 122e0: 1f 93 push r17 122e2: 0f 93 push r16 122e4: 8f ef ldi r24, 0xFF ; 255 122e6: 90 e8 ldi r25, 0x80 ; 128 122e8: 0c 94 a9 84 jmp 0x10952 ; 0x10952 } else { mcode_in_progress = code_value_short(); 122ec: 0e 94 d8 55 call 0xabb0 ; 0xabb0 122f0: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 122f4: 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) 122f8: 8e 3b cpi r24, 0xBE ; 190 122fa: 91 05 cpc r25, r1 122fc: 11 f4 brne .+4 ; 0x12302 122fe: 0c 94 36 9c jmp 0x1386c ; 0x1386c 12302: 0c f0 brlt .+2 ; 0x12306 12304: 07 c3 rjmp .+1550 ; 0x12914 12306: 8c 34 cpi r24, 0x4C ; 76 12308: 91 05 cpc r25, r1 1230a: 11 f4 brne .+4 ; 0x12310 1230c: 0c 94 4f 9b jmp 0x1369e ; 0x1369e 12310: 0c f0 brlt .+2 ; 0x12314 12312: de c1 rjmp .+956 ; 0x126d0 12314: 8c 31 cpi r24, 0x1C ; 28 12316: 91 05 cpc r25, r1 12318: 11 f4 brne .+4 ; 0x1231e 1231a: 0c 94 86 99 jmp 0x1330c ; 0x1330c 1231e: 0c f0 brlt .+2 ; 0x12322 12320: f4 c0 rjmp .+488 ; 0x1250a 12322: 85 31 cpi r24, 0x15 ; 21 12324: 91 05 cpc r25, r1 12326: 09 f4 brne .+2 ; 0x1232a 12328: 0a c7 rjmp .+3604 ; 0x1313e 1232a: 0c f0 brlt .+2 ; 0x1232e 1232c: 5a c0 rjmp .+180 ; 0x123e2 1232e: 81 31 cpi r24, 0x11 ; 17 12330: 91 05 cpc r25, r1 12332: 09 f4 brne .+2 ; 0x12336 12334: f9 c6 rjmp .+3570 ; 0x13128 12336: dc f4 brge .+54 ; 0x1236e 12338: 02 97 sbiw r24, 0x02 ; 2 1233a: 08 f4 brcc .+2 ; 0x1233e 1233c: 5d c6 rjmp .+3258 ; 0x12ff8 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 1233e: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 12342: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 12346: 8f 51 subi r24, 0x1F ; 31 12348: 90 4f sbci r25, 0xF0 ; 240 1234a: 9f 93 push r25 1234c: 8f 93 push r24 1234e: 1f 92 push r1 12350: 8d e4 ldi r24, 0x4D ; 77 12352: 8f 93 push r24 12354: 84 ef ldi r24, 0xF4 ; 244 12356: 96 e6 ldi r25, 0x66 ; 102 12358: 9f 93 push r25 1235a: 8f 93 push r24 1235c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 12360: 0f 90 pop r0 12362: 0f 90 pop r0 12364: 0f 90 pop r0 12366: 0f 90 pop r0 12368: 0f 90 pop r0 1236a: 0f 90 pop r0 1236c: a8 c6 rjmp .+3408 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1236e: 82 31 cpi r24, 0x12 ; 18 12370: 91 05 cpc r25, r1 12372: 11 f4 brne .+4 ; 0x12378 12374: 0c 94 e1 9c jmp 0x139c2 ; 0x139c2 12378: 44 97 sbiw r24, 0x14 ; 20 1237a: 09 f7 brne .-62 ; 0x1233e #### 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() 1237c: 81 e0 ldi r24, 0x01 ; 1 1237e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 12382: 84 ee ldi r24, 0xE4 ; 228 12384: 96 e6 ldi r25, 0x66 ; 102 12386: 0e 94 de 72 call 0xe5bc ; 0xe5bc card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 1238a: 84 e5 ldi r24, 0x54 ; 84 1238c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12390: 18 2f mov r17, r24 12392: 8c e4 ldi r24, 0x4C ; 76 12394: 0e 94 b6 55 call 0xab6c ; 0xab6c 12398: 00 e0 ldi r16, 0x00 ; 0 1239a: 80 fb bst r24, 0 1239c: 00 f9 bld r16, 0 1239e: 10 fb bst r17, 0 123a0: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 123a2: 80 ef ldi r24, 0xF0 ; 240 123a4: 93 e1 ldi r25, 0x13 ; 19 123a6: 0e 94 c1 70 call 0xe182 ; 0xe182 lsDive("",root, NULL, LS_SerialPrint, params); 123aa: 83 e2 ldi r24, 0x23 ; 35 123ac: e0 ef ldi r30, 0xF0 ; 240 123ae: f3 e1 ldi r31, 0x13 ; 19 123b0: de 01 movw r26, r28 123b2: 11 96 adiw r26, 0x01 ; 1 123b4: 01 90 ld r0, Z+ 123b6: 0d 92 st X+, r0 123b8: 8a 95 dec r24 123ba: e1 f7 brne .-8 ; 0x123b4 123bc: 20 e0 ldi r18, 0x00 ; 0 123be: 50 e0 ldi r21, 0x00 ; 0 123c0: 40 e0 ldi r20, 0x00 ; 0 123c2: be 01 movw r22, r28 123c4: 6f 5f subi r22, 0xFF ; 255 123c6: 7f 4f sbci r23, 0xFF ; 255 123c8: 8a ed ldi r24, 0xDA ; 218 123ca: 92 e0 ldi r25, 0x02 ; 2 123cc: 0f 94 07 45 call 0x28a0e ; 0x28a0e 123d0: ce 01 movw r24, r28 123d2: 01 96 adiw r24, 0x01 ; 1 123d4: 0e 94 c6 70 call 0xe18c ; 0xe18c SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 123d8: 86 ed ldi r24, 0xD6 ; 214 123da: 96 e6 ldi r25, 0x66 ; 102 123dc: 0e 94 de 72 call 0xe5bc ; 0xe5bc 123e0: 6e c6 rjmp .+3292 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 123e2: 88 31 cpi r24, 0x18 ; 24 123e4: 91 05 cpc r25, r1 123e6: 09 f4 brne .+2 ; 0x123ea 123e8: bb c6 rjmp .+3446 ; 0x13160 123ea: 84 f4 brge .+32 ; 0x1240c 123ec: 86 31 cpi r24, 0x16 ; 22 123ee: 91 05 cpc r25, r1 123f0: 09 f4 brne .+2 ; 0x123f4 123f2: a9 c6 rjmp .+3410 ; 0x13146 123f4: 47 97 sbiw r24, 0x17 ; 23 123f6: 09 f0 breq .+2 ; 0x123fa 123f8: a2 cf rjmp .-188 ; 0x1233e M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 123fa: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 123fe: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 12402: 61 e0 ldi r22, 0x01 ; 1 12404: 04 96 adiw r24, 0x04 ; 4 12406: 0f 94 a4 4b call 0x29748 ; 0x29748 1240a: 59 c6 rjmp .+3250 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1240c: 8a 31 cpi r24, 0x1A ; 26 1240e: 91 05 cpc r25, r1 12410: 09 f4 brne .+2 ; 0x12414 12412: ec c6 rjmp .+3544 ; 0x131ec 12414: 0c f0 brlt .+2 ; 0x12418 12416: 0c c7 rjmp .+3608 ; 0x13230 12418: 04 ec ldi r16, 0xC4 ; 196 1241a: 12 e0 ldi r17, 0x02 ; 2 1241c: f2 e4 ldi r31, 0x42 ; 66 1241e: af 2e mov r10, r31 12420: f2 e0 ldi r31, 0x02 ; 2 12422: bf 2e mov r11, r31 12424: a4 e2 ldi r26, 0x24 ; 36 12426: ca 2e mov r12, r26 12428: a2 e0 ldi r26, 0x02 ; 2 1242a: da 2e mov r13, r26 1242c: b8 e1 ldi r27, 0x18 ; 24 1242e: eb 2e mov r14, r27 12430: b2 e0 ldi r27, 0x02 ; 2 12432: fb 2e mov r15, r27 12434: 87 ec ldi r24, 0xC7 ; 199 12436: 88 2e mov r8, r24 12438: 82 e0 ldi r24, 0x02 ; 2 1243a: 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])) { 1243c: f8 01 movw r30, r16 1243e: 81 91 ld r24, Z+ 12440: 8f 01 movw r16, r30 12442: 0e 94 b6 55 call 0xab6c ; 0xab6c 12446: 88 23 and r24, r24 12448: 21 f1 breq .+72 ; 0x12492 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 1244a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1244e: d6 01 movw r26, r12 12450: 4d 90 ld r4, X+ 12452: 5d 90 ld r5, X+ 12454: 6d 90 ld r6, X+ 12456: 7c 90 ld r7, X 12458: a3 01 movw r20, r6 1245a: 92 01 movw r18, r4 1245c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 12460: 87 fd sbrc r24, 7 12462: 11 c0 rjmp .+34 ; 0x12486 12464: 0e 94 8e 5a call 0xb51c ; 0xb51c 12468: f7 01 movw r30, r14 1246a: 40 80 ld r4, Z 1246c: 51 80 ldd r5, Z+1 ; 0x01 1246e: 62 80 ldd r6, Z+2 ; 0x02 12470: 73 80 ldd r7, Z+3 ; 0x03 12472: a3 01 movw r20, r6 12474: 92 01 movw r18, r4 12476: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1247a: 18 16 cp r1, r24 1247c: 24 f0 brlt .+8 ; 0x12486 1247e: 0e 94 8e 5a call 0xb51c ; 0xb51c 12482: 2b 01 movw r4, r22 12484: 3c 01 movw r6, r24 12486: d5 01 movw r26, r10 12488: 4d 92 st X+, r4 1248a: 5d 92 st X+, r5 1248c: 6d 92 st X+, r6 1248e: 7c 92 st X, r7 12490: 13 97 sbiw r26, 0x03 ; 3 12492: b4 e0 ldi r27, 0x04 ; 4 12494: ab 0e add r10, r27 12496: b1 1c adc r11, r1 12498: e4 e0 ldi r30, 0x04 ; 4 1249a: ce 0e add r12, r30 1249c: d1 1c adc r13, r1 1249e: f4 e0 ldi r31, 0x04 ; 4 124a0: ef 0e add r14, r31 124a2: 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++) { 124a4: 80 16 cp r8, r16 124a6: 91 06 cpc r9, r17 124a8: 49 f6 brne .-110 ; 0x1243c //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')) { 124aa: 83 e5 ldi r24, 0x53 ; 83 124ac: 0e 94 b6 55 call 0xab6c ; 0xab6c 124b0: 88 23 and r24, r24 124b2: 11 f4 brne .+4 ; 0x124b8 124b4: 0c 94 ff a8 jmp 0x151fe ; 0x151fe if ( code_value_uint8() == 0 ) { 124b8: 0e 94 cb 55 call 0xab96 ; 0xab96 124bc: 81 11 cpse r24, r1 124be: ff c5 rjmp .+3070 ; 0x130be pause_position[X_AXIS] = X_PAUSE_POS; 124c0: 80 e0 ldi r24, 0x00 ; 0 124c2: 90 e0 ldi r25, 0x00 ; 0 124c4: a8 e4 ldi r26, 0x48 ; 72 124c6: b2 e4 ldi r27, 0x42 ; 66 124c8: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.493> 124cc: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.493+0x1> 124d0: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.493+0x2> 124d4: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.493+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 124d8: 80 e0 ldi r24, 0x00 ; 0 124da: 90 e0 ldi r25, 0x00 ; 0 124dc: ae e3 ldi r26, 0x3E ; 62 124de: b3 e4 ldi r27, 0x43 ; 67 124e0: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.493+0x4> 124e4: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.493+0x5> 124e8: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.493+0x6> 124ec: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.493+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 124f0: 80 e0 ldi r24, 0x00 ; 0 124f2: 90 e0 ldi r25, 0x00 ; 0 124f4: a0 ea ldi r26, 0xA0 ; 160 124f6: b1 e4 ldi r27, 0x41 ; 65 124f8: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.493+0x8> 124fc: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.493+0x9> 12500: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.493+0xa> 12504: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.493+0xb> 12508: da c5 rjmp .+2996 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1250a: 8c 32 cpi r24, 0x2C ; 44 1250c: 91 05 cpc r25, r1 1250e: 09 f4 brne .+2 ; 0x12512 12510: ce c7 rjmp .+3996 ; 0x134ae 12512: 0c f0 brlt .+2 ; 0x12516 12514: 8f c0 rjmp .+286 ; 0x12634 12516: 8f 31 cpi r24, 0x1F ; 31 12518: 91 05 cpc r25, r1 1251a: 09 f4 brne .+2 ; 0x1251e 1251c: 9e c7 rjmp .+3900 ; 0x1345a 1251e: 0c f0 brlt .+2 ; 0x12522 12520: 52 c0 rjmp .+164 ; 0x125c6 12522: 8d 31 cpi r24, 0x1D ; 29 12524: 91 05 cpc r25, r1 12526: 09 f4 brne .+2 ; 0x1252a 12528: ca c5 rjmp .+2964 ; 0x130be 1252a: 4e 97 sbiw r24, 0x1e ; 30 1252c: 09 f0 breq .+2 ; 0x12530 1252e: 07 cf rjmp .-498 ; 0x1233e M30 [filename] */ case 30: if (card.mounted){ 12530: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 12534: 88 23 and r24, r24 12536: 09 f4 brne .+2 ; 0x1253a 12538: c2 c5 rjmp .+2948 ; 0x130be card.closefile(); 1253a: 0f 94 82 41 call 0x28304 ; 0x28304 card.removeFile(strchr_pointer + 4); 1253e: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12542: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12546: 0c 5f subi r16, 0xFC ; 252 12548: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 1254a: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1254e: 88 23 and r24, r24 12550: 09 f4 brne .+2 ; 0x12554 12552: b5 c5 rjmp .+2922 ; 0x130be file.close(); 12554: 8a ef ldi r24, 0xFA ; 250 12556: 95 e1 ldi r25, 0x15 ; 21 12558: 0f 94 33 6f call 0x2de66 ; 0x2de66 sdprinting = false; 1255c: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 12560: 1d a3 std Y+37, r17 ; 0x25 12562: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 12564: ce 01 movw r24, r28 12566: 84 96 adiw r24, 0x24 ; 36 12568: 0f 94 1f 4b call 0x2963e ; 0x2963e 1256c: 88 23 and r24, r24 1256e: 09 f4 brne .+2 ; 0x12572 12570: a6 c5 rjmp .+2892 ; 0x130be return; if (file.remove(curDir, fname)) 12572: 4c a1 ldd r20, Y+36 ; 0x24 12574: 5d a1 ldd r21, Y+37 ; 0x25 12576: 60 91 13 14 lds r22, 0x1413 ; 0x801413 1257a: 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) {} 1257e: 19 82 std Y+1, r1 ; 0x01 12580: 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; 12582: 22 e0 ldi r18, 0x02 ; 2 12584: ce 01 movw r24, r28 12586: 01 96 adiw r24, 0x01 ; 1 12588: 0f 94 2a 9a call 0x33454 ; 0x33454 1258c: 81 11 cpse r24, r1 1258e: c6 c6 rjmp .+3468 ; 0x1331c return file.remove(); fail: // can't set iostate - static function return false; 12590: 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; 12592: ce 01 movw r24, r28 12594: 01 96 adiw r24, 0x01 ; 1 12596: 0e 94 c6 70 call 0xe18c ; 0xe18c 1259a: 11 23 and r17, r17 1259c: 09 f4 brne .+2 ; 0x125a0 1259e: d5 c6 rjmp .+3498 ; 0x1334a { SERIAL_PROTOCOLPGM("File deleted:"); 125a0: 84 e7 ldi r24, 0x74 ; 116 125a2: 9e e7 ldi r25, 0x7E ; 126 125a4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(fname); 125a8: 8c a1 ldd r24, Y+36 ; 0x24 125aa: 9d a1 ldd r25, Y+37 ; 0x25 125ac: 0f 94 9e 99 call 0x3333c ; 0x3333c sdpos = 0; 125b0: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 125b4: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 125b8: 10 92 80 16 sts 0x1680, r1 ; 0x801680 125bc: 10 92 81 16 sts 0x1681, r1 ; 0x801681 #ifdef SDCARD_SORT_ALPHA presort(); 125c0: 0f 94 e3 48 call 0x291c6 ; 0x291c6 125c4: 7c c5 rjmp .+2808 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 125c6: 80 32 cpi r24, 0x20 ; 32 125c8: 91 05 cpc r25, r1 125ca: 09 f4 brne .+2 ; 0x125ce 125cc: cc c6 rjmp .+3480 ; 0x13366 125ce: 8a 97 sbiw r24, 0x2a ; 42 125d0: 09 f0 breq .+2 ; 0x125d4 125d2: b5 ce rjmp .-662 ; 0x1233e #### 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')) 125d4: 83 e5 ldi r24, 0x53 ; 83 125d6: 0e 94 b6 55 call 0xab6c ; 0xab6c 125da: 88 23 and r24, r24 125dc: 09 f4 brne .+2 ; 0x125e0 125de: 6f c5 rjmp .+2782 ; 0x130be { uint8_t pin_status = code_value_uint8(); 125e0: 0e 94 cb 55 call 0xab96 ; 0xab96 125e4: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 125e6: 80 e5 ldi r24, 0x50 ; 80 125e8: 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; 125ec: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 125ee: 88 23 and r24, r24 125f0: 19 f0 breq .+6 ; 0x125f8 pin_number = code_value_uint8(); 125f2: 0e 94 cb 55 call 0xab96 ; 0xab96 125f6: 18 2f mov r17, r24 125f8: e4 ed ldi r30, 0xD4 ; 212 125fa: 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) 125fc: 84 91 lpm r24, Z 125fe: 81 17 cp r24, r17 12600: 09 f4 brne .+2 ; 0x12604 12602: 5d c5 rjmp .+2746 ; 0x130be 12604: 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++) 12606: 30 e8 ldi r19, 0x80 ; 128 12608: e0 3f cpi r30, 0xF0 ; 240 1260a: f3 07 cpc r31, r19 1260c: b9 f7 brne .-18 ; 0x125fc pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 1260e: 16 30 cpi r17, 0x06 ; 6 12610: 09 f0 breq .+2 ; 0x12614 12612: 4a c7 rjmp .+3732 ; 0x134a8 fanSpeed = pin_status; 12614: 00 93 e9 11 sts 0x11E9, r16 ; 0x8011e9 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 12618: 61 e0 ldi r22, 0x01 ; 1 1261a: 81 2f mov r24, r17 1261c: 0e 94 3b c0 call 0x18076 ; 0x18076 digitalWrite(pin_number, pin_status); 12620: 60 2f mov r22, r16 12622: 81 2f mov r24, r17 12624: 0e 94 0d c0 call 0x1801a ; 0x1801a analogWrite(pin_number, pin_status); 12628: 60 2f mov r22, r16 1262a: 70 e0 ldi r23, 0x00 ; 0 1262c: 81 2f mov r24, r17 1262e: 0e 94 6c c0 call 0x180d8 ; 0x180d8 12632: 45 c5 rjmp .+2698 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12634: 8f 32 cpi r24, 0x2F ; 47 12636: 91 05 cpc r25, r1 12638: 09 f4 brne .+2 ; 0x1263c 1263a: 62 c7 rjmp .+3780 ; 0x13500 1263c: 5c f5 brge .+86 ; 0x12694 1263e: 8d 32 cpi r24, 0x2D ; 45 12640: 91 05 cpc r25, r1 12642: 09 f4 brne .+2 ; 0x12646 12644: 4d c7 rjmp .+3738 ; 0x134e0 12646: 8e 97 sbiw r24, 0x2e ; 46 12648: 09 f0 breq .+2 ; 0x1264c 1264a: 79 ce rjmp .-782 ; 0x1233e ### 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()) { 1264c: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 12650: 88 23 and r24, r24 12652: 09 f4 brne .+2 ; 0x12656 12654: 50 c7 rjmp .+3744 ; 0x134f6 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 12656: ce 01 movw r24, r28 12658: 01 96 adiw r24, 0x01 ; 1 1265a: 0f 94 28 52 call 0x2a450 ; 0x2a450 1265e: 88 23 and r24, r24 12660: 09 f4 brne .+2 ; 0x12664 12662: 44 c7 rjmp .+3720 ; 0x134ec } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12664: 89 81 ldd r24, Y+1 ; 0x01 12666: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1266a: 8e e2 ldi r24, 0x2E ; 46 1266c: 0e 94 cc 70 call 0xe198 ; 0xe198 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12670: 8a 81 ldd r24, Y+2 ; 0x02 12672: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12676: 8e e2 ldi r24, 0x2E ; 46 12678: 0e 94 cc 70 call 0xe198 ; 0xe198 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1267c: 8b 81 ldd r24, Y+3 ; 0x03 1267e: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12682: 8e e2 ldi r24, 0x2E ; 46 12684: 0e 94 cc 70 call 0xe198 ; 0xe198 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12688: 8c 81 ldd r24, Y+4 ; 0x04 1268a: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 1268e: 0f 94 9d 98 call 0x3313a ; 0x3313a 12692: 15 c5 rjmp .+2602 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12694: 89 34 cpi r24, 0x49 ; 73 12696: 91 05 cpc r25, r1 12698: 09 f4 brne .+2 ; 0x1269c 1269a: 5b c7 rjmp .+3766 ; 0x13552 1269c: 8b 34 cpi r24, 0x4B ; 75 1269e: 91 05 cpc r25, r1 126a0: 11 f4 brne .+4 ; 0x126a6 126a2: 0c 94 49 9b jmp 0x13692 ; 0x13692 126a6: 88 34 cpi r24, 0x48 ; 72 126a8: 91 05 cpc r25, r1 126aa: 09 f0 breq .+2 ; 0x126ae 126ac: 48 ce rjmp .-880 ; 0x1233e #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 126ae: 83 e5 ldi r24, 0x53 ; 83 126b0: 0e 94 b6 55 call 0xab6c ; 0xab6c 126b4: 88 23 and r24, r24 126b6: 09 f4 brne .+2 ; 0x126ba 126b8: 3d c7 rjmp .+3706 ; 0x13534 switch (code_value_uint8()){ 126ba: 0e 94 cb 55 call 0xab96 ; 0xab96 126be: 88 23 and r24, r24 126c0: 09 f4 brne .+2 ; 0x126c4 126c2: 35 c7 rjmp .+3690 ; 0x1352e 126c4: 81 30 cpi r24, 0x01 ; 1 126c6: 09 f0 breq .+2 ; 0x126ca 126c8: fa c4 rjmp .+2548 ; 0x130be 126ca: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 126ce: f7 c4 rjmp .+2542 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 126d0: 8b 36 cpi r24, 0x6B ; 107 126d2: 91 05 cpc r25, r1 126d4: 11 f4 brne .+4 ; 0x126da 126d6: 0c 94 d8 9c jmp 0x139b0 ; 0x139b0 126da: 0c f0 brlt .+2 ; 0x126de 126dc: 83 c0 rjmp .+262 ; 0x127e4 126de: 84 35 cpi r24, 0x54 ; 84 126e0: 91 05 cpc r25, r1 126e2: 11 f4 brne .+4 ; 0x126e8 126e4: 0c 94 e1 9c jmp 0x139c2 ; 0x139c2 126e8: bc f5 brge .+110 ; 0x12758 126ea: 8f 34 cpi r24, 0x4F ; 79 126ec: 91 05 cpc r25, r1 126ee: 09 f4 brne .+2 ; 0x126f2 126f0: ee c7 rjmp .+4060 ; 0x136ce 126f2: 1c f5 brge .+70 ; 0x1273a 126f4: 8d 34 cpi r24, 0x4D ; 77 126f6: 91 05 cpc r25, r1 126f8: 09 f4 brne .+2 ; 0x126fc 126fa: e4 c7 rjmp .+4040 ; 0x136c4 126fc: 8e 34 cpi r24, 0x4E ; 78 126fe: 91 05 cpc r25, r1 12700: 09 f0 breq .+2 ; 0x12704 12702: 1d ce rjmp .-966 ; 0x1233e ### 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 "); 12704: 89 ea ldi r24, 0xA9 ; 169 12706: 90 e8 ldi r25, 0x80 ; 128 12708: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 1270c: 8d ee ldi r24, 0xED ; 237 1270e: 9f e0 ldi r25, 0x0F ; 15 12710: 0f 94 85 a0 call 0x3410a ; 0x3410a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 12714: 4a e0 ldi r20, 0x0A ; 10 12716: 0f 94 cd 96 call 0x32d9a ; 0x32d9a SERIAL_ECHOPGM(" min "); 1271a: 83 ea ldi r24, 0xA3 ; 163 1271c: 90 e8 ldi r25, 0x80 ; 128 1271e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 12722: 81 ef ldi r24, 0xF1 ; 241 12724: 9f e0 ldi r25, 0x0F ; 15 12726: 0f 94 85 a0 call 0x3410a ; 0x3410a 1272a: 4a e0 ldi r20, 0x0A ; 10 1272c: 0f 94 cd 96 call 0x32d9a ; 0x32d9a SERIAL_ECHOLNPGM(" cm."); 12730: 8e e9 ldi r24, 0x9E ; 158 12732: 90 e8 ldi r25, 0x80 ; 128 12734: 0e 94 de 72 call 0xe5bc ; 0xe5bc 12738: c2 c4 rjmp .+2436 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1273a: 82 35 cpi r24, 0x52 ; 82 1273c: 91 05 cpc r25, r1 1273e: 11 f4 brne .+4 ; 0x12744 12740: 0c 94 db 9c jmp 0x139b6 ; 0x139b6 12744: 83 35 cpi r24, 0x53 ; 83 12746: 91 05 cpc r25, r1 12748: 09 f0 breq .+2 ; 0x1274c 1274a: f9 cd rjmp .-1038 ; 0x1233e /*! ### 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; 1274c: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 12750: 88 60 ori r24, 0x08 ; 8 12752: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 12756: b3 c4 rjmp .+2406 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12758: 8c 35 cpi r24, 0x5C ; 92 1275a: 91 05 cpc r25, r1 1275c: 11 f4 brne .+4 ; 0x12762 1275e: 0c 94 4a 9d jmp 0x13a94 ; 0x13a94 12762: 34 f5 brge .+76 ; 0x127b0 12764: 85 35 cpi r24, 0x55 ; 85 12766: 91 05 cpc r25, r1 12768: 11 f4 brne .+4 ; 0x1276e 1276a: 0c 94 31 9d jmp 0x13a62 ; 0x13a62 1276e: 86 35 cpi r24, 0x56 ; 86 12770: 91 05 cpc r25, r1 12772: 09 f0 breq .+2 ; 0x12776 12774: e4 cd rjmp .-1080 ; 0x1233e #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 12776: 83 e5 ldi r24, 0x53 ; 83 12778: 0e 94 b6 55 call 0xab6c ; 0xab6c 1277c: 88 23 and r24, r24 1277e: 09 f4 brne .+2 ; 0x12782 12780: 9e c4 rjmp .+2364 ; 0x130be safetytimer_inactive_time = code_value() * 1000; 12782: 0e 94 8e 5a call 0xb51c ; 0xb51c 12786: 20 e0 ldi r18, 0x00 ; 0 12788: 30 e0 ldi r19, 0x00 ; 0 1278a: 4a e7 ldi r20, 0x7A ; 122 1278c: 54 e4 ldi r21, 0x44 ; 68 1278e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 12792: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12796: 60 93 33 02 sts 0x0233, r22 ; 0x800233 1279a: 70 93 34 02 sts 0x0234, r23 ; 0x800234 1279e: 80 93 35 02 sts 0x0235, r24 ; 0x800235 127a2: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 127a6: 8a e1 ldi r24, 0x1A ; 26 127a8: 96 e0 ldi r25, 0x06 ; 6 127aa: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> 127ae: 87 c4 rjmp .+2318 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127b0: 89 36 cpi r24, 0x69 ; 105 127b2: 91 05 cpc r25, r1 127b4: 09 f4 brne .+2 ; 0x127b8 127b6: de c7 rjmp .+4028 ; 0x13774 127b8: 14 f0 brlt .+4 ; 0x127be 127ba: 0c 94 ca 9c jmp 0x13994 ; 0x13994 127be: 88 36 cpi r24, 0x68 ; 104 127c0: 91 05 cpc r25, r1 127c2: 09 f0 breq .+2 ; 0x127c6 127c4: bc cd rjmp .-1160 ; 0x1233e #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 127c6: 83 e5 ldi r24, 0x53 ; 83 127c8: 0e 94 b6 55 call 0xab6c ; 0xab6c 127cc: 88 23 and r24, r24 127ce: 09 f4 brne .+2 ; 0x127d2 127d0: 76 c4 rjmp .+2284 ; 0x130be { setTargetHotend(code_value()); 127d2: 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; 127d6: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 127da: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 127de: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 127e2: 6d c4 rjmp .+2266 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127e4: 85 37 cpi r24, 0x75 ; 117 127e6: 91 05 cpc r25, r1 127e8: 11 f4 brne .+4 ; 0x127ee 127ea: 0c 94 c8 9e jmp 0x13d90 ; 0x13d90 127ee: b4 f5 brge .+108 ; 0x1285c 127f0: 80 37 cpi r24, 0x70 ; 112 127f2: 91 05 cpc r25, r1 127f4: 09 f4 brne .+2 ; 0x127f8 127f6: ab c7 rjmp .+3926 ; 0x1374e 127f8: cc f4 brge .+50 ; 0x1282c 127fa: 8d 36 cpi r24, 0x6D ; 109 127fc: 91 05 cpc r25, r1 127fe: 09 f4 brne .+2 ; 0x12802 12800: e5 c7 rjmp .+4042 ; 0x137cc 12802: 8e 36 cpi r24, 0x6E ; 110 12804: 91 05 cpc r25, r1 12806: 09 f0 breq .+2 ; 0x1280a 12808: 9a cd rjmp .-1228 ; 0x1233e #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 1280a: 8e e4 ldi r24, 0x4E ; 78 1280c: 0e 94 b6 55 call 0xab6c ; 0xab6c 12810: 88 23 and r24, r24 12812: 09 f4 brne .+2 ; 0x12816 12814: 54 c4 rjmp .+2216 ; 0x130be gcode_LastN = code_value_long(); 12816: 0e 94 1e 56 call 0xac3c ; 0xac3c 1281a: 60 93 d1 11 sts 0x11D1, r22 ; 0x8011d1 1281e: 70 93 d2 11 sts 0x11D2, r23 ; 0x8011d2 12822: 80 93 d3 11 sts 0x11D3, r24 ; 0x8011d3 12826: 90 93 d4 11 sts 0x11D4, r25 ; 0x8011d4 1282a: 49 c4 rjmp .+2194 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1282c: 82 37 cpi r24, 0x72 ; 114 1282e: 91 05 cpc r25, r1 12830: 11 f4 brne .+4 ; 0x12836 12832: 0c 94 c5 9e jmp 0x13d8a ; 0x13d8a 12836: 14 f4 brge .+4 ; 0x1283c 12838: 0c 94 d2 9d jmp 0x13ba4 ; 0x13ba4 1283c: 83 37 cpi r24, 0x73 ; 115 1283e: 91 05 cpc r25, r1 12840: 09 f0 breq .+2 ; 0x12844 12842: 7d cd rjmp .-1286 ; 0x1233e #### 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')) { 12844: 86 e5 ldi r24, 0x56 ; 86 12846: 0e 94 b6 55 call 0xab6c ; 0xab6c 1284a: 88 23 and r24, r24 1284c: 11 f4 brne .+4 ; 0x12852 1284e: 0c 94 f1 9d jmp 0x13be2 ; 0x13be2 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 12852: 89 ed ldi r24, 0xD9 ; 217 12854: 9f e9 ldi r25, 0x9F ; 159 12856: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1285a: 31 c4 rjmp .+2146 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1285c: 8b 37 cpi r24, 0x7B ; 123 1285e: 91 05 cpc r25, r1 12860: 11 f4 brne .+4 ; 0x12866 12862: 0c 94 20 9f jmp 0x13e40 ; 0x13e40 12866: 0c f0 brlt .+2 ; 0x1286a 12868: 48 c0 rjmp .+144 ; 0x128fa 1286a: 86 37 cpi r24, 0x76 ; 118 1286c: 91 05 cpc r25, r1 1286e: 11 f4 brne .+4 ; 0x12874 12870: 0c 94 d8 9e jmp 0x13db0 ; 0x13db0 12874: 87 37 cpi r24, 0x77 ; 119 12876: 91 05 cpc r25, r1 12878: 09 f0 breq .+2 ; 0x1287c 1287a: 61 cd rjmp .-1342 ; 0x1233e /*! ### 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 1287c: 80 e1 ldi r24, 0x10 ; 16 1287e: 96 e6 ldi r25, 0x66 ; 102 12880: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(); 12884: 0f 94 9d 98 call 0x3313a ; 0x3313a #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 12888: 88 e0 ldi r24, 0x08 ; 8 1288a: 96 e6 ldi r25, 0x66 ; 102 1288c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 12890: 1e 9b sbis 0x03, 6 ; 3 12892: 02 c0 rjmp .+4 ; 0x12898 12894: 0c 94 10 9f jmp 0x13e20 ; 0x13e20 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 12898: 83 e0 ldi r24, 0x03 ; 3 1289a: 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); 1289c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128a0: 0f 94 9d 98 call 0x3313a ; 0x3313a 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 128a4: 81 ef ldi r24, 0xF1 ; 241 128a6: 95 e6 ldi r25, 0x65 ; 101 128a8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 128ac: 1d 9b sbis 0x03, 5 ; 3 128ae: 02 c0 rjmp .+4 ; 0x128b4 128b0: 0c 94 14 9f jmp 0x13e28 ; 0x13e28 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128b4: 83 e0 ldi r24, 0x03 ; 3 128b6: 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); 128b8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128bc: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 128c0: 89 ee ldi r24, 0xE9 ; 233 128c2: 95 e6 ldi r25, 0x65 ; 101 128c4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 128c8: 1c 9b sbis 0x03, 4 ; 3 128ca: 02 c0 rjmp .+4 ; 0x128d0 128cc: 0c 94 18 9f jmp 0x13e30 ; 0x13e30 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128d0: 83 e0 ldi r24, 0x03 ; 3 128d2: 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); 128d4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128d8: 0f 94 9d 98 call 0x3313a ; 0x3313a #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 128dc: 81 ee ldi r24, 0xE1 ; 225 128de: 95 e6 ldi r25, 0x65 ; 101 128e0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 128e4: 01 99 sbic 0x00, 1 ; 0 128e6: 02 c0 rjmp .+4 ; 0x128ec 128e8: 0c 94 1c 9f jmp 0x13e38 ; 0x13e38 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 128ec: 83 e0 ldi r24, 0x03 ; 3 128ee: 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); 128f0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 128f4: 0f 94 9d 98 call 0x3313a ; 0x3313a 128f8: e2 c3 rjmp .+1988 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 128fa: 8c 38 cpi r24, 0x8C ; 140 128fc: 91 05 cpc r25, r1 128fe: 09 f4 brne .+2 ; 0x12902 12900: 2a c7 rjmp .+3668 ; 0x13756 12902: 8b 39 cpi r24, 0x9B ; 155 12904: 91 05 cpc r25, r1 12906: 09 f4 brne .+2 ; 0x1290a 12908: 41 c7 rjmp .+3714 ; 0x1378c 1290a: 8d 37 cpi r24, 0x7D ; 125 1290c: 91 05 cpc r25, r1 1290e: 09 f0 breq .+2 ; 0x12912 12910: 16 cd rjmp .-1492 ; 0x1233e 12912: 82 cd rjmp .-1276 ; 0x12418 12914: 84 3a cpi r24, 0xA4 ; 164 12916: 41 e0 ldi r20, 0x01 ; 1 12918: 94 07 cpc r25, r20 1291a: 11 f4 brne .+4 ; 0x12920 1291c: 0c 94 3f a2 jmp 0x1447e ; 0x1447e 12920: 0c f0 brlt .+2 ; 0x12924 12922: 38 c2 rjmp .+1136 ; 0x12d94 12924: 82 3e cpi r24, 0xE2 ; 226 12926: 91 05 cpc r25, r1 12928: 11 f4 brne .+4 ; 0x1292e 1292a: 0c 94 c9 a0 jmp 0x14192 ; 0x14192 1292e: 0c f0 brlt .+2 ; 0x12932 12930: 6b c1 rjmp .+726 ; 0x12c08 12932: 8e 3c cpi r24, 0xCE ; 206 12934: 91 05 cpc r25, r1 12936: 11 f4 brne .+4 ; 0x1293c 12938: 0c 94 dc 9f jmp 0x13fb8 ; 0x13fb8 1293c: 0c f0 brlt .+2 ; 0x12940 1293e: b1 c0 rjmp .+354 ; 0x12aa2 12940: 8b 3c cpi r24, 0xCB ; 203 12942: 91 05 cpc r25, r1 12944: 11 f4 brne .+4 ; 0x1294a 12946: 0c 94 66 9f jmp 0x13ecc ; 0x13ecc 1294a: 5c f5 brge .+86 ; 0x129a2 1294c: 88 3c cpi r24, 0xC8 ; 200 1294e: 91 05 cpc r25, r1 12950: 11 f4 brne .+4 ; 0x12956 12952: 0c 94 23 9f jmp 0x13e46 ; 0x13e46 12956: 04 ec ldi r16, 0xC4 ; 196 12958: 12 e0 ldi r17, 0x02 ; 2 1295a: a2 e3 ldi r26, 0x32 ; 50 1295c: ea 2e mov r14, r26 1295e: a4 e0 ldi r26, 0x04 ; 4 12960: fa 2e mov r15, r26 12962: b8 ec ldi r27, 0xC8 ; 200 12964: cb 2e mov r12, r27 12966: b2 e0 ldi r27, 0x02 ; 2 12968: db 2e mov r13, r27 1296a: 89 3c cpi r24, 0xC9 ; 201 1296c: 91 05 cpc r25, r1 1296e: 09 f0 breq .+2 ; 0x12972 12970: e6 cc rjmp .-1588 ; 0x1233e - `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])) 12972: d8 01 movw r26, r16 12974: 8d 91 ld r24, X+ 12976: 8d 01 movw r16, r26 12978: 0e 94 b6 55 call 0xab6c ; 0xab6c 1297c: 88 23 and r24, r24 1297e: 49 f0 breq .+18 ; 0x12992 { unsigned long val = code_value(); 12980: 0e 94 8e 5a call 0xb51c ; 0xb51c 12984: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12988: f7 01 movw r30, r14 1298a: 64 a3 std Z+36, r22 ; 0x24 1298c: 75 a3 std Z+37, r23 ; 0x25 1298e: 86 a3 std Z+38, r24 ; 0x26 12990: 97 a3 std Z+39, r25 ; 0x27 12992: f4 e0 ldi r31, 0x04 ; 4 12994: ef 0e add r14, r31 12996: 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++) 12998: c0 16 cp r12, r16 1299a: d1 06 cpc r13, r17 1299c: 51 f7 brne .-44 ; 0x12972 1299e: 0c 94 c7 9d jmp 0x13b8e ; 0x13b8e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 129a2: 8c 3c cpi r24, 0xCC ; 204 129a4: 91 05 cpc r25, r1 129a6: 11 f4 brne .+4 ; 0x129ac 129a8: 0c 94 85 9f jmp 0x13f0a ; 0x13f0a 129ac: 8d 3c cpi r24, 0xCD ; 205 129ae: 91 05 cpc r25, r1 129b0: 09 f0 breq .+2 ; 0x129b4 129b2: c5 cc rjmp .-1654 ; 0x1233e - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 129b4: 83 e5 ldi r24, 0x53 ; 83 129b6: 0e 94 b6 55 call 0xab6c ; 0xab6c 129ba: 88 23 and r24, r24 129bc: 51 f0 breq .+20 ; 0x129d2 129be: 0e 94 8e 5a call 0xb51c ; 0xb51c 129c2: 60 93 6e 04 sts 0x046E, r22 ; 0x80046e 129c6: 70 93 6f 04 sts 0x046F, r23 ; 0x80046f 129ca: 80 93 70 04 sts 0x0470, r24 ; 0x800470 129ce: 90 93 71 04 sts 0x0471, r25 ; 0x800471 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 129d2: 84 e5 ldi r24, 0x54 ; 84 129d4: 0e 94 b6 55 call 0xab6c ; 0xab6c 129d8: 88 23 and r24, r24 129da: 51 f0 breq .+20 ; 0x129f0 129dc: 0e 94 8e 5a call 0xb51c ; 0xb51c 129e0: 60 93 72 04 sts 0x0472, r22 ; 0x800472 129e4: 70 93 73 04 sts 0x0473, r23 ; 0x800473 129e8: 80 93 74 04 sts 0x0474, r24 ; 0x800474 129ec: 90 93 75 04 sts 0x0475, r25 ; 0x800475 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 129f0: 82 e4 ldi r24, 0x42 ; 66 129f2: 0e 94 b6 55 call 0xab6c ; 0xab6c 129f6: 88 23 and r24, r24 129f8: 61 f0 breq .+24 ; 0x12a12 129fa: 0e 94 8e 5a call 0xb51c ; 0xb51c 129fe: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12a02: 60 93 76 04 sts 0x0476, r22 ; 0x800476 12a06: 70 93 77 04 sts 0x0477, r23 ; 0x800477 12a0a: 80 93 78 04 sts 0x0478, r24 ; 0x800478 12a0e: 90 93 79 04 sts 0x0479, r25 ; 0x800479 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 12a12: 88 e5 ldi r24, 0x58 ; 88 12a14: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a18: 88 23 and r24, r24 12a1a: 91 f0 breq .+36 ; 0x12a40 12a1c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a20: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 12a24: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12a28: 80 93 80 04 sts 0x0480, r24 ; 0x800480 12a2c: 90 93 81 04 sts 0x0481, r25 ; 0x800481 12a30: 60 93 7a 04 sts 0x047A, r22 ; 0x80047a 12a34: 70 93 7b 04 sts 0x047B, r23 ; 0x80047b 12a38: 80 93 7c 04 sts 0x047C, r24 ; 0x80047c 12a3c: 90 93 7d 04 sts 0x047D, r25 ; 0x80047d if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 12a40: 89 e5 ldi r24, 0x59 ; 89 12a42: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a46: 88 23 and r24, r24 12a48: 51 f0 breq .+20 ; 0x12a5e 12a4a: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a4e: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 12a52: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12a56: 80 93 80 04 sts 0x0480, r24 ; 0x800480 12a5a: 90 93 81 04 sts 0x0481, r25 ; 0x800481 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 12a5e: 8a e5 ldi r24, 0x5A ; 90 12a60: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a64: 88 23 and r24, r24 12a66: 51 f0 breq .+20 ; 0x12a7c 12a68: 0e 94 8e 5a call 0xb51c ; 0xb51c 12a6c: 60 93 82 04 sts 0x0482, r22 ; 0x800482 12a70: 70 93 83 04 sts 0x0483, r23 ; 0x800483 12a74: 80 93 84 04 sts 0x0484, r24 ; 0x800484 12a78: 90 93 85 04 sts 0x0485, r25 ; 0x800485 if(code_seen('E')) 12a7c: 85 e4 ldi r24, 0x45 ; 69 12a7e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12a82: 88 23 and r24, r24 12a84: 09 f4 brne .+2 ; 0x12a88 12a86: 1b c3 rjmp .+1590 ; 0x130be { float e = code_value(); 12a88: 0e 94 8e 5a call 0xb51c ; 0xb51c #ifndef LA_NOCOMPAT e = la10c_jerk(e); 12a8c: 0e 94 0e 74 call 0xe81c ; 0xe81c #endif cs.max_jerk[E_AXIS] = e; 12a90: 60 93 86 04 sts 0x0486, r22 ; 0x800486 12a94: 70 93 87 04 sts 0x0487, r23 ; 0x800487 12a98: 80 93 88 04 sts 0x0488, r24 ; 0x800488 12a9c: 90 93 89 04 sts 0x0489, r25 ; 0x800489 12aa0: 0e c3 rjmp .+1564 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12aa2: 81 3d cpi r24, 0xD1 ; 209 12aa4: 91 05 cpc r25, r1 12aa6: 11 f4 brne .+4 ; 0x12aac 12aa8: 0c 94 29 a0 jmp 0x14052 ; 0x14052 12aac: 5c f5 brge .+86 ; 0x12b04 12aae: 8f 3c cpi r24, 0xCF ; 207 12ab0: 91 05 cpc r25, r1 12ab2: 11 f4 brne .+4 ; 0x12ab8 12ab4: 0c 94 f8 9f jmp 0x13ff0 ; 0x13ff0 12ab8: 80 3d cpi r24, 0xD0 ; 208 12aba: 91 05 cpc r25, r1 12abc: 09 f0 breq .+2 ; 0x12ac0 12abe: 3f cc rjmp .-1922 ; 0x1233e - `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')) 12ac0: 83 e5 ldi r24, 0x53 ; 83 12ac2: 0e 94 b6 55 call 0xab6c ; 0xab6c 12ac6: 88 23 and r24, r24 12ac8: 51 f0 breq .+20 ; 0x12ade { cs.retract_recover_length = code_value() ; 12aca: 0e 94 8e 5a call 0xb51c ; 0xb51c 12ace: 60 93 c1 04 sts 0x04C1, r22 ; 0x8004c1 12ad2: 70 93 c2 04 sts 0x04C2, r23 ; 0x8004c2 12ad6: 80 93 c3 04 sts 0x04C3, r24 ; 0x8004c3 12ada: 90 93 c4 04 sts 0x04C4, r25 ; 0x8004c4 } if(code_seen('F')) 12ade: 86 e4 ldi r24, 0x46 ; 70 12ae0: 0e 94 b6 55 call 0xab6c ; 0xab6c 12ae4: 88 23 and r24, r24 12ae6: 09 f4 brne .+2 ; 0x12aea 12ae8: ea c2 rjmp .+1492 ; 0x130be { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 12aea: 0e 94 8e 5a call 0xb51c ; 0xb51c 12aee: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 12af2: 60 93 c5 04 sts 0x04C5, r22 ; 0x8004c5 12af6: 70 93 c6 04 sts 0x04C6, r23 ; 0x8004c6 12afa: 80 93 c7 04 sts 0x04C7, r24 ; 0x8004c7 12afe: 90 93 c8 04 sts 0x04C8, r25 ; 0x8004c8 12b02: dd c2 rjmp .+1466 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12b04: 8c 3d cpi r24, 0xDC ; 220 12b06: 91 05 cpc r25, r1 12b08: 11 f4 brne .+4 ; 0x12b0e 12b0a: 0c 94 69 a0 jmp 0x140d2 ; 0x140d2 12b0e: 8d 3d cpi r24, 0xDD ; 221 12b10: 91 05 cpc r25, r1 12b12: 11 f4 brne .+4 ; 0x12b18 12b14: 0c 94 a8 a0 jmp 0x14150 ; 0x14150 12b18: 86 3d cpi r24, 0xD6 ; 214 12b1a: 91 05 cpc r25, r1 12b1c: 09 f0 breq .+2 ; 0x12b20 12b1e: 0f cc rjmp .-2018 ; 0x1233e 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; 12b20: 80 e5 ldi r24, 0x50 ; 80 12b22: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b26: 88 23 and r24, r24 12b28: 11 f4 brne .+4 ; 0x12b2e 12b2a: 0c 94 55 a0 jmp 0x140aa ; 0x140aa 12b2e: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b32: 2b 01 movw r4, r22 12b34: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 12b36: 83 e5 ldi r24, 0x53 ; 83 12b38: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b3c: 88 23 and r24, r24 12b3e: 11 f4 brne .+4 ; 0x12b44 12b40: 0c 94 5f a0 jmp 0x140be ; 0x140be 12b44: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b48: 4b 01 movw r8, r22 12b4a: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 12b4c: 8e e4 ldi r24, 0x4E ; 78 12b4e: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b52: d0 90 fe 04 lds r13, 0x04FE ; 0x8004fe 12b56: 88 23 and r24, r24 12b58: 29 f0 breq .+10 ; 0x12b64 12b5a: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b5e: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12b62: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 12b64: 82 e5 ldi r24, 0x52 ; 82 12b66: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b6a: e0 90 ff 04 lds r14, 0x04FF ; 0x8004ff 12b6e: f0 90 00 05 lds r15, 0x0500 ; 0x800500 12b72: 88 23 and r24, r24 12b74: 29 f0 breq .+10 ; 0x12b80 12b76: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b7a: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12b7e: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 12b80: 86 e4 ldi r24, 0x46 ; 70 12b82: 0e 94 b6 55 call 0xab6c ; 0xab6c 12b86: 00 91 01 05 lds r16, 0x0501 ; 0x800501 12b8a: 10 91 02 05 lds r17, 0x0502 ; 0x800502 12b8e: 88 23 and r24, r24 12b90: 29 f0 breq .+10 ; 0x12b9c 12b92: 0e 94 8e 5a call 0xb51c ; 0xb51c 12b96: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12b9a: 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) 12b9c: 20 e0 ldi r18, 0x00 ; 0 12b9e: 30 e0 ldi r19, 0x00 ; 0 12ba0: a9 01 movw r20, r18 12ba2: c3 01 movw r24, r6 12ba4: b2 01 movw r22, r4 12ba6: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 12baa: 18 16 cp r1, r24 12bac: 0c f0 brlt .+2 ; 0x12bb0 12bae: 87 c2 rjmp .+1294 ; 0x130be 12bb0: 20 e0 ldi r18, 0x00 ; 0 12bb2: 30 e0 ldi r19, 0x00 ; 0 12bb4: a9 01 movw r20, r18 12bb6: c5 01 movw r24, r10 12bb8: b4 01 movw r22, r8 12bba: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 12bbe: 87 fd sbrc r24, 7 12bc0: 7e c2 rjmp .+1276 ; 0x130be 12bc2: a5 01 movw r20, r10 12bc4: 94 01 movw r18, r8 12bc6: c3 01 movw r24, r6 12bc8: b2 01 movw r22, r4 12bca: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 12bce: 87 fd sbrc r24, 7 12bd0: 76 c2 rjmp .+1260 ; 0x130be { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 12bd2: 40 92 f6 04 sts 0x04F6, r4 ; 0x8004f6 12bd6: 50 92 f7 04 sts 0x04F7, r5 ; 0x8004f7 12bda: 60 92 f8 04 sts 0x04F8, r6 ; 0x8004f8 12bde: 70 92 f9 04 sts 0x04F9, r7 ; 0x8004f9 cs.min_mm_per_arc_segment = s; 12be2: 80 92 fa 04 sts 0x04FA, r8 ; 0x8004fa 12be6: 90 92 fb 04 sts 0x04FB, r9 ; 0x8004fb 12bea: a0 92 fc 04 sts 0x04FC, r10 ; 0x8004fc 12bee: b0 92 fd 04 sts 0x04FD, r11 ; 0x8004fd cs.n_arc_correction = n; 12bf2: d0 92 fe 04 sts 0x04FE, r13 ; 0x8004fe cs.min_arc_segments = r; 12bf6: f0 92 00 05 sts 0x0500, r15 ; 0x800500 12bfa: e0 92 ff 04 sts 0x04FF, r14 ; 0x8004ff cs.arc_segments_per_sec = f; 12bfe: 10 93 02 05 sts 0x0502, r17 ; 0x800502 12c02: 00 93 01 05 sts 0x0501, r16 ; 0x800501 12c06: 5b c2 rjmp .+1206 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c08: 80 33 cpi r24, 0x30 ; 48 12c0a: a1 e0 ldi r26, 0x01 ; 1 12c0c: 9a 07 cpc r25, r26 12c0e: 11 f4 brne .+4 ; 0x12c14 12c10: 0c 94 a4 a1 jmp 0x14348 ; 0x14348 12c14: 0c f0 brlt .+2 ; 0x12c18 12c16: 6c c0 rjmp .+216 ; 0x12cf0 12c18: 8d 32 cpi r24, 0x2D ; 45 12c1a: e1 e0 ldi r30, 0x01 ; 1 12c1c: 9e 07 cpc r25, r30 12c1e: 11 f4 brne .+4 ; 0x12c24 12c20: 0c 94 2b a1 jmp 0x14256 ; 0x14256 12c24: 54 f5 brge .+84 ; 0x12c7a 12c26: 80 3f cpi r24, 0xF0 ; 240 12c28: 91 05 cpc r25, r1 12c2a: 09 f4 brne .+2 ; 0x12c2e 12c2c: 48 c2 rjmp .+1168 ; 0x130be 12c2e: 8c 32 cpi r24, 0x2C ; 44 12c30: 91 40 sbci r25, 0x01 ; 1 12c32: 09 f0 breq .+2 ; 0x12c36 12c34: 84 cb rjmp .-2296 ; 0x1233e - `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; 12c36: 80 e5 ldi r24, 0x50 ; 80 12c38: 0e 94 b6 55 call 0xab6c ; 0xab6c 12c3c: 08 ee ldi r16, 0xE8 ; 232 12c3e: 13 e0 ldi r17, 0x03 ; 3 12c40: 88 23 and r24, r24 12c42: 29 f0 breq .+10 ; 0x12c4e 12c44: 0e 94 8e 5a call 0xb51c ; 0xb51c 12c48: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12c4c: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 12c4e: 83 e5 ldi r24, 0x53 ; 83 12c50: 0e 94 b6 55 call 0xab6c ; 0xab6c 12c54: 88 23 and r24, r24 12c56: 11 f4 brne .+4 ; 0x12c5c 12c58: 0c 94 23 a1 jmp 0x14246 ; 0x14246 beepS = 0; else { beepS = code_value(); 12c5c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12c60: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> if (!beepS) { 12c64: 61 15 cp r22, r1 12c66: 71 05 cpc r23, r1 12c68: 11 f0 breq .+4 ; 0x12c6e 12c6a: 0c 94 25 a1 jmp 0x1424a ; 0x1424a // handle S0 as a pause _delay(beepP); 12c6e: b8 01 movw r22, r16 12c70: 90 e0 ldi r25, 0x00 ; 0 12c72: 80 e0 ldi r24, 0x00 ; 0 12c74: 0f 94 4d 0d call 0x21a9a ; 0x21a9a 12c78: 22 c2 rjmp .+1092 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c7a: 8e 32 cpi r24, 0x2E ; 46 12c7c: 31 e0 ldi r19, 0x01 ; 1 12c7e: 93 07 cpc r25, r19 12c80: 11 f4 brne .+4 ; 0x12c86 12c82: 0c 94 1d a2 jmp 0x1443a ; 0x1443a 12c86: 8f 32 cpi r24, 0x2F ; 47 12c88: 91 40 sbci r25, 0x01 ; 1 12c8a: 09 f0 breq .+2 ; 0x12c8e 12c8c: 58 cb rjmp .-2384 ; 0x1233e case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 12c8e: 85 e4 ldi r24, 0x45 ; 69 12c90: 0e 94 b6 55 call 0xab6c ; 0xab6c - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 12c94: 10 e0 ldi r17, 0x00 ; 0 12c96: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 12c98: 88 23 and r24, r24 12c9a: 59 f0 breq .+22 ; 0x12cb2 12c9c: 0e 94 d8 55 call 0xabb0 ; 0xabb0 12ca0: 8c 01 movw r16, r24 if (e < 0) temp = 70; 12ca2: c1 2c mov r12, r1 12ca4: d1 2c mov r13, r1 12ca6: 5c e8 ldi r21, 0x8C ; 140 12ca8: e5 2e mov r14, r21 12caa: 52 e4 ldi r21, 0x42 ; 66 12cac: 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) 12cae: 97 fd sbrc r25, 7 12cb0: 06 c0 rjmp .+12 ; 0x12cbe - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 12cb2: c1 2c mov r12, r1 12cb4: d1 2c mov r13, r1 12cb6: 66 e1 ldi r22, 0x16 ; 22 12cb8: e6 2e mov r14, r22 12cba: 63 e4 ldi r22, 0x43 ; 67 12cbc: 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(); 12cbe: 83 e5 ldi r24, 0x53 ; 83 12cc0: 0e 94 b6 55 call 0xab6c ; 0xab6c 12cc4: 88 23 and r24, r24 12cc6: 21 f0 breq .+8 ; 0x12cd0 12cc8: 0e 94 8e 5a call 0xb51c ; 0xb51c 12ccc: 6b 01 movw r12, r22 12cce: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 12cd0: 83 e4 ldi r24, 0x43 ; 67 12cd2: 0e 94 b6 55 call 0xab6c ; 0xab6c 12cd6: 88 23 and r24, r24 12cd8: 11 f4 brne .+4 ; 0x12cde 12cda: 0c 94 2d a2 jmp 0x1445a ; 0x1445a 12cde: 0e 94 d8 55 call 0xabb0 ; 0xabb0 PID_autotune(temp, e, c); 12ce2: 9c 01 movw r18, r24 12ce4: a8 01 movw r20, r16 12ce6: c7 01 movw r24, r14 12ce8: b6 01 movw r22, r12 12cea: 0f 94 95 18 call 0x2312a ; 0x2312a 12cee: e7 c1 rjmp .+974 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12cf0: 80 39 cpi r24, 0x90 ; 144 12cf2: 51 e0 ldi r21, 0x01 ; 1 12cf4: 95 07 cpc r25, r21 12cf6: 11 f4 brne .+4 ; 0x12cfc 12cf8: 0c 94 31 a2 jmp 0x14462 ; 0x14462 12cfc: 04 f5 brge .+64 ; 0x12d3e 12cfe: 8e 35 cpi r24, 0x5E ; 94 12d00: b1 e0 ldi r27, 0x01 ; 1 12d02: 9b 07 cpc r25, r27 12d04: 11 f4 brne .+4 ; 0x12d0a 12d06: 0c 94 55 ad jmp 0x15aaa ; 0x15aaa 12d0a: 8f 35 cpi r24, 0x5F ; 95 12d0c: 91 40 sbci r25, 0x01 ; 1 12d0e: 09 f0 breq .+2 ; 0x12d12 12d10: 16 cb rjmp .-2516 ; 0x1233e - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 12d12: 83 e5 ldi r24, 0x53 ; 83 12d14: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d18: 88 23 and r24, r24 12d1a: 71 f0 breq .+28 ; 0x12d38 12d1c: 0e 94 8e 5a call 0xb51c ; 0xb51c 12d20: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 12d24: 61 30 cpi r22, 0x01 ; 1 12d26: 71 05 cpc r23, r1 12d28: 11 f4 brne .+4 ; 0x12d2e 12d2a: 0c 94 8b ad jmp 0x15b16 ; 0x15b16 12d2e: 62 30 cpi r22, 0x02 ; 2 12d30: 71 05 cpc r23, r1 12d32: 11 f4 brne .+4 ; 0x12d38 12d34: 0c 94 ad ad jmp 0x15b5a ; 0x15b5a case 2: for(int i=0;i 12d3c: c0 c1 rjmp .+896 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d3e: 85 39 cpi r24, 0x95 ; 149 12d40: f1 e0 ldi r31, 0x01 ; 1 12d42: 9f 07 cpc r25, r31 12d44: 11 f4 brne .+4 ; 0x12d4a 12d46: 0c 94 35 a2 jmp 0x1446a ; 0x1446a 12d4a: 86 39 cpi r24, 0x96 ; 150 12d4c: 21 e0 ldi r18, 0x01 ; 1 12d4e: 92 07 cpc r25, r18 12d50: 11 f4 brne .+4 ; 0x12d56 12d52: 0c 94 3a a2 jmp 0x14474 ; 0x14474 12d56: 83 39 cpi r24, 0x93 ; 147 12d58: 91 40 sbci r25, 0x01 ; 1 12d5a: 09 f0 breq .+2 ; 0x12d5e 12d5c: f0 ca rjmp .-2592 ; 0x1233e */ 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()) 12d5e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 12d62: 81 30 cpi r24, 0x01 ; 1 12d64: 09 f0 breq .+2 ; 0x12d68 12d66: ab c1 rjmp .+854 ; 0x130be { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 12d68: 85 e4 ldi r24, 0x45 ; 69 12d6a: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d6e: 81 11 cpse r24, r1 12d70: 0e 94 cb 55 call 0xab96 ; 0xab96 if(code_seen('F')) filament = code_value_uint8(); 12d74: 86 e4 ldi r24, 0x46 ; 70 12d76: 0e 94 b6 55 call 0xab6c ; 0xab6c 12d7a: 81 11 cpse r24, r1 12d7c: 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()) { 12d80: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 12d84: 88 23 and r24, r24 12d86: 09 f4 brne .+2 ; 0x12d8a 12d88: 9a c1 rjmp .+820 ; 0x130be // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 12d8a: 60 e0 ldi r22, 0x00 ; 0 12d8c: 80 e0 ldi r24, 0x00 ; 0 12d8e: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 12d92: 95 c1 rjmp .+810 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d94: 80 3c cpi r24, 0xC0 ; 192 12d96: 42 e0 ldi r20, 0x02 ; 2 12d98: 94 07 cpc r25, r20 12d9a: 11 f4 brne .+4 ; 0x12da0 12d9c: 0c 94 9c ae jmp 0x15d38 ; 0x15d38 12da0: 0c f0 brlt .+2 ; 0x12da4 12da2: 57 c0 rjmp .+174 ; 0x12e52 12da4: 88 32 cpi r24, 0x28 ; 40 12da6: a2 e0 ldi r26, 0x02 ; 2 12da8: 9a 07 cpc r25, r26 12daa: 11 f4 brne .+4 ; 0x12db0 12dac: 0c 94 e0 a4 jmp 0x149c0 ; 0x149c0 12db0: 4c f5 brge .+82 ; 0x12e04 12db2: 86 3f cpi r24, 0xF6 ; 246 12db4: e1 e0 ldi r30, 0x01 ; 1 12db6: 9e 07 cpc r25, r30 12db8: 11 f4 brne .+4 ; 0x12dbe 12dba: 0c 94 47 a2 jmp 0x1448e ; 0x1448e 12dbe: 6c f4 brge .+26 ; 0x12dda 12dc0: 84 3f cpi r24, 0xF4 ; 244 12dc2: 21 e0 ldi r18, 0x01 ; 1 12dc4: 92 07 cpc r25, r18 12dc6: 11 f4 brne .+4 ; 0x12dcc 12dc8: 0c 94 43 a2 jmp 0x14486 ; 0x14486 12dcc: 85 3f cpi r24, 0xF5 ; 245 12dce: 91 40 sbci r25, 0x01 ; 1 12dd0: 09 f0 breq .+2 ; 0x12dd4 12dd2: b5 ca rjmp .-2710 ; 0x1233e M501 */ case 501: { Config_RetrieveSettings(); 12dd4: 0e 94 6c 75 call 0xead8 ; 0xead8 12dd8: 72 c1 rjmp .+740 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12dda: 87 3f cpi r24, 0xF7 ; 247 12ddc: 41 e0 ldi r20, 0x01 ; 1 12dde: 94 07 cpc r25, r20 12de0: 11 f4 brne .+4 ; 0x12de6 12de2: 0c 94 4b a2 jmp 0x14496 ; 0x14496 12de6: 8d 3f cpi r24, 0xFD ; 253 12de8: 91 40 sbci r25, 0x01 ; 1 12dea: 09 f0 breq .+2 ; 0x12dee 12dec: a8 ca rjmp .-2736 ; 0x1233e M509 */ case 509: { lang_reset(); 12dee: 0e 94 3f 6c call 0xd87e ; 0xd87e SERIAL_ECHO_START; 12df2: 87 e7 ldi r24, 0x77 ; 119 12df4: 9e e9 ldi r25, 0x9E ; 158 12df6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 12dfa: 86 ea ldi r24, 0xA6 ; 166 12dfc: 9f e7 ldi r25, 0x7F ; 127 12dfe: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 12e02: 5d c1 rjmp .+698 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e04: 8a 35 cpi r24, 0x5A ; 90 12e06: a2 e0 ldi r26, 0x02 ; 2 12e08: 9a 07 cpc r25, r26 12e0a: 11 f4 brne .+4 ; 0x12e10 12e0c: 0c 94 0e a9 jmp 0x1521c ; 0x1521c 12e10: 5c f4 brge .+22 ; 0x12e28 12e12: 88 35 cpi r24, 0x58 ; 88 12e14: e2 e0 ldi r30, 0x02 ; 2 12e16: 9e 07 cpc r25, r30 12e18: 11 f4 brne .+4 ; 0x12e1e 12e1a: 0c 94 15 a5 jmp 0x14a2a ; 0x14a2a 12e1e: 89 35 cpi r24, 0x59 ; 89 12e20: 92 40 sbci r25, 0x02 ; 2 12e22: 09 f4 brne .+2 ; 0x12e26 12e24: f9 ca rjmp .-2574 ; 0x12418 12e26: 8b ca rjmp .-2794 ; 0x1233e 12e28: 8d 3b cpi r24, 0xBD ; 189 12e2a: 22 e0 ldi r18, 0x02 ; 2 12e2c: 92 07 cpc r25, r18 12e2e: 11 f4 brne .+4 ; 0x12e34 12e30: 0c 94 c6 ad jmp 0x15b8c ; 0x15b8c 12e34: 8e 3b cpi r24, 0xBE ; 190 12e36: 32 e0 ldi r19, 0x02 ; 2 12e38: 93 07 cpc r25, r19 12e3a: 11 f4 brne .+4 ; 0x12e40 12e3c: 0c 94 68 ae jmp 0x15cd0 ; 0x15cd0 12e40: 8b 35 cpi r24, 0x5B ; 91 12e42: 92 40 sbci r25, 0x02 ; 2 12e44: 09 f0 breq .+2 ; 0x12e48 12e46: 7b ca rjmp .-2826 ; 0x1233e /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 12e48: 60 e0 ldi r22, 0x00 ; 0 12e4a: 80 e0 ldi r24, 0x00 ; 0 12e4c: 0e 94 64 ef call 0x1dec8 ; 0x1dec8 12e50: 36 c1 rjmp .+620 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e52: 8c 35 cpi r24, 0x5C ; 92 12e54: 53 e0 ldi r21, 0x03 ; 3 12e56: 95 07 cpc r25, r21 12e58: 11 f4 brne .+4 ; 0x12e5e 12e5a: 0c 94 30 aa jmp 0x15460 ; 0x15460 12e5e: 0c f0 brlt .+2 ; 0x12e62 12e60: 42 c0 rjmp .+132 ; 0x12ee6 12e62: 83 3c cpi r24, 0xC3 ; 195 12e64: b2 e0 ldi r27, 0x02 ; 2 12e66: 9b 07 cpc r25, r27 12e68: 11 f4 brne .+4 ; 0x12e6e 12e6a: 0c 94 a8 ae jmp 0x15d50 ; 0x15d50 12e6e: 7c f4 brge .+30 ; 0x12e8e 12e70: 81 3c cpi r24, 0xC1 ; 193 12e72: f2 e0 ldi r31, 0x02 ; 2 12e74: 9f 07 cpc r25, r31 12e76: 11 f4 brne .+4 ; 0x12e7c 12e78: 0c 94 a2 ae jmp 0x15d44 ; 0x15d44 12e7c: 82 3c cpi r24, 0xC2 ; 194 12e7e: 92 40 sbci r25, 0x02 ; 2 12e80: 09 f0 breq .+2 ; 0x12e84 12e82: 5d ca rjmp .-2886 ; 0x1233e #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 12e84: 82 ec ldi r24, 0xC2 ; 194 12e86: 92 e0 ldi r25, 0x02 ; 2 12e88: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 12e8c: 18 c1 rjmp .+560 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e8e: 85 3c cpi r24, 0xC5 ; 197 12e90: 32 e0 ldi r19, 0x02 ; 2 12e92: 93 07 cpc r25, r19 12e94: 11 f4 brne .+4 ; 0x12e9a 12e96: 0c 94 f1 ae jmp 0x15de2 ; 0x15de2 12e9a: 14 f4 brge .+4 ; 0x12ea0 12e9c: 0c 94 c5 ae jmp 0x15d8a ; 0x15d8a 12ea0: 82 35 cpi r24, 0x52 ; 82 12ea2: 93 40 sbci r25, 0x03 ; 3 12ea4: 09 f0 breq .+2 ; 0x12ea8 12ea6: 4b ca rjmp .-2922 ; 0x1233e float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 12ea8: 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')) { 12eaa: 83 e5 ldi r24, 0x53 ; 83 12eac: 0e 94 b6 55 call 0xab6c ; 0xab6c 12eb0: 88 23 and r24, r24 12eb2: 11 f4 brne .+4 ; 0x12eb8 12eb4: 0c 94 16 a9 jmp 0x1522c ; 0x1522c iSel = code_value_uint8(); 12eb8: 0e 94 cb 55 call 0xab96 ; 0xab96 12ebc: 18 2f mov r17, r24 if (iSel>=max_sheets) 12ebe: 88 30 cpi r24, 0x08 ; 8 12ec0: 10 f4 brcc .+4 ; 0x12ec6 12ec2: 0c 94 1b a9 jmp 0x15236 ; 0x15236 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 12ec6: 82 e8 ldi r24, 0x82 ; 130 12ec8: 9f e7 ldi r25, 0x7F ; 127 12eca: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 12ece: 4a e0 ldi r20, 0x0A ; 10 12ed0: 67 e0 ldi r22, 0x07 ; 7 12ed2: 70 e0 ldi r23, 0x00 ; 0 12ed4: 80 e0 ldi r24, 0x00 ; 0 12ed6: 90 e0 ldi r25, 0x00 ; 0 12ed8: 0f 94 cd 96 call 0x32d9a ; 0x32d9a SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 12edc: 8a ed ldi r24, 0xDA ; 218 12ede: 92 e0 ldi r25, 0x02 ; 2 12ee0: 0f 94 9e 99 call 0x3333c ; 0x3333c 12ee4: ec c0 rjmp .+472 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12ee6: 84 38 cpi r24, 0x84 ; 132 12ee8: a3 e0 ldi r26, 0x03 ; 3 12eea: 9a 07 cpc r25, r26 12eec: 11 f4 brne .+4 ; 0x12ef2 12eee: 0c 94 a6 ac jmp 0x1594c ; 0x1594c 12ef2: 0c f0 brlt .+2 ; 0x12ef6 12ef4: 4d c0 rjmp .+154 ; 0x12f90 12ef6: 8d 35 cpi r24, 0x5D ; 93 12ef8: e3 e0 ldi r30, 0x03 ; 3 12efa: 9e 07 cpc r25, r30 12efc: 11 f4 brne .+4 ; 0x12f02 12efe: 0c 94 ba aa jmp 0x15574 ; 0x15574 12f02: 8e 35 cpi r24, 0x5E ; 94 12f04: 93 40 sbci r25, 0x03 ; 3 12f06: 09 f0 breq .+2 ; 0x12f0a 12f08: 1a ca rjmp .-3020 ; 0x1233e */ 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); 12f0a: 0e 94 8e 5a call 0xb51c ; 0xb51c 12f0e: 20 e0 ldi r18, 0x00 ; 0 12f10: 30 e0 ldi r19, 0x00 ; 0 12f12: 40 e2 ldi r20, 0x20 ; 32 12f14: 51 e4 ldi r21, 0x41 ; 65 12f16: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 12f1a: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 12f1e: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 12f20: 63 30 cpi r22, 0x03 ; 3 12f22: 11 f4 brne .+4 ; 0x12f28 12f24: 0c 94 c0 ab jmp 0x15780 ; 0x15780 12f28: 10 f0 brcs .+4 ; 0x12f2e 12f2a: 0c 94 52 ab jmp 0x156a4 ; 0x156a4 12f2e: 61 30 cpi r22, 0x01 ; 1 12f30: 11 f4 brne .+4 ; 0x12f36 12f32: 0c 94 7b ab jmp 0x156f6 ; 0x156f6 12f36: 62 30 cpi r22, 0x02 ; 2 12f38: 09 f0 breq .+2 ; 0x12f3c 12f3a: c1 c0 rjmp .+386 ; 0x130be ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12f3c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return pgm_read_word(&_nPrinterMmuType); 12f40: e7 eb ldi r30, 0xB7 ; 183 12f42: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12f44: 81 30 cpi r24, 0x01 ; 1 12f46: 11 f0 breq .+4 ; 0x12f4c return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 12f48: e9 eb ldi r30, 0xB9 ; 185 12f4a: f9 e7 ldi r31, 0x79 ; 121 12f4c: 05 91 lpm r16, Z+ 12f4e: 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')) 12f50: 80 e5 ldi r24, 0x50 ; 80 12f52: 0e 94 b6 55 call 0xab6c ; 0xab6c 12f56: 88 23 and r24, r24 12f58: 11 f4 brne .+4 ; 0x12f5e 12f5a: 0c 94 af ab jmp 0x1575e ; 0x1575e { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 12f5e: 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) 12f62: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 12f66: ff 20 and r15, r15 12f68: 09 f4 brne .+2 ; 0x12f6c 12f6a: a9 c0 rjmp .+338 ; 0x130be return; if (nPrinterModel == actualPrinterModel) 12f6c: 60 17 cp r22, r16 12f6e: 71 07 cpc r23, r17 12f70: 09 f4 brne .+2 ; 0x12f74 12f72: a5 c0 rjmp .+330 ; 0x130be // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 12f74: 89 ec ldi r24, 0xC9 ; 201 12f76: 97 e3 ldi r25, 0x37 ; 55 12f78: 0e 94 3c 6d call 0xda78 ; 0xda78 12f7c: 8c 01 movw r16, r24 12f7e: 81 e9 ldi r24, 0x91 ; 145 12f80: 97 e3 ldi r25, 0x37 ; 55 12f82: 0e 94 3c 6d call 0xda78 ; 0xda78 12f86: 4f 2d mov r20, r15 12f88: b8 01 movw r22, r16 12f8a: 0e 94 b1 ef call 0x1df62 ; 0x1df62 12f8e: 97 c0 rjmp .+302 ; 0x130be } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12f90: 8c 38 cpi r24, 0x8C ; 140 12f92: 23 e0 ldi r18, 0x03 ; 3 12f94: 92 07 cpc r25, r18 12f96: 09 f4 brne .+2 ; 0x12f9a 12f98: 92 c0 rjmp .+292 ; 0x130be 12f9a: 80 3a cpi r24, 0xA0 ; 160 12f9c: 33 e0 ldi r19, 0x03 ; 3 12f9e: 93 07 cpc r25, r19 12fa0: 09 f4 brne .+2 ; 0x12fa4 12fa2: 50 c2 rjmp .+1184 ; 0x13444 12fa4: 8b 38 cpi r24, 0x8B ; 139 12fa6: 93 40 sbci r25, 0x03 ; 3 12fa8: 09 f0 breq .+2 ; 0x12fac 12faa: c9 c9 rjmp .-3182 ; 0x1233e for(int i=0;i 12fb2: 88 23 and r24, r24 12fb4: 39 f0 breq .+14 ; 0x12fc4 12fb6: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fba: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 12fbe: 80 e0 ldi r24, 0x00 ; 0 12fc0: 0f 94 61 21 call 0x242c2 ; 0x242c2 #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 12fc4: 8a e5 ldi r24, 0x5A ; 90 12fc6: 0e 94 b6 55 call 0xab6c ; 0xab6c 12fca: 88 23 and r24, r24 12fcc: 39 f0 breq .+14 ; 0x12fdc 12fce: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fd2: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 12fd6: 81 e0 ldi r24, 0x01 ; 1 12fd8: 0f 94 61 21 call 0x242c2 ; 0x242c2 #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 12fdc: 85 e4 ldi r24, 0x45 ; 69 12fde: 0e 94 b6 55 call 0xab6c ; 0xab6c 12fe2: 88 23 and r24, r24 12fe4: 09 f4 brne .+2 ; 0x12fe8 12fe6: 6b c0 rjmp .+214 ; 0x130be 12fe8: 0e 94 8e 5a call 0xb51c ; 0xb51c 12fec: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 12ff0: cb 01 movw r24, r22 12ff2: 0f 94 61 20 call 0x240c2 ; 0x240c2 12ff6: 63 c0 rjmp .+198 ; 0x130be - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 12ff8: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12ffc: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13000: 0e 5f subi r16, 0xFE ; 254 13002: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 13004: 80 e5 ldi r24, 0x50 ; 80 13006: 0e 94 b6 55 call 0xab6c ; 0xab6c */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 1300a: c1 2c mov r12, r1 1300c: d1 2c mov r13, r1 1300e: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 13010: 88 23 and r24, r24 13012: 21 f0 breq .+8 ; 0x1301c 13014: 0e 94 1e 56 call 0xac3c ; 0xac3c 13018: 6b 01 movw r12, r22 1301a: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 1301c: 83 e5 ldi r24, 0x53 ; 83 1301e: 0e 94 b6 55 call 0xab6c ; 0xab6c 13022: 88 23 and r24, r24 13024: 51 f0 breq .+20 ; 0x1303a 13026: 0e 94 1e 56 call 0xac3c ; 0xac3c 1302a: 9b 01 movw r18, r22 1302c: ac 01 movw r20, r24 1302e: a8 ee ldi r26, 0xE8 ; 232 13030: b3 e0 ldi r27, 0x03 ; 3 13032: 0f 94 12 a1 call 0x34224 ; 0x34224 <__muluhisi3> 13036: 6b 01 movw r12, r22 13038: 7c 01 movw r14, r24 1303a: c8 01 movw r24, r16 1303c: 0f 5f subi r16, 0xFF ; 255 1303e: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 13040: dc 01 movw r26, r24 13042: 4c 91 ld r20, X 13044: 40 32 cpi r20, 0x20 ; 32 13046: c9 f3 breq .-14 ; 0x1303a custom_message_type = CustomMsg::M0Wait; 13048: 26 e0 ldi r18, 0x06 ; 6 1304a: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 if (!expiration_time_set && *src != '\0') { 1304e: c1 14 cp r12, r1 13050: d1 04 cpc r13, r1 13052: e1 04 cpc r14, r1 13054: f1 04 cpc r15, r1 13056: c9 f5 brne .+114 ; 0x130ca 13058: 2c 91 ld r18, X 1305a: 22 23 and r18, r18 1305c: b1 f1 breq .+108 ; 0x130ca lcd_setstatus(src); 1305e: 0e 94 53 ef call 0x1dea6 ; 0x1dea6 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(); 13062: 0f 94 14 22 call 0x24428 ; 0x24428 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 13066: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 1306a: 84 60 ori r24, 0x04 ; 4 1306c: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd previous_millis_cmd.start(); 13070: 8a e4 ldi r24, 0x4A ; 74 13072: 93 e0 ldi r25, 0x03 ; 3 13074: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> if (expiration_time_set) { 13078: c1 14 cp r12, r1 1307a: d1 04 cpc r13, r1 1307c: e1 04 cpc r14, r1 1307e: f1 04 cpc r15, r1 13080: d9 f1 breq .+118 ; 0x130f8 codenum += _millis(); // keep track of when we started waiting 13082: 0f 94 46 0f call 0x21e8c ; 0x21e8c 13086: c6 0e add r12, r22 13088: d7 1e adc r13, r23 1308a: e8 1e adc r14, r24 1308c: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 1308e: 84 e0 ldi r24, 0x04 ; 4 13090: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 13094: 0f 94 46 0f call 0x21e8c ; 0x21e8c 13098: 6c 15 cp r22, r12 1309a: 7d 05 cpc r23, r13 1309c: 8e 05 cpc r24, r14 1309e: 9f 05 cpc r25, r15 130a0: 10 f1 brcs .+68 ; 0x130e6 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 130a2: 82 e0 ldi r24, 0x02 ; 2 130a4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 130a8: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 130ac: 8b 7f andi r24, 0xFB ; 251 130ae: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd if (IS_SD_PRINTING) 130b2: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 130b6: 88 23 and r24, r24 130b8: 91 f1 breq .+100 ; 0x1311e custom_message_type = CustomMsg::Status; 130ba: 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; 130be: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 130c2: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.491> 130c6: 0c 94 ba 84 jmp 0x10974 ; 0x10974 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){ 130ca: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 130ce: 81 11 cpse r24, r1 130d0: 07 c0 rjmp .+14 ; 0x130e0 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 130d2: 8f ec ldi r24, 0xCF ; 207 130d4: 99 e3 ldi r25, 0x39 ; 57 130d6: 0e 94 3c 6d call 0xda78 ; 0xda78 130da: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 130de: c1 cf rjmp .-126 ; 0x13062 } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 130e0: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 130e4: be cf rjmp .-132 ; 0x13062 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()) { 130e6: 0e 94 23 6c call 0xd846 ; 0xd846 130ea: 81 11 cpse r24, r1 130ec: da cf rjmp .-76 ; 0x130a2 delay_keep_alive(0); 130ee: 90 e0 ldi r25, 0x00 ; 0 130f0: 80 e0 ldi r24, 0x00 ; 0 130f2: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 130f6: ce cf rjmp .-100 ; 0x13094 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 130f8: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 130fc: 84 e0 ldi r24, 0x04 ; 4 130fe: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 13102: 0e 94 1e 6c call 0xd83c ; 0xd83c while(!lcd_clicked()) 13106: 0e 94 23 6c call 0xd846 ; 0xd846 1310a: 81 11 cpse r24, r1 1310c: 05 c0 rjmp .+10 ; 0x13118 { delay_keep_alive(0); 1310e: 90 e0 ldi r25, 0x00 ; 0 13110: 80 e0 ldi r24, 0x00 ; 0 13112: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 13116: f7 cf rjmp .-18 ; 0x13106 } KEEPALIVE_STATE(busy_state_backup); 13118: 10 93 78 02 sts 0x0278, r17 ; 0x800278 1311c: c5 cf rjmp .-118 ; 0x130a8 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 1311e: 8b e0 ldi r24, 0x0B ; 11 13120: 9c e6 ldi r25, 0x6C ; 108 13122: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 13126: cb cf rjmp .-106 ; 0x130be /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 13128: 84 ec ldi r24, 0xC4 ; 196 1312a: 99 e3 ldi r25, 0x39 ; 57 1312c: 0e 94 3c 6d call 0xda78 ; 0xda78 13130: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe enable_x(); 13134: 17 98 cbi 0x02, 7 ; 2 enable_y(); 13136: 16 98 cbi 0x02, 6 ; 2 enable_z(); 13138: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1313a: 14 98 cbi 0x02, 4 ; 2 1313c: c0 cf rjmp .-128 ; 0x130be /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1313e: 81 e0 ldi r24, 0x01 ; 1 13140: 0f 94 1b 4d call 0x29a36 ; 0x29a36 13144: bc cf rjmp .-136 ; 0x130be presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 13146: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 1314a: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 1314e: 87 e7 ldi r24, 0x77 ; 119 13150: 9e e9 ldi r25, 0x9E ; 158 13152: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 13156: 8d e8 ldi r24, 0x8D ; 141 13158: 98 e6 ldi r25, 0x68 ; 104 1315a: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1315e: af cf rjmp .-162 ; 0x130be /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 13160: 0e 94 48 61 call 0xc290 ; 0xc290 13164: 88 23 and r24, r24 13166: 19 f0 breq .+6 ; 0x1316e lcd_resume_print(); 13168: 0e 94 24 ef call 0x1de48 ; 0x1de48 1316c: a8 cf rjmp .-176 ; 0x130be else { if (!filament_presence_check()) { 1316e: 0e 94 c2 ef call 0x1df84 ; 0x1df84 13172: 88 23 and r24, r24 13174: 09 f4 brne .+2 ; 0x13178 13176: a3 cf rjmp .-186 ; 0x130be 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); }; 13178: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1317c: 88 23 and r24, r24 1317e: 61 f0 breq .+24 ; 0x13198 // Print was aborted break; } if (!card.get_sdpos()) 13180: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 13184: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 13188: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1318c: b0 91 81 16 lds r27, 0x1681 ; 0x801681 13190: 89 2b or r24, r25 13192: 8a 2b or r24, r26 13194: 8b 2b or r24, r27 13196: 69 f4 brne .+26 ; 0x131b2 { // A new print has started from scratch, reset stats failstats_reset_print(); 13198: 0e 94 29 56 call 0xac52 ; 0xac52 sdpos_atomic = 0; 1319c: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 131a0: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 131a4: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 131a8: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 131ac: 80 e0 ldi r24, 0x00 ; 0 131ae: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 } void CardReader::startFileprint() { if(mounted) 131b2: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 131b6: 88 23 and r24, r24 131b8: 31 f0 breq .+12 ; 0x131c6 { sdprinting = true; 131ba: 81 e0 ldi r24, 0x01 ; 1 131bc: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 131c0: 85 e0 ldi r24, 0x05 ; 5 131c2: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 131c6: 0f 94 28 20 call 0x24050 ; 0x24050 if (MMU2::mmu2.Enabled()) 131ca: 80 91 94 12 lds r24, 0x1294 ; 0x801294 131ce: 81 30 cpi r24, 0x01 ; 1 131d0: 09 f0 breq .+2 ; 0x131d4 131d2: 75 cf rjmp .-278 ; 0x130be { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 131d4: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 131d8: 88 23 and r24, r24 131da: 09 f4 brne .+2 ; 0x131de 131dc: 70 cf rjmp .-288 ; 0x130be 131de: 0e 94 f7 c3 call 0x187ee ; 0x187ee 131e2: 81 11 cpse r24, r1 131e4: 6c cf rjmp .-296 ; 0x130be { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 131e6: 0f 94 34 6b call 0x2d668 ; 0x2d668 131ea: 69 cf rjmp .-302 ; 0x130be #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 131ec: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 131f0: 88 23 and r24, r24 131f2: 09 f4 brne .+2 ; 0x131f6 131f4: 64 cf rjmp .-312 ; 0x130be 131f6: 83 e5 ldi r24, 0x53 ; 83 131f8: 0e 94 b6 55 call 0xab6c ; 0xab6c 131fc: 88 23 and r24, r24 131fe: 09 f4 brne .+2 ; 0x13202 13200: 5e cf rjmp .-324 ; 0x130be long index = code_value_long(); 13202: 0e 94 1e 56 call 0xac3c ; 0xac3c 13206: 6b 01 movw r12, r22 13208: 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);}; 1320a: c0 92 7e 16 sts 0x167E, r12 ; 0x80167e 1320e: d0 92 7f 16 sts 0x167F, r13 ; 0x80167f 13212: e0 92 80 16 sts 0x1680, r14 ; 0x801680 13216: f0 92 81 16 sts 0x1681, r15 ; 0x801681 1321a: 0f 94 94 43 call 0x28728 ; 0x28728 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; 1321e: c0 92 dc 11 sts 0x11DC, r12 ; 0x8011dc 13222: d0 92 dd 11 sts 0x11DD, r13 ; 0x8011dd 13226: e0 92 de 11 sts 0x11DE, r14 ; 0x8011de 1322a: f0 92 df 11 sts 0x11DF, r15 ; 0x8011df 1322e: 47 cf rjmp .-370 ; 0x130be #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 13230: 80 e5 ldi r24, 0x50 ; 80 13232: 0e 94 b6 55 call 0xab6c ; 0xab6c 13236: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 13238: 0e 94 48 61 call 0xc290 ; 0xc290 1323c: 88 23 and r24, r24 1323e: 91 f0 breq .+36 ; 0x13264 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 13240: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 13244: 88 23 and r24, r24 13246: 49 f0 breq .+18 ; 0x1325a 13248: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1324c: 81 11 cpse r24, r1 1324e: 05 c0 rjmp .+10 ; 0x1325a SERIAL_PROTOCOLLNPGM("SD print paused"); 13250: 8e e9 ldi r24, 0x9E ; 158 13252: 9e e7 ldi r25, 0x7E ; 126 13254: 0e 94 de 72 call 0xe5bc ; 0xe5bc 13258: 32 cf rjmp .-412 ; 0x130be else SERIAL_PROTOCOLLNPGM("Print saved"); 1325a: 82 e9 ldi r24, 0x92 ; 146 1325c: 9e e7 ldi r25, 0x7E ; 126 1325e: 0e 94 de 72 call 0xe5bc ; 0xe5bc 13262: 2d cf rjmp .-422 ; 0x130be } else if (sdprinting) 13264: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 13268: 88 23 and r24, r24 1326a: 09 f4 brne .+2 ; 0x1326e 1326c: 4a c0 rjmp .+148 ; 0x13302 { if (arg_P) 1326e: 11 23 and r17, r17 13270: e1 f1 breq .+120 ; 0x132ea { printAbsFilenameFast(); 13272: 0f 94 19 48 call 0x29032 ; 0x29032 SERIAL_PROTOCOLLN(); 13276: 0f 94 9d 98 call 0x3313a ; 0x3313a } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 1327a: 82 ea ldi r24, 0xA2 ; 162 1327c: 95 e6 ldi r25, 0x65 ; 101 1327e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 13282: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 13286: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 1328a: 80 91 80 16 lds r24, 0x1680 ; 0x801680 1328e: 90 91 81 16 lds r25, 0x1681 ; 0x801681 13292: 4a e0 ldi r20, 0x0A ; 10 13294: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13298: 8f e2 ldi r24, 0x2F ; 47 1329a: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1329e: 60 91 77 16 lds r22, 0x1677 ; 0x801677 132a2: 70 91 78 16 lds r23, 0x1678 ; 0x801678 132a6: 80 91 79 16 lds r24, 0x1679 ; 0x801679 132aa: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 132ae: 4a e0 ldi r20, 0x0A ; 10 132b0: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 132b4: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 132b8: 0f 94 38 1c call 0x23870 ; 0x23870 132bc: 2c e3 ldi r18, 0x3C ; 60 132be: 30 e0 ldi r19, 0x00 ; 0 132c0: 40 e0 ldi r20, 0x00 ; 0 132c2: 50 e0 ldi r21, 0x00 ; 0 132c4: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 132c8: c9 01 movw r24, r18 132ca: 6c e3 ldi r22, 0x3C ; 60 132cc: 70 e0 ldi r23, 0x00 ; 0 132ce: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 132d2: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 132d4: 90 e0 ldi r25, 0x00 ; 0 132d6: 80 e0 ldi r24, 0x00 ; 0 132d8: 0f 94 43 97 call 0x32e86 ; 0x32e86 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 132dc: 8a e3 ldi r24, 0x3A ; 58 132de: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 132e2: c8 01 movw r24, r16 132e4: 0f 94 48 41 call 0x28290 ; 0x28290 132e8: ea ce rjmp .-556 ; 0x130be { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 132ea: 80 91 81 13 lds r24, 0x1381 ; 0x801381 132ee: 88 23 and r24, r24 132f0: 29 f0 breq .+10 ; 0x132fc 132f2: 81 e8 ldi r24, 0x81 ; 129 132f4: 93 e1 ldi r25, 0x13 ; 19 132f6: 0f 94 9e 99 call 0x3333c ; 0x3333c 132fa: bf cf rjmp .-130 ; 0x1327a 132fc: 8c e6 ldi r24, 0x6C ; 108 132fe: 93 e1 ldi r25, 0x13 ; 19 13300: fa cf rjmp .-12 ; 0x132f6 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 13302: 82 e8 ldi r24, 0x82 ; 130 13304: 9e e7 ldi r25, 0x7E ; 126 13306: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1330a: d9 ce rjmp .-590 ; 0x130be /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1330c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13310: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 13314: 04 96 adiw r24, 0x04 ; 4 13316: 0f 94 c0 51 call 0x2a380 ; 0x2a380 1331a: d1 ce rjmp .-606 ; 0x130be * 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; 1331c: ce 01 movw r24, r28 1331e: 01 96 adiw r24, 0x01 ; 1 13320: 0f 94 75 44 call 0x288ea ; 0x288ea 13324: 88 23 and r24, r24 13326: 09 f4 brne .+2 ; 0x1332a 13328: 33 c9 rjmp .-3482 ; 0x12590 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1332a: 61 e0 ldi r22, 0x01 ; 1 1332c: ce 01 movw r24, r28 1332e: 01 96 adiw r24, 0x01 ; 1 13330: 0f 94 3c 6f call 0x2de78 ; 0x2de78 if (!d) goto fail; 13334: 00 97 sbiw r24, 0x00 ; 0 13336: 09 f4 brne .+2 ; 0x1333a 13338: 2b c9 rjmp .-3498 ; 0x12590 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1333a: 25 ee ldi r18, 0xE5 ; 229 1333c: fc 01 movw r30, r24 1333e: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 13340: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 13342: 0f 94 ca 35 call 0x26b94 ; 0x26b94 13346: 18 2f mov r17, r24 13348: 24 c9 rjmp .-3512 ; 0x12592 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 1334a: 8c e5 ldi r24, 0x5C ; 92 1334c: 9e e7 ldi r25, 0x7E ; 126 1334e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 13352: 8c a1 ldd r24, Y+36 ; 0x24 13354: 9d a1 ldd r25, Y+37 ; 0x25 13356: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 1335a: 8e e2 ldi r24, 0x2E ; 46 1335c: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 13360: 0f 94 9d 98 call 0x3313a ; 0x3313a 13364: ac ce rjmp .-680 ; 0x130be - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 13366: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1336a: 81 11 cpse r24, r1 st_synchronize(); 1336c: 0f 94 14 22 call 0x24428 ; 0x24428 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 13370: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13374: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13378: 0c 5f subi r16, 0xFC ; 252 1337a: 1f 4f sbci r17, 0xFF ; 255 1337c: 61 e2 ldi r22, 0x21 ; 33 1337e: 70 e0 ldi r23, 0x00 ; 0 13380: c8 01 movw r24, r16 13382: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 if(namestartpos==NULL) 13386: 00 97 sbiw r24, 0x00 ; 0 13388: 19 f0 breq .+6 ; 0x13390 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 1338a: 8c 01 movw r16, r24 1338c: 0f 5f subi r16, 0xFF ; 255 1338e: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 13390: 80 e5 ldi r24, 0x50 ; 80 13392: 0e 94 b6 55 call 0xab6c ; 0xab6c 13396: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 13398: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 1339c: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 133a0: 08 17 cp r16, r24 133a2: 19 07 cpc r17, r25 133a4: 08 f4 brcc .+2 ; 0x133a8 call_procedure=false; //false alert, 'P' found within filename 133a6: f1 2c mov r15, r1 if( card.mounted ) 133a8: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 133ac: 88 23 and r24, r24 133ae: 09 f4 brne .+2 ; 0x133b2 133b0: 86 ce rjmp .-756 ; 0x130be { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 133b2: 61 e0 ldi r22, 0x01 ; 1 133b4: 6f 25 eor r22, r15 133b6: c8 01 movw r24, r16 133b8: 0f 94 a4 4b call 0x29748 ; 0x29748 if(code_seen('S')) 133bc: 83 e5 ldi r24, 0x53 ; 83 133be: 0e 94 b6 55 call 0xab6c ; 0xab6c 133c2: 88 23 and r24, r24 133c4: 99 f0 breq .+38 ; 0x133ec if(strchr_pointer 133ca: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 133ce: 80 17 cp r24, r16 133d0: 91 07 cpc r25, r17 133d2: 60 f4 brcc .+24 ; 0x133ec card.setIndex(code_value_long()); 133d4: 0e 94 1e 56 call 0xac3c ; 0xac3c 133d8: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 133dc: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 133e0: 80 93 80 16 sts 0x1680, r24 ; 0x801680 133e4: 90 93 81 16 sts 0x1681, r25 ; 0x801681 133e8: 0f 94 94 43 call 0x28728 ; 0x28728 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 133ec: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 133f0: 88 23 and r24, r24 133f2: 31 f0 breq .+12 ; 0x13400 { sdprinting = true; 133f4: 81 e0 ldi r24, 0x01 ; 1 133f6: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 133fa: 85 e0 ldi r24, 0x05 ; 5 133fc: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> card.startFileprint(); if(!call_procedure) 13400: f1 10 cpse r15, r1 13402: 5d ce rjmp .-838 ; 0x130be 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); }; 13404: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 13408: 88 23 and r24, r24 1340a: 61 f0 breq .+24 ; 0x13424 { if(!card.get_sdpos()) 1340c: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 13410: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 13414: a0 91 80 16 lds r26, 0x1680 ; 0x801680 13418: b0 91 81 16 lds r27, 0x1681 ; 0x801681 1341c: 89 2b or r24, r25 1341e: 8a 2b or r24, r26 13420: 8b 2b or r24, r27 13422: 69 f4 brne .+26 ; 0x1343e { // A new print has started from scratch, reset stats failstats_reset_print(); 13424: 0e 94 29 56 call 0xac52 ; 0xac52 sdpos_atomic = 0; 13428: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 1342c: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 13430: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 13434: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 13438: 80 e0 ldi r24, 0x00 ; 0 1343a: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 1343e: 0f 94 28 20 call 0x24050 ; 0x24050 13442: 3d ce rjmp .-902 ; 0x130be M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 13444: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13448: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 } } void CardReader::openLogFile(const char* name) { logging = true; 1344c: 21 e0 ldi r18, 0x01 ; 1 1344e: 20 93 69 13 sts 0x1369, r18 ; 0x801369 openFileWrite(name); 13452: 05 96 adiw r24, 0x05 ; 5 13454: 0f 94 c0 51 call 0x2a380 ; 0x2a380 13458: 32 ce rjmp .-924 ; 0x130be ### 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(); 1345a: 0f 94 38 1c call 0x23870 ; 0x23870 int16_t sec, min; min = t / 60; sec = t % 60; 1345e: 2c e3 ldi r18, 0x3C ; 60 13460: 30 e0 ldi r19, 0x00 ; 0 13462: 40 e0 ldi r20, 0x00 ; 0 13464: 50 e0 ldi r21, 0x00 ; 0 13466: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 1346a: 7f 93 push r23 1346c: 6f 93 push r22 1346e: 3f 93 push r19 13470: 2f 93 push r18 13472: 80 ef ldi r24, 0xF0 ; 240 13474: 90 e8 ldi r25, 0x80 ; 128 13476: 9f 93 push r25 13478: 8f 93 push r24 1347a: 8e 01 movw r16, r28 1347c: 0f 5f subi r16, 0xFF ; 255 1347e: 1f 4f sbci r17, 0xFF ; 255 13480: 1f 93 push r17 13482: 0f 93 push r16 13484: 0f 94 94 9f call 0x33f28 ; 0x33f28 SERIAL_ECHO_START; 13488: 87 e7 ldi r24, 0x77 ; 119 1348a: 9e e9 ldi r25, 0x9E ; 158 1348c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(time); 13490: c8 01 movw r24, r16 13492: 0f 94 9e 99 call 0x3333c ; 0x3333c lcd_setstatus(time); 13496: c8 01 movw r24, r16 13498: 0e 94 53 ef call 0x1dea6 ; 0x1dea6 autotempShutdown(); 1349c: 0f b6 in r0, 0x3f ; 63 1349e: f8 94 cli 134a0: de bf out 0x3e, r29 ; 62 134a2: 0f be out 0x3f, r0 ; 63 134a4: cd bf out 0x3d, r28 ; 61 134a6: 0b ce rjmp .-1002 ; 0x130be } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 134a8: 17 fd sbrc r17, 7 134aa: 09 ce rjmp .-1006 ; 0x130be 134ac: b5 c8 rjmp .-3734 ; 0x12618 ### 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); 134ae: 80 e1 ldi r24, 0x10 ; 16 134b0: 0e 94 2b c6 call 0x18c56 ; 0x18c56 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 134b4: 81 ea ldi r24, 0xA1 ; 161 134b6: 9d e0 ldi r25, 0x0D ; 13 134b8: 0f 94 7d a0 call 0x340fa ; 0x340fa 134bc: 4b e0 ldi r20, 0x0B ; 11 134be: 84 9f mul r24, r20 134c0: c0 01 movw r24, r0 134c2: 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); 134c4: 70 e0 ldi r23, 0x00 ; 0 134c6: 60 e0 ldi r22, 0x00 ; 0 134c8: 80 5b subi r24, 0xB0 ; 176 134ca: 92 4f sbci r25, 0xF2 ; 242 134cc: 0f 94 bf a0 call 0x3417e ; 0x3417e // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 134d0: 82 e0 ldi r24, 0x02 ; 2 134d2: 0e 94 2b c6 call 0x18c56 ; 0x18c56 reset_bed_offset_and_skew(); 134d6: 0f 94 1c 90 call 0x32038 ; 0x32038 // 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(); 134da: 0f 94 fd 8f call 0x31ffa ; 0x31ffa 134de: ef cd rjmp .-1058 ; 0x130be */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 134e0: 8a e5 ldi r24, 0x5A ; 90 134e2: 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); 134e6: 0e 94 8d c6 call 0x18d1a ; 0x18d1a 134ea: e9 cd rjmp .-1070 ; 0x130be SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 134ec: 84 eb ldi r24, 0xB4 ; 180 134ee: 90 e8 ldi r25, 0x80 ; 128 134f0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 134f4: e4 cd rjmp .-1080 ; 0x130be } } else { SERIAL_PROTOCOLLNPGM("n/a"); 134f6: 80 eb ldi r24, 0xB0 ; 176 134f8: 90 e8 ldi r25, 0x80 ; 128 134fa: 0e 94 de 72 call 0xe5bc ; 0xe5bc 134fe: df cd rjmp .-1090 ; 0x130be /*! ### 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); 13500: 84 e0 ldi r24, 0x04 ; 4 13502: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 13506: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_consume_click(); 1350a: 0e 94 1e 6c call 0xd83c ; 0xd83c for (;;) { manage_heater(); 1350e: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 13512: 81 e0 ldi r24, 0x01 ; 1 13514: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_show_end_stops(); 13518: 0f 94 16 0a call 0x2142c ; 0x2142c if (lcd_clicked()) { 1351c: 0e 94 23 6c call 0xd846 ; 0xd846 13520: 88 23 and r24, r24 13522: a9 f3 breq .-22 ; 0x1350e break; } } lcd_clear(); 13524: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_return_to_status(); 13528: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 1352c: c8 cd rjmp .-1136 ; 0x130be 1352e: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 13532: c5 cd rjmp .-1142 ; 0x130be break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 13534: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 13538: 1f 92 push r1 1353a: 8f 93 push r24 1353c: 84 ec ldi r24, 0xC4 ; 196 1353e: 96 e6 ldi r25, 0x66 ; 102 13540: 9f 93 push r25 13542: 8f 93 push r24 13544: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13548: 0f 90 pop r0 1354a: 0f 90 pop r0 1354c: 0f 90 pop r0 1354e: 0f 90 pop r0 13550: b6 cd rjmp .-1172 ; 0x130be - `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(); 13552: 80 e5 ldi r24, 0x50 ; 80 13554: 0e 94 b6 55 call 0xab6c ; 0xab6c 13558: 88 23 and r24, r24 1355a: 21 f0 breq .+8 ; 0x13564 1355c: 0e 94 cb 55 call 0xab96 ; 0xab96 13560: 80 93 71 02 sts 0x0271, r24 ; 0x800271 if(code_seen('R')) print_time_remaining_normal = code_value(); 13564: 82 e5 ldi r24, 0x52 ; 82 13566: 0e 94 b6 55 call 0xab6c ; 0xab6c 1356a: 88 23 and r24, r24 1356c: 41 f0 breq .+16 ; 0x1357e 1356e: 0e 94 8e 5a call 0xb51c ; 0xb51c 13572: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 13576: 70 93 75 02 sts 0x0275, r23 ; 0x800275 1357a: 60 93 74 02 sts 0x0274, r22 ; 0x800274 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 1357e: 81 e5 ldi r24, 0x51 ; 81 13580: 0e 94 b6 55 call 0xab6c ; 0xab6c 13584: 88 23 and r24, r24 13586: 21 f0 breq .+8 ; 0x13590 13588: 0e 94 cb 55 call 0xab96 ; 0xab96 1358c: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 13590: 83 e5 ldi r24, 0x53 ; 83 13592: 0e 94 b6 55 call 0xab6c ; 0xab6c 13596: 88 23 and r24, r24 13598: 41 f0 breq .+16 ; 0x135aa 1359a: 0e 94 8e 5a call 0xb51c ; 0xb51c 1359e: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 135a2: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 135a6: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 135aa: 83 e4 ldi r24, 0x43 ; 67 135ac: 0e 94 b6 55 call 0xab6c ; 0xab6c 135b0: 88 23 and r24, r24 135b2: a9 f0 breq .+42 ; 0x135de float print_time_to_change_normal_f = code_value(); 135b4: 0e 94 8e 5a call 0xb51c ; 0xb51c 135b8: 6b 01 movw r12, r22 135ba: 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; 135bc: 20 e0 ldi r18, 0x00 ; 0 135be: 30 e0 ldi r19, 0x00 ; 0 135c0: a9 01 movw r20, r18 135c2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 135c6: 6f ef ldi r22, 0xFF ; 255 135c8: 7f ef ldi r23, 0xFF ; 255 135ca: 18 16 cp r1, r24 135cc: 24 f4 brge .+8 ; 0x135d6 135ce: c7 01 movw r24, r14 135d0: b6 01 movw r22, r12 135d2: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 135d6: 70 93 73 02 sts 0x0273, r23 ; 0x800273 135da: 60 93 72 02 sts 0x0272, r22 ; 0x800272 } if(code_seen('D')){ 135de: 84 e4 ldi r24, 0x44 ; 68 135e0: 0e 94 b6 55 call 0xab6c ; 0xab6c 135e4: 88 23 and r24, r24 135e6: a9 f0 breq .+42 ; 0x13612 float print_time_to_change_silent_f = code_value(); 135e8: 0e 94 8e 5a call 0xb51c ; 0xb51c 135ec: 6b 01 movw r12, r22 135ee: 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; 135f0: 20 e0 ldi r18, 0x00 ; 0 135f2: 30 e0 ldi r19, 0x00 ; 0 135f4: a9 01 movw r20, r18 135f6: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 135fa: 6f ef ldi r22, 0xFF ; 255 135fc: 7f ef ldi r23, 0xFF ; 255 135fe: 18 16 cp r1, r24 13600: 24 f4 brge .+8 ; 0x1360a 13602: c7 01 movw r24, r14 13604: b6 01 movw r22, r12 13606: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 1360a: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 1360e: 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); 13612: 80 91 73 02 lds r24, 0x0273 ; 0x800273 13616: 8f 93 push r24 13618: 80 91 72 02 lds r24, 0x0272 ; 0x800272 1361c: 8f 93 push r24 1361e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 13622: 8f 93 push r24 13624: 80 91 74 02 lds r24, 0x0274 ; 0x800274 13628: 8f 93 push r24 1362a: 80 91 71 02 lds r24, 0x0271 ; 0x800271 1362e: 28 2f mov r18, r24 13630: 08 2e mov r0, r24 13632: 00 0c add r0, r0 13634: 33 0b sbc r19, r19 13636: 3f 93 push r19 13638: 8f 93 push r24 1363a: 8a e6 ldi r24, 0x6A ; 106 1363c: 96 e6 ldi r25, 0x66 ; 102 1363e: 9f 93 push r25 13640: 8f 93 push r24 13642: 01 e7 ldi r16, 0x71 ; 113 13644: 16 e6 ldi r17, 0x66 ; 102 13646: 1f 93 push r17 13648: 0f 93 push r16 1364a: 0f 94 3f 9f call 0x33e7e ; 0x33e7e printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 1364e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 13652: 8f 93 push r24 13654: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 13658: 8f 93 push r24 1365a: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 1365e: 8f 93 push r24 13660: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 13664: 8f 93 push r24 13666: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 1366a: 28 2f mov r18, r24 1366c: 08 2e mov r0, r24 1366e: 00 0c add r0, r0 13670: 33 0b sbc r19, r19 13672: 3f 93 push r19 13674: 8f 93 push r24 13676: 83 e6 ldi r24, 0x63 ; 99 13678: 96 e6 ldi r25, 0x66 ; 102 1367a: 9f 93 push r25 1367c: 8f 93 push r24 1367e: 1f 93 push r17 13680: 0f 93 push r16 13682: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13686: 0f b6 in r0, 0x3f ; 63 13688: f8 94 cli 1368a: de bf out 0x3e, r29 ; 62 1368c: 0f be out 0x3f, r0 ; 63 1368e: cd bf out 0x3d, r28 ; 61 13690: 16 cd rjmp .-1492 ; 0x130be /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 13692: 0e 94 c2 ef call 0x1df84 ; 0x1df84 13696: 88 23 and r24, r24 13698: 09 f4 brne .+2 ; 0x1369c 1369a: 11 cd rjmp .-1502 ; 0x130be 1369c: d0 ce rjmp .-608 ; 0x1343e } else return false; } bool Stopwatch::pause() { if (isRunning()) { 1369e: 80 91 59 03 lds r24, 0x0359 ; 0x800359 136a2: 81 30 cpi r24, 0x01 ; 1 136a4: 09 f0 breq .+2 ; 0x136a8 136a6: 0b cd rjmp .-1514 ; 0x130be state = PAUSED; 136a8: 82 e0 ldi r24, 0x02 ; 2 136aa: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 136ae: 0f 94 46 0f call 0x21e8c ; 0x21e8c 136b2: 60 93 78 06 sts 0x0678, r22 ; 0x800678 136b6: 70 93 79 06 sts 0x0679, r23 ; 0x800679 136ba: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 136be: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 136c2: fd cc rjmp .-1542 ; 0x130be /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 136c4: 0f 94 4c 20 call 0x24098 ; 0x24098 save_statistics(); 136c8: 0e 94 c3 5f call 0xbf86 ; 0xbf86 136cc: f8 cc rjmp .-1552 ; 0x130be void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 136ce: 8a e5 ldi r24, 0x5A ; 90 136d0: 93 e0 ldi r25, 0x03 ; 3 136d2: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 136d6: 83 e5 ldi r24, 0x53 ; 83 136d8: 0e 94 b6 55 call 0xab6c ; 0xab6c 136dc: 88 23 and r24, r24 136de: 09 f1 breq .+66 ; 0x13722 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 136e0: 62 e2 ldi r22, 0x22 ; 34 136e2: 70 e0 ldi r23, 0x00 ; 0 136e4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 136e8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 136ec: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 136f0: 8c 01 movw r16, r24 if (!this->ptr) { 136f2: 89 2b or r24, r25 136f4: b1 f0 breq .+44 ; 0x13722 // First quote not found return; } // Skip the leading quote this->ptr++; 136f6: 0f 5f subi r16, 0xFF ; 255 136f8: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 136fa: 62 e2 ldi r22, 0x22 ; 34 136fc: 70 e0 ldi r23, 0x00 ; 0 136fe: c8 01 movw r24, r16 13700: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 if(!pStrEnd) { 13704: 89 2b or r24, r25 13706: 69 f0 breq .+26 ; 0x13722 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 13708: e2 e7 ldi r30, 0x72 ; 114 1370a: f6 e0 ldi r31, 0x06 ; 6 1370c: 83 e0 ldi r24, 0x03 ; 3 1370e: df 01 movw r26, r30 13710: 1d 92 st X+, r1 13712: 8a 95 dec r24 13714: e9 f7 brne .-6 ; 0x13710 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 13716: 42 e0 ldi r20, 0x02 ; 2 13718: 50 e0 ldi r21, 0x00 ; 0 1371a: b8 01 movw r22, r16 1371c: cf 01 movw r24, r30 1371e: 0f 94 fd a6 call 0x34dfa ; 0x34dfa } #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 13722: 8c e8 ldi r24, 0x8C ; 140 13724: 9f e0 ldi r25, 0x0F ; 15 13726: 0f 94 7d a0 call 0x340fa ; 0x340fa && printer_recovering() && printingIsPaused()) { 1372a: 81 30 cpi r24, 0x01 ; 1 1372c: 09 f0 breq .+2 ; 0x13730 1372e: c7 cc rjmp .-1650 ; 0x130be #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() 13730: 0e 94 3e 61 call 0xc27c ; 0xc27c 13734: 88 23 and r24, r24 13736: 09 f4 brne .+2 ; 0x1373a 13738: c2 cc rjmp .-1660 ; 0x130be && printingIsPaused()) { 1373a: 0e 94 48 61 call 0xc290 ; 0xc290 1373e: 88 23 and r24, r24 13740: 09 f4 brne .+2 ; 0x13744 13742: bd cc rjmp .-1670 ; 0x130be // 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); 13744: 86 e4 ldi r24, 0x46 ; 70 13746: 96 e6 ldi r25, 0x66 ; 102 13748: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1374c: b8 cc rjmp .-1680 ; 0x130be /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 1374e: 89 e2 ldi r24, 0x29 ; 41 13750: 96 e6 ldi r25, 0x66 ; 102 13752: 0e 94 6a 73 call 0xe6d4 ; 0xe6d4 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 13756: 83 e5 ldi r24, 0x53 ; 83 13758: 0e 94 b6 55 call 0xab6c ; 0xab6c 1375c: 88 23 and r24, r24 1375e: 09 f4 brne .+2 ; 0x13762 13760: ae cc rjmp .-1700 ; 0x130be 13762: 0e 94 8e 5a call 0xb51c ; 0xb51c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13766: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1376a: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 1376e: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 13772: a5 cc rjmp .-1718 ; 0x130be 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 "); 13774: 8a e9 ldi r24, 0x9A ; 154 13776: 90 e8 ldi r25, 0x80 ; 128 13778: 0e 94 e5 70 call 0xe1ca ; 0xe1ca gcode_M105(); 1377c: 0e 94 57 72 call 0xe4ae ; 0xe4ae cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 13780: 0e 94 5e 70 call 0xe0bc ; 0xe0bc cmdbuffer_front_already_processed = true; 13784: 81 e0 ldi r24, 0x01 ; 1 13786: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 1378a: 99 cc rjmp .-1742 ; 0x130be bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 1378c: 83 e5 ldi r24, 0x53 ; 83 1378e: 0e 94 b6 55 call 0xab6c ; 0xab6c 13792: 88 23 and r24, r24 13794: 51 f0 breq .+20 ; 0x137aa autoReportFeatures.SetPeriod( code_value_uint8() ); 13796: 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; 1379a: 80 93 62 13 sts 0x1362, r24 ; 0x801362 if (auto_report_period != 0){ 1379e: 88 23 and r24, r24 137a0: 71 f0 breq .+28 ; 0x137be auto_report_timer.start(); 137a2: 83 e6 ldi r24, 0x63 ; 99 137a4: 93 e1 ldi r25, 0x13 ; 19 137a6: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 137aa: 83 e4 ldi r24, 0x43 ; 67 137ac: 0e 94 b6 55 call 0xab6c ; 0xab6c 137b0: 88 23 and r24, r24 137b2: 41 f0 breq .+16 ; 0x137c4 autoReportFeatures.SetMask(code_value_uint8()); 137b4: 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; } 137b8: 80 93 61 13 sts 0x1361, r24 ; 0x801361 137bc: 80 cc rjmp .-1792 ; 0x130be 137be: 10 92 63 13 sts 0x1363, r1 ; 0x801363 137c2: f3 cf rjmp .-26 ; 0x137aa 137c4: 81 e0 ldi r24, 0x01 ; 1 137c6: 80 93 61 13 sts 0x1361, r24 ; 0x801361 137ca: 79 cc rjmp .-1806 ; 0x130be 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)); 137cc: 80 e7 ldi r24, 0x70 ; 112 137ce: 99 e4 ldi r25, 0x49 ; 73 137d0: 0e 94 3c 6d call 0xda78 ; 0xda78 137d4: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe heating_status = HeatingStatus::EXTRUDER_HEATING; 137d8: 81 e0 ldi r24, 0x01 ; 1 137da: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 137de: 0f 94 a0 98 call 0x33140 ; 0x33140 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 137e2: 83 e5 ldi r24, 0x53 ; 83 137e4: 0e 94 b6 55 call 0xab6c ; 0xab6c 137e8: 88 23 and r24, r24 137ea: 49 f0 breq .+18 ; 0x137fe setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 137ec: 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; 137f0: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 137f4: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 137f8: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 137fc: 05 c0 rjmp .+10 ; 0x13808 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 137fe: 82 e5 ldi r24, 0x52 ; 82 13800: 0e 94 b6 55 call 0xab6c ; 0xab6c 13804: 81 11 cpse r24, r1 13806: f2 cf rjmp .-28 ; 0x137ec autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 13808: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1380c: 6b 01 movw r12, r22 1380e: 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]; 13810: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 13814: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 13818: 07 2e mov r0, r23 1381a: 00 0c add r0, r0 1381c: 88 0b sbc r24, r24 1381e: 99 0b sbc r25, r25 13820: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 13824: 11 e0 ldi r17, 0x01 ; 1 13826: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 1382a: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 1382e: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 13832: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 13836: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1383a: 18 16 cp r1, r24 1383c: 0c f0 brlt .+2 ; 0x13840 1383e: 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 13840: 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 13844: c7 01 movw r24, r14 13846: b6 01 movw r22, r12 13848: 0f 94 36 4e call 0x29c6c ; 0x29c6c LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 1384c: 80 e6 ldi r24, 0x60 ; 96 1384e: 99 e4 ldi r25, 0x49 ; 73 13850: 0e 94 3c 6d call 0xda78 ; 0xda78 13854: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 13858: 82 e0 ldi r24, 0x02 ; 2 1385a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(2); 1385e: 0f 94 a0 98 call 0x33140 ; 0x33140 previous_millis_cmd.start(); 13862: 8a e4 ldi r24, 0x4A ; 74 13864: 93 e0 ldi r25, 0x03 ; 3 13866: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> 1386a: 29 cc rjmp .-1966 ; 0x130be */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 1386c: 82 e5 ldi r24, 0x52 ; 82 1386e: 99 e4 ldi r25, 0x49 ; 73 13870: 0e 94 3c 6d call 0xda78 ; 0xda78 13874: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe heating_status = HeatingStatus::BED_HEATING; 13878: 83 e0 ldi r24, 0x03 ; 3 1387a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 1387e: 81 e0 ldi r24, 0x01 ; 1 13880: 0f 94 a0 98 call 0x33140 ; 0x33140 if (code_seen('S')) 13884: 83 e5 ldi r24, 0x53 ; 83 13886: 0e 94 b6 55 call 0xab6c ; 0xab6c 1388a: 18 2f mov r17, r24 1388c: 88 23 and r24, r24 1388e: 49 f0 breq .+18 ; 0x138a2 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 13890: 0e 94 8e 5a call 0xb51c ; 0xb51c target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13894: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 13898: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 1389c: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 138a0: 05 c0 rjmp .+10 ; 0x138ac if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 138a2: 82 e5 ldi r24, 0x52 ; 82 138a4: 0e 94 b6 55 call 0xab6c ; 0xab6c 138a8: 81 11 cpse r24, r1 138aa: f2 cf rjmp .-28 ; 0x13890 { setTargetBed(code_value()); } codenum = _millis(); 138ac: 0f 94 46 0f call 0x21e8c ; 0x21e8c 138b0: 6b 01 movw r12, r22 138b2: 7c 01 movw r14, r24 cancel_heatup = false; 138b4: 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; 138b8: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138bc: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138c0: 07 2e mov r0, r23 138c2: 00 0c add r0, r0 138c4: 88 0b sbc r24, r24 138c6: 99 0b sbc r25, r25 138c8: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 138cc: 01 e0 ldi r16, 0x01 ; 1 138ce: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 138d2: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 138d6: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 138da: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 138de: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 138e2: 18 16 cp r1, r24 138e4: 0c f0 brlt .+2 ; 0x138e8 138e6: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 138e8: 00 93 c3 0d sts 0x0DC3, r16 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 138ec: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 138f0: 81 11 cpse r24, r1 138f2: 1a c0 rjmp .+52 ; 0x13928 138f4: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138f8: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138fc: 07 2e mov r0, r23 138fe: 00 0c add r0, r0 13900: 88 0b sbc r24, r24 13902: 99 0b sbc r25, r25 13904: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 13908: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 1390c: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 13910: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 13914: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 13918: e0 91 c3 0d lds r30, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> 1391c: ee 23 and r30, r30 1391e: 91 f0 breq .+36 ; 0x13944 13920: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 13924: 18 16 cp r1, r24 13926: a4 f0 brlt .+40 ; 0x13950 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 13928: 87 e4 ldi r24, 0x47 ; 71 1392a: 99 e4 ldi r25, 0x49 ; 73 1392c: 0e 94 3c 6d call 0xda78 ; 0xda78 13930: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe heating_status = HeatingStatus::BED_HEATING_COMPLETE; 13934: 84 e0 ldi r24, 0x04 ; 4 13936: 80 93 99 03 sts 0x0399, r24 ; 0x800399 previous_millis_cmd.start(); 1393a: 8a e4 ldi r24, 0x4A ; 74 1393c: 93 e0 ldi r25, 0x03 ; 3 1393e: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> 13942: bd cb rjmp .-2182 ; 0x130be codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 13944: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 13948: 87 ff sbrs r24, 7 1394a: ee cf rjmp .-36 ; 0x13928 1394c: 11 11 cpse r17, r1 1394e: ec cf rjmp .-40 ; 0x13928 { if (lcd_commands_type == LcdCommands::LongPause) { 13950: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 13954: 82 30 cpi r24, 0x02 ; 2 13956: 41 f3 breq .-48 ; 0x13928 // 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. 13958: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1395c: 6c 19 sub r22, r12 1395e: 7d 09 sbc r23, r13 13960: 8e 09 sbc r24, r14 13962: 9f 09 sbc r25, r15 13964: 69 3e cpi r22, 0xE9 ; 233 13966: 73 40 sbci r23, 0x03 ; 3 13968: 81 05 cpc r24, r1 1396a: 91 05 cpc r25, r1 1396c: 50 f0 brcs .+20 ; 0x13982 { if (!farm_mode) { 1396e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 13972: 81 11 cpse r24, r1 13974: 02 c0 rjmp .+4 ; 0x1397a serialecho_temperatures(); 13976: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 } codenum = _millis(); 1397a: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1397e: 6b 01 movw r12, r22 13980: 7c 01 movw r14, r24 } manage_heater(); 13982: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 13986: 80 e0 ldi r24, 0x00 ; 0 13988: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); 1398c: 80 e0 ldi r24, 0x00 ; 0 1398e: 0e 94 cd 69 call 0xd39a ; 0xd39a 13992: ac cf rjmp .-168 ; 0x138ec #### 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')){ 13994: 83 e5 ldi r24, 0x53 ; 83 13996: 0e 94 b6 55 call 0xab6c ; 0xab6c 1399a: 88 23 and r24, r24 1399c: 29 f0 breq .+10 ; 0x139a8 fanSpeed = code_value_uint8(); 1399e: 0e 94 cb 55 call 0xab96 ; 0xab96 139a2: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 139a6: 8b cb rjmp .-2282 ; 0x130be } else { fanSpeed = 255; 139a8: 8f ef ldi r24, 0xFF ; 255 139aa: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 139ae: 87 cb rjmp .-2290 ; 0x130be /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 139b0: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 139b4: 84 cb rjmp .-2296 ; 0x130be /*! ### 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; 139b6: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 139ba: 87 7f andi r24, 0xF7 ; 247 139bc: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 139c0: 7e cb rjmp .-2308 ; 0x130be ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 139c2: 83 e5 ldi r24, 0x53 ; 83 139c4: 0e 94 b6 55 call 0xab6c ; 0xab6c 139c8: 88 23 and r24, r24 139ca: 99 f0 breq .+38 ; 0x139f2 stepper_inactive_time = code_value() * 1000; 139cc: 0e 94 8e 5a call 0xb51c ; 0xb51c 139d0: 20 e0 ldi r18, 0x00 ; 0 139d2: 30 e0 ldi r19, 0x00 ; 0 139d4: 4a e7 ldi r20, 0x7A ; 122 139d6: 54 e4 ldi r21, 0x44 ; 68 139d8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 139dc: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 139e0: 60 93 37 02 sts 0x0237, r22 ; 0x800237 139e4: 70 93 38 02 sts 0x0238, r23 ; 0x800238 139e8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 139ec: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 139f0: 66 cb rjmp .-2356 ; 0x130be } 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]))); 139f2: 88 e5 ldi r24, 0x58 ; 88 139f4: 0e 94 b6 55 call 0xab6c ; 0xab6c 139f8: 88 23 and r24, r24 139fa: d1 f0 breq .+52 ; 0x13a30 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 139fc: 0f 94 14 22 call 0x24428 ; 0x24428 if (code_seen('X')) disable_x(); 13a00: 88 e5 ldi r24, 0x58 ; 88 13a02: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a06: 81 11 cpse r24, r1 13a08: 28 c0 rjmp .+80 ; 0x13a5a if (code_seen('Y')) disable_y(); 13a0a: 89 e5 ldi r24, 0x59 ; 89 13a0c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a10: 88 23 and r24, r24 13a12: 19 f0 breq .+6 ; 0x13a1a 13a14: 16 9a sbi 0x02, 6 ; 2 13a16: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 if (code_seen('Z')) disable_z(); 13a1a: 8a e5 ldi r24, 0x5A ; 90 13a1c: 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(); 13a20: 85 e4 ldi r24, 0x45 ; 69 13a22: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a26: 88 23 and r24, r24 13a28: 09 f4 brne .+2 ; 0x13a2c 13a2a: 49 cb rjmp .-2414 ; 0x130be 13a2c: 14 9a sbi 0x02, 4 ; 2 13a2e: 47 cb rjmp .-2418 ; 0x130be 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]))); 13a30: 89 e5 ldi r24, 0x59 ; 89 13a32: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a36: 81 11 cpse r24, r1 13a38: e1 cf rjmp .-62 ; 0x139fc 13a3a: 8a e5 ldi r24, 0x5A ; 90 13a3c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a40: 81 11 cpse r24, r1 13a42: dc cf rjmp .-72 ; 0x139fc 13a44: 85 e4 ldi r24, 0x45 ; 69 13a46: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a4a: 81 11 cpse r24, r1 13a4c: d7 cf rjmp .-82 ; 0x139fc if(all_axis) { st_synchronize(); 13a4e: 0f 94 14 22 call 0x24428 ; 0x24428 disable_e0(); 13a52: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 13a54: 0e 94 c4 74 call 0xe988 ; 0xe988 13a58: 32 cb rjmp .-2460 ; 0x130be } else { st_synchronize(); if (code_seen('X')) disable_x(); 13a5a: 17 9a sbi 0x02, 7 ; 2 13a5c: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 13a60: d4 cf rjmp .-88 ; 0x13a0a #### 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')) { 13a62: 83 e5 ldi r24, 0x53 ; 83 13a64: 0e 94 b6 55 call 0xab6c ; 0xab6c 13a68: 88 23 and r24, r24 13a6a: 09 f4 brne .+2 ; 0x13a6e 13a6c: 28 cb rjmp .-2480 ; 0x130be max_inactive_time = code_value() * 1000; 13a6e: 0e 94 8e 5a call 0xb51c ; 0xb51c 13a72: 20 e0 ldi r18, 0x00 ; 0 13a74: 30 e0 ldi r19, 0x00 ; 0 13a76: 4a e7 ldi r20, 0x7A ; 122 13a78: 54 e4 ldi r21, 0x44 ; 68 13a7a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 13a7e: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 13a82: 60 93 46 03 sts 0x0346, r22 ; 0x800346 13a86: 70 93 47 03 sts 0x0347, r23 ; 0x800347 13a8a: 80 93 48 03 sts 0x0348, r24 ; 0x800348 13a8e: 90 93 49 03 sts 0x0349, r25 ; 0x800349 13a92: 15 cb rjmp .-2518 ; 0x130be 13a94: 84 ec ldi r24, 0xC4 ; 196 13a96: 88 2e mov r8, r24 13a98: 82 e0 ldi r24, 0x02 ; 2 13a9a: 98 2e mov r9, r24 13a9c: 92 e3 ldi r25, 0x32 ; 50 13a9e: a9 2e mov r10, r25 13aa0: 94 e0 ldi r25, 0x04 ; 4 13aa2: 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++) 13aa4: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 13aa6: f4 01 movw r30, r8 13aa8: 81 91 ld r24, Z+ 13aaa: 4f 01 movw r8, r30 13aac: 0e 94 b6 55 call 0xab6c ; 0xab6c 13ab0: 88 23 and r24, r24 13ab2: 09 f4 brne .+2 ; 0x13ab6 13ab4: 65 c0 rjmp .+202 ; 0x13b80 { float value = code_value(); 13ab6: 0e 94 8e 5a call 0xb51c ; 0xb51c 13aba: 6b 01 movw r12, r22 13abc: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 13abe: 13 30 cpi r17, 0x03 ; 3 13ac0: 09 f0 breq .+2 ; 0x13ac4 13ac2: 68 c0 rjmp .+208 ; 0x13b94 if(value < 20.0) { 13ac4: 20 e0 ldi r18, 0x00 ; 0 13ac6: 30 e0 ldi r19, 0x00 ; 0 13ac8: 40 ea ldi r20, 0xA0 ; 160 13aca: 51 e4 ldi r21, 0x41 ; 65 13acc: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 13ad0: 87 ff sbrs r24, 7 13ad2: 4e c0 rjmp .+156 ; 0x13b70 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 13ad4: a7 01 movw r20, r14 13ad6: 96 01 movw r18, r12 13ad8: 60 91 42 04 lds r22, 0x0442 ; 0x800442 13adc: 70 91 43 04 lds r23, 0x0443 ; 0x800443 13ae0: 80 91 44 04 lds r24, 0x0444 ; 0x800444 13ae4: 90 91 45 04 lds r25, 0x0445 ; 0x800445 13ae8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 13aec: 2b 01 movw r4, r22 13aee: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 13af0: ac 01 movw r20, r24 13af2: 9b 01 movw r18, r22 13af4: 60 91 86 04 lds r22, 0x0486 ; 0x800486 13af8: 70 91 87 04 lds r23, 0x0487 ; 0x800487 13afc: 80 91 88 04 lds r24, 0x0488 ; 0x800488 13b00: 90 91 89 04 lds r25, 0x0489 ; 0x800489 13b04: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 13b08: 60 93 86 04 sts 0x0486, r22 ; 0x800486 13b0c: 70 93 87 04 sts 0x0487, r23 ; 0x800487 13b10: 80 93 88 04 sts 0x0488, r24 ; 0x800488 13b14: 90 93 89 04 sts 0x0489, r25 ; 0x800489 max_feedrate[E_AXIS] *= factor; 13b18: a3 01 movw r20, r6 13b1a: 92 01 movw r18, r4 13b1c: 60 91 52 04 lds r22, 0x0452 ; 0x800452 13b20: 70 91 53 04 lds r23, 0x0453 ; 0x800453 13b24: 80 91 54 04 lds r24, 0x0454 ; 0x800454 13b28: 90 91 55 04 lds r25, 0x0455 ; 0x800455 13b2c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 13b30: 60 93 52 04 sts 0x0452, r22 ; 0x800452 13b34: 70 93 53 04 sts 0x0453, r23 ; 0x800453 13b38: 80 93 54 04 sts 0x0454, r24 ; 0x800454 13b3c: 90 93 55 04 sts 0x0455, r25 ; 0x800455 max_acceleration_steps_per_s2[E_AXIS] *= factor; 13b40: 60 91 f1 16 lds r22, 0x16F1 ; 0x8016f1 13b44: 70 91 f2 16 lds r23, 0x16F2 ; 0x8016f2 13b48: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 13b4c: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 13b50: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 13b54: a3 01 movw r20, r6 13b56: 92 01 movw r18, r4 13b58: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 13b5c: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 13b60: 60 93 f1 16 sts 0x16F1, r22 ; 0x8016f1 13b64: 70 93 f2 16 sts 0x16F2, r23 ; 0x8016f2 13b68: 80 93 f3 16 sts 0x16F3, r24 ; 0x8016f3 13b6c: 90 93 f4 16 sts 0x16F4, r25 ; 0x8016f4 } cs.axis_steps_per_mm[E_AXIS] = value; 13b70: c0 92 42 04 sts 0x0442, r12 ; 0x800442 13b74: d0 92 43 04 sts 0x0443, r13 ; 0x800443 13b78: e0 92 44 04 sts 0x0444, r14 ; 0x800444 13b7c: f0 92 45 04 sts 0x0445, r15 ; 0x800445 13b80: b4 e0 ldi r27, 0x04 ; 4 13b82: ab 0e add r10, r27 13b84: b1 1c adc r11, r1 13b86: 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++) 13b88: 14 30 cpi r17, 0x04 ; 4 13b8a: 09 f0 breq .+2 ; 0x13b8e 13b8c: 8c cf rjmp .-232 ; 0x13aa6 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 13b8e: 0f 94 36 75 call 0x2ea6c ; 0x2ea6c 13b92: 95 ca rjmp .-2774 ; 0x130be 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; 13b94: d5 01 movw r26, r10 13b96: 14 96 adiw r26, 0x04 ; 4 13b98: cd 92 st X+, r12 13b9a: dd 92 st X+, r13 13b9c: ed 92 st X+, r14 13b9e: fc 92 st X, r15 13ba0: 17 97 sbiw r26, 0x07 ; 7 13ba2: ee cf rjmp .-36 ; 0x13b80 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 13ba4: 83 e5 ldi r24, 0x53 ; 83 13ba6: 0e 94 b6 55 call 0xab6c ; 0xab6c 13baa: 88 23 and r24, r24 13bac: 29 f0 breq .+10 ; 0x13bb8 host_keepalive_interval = code_value_uint8(); 13bae: 0e 94 cb 55 call 0xab96 ; 0xab96 13bb2: 80 93 32 02 sts 0x0232, r24 ; 0x800232 13bb6: 83 ca rjmp .-2810 ; 0x130be } else { SERIAL_ECHO_START; 13bb8: 87 e7 ldi r24, 0x77 ; 119 13bba: 9e e9 ldi r25, 0x9E ; 158 13bbc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 13bc0: c0 90 32 02 lds r12, 0x0232 ; 0x800232 13bc4: d1 2c mov r13, r1 13bc6: f1 2c mov r15, r1 13bc8: 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); } 13bca: 83 e9 ldi r24, 0x93 ; 147 13bcc: 90 e8 ldi r25, 0x80 ; 128 13bce: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13bd2: 4a e0 ldi r20, 0x0A ; 10 13bd4: c7 01 movw r24, r14 13bd6: b6 01 movw r22, r12 13bd8: 0f 94 cd 96 call 0x32d9a ; 0x32d9a host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 13bdc: 0f 94 9d 98 call 0x3313a ; 0x3313a 13be0: 6e ca rjmp .-2852 ; 0x130be */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 13be2: 85 e5 ldi r24, 0x55 ; 85 13be4: 0e 94 b6 55 call 0xab6c ; 0xab6c 13be8: 88 23 and r24, r24 13bea: 09 f4 brne .+2 ; 0x13bee 13bec: 5a c0 rjmp .+180 ; 0x13ca2 // 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); 13bee: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13bf2: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13bf6: 0f 5f subi r16, 0xFF ; 255 13bf8: 1f 4f sbci r17, 0xFF ; 255 13bfa: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 13bfe: 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) 13c02: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 13c06: 88 23 and r24, r24 13c08: 09 f4 brne .+2 ; 0x13c0c 13c0a: 59 ca rjmp .-2894 ; 0x130be // 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)) 13c0c: be 01 movw r22, r28 13c0e: 6f 5f subi r22, 0xFF ; 255 13c10: 7f 4f sbci r23, 0xFF ; 255 13c12: c8 01 movw r24, r16 13c14: 0e 94 11 e1 call 0x1c222 ; 0x1c222 13c18: 88 23 and r24, r24 13c1a: 09 f4 brne .+2 ; 0x13c1e 13c1c: 50 ca rjmp .-2912 ; 0x130be 13c1e: 82 e5 ldi r24, 0x52 ; 82 13c20: 97 e8 ldi r25, 0x87 ; 135 13c22: de 01 movw r26, r28 13c24: 11 96 adiw r26, 0x01 ; 1 13c26: be 01 movw r22, r28 13c28: 67 5f subi r22, 0xF7 ; 247 13c2a: 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]); 13c2c: fc 01 movw r30, r24 13c2e: 45 91 lpm r20, Z+ 13c30: 54 91 lpm r21, Z if (ver_gcode[i] > v) 13c32: 2d 91 ld r18, X+ 13c34: 3d 91 ld r19, X+ 13c36: 42 17 cp r20, r18 13c38: 53 07 cpc r21, r19 13c3a: 10 f4 brcc .+4 ; 0x13c40 13c3c: 0c 94 3c b0 jmp 0x16078 ; 0x16078 return 1; else if (ver_gcode[i] < v) 13c40: 24 17 cp r18, r20 13c42: 35 07 cpc r19, r21 13c44: 08 f4 brcc .+2 ; 0x13c48 13c46: 3b ca rjmp .-2954 ; 0x130be 13c48: 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) 13c4a: a6 17 cp r26, r22 13c4c: b7 07 cpc r27, r23 13c4e: 71 f7 brne .-36 ; 0x13c2c 13c50: 36 ca rjmp .-2964 ; 0x130be 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)); 13c52: 80 e6 ldi r24, 0x60 ; 96 13c54: 99 e3 ldi r25, 0x39 ; 57 13c56: 0e 94 3c 6d call 0xda78 ; 0xda78 13c5a: ac 01 movw r20, r24 13c5c: 63 e0 ldi r22, 0x03 ; 3 13c5e: 80 e0 ldi r24, 0x00 ; 0 13c60: 0e 94 1a 6a call 0xd434 ; 0xd434 Sound_MakeCustom(50,1000,false); 13c64: 40 e0 ldi r20, 0x00 ; 0 13c66: 68 ee ldi r22, 0xE8 ; 232 13c68: 73 e0 ldi r23, 0x03 ; 3 13c6a: 82 e3 ldi r24, 0x32 ; 50 13c6c: 90 e0 ldi r25, 0x00 ; 0 13c6e: 0f 94 61 31 call 0x262c2 ; 0x262c2 delay_keep_alive(500); 13c72: 84 ef ldi r24, 0xF4 ; 244 13c74: 91 e0 ldi r25, 0x01 ; 1 13c76: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 Sound_MakeCustom(50,1000,false); 13c7a: 40 e0 ldi r20, 0x00 ; 0 13c7c: 68 ee ldi r22, 0xE8 ; 232 13c7e: 73 e0 ldi r23, 0x03 ; 3 13c80: 82 e3 ldi r24, 0x32 ; 50 13c82: 90 e0 ldi r25, 0x00 ; 0 13c84: 0f 94 61 31 call 0x262c2 ; 0x262c2 lcd_wait_for_click_delay(30); 13c88: 8e e1 ldi r24, 0x1E ; 30 13c8a: 90 e0 ldi r25, 0x00 ; 0 13c8c: 0f 94 3d 34 call 0x2687a ; 0x2687a lcd_update_enable(true); 13c90: 81 e0 ldi r24, 0x01 ; 1 13c92: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 13c96: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_update(0); 13c9a: 80 e0 ldi r24, 0x00 ; 0 13c9c: 0e 94 cd 69 call 0xd39a ; 0xd39a 13ca0: 0e ca rjmp .-3044 ; 0x130be } 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); 13ca2: 41 e1 ldi r20, 0x11 ; 17 13ca4: 50 e0 ldi r21, 0x00 ; 0 13ca6: 60 e8 ldi r22, 0x80 ; 128 13ca8: 7c e0 ldi r23, 0x0C ; 12 13caa: ce 01 movw r24, r28 13cac: 01 96 adiw r24, 0x01 ; 1 13cae: 0f 94 6d a0 call 0x340da ; 0x340da SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 13cb2: 85 e7 ldi r24, 0x75 ; 117 13cb4: 90 e8 ldi r25, 0x80 ; 128 13cb6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(FW_VERSION_STR_P()); 13cba: 89 ed ldi r24, 0xD9 ; 217 13cbc: 9f e9 ldi r25, 0x9F ; 159 13cbe: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM("+"); 13cc2: 83 e7 ldi r24, 0x73 ; 115 13cc4: 90 e8 ldi r25, 0x80 ; 128 13cc6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(STR(FW_COMMITNR)); 13cca: 8e e6 ldi r24, 0x6E ; 110 13ccc: 90 e8 ldi r25, 0x80 ; 128 13cce: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM("_"); 13cd2: 8c e6 ldi r24, 0x6C ; 108 13cd4: 90 e8 ldi r25, 0x80 ; 128 13cd6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(FW_COMMIT_HASH); 13cda: 82 e6 ldi r24, 0x62 ; 98 13cdc: 90 e8 ldi r25, 0x80 ; 128 13cde: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 13ce2: 88 e0 ldi r24, 0x08 ; 8 13ce4: 90 e8 ldi r25, 0x80 ; 128 13ce6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(PROTOCOL_VERSION); 13cea: 84 e0 ldi r24, 0x04 ; 4 13cec: 90 e8 ldi r25, 0x80 ; 128 13cee: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(" MACHINE_TYPE:"); 13cf2: 85 ef ldi r24, 0xF5 ; 245 13cf4: 9f e7 ldi r25, 0x7F ; 127 13cf6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 13cfa: ce 01 movw r24, r28 13cfc: 01 96 adiw r24, 0x01 ; 1 13cfe: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 13d02: 83 ee ldi r24, 0xE3 ; 227 13d04: 9f e7 ldi r25, 0x7F ; 127 13d06: 0e 94 e5 70 call 0xe1ca ; 0xe1ca #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 13d0a: 82 ee ldi r24, 0xE2 ; 226 13d0c: 9f e7 ldi r25, 0x7F ; 127 13d0e: 0e 94 de 72 call 0xe5bc ; 0xe5bc } #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'); 13d12: 1f 92 push r1 13d14: 01 e3 ldi r16, 0x31 ; 49 13d16: f0 2e mov r15, r16 13d18: ff 92 push r15 13d1a: 8b e4 ldi r24, 0x4B ; 75 13d1c: 9e e7 ldi r25, 0x7E ; 126 13d1e: 9f 93 push r25 13d20: 8f 93 push r24 13d22: 04 e0 ldi r16, 0x04 ; 4 13d24: 1e e7 ldi r17, 0x7E ; 126 13d26: 1f 93 push r17 13d28: 0f 93 push r16 13d2a: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13d2e: 1f 92 push r1 13d30: ff 92 push r15 13d32: 8b e3 ldi r24, 0x3B ; 59 13d34: 9e e7 ldi r25, 0x7E ; 126 13d36: 9f 93 push r25 13d38: 8f 93 push r24 13d3a: 1f 93 push r17 13d3c: 0f 93 push r16 13d3e: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13d42: 1f 92 push r1 13d44: ff 92 push r15 13d46: 87 e2 ldi r24, 0x27 ; 39 13d48: 9e e7 ldi r25, 0x7E ; 126 13d4a: 9f 93 push r25 13d4c: 8f 93 push r24 13d4e: 1f 93 push r17 13d50: 0f 93 push r16 13d52: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13d56: 1f 92 push r1 13d58: ff 92 push r15 13d5a: 8a e1 ldi r24, 0x1A ; 26 13d5c: 9e e7 ldi r25, 0x7E ; 126 13d5e: 9f 93 push r25 13d60: 8f 93 push r24 13d62: 1f 93 push r17 13d64: 0f 93 push r16 13d66: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13d6a: 1f 92 push r1 13d6c: ff 92 push r15 13d6e: 8f e0 ldi r24, 0x0F ; 15 13d70: 9e e7 ldi r25, 0x7E ; 126 13d72: 9f 93 push r25 13d74: 8f 93 push r24 13d76: 1f 93 push r17 13d78: 0f 93 push r16 13d7a: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 13d7e: 0f b6 in r0, 0x3f ; 63 13d80: f8 94 cli 13d82: de bf out 0x3e, r29 ; 62 13d84: 0f be out 0x3f, r0 ; 63 13d86: cd bf out 0x3d, r28 ; 61 13d88: 9a c9 rjmp .-3276 ; 0x130be /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 13d8a: 0e 94 dc 71 call 0xe3b8 ; 0xe3b8 13d8e: 97 c9 rjmp .-3282 ; 0x130be /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 13d90: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 13d94: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 13d98: cf 01 movw r24, r30 13d9a: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 13d9c: 24 81 ldd r18, Z+4 ; 0x04 13d9e: 20 32 cpi r18, 0x20 ; 32 13da0: 09 f4 brne .+2 ; 0x13da4 13da2: 01 96 adiw r24, 0x01 ; 1 13da4: 0e 94 53 ef call 0x1dea6 ; 0x1dea6 custom_message_type = CustomMsg::M117; 13da8: 87 e0 ldi r24, 0x07 ; 7 13daa: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 13dae: 87 c9 rjmp .-3314 ; 0x130be - `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; 13db0: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13db4: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13db8: 0b 5f subi r16, 0xFB ; 251 13dba: 1f 4f sbci r17, 0xFF ; 255 13dbc: 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; 13dbe: f1 2c mov r15, r1 13dc0: 40 e0 ldi r20, 0x00 ; 0 13dc2: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 13dc4: e9 f0 breq .+58 ; 0x13e00 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 13dc6: d8 01 movw r26, r16 13dc8: 9c 91 ld r25, X 13dca: 29 2f mov r18, r25 13dcc: 2b 7f andi r18, 0xFB ; 251 13dce: 21 34 cpi r18, 0x41 ; 65 13dd0: b9 f4 brne .+46 ; 0x13e00 13dd2: 11 96 adiw r26, 0x01 ; 1 13dd4: 2c 91 ld r18, X 13dd6: 21 33 cpi r18, 0x31 ; 49 13dd8: 99 f4 brne .+38 ; 0x13e00 switch (p[0]) { 13dda: 91 34 cpi r25, 0x41 ; 65 13ddc: 71 f0 breq .+28 ; 0x13dfa 13dde: 95 34 cpi r25, 0x45 ; 69 13de0: 09 f4 brne .+2 ; 0x13de4 case 'A': hasA = true; break; case 'E': hasE = true; break; 13de2: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 13de4: 98 01 movw r18, r16 13de6: 2e 5f subi r18, 0xFE ; 254 13de8: 3f 4f sbci r19, 0xFF ; 255 13dea: 89 01 movw r16, r18 13dec: 2f 5f subi r18, 0xFF ; 255 13dee: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 13df0: f8 01 movw r30, r16 13df2: 90 81 ld r25, Z 13df4: 90 32 cpi r25, 0x20 ; 32 13df6: c9 f3 breq .-14 ; 0x13dea 13df8: e4 cf rjmp .-56 ; 0x13dc2 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; 13dfa: ff 24 eor r15, r15 13dfc: f3 94 inc r15 13dfe: f2 cf rjmp .-28 ; 0x13de4 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 13e00: 44 23 and r20, r20 13e02: 21 f0 breq .+8 ; 0x13e0c 13e04: 87 e7 ldi r24, 0x77 ; 119 13e06: 9e e9 ldi r25, 0x9E ; 158 13e08: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (hasA) SERIAL_ECHOPGM("//"); 13e0c: ff 20 and r15, r15 13e0e: 21 f0 breq .+8 ; 0x13e18 13e10: 8f ed ldi r24, 0xDF ; 223 13e12: 9f e7 ldi r25, 0x7F ; 127 13e14: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(p); 13e18: c8 01 movw r24, r16 13e1a: 0f 94 9e 99 call 0x3333c ; 0x3333c 13e1e: 4f c9 rjmp .-3426 ; 0x130be 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); 13e20: 89 ef ldi r24, 0xF9 ; 249 13e22: 95 e6 ldi r25, 0x65 ; 101 13e24: 0c 94 4e 94 jmp 0x1289c ; 0x1289c 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); 13e28: 89 ef ldi r24, 0xF9 ; 249 13e2a: 95 e6 ldi r25, 0x65 ; 101 13e2c: 0c 94 5c 94 jmp 0x128b8 ; 0x128b8 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); 13e30: 89 ef ldi r24, 0xF9 ; 249 13e32: 95 e6 ldi r25, 0x65 ; 101 13e34: 0c 94 6a 94 jmp 0x128d4 ; 0x128d4 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); 13e38: 89 ef ldi r24, 0xF9 ; 249 13e3a: 95 e6 ldi r25, 0x65 ; 101 13e3c: 0c 94 78 94 jmp 0x128f0 ; 0x128f0 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 13e40: 0e 94 28 60 call 0xc050 ; 0xc050 13e44: 3c c9 rjmp .-3464 ; 0x130be */ 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')) { 13e46: 84 e5 ldi r24, 0x54 ; 84 13e48: 0e 94 b6 55 call 0xab6c ; 0xab6c 13e4c: 88 23 and r24, r24 13e4e: 69 f0 breq .+26 ; 0x13e6a extruder = code_value_uint8(); 13e50: 0e 94 cb 55 call 0xab96 ; 0xab96 if(extruder >= EXTRUDERS) { 13e54: 88 23 and r24, r24 13e56: 49 f0 breq .+18 ; 0x13e6a SERIAL_ECHO_START; 13e58: 87 e7 ldi r24, 0x77 ; 119 13e5a: 9e e9 ldi r25, 0x9E ; 158 13e5c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 13e60: 8a ec ldi r24, 0xCA ; 202 13e62: 95 e6 ldi r25, 0x65 ; 101 13e64: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 13e68: 2a c9 rjmp .-3500 ; 0x130be SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 13e6a: 84 e4 ldi r24, 0x44 ; 68 13e6c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13e70: 88 23 and r24, r24 13e72: 09 f4 brne .+2 ; 0x13e76 13e74: 24 c9 rjmp .-3512 ; 0x130be float diameter = code_value(); 13e76: 0e 94 8e 5a call 0xb51c ; 0xb51c if (diameter == 0.0) { 13e7a: 20 e0 ldi r18, 0x00 ; 0 13e7c: 30 e0 ldi r19, 0x00 ; 0 13e7e: a9 01 movw r20, r18 13e80: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 13e84: 81 11 cpse r24, r1 13e86: 05 c0 rjmp .+10 ; 0x13e92 // 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; 13e88: 10 92 c9 04 sts 0x04C9, r1 ; 0x8004c9 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 13e8c: 0e 94 5d 5f call 0xbeba ; 0xbeba 13e90: 16 c9 rjmp .-3540 ; 0x130be // 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(); 13e92: 0e 94 8e 5a call 0xb51c ; 0xb51c 13e96: 6b 01 movw r12, r22 13e98: 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]); 13e9a: 20 e0 ldi r18, 0x00 ; 0 13e9c: 30 e0 ldi r19, 0x00 ; 0 13e9e: a9 01 movw r20, r18 13ea0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 13ea4: 81 11 cpse r24, r1 13ea6: 06 c0 rjmp .+12 ; 0x13eb4 13ea8: c1 2c mov r12, r1 13eaa: d1 2c mov r13, r1 13eac: 10 ee ldi r17, 0xE0 ; 224 13eae: e1 2e mov r14, r17 13eb0: 1f e3 ldi r17, 0x3F ; 63 13eb2: f1 2e mov r15, r17 13eb4: c0 92 ca 04 sts 0x04CA, r12 ; 0x8004ca 13eb8: d0 92 cb 04 sts 0x04CB, r13 ; 0x8004cb 13ebc: e0 92 cc 04 sts 0x04CC, r14 ; 0x8004cc 13ec0: 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; 13ec4: 81 e0 ldi r24, 0x01 ; 1 13ec6: 80 93 c9 04 sts 0x04C9, r24 ; 0x8004c9 13eca: e0 cf rjmp .-64 ; 0x13e8c 13ecc: 04 ec ldi r16, 0xC4 ; 196 13ece: 12 e0 ldi r17, 0x02 ; 2 13ed0: e2 e3 ldi r30, 0x32 ; 50 13ed2: ee 2e mov r14, r30 13ed4: e4 e0 ldi r30, 0x04 ; 4 13ed6: fe 2e mov r15, r30 13ed8: f8 ec ldi r31, 0xC8 ; 200 13eda: cf 2e mov r12, r31 13edc: f2 e0 ldi r31, 0x02 ; 2 13ede: 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])) 13ee0: d8 01 movw r26, r16 13ee2: 8d 91 ld r24, X+ 13ee4: 8d 01 movw r16, r26 13ee6: 0e 94 b6 55 call 0xab6c ; 0xab6c 13eea: 88 23 and r24, r24 13eec: 39 f0 breq .+14 ; 0x13efc { float val = code_value(); 13eee: 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; 13ef2: f7 01 movw r30, r14 13ef4: 64 8b std Z+20, r22 ; 0x14 13ef6: 75 8b std Z+21, r23 ; 0x15 13ef8: 86 8b std Z+22, r24 ; 0x16 13efa: 97 8b std Z+23, r25 ; 0x17 13efc: f4 e0 ldi r31, 0x04 ; 4 13efe: ef 0e add r14, r31 13f00: 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++) 13f02: c0 16 cp r12, r16 13f04: d1 06 cpc r13, r17 13f06: 61 f7 brne .-40 ; 0x13ee0 13f08: da c8 rjmp .-3660 ; 0x130be - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 13f0a: 83 e5 ldi r24, 0x53 ; 83 13f0c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f10: 88 23 and r24, r24 13f12: 19 f1 breq .+70 ; 0x13f5a // 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(); 13f14: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f18: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13f1c: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13f20: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13f24: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13f28: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f2c: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f30: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f34: 90 93 69 04 sts 0x0469, r25 ; 0x800469 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 13f38: 84 e5 ldi r24, 0x54 ; 84 13f3a: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f3e: 88 23 and r24, r24 13f40: 09 f4 brne .+2 ; 0x13f44 13f42: bd c8 rjmp .-3718 ; 0x130be cs.retract_acceleration = code_value(); 13f44: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f48: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f4c: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f50: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f54: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d 13f58: b2 c8 rjmp .-3740 ; 0x130be } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 13f5a: 80 e5 ldi r24, 0x50 ; 80 13f5c: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f60: 88 23 and r24, r24 13f62: 51 f0 breq .+20 ; 0x13f78 cs.acceleration = code_value(); 13f64: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f68: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f6c: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f70: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f74: 90 93 69 04 sts 0x0469, r25 ; 0x800469 if(code_seen('R')) 13f78: 82 e5 ldi r24, 0x52 ; 82 13f7a: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f7e: 88 23 and r24, r24 13f80: 51 f0 breq .+20 ; 0x13f96 cs.retract_acceleration = code_value(); 13f82: 0e 94 8e 5a call 0xb51c ; 0xb51c 13f86: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f8a: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f8e: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f92: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d if(code_seen('T')) 13f96: 84 e5 ldi r24, 0x54 ; 84 13f98: 0e 94 b6 55 call 0xab6c ; 0xab6c 13f9c: 88 23 and r24, r24 13f9e: 09 f4 brne .+2 ; 0x13fa2 13fa0: 8e c8 rjmp .-3812 ; 0x130be cs.travel_acceleration = code_value(); 13fa2: 0e 94 8e 5a call 0xb51c ; 0xb51c 13fa6: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13faa: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13fae: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13fb2: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13fb6: 83 c8 rjmp .-3834 ; 0x130be 13fb8: 04 ec ldi r16, 0xC4 ; 196 13fba: 12 e0 ldi r17, 0x02 ; 2 13fbc: 7a e8 ldi r23, 0x8A ; 138 13fbe: e7 2e mov r14, r23 13fc0: 74 e0 ldi r23, 0x04 ; 4 13fc2: 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(); 13fc4: d8 01 movw r26, r16 13fc6: 8d 91 ld r24, X+ 13fc8: 8d 01 movw r16, r26 13fca: 0e 94 b6 55 call 0xab6c ; 0xab6c 13fce: 88 23 and r24, r24 13fd0: 39 f0 breq .+14 ; 0x13fe0 13fd2: 0e 94 8e 5a call 0xb51c ; 0xb51c 13fd6: f7 01 movw r30, r14 13fd8: 60 83 st Z, r22 13fda: 71 83 std Z+1, r23 ; 0x01 13fdc: 82 83 std Z+2, r24 ; 0x02 13fde: 93 83 std Z+3, r25 ; 0x03 13fe0: f4 e0 ldi r31, 0x04 ; 4 13fe2: ef 0e add r14, r31 13fe4: 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++) 13fe6: 22 e0 ldi r18, 0x02 ; 2 13fe8: 07 3c cpi r16, 0xC7 ; 199 13fea: 12 07 cpc r17, r18 13fec: 59 f7 brne .-42 ; 0x13fc4 13fee: 67 c8 rjmp .-3890 ; 0x130be - `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')) 13ff0: 83 e5 ldi r24, 0x53 ; 83 13ff2: 0e 94 b6 55 call 0xab6c ; 0xab6c 13ff6: 88 23 and r24, r24 13ff8: 51 f0 breq .+20 ; 0x1400e { cs.retract_length = code_value() ; 13ffa: 0e 94 8e 5a call 0xb51c ; 0xb51c 13ffe: 60 93 b5 04 sts 0x04B5, r22 ; 0x8004b5 14002: 70 93 b6 04 sts 0x04B6, r23 ; 0x8004b6 14006: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 1400a: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 } if(code_seen('F')) 1400e: 86 e4 ldi r24, 0x46 ; 70 14010: 0e 94 b6 55 call 0xab6c ; 0xab6c 14014: 88 23 and r24, r24 14016: 61 f0 breq .+24 ; 0x14030 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 14018: 0e 94 8e 5a call 0xb51c ; 0xb51c 1401c: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 14020: 60 93 b9 04 sts 0x04B9, r22 ; 0x8004b9 14024: 70 93 ba 04 sts 0x04BA, r23 ; 0x8004ba 14028: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 1402c: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc } if(code_seen('Z')) 14030: 8a e5 ldi r24, 0x5A ; 90 14032: 0e 94 b6 55 call 0xab6c ; 0xab6c 14036: 88 23 and r24, r24 14038: 09 f4 brne .+2 ; 0x1403c 1403a: 41 c8 rjmp .-3966 ; 0x130be { cs.retract_zlift = code_value() ; 1403c: 0e 94 8e 5a call 0xb51c ; 0xb51c 14040: 60 93 bd 04 sts 0x04BD, r22 ; 0x8004bd 14044: 70 93 be 04 sts 0x04BE, r23 ; 0x8004be 14048: 80 93 bf 04 sts 0x04BF, r24 ; 0x8004bf 1404c: 90 93 c0 04 sts 0x04C0, r25 ; 0x8004c0 14050: 36 c8 rjmp .-3988 ; 0x130be #### 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')) 14052: 83 e5 ldi r24, 0x53 ; 83 14054: 0e 94 b6 55 call 0xab6c ; 0xab6c 14058: 88 23 and r24, r24 1405a: 09 f4 brne .+2 ; 0x1405e 1405c: 30 c8 rjmp .-4000 ; 0x130be { switch(code_value_uint8()) 1405e: 0e 94 cb 55 call 0xab96 ; 0xab96 14062: 88 23 and r24, r24 14064: b9 f0 breq .+46 ; 0x14094 14066: 81 30 cpi r24, 0x01 ; 1 14068: d1 f0 breq .+52 ; 0x1409e #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1406a: 87 e7 ldi r24, 0x77 ; 119 1406c: 9e e9 ldi r25, 0x9E ; 158 1406e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 14072: 87 eb ldi r24, 0xB7 ; 183 14074: 95 e6 ldi r25, 0x65 ; 101 14076: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1407a: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 1407e: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 14082: 8f 51 subi r24, 0x1F ; 31 14084: 90 4f sbci r25, 0xF0 ; 240 14086: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHOLNPGM("\"(1)"); 1408a: 8a ed ldi r24, 0xDA ; 218 1408c: 9f e7 ldi r25, 0x7F ; 127 1408e: 0e 94 de 72 call 0xe5bc ; 0xe5bc 14092: 15 c8 rjmp .-4054 ; 0x130be { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 14094: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 retracted[0]=false; 14098: 10 92 03 05 sts 0x0503, r1 ; 0x800503 1409c: 10 c8 rjmp .-4064 ; 0x130be retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 1409e: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 retracted[0]=false; 140a2: 10 92 03 05 sts 0x0503, r1 ; 0x800503 140a6: 0c 94 5f 98 jmp 0x130be ; 0x130be 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; 140aa: 40 90 f6 04 lds r4, 0x04F6 ; 0x8004f6 140ae: 50 90 f7 04 lds r5, 0x04F7 ; 0x8004f7 140b2: 60 90 f8 04 lds r6, 0x04F8 ; 0x8004f8 140b6: 70 90 f9 04 lds r7, 0x04F9 ; 0x8004f9 140ba: 0c 94 9b 95 jmp 0x12b36 ; 0x12b36 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 140be: 80 90 fa 04 lds r8, 0x04FA ; 0x8004fa 140c2: 90 90 fb 04 lds r9, 0x04FB ; 0x8004fb 140c6: a0 90 fc 04 lds r10, 0x04FC ; 0x8004fc 140ca: b0 90 fd 04 lds r11, 0x04FD ; 0x8004fd 140ce: 0c 94 a6 95 jmp 0x12b4c ; 0x12b4c - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 140d2: 82 e4 ldi r24, 0x42 ; 66 140d4: 0e 94 b6 55 call 0xab6c ; 0xab6c 140d8: 18 2f mov r17, r24 140da: 88 23 and r24, r24 140dc: 41 f0 breq .+16 ; 0x140ee { saved_feedmultiply_mm = feedmultiply; 140de: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 140e2: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 140e6: 90 93 31 02 sts 0x0231, r25 ; 0x800231 140ea: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 140ee: 83 e5 ldi r24, 0x53 ; 83 140f0: 0e 94 b6 55 call 0xab6c ; 0xab6c 140f4: 08 2f mov r16, r24 140f6: 88 23 and r24, r24 140f8: 39 f0 breq .+14 ; 0x14108 { feedmultiply = code_value_short(); 140fa: 0e 94 d8 55 call 0xabb0 ; 0xabb0 140fe: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 14102: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 14106: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 14108: 82 e5 ldi r24, 0x52 ; 82 1410a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1410e: 88 23 and r24, r24 14110: 51 f0 breq .+20 ; 0x14126 { feedmultiply = saved_feedmultiply_mm; 14112: 80 91 30 02 lds r24, 0x0230 ; 0x800230 14116: 90 91 31 02 lds r25, 0x0231 ; 0x800231 1411a: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 1411e: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 14122: 0c 94 5f 98 jmp 0x130be ; 0x130be codesWereSeen = true; } if (!codesWereSeen) 14126: 11 11 cpse r17, r1 14128: 0c 94 5f 98 jmp 0x130be ; 0x130be { printf_P(PSTR("%i%%\n"), feedmultiply); 1412c: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 14130: 8f 93 push r24 14132: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 14136: 8f 93 push r24 14138: 84 ed ldi r24, 0xD4 ; 212 1413a: 9f e7 ldi r25, 0x7F ; 127 1413c: 9f 93 push r25 1413e: 8f 93 push r24 14140: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 14144: 0f 90 pop r0 14146: 0f 90 pop r0 14148: 0f 90 pop r0 1414a: 0f 90 pop r0 1414c: 0c 94 5f 98 jmp 0x130be ; 0x130be #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 14150: 83 e5 ldi r24, 0x53 ; 83 14152: 0e 94 b6 55 call 0xab6c ; 0xab6c 14156: 88 23 and r24, r24 14158: 51 f0 breq .+20 ; 0x1416e { extrudemultiply = code_value_short(); 1415a: 0e 94 d8 55 call 0xabb0 ; 0xabb0 1415e: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a 14162: 80 93 59 02 sts 0x0259, r24 ; 0x800259 calculate_extruder_multipliers(); 14166: 0e 94 5d 5f call 0xbeba ; 0xbeba 1416a: 0c 94 5f 98 jmp 0x130be ; 0x130be } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 1416e: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 14172: 8f 93 push r24 14174: 80 91 59 02 lds r24, 0x0259 ; 0x800259 14178: 8f 93 push r24 1417a: 8e ec ldi r24, 0xCE ; 206 1417c: 9f e7 ldi r25, 0x7F ; 127 1417e: 9f 93 push r25 14180: 8f 93 push r24 14182: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 14186: 0f 90 pop r0 14188: 0f 90 pop r0 1418a: 0f 90 pop r0 1418c: 0f 90 pop r0 1418e: 0c 94 5f 98 jmp 0x130be ; 0x130be - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 14192: 80 e5 ldi r24, 0x50 ; 80 14194: 0e 94 b6 55 call 0xab6c ; 0xab6c 14198: 88 23 and r24, r24 1419a: 11 f4 brne .+4 ; 0x141a0 1419c: 0c 94 5f 98 jmp 0x130be ; 0x130be int pin_number = code_value_short(); // pin number 141a0: 0e 94 d8 55 call 0xabb0 ; 0xabb0 141a4: 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 141a6: 83 e5 ldi r24, 0x53 ; 83 141a8: 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 141ac: 0f ef ldi r16, 0xFF ; 255 141ae: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 141b0: 88 23 and r24, r24 141b2: 19 f0 breq .+6 ; 0x141ba 141b4: 0e 94 d8 55 call 0xabb0 ; 0xabb0 141b8: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 141ba: c8 01 movw r24, r16 141bc: 01 96 adiw r24, 0x01 ; 1 141be: 03 97 sbiw r24, 0x03 ; 3 141c0: 10 f0 brcs .+4 ; 0x141c6 141c2: 0c 94 5f 98 jmp 0x130be ; 0x130be 141c6: e4 ed ldi r30, 0xD4 ; 212 141c8: f0 e8 ldi r31, 0x80 ; 128 141ca: 20 ef ldi r18, 0xF0 ; 240 141cc: 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)) 141ce: 84 91 lpm r24, Z 141d0: 08 2e mov r0, r24 141d2: 00 0c add r0, r0 141d4: 99 0b sbc r25, r25 141d6: e8 16 cp r14, r24 141d8: f9 06 cpc r15, r25 141da: 11 f4 brne .+4 ; 0x141e0 141dc: 0c 94 5f 98 jmp 0x130be ; 0x130be 141e0: 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++) 141e2: 2e 17 cp r18, r30 141e4: 3f 07 cpc r19, r31 141e6: 99 f7 brne .-26 ; 0x141ce pin_number = -1; break; } } if (pin_number > -1) 141e8: f7 fe sbrs r15, 7 141ea: 02 c0 rjmp .+4 ; 0x141f0 141ec: 0c 94 5f 98 jmp 0x130be ; 0x130be { int target = LOW; st_synchronize(); 141f0: 0f 94 14 22 call 0x24428 ; 0x24428 pinMode(pin_number, INPUT); 141f4: de 2c mov r13, r14 141f6: 60 e0 ldi r22, 0x00 ; 0 141f8: 8e 2d mov r24, r14 141fa: 0e 94 3b c0 call 0x18076 ; 0x18076 switch(pin_state){ 141fe: 0f 3f cpi r16, 0xFF ; 255 14200: 10 07 cpc r17, r16 14202: b1 f0 breq .+44 ; 0x14230 14204: 01 30 cpi r16, 0x01 ; 1 14206: 11 05 cpc r17, r1 14208: 11 f0 breq .+4 ; 0x1420e } } if (pin_number > -1) { int target = LOW; 1420a: 10 e0 ldi r17, 0x00 ; 0 1420c: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 1420e: 8d 2d mov r24, r13 14210: 0e 94 e4 bf call 0x17fc8 ; 0x17fc8 14214: 80 17 cp r24, r16 14216: 91 07 cpc r25, r17 14218: 11 f4 brne .+4 ; 0x1421e 1421a: 0c 94 5f 98 jmp 0x130be ; 0x130be manage_heater(); 1421e: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 14222: 80 e0 ldi r24, 0x00 ; 0 14224: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); 14228: 80 e0 ldi r24, 0x00 ; 0 1422a: 0e 94 cd 69 call 0xd39a ; 0xd39a 1422e: ef cf rjmp .-34 ; 0x1420e case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 14230: 8e 2d mov r24, r14 14232: 0e 94 e4 bf call 0x17fc8 ; 0x17fc8 14236: 31 e0 ldi r19, 0x01 ; 1 14238: 20 e0 ldi r18, 0x00 ; 0 1423a: 89 2b or r24, r25 1423c: 09 f0 breq .+2 ; 0x14240 1423e: 30 e0 ldi r19, 0x00 ; 0 14240: 03 2f mov r16, r19 14242: 12 2f mov r17, r18 14244: e4 cf rjmp .-56 ; 0x1420e case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 14246: 70 e0 ldi r23, 0x00 ; 0 14248: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 1424a: 40 e0 ldi r20, 0x00 ; 0 1424c: c8 01 movw r24, r16 1424e: 0f 94 61 31 call 0x262c2 ; 0x262c2 14252: 0c 94 5f 98 jmp 0x130be ; 0x130be - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 14256: 80 e5 ldi r24, 0x50 ; 80 14258: 0e 94 b6 55 call 0xab6c ; 0xab6c 1425c: 88 23 and r24, r24 1425e: 51 f0 breq .+20 ; 0x14274 14260: 0e 94 8e 5a call 0xb51c ; 0xb51c 14264: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a 14268: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b 1426c: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c 14270: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 14274: 89 e4 ldi r24, 0x49 ; 73 14276: 0e 94 b6 55 call 0xab6c ; 0xab6c 1427a: 88 23 and r24, r24 1427c: 81 f0 breq .+32 ; 0x1429e 1427e: 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; 14282: 2c ea ldi r18, 0xAC ; 172 14284: 35 ec ldi r19, 0xC5 ; 197 14286: 47 e2 ldi r20, 0x27 ; 39 14288: 5e e3 ldi r21, 0x3E ; 62 1428a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1428e: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e 14292: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f 14296: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 1429a: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 1429e: 84 e4 ldi r24, 0x44 ; 68 142a0: 0e 94 b6 55 call 0xab6c ; 0xab6c 142a4: 88 23 and r24, r24 142a6: 81 f0 breq .+32 ; 0x142c8 142a8: 0e 94 8e 5a call 0xb51c ; 0xb51c } float unscalePID_i(float i) { return i/PID_dT; 142ac: 2c ea ldi r18, 0xAC ; 172 142ae: 35 ec ldi r19, 0xC5 ; 197 142b0: 47 e2 ldi r20, 0x27 ; 39 142b2: 5e e3 ldi r21, 0x3E ; 62 142b4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 142b8: 60 93 a2 04 sts 0x04A2, r22 ; 0x8004a2 142bc: 70 93 a3 04 sts 0x04A3, r23 ; 0x8004a3 142c0: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 142c4: 90 93 a5 04 sts 0x04A5, r25 ; 0x8004a5 updatePID(); 142c8: 0f 94 68 18 call 0x230d0 ; 0x230d0 SERIAL_PROTOCOLRPGM(MSG_OK); 142cc: 85 ed ldi r24, 0xD5 ; 213 142ce: 99 e6 ldi r25, 0x69 ; 105 142d0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLPGM(" p:"); 142d4: 8a ec ldi r24, 0xCA ; 202 142d6: 9f e7 ldi r25, 0x7F ; 127 142d8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 142dc: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 142e0: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 142e4: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 142e8: 90 91 9d 04 lds r25, 0x049D ; 0x80049d 142ec: 42 e0 ldi r20, 0x02 ; 2 142ee: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 142f2: 86 ec ldi r24, 0xC6 ; 198 142f4: 9f e7 ldi r25, 0x7F ; 127 142f6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 142fa: 2c ea ldi r18, 0xAC ; 172 142fc: 35 ec ldi r19, 0xC5 ; 197 142fe: 47 e2 ldi r20, 0x27 ; 39 14300: 5e e3 ldi r21, 0x3E ; 62 14302: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14306: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 1430a: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 1430e: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 14312: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 14316: 42 e0 ldi r20, 0x02 ; 2 14318: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 1431c: 82 ec ldi r24, 0xC2 ; 194 1431e: 9f e7 ldi r25, 0x7F ; 127 14320: 0e 94 e5 70 call 0xe1ca ; 0xe1ca #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 14324: 2c ea ldi r18, 0xAC ; 172 14326: 35 ec ldi r19, 0xC5 ; 197 14328: 47 e2 ldi r20, 0x27 ; 39 1432a: 5e e3 ldi r21, 0x3E ; 62 1432c: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 14330: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14334: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14338: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 1433c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 14340: 0f 94 2b 41 call 0x28256 ; 0x28256 14344: 0c 94 5f 98 jmp 0x130be ; 0x130be - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 14348: 80 e5 ldi r24, 0x50 ; 80 1434a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1434e: 88 23 and r24, r24 14350: 51 f0 breq .+20 ; 0x14366 14352: 0e 94 8e 5a call 0xb51c ; 0xb51c 14356: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 1435a: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 1435e: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 14362: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 14366: 89 e4 ldi r24, 0x49 ; 73 14368: 0e 94 b6 55 call 0xab6c ; 0xab6c 1436c: 88 23 and r24, r24 1436e: 81 f0 breq .+32 ; 0x14390 14370: 0e 94 8e 5a call 0xb51c ; 0xb51c 14374: 2c ea ldi r18, 0xAC ; 172 14376: 35 ec ldi r19, 0xC5 ; 197 14378: 47 e2 ldi r20, 0x27 ; 39 1437a: 5e e3 ldi r21, 0x3E ; 62 1437c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 14380: 60 93 aa 04 sts 0x04AA, r22 ; 0x8004aa 14384: 70 93 ab 04 sts 0x04AB, r23 ; 0x8004ab 14388: 80 93 ac 04 sts 0x04AC, r24 ; 0x8004ac 1438c: 90 93 ad 04 sts 0x04AD, r25 ; 0x8004ad if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 14390: 84 e4 ldi r24, 0x44 ; 68 14392: 0e 94 b6 55 call 0xab6c ; 0xab6c 14396: 88 23 and r24, r24 14398: 81 f0 breq .+32 ; 0x143ba 1439a: 0e 94 8e 5a call 0xb51c ; 0xb51c } float unscalePID_i(float i) { return i/PID_dT; 1439e: 2c ea ldi r18, 0xAC ; 172 143a0: 35 ec ldi r19, 0xC5 ; 197 143a2: 47 e2 ldi r20, 0x27 ; 39 143a4: 5e e3 ldi r21, 0x3E ; 62 143a6: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 143aa: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae 143ae: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af 143b2: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 143b6: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 updatePID(); 143ba: 0f 94 68 18 call 0x230d0 ; 0x230d0 SERIAL_PROTOCOLRPGM(MSG_OK); 143be: 85 ed ldi r24, 0xD5 ; 213 143c0: 99 e6 ldi r25, 0x69 ; 105 143c2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLPGM(" p:"); 143c6: 8e eb ldi r24, 0xBE ; 190 143c8: 9f e7 ldi r25, 0x7F ; 127 143ca: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 143ce: 60 91 a6 04 lds r22, 0x04A6 ; 0x8004a6 143d2: 70 91 a7 04 lds r23, 0x04A7 ; 0x8004a7 143d6: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 143da: 90 91 a9 04 lds r25, 0x04A9 ; 0x8004a9 143de: 42 e0 ldi r20, 0x02 ; 2 143e0: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 143e4: 8a eb ldi r24, 0xBA ; 186 143e6: 9f e7 ldi r25, 0x7F ; 127 143e8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 143ec: 2c ea ldi r18, 0xAC ; 172 143ee: 35 ec ldi r19, 0xC5 ; 197 143f0: 47 e2 ldi r20, 0x27 ; 39 143f2: 5e e3 ldi r21, 0x3E ; 62 143f4: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 143f8: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 143fc: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 14400: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 14404: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 14408: 42 e0 ldi r20, 0x02 ; 2 1440a: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 1440e: 86 eb ldi r24, 0xB6 ; 182 14410: 9f e7 ldi r25, 0x7F ; 127 14412: 0e 94 e5 70 call 0xe1ca ; 0xe1ca #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 14416: 2c ea ldi r18, 0xAC ; 172 14418: 35 ec ldi r19, 0xC5 ; 197 1441a: 47 e2 ldi r20, 0x27 ; 39 1441c: 5e e3 ldi r21, 0x3E ; 62 1441e: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 14422: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 14426: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 1442a: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 1442e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 14432: 0f 94 2b 41 call 0x28256 ; 0x28256 14436: 0c 94 5f 98 jmp 0x130be ; 0x130be - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 1443a: 83 e5 ldi r24, 0x53 ; 83 1443c: 0e 94 b6 55 call 0xab6c ; 0xab6c 14440: 88 23 and r24, r24 14442: 41 f0 breq .+16 ; 0x14454 14444: 0e 94 d8 55 call 0xabb0 ; 0xabb0 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 14448: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1444c: 80 93 57 02 sts 0x0257, r24 ; 0x800257 14450: 0c 94 5f 98 jmp 0x130be ; 0x130be #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 14454: 90 e0 ldi r25, 0x00 ; 0 14456: 80 e0 ldi r24, 0x00 ; 0 14458: f7 cf rjmp .-18 ; 0x14448 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 1445a: 85 e0 ldi r24, 0x05 ; 5 1445c: 90 e0 ldi r25, 0x00 ; 0 1445e: 0c 94 71 96 jmp 0x12ce2 ; 0x12ce2 M400 */ case 400: { st_synchronize(); 14462: 0f 94 14 22 call 0x24428 ; 0x24428 14466: 0c 94 5f 98 jmp 0x130be ; 0x130be */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 1446a: 81 e0 ldi r24, 0x01 ; 1 1446c: 0e 94 ab 6e call 0xdd56 ; 0xdd56 14470: 0c 94 5f 98 jmp 0x130be ; 0x130be */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 14474: 80 e0 ldi r24, 0x00 ; 0 14476: 0e 94 ab 6e call 0xdd56 ; 0xdd56 1447a: 0c 94 5f 98 jmp 0x130be ; 0x130be M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 1447e: 0e 94 c2 73 call 0xe784 ; 0xe784 14482: 0c 94 5f 98 jmp 0x130be ; 0x130be M500 */ case 500: { Config_StoreSettings(); 14486: 0e 94 e7 75 call 0xebce ; 0xebce 1448a: 0c 94 5f 98 jmp 0x130be ; 0x130be M502 */ case 502: { Config_ResetDefault(); 1448e: 0e 94 56 75 call 0xeaac ; 0xeaac 14492: 0c 94 5f 98 jmp 0x130be ; 0x130be 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( 14496: 80 91 95 04 lds r24, 0x0495 ; 0x800495 1449a: 8f 93 push r24 1449c: 80 91 94 04 lds r24, 0x0494 ; 0x800494 144a0: 8f 93 push r24 144a2: 80 91 93 04 lds r24, 0x0493 ; 0x800493 144a6: 8f 93 push r24 144a8: 80 91 92 04 lds r24, 0x0492 ; 0x800492 144ac: 8f 93 push r24 144ae: 80 91 91 04 lds r24, 0x0491 ; 0x800491 144b2: 8f 93 push r24 144b4: 80 91 90 04 lds r24, 0x0490 ; 0x800490 144b8: 8f 93 push r24 144ba: 80 91 8f 04 lds r24, 0x048F ; 0x80048f 144be: 8f 93 push r24 144c0: 80 91 8e 04 lds r24, 0x048E ; 0x80048e 144c4: 8f 93 push r24 144c6: 80 91 8d 04 lds r24, 0x048D ; 0x80048d 144ca: 8f 93 push r24 144cc: 80 91 8c 04 lds r24, 0x048C ; 0x80048c 144d0: 8f 93 push r24 144d2: 80 91 8b 04 lds r24, 0x048B ; 0x80048b 144d6: 8f 93 push r24 144d8: 80 91 8a 04 lds r24, 0x048A ; 0x80048a 144dc: 8f 93 push r24 144de: 07 e7 ldi r16, 0x77 ; 119 144e0: 1e e9 ldi r17, 0x9E ; 158 144e2: 1f 93 push r17 144e4: 0f 93 push r16 144e6: 1f 93 push r17 144e8: 0f 93 push r16 144ea: 80 91 89 04 lds r24, 0x0489 ; 0x800489 144ee: 8f 93 push r24 144f0: 80 91 88 04 lds r24, 0x0488 ; 0x800488 144f4: 8f 93 push r24 144f6: 80 91 87 04 lds r24, 0x0487 ; 0x800487 144fa: 8f 93 push r24 144fc: 80 91 86 04 lds r24, 0x0486 ; 0x800486 14500: 8f 93 push r24 14502: 80 91 85 04 lds r24, 0x0485 ; 0x800485 14506: 8f 93 push r24 14508: 80 91 84 04 lds r24, 0x0484 ; 0x800484 1450c: 8f 93 push r24 1450e: 80 91 83 04 lds r24, 0x0483 ; 0x800483 14512: 8f 93 push r24 14514: 80 91 82 04 lds r24, 0x0482 ; 0x800482 14518: 8f 93 push r24 1451a: 80 91 81 04 lds r24, 0x0481 ; 0x800481 1451e: 8f 93 push r24 14520: 80 91 80 04 lds r24, 0x0480 ; 0x800480 14524: 8f 93 push r24 14526: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 1452a: 8f 93 push r24 1452c: 80 91 7e 04 lds r24, 0x047E ; 0x80047e 14530: 8f 93 push r24 14532: 80 91 7d 04 lds r24, 0x047D ; 0x80047d 14536: 8f 93 push r24 14538: 80 91 7c 04 lds r24, 0x047C ; 0x80047c 1453c: 8f 93 push r24 1453e: 80 91 7b 04 lds r24, 0x047B ; 0x80047b 14542: 8f 93 push r24 14544: 80 91 7a 04 lds r24, 0x047A ; 0x80047a 14548: 8f 93 push r24 1454a: 80 91 79 04 lds r24, 0x0479 ; 0x800479 1454e: 8f 93 push r24 14550: 80 91 78 04 lds r24, 0x0478 ; 0x800478 14554: 8f 93 push r24 14556: 80 91 77 04 lds r24, 0x0477 ; 0x800477 1455a: 8f 93 push r24 1455c: 80 91 76 04 lds r24, 0x0476 ; 0x800476 14560: 8f 93 push r24 14562: 80 91 75 04 lds r24, 0x0475 ; 0x800475 14566: 8f 93 push r24 14568: 80 91 74 04 lds r24, 0x0474 ; 0x800474 1456c: 8f 93 push r24 1456e: 80 91 73 04 lds r24, 0x0473 ; 0x800473 14572: 8f 93 push r24 14574: 80 91 72 04 lds r24, 0x0472 ; 0x800472 14578: 8f 93 push r24 1457a: 80 91 71 04 lds r24, 0x0471 ; 0x800471 1457e: 8f 93 push r24 14580: 80 91 70 04 lds r24, 0x0470 ; 0x800470 14584: 8f 93 push r24 14586: 80 91 6f 04 lds r24, 0x046F ; 0x80046f 1458a: 8f 93 push r24 1458c: 80 91 6e 04 lds r24, 0x046E ; 0x80046e 14590: 8f 93 push r24 14592: 1f 93 push r17 14594: 0f 93 push r16 14596: 1f 93 push r17 14598: 0f 93 push r16 1459a: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 1459e: 8f 93 push r24 145a0: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 145a4: 8f 93 push r24 145a6: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 145aa: 8f 93 push r24 145ac: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 145b0: 8f 93 push r24 145b2: 80 91 6d 04 lds r24, 0x046D ; 0x80046d 145b6: 8f 93 push r24 145b8: 80 91 6c 04 lds r24, 0x046C ; 0x80046c 145bc: 8f 93 push r24 145be: 80 91 6b 04 lds r24, 0x046B ; 0x80046b 145c2: 8f 93 push r24 145c4: 80 91 6a 04 lds r24, 0x046A ; 0x80046a 145c8: 8f 93 push r24 145ca: 80 91 69 04 lds r24, 0x0469 ; 0x800469 145ce: 8f 93 push r24 145d0: 80 91 68 04 lds r24, 0x0468 ; 0x800468 145d4: 8f 93 push r24 145d6: 80 91 67 04 lds r24, 0x0467 ; 0x800467 145da: 8f 93 push r24 145dc: 80 91 66 04 lds r24, 0x0466 ; 0x800466 145e0: 8f 93 push r24 145e2: 1f 93 push r17 145e4: 0f 93 push r16 145e6: 1f 93 push r17 145e8: 0f 93 push r16 145ea: 80 91 65 04 lds r24, 0x0465 ; 0x800465 145ee: 8f 93 push r24 145f0: 80 91 64 04 lds r24, 0x0464 ; 0x800464 145f4: 8f 93 push r24 145f6: 80 91 63 04 lds r24, 0x0463 ; 0x800463 145fa: 8f 93 push r24 145fc: 80 91 62 04 lds r24, 0x0462 ; 0x800462 14600: 8f 93 push r24 14602: 80 91 61 04 lds r24, 0x0461 ; 0x800461 14606: 8f 93 push r24 14608: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1460c: 8f 93 push r24 1460e: 80 91 5f 04 lds r24, 0x045F ; 0x80045f 14612: 8f 93 push r24 14614: 80 91 5e 04 lds r24, 0x045E ; 0x80045e 14618: 8f 93 push r24 1461a: 80 91 5d 04 lds r24, 0x045D ; 0x80045d 1461e: 8f 93 push r24 14620: 80 91 5c 04 lds r24, 0x045C ; 0x80045c 14624: 8f 93 push r24 14626: 80 91 5b 04 lds r24, 0x045B ; 0x80045b 1462a: 8f 93 push r24 1462c: 80 91 5a 04 lds r24, 0x045A ; 0x80045a 14630: 8f 93 push r24 14632: 80 91 59 04 lds r24, 0x0459 ; 0x800459 14636: 8f 93 push r24 14638: 80 91 58 04 lds r24, 0x0458 ; 0x800458 1463c: 8f 93 push r24 1463e: 80 91 57 04 lds r24, 0x0457 ; 0x800457 14642: 8f 93 push r24 14644: 80 91 56 04 lds r24, 0x0456 ; 0x800456 14648: 8f 93 push r24 1464a: 1f 93 push r17 1464c: 0f 93 push r16 1464e: 1f 93 push r17 14650: 0f 93 push r16 14652: 80 91 55 04 lds r24, 0x0455 ; 0x800455 14656: 8f 93 push r24 14658: 80 91 54 04 lds r24, 0x0454 ; 0x800454 1465c: 8f 93 push r24 1465e: 80 91 53 04 lds r24, 0x0453 ; 0x800453 14662: 8f 93 push r24 14664: 80 91 52 04 lds r24, 0x0452 ; 0x800452 14668: 8f 93 push r24 1466a: 80 91 51 04 lds r24, 0x0451 ; 0x800451 1466e: 8f 93 push r24 14670: 80 91 50 04 lds r24, 0x0450 ; 0x800450 14674: 8f 93 push r24 14676: 80 91 4f 04 lds r24, 0x044F ; 0x80044f 1467a: 8f 93 push r24 1467c: 80 91 4e 04 lds r24, 0x044E ; 0x80044e 14680: 8f 93 push r24 14682: 80 91 4d 04 lds r24, 0x044D ; 0x80044d 14686: 8f 93 push r24 14688: 80 91 4c 04 lds r24, 0x044C ; 0x80044c 1468c: 8f 93 push r24 1468e: 80 91 4b 04 lds r24, 0x044B ; 0x80044b 14692: 8f 93 push r24 14694: 80 91 4a 04 lds r24, 0x044A ; 0x80044a 14698: 8f 93 push r24 1469a: 80 91 49 04 lds r24, 0x0449 ; 0x800449 1469e: 8f 93 push r24 146a0: 80 91 48 04 lds r24, 0x0448 ; 0x800448 146a4: 8f 93 push r24 146a6: 80 91 47 04 lds r24, 0x0447 ; 0x800447 146aa: 8f 93 push r24 146ac: 80 91 46 04 lds r24, 0x0446 ; 0x800446 146b0: 8f 93 push r24 146b2: 1f 93 push r17 146b4: 0f 93 push r16 146b6: 1f 93 push r17 146b8: 0f 93 push r16 146ba: 80 91 45 04 lds r24, 0x0445 ; 0x800445 146be: 8f 93 push r24 146c0: 80 91 44 04 lds r24, 0x0444 ; 0x800444 146c4: 8f 93 push r24 146c6: 80 91 43 04 lds r24, 0x0443 ; 0x800443 146ca: 8f 93 push r24 146cc: 80 91 42 04 lds r24, 0x0442 ; 0x800442 146d0: 8f 93 push r24 146d2: 80 91 41 04 lds r24, 0x0441 ; 0x800441 146d6: 8f 93 push r24 146d8: 80 91 40 04 lds r24, 0x0440 ; 0x800440 146dc: 8f 93 push r24 146de: 80 91 3f 04 lds r24, 0x043F ; 0x80043f 146e2: 8f 93 push r24 146e4: 80 91 3e 04 lds r24, 0x043E ; 0x80043e 146e8: 8f 93 push r24 146ea: 80 91 3d 04 lds r24, 0x043D ; 0x80043d 146ee: 8f 93 push r24 146f0: 80 91 3c 04 lds r24, 0x043C ; 0x80043c 146f4: 8f 93 push r24 146f6: 80 91 3b 04 lds r24, 0x043B ; 0x80043b 146fa: 8f 93 push r24 146fc: 80 91 3a 04 lds r24, 0x043A ; 0x80043a 14700: 8f 93 push r24 14702: 80 91 39 04 lds r24, 0x0439 ; 0x800439 14706: 8f 93 push r24 14708: 80 91 38 04 lds r24, 0x0438 ; 0x800438 1470c: 8f 93 push r24 1470e: 80 91 37 04 lds r24, 0x0437 ; 0x800437 14712: 8f 93 push r24 14714: 80 91 36 04 lds r24, 0x0436 ; 0x800436 14718: 8f 93 push r24 1471a: 1f 93 push r17 1471c: 0f 93 push r16 1471e: 1f 93 push r17 14720: 0f 93 push r16 14722: 89 ef ldi r24, 0xF9 ; 249 14724: 9b e7 ldi r25, 0x7B ; 123 14726: 9f 93 push r25 14728: 8f 93 push r24 1472a: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 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"), 1472e: 0f b6 in r0, 0x3f ; 63 14730: f8 94 cli 14732: de bf out 0x3e, r29 ; 62 14734: 0f be out 0x3f, r0 ; 63 14736: cd bf out 0x3d, r28 ; 61 14738: 2c ea ldi r18, 0xAC ; 172 1473a: 35 ec ldi r19, 0xC5 ; 197 1473c: 47 e2 ldi r20, 0x27 ; 39 1473e: 5e e3 ldi r21, 0x3E ; 62 14740: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 14744: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14748: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 1474c: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 14750: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 14754: 9f 93 push r25 14756: 8f 93 push r24 14758: 7f 93 push r23 1475a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1475c: 2c ea ldi r18, 0xAC ; 172 1475e: 35 ec ldi r19, 0xC5 ; 197 14760: 47 e2 ldi r20, 0x27 ; 39 14762: 5e e3 ldi r21, 0x3E ; 62 14764: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14768: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 1476c: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 14770: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 14774: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 14778: 9f 93 push r25 1477a: 8f 93 push r24 1477c: 7f 93 push r23 1477e: 6f 93 push r22 14780: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 14784: 8f 93 push r24 14786: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 1478a: 8f 93 push r24 1478c: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 14790: 8f 93 push r24 14792: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 14796: 8f 93 push r24 14798: 1f 93 push r17 1479a: 0f 93 push r16 1479c: 1f 93 push r17 1479e: 0f 93 push r16 147a0: 8c ec ldi r24, 0xCC ; 204 147a2: 9b e7 ldi r25, 0x7B ; 123 147a4: 9f 93 push r25 147a6: 8f 93 push r24 147a8: 0f 94 3f 9f call 0x33e7e ; 0x33e7e #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 147ac: 2c ea ldi r18, 0xAC ; 172 147ae: 35 ec ldi r19, 0xC5 ; 197 147b0: 47 e2 ldi r20, 0x27 ; 39 147b2: 5e e3 ldi r21, 0x3E ; 62 147b4: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 147b8: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 147bc: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 147c0: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 147c4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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"), 147c8: 9f 93 push r25 147ca: 8f 93 push r24 147cc: 7f 93 push r23 147ce: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 147d0: 2c ea ldi r18, 0xAC ; 172 147d2: 35 ec ldi r19, 0xC5 ; 197 147d4: 47 e2 ldi r20, 0x27 ; 39 147d6: 5e e3 ldi r21, 0x3E ; 62 147d8: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 147dc: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 147e0: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 147e4: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 147e8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 147ec: 9f 93 push r25 147ee: 8f 93 push r24 147f0: 7f 93 push r23 147f2: 6f 93 push r22 147f4: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 147f8: 8f 93 push r24 147fa: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 147fe: 8f 93 push r24 14800: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 14804: 8f 93 push r24 14806: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 1480a: 8f 93 push r24 1480c: 1f 93 push r17 1480e: 0f 93 push r16 14810: 1f 93 push r17 14812: 0f 93 push r16 14814: 87 e9 ldi r24, 0x97 ; 151 14816: 9b e7 ldi r25, 0x7B ; 123 14818: 9f 93 push r25 1481a: 8f 93 push r24 1481c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 14820: 0f b6 in r0, 0x3f ; 63 14822: f8 94 cli 14824: de bf out 0x3e, r29 ; 62 14826: 0f be out 0x3f, r0 ; 63 14828: cd bf out 0x3d, r28 ; 61 1482a: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 1482e: 1f 92 push r1 14830: 8f 93 push r24 14832: 1f 93 push r17 14834: 0f 93 push r16 14836: 1f 93 push r17 14838: 0f 93 push r16 1483a: 20 e0 ldi r18, 0x00 ; 0 1483c: 30 e0 ldi r19, 0x00 ; 0 1483e: 40 e7 ldi r20, 0x70 ; 112 14840: 52 e4 ldi r21, 0x42 ; 66 14842: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 14846: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 1484a: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 1484e: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 14852: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 14856: 9f 93 push r25 14858: 8f 93 push r24 1485a: 7f 93 push r23 1485c: 6f 93 push r22 1485e: 80 91 c4 04 lds r24, 0x04C4 ; 0x8004c4 14862: 8f 93 push r24 14864: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 14868: 8f 93 push r24 1486a: 80 91 c2 04 lds r24, 0x04C2 ; 0x8004c2 1486e: 8f 93 push r24 14870: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 14874: 8f 93 push r24 14876: 1f 93 push r17 14878: 0f 93 push r16 1487a: 1f 93 push r17 1487c: 0f 93 push r16 1487e: 80 91 c0 04 lds r24, 0x04C0 ; 0x8004c0 14882: 8f 93 push r24 14884: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 14888: 8f 93 push r24 1488a: 80 91 be 04 lds r24, 0x04BE ; 0x8004be 1488e: 8f 93 push r24 14890: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd 14894: 8f 93 push r24 14896: 20 e0 ldi r18, 0x00 ; 0 14898: 30 e0 ldi r19, 0x00 ; 0 1489a: 40 e7 ldi r20, 0x70 ; 112 1489c: 52 e4 ldi r21, 0x42 ; 66 1489e: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 148a2: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 148a6: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 148aa: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 148ae: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 148b2: 9f 93 push r25 148b4: 8f 93 push r24 148b6: 7f 93 push r23 148b8: 6f 93 push r22 148ba: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 148be: 8f 93 push r24 148c0: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 148c4: 8f 93 push r24 148c6: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 148ca: 8f 93 push r24 148cc: 80 91 b5 04 lds r24, 0x04B5 ; 0x8004b5 148d0: 8f 93 push r24 148d2: 1f 93 push r17 148d4: 0f 93 push r16 148d6: 1f 93 push r17 148d8: 0f 93 push r16 148da: 86 e9 ldi r24, 0x96 ; 150 148dc: 9a e7 ldi r25, 0x7A ; 122 148de: 9f 93 push r25 148e0: 8f 93 push r24 148e2: 0f 94 3f 9f call 0x33e7e ; 0x33e7e ); #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) { 148e6: 0f b6 in r0, 0x3f ; 63 148e8: f8 94 cli 148ea: de bf out 0x3e, r29 ; 62 148ec: 0f be out 0x3f, r0 ; 63 148ee: cd bf out 0x3d, r28 ; 61 148f0: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 148f4: 88 23 and r24, r24 148f6: 09 f4 brne .+2 ; 0x148fa 148f8: 56 c0 rjmp .+172 ; 0x149a6 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 148fa: 80 91 cd 04 lds r24, 0x04CD ; 0x8004cd 148fe: 8f 93 push r24 14900: 80 91 cc 04 lds r24, 0x04CC ; 0x8004cc 14904: 8f 93 push r24 14906: 80 91 cb 04 lds r24, 0x04CB ; 0x8004cb 1490a: 8f 93 push r24 1490c: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca 14910: 8f 93 push r24 14912: 1f 93 push r17 14914: 0f 93 push r16 14916: 1f 93 push r17 14918: 0f 93 push r16 1491a: 80 e7 ldi r24, 0x70 ; 112 1491c: 9a e7 ldi r25, 0x7A ; 122 1491e: 9f 93 push r25 14920: 8f 93 push r24 14922: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 14926: 0f b6 in r0, 0x3f ; 63 14928: f8 94 cli 1492a: de bf out 0x3e, r29 ; 62 1492c: 0f be out 0x3f, r0 ; 63 1492e: 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( 14930: 80 91 02 05 lds r24, 0x0502 ; 0x800502 14934: 8f 93 push r24 14936: 80 91 01 05 lds r24, 0x0501 ; 0x800501 1493a: 8f 93 push r24 1493c: 80 91 00 05 lds r24, 0x0500 ; 0x800500 14940: 8f 93 push r24 14942: 80 91 ff 04 lds r24, 0x04FF ; 0x8004ff 14946: 8f 93 push r24 14948: 80 91 fe 04 lds r24, 0x04FE ; 0x8004fe 1494c: 1f 92 push r1 1494e: 8f 93 push r24 14950: 80 91 fd 04 lds r24, 0x04FD ; 0x8004fd 14954: 8f 93 push r24 14956: 80 91 fc 04 lds r24, 0x04FC ; 0x8004fc 1495a: 8f 93 push r24 1495c: 80 91 fb 04 lds r24, 0x04FB ; 0x8004fb 14960: 8f 93 push r24 14962: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 14966: 8f 93 push r24 14968: 80 91 f9 04 lds r24, 0x04F9 ; 0x8004f9 1496c: 8f 93 push r24 1496e: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 14972: 8f 93 push r24 14974: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 14978: 8f 93 push r24 1497a: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 1497e: 8f 93 push r24 14980: 87 e7 ldi r24, 0x77 ; 119 14982: 9e e9 ldi r25, 0x9E ; 158 14984: 9f 93 push r25 14986: 8f 93 push r24 14988: 9f 93 push r25 1498a: 8f 93 push r24 1498c: 8f ec ldi r24, 0xCF ; 207 1498e: 99 e7 ldi r25, 0x79 ; 121 14990: 9f 93 push r25 14992: 8f 93 push r24 14994: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 14998: 0f b6 in r0, 0x3f ; 63 1499a: f8 94 cli 1499c: de bf out 0x3e, r29 ; 62 1499e: 0f be out 0x3f, r0 ; 63 149a0: cd bf out 0x3d, r28 ; 61 149a2: 0c 94 5f 98 jmp 0x130be ; 0x130be 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); 149a6: 1f 93 push r17 149a8: 0f 93 push r16 149aa: 81 e5 ldi r24, 0x51 ; 81 149ac: 9a e7 ldi r25, 0x7A ; 122 149ae: 9f 93 push r25 149b0: 8f 93 push r24 149b2: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 149b6: 0f 90 pop r0 149b8: 0f 90 pop r0 149ba: 0f 90 pop r0 149bc: 0f 90 pop r0 149be: b8 cf rjmp .-144 ; 0x14930 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 149c0: 80 e5 ldi r24, 0x50 ; 80 149c2: 0e 94 b6 55 call 0xab6c ; 0xab6c 149c6: 88 23 and r24, r24 149c8: 11 f4 brne .+4 ; 0x149ce 149ca: 0c 94 5f 98 jmp 0x130be ; 0x130be { uint8_t valCnt = 0; IP_address = 0; 149ce: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 149d2: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 149d6: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 149da: 10 92 80 06 sts 0x0680, r1 ; 0x800680 149de: 0d e7 ldi r16, 0x7D ; 125 149e0: 16 e0 ldi r17, 0x06 ; 6 149e2: 31 e8 ldi r19, 0x81 ; 129 149e4: e3 2e mov r14, r19 149e6: 36 e0 ldi r19, 0x06 ; 6 149e8: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 149ea: 4a e2 ldi r20, 0x2A ; 42 149ec: d4 2e mov r13, r20 149ee: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 149f2: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 149f6: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 149f8: 0e 94 d8 55 call 0xabb0 ; 0xabb0 149fc: d8 01 movw r26, r16 149fe: 8d 93 st X+, r24 14a00: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 14a02: ea 16 cp r14, r26 14a04: fb 06 cpc r15, r27 14a06: 11 f4 brne .+4 ; 0x14a0c 14a08: 0c 94 5f 98 jmp 0x130be ; 0x130be 14a0c: 8e e2 ldi r24, 0x2E ; 46 14a0e: 0e 94 b6 55 call 0xab6c ; 0xab6c 14a12: 81 11 cpse r24, r1 14a14: ec cf rjmp .-40 ; 0x149ee if (valCnt != 4) IP_address = 0; 14a16: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 14a1a: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 14a1e: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 14a22: 10 92 80 06 sts 0x0680, r1 ; 0x800680 14a26: 0c 94 5f 98 jmp 0x130be ; 0x130be - `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(); 14a2a: 0f 94 14 22 call 0x24428 ; 0x24428 /// 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; 14a2e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 14a32: 81 11 cpse r24, r1 14a34: 02 c0 rjmp .+4 ; 0x14a3a 14a36: 0e 94 b9 5e call 0xbd72 ; 0xbd72 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(); 14a3a: 85 e4 ldi r24, 0x45 ; 69 14a3c: 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; 14a40: 81 2c mov r8, r1 14a42: 91 2c mov r9, r1 14a44: a1 2c mov r10, r1 14a46: 20 ec ldi r18, 0xC0 ; 192 14a48: 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(); 14a4a: 88 23 and r24, r24 14a4c: 21 f0 breq .+8 ; 0x14a56 14a4e: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a52: 4b 01 movw r8, r22 14a54: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 14a56: 8c e4 ldi r24, 0x4C ; 76 14a58: 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; 14a5c: c1 2c mov r12, r1 14a5e: d1 2c mov r13, r1 14a60: 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(); 14a62: 88 23 and r24, r24 14a64: 21 f0 breq .+8 ; 0x14a6e 14a66: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a6a: 6b 01 movw r12, r22 14a6c: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 14a6e: 8a e5 ldi r24, 0x5A ; 90 14a70: 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; 14a74: 41 2c mov r4, r1 14a76: 51 2c mov r5, r1 14a78: 98 ed ldi r25, 0xD8 ; 216 14a7a: 69 2e mov r6, r25 14a7c: 91 e4 ldi r25, 0x41 ; 65 14a7e: 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()); 14a80: 88 23 and r24, r24 14a82: 31 f0 breq .+12 ; 0x14a90 14a84: 0e 94 8e 5a call 0xb51c ; 0xb51c 14a88: 2b 01 movw r4, r22 14a8a: 3c 01 movw r6, r24 14a8c: e8 94 clt 14a8e: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 14a90: 88 e5 ldi r24, 0x58 ; 88 14a92: 0e 94 b6 55 call 0xab6c ; 0xab6c 14a96: 88 23 and r24, r24 14a98: 09 f4 brne .+2 ; 0x14a9c 14a9a: b5 c1 rjmp .+874 ; 0x14e06 14a9c: 0e 94 8e 5a call 0xb51c ; 0xb51c 14aa0: 68 a7 std Y+40, r22 ; 0x28 14aa2: 79 a7 std Y+41, r23 ; 0x29 14aa4: 8a a7 std Y+42, r24 ; 0x2a 14aa6: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 14aa8: 89 e5 ldi r24, 0x59 ; 89 14aaa: 0e 94 b6 55 call 0xab6c ; 0xab6c 14aae: 88 23 and r24, r24 14ab0: 09 f4 brne .+2 ; 0x14ab4 14ab2: b2 c1 rjmp .+868 ; 0x14e18 14ab4: 0e 94 8e 5a call 0xb51c ; 0xb51c 14ab8: 6c a7 std Y+44, r22 ; 0x2c 14aba: 7d a7 std Y+45, r23 ; 0x2d 14abc: 8e a7 std Y+46, r24 ; 0x2e 14abe: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 14ac0: 1a 82 std Y+2, r1 ; 0x02 14ac2: 19 82 std Y+1, r1 ; 0x01 14ac4: fe 01 movw r30, r28 14ac6: 33 96 adiw r30, 0x03 ; 3 14ac8: 83 e1 ldi r24, 0x13 ; 19 14aca: df 01 movw r26, r30 14acc: 1d 92 st X+, r1 14ace: 8a 95 dec r24 14ad0: e9 f7 brne .-6 ; 0x14acc if (code_seen('C')) { 14ad2: 83 e4 ldi r24, 0x43 ; 67 14ad4: 0e 94 b6 55 call 0xab6c ; 0xab6c 14ad8: 88 23 and r24, r24 14ada: f9 f0 breq .+62 ; 0x14b1a , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14adc: 62 e2 ldi r22, 0x22 ; 34 14ade: 70 e0 ldi r23, 0x00 ; 0 14ae0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 14ae4: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 14ae8: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 14aec: 8c 01 movw r16, r24 if (!this->ptr) { 14aee: 89 2b or r24, r25 14af0: a1 f0 breq .+40 ; 0x14b1a // First quote not found return; } // Skip the leading quote this->ptr++; 14af2: 0f 5f subi r16, 0xFF ; 255 14af4: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14af6: 62 e2 ldi r22, 0x22 ; 34 14af8: 70 e0 ldi r23, 0x00 ; 0 14afa: c8 01 movw r24, r16 14afc: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 if(!pStrEnd) { 14b00: 00 97 sbiw r24, 0x00 ; 0 14b02: 59 f0 breq .+22 ; 0x14b1a // Second quote not found return; } this->len = pStrEnd - this->ptr; 14b04: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 14b06: 84 31 cpi r24, 0x14 ; 20 14b08: 08 f0 brcs .+2 ; 0x14b0c 14b0a: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 14b0c: 48 2f mov r20, r24 14b0e: 50 e0 ldi r21, 0x00 ; 0 14b10: b8 01 movw r22, r16 14b12: ce 01 movw r24, r28 14b14: 01 96 adiw r24, 0x01 ; 1 14b16: 0f 94 a6 a6 call 0x34d4c ; 0x34d4c } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 14b1a: 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; 14b1e: 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"))) 14b20: 81 30 cpi r24, 0x01 ; 1 14b22: 29 f4 brne .+10 ; 0x14b2e 14b24: 81 ea ldi r24, 0xA1 ; 161 14b26: 9f e7 ldi r25, 0x7F ; 127 14b28: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 14b2c: 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(); 14b2e: 0f 94 14 22 call 0x24428 ; 0x24428 // 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); 14b32: 86 e1 ldi r24, 0x16 ; 22 14b34: 0f 94 a0 98 call 0x33140 ; 0x33140 // Turn off the fan fanSpeed = 0; 14b38: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 // Retract E if (!printingIsPaused()) 14b3c: 0e 94 48 61 call 0xc290 ; 0xc290 14b40: 81 11 cpse r24, r1 14b42: 6f c1 rjmp .+734 ; 0x14e22 { current_position[E_AXIS] += e_shift; 14b44: a5 01 movw r20, r10 14b46: 94 01 movw r18, r8 14b48: 60 91 01 12 lds r22, 0x1201 ; 0x801201 14b4c: 70 91 02 12 lds r23, 0x1202 ; 0x801202 14b50: 80 91 03 12 lds r24, 0x1203 ; 0x801203 14b54: 90 91 04 12 lds r25, 0x1204 ; 0x801204 14b58: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 14b5c: 60 93 01 12 sts 0x1201, r22 ; 0x801201 14b60: 70 93 02 12 sts 0x1202, r23 ; 0x801202 14b64: 80 93 03 12 sts 0x1203, r24 ; 0x801203 14b68: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 14b6c: 60 e0 ldi r22, 0x00 ; 0 14b6e: 70 e0 ldi r23, 0x00 ; 0 14b70: 88 ee ldi r24, 0xE8 ; 232 14b72: 92 e4 ldi r25, 0x42 ; 66 14b74: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 14b78: 0f 94 14 22 call 0x24428 ; 0x24428 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 14b7c: 8a ed ldi r24, 0xDA ; 218 14b7e: 9a e6 ldi r25, 0x6A ; 106 14b80: 0e 94 de 72 call 0xe5bc ; 0xe5bc // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 14b84: c3 01 movw r24, r6 14b86: b2 01 movw r22, r4 14b88: 0e 94 68 67 call 0xced0 ; 0xced0 // Move XY to side current_position[X_AXIS] = x_position; 14b8c: 28 a5 ldd r18, Y+40 ; 0x28 14b8e: 39 a5 ldd r19, Y+41 ; 0x29 14b90: 4a a5 ldd r20, Y+42 ; 0x2a 14b92: 5b a5 ldd r21, Y+43 ; 0x2b 14b94: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 14b98: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 14b9c: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 14ba0: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = y_position; 14ba4: 8c a5 ldd r24, Y+44 ; 0x2c 14ba6: 9d a5 ldd r25, Y+45 ; 0x2d 14ba8: ae a5 ldd r26, Y+46 ; 0x2e 14baa: bf a5 ldd r27, Y+47 ; 0x2f 14bac: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 14bb0: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 14bb4: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 14bb8: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14bbc: 60 e0 ldi r22, 0x00 ; 0 14bbe: 70 e0 ldi r23, 0x00 ; 0 14bc0: 88 e4 ldi r24, 0x48 ; 72 14bc2: 92 e4 ldi r25, 0x42 ; 66 14bc4: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 14bc8: 0f 94 14 22 call 0x24428 ; 0x24428 bool repeat = false; 14bcc: 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; 14bce: 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)); 14bd0: 0b eb ldi r16, 0xBB ; 187 14bd2: 20 2e mov r2, r16 14bd4: 09 e7 ldi r16, 0x79 ; 121 14bd6: 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)); 14bd8: 83 ec ldi r24, 0xC3 ; 195 14bda: 88 2e mov r8, r24 14bdc: 89 e7 ldi r24, 0x79 ; 121 14bde: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 14be0: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14be4: 81 30 cpi r24, 0x01 ; 1 14be6: 09 f0 breq .+2 ; 0x14bea 14be8: 1f c1 rjmp .+574 ; 0x14e28 eject_slot = MMU2::mmu2.get_current_tool(); 14bea: 0f 94 30 41 call 0x28260 ; 0x28260 14bee: a8 2e mov r10, r24 mmu_M600_unload_filament(); 14bf0: 0e 94 a7 6d call 0xdb4e ; 0xdb4e } 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 14bf4: 0f 94 14 22 call 0x24428 ; 0x24428 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 14bf8: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 14bfc: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 14c00: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14c04: 81 30 cpi r24, 0x01 ; 1 14c06: 09 f4 brne .+2 ; 0x14c0a 14c08: d9 c1 rjmp .+946 ; 0x14fbc { KEEPALIVE_STATE(PAUSED_FOR_USER); 14c0a: 84 e0 ldi r24, 0x04 ; 4 14c0c: 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); 14c10: 8e e3 ldi r24, 0x3E ; 62 14c12: 99 e3 ldi r25, 0x39 ; 57 14c14: 0e 94 3c 6d call 0xda78 ; 0xda78 14c18: 40 e0 ldi r20, 0x00 ; 0 14c1a: 60 e0 ldi r22, 0x00 ; 0 14c1c: 0f 94 89 2d call 0x25b12 ; 0x25b12 14c20: 08 2f mov r16, r24 lcd_update_enable(false); 14c22: 80 e0 ldi r24, 0x00 ; 0 14c24: 0e 94 4b 6a call 0xd496 ; 0xd496 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 14c28: 01 30 cpi r16, 0x01 ; 1 14c2a: 29 f5 brne .+74 ; 0x14c76 lcd_clear(); 14c2c: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 14c30: 86 eb ldi r24, 0xB6 ; 182 14c32: 99 e3 ldi r25, 0x39 ; 57 14c34: 0e 94 3c 6d call 0xda78 ; 0xda78 14c38: ac 01 movw r20, r24 14c3a: 62 e0 ldi r22, 0x02 ; 2 14c3c: 80 e0 ldi r24, 0x00 ; 0 14c3e: 0e 94 1a 6a call 0xd434 ; 0xd434 current_position[X_AXIS] = 100; 14c42: 80 e0 ldi r24, 0x00 ; 0 14c44: 90 e0 ldi r25, 0x00 ; 0 14c46: a8 ec ldi r26, 0xC8 ; 200 14c48: b2 e4 ldi r27, 0x42 ; 66 14c4a: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 14c4e: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 14c52: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 14c56: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14c5a: 60 e0 ldi r22, 0x00 ; 0 14c5c: 70 e0 ldi r23, 0x00 ; 0 14c5e: 88 e4 ldi r24, 0x48 ; 72 14c60: 92 e4 ldi r25, 0x42 ; 66 14c62: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 14c66: 0f 94 14 22 call 0x24428 ; 0x24428 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 14c6a: 8c e0 ldi r24, 0x0C ; 12 14c6c: 99 e3 ldi r25, 0x39 ; 57 14c6e: 0e 94 3c 6d call 0xda78 ; 0xda78 14c72: 0f 94 19 0b call 0x21632 ; 0x21632 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 14c76: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 14c7a: 8a e9 ldi r24, 0x9A ; 154 14c7c: 98 e3 ldi r25, 0x38 ; 56 14c7e: 0e 94 3c 6d call 0xda78 ; 0xda78 14c82: ac 01 movw r20, r24 14c84: 60 e0 ldi r22, 0x00 ; 0 14c86: 80 e0 ldi r24, 0x00 ; 0 14c88: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(0, 1); 14c8c: 61 e0 ldi r22, 0x01 ; 1 14c8e: 80 e0 ldi r24, 0x00 ; 0 14c90: 0e 94 06 6a call 0xd40c ; 0xd40c if (filament_name[0]) { 14c94: 89 81 ldd r24, Y+1 ; 0x01 14c96: 88 23 and r24, r24 14c98: 41 f0 breq .+16 ; 0x14caa lcd_print(filament_name); 14c9a: ce 01 movw r24, r28 14c9c: 01 96 adiw r24, 0x01 ; 1 14c9e: 0e 94 0d 6c call 0xd81a ; 0xd81a lcd_set_cursor(0, 2); 14ca2: 62 e0 ldi r22, 0x02 ; 2 14ca4: 80 e0 ldi r24, 0x00 ; 0 14ca6: 0e 94 06 6a call 0xd40c ; 0xd40c } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 14caa: 80 91 85 16 lds r24, 0x1685 ; 0x801685 14cae: 81 11 cpse r24, r1 14cb0: 06 c0 rjmp .+12 ; 0x14cbe #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 14cb2: 85 e8 ldi r24, 0x85 ; 133 14cb4: 98 e3 ldi r25, 0x38 ; 56 14cb6: 0e 94 3c 6d call 0xda78 ; 0xda78 14cba: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 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); 14cbe: 84 e0 ldi r24, 0x04 ; 4 14cc0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 14cc4: 0e 94 23 6c call 0xd846 ; 0xd846 14cc8: 81 11 cpse r24, r1 14cca: 10 c0 rjmp .+32 ; 0x14cec { manage_heater(); 14ccc: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 14cd0: 81 e0 ldi r24, 0x01 ; 1 14cd2: 0e 94 8c 7a call 0xf518 ; 0xf518 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 14cd6: 80 91 88 16 lds r24, 0x1688 ; 0x801688 14cda: 88 23 and r24, r24 14cdc: 99 f3 breq .-26 ; 0x14cc4 Sound_MakeCustom(50,1000,false); 14cde: 40 e0 ldi r20, 0x00 ; 0 14ce0: 68 ee ldi r22, 0xE8 ; 232 14ce2: 73 e0 ldi r23, 0x03 ; 3 14ce4: 82 e3 ldi r24, 0x32 ; 50 14ce6: 90 e0 ldi r25, 0x00 ; 0 14ce8: 0f 94 61 31 call 0x262c2 ; 0x262c2 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 14cec: 32 e0 ldi r19, 0x02 ; 2 14cee: 30 93 78 02 sts 0x0278, r19 ; 0x800278 M600_load_filament_movements(filament_name); 14cf2: ce 01 movw r24, r28 14cf4: 01 96 adiw r24, 0x01 ; 1 14cf6: 0e 94 60 6d call 0xdac0 ; 0xdac0 Sound_MakeCustom(50,1000,false); 14cfa: 40 e0 ldi r20, 0x00 ; 0 14cfc: 68 ee ldi r22, 0xE8 ; 232 14cfe: 73 e0 ldi r23, 0x03 ; 3 14d00: 82 e3 ldi r24, 0x32 ; 50 14d02: 90 e0 ldi r25, 0x00 ; 0 14d04: 0f 94 61 31 call 0x262c2 ; 0x262c2 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 14d08: 11 11 cpse r17, r1 14d0a: 9e c1 rjmp .+828 ; 0x15048 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); 14d0c: b4 e0 ldi r27, 0x04 ; 4 14d0e: bb 2e mov r11, r27 14d10: b0 92 78 02 sts 0x0278, r11 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 14d14: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 14d18: 86 ed ldi r24, 0xD6 ; 214 14d1a: 98 e3 ldi r25, 0x38 ; 56 14d1c: 0e 94 3c 6d call 0xda78 ; 0xda78 14d20: ac 01 movw r20, r24 14d22: 60 e0 ldi r22, 0x00 ; 0 14d24: 81 e0 ldi r24, 0x01 ; 1 14d26: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 14d2a: 80 ec ldi r24, 0xC0 ; 192 14d2c: 98 e3 ldi r25, 0x38 ; 56 14d2e: 0e 94 3c 6d call 0xda78 ; 0xda78 14d32: ac 01 movw r20, r24 14d34: 61 e0 ldi r22, 0x01 ; 1 14d36: 81 e0 ldi r24, 0x01 ; 1 14d38: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 14d3c: 8c ea ldi r24, 0xAC ; 172 14d3e: 98 e3 ldi r25, 0x38 ; 56 14d40: 0e 94 3c 6d call 0xda78 ; 0xda78 14d44: ac 01 movw r20, r24 14d46: 62 e0 ldi r22, 0x02 ; 2 14d48: 81 e0 ldi r24, 0x01 ; 1 14d4a: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 14d4e: 8c eb ldi r24, 0xBC ; 188 14d50: 9c e3 ldi r25, 0x3C ; 60 14d52: 0e 94 3c 6d call 0xda78 ; 0xda78 14d56: ac 01 movw r20, r24 14d58: 63 e0 ldi r22, 0x03 ; 3 14d5a: 81 e0 ldi r24, 0x01 ; 1 14d5c: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc_at(0, cursor_pos, '>'); 14d60: 4e e3 ldi r20, 0x3E ; 62 14d62: 60 e0 ldi r22, 0x00 ; 0 14d64: 80 e0 ldi r24, 0x00 ; 0 14d66: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_consume_click(); 14d6a: 0e 94 1e 6c call 0xd83c ; 0xd83c uint8_t lcd_alright() { uint8_t cursor_pos = 0; 14d6e: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 14d70: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 14d74: 81 e0 ldi r24, 0x01 ; 1 14d76: 0e 94 8c 7a call 0xf518 ; 0xf518 if (lcd_encoder) 14d7a: 80 91 06 05 lds r24, 0x0506 ; 0x800506 14d7e: 90 91 07 05 lds r25, 0x0507 ; 0x800507 14d82: 00 97 sbiw r24, 0x00 ; 0 14d84: d9 f0 breq .+54 ; 0x14dbc { if (lcd_encoder < 0 ) { 14d86: 97 ff sbrs r25, 7 14d88: 22 c1 rjmp .+580 ; 0x14fce // Rotating knob counter clockwise if (cursor_pos > 0) 14d8a: 00 23 and r16, r16 14d8c: 09 f4 brne .+2 ; 0x14d90 14d8e: 23 c1 rjmp .+582 ; 0x14fd6 cursor_pos--; 14d90: 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 ")); 14d92: 47 ec ldi r20, 0xC7 ; 199 14d94: 59 e7 ldi r21, 0x79 ; 121 14d96: 60 e0 ldi r22, 0x00 ; 0 14d98: 80 e0 ldi r24, 0x00 ; 0 14d9a: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc_at(0, cursor_pos, '>'); 14d9e: 4e e3 ldi r20, 0x3E ; 62 14da0: 60 2f mov r22, r16 14da2: 80 e0 ldi r24, 0x00 ; 0 14da4: 0e 94 26 6a call 0xd44c ; 0xd44c // Consume rotation event and make feedback sound lcd_encoder = 0; 14da8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 14dac: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 14db0: 64 e6 ldi r22, 0x64 ; 100 14db2: 70 e0 ldi r23, 0x00 ; 0 14db4: 80 e0 ldi r24, 0x00 ; 0 14db6: 90 e0 ldi r25, 0x00 ; 0 14db8: 0f 94 4d 0d call 0x21a9a ; 0x21a9a } if (lcd_clicked()) 14dbc: 0e 94 23 6c call 0xd846 ; 0xd846 14dc0: 88 23 and r24, r24 14dc2: b1 f2 breq .-84 ; 0x14d70 { lcd_clear(); 14dc4: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_return_to_status(); 14dc8: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 14dcc: 42 e0 ldi r20, 0x02 ; 2 14dce: 40 93 78 02 sts 0x0278, r20 ; 0x800278 switch(lcd_change_filament_state) 14dd2: 02 30 cpi r16, 0x02 ; 2 14dd4: 09 f4 brne .+2 ; 0x14dd8 14dd6: 08 c1 rjmp .+528 ; 0x14fe8 14dd8: 03 30 cpi r16, 0x03 ; 3 14dda: 09 f4 brne .+2 ; 0x14dde 14ddc: ed c1 rjmp .+986 ; 0x151b8 14dde: 01 30 cpi r16, 0x01 ; 1 14de0: 09 f0 breq .+2 ; 0x14de4 14de2: 21 c1 rjmp .+578 ; 0x15026 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 14de4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14de8: 81 30 cpi r24, 0x01 ; 1 14dea: 09 f0 breq .+2 ; 0x14dee 14dec: f8 c0 rjmp .+496 ; 0x14fde uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 14dee: 0f 94 30 41 call 0x28260 ; 0x28260 14df2: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 14df4: 0e 94 a7 6d call 0xdb4e ; 0xdb4e // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 14df8: 80 2f mov r24, r16 14dfa: 0e 94 f6 7c call 0xf9ec ; 0xf9ec // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 14dfe: 80 e0 ldi r24, 0x00 ; 0 14e00: 0e 94 a3 71 call 0xe346 ; 0xe346 14e04: 85 cf rjmp .-246 ; 0x14d10 // 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; 14e06: 20 e0 ldi r18, 0x00 ; 0 14e08: 30 e0 ldi r19, 0x00 ; 0 14e0a: 43 e5 ldi r20, 0x53 ; 83 14e0c: 53 e4 ldi r21, 0x43 ; 67 14e0e: 28 a7 std Y+40, r18 ; 0x28 14e10: 39 a7 std Y+41, r19 ; 0x29 14e12: 4a a7 std Y+42, r20 ; 0x2a 14e14: 5b a7 std Y+43, r21 ; 0x2b 14e16: 48 ce rjmp .-880 ; 0x14aa8 float y_position = FILAMENTCHANGE_YPOS; 14e18: 1c a6 std Y+44, r1 ; 0x2c 14e1a: 1d a6 std Y+45, r1 ; 0x2d 14e1c: 1e a6 std Y+46, r1 ; 0x2e 14e1e: 1f a6 std Y+47, r1 ; 0x2f 14e20: 4f ce rjmp .-866 ; 0x14ac0 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(); 14e22: 0e 94 36 5f call 0xbe6c ; 0xbe6c 14e26: ae ce rjmp .-676 ; 0x14b84 //! //! 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); 14e28: 84 e0 ldi r24, 0x04 ; 4 14e2a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 14e2e: 0f 94 46 0f call 0x21e8c ; 0x21e8c 14e32: 2b 01 movw r4, r22 14e34: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14e36: 8a e5 ldi r24, 0x5A ; 90 14e38: 98 e3 ldi r25, 0x38 ; 56 14e3a: 0e 94 3c 6d call 0xda78 ; 0xda78 14e3e: 0f 94 92 0a call 0x21524 ; 0x21524 while (!(wait_for_user_state == 0 && lcd_clicked())){ 14e42: 0e 94 23 6c call 0xd846 ; 0xd846 14e46: 08 2f mov r16, r24 14e48: 81 11 cpse r24, r1 14e4a: 34 c0 rjmp .+104 ; 0x14eb4 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) { 14e4c: a3 01 movw r20, r6 14e4e: 92 01 movw r18, r4 14e50: 20 54 subi r18, 0x40 ; 64 14e52: 38 4d sbci r19, 0xD8 ; 216 14e54: 46 4f sbci r20, 0xF6 ; 246 14e56: 5f 4f sbci r21, 0xFF ; 255 14e58: 28 a7 std Y+40, r18 ; 0x28 14e5a: 39 a7 std Y+41, r19 ; 0x29 14e5c: 4a a7 std Y+42, r20 ; 0x2a 14e5e: 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(); 14e60: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 14e64: 81 e0 ldi r24, 0x01 ; 1 14e66: 0e 94 8c 7a call 0xf518 ; 0xf518 if (wait_for_user_state != 2) sound_wait_for_user(); 14e6a: 02 30 cpi r16, 0x02 ; 2 14e6c: 09 f4 brne .+2 ; 0x14e70 14e6e: 65 c0 rjmp .+202 ; 0x14f3a 14e70: 0f 94 67 35 call 0x26ace ; 0x26ace 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); 14e74: 84 e0 ldi r24, 0x04 ; 4 14e76: 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) { 14e78: 01 30 cpi r16, 0x01 ; 1 14e7a: 29 f1 breq .+74 ; 0x14ec6 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 14e7c: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 14e80: 0f 94 46 0f call 0x21e8c ; 0x21e8c 14e84: 28 a5 ldd r18, Y+40 ; 0x28 14e86: 39 a5 ldd r19, Y+41 ; 0x29 14e88: 4a a5 ldd r20, Y+42 ; 0x2a 14e8a: 5b a5 ldd r21, Y+43 ; 0x2b 14e8c: 26 17 cp r18, r22 14e8e: 37 07 cpc r19, r23 14e90: 48 07 cpc r20, r24 14e92: 59 07 cpc r21, r25 14e94: b0 f6 brcc .-84 ; 0x14e42 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 14e96: 89 e2 ldi r24, 0x29 ; 41 14e98: 98 e3 ldi r25, 0x38 ; 56 14e9a: 0e 94 3c 6d call 0xda78 ; 0xda78 14e9e: 0f 94 92 0a call 0x21524 ; 0x21524 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14ea2: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 14ea6: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 14eaa: 0f 94 14 22 call 0x24428 ; 0x24428 disable_e0(); 14eae: 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; 14eb0: 01 e0 ldi r16, 0x01 ; 1 14eb2: d6 cf rjmp .-84 ; 0x14e60 14eb4: 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; 14eb8: 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); 14ebc: c7 01 movw r24, r14 14ebe: b6 01 movw r22, r12 14ec0: 0e 94 1e f0 call 0x1e03c ; 0x1e03c 14ec4: 97 ce rjmp .-722 ; 0x14bf4 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); 14ec6: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (lcd_clicked()) { 14eca: 0e 94 23 6c call 0xd846 ; 0xd846 14ece: 88 23 and r24, r24 14ed0: 39 f2 breq .-114 ; 0x14e60 14ed2: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef 14ed6: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 14eda: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 14ede: 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)); 14ee2: 87 e0 ldi r24, 0x07 ; 7 14ee4: 9f e4 ldi r25, 0x4F ; 79 14ee6: 0e 94 3c 6d call 0xda78 ; 0xda78 14eea: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14eee: 42 e8 ldi r20, 0x82 ; 130 14ef0: 64 e0 ldi r22, 0x04 ; 4 14ef2: 80 e0 ldi r24, 0x00 ; 0 14ef4: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 14ef8: 80 91 f2 11 lds r24, 0x11F2 ; 0x8011f2 14efc: 8f 93 push r24 14efe: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 14f02: 8f 93 push r24 14f04: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f08: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f0c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f10: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14f14: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 14f18: 7f 93 push r23 14f1a: 6f 93 push r22 14f1c: 3f 92 push r3 14f1e: 2f 92 push r2 14f20: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_putc(LCD_STR_DEGREE[0]); 14f24: 81 e8 ldi r24, 0x81 ; 129 14f26: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 14f2a: 0f 90 pop r0 14f2c: 0f 90 pop r0 14f2e: 0f 90 pop r0 14f30: 0f 90 pop r0 14f32: 0f 90 pop r0 14f34: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 14f36: 02 e0 ldi r16, 0x02 ; 2 14f38: 93 cf rjmp .-218 ; 0x14e60 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 14f3a: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 14f3e: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 14f42: 07 2e mov r0, r23 14f44: 00 0c add r0, r0 14f46: 88 0b sbc r24, r24 14f48: 99 0b sbc r25, r25 14f4a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 14f4e: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 14f52: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 14f56: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 14f5a: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 14f5e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 14f62: 9f 77 andi r25, 0x7F ; 127 14f64: 20 e0 ldi r18, 0x00 ; 0 14f66: 30 e0 ldi r19, 0x00 ; 0 14f68: 40 ea ldi r20, 0xA0 ; 160 14f6a: 50 e4 ldi r21, 0x40 ; 64 14f6c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 14f70: 87 ff sbrs r24, 7 14f72: 0b c0 rjmp .+22 ; 0x14f8a lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14f74: 8a e5 ldi r24, 0x5A ; 90 14f76: 98 e3 ldi r25, 0x38 ; 56 14f78: 0e 94 3c 6d call 0xda78 ; 0xda78 14f7c: 0f 94 92 0a call 0x21524 ; 0x21524 waiting_start_time = _millis(); 14f80: 0f 94 46 0f call 0x21e8c ; 0x21e8c 14f84: 2b 01 movw r4, r22 14f86: 3c 01 movw r6, r24 14f88: 5c cf rjmp .-328 ; 0x14e42 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 14f8a: 64 e0 ldi r22, 0x04 ; 4 14f8c: 81 e0 ldi r24, 0x01 ; 1 14f8e: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 14f92: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f96: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f9a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f9e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14fa2: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 14fa6: 7f 93 push r23 14fa8: 6f 93 push r22 14faa: 9f 92 push r9 14fac: 8f 92 push r8 14fae: 0e 94 df 69 call 0xd3be ; 0xd3be 14fb2: 0f 90 pop r0 14fb4: 0f 90 pop r0 14fb6: 0f 90 pop r0 14fb8: 0f 90 pop r0 14fba: 52 cf rjmp .-348 ; 0x14e60 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 14fbc: 11 11 cpse r17, r1 14fbe: 03 c0 rjmp .+6 ; 0x14fc6 14fc0: 8a 2d mov r24, r10 14fc2: 0e 94 f6 7c call 0xf9ec ; 0xf9ec mmu_M600_load_filament(automatic); 14fc6: 81 2f mov r24, r17 14fc8: 0e 94 a3 71 call 0xe346 ; 0xe346 14fcc: 9d ce rjmp .-710 ; 0x14d08 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 14fce: 03 30 cpi r16, 0x03 ; 3 14fd0: 10 f4 brcc .+4 ; 0x14fd6 cursor_pos++; 14fd2: 0f 5f subi r16, 0xFF ; 255 14fd4: de ce rjmp .-580 ; 0x14d92 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 14fd6: 87 e0 ldi r24, 0x07 ; 7 14fd8: 0f 94 71 2c call 0x258e2 ; 0x258e2 14fdc: da ce rjmp .-588 ; 0x14d92 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); 14fde: ce 01 movw r24, r28 14fe0: 01 96 adiw r24, 0x01 ; 1 14fe2: 0e 94 60 6d call 0xdac0 ; 0xdac0 14fe6: 94 ce rjmp .-728 ; 0x14d10 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 14fe8: 0f 94 14 22 call 0x24428 ; 0x24428 load_filament_final_feed(); 14fec: 0e 94 00 5f call 0xbe00 ; 0xbe00 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(); 14ff0: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 14ff4: 8a ee ldi r24, 0xEA ; 234 14ff6: 98 e3 ldi r25, 0x38 ; 56 14ff8: 0e 94 3c 6d call 0xda78 ; 0xda78 14ffc: ac 01 movw r20, r24 14ffe: 60 e0 ldi r22, 0x00 ; 0 15000: 80 e0 ldi r24, 0x00 ; 0 15002: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 15006: 86 eb ldi r24, 0xB6 ; 182 15008: 99 e3 ldi r25, 0x39 ; 57 1500a: 0e 94 3c 6d call 0xda78 ; 0xda78 1500e: ac 01 movw r20, r24 15010: 62 e0 ldi r22, 0x02 ; 2 15012: 80 e0 ldi r24, 0x00 ; 0 15014: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 15018: 87 e9 ldi r24, 0x97 ; 151 1501a: 9d e1 ldi r25, 0x1D ; 29 1501c: 0f 94 dd 0b call 0x217ba ; 0x217ba lcd_loading_color(); st_synchronize(); 15020: 0f 94 14 22 call 0x24428 ; 0x24428 15024: 75 ce rjmp .-790 ; 0x14d10 } void lcd_change_success() { lcd_clear(); 15026: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 1502a: 8a ef ldi r24, 0xFA ; 250 1502c: 98 e3 ldi r25, 0x38 ; 56 1502e: 0e 94 3c 6d call 0xda78 ; 0xda78 15032: ac 01 movw r20, r24 15034: 62 e0 ldi r22, 0x02 ; 2 15036: 80 e0 ldi r24, 0x00 ; 0 15038: 0e 94 1a 6a call 0xd434 ; 0xd434 //! @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) 1503c: 00 23 and r16, r16 1503e: 19 f0 breq .+6 ; 0x15046 15040: 03 30 cpi r16, 0x03 ; 3 15042: 09 f0 breq .+2 ; 0x15046 15044: 65 ce rjmp .-822 ; 0x14d10 default: lcd_change_success(); break; } } return false; 15046: 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(); } 15048: 84 e8 ldi r24, 0x84 ; 132 1504a: 96 e1 ldi r25, 0x16 ; 22 1504c: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 15050: b1 10 cpse r11, r1 15052: c6 cd rjmp .-1140 ; 0x14be0 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 15054: 81 e0 ldi r24, 0x01 ; 1 15056: 0e 94 4b 6a call 0xd496 ; 0xd496 // Not let's go back to print fanSpeed = saved_fan_speed; 1505a: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 1505e: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 // Feed a little of filament to stabilize pressure if (!automatic) { 15062: 11 11 cpse r17, r1 15064: 27 c0 rjmp .+78 ; 0x150b4 if (printingIsPaused()) 15066: 0e 94 48 61 call 0xc290 ; 0xc290 1506a: c0 90 01 12 lds r12, 0x1201 ; 0x801201 1506e: d0 90 02 12 lds r13, 0x1202 ; 0x801202 15072: e0 90 03 12 lds r14, 0x1203 ; 0x801203 15076: f0 90 04 12 lds r15, 0x1204 ; 0x801204 1507a: 88 23 and r24, r24 1507c: 09 f4 brne .+2 ; 0x15080 1507e: 9f c0 rjmp .+318 ; 0x151be { // 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; 15080: 20 e0 ldi r18, 0x00 ; 0 15082: 30 e0 ldi r19, 0x00 ; 0 15084: 40 e8 ldi r20, 0x80 ; 128 15086: 5f e3 ldi r21, 0x3F ; 63 15088: c7 01 movw r24, r14 1508a: b6 01 movw r22, r12 1508c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 15090: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15094: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15098: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1509c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 150a0: 60 e0 ldi r22, 0x00 ; 0 150a2: 70 e0 ldi r23, 0x00 ; 0 150a4: 88 ee ldi r24, 0xE8 ; 232 150a6: 92 e4 ldi r25, 0x42 ; 66 150a8: 0f 94 11 85 call 0x30a22 ; 0x30a22 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 150ac: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 150b0: 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); 150b4: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd 150b8: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe 150bc: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff 150c0: 10 91 00 12 lds r17, 0x1200 ; 0x801200 150c4: 20 91 94 02 lds r18, 0x0294 ; 0x800294 150c8: 30 91 95 02 lds r19, 0x0295 ; 0x800295 150cc: 40 91 96 02 lds r20, 0x0296 ; 0x800296 150d0: 50 91 97 02 lds r21, 0x0297 ; 0x800297 150d4: 60 91 90 02 lds r22, 0x0290 ; 0x800290 150d8: 70 91 91 02 lds r23, 0x0291 ; 0x800291 150dc: 80 91 92 02 lds r24, 0x0292 ; 0x800292 150e0: 90 91 93 02 lds r25, 0x0293 ; 0x800293 150e4: 1f 92 push r1 150e6: 1f 92 push r1 150e8: 1f 92 push r1 150ea: 1f 92 push r1 150ec: 81 2c mov r8, r1 150ee: 91 2c mov r9, r1 150f0: e8 e4 ldi r30, 0x48 ; 72 150f2: ae 2e mov r10, r30 150f4: e2 e4 ldi r30, 0x42 ; 66 150f6: be 2e mov r11, r30 150f8: f1 e0 ldi r31, 0x01 ; 1 150fa: cf 2e mov r12, r31 150fc: f2 e1 ldi r31, 0x12 ; 18 150fe: df 2e mov r13, r31 15100: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 st_synchronize(); 15104: 0f 94 14 22 call 0x24428 ; 0x24428 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 15108: e0 90 98 02 lds r14, 0x0298 ; 0x800298 1510c: f0 90 99 02 lds r15, 0x0299 ; 0x800299 15110: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 15114: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 15118: 20 91 94 02 lds r18, 0x0294 ; 0x800294 1511c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 15120: 40 91 96 02 lds r20, 0x0296 ; 0x800296 15124: 50 91 97 02 lds r21, 0x0297 ; 0x800297 15128: 60 91 90 02 lds r22, 0x0290 ; 0x800290 1512c: 70 91 91 02 lds r23, 0x0291 ; 0x800291 15130: 80 91 92 02 lds r24, 0x0292 ; 0x800292 15134: 90 91 93 02 lds r25, 0x0293 ; 0x800293 15138: 1f 92 push r1 1513a: 1f 92 push r1 1513c: 1f 92 push r1 1513e: 1f 92 push r1 15140: 81 2c mov r8, r1 15142: 91 2c mov r9, r1 15144: a0 e7 ldi r26, 0x70 ; 112 15146: aa 2e mov r10, r26 15148: a1 e4 ldi r26, 0x41 ; 65 1514a: ba 2e mov r11, r26 1514c: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 st_synchronize(); 15150: 0f 94 14 22 call 0x24428 ; 0x24428 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 15154: 8c e9 ldi r24, 0x9C ; 156 15156: 92 e0 ldi r25, 0x02 ; 2 15158: 0f 94 69 75 call 0x2ead2 ; 0x2ead2 memcpy(current_position, saved_pos, sizeof(saved_pos)); 1515c: 80 e1 ldi r24, 0x10 ; 16 1515e: e0 e9 ldi r30, 0x90 ; 144 15160: f2 e0 ldi r31, 0x02 ; 2 15162: a5 ef ldi r26, 0xF5 ; 245 15164: b1 e1 ldi r27, 0x11 ; 17 15166: 01 90 ld r0, Z+ 15168: 0d 92 st X+, r0 1516a: 8a 95 dec r24 1516c: e1 f7 brne .-8 ; 0x15166 set_destination_to_current(); 1516e: 0e 94 c1 61 call 0xc382 ; 0xc382 // Recover feed rate feedmultiply = saved_feedmultiply2; 15172: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> 15176: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> 1517a: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 1517e: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 15182: 9f 93 push r25 15184: 8f 93 push r24 15186: 89 e9 ldi r24, 0x99 ; 153 15188: 95 e6 ldi r25, 0x65 ; 101 1518a: 9f 93 push r25 1518c: 8f 93 push r24 1518e: 0e 94 d0 7d call 0xfba0 ; 0xfba0 if (printingIsPaused()) { 15192: 0e 94 48 61 call 0xc290 ; 0xc290 15196: 0f b6 in r0, 0x3f ; 63 15198: f8 94 cli 1519a: de bf out 0x3e, r29 ; 62 1519c: 0f be out 0x3f, r0 ; 63 1519e: cd bf out 0x3d, r28 ; 61 151a0: 88 23 and r24, r24 151a2: 21 f1 breq .+72 ; 0x151ec lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 151a4: 8d e4 ldi r24, 0x4D ; 77 151a6: 91 e4 ldi r25, 0x41 ; 65 151a8: 0e 94 3c 6d call 0xda78 ; 0xda78 151ac: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 151b0: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 151b4: 0c 94 5f 98 jmp 0x130be ; 0x130be st_synchronize(); break; // Unload filament case 3: return true; 151b8: bb 24 eor r11, r11 151ba: b3 94 inc r11 151bc: 45 cf rjmp .-374 ; 0x15048 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 151be: 20 e0 ldi r18, 0x00 ; 0 151c0: 30 e0 ldi r19, 0x00 ; 0 151c2: 40 ea ldi r20, 0xA0 ; 160 151c4: 50 e4 ldi r21, 0x40 ; 64 151c6: c7 01 movw r24, r14 151c8: b6 01 movw r22, r12 151ca: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 151ce: 60 93 01 12 sts 0x1201, r22 ; 0x801201 151d2: 70 93 02 12 sts 0x1202, r23 ; 0x801202 151d6: 80 93 03 12 sts 0x1203, r24 ; 0x801203 151da: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 151de: 60 e0 ldi r22, 0x00 ; 0 151e0: 70 e0 ldi r23, 0x00 ; 0 151e2: 80 e0 ldi r24, 0x00 ; 0 151e4: 90 e4 ldi r25, 0x40 ; 64 151e6: 0f 94 11 85 call 0x30a22 ; 0x30a22 151ea: 64 cf rjmp .-312 ; 0x150b4 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 151ec: 8b e0 ldi r24, 0x0B ; 11 151ee: 9c e6 ldi r25, 0x6C ; 108 151f0: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 151f4: 84 e2 ldi r24, 0x24 ; 36 151f6: 98 e6 ldi r25, 0x68 ; 104 151f8: 0e 94 de 72 call 0xe5bc ; 0xe5bc 151fc: d9 cf rjmp .-78 ; 0x151b0 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 151fe: 0e 94 48 61 call 0xc290 ; 0xc290 15202: 81 11 cpse r24, r1 15204: 0c 94 5f 98 jmp 0x130be ; 0x130be st_synchronize(); 15208: 0f 94 14 22 call 0x24428 ; 0x24428 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 1520c: 0e 94 91 73 call 0xe722 ; 0xe722 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 15210: 0e 94 5e 70 call 0xe0bc ; 0xe0bc lcd_pause_print(); 15214: 0f 94 52 0f call 0x21ea4 ; 0x21ea4 15218: 0c 94 5f 98 jmp 0x130be ; 0x130be /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 1521c: 0e 94 48 61 call 0xc290 ; 0xc290 15220: 88 23 and r24, r24 15222: 11 f4 brne .+4 ; 0x15228 15224: 0c 94 5f 98 jmp 0x130be ; 0x130be 15228: 0c 94 b4 98 jmp 0x13168 ; 0x13168 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1522c: 81 ea ldi r24, 0xA1 ; 161 1522e: 9d e0 ldi r25, 0x0D ; 13 15230: 0f 94 7d a0 call 0x340fa ; 0x340fa 15234: 18 2f mov r17, r24 } if (code_seen('Z')){ 15236: 8a e5 ldi r24, 0x5A ; 90 15238: 0e 94 b6 55 call 0xab6c ; 0xab6c 1523c: 88 23 and r24, r24 1523e: 09 f4 brne .+2 ; 0x15242 15240: d7 c0 rjmp .+430 ; 0x153f0 z_val = code_value(); 15242: 0e 94 8e 5a call 0xb51c ; 0xb51c 15246: 2b 01 movw r4, r22 15248: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 1524a: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 1524e: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 15252: 40 91 40 04 lds r20, 0x0440 ; 0x800440 15256: 50 91 41 04 lds r21, 0x0441 ; 0x800441 1525a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1525e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 15262: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 15264: 9b 01 movw r18, r22 15266: 21 56 subi r18, 0x61 ; 97 15268: 30 4f sbci r19, 0xF0 ; 240 1526a: 20 3a cpi r18, 0xA0 ; 160 1526c: 3f 40 sbci r19, 0x0F ; 15 1526e: 30 f0 brcs .+12 ; 0x1527c { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 15270: 8c e6 ldi r24, 0x6C ; 108 15272: 9f e7 ldi r25, 0x7F ; 127 15274: 0e 94 de 72 call 0xe5bc ; 0xe5bc 15278: 0c 94 5f 98 jmp 0x130be ; 0x130be break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 1527c: 5b e0 ldi r21, 0x0B ; 11 1527e: 15 9f mul r17, r21 15280: 90 01 movw r18, r0 15282: 11 24 eor r1, r1 15284: c9 01 movw r24, r18 15286: 80 5b subi r24, 0xB0 ; 176 15288: 92 4f sbci r25, 0xF2 ; 242 1528a: 0f 94 bf a0 call 0x3417e ; 0x3417e { 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')) 1528e: 8c e4 ldi r24, 0x4C ; 76 15290: 0e 94 b6 55 call 0xab6c ; 0xab6c 15294: bb e0 ldi r27, 0x0B ; 11 15296: 1b 9f mul r17, r27 15298: 70 01 movw r14, r0 1529a: 11 24 eor r1, r1 1529c: 57 01 movw r10, r14 1529e: e7 eb ldi r30, 0xB7 ; 183 152a0: ae 1a sub r10, r30 152a2: e2 ef ldi r30, 0xF2 ; 242 152a4: be 0a sbc r11, r30 152a6: 88 23 and r24, r24 152a8: 09 f4 brne .+2 ; 0x152ac 152aa: be c0 rjmp .+380 ; 0x15428 { char *src = strchr_pointer + 1; 152ac: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 152b0: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 152b4: 31 96 adiw r30, 0x01 ; 1 152b6: bf 01 movw r22, r30 while (*src == ' ') ++src; 152b8: 81 91 ld r24, Z+ 152ba: 80 32 cpi r24, 0x20 ; 32 152bc: e1 f3 breq .-8 ; 0x152b6 if (*src != '\0') 152be: 88 23 and r24, r24 152c0: 31 f0 breq .+12 ; 0x152ce { strncpy(strLabel,src,7); 152c2: 47 e0 ldi r20, 0x07 ; 7 152c4: 50 e0 ldi r21, 0x00 ; 0 152c6: ce 01 movw r24, r28 152c8: 01 96 adiw r24, 0x01 ; 1 152ca: 0f 94 fd a6 call 0x34dfa ; 0x34dfa #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); 152ce: 47 e0 ldi r20, 0x07 ; 7 152d0: 50 e0 ldi r21, 0x00 ; 0 152d2: b5 01 movw r22, r10 152d4: ce 01 movw r24, r28 152d6: 01 96 adiw r24, 0x01 ; 1 152d8: 0f 94 91 a0 call 0x34122 ; 0x34122 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 152dc: 82 e4 ldi r24, 0x42 ; 66 152de: 0e 94 b6 55 call 0xab6c ; 0xab6c 152e2: 57 01 movw r10, r14 152e4: fe ea ldi r31, 0xAE ; 174 152e6: af 1a sub r10, r31 152e8: f2 ef ldi r31, 0xF2 ; 242 152ea: bf 0a sbc r11, r31 152ec: 88 23 and r24, r24 152ee: 09 f4 brne .+2 ; 0x152f2 152f0: a3 c0 rjmp .+326 ; 0x15438 { iBedC = code_value_uint8(); 152f2: 0e 94 cb 55 call 0xab96 ; 0xab96 152f6: 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); 152f8: 68 2f mov r22, r24 152fa: c5 01 movw r24, r10 152fc: 0f 94 a1 a0 call 0x34142 ; 0x34142 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 15300: 80 e5 ldi r24, 0x50 ; 80 15302: 0e 94 b6 55 call 0xab6c ; 0xab6c 15306: 2d ea ldi r18, 0xAD ; 173 15308: e2 1a sub r14, r18 1530a: 22 ef ldi r18, 0xF2 ; 242 1530c: f2 0a sbc r15, r18 1530e: 88 23 and r24, r24 15310: 09 f4 brne .+2 ; 0x15314 15312: 97 c0 rjmp .+302 ; 0x15442 { iPindaC = code_value_uint8(); 15314: 0e 94 cb 55 call 0xab96 ; 0xab96 15318: b8 2e mov r11, r24 1531a: 68 2f mov r22, r24 1531c: c7 01 movw r24, r14 1531e: 0f 94 a1 a0 call 0x34142 ; 0x34142 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 15322: 81 e4 ldi r24, 0x41 ; 65 15324: 0e 94 b6 55 call 0xab6c ; 0xab6c 15328: 88 23 and r24, r24 1532a: 09 f4 brne .+2 ; 0x1532e 1532c: 8f c0 rjmp .+286 ; 0x1544c { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 1532e: 0e 94 cb 55 call 0xab96 ; 0xab96 15332: 81 11 cpse r24, r1 15334: 06 c0 rjmp .+12 ; 0x15342 15336: 81 ea ldi r24, 0xA1 ; 161 15338: 9d e0 ldi r25, 0x0D ; 13 1533a: 0f 94 7d a0 call 0x340fa ; 0x340fa 1533e: 18 13 cpse r17, r24 15340: 8d c0 rjmp .+282 ; 0x1545c if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 15342: 81 2f mov r24, r17 15344: 0e 94 a3 6f call 0xdf46 ; 0xdf46 15348: 08 2f mov r16, r24 1534a: 88 23 and r24, r24 1534c: 29 f0 breq .+10 ; 0x15358 1534e: 61 2f mov r22, r17 15350: 81 ea ldi r24, 0xA1 ; 161 15352: 9d e0 ldi r25, 0x0D ; 13 15354: 0f 94 a1 a0 call 0x34142 ; 0x34142 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 15358: 85 e6 ldi r24, 0x65 ; 101 1535a: 9f e7 ldi r25, 0x7F ; 127 1535c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15360: 61 2f mov r22, r17 15362: 70 e0 ldi r23, 0x00 ; 0 15364: 90 e0 ldi r25, 0x00 ; 0 15366: 80 e0 ldi r24, 0x00 ; 0 15368: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 1536c: 81 2f mov r24, r17 1536e: 0e 94 a3 6f call 0xdf46 ; 0xdf46 15372: 81 11 cpse r24, r1 15374: 04 c0 rjmp .+8 ; 0x1537e SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 15376: 84 e5 ldi r24, 0x54 ; 84 15378: 9f e7 ldi r25, 0x7F ; 127 1537a: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLPGM(" Z"); 1537e: 81 e5 ldi r24, 0x51 ; 81 15380: 9f e7 ldi r25, 0x7F ; 127 15382: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15386: 44 e0 ldi r20, 0x04 ; 4 15388: c3 01 movw r24, r6 1538a: b2 01 movw r22, r4 1538c: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 15390: 8e e4 ldi r24, 0x4E ; 78 15392: 9f e7 ldi r25, 0x7F ; 127 15394: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15398: b6 01 movw r22, r12 1539a: dd 0c add r13, r13 1539c: 88 0b sbc r24, r24 1539e: 99 0b sbc r25, r25 153a0: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 153a4: 8b e4 ldi r24, 0x4B ; 75 153a6: 9f e7 ldi r25, 0x7F ; 127 153a8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 153ac: ce 01 movw r24, r28 153ae: 01 96 adiw r24, 0x01 ; 1 153b0: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 153b4: 88 e4 ldi r24, 0x48 ; 72 153b6: 9f e7 ldi r25, 0x7F ; 127 153b8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 153bc: 69 2d mov r22, r9 153be: 70 e0 ldi r23, 0x00 ; 0 153c0: 90 e0 ldi r25, 0x00 ; 0 153c2: 80 e0 ldi r24, 0x00 ; 0 153c4: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 153c8: 85 e4 ldi r24, 0x45 ; 69 153ca: 9f e7 ldi r25, 0x7F ; 127 153cc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 153d0: 6b 2d mov r22, r11 153d2: 70 e0 ldi r23, 0x00 ; 0 153d4: 90 e0 ldi r25, 0x00 ; 0 153d6: 80 e0 ldi r24, 0x00 ; 0 153d8: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 153dc: 82 e4 ldi r24, 0x42 ; 66 153de: 9f e7 ldi r25, 0x7F ; 127 153e0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN((int)bIsActive); 153e4: 80 2f mov r24, r16 153e6: 90 e0 ldi r25, 0x00 ; 0 153e8: 0f 94 48 41 call 0x28290 ; 0x28290 153ec: 0c 94 5f 98 jmp 0x130be ; 0x130be } 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))); 153f0: ab e0 ldi r26, 0x0B ; 11 153f2: 1a 9f mul r17, r26 153f4: c0 01 movw r24, r0 153f6: 11 24 eor r1, r1 153f8: 80 5b subi r24, 0xB0 ; 176 153fa: 92 4f sbci r25, 0xF2 ; 242 153fc: 0f 94 8b a0 call 0x34116 ; 0x34116 15400: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 15402: bc 01 movw r22, r24 15404: 99 0f add r25, r25 15406: 88 0b sbc r24, r24 15408: 99 0b sbc r25, r25 1540a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1540e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 15412: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 15416: 40 91 40 04 lds r20, 0x0440 ; 0x800440 1541a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 1541e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 15422: 2b 01 movw r4, r22 15424: 3c 01 movw r6, r24 15426: 33 cf rjmp .-410 ; 0x1528e } 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)); 15428: 47 e0 ldi r20, 0x07 ; 7 1542a: 50 e0 ldi r21, 0x00 ; 0 1542c: b5 01 movw r22, r10 1542e: ce 01 movw r24, r28 15430: 01 96 adiw r24, 0x01 ; 1 15432: 0f 94 6d a0 call 0x340da ; 0x340da 15436: 52 cf rjmp .-348 ; 0x152dc 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); 15438: c5 01 movw r24, r10 1543a: 0f 94 7d a0 call 0x340fa ; 0x340fa 1543e: 98 2e mov r9, r24 15440: 5f cf rjmp .-322 ; 0x15300 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); 15442: c7 01 movw r24, r14 15444: 0f 94 7d a0 call 0x340fa ; 0x340fa 15448: b8 2e mov r11, r24 1544a: 6b cf rjmp .-298 ; 0x15322 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 1544c: 81 ea ldi r24, 0xA1 ; 161 1544e: 9d e0 ldi r25, 0x0D ; 13 15450: 0f 94 7d a0 call 0x340fa ; 0x340fa 15454: 01 e0 ldi r16, 0x01 ; 1 15456: 18 17 cp r17, r24 15458: 09 f4 brne .+2 ; 0x1545c 1545a: 7e cf rjmp .-260 ; 0x15358 { 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; 1545c: 00 e0 ldi r16, 0x00 ; 0 1545e: 7c cf rjmp .-264 ; 0x15358 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 15460: 83 e5 ldi r24, 0x53 ; 83 15462: 0e 94 b6 55 call 0xab6c ; 0xab6c 15466: 88 23 and r24, r24 15468: 11 f4 brne .+4 ; 0x1546e 1546a: 0c 94 5f 98 jmp 0x130be ; 0x130be set_target_pinda = code_value_short(); 1546e: 0e 94 d8 55 call 0xabb0 ; 0xabb0 15472: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 15474: 86 eb ldi r24, 0xB6 ; 182 15476: 99 e3 ldi r25, 0x39 ; 57 15478: 0e 94 3c 6d call 0xda78 ; 0xda78 1547c: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 15480: 8f e1 ldi r24, 0x1F ; 31 15482: 9f e7 ldi r25, 0x7F ; 127 15484: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(set_target_pinda); 15488: c8 01 movw r24, r16 1548a: 0f 94 48 41 call 0x28290 ; 0x28290 codenum = _millis(); 1548e: 0f 94 46 0f call 0x21e8c ; 0x21e8c 15492: 4b 01 movw r8, r22 15494: 5c 01 movw r10, r24 cancel_heatup = false; 15496: 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; 1549a: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 1549e: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 154a2: 89 2b or r24, r25 154a4: 41 f4 brne .+16 ; 0x154b6 154a6: ff 24 eor r15, r15 154a8: f3 94 inc r15 154aa: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 154ae: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 154b2: 89 2b or r24, r25 154b4: 09 f0 breq .+2 ; 0x154b8 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 154b6: 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)) ) { 154b8: 28 01 movw r4, r16 154ba: 01 2e mov r0, r17 154bc: 00 0c add r0, r0 154be: 66 08 sbc r6, r6 154c0: 77 08 sbc r7, r7 154c2: f1 10 cpse r15, r1 154c4: 1a c0 rjmp .+52 ; 0x154fa 154c6: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 154ca: 81 11 cpse r24, r1 154cc: 10 c0 rjmp .+32 ; 0x154ee 154ce: c3 01 movw r24, r6 154d0: b2 01 movw r22, r4 154d2: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 154d6: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 154da: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 154de: 40 91 90 06 lds r20, 0x0690 ; 0x800690 154e2: 50 91 91 06 lds r21, 0x0691 ; 0x800691 154e6: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 154ea: 18 16 cp r1, r24 154ec: b4 f0 brlt .+44 ; 0x1551a } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 154ee: 85 ed ldi r24, 0xD5 ; 213 154f0: 99 e6 ldi r25, 0x69 ; 105 154f2: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 154f6: 0c 94 5f 98 jmp 0x130be ; 0x130be 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)) ) { 154fa: c3 01 movw r24, r6 154fc: b2 01 movw r22, r4 154fe: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 15502: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 15506: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 1550a: 40 91 90 06 lds r20, 0x0690 ; 0x800690 1550e: 50 91 91 06 lds r21, 0x0691 ; 0x800691 15512: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 15516: 87 ff sbrs r24, 7 15518: ea cf rjmp .-44 ; 0x154ee if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 1551a: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1551e: 68 19 sub r22, r8 15520: 79 09 sbc r23, r9 15522: 8a 09 sbc r24, r10 15524: 9b 09 sbc r25, r11 15526: 69 3e cpi r22, 0xE9 ; 233 15528: 73 40 sbci r23, 0x03 ; 3 1552a: 81 05 cpc r24, r1 1552c: 91 05 cpc r25, r1 1552e: c8 f0 brcs .+50 ; 0x15562 { SERIAL_PROTOCOLPGM("P:"); 15530: 8c e1 ldi r24, 0x1C ; 28 15532: 9f e7 ldi r25, 0x7F ; 127 15534: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15538: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 1553c: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 15540: 80 91 90 06 lds r24, 0x0690 ; 0x800690 15544: 90 91 91 06 lds r25, 0x0691 ; 0x800691 15548: 41 e0 ldi r20, 0x01 ; 1 1554a: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1554e: 8f e2 ldi r24, 0x2F ; 47 15550: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 15554: c8 01 movw r24, r16 15556: 0f 94 48 41 call 0x28290 ; 0x28290 codenum = _millis(); 1555a: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1555e: 4b 01 movw r8, r22 15560: 5c 01 movw r10, r24 } manage_heater(); 15562: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 15566: 80 e0 ldi r24, 0x00 ; 0 15568: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); 1556c: 80 e0 ldi r24, 0x00 ; 0 1556e: 0e 94 cd 69 call 0xd39a ; 0xd39a 15572: a7 cf rjmp .-178 ; 0x154c2 - `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 15574: 8f e3 ldi r24, 0x3F ; 63 15576: 0e 94 b6 55 call 0xab6c ; 0xab6c 1557a: 88 23 and r24, r24 1557c: c9 f0 breq .+50 ; 0x155b0 SERIAL_PROTOCOLPGM("PINDA cal status: "); 1557e: 89 e0 ldi r24, 0x09 ; 9 15580: 9f e7 ldi r25, 0x7F ; 127 15582: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 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); } 15586: 86 ea ldi r24, 0xA6 ; 166 15588: 9f e0 ldi r25, 0x0F ; 15 1558a: 0f 94 7d a0 call 0x340fa ; 0x340fa 1558e: 21 e0 ldi r18, 0x01 ; 1 15590: 30 e0 ldi r19, 0x00 ; 0 15592: 81 11 cpse r24, r1 15594: 02 c0 rjmp .+4 ; 0x1559a 15596: 30 e0 ldi r19, 0x00 ; 0 15598: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 1559a: c9 01 movw r24, r18 1559c: 0f 94 48 41 call 0x28290 ; 0x28290 SERIAL_PROTOCOLLNRPGM(_header); 155a0: 82 ef ldi r24, 0xF2 ; 242 155a2: 9e e7 ldi r25, 0x7E ; 126 155a4: 0e 94 de 72 call 0xe5bc ; 0xe5bc gcode_M861_print_pinda_cal_eeprom(); 155a8: 0e 94 1d 71 call 0xe23a ; 0xe23a 155ac: 0c 94 5f 98 jmp 0x130be ; 0x130be } else if (code_seen('!')) { // ! - Set factory default values 155b0: 81 e2 ldi r24, 0x21 ; 33 155b2: 0e 94 b6 55 call 0xab6c ; 0xab6c 155b6: 88 23 and r24, r24 155b8: 49 f1 breq .+82 ; 0x1560c 155ba: 61 e0 ldi r22, 0x01 ; 1 155bc: 86 ea ldi r24, 0xA6 ; 166 155be: 9f e0 ldi r25, 0x0F ; 15 155c0: 0f 94 a1 a0 call 0x34142 ; 0x34142 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 155c4: 68 e0 ldi r22, 0x08 ; 8 155c6: 70 e0 ldi r23, 0x00 ; 0 155c8: 80 eb ldi r24, 0xB0 ; 176 155ca: 9f e0 ldi r25, 0x0F ; 15 155cc: 0f 94 bf a0 call 0x3417e ; 0x3417e 155d0: 68 e1 ldi r22, 0x18 ; 24 155d2: 70 e0 ldi r23, 0x00 ; 0 155d4: 82 eb ldi r24, 0xB2 ; 178 155d6: 9f e0 ldi r25, 0x0F ; 15 155d8: 0f 94 bf a0 call 0x3417e ; 0x3417e 155dc: 60 e3 ldi r22, 0x30 ; 48 155de: 70 e0 ldi r23, 0x00 ; 0 155e0: 84 eb ldi r24, 0xB4 ; 180 155e2: 9f e0 ldi r25, 0x0F ; 15 155e4: 0f 94 bf a0 call 0x3417e ; 0x3417e 155e8: 60 e5 ldi r22, 0x50 ; 80 155ea: 70 e0 ldi r23, 0x00 ; 0 155ec: 86 eb ldi r24, 0xB6 ; 182 155ee: 9f e0 ldi r25, 0x0F ; 15 155f0: 0f 94 bf a0 call 0x3417e ; 0x3417e 155f4: 68 e7 ldi r22, 0x78 ; 120 155f6: 70 e0 ldi r23, 0x00 ; 0 155f8: 88 eb ldi r24, 0xB8 ; 184 155fa: 9f e0 ldi r25, 0x0F ; 15 155fc: 0f 94 bf a0 call 0x3417e ; 0x3417e 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"); 15600: 81 ee ldi r24, 0xE1 ; 225 15602: 9e e7 ldi r25, 0x7E ; 126 15604: 0e 94 de 72 call 0xe5bc ; 0xe5bc 15608: 0c 94 5f 98 jmp 0x130be ; 0x130be } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 1560c: 8a e5 ldi r24, 0x5A ; 90 1560e: 0e 94 b6 55 call 0xab6c ; 0xab6c 15612: 88 23 and r24, r24 15614: c1 f0 breq .+48 ; 0x15646 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15616: 61 e0 ldi r22, 0x01 ; 1 15618: 86 ea ldi r24, 0xA6 ; 166 1561a: 9f e0 ldi r25, 0x0F ; 15 1561c: 0f 94 a1 a0 call 0x34142 ; 0x34142 15620: 00 eb ldi r16, 0xB0 ; 176 15622: 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); 15624: 70 e0 ldi r23, 0x00 ; 0 15626: 60 e0 ldi r22, 0x00 ; 0 15628: c8 01 movw r24, r16 1562a: 0f 94 bf a0 call 0x3417e ; 0x3417e 1562e: 0e 5f subi r16, 0xFE ; 254 15630: 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++) { 15632: 0a 3b cpi r16, 0xBA ; 186 15634: 4f e0 ldi r20, 0x0F ; 15 15636: 14 07 cpc r17, r20 15638: a9 f7 brne .-22 ; 0x15624 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 1563a: 87 ed ldi r24, 0xD7 ; 215 1563c: 9e e7 ldi r25, 0x7E ; 126 1563e: 0e 94 de 72 call 0xe5bc ; 0xe5bc 15642: 0c 94 5f 98 jmp 0x130be ; 0x130be } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 15646: 83 e5 ldi r24, 0x53 ; 83 15648: 0e 94 b6 55 call 0xab6c ; 0xab6c 1564c: 88 23 and r24, r24 1564e: 21 f1 breq .+72 ; 0x15698 int16_t usteps = code_value_short(); 15650: 0e 94 d8 55 call 0xabb0 ; 0xabb0 15654: 8c 01 movw r16, r24 if (code_seen('I')) { 15656: 89 e4 ldi r24, 0x49 ; 73 15658: 0e 94 b6 55 call 0xab6c ; 0xab6c 1565c: 88 23 and r24, r24 1565e: 11 f4 brne .+4 ; 0x15664 15660: 0c 94 5f 98 jmp 0x130be ; 0x130be uint8_t index = code_value_uint8(); 15664: 0e 94 cb 55 call 0xab96 ; 0xab96 if (index < 5) { 15668: 85 30 cpi r24, 0x05 ; 5 1566a: 10 f0 brcs .+4 ; 0x15670 1566c: 0c 94 5f 98 jmp 0x130be ; 0x130be eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 15670: 90 e0 ldi r25, 0x00 ; 0 15672: 88 52 subi r24, 0x28 ; 40 15674: 98 4f sbci r25, 0xF8 ; 248 15676: b8 01 movw r22, r16 15678: 88 0f add r24, r24 1567a: 99 1f adc r25, r25 1567c: 0f 94 bf a0 call 0x3417e ; 0x3417e SERIAL_PROTOCOLLNRPGM(MSG_OK); 15680: 85 ed ldi r24, 0xD5 ; 213 15682: 99 e6 ldi r25, 0x69 ; 105 15684: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLLNRPGM(_header); 15688: 82 ef ldi r24, 0xF2 ; 242 1568a: 9e e7 ldi r25, 0x7E ; 126 1568c: 0e 94 de 72 call 0xe5bc ; 0xe5bc gcode_M861_print_pinda_cal_eeprom(); 15690: 0e 94 1d 71 call 0xe23a ; 0xe23a 15694: 0c 94 5f 98 jmp 0x130be ; 0x130be } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 15698: 86 ec ldi r24, 0xC6 ; 198 1569a: 9e e7 ldi r25, 0x7E ; 126 1569c: 0e 94 de 72 call 0xe5bc ; 0xe5bc 156a0: 0c 94 5f 98 jmp 0x130be ; 0x130be 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) 156a4: 64 30 cpi r22, 0x04 ; 4 156a6: 09 f4 brne .+2 ; 0x156aa 156a8: be c0 rjmp .+380 ; 0x15826 156aa: 65 30 cpi r22, 0x05 ; 5 156ac: 11 f0 breq .+4 ; 0x156b2 156ae: 0c 94 5f 98 jmp 0x130be ; 0x130be 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')) 156b2: 80 e5 ldi r24, 0x50 ; 80 156b4: 0e 94 b6 55 call 0xab6c ; 0xab6c 156b8: 88 23 and r24, r24 156ba: 09 f4 brne .+2 ; 0x156be 156bc: 3a c1 rjmp .+628 ; 0x15932 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 156be: 0e 94 1e 56 call 0xac3c ; 0xac3c done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 156c2: 10 91 b6 03 lds r17, 0x03B6 ; 0x8003b6 156c6: 11 23 and r17, r17 156c8: 11 f4 brne .+4 ; 0x156ce 156ca: 0c 94 5f 98 jmp 0x130be ; 0x130be return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 156ce: 62 30 cpi r22, 0x02 ; 2 156d0: 71 05 cpc r23, r1 156d2: 10 f4 brcc .+4 ; 0x156d8 156d4: 0c 94 5f 98 jmp 0x130be ; 0x130be // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 156d8: 85 eb ldi r24, 0xB5 ; 181 156da: 96 e3 ldi r25, 0x36 ; 54 156dc: 0e 94 3c 6d call 0xda78 ; 0xda78 156e0: 7c 01 movw r14, r24 156e2: 84 e8 ldi r24, 0x84 ; 132 156e4: 96 e3 ldi r25, 0x36 ; 54 156e6: 0e 94 3c 6d call 0xda78 ; 0xda78 156ea: 41 2f mov r20, r17 156ec: b7 01 movw r22, r14 156ee: 0e 94 b1 ef call 0x1df62 ; 0x1df62 156f2: 0c 94 5f 98 jmp 0x130be ; 0x130be ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 156f6: 80 e5 ldi r24, 0x50 ; 80 156f8: 0e 94 b6 55 call 0xab6c ; 0xab6c 156fc: 88 23 and r24, r24 156fe: a9 f0 breq .+42 ; 0x1572a { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 15700: 0e 94 8e 5a call 0xb51c ; 0xb51c 15704: 20 e0 ldi r18, 0x00 ; 0 15706: 30 e0 ldi r19, 0x00 ; 0 15708: 4a e7 ldi r20, 0x7A ; 122 1570a: 54 e4 ldi r21, 0x44 ; 68 1570c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 15710: 20 e0 ldi r18, 0x00 ; 0 15712: 30 e0 ldi r19, 0x00 ; 0 15714: 40 e0 ldi r20, 0x00 ; 0 15716: 5f e3 ldi r21, 0x3F ; 63 15718: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1571c: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> nozzle_diameter_check(nDiameter); 15720: cb 01 movw r24, r22 15722: 0e 94 f0 ef call 0x1dfe0 ; 0x1dfe0 15726: 0c 94 5f 98 jmp 0x130be ; 0x130be } else if(code_seen('Q')) 1572a: 81 e5 ldi r24, 0x51 ; 81 1572c: 0e 94 b6 55 call 0xab6c ; 0xab6c 15730: 88 23 and r24, r24 15732: 11 f4 brne .+4 ; 0x15738 15734: 0c 94 5f 98 jmp 0x130be ; 0x130be SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 15738: 85 ea ldi r24, 0xA5 ; 165 1573a: 9d e0 ldi r25, 0x0D ; 13 1573c: 0f 94 8b a0 call 0x34116 ; 0x34116 15740: bc 01 movw r22, r24 15742: 90 e0 ldi r25, 0x00 ; 0 15744: 80 e0 ldi r24, 0x00 ; 0 15746: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 1574a: 20 e0 ldi r18, 0x00 ; 0 1574c: 30 e0 ldi r19, 0x00 ; 0 1574e: 4a e7 ldi r20, 0x7A ; 122 15750: 54 e4 ldi r21, 0x44 ; 68 15752: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 15756: 0f 94 2b 41 call 0x28256 ; 0x28256 1575a: 0c 94 5f 98 jmp 0x130be ; 0x130be 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')) 1575e: 81 e5 ldi r24, 0x51 ; 81 15760: 0e 94 b6 55 call 0xab6c ; 0xab6c 15764: 88 23 and r24, r24 15766: 11 f4 brne .+4 ; 0x1576c 15768: 0c 94 5f 98 jmp 0x130be ; 0x130be print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 1576c: b8 01 movw r22, r16 1576e: 90 e0 ldi r25, 0x00 ; 0 15770: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15772: 4a e0 ldi r20, 0x0A ; 10 15774: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 15778: 0f 94 9d 98 call 0x3313a ; 0x3313a 1577c: 0c 94 5f 98 jmp 0x130be ; 0x130be return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 15780: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return _sPrinterMmuName; 15784: 7b ea ldi r23, 0xAB ; 171 15786: e7 2e mov r14, r23 15788: 79 e7 ldi r23, 0x79 ; 121 1578a: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1578c: 81 30 cpi r24, 0x01 ; 1 1578e: 21 f0 breq .+8 ; 0x15798 return _sPrinterMmuName; } else { return _sPrinterName; 15790: 64 ea ldi r22, 0xA4 ; 164 15792: e6 2e mov r14, r22 15794: 69 e7 ldi r22, 0x79 ; 121 15796: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 15798: 80 e5 ldi r24, 0x50 ; 80 1579a: 0e 94 b6 55 call 0xab6c ; 0xab6c 1579e: 88 23 and r24, r24 157a0: b1 f1 breq .+108 ; 0x1580e , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 157a2: 62 e2 ldi r22, 0x22 ; 34 157a4: 70 e0 ldi r23, 0x00 ; 0 157a6: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 157aa: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 157ae: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 157b2: 8c 01 movw r16, r24 if (!this->ptr) { 157b4: 89 2b or r24, r25 157b6: d1 f0 breq .+52 ; 0x157ec // First quote not found return; } // Skip the leading quote this->ptr++; 157b8: 0f 5f subi r16, 0xFF ; 255 157ba: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 157bc: 62 e2 ldi r22, 0x22 ; 34 157be: 70 e0 ldi r23, 0x00 ; 0 157c0: c8 01 movw r24, r16 157c2: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 if(!pStrEnd) { 157c6: 00 97 sbiw r24, 0x00 ; 0 157c8: 89 f0 breq .+34 ; 0x157ec // Second quote not found return; } this->len = pStrEnd - this->ptr; 157ca: d8 2e mov r13, r24 157cc: d0 1a sub r13, r16 157ce: c7 01 movw r24, r14 157d0: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 157d4: d8 12 cpse r13, r24 157d6: 0a c0 rjmp .+20 ; 0x157ec if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 157d8: ac 01 movw r20, r24 157da: 55 27 eor r21, r21 157dc: b7 01 movw r22, r14 157de: c8 01 movw r24, r16 157e0: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 157e4: 89 2b or r24, r25 157e6: 11 f4 brne .+4 ; 0x157ec 157e8: 0c 94 5f 98 jmp 0x130be ; 0x130be } } render_M862_warnings( 157ec: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 157f0: 89 ec ldi r24, 0xC9 ; 201 157f2: 97 e3 ldi r25, 0x37 ; 55 157f4: 0e 94 3c 6d call 0xda78 ; 0xda78 157f8: 8c 01 movw r16, r24 157fa: 81 e9 ldi r24, 0x91 ; 145 157fc: 97 e3 ldi r25, 0x37 ; 55 157fe: 0e 94 3c 6d call 0xda78 ; 0xda78 15802: 4f 2d mov r20, r15 15804: b8 01 movw r22, r16 15806: 0e 94 b1 ef call 0x1df62 ; 0x1df62 1580a: 0c 94 5f 98 jmp 0x130be ; 0x130be { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 1580e: 81 e5 ldi r24, 0x51 ; 81 15810: 0e 94 b6 55 call 0xab6c ; 0xab6c 15814: 88 23 and r24, r24 15816: 11 f4 brne .+4 ; 0x1581c 15818: 0c 94 5f 98 jmp 0x130be ; 0x130be SERIAL_PROTOCOLLNRPGM(type); 1581c: c7 01 movw r24, r14 1581e: 0e 94 de 72 call 0xe5bc ; 0xe5bc 15822: 0c 94 5f 98 jmp 0x130be ; 0x130be } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 15826: 80 e5 ldi r24, 0x50 ; 80 15828: 0e 94 b6 55 call 0xab6c ; 0xab6c 1582c: 88 23 and r24, r24 1582e: 09 f4 brne .+2 ; 0x15832 15830: 77 c0 rjmp .+238 ; 0x15920 fw_version_check(++strchr_pointer); 15832: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15836: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1583a: 01 96 adiw r24, 0x01 ; 1 1583c: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 15840: 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) 15844: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 15848: 22 23 and r18, r18 1584a: 11 f4 brne .+4 ; 0x15850 1584c: 0c 94 5f 98 jmp 0x130be ; 0x130be return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 15850: be 01 movw r22, r28 15852: 6f 5f subi r22, 0xFF ; 255 15854: 7f 4f sbci r23, 0xFF ; 255 15856: 0e 94 11 e1 call 0x1c222 ; 0x1c222 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 1585a: 8a e0 ldi r24, 0x0A ; 10 1585c: 90 e0 ldi r25, 0x00 ; 0 1585e: 0f 94 8b a0 call 0x34116 ; 0x34116 15862: 29 81 ldd r18, Y+1 ; 0x01 15864: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15866: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 15868: 82 17 cp r24, r18 1586a: 93 07 cpc r25, r19 1586c: 28 f0 brcs .+10 ; 0x15878 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1586e: 11 e0 ldi r17, 0x01 ; 1 15870: 28 17 cp r18, r24 15872: 39 07 cpc r19, r25 15874: 08 f4 brcc .+2 ; 0x15878 15876: 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; 15878: 12 95 swap r17 1587a: 11 0f add r17, r17 1587c: 11 0f add r17, r17 1587e: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 15880: 8c e0 ldi r24, 0x0C ; 12 15882: 90 e0 ldi r25, 0x00 ; 0 15884: 0f 94 8b a0 call 0x34116 ; 0x34116 15888: ac 01 movw r20, r24 1588a: 2b 81 ldd r18, Y+3 ; 0x03 1588c: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1588e: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 15890: 42 17 cp r20, r18 15892: 53 07 cpc r21, r19 15894: 28 f0 brcs .+10 ; 0x158a0 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 15896: 81 e0 ldi r24, 0x01 ; 1 15898: 24 17 cp r18, r20 1589a: 35 07 cpc r19, r21 1589c: 08 f4 brcc .+2 ; 0x158a0 1589e: 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; 158a0: 50 e1 ldi r21, 0x10 ; 16 158a2: 85 9f mul r24, r21 158a4: c0 01 movw r24, r0 158a6: 11 24 eor r1, r1 158a8: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 158aa: 8e e0 ldi r24, 0x0E ; 14 158ac: 90 e0 ldi r25, 0x00 ; 0 158ae: 0f 94 8b a0 call 0x34116 ; 0x34116 158b2: ac 01 movw r20, r24 158b4: 2d 81 ldd r18, Y+5 ; 0x05 158b6: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158b8: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158ba: 42 17 cp r20, r18 158bc: 53 07 cpc r21, r19 158be: 28 f0 brcs .+10 ; 0x158ca return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158c0: 81 e0 ldi r24, 0x01 ; 1 158c2: 24 17 cp r18, r20 158c4: 35 07 cpc r19, r21 158c6: 08 f4 brcc .+2 ; 0x158ca 158c8: 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; 158ca: a4 e0 ldi r26, 0x04 ; 4 158cc: 8a 9f mul r24, r26 158ce: c0 01 movw r24, r0 158d0: 11 24 eor r1, r1 158d2: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 158d4: 80 e1 ldi r24, 0x10 ; 16 158d6: 90 e0 ldi r25, 0x00 ; 0 158d8: 0f 94 8b a0 call 0x34116 ; 0x34116 158dc: ac 01 movw r20, r24 158de: 2f 81 ldd r18, Y+7 ; 0x07 158e0: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158e2: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158e4: 42 17 cp r20, r18 158e6: 53 07 cpc r21, r19 158e8: 28 f0 brcs .+10 ; 0x158f4 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158ea: 91 e0 ldi r25, 0x01 ; 1 158ec: 24 17 cp r18, r20 158ee: 35 07 cpc r19, r21 158f0: 08 f4 brcc .+2 ; 0x158f4 158f2: 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)); 158f4: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 158f6: 16 35 cpi r17, 0x56 ; 86 158f8: 10 f4 brcc .+4 ; 0x158fe 158fa: 0c 94 5f 98 jmp 0x130be ; 0x130be SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 158fe: f0 90 b7 03 lds r15, 0x03B7 ; 0x8003b7 15902: 8e e3 ldi r24, 0x3E ; 62 15904: 97 e3 ldi r25, 0x37 ; 55 15906: 0e 94 3c 6d call 0xda78 ; 0xda78 1590a: 8c 01 movw r16, r24 1590c: 8e e0 ldi r24, 0x0E ; 14 1590e: 97 e3 ldi r25, 0x37 ; 55 15910: 0e 94 3c 6d call 0xda78 ; 0xda78 15914: 4f 2d mov r20, r15 15916: b8 01 movw r22, r16 15918: 0e 94 b1 ef call 0x1df62 ; 0x1df62 1591c: 0c 94 5f 98 jmp 0x130be ; 0x130be else if(code_seen('Q')) 15920: 81 e5 ldi r24, 0x51 ; 81 15922: 0e 94 b6 55 call 0xab6c ; 0xab6c 15926: 88 23 and r24, r24 15928: 11 f4 brne .+4 ; 0x1592e 1592a: 0c 94 5f 98 jmp 0x130be ; 0x130be 1592e: 0c 94 29 94 jmp 0x12852 ; 0x12852 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 15932: 81 e5 ldi r24, 0x51 ; 81 15934: 0e 94 b6 55 call 0xab6c ; 0xab6c 15938: 88 23 and r24, r24 1593a: 11 f4 brne .+4 ; 0x15940 1593c: 0c 94 5f 98 jmp 0x130be ; 0x130be SERIAL_PROTOCOLLN(GCODE_LEVEL); 15940: 81 e0 ldi r24, 0x01 ; 1 15942: 90 e0 ldi r25, 0x00 ; 0 15944: 0f 94 48 41 call 0x28290 ; 0x28290 15948: 0c 94 5f 98 jmp 0x130be ; 0x130be * 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; 1594c: 8b e4 ldi r24, 0x4B ; 75 1594e: 0e 94 b6 55 call 0xab6c ; 0xab6c 15952: c1 2c mov r12, r1 15954: d1 2c mov r13, r1 15956: e1 2c mov r14, r1 15958: 50 ec ldi r21, 0xC0 ; 192 1595a: f5 2e mov r15, r21 1595c: 88 23 and r24, r24 1595e: 49 f1 breq .+82 ; 0x159b2 15960: 0e 94 8e 5a call 0xb51c ; 0xb51c 15964: 6b 01 movw r12, r22 15966: 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) 15968: 20 e0 ldi r18, 0x00 ; 0 1596a: 30 e0 ldi r19, 0x00 ; 0 1596c: a9 01 movw r20, r18 1596e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 15972: 81 11 cpse r24, r1 15974: 1e c0 rjmp .+60 ; 0x159b2 { extruder_advance_K = 0; 15976: 10 92 e1 16 sts 0x16E1, r1 ; 0x8016e1 1597a: 10 92 e2 16 sts 0x16E2, r1 ; 0x8016e2 1597e: 10 92 e3 16 sts 0x16E3, r1 ; 0x8016e3 15982: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 15986: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 1598a: 87 e7 ldi r24, 0x77 ; 119 1598c: 9e e9 ldi r25, 0x9E ; 158 1598e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM("Advance K="); 15992: 81 e8 ldi r24, 0x81 ; 129 15994: 99 e7 ldi r25, 0x79 ; 121 15996: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(extruder_advance_K); 1599a: 60 91 e1 16 lds r22, 0x16E1 ; 0x8016e1 1599e: 70 91 e2 16 lds r23, 0x16E2 ; 0x8016e2 159a2: 80 91 e3 16 lds r24, 0x16E3 ; 0x8016e3 159a6: 90 91 e4 16 lds r25, 0x16E4 ; 0x8016e4 159aa: 0f 94 2b 41 call 0x28256 ; 0x28256 159ae: 0c 94 5f 98 jmp 0x130be ; 0x130be } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 159b2: 80 91 45 03 lds r24, 0x0345 ; 0x800345 159b6: 81 11 cpse r24, r1 159b8: 1b c0 rjmp .+54 ; 0x159f0 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 159ba: 20 e0 ldi r18, 0x00 ; 0 159bc: 30 e0 ldi r19, 0x00 ; 0 159be: a9 01 movw r20, r18 159c0: c7 01 movw r24, r14 159c2: b6 01 movw r22, r12 159c4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 159c8: 87 ff sbrs r24, 7 159ca: 05 c0 rjmp .+10 ; 0x159d6 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 159cc: 8c e8 ldi r24, 0x8C ; 140 159ce: 99 e7 ldi r25, 0x79 ; 121 159d0: 0e 94 de 72 call 0xe5bc ; 0xe5bc 159d4: da cf rjmp .-76 ; 0x1598a return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 159d6: 20 e0 ldi r18, 0x00 ; 0 159d8: 30 e0 ldi r19, 0x00 ; 0 159da: 40 e2 ldi r20, 0x20 ; 32 159dc: 51 e4 ldi r21, 0x41 ; 65 159de: c7 01 movw r24, r14 159e0: b6 01 movw r22, r12 159e2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 159e6: 87 ff sbrs r24, 7 159e8: 2c c0 rjmp .+88 ; 0x15a42 159ea: 81 e0 ldi r24, 0x01 ; 1 159ec: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 } if(la10c_mode == LA10C_LA15) 159f0: 80 91 45 03 lds r24, 0x0345 ; 0x800345 return (k >= 0 && k < LA_K_MAX? k: -1); 159f4: 20 e0 ldi r18, 0x00 ; 0 159f6: 30 e0 ldi r19, 0x00 ; 0 159f8: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 159fa: 81 30 cpi r24, 0x01 ; 1 159fc: 21 f5 brne .+72 ; 0x15a46 return (k >= 0 && k < LA_K_MAX? k: -1); 159fe: c7 01 movw r24, r14 15a00: b6 01 movw r22, r12 15a02: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 15a06: 87 fd sbrc r24, 7 15a08: e1 cf rjmp .-62 ; 0x159cc 15a0a: 20 e0 ldi r18, 0x00 ; 0 15a0c: 30 e0 ldi r19, 0x00 ; 0 15a0e: 40 e2 ldi r20, 0x20 ; 32 15a10: 51 e4 ldi r21, 0x41 ; 65 15a12: c7 01 movw r24, r14 15a14: b6 01 movw r22, r12 15a16: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 15a1a: 87 ff sbrs r24, 7 15a1c: d7 cf rjmp .-82 ; 0x159cc la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 15a1e: 20 e0 ldi r18, 0x00 ; 0 15a20: 30 e0 ldi r19, 0x00 ; 0 15a22: a9 01 movw r20, r18 15a24: c7 01 movw r24, r14 15a26: b6 01 movw r22, r12 15a28: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 15a2c: 87 fd sbrc r24, 7 15a2e: ce cf rjmp .-100 ; 0x159cc SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 15a30: c0 92 e1 16 sts 0x16E1, r12 ; 0x8016e1 15a34: d0 92 e2 16 sts 0x16E2, r13 ; 0x8016e2 15a38: e0 92 e3 16 sts 0x16E3, r14 ; 0x8016e3 15a3c: f0 92 e4 16 sts 0x16E4, r15 ; 0x8016e4 15a40: a4 cf rjmp .-184 ; 0x1598a if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 15a42: 82 e0 ldi r24, 0x02 ; 2 15a44: d3 cf rjmp .-90 ; 0x159ec } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 15a46: c7 01 movw r24, r14 15a48: b6 01 movw r22, r12 15a4a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 15a4e: 87 fd sbrc r24, 7 15a50: bd cf rjmp .-134 ; 0x159cc // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 15a52: 2f e6 ldi r18, 0x6F ; 111 15a54: 32 e1 ldi r19, 0x12 ; 18 15a56: 43 e0 ldi r20, 0x03 ; 3 15a58: 5b e3 ldi r21, 0x3B ; 59 15a5a: c7 01 movw r24, r14 15a5c: b6 01 movw r22, r12 15a5e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 15a62: 2a e0 ldi r18, 0x0A ; 10 15a64: 37 ed ldi r19, 0xD7 ; 215 15a66: 43 e2 ldi r20, 0x23 ; 35 15a68: 5c e3 ldi r21, 0x3C ; 60 15a6a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 15a6e: 6b 01 movw r12, r22 15a70: 7c 01 movw r14, r24 return new_K < 0? 0: 15a72: 20 e0 ldi r18, 0x00 ; 0 15a74: 30 e0 ldi r19, 0x00 ; 0 15a76: a9 01 movw r20, r18 15a78: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 15a7c: 87 fd sbrc r24, 7 15a7e: 11 c0 rjmp .+34 ; 0x15aa2 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 15a80: 20 e0 ldi r18, 0x00 ; 0 15a82: 30 e0 ldi r19, 0x00 ; 0 15a84: 40 e2 ldi r20, 0x20 ; 32 15a86: 51 e4 ldi r21, 0x41 ; 65 15a88: c7 01 movw r24, r14 15a8a: b6 01 movw r22, r12 15a8c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 15a90: 18 16 cp r1, r24 15a92: 2c f6 brge .-118 ; 0x15a1e 15a94: c1 2c mov r12, r1 15a96: d1 2c mov r13, r1 15a98: 40 e2 ldi r20, 0x20 ; 32 15a9a: e4 2e mov r14, r20 15a9c: 41 e4 ldi r20, 0x41 ; 65 15a9e: f4 2e mov r15, r20 15aa0: c7 cf rjmp .-114 ; 0x15a30 // 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: 15aa2: c1 2c mov r12, r1 15aa4: d1 2c mov r13, r1 15aa6: 76 01 movw r14, r12 15aa8: c3 cf rjmp .-122 ; 0x15a30 } } 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()); 15aaa: 83 e5 ldi r24, 0x53 ; 83 15aac: 0e 94 b6 55 call 0xab6c ; 0xab6c 15ab0: 88 23 and r24, r24 15ab2: 59 f0 breq .+22 ; 0x15aca 15ab4: 10 e0 ldi r17, 0x00 ; 0 15ab6: 0e 94 8e 5a call 0xb51c ; 0xb51c 15aba: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 15abe: 81 2f mov r24, r17 15ac0: 0f 94 4a 21 call 0x24294 ; 0x24294 15ac4: 1f 5f subi r17, 0xFF ; 255 15ac6: 15 30 cpi r17, 0x05 ; 5 15ac8: b1 f7 brne .-20 ; 0x15ab6 15aca: 34 ec ldi r19, 0xC4 ; 196 15acc: e3 2e mov r14, r19 15ace: 32 e0 ldi r19, 0x02 ; 2 15ad0: f3 2e mov r15, r19 15ad2: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 15ade: 88 23 and r24, r24 15ae0: 39 f0 breq .+14 ; 0x15af0 15ae2: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ae6: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 15aea: 81 2f mov r24, r17 15aec: 0f 94 4a 21 call 0x24294 ; 0x24294 15af0: 1f 5f subi r17, 0xFF ; 255 15af2: 14 30 cpi r17, 0x04 ; 4 15af4: 79 f7 brne .-34 ; 0x15ad4 if(code_seen('B')) microstep_mode(4,code_value()); 15af6: 82 e4 ldi r24, 0x42 ; 66 15af8: 0e 94 b6 55 call 0xab6c ; 0xab6c 15afc: 88 23 and r24, r24 15afe: 39 f0 breq .+14 ; 0x15b0e 15b00: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b04: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 15b08: 84 e0 ldi r24, 0x04 ; 4 15b0a: 0f 94 4a 21 call 0x24294 ; 0x24294 microstep_readings(); 15b0e: 0f 94 70 20 call 0x240e0 ; 0x240e0 15b12: 0c 94 5f 98 jmp 0x130be ; 0x130be 15b16: 24 ec ldi r18, 0xC4 ; 196 15b18: e2 2e mov r14, r18 15b1a: 22 e0 ldi r18, 0x02 ; 2 15b1c: 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()) 15b1e: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 15b2a: 88 23 and r24, r24 15b2c: 41 f0 breq .+16 ; 0x15b3e 15b2e: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b32: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 15b36: 4f ef ldi r20, 0xFF ; 255 15b38: 81 2f mov r24, r17 15b3a: 0f 94 cb 20 call 0x24196 ; 0x24196 15b3e: 1f 5f subi r17, 0xFF ; 255 15b40: 14 30 cpi r17, 0x04 ; 4 15b42: 71 f7 brne .-36 ; 0x15b20 if(code_seen('B')) microstep_ms(4,code_value(),-1); 15b44: 82 e4 ldi r24, 0x42 ; 66 15b46: 0e 94 b6 55 call 0xab6c ; 0xab6c 15b4a: 88 23 and r24, r24 15b4c: 11 f4 brne .+4 ; 0x15b52 15b4e: 0c 94 9c 96 jmp 0x12d38 ; 0x12d38 15b52: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b56: 0c 94 9c 96 jmp 0x12d38 ; 0x12d38 15b5a: 94 ec ldi r25, 0xC4 ; 196 15b5c: e9 2e mov r14, r25 15b5e: 92 e0 ldi r25, 0x02 ; 2 15b60: 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()) 15b62: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 15b6e: 88 23 and r24, r24 15b70: 49 f0 breq .+18 ; 0x15b84 15b72: 0e 94 8e 5a call 0xb51c ; 0xb51c 15b76: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 15b7a: 46 2f mov r20, r22 15b7c: 6f ef ldi r22, 0xFF ; 255 15b7e: 81 2f mov r24, r17 15b80: 0f 94 cb 20 call 0x24196 ; 0x24196 15b84: 1f 5f subi r17, 0xFF ; 255 15b86: 14 30 cpi r17, 0x04 ; 4 15b88: 69 f7 brne .-38 ; 0x15b64 15b8a: dc cf rjmp .-72 ; 0x15b44 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15b8c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15b90: 81 30 cpi r24, 0x01 ; 1 15b92: c1 f1 breq .+112 ; 0x15c04 - `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; 15b94: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15b96: 8c e4 ldi r24, 0x4C ; 76 15b98: 0e 94 b6 55 call 0xab6c ; 0xab6c 15b9c: 88 23 and r24, r24 15b9e: 09 f4 brne .+2 ; 0x15ba2 15ba0: 40 c0 rjmp .+128 ; 0x15c22 15ba2: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ba6: 6b 01 movw r12, r22 15ba8: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15baa: 8a e5 ldi r24, 0x5A ; 90 15bac: 0e 94 b6 55 call 0xab6c ; 0xab6c 15bb0: 88 23 and r24, r24 15bb2: f1 f1 breq .+124 ; 0x15c30 15bb4: 0e 94 8e 5a call 0xb51c ; 0xb51c 15bb8: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15bba: 0e 94 68 67 call 0xced0 ; 0xced0 15bbe: 4b 01 movw r8, r22 15bc0: 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 15bc2: 8a e5 ldi r24, 0x5A ; 90 15bc4: 0e 94 b6 55 call 0xab6c ; 0xab6c 15bc8: 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; 15bca: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15bce: 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); 15bd2: 86 e1 ldi r24, 0x16 ; 22 15bd4: 0f 94 a0 98 call 0x33140 ; 0x33140 if (MMU2::mmu2.Enabled()) { 15bd8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15bdc: 81 30 cpi r24, 0x01 ; 1 15bde: 61 f5 brne .+88 ; 0x15c38 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15be0: 15 30 cpi r17, 0x05 ; 5 15be2: 18 f4 brcc .+6 ; 0x15bea MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 15be4: 81 2f mov r24, r17 15be6: 0e 94 cb f6 call 0x1ed96 ; 0x1ed96 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15bea: 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(); } 15bee: 84 e8 ldi r24, 0x84 ; 132 15bf0: 96 e1 ldi r25, 0x16 ; 22 15bf2: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 // 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); 15bf6: c5 01 movw r24, r10 15bf8: b4 01 movw r22, r8 15bfa: 90 58 subi r25, 0x80 ; 128 15bfc: 0e 94 68 67 call 0xced0 ; 0xced0 15c00: 0c 94 5f 98 jmp 0x130be ; 0x130be 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') ) { 15c04: 80 e5 ldi r24, 0x50 ; 80 15c06: 0e 94 b6 55 call 0xab6c ; 0xab6c 15c0a: 88 23 and r24, r24 15c0c: 21 f0 breq .+8 ; 0x15c16 mmuSlotIndex = code_value_uint8(); 15c0e: 0e 94 cb 55 call 0xab96 ; 0xab96 15c12: 18 2f mov r17, r24 15c14: c0 cf rjmp .-128 ; 0x15b96 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') ) { 15c16: 84 e5 ldi r24, 0x54 ; 84 15c18: 0e 94 b6 55 call 0xab6c ; 0xab6c 15c1c: 81 11 cpse r24, r1 15c1e: f7 cf rjmp .-18 ; 0x15c0e 15c20: b9 cf rjmp .-142 ; 0x15b94 - `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 15c22: c1 2c mov r12, r1 15c24: d1 2c mov r13, r1 15c26: 8c e8 ldi r24, 0x8C ; 140 15c28: e8 2e mov r14, r24 15c2a: 82 e4 ldi r24, 0x42 ; 66 15c2c: f8 2e mov r15, r24 15c2e: bd cf rjmp .-134 ; 0x15baa float z_target = 0; 15c30: 60 e0 ldi r22, 0x00 ; 0 15c32: 70 e0 ldi r23, 0x00 ; 0 15c34: cb 01 movw r24, r22 15c36: c1 cf rjmp .-126 ; 0x15bba 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; 15c38: 82 e0 ldi r24, 0x02 ; 2 15c3a: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 15c3e: 84 ec ldi r24, 0xC4 ; 196 15c40: 9a e5 ldi r25, 0x5A ; 90 15c42: 0e 94 3c 6d call 0xda78 ; 0xda78 15c46: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe current_position[E_AXIS] += fastLoadLength; 15c4a: a7 01 movw r20, r14 15c4c: 96 01 movw r18, r12 15c4e: 60 91 01 12 lds r22, 0x1201 ; 0x801201 15c52: 70 91 02 12 lds r23, 0x1202 ; 0x801202 15c56: 80 91 03 12 lds r24, 0x1203 ; 0x801203 15c5a: 90 91 04 12 lds r25, 0x1204 ; 0x801204 15c5e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 15c62: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15c66: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15c6a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 15c6e: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 15c72: 60 e0 ldi r22, 0x00 ; 0 15c74: 70 e0 ldi r23, 0x00 ; 0 15c76: 80 ea ldi r24, 0xA0 ; 160 15c78: 91 e4 ldi r25, 0x41 ; 65 15c7a: 0f 94 11 85 call 0x30a22 ; 0x30a22 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 15c7e: 01 11 cpse r16, r1 15c80: 06 c0 rjmp .+12 ; 0x15c8e raise_z_above(MIN_Z_FOR_LOAD); 15c82: 60 e0 ldi r22, 0x00 ; 0 15c84: 70 e0 ldi r23, 0x00 ; 0 15c86: 88 e4 ldi r24, 0x48 ; 72 15c88: 92 e4 ldi r25, 0x42 ; 66 15c8a: 0e 94 ca 67 call 0xcf94 ; 0xcf94 } load_filament_final_feed(); // slow sequence 15c8e: 0e 94 00 5f call 0xbe00 ; 0xbe00 st_synchronize(); 15c92: 0f 94 14 22 call 0x24428 ; 0x24428 Sound_MakeCustom(50, 500, false); 15c96: 40 e0 ldi r20, 0x00 ; 0 15c98: 64 ef ldi r22, 0xF4 ; 244 15c9a: 71 e0 ldi r23, 0x01 ; 1 15c9c: 82 e3 ldi r24, 0x32 ; 50 15c9e: 90 e0 ldi r25, 0x00 ; 0 15ca0: 0f 94 61 31 call 0x262c2 ; 0x262c2 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 15ca4: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15ca8: 81 11 cpse r24, r1 15caa: 05 c0 rjmp .+10 ; 0x15cb6 15cac: 80 91 62 03 lds r24, 0x0362 ; 0x800362 15cb0: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 15cb2: 0f 94 7b 2f call 0x25ef6 ; 0x25ef6 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 15cb6: 81 e0 ldi r24, 0x01 ; 1 15cb8: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_update(2); 15cbc: 82 e0 ldi r24, 0x02 ; 2 15cbe: 0e 94 cd 69 call 0xd39a ; 0xd39a lcd_setstatuspgm(MSG_WELCOME); 15cc2: 8b e0 ldi r24, 0x0B ; 11 15cc4: 9c e6 ldi r25, 0x6C ; 108 15cc6: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = CustomMsg::Status; 15cca: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 15cce: 8d cf rjmp .-230 ; 0x15bea */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 15cd0: 85 e5 ldi r24, 0x55 ; 85 15cd2: 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; 15cd6: c1 2c mov r12, r1 15cd8: d1 2c mov r13, r1 15cda: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 15cdc: 88 23 and r24, r24 15cde: 21 f0 breq .+8 ; 0x15ce8 15ce0: 0e 94 8e 5a call 0xb51c ; 0xb51c 15ce4: 6b 01 movw r12, r22 15ce6: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15ce8: 8a e5 ldi r24, 0x5A ; 90 15cea: 0e 94 b6 55 call 0xab6c ; 0xab6c 15cee: 88 23 and r24, r24 15cf0: a1 f0 breq .+40 ; 0x15d1a 15cf2: 0e 94 8e 5a call 0xb51c ; 0xb51c 15cf6: 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); 15cf8: 0e 94 68 67 call 0xced0 ; 0xced0 15cfc: 4b 01 movw r8, r22 15cfe: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 15d00: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d04: 81 30 cpi r24, 0x01 ; 1 15d06: 99 f4 brne .+38 ; 0x15d2e 15d08: 0f 94 34 6b call 0x2d668 ; 0x2d668 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 15d0c: c5 01 movw r24, r10 15d0e: b4 01 movw r22, r8 15d10: 90 58 subi r25, 0x80 ; 128 15d12: 0e 94 68 67 call 0xced0 ; 0xced0 15d16: 0c 94 5f 98 jmp 0x130be ; 0x130be 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 15d1a: 60 e0 ldi r22, 0x00 ; 0 15d1c: 70 e0 ldi r23, 0x00 ; 0 15d1e: 80 ea ldi r24, 0xA0 ; 160 15d20: 91 e4 ldi r25, 0x41 ; 65 15d22: 0e 94 ca 67 call 0xcf94 ; 0xcf94 - `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; 15d26: 60 e0 ldi r22, 0x00 ; 0 15d28: 70 e0 ldi r23, 0x00 ; 0 15d2a: cb 01 movw r24, r22 15d2c: e5 cf rjmp .-54 ; 0x15cf8 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 15d2e: c7 01 movw r24, r14 15d30: b6 01 movw r22, r12 15d32: 0e 94 1e f0 call 0x1e03c ; 0x1e03c 15d36: ea cf rjmp .-44 ; 0x15d0c #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15d38: 80 ec ldi r24, 0xC0 ; 192 15d3a: 92 e0 ldi r25, 0x02 ; 2 15d3c: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 15d40: 0c 94 5f 98 jmp 0x130be ; 0x130be #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 15d44: 81 ec ldi r24, 0xC1 ; 193 15d46: 92 e0 ldi r25, 0x02 ; 2 15d48: 0e 94 54 5a call 0xb4a8 ; 0xb4a8 15d4c: 0c 94 5f 98 jmp 0x130be ; 0x130be 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() ) { 15d50: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d54: 81 30 cpi r24, 0x01 ; 1 15d56: 11 f0 breq .+4 ; 0x15d5c 15d58: 0c 94 5f 98 jmp 0x130be ; 0x130be if( code_seen('A') ) { 15d5c: 81 e4 ldi r24, 0x41 ; 65 15d5e: 0e 94 b6 55 call 0xab6c ; 0xab6c 15d62: 88 23 and r24, r24 15d64: 11 f4 brne .+4 ; 0x15d6a 15d66: 0c 94 5f 98 jmp 0x130be ; 0x130be MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 15d6a: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15d6e: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15d72: 40 e1 ldi r20, 0x10 ; 16 15d74: 50 e0 ldi r21, 0x00 ; 0 15d76: 70 e0 ldi r23, 0x00 ; 0 15d78: 60 e0 ldi r22, 0x00 ; 0 15d7a: 01 96 adiw r24, 0x01 ; 1 15d7c: 0f 94 08 9c call 0x33810 ; 0x33810 15d80: 86 2f mov r24, r22 15d82: 0e 94 4f f7 call 0x1ee9e ; 0x1ee9e 15d86: 0c 94 5f 98 jmp 0x130be ; 0x130be 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() ){ 15d8a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d8e: 81 30 cpi r24, 0x01 ; 1 15d90: 11 f0 breq .+4 ; 0x15d96 15d92: 0c 94 5f 98 jmp 0x130be ; 0x130be uint8_t addr = 0; if( code_seen('A') ) { 15d96: 81 e4 ldi r24, 0x41 ; 65 15d98: 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; 15d9c: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 15d9e: 88 23 and r24, r24 15da0: 61 f0 breq .+24 ; 0x15dba addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 15da2: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15da6: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15daa: 40 e1 ldi r20, 0x10 ; 16 15dac: 50 e0 ldi r21, 0x00 ; 0 15dae: 70 e0 ldi r23, 0x00 ; 0 15db0: 60 e0 ldi r22, 0x00 ; 0 15db2: 01 96 adiw r24, 0x01 ; 1 15db4: 0f 94 08 9c call 0x33810 ; 0x33810 15db8: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 15dba: 88 e5 ldi r24, 0x58 ; 88 15dbc: 0e 94 b6 55 call 0xab6c ; 0xab6c 15dc0: 88 23 and r24, r24 15dc2: 61 f0 breq .+24 ; 0x15ddc data = code_value_short(); 15dc4: 0e 94 d8 55 call 0xabb0 ; 0xabb0 } if(addr){ 15dc8: 11 23 and r17, r17 15dca: 11 f4 brne .+4 ; 0x15dd0 15dcc: 0c 94 5f 98 jmp 0x130be ; 0x130be MMU2::mmu2.WriteRegister(addr, data); 15dd0: bc 01 movw r22, r24 15dd2: 81 2f mov r24, r17 15dd4: 0e 94 9a bf call 0x17f34 ; 0x17f34 15dd8: 0c 94 5f 98 jmp 0x130be ; 0x130be 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; 15ddc: 90 e0 ldi r25, 0x00 ; 0 15dde: 80 e0 ldi r24, 0x00 ; 0 15de0: f3 cf rjmp .-26 ; 0x15dc8 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15de2: 83 e5 ldi r24, 0x53 ; 83 15de4: 0e 94 b6 55 call 0xab6c ; 0xab6c 15de8: 88 23 and r24, r24 15dea: 31 f0 breq .+12 ; 0x15df8 { switch (code_value_uint8()) 15dec: 0e 94 cb 55 call 0xab96 ; 0xab96 15df0: 88 23 and r24, r24 15df2: a9 f0 breq .+42 ; 0x15e1e 15df4: 81 30 cpi r24, 0x01 ; 1 15df6: f9 f0 breq .+62 ; 0x15e36 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 15df8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15dfc: 81 30 cpi r24, 0x01 ; 1 15dfe: 59 f4 brne .+22 ; 0x15e16 15e00: 88 e5 ldi r24, 0x58 ; 88 15e02: 0e 94 b6 55 call 0xab6c ; 0xab6c 15e06: 88 23 and r24, r24 15e08: 31 f0 breq .+12 ; 0x15e16 { switch (code_value_uint8()) 15e0a: 0e 94 cb 55 call 0xab96 ; 0xab96 15e0e: 82 30 cpi r24, 0x02 ; 2 15e10: d0 f0 brcs .+52 ; 0x15e46 15e12: 8a 32 cpi r24, 0x2A ; 42 15e14: e1 f0 breq .+56 ; 0x15e4e break; default: break; } } MMU2::mmu2.Status(); 15e16: 0f 94 36 41 call 0x2826c ; 0x2826c 15e1a: 0c 94 5f 98 jmp 0x130be ; 0x130be if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15e1e: 60 e0 ldi r22, 0x00 ; 0 15e20: 8c ea ldi r24, 0xAC ; 172 15e22: 9c e0 ldi r25, 0x0C ; 12 15e24: 0f 94 a1 a0 call 0x34142 ; 0x34142 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 15e28: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 15e2c: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 15e30: 10 92 27 12 sts 0x1227, r1 ; 0x801227 15e34: e1 cf rjmp .-62 ; 0x15df8 15e36: 61 e0 ldi r22, 0x01 ; 1 15e38: 8c ea ldi r24, 0xAC ; 172 15e3a: 9c e0 ldi r25, 0x0C ; 12 15e3c: 0f 94 a1 a0 call 0x34142 ; 0x34142 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(); 15e40: 0f 94 3b 63 call 0x2c676 ; 0x2c676 15e44: d9 cf rjmp .-78 ; 0x15df8 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 15e46: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 15e48: 0f 94 fe 62 call 0x2c5fc ; 0x2c5fc 15e4c: e4 cf rjmp .-56 ; 0x15e16 15e4e: 8a e2 ldi r24, 0x2A ; 42 15e50: fb cf rjmp .-10 ; 0x15e48 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') { 15e52: 84 35 cpi r24, 0x54 ; 84 15e54: 09 f0 breq .+2 ; 0x15e58 15e56: 79 c0 rjmp .+242 ; 0x15f4a strchr_pointer = CMDBUFFER_CURRENT_STRING; 15e58: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15e5c: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 processing_tcode = true; 15e60: 81 e0 ldi r24, 0x01 ; 1 15e62: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f TCodes(strchr_pointer, code_value_uint8()); 15e66: 0e 94 cb 55 call 0xab96 ; 0xab96 15e6a: 18 2f mov r17, r24 15e6c: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 15e70: 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; 15e74: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 15e76: 79 01 movw r14, r18 15e78: e9 0e add r14, r25 15e7a: f1 1c adc r15, r1 15e7c: d7 01 movw r26, r14 15e7e: 8c 91 ld r24, X 15e80: 80 32 cpi r24, 0x20 ; 32 15e82: 11 f0 breq .+4 ; 0x15e88 15e84: 89 30 cpi r24, 0x09 ; 9 15e86: 11 f4 brne .+4 ; 0x15e8c 15e88: 9f 5f subi r25, 0xFF ; 255 15e8a: f5 cf rjmp .-22 ; 0x15e76 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 15e8c: 08 2e mov r0, r24 15e8e: 00 0c add r0, r0 15e90: 99 0b sbc r25, r25 15e92: 0f 94 91 a6 call 0x34d22 ; 0x34d22 15e96: f7 01 movw r30, r14 15e98: 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'); 15e9a: 90 ed ldi r25, 0xD0 ; 208 15e9c: 98 0f add r25, r24 15e9e: 95 30 cpi r25, 0x05 ; 5 15ea0: 58 f0 brcs .+22 ; 0x15eb8 15ea2: 8f 33 cpi r24, 0x3F ; 63 15ea4: 69 f0 breq .+26 ; 0x15ec0 15ea6: 88 37 cpi r24, 0x78 ; 120 15ea8: 59 f0 breq .+22 ; 0x15ec0 15eaa: 83 36 cpi r24, 0x63 ; 99 15eac: 01 f1 breq .+64 ; 0x15eee } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 15eae: 87 e5 ldi r24, 0x57 ; 87 15eb0: 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 15eb2: 0e 94 de 72 call 0xe5bc ; 0xe5bc 15eb6: 15 c0 rjmp .+42 ; 0x15ee2 15eb8: 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] == '?'){ 15ebc: 8f 33 cpi r24, 0x3F ; 63 15ebe: a9 f4 brne .+42 ; 0x15eea // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 15ec0: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ec4: 81 30 cpi r24, 0x01 ; 1 15ec6: 69 f4 brne .+26 ; 0x15ee2 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 15ec8: 86 e8 ldi r24, 0x86 ; 134 15eca: 9e e3 ldi r25, 0x3E ; 62 15ecc: 0e 94 3c 6d call 0xda78 ; 0xda78 15ed0: 70 e0 ldi r23, 0x00 ; 0 15ed2: 60 e0 ldi r22, 0x00 ; 0 15ed4: 0e 94 e5 bc call 0x179ca ; 0x179ca 15ed8: 68 2f mov r22, r24 15eda: d7 01 movw r26, r14 15edc: 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()); 15ede: 0e 94 04 f7 call 0x1ee08 ; 0x1ee08 processing_tcode = false; 15ee2: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f 15ee6: 0c 94 ba 84 jmp 0x10974 ; 0x10974 } 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'){ 15eea: 83 36 cpi r24, 0x63 ; 99 15eec: 49 f4 brne .+18 ; 0x15f00 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 15eee: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ef2: 81 30 cpi r24, 0x01 ; 1 15ef4: b1 f7 brne .-20 ; 0x15ee2 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 15ef6: 0f 94 30 41 call 0x28260 ; 0x28260 15efa: 68 2f mov r22, r24 15efc: 83 e6 ldi r24, 0x63 ; 99 15efe: ef cf rjmp .-34 ; 0x15ede } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 15f00: 91 30 cpi r25, 0x01 ; 1 15f02: 69 f4 brne .+26 ; 0x15f1e if (codeValue == MMU2::mmu2.get_current_tool()){ 15f04: 0f 94 30 41 call 0x28260 ; 0x28260 15f08: 18 13 cpse r17, r24 15f0a: 05 c0 rjmp .+10 ; 0x15f16 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 15f0c: 87 e6 ldi r24, 0x67 ; 103 15f0e: 99 e7 ldi r25, 0x79 ; 121 15f10: 0f 94 66 9f call 0x33ecc ; 0x33ecc 15f14: e6 cf rjmp .-52 ; 0x15ee2 #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); 15f16: 81 2f mov r24, r17 15f18: 0e 94 9c f3 call 0x1e738 ; 0x1e738 15f1c: e2 cf rjmp .-60 ; 0x15ee2 } } else { SERIAL_ECHO_START; 15f1e: 87 e7 ldi r24, 0x77 ; 119 15f20: 9e e9 ldi r25, 0x9E ; 158 15f22: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (codeValue >= EXTRUDERS) { 15f26: 11 23 and r17, r17 15f28: 59 f0 breq .+22 ; 0x15f40 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15f2a: 84 e5 ldi r24, 0x54 ; 84 15f2c: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 15f30: 81 2f mov r24, r17 15f32: 90 e0 ldi r25, 0x00 ; 0 15f34: c0 96 adiw r24, 0x30 ; 48 15f36: 0f 94 48 41 call 0x28290 ; 0x28290 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15f3a: 88 e8 ldi r24, 0x88 ; 136 15f3c: 95 e6 ldi r25, 0x65 ; 101 15f3e: b9 cf rjmp .-142 ; 0x15eb2 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 15f40: 85 e7 ldi r24, 0x75 ; 117 15f42: 95 e6 ldi r25, 0x65 ; 101 15f44: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 15f48: cc cf rjmp .-104 ; 0x15ee2 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 15f4a: 84 34 cpi r24, 0x44 ; 68 15f4c: 09 f0 breq .+2 ; 0x15f50 15f4e: 5d c0 rjmp .+186 ; 0x1600a { strchr_pointer = CMDBUFFER_CURRENT_STRING; 15f50: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15f54: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 switch(code_value_short()) 15f58: 0e 94 d8 55 call 0xabb0 ; 0xabb0 15f5c: 82 30 cpi r24, 0x02 ; 2 15f5e: 91 05 cpc r25, r1 15f60: 41 f1 breq .+80 ; 0x15fb2 15f62: 8c f4 brge .+34 ; 0x15f86 15f64: 01 96 adiw r24, 0x01 ; 1 15f66: e1 f0 breq .+56 ; 0x15fa0 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 15f68: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 15f6c: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 15f70: 8f 51 subi r24, 0x1F ; 31 15f72: 90 4f sbci r25, 0xF0 ; 240 15f74: 9f 93 push r25 15f76: 8f 93 push r24 15f78: 1f 92 push r1 15f7a: 84 e4 ldi r24, 0x44 ; 68 15f7c: 8f 93 push r24 15f7e: 84 ef ldi r24, 0xF4 ; 244 15f80: 96 e6 ldi r25, 0x66 ; 102 15f82: 0c 94 0f 85 jmp 0x10a1e ; 0x10a1e *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 15f86: 83 30 cpi r24, 0x03 ; 3 15f88: 91 05 cpc r25, r1 15f8a: f9 f0 breq .+62 ; 0x15fca 15f8c: 47 97 sbiw r24, 0x17 ; 23 15f8e: 61 f7 brne .-40 ; 0x15f68 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 15f90: 85 e4 ldi r24, 0x45 ; 69 15f92: 0e 94 b6 55 call 0xab6c ; 0xab6c 15f96: 88 23 and r24, r24 15f98: 09 f1 breq .+66 ; 0x15fdc serial_dump_and_reset(dump_crash_reason::manual); 15f9a: 80 e0 ldi r24, 0x00 ; 0 15f9c: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 15fa0: 81 e6 ldi r24, 0x61 ; 97 15fa2: 95 e6 ldi r25, 0x65 ; 101 15fa4: 9f 93 push r25 15fa6: 8f 93 push r24 15fa8: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 15fac: 0f 90 pop r0 15fae: 0f 90 pop r0 15fb0: ff cf rjmp .-2 ; 0x15fb0 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 15fb2: 0c e5 ldi r16, 0x5C ; 92 15fb4: 15 e6 ldi r17, 0x65 ; 101 15fb6: 22 e0 ldi r18, 0x02 ; 2 15fb8: 40 e0 ldi r20, 0x00 ; 0 15fba: 60 e0 ldi r22, 0x00 ; 0 15fbc: 72 e2 ldi r23, 0x22 ; 34 15fbe: 80 e0 ldi r24, 0x00 ; 0 15fc0: 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")); 15fc2: 0e 94 cf 5d call 0xbb9e ; 0xbb9e 15fc6: 0c 94 ba 84 jmp 0x10974 ; 0x10974 15fca: 05 e5 ldi r16, 0x55 ; 85 15fcc: 15 e6 ldi r17, 0x65 ; 101 15fce: 23 e0 ldi r18, 0x03 ; 3 15fd0: 41 e0 ldi r20, 0x01 ; 1 15fd2: 60 e0 ldi r22, 0x00 ; 0 15fd4: 70 e1 ldi r23, 0x10 ; 16 15fd6: 90 e0 ldi r25, 0x00 ; 0 15fd8: 80 e0 ldi r24, 0x00 ; 0 15fda: f3 cf rjmp .-26 ; 0x15fc2 { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 15fdc: 82 e5 ldi r24, 0x52 ; 82 15fde: 0e 94 b6 55 call 0xab6c ; 0xab6c 15fe2: 91 e0 ldi r25, 0x01 ; 1 15fe4: 89 27 eor r24, r25 15fe6: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c SERIAL_ECHOPGM("serial dump "); 15fea: 8a e4 ldi r24, 0x4A ; 74 15fec: 99 e7 ldi r25, 0x79 ; 121 15fee: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 15ff2: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15ff6: 88 23 and r24, r24 15ff8: 21 f0 breq .+8 ; 0x16002 15ffa: 8d e4 ldi r24, 0x4D ; 77 15ffc: 95 e6 ldi r25, 0x65 ; 101 15ffe: 0c 94 76 85 jmp 0x10aec ; 0x10aec 16002: 84 e4 ldi r24, 0x44 ; 68 16004: 95 e6 ldi r25, 0x65 ; 101 16006: 0c 94 76 85 jmp 0x10aec ; 0x10aec } } else { SERIAL_ECHO_START; 1600a: 87 e7 ldi r24, 0x77 ; 119 1600c: 9e e9 ldi r25, 0x9E ; 158 1600e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16012: 87 eb ldi r24, 0xB7 ; 183 16014: 95 e6 ldi r25, 0x65 ; 101 16016: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1601a: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 1601e: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 16022: 8f 51 subi r24, 0x1F ; 31 16024: 90 4f sbci r25, 0xF0 ; 240 16026: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHOLNPGM("\"(2)"); 1602a: 81 ec ldi r24, 0xC1 ; 193 1602c: 9e e7 ldi r25, 0x7E ; 126 1602e: 0c 94 76 85 jmp 0x10aec ; 0x10aec #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 16032: 2d ec ldi r18, 0xCD ; 205 16034: 3c ec ldi r19, 0xCC ; 204 16036: 4c ec ldi r20, 0xCC ; 204 16038: 5d e3 ldi r21, 0x3D ; 61 1603a: c7 01 movw r24, r14 1603c: b6 01 movw r22, r12 1603e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 16042: 18 16 cp r1, r24 16044: 14 f4 brge .+4 ; 0x1604a 16046: 0c 94 de 86 jmp 0x10dbc ; 0x10dbc 1604a: 0c 94 ee 87 jmp 0x10fdc ; 0x10fdc 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; 1604e: a3 01 movw r20, r6 16050: 92 01 movw r18, r4 16052: 62 2d mov r22, r2 16054: 73 2d mov r23, r3 16056: 8e 2d mov r24, r14 16058: 9f 2d mov r25, r15 1605a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1605e: 18 16 cp r1, r24 16060: 14 f0 brlt .+4 ; 0x16066 16062: 0c 94 60 8f jmp 0x11ec0 ; 0x11ec0 16066: e5 e0 ldi r30, 0x05 ; 5 16068: ce 0e add r12, r30 1606a: d1 1c adc r13, r1 1606c: f2 e0 ldi r31, 0x02 ; 2 1606e: 8f 0e add r8, r31 16070: 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; 16072: 85 01 movw r16, r10 16074: 0c 94 27 8f jmp 0x11e4e ; 0x11e4e 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)); 16078: 82 e7 ldi r24, 0x72 ; 114 1607a: 99 e3 ldi r25, 0x39 ; 57 1607c: 0e 94 3c 6d call 0xda78 ; 0xda78 16080: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_puts_at_P(0, 2, PSTR("")); 16084: 4b e5 ldi r20, 0x5B ; 91 16086: 5e e7 ldi r21, 0x7E ; 126 16088: 62 e0 ldi r22, 0x02 ; 2 1608a: 80 e0 ldi r24, 0x00 ; 0 1608c: 0e 94 1a 6a call 0xd434 ; 0xd434 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 16090: f8 01 movw r30, r16 16092: 81 91 ld r24, Z+ 16094: 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'; 16096: 98 2f mov r25, r24 16098: 9f 7d andi r25, 0xDF ; 223 1609a: 11 f4 brne .+4 ; 0x160a0 1609c: 0c 94 29 9e jmp 0x13c52 ; 0x13c52 160a0: 97 ef ldi r25, 0xF7 ; 247 160a2: 98 0f add r25, r24 160a4: 92 30 cpi r25, 0x02 ; 2 160a6: 10 f4 brcc .+4 ; 0x160ac 160a8: 0c 94 29 9e jmp 0x13c52 ; 0x13c52 160ac: 8d 30 cpi r24, 0x0D ; 13 160ae: 11 f4 brne .+4 ; 0x160b4 160b0: 0c 94 29 9e jmp 0x13c52 ; 0x13c52 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); 160b4: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 160b8: eb cf rjmp .-42 ; 0x16090 000160ba : uint8_t check_pinda_0() { return _PINDA?0:1; } 160ba: 80 91 bd 03 lds r24, 0x03BD ; 0x8003bd 160be: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 160c2: 08 95 ret 000160c4 : 160c4: 22 e0 ldi r18, 0x02 ; 2 160c6: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 160ca: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 160ce: 90 e1 ldi r25, 0x10 ; 16 160d0: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 160d4: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160d8: 80 61 ori r24, 0x10 ; 16 160da: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160de: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e2: 88 60 ori r24, 0x08 ; 8 160e4: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160ec: 80 68 ori r24, 0x80 ; 128 160ee: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160f2: 80 91 04 05 lds r24, 0x0504 ; 0x800504 160f6: 81 30 cpi r24, 0x01 ; 1 160f8: a9 f4 brne .+42 ; 0x16124 160fa: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 160fe: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 16102: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 16106: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1610a: 80 61 ori r24, 0x10 ; 16 1610c: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16110: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16114: 88 60 ori r24, 0x08 ; 8 16116: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611e: 80 68 ori r24, 0x80 ; 128 16120: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16124: 08 95 ret 00016126 : 16126: 81 50 subi r24, 0x01 ; 1 16128: 82 31 cpi r24, 0x12 ; 18 1612a: 08 f0 brcs .+2 ; 0x1612e 1612c: 5a c0 rjmp .+180 ; 0x161e2 1612e: e8 2f mov r30, r24 16130: f0 e0 ldi r31, 0x00 ; 0 16132: 88 27 eor r24, r24 16134: e1 56 subi r30, 0x61 ; 97 16136: ff 44 sbci r31, 0x4F ; 79 16138: 8f 4f sbci r24, 0xFF ; 255 1613a: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 1613e: bf b0 in r11, 0x0f ; 15 16140: c3 b0 in r12, 0x03 ; 3 16142: b1 b0 in r11, 0x01 ; 1 16144: b7 b0 in r11, 0x07 ; 7 16146: bb b0 in r11, 0x0b ; 11 16148: f1 b0 in r15, 0x01 ; 1 1614a: c6 b0 in r12, 0x06 ; 6 1614c: cc b0 in r12, 0x0c ; 12 1614e: d0 b0 in r13, 0x00 ; 0 16150: d6 b0 in r13, 0x06 ; 6 16152: da b0 in r13, 0x0a ; 10 16154: de b0 in r13, 0x0e ; 14 16156: e4 b0 in r14, 0x04 ; 4 16158: e8 b0 in r14, 0x08 ; 8 1615a: f1 b0 in r15, 0x01 ; 1 1615c: ec b0 in r14, 0x0c ; 12 1615e: f2 b0 in r15, 0x02 ; 2 16160: f6 b0 in r15, 0x06 ; 6 16162: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16166: 8f 77 andi r24, 0x7F ; 127 16168: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1616c: 08 95 ret 1616e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16172: 8f 7d andi r24, 0xDF ; 223 16174: f9 cf rjmp .-14 ; 0x16168 16176: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1617a: 87 7f andi r24, 0xF7 ; 247 1617c: f5 cf rjmp .-22 ; 0x16168 1617e: 84 b5 in r24, 0x24 ; 36 16180: 8f 77 andi r24, 0x7F ; 127 16182: 84 bd out 0x24, r24 ; 36 16184: 08 95 ret 16186: 84 b5 in r24, 0x24 ; 36 16188: 8f 7d andi r24, 0xDF ; 223 1618a: fb cf rjmp .-10 ; 0x16182 1618c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 16190: 8f 77 andi r24, 0x7F ; 127 16192: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 16196: 08 95 ret 16198: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1619c: 8f 7d andi r24, 0xDF ; 223 1619e: f9 cf rjmp .-14 ; 0x16192 161a0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161a4: 8f 77 andi r24, 0x7F ; 127 161a6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161aa: 08 95 ret 161ac: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161b0: 8f 7d andi r24, 0xDF ; 223 161b2: f9 cf rjmp .-14 ; 0x161a6 161b4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161b8: 87 7f andi r24, 0xF7 ; 247 161ba: f5 cf rjmp .-22 ; 0x161a6 161bc: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161c0: 8f 77 andi r24, 0x7F ; 127 161c2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161c6: 08 95 ret 161c8: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161cc: 8f 7d andi r24, 0xDF ; 223 161ce: f9 cf rjmp .-14 ; 0x161c2 161d0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161d4: 87 7f andi r24, 0xF7 ; 247 161d6: f5 cf rjmp .-22 ; 0x161c2 161d8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161dc: 8f 77 andi r24, 0x7F ; 127 161de: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e2: 08 95 ret 161e4: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e8: 8f 7d andi r24, 0xDF ; 223 161ea: f9 cf rjmp .-14 ; 0x161de 161ec: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161f0: 87 7f andi r24, 0xF7 ; 247 161f2: f5 cf rjmp .-22 ; 0x161de 000161f4 : 161f4: 83 b1 in r24, 0x03 ; 3 161f6: 82 95 swap r24 161f8: 81 70 andi r24, 0x01 ; 1 161fa: 08 95 ret 000161fc : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 161fc: cf 92 push r12 161fe: df 92 push r13 16200: ef 92 push r14 16202: 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; 16204: 20 91 bf 03 lds r18, 0x03BF ; 0x8003bf 16208: b0 e0 ldi r27, 0x00 ; 0 1620a: a0 e0 ldi r26, 0x00 ; 0 1620c: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 16210: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 16214: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 16218: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 1621c: 20 ff sbrs r18, 0 1621e: 42 c0 rjmp .+132 ; 0x162a4 16220: c8 1a sub r12, r24 16222: d9 0a sbc r13, r25 16224: ea 0a sbc r14, r26 16226: fb 0a sbc r15, r27 16228: c0 92 b6 06 sts 0x06B6, r12 ; 0x8006b6 1622c: d0 92 b7 06 sts 0x06B7, r13 ; 0x8006b7 16230: e0 92 b8 06 sts 0x06B8, r14 ; 0x8006b8 16234: f0 92 b9 06 sts 0x06B9, r15 ; 0x8006b9 16238: cb 01 movw r24, r22 1623a: b0 e0 ldi r27, 0x00 ; 0 1623c: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1623e: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 16242: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 16246: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 1624a: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 1624e: 21 ff sbrs r18, 1 16250: 36 c0 rjmp .+108 ; 0x162be 16252: c8 1a sub r12, r24 16254: d9 0a sbc r13, r25 16256: ea 0a sbc r14, r26 16258: fb 0a sbc r15, r27 1625a: c0 92 ba 06 sts 0x06BA, r12 ; 0x8006ba 1625e: d0 92 bb 06 sts 0x06BB, r13 ; 0x8006bb 16262: e0 92 bc 06 sts 0x06BC, r14 ; 0x8006bc 16266: f0 92 bd 06 sts 0x06BD, r15 ; 0x8006bd 1626a: 70 e0 ldi r23, 0x00 ; 0 1626c: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1626e: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 16272: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 16276: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 1627a: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 1627e: 22 ff sbrs r18, 2 16280: 2b c0 rjmp .+86 ; 0x162d8 16282: 84 1b sub r24, r20 16284: 95 0b sbc r25, r21 16286: a6 0b sbc r26, r22 16288: b7 0b sbc r27, r23 1628a: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 1628e: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 16292: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 16296: 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]); } 1629a: ff 90 pop r15 1629c: ef 90 pop r14 1629e: df 90 pop r13 162a0: cf 90 pop r12 162a2: 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; 162a4: 8c 0d add r24, r12 162a6: 9d 1d adc r25, r13 162a8: ae 1d adc r26, r14 162aa: bf 1d adc r27, r15 162ac: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 162b0: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 162b4: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 162b8: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 162bc: bd cf rjmp .-134 ; 0x16238 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 162be: 8c 0d add r24, r12 162c0: 9d 1d adc r25, r13 162c2: ae 1d adc r26, r14 162c4: bf 1d adc r27, r15 162c6: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 162ca: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 162ce: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 162d2: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 162d6: c9 cf rjmp .-110 ; 0x1626a if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 162d8: 84 0f add r24, r20 162da: 95 1f adc r25, r21 162dc: a6 1f adc r26, r22 162de: b7 1f adc r27, r23 162e0: d4 cf rjmp .-88 ; 0x1628a 000162e2 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 162e2: fb 01 movw r30, r22 *v = 0; 162e4: 11 82 std Z+1, r1 ; 0x01 162e6: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 162e8: 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'; 162ea: dc 01 movw r26, r24 162ec: 2c 91 ld r18, X 162ee: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 162f0: 2a 30 cpi r18, 0x0A ; 10 162f2: a0 f4 brcc .+40 ; 0x1631c *v *= 10; 162f4: 40 81 ld r20, Z 162f6: 51 81 ldd r21, Z+1 ; 0x01 162f8: 64 9f mul r22, r20 162fa: 90 01 movw r18, r0 162fc: 65 9f mul r22, r21 162fe: 30 0d add r19, r0 16300: 11 24 eor r1, r1 16302: 31 83 std Z+1, r19 ; 0x01 16304: 20 83 st Z, r18 *v += *str - '0'; 16306: 4d 91 ld r20, X+ 16308: cd 01 movw r24, r26 1630a: 20 53 subi r18, 0x30 ; 48 1630c: 31 09 sbc r19, r1 1630e: 24 0f add r18, r20 16310: 31 1d adc r19, r1 16312: 47 fd sbrc r20, 7 16314: 3a 95 dec r19 16316: 31 83 std Z+1, r19 ; 0x01 16318: 20 83 st Z, r18 1631a: e7 cf rjmp .-50 ; 0x162ea ++str; } return str; } 1631c: 08 95 ret 0001631e : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1631e: 8e e9 ldi r24, 0x9E ; 158 16320: 98 e6 ldi r25, 0x68 ; 104 16322: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_return_to_status(); 16326: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 0001632a : //! 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) { 1632a: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 1632e: 81 30 cpi r24, 0x01 ; 1 16330: 21 f4 brne .+8 ; 0x1633a SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 16332: 84 e5 ldi r24, 0x54 ; 84 16334: 98 e6 ldi r25, 0x68 ; 104 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 16336: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 1633a: 85 e4 ldi r24, 0x45 ; 69 1633c: 98 e6 ldi r25, 0x68 ; 104 1633e: fb cf rjmp .-10 ; 0x16336 00016340 : 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, 16340: 1f 93 push r17 16342: cf 93 push r28 16344: df 93 push r29 16346: c8 2f mov r28, r24 16348: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 1634a: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 1634e: 83 ea ldi r24, 0xA3 ; 163 16350: 94 e4 ldi r25, 0x44 ; 68 16352: 0e 94 3c 6d call 0xda78 ; 0xda78 16356: ac 01 movw r20, r24 16358: 60 e0 ldi r22, 0x00 ; 0 1635a: 80 e0 ldi r24, 0x00 ; 0 1635c: 0e 94 1a 6a call 0xd434 ; 0xd434 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)); 16360: 8d e7 ldi r24, 0x7D ; 125 16362: 94 e4 ldi r25, 0x44 ; 68 16364: c1 11 cpse r28, r1 16366: 02 c0 rjmp .+4 ; 0x1636c 16368: 80 e9 ldi r24, 0x90 ; 144 1636a: 94 e4 ldi r25, 0x44 ; 68 1636c: 0e 94 3c 6d call 0xda78 ; 0xda78 16370: ac 01 movw r20, r24 16372: 61 e0 ldi r22, 0x01 ; 1 16374: 80 e0 ldi r24, 0x00 ; 0 16376: 0e 94 1a 6a call 0xd434 ; 0xd434 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1637a: 8f ef ldi r24, 0xFF ; 255 1637c: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 16380: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 16384: 0f 94 f7 31 call 0x263ee ; 0x263ee // 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); 16388: 64 ef ldi r22, 0xF4 ; 244 1638a: 71 e0 ldi r23, 0x01 ; 1 1638c: 80 e0 ldi r24, 0x00 ; 0 1638e: 90 e0 ldi r25, 0x00 ; 0 16390: 0f 94 4d 0d call 0x21a9a ; 0x21a9a lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 16394: 82 e7 ldi r24, 0x72 ; 114 16396: 94 e4 ldi r25, 0x44 ; 68 16398: 0e 94 3c 6d call 0xda78 ; 0xda78 1639c: ac 01 movw r20, r24 1639e: 62 e0 ldi r22, 0x02 ; 2 163a0: 81 e0 ldi r24, 0x01 ; 1 163a2: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc_at(0, 3, '>'); 163a6: 4e e3 ldi r20, 0x3E ; 62 163a8: 63 e0 ldi r22, 0x03 ; 3 163aa: 80 e0 ldi r24, 0x00 ; 0 163ac: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 163b0: 83 e6 ldi r24, 0x63 ; 99 163b2: 94 e4 ldi r25, 0x44 ; 68 163b4: 0e 94 3c 6d call 0xda78 ; 0xda78 163b8: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_encoder = _default; 163bc: 6d 2f mov r22, r29 163be: 70 e0 ldi r23, 0x00 ; 0 163c0: 70 93 07 05 sts 0x0507, r23 ; 0x800507 163c4: 60 93 06 05 sts 0x0506, r22 ; 0x800506 KEEPALIVE_STATE(PAUSED_FOR_USER); 163c8: 84 e0 ldi r24, 0x04 ; 4 163ca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 163ce: 0e 94 1e 6c call 0xd83c ; 0xd83c 163d2: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 163d4: 11 e0 ldi r17, 0x01 ; 1 163d6: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 163d8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 163dc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 163e0: 00 97 sbiw r24, 0x00 ; 0 163e2: 19 f1 breq .+70 ; 0x1642a if (lcd_encoder < 0) { 163e4: 97 ff sbrs r25, 7 163e6: 0b c0 rjmp .+22 ; 0x163fe _result = !check_opposite; 163e8: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 163ea: 4e e3 ldi r20, 0x3E ; 62 163ec: 62 e0 ldi r22, 0x02 ; 2 163ee: 80 e0 ldi r24, 0x00 ; 0 163f0: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc_at(0, 3, ' '); 163f4: 40 e2 ldi r20, 0x20 ; 32 163f6: 63 e0 ldi r22, 0x03 ; 3 163f8: 80 e0 ldi r24, 0x00 ; 0 163fa: 0e 94 26 6a call 0xd44c ; 0xd44c } if (lcd_encoder > 0) { 163fe: 80 91 06 05 lds r24, 0x0506 ; 0x800506 16402: 90 91 07 05 lds r25, 0x0507 ; 0x800507 16406: 18 16 cp r1, r24 16408: 19 06 cpc r1, r25 1640a: 5c f4 brge .+22 ; 0x16422 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1640c: 40 e2 ldi r20, 0x20 ; 32 1640e: 62 e0 ldi r22, 0x02 ; 2 16410: 80 e0 ldi r24, 0x00 ; 0 16412: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc_at(0, 3, '>'); 16416: 4e e3 ldi r20, 0x3E ; 62 16418: 63 e0 ldi r22, 0x03 ; 3 1641a: 80 e0 ldi r24, 0x00 ; 0 1641c: 0e 94 26 6a call 0xd44c ; 0xd44c 16420: dc 2f mov r29, r28 } lcd_encoder = 0; 16422: 10 92 07 05 sts 0x0507, r1 ; 0x800507 16426: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } manage_heater(); 1642a: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1642e: 81 e0 ldi r24, 0x01 ; 1 16430: 0e 94 8c 7a call 0xf518 ; 0xf518 _delay(100); 16434: 64 e6 ldi r22, 0x64 ; 100 16436: 70 e0 ldi r23, 0x00 ; 0 16438: 80 e0 ldi r24, 0x00 ; 0 1643a: 90 e0 ldi r25, 0x00 ; 0 1643c: 0f 94 4d 0d call 0x21a9a ; 0x21a9a } while (!lcd_clicked()); 16440: 0e 94 23 6c call 0xd846 ; 0xd846 16444: 88 23 and r24, r24 16446: 41 f2 breq .-112 ; 0x163d8 KEEPALIVE_STATE(IN_HANDLER); 16448: 82 e0 ldi r24, 0x02 ; 2 1644a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 1644e: 80 e0 ldi r24, 0x00 ; 0 16450: 0e 94 ca 6e call 0xdd94 ; 0xdd94 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 16454: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 16458: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1645c: 0f 94 f7 31 call 0x263ee ; 0x263ee KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 16460: 8d 2f mov r24, r29 16462: df 91 pop r29 16464: cf 91 pop r28 16466: 1f 91 pop r17 16468: 08 95 ret 0001646a : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1646a: cf 93 push r28 1646c: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1646e: 0f 94 14 22 call 0x24428 ; 0x24428 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 16472: c5 ef ldi r28, 0xF5 ; 245 16474: 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)); 16476: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1647a: 70 e0 ldi r23, 0x00 ; 0 1647c: 90 e0 ldi r25, 0x00 ; 0 1647e: 80 e0 ldi r24, 0x00 ; 0 16480: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 16484: 9b 01 movw r18, r22 16486: ac 01 movw r20, r24 16488: 6c 85 ldd r22, Y+12 ; 0x0c 1648a: 7d 85 ldd r23, Y+13 ; 0x0d 1648c: 8e 85 ldd r24, Y+14 ; 0x0e 1648e: 9f 85 ldd r25, Y+15 ; 0x0f 16490: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 16494: 6c 87 std Y+12, r22 ; 0x0c 16496: 7d 87 std Y+13, r23 ; 0x0d 16498: 8e 87 std Y+14, r24 ; 0x0e 1649a: 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])); 1649c: 62 e0 ldi r22, 0x02 ; 2 1649e: 87 ea ldi r24, 0xA7 ; 167 164a0: 97 e8 ldi r25, 0x87 ; 135 } 164a2: df 91 pop r29 164a4: 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])); 164a6: 0d 94 2c 54 jmp 0x2a858 ; 0x2a858 000164aa : 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) { 164aa: 0f 93 push r16 164ac: 1f 93 push r17 164ae: cf 93 push r28 164b0: df 93 push r29 164b2: 98 2f mov r25, r24 164b4: 86 2f mov r24, r22 164b6: 14 2f mov r17, r20 164b8: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 164ba: 69 2f mov r22, r25 164bc: 0e 94 06 6a call 0xd40c ; 0xd40c switch (_state) 164c0: 11 30 cpi r17, 0x01 ; 1 164c2: 21 f0 breq .+8 ; 0x164cc 164c4: 12 30 cpi r17, 0x02 ; 2 164c6: 79 f0 breq .+30 ; 0x164e6 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164c8: ce 01 movw r24, r28 164ca: 15 c0 rjmp .+42 ; 0x164f6 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 164cc: ce 01 movw r24, r28 164ce: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_putc(':'); 164d2: 8a e3 ldi r24, 0x3A ; 58 164d4: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_putc(_indicator); 164d8: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 164da: df 91 pop r29 164dc: cf 91 pop r28 164de: 1f 91 pop r17 164e0: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 164e2: 0c 94 f5 69 jmp 0xd3ea ; 0xd3ea break; case 2: lcd_puts_P(_name_PROGMEM); 164e6: ce 01 movw r24, r28 164e8: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_putc(':'); 164ec: 8a e3 ldi r24, 0x3A ; 58 164ee: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_puts_P(MSG_OK_CAPS); 164f2: 87 e7 ldi r24, 0x77 ; 119 164f4: 98 e6 ldi r25, 0x68 ; 104 break; default: lcd_puts_P(_name_PROGMEM); } } 164f6: df 91 pop r29 164f8: cf 91 pop r28 164fa: 1f 91 pop r17 164fc: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164fe: 0c 94 f1 69 jmp 0xd3e2 ; 0xd3e2 00016502 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 16502: df 92 push r13 16504: ef 92 push r14 16506: ff 92 push r15 16508: 0f 93 push r16 1650a: 1f 93 push r17 1650c: cf 93 push r28 1650e: df 93 push r29 16510: cd b7 in r28, 0x3d ; 61 16512: de b7 in r29, 0x3e ; 62 16514: 63 97 sbiw r28, 0x13 ; 19 16516: 0f b6 in r0, 0x3f ; 63 16518: f8 94 cli 1651a: de bf out 0x3e, r29 ; 62 1651c: 0f be out 0x3f, r0 ; 63 1651e: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 16520: 30 91 31 04 lds r19, 0x0431 ; 0x800431 16524: 20 91 30 04 lds r18, 0x0430 ; 0x800430 16528: 32 13 cpse r19, r18 1652a: 73 c0 rjmp .+230 ; 0x16612 1652c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1652e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 16532: 88 23 and r24, r24 16534: 09 f4 brne .+2 ; 0x16538 16536: 45 c0 rjmp .+138 ; 0x165c2 //! //! @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)); 16538: 8b e5 ldi r24, 0x5B ; 91 1653a: 94 e4 ldi r25, 0x44 ; 68 1653c: 0e 94 3c 6d call 0xda78 ; 0xda78 16540: 9f 93 push r25 16542: 8f 93 push r24 16544: 8f e9 ldi r24, 0x9F ; 159 16546: 97 e8 ldi r25, 0x87 ; 135 16548: 9f 93 push r25 1654a: 8f 93 push r24 1654c: 8e 01 movw r16, r28 1654e: 0f 5f subi r16, 0xFF ; 255 16550: 1f 4f sbci r17, 0xFF ; 255 16552: 1f 93 push r17 16554: 0f 93 push r16 16556: 0f 94 94 9f call 0x33f28 ; 0x33f28 1655a: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1655c: 47 e0 ldi r20, 0x07 ; 7 1655e: 50 e0 ldi r21, 0x00 ; 0 16560: b7 01 movw r22, r14 16562: 80 0f add r24, r16 16564: 91 2f mov r25, r17 16566: 91 1d adc r25, r1 16568: 0f 94 6d a0 call 0x340da ; 0x340da 1656c: 0f 90 pop r0 1656e: 0f 90 pop r0 16570: 0f 90 pop r0 16572: 0f 90 pop r0 16574: 0f 90 pop r0 16576: 0f 90 pop r0 16578: 20 e0 ldi r18, 0x00 ; 0 1657a: 82 2f mov r24, r18 1657c: 8d 0d add r24, r13 1657e: 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) 16580: 27 30 cpi r18, 0x07 ; 7 16582: 39 f0 breq .+14 ; 0x16592 16584: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 16586: f8 01 movw r30, r16 16588: e8 0f add r30, r24 1658a: f9 1f adc r31, r25 1658c: 30 81 ld r19, Z 1658e: 31 11 cpse r19, r1 16590: f4 cf rjmp .-24 ; 0x1657a } buffer.c[index] = ']'; 16592: f8 01 movw r30, r16 16594: e8 0f add r30, r24 16596: f9 1f adc r31, r25 16598: 2d e5 ldi r18, 0x5D ; 93 1659a: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1659c: 8c 0f add r24, r28 1659e: 9d 1f adc r25, r29 165a0: fc 01 movw r30, r24 165a2: 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()); 165a4: 0f 94 1f 92 call 0x3243e ; 0x3243e 165a8: 48 2f mov r20, r24 165aa: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 165ae: 80 e0 ldi r24, 0x00 ; 0 165b0: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 165b4: 62 e1 ldi r22, 0x12 ; 18 165b6: c8 01 movw r24, r16 165b8: 0e 94 f5 6b call 0xd7ea ; 0xd7ea lcd_putc(type_char); 165bc: 80 e2 ldi r24, 0x20 ; 32 165be: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 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)) 165c2: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 165c6: 88 23 and r24, r24 165c8: 21 f1 breq .+72 ; 0x16612 165ca: 20 91 31 04 lds r18, 0x0431 ; 0x800431 165ce: 80 91 06 05 lds r24, 0x0506 ; 0x800506 165d2: 90 91 07 05 lds r25, 0x0507 ; 0x800507 165d6: 28 17 cp r18, r24 165d8: 19 06 cpc r1, r25 165da: d9 f4 brne .+54 ; 0x16612 { lcd_update_enabled = 0; 165dc: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 165e0: 85 ec ldi r24, 0xC5 ; 197 165e2: 9f e6 ldi r25, 0x6F ; 111 165e4: 89 2b or r24, r25 165e6: 11 f0 breq .+4 ; 0x165ec 165e8: 0e 94 c5 6f call 0xdf8a ; 0xdf8a lcd_update_enabled = 1; 165ec: 81 e0 ldi r24, 0x01 ; 1 165ee: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); 165f2: 0f 94 43 92 call 0x32486 ; 0x32486 return; } } menu_item++; } 165f6: 63 96 adiw r28, 0x13 ; 19 165f8: 0f b6 in r0, 0x3f ; 63 165fa: f8 94 cli 165fc: de bf out 0x3e, r29 ; 62 165fe: 0f be out 0x3f, r0 ; 63 16600: cd bf out 0x3d, r28 ; 61 16602: df 91 pop r29 16604: cf 91 pop r28 16606: 1f 91 pop r17 16608: 0f 91 pop r16 1660a: ff 90 pop r15 1660c: ef 90 pop r14 1660e: df 90 pop r13 16610: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 16612: 80 91 31 04 lds r24, 0x0431 ; 0x800431 16616: 8f 5f subi r24, 0xFF ; 255 16618: 80 93 31 04 sts 0x0431, r24 ; 0x800431 1661c: ec cf rjmp .-40 ; 0x165f6 0001661e : } #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); 1661e: 87 ea ldi r24, 0xA7 ; 167 16620: 9c e0 ldi r25, 0x0C ; 12 16622: 0f 94 7d a0 call 0x340fa ; 0x340fa if (value > 1) value = 1; 16626: 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) 16628: 82 30 cpi r24, 0x02 ; 2 1662a: 08 f4 brcc .+2 ; 0x1662e 1662c: 68 27 eor r22, r24 1662e: 87 ea ldi r24, 0xA7 ; 167 16630: 9c e0 ldi r25, 0x0C ; 12 16632: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 00016636 : 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); 16636: 8a ea ldi r24, 0xAA ; 170 16638: 9d e0 ldi r25, 0x0D ; 13 1663a: 0f 94 7d a0 call 0x340fa ; 0x340fa switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1663e: 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) { 16640: 83 30 cpi r24, 0x03 ; 3 16642: 21 f0 breq .+8 ; 0x1664c case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 16644: 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) { 16646: 85 30 cpi r24, 0x05 ; 5 16648: 09 f0 breq .+2 ; 0x1664c case 1: mbl_z_probe_nr = 3; break; 1664a: 63 e0 ldi r22, 0x03 ; 3 1664c: 8a ea ldi r24, 0xAA ; 170 1664e: 9d e0 ldi r25, 0x0D ; 13 16650: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 00016654 : 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); 16654: 8b ea ldi r24, 0xAB ; 171 16656: 9d e0 ldi r25, 0x0D ; 13 16658: 0f 94 7d a0 call 0x340fa ; 0x340fa if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1665c: 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; 1665e: 83 30 cpi r24, 0x03 ; 3 16660: 09 f4 brne .+2 ; 0x16664 16662: 67 e0 ldi r22, 0x07 ; 7 16664: 8b ea ldi r24, 0xAB ; 171 16666: 9d e0 ldi r25, 0x0D ; 13 16668: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001666c : #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); 1666c: 8c ea ldi r24, 0xAC ; 172 1666e: 9d e0 ldi r25, 0x0D ; 13 16670: 0f 94 7d a0 call 0x340fa ; 0x340fa magnet_elimination = !magnet_elimination; 16674: 61 e0 ldi r22, 0x01 ; 1 16676: 81 11 cpse r24, r1 16678: 60 e0 ldi r22, 0x00 ; 0 1667a: 8c ea ldi r24, 0xAC ; 172 1667c: 9d e0 ldi r25, 0x0D ; 13 1667e: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 00016682 : 16682: 60 91 98 03 lds r22, 0x0398 ; 0x800398 16686: 81 ea ldi r24, 0xA1 ; 161 16688: 9d e0 ldi r25, 0x0D ; 13 1668a: 0f 94 a1 a0 call 0x34142 ; 0x34142 //! @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(); 1668e: 0c 94 f9 ff jmp 0x1fff2 ; 0x1fff2 00016692 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 16692: 0f 93 push r16 16694: 1f 93 push r17 16696: cf 93 push r28 16698: df 93 push r29 1669a: 00 d0 rcall .+0 ; 0x1669c 1669c: 00 d0 rcall .+0 ; 0x1669e 1669e: 1f 92 push r1 166a0: 1f 92 push r1 166a2: cd b7 in r28, 0x3d ; 61 166a4: de b7 in r29, 0x3e ; 62 166a6: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 166a8: 8a e0 ldi r24, 0x0A ; 10 166aa: 90 e0 ldi r25, 0x00 ; 0 166ac: 0f 94 8b a0 call 0x34116 ; 0x34116 166b0: 9a 83 std Y+2, r25 ; 0x02 166b2: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 166b4: 8c e0 ldi r24, 0x0C ; 12 166b6: 90 e0 ldi r25, 0x00 ; 0 166b8: 0f 94 8b a0 call 0x34116 ; 0x34116 166bc: 9c 83 std Y+4, r25 ; 0x04 166be: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 166c0: 8e e0 ldi r24, 0x0E ; 14 166c2: 90 e0 ldi r25, 0x00 ; 0 166c4: 0f 94 8b a0 call 0x34116 ; 0x34116 166c8: 9e 83 std Y+6, r25 ; 0x06 166ca: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 166cc: 80 e1 ldi r24, 0x10 ; 16 166ce: 90 e0 ldi r25, 0x00 ; 0 166d0: 0f 94 8b a0 call 0x34116 ; 0x34116 166d4: 98 87 std Y+8, r25 ; 0x08 166d6: 8f 83 std Y+7, r24 ; 0x07 166d8: c8 01 movw r24, r16 166da: de 01 movw r26, r28 166dc: 11 96 adiw r26, 0x01 ; 1 166de: be 01 movw r22, r28 166e0: 67 5f subi r22, 0xF7 ; 247 166e2: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 166e4: fc 01 movw r30, r24 166e6: 25 91 lpm r18, Z+ 166e8: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 166ea: 4d 91 ld r20, X+ 166ec: 5d 91 ld r21, X+ 166ee: 42 17 cp r20, r18 166f0: 53 07 cpc r21, r19 166f2: 48 f0 brcs .+18 ; 0x16706 return true; else if (v < ver_eeprom[i]) 166f4: 24 17 cp r18, r20 166f6: 35 07 cpc r19, r21 166f8: 20 f0 brcs .+8 ; 0x16702 166fa: 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) { 166fc: a6 17 cp r26, r22 166fe: b7 07 cpc r27, r23 16700: 89 f7 brne .-30 ; 0x166e4 return true; else if (v < ver_eeprom[i]) break; } return false; 16702: 80 e0 ldi r24, 0x00 ; 0 16704: 01 c0 rjmp .+2 ; 0x16708 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; 16706: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 16708: 28 96 adiw r28, 0x08 ; 8 1670a: 0f b6 in r0, 0x3f ; 63 1670c: f8 94 cli 1670e: de bf out 0x3e, r29 ; 62 16710: 0f be out 0x3f, r0 ; 63 16712: cd bf out 0x3d, r28 ; 61 16714: df 91 pop r29 16716: cf 91 pop r28 16718: 1f 91 pop r17 1671a: 0f 91 pop r16 1671c: 08 95 ret 0001671e : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 1671e: cf 93 push r28 16720: 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)) 16722: 8f ef ldi r24, 0xFF ; 255 16724: 9f e0 ldi r25, 0x0F ; 15 16726: 0f 94 7d a0 call 0x340fa ; 0x340fa 1672a: 81 30 cpi r24, 0x01 ; 1 1672c: 99 f0 breq .+38 ; 0x16754 1672e: 82 30 cpi r24, 0x02 ; 2 16730: a1 f0 breq .+40 ; 0x1675a { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 16732: 8a e9 ldi r24, 0x9A ; 154 16734: 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); 16736: 0e 94 3c 6d call 0xda78 ; 0xda78 1673a: ec 01 movw r28, r24 1673c: 83 e9 ldi r24, 0x93 ; 147 1673e: 90 e4 ldi r25, 0x40 ; 64 16740: 0e 94 3c 6d call 0xda78 ; 0xda78 16744: 22 e0 ldi r18, 0x02 ; 2 16746: 47 ee ldi r20, 0xE7 ; 231 16748: 58 e3 ldi r21, 0x38 ; 56 1674a: 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 } } 1674c: df 91 pop r29 1674e: 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); 16750: 0d 94 ec 94 jmp 0x329d8 ; 0x329d8 { 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); 16754: 8a e8 ldi r24, 0x8A ; 138 16756: 90 e4 ldi r25, 0x40 ; 64 16758: ee cf rjmp .-36 ; 0x16736 break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 1675a: 8d e7 ldi r24, 0x7D ; 125 1675c: 90 e4 ldi r25, 0x40 ; 64 1675e: eb cf rjmp .-42 ; 0x16736 00016760 : 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) 16760: 80 91 64 03 lds r24, 0x0364 ; 0x800364 16764: 88 23 and r24, r24 16766: 21 f0 breq .+8 ; 0x16770 16768: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1676c: 88 23 and r24, r24 1676e: 51 f0 breq .+20 ; 0x16784 { _md->status = 1; 16770: 81 e0 ldi r24, 0x01 ; 1 16772: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 16776: 60 e0 ldi r22, 0x00 ; 0 16778: 8a e2 ldi r24, 0x2A ; 42 1677a: 9d e0 ldi r25, 0x0D ; 13 1677c: 0e 94 78 6f call 0xdef0 ; 0xdef0 16780: 80 93 65 03 sts 0x0365, r24 ; 0x800365 } MENU_BEGIN(); 16784: 0f 94 5d 93 call 0x326ba ; 0x326ba 16788: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1678c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16790: 84 30 cpi r24, 0x04 ; 4 16792: 08 f0 brcs .+2 ; 0x16796 16794: 90 c0 rjmp .+288 ; 0x168b6 16796: 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 1679a: 80 91 ba 03 lds r24, 0x03BA ; 0x8003ba 1679e: 81 11 cpse r24, r1 167a0: 55 c0 rjmp .+170 ; 0x1684c 167a2: 86 e7 ldi r24, 0x76 ; 118 167a4: 90 e4 ldi r25, 0x40 ; 64 167a6: 0e 94 3c 6d call 0xda78 ; 0xda78 167aa: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 167ae: 86 e4 ldi r24, 0x46 ; 70 167b0: 9c e3 ldi r25, 0x3C ; 60 167b2: 0e 94 3c 6d call 0xda78 ; 0xda78 167b6: 66 e9 ldi r22, 0x96 ; 150 167b8: 7c eb ldi r23, 0xBC ; 188 167ba: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 SETTINGS_NOZZLE; 167be: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 167c2: 8c 33 cpi r24, 0x3C ; 60 167c4: 09 f4 brne .+2 ; 0x167c8 167c6: 60 c0 rjmp .+192 ; 0x16888 167c8: 08 f0 brcs .+2 ; 0x167cc 167ca: 43 c0 rjmp .+134 ; 0x16852 167cc: 89 31 cpi r24, 0x19 ; 25 167ce: 09 f4 brne .+2 ; 0x167d2 167d0: 4f c0 rjmp .+158 ; 0x16870 167d2: 88 32 cpi r24, 0x28 ; 40 167d4: 09 f4 brne .+2 ; 0x167d8 167d6: 42 c0 rjmp .+132 ; 0x1685c MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 167d8: 8f ed ldi r24, 0xDF ; 223 167da: 9a e3 ldi r25, 0x3A ; 58 167dc: 0e 94 3c 6d call 0xda78 ; 0xda78 167e0: 67 e1 ldi r22, 0x17 ; 23 167e2: 76 ec ldi r23, 0xC6 ; 198 167e4: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 167e8: 8c e8 ldi r24, 0x8C ; 140 167ea: 9a e3 ldi r25, 0x3A ; 58 167ec: 0e 94 3c 6d call 0xda78 ; 0xda78 167f0: 6f ee ldi r22, 0xEF ; 239 167f2: 7b ef ldi r23, 0xFB ; 251 167f4: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 //! 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) 167f8: 80 91 65 03 lds r24, 0x0365 ; 0x800365 167fc: 88 23 and r24, r24 167fe: 31 f0 breq .+12 ; 0x1680c { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 16800: 6c e5 ldi r22, 0x5C ; 92 16802: 74 eb ldi r23, 0xB4 ; 180 16804: 8c e5 ldi r24, 0x5C ; 92 16806: 93 e8 ldi r25, 0x83 ; 131 16808: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 //! 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); 1680c: 89 e2 ldi r24, 0x29 ; 41 1680e: 9d e0 ldi r25, 0x0D ; 13 16810: 0f 94 7d a0 call 0x340fa ; 0x340fa 16814: 88 23 and r24, r24 16816: 09 f4 brne .+2 ; 0x1681a 16818: 4b c0 rjmp .+150 ; 0x168b0 1681a: 83 e0 ldi r24, 0x03 ; 3 1681c: 9e e3 ldi r25, 0x3E ; 62 1681e: 0e 94 3c 6d call 0xda78 ; 0xda78 16822: 22 e0 ldi r18, 0x02 ; 2 16824: 4a ec ldi r20, 0xCA ; 202 16826: 55 eb ldi r21, 0xB5 ; 181 16828: bc 01 movw r22, r24 1682a: 8e ee ldi r24, 0xEE ; 238 1682c: 97 e6 ldi r25, 0x67 ; 103 1682e: 0f 94 ec 94 call 0x329d8 ; 0x329d8 #endif //PINDA_TEMP_COMP MENU_END(); 16832: 0f 94 31 93 call 0x32662 ; 0x32662 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 16836: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1683a: 8f 5f subi r24, 0xFF ; 255 1683c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16840: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16844: 8f 5f subi r24, 0xFF ; 255 16846: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1684a: a0 cf rjmp .-192 ; 0x1678c MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1684c: 88 ef ldi r24, 0xF8 ; 248 1684e: 9d e3 ldi r25, 0x3D ; 61 16850: aa cf rjmp .-172 ; 0x167a6 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 16852: 80 35 cpi r24, 0x50 ; 80 16854: 19 f1 breq .+70 ; 0x1689c 16856: 8f 3f cpi r24, 0xFF ; 255 16858: 09 f0 breq .+2 ; 0x1685c 1685a: be cf rjmp .-132 ; 0x167d8 1685c: 85 e9 ldi r24, 0x95 ; 149 1685e: 9a e3 ldi r25, 0x3A ; 58 16860: 0e 94 3c 6d call 0xda78 ; 0xda78 16864: 22 e0 ldi r18, 0x02 ; 2 16866: 4d ea ldi r20, 0xAD ; 173 16868: 5c ef ldi r21, 0xFC ; 252 1686a: 63 e7 ldi r22, 0x73 ; 115 1686c: 73 e8 ldi r23, 0x83 ; 131 1686e: 09 c0 rjmp .+18 ; 0x16882 16870: 85 e9 ldi r24, 0x95 ; 149 16872: 9a e3 ldi r25, 0x3A ; 58 16874: 0e 94 3c 6d call 0xda78 ; 0xda78 16878: 22 e0 ldi r18, 0x02 ; 2 1687a: 4d ea ldi r20, 0xAD ; 173 1687c: 5c ef ldi r21, 0xFC ; 252 1687e: 68 e7 ldi r22, 0x78 ; 120 16880: 73 e8 ldi r23, 0x83 ; 131 16882: 0f 94 ec 94 call 0x329d8 ; 0x329d8 16886: a8 cf rjmp .-176 ; 0x167d8 16888: 85 e9 ldi r24, 0x95 ; 149 1688a: 9a e3 ldi r25, 0x3A ; 58 1688c: 0e 94 3c 6d call 0xda78 ; 0xda78 16890: 22 e0 ldi r18, 0x02 ; 2 16892: 4d ea ldi r20, 0xAD ; 173 16894: 5c ef ldi r21, 0xFC ; 252 16896: 6e e6 ldi r22, 0x6E ; 110 16898: 73 e8 ldi r23, 0x83 ; 131 1689a: f3 cf rjmp .-26 ; 0x16882 1689c: 85 e9 ldi r24, 0x95 ; 149 1689e: 9a e3 ldi r25, 0x3A ; 58 168a0: 0e 94 3c 6d call 0xda78 ; 0xda78 168a4: 22 e0 ldi r18, 0x02 ; 2 168a6: 4d ea ldi r20, 0xAD ; 173 168a8: 5c ef ldi r21, 0xFC ; 252 168aa: 69 e6 ldi r22, 0x69 ; 105 168ac: 73 e8 ldi r23, 0x83 ; 131 168ae: e9 cf rjmp .-46 ; 0x16882 //! 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); 168b0: 89 e0 ldi r24, 0x09 ; 9 168b2: 9e e3 ldi r25, 0x3E ; 62 168b4: b4 cf rjmp .-152 ; 0x1681e #endif //PINDA_TEMP_COMP MENU_END(); } 168b6: 08 95 ret 000168b8 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168b8: 0f 94 5d 93 call 0x326ba ; 0x326ba 168bc: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 168c0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168c4: 84 30 cpi r24, 0x04 ; 4 168c6: a8 f4 brcc .+42 ; 0x168f2 168c8: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 168cc: 86 e7 ldi r24, 0x76 ; 118 168ce: 90 e4 ldi r25, 0x40 ; 64 168d0: 0e 94 3c 6d call 0xda78 ; 0xda78 168d4: 0f 94 28 96 call 0x32c50 ; 0x32c50 #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(); 168d8: 0f 94 31 93 call 0x32662 ; 0x32662 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168dc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168e0: 8f 5f subi r24, 0xFF ; 255 168e2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 168e6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 168ea: 8f 5f subi r24, 0xFF ; 255 168ec: 80 93 30 04 sts 0x0430, r24 ; 0x800430 168f0: e7 cf rjmp .-50 ; 0x168c0 #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(); } 168f2: 08 95 ret 000168f4 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 168f4: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 168f6: 8e e0 ldi r24, 0x0E ; 14 168f8: 9e e3 ldi r25, 0x3E ; 62 168fa: 0e 94 3c 6d call 0xda78 ; 0xda78 168fe: ac 01 movw r20, r24 16900: 60 e0 ldi r22, 0x00 ; 0 16902: 80 e0 ldi r24, 0x00 ; 0 16904: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc_at(0, 1, '\n'); 16908: 4a e0 ldi r20, 0x0A ; 10 1690a: 61 e0 ldi r22, 0x01 ; 1 1690c: 80 e0 ldi r24, 0x00 ; 0 1690e: 0e 94 26 6a call 0xd44c ; 0xd44c MENU_BEGIN(); 16912: 0f 94 5d 93 call 0x326ba ; 0x326ba 16916: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1691a: 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(); 1691c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16920: 84 30 cpi r24, 0x04 ; 4 16922: 18 f5 brcc .+70 ; 0x1696a 16924: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 16928: 81 11 cpse r24, r1 1692a: 02 c0 rjmp .+4 ; 0x16930 1692c: 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); 16930: 89 e0 ldi r24, 0x09 ; 9 16932: 9e e3 ldi r25, 0x3E ; 62 16934: 0e 94 3c 6d call 0xda78 ; 0xda78 16938: 69 ee ldi r22, 0xE9 ; 233 1693a: 7d ef ldi r23, 0xFD ; 253 1693c: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 16940: 83 e0 ldi r24, 0x03 ; 3 16942: 9e e3 ldi r25, 0x3E ; 62 16944: 0e 94 3c 6d call 0xda78 ; 0xda78 16948: 6d ea ldi r22, 0xAD ; 173 1694a: 7f ee ldi r23, 0xEF ; 239 1694c: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_END(); 16950: 0f 94 31 93 call 0x32662 ; 0x32662 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 16954: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16958: 8f 5f subi r24, 0xFF ; 255 1695a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1695e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16962: 8f 5f subi r24, 0xFF ; 255 16964: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16968: d9 cf rjmp .-78 ; 0x1691c // 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(); } 1696a: cf 91 pop r28 1696c: 08 95 ret 0001696e : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1696e: 0f 94 5d 93 call 0x326ba ; 0x326ba 16972: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16976: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1697a: 84 30 cpi r24, 0x04 ; 4 1697c: 08 f0 brcs .+2 ; 0x16980 1697e: 3f c0 rjmp .+126 ; 0x169fe 16980: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 16984: 86 e4 ldi r24, 0x46 ; 70 16986: 9c e3 ldi r25, 0x3C ; 60 16988: 0e 94 3c 6d call 0xda78 ; 0xda78 1698c: 0f 94 28 96 call 0x32c50 ; 0x32c50 if(eeprom_is_sheet_initialized(selected_sheet)){ 16990: 80 91 98 03 lds r24, 0x0398 ; 0x800398 16994: 0e 94 a3 6f call 0xdf46 ; 0xdf46 16998: 88 23 and r24, r24 1699a: 41 f0 breq .+16 ; 0x169ac MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1699c: 8d e3 ldi r24, 0x3D ; 61 1699e: 9c e3 ldi r25, 0x3C ; 60 169a0: 0e 94 3c 6d call 0xda78 ; 0xda78 169a4: 64 ed ldi r22, 0xD4 ; 212 169a6: 7b eb ldi r23, 0xBB ; 187 169a8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } if (lcd_commands_type == LcdCommands::Idle) 169ac: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 169b0: 81 11 cpse r24, r1 169b2: 08 c0 rjmp .+16 ; 0x169c4 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 169b4: 8a e2 ldi r24, 0x2A ; 42 169b6: 9c e3 ldi r25, 0x3C ; 60 169b8: 0e 94 3c 6d call 0xda78 ; 0xda78 169bc: 61 e4 ldi r22, 0x41 ; 65 169be: 73 eb ldi r23, 0xB3 ; 179 169c0: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 169c4: 81 e2 ldi r24, 0x21 ; 33 169c6: 9c e3 ldi r25, 0x3C ; 60 169c8: 0e 94 3c 6d call 0xda78 ; 0xda78 169cc: 62 e4 ldi r22, 0x42 ; 66 169ce: 7a eb ldi r23, 0xBA ; 186 169d0: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 169d4: 89 e1 ldi r24, 0x19 ; 25 169d6: 9c e3 ldi r25, 0x3C ; 60 169d8: 0e 94 3c 6d call 0xda78 ; 0xda78 169dc: 69 e3 ldi r22, 0x39 ; 57 169de: 76 ec ldi r23, 0xC6 ; 198 169e0: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_END(); 169e4: 0f 94 31 93 call 0x32662 ; 0x32662 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 169e8: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 169ec: 8f 5f subi r24, 0xFF ; 255 169ee: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 169f2: 80 91 30 04 lds r24, 0x0430 ; 0x800430 169f6: 8f 5f subi r24, 0xFF ; 255 169f8: 80 93 30 04 sts 0x0430, r24 ; 0x800430 169fc: bc cf rjmp .-136 ; 0x16976 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 169fe: 08 95 ret 00016a00 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a00: 87 e0 ldi r24, 0x07 ; 7 16a02: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a06: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a0a ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a0a: 86 e0 ldi r24, 0x06 ; 6 16a0c: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a10: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a14 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a14: 85 e0 ldi r24, 0x05 ; 5 16a16: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a1a: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a1e ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a1e: 84 e0 ldi r24, 0x04 ; 4 16a20: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a24: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a28 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a28: 83 e0 ldi r24, 0x03 ; 3 16a2a: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a2e: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a32 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a32: 82 e0 ldi r24, 0x02 ; 2 16a34: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a38: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a3c ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a3c: 81 e0 ldi r24, 0x01 ; 1 16a3e: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a42: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a46 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a46: 10 92 98 03 sts 0x0398, r1 ; 0x800398 lcd_sheet_menu(); 16a4a: 0c 94 b7 b4 jmp 0x1696e ; 0x1696e 00016a4e : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 16a4e: cf 92 push r12 16a50: df 92 push r13 16a52: ef 92 push r14 16a54: ff 92 push r15 16a56: 0f 93 push r16 16a58: 1f 93 push r17 16a5a: cf 93 push r28 16a5c: df 93 push r29 16a5e: 6c 01 movw r12, r24 16a60: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 16a62: c4 2f mov r28, r20 16a64: d0 e0 ldi r29, 0x00 ; 0 16a66: ae 01 movw r20, r28 16a68: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 16a6c: 89 2b or r24, r25 16a6e: b9 f4 brne .+46 ; 0x16a9e Number(str + tagSize, v); 16a70: b8 01 movw r22, r16 16a72: c6 01 movw r24, r12 16a74: 8c 0f add r24, r28 16a76: 9d 1f adc r25, r29 16a78: 0e 94 71 b1 call 0x162e2 ; 0x162e2 *v |= tagMask; 16a7c: f8 01 movw r30, r16 16a7e: 20 81 ld r18, Z 16a80: 31 81 ldd r19, Z+1 ; 0x01 16a82: 2e 29 or r18, r14 16a84: 3f 29 or r19, r15 16a86: 31 83 std Z+1, r19 ; 0x01 16a88: 20 83 st Z, r18 return true; 16a8a: 81 e0 ldi r24, 0x01 ; 1 } return false; } 16a8c: df 91 pop r29 16a8e: cf 91 pop r28 16a90: 1f 91 pop r17 16a92: 0f 91 pop r16 16a94: ff 90 pop r15 16a96: ef 90 pop r14 16a98: df 90 pop r13 16a9a: cf 90 pop r12 16a9c: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 16a9e: 80 e0 ldi r24, 0x00 ; 0 16aa0: f5 cf rjmp .-22 ; 0x16a8c 00016aa2 : } 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 16aa2: 41 e0 ldi r20, 0x01 ; 1 16aa4: 61 e0 ldi r22, 0x01 ; 1 16aa6: 85 ea ldi r24, 0xA5 ; 165 16aa8: 93 e8 ldi r25, 0x83 ; 131 16aaa: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (disable == LCD_LEFT_BUTTON_CHOICE) 16aae: 81 11 cpse r24, r1 16ab0: 07 c0 rjmp .+14 ; 0x16ac0 { enquecommand_P(PSTR("G99")); 16ab2: 61 e0 ldi r22, 0x01 ; 1 16ab4: 81 ea ldi r24, 0xA1 ; 161 16ab6: 93 e8 ldi r25, 0x83 ; 131 16ab8: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 16abc: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 } lcd_update_enable(true); 16ac0: 81 e0 ldi r24, 0x01 ; 1 16ac2: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_draw_update = 2; 16ac6: 82 e0 ldi r24, 0x02 ; 2 16ac8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 16acc: 08 95 ret 00016ace : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 16ace: ef 92 push r14 16ad0: ff 92 push r15 16ad2: 0f 93 push r16 16ad4: 1f 93 push r17 16ad6: cf 93 push r28 16ad8: df 93 push r29 16ada: cd b7 in r28, 0x3d ; 61 16adc: de b7 in r29, 0x3e ; 62 16ade: 6b 97 sbiw r28, 0x1b ; 27 16ae0: 0f b6 in r0, 0x3f ; 63 16ae2: f8 94 cli 16ae4: de bf out 0x3e, r29 ; 62 16ae6: 0f be out 0x3f, r0 ; 63 16ae8: 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); 16aea: 8a e5 ldi r24, 0x5A ; 90 16aec: 9f e0 ldi r25, 0x0F ; 15 16aee: 0f 94 7d a0 call 0x340fa ; 0x340fa 16af2: e8 2e mov r14, r24 16af4: 0a e0 ldi r16, 0x0A ; 10 16af6: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 16af8: 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); 16afa: 48 e0 ldi r20, 0x08 ; 8 16afc: 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++) { 16afe: ef 14 cp r14, r15 16b00: 79 f0 breq .+30 ; 0x16b20 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 16b02: b8 01 movw r22, r16 16b04: ce 01 movw r24, r28 16b06: 0e 96 adiw r24, 0x0e ; 14 16b08: 0f 94 6d a0 call 0x340da ; 0x340da dir_name[8] = '\0'; 16b0c: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 16b0e: 60 e0 ldi r22, 0x00 ; 0 16b10: ce 01 movw r24, r28 16b12: 0e 96 adiw r24, 0x0e ; 14 16b14: 0f 94 6d 4a call 0x294da ; 0x294da 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++) { 16b18: f3 94 inc r15 16b1a: 08 5f subi r16, 0xF8 ; 248 16b1c: 1f 4f sbci r17, 0xFF ; 255 16b1e: ed cf rjmp .-38 ; 0x16afa 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); 16b20: 65 e9 ldi r22, 0x95 ; 149 16b22: 7f e0 ldi r23, 0x0F ; 15 16b24: 8e 01 movw r16, r28 16b26: 0f 5f subi r16, 0xFF ; 255 16b28: 1f 4f sbci r17, 0xFF ; 255 16b2a: c8 01 movw r24, r16 16b2c: 0f 94 6d a0 call 0x340da ; 0x340da // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 16b30: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 16b32: 8e e2 ldi r24, 0x2E ; 46 16b34: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 16b36: 43 e0 ldi r20, 0x03 ; 3 16b38: 50 e0 ldi r21, 0x00 ; 0 16b3a: 61 e9 ldi r22, 0x91 ; 145 16b3c: 7c e0 ldi r23, 0x0C ; 12 16b3e: ce 01 movw r24, r28 16b40: 48 96 adiw r24, 0x18 ; 24 16b42: 0f 94 6d a0 call 0x340da ; 0x340da extension_ptr[4] = '\0'; 16b46: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 16b48: be 01 movw r22, r28 16b4a: 69 5e subi r22, 0xE9 ; 233 16b4c: 7f 4f sbci r23, 0xFF ; 255 16b4e: c8 01 movw r24, r16 16b50: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 enquecommandf_P(MSG_M23, filename); 16b54: 1f 93 push r17 16b56: 0f 93 push r16 16b58: 8d e8 ldi r24, 0x8D ; 141 16b5a: 9c e6 ldi r25, 0x6C ; 108 16b5c: 9f 93 push r25 16b5e: 8f 93 push r24 16b60: 0e 94 d0 7d call 0xfba0 ; 0xfba0 restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 16b64: 61 e0 ldi r22, 0x01 ; 1 16b66: 89 e8 ldi r24, 0x89 ; 137 16b68: 9c e6 ldi r25, 0x6C ; 108 16b6a: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 16b6e: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 16b72: 0f 90 pop r0 16b74: 0f 90 pop r0 16b76: 0f 90 pop r0 16b78: 0f 90 pop r0 } 16b7a: 6b 96 adiw r28, 0x1b ; 27 16b7c: 0f b6 in r0, 0x3f ; 63 16b7e: f8 94 cli 16b80: de bf out 0x3e, r29 ; 62 16b82: 0f be out 0x3f, r0 ; 63 16b84: cd bf out 0x3d, r28 ; 61 16b86: df 91 pop r29 16b88: cf 91 pop r28 16b8a: 1f 91 pop r17 16b8c: 0f 91 pop r16 16b8e: ff 90 pop r15 16b90: ef 90 pop r14 16b92: 08 95 ret 00016b94 : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 16b94: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 16b96: 89 e2 ldi r24, 0x29 ; 41 16b98: 9d e0 ldi r25, 0x0D ; 13 16b9a: 0f 94 7d a0 call 0x340fa ; 0x340fa 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; 16b9e: 81 50 subi r24, 0x01 ; 1 16ba0: c1 e0 ldi r28, 0x01 ; 1 16ba2: 8e 3f cpi r24, 0xFE ; 254 16ba4: 08 f4 brcc .+2 ; 0x16ba8 16ba6: c0 e0 ldi r28, 0x00 ; 0 16ba8: 6c 2f mov r22, r28 16baa: 89 e2 ldi r24, 0x29 ; 41 16bac: 9d e0 ldi r25, 0x0D ; 13 16bae: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 16bb2: 85 e1 ldi r24, 0x15 ; 21 16bb4: 94 e8 ldi r25, 0x84 ; 132 16bb6: 0e 94 de 72 call 0xe5bc ; 0xe5bc } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16bba: 8c 2f mov r24, r28 16bbc: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_ECHOLN(pinda_temp_compensation); } 16bc0: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 16bc2: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 00016bc6 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 16bc6: cf 93 push r28 16bc8: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 16bca: 81 eb ldi r24, 0xB1 ; 177 16bcc: 93 e0 ldi r25, 0x03 ; 3 16bce: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 16bd2: 80 91 05 12 lds r24, 0x1205 ; 0x801205 16bd6: 81 11 cpse r24, r1 16bd8: 18 c0 rjmp .+48 ; 0x16c0a 16bda: 80 91 06 12 lds r24, 0x1206 ; 0x801206 16bde: 81 11 cpse r24, r1 16be0: 14 c0 rjmp .+40 ; 0x16c0a 16be2: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 16be6: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 16bea: 87 e3 ldi r24, 0x37 ; 55 16bec: cb 39 cpi r28, 0x9B ; 155 16bee: d8 07 cpc r29, r24 16bf0: 61 f0 breq .+24 ; 0x16c0a 16bf2: 88 e3 ldi r24, 0x38 ; 56 16bf4: cf 32 cpi r28, 0x2F ; 47 16bf6: d8 07 cpc r29, r24 16bf8: 41 f0 breq .+16 ; 0x16c0a 16bfa: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 16bfe: 81 11 cpse r24, r1 16c00: 04 c0 rjmp .+8 ; 0x16c0a 16c02: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 16c06: 88 23 and r24, r24 16c08: 31 f0 breq .+12 ; 0x16c16 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 16c0a: 82 e0 ldi r24, 0x02 ; 2 16c0c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c10: df 91 pop r29 16c12: cf 91 pop r28 16c14: 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) 16c16: 83 eb ldi r24, 0xB3 ; 179 16c18: c0 3b cpi r28, 0xB0 ; 176 16c1a: d8 07 cpc r29, r24 16c1c: 81 f4 brne .+32 ; 0x16c3e { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 16c1e: 82 e0 ldi r24, 0x02 ; 2 16c20: 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)); 16c24: 8a e2 ldi r24, 0x2A ; 42 16c26: 9d e0 ldi r25, 0x0D ; 13 16c28: 0f 94 7d a0 call 0x340fa ; 0x340fa 16c2c: 61 e0 ldi r22, 0x01 ; 1 16c2e: 81 11 cpse r24, r1 16c30: 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); 16c32: 8a e2 ldi r24, 0x2A ; 42 16c34: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c36: df 91 pop r29 16c38: cf 91 pop r28 16c3a: 0d 94 c5 a0 jmp 0x3418a ; 0x3418a 16c3e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 16c42: 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 16c46: 98 13 cpse r25, r24 16c48: 04 c0 rjmp .+8 ; 0x16c52 16c4a: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 16c4e: 88 23 and r24, r24 16c50: 61 f0 breq .+24 ; 0x16c6a if ( babystep_allowed_strict() 16c52: 0e 94 8e 61 call 0xc31c ; 0xc31c && (menu_menu == lcd_status_screen // and in listed menus... 16c56: 81 11 cpse r24, r1 16c58: 10 c0 rjmp .+32 ; 0x16c7a Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 16c5a: 82 e0 ldi r24, 0x02 ; 2 16c5c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 16c60: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c62: df 91 pop r29 16c64: cf 91 pop r28 16c66: 0d 94 71 2c jmp 0x258e2 ; 0x258e2 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 16c6a: 87 e3 ldi r24, 0x37 ; 55 16c6c: c1 3c cpi r28, 0xC1 ; 193 16c6e: d8 07 cpc r29, r24 16c70: e1 f4 brne .+56 ; 0x16caa #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16c72: 60 e0 ldi r22, 0x00 ; 0 16c74: 8f e2 ldi r24, 0x2F ; 47 16c76: 98 e3 ldi r25, 0x38 ; 56 16c78: 14 c0 rjmp .+40 ; 0x16ca2 // 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... 16c7a: 87 e3 ldi r24, 0x37 ; 55 16c7c: c1 3c cpi r28, 0xC1 ; 193 16c7e: d8 07 cpc r29, r24 16c80: 59 f0 breq .+22 ; 0x16c98 || menu_menu == lcd_main_menu 16c82: 83 ec ldi r24, 0xC3 ; 195 16c84: cd 3f cpi r28, 0xFD ; 253 16c86: d8 07 cpc r29, r24 16c88: 39 f0 breq .+14 ; 0x16c98 || menu_menu == lcd_tune_menu 16c8a: 86 eb ldi r24, 0xB6 ; 182 16c8c: c2 39 cpi r28, 0x92 ; 146 16c8e: d8 07 cpc r29, r24 16c90: 19 f0 breq .+6 ; 0x16c98 || menu_menu == lcd_support_menu 16c92: c9 50 subi r28, 0x09 ; 9 16c94: d7 43 sbci r29, 0x37 ; 55 16c96: 09 f7 brne .-62 ; 0x16c5a ) ){ lcd_clear(); 16c98: 0e 94 39 6a call 0xd472 ; 0xd472 menu_submenu(lcd_babystep_z); 16c9c: 60 e0 ldi r22, 0x00 ; 0 16c9e: 8b e9 ldi r24, 0x9B ; 155 16ca0: 97 e3 ldi r25, 0x37 ; 55 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16ca2: df 91 pop r29 16ca4: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16ca6: 0d 94 ca 94 jmp 0x32994 ; 0x32994 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 16caa: 83 ec ldi r24, 0xC3 ; 195 16cac: cd 3f cpi r28, 0xFD ; 253 16cae: d8 07 cpc r29, r24 16cb0: 01 f3 breq .-64 ; 0x16c72 || menu_menu == lcd_preheat_menu 16cb2: 88 e3 ldi r24, 0x38 ; 56 16cb4: cf 34 cpi r28, 0x4F ; 79 16cb6: d8 07 cpc r29, r24 16cb8: e1 f2 breq .-72 ; 0x16c72 || menu_menu == lcd_sdcard_menu 16cba: 8b ee ldi r24, 0xEB ; 235 16cbc: ce 3f cpi r28, 0xFE ; 254 16cbe: d8 07 cpc r29, r24 16cc0: c1 f2 breq .-80 ; 0x16c72 || menu_menu == lcd_settings_menu 16cc2: 87 eb ldi r24, 0xB7 ; 183 16cc4: c0 35 cpi r28, 0x50 ; 80 16cc6: d8 07 cpc r29, r24 16cc8: a1 f2 breq .-88 ; 0x16c72 || menu_menu == lcd_control_temperature_menu 16cca: 86 eb ldi r24, 0xB6 ; 182 16ccc: c2 37 cpi r28, 0x72 ; 114 16cce: d8 07 cpc r29, r24 16cd0: 81 f2 breq .-96 ; 0x16c72 #if (LANG_MODE != 0) || menu_menu == lcd_language 16cd2: 8d ef ldi r24, 0xFD ; 253 16cd4: ca 3f cpi r28, 0xFA ; 250 16cd6: d8 07 cpc r29, r24 16cd8: 61 f2 breq .-104 ; 0x16c72 #endif || menu_menu == lcd_support_menu 16cda: c9 50 subi r28, 0x09 ; 9 16cdc: d7 43 sbci r29, 0x37 ; 55 16cde: 09 f0 breq .+2 ; 0x16ce2 16ce0: bc cf rjmp .-136 ; 0x16c5a 16ce2: c7 cf rjmp .-114 ; 0x16c72 00016ce4 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16ce4: 0f 94 5d 93 call 0x326ba ; 0x326ba 16ce8: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16cec: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16cf0: 84 30 cpi r24, 0x04 ; 4 16cf2: b8 f4 brcc .+46 ; 0x16d22 16cf4: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 16cf8: 88 ef ldi r24, 0xF8 ; 248 16cfa: 9d e3 ldi r25, 0x3D ; 61 16cfc: 0e 94 3c 6d call 0xda78 ; 0xda78 16d00: 0f 94 28 96 call 0x32c50 ; 0x32c50 menuitems_temperature_common(); 16d04: 0f 94 ac 09 call 0x21358 ; 0x21358 MENU_END(); 16d08: 0f 94 31 93 call 0x32662 ; 0x32662 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16d0c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d10: 8f 5f subi r24, 0xFF ; 255 16d12: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16d16: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16d1a: 8f 5f subi r24, 0xFF ; 255 16d1c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16d20: e5 cf rjmp .-54 ; 0x16cec MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 16d22: 08 95 ret 00016d24 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 16d24: ef 92 push r14 16d26: ff 92 push r15 16d28: 0f 93 push r16 16d2a: 1f 93 push r17 16d2c: cf 93 push r28 16d2e: df 93 push r29 16d30: 80 91 59 02 lds r24, 0x0259 ; 0x800259 16d34: 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) 16d38: 20 91 71 03 lds r18, 0x0371 ; 0x800371 16d3c: 21 11 cpse r18, r1 16d3e: 91 c0 rjmp .+290 ; 0x16e62 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 16d40: 21 e0 ldi r18, 0x01 ; 1 16d42: 20 93 71 03 sts 0x0371, r18 ; 0x800371 _md->extrudemultiply = extrudemultiply; 16d46: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16d4a: 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); 16d4e: 8f ef ldi r24, 0xFF ; 255 16d50: 9f e0 ldi r25, 0x0F ; 15 16d52: 0f 94 7d a0 call 0x340fa ; 0x340fa 16d56: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16d5a: 0f 94 5d 93 call 0x326ba ; 0x326ba 16d5e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16d62: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d66: 84 30 cpi r24, 0x04 ; 4 16d68: 08 f0 brcs .+2 ; 0x16d6c 16d6a: 93 c0 rjmp .+294 ; 0x16e92 16d6c: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 16d70: 0f 94 dd 91 call 0x323ba ; 0x323ba 16d74: 81 11 cpse r24, r1 16d76: 0e 94 50 5f call 0xbea0 ; 0xbea0 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16d7a: 8a e5 ldi r24, 0x5A ; 90 16d7c: 9e e3 ldi r25, 0x3E ; 62 16d7e: 0e 94 3c 6d call 0xda78 ; 0xda78 16d82: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 16d86: 85 ec ldi r24, 0xC5 ; 197 16d88: 9d e3 ldi r25, 0x3D ; 61 16d8a: 0e 94 3c 6d call 0xda78 ; 0xda78 16d8e: f1 2c mov r15, r1 16d90: e1 2c mov r14, r1 16d92: 07 ee ldi r16, 0xE7 ; 231 16d94: 13 e0 ldi r17, 0x03 ; 3 16d96: 2a e0 ldi r18, 0x0A ; 10 16d98: 30 e0 ldi r19, 0x00 ; 0 16d9a: 40 e1 ldi r20, 0x10 ; 16 16d9c: 6e e8 ldi r22, 0x8E ; 142 16d9e: 72 e0 ldi r23, 0x02 ; 2 16da0: 0f 94 ad 93 call 0x3275a ; 0x3275a menuitems_temperature_common(); 16da4: 0f 94 ac 09 call 0x21358 ; 0x21358 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 16da8: 8e eb ldi r24, 0xBE ; 190 16daa: 9d e3 ldi r25, 0x3D ; 61 16dac: 0e 94 3c 6d call 0xda78 ; 0xda78 16db0: 2a e0 ldi r18, 0x0A ; 10 16db2: 30 e0 ldi r19, 0x00 ; 0 16db4: 40 e1 ldi r20, 0x10 ; 16 16db6: 69 e5 ldi r22, 0x59 ; 89 16db8: 72 e0 ldi r23, 0x02 ; 2 16dba: 0f 94 ad 93 call 0x3275a ; 0x3275a #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 16dbe: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16dc2: 81 11 cpse r24, r1 16dc4: 08 c0 rjmp .+16 ; 0x16dd6 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 16dc6: 8c ea ldi r24, 0xAC ; 172 16dc8: 9d e3 ldi r25, 0x3D ; 61 16dca: 0e 94 3c 6d call 0xda78 ; 0xda78 16dce: 60 e1 ldi r22, 0x10 ; 16 16dd0: 7f ee ldi r23, 0xEF ; 239 16dd2: 0f 94 da 92 call 0x325b4 ; 0x325b4 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 16dd6: 0e 94 48 61 call 0xc290 ; 0xc290 16dda: 88 23 and r24, r24 16ddc: 41 f0 breq .+16 ; 0x16dee MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 16dde: 87 ef ldi r24, 0xF7 ; 247 16de0: 98 e4 ldi r25, 0x48 ; 72 16de2: 0e 94 3c 6d call 0xda78 ; 0xda78 16de6: 68 eb ldi r22, 0xB8 ; 184 16de8: 73 e8 ldi r23, 0x83 ; 131 16dea: 0f 94 53 92 call 0x324a6 ; 0x324a6 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16dee: 8e e9 ldi r24, 0x9E ; 158 16df0: 9d e3 ldi r25, 0x3D ; 61 16df2: 0e 94 3c 6d call 0xda78 ; 0xda78 16df6: 6b ed ldi r22, 0xDB ; 219 16df8: 7c ef ldi r23, 0xFC ; 252 16dfa: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 16dfe: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16e02: 81 30 cpi r24, 0x01 ; 1 16e04: 11 f4 brne .+4 ; 0x16e0a { menuitems_MMU_settings_common(); 16e06: 0f 94 e5 09 call 0x213ca ; 0x213ca } SETTINGS_FANS_CHECK(); 16e0a: 0f 94 92 09 call 0x21324 ; 0x21324 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16e0e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16e12: 81 11 cpse r24, r1 16e14: 02 c0 rjmp .+4 ; 0x16e1a 16e16: 0e 94 8f b3 call 0x1671e ; 0x1671e menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e1a: 80 91 15 04 lds r24, 0x0415 ; 0x800415 16e1e: 82 30 cpi r24, 0x02 ; 2 16e20: 91 f1 breq .+100 ; 0x16e86 16e22: 83 30 cpi r24, 0x03 ; 3 16e24: 99 f1 breq .+102 ; 0x16e8c 16e26: 81 30 cpi r24, 0x01 ; 1 16e28: 59 f1 breq .+86 ; 0x16e80 16e2a: 87 e9 ldi r24, 0x97 ; 151 16e2c: 9d e3 ldi r25, 0x3D ; 61 16e2e: 0e 94 3c 6d call 0xda78 ; 0xda78 16e32: ec 01 movw r28, r24 16e34: 8f e8 ldi r24, 0x8F ; 143 16e36: 9d e3 ldi r25, 0x3D ; 61 16e38: 0e 94 3c 6d call 0xda78 ; 0xda78 16e3c: 22 e0 ldi r18, 0x02 ; 2 16e3e: 45 e8 ldi r20, 0x85 ; 133 16e40: 5c ef ldi r21, 0xFC ; 252 16e42: be 01 movw r22, r28 16e44: 0f 94 ec 94 call 0x329d8 ; 0x329d8 if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 16e48: 0f 94 31 93 call 0x32662 ; 0x32662 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16e4c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16e50: 8f 5f subi r24, 0xFF ; 255 16e52: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16e56: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16e5a: 8f 5f subi r24, 0xFF ; 255 16e5c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16e60: 80 cf rjmp .-256 ; 0x16d62 { // 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) 16e62: 20 91 72 03 lds r18, 0x0372 ; 0x800372 16e66: 30 91 73 03 lds r19, 0x0373 ; 0x800373 16e6a: 28 17 cp r18, r24 16e6c: 39 07 cpc r19, r25 16e6e: 09 f4 brne .+2 ; 0x16e72 16e70: 6e cf rjmp .-292 ; 0x16d4e { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 16e72: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16e76: 80 93 72 03 sts 0x0372, r24 ; 0x800372 calculate_extruder_multipliers(); 16e7a: 0e 94 5d 5f call 0xbeba ; 0xbeba 16e7e: 67 cf rjmp .-306 ; 0x16d4e menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e80: 88 e8 ldi r24, 0x88 ; 136 16e82: 9d e3 ldi r25, 0x3D ; 61 16e84: d4 cf rjmp .-88 ; 0x16e2e 16e86: 8a e8 ldi r24, 0x8A ; 138 16e88: 90 e4 ldi r25, 0x40 ; 64 16e8a: d1 cf rjmp .-94 ; 0x16e2e 16e8c: 8f e7 ldi r24, 0x7F ; 127 16e8e: 9d e3 ldi r25, 0x3D ; 61 16e90: ce cf rjmp .-100 ; 0x16e2e { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 16e92: df 91 pop r29 16e94: cf 91 pop r28 16e96: 1f 91 pop r17 16e98: 0f 91 pop r16 16e9a: ff 90 pop r15 16e9c: ef 90 pop r14 16e9e: 08 95 ret 00016ea0 : MENU_END(); } static void lcd_settings_menu() { 16ea0: 1f 93 push r17 16ea2: cf 93 push r28 16ea4: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 16ea6: 8f ef ldi r24, 0xFF ; 255 16ea8: 9f e0 ldi r25, 0x0F ; 15 16eaa: 0f 94 7d a0 call 0x340fa ; 0x340fa 16eae: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16eb2: 0f 94 5d 93 call 0x326ba ; 0x326ba 16eb6: 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 16eba: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16ebc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16ec0: 84 30 cpi r24, 0x04 ; 4 16ec2: 08 f0 brcs .+2 ; 0x16ec6 16ec4: 45 c1 rjmp .+650 ; 0x17150 16ec6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16eca: 8a e5 ldi r24, 0x5A ; 90 16ecc: 9e e3 ldi r25, 0x3E ; 62 16ece: 0e 94 3c 6d call 0xda78 ; 0xda78 16ed2: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 16ed6: 88 e2 ldi r24, 0x28 ; 40 16ed8: 9b e3 ldi r25, 0x3B ; 59 16eda: 0e 94 3c 6d call 0xda78 ; 0xda78 16ede: 62 e7 ldi r22, 0x72 ; 114 16ee0: 76 eb ldi r23, 0xB6 ; 182 16ee2: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 if (!printer_active() || printingIsPaused()) 16ee6: 0e 94 a4 61 call 0xc348 ; 0xc348 16eea: 88 23 and r24, r24 16eec: 21 f0 breq .+8 ; 0x16ef6 16eee: 0e 94 48 61 call 0xc290 ; 0xc290 16ef2: 88 23 and r24, r24 16ef4: 81 f0 breq .+32 ; 0x16f16 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 16ef6: 8c e1 ldi r24, 0x1C ; 28 16ef8: 9b e3 ldi r25, 0x3B ; 59 16efa: 0e 94 3c 6d call 0xda78 ; 0xda78 16efe: 60 e4 ldi r22, 0x40 ; 64 16f00: 7e ef ldi r23, 0xFE ; 254 16f02: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 16f06: 89 e0 ldi r24, 0x09 ; 9 16f08: 9b e3 ldi r25, 0x3B ; 59 16f0a: 0e 94 3c 6d call 0xda78 ; 0xda78 16f0e: 6d ea ldi r22, 0xAD ; 173 16f10: 78 e6 ldi r23, 0x68 ; 104 16f12: 0f 94 53 92 call 0x324a6 ; 0x324a6 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16f16: 8e e9 ldi r24, 0x9E ; 158 16f18: 9d e3 ldi r25, 0x3D ; 61 16f1a: 0e 94 3c 6d call 0xda78 ; 0xda78 16f1e: 6b ed ldi r22, 0xDB ; 219 16f20: 7c ef ldi r23, 0xFC ; 252 16f22: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #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); 16f26: 8c ea ldi r24, 0xAC ; 172 16f28: 9c e0 ldi r25, 0x0C ; 12 16f2a: 0f 94 7d a0 call 0x340fa ; 0x340fa 16f2e: 88 23 and r24, r24 16f30: 09 f4 brne .+2 ; 0x16f34 16f32: 91 c0 rjmp .+290 ; 0x17056 16f34: 81 e7 ldi r24, 0x71 ; 113 16f36: 9b e5 ldi r25, 0x5B ; 91 16f38: 0e 94 3c 6d call 0xda78 ; 0xda78 16f3c: 22 e0 ldi r18, 0x02 ; 2 16f3e: 44 ec ldi r20, 0xC4 ; 196 16f40: 5d ef ldi r21, 0xFD ; 253 16f42: bc 01 movw r22, r24 16f44: 89 e9 ldi r24, 0x99 ; 153 16f46: 93 e8 ldi r25, 0x83 ; 131 16f48: 0f 94 ec 94 call 0x329d8 ; 0x329d8 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 16f4c: 8c ea ldi r24, 0xAC ; 172 16f4e: 9c e0 ldi r25, 0x0C ; 12 16f50: 0f 94 7d a0 call 0x340fa ; 0x340fa 16f54: 88 23 and r24, r24 16f56: 31 f0 breq .+12 ; 0x16f64 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 16f58: 63 e9 ldi r22, 0x93 ; 147 16f5a: 7c eb ldi r23, 0xBC ; 188 16f5c: 8f e8 ldi r24, 0x8F ; 143 16f5e: 93 e8 ldi r25, 0x83 ; 131 16f60: 0f 94 da 92 call 0x325b4 ; 0x325b4 } if (MMU2::mmu2.Enabled()) 16f64: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16f68: 81 30 cpi r24, 0x01 ; 1 16f6a: 51 f4 brne .+20 ; 0x16f80 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 16f6c: 0f 94 e5 09 call 0x213ca ; 0x213ca MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 16f70: 8a ef ldi r24, 0xFA ; 250 16f72: 9a e3 ldi r25, 0x3A ; 58 16f74: 0e 94 3c 6d call 0xda78 ; 0xda78 16f78: 61 ed ldi r22, 0xD1 ; 209 16f7a: 7b eb ldi r23, 0xBB ; 187 16f7c: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } SETTINGS_FANS_CHECK(); 16f80: 0f 94 92 09 call 0x21324 ; 0x21324 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16f84: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f88: 81 11 cpse r24, r1 16f8a: 02 c0 rjmp .+4 ; 0x16f90 16f8c: 0e 94 8f b3 call 0x1671e ; 0x1671e } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 16f90: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f94: 81 11 cpse r24, r1 16f96: 62 c0 rjmp .+196 ; 0x1705c { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 16f98: 10 93 ba 03 sts 0x03BA, r17 ; 0x8003ba MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 16f9c: 8f ee ldi r24, 0xEF ; 239 16f9e: 9a e3 ldi r25, 0x3A ; 58 16fa0: 0e 94 3c 6d call 0xda78 ; 0xda78 16fa4: 60 eb ldi r22, 0xB0 ; 176 16fa6: 73 eb ldi r23, 0xB3 ; 179 16fa8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } 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); 16fac: 8e e8 ldi r24, 0x8E ; 142 16fae: 9b e3 ldi r25, 0x3B ; 59 16fb0: 0e 94 3c 6d call 0xda78 ; 0xda78 16fb4: 6d ef ldi r22, 0xFD ; 253 16fb6: 7a eb ldi r23, 0xBA ; 186 16fb8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #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()) 16fbc: 0f 94 84 14 call 0x22908 ; 0x22908 16fc0: 88 23 and r24, r24 16fc2: b1 f0 breq .+44 ; 0x16ff0 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); 16fc4: 8f ea ldi r24, 0xAF ; 175 16fc6: 9f e0 ldi r25, 0x0F ; 15 16fc8: 0f 94 7d a0 call 0x340fa ; 0x340fa 16fcc: 88 23 and r24, r24 16fce: 09 f4 brne .+2 ; 0x16fd2 16fd0: 4e c0 rjmp .+156 ; 0x1706e 16fd2: 81 e7 ldi r24, 0x71 ; 113 16fd4: 9b e5 ldi r25, 0x5B ; 91 16fd6: 0e 94 3c 6d call 0xda78 ; 0xda78 16fda: ec 01 movw r28, r24 16fdc: 86 e3 ldi r24, 0x36 ; 54 16fde: 9b e3 ldi r25, 0x3B ; 59 16fe0: 0e 94 3c 6d call 0xda78 ; 0xda78 16fe4: 22 e0 ldi r18, 0x02 ; 2 16fe6: 47 e9 ldi r20, 0x97 ; 151 16fe8: 5d ef ldi r21, 0xFD ; 253 16fea: be 01 movw r22, r28 16fec: 0f 94 ec 94 call 0x329d8 ; 0x329d8 #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); 16ff0: 0e 94 48 61 call 0xc290 ; 0xc290 16ff4: 81 11 cpse r24, r1 16ff6: 08 c0 rjmp .+16 ; 0x17008 16ff8: 87 e5 ldi r24, 0x57 ; 87 16ffa: 9d e3 ldi r25, 0x3D ; 61 16ffc: 0e 94 3c 6d call 0xda78 ; 0xda78 17000: 6b e9 ldi r22, 0x9B ; 155 17002: 77 e3 ldi r23, 0x37 ; 55 17004: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 17008: 8d ec ldi r24, 0xCD ; 205 1700a: 9a e3 ldi r25, 0x3A ; 58 1700c: 0e 94 3c 6d call 0xda78 ; 0xda78 17010: 65 e1 ldi r22, 0x15 ; 21 17012: 77 e3 ldi r23, 0x37 ; 55 17014: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 17018: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1701c: 81 11 cpse r24, r1 1701e: 47 c0 rjmp .+142 ; 0x170ae if (card.ToshibaFlashAir_isEnabled()) 17020: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 17024: 88 23 and r24, r24 17026: 31 f1 breq .+76 ; 0x17074 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 17028: 83 ec ldi r24, 0xC3 ; 195 1702a: 9a e3 ldi r25, 0x3A ; 58 1702c: 0e 94 3c 6d call 0xda78 ; 0xda78 17030: 22 e0 ldi r18, 0x02 ; 2 17032: 4b e7 ldi r20, 0x7B ; 123 17034: 5c ef ldi r21, 0xFC ; 252 17036: 66 e0 ldi r22, 0x06 ; 6 17038: 78 e6 ldi r23, 0x68 ; 104 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1703a: 0f 94 ec 94 call 0x329d8 ; 0x329d8 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1703e: 89 e0 ldi r24, 0x09 ; 9 17040: 9f e0 ldi r25, 0x0F ; 15 17042: 0f 94 7d a0 call 0x340fa ; 0x340fa 17046: 88 23 and r24, r24 17048: 19 f1 breq .+70 ; 0x17090 1704a: 81 30 cpi r24, 0x01 ; 1 1704c: 09 f4 brne .+2 ; 0x17050 1704e: 71 c0 rjmp .+226 ; 0x17132 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); 17050: 87 eb ldi r24, 0xB7 ; 183 17052: 90 e4 ldi r25, 0x40 ; 64 17054: 1f c0 rjmp .+62 ; 0x17094 #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); 17056: 8b e6 ldi r24, 0x6B ; 107 17058: 9b e5 ldi r25, 0x5B ; 91 1705a: 6e cf rjmp .-292 ; 0x16f38 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); 1705c: 8f ed ldi r24, 0xDF ; 223 1705e: 9a e3 ldi r25, 0x3A ; 58 17060: 0e 94 3c 6d call 0xda78 ; 0xda78 17064: 67 e1 ldi r22, 0x17 ; 23 17066: 76 ec ldi r23, 0xC6 ; 198 17068: 0f 94 da 92 call 0x325b4 ; 0x325b4 1706c: 9f cf rjmp .-194 ; 0x16fac #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); 1706e: 8b e6 ldi r24, 0x6B ; 107 17070: 9b e5 ldi r25, 0x5B ; 91 17072: b1 cf rjmp .-158 ; 0x16fd6 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); 17074: 8a eb ldi r24, 0xBA ; 186 17076: 9a e3 ldi r25, 0x3A ; 58 17078: 0e 94 3c 6d call 0xda78 ; 0xda78 1707c: ec 01 movw r28, r24 1707e: 83 ec ldi r24, 0xC3 ; 195 17080: 9a e3 ldi r25, 0x3A ; 58 17082: 0e 94 3c 6d call 0xda78 ; 0xda78 17086: 22 e0 ldi r18, 0x02 ; 2 17088: 4b e7 ldi r20, 0x7B ; 123 1708a: 5c ef ldi r21, 0xFC ; 252 1708c: be 01 movw r22, r28 1708e: d5 cf rjmp .-86 ; 0x1703a #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; 17090: 83 eb ldi r24, 0xB3 ; 179 17092: 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); 17094: 0e 94 3c 6d call 0xda78 ; 0xda78 17098: ec 01 movw r28, r24 1709a: 8c ea ldi r24, 0xAC ; 172 1709c: 9a e3 ldi r25, 0x3A ; 58 1709e: 0e 94 3c 6d call 0xda78 ; 0xda78 170a2: 22 e0 ldi r18, 0x02 ; 2 170a4: 42 ea ldi r20, 0xA2 ; 162 170a6: 5d ef ldi r21, 0xFD ; 253 170a8: be 01 movw r22, r28 170aa: 0f 94 ec 94 call 0x329d8 ; 0x329d8 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 170ae: 80 91 15 04 lds r24, 0x0415 ; 0x800415 170b2: 82 30 cpi r24, 0x02 ; 2 170b4: 09 f4 brne .+2 ; 0x170b8 170b6: 43 c0 rjmp .+134 ; 0x1713e 170b8: 83 30 cpi r24, 0x03 ; 3 170ba: 09 f4 brne .+2 ; 0x170be 170bc: 43 c0 rjmp .+134 ; 0x17144 170be: 81 30 cpi r24, 0x01 ; 1 170c0: d9 f1 breq .+118 ; 0x17138 170c2: 87 e9 ldi r24, 0x97 ; 151 170c4: 9d e3 ldi r25, 0x3D ; 61 170c6: 0e 94 3c 6d call 0xda78 ; 0xda78 170ca: ec 01 movw r28, r24 170cc: 8f e8 ldi r24, 0x8F ; 143 170ce: 9d e3 ldi r25, 0x3D ; 61 170d0: 0e 94 3c 6d call 0xda78 ; 0xda78 170d4: 22 e0 ldi r18, 0x02 ; 2 170d6: 45 e8 ldi r20, 0x85 ; 133 170d8: 5c ef ldi r21, 0xFC ; 252 170da: be 01 movw r22, r28 170dc: 0f 94 ec 94 call 0x329d8 ; 0x329d8 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 170e0: 87 ea ldi r24, 0xA7 ; 167 170e2: 9c e0 ldi r25, 0x0C ; 12 170e4: 0f 94 7d a0 call 0x340fa ; 0x340fa 170e8: 88 23 and r24, r24 170ea: 79 f1 breq .+94 ; 0x1714a 170ec: 83 e0 ldi r24, 0x03 ; 3 170ee: 9e e3 ldi r25, 0x3E ; 62 170f0: 0e 94 3c 6d call 0xda78 ; 0xda78 170f4: 22 e0 ldi r18, 0x02 ; 2 170f6: 4f e0 ldi r20, 0x0F ; 15 170f8: 53 eb ldi r21, 0xB3 ; 179 170fa: bc 01 movw r22, r24 170fc: 89 ef ldi r24, 0xF9 ; 249 170fe: 97 e6 ldi r25, 0x67 ; 103 17100: 0f 94 ec 94 call 0x329d8 ; 0x329d8 if (farm_mode) 17104: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17108: 88 23 and r24, r24 1710a: 31 f0 breq .+12 ; 0x17118 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 1710c: 61 e5 ldi r22, 0x51 ; 81 1710e: 75 eb ldi r23, 0xB5 ; 181 17110: 8d e7 ldi r24, 0x7D ; 125 17112: 93 e8 ldi r25, 0x83 ; 131 17114: 0f 94 da 92 call 0x325b4 ; 0x325b4 } MENU_END(); 17118: 0f 94 31 93 call 0x32662 ; 0x32662 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1711c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17120: 8f 5f subi r24, 0xFF ; 255 17122: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17126: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1712a: 8f 5f subi r24, 0xFF ; 255 1712c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17130: c5 ce rjmp .-630 ; 0x16ebc 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; 17132: 81 ea ldi r24, 0xA1 ; 161 17134: 9a e3 ldi r25, 0x3A ; 58 17136: ae cf rjmp .-164 ; 0x17094 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 17138: 88 e8 ldi r24, 0x88 ; 136 1713a: 9d e3 ldi r25, 0x3D ; 61 1713c: c4 cf rjmp .-120 ; 0x170c6 1713e: 8a e8 ldi r24, 0x8A ; 138 17140: 90 e4 ldi r25, 0x40 ; 64 17142: c1 cf rjmp .-126 ; 0x170c6 17144: 8f e7 ldi r24, 0x7F ; 127 17146: 9d e3 ldi r25, 0x3D ; 61 17148: be cf rjmp .-132 ; 0x170c6 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 1714a: 89 e0 ldi r24, 0x09 ; 9 1714c: 9e e3 ldi r25, 0x3E ; 62 1714e: d0 cf rjmp .-96 ; 0x170f0 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 17150: df 91 pop r29 17152: cf 91 pop r28 17154: 1f 91 pop r17 17156: 08 95 ret 00017158 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17158: 0f 94 5d 93 call 0x326ba ; 0x326ba 1715c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17160: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17164: 84 30 cpi r24, 0x04 ; 4 17166: 08 f0 brcs .+2 ; 0x1716a 17168: 7d c0 rjmp .+250 ; 0x17264 1716a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1716e: 8a e5 ldi r24, 0x5A ; 90 17170: 9e e3 ldi r25, 0x3E ; 62 17172: 0e 94 3c 6d call 0xda78 ; 0xda78 17176: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1717a: 8b ec ldi r24, 0xCB ; 203 1717c: 9b e3 ldi r25, 0x3B ; 59 1717e: 0e 94 3c 6d call 0xda78 ; 0xda78 17182: 63 ee ldi r22, 0xE3 ; 227 17184: 77 e3 ldi r23, 0x37 ; 55 17186: 0f 94 da 92 call 0x325b4 ; 0x325b4 if (lcd_commands_type == LcdCommands::Idle) 1718a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1718e: 81 11 cpse r24, r1 17190: 08 c0 rjmp .+16 ; 0x171a2 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 17192: 8a e2 ldi r24, 0x2A ; 42 17194: 9c e3 ldi r25, 0x3C ; 60 17196: 0e 94 3c 6d call 0xda78 ; 0xda78 1719a: 69 ef ldi r22, 0xF9 ; 249 1719c: 7f ef ldi r23, 0xFF ; 255 1719e: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 171a2: 87 ef ldi r24, 0xF7 ; 247 171a4: 98 e4 ldi r25, 0x48 ; 72 171a6: 0e 94 3c 6d call 0xda78 ; 0xda78 171aa: 66 eb ldi r22, 0xB6 ; 182 171ac: 78 e6 ldi r23, 0x68 ; 104 171ae: 0f 94 53 92 call 0x324a6 ; 0x324a6 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 171b2: 80 ec ldi r24, 0xC0 ; 192 171b4: 9b e3 ldi r25, 0x3B ; 59 171b6: 0e 94 3c 6d call 0xda78 ; 0xda78 171ba: 6c e9 ldi r22, 0x9C ; 156 171bc: 76 ef ldi r23, 0xF6 ; 246 171be: 0f 94 da 92 call 0x325b4 ; 0x325b4 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 171c2: 80 eb ldi r24, 0xB0 ; 176 171c4: 9b e3 ldi r25, 0x3B ; 59 171c6: 0e 94 3c 6d call 0xda78 ; 0xda78 171ca: 62 e3 ldi r22, 0x32 ; 50 171cc: 7e ef ldi r23, 0xFE ; 254 171ce: 0f 94 da 92 call 0x325b4 ; 0x325b4 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 171d2: 82 ea ldi r24, 0xA2 ; 162 171d4: 9b e3 ldi r25, 0x3B ; 59 171d6: 0e 94 3c 6d call 0xda78 ; 0xda78 171da: 6b e2 ldi r22, 0x2B ; 43 171dc: 7e ef ldi r23, 0xFE ; 254 171de: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 171e2: 8e e8 ldi r24, 0x8E ; 142 171e4: 9b e3 ldi r25, 0x3B ; 59 171e6: 0e 94 3c 6d call 0xda78 ; 0xda78 171ea: 69 e3 ldi r22, 0x39 ; 57 171ec: 7e ef ldi r23, 0xFE ; 254 171ee: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 171f2: 8a e7 ldi r24, 0x7A ; 122 171f4: 9b e3 ldi r25, 0x3B ; 59 171f6: 0e 94 3c 6d call 0xda78 ; 0xda78 171fa: 64 eb ldi r22, 0xB4 ; 180 171fc: 7e ef ldi r23, 0xFE ; 254 171fe: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 17202: 88 e6 ldi r24, 0x68 ; 104 17204: 9b e3 ldi r25, 0x3B ; 59 17206: 0e 94 3c 6d call 0xda78 ; 0xda78 1720a: 6d e6 ldi r22, 0x6D ; 109 1720c: 7f ef ldi r23, 0xFF ; 255 1720e: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 17212: 87 e5 ldi r24, 0x57 ; 87 17214: 9b e3 ldi r25, 0x3B ; 59 17216: 0e 94 3c 6d call 0xda78 ; 0xda78 1721a: 6b ec ldi r22, 0xCB ; 203 1721c: 77 e3 ldi r23, 0x37 ; 55 1721e: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 17222: 83 e4 ldi r24, 0x43 ; 67 17224: 9b e3 ldi r25, 0x3B ; 59 17226: 0e 94 3c 6d call 0xda78 ; 0xda78 1722a: 6d e9 ldi r22, 0x9D ; 157 1722c: 73 e8 ldi r23, 0x83 ; 131 1722e: 0f 94 53 92 call 0x324a6 ; 0x324a6 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 17232: 0f 94 84 14 call 0x22908 ; 0x22908 17236: 88 23 and r24, r24 17238: 41 f0 breq .+16 ; 0x1724a MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1723a: 86 e3 ldi r24, 0x36 ; 54 1723c: 9b e3 ldi r25, 0x3B ; 59 1723e: 0e 94 3c 6d call 0xda78 ; 0xda78 17242: 64 e2 ldi r22, 0x24 ; 36 17244: 7e ef ldi r23, 0xFE ; 254 17246: 0f 94 da 92 call 0x325b4 ; 0x325b4 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 1724a: 0f 94 31 93 call 0x32662 ; 0x32662 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1724e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17252: 8f 5f subi r24, 0xFF ; 255 17254: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17258: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1725c: 8f 5f subi r24, 0xFF ; 255 1725e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17262: 7e cf rjmp .-260 ; 0x17160 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 17264: 08 95 ret 00017266 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 17266: bf 92 push r11 17268: cf 92 push r12 1726a: df 92 push r13 1726c: ef 92 push r14 1726e: ff 92 push r15 17270: 0f 93 push r16 17272: 1f 93 push r17 17274: cf 93 push r28 17276: df 93 push r29 17278: c8 2f mov r28, r24 1727a: f6 2e mov r15, r22 1727c: e4 2e mov r14, r20 1727e: b2 2e mov r11, r18 17280: 68 01 movw r12, r16 lcd_update_enable(false); 17282: 80 e0 ldi r24, 0x00 ; 0 17284: 0e 94 4b 6a call 0xd496 ; 0xd496 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 17288: dc e7 ldi r29, 0x7C ; 124 1728a: fe 14 cp r15, r14 1728c: 08 f0 brcs .+2 ; 0x17290 1728e: dd e2 ldi r29, 0x2D ; 45 if (_clear) 17290: bb 20 and r11, r11 17292: 09 f1 breq .+66 ; 0x172d6 lcd_clear(); 17294: 0e 94 39 6a call 0xd472 ; 0xd472 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 17298: c1 11 cpse r28, r1 1729a: 20 c0 rjmp .+64 ; 0x172dc if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1729c: 83 ea ldi r24, 0xA3 ; 163 1729e: 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)); 172a0: 0e 94 3c 6d call 0xda78 ; 0xda78 172a4: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172a8: 88 ef ldi r24, 0xF8 ; 248 172aa: 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 172ac: 82 30 cpi r24, 0x02 ; 2 172ae: 78 f5 brcc .+94 ; 0x1730e || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172b0: 8c ef ldi r24, 0xFC ; 252 172b2: 9f e3 ldi r25, 0x3F ; 63 172b4: 0e 94 3c 6d call 0xda78 ; 0xda78 172b8: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 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)); 172bc: 8b ed ldi r24, 0xDB ; 219 172be: 9f e3 ldi r25, 0x3F ; 63 172c0: cc 30 cpi r28, 0x0C ; 12 172c2: 49 f1 breq .+82 ; 0x17316 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 172c4: 89 ec ldi r24, 0xC9 ; 201 172c6: 9f e3 ldi r25, 0x3F ; 63 172c8: cd 30 cpi r28, 0x0D ; 13 172ca: 29 f1 breq .+74 ; 0x17316 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 172cc: ce 30 cpi r28, 0x0E ; 14 172ce: 39 f5 brne .+78 ; 0x1731e 172d0: 86 eb ldi r24, 0xB6 ; 182 172d2: 9f e3 ldi r25, 0x3F ; 63 172d4: 20 c0 rjmp .+64 ; 0x17316 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 172d6: 0e 94 32 6a call 0xd464 ; 0xd464 172da: de cf rjmp .-68 ; 0x17298 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172dc: c1 30 cpi r28, 0x01 ; 1 172de: f1 f2 breq .-68 ; 0x1729c if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172e0: c2 30 cpi r28, 0x02 ; 2 172e2: e1 f2 breq .-72 ; 0x1729c if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 172e4: 83 e5 ldi r24, 0x53 ; 83 172e6: 90 e4 ldi r25, 0x40 ; 64 172e8: c3 30 cpi r28, 0x03 ; 3 172ea: d1 f2 breq .-76 ; 0x172a0 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 172ec: 81 e4 ldi r24, 0x41 ; 65 172ee: 90 e4 ldi r25, 0x40 ; 64 172f0: c4 30 cpi r28, 0x04 ; 4 172f2: b1 f2 breq .-84 ; 0x172a0 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 172f4: 8f e2 ldi r24, 0x2F ; 47 172f6: 90 e4 ldi r25, 0x40 ; 64 172f8: c5 30 cpi r28, 0x05 ; 5 172fa: 91 f2 breq .-92 ; 0x172a0 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 172fc: 8d e1 ldi r24, 0x1D ; 29 172fe: 90 e4 ldi r25, 0x40 ; 64 17300: c6 30 cpi r28, 0x06 ; 6 17302: 71 f2 breq .-100 ; 0x172a0 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 17304: c7 30 cpi r28, 0x07 ; 7 17306: 81 f6 brne .-96 ; 0x172a8 17308: 8e e0 ldi r24, 0x0E ; 14 1730a: 90 e4 ldi r25, 0x40 ; 64 1730c: c9 cf rjmp .-110 ; 0x172a0 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)); 1730e: ca 30 cpi r28, 0x0A ; 10 17310: 99 f5 brne .+102 ; 0x17378 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 17312: 89 ee ldi r24, 0xE9 ; 233 17314: 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)); 17316: 0e 94 3c 6d call 0xda78 ; 0xda78 1731a: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1731e: 40 e0 ldi r20, 0x00 ; 0 17320: 54 e8 ldi r21, 0x84 ; 132 17322: 61 e0 ldi r22, 0x01 ; 1 17324: 80 e0 ldi r24, 0x00 ; 0 17326: 0e 94 1a 6a call 0xd434 ; 0xd434 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1732a: c3 30 cpi r28, 0x03 ; 3 1732c: 70 f5 brcc .+92 ; 0x1738a { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1732e: 88 ea ldi r24, 0xA8 ; 168 17330: 9f e3 ldi r25, 0x3F ; 63 17332: 0e 94 3c 6d call 0xda78 ; 0xda78 17336: ac 01 movw r20, r24 17338: 62 e0 ldi r22, 0x02 ; 2 1733a: 80 e0 ldi r24, 0x00 ; 0 1733c: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(18, 2); 17340: 62 e0 ldi r22, 0x02 ; 2 17342: 82 e1 ldi r24, 0x12 ; 18 17344: 0e 94 06 6a call 0xd40c ; 0xd40c (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17348: c1 11 cpse r28, r1 1734a: 1a c0 rjmp .+52 ; 0x17380 1734c: 8d 2f mov r24, r29 1734e: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 17352: 8b e9 ldi r24, 0x9B ; 155 17354: 9f e3 ldi r25, 0x3F ; 63 17356: 0e 94 3c 6d call 0xda78 ; 0xda78 1735a: ac 01 movw r20, r24 1735c: 63 e0 ldi r22, 0x03 ; 3 1735e: 80 e0 ldi r24, 0x00 ; 0 17360: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(18, 3); 17364: 63 e0 ldi r22, 0x03 ; 3 17366: 82 e1 ldi r24, 0x12 ; 18 17368: 0e 94 06 6a call 0xd40c ; 0xd40c (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1736c: c2 30 cpi r28, 0x02 ; 2 1736e: 19 f1 breq .+70 ; 0x173b6 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); 17370: 8d 2f mov r24, r29 17372: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 17376: 23 c0 rjmp .+70 ; 0x173be 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)); 17378: cb 30 cpi r28, 0x0B ; 11 1737a: 09 f0 breq .+2 ; 0x1737e 1737c: 9f cf rjmp .-194 ; 0x172bc 1737e: c9 cf rjmp .-110 ; 0x17312 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); 17380: 87 e7 ldi r24, 0x77 ; 119 17382: 98 e6 ldi r25, 0x68 ; 104 17384: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 17388: e4 cf rjmp .-56 ; 0x17352 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) 1738a: 86 ef ldi r24, 0xF6 ; 246 1738c: 8c 0f add r24, r28 1738e: 82 30 cpi r24, 0x02 ; 2 17390: 80 f5 brcc .+96 ; 0x173f2 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 17392: 89 e8 ldi r24, 0x89 ; 137 17394: 9f e3 ldi r25, 0x3F ; 63 17396: 0e 94 3c 6d call 0xda78 ; 0xda78 1739a: ac 01 movw r20, r24 1739c: 62 e0 ldi r22, 0x02 ; 2 1739e: 80 e0 ldi r24, 0x00 ; 0 173a0: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc(':'); 173a4: 8a e3 ldi r24, 0x3A ; 58 173a6: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_set_cursor(18, 2); 173aa: 62 e0 ldi r22, 0x02 ; 2 173ac: 82 e1 ldi r24, 0x12 ; 18 173ae: 0e 94 06 6a call 0xd40c ; 0xd40c (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 173b2: ca 30 cpi r28, 0x0A ; 10 173b4: e9 f2 breq .-70 ; 0x17370 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); 173b6: 87 e7 ldi r24, 0x77 ; 119 173b8: 98 e6 ldi r25, 0x68 ; 104 173ba: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 _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); 173be: c1 14 cp r12, r1 173c0: d1 04 cpc r13, r1 173c2: 19 f0 breq .+6 ; 0x173ca 173c4: c6 01 movw r24, r12 173c6: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 _progress++; 173ca: 81 e0 ldi r24, 0x01 ; 1 173cc: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 173ce: 4e 2d mov r20, r14 173d0: 50 e0 ldi r21, 0x00 ; 0 173d2: 44 0f add r20, r20 173d4: 55 1f adc r21, r21 173d6: 84 17 cp r24, r20 173d8: 15 06 cpc r1, r21 173da: 0c f0 brlt .+2 ; 0x173de 173dc: 80 e0 ldi r24, 0x00 ; 0 } 173de: df 91 pop r29 173e0: cf 91 pop r28 173e2: 1f 91 pop r17 173e4: 0f 91 pop r16 173e6: ff 90 pop r15 173e8: ef 90 pop r14 173ea: df 90 pop r13 173ec: cf 90 pop r12 173ee: bf 90 pop r11 173f0: 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) 173f2: ca 30 cpi r28, 0x0A ; 10 173f4: 20 f7 brcc .-56 ; 0x173be { //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); 173f6: 41 e0 ldi r20, 0x01 ; 1 173f8: c4 30 cpi r28, 0x04 ; 4 173fa: 21 f0 breq .+8 ; 0x17404 173fc: 42 e0 ldi r20, 0x02 ; 2 173fe: c3 30 cpi r28, 0x03 ; 3 17400: 09 f4 brne .+2 ; 0x17404 17402: 40 e0 ldi r20, 0x00 ; 0 17404: 0d 2f mov r16, r29 17406: 2e ef ldi r18, 0xFE ; 254 17408: 33 e8 ldi r19, 0x83 ; 131 1740a: 62 e0 ldi r22, 0x02 ; 2 1740c: 82 e0 ldi r24, 0x02 ; 2 1740e: 0e 94 55 b2 call 0x164aa ; 0x164aa _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 17412: 41 e0 ldi r20, 0x01 ; 1 17414: c5 30 cpi r28, 0x05 ; 5 17416: 21 f0 breq .+8 ; 0x17420 17418: 42 e0 ldi r20, 0x02 ; 2 1741a: c5 30 cpi r28, 0x05 ; 5 1741c: 08 f4 brcc .+2 ; 0x17420 1741e: 40 e0 ldi r20, 0x00 ; 0 17420: 0d 2f mov r16, r29 17422: 2c ef ldi r18, 0xFC ; 252 17424: 33 e8 ldi r19, 0x83 ; 131 17426: 68 e0 ldi r22, 0x08 ; 8 17428: 82 e0 ldi r24, 0x02 ; 2 1742a: 0e 94 55 b2 call 0x164aa ; 0x164aa _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1742e: 41 e0 ldi r20, 0x01 ; 1 17430: c6 30 cpi r28, 0x06 ; 6 17432: 21 f0 breq .+8 ; 0x1743c 17434: 42 e0 ldi r20, 0x02 ; 2 17436: c6 30 cpi r28, 0x06 ; 6 17438: 08 f4 brcc .+2 ; 0x1743c 1743a: 40 e0 ldi r20, 0x00 ; 0 1743c: 0d 2f mov r16, r29 1743e: 2a ef ldi r18, 0xFA ; 250 17440: 33 e8 ldi r19, 0x83 ; 131 17442: 6e e0 ldi r22, 0x0E ; 14 17444: 82 e0 ldi r24, 0x02 ; 2 17446: 0e 94 55 b2 call 0x164aa ; 0x164aa _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1744a: 41 e0 ldi r20, 0x01 ; 1 1744c: c7 30 cpi r28, 0x07 ; 7 1744e: 21 f0 breq .+8 ; 0x17458 17450: 42 e0 ldi r20, 0x02 ; 2 17452: c7 30 cpi r28, 0x07 ; 7 17454: 08 f4 brcc .+2 ; 0x17458 17456: 40 e0 ldi r20, 0x00 ; 0 17458: 0d 2f mov r16, r29 1745a: 26 ef ldi r18, 0xF6 ; 246 1745c: 33 e8 ldi r19, 0x83 ; 131 1745e: 60 e0 ldi r22, 0x00 ; 0 17460: 83 e0 ldi r24, 0x03 ; 3 17462: 0e 94 55 b2 call 0x164aa ; 0x164aa _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 17466: 41 e0 ldi r20, 0x01 ; 1 17468: c8 30 cpi r28, 0x08 ; 8 1746a: 21 f0 breq .+8 ; 0x17474 1746c: 42 e0 ldi r20, 0x02 ; 2 1746e: c8 30 cpi r28, 0x08 ; 8 17470: 08 f4 brcc .+2 ; 0x17474 17472: 40 e0 ldi r20, 0x00 ; 0 17474: 0d 2f mov r16, r29 17476: 2f ee ldi r18, 0xEF ; 239 17478: 33 e8 ldi r19, 0x83 ; 131 1747a: 69 e0 ldi r22, 0x09 ; 9 1747c: 83 e0 ldi r24, 0x03 ; 3 1747e: 0e 94 55 b2 call 0x164aa ; 0x164aa 17482: 9d cf rjmp .-198 ; 0x173be 00017484 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 17484: cf 93 push r28 17486: 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) 17488: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1748c: 81 11 cpse r24, r1 1748e: 18 c0 rjmp .+48 ; 0x174c0 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 17490: 60 91 98 03 lds r22, 0x0398 ; 0x800398 17494: 8b e0 ldi r24, 0x0B ; 11 17496: 68 9f mul r22, r24 17498: b0 01 movw r22, r0 1749a: 11 24 eor r1, r1 1749c: 67 5b subi r22, 0xB7 ; 183 1749e: 72 4f sbci r23, 0xF2 ; 242 174a0: 47 e0 ldi r20, 0x07 ; 7 174a2: 50 e0 ldi r21, 0x00 ; 0 174a4: 86 e6 ldi r24, 0x66 ; 102 174a6: 93 e0 ldi r25, 0x03 ; 3 174a8: 0f 94 6d a0 call 0x340da ; 0x340da lcd_encoder = menuData->name[0]; 174ac: 80 91 66 03 lds r24, 0x0366 ; 0x800366 174b0: 90 e0 ldi r25, 0x00 ; 0 174b2: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174b6: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->initialized = true; 174ba: 81 e0 ldi r24, 0x01 ; 1 174bc: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 174c0: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174c4: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174c8: 80 97 sbiw r24, 0x20 ; 32 174ca: 34 f4 brge .+12 ; 0x174d8 174cc: 80 e2 ldi r24, 0x20 ; 32 174ce: 90 e0 ldi r25, 0x00 ; 0 174d0: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174d4: 80 93 06 05 sts 0x0506, r24 ; 0x800506 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 174d8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174dc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174e0: 8f 3f cpi r24, 0xFF ; 255 174e2: 91 05 cpc r25, r1 174e4: 39 f0 breq .+14 ; 0x174f4 174e6: 34 f0 brlt .+12 ; 0x174f4 174e8: 8f ef ldi r24, 0xFF ; 255 174ea: 90 e0 ldi r25, 0x00 ; 0 174ec: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174f0: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->name[menuData->selected] = lcd_encoder; 174f4: e0 91 65 03 lds r30, 0x0365 ; 0x800365 174f8: f0 e0 ldi r31, 0x00 ; 0 174fa: ec 59 subi r30, 0x9C ; 156 174fc: fc 4f sbci r31, 0xFC ; 252 174fe: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17502: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 17504: 0e 94 32 6a call 0xd464 ; 0xd464 17508: c6 e6 ldi r28, 0x66 ; 102 1750a: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1750c: 89 91 ld r24, Y+ 1750e: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 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) 17512: 83 e0 ldi r24, 0x03 ; 3 17514: cd 36 cpi r28, 0x6D ; 109 17516: d8 07 cpc r29, r24 17518: c9 f7 brne .-14 ; 0x1750c { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1751a: 4e e5 ldi r20, 0x5E ; 94 1751c: 61 e0 ldi r22, 0x01 ; 1 1751e: 80 91 65 03 lds r24, 0x0365 ; 0x800365 17522: 0e 94 26 6a call 0xd44c ; 0xd44c if (menuData->selected > 0) 17526: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1752a: 88 23 and r24, r24 1752c: 29 f0 breq .+10 ; 0x17538 { lcd_putc_at(menuData->selected-1, 1, ' '); 1752e: 40 e2 ldi r20, 0x20 ; 32 17530: 61 e0 ldi r22, 0x01 ; 1 17532: 81 50 subi r24, 0x01 ; 1 17534: 0e 94 26 6a call 0xd44c ; 0xd44c } if (lcd_clicked()) 17538: 0e 94 23 6c call 0xd846 ; 0xd846 1753c: 88 23 and r24, r24 1753e: 99 f0 breq .+38 ; 0x17566 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 17540: e0 91 65 03 lds r30, 0x0365 ; 0x800365 17544: 8e 2f mov r24, r30 17546: 90 e0 ldi r25, 0x00 ; 0 17548: 01 96 adiw r24, 0x01 ; 1 1754a: 07 97 sbiw r24, 0x07 ; 7 1754c: 78 f4 brcc .+30 ; 0x1756c { lcd_encoder = menuData->name[++(menuData->selected)]; 1754e: ef 5f subi r30, 0xFF ; 255 17550: e0 93 65 03 sts 0x0365, r30 ; 0x800365 17554: f0 e0 ldi r31, 0x00 ; 0 17556: ec 59 subi r30, 0x9C ; 156 17558: fc 4f sbci r31, 0xFC ; 252 1755a: 82 81 ldd r24, Z+2 ; 0x02 1755c: 90 e0 ldi r25, 0x00 ; 0 1755e: 90 93 07 05 sts 0x0507, r25 ; 0x800507 17562: 80 93 06 05 sts 0x0506, r24 ; 0x800506 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17566: df 91 pop r29 17568: cf 91 pop r28 1756a: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1756c: 60 91 98 03 lds r22, 0x0398 ; 0x800398 17570: 8b e0 ldi r24, 0x0B ; 11 17572: 68 9f mul r22, r24 17574: b0 01 movw r22, r0 17576: 11 24 eor r1, r1 17578: 67 5b subi r22, 0xB7 ; 183 1757a: 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); 1757c: 47 e0 ldi r20, 0x07 ; 7 1757e: 50 e0 ldi r21, 0x00 ; 0 17580: 86 e6 ldi r24, 0x66 ; 102 17582: 93 e0 ldi r25, 0x03 ; 3 17584: 0f 94 91 a0 call 0x34122 ; 0x34122 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17588: df 91 pop r29 1758a: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1758c: 0d 94 25 96 jmp 0x32c4a ; 0x32c4a 00017590 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 17590: 0f 94 e3 48 call 0x291c6 ; 0x291c6 #endif menu_top = 0; 17594: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 17598: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1759c: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175a0: 0d 94 7f 93 jmp 0x326fe ; 0x326fe 000175a4 : } } void CardReader::updir() { if(workDirDepth > 0) 175a4: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 175a8: 88 23 and r24, r24 175aa: f9 f0 breq .+62 ; 0x175ea { --workDirDepth; 175ac: 81 50 subi r24, 0x01 ; 1 175ae: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDir = workDirParents[0]; 175b2: 93 e2 ldi r25, 0x23 ; 35 175b4: e8 e3 ldi r30, 0x38 ; 56 175b6: f4 e1 ldi r31, 0x14 ; 20 175b8: a5 e1 ldi r26, 0x15 ; 21 175ba: b4 e1 ldi r27, 0x14 ; 20 175bc: 01 90 ld r0, Z+ 175be: 0d 92 st X+, r0 175c0: 9a 95 dec r25 175c2: e1 f7 brne .-8 ; 0x175bc 175c4: 28 e3 ldi r18, 0x38 ; 56 175c6: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 175c8: 90 e0 ldi r25, 0x00 ; 0 175ca: 98 17 cp r25, r24 175cc: 60 f4 brcc .+24 ; 0x175e6 { workDirParents[d] = workDirParents[d+1]; 175ce: 43 e2 ldi r20, 0x23 ; 35 175d0: f9 01 movw r30, r18 175d2: b3 96 adiw r30, 0x23 ; 35 175d4: d9 01 movw r26, r18 175d6: 01 90 ld r0, Z+ 175d8: 0d 92 st X+, r0 175da: 4a 95 dec r20 175dc: e1 f7 brne .-8 ; 0x175d6 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 175de: 9f 5f subi r25, 0xFF ; 255 175e0: 2d 5d subi r18, 0xDD ; 221 175e2: 3f 4f sbci r19, 0xFF ; 255 175e4: f2 cf rjmp .-28 ; 0x175ca { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 175e6: 0f 94 e3 48 call 0x291c6 ; 0x291c6 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 175ea: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 175ee: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175f2: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175f6: 0d 94 7f 93 jmp 0x326fe ; 0x326fe 000175fa : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 175fa: bf 92 push r11 175fc: cf 92 push r12 175fe: df 92 push r13 17600: ef 92 push r14 17602: ff 92 push r15 17604: 0f 93 push r16 17606: 1f 93 push r17 17608: cf 93 push r28 1760a: df 93 push r29 1760c: 00 d0 rcall .+0 ; 0x1760e 1760e: 1f 92 push r1 17610: cd b7 in r28, 0x3d ; 61 17612: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 17614: 8c ea ldi r24, 0xAC ; 172 17616: 9d e0 ldi r25, 0x0D ; 13 17618: 0f 94 7d a0 call 0x340fa ; 0x340fa 1761c: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1761e: 8b ea ldi r24, 0xAB ; 171 17620: 9d e0 ldi r25, 0x0D ; 13 17622: 0f 94 7d a0 call 0x340fa ; 0x340fa 17626: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 17628: 8a ea ldi r24, 0xAA ; 170 1762a: 9d e0 ldi r25, 0x0D ; 13 1762c: 0f 94 7d a0 call 0x340fa ; 0x340fa 17630: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 17632: 0f 94 5d 93 call 0x326ba ; 0x326ba 17636: 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'; 1763a: 80 e3 ldi r24, 0x30 ; 48 1763c: d8 2e mov r13, r24 1763e: df 0c add r13, r15 sToggle[1] = 'x'; 17640: 98 e7 ldi r25, 0x78 ; 120 17642: 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'; 17644: 20 e3 ldi r18, 0x30 ; 48 17646: e2 2e mov r14, r18 17648: 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(); 1764a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1764e: 84 30 cpi r24, 0x04 ; 4 17650: 08 f0 brcs .+2 ; 0x17654 17652: 56 c0 rjmp .+172 ; 0x17700 17654: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 17658: 0f 94 dd 91 call 0x323ba ; 0x323ba 1765c: 88 23 and r24, r24 1765e: 31 f0 breq .+12 ; 0x1766c 17660: 87 e0 ldi r24, 0x07 ; 7 17662: f8 12 cpse r15, r24 17664: 03 c0 rjmp .+6 ; 0x1766c 17666: 81 e0 ldi r24, 0x01 ; 1 17668: 0f 94 4d 2f call 0x25e9a ; 0x25e9a // 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)); 1766c: 88 ef ldi r24, 0xF8 ; 248 1766e: 9d e3 ldi r25, 0x3D ; 61 17670: 0e 94 3c 6d call 0xda78 ; 0xda78 17674: 0f 94 28 96 call 0x32c50 ; 0x32c50 sToggle[0] = points_nr + '0'; 17678: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1767a: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1767c: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1767e: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 17680: 81 ef ldi r24, 0xF1 ; 241 17682: 9d e3 ldi r25, 0x3D ; 61 17684: 0e 94 3c 6d call 0xda78 ; 0xda78 17688: 20 e0 ldi r18, 0x00 ; 0 1768a: 4a e2 ldi r20, 0x2A ; 42 1768c: 53 eb ldi r21, 0xB3 ; 179 1768e: be 01 movw r22, r28 17690: 6f 5f subi r22, 0xFF ; 255 17692: 7f 4f sbci r23, 0xFF ; 255 17694: 0f 94 ec 94 call 0x329d8 ; 0x329d8 sToggle[0] = mbl_z_probe_nr + '0'; 17698: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1769a: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1769c: 83 ee ldi r24, 0xE3 ; 227 1769e: 9d e3 ldi r25, 0x3D ; 61 176a0: 0e 94 3c 6d call 0xda78 ; 0xda78 176a4: 20 e0 ldi r18, 0x00 ; 0 176a6: 4b e1 ldi r20, 0x1B ; 27 176a8: 53 eb ldi r21, 0xB3 ; 179 176aa: be 01 movw r22, r28 176ac: 6f 5f subi r22, 0xFF ; 255 176ae: 7f 4f sbci r23, 0xFF ; 255 176b0: 0f 94 ec 94 call 0x329d8 ; 0x329d8 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); 176b4: 87 e0 ldi r24, 0x07 ; 7 176b6: f8 12 cpse r15, r24 176b8: 20 c0 rjmp .+64 ; 0x176fa 176ba: 81 e7 ldi r24, 0x71 ; 113 176bc: 9b e5 ldi r25, 0x5B ; 91 176be: c1 10 cpse r12, r1 176c0: 02 c0 rjmp .+4 ; 0x176c6 176c2: 8b e6 ldi r24, 0x6B ; 107 176c4: 9b e5 ldi r25, 0x5B ; 91 176c6: 0e 94 3c 6d call 0xda78 ; 0xda78 176ca: 8c 01 movw r16, r24 176cc: 8d ec ldi r24, 0xCD ; 205 176ce: 9d e3 ldi r25, 0x3D ; 61 176d0: 0e 94 3c 6d call 0xda78 ; 0xda78 176d4: 22 e0 ldi r18, 0x02 ; 2 176d6: 46 e3 ldi r20, 0x36 ; 54 176d8: 53 eb ldi r21, 0xB3 ; 179 176da: b8 01 movw r22, r16 176dc: 0f 94 ec 94 call 0x329d8 ; 0x329d8 MENU_END(); 176e0: 0f 94 31 93 call 0x32662 ; 0x32662 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(); 176e4: 90 91 2e 04 lds r25, 0x042E ; 0x80042e 176e8: 9f 5f subi r25, 0xFF ; 255 176ea: 90 93 2e 04 sts 0x042E, r25 ; 0x80042e 176ee: 90 91 30 04 lds r25, 0x0430 ; 0x800430 176f2: 9f 5f subi r25, 0xFF ; 255 176f4: 90 93 30 04 sts 0x0430, r25 ; 0x800430 176f8: a8 cf rjmp .-176 ; 0x1764a 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); 176fa: 8d ed ldi r24, 0xDD ; 221 176fc: 9d e3 ldi r25, 0x3D ; 61 176fe: e3 cf rjmp .-58 ; 0x176c6 MENU_END(); } 17700: 0f 90 pop r0 17702: 0f 90 pop r0 17704: 0f 90 pop r0 17706: 0f 90 pop r0 17708: df 91 pop r29 1770a: cf 91 pop r28 1770c: 1f 91 pop r17 1770e: 0f 91 pop r16 17710: ff 90 pop r15 17712: ef 90 pop r14 17714: df 90 pop r13 17716: cf 90 pop r12 17718: bf 90 pop r11 1771a: 08 95 ret 0001771c : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1771c: cf 93 push r28 MENU_BEGIN(); 1771e: 0f 94 5d 93 call 0x326ba ; 0x326ba 17722: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17726: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1772a: 84 30 cpi r24, 0x04 ; 4 1772c: 60 f5 brcc .+88 ; 0x17786 1772e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17732: 8a e5 ldi r24, 0x5A ; 90 17734: 9e e3 ldi r25, 0x3E ; 62 17736: 0e 94 3c 6d call 0xda78 ; 0xda78 1773a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1773e: 87 ee ldi r24, 0xE7 ; 231 17740: 9b e3 ldi r25, 0x3B ; 59 17742: 0e 94 3c 6d call 0xda78 ; 0xda78 17746: 62 e8 ldi r22, 0x82 ; 130 17748: 7c eb ldi r23, 0xBC ; 188 1774a: 0f 94 da 92 call 0x325b4 ; 0x325b4 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1774e: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 17750: 8c ea ldi r24, 0xAC ; 172 17752: 9c e3 ldi r25, 0x3C ; 60 17754: 0e 94 3c 6d call 0xda78 ; 0xda78 17758: 61 e3 ldi r22, 0x31 ; 49 1775a: 6c 0f add r22, r28 1775c: 2c 2f mov r18, r28 1775e: 41 e9 ldi r20, 0x91 ; 145 17760: 5c eb ldi r21, 0xBC ; 188 17762: 0f 94 83 92 call 0x32506 ; 0x32506 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++) 17766: cf 5f subi r28, 0xFF ; 255 17768: c5 30 cpi r28, 0x05 ; 5 1776a: 91 f7 brne .-28 ; 0x17750 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1776c: 0f 94 31 93 call 0x32662 ; 0x32662 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 17770: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17774: 8f 5f subi r24, 0xFF ; 255 17776: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1777a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1777e: 8f 5f subi r24, 0xFF ; 255 17780: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17784: d0 cf rjmp .-96 ; 0x17726 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(); } 17786: cf 91 pop r28 17788: 08 95 ret 0001778a : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1778a: 84 e0 ldi r24, 0x04 ; 4 1778c: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 00017790 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 17790: 85 e0 ldi r24, 0x05 ; 5 17792: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 00017796 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 17796: 86 e0 ldi r24, 0x06 ; 6 17798: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 0001779c : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1779c: 87 e0 ldi r24, 0x07 ; 7 1779e: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 000177a2 : 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); 177a2: 88 e0 ldi r24, 0x08 ; 8 177a4: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 000177a8 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 177a8: 60 91 98 03 lds r22, 0x0398 ; 0x800398 177ac: 81 ea ldi r24, 0xA1 ; 161 177ae: 9d e0 ldi r25, 0x0D ; 13 177b0: 0f 94 a1 a0 call 0x34142 ; 0x34142 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 177b4: 83 e0 ldi r24, 0x03 ; 3 177b6: 0d 94 09 96 jmp 0x32c12 ; 0x32c12 000177ba : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 177ba: cf 93 push r28 MENU_BEGIN(); 177bc: 0f 94 5d 93 call 0x326ba ; 0x326ba 177c0: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 177c4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 177c8: 84 30 cpi r24, 0x04 ; 4 177ca: 88 f5 brcc .+98 ; 0x1782e 177cc: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 177d0: 0f 94 dd 91 call 0x323ba ; 0x323ba 177d4: 81 11 cpse r24, r1 177d6: 0f 94 01 0c call 0x21802 ; 0x21802 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 177da: 8a e5 ldi r24, 0x5A ; 90 177dc: 9e e3 ldi r25, 0x3E ; 62 177de: 0e 94 3c 6d call 0xda78 ; 0xda78 177e2: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 177e6: 87 ee ldi r24, 0xE7 ; 231 177e8: 9b e3 ldi r25, 0x3B ; 59 177ea: 0e 94 3c 6d call 0xda78 ; 0xda78 177ee: 63 eb ldi r22, 0xB3 ; 179 177f0: 76 ef ldi r23, 0xF6 ; 246 177f2: 0f 94 da 92 call 0x325b4 ; 0x325b4 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 177f6: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 177f8: 8c ea ldi r24, 0xAC ; 172 177fa: 9c e3 ldi r25, 0x3C ; 60 177fc: 0e 94 3c 6d call 0xda78 ; 0xda78 17800: 61 e3 ldi r22, 0x31 ; 49 17802: 6c 0f add r22, r28 17804: 2c 2f mov r18, r28 17806: 4e e9 ldi r20, 0x9E ; 158 17808: 56 ef ldi r21, 0xF6 ; 246 1780a: 0f 94 83 92 call 0x32506 ; 0x32506 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++) 1780e: cf 5f subi r28, 0xFF ; 255 17810: c5 30 cpi r28, 0x05 ; 5 17812: 91 f7 brne .-28 ; 0x177f8 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 17814: 0f 94 31 93 call 0x32662 ; 0x32662 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 17818: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1781c: 8f 5f subi r24, 0xFF ; 255 1781e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17822: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17826: 8f 5f subi r24, 0xFF ; 255 17828: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1782c: cb cf rjmp .-106 ; 0x177c4 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(); } 1782e: cf 91 pop r28 17830: 08 95 ret 00017832 : } // 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)) { 17832: ef 92 push r14 17834: ff 92 push r15 17836: 0f 93 push r16 17838: 1f 93 push r17 1783a: cf 93 push r28 1783c: 8c 01 movw r16, r24 1783e: 7b 01 movw r14, r22 MENU_BEGIN(); 17840: 0f 94 5d 93 call 0x326ba ; 0x326ba 17844: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17848: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1784c: 84 30 cpi r24, 0x04 ; 4 1784e: 28 f5 brcc .+74 ; 0x1789a 17850: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 17854: 0f 94 dd 91 call 0x323ba ; 0x323ba 17858: 81 11 cpse r24, r1 1785a: 0f 94 01 0c call 0x21802 ; 0x21802 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1785e: 8a e5 ldi r24, 0x5A ; 90 17860: 9e e3 ldi r25, 0x3E ; 62 17862: 0e 94 3c 6d call 0xda78 ; 0xda78 17866: 0f 94 28 96 call 0x32c50 ; 0x32c50 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1786a: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1786c: 61 e3 ldi r22, 0x31 ; 49 1786e: 6c 0f add r22, r28 17870: 2c 2f mov r18, r28 17872: a7 01 movw r20, r14 17874: c8 01 movw r24, r16 17876: 0f 94 83 92 call 0x32506 ; 0x32506 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1787a: cf 5f subi r28, 0xFF ; 255 1787c: c5 30 cpi r28, 0x05 ; 5 1787e: b1 f7 brne .-20 ; 0x1786c MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 17880: 0f 94 31 93 call 0x32662 ; 0x32662 // 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(); 17884: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17888: 8f 5f subi r24, 0xFF ; 255 1788a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1788e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17892: 8f 5f subi r24, 0xFF ; 255 17894: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17898: d7 cf rjmp .-82 ; 0x17848 ); 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(); } 1789a: cf 91 pop r28 1789c: 1f 91 pop r17 1789e: 0f 91 pop r16 178a0: ff 90 pop r15 178a2: ef 90 pop r14 178a4: 08 95 ret 000178a6 : 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); 178a6: 84 ea ldi r24, 0xA4 ; 164 178a8: 9a e5 ldi r25, 0x5A ; 90 178aa: 0e 94 3c 6d call 0xda78 ; 0xda78 178ae: 6b e6 ldi r22, 0x6B ; 107 178b0: 7c eb ldi r23, 0xBC ; 188 178b2: 0c 94 19 bc jmp 0x17832 ; 0x17832 000178b6 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 178b6: 83 eb ldi r24, 0xB3 ; 179 178b8: 9a e5 ldi r25, 0x5A ; 90 178ba: 0e 94 3c 6d call 0xda78 ; 0xda78 178be: 67 e7 ldi r22, 0x77 ; 119 178c0: 7c eb ldi r23, 0xBC ; 188 178c2: 0c 94 19 bc jmp 0x17832 ; 0x17832 000178c6 : 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); 178c6: 8c ea ldi r24, 0xAC ; 172 178c8: 9c e3 ldi r25, 0x3C ; 60 178ca: 0e 94 3c 6d call 0xda78 ; 0xda78 178ce: 6d e3 ldi r22, 0x3D ; 61 178d0: 77 ef ldi r23, 0xF7 ; 247 178d2: 0c 94 19 bc jmp 0x17832 ; 0x17832 000178d6 : 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){ 178d6: cf 93 push r28 178d8: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 178da: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 178de: 88 23 and r24, r24 178e0: 21 f0 breq .+8 ; 0x178ea 178e2: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 178e4: cf 91 pop r28 178e6: 0d 94 0c 6c jmp 0x2d818 ; 0x2d818 178ea: cf 91 pop r28 178ec: 08 95 ret 000178ee : 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) { 178ee: cf 93 push r28 178f0: c8 2f mov r28, r24 menu_back(); 178f2: 0f 94 25 96 call 0x32c4a ; 0x32c4a MMU2::mmu2.eject_filament(filament, true); 178f6: 61 e0 ldi r22, 0x01 ; 1 178f8: 8c 2f mov r24, r28 178fa: 0f 94 8f 6b call 0x2d71e ; 0x2d71e // Clear the filament action clearFilamentAction(); } 178fe: 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(); 17900: 0d 94 01 0c jmp 0x21802 ; 0x21802 00017904 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 17904: 80 e0 ldi r24, 0x00 ; 0 17906: 0f 94 4c 6b call 0x2d698 ; 0x2d698 1790a: 81 e0 ldi r24, 0x01 ; 1 1790c: 0f 94 4c 6b call 0x2d698 ; 0x2d698 17910: 82 e0 ldi r24, 0x02 ; 2 17912: 0f 94 4c 6b call 0x2d698 ; 0x2d698 17916: 83 e0 ldi r24, 0x03 ; 3 17918: 0f 94 4c 6b call 0x2d698 ; 0x2d698 1791c: 84 e0 ldi r24, 0x04 ; 4 1791e: 0d 94 4c 6b jmp 0x2d698 ; 0x2d698 00017922 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 17922: 0d 94 4c 6b jmp 0x2d698 ; 0x2d698 00017926 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17926: 80 e0 ldi r24, 0x00 ; 0 17928: 0d 94 fe 62 jmp 0x2c5fc ; 0x2c5fc 0001792c : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1792c: 0f 94 5d 93 call 0x326ba ; 0x326ba 17930: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17934: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17938: 84 30 cpi r24, 0x04 ; 4 1793a: 08 f0 brcs .+2 ; 0x1793e 1793c: 45 c0 rjmp .+138 ; 0x179c8 1793e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 17942: 8f ee ldi r24, 0xEF ; 239 17944: 9a e3 ldi r25, 0x3A ; 58 17946: 0e 94 3c 6d call 0xda78 ; 0xda78 1794a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 1794e: 63 e2 ldi r22, 0x23 ; 35 17950: 75 eb ldi r23, 0xB5 ; 181 17952: 89 e4 ldi r24, 0x49 ; 73 17954: 9d e0 ldi r25, 0x0D ; 13 17956: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1795a: 6e e1 ldi r22, 0x1E ; 30 1795c: 75 eb ldi r23, 0xB5 ; 181 1795e: 84 e5 ldi r24, 0x54 ; 84 17960: 9d e0 ldi r25, 0x0D ; 13 17962: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 17966: 69 e1 ldi r22, 0x19 ; 25 17968: 75 eb ldi r23, 0xB5 ; 181 1796a: 8f e5 ldi r24, 0x5F ; 95 1796c: 9d e0 ldi r25, 0x0D ; 13 1796e: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 17972: 64 e1 ldi r22, 0x14 ; 20 17974: 75 eb ldi r23, 0xB5 ; 181 17976: 8a e6 ldi r24, 0x6A ; 106 17978: 9d e0 ldi r25, 0x0D ; 13 1797a: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 1797e: 6f e0 ldi r22, 0x0F ; 15 17980: 75 eb ldi r23, 0xB5 ; 181 17982: 85 e7 ldi r24, 0x75 ; 117 17984: 9d e0 ldi r25, 0x0D ; 13 17986: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1798a: 6a e0 ldi r22, 0x0A ; 10 1798c: 75 eb ldi r23, 0xB5 ; 181 1798e: 80 e8 ldi r24, 0x80 ; 128 17990: 9d e0 ldi r25, 0x0D ; 13 17992: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 17996: 65 e0 ldi r22, 0x05 ; 5 17998: 75 eb ldi r23, 0xB5 ; 181 1799a: 8b e8 ldi r24, 0x8B ; 139 1799c: 9d e0 ldi r25, 0x0D ; 13 1799e: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 179a2: 60 e0 ldi r22, 0x00 ; 0 179a4: 75 eb ldi r23, 0xB5 ; 181 179a6: 86 e9 ldi r24, 0x96 ; 150 179a8: 9d e0 ldi r25, 0x0D ; 13 179aa: 0f 94 8b 95 call 0x32b16 ; 0x32b16 MENU_END(); 179ae: 0f 94 31 93 call 0x32662 ; 0x32662 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 179b2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 179b6: 8f 5f subi r24, 0xFF ; 255 179b8: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 179bc: 80 91 30 04 lds r24, 0x0430 ; 0x800430 179c0: 8f 5f subi r24, 0xFF ; 255 179c2: 80 93 30 04 sts 0x0430, r24 ; 0x800430 179c6: b6 cf rjmp .-148 ; 0x17934 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(); } 179c8: 08 95 ret 000179ca : //! //! @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) 179ca: 4f 92 push r4 179cc: 5f 92 push r5 179ce: 6f 92 push r6 179d0: 7f 92 push r7 179d2: 8f 92 push r8 179d4: 9f 92 push r9 179d6: af 92 push r10 179d8: bf 92 push r11 179da: cf 92 push r12 179dc: df 92 push r13 179de: ef 92 push r14 179e0: ff 92 push r15 179e2: 0f 93 push r16 179e4: 1f 93 push r17 179e6: cf 93 push r28 179e8: df 93 push r29 179ea: 6c 01 movw r12, r24 179ec: 7b 01 movw r14, r22 179ee: 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); 179f2: 67 2b or r22, r23 179f4: 29 f0 breq .+10 ; 0x17a00 179f6: 06 e0 ldi r16, 0x06 ; 6 179f8: 81 30 cpi r24, 0x01 ; 1 179fa: 29 f0 breq .+10 ; 0x17a06 179fc: 05 e0 ldi r16, 0x05 ; 5 179fe: 03 c0 rjmp .+6 ; 0x17a06 17a00: 04 e0 ldi r16, 0x04 ; 4 17a02: 81 30 cpi r24, 0x01 ; 1 17a04: d9 f3 breq .-10 ; 0x179fc const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 17a06: 0e 94 39 6a call 0xd472 ; 0xd472 KEEPALIVE_STATE(PAUSED_FOR_USER); 17a0a: 84 e0 ldi r24, 0x04 ; 4 17a0c: 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; 17a10: 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; 17a12: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 17a14: 03 50 subi r16, 0x03 ; 3 17a16: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 17a18: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 17a1c: 81 e0 ldi r24, 0x01 ; 1 17a1e: 0e 94 8c 7a call 0xf518 ; 0xf518 if (lcd_encoder) 17a22: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17a26: 90 91 07 05 lds r25, 0x0507 ; 0x800507 17a2a: 00 97 sbiw r24, 0x00 ; 0 17a2c: 09 f4 brne .+2 ; 0x17a30 17a2e: 9d c0 rjmp .+314 ; 0x17b6a { if (lcd_encoder < 0) 17a30: 97 ff sbrs r25, 7 17a32: 88 c0 rjmp .+272 ; 0x17b44 { cursor_pos--; 17a34: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 17a36: 10 92 07 05 sts 0x0507, r1 ; 0x800507 17a3a: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } if (cursor_pos > 3) 17a3e: c4 30 cpi r28, 0x04 ; 4 17a40: 0c f4 brge .+2 ; 0x17a44 17a42: 86 c0 rjmp .+268 ; 0x17b50 { cursor_pos = 3; if (first < items_no - 3) 17a44: 88 2d mov r24, r8 17a46: 08 2c mov r0, r8 17a48: 00 0c add r0, r0 17a4a: 99 0b sbc r25, r25 17a4c: 80 17 cp r24, r16 17a4e: 91 07 cpc r25, r17 17a50: 0c f0 brlt .+2 ; 0x17a54 17a52: 7a c0 rjmp .+244 ; 0x17b48 { first++; 17a54: 83 94 inc r8 lcd_clear(); 17a56: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 17a5a: 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); 17a5c: c1 14 cp r12, r1 17a5e: d1 04 cpc r13, r1 17a60: 29 f0 breq .+10 ; 0x17a6c 17a62: a6 01 movw r20, r12 17a64: 60 e0 ldi r22, 0x00 ; 0 17a66: 80 e0 ldi r24, 0x00 ; 0 17a68: 0e 94 1a 6a call 0xd434 ; 0xd434 const bool last_visible = (first == items_no - 3); 17a6c: a8 2c mov r10, r8 17a6e: 08 2c mov r0, r8 17a70: 00 0c add r0, r0 17a72: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 17a74: e1 14 cp r14, r1 17a76: f1 04 cpc r15, r1 17a78: 29 f0 breq .+10 ; 0x17a84 17a7a: 82 e0 ldi r24, 0x02 ; 2 17a7c: 98 2e mov r9, r24 17a7e: a0 16 cp r10, r16 17a80: b1 06 cpc r11, r17 17a82: 11 f0 breq .+4 ; 0x17a88 17a84: 93 e0 ldi r25, 0x03 ; 3 17a86: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 17a88: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 17a8a: df 5f subi r29, 0xFF ; 255 17a8c: 48 ed ldi r20, 0xD8 ; 216 17a8e: 59 e6 ldi r21, 0x69 ; 105 17a90: 6d 2f mov r22, r29 17a92: 81 e0 ldi r24, 0x01 ; 1 17a94: 0e 94 1a 6a call 0xd434 ; 0xd434 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++) 17a98: 9d 12 cpse r9, r29 17a9a: f7 cf rjmp .-18 ; 0x17a8a 17a9c: 48 2c mov r4, r8 17a9e: 08 2c mov r0, r8 17aa0: 00 0c add r0, r0 17aa2: 55 08 sbc r5, r5 17aa4: 66 08 sbc r6, r6 17aa6: 77 08 sbc r7, r7 17aa8: 8f ef ldi r24, 0xFF ; 255 17aaa: 48 1a sub r4, r24 17aac: 58 0a sbc r5, r24 17aae: 68 0a sbc r6, r24 17ab0: 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++) 17ab2: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 17ab4: 93 94 inc r9 17ab6: 69 2d mov r22, r9 17ab8: 8a e0 ldi r24, 0x0A ; 10 17aba: 0e 94 06 6a call 0xd40c ; 0xd40c 17abe: c3 01 movw r24, r6 17ac0: b2 01 movw r22, r4 17ac2: 0e 94 bf 6b call 0xd77e ; 0xd77e 17ac6: 8f ef ldi r24, 0xFF ; 255 17ac8: 48 1a sub r4, r24 17aca: 58 0a sbc r5, r24 17acc: 68 0a sbc r6, r24 17ace: 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++) 17ad0: d9 11 cpse r29, r9 17ad2: f0 cf rjmp .-32 ; 0x17ab4 { 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); 17ad4: e1 14 cp r14, r1 17ad6: f1 04 cpc r15, r1 17ad8: 41 f0 breq .+16 ; 0x17aea 17ada: a0 16 cp r10, r16 17adc: b1 06 cpc r11, r17 17ade: 29 f4 brne .+10 ; 0x17aea 17ae0: a7 01 movw r20, r14 17ae2: 63 e0 ldi r22, 0x03 ; 3 17ae4: 81 e0 ldi r24, 0x01 ; 1 17ae6: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 17aea: 47 eb ldi r20, 0xB7 ; 183 17aec: 57 e8 ldi r21, 0x87 ; 135 17aee: 61 e0 ldi r22, 0x01 ; 1 17af0: 80 e0 ldi r24, 0x00 ; 0 17af2: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_putc_at(0, cursor_pos, '>'); 17af6: 4e e3 ldi r20, 0x3E ; 62 17af8: 6c 2f mov r22, r28 17afa: 80 e0 ldi r24, 0x00 ; 0 17afc: 0e 94 26 6a call 0xd44c ; 0xd44c _delay(100); 17b00: 64 e6 ldi r22, 0x64 ; 100 17b02: 70 e0 ldi r23, 0x00 ; 0 17b04: 80 e0 ldi r24, 0x00 ; 0 17b06: 90 e0 ldi r25, 0x00 ; 0 17b08: 0f 94 4d 0d call 0x21a9a ; 0x21a9a if (lcd_clicked()) 17b0c: 0e 94 23 6c call 0xd846 ; 0xd846 17b10: 88 23 and r24, r24 17b12: 09 f4 brne .+2 ; 0x17b16 17b14: 81 cf rjmp .-254 ; 0x17a18 { KEEPALIVE_STATE(IN_HANDLER); 17b16: 82 e0 ldi r24, 0x02 ; 2 17b18: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 17b1c: 8f ef ldi r24, 0xFF ; 255 17b1e: 8c 0f add r24, r28 17b20: 88 0d add r24, r8 } } } 17b22: df 91 pop r29 17b24: cf 91 pop r28 17b26: 1f 91 pop r17 17b28: 0f 91 pop r16 17b2a: ff 90 pop r15 17b2c: ef 90 pop r14 17b2e: df 90 pop r13 17b30: cf 90 pop r12 17b32: bf 90 pop r11 17b34: af 90 pop r10 17b36: 9f 90 pop r9 17b38: 8f 90 pop r8 17b3a: 7f 90 pop r7 17b3c: 6f 90 pop r6 17b3e: 5f 90 pop r5 17b40: 4f 90 pop r4 17b42: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 17b44: cf 5f subi r28, 0xFF ; 255 17b46: 77 cf rjmp .-274 ; 0x17a36 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); 17b48: 87 e0 ldi r24, 0x07 ; 7 17b4a: 0f 94 71 2c call 0x258e2 ; 0x258e2 17b4e: 85 cf rjmp .-246 ; 0x17a5a } } if (cursor_pos < 1) 17b50: c1 11 cpse r28, r1 17b52: 84 cf rjmp .-248 ; 0x17a5c { cursor_pos = 1; if (first > 0) 17b54: 18 14 cp r1, r8 17b56: 2c f4 brge .+10 ; 0x17b62 { first--; 17b58: 8a 94 dec r8 lcd_clear(); 17b5a: 0e 94 39 6a call 0xd472 ; 0xd472 } } if (cursor_pos < 1) { cursor_pos = 1; 17b5e: c1 e0 ldi r28, 0x01 ; 1 17b60: 7d cf rjmp .-262 ; 0x17a5c if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 17b62: 87 e0 ldi r24, 0x07 ; 7 17b64: 0f 94 71 2c call 0x258e2 ; 0x258e2 17b68: fa cf rjmp .-12 ; 0x17b5e cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 17b6a: c4 30 cpi r28, 0x04 ; 4 17b6c: 0c f0 brlt .+2 ; 0x17b70 17b6e: 6a cf rjmp .-300 ; 0x17a44 17b70: 75 cf rjmp .-278 ; 0x17a5c 00017b72 : } #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) { 17b72: 4f 92 push r4 17b74: 5f 92 push r5 17b76: 6f 92 push r6 17b78: 7f 92 push r7 17b7a: af 92 push r10 17b7c: bf 92 push r11 17b7e: cf 92 push r12 17b80: df 92 push r13 17b82: ef 92 push r14 17b84: ff 92 push r15 17b86: 0f 93 push r16 17b88: 1f 93 push r17 17b8a: cf 93 push r28 17b8c: df 93 push r29 17b8e: 24 e0 ldi r18, 0x04 ; 4 17b90: 30 e0 ldi r19, 0x00 ; 0 17b92: 41 e0 ldi r20, 0x01 ; 1 17b94: 50 e0 ldi r21, 0x00 ; 0 17b96: d9 01 movw r26, r18 17b98: a4 52 subi r26, 0x24 ; 36 17b9a: bd 47 sbci r27, 0x7D ; 125 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 17b9c: fd 01 movw r30, r26 17b9e: 65 91 lpm r22, Z+ 17ba0: 74 91 lpm r23, Z 17ba2: 86 17 cp r24, r22 17ba4: 97 07 cpc r25, r23 17ba6: 0c f0 brlt .+2 ; 0x17baa 17ba8: 66 c0 rjmp .+204 ; 0x17c76 { celsius = PGM_RD_W((*tt)[i-1][1]) + 17baa: 41 50 subi r20, 0x01 ; 1 17bac: 51 09 sbc r21, r1 17bae: 44 0f add r20, r20 17bb0: 55 1f adc r21, r21 17bb2: 44 0f add r20, r20 17bb4: 55 1f adc r21, r21 17bb6: ea 01 movw r28, r20 17bb8: c2 52 subi r28, 0x22 ; 34 17bba: dd 47 sbci r29, 0x7D ; 125 17bbc: fe 01 movw r30, r28 17bbe: 05 91 lpm r16, Z+ 17bc0: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 17bc2: 44 52 subi r20, 0x24 ; 36 17bc4: 5d 47 sbci r21, 0x7D ; 125 17bc6: fa 01 movw r30, r20 17bc8: 65 91 lpm r22, Z+ 17bca: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bcc: f9 01 movw r30, r18 17bce: e2 52 subi r30, 0x22 ; 34 17bd0: fd 47 sbci r31, 0x7D ; 125 17bd2: e5 90 lpm r14, Z+ 17bd4: f4 90 lpm r15, Z 17bd6: fe 01 movw r30, r28 17bd8: c5 90 lpm r12, Z+ 17bda: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 17bdc: fd 01 movw r30, r26 17bde: c5 91 lpm r28, Z+ 17be0: d4 91 lpm r29, Z 17be2: fa 01 movw r30, r20 17be4: a5 90 lpm r10, Z+ 17be6: 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])) * 17be8: 86 1b sub r24, r22 17bea: 97 0b sbc r25, r23 17bec: bc 01 movw r22, r24 17bee: 99 0f add r25, r25 17bf0: 88 0b sbc r24, r24 17bf2: 99 0b sbc r25, r25 17bf4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17bf8: 2b 01 movw r4, r22 17bfa: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bfc: b7 01 movw r22, r14 17bfe: 6c 19 sub r22, r12 17c00: 7d 09 sbc r23, r13 17c02: 07 2e mov r0, r23 17c04: 00 0c add r0, r0 17c06: 88 0b sbc r24, r24 17c08: 99 0b sbc r25, r25 17c0a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17c0e: 9b 01 movw r18, r22 17c10: 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])) * 17c12: c3 01 movw r24, r6 17c14: b2 01 movw r22, r4 17c16: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17c1a: 6b 01 movw r12, r22 17c1c: 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])); 17c1e: be 01 movw r22, r28 17c20: 6a 19 sub r22, r10 17c22: 7b 09 sbc r23, r11 17c24: 07 2e mov r0, r23 17c26: 00 0c add r0, r0 17c28: 88 0b sbc r24, r24 17c2a: 99 0b sbc r25, r25 17c2c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17c30: 9b 01 movw r18, r22 17c32: 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])) / 17c34: c7 01 movw r24, r14 17c36: b6 01 movw r22, r12 17c38: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 17c3c: 6b 01 movw r12, r22 17c3e: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 17c40: b8 01 movw r22, r16 17c42: 11 0f add r17, r17 17c44: 88 0b sbc r24, r24 17c46: 99 0b sbc r25, r25 17c48: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17c4c: 9b 01 movw r18, r22 17c4e: ac 01 movw r20, r24 17c50: c7 01 movw r24, r14 17c52: b6 01 movw r22, r12 17c54: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__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; } 17c58: df 91 pop r29 17c5a: cf 91 pop r28 17c5c: 1f 91 pop r17 17c5e: 0f 91 pop r16 17c60: ff 90 pop r15 17c62: ef 90 pop r14 17c64: df 90 pop r13 17c66: cf 90 pop r12 17c68: bf 90 pop r11 17c6a: af 90 pop r10 17c6c: 7f 90 pop r7 17c6e: 6f 90 pop r6 17c70: 5f 90 pop r5 17c72: 4f 90 pop r4 17c74: 08 95 ret 17c76: 4f 5f subi r20, 0xFF ; 255 17c78: 5f 4f sbci r21, 0xFF ; 255 17c7a: 2c 5f subi r18, 0xFC ; 252 17c7c: 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 17c84: 88 cf rjmp .-240 ; 0x17b96 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 17c86: ea e5 ldi r30, 0x5A ; 90 17c88: f3 e8 ldi r31, 0x83 ; 131 17c8a: 65 91 lpm r22, Z+ 17c8c: 74 91 lpm r23, Z 17c8e: 07 2e mov r0, r23 17c90: 00 0c add r0, r0 17c92: 88 0b sbc r24, r24 17c94: 99 0b sbc r25, r25 17c96: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17c9a: de cf rjmp .-68 ; 0x17c58 00017c9c : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 17c9c: 8f 92 push r8 17c9e: 9f 92 push r9 17ca0: af 92 push r10 17ca2: bf 92 push r11 17ca4: cf 92 push r12 17ca6: df 92 push r13 17ca8: ef 92 push r14 17caa: ff 92 push r15 17cac: 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]) { 17cb0: 88 23 and r24, r24 17cb2: 09 f4 brne .+2 ; 0x17cb6 17cb4: 9d c0 rjmp .+314 ; 0x17df0 17cb6: 91 11 cpse r25, r1 17cb8: 92 c0 rjmp .+292 ; 0x17dde st_synchronize(); 17cba: 0f 94 14 22 call 0x24428 ; 0x24428 set_destination_to_current(); 17cbe: 0e 94 c1 61 call 0xc382 ; 0xc382 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 17cc2: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17cc6: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17cca: 07 2e mov r0, r23 17ccc: 00 0c add r0, r0 17cce: 88 0b sbc r24, r24 17cd0: 99 0b sbc r25, r25 17cd2: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17cd6: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 17cda: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 17cde: 40 91 b7 04 lds r20, 0x04B7 ; 0x8004b7 17ce2: 50 91 b8 04 lds r21, 0x04B8 ; 0x8004b8 17ce6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17cea: 2a e0 ldi r18, 0x0A ; 10 17cec: 37 ed ldi r19, 0xD7 ; 215 17cee: 43 e2 ldi r20, 0x23 ; 35 17cf0: 5c e3 ldi r21, 0x3C ; 60 17cf2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17cf6: 20 91 01 12 lds r18, 0x1201 ; 0x801201 17cfa: 30 91 02 12 lds r19, 0x1202 ; 0x801202 17cfe: 40 91 03 12 lds r20, 0x1203 ; 0x801203 17d02: 50 91 04 12 lds r21, 0x1204 ; 0x801204 17d06: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 17d0a: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17d0e: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17d12: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17d16: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17d1a: 81 e0 ldi r24, 0x01 ; 1 17d1c: 92 e1 ldi r25, 0x12 ; 18 17d1e: 0f 94 69 75 call 0x2ead2 ; 0x2ead2 float oldFeedrate = feedrate; 17d22: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 17d26: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 17d2a: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 17d2e: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 17d32: 20 e0 ldi r18, 0x00 ; 0 17d34: 30 e0 ldi r19, 0x00 ; 0 17d36: 40 e7 ldi r20, 0x70 ; 112 17d38: 52 e4 ldi r21, 0x42 ; 66 17d3a: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 17d3e: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 17d42: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17d46: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17d4a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17d4e: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17d52: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17d56: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17d5a: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 17d5e: 81 e0 ldi r24, 0x01 ; 1 17d60: 80 93 03 05 sts 0x0503, r24 ; 0x800503 prepare_move(); 17d64: 90 e0 ldi r25, 0x00 ; 0 17d66: 80 e0 ldi r24, 0x00 ; 0 17d68: 0e 94 8f 65 call 0xcb1e ; 0xcb1e if(cs.retract_zlift) { 17d6c: 20 e0 ldi r18, 0x00 ; 0 17d6e: 30 e0 ldi r19, 0x00 ; 0 17d70: a9 01 movw r20, r18 17d72: 60 91 bd 04 lds r22, 0x04BD ; 0x8004bd 17d76: 70 91 be 04 lds r23, 0x04BE ; 0x8004be 17d7a: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 17d7e: 90 91 c0 04 lds r25, 0x04C0 ; 0x8004c0 17d82: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 17d86: 88 23 and r24, r24 17d88: 11 f1 breq .+68 ; 0x17dce st_synchronize(); 17d8a: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[Z_AXIS]-=cs.retract_zlift; 17d8e: 20 91 bd 04 lds r18, 0x04BD ; 0x8004bd 17d92: 30 91 be 04 lds r19, 0x04BE ; 0x8004be 17d96: 40 91 bf 04 lds r20, 0x04BF ; 0x8004bf 17d9a: 50 91 c0 04 lds r21, 0x04C0 ; 0x8004c0 17d9e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17da2: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17da6: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17daa: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17dae: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 17db2: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17db6: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17dba: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17dbe: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17dc2: 0f 94 d1 83 call 0x307a2 ; 0x307a2 prepare_move(); 17dc6: 90 e0 ldi r25, 0x00 ; 0 17dc8: 80 e0 ldi r24, 0x00 ; 0 17dca: 0e 94 8f 65 call 0xcb1e ; 0xcb1e } feedrate = oldFeedrate; 17dce: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 17dd2: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 17dd6: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 17dda: 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 17dde: ff 90 pop r15 17de0: ef 90 pop r14 17de2: df 90 pop r13 17de4: cf 90 pop r12 17de6: bf 90 pop r11 17de8: af 90 pop r10 17dea: 9f 90 pop r9 17dec: 8f 90 pop r8 17dee: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 17df0: 99 23 and r25, r25 17df2: a9 f3 breq .-22 ; 0x17dde st_synchronize(); 17df4: 0f 94 14 22 call 0x24428 ; 0x24428 set_destination_to_current(); 17df8: 0e 94 c1 61 call 0xc382 ; 0xc382 float oldFeedrate = feedrate; 17dfc: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 17e00: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 17e04: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 17e08: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 17e0c: 20 e0 ldi r18, 0x00 ; 0 17e0e: 30 e0 ldi r19, 0x00 ; 0 17e10: 40 e7 ldi r20, 0x70 ; 112 17e12: 52 e4 ldi r21, 0x42 ; 66 17e14: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 17e18: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 17e1c: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 17e20: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 17e24: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17e28: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17e2c: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17e30: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17e34: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 17e38: c0 90 bd 04 lds r12, 0x04BD ; 0x8004bd 17e3c: d0 90 be 04 lds r13, 0x04BE ; 0x8004be 17e40: e0 90 bf 04 lds r14, 0x04BF ; 0x8004bf 17e44: f0 90 c0 04 lds r15, 0x04C0 ; 0x8004c0 17e48: 20 e0 ldi r18, 0x00 ; 0 17e4a: 30 e0 ldi r19, 0x00 ; 0 17e4c: a9 01 movw r20, r18 17e4e: c7 01 movw r24, r14 17e50: b6 01 movw r22, r12 17e52: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 17e56: 88 23 and r24, r24 17e58: e1 f0 breq .+56 ; 0x17e92 current_position[Z_AXIS]+=cs.retract_zlift; 17e5a: a7 01 movw r20, r14 17e5c: 96 01 movw r18, r12 17e5e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17e62: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17e66: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17e6a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17e6e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 17e72: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17e76: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17e7a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17e7e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17e82: 0f 94 d1 83 call 0x307a2 ; 0x307a2 prepare_move(); 17e86: 90 e0 ldi r25, 0x00 ; 0 17e88: 80 e0 ldi r24, 0x00 ; 0 17e8a: 0e 94 8f 65 call 0xcb1e ; 0xcb1e st_synchronize(); 17e8e: 0f 94 14 22 call 0x24428 ; 0x24428 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 17e92: 20 91 c1 04 lds r18, 0x04C1 ; 0x8004c1 17e96: 30 91 c2 04 lds r19, 0x04C2 ; 0x8004c2 17e9a: 40 91 c3 04 lds r20, 0x04C3 ; 0x8004c3 17e9e: 50 91 c4 04 lds r21, 0x04C4 ; 0x8004c4 17ea2: 60 91 b5 04 lds r22, 0x04B5 ; 0x8004b5 17ea6: 70 91 b6 04 lds r23, 0x04B6 ; 0x8004b6 17eaa: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 17eae: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 17eb2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 17eb6: 6b 01 movw r12, r22 17eb8: 7c 01 movw r14, r24 17eba: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17ebe: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17ec2: 07 2e mov r0, r23 17ec4: 00 0c add r0, r0 17ec6: 88 0b sbc r24, r24 17ec8: 99 0b sbc r25, r25 17eca: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 17ece: 9b 01 movw r18, r22 17ed0: ac 01 movw r20, r24 17ed2: c7 01 movw r24, r14 17ed4: b6 01 movw r22, r12 17ed6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17eda: 2a e0 ldi r18, 0x0A ; 10 17edc: 37 ed ldi r19, 0xD7 ; 215 17ede: 43 e2 ldi r20, 0x23 ; 35 17ee0: 5c e3 ldi r21, 0x3C ; 60 17ee2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 17ee6: 9b 01 movw r18, r22 17ee8: ac 01 movw r20, r24 17eea: 60 91 01 12 lds r22, 0x1201 ; 0x801201 17eee: 70 91 02 12 lds r23, 0x1202 ; 0x801202 17ef2: 80 91 03 12 lds r24, 0x1203 ; 0x801203 17ef6: 90 91 04 12 lds r25, 0x1204 ; 0x801204 17efa: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 17efe: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17f02: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17f06: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17f0a: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17f0e: 81 e0 ldi r24, 0x01 ; 1 17f10: 92 e1 ldi r25, 0x12 ; 18 17f12: 0f 94 69 75 call 0x2ead2 ; 0x2ead2 retracted[active_extruder]=false; 17f16: 10 92 03 05 sts 0x0503, r1 ; 0x800503 prepare_move(); 17f1a: 90 e0 ldi r25, 0x00 ; 0 17f1c: 80 e0 ldi r24, 0x00 ; 0 17f1e: 0e 94 8f 65 call 0xcb1e ; 0xcb1e feedrate = oldFeedrate; 17f22: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 17f26: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 17f2a: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 17f2e: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 17f32: 55 cf rjmp .-342 ; 0x17dde 00017f34 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 17f34: ef 92 push r14 17f36: ff 92 push r15 17f38: 0f 93 push r16 17f3a: 1f 93 push r17 17f3c: cf 93 push r28 17f3e: df 93 push r29 17f40: 00 d0 rcall .+0 ; 0x17f42 17f42: 1f 92 push r1 17f44: 1f 92 push r1 17f46: cd b7 in r28, 0x3d ; 61 17f48: de b7 in r29, 0x3e ; 62 17f4a: 08 2f mov r16, r24 17f4c: 16 2f mov r17, r22 17f4e: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 17f50: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 17f54: 88 23 and r24, r24 17f56: d9 f0 breq .+54 ; 0x17f8e 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) { 17f58: 0b 30 cpi r16, 0x0B ; 11 17f5a: 29 f1 breq .+74 ; 0x17fa6 17f5c: 04 31 cpi r16, 0x14 ; 20 17f5e: 31 f1 breq .+76 ; 0x17fac /// @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()) { 17f60: 87 e5 ldi r24, 0x57 ; 87 17f62: e8 2e mov r14, r24 17f64: e9 82 std Y+1, r14 ; 0x01 17f66: 0a 83 std Y+2, r16 ; 0x02 17f68: 1b 83 std Y+3, r17 ; 0x03 17f6a: fc 82 std Y+4, r15 ; 0x04 17f6c: ce 01 movw r24, r28 17f6e: 01 96 adiw r24, 0x01 ; 1 17f70: 0f 94 70 87 call 0x30ee0 ; 0x30ee0 17f74: 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)); 17f76: 47 e5 ldi r20, 0x57 ; 87 17f78: 50 2f mov r21, r16 17f7a: 61 2f mov r22, r17 17f7c: 7f 2d mov r23, r15 17f7e: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 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)); 17f82: 60 e0 ldi r22, 0x00 ; 0 17f84: 80 e0 ldi r24, 0x00 ; 0 17f86: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 17f8a: 88 23 and r24, r24 17f8c: 59 f3 breq .-42 ; 0x17f64 return true; } 17f8e: 0f 90 pop r0 17f90: 0f 90 pop r0 17f92: 0f 90 pop r0 17f94: 0f 90 pop r0 17f96: 0f 90 pop r0 17f98: df 91 pop r29 17f9a: cf 91 pop r28 17f9c: 1f 91 pop r17 17f9e: 0f 91 pop r16 17fa0: ff 90 pop r15 17fa2: ef 90 pop r14 17fa4: 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); 17fa6: 10 93 71 12 sts 0x1271, r17 ; 0x801271 17faa: da cf rjmp .-76 ; 0x17f60 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 17fac: 10 93 72 12 sts 0x1272, r17 ; 0x801272 17fb0: d7 cf rjmp .-82 ; 0x17f60 00017fb2 : #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) 17fb2: 82 30 cpi r24, 0x02 ; 2 17fb4: 91 05 cpc r25, r1 17fb6: 38 f0 brcs .+14 ; 0x17fc6 // 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 17fb8: 88 0f add r24, r24 17fba: 99 1f adc r25, r25 17fbc: 88 0f add r24, r24 17fbe: 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, 17fc0: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 17fc2: 01 97 sbiw r24, 0x01 ; 1 17fc4: f1 f7 brne .-4 ; 0x17fc2 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 17fc6: 08 95 ret 00017fc8 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 17fc8: cf 93 push r28 17fca: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 17fcc: 28 2f mov r18, r24 17fce: 30 e0 ldi r19, 0x00 ; 0 17fd0: f9 01 movw r30, r18 17fd2: e9 5b subi r30, 0xB9 ; 185 17fd4: f9 47 sbci r31, 0x79 ; 121 17fd6: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 17fd8: f9 01 movw r30, r18 17fda: ef 50 subi r30, 0x0F ; 15 17fdc: fa 47 sbci r31, 0x7A ; 122 17fde: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 17fe0: f9 01 movw r30, r18 17fe2: e5 56 subi r30, 0x65 ; 101 17fe4: fa 47 sbci r31, 0x7A ; 122 17fe6: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 17fe8: cc 23 and r28, r28 17fea: a1 f0 breq .+40 ; 0x18014 // 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); 17fec: 81 11 cpse r24, r1 17fee: 0e 94 93 b0 call 0x16126 ; 0x16126 if (*portInputRegister(port) & bit) return HIGH; 17ff2: ec 2f mov r30, r28 17ff4: f0 e0 ldi r31, 0x00 ; 0 17ff6: ee 0f add r30, r30 17ff8: ff 1f adc r31, r31 17ffa: ef 57 subi r30, 0x7F ; 127 17ffc: fa 47 sbci r31, 0x7A ; 122 17ffe: a5 91 lpm r26, Z+ 18000: b4 91 lpm r27, Z 18002: ec 91 ld r30, X 18004: ed 23 and r30, r29 18006: 81 e0 ldi r24, 0x01 ; 1 18008: 90 e0 ldi r25, 0x00 ; 0 1800a: 09 f4 brne .+2 ; 0x1800e 1800c: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1800e: df 91 pop r29 18010: cf 91 pop r28 18012: 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; 18014: 80 e0 ldi r24, 0x00 ; 0 18016: 90 e0 ldi r25, 0x00 ; 0 18018: fa cf rjmp .-12 ; 0x1800e 0001801a : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1801a: 1f 93 push r17 1801c: cf 93 push r28 1801e: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 18020: 28 2f mov r18, r24 18022: 30 e0 ldi r19, 0x00 ; 0 18024: f9 01 movw r30, r18 18026: e9 5b subi r30, 0xB9 ; 185 18028: f9 47 sbci r31, 0x79 ; 121 1802a: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1802c: f9 01 movw r30, r18 1802e: ef 50 subi r30, 0x0F ; 15 18030: fa 47 sbci r31, 0x7A ; 122 18032: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 18034: f9 01 movw r30, r18 18036: e5 56 subi r30, 0x65 ; 101 18038: fa 47 sbci r31, 0x7A ; 122 1803a: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1803c: cc 23 and r28, r28 1803e: a9 f0 breq .+42 ; 0x1806a 18040: 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); 18042: 81 11 cpse r24, r1 18044: 0e 94 93 b0 call 0x16126 ; 0x16126 out = portOutputRegister(port); 18048: ec 2f mov r30, r28 1804a: f0 e0 ldi r31, 0x00 ; 0 1804c: ee 0f add r30, r30 1804e: ff 1f adc r31, r31 18050: e9 59 subi r30, 0x99 ; 153 18052: fa 47 sbci r31, 0x7A ; 122 18054: a5 91 lpm r26, Z+ 18056: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 18058: 8f b7 in r24, 0x3f ; 63 cli(); 1805a: f8 94 cli if (val == LOW) { *out &= ~bit; 1805c: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1805e: 11 11 cpse r17, r1 18060: 08 c0 rjmp .+16 ; 0x18072 *out &= ~bit; 18062: d0 95 com r29 18064: de 23 and r29, r30 } else { *out |= bit; 18066: dc 93 st X, r29 } SREG = oldSREG; 18068: 8f bf out 0x3f, r24 ; 63 } 1806a: df 91 pop r29 1806c: cf 91 pop r28 1806e: 1f 91 pop r17 18070: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 18072: de 2b or r29, r30 18074: f8 cf rjmp .-16 ; 0x18066 00018076 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 18076: cf 93 push r28 18078: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1807a: 90 e0 ldi r25, 0x00 ; 0 1807c: fc 01 movw r30, r24 1807e: ef 50 subi r30, 0x0F ; 15 18080: fa 47 sbci r31, 0x7A ; 122 18082: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 18084: 85 56 subi r24, 0x65 ; 101 18086: 9a 47 sbci r25, 0x7A ; 122 18088: fc 01 movw r30, r24 1808a: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1808c: 88 23 and r24, r24 1808e: d1 f0 breq .+52 ; 0x180c4 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 18090: 90 e0 ldi r25, 0x00 ; 0 18092: 88 0f add r24, r24 18094: 99 1f adc r25, r25 18096: fc 01 movw r30, r24 18098: e3 5b subi r30, 0xB3 ; 179 1809a: fa 47 sbci r31, 0x7A ; 122 1809c: a5 91 lpm r26, Z+ 1809e: b4 91 lpm r27, Z out = portOutputRegister(port); 180a0: fc 01 movw r30, r24 180a2: e9 59 subi r30, 0x99 ; 153 180a4: fa 47 sbci r31, 0x7A ; 122 180a6: c5 91 lpm r28, Z+ 180a8: d4 91 lpm r29, Z if (mode == INPUT) { 180aa: 61 11 cpse r22, r1 180ac: 0e c0 rjmp .+28 ; 0x180ca uint8_t oldSREG = SREG; 180ae: 9f b7 in r25, 0x3f ; 63 cli(); 180b0: f8 94 cli *reg &= ~bit; 180b2: 8c 91 ld r24, X 180b4: e2 2f mov r30, r18 180b6: e0 95 com r30 180b8: 8e 23 and r24, r30 180ba: 8c 93 st X, r24 *out &= ~bit; 180bc: 28 81 ld r18, Y 180be: e2 23 and r30, r18 180c0: e8 83 st Y, r30 SREG = oldSREG; 180c2: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 180c4: df 91 pop r29 180c6: cf 91 pop r28 180c8: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 180ca: 8f b7 in r24, 0x3f ; 63 cli(); 180cc: f8 94 cli *reg |= bit; 180ce: ec 91 ld r30, X 180d0: e2 2b or r30, r18 180d2: ec 93 st X, r30 SREG = oldSREG; 180d4: 8f bf out 0x3f, r24 ; 63 180d6: f6 cf rjmp .-20 ; 0x180c4 000180d8 : // 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) { 180d8: 1f 93 push r17 180da: cf 93 push r28 180dc: df 93 push r29 180de: 18 2f mov r17, r24 180e0: 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); 180e2: 61 e0 ldi r22, 0x01 ; 1 180e4: 0e 94 3b c0 call 0x18076 ; 0x18076 if (val == 0) 180e8: 20 97 sbiw r28, 0x00 ; 0 180ea: 39 f4 brne .+14 ; 0x180fa { digitalWrite(pin, LOW); 180ec: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 180ee: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 180f0: df 91 pop r29 180f2: cf 91 pop r28 180f4: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 180f6: 0c 94 0d c0 jmp 0x1801a ; 0x1801a pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 180fa: cf 3f cpi r28, 0xFF ; 255 180fc: d1 05 cpc r29, r1 180fe: 11 f4 brne .+4 ; 0x18104 { digitalWrite(pin, HIGH); 18100: 61 e0 ldi r22, 0x01 ; 1 18102: f5 cf rjmp .-22 ; 0x180ee } else { switch(digitalPinToTimer(pin)) 18104: e1 2f mov r30, r17 18106: f0 e0 ldi r31, 0x00 ; 0 18108: e9 5b subi r30, 0xB9 ; 185 1810a: f9 47 sbci r31, 0x79 ; 121 1810c: e4 91 lpm r30, Z 1810e: e1 50 subi r30, 0x01 ; 1 18110: e2 31 cpi r30, 0x12 ; 18 18112: 08 f0 brcs .+2 ; 0x18116 18114: b3 c0 rjmp .+358 ; 0x1827c 18116: f0 e0 ldi r31, 0x00 ; 0 18118: 88 27 eor r24, r24 1811a: ee 56 subi r30, 0x6E ; 110 1811c: ff 43 sbci r31, 0x3F ; 63 1811e: 8f 4f sbci r24, 0xFF ; 255 18120: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 18124: a4 c0 rjmp .+328 ; 0x1826e 18126: ac c0 rjmp .+344 ; 0x18280 18128: b1 c0 rjmp .+354 ; 0x1828c 1812a: bb c0 rjmp .+374 ; 0x182a2 1812c: c5 c0 rjmp .+394 ; 0x182b8 1812e: 3e c1 rjmp .+636 ; 0x183ac 18130: cf c0 rjmp .+414 ; 0x182d0 18132: d7 c0 rjmp .+430 ; 0x182e2 18134: df c0 rjmp .+446 ; 0x182f4 18136: e9 c0 rjmp .+466 ; 0x1830a 18138: f3 c0 rjmp .+486 ; 0x18320 1813a: fd c0 rjmp .+506 ; 0x18336 1813c: 0c c1 rjmp .+536 ; 0x18356 1813e: 16 c1 rjmp .+556 ; 0x1836c 18140: 3e c1 rjmp .+636 ; 0x183be 18142: 20 c1 rjmp .+576 ; 0x18384 18144: 2a c1 rjmp .+596 ; 0x1839a 18146: 34 c1 rjmp .+616 ; 0x183b0 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 18148: 84 b5 in r24, 0x24 ; 36 1814a: 80 68 ori r24, 0x80 ; 128 1814c: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1814e: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 18150: df 91 pop r29 18152: cf 91 pop r28 18154: 1f 91 pop r17 18156: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 18158: 84 b5 in r24, 0x24 ; 36 1815a: 80 62 ori r24, 0x20 ; 32 1815c: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1815e: c8 bd out 0x28, r28 ; 40 18160: f7 cf rjmp .-18 ; 0x18150 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 18162: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18166: 80 68 ori r24, 0x80 ; 128 18168: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1816c: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 18170: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 18174: ed cf rjmp .-38 ; 0x18150 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 18176: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1817a: 80 62 ori r24, 0x20 ; 32 1817c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 18180: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 18184: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 18188: e3 cf rjmp .-58 ; 0x18150 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1818a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1818e: 88 60 ori r24, 0x08 ; 8 18190: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 18194: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 18198: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1819c: d9 cf rjmp .-78 ; 0x18150 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1819e: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181a2: 80 68 ori r24, 0x80 ; 128 181a4: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 181a8: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 181ac: d1 cf rjmp .-94 ; 0x18150 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 181ae: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181b2: 80 62 ori r24, 0x20 ; 32 181b4: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 181b8: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 181bc: c9 cf rjmp .-110 ; 0x18150 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 181be: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181c2: 80 68 ori r24, 0x80 ; 128 181c4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 181c8: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 181cc: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 181d0: bf cf rjmp .-130 ; 0x18150 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 181d2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181d6: 80 62 ori r24, 0x20 ; 32 181d8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 181dc: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 181e0: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 181e4: b5 cf rjmp .-150 ; 0x18150 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 181e6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181ea: 88 60 ori r24, 0x08 ; 8 181ec: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 181f0: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 181f4: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 181f8: ab cf rjmp .-170 ; 0x18150 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 181fa: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 181fe: 80 68 ori r24, 0x80 ; 128 18200: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 18204: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18208: 8f 7b andi r24, 0xBF ; 191 1820a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1820e: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 18212: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 18216: 9c cf rjmp .-200 ; 0x18150 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 18218: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1821c: 80 62 ori r24, 0x20 ; 32 1821e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 18222: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 18226: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1822a: 92 cf rjmp .-220 ; 0x18150 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1822c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18230: 88 60 ori r24, 0x08 ; 8 18232: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 18236: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1823a: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1823e: 88 cf rjmp .-240 ; 0x18150 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 18240: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18244: 80 68 ori r24, 0x80 ; 128 18246: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1824a: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1824e: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 18252: 7e cf rjmp .-260 ; 0x18150 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 18254: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18258: 80 62 ori r24, 0x20 ; 32 1825a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1825e: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 18262: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 18266: 74 cf rjmp .-280 ; 0x18150 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 18268: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1826c: 88 60 ori r24, 0x08 ; 8 1826e: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 18272: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 18276: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1827a: 6a cf rjmp .-300 ; 0x18150 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1827c: c0 38 cpi r28, 0x80 ; 128 1827e: d1 05 cpc r29, r1 18280: 0c f0 brlt .+2 ; 0x18284 18282: 3e cf rjmp .-388 ; 0x18100 18284: 33 cf rjmp .-410 ; 0x180ec 00018286 : } } /// 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){ 18286: 4f 92 push r4 18288: 5f 92 push r5 1828a: 6f 92 push r6 1828c: 7f 92 push r7 1828e: 8f 92 push r8 18290: 9f 92 push r9 18292: af 92 push r10 18294: bf 92 push r11 18296: cf 92 push r12 18298: df 92 push r13 1829a: ef 92 push r14 1829c: ff 92 push r15 1829e: 0f 93 push r16 182a0: 1f 93 push r17 182a2: cf 93 push r28 182a4: df 93 push r29 182a6: eb 01 movw r28, r22 182a8: 6a 01 movw r12, r20 182aa: 79 01 movw r14, r18 sm4_do_step(axes); 182ac: 0f 94 99 35 call 0x26b32 ; 0x26b32 182b0: f6 01 movw r30, r12 182b2: 00 81 ld r16, Z 182b4: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 182b6: 1c 16 cp r1, r28 182b8: 1d 06 cpc r1, r29 182ba: b4 f4 brge .+44 ; 0x182e8 182bc: 0e 15 cp r16, r14 182be: 1f 05 cpc r17, r15 182c0: 99 f4 brne .+38 ; 0x182e8 delayMicroseconds(delay_us); 182c2: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 182c4: df 91 pop r29 182c6: cf 91 pop r28 182c8: 1f 91 pop r17 182ca: 0f 91 pop r16 182cc: ff 90 pop r15 182ce: ef 90 pop r14 182d0: df 90 pop r13 182d2: cf 90 pop r12 182d4: bf 90 pop r11 182d6: af 90 pop r10 182d8: 9f 90 pop r9 182da: 8f 90 pop r8 182dc: 7f 90 pop r7 182de: 6f 90 pop r6 182e0: 5f 90 pop r5 182e2: 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); 182e4: 0c 94 d9 bf jmp 0x17fb2 ; 0x17fb2 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 182e8: b8 01 movw r22, r16 182ea: 90 e0 ldi r25, 0x00 ; 0 182ec: 80 e0 ldi r24, 0x00 ; 0 182ee: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 182f2: 2d eb ldi r18, 0xBD ; 189 182f4: 37 e3 ldi r19, 0x37 ; 55 182f6: 46 e8 ldi r20, 0x86 ; 134 182f8: 55 e3 ldi r21, 0x35 ; 53 182fa: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 182fe: 4b 01 movw r8, r22 18300: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 18302: be 01 movw r22, r28 18304: 0d 2e mov r0, r29 18306: 00 0c add r0, r0 18308: 88 0b sbc r24, r24 1830a: 99 0b sbc r25, r25 1830c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 18310: a5 01 movw r20, r10 18312: 94 01 movw r18, r8 18314: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 18318: 2b 01 movw r4, r22 1831a: 3c 01 movw r6, r24 1831c: a5 01 movw r20, r10 1831e: 94 01 movw r18, r8 18320: 6a e0 ldi r22, 0x0A ; 10 18322: 77 ed ldi r23, 0xD7 ; 215 18324: 83 e2 ldi r24, 0x23 ; 35 18326: 9c e3 ldi r25, 0x3C ; 60 18328: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1832c: 9b 01 movw r18, r22 1832e: ac 01 movw r20, r24 18330: c3 01 movw r24, r6 18332: b2 01 movw r22, r4 18334: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 18338: 4b 01 movw r8, r22 1833a: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1833c: 2a e0 ldi r18, 0x0A ; 10 1833e: 37 ed ldi r19, 0xD7 ; 215 18340: 43 e2 ldi r20, 0x23 ; 35 18342: 5e e3 ldi r21, 0x3E ; 62 18344: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 18348: 18 16 cp r1, r24 1834a: dc f5 brge .+118 ; 0x183c2 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)); 1834c: a5 01 movw r20, r10 1834e: 94 01 movw r18, r8 18350: 6a e0 ldi r22, 0x0A ; 10 18352: 77 ed ldi r23, 0xD7 ; 215 18354: 83 e2 ldi r24, 0x23 ; 35 18356: 9c e3 ldi r25, 0x3C ; 60 18358: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1835c: 20 e0 ldi r18, 0x00 ; 0 1835e: 34 e2 ldi r19, 0x24 ; 36 18360: 44 e7 ldi r20, 0x74 ; 116 18362: 59 e4 ldi r21, 0x49 ; 73 18364: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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); 18368: 20 e0 ldi r18, 0x00 ; 0 1836a: 30 e0 ldi r19, 0x00 ; 0 1836c: 40 e0 ldi r20, 0x00 ; 0 1836e: 5f e3 ldi r21, 0x3F ; 63 18370: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 18374: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 18378: 5b 01 movw r10, r22 1837a: 6e 15 cp r22, r14 1837c: 7f 05 cpc r23, r15 1837e: 08 f4 brcc .+2 ; 0x18382 18380: 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){ 18382: 0a 15 cp r16, r10 18384: 1b 05 cpc r17, r11 18386: 31 f4 brne .+12 ; 0x18394 18388: 20 97 sbiw r28, 0x00 ; 0 1838a: 21 f0 breq .+8 ; 0x18394 if (acc > 0) 1838c: fc f0 brlt .+62 ; 0x183cc t1--; 1838e: f1 e0 ldi r31, 0x01 ; 1 18390: af 1a sub r10, r31 18392: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 18394: c5 01 movw r24, r10 18396: 0e 94 d9 bf call 0x17fb2 ; 0x17fb2 delay_us = t1; 1839a: f6 01 movw r30, r12 1839c: b1 82 std Z+1, r11 ; 0x01 1839e: a0 82 st Z, r10 } 183a0: df 91 pop r29 183a2: cf 91 pop r28 183a4: 1f 91 pop r17 183a6: 0f 91 pop r16 183a8: ff 90 pop r15 183aa: ef 90 pop r14 183ac: df 90 pop r13 183ae: cf 90 pop r12 183b0: bf 90 pop r11 183b2: af 90 pop r10 183b4: 9f 90 pop r9 183b6: 8f 90 pop r8 183b8: 7f 90 pop r7 183ba: 6f 90 pop r6 183bc: 5f 90 pop r5 183be: 4f 90 pop r4 183c0: 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 183c2: 80 e1 ldi r24, 0x10 ; 16 183c4: a8 2e mov r10, r24 183c6: 87 e2 ldi r24, 0x27 ; 39 183c8: b8 2e mov r11, r24 183ca: db cf rjmp .-74 ; 0x18382 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 183cc: 8f ef ldi r24, 0xFF ; 255 183ce: a8 1a sub r10, r24 183d0: b8 0a sbc r11, r24 183d2: e0 cf rjmp .-64 ; 0x18394 000183d4 : /// 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){ 183d4: 2f 92 push r2 183d6: 3f 92 push r3 183d8: 4f 92 push r4 183da: 5f 92 push r5 183dc: 6f 92 push r6 183de: 7f 92 push r7 183e0: 8f 92 push r8 183e2: 9f 92 push r9 183e4: af 92 push r10 183e6: bf 92 push r11 183e8: cf 92 push r12 183ea: df 92 push r13 183ec: ef 92 push r14 183ee: ff 92 push r15 183f0: 0f 93 push r16 183f2: 1f 93 push r17 183f4: cf 93 push r28 183f6: df 93 push r29 183f8: 00 d0 rcall .+0 ; 0x183fa 183fa: cd b7 in r28, 0x3d ; 61 183fc: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 183fe: f9 01 movw r30, r18 18400: e0 80 ld r14, Z 18402: f1 80 ldd r15, Z+1 ; 0x01 18404: e1 14 cp r14, r1 18406: f1 04 cpc r15, r1 18408: 09 f4 brne .+2 ; 0x1840c 1840a: 6c c0 rjmp .+216 ; 0x184e4 1840c: 16 16 cp r1, r22 1840e: 17 06 cpc r1, r23 18410: 0c f0 brlt .+2 ; 0x18414 18412: 68 c0 rjmp .+208 ; 0x184e4 18414: 19 01 movw r2, r18 18416: 5b 83 std Y+3, r21 ; 0x03 18418: 4a 83 std Y+2, r20 ; 0x02 1841a: 6b 01 movw r12, r22 1841c: 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)); 1841e: fa 01 movw r30, r20 18420: 00 81 ld r16, Z 18422: 11 81 ldd r17, Z+1 ; 0x01 18424: b8 01 movw r22, r16 18426: 90 e0 ldi r25, 0x00 ; 0 18428: 80 e0 ldi r24, 0x00 ; 0 1842a: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 1842e: 4b 01 movw r8, r22 18430: 5c 01 movw r10, r24 18432: b6 01 movw r22, r12 18434: 0d 2c mov r0, r13 18436: 00 0c add r0, r0 18438: 88 0b sbc r24, r24 1843a: 99 0b sbc r25, r25 1843c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 18440: 2b 01 movw r4, r22 18442: 3c 01 movw r6, r24 18444: a5 01 movw r20, r10 18446: 94 01 movw r18, r8 18448: c5 01 movw r24, r10 1844a: b4 01 movw r22, r8 1844c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 18450: 9b 01 movw r18, r22 18452: ac 01 movw r20, r24 18454: c3 01 movw r24, r6 18456: b2 01 movw r22, r4 18458: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1845c: 9b 01 movw r18, r22 1845e: ac 01 movw r20, r24 18460: 6a e0 ldi r22, 0x0A ; 10 18462: 77 ed ldi r23, 0xD7 ; 215 18464: 83 ea ldi r24, 0xA3 ; 163 18466: 9b e3 ldi r25, 0x3B ; 59 18468: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__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); 1846c: 20 e0 ldi r18, 0x00 ; 0 1846e: 30 e0 ldi r19, 0x00 ; 0 18470: 40 e0 ldi r20, 0x00 ; 0 18472: 5f e3 ldi r21, 0x3F ; 63 18474: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 18478: 0f 94 1d a3 call 0x3463a ; 0x3463a <__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){ 1847c: 6e 15 cp r22, r14 1847e: 7f 05 cpc r23, r15 18480: 30 f5 brcc .+76 ; 0x184ce /// go steady sm4_do_step(axes); 18482: 89 81 ldd r24, Y+1 ; 0x01 18484: 0f 94 99 35 call 0x26b32 ; 0x26b32 delayMicroseconds(delay_us); 18488: ea 81 ldd r30, Y+2 ; 0x02 1848a: fb 81 ldd r31, Y+3 ; 0x03 1848c: 80 81 ld r24, Z 1848e: 91 81 ldd r25, Z+1 ; 0x01 18490: 0e 94 d9 bf call 0x17fb2 ; 0x17fb2 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 18494: f1 01 movw r30, r2 18496: 80 81 ld r24, Z 18498: 91 81 ldd r25, Z+1 ; 0x01 1849a: 01 97 sbiw r24, 0x01 ; 1 1849c: 91 83 std Z+1, r25 ; 0x01 1849e: 80 83 st Z, r24 return true; 184a0: 81 e0 ldi r24, 0x01 ; 1 } 184a2: 0f 90 pop r0 184a4: 0f 90 pop r0 184a6: 0f 90 pop r0 184a8: df 91 pop r29 184aa: cf 91 pop r28 184ac: 1f 91 pop r17 184ae: 0f 91 pop r16 184b0: ff 90 pop r15 184b2: ef 90 pop r14 184b4: df 90 pop r13 184b6: cf 90 pop r12 184b8: bf 90 pop r11 184ba: af 90 pop r10 184bc: 9f 90 pop r9 184be: 8f 90 pop r8 184c0: 7f 90 pop r7 184c2: 6f 90 pop r6 184c4: 5f 90 pop r5 184c6: 4f 90 pop r4 184c8: 3f 90 pop r3 184ca: 2f 90 pop r2 184cc: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 184ce: 66 27 eor r22, r22 184d0: 77 27 eor r23, r23 184d2: 6c 19 sub r22, r12 184d4: 7d 09 sbc r23, r13 184d6: 98 01 movw r18, r16 184d8: 4a 81 ldd r20, Y+2 ; 0x02 184da: 5b 81 ldd r21, Y+3 ; 0x03 184dc: 89 81 ldd r24, Y+1 ; 0x01 184de: 0e 94 43 c1 call 0x18286 ; 0x18286 184e2: d8 cf rjmp .-80 ; 0x18494 /// 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; 184e4: 80 e0 ldi r24, 0x00 ; 0 184e6: dd cf rjmp .-70 ; 0x184a2 000184e8 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 184e8: 0f 93 push r16 184ea: 1f 93 push r17 184ec: cf 93 push r28 184ee: df 93 push r29 184f0: 18 2f mov r17, r24 184f2: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 184f4: d1 e0 ldi r29, 0x01 ; 1 184f6: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 184f8: 81 2f mov r24, r17 184fa: 8d 23 and r24, r29 184fc: 29 f0 breq .+10 ; 0x18508 sm4_set_dir(i, dir & mask); 184fe: 60 2f mov r22, r16 18500: 6d 23 and r22, r29 18502: 8c 2f mov r24, r28 18504: 0f 94 a1 35 call 0x26b42 ; 0x26b42 } } } 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) { 18508: cf 5f subi r28, 0xFF ; 255 1850a: dd 0f add r29, r29 1850c: c3 30 cpi r28, 0x03 ; 3 1850e: a1 f7 brne .-24 ; 0x184f8 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 18510: df 91 pop r29 18512: cf 91 pop r28 18514: 1f 91 pop r17 18516: 0f 91 pop r16 18518: 08 95 ret 0001851a : //@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) { 1851a: 8f 92 push r8 1851c: 9f 92 push r9 1851e: af 92 push r10 18520: bf 92 push r11 18522: cf 92 push r12 18524: df 92 push r13 18526: ef 92 push r14 18528: ff 92 push r15 1852a: 30 e0 ldi r19, 0x00 ; 0 1852c: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1852e: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 18530: 48 2f mov r20, r24 18532: 49 23 and r20, r25 18534: 19 f1 breq .+70 ; 0x1857c count_position[i] += dir & mask ? -1L : 1L; 18536: a9 01 movw r20, r18 18538: 44 0f add r20, r20 1853a: 55 1f adc r21, r21 1853c: 44 0f add r20, r20 1853e: 55 1f adc r21, r21 18540: fa 01 movw r30, r20 18542: ea 54 subi r30, 0x4A ; 74 18544: f9 4f sbci r31, 0xF9 ; 249 18546: c0 80 ld r12, Z 18548: d1 80 ldd r13, Z+1 ; 0x01 1854a: e2 80 ldd r14, Z+2 ; 0x02 1854c: f3 80 ldd r15, Z+3 ; 0x03 1854e: 76 2f mov r23, r22 18550: 79 23 and r23, r25 18552: 81 2c mov r8, r1 18554: 91 2c mov r9, r1 18556: 54 01 movw r10, r8 18558: 83 94 inc r8 1855a: 77 23 and r23, r23 1855c: 21 f0 breq .+8 ; 0x18566 1855e: 88 24 eor r8, r8 18560: 8a 94 dec r8 18562: 98 2c mov r9, r8 18564: 54 01 movw r10, r8 18566: c8 0c add r12, r8 18568: d9 1c adc r13, r9 1856a: ea 1c adc r14, r10 1856c: fb 1c adc r15, r11 1856e: 4a 54 subi r20, 0x4A ; 74 18570: 59 4f sbci r21, 0xF9 ; 249 18572: fa 01 movw r30, r20 18574: c0 82 st Z, r12 18576: d1 82 std Z+1, r13 ; 0x01 18578: e2 82 std Z+2, r14 ; 0x02 1857a: 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) { 1857c: 99 0f add r25, r25 1857e: 2f 5f subi r18, 0xFF ; 255 18580: 3f 4f sbci r19, 0xFF ; 255 18582: 23 30 cpi r18, 0x03 ; 3 18584: 31 05 cpc r19, r1 18586: a1 f6 brne .-88 ; 0x18530 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 18588: ff 90 pop r15 1858a: ef 90 pop r14 1858c: df 90 pop r13 1858e: cf 90 pop r12 18590: bf 90 pop r11 18592: af 90 pop r10 18594: 9f 90 pop r9 18596: 8f 90 pop r8 18598: 08 95 ret 0001859a : /// 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) { 1859a: 2f 92 push r2 1859c: 3f 92 push r3 1859e: 4f 92 push r4 185a0: 5f 92 push r5 185a2: 6f 92 push r6 185a4: 7f 92 push r7 185a6: 8f 92 push r8 185a8: 9f 92 push r9 185aa: af 92 push r10 185ac: bf 92 push r11 185ae: cf 92 push r12 185b0: df 92 push r13 185b2: ef 92 push r14 185b4: ff 92 push r15 185b6: 0f 93 push r16 185b8: 1f 93 push r17 185ba: cf 93 push r28 185bc: df 93 push r29 185be: 00 d0 rcall .+0 ; 0x185c0 185c0: 00 d0 rcall .+0 ; 0x185c2 185c2: cd b7 in r28, 0x3d ; 61 185c4: 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]; 185c6: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 185ca: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 185ce: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 185d2: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 185d6: 7c 01 movw r14, r24 185d8: ec 18 sub r14, r12 185da: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 185dc: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 185e0: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 185e4: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 185e8: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 185ec: 68 1b sub r22, r24 185ee: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 185f0: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 185f4: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 185f8: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 185fc: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 18600: fa 01 movw r30, r20 18602: e8 1b sub r30, r24 18604: f9 0b sbc r31, r25 18606: fa 83 std Y+2, r31 ; 0x02 18608: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1860a: fb 01 movw r30, r22 1860c: ff 0f add r31, r31 1860e: ee 0b sbc r30, r30 18610: ff 0f add r31, r31 18612: fe 2f mov r31, r30 18614: ee 1f adc r30, r30 18616: e2 70 andi r30, 0x02 ; 2 18618: 89 81 ldd r24, Y+1 ; 0x01 1861a: 9a 81 ldd r25, Y+2 ; 0x02 1861c: 88 e0 ldi r24, 0x08 ; 8 1861e: 98 02 muls r25, r24 18620: 81 2d mov r24, r1 18622: 99 0b sbc r25, r25 18624: 11 24 eor r1, r1 18626: 84 70 andi r24, 0x04 ; 4 18628: e8 2b or r30, r24 1862a: 8f 2d mov r24, r15 1862c: 88 1f adc r24, r24 1862e: 88 27 eor r24, r24 18630: 88 1f adc r24, r24 18632: e8 2b or r30, r24 18634: e0 93 bf 03 sts 0x03BF, r30 ; 0x8003bf asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 18638: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1863c: 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; 1863e: 87 e0 ldi r24, 0x07 ; 7 18640: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 18642: e0 fd sbrc r30, 0 18644: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 18646: e1 fd sbrc r30, 1 18648: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 1864a: e4 70 andi r30, 0x04 ; 4 1864c: 09 f0 breq .+2 ; 0x18650 1864e: 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; 18650: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 18654: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 18656: 8a ef ldi r24, 0xFA ; 250 18658: 90 eb ldi r25, 0xB0 ; 176 1865a: 01 11 cpse r16, r1 1865c: 02 c0 rjmp .+4 ; 0x18662 1865e: 90 e0 ldi r25, 0x00 ; 0 18660: 80 e0 ldi r24, 0x00 ; 0 18662: 90 93 28 05 sts 0x0528, r25 ; 0x800528 18666: 80 93 27 05 sts 0x0527, r24 ; 0x800527 xyzcal_sm4_delay = delay_us; 1866a: 30 93 be 03 sts 0x03BE, r19 ; 0x8003be 1866e: 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; 18672: 29 81 ldd r18, Y+1 ; 0x01 18674: 3a 81 ldd r19, Y+2 ; 0x02 18676: 3e 83 std Y+6, r19 ; 0x06 18678: 2d 83 std Y+5, r18 ; 0x05 1867a: 37 ff sbrs r19, 7 1867c: 05 c0 rjmp .+10 ; 0x18688 1867e: 31 95 neg r19 18680: 21 95 neg r18 18682: 31 09 sbc r19, r1 18684: 3e 83 std Y+6, r19 ; 0x06 18686: 2d 83 std Y+5, r18 ; 0x05 18688: 8b 01 movw r16, r22 1868a: 77 ff sbrs r23, 7 1868c: 03 c0 rjmp .+6 ; 0x18694 1868e: 11 95 neg r17 18690: 01 95 neg r16 18692: 11 09 sbc r17, r1 18694: f7 fe sbrs r15, 7 18696: 03 c0 rjmp .+6 ; 0x1869e 18698: f1 94 neg r15 1869a: e1 94 neg r14 1869c: 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); 1869e: 98 01 movw r18, r16 186a0: d8 01 movw r26, r16 186a2: 0f 94 95 a1 call 0x3432a ; 0x3432a <__mulhisi3> 186a6: 4b 01 movw r8, r22 186a8: 5c 01 movw r10, r24 186aa: 2d 81 ldd r18, Y+5 ; 0x05 186ac: 3e 81 ldd r19, Y+6 ; 0x06 186ae: d9 01 movw r26, r18 186b0: 0f 94 95 a1 call 0x3432a ; 0x3432a <__mulhisi3> 186b4: 86 0e add r8, r22 186b6: 97 1e adc r9, r23 186b8: a8 1e adc r10, r24 186ba: b9 1e adc r11, r25 186bc: 97 01 movw r18, r14 186be: d7 01 movw r26, r14 186c0: 0f 94 95 a1 call 0x3432a ; 0x3432a <__mulhisi3> 186c4: 68 0d add r22, r8 186c6: 79 1d adc r23, r9 186c8: 8a 1d adc r24, r10 186ca: 9b 1d adc r25, r11 186cc: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 186d0: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 186d4: 20 e0 ldi r18, 0x00 ; 0 186d6: 30 e0 ldi r19, 0x00 ; 0 186d8: 40 e0 ldi r20, 0x00 ; 0 186da: 5f e3 ldi r21, 0x3F ; 63 186dc: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 186e0: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 186e4: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 186e6: 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; 186e8: 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; 186ea: 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; 186ec: 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; 186ee: 1c 82 std Y+4, r1 ; 0x04 186f0: 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; 186f2: 31 2c mov r3, r1 186f4: 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; 186f6: 1a 82 std Y+2, r1 ; 0x02 186f8: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 186fa: 61 14 cp r6, r1 186fc: 71 04 cpc r7, r1 186fe: 09 f4 brne .+2 ; 0x18702 18700: 48 c0 rjmp .+144 ; 0x18792 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 18702: e0 91 27 05 lds r30, 0x0527 ; 0x800527 18706: f0 91 28 05 lds r31, 0x0528 ; 0x800528 1870a: 30 97 sbiw r30, 0x00 ; 0 1870c: f1 f5 brne .+124 ; 0x1878a uint8_t sm = 0; //step mask 1870e: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 18710: ec 14 cp r14, r12 18712: fd 04 cpc r15, r13 18714: 40 f0 brcs .+16 ; 0x18726 sm |= 1; cx += dd; 18716: c4 0c add r12, r4 18718: d5 1c adc r13, r5 x++; 1871a: 89 81 ldd r24, Y+1 ; 0x01 1871c: 9a 81 ldd r25, Y+2 ; 0x02 1871e: 01 96 adiw r24, 0x01 ; 1 18720: 9a 83 std Y+2, r25 ; 0x02 18722: 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; 18724: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 18726: 0a 15 cp r16, r10 18728: 1b 05 cpc r17, r11 1872a: 30 f0 brcs .+12 ; 0x18738 sm |= 2; 1872c: 82 60 ori r24, 0x02 ; 2 cy += dd; 1872e: a4 0c add r10, r4 18730: b5 1c adc r11, r5 y++; 18732: 9f ef ldi r25, 0xFF ; 255 18734: 29 1a sub r2, r25 18736: 39 0a sbc r3, r25 } if (cz <= dz){ 18738: ed 81 ldd r30, Y+5 ; 0x05 1873a: fe 81 ldd r31, Y+6 ; 0x06 1873c: e8 15 cp r30, r8 1873e: f9 05 cpc r31, r9 18740: 48 f0 brcs .+18 ; 0x18754 sm |= 4; 18742: 84 60 ori r24, 0x04 ; 4 cz += dd; 18744: 84 0c add r8, r4 18746: 95 1c adc r9, r5 z++; 18748: 2b 81 ldd r18, Y+3 ; 0x03 1874a: 3c 81 ldd r19, Y+4 ; 0x04 1874c: 2f 5f subi r18, 0xFF ; 255 1874e: 3f 4f sbci r19, 0xFF ; 255 18750: 3c 83 std Y+4, r19 ; 0x04 18752: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 18754: ce 18 sub r12, r14 18756: df 08 sbc r13, r15 cy -= dy; 18758: a0 1a sub r10, r16 1875a: b1 0a sbc r11, r17 cz -= dz; 1875c: ed 81 ldd r30, Y+5 ; 0x05 1875e: fe 81 ldd r31, Y+6 ; 0x06 18760: 8e 1a sub r8, r30 18762: 9f 0a sbc r9, r31 sm4_do_step(sm); 18764: 0f 94 99 35 call 0x26b32 ; 0x26b32 uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 18768: e0 91 23 05 lds r30, 0x0523 ; 0x800523 1876c: f0 91 24 05 lds r31, 0x0524 ; 0x800524 18770: 30 97 sbiw r30, 0x00 ; 0 18772: d1 f1 breq .+116 ; 0x187e8 18774: b2 01 movw r22, r4 18776: c3 01 movw r24, r6 18778: 19 95 eicall if (delay) delayMicroseconds(delay); 1877a: 00 97 sbiw r24, 0x00 ; 0 1877c: 11 f0 breq .+4 ; 0x18782 1877e: 0e 94 d9 bf call 0x17fb2 ; 0x17fb2 nd--; 18782: f1 e0 ldi r31, 0x01 ; 1 18784: 6f 1a sub r6, r31 18786: 71 08 sbc r7, r1 18788: b8 cf rjmp .-144 ; 0x186fa 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; 1878a: 19 95 eicall 1878c: 88 23 and r24, r24 1878e: 09 f4 brne .+2 ; 0x18792 18790: be cf rjmp .-132 ; 0x1870e 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) 18792: e0 91 25 05 lds r30, 0x0525 ; 0x800525 18796: f0 91 26 05 lds r31, 0x0526 ; 0x800526 1879a: 30 97 sbiw r30, 0x00 ; 0 1879c: 41 f0 breq .+16 ; 0x187ae (*sm4_update_pos_cb)(x, y, z, 0); 1879e: 30 e0 ldi r19, 0x00 ; 0 187a0: 20 e0 ldi r18, 0x00 ; 0 187a2: 4b 81 ldd r20, Y+3 ; 0x03 187a4: 5c 81 ldd r21, Y+4 ; 0x04 187a6: b1 01 movw r22, r2 187a8: 89 81 ldd r24, Y+1 ; 0x01 187aa: 9a 81 ldd r25, Y+2 ; 0x02 187ac: 19 95 eicall 187ae: 81 e0 ldi r24, 0x01 ; 1 187b0: 67 28 or r6, r7 187b2: 09 f4 brne .+2 ; 0x187b6 187b4: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 187b6: 26 96 adiw r28, 0x06 ; 6 187b8: 0f b6 in r0, 0x3f ; 63 187ba: f8 94 cli 187bc: de bf out 0x3e, r29 ; 62 187be: 0f be out 0x3f, r0 ; 63 187c0: cd bf out 0x3d, r28 ; 61 187c2: df 91 pop r29 187c4: cf 91 pop r28 187c6: 1f 91 pop r17 187c8: 0f 91 pop r16 187ca: ff 90 pop r15 187cc: ef 90 pop r14 187ce: df 90 pop r13 187d0: cf 90 pop r12 187d2: bf 90 pop r11 187d4: af 90 pop r10 187d6: 9f 90 pop r9 187d8: 8f 90 pop r8 187da: 7f 90 pop r7 187dc: 6f 90 pop r6 187de: 5f 90 pop r5 187e0: 4f 90 pop r4 187e2: 3f 90 pop r3 187e4: 2f 90 pop r2 187e6: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 187e8: 84 ef ldi r24, 0xF4 ; 244 187ea: 91 e0 ldi r25, 0x01 ; 1 187ec: c8 cf rjmp .-112 ; 0x1877e 000187ee : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 187ee: 89 b1 in r24, 0x09 ; 9 187f0: 86 95 lsr r24 187f2: 81 70 andi r24, 0x01 ; 1 187f4: 91 e0 ldi r25, 0x01 ; 1 187f6: 89 27 eor r24, r25 187f8: 08 95 ret 000187fa : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 187fa: 1f 93 push r17 187fc: cf 93 push r28 187fe: df 93 push r29 MENU_BEGIN(); 18800: 0f 94 5d 93 call 0x326ba ; 0x326ba 18804: 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); 18808: 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 1880a: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1880c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18810: 84 30 cpi r24, 0x04 ; 4 18812: 08 f0 brcs .+2 ; 0x18816 18814: 08 c2 rjmp .+1040 ; 0x18c26 18816: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1881a: 81 e7 ldi r24, 0x71 ; 113 1881c: 9d e3 ldi r25, 0x3D ; 61 1881e: 0e 94 3c 6d call 0xda78 ; 0xda78 18822: 0f 94 28 96 call 0x32c50 ; 0x32c50 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)) { 18826: 0e 94 a4 61 call 0xc348 ; 0xc348 1882a: 81 11 cpse r24, r1 1882c: 19 c0 rjmp .+50 ; 0x18860 1882e: 0e 94 3e 61 call 0xc27c ; 0xc27c 18832: 81 11 cpse r24, r1 18834: 15 c0 rjmp .+42 ; 0x18860 18836: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1883a: 81 11 cpse r24, r1 1883c: 11 c0 rjmp .+34 ; 0x18860 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1883e: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 18842: 83 30 cpi r24, 0x03 ; 3 18844: 09 f0 breq .+2 ; 0x18848 18846: 5d c0 rjmp .+186 ; 0x18902 18848: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1884c: 88 23 and r24, r24 1884e: 41 f0 breq .+16 ; 0x18860 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 18850: 87 e6 ldi r24, 0x67 ; 103 18852: 9d e3 ldi r25, 0x3D ; 61 18854: 0e 94 3c 6d call 0xda78 ; 0xda78 18858: 67 e6 ldi r22, 0x67 ; 103 1885a: 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); 1885c: 0f 94 da 92 call 0x325b4 ; 0x325b4 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 18860: 0e 94 8e 61 call 0xc31c ; 0xc31c 18864: 88 23 and r24, r24 18866: 81 f0 breq .+32 ; 0x18888 18868: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 1886c: 81 11 cpse r24, r1 1886e: 04 c0 rjmp .+8 ; 0x18878 18870: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18874: 84 30 cpi r24, 0x04 ; 4 18876: 41 f4 brne .+16 ; 0x18888 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18878: 87 e5 ldi r24, 0x57 ; 87 1887a: 9d e3 ldi r25, 0x3D ; 61 1887c: 0e 94 3c 6d call 0xda78 ; 0xda78 18880: 6b e9 ldi r22, 0x9B ; 155 18882: 77 e3 ldi r23, 0x37 ; 55 18884: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 if (farm_mode) 18888: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1888c: 88 23 and r24, r24 1888e: 41 f0 breq .+16 ; 0x188a0 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 18890: 8c ea ldi r24, 0xAC ; 172 18892: 9d e3 ldi r25, 0x3D ; 61 18894: 0e 94 3c 6d call 0xda78 ; 0xda78 18898: 60 e1 ldi r22, 0x10 ; 16 1889a: 7f ee ldi r23, 0xEF ; 239 1889c: 0f 94 da 92 call 0x325b4 ; 0x325b4 if (!printer_recovering()) { 188a0: 0e 94 3e 61 call 0xc27c ; 0xc27c 188a4: 81 11 cpse r24, r1 188a6: 61 c0 rjmp .+194 ; 0x1896a } //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); 188a8: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 188ac: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 188b0: 89 1b sub r24, r25 188b2: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188b4: a9 f5 brne .+106 ; 0x18920 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 188b6: 0e 94 a4 61 call 0xc348 ; 0xc348 188ba: 81 11 cpse r24, r1 188bc: 31 c0 rjmp .+98 ; 0x18920 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188be: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 188c2: 82 30 cpi r24, 0x02 ; 2 188c4: 69 f1 breq .+90 ; 0x18920 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 188c6: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 188ca: 81 11 cpse r24, r1 188cc: 31 c0 rjmp .+98 ; 0x18930 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 188ce: 86 e4 ldi r24, 0x46 ; 70 188d0: 9d e3 ldi r25, 0x3D ; 61 188d2: 0e 94 3c 6d call 0xda78 ; 0xda78 188d6: 6f e4 ldi r22, 0x4F ; 79 188d8: 78 e3 ldi r23, 0x38 ; 56 188da: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 if (M79_timer_get_status()) { 188de: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 188e2: 88 23 and r24, r24 188e4: 29 f1 breq .+74 ; 0x18930 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 188e6: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.365> 188ea: 81 30 cpi r24, 0x01 ; 1 188ec: 09 f0 breq .+2 ; 0x188f0 188ee: 45 c1 rjmp .+650 ; 0x18b7a MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 188f0: 86 e3 ldi r24, 0x36 ; 54 188f2: 9d e3 ldi r25, 0x3D ; 61 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 188f4: 0e 94 3c 6d call 0xda78 ; 0xda78 188f8: 65 e9 ldi r22, 0x95 ; 149 188fa: 71 eb ldi r23, 0xB1 ; 177 188fc: 0f 94 da 92 call 0x325b4 ; 0x325b4 18900: 17 c0 rjmp .+46 ; 0x18930 // 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()) { 18902: 84 30 cpi r24, 0x04 ; 4 18904: 09 f0 breq .+2 ; 0x18908 18906: ac cf rjmp .-168 ; 0x18860 18908: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 1890c: 88 23 and r24, r24 1890e: 09 f4 brne .+2 ; 0x18912 18910: a7 cf rjmp .-178 ; 0x18860 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18912: 87 e6 ldi r24, 0x67 ; 103 18914: 9d e3 ldi r25, 0x3D ; 61 18916: 0e 94 3c 6d call 0xda78 ; 0xda78 1891a: 6f e8 ldi r22, 0x8F ; 143 1891c: 71 eb ldi r23, 0xB1 ; 177 1891e: 9e cf rjmp .-196 ; 0x1885c 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); 18920: 80 e5 ldi r24, 0x50 ; 80 18922: 9d e3 ldi r25, 0x3D ; 61 18924: 0e 94 3c 6d call 0xda78 ; 0xda78 18928: 62 e9 ldi r22, 0x92 ; 146 1892a: 76 eb ldi r23, 0xB6 ; 182 1892c: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #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) { 18930: c0 91 06 12 lds r28, 0x1206 ; 0x801206 18934: 0e 94 48 61 call 0xc290 ; 0xc290 18938: c1 11 cpse r28, r1 1893a: 17 c0 rjmp .+46 ; 0x1896a 1893c: 90 91 05 12 lds r25, 0x1205 ; 0x801205 18940: 91 11 cpse r25, r1 18942: 13 c0 rjmp .+38 ; 0x1896a 18944: 81 11 cpse r24, r1 18946: 15 c0 rjmp .+42 ; 0x18972 18948: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 1894c: 81 11 cpse r24, r1 1894e: 0d c0 rjmp .+26 ; 0x1896a if (usb_timer.running()) { 18950: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18954: 88 23 and r24, r24 18956: 09 f4 brne .+2 ; 0x1895a 18958: 13 c1 rjmp .+550 ; 0x18b80 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1895a: 8c e1 ldi r24, 0x1C ; 28 1895c: 9d e3 ldi r25, 0x3D ; 61 1895e: 0e 94 3c 6d call 0xda78 ; 0xda78 18962: 69 e2 ldi r22, 0x29 ; 41 18964: 77 e3 ldi r23, 0x37 ; 55 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18966: 0f 94 da 92 call 0x325b4 ; 0x325b4 } } } if (printingIsPaused() 1896a: 0e 94 48 61 call 0xc290 ; 0xc290 && !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) { 1896e: 88 23 and r24, r24 18970: f1 f0 breq .+60 ; 0x189ae temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 18972: 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() 18976: 81 11 cpse r24, r1 18978: 1a c0 rjmp .+52 ; 0x189ae #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1897a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 1897e: 82 30 cpi r24, 0x02 ; 2 18980: b1 f0 breq .+44 ; 0x189ae #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 18982: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18986: 82 30 cpi r24, 0x02 ; 2 18988: 21 f4 brne .+8 ; 0x18992 1898a: 90 91 e7 11 lds r25, 0x11E7 ; 0x8011e7 1898e: 99 23 and r25, r25 18990: 71 f0 breq .+28 ; 0x189ae && custom_message_type != CustomMsg::Resuming) { 18992: 90 91 c7 06 lds r25, 0x06C7 ; 0x8006c7 18996: 98 30 cpi r25, 0x08 ; 8 18998: 51 f0 breq .+20 ; 0x189ae if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1899a: 81 11 cpse r24, r1 1899c: fd c0 rjmp .+506 ; 0x18b98 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1899e: 8d e0 ldi r24, 0x0D ; 13 189a0: 9d e3 ldi r25, 0x3D ; 61 189a2: 0e 94 3c 6d call 0xda78 ; 0xda78 189a6: 64 e2 ldi r22, 0x24 ; 36 189a8: 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); 189aa: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 189ae: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189b2: 81 11 cpse r24, r1 189b4: 08 c0 rjmp .+16 ; 0x189c6 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())) 189b6: 0e 94 48 61 call 0xc290 ; 0xc290 189ba: 81 11 cpse r24, r1 189bc: 04 c0 rjmp .+8 ; 0x189c6 189be: 0e 94 3e 61 call 0xc27c ; 0xc27c 189c2: 88 23 and r24, r24 189c4: 81 f0 breq .+32 ; 0x189e6 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189c6: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 189ca: 81 30 cpi r24, 0x01 ; 1 189cc: 61 f0 breq .+24 ; 0x189e6 189ce: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 189d2: 81 11 cpse r24, r1 189d4: 08 c0 rjmp .+16 ; 0x189e6 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 189d6: 8e e0 ldi r24, 0x0E ; 14 189d8: 9e e3 ldi r25, 0x3E ; 62 189da: 0e 94 3c 6d call 0xda78 ; 0xda78 189de: 6a e7 ldi r22, 0x7A ; 122 189e0: 74 eb ldi r23, 0xB4 ; 180 189e2: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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() 189e6: 0e 94 3e 61 call 0xc27c ; 0xc27c #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189ea: 81 11 cpse r24, r1 189ec: 95 c0 rjmp .+298 ; 0x18b18 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() 189ee: 0e 94 a4 61 call 0xc348 ; 0xc348 189f2: 81 11 cpse r24, r1 189f4: 91 c0 rjmp .+290 ; 0x18b18 189f6: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 189fa: 81 11 cpse r24, r1 189fc: 8d c0 rjmp .+282 ; 0x18b18 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189fe: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18a02: 82 30 cpi r24, 0x02 ; 2 18a04: 09 f4 brne .+2 ; 0x18a08 18a06: 88 c0 rjmp .+272 ; 0x18b18 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18a08: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18a0c: 81 11 cpse r24, r1 18a0e: 05 c0 rjmp .+10 ; 0x18a1a || lcd_commands_type != LcdCommands::Idle) { 18a10: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a14: 88 23 and r24, r24 18a16: 09 f4 brne .+2 ; 0x18a1a 18a18: ce c0 rjmp .+412 ; 0x18bb6 if (!card.isFileOpen()) { 18a1a: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 18a1e: 81 11 cpse r24, r1 18a20: 12 c0 rjmp .+36 ; 0x18a46 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18a22: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18a26: 81 11 cpse r24, r1 18a28: 0e c0 rjmp .+28 ; 0x18a46 18a2a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a2e: 81 11 cpse r24, r1 18a30: 0a c0 rjmp .+20 ; 0x18a46 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18a32: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 18a36: 8d ef ldi r24, 0xFD ; 253 18a38: 9c e3 ldi r25, 0x3C ; 60 18a3a: 0e 94 3c 6d call 0xda78 ; 0xda78 18a3e: 6e ef ldi r22, 0xFE ; 254 18a40: 7b ee ldi r23, 0xEB ; 235 18a42: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #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) { 18a46: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18a4a: 81 11 cpse r24, r1 18a4c: 12 c0 rjmp .+36 ; 0x18a72 const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18a4e: 81 ea ldi r24, 0xA1 ; 161 18a50: 9d e0 ldi r25, 0x0D ; 13 18a52: 0f 94 7d a0 call 0x340fa ; 0x340fa 18a56: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 18a58: 0e 94 b1 6f call 0xdf62 ; 0xdf62 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 18a5c: 87 fd sbrc r24, 7 18a5e: 09 c0 rjmp .+18 ; 0x18a72 18a60: c8 17 cp r28, r24 18a62: 39 f0 breq .+14 ; 0x18a72 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 18a64: c1 02 muls r28, r17 18a66: c0 01 movw r24, r0 18a68: 11 24 eor r1, r1 18a6a: 87 5b subi r24, 0xB7 ; 183 18a6c: 92 4f sbci r25, 0xF2 ; 242 18a6e: 0e 94 81 b2 call 0x16502 ; 0x16502 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 18a72: 80 91 62 03 lds r24, 0x0362 ; 0x800362 18a76: 81 11 cpse r24, r1 18a78: 4f c0 rjmp .+158 ; 0x18b18 18a7a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 18a7e: 81 11 cpse r24, r1 18a80: 4b c0 rjmp .+150 ; 0x18b18 if (MMU2::mmu2.Enabled()) { 18a82: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18a86: 81 30 cpi r24, 0x01 ; 1 18a88: 09 f0 breq .+2 ; 0x18a8c 18a8a: 9e c0 rjmp .+316 ; 0x18bc8 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 18a8c: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 18a90: 81 11 cpse r24, r1 18a92: 0c c0 rjmp .+24 ; 0x18aac 18a94: 0e 94 f7 c3 call 0x187ee ; 0x187ee 18a98: 81 11 cpse r24, r1 18a9a: 08 c0 rjmp .+16 ; 0x18aac // 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); 18a9c: 8f ed ldi r24, 0xDF ; 223 18a9e: 9c e3 ldi r25, 0x3C ; 60 18aa0: 0e 94 3c 6d call 0xda78 ; 0xda78 18aa4: 6e e8 ldi r22, 0x8E ; 142 18aa6: 7b eb ldi r23, 0xBB ; 187 18aa8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 18aac: 8e ec ldi r24, 0xCE ; 206 18aae: 9c e3 ldi r25, 0x3C ; 60 18ab0: 0e 94 3c 6d call 0xda78 ; 0xda78 18ab4: 65 ec ldi r22, 0xC5 ; 197 18ab6: 7b eb ldi r23, 0xBB ; 187 18ab8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 18abc: 8c eb ldi r24, 0xBC ; 188 18abe: 9c e3 ldi r25, 0x3C ; 60 18ac0: 0e 94 3c 6d call 0xda78 ; 0xda78 18ac4: 68 ec ldi r22, 0xC8 ; 200 18ac6: 7b eb ldi r23, 0xBB ; 187 18ac8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 18acc: 83 eb ldi r24, 0xB3 ; 179 18ace: 9a e5 ldi r25, 0x5A ; 90 18ad0: 0e 94 3c 6d call 0xda78 ; 0xda78 18ad4: 6b ec ldi r22, 0xCB ; 203 18ad6: 7b eb ldi r23, 0xBB ; 187 18ad8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 18adc: 8e ec ldi r24, 0xCE ; 206 18ade: 9e e0 ldi r25, 0x0E ; 14 18ae0: 0f 94 7d a0 call 0x340fa ; 0x340fa 18ae4: 88 23 and r24, r24 18ae6: 41 f0 breq .+16 ; 0x18af8 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 18ae8: 84 ea ldi r24, 0xA4 ; 164 18aea: 9a e5 ldi r25, 0x5A ; 90 18aec: 0e 94 3c 6d call 0xda78 ; 0xda78 18af0: 6e ec ldi r22, 0xCE ; 206 18af2: 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); 18af4: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 18af8: 88 ef ldi r24, 0xF8 ; 248 18afa: 9d e3 ldi r25, 0x3D ; 61 18afc: 0e 94 3c 6d call 0xda78 ; 0xda78 18b00: 60 e5 ldi r22, 0x50 ; 80 18b02: 77 eb ldi r23, 0xB7 ; 183 18b04: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 18b08: 8a e8 ldi r24, 0x8A ; 138 18b0a: 9c e3 ldi r25, 0x3C ; 60 18b0c: 0e 94 3c 6d call 0xda78 ; 0xda78 18b10: 6c ea ldi r22, 0xAC ; 172 18b12: 78 eb ldi r23, 0xB8 ; 184 18b14: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 18b18: 8d e7 ldi r24, 0x7D ; 125 18b1a: 9c e3 ldi r25, 0x3C ; 60 18b1c: 0e 94 3c 6d call 0xda78 ; 0xda78 18b20: 67 e1 ldi r22, 0x17 ; 23 18b22: 78 e3 ldi r23, 0x38 ; 56 18b24: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 18b28: 80 e7 ldi r24, 0x70 ; 112 18b2a: 9c e3 ldi r25, 0x3C ; 60 18b2c: 0e 94 3c 6d call 0xda78 ; 0xda78 18b30: 61 e3 ldi r22, 0x31 ; 49 18b32: 77 e3 ldi r23, 0x37 ; 55 18b34: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #endif if (MMU2::mmu2.Enabled()) { 18b38: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18b3c: 81 30 cpi r24, 0x01 ; 1 18b3e: 41 f4 brne .+16 ; 0x18b50 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 18b40: 8f e5 ldi r24, 0x5F ; 95 18b42: 9c e3 ldi r25, 0x3C ; 60 18b44: 0e 94 3c 6d call 0xda78 ; 0xda78 18b48: 6e e7 ldi r22, 0x7E ; 126 18b4a: 7e ef ldi r23, 0xFE ; 254 18b4c: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 18b50: 85 e5 ldi r24, 0x55 ; 85 18b52: 9c e3 ldi r25, 0x3C ; 60 18b54: 0e 94 3c 6d call 0xda78 ; 0xda78 18b58: 69 e0 ldi r22, 0x09 ; 9 18b5a: 77 e3 ldi r23, 0x37 ; 55 18b5c: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_END(); 18b60: 0f 94 31 93 call 0x32662 ; 0x32662 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18b64: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18b68: 8f 5f subi r24, 0xFF ; 255 18b6a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 18b6e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 18b72: 8f 5f subi r24, 0xFF ; 255 18b74: 80 93 30 04 sts 0x0430, r24 ; 0x800430 18b78: 49 ce rjmp .-878 ; 0x1880c 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); 18b7a: 8a e2 ldi r24, 0x2A ; 42 18b7c: 9d e3 ldi r25, 0x3D ; 61 18b7e: ba ce rjmp .-652 ; 0x188f4 } } 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) { 18b80: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 18b84: 88 23 and r24, r24 18b86: 09 f4 brne .+2 ; 0x18b8a 18b88: f0 ce rjmp .-544 ; 0x1896a MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18b8a: 8c e1 ldi r24, 0x1C ; 28 18b8c: 9d e3 ldi r25, 0x3D ; 61 18b8e: 0e 94 3c 6d call 0xda78 ; 0xda78 18b92: 67 e7 ldi r22, 0x77 ; 119 18b94: 77 e3 ldi r23, 0x37 ; 55 18b96: e7 ce rjmp .-562 ; 0x18966 #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())) { 18b98: 81 30 cpi r24, 0x01 ; 1 18b9a: 09 f0 breq .+2 ; 0x18b9e 18b9c: 08 cf rjmp .-496 ; 0x189ae 18b9e: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 18ba2: 88 23 and r24, r24 18ba4: 09 f4 brne .+2 ; 0x18ba8 18ba6: 03 cf rjmp .-506 ; 0x189ae MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 18ba8: 8d e0 ldi r24, 0x0D ; 13 18baa: 9d e3 ldi r25, 0x3D ; 61 18bac: 0e 94 3c 6d call 0xda78 ; 0xda78 18bb0: 66 e5 ldi r22, 0x56 ; 86 18bb2: 76 ee ldi r23, 0xE6 ; 230 18bb4: fa ce rjmp .-524 ; 0x189aa #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 18bb6: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 18bba: 80 ef ldi r24, 0xF0 ; 240 18bbc: 9c e3 ldi r25, 0x3C ; 60 18bbe: 0e 94 3c 6d call 0xda78 ; 0xda78 18bc2: 0f 94 28 96 call 0x32c50 ; 0x32c50 18bc6: 3f cf rjmp .-386 ; 0x18a46 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 18bc8: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18bcc: 88 23 and r24, r24 18bce: e1 f0 breq .+56 ; 0x18c08 if (!fsensor.getAutoLoadEnabled()) { 18bd0: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bd4: 81 11 cpse r24, r1 18bd6: 08 c0 rjmp .+16 ; 0x18be8 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18bd8: 8c ea ldi r24, 0xAC ; 172 18bda: 9c e3 ldi r25, 0x3C ; 60 18bdc: 0e 94 3c 6d call 0xda78 ; 0xda78 18be0: 63 e3 ldi r22, 0x33 ; 51 18be2: 78 e3 ldi r23, 0x38 ; 56 18be4: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 } if (!fsensor.getFilamentPresent()) { 18be8: 0e 94 f7 c3 call 0x187ee ; 0x187ee 18bec: 81 11 cpse r24, r1 18bee: 14 c0 rjmp .+40 ; 0x18c18 if (fsensor.getAutoLoadEnabled()) { 18bf0: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bf4: 88 23 and r24, r24 18bf6: 09 f4 brne .+2 ; 0x18bfa 18bf8: 7f cf rjmp .-258 ; 0x18af8 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 18bfa: 88 e9 ldi r24, 0x98 ; 152 18bfc: 9c e3 ldi r25, 0x3C ; 60 18bfe: 0e 94 3c 6d call 0xda78 ; 0xda78 18c02: 6d e7 ldi r22, 0x7D ; 125 18c04: 78 e3 ldi r23, 0x38 ; 56 18c06: 76 cf rjmp .-276 ; 0x18af4 } 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); 18c08: 8c ea ldi r24, 0xAC ; 172 18c0a: 9c e3 ldi r25, 0x3C ; 60 18c0c: 0e 94 3c 6d call 0xda78 ; 0xda78 18c10: 63 e3 ldi r22, 0x33 ; 51 18c12: 78 e3 ldi r23, 0x38 ; 56 18c14: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 18c18: 8c eb ldi r24, 0xBC ; 188 18c1a: 9c e3 ldi r25, 0x3C ; 60 18c1c: 0e 94 3c 6d call 0xda78 ; 0xda78 18c20: 6b ed ldi r22, 0xDB ; 219 18c22: 77 e3 ldi r23, 0x37 ; 55 18c24: 67 cf rjmp .-306 ; 0x18af4 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 18c26: df 91 pop r29 18c28: cf 91 pop r28 18c2a: 1f 91 pop r17 18c2c: 08 95 ret 00018c2e : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 18c2e: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18c32: 88 23 and r24, r24 18c34: 61 f0 breq .+24 ; 0x18c4e 18c36: 0e 94 f7 c3 call 0x187ee ; 0x187ee 18c3a: 88 23 and r24, r24 18c3c: 41 f0 breq .+16 ; 0x18c4e lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 18c3e: 8f e4 ldi r24, 0x4F ; 79 18c40: 9a e3 ldi r25, 0x3A ; 58 18c42: 0e 94 3c 6d call 0xda78 ; 0xda78 18c46: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 18c4a: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 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; 18c4e: 85 e0 ldi r24, 0x05 ; 5 18c50: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 18c54: fa cf rjmp .-12 ; 0x18c4a 00018c56 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 18c56: cf 93 push r28 18c58: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18c5a: 86 ea ldi r24, 0xA6 ; 166 18c5c: 9c e0 ldi r25, 0x0C ; 12 18c5e: 0f 94 7d a0 call 0x340fa ; 0x340fa status &= ~components; 18c62: c0 95 com r28 18c64: 6c 2f mov r22, r28 18c66: 68 23 and r22, r24 18c68: 86 ea ldi r24, 0xA6 ; 166 18c6a: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18c6c: cf 91 pop r28 18c6e: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 00018c72 : } } } static void lcd_reset_sheet() { 18c72: 1f 93 push r17 18c74: cf 93 push r28 18c76: df 93 push r29 18c78: 00 d0 rcall .+0 ; 0x18c7a 18c7a: 00 d0 rcall .+0 ; 0x18c7c 18c7c: 1f 92 push r1 18c7e: 1f 92 push r1 18c80: cd b7 in r28, 0x3d ; 61 18c82: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 18c84: be 01 movw r22, r28 18c86: 6f 5f subi r22, 0xFF ; 255 18c88: 7f 4f sbci r23, 0xFF ; 255 18c8a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c8e: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 18c92: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c96: 1b e0 ldi r17, 0x0B ; 11 18c98: 81 9f mul r24, r17 18c9a: c0 01 movw r24, r0 18c9c: 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); 18c9e: 6f ef ldi r22, 0xFF ; 255 18ca0: 7f ef ldi r23, 0xFF ; 255 18ca2: 80 5b subi r24, 0xB0 ; 176 18ca4: 92 4f sbci r25, 0xF2 ; 242 18ca6: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 18caa: 60 91 98 03 lds r22, 0x0398 ; 0x800398 18cae: 61 9f mul r22, r17 18cb0: b0 01 movw r22, r0 18cb2: 11 24 eor r1, r1 18cb4: 67 5b subi r22, 0xB7 ; 183 18cb6: 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); 18cb8: 47 e0 ldi r20, 0x07 ; 7 18cba: 50 e0 ldi r21, 0x00 ; 0 18cbc: ce 01 movw r24, r28 18cbe: 01 96 adiw r24, 0x01 ; 1 18cc0: 0f 94 91 a0 call 0x34122 ; 0x34122 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 18cc4: 81 ea ldi r24, 0xA1 ; 161 18cc6: 9d e0 ldi r25, 0x0D ; 13 18cc8: 0f 94 7d a0 call 0x340fa ; 0x340fa 18ccc: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18cd0: 89 13 cpse r24, r25 18cd2: 0a c0 rjmp .+20 ; 0x18ce8 { eeprom_switch_to_next_sheet(); 18cd4: 0e 94 c5 6f call 0xdf8a ; 0xdf8a if (-1 == eeprom_next_initialized_sheet(0)) 18cd8: 80 e0 ldi r24, 0x00 ; 0 18cda: 0e 94 b1 6f call 0xdf62 ; 0xdf62 18cde: 8f 3f cpi r24, 0xFF ; 255 18ce0: 19 f4 brne .+6 ; 0x18ce8 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18ce2: 80 e1 ldi r24, 0x10 ; 16 18ce4: 0e 94 2b c6 call 0x18c56 ; 0x18c56 } menu_back(); 18ce8: 0f 94 25 96 call 0x32c4a ; 0x32c4a } 18cec: 28 96 adiw r28, 0x08 ; 8 18cee: 0f b6 in r0, 0x3f ; 63 18cf0: f8 94 cli 18cf2: de bf out 0x3e, r29 ; 62 18cf4: 0f be out 0x3f, r0 ; 63 18cf6: cd bf out 0x3d, r28 ; 61 18cf8: df 91 pop r29 18cfa: cf 91 pop r28 18cfc: 1f 91 pop r17 18cfe: 08 95 ret 00018d00 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 18d00: cf 93 push r28 18d02: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18d04: 86 ea ldi r24, 0xA6 ; 166 18d06: 9c e0 ldi r25, 0x0C ; 12 18d08: 0f 94 7d a0 call 0x340fa ; 0x340fa status |= components; 18d0c: 68 2f mov r22, r24 18d0e: 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); 18d10: 86 ea ldi r24, 0xA6 ; 166 18d12: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18d14: cf 91 pop r28 18d16: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 00018d1a : //! @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) 18d1a: 2f 92 push r2 18d1c: 3f 92 push r3 18d1e: 4f 92 push r4 18d20: 5f 92 push r5 18d22: 6f 92 push r6 18d24: 7f 92 push r7 18d26: 8f 92 push r8 18d28: 9f 92 push r9 18d2a: af 92 push r10 18d2c: bf 92 push r11 18d2e: cf 92 push r12 18d30: df 92 push r13 18d32: ef 92 push r14 18d34: ff 92 push r15 18d36: 0f 93 push r16 18d38: 1f 93 push r17 18d3a: cf 93 push r28 18d3c: df 93 push r29 18d3e: cd b7 in r28, 0x3d ; 61 18d40: de b7 in r29, 0x3e ; 62 18d42: ce 5c subi r28, 0xCE ; 206 18d44: d1 09 sbc r29, r1 18d46: 0f b6 in r0, 0x3f ; 63 18d48: f8 94 cli 18d4a: de bf out 0x3e, r29 ; 62 18d4c: 0f be out 0x3f, r0 ; 63 18d4e: cd bf out 0x3d, r28 ; 61 18d50: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 18d52: 81 11 cpse r24, r1 18d54: 04 c0 rjmp .+8 ; 0x18d5e { disable_heater(); 18d56: 0f 94 31 12 call 0x22462 ; 0x22462 eeprom_adjust_bed_reset(); //reset bed level correction 18d5a: 0e 94 fa 6f call 0xdff4 ; 0xdff4 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 18d5e: 80 e0 ldi r24, 0x00 ; 0 18d60: 0e 94 4b 6a call 0xd496 ; 0xd496 // Let the planner use the uncorrected coordinates. mbl.reset(); 18d64: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 // 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(); 18d68: 0f 94 fd 8f call 0x31ffa ; 0x31ffa babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 18d6c: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 18d70: 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)); 18d74: e3 ea ldi r30, 0xA3 ; 163 18d76: f6 e0 ldi r31, 0x06 ; 6 18d78: 83 e0 ldi r24, 0x03 ; 3 18d7a: df 01 movw r26, r30 18d7c: 1d 92 st X+, r1 18d7e: 8a 95 dec r24 18d80: e9 f7 brne .-6 ; 0x18d7c // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 18d82: 81 e0 ldi r24, 0x01 ; 1 18d84: 0e 94 79 60 call 0xc0f2 ; 0xc0f2 18d88: c7 55 subi r28, 0x57 ; 87 18d8a: df 4f sbci r29, 0xFF ; 255 18d8c: 99 83 std Y+1, r25 ; 0x01 18d8e: 88 83 st Y, r24 18d90: c9 5a subi r28, 0xA9 ; 169 18d92: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 18d94: 87 ef ldi r24, 0xF7 ; 247 18d96: 98 e4 ldi r25, 0x48 ; 72 18d98: 0e 94 3c 6d call 0xda78 ; 0xda78 18d9c: 0f 94 92 0a call 0x21524 ; 0x21524 raise_z_above(MESH_HOME_Z_SEARCH); 18da0: 60 e0 ldi r22, 0x00 ; 0 18da2: 70 e0 ldi r23, 0x00 ; 0 18da4: 80 ea ldi r24, 0xA0 ; 160 18da6: 90 e4 ldi r25, 0x40 ; 64 18da8: 0e 94 ca 67 call 0xcf94 ; 0xcf94 } /**/ void home_xy() { set_destination_to_current(); 18dac: 0e 94 c1 61 call 0xc382 ; 0xc382 homeaxis(X_AXIS); 18db0: 80 e0 ldi r24, 0x00 ; 0 18db2: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba homeaxis(Y_AXIS); 18db6: 81 e0 ldi r24, 0x01 ; 1 18db8: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba plan_set_position_curposXYZE(); 18dbc: 0f 94 d1 83 call 0x307a2 ; 0x307a2 endstops_hit_on_purpose(); 18dc0: 0f 94 68 2c call 0x258d0 ; 0x258d0 18dc4: 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; 18dc8: 20 e0 ldi r18, 0x00 ; 0 18dca: 30 e0 ldi r19, 0x00 ; 0 18dcc: 40 ea ldi r20, 0xA0 ; 160 18dce: 50 e4 ldi r21, 0x40 ; 64 18dd0: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 18dd4: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 18dd8: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 18ddc: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 18de0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 18de4: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 18de8: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 18dec: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 18df0: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] += 5; 18df4: 20 e0 ldi r18, 0x00 ; 0 18df6: 30 e0 ldi r19, 0x00 ; 0 18df8: 40 ea ldi r20, 0xA0 ; 160 18dfa: 50 e4 ldi r21, 0x40 ; 64 18dfc: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 18e00: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 18e04: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 18e08: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 18e0c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 18e10: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 18e14: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 18e18: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 18e1c: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18e20: 60 e0 ldi r22, 0x00 ; 0 18e22: 70 e0 ldi r23, 0x00 ; 0 18e24: 80 ea ldi r24, 0xA0 ; 160 18e26: 91 e4 ldi r25, 0x41 ; 65 18e28: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 18e2c: 0f 94 14 22 call 0x24428 ; 0x24428 // 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)) 18e30: 81 2f mov r24, r17 18e32: 0f 94 99 34 call 0x26932 ; 0x26932 18e36: e5 96 adiw r28, 0x35 ; 53 18e38: 8f af std Y+63, r24 ; 0x3f 18e3a: e5 97 sbiw r28, 0x35 ; 53 18e3c: 81 11 cpse r24, r1 18e3e: 04 c0 rjmp .+8 ; 0x18e48 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 18e40: e5 96 adiw r28, 0x35 ; 53 18e42: 1f ae std Y+63, r1 ; 0x3f 18e44: e5 97 sbiw r28, 0x35 ; 53 18e46: 08 c3 rjmp .+1552 ; 0x19458 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 18e48: 8b eb ldi r24, 0xBB ; 187 18e4a: 98 e4 ldi r25, 0x48 ; 72 18e4c: 0e 94 3c 6d call 0xda78 ; 0xda78 18e50: 0f 94 19 0b call 0x21632 ; 0x21632 if(onlyZ){ 18e54: 11 23 and r17, r17 18e56: 09 f4 brne .+2 ; 0x18e5a 18e58: da c2 rjmp .+1460 ; 0x1940e prompt_steel_sheet_on_bed(true); 18e5a: 81 e0 ldi r24, 0x01 ; 1 18e5c: 0f 94 30 2f call 0x25e60 ; 0x25e60 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 18e60: 89 e8 ldi r24, 0x89 ; 137 18e62: 98 e4 ldi r25, 0x48 ; 72 18e64: 0e 94 3c 6d call 0xda78 ; 0xda78 18e68: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_puts_at_P(0,3,_n("1/9")); 18e6c: 4e e5 ldi r20, 0x5E ; 94 18e6e: 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")); 18e70: 63 e0 ldi r22, 0x03 ; 3 18e72: 80 e0 ldi r24, 0x00 ; 0 18e74: 0e 94 1a 6a call 0xd434 ; 0xd434 } refresh_cmd_timeout(); 18e78: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 18e7c: 11 11 cpse r17, r1 18e7e: 1b c0 rjmp .+54 ; 0x18eb6 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18e80: 84 e0 ldi r24, 0x04 ; 4 18e82: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 18e86: 80 e0 ldi r24, 0x00 ; 0 18e88: 0f 94 30 2f call 0x25e60 ; 0x25e60 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 18e8c: 8f ec ldi r24, 0xCF ; 207 18e8e: 97 e4 ldi r25, 0x47 ; 71 18e90: 0e 94 3c 6d call 0xda78 ; 0xda78 18e94: 0f 94 19 0b call 0x21632 ; 0x21632 KEEPALIVE_STATE(IN_HANDLER); 18e98: 82 e0 ldi r24, 0x02 ; 2 18e9a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 18e9e: 87 e6 ldi r24, 0x67 ; 103 18ea0: 98 e4 ldi r25, 0x48 ; 72 18ea2: 0e 94 3c 6d call 0xda78 ; 0xda78 18ea6: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_puts_at_P(0,3,_n("1/4")); 18eaa: 46 e5 ldi r20, 0x56 ; 86 18eac: 5a e6 ldi r21, 0x6A ; 106 18eae: 63 e0 ldi r22, 0x03 ; 3 18eb0: 80 e0 ldi r24, 0x00 ; 0 18eb2: 0e 94 1a 6a call 0xd434 ; 0xd434 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 18eb6: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> check_endstops = check; 18eba: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 18ebe: 60 e0 ldi r22, 0x00 ; 0 18ec0: 70 e0 ldi r23, 0x00 ; 0 18ec2: 80 e8 ldi r24, 0x80 ; 128 18ec4: 9f eb ldi r25, 0xBF ; 191 18ec6: 0e 94 68 67 call 0xced0 ; 0xced0 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 18eca: c1 2c mov r12, r1 18ecc: d1 2c mov r13, r1 18ece: b0 ea ldi r27, 0xA0 ; 160 18ed0: eb 2e mov r14, r27 18ed2: b0 e4 ldi r27, 0x40 ; 64 18ed4: fb 2e mov r15, r27 18ed6: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18eda: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18ede: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18ee2: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18ee6: 81 e0 ldi r24, 0x01 ; 1 18ee8: 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); 18eec: 60 e0 ldi r22, 0x00 ; 0 18eee: 70 e0 ldi r23, 0x00 ; 0 18ef0: 80 ea ldi r24, 0xA0 ; 160 18ef2: 91 e4 ldi r25, 0x41 ; 65 18ef4: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 18ef8: 0f 94 14 22 call 0x24428 ; 0x24428 18efc: 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)) && 18f00: 82 e0 ldi r24, 0x02 ; 2 18f02: 0f 94 00 22 call 0x24400 ; 0x24400 18f06: 2d ec ldi r18, 0xCD ; 205 18f08: 3c ec ldi r19, 0xCC ; 204 18f0a: 44 ea ldi r20, 0xA4 ; 164 18f0c: 50 e4 ldi r21, 0x40 ; 64 18f0e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 18f12: 18 16 cp r1, r24 18f14: 0c f4 brge .+2 ; 0x18f18 18f16: 84 c2 rjmp .+1288 ; 0x19420 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 18f18: 82 e0 ldi r24, 0x02 ; 2 18f1a: 0f 94 00 22 call 0x24400 ; 0x24400 #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)) && 18f1e: 23 e3 ldi r18, 0x33 ; 51 18f20: 33 e3 ldi r19, 0x33 ; 51 18f22: 4b e9 ldi r20, 0x9B ; 155 18f24: 50 e4 ldi r21, 0x40 ; 64 18f26: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 18f2a: 87 fd sbrc r24, 7 18f2c: 79 c2 rjmp .+1266 ; 0x19420 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 18f2e: 11 11 cpse r17, r1 18f30: 7c c2 rjmp .+1272 ; 0x1942a } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18f32: 80 e1 ldi r24, 0x10 ; 16 18f34: 0e 94 2b c6 call 0x18c56 ; 0x18c56 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 18f38: 81 ea ldi r24, 0xA1 ; 161 18f3a: 9d e0 ldi r25, 0x0D ; 13 18f3c: 0f 94 7d a0 call 0x340fa ; 0x340fa 18f40: bb e0 ldi r27, 0x0B ; 11 18f42: 8b 9f mul r24, r27 18f44: c0 01 movw r24, r0 18f46: 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); 18f48: 70 e0 ldi r23, 0x00 ; 0 18f4a: 60 e0 ldi r22, 0x00 ; 0 18f4c: 80 5b subi r24, 0xB0 ; 176 18f4e: 92 4f sbci r25, 0xF2 ; 242 18f50: 0f 94 bf a0 call 0x3417e ; 0x3417e } 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(); 18f54: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 // 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); 18f58: ed e9 ldi r30, 0x9D ; 157 18f5a: f2 e1 ldi r31, 0x12 ; 18 18f5c: 84 ec ldi r24, 0xC4 ; 196 18f5e: df 01 movw r26, r30 18f60: 1d 92 st X+, r1 18f62: 8a 95 dec r24 18f64: e9 f7 brne .-6 ; 0x18f60 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 18f66: 84 e7 ldi r24, 0x74 ; 116 18f68: 99 e8 ldi r25, 0x89 ; 137 18f6a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca MYSERIAL.println(int(iteration + 1)); 18f6e: 81 e0 ldi r24, 0x01 ; 1 18f70: 90 e0 ldi r25, 0x00 ; 0 18f72: 0f 94 48 41 call 0x28290 ; 0x28290 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)); 18f76: 87 e6 ldi r24, 0x67 ; 103 18f78: 98 e4 ldi r25, 0x48 ; 72 18f7a: 0e 94 3c 6d call 0xda78 ; 0xda78 18f7e: 0f 94 92 0a call 0x21524 ; 0x21524 #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; 18f82: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18f86: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18f8a: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18f8e: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18f92: b2 e0 ldi r27, 0x02 ; 2 18f94: e1 96 adiw r28, 0x31 ; 49 18f96: bf af std Y+63, r27 ; 0x3f 18f98: e1 97 sbiw r28, 0x31 ; 49 18f9a: 2f e4 ldi r18, 0x4F ; 79 18f9c: 39 e8 ldi r19, 0x89 ; 137 18f9e: cd 56 subi r28, 0x6D ; 109 18fa0: df 4f sbci r29, 0xFF ; 255 18fa2: 39 83 std Y+1, r19 ; 0x01 18fa4: 28 83 st Y, r18 18fa6: c3 59 subi r28, 0x93 ; 147 18fa8: d0 40 sbci r29, 0x00 ; 0 18faa: 4c e9 ldi r20, 0x9C ; 156 18fac: 52 e1 ldi r21, 0x12 ; 18 18fae: cf 56 subi r28, 0x6F ; 111 18fb0: df 4f sbci r29, 0xFF ; 255 18fb2: 59 83 std Y+1, r21 ; 0x01 18fb4: 48 83 st Y, r20 18fb6: c1 59 subi r28, 0x91 ; 145 18fb8: d0 40 sbci r29, 0x00 ; 0 18fba: a0 96 adiw r28, 0x20 ; 32 18fbc: 5f af std Y+63, r21 ; 0x3f 18fbe: 4e af std Y+62, r20 ; 0x3e 18fc0: a0 97 sbiw r28, 0x20 ; 32 18fc2: e0 96 adiw r28, 0x30 ; 48 18fc4: 3f af std Y+63, r19 ; 0x3f 18fc6: 2e af std Y+62, r18 ; 0x3e 18fc8: 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; 18fca: a7 96 adiw r28, 0x27 ; 39 18fcc: 1f ae std Y+63, r1 ; 0x3f 18fce: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 18fd0: 31 2c mov r3, r1 18fd2: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 18fd4: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 18fd8: 63 e0 ldi r22, 0x03 ; 3 18fda: 80 e0 ldi r24, 0x00 ; 0 18fdc: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%d/4"),(k+1)); 18fe0: bf ef ldi r27, 0xFF ; 255 18fe2: 2b 1a sub r2, r27 18fe4: 3b 0a sbc r3, r27 18fe6: 3f 92 push r3 18fe8: 2f 92 push r2 18fea: ef e6 ldi r30, 0x6F ; 111 18fec: f9 e8 ldi r31, 0x89 ; 137 18fee: ff 93 push r31 18ff0: ef 93 push r30 18ff2: 0e 94 df 69 call 0xd3be ; 0xd3be } #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); 18ff6: 65 e5 ldi r22, 0x55 ; 85 18ff8: 75 e5 ldi r23, 0x55 ; 85 18ffa: 85 e5 ldi r24, 0x55 ; 85 18ffc: 91 e4 ldi r25, 0x41 ; 65 18ffe: 0f 94 c3 87 call 0x30f86 ; 0x30f86 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); 19002: e0 96 adiw r28, 0x30 ; 48 19004: ee ad ldd r30, Y+62 ; 0x3e 19006: ff ad ldd r31, Y+63 ; 0x3f 19008: e0 97 sbiw r28, 0x30 ; 48 1900a: 85 91 lpm r24, Z+ 1900c: 95 91 lpm r25, Z+ 1900e: a5 91 lpm r26, Z+ 19010: b4 91 lpm r27, Z 19012: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 19016: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1901a: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1901e: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 19022: e0 96 adiw r28, 0x30 ; 48 19024: ee ad ldd r30, Y+62 ; 0x3e 19026: ff ad ldd r31, Y+63 ; 0x3f 19028: e0 97 sbiw r28, 0x30 ; 48 1902a: 34 96 adiw r30, 0x04 ; 4 1902c: 85 91 lpm r24, Z+ 1902e: 95 91 lpm r25, Z+ 19030: a5 91 lpm r26, Z+ 19032: b4 91 lpm r27, Z 19034: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 19038: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1903c: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 19040: 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); 19044: 60 e0 ldi r22, 0x00 ; 0 19046: 70 e0 ldi r23, 0x00 ; 0 19048: 88 e4 ldi r24, 0x48 ; 72 1904a: 92 e4 ldi r25, 0x42 ; 66 1904c: 0f 94 c3 87 call 0x30f86 ; 0x30f86 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 19050: 44 ed ldi r20, 0xD4 ; 212 19052: 57 e8 ldi r21, 0x87 ; 135 19054: 5f 93 push r21 19056: 4f 93 push r20 19058: 0f 94 3f 9f call 0x33e7e ; 0x33e7e lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1905c: 43 ec ldi r20, 0xC3 ; 195 1905e: 57 e8 ldi r21, 0x87 ; 135 19060: 63 e0 ldi r22, 0x03 ; 3 19062: 84 e0 ldi r24, 0x04 ; 4 19064: 0e 94 1a 6a call 0xd434 ; 0xd434 // disable heaters and stop motion before we initialize sm4 disable_heater(); 19068: 0f 94 31 12 call 0x22462 ; 0x22462 st_synchronize(); 1906c: 0f 94 14 22 call 0x24428 ; 0x24428 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 19070: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 19074: 8d 7f andi r24, 0xFD ; 253 19076: 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" ); 1907a: 0f b6 in r0, 0x3f ; 63 1907c: f8 94 cli 1907e: a8 95 wdr 19080: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19084: 88 61 ori r24, 0x18 ; 24 19086: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1908a: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1908e: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 19090: 10 92 28 05 sts 0x0528, r1 ; 0x800528 19094: 10 92 27 05 sts 0x0527, r1 ; 0x800527 sm4_update_pos_cb = xyzcal_update_pos; 19098: 8e ef ldi r24, 0xFE ; 254 1909a: 90 eb ldi r25, 0xB0 ; 176 1909c: 90 93 26 05 sts 0x0526, r25 ; 0x800526 190a0: 80 93 25 05 sts 0x0525, r24 ; 0x800525 sm4_calc_delay_cb = xyzcal_calc_delay; 190a4: ad e5 ldi r26, 0x5D ; 93 190a6: b0 eb ldi r27, 0xB0 ; 176 190a8: b0 93 24 05 sts 0x0524, r27 ; 0x800524 190ac: 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]); 190b0: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 190b4: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 190b8: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 190bc: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 190c0: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 190c4: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 190c8: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 190cc: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 190d0: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 190d4: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 190d8: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 190dc: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 190e0: 3f 93 push r19 190e2: 2f 93 push r18 190e4: 1f 93 push r17 190e6: 0f 93 push r16 190e8: 7f 93 push r23 190ea: 6f 93 push r22 190ec: 5f 93 push r21 190ee: 4f 93 push r20 190f0: bf 93 push r27 190f2: af 93 push r26 190f4: 9f 93 push r25 190f6: 8f 93 push r24 190f8: e3 e7 ldi r30, 0x73 ; 115 190fa: f8 e8 ldi r31, 0x88 ; 136 190fc: ff 93 push r31 190fe: ef 93 push r30 19100: 0f 94 3f 9f call 0x33e7e ; 0x33e7e int16_t x0 = _X; 19104: 40 90 b6 06 lds r4, 0x06B6 ; 0x8006b6 19108: 50 90 b7 06 lds r5, 0x06B7 ; 0x8006b7 1910c: 60 90 b8 06 lds r6, 0x06B8 ; 0x8006b8 19110: 70 90 b9 06 lds r7, 0x06B9 ; 0x8006b9 19114: b4 2c mov r11, r4 19116: a5 2c mov r10, r5 int16_t y0 = _Y; 19118: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 1911c: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19120: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19124: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19128: a6 96 adiw r28, 0x26 ; 38 1912a: 8c af std Y+60, r24 ; 0x3c 1912c: 9d af std Y+61, r25 ; 0x3d 1912e: ae af std Y+62, r26 ; 0x3e 19130: bf af std Y+63, r27 ; 0x3f 19132: a6 97 sbiw r28, 0x26 ; 38 19134: a3 96 adiw r28, 0x23 ; 35 19136: 9f ac ldd r9, Y+63 ; 0x3f 19138: a3 97 sbiw r28, 0x23 ; 35 1913a: a4 96 adiw r28, 0x24 ; 36 1913c: 8f ac ldd r8, Y+63 ; 0x3f 1913e: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 19140: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 19144: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 19148: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 1914c: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 19150: 0f b6 in r0, 0x3f ; 63 19152: f8 94 cli 19154: de bf out 0x3e, r29 ; 62 19156: 0f be out 0x3f, r0 ; 63 19158: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1915a: b5 e0 ldi r27, 0x05 ; 5 1915c: cb 16 cp r12, r27 1915e: b7 ef ldi r27, 0xF7 ; 247 19160: db 06 cpc r13, r27 19162: 0c f4 brge .+2 ; 0x19166 19164: d3 c1 rjmp .+934 ; 0x1950c } 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; 19166: 1a 82 std Y+2, r1 ; 0x02 19168: 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); 1916a: 1f 92 push r1 1916c: 1f 92 push r1 1916e: e3 e0 ldi r30, 0x03 ; 3 19170: ef 93 push r30 19172: f4 e8 ldi r31, 0x84 ; 132 19174: ff 93 push r31 19176: 1f 92 push r1 19178: 24 e6 ldi r18, 0x64 ; 100 1917a: 2f 93 push r18 1917c: df 92 push r13 1917e: cf 92 push r12 19180: 8f 92 push r8 19182: 9f 92 push r9 19184: af 92 push r10 19186: bf 92 push r11 19188: 4a ee ldi r20, 0xEA ; 234 1918a: 57 e8 ldi r21, 0x87 ; 135 1918c: 5f 93 push r21 1918e: 4f 93 push r20 19190: 0f 94 3f 9f call 0x33e7e ; 0x33e7e if (!ret && (ad < 720)) 19194: 0f b6 in r0, 0x3f ; 63 19196: f8 94 cli 19198: de bf out 0x3e, r29 ; 62 1919a: 0f be out 0x3f, r0 ; 63 1919c: cd bf out 0x3d, r28 ; 61 1919e: 89 81 ldd r24, Y+1 ; 0x01 191a0: 9a 81 ldd r25, Y+2 ; 0x02 191a2: 80 3d cpi r24, 0xD0 ; 208 191a4: 92 40 sbci r25, 0x02 ; 2 191a6: 08 f4 brcc .+2 ; 0x191aa 191a8: 7c c1 rjmp .+760 ; 0x194a2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 191aa: 89 81 ldd r24, Y+1 ; 0x01 191ac: 9a 81 ldd r25, Y+2 ; 0x02 191ae: 80 3a cpi r24, 0xA0 ; 160 191b0: 95 40 sbci r25, 0x05 ; 5 191b2: 10 f0 brcs .+4 ; 0x191b8 191b4: 0c 94 d1 d7 jmp 0x1afa2 ; 0x1afa2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 191b8: 9e 01 movw r18, r28 191ba: 2f 5f subi r18, 0xFF ; 255 191bc: 3f 4f sbci r19, 0xFF ; 255 191be: 79 01 movw r14, r18 191c0: 10 e0 ldi r17, 0x00 ; 0 191c2: 00 e0 ldi r16, 0x00 ; 0 191c4: 2c e7 ldi r18, 0x7C ; 124 191c6: 3c ef ldi r19, 0xFC ; 252 191c8: a6 01 movw r20, r12 191ca: 44 56 subi r20, 0x64 ; 100 191cc: 51 09 sbc r21, r1 191ce: 69 2d mov r22, r9 191d0: 78 2d mov r23, r8 191d2: 8b 2d mov r24, r11 191d4: 9a 2d mov r25, r10 191d6: 0f 94 6d 5f call 0x2beda ; 0x2beda 191da: 88 23 and r24, r24 191dc: 11 f4 brne .+4 ; 0x191e2 191de: 0c 94 d1 d7 jmp 0x1afa2 ; 0x1afa2 ad += 720; 191e2: 89 81 ldd r24, Y+1 ; 0x01 191e4: 9a 81 ldd r25, Y+2 ; 0x02 191e6: 80 53 subi r24, 0x30 ; 48 191e8: 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); 191ea: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 191ee: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 191f2: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 191f6: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 191fa: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 191fe: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 19202: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 19206: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 1920a: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 1920e: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 19212: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 19216: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 1921a: 9f 93 push r25 1921c: 8f 93 push r24 1921e: df 92 push r13 19220: cf 92 push r12 19222: 1f 93 push r17 19224: 0f 93 push r16 19226: 5f 93 push r21 19228: 4f 93 push r20 1922a: 8f e4 ldi r24, 0x4F ; 79 1922c: 98 e8 ldi r25, 0x88 ; 136 1922e: 9f 93 push r25 19230: 8f 93 push r24 19232: 0f 94 3f 9f call 0x33e7e ; 0x33e7e /// 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); 19236: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 1923a: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 1923e: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 19242: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 19246: 48 54 subi r20, 0x48 ; 72 19248: 51 09 sbc r21, r1 1924a: 00 e0 ldi r16, 0x00 ; 0 1924c: 28 ec ldi r18, 0xC8 ; 200 1924e: 30 e0 ldi r19, 0x00 ; 0 19250: a3 96 adiw r28, 0x23 ; 35 19252: 6f ad ldd r22, Y+63 ; 0x3f 19254: a3 97 sbiw r28, 0x23 ; 35 19256: a4 96 adiw r28, 0x24 ; 36 19258: 7f ad ldd r23, Y+63 ; 0x3f 1925a: a4 97 sbiw r28, 0x24 ; 36 1925c: c2 01 movw r24, r4 1925e: 0e 94 cd c2 call 0x1859a ; 0x1859a /// 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; 19262: 20 91 b6 06 lds r18, 0x06B6 ; 0x8006b6 19266: 30 91 b7 06 lds r19, 0x06B7 ; 0x8006b7 1926a: 40 91 b8 06 lds r20, 0x06B8 ; 0x8006b8 1926e: 50 91 b9 06 lds r21, 0x06B9 ; 0x8006b9 19272: 6e 96 adiw r28, 0x1e ; 30 19274: 2c af std Y+60, r18 ; 0x3c 19276: 3d af std Y+61, r19 ; 0x3d 19278: 4e af std Y+62, r20 ; 0x3e 1927a: 5f af std Y+63, r21 ; 0x3f 1927c: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1927e: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19282: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19286: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 1928a: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 1928e: ae 96 adiw r28, 0x2e ; 46 19290: 8c af std Y+60, r24 ; 0x3c 19292: 9d af std Y+61, r25 ; 0x3d 19294: ae af std Y+62, r26 ; 0x3e 19296: bf af std Y+63, r27 ; 0x3f 19298: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1929a: 20 91 be 06 lds r18, 0x06BE ; 0x8006be 1929e: 30 91 bf 06 lds r19, 0x06BF ; 0x8006bf 192a2: 40 91 c0 06 lds r20, 0x06C0 ; 0x8006c0 192a6: 50 91 c1 06 lds r21, 0x06C1 ; 0x8006c1 192aa: e9 96 adiw r28, 0x39 ; 57 192ac: 2c af std Y+60, r18 ; 0x3c 192ae: 3d af std Y+61, r19 ; 0x3d 192b0: 4e af std Y+62, r20 ; 0x3e 192b2: 5f af std Y+63, r21 ; 0x3f 192b4: e9 97 sbiw r28, 0x39 ; 57 192b6: a8 ec ldi r26, 0xC8 ; 200 192b8: ba e0 ldi r27, 0x0A ; 10 192ba: 0f b6 in r0, 0x3f ; 63 192bc: f8 94 cli 192be: de bf out 0x3e, r29 ; 62 192c0: 0f be out 0x3f, r0 ; 63 192c2: cd bf out 0x3d, r28 ; 61 192c4: 90 e0 ldi r25, 0x00 ; 0 192c6: 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)); 192c8: fc 01 movw r30, r24 192ca: e6 51 subi r30, 0x16 ; 22 192cc: f7 47 sbci r31, 0x77 ; 119 192ce: 25 91 lpm r18, Z+ 192d0: 34 91 lpm r19, Z 192d2: 2d 93 st X+, r18 192d4: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 192d6: fc 01 movw r30, r24 192d8: ee 52 subi r30, 0x2E ; 46 192da: f7 47 sbci r31, 0x77 ; 119 192dc: 25 91 lpm r18, Z+ 192de: 34 91 lpm r19, Z 192e0: 57 96 adiw r26, 0x17 ; 23 192e2: 3c 93 st X, r19 192e4: 2e 93 st -X, r18 192e6: 56 97 sbiw r26, 0x16 ; 22 192e8: 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++){ 192ea: 88 31 cpi r24, 0x18 ; 24 192ec: 91 05 cpc r25, r1 192ee: 61 f7 brne .-40 ; 0x192c8 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); 192f0: e7 96 adiw r28, 0x37 ; 55 192f2: 4e ad ldd r20, Y+62 ; 0x3e 192f4: 5f ad ldd r21, Y+63 ; 0x3f 192f6: e7 97 sbiw r28, 0x37 ; 55 192f8: ac 96 adiw r28, 0x2c ; 44 192fa: 6e ad ldd r22, Y+62 ; 0x3e 192fc: 7f ad ldd r23, Y+63 ; 0x3f 192fe: ac 97 sbiw r28, 0x2c ; 44 19300: 6c 96 adiw r28, 0x1c ; 28 19302: 8e ad ldd r24, Y+62 ; 0x3e 19304: 9f ad ldd r25, Y+63 ; 0x3f 19306: 6c 97 sbiw r28, 0x1c ; 28 19308: 0f 94 f5 5b call 0x2b7ea ; 0x2b7ea 1930c: 28 ec ldi r18, 0xC8 ; 200 1930e: 36 e0 ldi r19, 0x06 ; 6 19310: a4 96 adiw r28, 0x24 ; 36 19312: 3f af std Y+63, r19 ; 0x3f 19314: 2e af std Y+62, r18 ; 0x3e 19316: a4 97 sbiw r28, 0x24 ; 36 19318: 79 01 movw r14, r18 1931a: f0 e2 ldi r31, 0x20 ; 32 1931c: 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]); 1931e: a5 e9 ldi r26, 0x95 ; 149 19320: ca 2e mov r12, r26 19322: a8 e8 ldi r26, 0x88 ; 136 19324: da 2e mov r13, r26 } DBG(endl); 19326: 03 e7 ldi r16, 0x73 ; 115 19328: 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); 1932a: 57 01 movw r10, r14 1932c: e0 e2 ldi r30, 0x20 ; 32 1932e: 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]); 19330: d5 01 movw r26, r10 19332: 8d 91 ld r24, X+ 19334: 5d 01 movw r10, r26 19336: 1f 92 push r1 19338: 8f 93 push r24 1933a: df 92 push r13 1933c: cf 92 push r12 1933e: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 19342: 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){ 19344: 0f 90 pop r0 19346: 0f 90 pop r0 19348: 0f 90 pop r0 1934a: 0f 90 pop r0 1934c: 81 10 cpse r8, r1 1934e: f0 cf rjmp .-32 ; 0x19330 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 19350: 1f 93 push r17 19352: 0f 93 push r16 19354: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 19358: 9a 94 dec r9 1935a: b0 e2 ldi r27, 0x20 ; 32 1935c: eb 0e add r14, r27 1935e: 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){ 19360: 0f 90 pop r0 19362: 0f 90 pop r0 19364: 91 10 cpse r9, r1 19366: e1 cf rjmp .-62 ; 0x1932a for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 19368: 1f 93 push r17 1936a: 0f 93 push r16 1936c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 19370: 68 ec ldi r22, 0xC8 ; 200 19372: 7a e0 ldi r23, 0x0A ; 10 19374: 0f 90 pop r0 19376: 0f 90 pop r0 19378: e8 ec ldi r30, 0xC8 ; 200 1937a: 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; 1937c: 90 e0 ldi r25, 0x00 ; 0 1937e: 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; 19380: 50 e0 ldi r21, 0x00 ; 0 19382: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 19384: 21 91 ld r18, Z+ 19386: 21 11 cpse r18, r1 19388: 01 c3 rjmp .+1538 ; 0x1998c ++mins; 1938a: 4f 5f subi r20, 0xFF ; 255 1938c: 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){ 1938e: 6e 17 cp r22, r30 19390: 7f 07 cpc r23, r31 19392: c1 f7 brne .-16 ; 0x19384 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 19394: 9a 01 movw r18, r20 19396: 28 0f add r18, r24 19398: 39 1f adc r19, r25 1939a: 25 38 cpi r18, 0x85 ; 133 1939c: 33 40 sbci r19, 0x03 ; 3 1939e: a4 f0 brlt .+40 ; 0x193c8 && mins > threshold_extreme 193a0: 43 33 cpi r20, 0x33 ; 51 193a2: 51 05 cpc r21, r1 193a4: 8c f0 brlt .+34 ; 0x193c8 && maxs > threshold_extreme 193a6: 83 33 cpi r24, 0x33 ; 51 193a8: 91 05 cpc r25, r1 193aa: 74 f0 brlt .+28 ; 0x193c8 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 193ac: 20 e0 ldi r18, 0x00 ; 0 193ae: 34 e0 ldi r19, 0x04 ; 4 193b0: 24 1b sub r18, r20 193b2: 35 0b sbc r19, r21 193b4: 28 1b sub r18, r24 193b6: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 193b8: 24 17 cp r18, r20 193ba: 35 07 cpc r19, r21 193bc: 2c f4 brge .+10 ; 0x193c8 } 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; 193be: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 193c0: 28 17 cp r18, r24 193c2: 39 07 cpc r19, r25 193c4: 0c f4 brge .+2 ; 0x193c8 193c6: d2 c0 rjmp .+420 ; 0x1956c } /// 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; 193c8: 66 96 adiw r28, 0x16 ; 22 193ca: 1f ae std Y+63, r1 ; 0x3f 193cc: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 193ce: 62 96 adiw r28, 0x12 ; 18 193d0: 1f ae std Y+63, r1 ; 0x3f 193d2: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 193d4: 22 96 adiw r28, 0x02 ; 2 193d6: 1f ae std Y+63, r1 ; 0x3f 193d8: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 193da: 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) 193dc: 88 ec ldi r24, 0xC8 ; 200 193de: 96 e0 ldi r25, 0x06 ; 6 193e0: 89 2b or r24, r25 193e2: 99 f0 breq .+38 ; 0x1940a 193e4: 88 ec ldi r24, 0xC8 ; 200 193e6: 9a e0 ldi r25, 0x0A ; 10 return -1; 193e8: 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) 193ea: 00 97 sbiw r24, 0x00 ; 0 193ec: 49 f0 breq .+18 ; 0x19400 193ee: ae 01 movw r20, r28 193f0: 4f 5a subi r20, 0xAF ; 175 193f2: 5f 4f sbci r21, 0xFF ; 255 193f4: be 01 movw r22, r28 193f6: 6b 5a subi r22, 0xAB ; 171 193f8: 7f 4f sbci r23, 0xFF ; 255 193fa: 0f 94 18 5b call 0x2b630 ; 0x2b630 193fe: 08 2f mov r16, r24 19400: 80 ee ldi r24, 0xE0 ; 224 19402: 9a e0 ldi r25, 0x0A ; 10 19404: 89 2b or r24, r25 19406: 09 f0 breq .+2 ; 0x1940a 19408: c6 c2 rjmp .+1420 ; 0x19996 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; 1940a: 8f ef ldi r24, 0xFF ; 255 1940c: d6 c2 rjmp .+1452 ; 0x199ba 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)); 1940e: 87 e6 ldi r24, 0x67 ; 103 19410: 98 e4 ldi r25, 0x48 ; 72 19412: 0e 94 3c 6d call 0xda78 ; 0xda78 19416: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_puts_at_P(0,3,_n("1/4")); 1941a: 4a e5 ldi r20, 0x5A ; 90 1941c: 5a e6 ldi r21, 0x6A ; 106 1941e: 28 cd rjmp .-1456 ; 0x18e70 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 19420: 80 e8 ldi r24, 0x80 ; 128 19422: 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); 19424: 0f 94 19 0b call 0x21632 ; 0x21632 19428: 0b cd rjmp .-1514 ; 0x18e40 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); 1942a: c7 55 subi r28, 0x57 ; 87 1942c: df 4f sbci r29, 0xFF ; 255 1942e: 88 81 ld r24, Y 19430: 99 81 ldd r25, Y+1 ; 0x01 19432: c9 5a subi r28, 0xA9 ; 169 19434: d0 40 sbci r29, 0x00 ; 0 19436: 0e 94 5f 60 call 0xc0be ; 0xc0be // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1943a: 0f 94 62 90 call 0x320c4 ; 0x320c4 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1943e: 0f 94 00 8e call 0x31c00 ; 0x31c00 //FIXME bool result = sample_mesh_and_store_reference(); 19442: 0f 94 19 8c call 0x31832 ; 0x31832 19446: e5 96 adiw r28, 0x35 ; 53 19448: 8f af std Y+63, r24 ; 0x3f 1944a: e5 97 sbiw r28, 0x35 ; 53 if (result) 1944c: 88 23 and r24, r24 1944e: 09 f4 brne .+2 ; 0x19452 19450: f7 cc rjmp .-1554 ; 0x18e40 { calibration_status_set(CALIBRATION_STATUS_Z); 19452: 84 e0 ldi r24, 0x04 ; 4 19454: 0e 94 80 c6 call 0x18d00 ; 0x18d00 } else { // Timeouted. } lcd_update_enable(true); 19458: 81 e0 ldi r24, 0x01 ; 1 1945a: 0e 94 4b 6a call 0xd496 ; 0xd496 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 1945e: e5 96 adiw r28, 0x35 ; 53 19460: 8f ad ldd r24, Y+63 ; 0x3f 19462: e5 97 sbiw r28, 0x35 ; 53 19464: c2 53 subi r28, 0x32 ; 50 19466: df 4f sbci r29, 0xFF ; 255 19468: 0f b6 in r0, 0x3f ; 63 1946a: f8 94 cli 1946c: de bf out 0x3e, r29 ; 62 1946e: 0f be out 0x3f, r0 ; 63 19470: cd bf out 0x3d, r28 ; 61 19472: df 91 pop r29 19474: cf 91 pop r28 19476: 1f 91 pop r17 19478: 0f 91 pop r16 1947a: ff 90 pop r15 1947c: ef 90 pop r14 1947e: df 90 pop r13 19480: cf 90 pop r12 19482: bf 90 pop r11 19484: af 90 pop r10 19486: 9f 90 pop r9 19488: 8f 90 pop r8 1948a: 7f 90 pop r7 1948c: 6f 90 pop r6 1948e: 5f 90 pop r5 19490: 4f 90 pop r4 19492: 3f 90 pop r3 19494: 2f 90 pop r2 19496: 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) { 19498: e1 e0 ldi r30, 0x01 ; 1 1949a: e1 96 adiw r28, 0x31 ; 49 1949c: ef af std Y+63, r30 ; 0x3f 1949e: e1 97 sbiw r28, 0x31 ; 49 194a0: 7c cd rjmp .-1288 ; 0x18f9a 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) 194a2: fe 01 movw r30, r28 194a4: 31 96 adiw r30, 0x01 ; 1 194a6: 7f 01 movw r14, r30 194a8: 10 e0 ldi r17, 0x00 ; 0 194aa: 00 e0 ldi r16, 0x00 ; 0 194ac: 24 e8 ldi r18, 0x84 ; 132 194ae: 33 e0 ldi r19, 0x03 ; 3 194b0: a6 01 movw r20, r12 194b2: 69 2d mov r22, r9 194b4: 78 2d mov r23, r8 194b6: 8b 2d mov r24, r11 194b8: 9a 2d mov r25, r10 194ba: 0f 94 6d 5f call 0x2beda ; 0x2beda ad += 0; if (!ret && (ad < 1440)) 194be: 88 23 and r24, r24 194c0: 09 f4 brne .+2 ; 0x194c4 194c2: 73 ce rjmp .-794 ; 0x191aa 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; 194c4: 89 81 ldd r24, Y+1 ; 0x01 194c6: 9a 81 ldd r25, Y+2 ; 0x02 194c8: 90 ce rjmp .-736 ; 0x191ea 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)) 194ca: 89 81 ldd r24, Y+1 ; 0x01 194cc: 9a 81 ldd r25, Y+2 ; 0x02 194ce: 80 34 cpi r24, 0x40 ; 64 194d0: 9b 40 sbci r25, 0x0B ; 11 194d2: b8 f4 brcc .+46 ; 0x19502 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 194d4: ce 01 movw r24, r28 194d6: 01 96 adiw r24, 0x01 ; 1 194d8: 7c 01 movw r14, r24 194da: 04 eb ldi r16, 0xB4 ; 180 194dc: 10 e0 ldi r17, 0x00 ; 0 194de: 2c e7 ldi r18, 0x7C ; 124 194e0: 3c ef ldi r19, 0xFC ; 252 194e2: a6 01 movw r20, r12 194e4: 4c 52 subi r20, 0x2C ; 44 194e6: 51 40 sbci r21, 0x01 ; 1 194e8: 69 2d mov r22, r9 194ea: 78 2d mov r23, r8 194ec: 8b 2d mov r24, r11 194ee: 9a 2d mov r25, r10 194f0: 0f 94 6d 5f call 0x2beda ; 0x2beda 194f4: 88 23 and r24, r24 194f6: 29 f0 breq .+10 ; 0x19502 ad += 2160; 194f8: 89 81 ldd r24, Y+1 ; 0x01 194fa: 9a 81 ldd r25, Y+2 ; 0x02 194fc: 80 59 subi r24, 0x90 ; 144 194fe: 97 4f sbci r25, 0xF7 ; 247 19500: 74 ce rjmp .-792 ; 0x191ea /// 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; 19502: 90 e9 ldi r25, 0x90 ; 144 19504: c9 1a sub r12, r25 19506: 91 e0 ldi r25, 0x01 ; 1 19508: d9 0a sbc r13, r25 1950a: 27 ce rjmp .-946 ; 0x1915a } //@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]); 1950c: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 19510: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 19514: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 19518: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 1951c: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 19520: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 19524: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 19528: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 1952c: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 19530: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 19534: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 19538: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 1953c: 3f 93 push r19 1953e: 2f 93 push r18 19540: 1f 93 push r17 19542: 0f 93 push r16 19544: 7f 93 push r23 19546: 6f 93 push r22 19548: 5f 93 push r21 1954a: 4f 93 push r20 1954c: bf 93 push r27 1954e: af 93 push r26 19550: 9f 93 push r25 19552: 8f 93 push r24 19554: 82 e2 ldi r24, 0x22 ; 34 19556: 98 e8 ldi r25, 0x88 ; 136 19558: 9f 93 push r25 1955a: 8f 93 push r24 1955c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 19560: 0f b6 in r0, 0x3f ; 63 19562: f8 94 cli 19564: de bf out 0x3e, r29 ; 62 19566: 0f be out 0x3f, r0 ; 63 19568: 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; 1956a: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1956c: 82 e0 ldi r24, 0x02 ; 2 1956e: 99 e8 ldi r25, 0x89 ; 137 19570: 9f 93 push r25 19572: 8f 93 push r24 19574: 0f 94 3f 9f call 0x33e7e ; 0x33e7e lcd_set_cursor(4,3); 19578: 63 e0 ldi r22, 0x03 ; 3 1957a: 84 e0 ldi r24, 0x04 ; 4 1957c: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_space(16); 19580: 80 e1 ldi r24, 0x10 ; 16 19582: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 19586: 0f 94 44 85 call 0x30a88 ; 0x30a88 : "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" ); 1958a: 88 e1 ldi r24, 0x18 ; 24 1958c: 98 e2 ldi r25, 0x28 ; 40 1958e: 0f b6 in r0, 0x3f ; 63 19590: f8 94 cli 19592: a8 95 wdr 19594: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19598: 0f be out 0x3f, r0 ; 63 1959a: 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); 1959e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 195a2: 80 64 ori r24, 0x40 ; 64 195a4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 195a8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 195ac: 82 60 ori r24, 0x02 ; 2 195ae: 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){ 195b2: 0f 90 pop r0 195b4: 0f 90 pop r0 195b6: 1d 3f cpi r17, 0xFD ; 253 195b8: 09 f4 brne .+2 ; 0x195bc 195ba: 64 c3 rjmp .+1736 ; 0x19c84 195bc: 1f 3f cpi r17, 0xFF ; 255 195be: 11 f4 brne .+4 ; 0x195c4 195c0: 0c 94 8d d7 jmp 0x1af1a ; 0x1af1a 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); 195c4: 20 e0 ldi r18, 0x00 ; 0 195c6: 30 e0 ldi r19, 0x00 ; 0 195c8: a9 01 movw r20, r18 195ca: a0 96 adiw r28, 0x20 ; 32 195cc: ee ad ldd r30, Y+62 ; 0x3e 195ce: ff ad ldd r31, Y+63 ; 0x3f 195d0: a0 97 sbiw r28, 0x20 ; 32 195d2: 61 81 ldd r22, Z+1 ; 0x01 195d4: 72 81 ldd r23, Z+2 ; 0x02 195d6: 83 81 ldd r24, Z+3 ; 0x03 195d8: 94 81 ldd r25, Z+4 ; 0x04 195da: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 195de: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 195e2: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 195e6: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 195ea: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 195ee: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 195f2: a0 96 adiw r28, 0x20 ; 32 195f4: ae ad ldd r26, Y+62 ; 0x3e 195f6: bf ad ldd r27, Y+63 ; 0x3f 195f8: a0 97 sbiw r28, 0x20 ; 32 195fa: 11 96 adiw r26, 0x01 ; 1 195fc: 6d 93 st X+, r22 195fe: 7d 93 st X+, r23 19600: 8d 93 st X+, r24 19602: 9c 93 st X, r25 19604: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19606: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 1960a: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 1960e: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 19612: 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); 19616: 20 e0 ldi r18, 0x00 ; 0 19618: 30 e0 ldi r19, 0x00 ; 0 1961a: a9 01 movw r20, r18 1961c: 15 96 adiw r26, 0x05 ; 5 1961e: 6d 91 ld r22, X+ 19620: 7d 91 ld r23, X+ 19622: 8d 91 ld r24, X+ 19624: 9c 91 ld r25, X 19626: 18 97 sbiw r26, 0x08 ; 8 19628: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1962c: a7 01 movw r20, r14 1962e: 96 01 movw r18, r12 19630: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19634: a0 96 adiw r28, 0x20 ; 32 19636: ee ad ldd r30, Y+62 ; 0x3e 19638: ff ad ldd r31, Y+63 ; 0x3f 1963a: a0 97 sbiw r28, 0x20 ; 32 1963c: 65 83 std Z+5, r22 ; 0x05 1963e: 76 83 std Z+6, r23 ; 0x06 19640: 87 83 std Z+7, r24 ; 0x07 19642: 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) 19644: 20 e0 ldi r18, 0x00 ; 0 19646: 30 e0 ldi r19, 0x00 ; 0 19648: 40 e8 ldi r20, 0x80 ; 128 1964a: 50 ec ldi r21, 0xC0 ; 192 1964c: c7 01 movw r24, r14 1964e: b6 01 movw r22, r12 19650: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 19654: 87 ff sbrs r24, 7 19656: 0c c0 rjmp .+24 ; 0x19670 current_position[Y_AXIS] = Y_MIN_POS; 19658: 80 e0 ldi r24, 0x00 ; 0 1965a: 90 e0 ldi r25, 0x00 ; 0 1965c: a0 e8 ldi r26, 0x80 ; 128 1965e: b0 ec ldi r27, 0xC0 ; 192 19660: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 19664: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19668: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1966c: 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; 19670: 20 e0 ldi r18, 0x00 ; 0 19672: 30 e0 ldi r19, 0x00 ; 0 19674: 40 e4 ldi r20, 0x40 ; 64 19676: 50 e4 ldi r21, 0x40 ; 64 19678: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1967c: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 19680: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 19684: 90 91 00 12 lds r25, 0x1200 ; 0x801200 19688: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1968c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 19690: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 19694: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 19698: 90 93 00 12 sts 0x1200, r25 ; 0x801200 1969c: e0 96 adiw r28, 0x30 ; 48 1969e: 2e ad ldd r18, Y+62 ; 0x3e 196a0: 3f ad ldd r19, Y+63 ; 0x3f 196a2: e0 97 sbiw r28, 0x30 ; 48 196a4: 28 5f subi r18, 0xF8 ; 248 196a6: 3f 4f sbci r19, 0xFF ; 255 196a8: e0 96 adiw r28, 0x30 ; 48 196aa: 3f af std Y+63, r19 ; 0x3f 196ac: 2e af std Y+62, r18 ; 0x3e 196ae: e0 97 sbiw r28, 0x30 ; 48 196b0: a0 96 adiw r28, 0x20 ; 32 196b2: 4e ad ldd r20, Y+62 ; 0x3e 196b4: 5f ad ldd r21, Y+63 ; 0x3f 196b6: a0 97 sbiw r28, 0x20 ; 32 196b8: 48 5f subi r20, 0xF8 ; 248 196ba: 5f 4f sbci r21, 0xFF ; 255 196bc: a0 96 adiw r28, 0x20 ; 32 196be: 5f af std Y+63, r21 ; 0x3f 196c0: 4e af std Y+62, r20 ; 0x3e 196c2: 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) { 196c4: 54 e0 ldi r21, 0x04 ; 4 196c6: 25 16 cp r2, r21 196c8: 31 04 cpc r3, r1 196ca: 09 f0 breq .+2 ; 0x196ce 196cc: 83 cc rjmp .-1786 ; 0x18fd4 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 196ce: a7 96 adiw r28, 0x27 ; 39 196d0: 6f ad ldd r22, Y+63 ; 0x3f 196d2: a7 97 sbiw r28, 0x27 ; 39 196d4: 66 23 and r22, r22 196d6: 31 f0 breq .+12 ; 0x196e4 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) { 196d8: e1 96 adiw r28, 0x31 ; 49 196da: 8f ad ldd r24, Y+63 ; 0x3f 196dc: e1 97 sbiw r28, 0x31 ; 49 196de: 81 30 cpi r24, 0x01 ; 1 196e0: 09 f0 breq .+2 ; 0x196e4 196e2: da ce rjmp .-588 ; 0x19498 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 196e4: 85 e3 ldi r24, 0x35 ; 53 196e6: 9a e6 ldi r25, 0x6A ; 106 196e8: 9f 93 push r25 196ea: 8f 93 push r24 196ec: 0f 94 3f 9f call 0x33e7e ; 0x33e7e delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 196f0: 90 e0 ldi r25, 0x00 ; 0 196f2: 80 e0 ldi r24, 0x00 ; 0 196f4: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 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) { 196f8: 0f 90 pop r0 196fa: 0f 90 pop r0 196fc: 20 e0 ldi r18, 0x00 ; 0 196fe: 30 e0 ldi r19, 0x00 ; 0 19700: 40 e9 ldi r20, 0x90 ; 144 19702: 50 ec ldi r21, 0xC0 ; 192 19704: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 19708: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 1970c: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 19710: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 19714: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 19718: 87 ff sbrs r24, 7 1971a: bb c2 rjmp .+1398 ; 0x19c92 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1971c: 8e e4 ldi r24, 0x4E ; 78 1971e: 99 e8 ldi r25, 0x89 ; 137 19720: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 19724: 8c e1 ldi r24, 0x1C ; 28 19726: 99 e8 ldi r25, 0x89 ; 137 19728: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1972c: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 19730: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 19734: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 19738: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 1973c: 42 e0 ldi r20, 0x02 ; 2 1973e: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 19742: 88 e1 ldi r24, 0x18 ; 24 19744: 99 e8 ldi r25, 0x89 ; 137 19746: 0e 94 e5 70 call 0xe1ca ; 0xe1ca MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1974a: 60 e0 ldi r22, 0x00 ; 0 1974c: 70 e0 ldi r23, 0x00 ; 0 1974e: 80 e9 ldi r24, 0x90 ; 144 19750: 90 ec ldi r25, 0xC0 ; 192 19752: 0f 94 2b 41 call 0x28256 ; 0x28256 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 19756: 92 e0 ldi r25, 0x02 ; 2 19758: af 96 adiw r28, 0x2f ; 47 1975a: 9f af std Y+63, r25 ; 0x3f 1975c: 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; 1975e: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 19762: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 19766: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 1976a: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1976e: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 19772: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 19776: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 1977a: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 1977e: a4 e6 ldi r26, 0x64 ; 100 19780: e6 96 adiw r28, 0x36 ; 54 19782: af af std Y+63, r26 ; 0x3f 19784: 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; 19786: a2 96 adiw r28, 0x22 ; 34 19788: 1c ae std Y+60, r1 ; 0x3c 1978a: 1d ae std Y+61, r1 ; 0x3d 1978c: 1e ae std Y+62, r1 ; 0x3e 1978e: 1f ae std Y+63, r1 ; 0x3f 19790: 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; 19792: a6 96 adiw r28, 0x26 ; 38 19794: 1c ae std Y+60, r1 ; 0x3c 19796: 1d ae std Y+61, r1 ; 0x3d 19798: 1e ae std Y+62, r1 ; 0x3e 1979a: 1f ae std Y+63, r1 ; 0x3f 1979c: 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 }; 1979e: fe 01 movw r30, r28 197a0: 31 96 adiw r30, 0x01 ; 1 197a2: 68 96 adiw r28, 0x18 ; 24 197a4: ff af std Y+63, r31 ; 0x3f 197a6: ee af std Y+62, r30 ; 0x3e 197a8: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 197aa: 9e 01 movw r18, r28 197ac: 2f 5b subi r18, 0xBF ; 191 197ae: 3f 4f sbci r19, 0xFF ; 255 197b0: 6a 96 adiw r28, 0x1a ; 26 197b2: 3f af std Y+63, r19 ; 0x3f 197b4: 2e af std Y+62, r18 ; 0x3e 197b6: 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; 197b8: a6 96 adiw r28, 0x26 ; 38 197ba: 6c ad ldd r22, Y+60 ; 0x3c 197bc: 7d ad ldd r23, Y+61 ; 0x3d 197be: 8e ad ldd r24, Y+62 ; 0x3e 197c0: 9f ad ldd r25, Y+63 ; 0x3f 197c2: a6 97 sbiw r28, 0x26 ; 38 197c4: 0f 94 9f a2 call 0x3453e ; 0x3453e 197c8: 6e 96 adiw r28, 0x1e ; 30 197ca: 6c af std Y+60, r22 ; 0x3c 197cc: 7d af std Y+61, r23 ; 0x3d 197ce: 8e af std Y+62, r24 ; 0x3e 197d0: 9f af std Y+63, r25 ; 0x3f 197d2: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 197d4: a6 96 adiw r28, 0x26 ; 38 197d6: 6c ad ldd r22, Y+60 ; 0x3c 197d8: 7d ad ldd r23, Y+61 ; 0x3d 197da: 8e ad ldd r24, Y+62 ; 0x3e 197dc: 9f ad ldd r25, Y+63 ; 0x3f 197de: a6 97 sbiw r28, 0x26 ; 38 197e0: 0f 94 65 a5 call 0x34aca ; 0x34aca 197e4: cb 57 subi r28, 0x7B ; 123 197e6: df 4f sbci r29, 0xFF ; 255 197e8: 68 83 st Y, r22 197ea: 79 83 std Y+1, r23 ; 0x01 197ec: 8a 83 std Y+2, r24 ; 0x02 197ee: 9b 83 std Y+3, r25 ; 0x03 197f0: c5 58 subi r28, 0x85 ; 133 197f2: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 197f4: a2 96 adiw r28, 0x22 ; 34 197f6: 6c ad ldd r22, Y+60 ; 0x3c 197f8: 7d ad ldd r23, Y+61 ; 0x3d 197fa: 8e ad ldd r24, Y+62 ; 0x3e 197fc: 9f ad ldd r25, Y+63 ; 0x3f 197fe: a2 97 sbiw r28, 0x22 ; 34 19800: 0f 94 9f a2 call 0x3453e ; 0x3453e 19804: c7 57 subi r28, 0x77 ; 119 19806: df 4f sbci r29, 0xFF ; 255 19808: 68 83 st Y, r22 1980a: 79 83 std Y+1, r23 ; 0x01 1980c: 8a 83 std Y+2, r24 ; 0x02 1980e: 9b 83 std Y+3, r25 ; 0x03 19810: c9 58 subi r28, 0x89 ; 137 19812: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 19814: a2 96 adiw r28, 0x22 ; 34 19816: 6c ad ldd r22, Y+60 ; 0x3c 19818: 7d ad ldd r23, Y+61 ; 0x3d 1981a: 8e ad ldd r24, Y+62 ; 0x3e 1981c: 9f ad ldd r25, Y+63 ; 0x3f 1981e: a2 97 sbiw r28, 0x22 ; 34 19820: 0f 94 65 a5 call 0x34aca ; 0x34aca 19824: cb 56 subi r28, 0x6B ; 107 19826: df 4f sbci r29, 0xFF ; 255 19828: 68 83 st Y, r22 1982a: 79 83 std Y+1, r23 ; 0x01 1982c: 8a 83 std Y+2, r24 ; 0x02 1982e: 9b 83 std Y+3, r25 ; 0x03 19830: c5 59 subi r28, 0x95 ; 149 19832: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 19834: 68 96 adiw r28, 0x18 ; 24 19836: ae ad ldd r26, Y+62 ; 0x3e 19838: bf ad ldd r27, Y+63 ; 0x3f 1983a: 68 97 sbiw r28, 0x18 ; 24 1983c: e0 e4 ldi r30, 0x40 ; 64 1983e: 1d 92 st X+, r1 19840: ea 95 dec r30 19842: e9 f7 brne .-6 ; 0x1983e float b[4] = { 0.f }; 19844: 80 e1 ldi r24, 0x10 ; 16 19846: 6a 96 adiw r28, 0x1a ; 26 19848: ae ad ldd r26, Y+62 ; 0x3e 1984a: bf ad ldd r27, Y+63 ; 0x3f 1984c: 6a 97 sbiw r28, 0x1a ; 26 1984e: 1d 92 st X+, r1 19850: 8a 95 dec r24 19852: e9 f7 brne .-6 ; 0x1984e float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 19854: 90 e0 ldi r25, 0x00 ; 0 19856: 80 e0 ldi r24, 0x00 ; 0 19858: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 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); 1985c: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 19860: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 19864: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 19868: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1986c: c5 55 subi r28, 0x55 ; 85 1986e: df 4f sbci r29, 0xFF ; 255 19870: 28 83 st Y, r18 19872: 39 83 std Y+1, r19 ; 0x01 19874: 4a 83 std Y+2, r20 ; 0x02 19876: 5b 83 std Y+3, r21 ; 0x03 19878: cb 5a subi r28, 0xAB ; 171 1987a: 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); 1987c: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 19880: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 19884: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 19888: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 1988c: c1 55 subi r28, 0x51 ; 81 1988e: df 4f sbci r29, 0xFF ; 255 19890: 88 83 st Y, r24 19892: 99 83 std Y+1, r25 ; 0x01 19894: aa 83 std Y+2, r26 ; 0x02 19896: bb 83 std Y+3, r27 ; 0x03 19898: cf 5a subi r28, 0xAF ; 175 1989a: d0 40 sbci r29, 0x00 ; 0 1989c: de 01 movw r26, r28 1989e: af 5b subi r26, 0xBF ; 191 198a0: bf 4f sbci r27, 0xFF ; 255 198a2: c7 56 subi r28, 0x67 ; 103 198a4: df 4f sbci r29, 0xFF ; 255 198a6: b9 83 std Y+1, r27 ; 0x01 198a8: a8 83 st Y, r26 198aa: c9 59 subi r28, 0x99 ; 153 198ac: d0 40 sbci r29, 0x00 ; 0 198ae: fe 01 movw r30, r28 198b0: 31 96 adiw r30, 0x01 ; 1 198b2: ac 96 adiw r28, 0x2c ; 44 198b4: ff af std Y+63, r31 ; 0x3f 198b6: ee af std Y+62, r30 ; 0x3e 198b8: 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) { 198ba: 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])); 198bc: cb 56 subi r28, 0x6B ; 107 198be: df 4f sbci r29, 0xFF ; 255 198c0: 28 81 ld r18, Y 198c2: 39 81 ldd r19, Y+1 ; 0x01 198c4: 4a 81 ldd r20, Y+2 ; 0x02 198c6: 5b 81 ldd r21, Y+3 ; 0x03 198c8: c5 59 subi r28, 0x95 ; 149 198ca: d0 40 sbci r29, 0x00 ; 0 198cc: 50 58 subi r21, 0x80 ; 128 198ce: ed 96 adiw r28, 0x3d ; 61 198d0: 2c af std Y+60, r18 ; 0x3c 198d2: 3d af std Y+61, r19 ; 0x3d 198d4: 4e af std Y+62, r20 ; 0x3e 198d6: 5f af std Y+63, r21 ; 0x3f 198d8: 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])); 198da: c7 57 subi r28, 0x77 ; 119 198dc: df 4f sbci r29, 0xFF ; 255 198de: 88 81 ld r24, Y 198e0: 99 81 ldd r25, Y+1 ; 0x01 198e2: aa 81 ldd r26, Y+2 ; 0x02 198e4: bb 81 ldd r27, Y+3 ; 0x03 198e6: c9 58 subi r28, 0x89 ; 137 198e8: d0 40 sbci r29, 0x00 ; 0 198ea: b0 58 subi r27, 0x80 ; 128 198ec: c3 58 subi r28, 0x83 ; 131 198ee: df 4f sbci r29, 0xFF ; 255 198f0: 88 83 st Y, r24 198f2: 99 83 std Y+1, r25 ; 0x01 198f4: aa 83 std Y+2, r26 ; 0x02 198f6: bb 83 std Y+3, r27 ; 0x03 198f8: cd 57 subi r28, 0x7D ; 125 198fa: 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]) : 198fc: cb 57 subi r28, 0x7B ; 123 198fe: df 4f sbci r29, 0xFF ; 255 19900: 28 81 ld r18, Y 19902: 39 81 ldd r19, Y+1 ; 0x01 19904: 4a 81 ldd r20, Y+2 ; 0x02 19906: 5b 81 ldd r21, Y+3 ; 0x03 19908: c5 58 subi r28, 0x85 ; 133 1990a: d0 40 sbci r29, 0x00 ; 0 1990c: 50 58 subi r21, 0x80 ; 128 1990e: cf 57 subi r28, 0x7F ; 127 19910: df 4f sbci r29, 0xFF ; 255 19912: 28 83 st Y, r18 19914: 39 83 std Y+1, r19 ; 0x01 19916: 4a 83 std Y+2, r20 ; 0x02 19918: 5b 83 std Y+3, r21 ; 0x03 1991a: c1 58 subi r28, 0x81 ; 129 1991c: 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) { 1991e: ac 96 adiw r28, 0x2c ; 44 19920: 2e ac ldd r2, Y+62 ; 0x3e 19922: 3f ac ldd r3, Y+63 ; 0x3f 19924: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 19926: 10 e0 ldi r17, 0x00 ; 0 19928: 6c e9 ldi r22, 0x9C ; 156 1992a: 46 2e mov r4, r22 1992c: 62 e1 ldi r22, 0x12 ; 18 1992e: 56 2e mov r5, r22 19930: 74 e0 ldi r23, 0x04 ; 4 19932: 77 2e mov r7, r23 acc = 0; 19934: c1 2c mov r12, r1 19936: d1 2c mov r13, r1 19938: 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) { 1993a: 01 30 cpi r16, 0x01 ; 1 1993c: 11 f4 brne .+4 ; 0x19942 1993e: 0c 94 45 d8 jmp 0x1b08a ; 0x1b08a 19942: 11 30 cpi r17, 0x01 ; 1 19944: 11 f4 brne .+4 ; 0x1994a 19946: 0c 94 f3 d7 jmp 0x1afe6 ; 0x1afe6 float a = (r == 0) ? 1.f : 1994a: 00 23 and r16, r16 1994c: 11 f4 brne .+4 ; 0x19952 1994e: 0c 94 33 d8 jmp 0x1b066 ; 0x1b066 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19952: 02 30 cpi r16, 0x02 ; 2 19954: 09 f0 breq .+2 ; 0x19958 19956: a1 c1 rjmp .+834 ; 0x19c9a 19958: d2 01 movw r26, r4 1995a: 11 96 adiw r26, 0x01 ; 1 1995c: 2d 91 ld r18, X+ 1995e: 3d 91 ld r19, X+ 19960: 4d 91 ld r20, X+ 19962: 5c 91 ld r21, X 19964: 14 97 sbiw r26, 0x04 ; 4 19966: cf 57 subi r28, 0x7F ; 127 19968: df 4f sbci r29, 0xFF ; 255 1996a: 68 81 ld r22, Y 1996c: 79 81 ldd r23, Y+1 ; 0x01 1996e: 8a 81 ldd r24, Y+2 ; 0x02 19970: 9b 81 ldd r25, Y+3 ; 0x03 19972: c1 58 subi r28, 0x81 ; 129 19974: d0 40 sbci r29, 0x00 ; 0 19976: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1997a: 4b 01 movw r8, r22 1997c: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1997e: 11 11 cpse r17, r1 19980: 9a c1 rjmp .+820 ; 0x19cb6 19982: 60 e0 ldi r22, 0x00 ; 0 19984: 70 e0 ldi r23, 0x00 ; 0 19986: 80 e8 ldi r24, 0x80 ; 128 19988: 9f e3 ldi r25, 0x3F ; 63 1998a: aa c1 rjmp .+852 ; 0x19ce0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1998c: 2f 3f cpi r18, 0xFF ; 255 1998e: 09 f0 breq .+2 ; 0x19992 19990: fe cc rjmp .-1540 ; 0x1938e ++maxs; 19992: 01 96 adiw r24, 0x01 ; 1 19994: fc cc rjmp .-1544 ; 0x1938e 19996: ae 01 movw r20, r28 19998: 4f 5f subi r20, 0xFF ; 255 1999a: 5f 4f sbci r21, 0xFF ; 255 1999c: be 01 movw r22, r28 1999e: 6f 5b subi r22, 0xBF ; 191 199a0: 7f 4f sbci r23, 0xFF ; 255 199a2: 80 ee ldi r24, 0xE0 ; 224 199a4: 9a e0 ldi r25, 0x0A ; 10 199a6: 0f 94 18 5b call 0x2b630 ; 0x2b630 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; 199aa: 66 96 adiw r28, 0x16 ; 22 199ac: 6f ad ldd r22, Y+63 ; 0x3f 199ae: 66 97 sbiw r28, 0x16 ; 22 row = r08; 199b0: 62 96 adiw r28, 0x12 ; 18 199b2: 1f ad ldd r17, Y+63 ; 0x3f 199b4: 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){ 199b6: 80 17 cp r24, r16 199b8: 28 f0 brcs .+10 ; 0x199c4 col = c08; row = r08; return match08; } col = c10; 199ba: 22 96 adiw r28, 0x02 ; 2 199bc: 6f ad ldd r22, Y+63 ; 0x3f 199be: 22 97 sbiw r28, 0x02 ; 2 row = r10; 199c0: 19 81 ldd r17, Y+1 ; 0x01 199c2: 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){ 199c4: 08 35 cpi r16, 0x58 ; 88 199c6: 08 f4 brcc .+2 ; 0x199ca 199c8: 5b c1 rjmp .+694 ; 0x19c80 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 199ca: 70 e0 ldi r23, 0x00 ; 0 199cc: 90 e0 ldi r25, 0x00 ; 0 199ce: 80 e0 ldi r24, 0x00 ; 0 199d0: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 199d4: 20 e0 ldi r18, 0x00 ; 0 199d6: 30 e0 ldi r19, 0x00 ; 0 199d8: 40 eb ldi r20, 0xB0 ; 176 199da: 50 e4 ldi r21, 0x40 ; 64 199dc: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 199e0: 2b 01 movw r4, r22 199e2: 3c 01 movw r6, r24 199e4: 65 96 adiw r28, 0x15 ; 21 199e6: 4c ae std Y+60, r4 ; 0x3c 199e8: 5d ae std Y+61, r5 ; 0x3d 199ea: 6e ae std Y+62, r6 ; 0x3e 199ec: 7f ae std Y+63, r7 ; 0x3f 199ee: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 199f0: 61 2f mov r22, r17 199f2: 70 e0 ldi r23, 0x00 ; 0 199f4: 90 e0 ldi r25, 0x00 ; 0 199f6: 80 e0 ldi r24, 0x00 ; 0 199f8: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 199fc: 20 e0 ldi r18, 0x00 ; 0 199fe: 30 e0 ldi r19, 0x00 ; 0 19a00: 40 eb ldi r20, 0xB0 ; 176 19a02: 50 e4 ldi r21, 0x40 ; 64 19a04: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19a08: 4b 01 movw r8, r22 19a0a: 5c 01 movw r10, r24 19a0c: 25 96 adiw r28, 0x05 ; 5 19a0e: 8c ae std Y+60, r8 ; 0x3c 19a10: 9d ae std Y+61, r9 ; 0x3d 19a12: ae ae std Y+62, r10 ; 0x3e 19a14: bf ae std Y+63, r11 ; 0x3f 19a16: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 19a18: 20 e0 ldi r18, 0x00 ; 0 19a1a: 30 e0 ldi r19, 0x00 ; 0 19a1c: 40 e9 ldi r20, 0x90 ; 144 19a1e: 50 e4 ldi r21, 0x40 ; 64 19a20: 29 83 std Y+1, r18 ; 0x01 19a22: 3a 83 std Y+2, r19 ; 0x02 19a24: 4b 83 std Y+3, r20 ; 0x03 19a26: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 19a28: ae 01 movw r20, r28 19a2a: 4f 5f subi r20, 0xFF ; 255 19a2c: 5f 4f sbci r21, 0xFF ; 255 19a2e: be 01 movw r22, r28 19a30: 6f 5b subi r22, 0xBF ; 191 19a32: 7f 4f sbci r23, 0xFF ; 255 19a34: ce 01 movw r24, r28 19a36: 8f 5a subi r24, 0xAF ; 175 19a38: 9f 4f sbci r25, 0xFF ; 255 19a3a: 0f 94 cd 57 call 0x2af9a ; 0x2af9a if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 19a3e: a3 01 movw r20, r6 19a40: 92 01 movw r18, r4 19a42: 65 96 adiw r28, 0x15 ; 21 19a44: 6c ad ldd r22, Y+60 ; 0x3c 19a46: 7d ad ldd r23, Y+61 ; 0x3d 19a48: 8e ad ldd r24, Y+62 ; 0x3e 19a4a: 9f ad ldd r25, Y+63 ; 0x3f 19a4c: 65 97 sbiw r28, 0x15 ; 21 19a4e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19a52: 6b 01 movw r12, r22 19a54: 7c 01 movw r14, r24 19a56: 9f 77 andi r25, 0x7F ; 127 19a58: 20 e0 ldi r18, 0x00 ; 0 19a5a: 30 e0 ldi r19, 0x00 ; 0 19a5c: 40 e4 ldi r20, 0x40 ; 64 19a5e: 50 e4 ldi r21, 0x40 ; 64 19a60: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 19a64: 18 16 cp r1, r24 19a66: 34 f1 brlt .+76 ; 0x19ab4 19a68: a5 01 movw r20, r10 19a6a: 94 01 movw r18, r8 19a6c: 25 96 adiw r28, 0x05 ; 5 19a6e: 6c ad ldd r22, Y+60 ; 0x3c 19a70: 7d ad ldd r23, Y+61 ; 0x3d 19a72: 8e ad ldd r24, Y+62 ; 0x3e 19a74: 9f ad ldd r25, Y+63 ; 0x3f 19a76: 25 97 sbiw r28, 0x05 ; 5 19a78: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19a7c: 9f 77 andi r25, 0x7F ; 127 19a7e: 20 e0 ldi r18, 0x00 ; 0 19a80: 30 e0 ldi r19, 0x00 ; 0 19a82: 40 e4 ldi r20, 0x40 ; 64 19a84: 50 e4 ldi r21, 0x40 ; 64 19a86: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 19a8a: 18 16 cp r1, r24 19a8c: 9c f0 brlt .+38 ; 0x19ab4 19a8e: 20 e0 ldi r18, 0x00 ; 0 19a90: 30 e0 ldi r19, 0x00 ; 0 19a92: 40 ea ldi r20, 0xA0 ; 160 19a94: 50 e4 ldi r21, 0x40 ; 64 19a96: 69 81 ldd r22, Y+1 ; 0x01 19a98: 7a 81 ldd r23, Y+2 ; 0x02 19a9a: 8b 81 ldd r24, Y+3 ; 0x03 19a9c: 9c 81 ldd r25, Y+4 ; 0x04 19a9e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19aa2: 9f 77 andi r25, 0x7F ; 127 19aa4: 20 e0 ldi r18, 0x00 ; 0 19aa6: 30 e0 ldi r19, 0x00 ; 0 19aa8: 40 e4 ldi r20, 0x40 ; 64 19aaa: 50 e4 ldi r21, 0x40 ; 64 19aac: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 19ab0: 18 16 cp r1, r24 19ab2: bc f5 brge .+110 ; 0x19b22 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 19ab4: 20 e0 ldi r18, 0x00 ; 0 19ab6: 30 e0 ldi r19, 0x00 ; 0 19ab8: 40 ea ldi r20, 0xA0 ; 160 19aba: 50 e4 ldi r21, 0x40 ; 64 19abc: 69 81 ldd r22, Y+1 ; 0x01 19abe: 7a 81 ldd r23, Y+2 ; 0x02 19ac0: 8b 81 ldd r24, Y+3 ; 0x03 19ac2: 9c 81 ldd r25, Y+4 ; 0x04 19ac4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19ac8: 9f 93 push r25 19aca: 8f 93 push r24 19acc: 7f 93 push r23 19ace: 6f 93 push r22 19ad0: a5 01 movw r20, r10 19ad2: 94 01 movw r18, r8 19ad4: 25 96 adiw r28, 0x05 ; 5 19ad6: 6c ad ldd r22, Y+60 ; 0x3c 19ad8: 7d ad ldd r23, Y+61 ; 0x3d 19ada: 8e ad ldd r24, Y+62 ; 0x3e 19adc: 9f ad ldd r25, Y+63 ; 0x3f 19ade: 25 97 sbiw r28, 0x05 ; 5 19ae0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19ae4: 9f 93 push r25 19ae6: 8f 93 push r24 19ae8: 7f 93 push r23 19aea: 6f 93 push r22 19aec: ff 92 push r15 19aee: ef 92 push r14 19af0: df 92 push r13 19af2: cf 92 push r12 19af4: 86 eb ldi r24, 0xB6 ; 182 19af6: 98 e8 ldi r25, 0x88 ; 136 19af8: 9f 93 push r25 19afa: 8f 93 push r24 19afc: 0f 94 3f 9f call 0x33e7e ; 0x33e7e /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 19b00: 65 96 adiw r28, 0x15 ; 21 19b02: 4c ae std Y+60, r4 ; 0x3c 19b04: 5d ae std Y+61, r5 ; 0x3d 19b06: 6e ae std Y+62, r6 ; 0x3e 19b08: 7f ae std Y+63, r7 ; 0x3f 19b0a: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 19b0c: 25 96 adiw r28, 0x05 ; 5 19b0e: 8c ae std Y+60, r8 ; 0x3c 19b10: 9d ae std Y+61, r9 ; 0x3d 19b12: ae ae std Y+62, r10 ; 0x3e 19b14: bf ae std Y+63, r11 ; 0x3f 19b16: 25 97 sbiw r28, 0x05 ; 5 19b18: 0f b6 in r0, 0x3f ; 63 19b1a: f8 94 cli 19b1c: de bf out 0x3e, r29 ; 62 19b1e: 0f be out 0x3f, r0 ; 63 19b20: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 19b22: 20 e0 ldi r18, 0x00 ; 0 19b24: 30 e0 ldi r19, 0x00 ; 0 19b26: 48 e7 ldi r20, 0x78 ; 120 19b28: 51 e4 ldi r21, 0x41 ; 65 19b2a: 65 96 adiw r28, 0x15 ; 21 19b2c: 6c ad ldd r22, Y+60 ; 0x3c 19b2e: 7d ad ldd r23, Y+61 ; 0x3d 19b30: 8e ad ldd r24, Y+62 ; 0x3e 19b32: 9f ad ldd r25, Y+63 ; 0x3f 19b34: 65 97 sbiw r28, 0x15 ; 21 19b36: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19b3a: 20 e0 ldi r18, 0x00 ; 0 19b3c: 30 e0 ldi r19, 0x00 ; 0 19b3e: 40 e8 ldi r20, 0x80 ; 128 19b40: 52 e4 ldi r21, 0x42 ; 66 19b42: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19b46: 6b 01 movw r12, r22 19b48: 7c 01 movw r14, r24 19b4a: 6c 96 adiw r28, 0x1c ; 28 19b4c: ae ad ldd r26, Y+62 ; 0x3e 19b4e: bf ad ldd r27, Y+63 ; 0x3f 19b50: 6c 97 sbiw r28, 0x1c ; 28 19b52: bd 01 movw r22, r26 19b54: bb 0f add r27, r27 19b56: 88 0b sbc r24, r24 19b58: 99 0b sbc r25, r25 19b5a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 19b5e: 9b 01 movw r18, r22 19b60: ac 01 movw r20, r24 19b62: c7 01 movw r24, r14 19b64: b6 01 movw r22, r12 19b66: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19b6a: 6b 01 movw r12, r22 19b6c: 7c 01 movw r14, r24 19b6e: 65 96 adiw r28, 0x15 ; 21 19b70: cc ae std Y+60, r12 ; 0x3c 19b72: dd ae std Y+61, r13 ; 0x3d 19b74: ee ae std Y+62, r14 ; 0x3e 19b76: ff ae std Y+63, r15 ; 0x3f 19b78: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 19b7a: 20 e0 ldi r18, 0x00 ; 0 19b7c: 30 e0 ldi r19, 0x00 ; 0 19b7e: 48 e7 ldi r20, 0x78 ; 120 19b80: 51 e4 ldi r21, 0x41 ; 65 19b82: 25 96 adiw r28, 0x05 ; 5 19b84: 6c ad ldd r22, Y+60 ; 0x3c 19b86: 7d ad ldd r23, Y+61 ; 0x3d 19b88: 8e ad ldd r24, Y+62 ; 0x3e 19b8a: 9f ad ldd r25, Y+63 ; 0x3f 19b8c: 25 97 sbiw r28, 0x05 ; 5 19b8e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19b92: 20 e0 ldi r18, 0x00 ; 0 19b94: 30 e0 ldi r19, 0x00 ; 0 19b96: 40 e8 ldi r20, 0x80 ; 128 19b98: 52 e4 ldi r21, 0x42 ; 66 19b9a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19b9e: 4b 01 movw r8, r22 19ba0: 5c 01 movw r10, r24 19ba2: ac 96 adiw r28, 0x2c ; 44 19ba4: ee ad ldd r30, Y+62 ; 0x3e 19ba6: ff ad ldd r31, Y+63 ; 0x3f 19ba8: ac 97 sbiw r28, 0x2c ; 44 19baa: bf 01 movw r22, r30 19bac: ff 0f add r31, r31 19bae: 88 0b sbc r24, r24 19bb0: 99 0b sbc r25, r25 19bb2: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 19bb6: 9b 01 movw r18, r22 19bb8: ac 01 movw r20, r24 19bba: c5 01 movw r24, r10 19bbc: b4 01 movw r22, r8 19bbe: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19bc2: 25 96 adiw r28, 0x05 ; 5 19bc4: 6c af std Y+60, r22 ; 0x3c 19bc6: 7d af std Y+61, r23 ; 0x3d 19bc8: 8e af std Y+62, r24 ; 0x3e 19bca: 9f af std Y+63, r25 ; 0x3f 19bcc: 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; 19bce: 2a e0 ldi r18, 0x0A ; 10 19bd0: 37 ed ldi r19, 0xD7 ; 215 19bd2: 43 e2 ldi r20, 0x23 ; 35 19bd4: 5c e3 ldi r21, 0x3C ; 60 19bd6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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)); 19bda: 9f 93 push r25 19bdc: 8f 93 push r24 19bde: 7f 93 push r23 19be0: 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; 19be2: 2a e0 ldi r18, 0x0A ; 10 19be4: 37 ed ldi r19, 0xD7 ; 215 19be6: 43 e2 ldi r20, 0x23 ; 35 19be8: 5c e3 ldi r21, 0x3C ; 60 19bea: c7 01 movw r24, r14 19bec: b6 01 movw r22, r12 19bee: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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)); 19bf2: 9f 93 push r25 19bf4: 8f 93 push r24 19bf6: 7f 93 push r23 19bf8: 6f 93 push r22 19bfa: 8a e9 ldi r24, 0x9A ; 154 19bfc: 98 e8 ldi r25, 0x88 ; 136 19bfe: 9f 93 push r25 19c00: 8f 93 push r24 19c02: 0f 94 3f 9f call 0x33e7e ; 0x33e7e uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 19c06: 20 e0 ldi r18, 0x00 ; 0 19c08: 30 e0 ldi r19, 0x00 ; 0 19c0a: 40 e0 ldi r20, 0x00 ; 0 19c0c: 5f e3 ldi r21, 0x3F ; 63 19c0e: 25 96 adiw r28, 0x05 ; 5 19c10: 6c ad ldd r22, Y+60 ; 0x3c 19c12: 7d ad ldd r23, Y+61 ; 0x3d 19c14: 8e ad ldd r24, Y+62 ; 0x3e 19c16: 9f ad ldd r25, Y+63 ; 0x3f 19c18: 25 97 sbiw r28, 0x05 ; 5 19c1a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19c1e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 19c22: 6b 01 movw r12, r22 19c24: 20 e0 ldi r18, 0x00 ; 0 19c26: 30 e0 ldi r19, 0x00 ; 0 19c28: 40 e0 ldi r20, 0x00 ; 0 19c2a: 5f e3 ldi r21, 0x3F ; 63 19c2c: 65 96 adiw r28, 0x15 ; 21 19c2e: 6c ad ldd r22, Y+60 ; 0x3c 19c30: 7d ad ldd r23, Y+61 ; 0x3d 19c32: 8e ad ldd r24, Y+62 ; 0x3e 19c34: 9f ad ldd r25, Y+63 ; 0x3f 19c36: 65 97 sbiw r28, 0x15 ; 21 19c38: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19c3c: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 19c40: 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); 19c42: 00 e0 ldi r16, 0x00 ; 0 19c44: 28 ec ldi r18, 0xC8 ; 200 19c46: 30 e0 ldi r19, 0x00 ; 0 19c48: e7 96 adiw r28, 0x37 ; 55 19c4a: 4e ad ldd r20, Y+62 ; 0x3e 19c4c: 5f ad ldd r21, Y+63 ; 0x3f 19c4e: e7 97 sbiw r28, 0x37 ; 55 19c50: b6 01 movw r22, r12 19c52: 0e 94 cd c2 call 0x1859a ; 0x1859a 19c56: 0f b6 in r0, 0x3f ; 63 19c58: f8 94 cli 19c5a: de bf out 0x3e, r29 ; 62 19c5c: 0f be out 0x3f, r0 ; 63 19c5e: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 19c60: 10 e0 ldi r17, 0x00 ; 0 19c62: 88 ea ldi r24, 0xA8 ; 168 19c64: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 19c66: a4 96 adiw r28, 0x24 ; 36 19c68: ae ad ldd r26, Y+62 ; 0x3e 19c6a: bf ad ldd r27, Y+63 ; 0x3f 19c6c: a4 97 sbiw r28, 0x24 ; 36 19c6e: 1d 92 st X+, r1 19c70: a4 96 adiw r28, 0x24 ; 36 19c72: bf af std Y+63, r27 ; 0x3f 19c74: ae af std Y+62, r26 ; 0x3e 19c76: 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++) 19c78: 8a 17 cp r24, r26 19c7a: 9b 07 cpc r25, r27 19c7c: a1 f7 brne .-24 ; 0x19c66 19c7e: 76 cc rjmp .-1812 ; 0x1956c /// 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; 19c80: 1f ef ldi r17, 0xFF ; 255 19c82: ef cf rjmp .-34 ; 0x19c62 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; 19c84: e5 96 adiw r28, 0x35 ; 53 19c86: bf ad ldd r27, Y+63 ; 0x3f 19c88: e5 97 sbiw r28, 0x35 ; 53 19c8a: a7 96 adiw r28, 0x27 ; 39 19c8c: bf af std Y+63, r27 ; 0x3f 19c8e: a7 97 sbiw r28, 0x27 ; 39 19c90: 99 cc rjmp .-1742 ; 0x195c4 // 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; 19c92: af 96 adiw r28, 0x2f ; 47 19c94: 1f ae std Y+63, r1 ; 0x3f 19c96: af 97 sbiw r28, 0x2f ; 47 19c98: 62 cd rjmp .-1340 ; 0x1975e 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]) : 19c9a: f2 01 movw r30, r4 19c9c: 25 81 ldd r18, Z+5 ; 0x05 19c9e: 36 81 ldd r19, Z+6 ; 0x06 19ca0: 47 81 ldd r20, Z+7 ; 0x07 19ca2: 50 85 ldd r21, Z+8 ; 0x08 19ca4: c3 58 subi r28, 0x83 ; 131 19ca6: df 4f sbci r29, 0xFF ; 255 19ca8: 68 81 ld r22, Y 19caa: 79 81 ldd r23, Y+1 ; 0x01 19cac: 8a 81 ldd r24, Y+2 ; 0x02 19cae: 9b 81 ldd r25, Y+3 ; 0x03 19cb0: cd 57 subi r28, 0x7D ; 125 19cb2: d0 40 sbci r29, 0x00 ; 0 19cb4: 60 ce rjmp .-832 ; 0x19976 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 19cb6: 12 30 cpi r17, 0x02 ; 2 19cb8: 11 f0 breq .+4 ; 0x19cbe 19cba: 0c 94 34 d7 jmp 0x1ae68 ; 0x1ae68 19cbe: d2 01 movw r26, r4 19cc0: 11 96 adiw r26, 0x01 ; 1 19cc2: 2d 91 ld r18, X+ 19cc4: 3d 91 ld r19, X+ 19cc6: 4d 91 ld r20, X+ 19cc8: 5c 91 ld r21, X 19cca: 14 97 sbiw r26, 0x04 ; 4 19ccc: cf 57 subi r28, 0x7F ; 127 19cce: df 4f sbci r29, 0xFF ; 255 19cd0: 68 81 ld r22, Y 19cd2: 79 81 ldd r23, Y+1 ; 0x01 19cd4: 8a 81 ldd r24, Y+2 ; 0x02 19cd6: 9b 81 ldd r25, Y+3 ; 0x03 19cd8: c1 58 subi r28, 0x81 ; 129 19cda: d0 40 sbci r29, 0x00 ; 0 19cdc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 19ce0: 9b 01 movw r18, r22 19ce2: ac 01 movw r20, r24 19ce4: c5 01 movw r24, r10 19ce6: b4 01 movw r22, r8 19ce8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19cec: 9b 01 movw r18, r22 19cee: ac 01 movw r20, r24 19cf0: c7 01 movw r24, r14 19cf2: b6 01 movw r22, r12 19cf4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19cf8: 6b 01 movw r12, r22 19cfa: 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) { 19cfc: 01 11 cpse r16, r1 19cfe: 0c 94 41 d8 jmp 0x1b082 ; 0x1b082 19d02: 7a 94 dec r7 19d04: f8 e0 ldi r31, 0x08 ; 8 19d06: 4f 0e add r4, r31 19d08: 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) { 19d0a: 71 10 cpse r7, r1 19d0c: 16 ce rjmp .-980 ; 0x1993a (-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; 19d0e: d1 01 movw r26, r2 19d10: cd 92 st X+, r12 19d12: dd 92 st X+, r13 19d14: ed 92 st X+, r14 19d16: fd 92 st X+, r15 19d18: 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) { 19d1a: 1f 5f subi r17, 0xFF ; 255 19d1c: 14 30 cpi r17, 0x04 ; 4 19d1e: 09 f0 breq .+2 ; 0x19d22 19d20: 03 ce rjmp .-1018 ; 0x19928 19d22: 3f e4 ldi r19, 0x4F ; 79 19d24: 23 2e mov r2, r19 19d26: 39 e8 ldi r19, 0x89 ; 137 19d28: 33 2e mov r3, r19 19d2a: ec e9 ldi r30, 0x9C ; 156 19d2c: f2 e1 ldi r31, 0x12 ; 18 19d2e: a8 96 adiw r28, 0x28 ; 40 19d30: ff af std Y+63, r31 ; 0x3f 19d32: ee af std Y+62, r30 ; 0x3e 19d34: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 19d36: c3 57 subi r28, 0x73 ; 115 19d38: df 4f sbci r29, 0xFF ; 255 19d3a: 18 82 st Y, r1 19d3c: cd 58 subi r28, 0x8D ; 141 19d3e: d0 40 sbci r29, 0x00 ; 0 19d40: c3 56 subi r28, 0x63 ; 99 19d42: df 4f sbci r29, 0xFF ; 255 19d44: 18 82 st Y, r1 19d46: cd 59 subi r28, 0x9D ; 157 19d48: d0 40 sbci r29, 0x00 ; 0 19d4a: cf 55 subi r28, 0x5F ; 95 19d4c: df 4f sbci r29, 0xFF ; 255 19d4e: 18 82 st Y, r1 19d50: c1 5a subi r28, 0xA1 ; 161 19d52: d0 40 sbci r29, 0x00 ; 0 19d54: 10 e0 ldi r17, 0x00 ; 0 19d56: a8 96 adiw r28, 0x28 ; 40 19d58: ae ad ldd r26, Y+62 ; 0x3e 19d5a: bf ad ldd r27, Y+63 ; 0x3f 19d5c: a8 97 sbiw r28, 0x28 ; 40 19d5e: 11 96 adiw r26, 0x01 ; 1 19d60: 2d 91 ld r18, X+ 19d62: 3d 91 ld r19, X+ 19d64: 4d 91 ld r20, X+ 19d66: 5c 91 ld r21, X 19d68: 14 97 sbiw r26, 0x04 ; 4 19d6a: e4 96 adiw r28, 0x34 ; 52 19d6c: 2c af std Y+60, r18 ; 0x3c 19d6e: 3d af std Y+61, r19 ; 0x3d 19d70: 4e af std Y+62, r20 ; 0x3e 19d72: 5f af std Y+63, r21 ; 0x3f 19d74: e4 97 sbiw r28, 0x34 ; 52 19d76: 15 96 adiw r26, 0x05 ; 5 19d78: 4d 90 ld r4, X+ 19d7a: 5d 90 ld r5, X+ 19d7c: 6d 90 ld r6, X+ 19d7e: 7c 90 ld r7, X 19d80: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 19d82: 00 23 and r16, r16 19d84: 11 f4 brne .+4 ; 0x19d8a 19d86: 0c 94 67 d7 jmp 0x1aece ; 0x1aece ((r == 1) ? 0.f : 19d8a: 81 2c mov r8, r1 19d8c: 91 2c mov r9, r1 19d8e: 54 01 movw r10, r8 19d90: 01 30 cpi r16, 0x01 ; 1 19d92: 81 f0 breq .+32 ; 0x19db4 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19d94: 02 30 cpi r16, 0x02 ; 2 19d96: 11 f0 breq .+4 ; 0x19d9c 19d98: 0c 94 5b d7 jmp 0x1aeb6 ; 0x1aeb6 19d9c: cf 57 subi r28, 0x7F ; 127 19d9e: df 4f sbci r29, 0xFF ; 255 19da0: 68 81 ld r22, Y 19da2: 79 81 ldd r23, Y+1 ; 0x01 19da4: 8a 81 ldd r24, Y+2 ; 0x02 19da6: 9b 81 ldd r25, Y+3 ; 0x03 19da8: c1 58 subi r28, 0x81 ; 129 19daa: d0 40 sbci r29, 0x00 ; 0 19dac: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19db0: 4b 01 movw r8, r22 19db2: 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); 19db4: e4 96 adiw r28, 0x34 ; 52 19db6: 2c ad ldd r18, Y+60 ; 0x3c 19db8: 3d ad ldd r19, Y+61 ; 0x3d 19dba: 4e ad ldd r20, Y+62 ; 0x3e 19dbc: 5f ad ldd r21, Y+63 ; 0x3f 19dbe: e4 97 sbiw r28, 0x34 ; 52 19dc0: 6e 96 adiw r28, 0x1e ; 30 19dc2: 6c ad ldd r22, Y+60 ; 0x3c 19dc4: 7d ad ldd r23, Y+61 ; 0x3d 19dc6: 8e ad ldd r24, Y+62 ; 0x3e 19dc8: 9f ad ldd r25, Y+63 ; 0x3f 19dca: 6e 97 sbiw r28, 0x1e ; 30 19dcc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19dd0: 6b 01 movw r12, r22 19dd2: 7c 01 movw r14, r24 19dd4: f1 01 movw r30, r2 19dd6: 25 91 lpm r18, Z+ 19dd8: 35 91 lpm r19, Z+ 19dda: 45 91 lpm r20, Z+ 19ddc: 54 91 lpm r21, Z 19dde: cb 55 subi r28, 0x5B ; 91 19de0: df 4f sbci r29, 0xFF ; 255 19de2: 28 83 st Y, r18 19de4: 39 83 std Y+1, r19 ; 0x01 19de6: 4a 83 std Y+2, r20 ; 0x02 19de8: 5b 83 std Y+3, r21 ; 0x03 19dea: c5 5a subi r28, 0xA5 ; 165 19dec: d0 40 sbci r29, 0x00 ; 0 19dee: a3 01 movw r20, r6 19df0: 92 01 movw r18, r4 19df2: cb 56 subi r28, 0x6B ; 107 19df4: df 4f sbci r29, 0xFF ; 255 19df6: 68 81 ld r22, Y 19df8: 79 81 ldd r23, Y+1 ; 0x01 19dfa: 8a 81 ldd r24, Y+2 ; 0x02 19dfc: 9b 81 ldd r25, Y+3 ; 0x03 19dfe: c5 59 subi r28, 0x95 ; 149 19e00: d0 40 sbci r29, 0x00 ; 0 19e02: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19e06: 9b 01 movw r18, r22 19e08: ac 01 movw r20, r24 19e0a: c7 01 movw r24, r14 19e0c: b6 01 movw r22, r12 19e0e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 19e12: c5 55 subi r28, 0x55 ; 85 19e14: df 4f sbci r29, 0xFF ; 255 19e16: 28 81 ld r18, Y 19e18: 39 81 ldd r19, Y+1 ; 0x01 19e1a: 4a 81 ldd r20, Y+2 ; 0x02 19e1c: 5b 81 ldd r21, Y+3 ; 0x03 19e1e: cb 5a subi r28, 0xAB ; 171 19e20: d0 40 sbci r29, 0x00 ; 0 19e22: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19e26: cb 55 subi r28, 0x5B ; 91 19e28: df 4f sbci r29, 0xFF ; 255 19e2a: 28 81 ld r18, Y 19e2c: 39 81 ldd r19, Y+1 ; 0x01 19e2e: 4a 81 ldd r20, Y+2 ; 0x02 19e30: 5b 81 ldd r21, Y+3 ; 0x03 19e32: c5 5a subi r28, 0xA5 ; 165 19e34: d0 40 sbci r29, 0x00 ; 0 19e36: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 19e3a: a5 01 movw r20, r10 19e3c: 94 01 movw r18, r8 19e3e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19e42: c3 57 subi r28, 0x73 ; 115 19e44: df 4f sbci r29, 0xFF ; 255 19e46: 28 81 ld r18, Y 19e48: cd 58 subi r28, 0x8D ; 141 19e4a: d0 40 sbci r29, 0x00 ; 0 19e4c: c3 56 subi r28, 0x63 ; 99 19e4e: df 4f sbci r29, 0xFF ; 255 19e50: 38 81 ld r19, Y 19e52: cd 59 subi r28, 0x9D ; 157 19e54: d0 40 sbci r29, 0x00 ; 0 19e56: cf 55 subi r28, 0x5F ; 95 19e58: df 4f sbci r29, 0xFF ; 255 19e5a: 48 81 ld r20, Y 19e5c: c1 5a subi r28, 0xA1 ; 161 19e5e: d0 40 sbci r29, 0x00 ; 0 19e60: 51 2f mov r21, r17 19e62: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19e66: c3 57 subi r28, 0x73 ; 115 19e68: df 4f sbci r29, 0xFF ; 255 19e6a: 68 83 st Y, r22 19e6c: 79 83 std Y+1, r23 ; 0x01 19e6e: 8a 83 std Y+2, r24 ; 0x02 19e70: 9b 83 std Y+3, r25 ; 0x03 19e72: cd 58 subi r28, 0x8D ; 141 19e74: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 19e76: 00 23 and r16, r16 19e78: 11 f4 brne .+4 ; 0x19e7e 19e7a: 0c 94 6f d7 jmp 0x1aede ; 0x1aede ((r == 1) ? 1.f : 19e7e: 01 30 cpi r16, 0x01 ; 1 19e80: 11 f4 brne .+4 ; 0x19e86 19e82: 0c 94 74 d7 jmp 0x1aee8 ; 0x1aee8 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 19e86: 02 30 cpi r16, 0x02 ; 2 19e88: 61 f0 breq .+24 ; 0x19ea2 19e8a: a3 01 movw r20, r6 19e8c: 92 01 movw r18, r4 19e8e: ed 96 adiw r28, 0x3d ; 61 19e90: 6c ad ldd r22, Y+60 ; 0x3c 19e92: 7d ad ldd r23, Y+61 ; 0x3d 19e94: 8e ad ldd r24, Y+62 ; 0x3e 19e96: 9f ad ldd r25, Y+63 ; 0x3f 19e98: ed 97 sbiw r28, 0x3d ; 61 19e9a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19e9e: 6b 01 movw r12, r22 19ea0: 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); 19ea2: f1 01 movw r30, r2 19ea4: 34 96 adiw r30, 0x04 ; 4 19ea6: 85 90 lpm r8, Z+ 19ea8: 95 90 lpm r9, Z+ 19eaa: a5 90 lpm r10, Z+ 19eac: b4 90 lpm r11, Z 19eae: e4 96 adiw r28, 0x34 ; 52 19eb0: 2c ad ldd r18, Y+60 ; 0x3c 19eb2: 3d ad ldd r19, Y+61 ; 0x3d 19eb4: 4e ad ldd r20, Y+62 ; 0x3e 19eb6: 5f ad ldd r21, Y+63 ; 0x3f 19eb8: e4 97 sbiw r28, 0x34 ; 52 19eba: cb 57 subi r28, 0x7B ; 123 19ebc: df 4f sbci r29, 0xFF ; 255 19ebe: 68 81 ld r22, Y 19ec0: 79 81 ldd r23, Y+1 ; 0x01 19ec2: 8a 81 ldd r24, Y+2 ; 0x02 19ec4: 9b 81 ldd r25, Y+3 ; 0x03 19ec6: c5 58 subi r28, 0x85 ; 133 19ec8: d0 40 sbci r29, 0x00 ; 0 19eca: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19ece: e4 96 adiw r28, 0x34 ; 52 19ed0: 6c af std Y+60, r22 ; 0x3c 19ed2: 7d af std Y+61, r23 ; 0x3d 19ed4: 8e af std Y+62, r24 ; 0x3e 19ed6: 9f af std Y+63, r25 ; 0x3f 19ed8: e4 97 sbiw r28, 0x34 ; 52 19eda: a3 01 movw r20, r6 19edc: 92 01 movw r18, r4 19ede: c7 57 subi r28, 0x77 ; 119 19ee0: df 4f sbci r29, 0xFF ; 255 19ee2: 68 81 ld r22, Y 19ee4: 79 81 ldd r23, Y+1 ; 0x01 19ee6: 8a 81 ldd r24, Y+2 ; 0x02 19ee8: 9b 81 ldd r25, Y+3 ; 0x03 19eea: c9 58 subi r28, 0x89 ; 137 19eec: d0 40 sbci r29, 0x00 ; 0 19eee: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19ef2: 9b 01 movw r18, r22 19ef4: ac 01 movw r20, r24 19ef6: e4 96 adiw r28, 0x34 ; 52 19ef8: 6c ad ldd r22, Y+60 ; 0x3c 19efa: 7d ad ldd r23, Y+61 ; 0x3d 19efc: 8e ad ldd r24, Y+62 ; 0x3e 19efe: 9f ad ldd r25, Y+63 ; 0x3f 19f00: e4 97 sbiw r28, 0x34 ; 52 19f02: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19f06: c1 55 subi r28, 0x51 ; 81 19f08: df 4f sbci r29, 0xFF ; 255 19f0a: 28 81 ld r18, Y 19f0c: 39 81 ldd r19, Y+1 ; 0x01 19f0e: 4a 81 ldd r20, Y+2 ; 0x02 19f10: 5b 81 ldd r21, Y+3 ; 0x03 19f12: cf 5a subi r28, 0xAF ; 175 19f14: d0 40 sbci r29, 0x00 ; 0 19f16: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19f1a: a5 01 movw r20, r10 19f1c: 94 01 movw r18, r8 19f1e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 19f22: a7 01 movw r20, r14 19f24: 96 01 movw r18, r12 19f26: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 19f2a: c3 57 subi r28, 0x73 ; 115 19f2c: df 4f sbci r29, 0xFF ; 255 19f2e: 28 81 ld r18, Y 19f30: 39 81 ldd r19, Y+1 ; 0x01 19f32: 4a 81 ldd r20, Y+2 ; 0x02 19f34: 5b 81 ldd r21, Y+3 ; 0x03 19f36: cd 58 subi r28, 0x8D ; 141 19f38: d0 40 sbci r29, 0x00 ; 0 19f3a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 19f3e: c3 57 subi r28, 0x73 ; 115 19f40: df 4f sbci r29, 0xFF ; 255 19f42: 68 83 st Y, r22 19f44: cd 58 subi r28, 0x8D ; 141 19f46: d0 40 sbci r29, 0x00 ; 0 19f48: c3 56 subi r28, 0x63 ; 99 19f4a: df 4f sbci r29, 0xFF ; 255 19f4c: 78 83 st Y, r23 19f4e: cd 59 subi r28, 0x9D ; 157 19f50: d0 40 sbci r29, 0x00 ; 0 19f52: cf 55 subi r28, 0x5F ; 95 19f54: df 4f sbci r29, 0xFF ; 255 19f56: 88 83 st Y, r24 19f58: c1 5a subi r28, 0xA1 ; 161 19f5a: d0 40 sbci r29, 0x00 ; 0 19f5c: 19 2f mov r17, r25 19f5e: a8 96 adiw r28, 0x28 ; 40 19f60: 4e ad ldd r20, Y+62 ; 0x3e 19f62: 5f ad ldd r21, Y+63 ; 0x3f 19f64: a8 97 sbiw r28, 0x28 ; 40 19f66: 48 5f subi r20, 0xF8 ; 248 19f68: 5f 4f sbci r21, 0xFF ; 255 19f6a: a8 96 adiw r28, 0x28 ; 40 19f6c: 5f af std Y+63, r21 ; 0x3f 19f6e: 4e af std Y+62, r20 ; 0x3e 19f70: a8 97 sbiw r28, 0x28 ; 40 19f72: 58 e0 ldi r21, 0x08 ; 8 19f74: 25 0e add r2, r21 19f76: 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) { 19f78: ac eb ldi r26, 0xBC ; 188 19f7a: b2 e1 ldi r27, 0x12 ; 18 19f7c: a8 96 adiw r28, 0x28 ; 40 19f7e: ee ad ldd r30, Y+62 ; 0x3e 19f80: ff ad ldd r31, Y+63 ; 0x3f 19f82: a8 97 sbiw r28, 0x28 ; 40 19f84: ae 17 cp r26, r30 19f86: bf 07 cpc r27, r31 19f88: 09 f0 breq .+2 ; 0x19f8c 19f8a: e5 ce rjmp .-566 ; 0x19d56 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; 19f8c: 90 58 subi r25, 0x80 ; 128 19f8e: c7 56 subi r28, 0x67 ; 103 19f90: df 4f sbci r29, 0xFF ; 255 19f92: a8 81 ld r26, Y 19f94: b9 81 ldd r27, Y+1 ; 0x01 19f96: c9 59 subi r28, 0x99 ; 153 19f98: d0 40 sbci r29, 0x00 ; 0 19f9a: 6d 93 st X+, r22 19f9c: 7d 93 st X+, r23 19f9e: 8d 93 st X+, r24 19fa0: 9d 93 st X+, r25 19fa2: c7 56 subi r28, 0x67 ; 103 19fa4: df 4f sbci r29, 0xFF ; 255 19fa6: b9 83 std Y+1, r27 ; 0x01 19fa8: a8 83 st Y, r26 19faa: c9 59 subi r28, 0x99 ; 153 19fac: 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) { 19fae: 0f 5f subi r16, 0xFF ; 255 19fb0: ac 96 adiw r28, 0x2c ; 44 19fb2: ee ad ldd r30, Y+62 ; 0x3e 19fb4: ff ad ldd r31, Y+63 ; 0x3f 19fb6: ac 97 sbiw r28, 0x2c ; 44 19fb8: 70 96 adiw r30, 0x10 ; 16 19fba: ac 96 adiw r28, 0x2c ; 44 19fbc: ff af std Y+63, r31 ; 0x3f 19fbe: ee af std Y+62, r30 ; 0x3e 19fc0: ac 97 sbiw r28, 0x2c ; 44 19fc2: 04 30 cpi r16, 0x04 ; 4 19fc4: 09 f0 breq .+2 ; 0x19fc8 19fc6: ab cc rjmp .-1706 ; 0x1991e } // 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]; 19fc8: 25 96 adiw r28, 0x05 ; 5 19fca: 2c ad ldd r18, Y+60 ; 0x3c 19fcc: 3d ad ldd r19, Y+61 ; 0x3d 19fce: 4e ad ldd r20, Y+62 ; 0x3e 19fd0: 5f ad ldd r21, Y+63 ; 0x3f 19fd2: 25 97 sbiw r28, 0x05 ; 5 19fd4: ae 96 adiw r28, 0x2e ; 46 19fd6: 2c af std Y+60, r18 ; 0x3c 19fd8: 3d af std Y+61, r19 ; 0x3d 19fda: 4e af std Y+62, r20 ; 0x3e 19fdc: 5f af std Y+63, r21 ; 0x3f 19fde: ae 97 sbiw r28, 0x2e ; 46 19fe0: 8d 81 ldd r24, Y+5 ; 0x05 19fe2: 9e 81 ldd r25, Y+6 ; 0x06 19fe4: af 81 ldd r26, Y+7 ; 0x07 19fe6: b8 85 ldd r27, Y+8 ; 0x08 19fe8: e4 96 adiw r28, 0x34 ; 52 19fea: 8c af std Y+60, r24 ; 0x3c 19fec: 9d af std Y+61, r25 ; 0x3d 19fee: ae af std Y+62, r26 ; 0x3e 19ff0: bf af std Y+63, r27 ; 0x3f 19ff2: e4 97 sbiw r28, 0x34 ; 52 19ff4: 29 85 ldd r18, Y+9 ; 0x09 19ff6: 3a 85 ldd r19, Y+10 ; 0x0a 19ff8: 4b 85 ldd r20, Y+11 ; 0x0b 19ffa: 5c 85 ldd r21, Y+12 ; 0x0c 19ffc: ed 96 adiw r28, 0x3d ; 61 19ffe: 2c af std Y+60, r18 ; 0x3c 1a000: 3d af std Y+61, r19 ; 0x3d 1a002: 4e af std Y+62, r20 ; 0x3e 1a004: 5f af std Y+63, r21 ; 0x3f 1a006: ed 97 sbiw r28, 0x3d ; 61 1a008: 8d 85 ldd r24, Y+13 ; 0x0d 1a00a: 9e 85 ldd r25, Y+14 ; 0x0e 1a00c: af 85 ldd r26, Y+15 ; 0x0f 1a00e: b8 89 ldd r27, Y+16 ; 0x10 1a010: c3 58 subi r28, 0x83 ; 131 1a012: df 4f sbci r29, 0xFF ; 255 1a014: 88 83 st Y, r24 1a016: 99 83 std Y+1, r25 ; 0x01 1a018: aa 83 std Y+2, r26 ; 0x02 1a01a: bb 83 std Y+3, r27 ; 0x03 1a01c: cd 57 subi r28, 0x7D ; 125 1a01e: d0 40 sbci r29, 0x00 ; 0 1a020: 29 81 ldd r18, Y+1 ; 0x01 1a022: 3a 81 ldd r19, Y+2 ; 0x02 1a024: 4b 81 ldd r20, Y+3 ; 0x03 1a026: 5c 81 ldd r21, Y+4 ; 0x04 1a028: cf 57 subi r28, 0x7F ; 127 1a02a: df 4f sbci r29, 0xFF ; 255 1a02c: 28 83 st Y, r18 1a02e: 39 83 std Y+1, r19 ; 0x01 1a030: 4a 83 std Y+2, r20 ; 0x02 1a032: 5b 83 std Y+3, r21 ; 0x03 1a034: c1 58 subi r28, 0x81 ; 129 1a036: 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]; 1a038: 29 96 adiw r28, 0x09 ; 9 1a03a: 8c ad ldd r24, Y+60 ; 0x3c 1a03c: 9d ad ldd r25, Y+61 ; 0x3d 1a03e: ae ad ldd r26, Y+62 ; 0x3e 1a040: bf ad ldd r27, Y+63 ; 0x3f 1a042: 29 97 sbiw r28, 0x09 ; 9 1a044: cb 57 subi r28, 0x7B ; 123 1a046: df 4f sbci r29, 0xFF ; 255 1a048: 88 83 st Y, r24 1a04a: 99 83 std Y+1, r25 ; 0x01 1a04c: aa 83 std Y+2, r26 ; 0x02 1a04e: bb 83 std Y+3, r27 ; 0x03 1a050: c5 58 subi r28, 0x85 ; 133 1a052: d0 40 sbci r29, 0x00 ; 0 1a054: 29 89 ldd r18, Y+17 ; 0x11 1a056: 3a 89 ldd r19, Y+18 ; 0x12 1a058: 4b 89 ldd r20, Y+19 ; 0x13 1a05a: 5c 89 ldd r21, Y+20 ; 0x14 1a05c: c7 57 subi r28, 0x77 ; 119 1a05e: df 4f sbci r29, 0xFF ; 255 1a060: 28 83 st Y, r18 1a062: 39 83 std Y+1, r19 ; 0x01 1a064: 4a 83 std Y+2, r20 ; 0x02 1a066: 5b 83 std Y+3, r21 ; 0x03 1a068: c9 58 subi r28, 0x89 ; 137 1a06a: d0 40 sbci r29, 0x00 ; 0 1a06c: 89 8d ldd r24, Y+25 ; 0x19 1a06e: 9a 8d ldd r25, Y+26 ; 0x1a 1a070: ab 8d ldd r26, Y+27 ; 0x1b 1a072: bc 8d ldd r27, Y+28 ; 0x1c 1a074: cb 56 subi r28, 0x6B ; 107 1a076: df 4f sbci r29, 0xFF ; 255 1a078: 88 83 st Y, r24 1a07a: 99 83 std Y+1, r25 ; 0x01 1a07c: aa 83 std Y+2, r26 ; 0x02 1a07e: bb 83 std Y+3, r27 ; 0x03 1a080: c5 59 subi r28, 0x95 ; 149 1a082: d0 40 sbci r29, 0x00 ; 0 1a084: 2d 8d ldd r18, Y+29 ; 0x1d 1a086: 3e 8d ldd r19, Y+30 ; 0x1e 1a088: 4f 8d ldd r20, Y+31 ; 0x1f 1a08a: 58 a1 ldd r21, Y+32 ; 0x20 1a08c: c7 56 subi r28, 0x67 ; 103 1a08e: df 4f sbci r29, 0xFF ; 255 1a090: 28 83 st Y, r18 1a092: 39 83 std Y+1, r19 ; 0x01 1a094: 4a 83 std Y+2, r20 ; 0x02 1a096: 5b 83 std Y+3, r21 ; 0x03 1a098: c9 59 subi r28, 0x99 ; 153 1a09a: d0 40 sbci r29, 0x00 ; 0 1a09c: 8d 89 ldd r24, Y+21 ; 0x15 1a09e: 9e 89 ldd r25, Y+22 ; 0x16 1a0a0: af 89 ldd r26, Y+23 ; 0x17 1a0a2: b8 8d ldd r27, Y+24 ; 0x18 1a0a4: c3 57 subi r28, 0x73 ; 115 1a0a6: df 4f sbci r29, 0xFF ; 255 1a0a8: 88 83 st Y, r24 1a0aa: 99 83 std Y+1, r25 ; 0x01 1a0ac: aa 83 std Y+2, r26 ; 0x02 1a0ae: bb 83 std Y+3, r27 ; 0x03 1a0b0: cd 58 subi r28, 0x8D ; 141 1a0b2: 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]; 1a0b4: 2d 96 adiw r28, 0x0d ; 13 1a0b6: 2c ad ldd r18, Y+60 ; 0x3c 1a0b8: 3d ad ldd r19, Y+61 ; 0x3d 1a0ba: 4e ad ldd r20, Y+62 ; 0x3e 1a0bc: 5f ad ldd r21, Y+63 ; 0x3f 1a0be: 2d 97 sbiw r28, 0x0d ; 13 1a0c0: c3 56 subi r28, 0x63 ; 99 1a0c2: df 4f sbci r29, 0xFF ; 255 1a0c4: 28 83 st Y, r18 1a0c6: 39 83 std Y+1, r19 ; 0x01 1a0c8: 4a 83 std Y+2, r20 ; 0x02 1a0ca: 5b 83 std Y+3, r21 ; 0x03 1a0cc: cd 59 subi r28, 0x9D ; 157 1a0ce: d0 40 sbci r29, 0x00 ; 0 1a0d0: 89 a1 ldd r24, Y+33 ; 0x21 1a0d2: 9a a1 ldd r25, Y+34 ; 0x22 1a0d4: ab a1 ldd r26, Y+35 ; 0x23 1a0d6: bc a1 ldd r27, Y+36 ; 0x24 1a0d8: cf 55 subi r28, 0x5F ; 95 1a0da: df 4f sbci r29, 0xFF ; 255 1a0dc: 88 83 st Y, r24 1a0de: 99 83 std Y+1, r25 ; 0x01 1a0e0: aa 83 std Y+2, r26 ; 0x02 1a0e2: bb 83 std Y+3, r27 ; 0x03 1a0e4: c1 5a subi r28, 0xA1 ; 161 1a0e6: d0 40 sbci r29, 0x00 ; 0 1a0e8: 2d a1 ldd r18, Y+37 ; 0x25 1a0ea: 3e a1 ldd r19, Y+38 ; 0x26 1a0ec: 4f a1 ldd r20, Y+39 ; 0x27 1a0ee: 58 a5 ldd r21, Y+40 ; 0x28 1a0f0: cb 55 subi r28, 0x5B ; 91 1a0f2: df 4f sbci r29, 0xFF ; 255 1a0f4: 28 83 st Y, r18 1a0f6: 39 83 std Y+1, r19 ; 0x01 1a0f8: 4a 83 std Y+2, r20 ; 0x02 1a0fa: 5b 83 std Y+3, r21 ; 0x03 1a0fc: c5 5a subi r28, 0xA5 ; 165 1a0fe: d0 40 sbci r29, 0x00 ; 0 1a100: 8d a5 ldd r24, Y+45 ; 0x2d 1a102: 9e a5 ldd r25, Y+46 ; 0x2e 1a104: af a5 ldd r26, Y+47 ; 0x2f 1a106: b8 a9 ldd r27, Y+48 ; 0x30 1a108: cd 54 subi r28, 0x4D ; 77 1a10a: df 4f sbci r29, 0xFF ; 255 1a10c: 88 83 st Y, r24 1a10e: 99 83 std Y+1, r25 ; 0x01 1a110: aa 83 std Y+2, r26 ; 0x02 1a112: bb 83 std Y+3, r27 ; 0x03 1a114: c3 5b subi r28, 0xB3 ; 179 1a116: d0 40 sbci r29, 0x00 ; 0 1a118: 29 a5 ldd r18, Y+41 ; 0x29 1a11a: 3a a5 ldd r19, Y+42 ; 0x2a 1a11c: 4b a5 ldd r20, Y+43 ; 0x2b 1a11e: 5c a5 ldd r21, Y+44 ; 0x2c 1a120: c9 54 subi r28, 0x49 ; 73 1a122: df 4f sbci r29, 0xFF ; 255 1a124: 28 83 st Y, r18 1a126: 39 83 std Y+1, r19 ; 0x01 1a128: 4a 83 std Y+2, r20 ; 0x02 1a12a: 5b 83 std Y+3, r21 ; 0x03 1a12c: c7 5b subi r28, 0xB7 ; 183 1a12e: 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]; 1a130: 61 96 adiw r28, 0x11 ; 17 1a132: 8c ad ldd r24, Y+60 ; 0x3c 1a134: 9d ad ldd r25, Y+61 ; 0x3d 1a136: ae ad ldd r26, Y+62 ; 0x3e 1a138: bf ad ldd r27, Y+63 ; 0x3f 1a13a: 61 97 sbiw r28, 0x11 ; 17 1a13c: c5 54 subi r28, 0x45 ; 69 1a13e: df 4f sbci r29, 0xFF ; 255 1a140: 88 83 st Y, r24 1a142: 99 83 std Y+1, r25 ; 0x01 1a144: aa 83 std Y+2, r26 ; 0x02 1a146: bb 83 std Y+3, r27 ; 0x03 1a148: cb 5b subi r28, 0xBB ; 187 1a14a: d0 40 sbci r29, 0x00 ; 0 1a14c: 29 a9 ldd r18, Y+49 ; 0x31 1a14e: 3a a9 ldd r19, Y+50 ; 0x32 1a150: 4b a9 ldd r20, Y+51 ; 0x33 1a152: 5c a9 ldd r21, Y+52 ; 0x34 1a154: c1 54 subi r28, 0x41 ; 65 1a156: df 4f sbci r29, 0xFF ; 255 1a158: 28 83 st Y, r18 1a15a: 39 83 std Y+1, r19 ; 0x01 1a15c: 4a 83 std Y+2, r20 ; 0x02 1a15e: 5b 83 std Y+3, r21 ; 0x03 1a160: cf 5b subi r28, 0xBF ; 191 1a162: d0 40 sbci r29, 0x00 ; 0 1a164: 8d a9 ldd r24, Y+53 ; 0x35 1a166: 9e a9 ldd r25, Y+54 ; 0x36 1a168: af a9 ldd r26, Y+55 ; 0x37 1a16a: b8 ad ldd r27, Y+56 ; 0x38 1a16c: cd 53 subi r28, 0x3D ; 61 1a16e: df 4f sbci r29, 0xFF ; 255 1a170: 88 83 st Y, r24 1a172: 99 83 std Y+1, r25 ; 0x01 1a174: aa 83 std Y+2, r26 ; 0x02 1a176: bb 83 std Y+3, r27 ; 0x03 1a178: c3 5c subi r28, 0xC3 ; 195 1a17a: d0 40 sbci r29, 0x00 ; 0 1a17c: 29 ad ldd r18, Y+57 ; 0x39 1a17e: 3a ad ldd r19, Y+58 ; 0x3a 1a180: 4b ad ldd r20, Y+59 ; 0x3b 1a182: 5c ad ldd r21, Y+60 ; 0x3c 1a184: c9 53 subi r28, 0x39 ; 57 1a186: df 4f sbci r29, 0xFF ; 255 1a188: 28 83 st Y, r18 1a18a: 39 83 std Y+1, r19 ; 0x01 1a18c: 4a 83 std Y+2, r20 ; 0x02 1a18e: 5b 83 std Y+3, r21 ; 0x03 1a190: c7 5c subi r28, 0xC7 ; 199 1a192: d0 40 sbci r29, 0x00 ; 0 1a194: 21 96 adiw r28, 0x01 ; 1 1a196: 8c ad ldd r24, Y+60 ; 0x3c 1a198: 9d ad ldd r25, Y+61 ; 0x3d 1a19a: ae ad ldd r26, Y+62 ; 0x3e 1a19c: bf ad ldd r27, Y+63 ; 0x3f 1a19e: 21 97 sbiw r28, 0x01 ; 1 1a1a0: c5 53 subi r28, 0x35 ; 53 1a1a2: df 4f sbci r29, 0xFF ; 255 1a1a4: 88 83 st Y, r24 1a1a6: 99 83 std Y+1, r25 ; 0x01 1a1a8: aa 83 std Y+2, r26 ; 0x02 1a1aa: bb 83 std Y+3, r27 ; 0x03 1a1ac: cb 5c subi r28, 0xCB ; 203 1a1ae: d0 40 sbci r29, 0x00 ; 0 1a1b0: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1a1b2: c1 2c mov r12, r1 1a1b4: d1 2c mov r13, r1 1a1b6: 76 01 movw r14, r12 1a1b8: 46 01 movw r8, r12 1a1ba: 57 01 movw r10, r14 1a1bc: 26 01 movw r4, r12 1a1be: 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]; 1a1c0: a3 01 movw r20, r6 1a1c2: 92 01 movw r18, r4 1a1c4: e4 96 adiw r28, 0x34 ; 52 1a1c6: 6c ad ldd r22, Y+60 ; 0x3c 1a1c8: 7d ad ldd r23, Y+61 ; 0x3d 1a1ca: 8e ad ldd r24, Y+62 ; 0x3e 1a1cc: 9f ad ldd r25, Y+63 ; 0x3f 1a1ce: e4 97 sbiw r28, 0x34 ; 52 1a1d0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a1d4: 9b 01 movw r18, r22 1a1d6: ac 01 movw r20, r24 1a1d8: ae 96 adiw r28, 0x2e ; 46 1a1da: 6c ad ldd r22, Y+60 ; 0x3c 1a1dc: 7d ad ldd r23, Y+61 ; 0x3d 1a1de: 8e ad ldd r24, Y+62 ; 0x3e 1a1e0: 9f ad ldd r25, Y+63 ; 0x3f 1a1e2: ae 97 sbiw r28, 0x2e ; 46 1a1e4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a1e8: 2b 01 movw r4, r22 1a1ea: 3c 01 movw r6, r24 1a1ec: a5 01 movw r20, r10 1a1ee: 94 01 movw r18, r8 1a1f0: ed 96 adiw r28, 0x3d ; 61 1a1f2: 6c ad ldd r22, Y+60 ; 0x3c 1a1f4: 7d ad ldd r23, Y+61 ; 0x3d 1a1f6: 8e ad ldd r24, Y+62 ; 0x3e 1a1f8: 9f ad ldd r25, Y+63 ; 0x3f 1a1fa: ed 97 sbiw r28, 0x3d ; 61 1a1fc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a200: 9b 01 movw r18, r22 1a202: ac 01 movw r20, r24 1a204: c3 01 movw r24, r6 1a206: b2 01 movw r22, r4 1a208: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a20c: 2b 01 movw r4, r22 1a20e: 3c 01 movw r6, r24 1a210: a7 01 movw r20, r14 1a212: 96 01 movw r18, r12 1a214: c3 58 subi r28, 0x83 ; 131 1a216: df 4f sbci r29, 0xFF ; 255 1a218: 68 81 ld r22, Y 1a21a: 79 81 ldd r23, Y+1 ; 0x01 1a21c: 8a 81 ldd r24, Y+2 ; 0x02 1a21e: 9b 81 ldd r25, Y+3 ; 0x03 1a220: cd 57 subi r28, 0x7D ; 125 1a222: d0 40 sbci r29, 0x00 ; 0 1a224: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a228: 9b 01 movw r18, r22 1a22a: ac 01 movw r20, r24 1a22c: c3 01 movw r24, r6 1a22e: b2 01 movw r22, r4 1a230: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a234: cf 57 subi r28, 0x7F ; 127 1a236: df 4f sbci r29, 0xFF ; 255 1a238: 28 81 ld r18, Y 1a23a: 39 81 ldd r19, Y+1 ; 0x01 1a23c: 4a 81 ldd r20, Y+2 ; 0x02 1a23e: 5b 81 ldd r21, Y+3 ; 0x03 1a240: c1 58 subi r28, 0x81 ; 129 1a242: d0 40 sbci r29, 0x00 ; 0 1a244: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1a248: 6e 96 adiw r28, 0x1e ; 30 1a24a: 6c af std Y+60, r22 ; 0x3c 1a24c: 7d af std Y+61, r23 ; 0x3d 1a24e: 8e af std Y+62, r24 ; 0x3e 1a250: 9f af std Y+63, r25 ; 0x3f 1a252: 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]; 1a254: c7 57 subi r28, 0x77 ; 119 1a256: df 4f sbci r29, 0xFF ; 255 1a258: 28 81 ld r18, Y 1a25a: 39 81 ldd r19, Y+1 ; 0x01 1a25c: 4a 81 ldd r20, Y+2 ; 0x02 1a25e: 5b 81 ldd r21, Y+3 ; 0x03 1a260: c9 58 subi r28, 0x89 ; 137 1a262: d0 40 sbci r29, 0x00 ; 0 1a264: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a268: 9b 01 movw r18, r22 1a26a: ac 01 movw r20, r24 1a26c: cb 57 subi r28, 0x7B ; 123 1a26e: df 4f sbci r29, 0xFF ; 255 1a270: 68 81 ld r22, Y 1a272: 79 81 ldd r23, Y+1 ; 0x01 1a274: 8a 81 ldd r24, Y+2 ; 0x02 1a276: 9b 81 ldd r25, Y+3 ; 0x03 1a278: c5 58 subi r28, 0x85 ; 133 1a27a: d0 40 sbci r29, 0x00 ; 0 1a27c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a280: 2b 01 movw r4, r22 1a282: 3c 01 movw r6, r24 1a284: a5 01 movw r20, r10 1a286: 94 01 movw r18, r8 1a288: cb 56 subi r28, 0x6B ; 107 1a28a: df 4f sbci r29, 0xFF ; 255 1a28c: 68 81 ld r22, Y 1a28e: 79 81 ldd r23, Y+1 ; 0x01 1a290: 8a 81 ldd r24, Y+2 ; 0x02 1a292: 9b 81 ldd r25, Y+3 ; 0x03 1a294: c5 59 subi r28, 0x95 ; 149 1a296: d0 40 sbci r29, 0x00 ; 0 1a298: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a29c: 9b 01 movw r18, r22 1a29e: ac 01 movw r20, r24 1a2a0: c3 01 movw r24, r6 1a2a2: b2 01 movw r22, r4 1a2a4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a2a8: 4b 01 movw r8, r22 1a2aa: 5c 01 movw r10, r24 1a2ac: a7 01 movw r20, r14 1a2ae: 96 01 movw r18, r12 1a2b0: c7 56 subi r28, 0x67 ; 103 1a2b2: df 4f sbci r29, 0xFF ; 255 1a2b4: 68 81 ld r22, Y 1a2b6: 79 81 ldd r23, Y+1 ; 0x01 1a2b8: 8a 81 ldd r24, Y+2 ; 0x02 1a2ba: 9b 81 ldd r25, Y+3 ; 0x03 1a2bc: c9 59 subi r28, 0x99 ; 153 1a2be: d0 40 sbci r29, 0x00 ; 0 1a2c0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a2c4: 9b 01 movw r18, r22 1a2c6: ac 01 movw r20, r24 1a2c8: c5 01 movw r24, r10 1a2ca: b4 01 movw r22, r8 1a2cc: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a2d0: c3 57 subi r28, 0x73 ; 115 1a2d2: df 4f sbci r29, 0xFF ; 255 1a2d4: 28 81 ld r18, Y 1a2d6: 39 81 ldd r19, Y+1 ; 0x01 1a2d8: 4a 81 ldd r20, Y+2 ; 0x02 1a2da: 5b 81 ldd r21, Y+3 ; 0x03 1a2dc: cd 58 subi r28, 0x8D ; 141 1a2de: d0 40 sbci r29, 0x00 ; 0 1a2e0: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1a2e4: 2b 01 movw r4, r22 1a2e6: 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]; 1a2e8: cf 55 subi r28, 0x5F ; 95 1a2ea: df 4f sbci r29, 0xFF ; 255 1a2ec: 28 81 ld r18, Y 1a2ee: 39 81 ldd r19, Y+1 ; 0x01 1a2f0: 4a 81 ldd r20, Y+2 ; 0x02 1a2f2: 5b 81 ldd r21, Y+3 ; 0x03 1a2f4: c1 5a subi r28, 0xA1 ; 161 1a2f6: d0 40 sbci r29, 0x00 ; 0 1a2f8: 6e 96 adiw r28, 0x1e ; 30 1a2fa: 6c ad ldd r22, Y+60 ; 0x3c 1a2fc: 7d ad ldd r23, Y+61 ; 0x3d 1a2fe: 8e ad ldd r24, Y+62 ; 0x3e 1a300: 9f ad ldd r25, Y+63 ; 0x3f 1a302: 6e 97 sbiw r28, 0x1e ; 30 1a304: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a308: 9b 01 movw r18, r22 1a30a: ac 01 movw r20, r24 1a30c: c3 56 subi r28, 0x63 ; 99 1a30e: df 4f sbci r29, 0xFF ; 255 1a310: 68 81 ld r22, Y 1a312: 79 81 ldd r23, Y+1 ; 0x01 1a314: 8a 81 ldd r24, Y+2 ; 0x02 1a316: 9b 81 ldd r25, Y+3 ; 0x03 1a318: cd 59 subi r28, 0x9D ; 157 1a31a: d0 40 sbci r29, 0x00 ; 0 1a31c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a320: 4b 01 movw r8, r22 1a322: 5c 01 movw r10, r24 1a324: cb 55 subi r28, 0x5B ; 91 1a326: df 4f sbci r29, 0xFF ; 255 1a328: 28 81 ld r18, Y 1a32a: 39 81 ldd r19, Y+1 ; 0x01 1a32c: 4a 81 ldd r20, Y+2 ; 0x02 1a32e: 5b 81 ldd r21, Y+3 ; 0x03 1a330: c5 5a subi r28, 0xA5 ; 165 1a332: d0 40 sbci r29, 0x00 ; 0 1a334: c3 01 movw r24, r6 1a336: b2 01 movw r22, r4 1a338: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a33c: 9b 01 movw r18, r22 1a33e: ac 01 movw r20, r24 1a340: c5 01 movw r24, r10 1a342: b4 01 movw r22, r8 1a344: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a348: 4b 01 movw r8, r22 1a34a: 5c 01 movw r10, r24 1a34c: a7 01 movw r20, r14 1a34e: 96 01 movw r18, r12 1a350: cd 54 subi r28, 0x4D ; 77 1a352: df 4f sbci r29, 0xFF ; 255 1a354: 68 81 ld r22, Y 1a356: 79 81 ldd r23, Y+1 ; 0x01 1a358: 8a 81 ldd r24, Y+2 ; 0x02 1a35a: 9b 81 ldd r25, Y+3 ; 0x03 1a35c: c3 5b subi r28, 0xB3 ; 179 1a35e: d0 40 sbci r29, 0x00 ; 0 1a360: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a364: 9b 01 movw r18, r22 1a366: ac 01 movw r20, r24 1a368: c5 01 movw r24, r10 1a36a: b4 01 movw r22, r8 1a36c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a370: c9 54 subi r28, 0x49 ; 73 1a372: df 4f sbci r29, 0xFF ; 255 1a374: 28 81 ld r18, Y 1a376: 39 81 ldd r19, Y+1 ; 0x01 1a378: 4a 81 ldd r20, Y+2 ; 0x02 1a37a: 5b 81 ldd r21, Y+3 ; 0x03 1a37c: c7 5b subi r28, 0xB7 ; 183 1a37e: d0 40 sbci r29, 0x00 ; 0 1a380: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1a384: 4b 01 movw r8, r22 1a386: 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]; 1a388: c1 54 subi r28, 0x41 ; 65 1a38a: df 4f sbci r29, 0xFF ; 255 1a38c: 28 81 ld r18, Y 1a38e: 39 81 ldd r19, Y+1 ; 0x01 1a390: 4a 81 ldd r20, Y+2 ; 0x02 1a392: 5b 81 ldd r21, Y+3 ; 0x03 1a394: cf 5b subi r28, 0xBF ; 191 1a396: d0 40 sbci r29, 0x00 ; 0 1a398: 6e 96 adiw r28, 0x1e ; 30 1a39a: 6c ad ldd r22, Y+60 ; 0x3c 1a39c: 7d ad ldd r23, Y+61 ; 0x3d 1a39e: 8e ad ldd r24, Y+62 ; 0x3e 1a3a0: 9f ad ldd r25, Y+63 ; 0x3f 1a3a2: 6e 97 sbiw r28, 0x1e ; 30 1a3a4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a3a8: 9b 01 movw r18, r22 1a3aa: ac 01 movw r20, r24 1a3ac: c5 54 subi r28, 0x45 ; 69 1a3ae: df 4f sbci r29, 0xFF ; 255 1a3b0: 68 81 ld r22, Y 1a3b2: 79 81 ldd r23, Y+1 ; 0x01 1a3b4: 8a 81 ldd r24, Y+2 ; 0x02 1a3b6: 9b 81 ldd r25, Y+3 ; 0x03 1a3b8: cb 5b subi r28, 0xBB ; 187 1a3ba: d0 40 sbci r29, 0x00 ; 0 1a3bc: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a3c0: 6b 01 movw r12, r22 1a3c2: 7c 01 movw r14, r24 1a3c4: cd 53 subi r28, 0x3D ; 61 1a3c6: df 4f sbci r29, 0xFF ; 255 1a3c8: 28 81 ld r18, Y 1a3ca: 39 81 ldd r19, Y+1 ; 0x01 1a3cc: 4a 81 ldd r20, Y+2 ; 0x02 1a3ce: 5b 81 ldd r21, Y+3 ; 0x03 1a3d0: c3 5c subi r28, 0xC3 ; 195 1a3d2: d0 40 sbci r29, 0x00 ; 0 1a3d4: c3 01 movw r24, r6 1a3d6: b2 01 movw r22, r4 1a3d8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a3dc: 9b 01 movw r18, r22 1a3de: ac 01 movw r20, r24 1a3e0: c7 01 movw r24, r14 1a3e2: b6 01 movw r22, r12 1a3e4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a3e8: 6b 01 movw r12, r22 1a3ea: 7c 01 movw r14, r24 1a3ec: c9 53 subi r28, 0x39 ; 57 1a3ee: df 4f sbci r29, 0xFF ; 255 1a3f0: 28 81 ld r18, Y 1a3f2: 39 81 ldd r19, Y+1 ; 0x01 1a3f4: 4a 81 ldd r20, Y+2 ; 0x02 1a3f6: 5b 81 ldd r21, Y+3 ; 0x03 1a3f8: c7 5c subi r28, 0xC7 ; 199 1a3fa: d0 40 sbci r29, 0x00 ; 0 1a3fc: c5 01 movw r24, r10 1a3fe: b4 01 movw r22, r8 1a400: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a404: 9b 01 movw r18, r22 1a406: ac 01 movw r20, r24 1a408: c7 01 movw r24, r14 1a40a: b6 01 movw r22, r12 1a40c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a410: c5 53 subi r28, 0x35 ; 53 1a412: df 4f sbci r29, 0xFF ; 255 1a414: 28 81 ld r18, Y 1a416: 39 81 ldd r19, Y+1 ; 0x01 1a418: 4a 81 ldd r20, Y+2 ; 0x02 1a41a: 5b 81 ldd r21, Y+3 ; 0x03 1a41c: cb 5c subi r28, 0xCB ; 203 1a41e: d0 40 sbci r29, 0x00 ; 0 1a420: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1a424: 6b 01 movw r12, r22 1a426: 7c 01 movw r14, r24 1a428: 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) { 1a42a: 09 f0 breq .+2 ; 0x1a42e 1a42c: c9 ce rjmp .-622 ; 0x1a1c0 // 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]; 1a42e: 6e 96 adiw r28, 0x1e ; 30 1a430: 2c ad ldd r18, Y+60 ; 0x3c 1a432: 3d ad ldd r19, Y+61 ; 0x3d 1a434: 4e ad ldd r20, Y+62 ; 0x3e 1a436: 5f ad ldd r21, Y+63 ; 0x3f 1a438: 6e 97 sbiw r28, 0x1e ; 30 1a43a: c5 55 subi r28, 0x55 ; 85 1a43c: df 4f sbci r29, 0xFF ; 255 1a43e: 68 81 ld r22, Y 1a440: 79 81 ldd r23, Y+1 ; 0x01 1a442: 8a 81 ldd r24, Y+2 ; 0x02 1a444: 9b 81 ldd r25, Y+3 ; 0x03 1a446: cb 5a subi r28, 0xAB ; 171 1a448: d0 40 sbci r29, 0x00 ; 0 1a44a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a44e: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1a452: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1a456: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1a45a: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] += h[1]; 1a45e: a3 01 movw r20, r6 1a460: 92 01 movw r18, r4 1a462: c1 55 subi r28, 0x51 ; 81 1a464: df 4f sbci r29, 0xFF ; 255 1a466: 68 81 ld r22, Y 1a468: 79 81 ldd r23, Y+1 ; 0x01 1a46a: 8a 81 ldd r24, Y+2 ; 0x02 1a46c: 9b 81 ldd r25, Y+3 ; 0x03 1a46e: cf 5a subi r28, 0xAF ; 175 1a470: d0 40 sbci r29, 0x00 ; 0 1a472: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a476: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1a47a: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1a47e: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1a482: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 a1 += h[2]; 1a486: a5 01 movw r20, r10 1a488: 94 01 movw r18, r8 1a48a: a6 96 adiw r28, 0x26 ; 38 1a48c: 6c ad ldd r22, Y+60 ; 0x3c 1a48e: 7d ad ldd r23, Y+61 ; 0x3d 1a490: 8e ad ldd r24, Y+62 ; 0x3e 1a492: 9f ad ldd r25, Y+63 ; 0x3f 1a494: a6 97 sbiw r28, 0x26 ; 38 1a496: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a49a: a6 96 adiw r28, 0x26 ; 38 1a49c: 6c af std Y+60, r22 ; 0x3c 1a49e: 7d af std Y+61, r23 ; 0x3d 1a4a0: 8e af std Y+62, r24 ; 0x3e 1a4a2: 9f af std Y+63, r25 ; 0x3f 1a4a4: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1a4a6: a7 01 movw r20, r14 1a4a8: 96 01 movw r18, r12 1a4aa: a2 96 adiw r28, 0x22 ; 34 1a4ac: 6c ad ldd r22, Y+60 ; 0x3c 1a4ae: 7d ad ldd r23, Y+61 ; 0x3d 1a4b0: 8e ad ldd r24, Y+62 ; 0x3e 1a4b2: 9f ad ldd r25, Y+63 ; 0x3f 1a4b4: a2 97 sbiw r28, 0x22 ; 34 1a4b6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a4ba: a2 96 adiw r28, 0x22 ; 34 1a4bc: 6c af std Y+60, r22 ; 0x3c 1a4be: 7d af std Y+61, r23 ; 0x3d 1a4c0: 8e af std Y+62, r24 ; 0x3e 1a4c2: 9f af std Y+63, r25 ; 0x3f 1a4c4: a2 97 sbiw r28, 0x22 ; 34 1a4c6: e6 96 adiw r28, 0x36 ; 54 1a4c8: 9f ad ldd r25, Y+63 ; 0x3f 1a4ca: e6 97 sbiw r28, 0x36 ; 54 1a4cc: 91 50 subi r25, 0x01 ; 1 1a4ce: e6 96 adiw r28, 0x36 ; 54 1a4d0: 9f af std Y+63, r25 ; 0x3f 1a4d2: 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) { 1a4d4: 91 11 cpse r25, r1 1a4d6: 70 c9 rjmp .-3360 ; 0x197b8 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a4d8: a6 96 adiw r28, 0x26 ; 38 1a4da: 6c ad ldd r22, Y+60 ; 0x3c 1a4dc: 7d ad ldd r23, Y+61 ; 0x3d 1a4de: 8e ad ldd r24, Y+62 ; 0x3e 1a4e0: 9f ad ldd r25, Y+63 ; 0x3f 1a4e2: a6 97 sbiw r28, 0x26 ; 38 1a4e4: 0f 94 9f a2 call 0x3453e ; 0x3453e 1a4e8: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a4ec: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a4f0: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a4f4: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a4f8: a6 96 adiw r28, 0x26 ; 38 1a4fa: 6c ad ldd r22, Y+60 ; 0x3c 1a4fc: 7d ad ldd r23, Y+61 ; 0x3d 1a4fe: 8e ad ldd r24, Y+62 ; 0x3e 1a500: 9f ad ldd r25, Y+63 ; 0x3f 1a502: a6 97 sbiw r28, 0x26 ; 38 1a504: 0f 94 65 a5 call 0x34aca ; 0x34aca 1a508: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a50c: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a510: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a514: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1a518: a2 96 adiw r28, 0x22 ; 34 1a51a: 6c ad ldd r22, Y+60 ; 0x3c 1a51c: 7d ad ldd r23, Y+61 ; 0x3d 1a51e: 8e ad ldd r24, Y+62 ; 0x3e 1a520: 9f ad ldd r25, Y+63 ; 0x3f 1a522: a2 97 sbiw r28, 0x22 ; 34 1a524: 0f 94 65 a5 call 0x34aca ; 0x34aca 1a528: 90 58 subi r25, 0x80 ; 128 1a52a: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 1a52e: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 1a532: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 1a536: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1a53a: a2 96 adiw r28, 0x22 ; 34 1a53c: 6c ad ldd r22, Y+60 ; 0x3c 1a53e: 7d ad ldd r23, Y+61 ; 0x3d 1a540: 8e ad ldd r24, Y+62 ; 0x3e 1a542: 9f ad ldd r25, Y+63 ; 0x3f 1a544: a2 97 sbiw r28, 0x22 ; 34 1a546: 0f 94 9f a2 call 0x3453e ; 0x3453e 1a54a: 60 93 c9 12 sts 0x12C9, r22 ; 0x8012c9 1a54e: 70 93 ca 12 sts 0x12CA, r23 ; 0x8012ca 1a552: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb 1a556: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1a55a: a6 96 adiw r28, 0x26 ; 38 1a55c: 2c ad ldd r18, Y+60 ; 0x3c 1a55e: 3d ad ldd r19, Y+61 ; 0x3d 1a560: 4e ad ldd r20, Y+62 ; 0x3e 1a562: 5f ad ldd r21, Y+63 ; 0x3f 1a564: a6 97 sbiw r28, 0x26 ; 38 1a566: a2 96 adiw r28, 0x22 ; 34 1a568: 6c ad ldd r22, Y+60 ; 0x3c 1a56a: 7d ad ldd r23, Y+61 ; 0x3d 1a56c: 8e ad ldd r24, Y+62 ; 0x3e 1a56e: 9f ad ldd r25, Y+63 ; 0x3f 1a570: a2 97 sbiw r28, 0x22 ; 34 1a572: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a576: 4b 01 movw r8, r22 1a578: 5c 01 movw r10, r24 1a57a: 7c 01 movw r14, r24 1a57c: 6b 01 movw r12, r22 1a57e: e8 94 clt 1a580: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1a582: 21 ee ldi r18, 0xE1 ; 225 1a584: 3e e2 ldi r19, 0x2E ; 46 1a586: 45 e6 ldi r20, 0x65 ; 101 1a588: 52 e4 ldi r21, 0x42 ; 66 1a58a: a2 96 adiw r28, 0x22 ; 34 1a58c: 6c ad ldd r22, Y+60 ; 0x3c 1a58e: 7d ad ldd r23, Y+61 ; 0x3d 1a590: 8e ad ldd r24, Y+62 ; 0x3e 1a592: 9f ad ldd r25, Y+63 ; 0x3f 1a594: a2 97 sbiw r28, 0x22 ; 34 1a596: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a59a: 9f 93 push r25 1a59c: 8f 93 push r24 1a59e: 7f 93 push r23 1a5a0: 6f 93 push r22 1a5a2: 21 ee ldi r18, 0xE1 ; 225 1a5a4: 3e e2 ldi r19, 0x2E ; 46 1a5a6: 45 e6 ldi r20, 0x65 ; 101 1a5a8: 52 e4 ldi r21, 0x42 ; 66 1a5aa: c5 01 movw r24, r10 1a5ac: b4 01 movw r22, r8 1a5ae: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a5b2: 9f 93 push r25 1a5b4: 8f 93 push r24 1a5b6: 7f 93 push r23 1a5b8: 6f 93 push r22 1a5ba: 81 ee ldi r24, 0xE1 ; 225 1a5bc: 99 e6 ldi r25, 0x69 ; 105 1a5be: 9f 93 push r25 1a5c0: 8f 93 push r24 1a5c2: 0f 94 3f 9f call 0x33e7e ; 0x33e7e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1a5c6: b7 01 movw r22, r14 1a5c8: a6 01 movw r20, r12 1a5ca: 80 e6 ldi r24, 0x60 ; 96 1a5cc: 9f e0 ldi r25, 0x0F ; 15 1a5ce: 0f 94 b3 a0 call 0x34166 ; 0x34166 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) 1a5d2: 0f b6 in r0, 0x3f ; 63 1a5d4: f8 94 cli 1a5d6: de bf out 0x3e, r29 ; 62 1a5d8: 0f be out 0x3f, r0 ; 63 1a5da: cd bf out 0x3d, r28 ; 61 1a5dc: 2f e1 ldi r18, 0x1F ; 31 1a5de: 32 e4 ldi r19, 0x42 ; 66 1a5e0: 49 e0 ldi r20, 0x09 ; 9 1a5e2: 5b e3 ldi r21, 0x3B ; 59 1a5e4: c7 01 movw r24, r14 1a5e6: b6 01 movw r22, r12 1a5e8: 0f 94 2e a4 call 0x3485c ; 0x3485c <__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; 1a5ec: 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) 1a5ee: 18 16 cp r1, r24 1a5f0: 64 f4 brge .+24 ; 0x1a60a result = (angleDiff > bed_skew_angle_extreme) ? 1a5f2: 25 e3 ldi r18, 0x35 ; 53 1a5f4: 3a ef ldi r19, 0xFA ; 250 1a5f6: 4e e8 ldi r20, 0x8E ; 142 1a5f8: 5b e3 ldi r21, 0x3B ; 59 1a5fa: c7 01 movw r24, r14 1a5fc: b6 01 movw r22, r12 1a5fe: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1a602: 12 e0 ldi r17, 0x02 ; 2 1a604: 18 16 cp r1, r24 1a606: 0c f0 brlt .+2 ; 0x1a60a 1a608: 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 || 1a60a: 25 e3 ldi r18, 0x35 ; 53 1a60c: 3a ef ldi r19, 0xFA ; 250 1a60e: 4e e8 ldi r20, 0x8E ; 142 1a610: 5b e3 ldi r21, 0x3B ; 59 1a612: a6 96 adiw r28, 0x26 ; 38 1a614: 6c ad ldd r22, Y+60 ; 0x3c 1a616: 7d ad ldd r23, Y+61 ; 0x3d 1a618: 8e ad ldd r24, Y+62 ; 0x3e 1a61a: 9f ad ldd r25, Y+63 ; 0x3f 1a61c: a6 97 sbiw r28, 0x26 ; 38 1a61e: 9f 77 andi r25, 0x7F ; 127 1a620: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1a624: 18 16 cp r1, r24 1a626: 0c f4 brge .+2 ; 0x1a62a 1a628: 67 c4 rjmp .+2254 ; 0x1aef8 1a62a: 25 e3 ldi r18, 0x35 ; 53 1a62c: 3a ef ldi r19, 0xFA ; 250 1a62e: 4e e8 ldi r20, 0x8E ; 142 1a630: 5b e3 ldi r21, 0x3B ; 59 1a632: a2 96 adiw r28, 0x22 ; 34 1a634: 6c ad ldd r22, Y+60 ; 0x3c 1a636: 7d ad ldd r23, Y+61 ; 0x3d 1a638: 8e ad ldd r24, Y+62 ; 0x3e 1a63a: 9f ad ldd r25, Y+63 ; 0x3f 1a63c: a2 97 sbiw r28, 0x22 ; 34 1a63e: 9f 77 andi r25, 0x7F ; 127 1a640: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1a644: 18 16 cp r1, r24 1a646: 0c f4 brge .+2 ; 0x1a64a 1a648: 57 c4 rjmp .+2222 ; 0x1aef8 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]; 1a64a: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 1a64e: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 1a652: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf 1a656: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 1a65a: ae 96 adiw r28, 0x2e ; 46 1a65c: 2c af std Y+60, r18 ; 0x3c 1a65e: 3d af std Y+61, r19 ; 0x3d 1a660: 4e af std Y+62, r20 ; 0x3e 1a662: 5f af std Y+63, r21 ; 0x3f 1a664: ae 97 sbiw r28, 0x2e ; 46 1a666: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1a66a: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1a66e: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1a672: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1a676: e9 96 adiw r28, 0x39 ; 57 1a678: 8c af std Y+60, r24 ; 0x3c 1a67a: 9d af std Y+61, r25 ; 0x3d 1a67c: ae af std Y+62, r26 ; 0x3e 1a67e: bf af std Y+63, r27 ; 0x3f 1a680: e9 97 sbiw r28, 0x39 ; 57 1a682: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a686: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a68a: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a68e: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a692: e4 96 adiw r28, 0x34 ; 52 1a694: 2c af std Y+60, r18 ; 0x3c 1a696: 3d af std Y+61, r19 ; 0x3d 1a698: 4e af std Y+62, r20 ; 0x3e 1a69a: 5f af std Y+63, r21 ; 0x3f 1a69c: 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]; 1a69e: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 1a6a2: 90 91 c2 12 lds r25, 0x12C2 ; 0x8012c2 1a6a6: a0 91 c3 12 lds r26, 0x12C3 ; 0x8012c3 1a6aa: b0 91 c4 12 lds r27, 0x12C4 ; 0x8012c4 1a6ae: ed 96 adiw r28, 0x3d ; 61 1a6b0: 8c af std Y+60, r24 ; 0x3c 1a6b2: 9d af std Y+61, r25 ; 0x3d 1a6b4: ae af std Y+62, r26 ; 0x3e 1a6b6: bf af std Y+63, r27 ; 0x3f 1a6b8: ed 97 sbiw r28, 0x3d ; 61 1a6ba: 20 91 c9 12 lds r18, 0x12C9 ; 0x8012c9 1a6be: 30 91 ca 12 lds r19, 0x12CA ; 0x8012ca 1a6c2: 40 91 cb 12 lds r20, 0x12CB ; 0x8012cb 1a6c6: 50 91 cc 12 lds r21, 0x12CC ; 0x8012cc 1a6ca: c3 58 subi r28, 0x83 ; 131 1a6cc: df 4f sbci r29, 0xFF ; 255 1a6ce: 28 83 st Y, r18 1a6d0: 39 83 std Y+1, r19 ; 0x01 1a6d2: 4a 83 std Y+2, r20 ; 0x02 1a6d4: 5b 83 std Y+3, r21 ; 0x03 1a6d6: cd 57 subi r28, 0x7D ; 125 1a6d8: d0 40 sbci r29, 0x00 ; 0 1a6da: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1a6de: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1a6e2: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 1a6e6: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 1a6ea: cf 57 subi r28, 0x7F ; 127 1a6ec: df 4f sbci r29, 0xFF ; 255 1a6ee: 88 83 st Y, r24 1a6f0: 99 83 std Y+1, r25 ; 0x01 1a6f2: aa 83 std Y+2, r26 ; 0x02 1a6f4: bb 83 std Y+3, r27 ; 0x03 1a6f6: c1 58 subi r28, 0x81 ; 129 1a6f8: d0 40 sbci r29, 0x00 ; 0 1a6fa: af e4 ldi r26, 0x4F ; 79 1a6fc: b9 e8 ldi r27, 0x89 ; 137 1a6fe: 6c 96 adiw r28, 0x1c ; 28 1a700: bf af std Y+63, r27 ; 0x3f 1a702: ae af std Y+62, r26 ; 0x3e 1a704: 6c 97 sbiw r28, 0x1c ; 28 1a706: 8c e9 ldi r24, 0x9C ; 156 1a708: 28 2e mov r2, r24 1a70a: 82 e1 ldi r24, 0x12 ; 18 1a70c: 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]; 1a70e: f1 01 movw r30, r2 1a710: c1 80 ldd r12, Z+1 ; 0x01 1a712: d2 80 ldd r13, Z+2 ; 0x02 1a714: e3 80 ldd r14, Z+3 ; 0x03 1a716: f4 80 ldd r15, Z+4 ; 0x04 1a718: 45 80 ldd r4, Z+5 ; 0x05 1a71a: 56 80 ldd r5, Z+6 ; 0x06 1a71c: 67 80 ldd r6, Z+7 ; 0x07 1a71e: 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; 1a720: 6c 96 adiw r28, 0x1c ; 28 1a722: ee ad ldd r30, Y+62 ; 0x3e 1a724: ff ad ldd r31, Y+63 ; 0x3f 1a726: 6c 97 sbiw r28, 0x1c ; 28 1a728: 25 91 lpm r18, Z+ 1a72a: 35 91 lpm r19, Z+ 1a72c: 45 91 lpm r20, Z+ 1a72e: 54 91 lpm r21, Z 1a730: cb 57 subi r28, 0x7B ; 123 1a732: df 4f sbci r29, 0xFF ; 255 1a734: 28 83 st Y, r18 1a736: 39 83 std Y+1, r19 ; 0x01 1a738: 4a 83 std Y+2, r20 ; 0x02 1a73a: 5b 83 std Y+3, r21 ; 0x03 1a73c: c5 58 subi r28, 0x85 ; 133 1a73e: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1a740: 6c 96 adiw r28, 0x1c ; 28 1a742: ee ad ldd r30, Y+62 ; 0x3e 1a744: ff ad ldd r31, Y+63 ; 0x3f 1a746: 6c 97 sbiw r28, 0x1c ; 28 1a748: 34 96 adiw r30, 0x04 ; 4 1a74a: 85 90 lpm r8, Z+ 1a74c: 95 90 lpm r9, Z+ 1a74e: a5 90 lpm r10, Z+ 1a750: 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]; 1a752: ed 96 adiw r28, 0x3d ; 61 1a754: 2c ad ldd r18, Y+60 ; 0x3c 1a756: 3d ad ldd r19, Y+61 ; 0x3d 1a758: 4e ad ldd r20, Y+62 ; 0x3e 1a75a: 5f ad ldd r21, Y+63 ; 0x3f 1a75c: ed 97 sbiw r28, 0x3d ; 61 1a75e: c7 01 movw r24, r14 1a760: b6 01 movw r22, r12 1a762: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a766: c7 57 subi r28, 0x77 ; 119 1a768: df 4f sbci r29, 0xFF ; 255 1a76a: 68 83 st Y, r22 1a76c: 79 83 std Y+1, r23 ; 0x01 1a76e: 8a 83 std Y+2, r24 ; 0x02 1a770: 9b 83 std Y+3, r25 ; 0x03 1a772: c9 58 subi r28, 0x89 ; 137 1a774: d0 40 sbci r29, 0x00 ; 0 1a776: c3 58 subi r28, 0x83 ; 131 1a778: df 4f sbci r29, 0xFF ; 255 1a77a: 28 81 ld r18, Y 1a77c: 39 81 ldd r19, Y+1 ; 0x01 1a77e: 4a 81 ldd r20, Y+2 ; 0x02 1a780: 5b 81 ldd r21, Y+3 ; 0x03 1a782: cd 57 subi r28, 0x7D ; 125 1a784: d0 40 sbci r29, 0x00 ; 0 1a786: c3 01 movw r24, r6 1a788: b2 01 movw r22, r4 1a78a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a78e: 9b 01 movw r18, r22 1a790: ac 01 movw r20, r24 1a792: c7 57 subi r28, 0x77 ; 119 1a794: df 4f sbci r29, 0xFF ; 255 1a796: 68 81 ld r22, Y 1a798: 79 81 ldd r23, Y+1 ; 0x01 1a79a: 8a 81 ldd r24, Y+2 ; 0x02 1a79c: 9b 81 ldd r25, Y+3 ; 0x03 1a79e: c9 58 subi r28, 0x89 ; 137 1a7a0: d0 40 sbci r29, 0x00 ; 0 1a7a2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a7a6: cf 57 subi r28, 0x7F ; 127 1a7a8: df 4f sbci r29, 0xFF ; 255 1a7aa: 28 81 ld r18, Y 1a7ac: 39 81 ldd r19, Y+1 ; 0x01 1a7ae: 4a 81 ldd r20, Y+2 ; 0x02 1a7b0: 5b 81 ldd r21, Y+3 ; 0x03 1a7b2: c1 58 subi r28, 0x81 ; 129 1a7b4: d0 40 sbci r29, 0x00 ; 0 1a7b6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a7ba: 9b 01 movw r18, r22 1a7bc: 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; 1a7be: c5 01 movw r24, r10 1a7c0: b4 01 movw r22, r8 1a7c2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a7c6: 4b 01 movw r8, r22 1a7c8: 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]; 1a7ca: a7 01 movw r20, r14 1a7cc: 96 01 movw r18, r12 1a7ce: ae 96 adiw r28, 0x2e ; 46 1a7d0: 6c ad ldd r22, Y+60 ; 0x3c 1a7d2: 7d ad ldd r23, Y+61 ; 0x3d 1a7d4: 8e ad ldd r24, Y+62 ; 0x3e 1a7d6: 9f ad ldd r25, Y+63 ; 0x3f 1a7d8: ae 97 sbiw r28, 0x2e ; 46 1a7da: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a7de: 6b 01 movw r12, r22 1a7e0: 7c 01 movw r14, r24 1a7e2: a3 01 movw r20, r6 1a7e4: 92 01 movw r18, r4 1a7e6: e9 96 adiw r28, 0x39 ; 57 1a7e8: 6c ad ldd r22, Y+60 ; 0x3c 1a7ea: 7d ad ldd r23, Y+61 ; 0x3d 1a7ec: 8e ad ldd r24, Y+62 ; 0x3e 1a7ee: 9f ad ldd r25, Y+63 ; 0x3f 1a7f0: e9 97 sbiw r28, 0x39 ; 57 1a7f2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a7f6: 9b 01 movw r18, r22 1a7f8: ac 01 movw r20, r24 1a7fa: c7 01 movw r24, r14 1a7fc: b6 01 movw r22, r12 1a7fe: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a802: e4 96 adiw r28, 0x34 ; 52 1a804: 2c ad ldd r18, Y+60 ; 0x3c 1a806: 3d ad ldd r19, Y+61 ; 0x3d 1a808: 4e ad ldd r20, Y+62 ; 0x3e 1a80a: 5f ad ldd r21, Y+63 ; 0x3f 1a80c: e4 97 sbiw r28, 0x34 ; 52 1a80e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a812: 9b 01 movw r18, r22 1a814: 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; 1a816: cb 57 subi r28, 0x7B ; 123 1a818: df 4f sbci r29, 0xFF ; 255 1a81a: 68 81 ld r22, Y 1a81c: 79 81 ldd r23, Y+1 ; 0x01 1a81e: 8a 81 ldd r24, Y+2 ; 0x02 1a820: 9b 81 ldd r25, Y+3 ; 0x03 1a822: c5 58 subi r28, 0x85 ; 133 1a824: d0 40 sbci r29, 0x00 ; 0 1a826: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1a82a: a5 01 movw r20, r10 1a82c: 94 01 movw r18, r8 1a82e: 0f 94 41 a4 call 0x34882 ; 0x34882 } 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) { 1a832: 2d ec ldi r18, 0xCD ; 205 1a834: 3c ec ldi r19, 0xCC ; 204 1a836: 4c e4 ldi r20, 0x4C ; 76 1a838: 5f e3 ldi r21, 0x3F ; 63 1a83a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1a83e: 18 16 cp r1, r24 1a840: 0c f4 brge .+2 ; 0x1a844 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1a842: 1e ef ldi r17, 0xFE ; 254 1a844: 38 e0 ldi r19, 0x08 ; 8 1a846: 23 0e add r2, r19 1a848: 31 1c adc r3, r1 1a84a: 6c 96 adiw r28, 0x1c ; 28 1a84c: 4e ad ldd r20, Y+62 ; 0x3e 1a84e: 5f ad ldd r21, Y+63 ; 0x3f 1a850: 6c 97 sbiw r28, 0x1c ; 28 1a852: 48 5f subi r20, 0xF8 ; 248 1a854: 5f 4f sbci r21, 0xFF ; 255 1a856: 6c 96 adiw r28, 0x1c ; 28 1a858: 5f af std Y+63, r21 ; 0x3f 1a85a: 4e af std Y+62, r20 ; 0x3e 1a85c: 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) { 1a85e: a8 96 adiw r28, 0x28 ; 40 1a860: 8e ad ldd r24, Y+62 ; 0x3e 1a862: 9f ad ldd r25, Y+63 ; 0x3f 1a864: a8 97 sbiw r28, 0x28 ; 40 1a866: 82 15 cp r24, r2 1a868: 93 05 cpc r25, r3 1a86a: 09 f0 breq .+2 ; 0x1a86e 1a86c: 50 cf rjmp .-352 ; 0x1a70e MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1a86e: 11 11 cpse r17, r1 1a870: 62 c1 rjmp .+708 ; 0x1ab36 #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); 1a872: a2 96 adiw r28, 0x22 ; 34 1a874: 2c ad ldd r18, Y+60 ; 0x3c 1a876: 3d ad ldd r19, Y+61 ; 0x3d 1a878: 4e ad ldd r20, Y+62 ; 0x3e 1a87a: 5f ad ldd r21, Y+63 ; 0x3f 1a87c: a2 97 sbiw r28, 0x22 ; 34 1a87e: a6 96 adiw r28, 0x26 ; 38 1a880: 6c ad ldd r22, Y+60 ; 0x3c 1a882: 7d ad ldd r23, Y+61 ; 0x3d 1a884: 8e ad ldd r24, Y+62 ; 0x3e 1a886: 9f ad ldd r25, Y+63 ; 0x3f 1a888: a6 97 sbiw r28, 0x26 ; 38 1a88a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a88e: 20 e0 ldi r18, 0x00 ; 0 1a890: 30 e0 ldi r19, 0x00 ; 0 1a892: 40 e0 ldi r20, 0x00 ; 0 1a894: 5f e3 ldi r21, 0x3F ; 63 1a896: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a89a: 6b 01 movw r12, r22 1a89c: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a89e: 0f 94 9f a2 call 0x3453e ; 0x3453e 1a8a2: a2 96 adiw r28, 0x22 ; 34 1a8a4: 6c af std Y+60, r22 ; 0x3c 1a8a6: 7d af std Y+61, r23 ; 0x3d 1a8a8: 8e af std Y+62, r24 ; 0x3e 1a8aa: 9f af std Y+63, r25 ; 0x3f 1a8ac: a2 97 sbiw r28, 0x22 ; 34 1a8ae: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a8b2: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a8b6: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a8ba: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a8be: c7 01 movw r24, r14 1a8c0: b6 01 movw r22, r12 1a8c2: 0f 94 65 a5 call 0x34aca ; 0x34aca 1a8c6: a6 96 adiw r28, 0x26 ; 38 1a8c8: 6c af std Y+60, r22 ; 0x3c 1a8ca: 7d af std Y+61, r23 ; 0x3d 1a8cc: 8e af std Y+62, r24 ; 0x3e 1a8ce: 9f af std Y+63, r25 ; 0x3f 1a8d0: a6 97 sbiw r28, 0x26 ; 38 1a8d2: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a8d6: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a8da: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a8de: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1a8e2: 9b 01 movw r18, r22 1a8e4: ac 01 movw r20, r24 1a8e6: 50 58 subi r21, 0x80 ; 128 1a8e8: aa 96 adiw r28, 0x2a ; 42 1a8ea: 2c af std Y+60, r18 ; 0x3c 1a8ec: 3d af std Y+61, r19 ; 0x3d 1a8ee: 4e af std Y+62, r20 ; 0x3e 1a8f0: 5f af std Y+63, r21 ; 0x3f 1a8f2: aa 97 sbiw r28, 0x2a ; 42 1a8f4: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1a8f8: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1a8fc: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1a900: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1a904: a2 96 adiw r28, 0x22 ; 34 1a906: 8c ad ldd r24, Y+60 ; 0x3c 1a908: 9d ad ldd r25, Y+61 ; 0x3d 1a90a: ae ad ldd r26, Y+62 ; 0x3e 1a90c: bf ad ldd r27, Y+63 ; 0x3f 1a90e: a2 97 sbiw r28, 0x22 ; 34 1a910: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 1a914: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca 1a918: a0 93 cb 12 sts 0x12CB, r26 ; 0x8012cb 1a91c: b0 93 cc 12 sts 0x12CC, r27 ; 0x8012cc // Refresh the offset. cntr[0] = 0.f; 1a920: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1a924: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 1a928: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 1a92c: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1a930: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1a934: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 1a938: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 1a93c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 float wx = 0.f; 1a940: 41 2c mov r4, r1 1a942: 51 2c mov r5, r1 1a944: 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]; 1a946: cf 56 subi r28, 0x6F ; 111 1a948: df 4f sbci r29, 0xFF ; 255 1a94a: a8 81 ld r26, Y 1a94c: b9 81 ldd r27, Y+1 ; 0x01 1a94e: c1 59 subi r28, 0x91 ; 145 1a950: d0 40 sbci r29, 0x00 ; 0 1a952: 11 96 adiw r26, 0x01 ; 1 1a954: 8d 90 ld r8, X+ 1a956: 9d 90 ld r9, X+ 1a958: ad 90 ld r10, X+ 1a95a: bc 90 ld r11, X 1a95c: 14 97 sbiw r26, 0x04 ; 4 1a95e: 15 96 adiw r26, 0x05 ; 5 1a960: 2d 91 ld r18, X+ 1a962: 3d 91 ld r19, X+ 1a964: 4d 91 ld r20, X+ 1a966: 5c 91 ld r21, X 1a968: 18 97 sbiw r26, 0x08 ; 8 1a96a: 6e 96 adiw r28, 0x1e ; 30 1a96c: 2c af std Y+60, r18 ; 0x3c 1a96e: 3d af std Y+61, r19 ; 0x3d 1a970: 4e af std Y+62, r20 ; 0x3e 1a972: 5f af std Y+63, r21 ; 0x3f 1a974: 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); 1a976: cd 56 subi r28, 0x6D ; 109 1a978: df 4f sbci r29, 0xFF ; 255 1a97a: e8 81 ld r30, Y 1a97c: f9 81 ldd r31, Y+1 ; 0x01 1a97e: c3 59 subi r28, 0x93 ; 147 1a980: d0 40 sbci r29, 0x00 ; 0 1a982: c5 90 lpm r12, Z+ 1a984: d5 90 lpm r13, Z+ 1a986: e5 90 lpm r14, Z+ 1a988: 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]; 1a98a: a5 01 movw r20, r10 1a98c: 94 01 movw r18, r8 1a98e: a2 96 adiw r28, 0x22 ; 34 1a990: 6c ad ldd r22, Y+60 ; 0x3c 1a992: 7d ad ldd r23, Y+61 ; 0x3d 1a994: 8e ad ldd r24, Y+62 ; 0x3e 1a996: 9f ad ldd r25, Y+63 ; 0x3f 1a998: a2 97 sbiw r28, 0x22 ; 34 1a99a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a99e: ae 96 adiw r28, 0x2e ; 46 1a9a0: 6c af std Y+60, r22 ; 0x3c 1a9a2: 7d af std Y+61, r23 ; 0x3d 1a9a4: 8e af std Y+62, r24 ; 0x3e 1a9a6: 9f af std Y+63, r25 ; 0x3f 1a9a8: ae 97 sbiw r28, 0x2e ; 46 1a9aa: 6e 96 adiw r28, 0x1e ; 30 1a9ac: 2c ad ldd r18, Y+60 ; 0x3c 1a9ae: 3d ad ldd r19, Y+61 ; 0x3d 1a9b0: 4e ad ldd r20, Y+62 ; 0x3e 1a9b2: 5f ad ldd r21, Y+63 ; 0x3f 1a9b4: 6e 97 sbiw r28, 0x1e ; 30 1a9b6: aa 96 adiw r28, 0x2a ; 42 1a9b8: 6c ad ldd r22, Y+60 ; 0x3c 1a9ba: 7d ad ldd r23, Y+61 ; 0x3d 1a9bc: 8e ad ldd r24, Y+62 ; 0x3e 1a9be: 9f ad ldd r25, Y+63 ; 0x3f 1a9c0: aa 97 sbiw r28, 0x2a ; 42 1a9c2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1a9c6: 9b 01 movw r18, r22 1a9c8: ac 01 movw r20, r24 1a9ca: ae 96 adiw r28, 0x2e ; 46 1a9cc: 6c ad ldd r22, Y+60 ; 0x3c 1a9ce: 7d ad ldd r23, Y+61 ; 0x3d 1a9d0: 8e ad ldd r24, Y+62 ; 0x3e 1a9d2: 9f ad ldd r25, Y+63 ; 0x3f 1a9d4: ae 97 sbiw r28, 0x2e ; 46 1a9d6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a9da: 9b 01 movw r18, r22 1a9dc: 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); 1a9de: c7 01 movw r24, r14 1a9e0: b6 01 movw r22, r12 1a9e2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1a9e6: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a9ea: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a9ee: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a9f2: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a9f6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1a9fa: 6b 01 movw r12, r22 1a9fc: 7c 01 movw r14, r24 1a9fe: c0 92 cd 12 sts 0x12CD, r12 ; 0x8012cd 1aa02: d0 92 ce 12 sts 0x12CE, r13 ; 0x8012ce 1aa06: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf 1aa0a: f0 92 d0 12 sts 0x12D0, r15 ; 0x8012d0 wx += w; 1aa0e: 20 e0 ldi r18, 0x00 ; 0 1aa10: 30 e0 ldi r19, 0x00 ; 0 1aa12: 40 e8 ldi r20, 0x80 ; 128 1aa14: 5f e3 ldi r21, 0x3F ; 63 1aa16: c3 01 movw r24, r6 1aa18: b2 01 movw r22, r4 1aa1a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1aa1e: 2b 01 movw r4, r22 1aa20: 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); 1aa22: cd 56 subi r28, 0x6D ; 109 1aa24: df 4f sbci r29, 0xFF ; 255 1aa26: e8 81 ld r30, Y 1aa28: f9 81 ldd r31, Y+1 ; 0x01 1aa2a: c3 59 subi r28, 0x93 ; 147 1aa2c: d0 40 sbci r29, 0x00 ; 0 1aa2e: 34 96 adiw r30, 0x04 ; 4 1aa30: 25 91 lpm r18, Z+ 1aa32: 35 91 lpm r19, Z+ 1aa34: 45 91 lpm r20, Z+ 1aa36: 54 91 lpm r21, Z 1aa38: ae 96 adiw r28, 0x2e ; 46 1aa3a: 2c af std Y+60, r18 ; 0x3c 1aa3c: 3d af std Y+61, r19 ; 0x3d 1aa3e: 4e af std Y+62, r20 ; 0x3e 1aa40: 5f af std Y+63, r21 ; 0x3f 1aa42: 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]; 1aa44: a5 01 movw r20, r10 1aa46: 94 01 movw r18, r8 1aa48: a6 96 adiw r28, 0x26 ; 38 1aa4a: 6c ad ldd r22, Y+60 ; 0x3c 1aa4c: 7d ad ldd r23, Y+61 ; 0x3d 1aa4e: 8e ad ldd r24, Y+62 ; 0x3e 1aa50: 9f ad ldd r25, Y+63 ; 0x3f 1aa52: a6 97 sbiw r28, 0x26 ; 38 1aa54: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1aa58: 4b 01 movw r8, r22 1aa5a: 5c 01 movw r10, r24 1aa5c: 6e 96 adiw r28, 0x1e ; 30 1aa5e: 2c ad ldd r18, Y+60 ; 0x3c 1aa60: 3d ad ldd r19, Y+61 ; 0x3d 1aa62: 4e ad ldd r20, Y+62 ; 0x3e 1aa64: 5f ad ldd r21, Y+63 ; 0x3f 1aa66: 6e 97 sbiw r28, 0x1e ; 30 1aa68: a2 96 adiw r28, 0x22 ; 34 1aa6a: 6c ad ldd r22, Y+60 ; 0x3c 1aa6c: 7d ad ldd r23, Y+61 ; 0x3d 1aa6e: 8e ad ldd r24, Y+62 ; 0x3e 1aa70: 9f ad ldd r25, Y+63 ; 0x3f 1aa72: a2 97 sbiw r28, 0x22 ; 34 1aa74: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1aa78: 9b 01 movw r18, r22 1aa7a: ac 01 movw r20, r24 1aa7c: c5 01 movw r24, r10 1aa7e: b4 01 movw r22, r8 1aa80: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1aa84: 9b 01 movw r18, r22 1aa86: 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); 1aa88: ae 96 adiw r28, 0x2e ; 46 1aa8a: 6c ad ldd r22, Y+60 ; 0x3c 1aa8c: 7d ad ldd r23, Y+61 ; 0x3d 1aa8e: 8e ad ldd r24, Y+62 ; 0x3e 1aa90: 9f ad ldd r25, Y+63 ; 0x3f 1aa92: ae 97 sbiw r28, 0x2e ; 46 1aa94: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1aa98: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1aa9c: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1aaa0: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1aaa4: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1aaa8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1aaac: 4b 01 movw r8, r22 1aaae: 5c 01 movw r10, r24 1aab0: 80 92 d1 12 sts 0x12D1, r8 ; 0x8012d1 1aab4: 90 92 d2 12 sts 0x12D2, r9 ; 0x8012d2 1aab8: a0 92 d3 12 sts 0x12D3, r10 ; 0x8012d3 1aabc: b0 92 d4 12 sts 0x12D4, r11 ; 0x8012d4 1aac0: cf 56 subi r28, 0x6F ; 111 1aac2: df 4f sbci r29, 0xFF ; 255 1aac4: 48 81 ld r20, Y 1aac6: 59 81 ldd r21, Y+1 ; 0x01 1aac8: c1 59 subi r28, 0x91 ; 145 1aaca: d0 40 sbci r29, 0x00 ; 0 1aacc: 48 5f subi r20, 0xF8 ; 248 1aace: 5f 4f sbci r21, 0xFF ; 255 1aad0: cf 56 subi r28, 0x6F ; 111 1aad2: df 4f sbci r29, 0xFF ; 255 1aad4: 59 83 std Y+1, r21 ; 0x01 1aad6: 48 83 st Y, r20 1aad8: c1 59 subi r28, 0x91 ; 145 1aada: d0 40 sbci r29, 0x00 ; 0 1aadc: cd 56 subi r28, 0x6D ; 109 1aade: df 4f sbci r29, 0xFF ; 255 1aae0: 88 81 ld r24, Y 1aae2: 99 81 ldd r25, Y+1 ; 0x01 1aae4: c3 59 subi r28, 0x93 ; 147 1aae6: d0 40 sbci r29, 0x00 ; 0 1aae8: 08 96 adiw r24, 0x08 ; 8 1aaea: cd 56 subi r28, 0x6D ; 109 1aaec: df 4f sbci r29, 0xFF ; 255 1aaee: 99 83 std Y+1, r25 ; 0x01 1aaf0: 88 83 st Y, r24 1aaf2: c3 59 subi r28, 0x93 ; 147 1aaf4: 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) { 1aaf6: 24 16 cp r2, r20 1aaf8: 35 06 cpc r3, r21 1aafa: 09 f0 breq .+2 ; 0x1aafe 1aafc: 24 cf rjmp .-440 ; 0x1a946 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1aafe: a3 01 movw r20, r6 1ab00: 92 01 movw r18, r4 1ab02: c7 01 movw r24, r14 1ab04: b6 01 movw r22, r12 1ab06: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1ab0a: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1ab0e: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1ab12: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1ab16: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] /= wy; 1ab1a: a3 01 movw r20, r6 1ab1c: 92 01 movw r18, r4 1ab1e: c5 01 movw r24, r10 1ab20: b4 01 movw r22, r8 1ab22: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1ab26: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ab2a: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ab2e: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ab32: 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]; 1ab36: 40 90 bd 12 lds r4, 0x12BD ; 0x8012bd 1ab3a: 50 90 be 12 lds r5, 0x12BE ; 0x8012be 1ab3e: 60 90 bf 12 lds r6, 0x12BF ; 0x8012bf 1ab42: 70 90 c0 12 lds r7, 0x12C0 ; 0x8012c0 1ab46: c0 90 c9 12 lds r12, 0x12C9 ; 0x8012c9 1ab4a: d0 90 ca 12 lds r13, 0x12CA ; 0x8012ca 1ab4e: e0 90 cb 12 lds r14, 0x12CB ; 0x8012cb 1ab52: f0 90 cc 12 lds r15, 0x12CC ; 0x8012cc 1ab56: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 1ab5a: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 1ab5e: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 1ab62: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 1ab66: a2 96 adiw r28, 0x22 ; 34 1ab68: 2c af std Y+60, r18 ; 0x3c 1ab6a: 3d af std Y+61, r19 ; 0x3d 1ab6c: 4e af std Y+62, r20 ; 0x3e 1ab6e: 5f af std Y+63, r21 ; 0x3f 1ab70: a2 97 sbiw r28, 0x22 ; 34 1ab72: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1ab76: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1ab7a: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1ab7e: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1ab82: a6 96 adiw r28, 0x26 ; 38 1ab84: 8c af std Y+60, r24 ; 0x3c 1ab86: 9d af std Y+61, r25 ; 0x3d 1ab88: ae af std Y+62, r26 ; 0x3e 1ab8a: bf af std Y+63, r27 ; 0x3f 1ab8c: a6 97 sbiw r28, 0x26 ; 38 1ab8e: a7 01 movw r20, r14 1ab90: 96 01 movw r18, r12 1ab92: c3 01 movw r24, r6 1ab94: b2 01 movw r22, r4 1ab96: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1ab9a: 4b 01 movw r8, r22 1ab9c: 5c 01 movw r10, r24 1ab9e: a6 96 adiw r28, 0x26 ; 38 1aba0: 2c ad ldd r18, Y+60 ; 0x3c 1aba2: 3d ad ldd r19, Y+61 ; 0x3d 1aba4: 4e ad ldd r20, Y+62 ; 0x3e 1aba6: 5f ad ldd r21, Y+63 ; 0x3f 1aba8: a6 97 sbiw r28, 0x26 ; 38 1abaa: a2 96 adiw r28, 0x22 ; 34 1abac: 6c ad ldd r22, Y+60 ; 0x3c 1abae: 7d ad ldd r23, Y+61 ; 0x3d 1abb0: 8e ad ldd r24, Y+62 ; 0x3e 1abb2: 9f ad ldd r25, Y+63 ; 0x3f 1abb4: a2 97 sbiw r28, 0x22 ; 34 1abb6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1abba: 9b 01 movw r18, r22 1abbc: ac 01 movw r20, r24 1abbe: c5 01 movw r24, r10 1abc0: b4 01 movw r22, r8 1abc2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1abc6: 4b 01 movw r8, r22 1abc8: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1abca: ac 01 movw r20, r24 1abcc: 9b 01 movw r18, r22 1abce: c7 01 movw r24, r14 1abd0: b6 01 movw r22, r12 1abd2: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1abd6: 6b 01 movw r12, r22 1abd8: 7c 01 movw r14, r24 1abda: a6 96 adiw r28, 0x26 ; 38 1abdc: 6c ad ldd r22, Y+60 ; 0x3c 1abde: 7d ad ldd r23, Y+61 ; 0x3d 1abe0: 8e ad ldd r24, Y+62 ; 0x3e 1abe2: 9f ad ldd r25, Y+63 ; 0x3f 1abe4: a6 97 sbiw r28, 0x26 ; 38 1abe6: 90 58 subi r25, 0x80 ; 128 1abe8: a5 01 movw r20, r10 1abea: 94 01 movw r18, r8 1abec: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1abf0: a6 96 adiw r28, 0x26 ; 38 1abf2: 6c af std Y+60, r22 ; 0x3c 1abf4: 7d af std Y+61, r23 ; 0x3d 1abf6: 8e af std Y+62, r24 ; 0x3e 1abf8: 9f af std Y+63, r25 ; 0x3f 1abfa: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1abfc: a2 96 adiw r28, 0x22 ; 34 1abfe: 6c ad ldd r22, Y+60 ; 0x3c 1ac00: 7d ad ldd r23, Y+61 ; 0x3d 1ac02: 8e ad ldd r24, Y+62 ; 0x3e 1ac04: 9f ad ldd r25, Y+63 ; 0x3f 1ac06: a2 97 sbiw r28, 0x22 ; 34 1ac08: 90 58 subi r25, 0x80 ; 128 1ac0a: a5 01 movw r20, r10 1ac0c: 94 01 movw r18, r8 1ac0e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1ac12: aa 96 adiw r28, 0x2a ; 42 1ac14: 6c af std Y+60, r22 ; 0x3c 1ac16: 7d af std Y+61, r23 ; 0x3d 1ac18: 8e af std Y+62, r24 ; 0x3e 1ac1a: 9f af std Y+63, r25 ; 0x3f 1ac1c: aa 97 sbiw r28, 0x2a ; 42 1ac1e: a5 01 movw r20, r10 1ac20: 94 01 movw r18, r8 1ac22: c3 01 movw r24, r6 1ac24: b2 01 movw r22, r4 1ac26: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1ac2a: 4b 01 movw r8, r22 1ac2c: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ac2e: 40 90 cd 12 lds r4, 0x12CD ; 0x8012cd 1ac32: 50 90 ce 12 lds r5, 0x12CE ; 0x8012ce 1ac36: 60 90 cf 12 lds r6, 0x12CF ; 0x8012cf 1ac3a: 70 90 d0 12 lds r7, 0x12D0 ; 0x8012d0 1ac3e: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1ac42: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1ac46: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1ac4a: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1ac4e: a2 96 adiw r28, 0x22 ; 34 1ac50: 2c af std Y+60, r18 ; 0x3c 1ac52: 3d af std Y+61, r19 ; 0x3d 1ac54: 4e af std Y+62, r20 ; 0x3e 1ac56: 5f af std Y+63, r21 ; 0x3f 1ac58: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ac5a: c0 92 bd 12 sts 0x12BD, r12 ; 0x8012bd 1ac5e: d0 92 be 12 sts 0x12BE, r13 ; 0x8012be 1ac62: e0 92 bf 12 sts 0x12BF, r14 ; 0x8012bf 1ac66: f0 92 c0 12 sts 0x12C0, r15 ; 0x8012c0 vec_x[1] = Ainv[1][0]; 1ac6a: aa 96 adiw r28, 0x2a ; 42 1ac6c: 8c ad ldd r24, Y+60 ; 0x3c 1ac6e: 9d ad ldd r25, Y+61 ; 0x3d 1ac70: ae ad ldd r26, Y+62 ; 0x3e 1ac72: bf ad ldd r27, Y+63 ; 0x3f 1ac74: aa 97 sbiw r28, 0x2a ; 42 1ac76: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 1ac7a: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 1ac7e: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 1ac82: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 vec_y[0] = Ainv[0][1]; 1ac86: a6 96 adiw r28, 0x26 ; 38 1ac88: 2c ad ldd r18, Y+60 ; 0x3c 1ac8a: 3d ad ldd r19, Y+61 ; 0x3d 1ac8c: 4e ad ldd r20, Y+62 ; 0x3e 1ac8e: 5f ad ldd r21, Y+63 ; 0x3f 1ac90: a6 97 sbiw r28, 0x26 ; 38 1ac92: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1ac96: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1ac9a: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1ac9e: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = Ainv[1][1]; 1aca2: 80 92 c9 12 sts 0x12C9, r8 ; 0x8012c9 1aca6: 90 92 ca 12 sts 0x12CA, r9 ; 0x8012ca 1acaa: a0 92 cb 12 sts 0x12CB, r10 ; 0x8012cb 1acae: 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], 1acb2: c7 01 movw r24, r14 1acb4: b6 01 movw r22, r12 1acb6: 90 58 subi r25, 0x80 ; 128 1acb8: a3 01 movw r20, r6 1acba: 92 01 movw r18, r4 1acbc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1acc0: 6b 01 movw r12, r22 1acc2: 7c 01 movw r14, r24 1acc4: a2 96 adiw r28, 0x22 ; 34 1acc6: 2c ad ldd r18, Y+60 ; 0x3c 1acc8: 3d ad ldd r19, Y+61 ; 0x3d 1acca: 4e ad ldd r20, Y+62 ; 0x3e 1accc: 5f ad ldd r21, Y+63 ; 0x3f 1acce: a2 97 sbiw r28, 0x22 ; 34 1acd0: a6 96 adiw r28, 0x26 ; 38 1acd2: 6c ad ldd r22, Y+60 ; 0x3c 1acd4: 7d ad ldd r23, Y+61 ; 0x3d 1acd6: 8e ad ldd r24, Y+62 ; 0x3e 1acd8: 9f ad ldd r25, Y+63 ; 0x3f 1acda: a6 97 sbiw r28, 0x26 ; 38 1acdc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1ace0: 9b 01 movw r18, r22 1ace2: ac 01 movw r20, r24 1ace4: c7 01 movw r24, r14 1ace6: b6 01 movw r22, r12 1ace8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__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]; 1acec: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1acf0: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1acf4: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1acf8: 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] 1acfc: aa 96 adiw r28, 0x2a ; 42 1acfe: 6c ad ldd r22, Y+60 ; 0x3c 1ad00: 7d ad ldd r23, Y+61 ; 0x3d 1ad02: 8e ad ldd r24, Y+62 ; 0x3e 1ad04: 9f ad ldd r25, Y+63 ; 0x3f 1ad06: aa 97 sbiw r28, 0x2a ; 42 1ad08: 90 58 subi r25, 0x80 ; 128 1ad0a: a3 01 movw r20, r6 1ad0c: 92 01 movw r18, r4 1ad0e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1ad12: 6b 01 movw r12, r22 1ad14: 7c 01 movw r14, r24 1ad16: a2 96 adiw r28, 0x22 ; 34 1ad18: 2c ad ldd r18, Y+60 ; 0x3c 1ad1a: 3d ad ldd r19, Y+61 ; 0x3d 1ad1c: 4e ad ldd r20, Y+62 ; 0x3e 1ad1e: 5f ad ldd r21, Y+63 ; 0x3f 1ad20: a2 97 sbiw r28, 0x22 ; 34 1ad22: c5 01 movw r24, r10 1ad24: b4 01 movw r22, r8 1ad26: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1ad2a: 9b 01 movw r18, r22 1ad2c: ac 01 movw r20, r24 1ad2e: c7 01 movw r24, r14 1ad30: b6 01 movw r22, r12 1ad32: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__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]; 1ad36: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ad3a: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ad3e: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ad42: 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 1ad46: 90 e0 ldi r25, 0x00 ; 0 1ad48: 80 e0 ldi r24, 0x00 ; 0 1ad4a: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (result >= 0) { 1ad4e: 17 fd sbrc r17, 7 1ad50: d5 c0 rjmp .+426 ; 0x1aefc DBG(_n("Calibration success.\n")); 1ad52: 8f e1 ldi r24, 0x1F ; 31 1ad54: 9a e6 ldi r25, 0x6A ; 106 1ad56: 9f 93 push r25 1ad58: 8f 93 push r24 1ad5a: 0f 94 3f 9f call 0x33e7e ; 0x33e7e world2machine_update(vec_x, vec_y, cntr); 1ad5e: 4d ec ldi r20, 0xCD ; 205 1ad60: 52 e1 ldi r21, 0x12 ; 18 1ad62: 65 ec ldi r22, 0xC5 ; 197 1ad64: 72 e1 ldi r23, 0x12 ; 18 1ad66: 8d eb ldi r24, 0xBD ; 189 1ad68: 92 e1 ldi r25, 0x12 ; 18 1ad6a: 0f 94 7b 8e call 0x31cf6 ; 0x31cf6 #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); 1ad6e: 48 e0 ldi r20, 0x08 ; 8 1ad70: 50 e0 ldi r21, 0x00 ; 0 1ad72: 65 ee ldi r22, 0xE5 ; 229 1ad74: 7f e0 ldi r23, 0x0F ; 15 1ad76: 8d ec ldi r24, 0xCD ; 205 1ad78: 92 e1 ldi r25, 0x12 ; 18 1ad7a: 0f 94 91 a0 call 0x34122 ; 0x34122 1ad7e: 48 e0 ldi r20, 0x08 ; 8 1ad80: 50 e0 ldi r21, 0x00 ; 0 1ad82: 6d ed ldi r22, 0xDD ; 221 1ad84: 7f e0 ldi r23, 0x0F ; 15 1ad86: 8d eb ldi r24, 0xBD ; 189 1ad88: 92 e1 ldi r25, 0x12 ; 18 1ad8a: 0f 94 91 a0 call 0x34122 ; 0x34122 1ad8e: 48 e0 ldi r20, 0x08 ; 8 1ad90: 50 e0 ldi r21, 0x00 ; 0 1ad92: 65 ed ldi r22, 0xD5 ; 213 1ad94: 7f e0 ldi r23, 0x0F ; 15 1ad96: 85 ec ldi r24, 0xC5 ; 197 1ad98: 92 e1 ldi r25, 0x12 ; 18 1ad9a: 0f 94 91 a0 call 0x34122 ; 0x34122 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(); 1ad9e: 0f 94 00 8e call 0x31c00 ; 0x31c00 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ada2: 0f 90 pop r0 1ada4: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ada6: c7 55 subi r28, 0x57 ; 87 1ada8: df 4f sbci r29, 0xFF ; 255 1adaa: 88 81 ld r24, Y 1adac: 99 81 ldd r25, Y+1 ; 0x01 1adae: c9 5a subi r28, 0xA9 ; 169 1adb0: d0 40 sbci r29, 0x00 ; 0 1adb2: 0e 94 5f 60 call 0xc0be ; 0xc0be // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1adb6: 80 e0 ldi r24, 0x00 ; 0 1adb8: 90 e0 ldi r25, 0x00 ; 0 1adba: a0 ea ldi r26, 0xA0 ; 160 1adbc: b0 e4 ldi r27, 0x40 ; 64 1adbe: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 1adc2: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1adc6: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1adca: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1adce: 60 e0 ldi r22, 0x00 ; 0 1add0: 70 e0 ldi r23, 0x00 ; 0 1add2: 80 ea ldi r24, 0xA0 ; 160 1add4: 91 e4 ldi r25, 0x41 ; 65 1add6: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1adda: 0f 94 14 22 call 0x24428 ; 0x24428 //#ifndef NEW_XYZCAL if (result >= 0) 1adde: 17 fd sbrc r17, 7 1ade0: 22 c0 rjmp .+68 ; 0x1ae26 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; 1ade2: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 1ade6: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 1adea: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 1adee: 10 92 00 12 sts 0x1200, r1 ; 0x801200 destination[Z_AXIS] = 150.F; 1adf2: 80 e0 ldi r24, 0x00 ; 0 1adf4: 90 e0 ldi r25, 0x00 ; 0 1adf6: a6 e1 ldi r26, 0x16 ; 22 1adf8: b3 e4 ldi r27, 0x43 ; 67 1adfa: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 1adfe: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 1ae02: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 1ae06: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1ae0a: 65 e5 ldi r22, 0x55 ; 85 1ae0c: 75 e5 ldi r23, 0x55 ; 85 1ae0e: 85 e5 ldi r24, 0x55 ; 85 1ae10: 91 e4 ldi r25, 0x41 ; 65 1ae12: 0f 94 de 84 call 0x309bc ; 0x309bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1ae16: 89 e0 ldi r24, 0x09 ; 9 1ae18: 97 e4 ldi r25, 0x47 ; 71 1ae1a: 0e 94 3c 6d call 0xda78 ; 0xda78 1ae1e: 0f 94 19 0b call 0x21632 ; 0x21632 // 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()) 1ae22: 0f 94 19 8c call 0x31832 ; 0x31832 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ae26: 81 e0 ldi r24, 0x01 ; 1 1ae28: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_update(2); 1ae2c: 82 e0 ldi r24, 0x02 ; 2 1ae2e: 0e 94 cd 69 call 0xd39a ; 0xd39a 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)); 1ae32: 8a ec ldi r24, 0xCA ; 202 1ae34: 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) { 1ae36: 1f 3f cpi r17, 0xFF ; 255 1ae38: 99 f0 breq .+38 ; 0x1ae60 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) { 1ae3a: 1e 3f cpi r17, 0xFE ; 254 1ae3c: 09 f0 breq .+2 ; 0x1ae40 1ae3e: 73 c0 rjmp .+230 ; 0x1af26 if (point_too_far_mask == 0) 1ae40: af 96 adiw r28, 0x2f ; 47 1ae42: 4f ad ldd r20, Y+63 ; 0x3f 1ae44: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ae46: 85 e9 ldi r24, 0x95 ; 149 1ae48: 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) 1ae4a: 44 23 and r20, r20 1ae4c: 49 f0 breq .+18 ; 0x1ae60 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ae4e: af 96 adiw r28, 0x2f ; 47 1ae50: 5f ad ldd r21, Y+63 ; 0x3f 1ae52: 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); 1ae54: 83 e5 ldi r24, 0x53 ; 83 1ae56: 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) 1ae58: 52 30 cpi r21, 0x02 ; 2 1ae5a: 11 f0 breq .+4 ; 0x1ae60 // 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); 1ae5c: 8c e0 ldi r24, 0x0C ; 12 1ae5e: 96 e4 ldi r25, 0x46 ; 70 1ae60: 0e 94 3c 6d call 0xda78 ; 0xda78 1ae64: 0c 94 12 ca jmp 0x19424 ; 0x19424 (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]) : 1ae68: f2 01 movw r30, r4 1ae6a: 25 81 ldd r18, Z+5 ; 0x05 1ae6c: 36 81 ldd r19, Z+6 ; 0x06 1ae6e: 47 81 ldd r20, Z+7 ; 0x07 1ae70: 50 85 ldd r21, Z+8 ; 0x08 1ae72: c3 58 subi r28, 0x83 ; 131 1ae74: df 4f sbci r29, 0xFF ; 255 1ae76: 68 81 ld r22, Y 1ae78: 79 81 ldd r23, Y+1 ; 0x01 1ae7a: 8a 81 ldd r24, Y+2 ; 0x02 1ae7c: 9b 81 ldd r25, Y+3 ; 0x03 1ae7e: cd 57 subi r28, 0x7D ; 125 1ae80: d0 40 sbci r29, 0x00 ; 0 1ae82: 0c 94 6e ce jmp 0x19cdc ; 0x19cdc // 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]) : 1ae86: f2 01 movw r30, r4 1ae88: 25 81 ldd r18, Z+5 ; 0x05 1ae8a: 36 81 ldd r19, Z+6 ; 0x06 1ae8c: 47 81 ldd r20, Z+7 ; 0x07 1ae8e: 50 85 ldd r21, Z+8 ; 0x08 1ae90: ed 96 adiw r28, 0x3d ; 61 1ae92: 6c ad ldd r22, Y+60 ; 0x3c 1ae94: 7d ad ldd r23, Y+61 ; 0x3d 1ae96: 8e ad ldd r24, Y+62 ; 0x3e 1ae98: 9f ad ldd r25, Y+63 ; 0x3f 1ae9a: ed 97 sbiw r28, 0x3d ; 61 1ae9c: b8 c0 rjmp .+368 ; 0x1b00e (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1ae9e: f2 01 movw r30, r4 1aea0: 25 81 ldd r18, Z+5 ; 0x05 1aea2: 36 81 ldd r19, Z+6 ; 0x06 1aea4: 47 81 ldd r20, Z+7 ; 0x07 1aea6: 50 85 ldd r21, Z+8 ; 0x08 1aea8: ed 96 adiw r28, 0x3d ; 61 1aeaa: 6c ad ldd r22, Y+60 ; 0x3c 1aeac: 7d ad ldd r23, Y+61 ; 0x3d 1aeae: 8e ad ldd r24, Y+62 ; 0x3e 1aeb0: 9f ad ldd r25, Y+63 ; 0x3f 1aeb2: ed 97 sbiw r28, 0x3d ; 61 1aeb4: c6 c0 rjmp .+396 ; 0x1b042 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]) : 1aeb6: a3 01 movw r20, r6 1aeb8: 92 01 movw r18, r4 1aeba: c3 58 subi r28, 0x83 ; 131 1aebc: df 4f sbci r29, 0xFF ; 255 1aebe: 68 81 ld r22, Y 1aec0: 79 81 ldd r23, Y+1 ; 0x01 1aec2: 8a 81 ldd r24, Y+2 ; 0x02 1aec4: 9b 81 ldd r25, Y+3 ; 0x03 1aec6: cd 57 subi r28, 0x7D ; 125 1aec8: d0 40 sbci r29, 0x00 ; 0 1aeca: 0c 94 d6 ce jmp 0x19dac ; 0x19dac // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1aece: 81 2c mov r8, r1 1aed0: 91 2c mov r9, r1 1aed2: 20 e8 ldi r18, 0x80 ; 128 1aed4: a2 2e mov r10, r18 1aed6: 2f e3 ldi r18, 0x3F ; 63 1aed8: b2 2e mov r11, r18 1aeda: 0c 94 da ce jmp 0x19db4 ; 0x19db4 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1aede: c1 2c mov r12, r1 1aee0: d1 2c mov r13, r1 1aee2: 76 01 movw r14, r12 1aee4: 0c 94 51 cf jmp 0x19ea2 ; 0x19ea2 ((r == 1) ? 1.f : 1aee8: c1 2c mov r12, r1 1aeea: d1 2c mov r13, r1 1aeec: 90 e8 ldi r25, 0x80 ; 128 1aeee: e9 2e mov r14, r25 1aef0: 9f e3 ldi r25, 0x3F ; 63 1aef2: f9 2e mov r15, r25 1aef4: 0c 94 51 cf jmp 0x19ea2 ; 0x19ea2 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; 1aef8: 12 e0 ldi r17, 0x02 ; 2 1aefa: a7 cb rjmp .-2226 ; 0x1a64a } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1aefc: 1e 3f cpi r17, 0xFE ; 254 1aefe: 89 f4 brne .+34 ; 0x1af22 1af00: af 96 adiw r28, 0x2f ; 47 1af02: 3f ad ldd r19, Y+63 ; 0x3f 1af04: af 97 sbiw r28, 0x2f ; 47 1af06: 32 30 cpi r19, 0x02 ; 2 1af08: 09 f0 breq .+2 ; 0x1af0c 1af0a: 4d cf rjmp .-358 ; 0x1ada6 DBG(_n("Fitting failed => calibration failed.\n")); 1af0c: 88 ef ldi r24, 0xF8 ; 248 1af0e: 99 e6 ldi r25, 0x69 ; 105 1af10: 9f 93 push r25 1af12: 8f 93 push r24 1af14: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 1af18: 44 cf rjmp .-376 ; 0x1ada2 // 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; 1af1a: af 96 adiw r28, 0x2f ; 47 1af1c: 1f ae std Y+63, r1 ; 0x3f 1af1e: af 97 sbiw r28, 0x2f ; 47 1af20: 42 cf rjmp .-380 ; 0x1ada6 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af22: 1f ef ldi r17, 0xFF ; 255 1af24: 40 cf rjmp .-384 ; 0x1ada6 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) { 1af26: af 96 adiw r28, 0x2f ; 47 1af28: 6f ad ldd r22, Y+63 ; 0x3f 1af2a: af 97 sbiw r28, 0x2f ; 47 1af2c: 61 11 cpse r22, r1 1af2e: 13 c0 rjmp .+38 ; 0x1af56 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); 1af30: 81 ef ldi r24, 0xF1 ; 241 1af32: 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) { 1af34: 11 30 cpi r17, 0x01 ; 1 1af36: 51 f0 breq .+20 ; 0x1af4c 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); 1af38: 8e ea ldi r24, 0xAE ; 174 1af3a: 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) { 1af3c: 12 30 cpi r17, 0x02 ; 2 1af3e: 31 f0 breq .+12 ; 0x1af4c default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1af40: 85 e9 ldi r24, 0x95 ; 149 1af42: 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) { 1af44: 11 11 cpse r17, r1 1af46: 02 c0 rjmp .+4 ; 0x1af4c 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); 1af48: 86 e3 ldi r24, 0x36 ; 54 1af4a: 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); 1af4c: 0e 94 3c 6d call 0xda78 ; 0xda78 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1af50: 0f 94 19 0b call 0x21632 ; 0x21632 1af54: 0d c0 rjmp .+26 ; 0x1af70 // 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) 1af56: af 96 adiw r28, 0x2f ; 47 1af58: 8f ad ldd r24, Y+63 ; 0x3f 1af5a: af 97 sbiw r28, 0x2f ; 47 1af5c: 82 30 cpi r24, 0x02 ; 2 1af5e: f1 f4 brne .+60 ; 0x1af9c // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1af60: 85 ec ldi r24, 0xC5 ; 197 1af62: 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); 1af64: 0e 94 3c 6d call 0xda78 ; 0xda78 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); 1af68: 0f 94 19 0b call 0x21632 ; 0x21632 } if (point_too_far_mask == 0 || result > 0) { 1af6c: 11 16 cp r1, r17 1af6e: 04 f3 brlt .-64 ; 0x1af30 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1af70: 1f 3f cpi r17, 0xFF ; 255 1af72: 11 f4 brne .+4 ; 0x1af78 1af74: 0c 94 20 c7 jmp 0x18e40 ; 0x18e40 { // 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); 1af78: 86 e0 ldi r24, 0x06 ; 6 1af7a: 0e 94 80 c6 call 0x18d00 ; 0x18d00 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1af7e: 8f e5 ldi r24, 0x5F ; 95 1af80: 9f e0 ldi r25, 0x0F ; 15 1af82: 0f 94 7d a0 call 0x340fa ; 0x340fa 1af86: 81 11 cpse r24, r1 1af88: 0c 94 2c ca jmp 0x19458 ; 0x19458 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1af8c: 80 e3 ldi r24, 0x30 ; 48 1af8e: 97 e4 ldi r25, 0x47 ; 71 1af90: 0e 94 3c 6d call 0xda78 ; 0xda78 1af94: 0f 94 19 0b call 0x21632 ; 0x21632 1af98: 0c 94 2c ca jmp 0x19458 ; 0x19458 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); 1af9c: 89 e7 ldi r24, 0x79 ; 121 1af9e: 95 e4 ldi r25, 0x45 ; 69 1afa0: e1 cf rjmp .-62 ; 0x1af64 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)) 1afa2: 89 81 ldd r24, Y+1 ; 0x01 1afa4: 9a 81 ldd r25, Y+2 ; 0x02 1afa6: 80 37 cpi r24, 0x70 ; 112 1afa8: 98 40 sbci r25, 0x08 ; 8 1afaa: 10 f0 brcs .+4 ; 0x1afb0 1afac: 0c 94 65 ca jmp 0x194ca ; 0x194ca if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1afb0: ae 01 movw r20, r28 1afb2: 4f 5f subi r20, 0xFF ; 255 1afb4: 5f 4f sbci r21, 0xFF ; 255 1afb6: 7a 01 movw r14, r20 1afb8: 04 eb ldi r16, 0xB4 ; 180 1afba: 10 e0 ldi r17, 0x00 ; 0 1afbc: 24 e8 ldi r18, 0x84 ; 132 1afbe: 33 e0 ldi r19, 0x03 ; 3 1afc0: a6 01 movw r20, r12 1afc2: 48 5c subi r20, 0xC8 ; 200 1afc4: 51 09 sbc r21, r1 1afc6: 69 2d mov r22, r9 1afc8: 78 2d mov r23, r8 1afca: 8b 2d mov r24, r11 1afcc: 9a 2d mov r25, r10 1afce: 0f 94 6d 5f call 0x2beda ; 0x2beda 1afd2: 88 23 and r24, r24 1afd4: 11 f4 brne .+4 ; 0x1afda 1afd6: 0c 94 65 ca jmp 0x194ca ; 0x194ca ad += 1440; 1afda: 89 81 ldd r24, Y+1 ; 0x01 1afdc: 9a 81 ldd r25, Y+2 ; 0x02 1afde: 80 56 subi r24, 0x60 ; 96 1afe0: 9a 4f sbci r25, 0xFA ; 250 1afe2: 0c 94 f5 c8 jmp 0x191ea ; 0x191ea 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) { 1afe6: 00 23 and r16, r16 1afe8: 11 f4 brne .+4 ; 0x1afee 1afea: 0c 94 81 ce jmp 0x19d02 ; 0x19d02 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1afee: 02 30 cpi r16, 0x02 ; 2 1aff0: 09 f0 breq .+2 ; 0x1aff4 1aff2: 49 cf rjmp .-366 ; 0x1ae86 1aff4: d2 01 movw r26, r4 1aff6: 11 96 adiw r26, 0x01 ; 1 1aff8: 2d 91 ld r18, X+ 1affa: 3d 91 ld r19, X+ 1affc: 4d 91 ld r20, X+ 1affe: 5c 91 ld r21, X 1b000: 14 97 sbiw r26, 0x04 ; 4 1b002: 6e 96 adiw r28, 0x1e ; 30 1b004: 6c ad ldd r22, Y+60 ; 0x3c 1b006: 7d ad ldd r23, Y+61 ; 0x3d 1b008: 8e ad ldd r24, Y+62 ; 0x3e 1b00a: 9f ad ldd r25, Y+63 ; 0x3f 1b00c: 6e 97 sbiw r28, 0x1e ; 30 1b00e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1b012: 4b 01 movw r8, r22 1b014: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1b016: 60 e0 ldi r22, 0x00 ; 0 1b018: 70 e0 ldi r23, 0x00 ; 0 1b01a: 80 e8 ldi r24, 0x80 ; 128 1b01c: 9f e3 ldi r25, 0x3F ; 63 1b01e: 11 30 cpi r17, 0x01 ; 1 1b020: 91 f0 breq .+36 ; 0x1b046 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1b022: 12 30 cpi r17, 0x02 ; 2 1b024: 09 f0 breq .+2 ; 0x1b028 1b026: 3b cf rjmp .-394 ; 0x1ae9e 1b028: d2 01 movw r26, r4 1b02a: 11 96 adiw r26, 0x01 ; 1 1b02c: 2d 91 ld r18, X+ 1b02e: 3d 91 ld r19, X+ 1b030: 4d 91 ld r20, X+ 1b032: 5c 91 ld r21, X 1b034: 14 97 sbiw r26, 0x04 ; 4 1b036: 6e 96 adiw r28, 0x1e ; 30 1b038: 6c ad ldd r22, Y+60 ; 0x3c 1b03a: 7d ad ldd r23, Y+61 ; 0x3d 1b03c: 8e ad ldd r24, Y+62 ; 0x3e 1b03e: 9f ad ldd r25, Y+63 ; 0x3f 1b040: 6e 97 sbiw r28, 0x1e ; 30 1b042: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1b046: 9b 01 movw r18, r22 1b048: ac 01 movw r20, r24 1b04a: c5 01 movw r24, r10 1b04c: b4 01 movw r22, r8 1b04e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1b052: 9b 01 movw r18, r22 1b054: ac 01 movw r20, r24 1b056: c7 01 movw r24, r14 1b058: b6 01 movw r22, r12 1b05a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1b05e: 6b 01 movw r12, r22 1b060: 7c 01 movw r14, r24 1b062: 0c 94 81 ce jmp 0x19d02 ; 0x19d02 // 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 : 1b066: 81 2c mov r8, r1 1b068: 91 2c mov r9, r1 1b06a: 50 e8 ldi r21, 0x80 ; 128 1b06c: a5 2e mov r10, r21 1b06e: 5f e3 ldi r21, 0x3F ; 63 1b070: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1b072: 11 11 cpse r17, r1 1b074: 0c 94 5b ce jmp 0x19cb6 ; 0x19cb6 ((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; 1b078: 20 e0 ldi r18, 0x00 ; 0 1b07a: 30 e0 ldi r19, 0x00 ; 0 1b07c: 40 e8 ldi r20, 0x80 ; 128 1b07e: 5f e3 ldi r21, 0x3F ; 63 1b080: ea cf rjmp .-44 ; 0x1b056 } // 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) { 1b082: 11 11 cpse r17, r1 1b084: b4 cf rjmp .-152 ; 0x1afee 1b086: 0c 94 81 ce jmp 0x19d02 ; 0x19d02 float a = (r == 1) ? 1.f : 1b08a: 81 2c mov r8, r1 1b08c: 91 2c mov r9, r1 1b08e: 40 e8 ldi r20, 0x80 ; 128 1b090: a4 2e mov r10, r20 1b092: 4f e3 ldi r20, 0x3F ; 63 1b094: 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) { 1b096: 11 11 cpse r17, r1 1b098: be cf rjmp .-132 ; 0x1b016 1b09a: 0c 94 81 ce jmp 0x19d02 ; 0x19d02 0001b09e : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1b09e: cf 93 push r28 1b0a0: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1b0a2: 86 ea ldi r24, 0xA6 ; 166 1b0a4: 9c e0 ldi r25, 0x0C ; 12 1b0a6: 0f 94 7d a0 call 0x340fa ; 0x340fa return ((status & components) == components); 1b0aa: 98 2f mov r25, r24 1b0ac: 9c 23 and r25, r28 1b0ae: 81 e0 ldi r24, 0x01 ; 1 1b0b0: 9c 13 cpse r25, r28 1b0b2: 80 e0 ldi r24, 0x00 ; 0 } 1b0b4: cf 91 pop r28 1b0b6: 08 95 ret 0001b0b8 : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1b0b8: 61 e0 ldi r22, 0x01 ; 1 1b0ba: 88 ea ldi r24, 0xA8 ; 168 1b0bc: 9d e0 ldi r25, 0x0D ; 13 1b0be: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b0c2: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (farm_mode) { 1b0c6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1b0ca: 88 23 and r24, r24 1b0cc: 41 f0 breq .+16 ; 0x1b0de oCheckMode = ClCheckMode::_Strict; 1b0ce: 82 e0 ldi r24, 0x02 ; 2 1b0d0: 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); 1b0d4: 62 e0 ldi r22, 0x02 ; 2 1b0d6: 88 ea ldi r24, 0xA8 ; 168 1b0d8: 9d e0 ldi r25, 0x0D ; 13 1b0da: 0f 94 a1 a0 call 0x34142 ; 0x34142 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); 1b0de: 68 e2 ldi r22, 0x28 ; 40 1b0e0: 87 ea ldi r24, 0xA7 ; 167 1b0e2: 9d e0 ldi r25, 0x0D ; 13 1b0e4: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b0e8: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1b0ec: 60 e9 ldi r22, 0x90 ; 144 1b0ee: 71 e0 ldi r23, 0x01 ; 1 1b0f0: 85 ea ldi r24, 0xA5 ; 165 1b0f2: 9d e0 ldi r25, 0x0D ; 13 1b0f4: 0e 94 60 6f call 0xdec0 ; 0xdec0 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1b0f8: 61 e0 ldi r22, 0x01 ; 1 1b0fa: 84 ea ldi r24, 0xA4 ; 164 1b0fc: 9d e0 ldi r25, 0x0D ; 13 1b0fe: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b102: 80 93 b8 03 sts 0x03B8, r24 ; 0x8003b8 oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1b106: 61 e0 ldi r22, 0x01 ; 1 1b108: 83 ea ldi r24, 0xA3 ; 163 1b10a: 9d e0 ldi r25, 0x0D ; 13 1b10c: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b110: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1b114: 61 e0 ldi r22, 0x01 ; 1 1b116: 82 ea ldi r24, 0xA2 ; 162 1b118: 9d e0 ldi r25, 0x0D ; 13 1b11a: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b11e: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1b122: 61 e0 ldi r22, 0x01 ; 1 1b124: 80 e2 ldi r24, 0x20 ; 32 1b126: 9c e0 ldi r25, 0x0C ; 12 1b128: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b12c: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc } 1b130: 08 95 ret 0001b132
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1b132: cf 93 push r28 1b134: df 93 push r29 1b136: 00 d0 rcall .+0 ; 0x1b138 1b138: 00 d0 rcall .+0 ; 0x1b13a 1b13a: 00 d0 rcall .+0 ; 0x1b13c 1b13c: 1f 92 push r1 1b13e: cd b7 in r28, 0x3d ; 61 1b140: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1b142: 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); 1b144: 84 b5 in r24, 0x24 ; 36 1b146: 82 60 ori r24, 0x02 ; 2 1b148: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1b14a: 84 b5 in r24, 0x24 ; 36 1b14c: 81 60 ori r24, 0x01 ; 1 1b14e: 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); 1b150: 85 b5 in r24, 0x25 ; 37 1b152: 82 60 ori r24, 0x02 ; 2 1b154: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1b156: 85 b5 in r24, 0x25 ; 37 1b158: 81 60 ori r24, 0x01 ; 1 1b15a: 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); 1b15c: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b160: 81 60 ori r24, 0x01 ; 1 1b162: 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; 1b166: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1b16a: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b16e: 82 60 ori r24, 0x02 ; 2 1b170: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1b174: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b178: 81 60 ori r24, 0x01 ; 1 1b17a: 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); 1b17e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1b182: 81 60 ori r24, 0x01 ; 1 1b184: 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); 1b188: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1b18c: 84 60 ori r24, 0x04 ; 4 1b18e: 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); 1b192: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1b196: 81 60 ori r24, 0x01 ; 1 1b198: 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 1b19c: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1a0: 82 60 ori r24, 0x02 ; 2 1b1a2: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1b1a6: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1aa: 81 60 ori r24, 0x01 ; 1 1b1ac: 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 1b1b0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1b1b4: 81 60 ori r24, 0x01 ; 1 1b1b6: 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 1b1ba: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1be: 82 60 ori r24, 0x02 ; 2 1b1c0: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1b1c4: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1c8: 81 60 ori r24, 0x01 ; 1 1b1ca: 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 1b1ce: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1b1d2: 81 60 ori r24, 0x01 ; 1 1b1d4: 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 1b1d8: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1dc: 82 60 ori r24, 0x02 ; 2 1b1de: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1b1e2: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1e6: 81 60 ori r24, 0x01 ; 1 1b1e8: 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 1b1ec: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1b1f0: 81 60 ori r24, 0x01 ; 1 1b1f2: 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); 1b1f6: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b1fa: 84 60 ori r24, 0x04 ; 4 1b1fc: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1b200: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b204: 82 60 ori r24, 0x02 ; 2 1b206: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1b20a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b20e: 81 60 ori r24, 0x01 ; 1 1b210: 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); 1b214: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b218: 80 68 ori r24, 0x80 ; 128 1b21a: 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; 1b21e: 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) { 1b222: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b224: f8 94 cli wdt_reset(); 1b226: a8 95 wdr MCUSR &= ~_BV(WDRF); 1b228: 84 b7 in r24, 0x34 ; 52 1b22a: 87 7f andi r24, 0xF7 ; 247 1b22c: 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" ); 1b22e: 0f b6 in r0, 0x3f ; 63 1b230: f8 94 cli 1b232: a8 95 wdr 1b234: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b238: 88 61 ori r24, 0x18 ; 24 1b23a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b23e: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b242: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b244: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1b246: 9f b7 in r25, 0x3f ; 63 1b248: 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 1b24a: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1b24e: 84 e0 ldi r24, 0x04 ; 4 1b250: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1b258: 81 60 ori r24, 0x01 ; 1 1b25a: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b262: 8d 7f andi r24, 0xFD ; 253 1b264: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b26c: 8b 7f andi r24, 0xFB ; 251 1b26e: 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; 1b272: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1b276: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1b278: 73 98 cbi 0x0e, 3 ; 14 SET_OUTPUT(LCD_PINS_RS); 1b27a: 57 9a sbi 0x0a, 7 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1b27c: 6b 9a sbi 0x0d, 3 ; 13 SET_OUTPUT(LCD_PINS_D0); SET_OUTPUT(LCD_PINS_D1); SET_OUTPUT(LCD_PINS_D2); SET_OUTPUT(LCD_PINS_D3); #endif SET_OUTPUT(LCD_PINS_D4); 1b27e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b282: 82 60 ori r24, 0x02 ; 2 1b284: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D5); 1b288: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b28c: 81 60 ori r24, 0x01 ; 1 1b28e: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D6); 1b292: 3d 9a sbi 0x07, 5 ; 7 SET_OUTPUT(LCD_PINS_D7); 1b294: 3e 9a sbi 0x07, 6 ; 7 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1b296: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.513> 1b29a: 88 60 ori r24, 0x08 ; 8 1b29c: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.513> 1b2a0: 2f ef ldi r18, 0xFF ; 255 1b2a2: 30 e7 ldi r19, 0x70 ; 112 1b2a4: 82 e0 ldi r24, 0x02 ; 2 1b2a6: 21 50 subi r18, 0x01 ; 1 1b2a8: 30 40 sbci r19, 0x00 ; 0 1b2aa: 80 40 sbci r24, 0x00 ; 0 1b2ac: e1 f7 brne .-8 ; 0x1b2a6 1b2ae: 00 c0 rjmp .+0 ; 0x1b2b0 1b2b0: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1b2b2: 81 e0 ldi r24, 0x01 ; 1 1b2b4: 0e 94 71 6a call 0xd4e2 ; 0xd4e2 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1b2b8: 89 e1 ldi r24, 0x19 ; 25 1b2ba: 9c e6 ldi r25, 0x6C ; 108 1b2bc: 90 93 c9 03 sts 0x03C9, r25 ; 0x8003c9 <_lcdout+0x9> 1b2c0: 80 93 c8 03 sts 0x03C8, r24 ; 0x8003c8 <_lcdout+0x8> 1b2c4: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_lcdout+0xb> 1b2c8: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_lcdout+0xa> 1b2cc: 12 e0 ldi r17, 0x02 ; 2 1b2ce: 10 93 c3 03 sts 0x03C3, r17 ; 0x8003c3 <_lcdout+0x3> 1b2d2: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_lcdout+0xd> 1b2d6: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1b2da: 0e 94 b2 6a call 0xd564 ; 0xd564 lcd_longpress_func = menu_lcd_longpress_func; 1b2de: 83 ee ldi r24, 0xE3 ; 227 1b2e0: 95 eb ldi r25, 0xB5 ; 181 1b2e2: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 1b2e6: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1b2ea: 8d ef ldi r24, 0xFD ; 253 1b2ec: 9a ee ldi r25, 0xEA ; 234 1b2ee: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 1b2f2: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 menu_menu = lcd_status_screen; 1b2f6: 81 ec ldi r24, 0xC1 ; 193 1b2f8: 97 e3 ldi r25, 0x37 ; 55 1b2fa: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 1b2fe: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 SET_INPUT(BTN_EN1); 1b302: 6f 98 cbi 0x0d, 7 ; 13 SET_INPUT(BTN_EN2); 1b304: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b308: 87 7f andi r24, 0xF7 ; 247 1b30a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1b30e: 77 9a sbi 0x0e, 7 ; 14 WRITE(BTN_EN2, HIGH); 1b310: 9f b7 in r25, 0x3f ; 63 1b312: f8 94 cli 1b314: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b318: 88 60 ori r24, 0x08 ; 8 1b31a: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b31e: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1b320: 50 98 cbi 0x0a, 0 ; 10 WRITE(BTN_ENC, HIGH); 1b322: 58 9a sbi 0x0b, 0 ; 11 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1b324: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b328: 8b 7f andi r24, 0xFB ; 251 1b32a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1b32e: 9f b7 in r25, 0x3f ; 63 1b330: f8 94 cli 1b332: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b336: 84 60 ori r24, 0x04 ; 4 1b338: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b33c: 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); 1b33e: af e9 ldi r26, 0x9F ; 159 1b340: bf e0 ldi r27, 0x0F ; 15 1b342: 11 97 sbiw r26, 0x01 ; 1 1b344: f1 f7 brne .-4 ; 0x1b342 1b346: 00 c0 rjmp .+0 ; 0x1b348 1b348: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1b34a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1b34e: 01 e0 ldi r16, 0x01 ; 1 1b350: 82 fb bst r24, 2 1b352: 88 27 eor r24, r24 1b354: 80 f9 bld r24, 0 1b356: 80 27 eor r24, r16 1b358: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1b35c: 44 e1 ldi r20, 0x14 ; 20 1b35e: 50 e0 ldi r21, 0x00 ; 0 1b360: 6b e0 ldi r22, 0x0B ; 11 1b362: 7c e6 ldi r23, 0x6C ; 108 1b364: 89 e0 ldi r24, 0x09 ; 9 1b366: 95 e0 ldi r25, 0x05 ; 5 1b368: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b36c: 84 b1 in r24, 0x04 ; 4 1b36e: 81 7f andi r24, 0xF1 ; 241 1b370: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1b372: 84 b1 in r24, 0x04 ; 4 1b374: 87 60 ori r24, 0x07 ; 7 1b376: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b378: 85 b1 in r24, 0x05 ; 5 1b37a: 81 7f andi r24, 0xF1 ; 241 1b37c: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1b37e: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1b380: 80 e5 ldi r24, 0x50 ; 80 1b382: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1b384: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1b386: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1b38a: 8d e9 ldi r24, 0x9D ; 157 1b38c: 96 e8 ldi r25, 0x86 ; 134 1b38e: 9f 93 push r25 1b390: 8f 93 push r24 1b392: 84 ea ldi r24, 0xA4 ; 164 1b394: 96 e8 ldi r25, 0x86 ; 134 1b396: 9f 93 push r25 1b398: 8f 93 push r24 1b39a: 0e 94 df 69 call 0xd3be ; 0xd3be static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1b39e: 6a 9a sbi 0x0d, 2 ; 13 eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1b3a0: 60 e0 ldi r22, 0x00 ; 0 1b3a2: 87 ed ldi r24, 0xD7 ; 215 1b3a4: 9e e0 ldi r25, 0x0E ; 14 1b3a6: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b3aa: 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); 1b3ae: 60 e0 ldi r22, 0x00 ; 0 1b3b0: 88 e0 ldi r24, 0x08 ; 8 1b3b2: 9f e0 ldi r25, 0x0F ; 15 1b3b4: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b3b8: 80 93 04 05 sts 0x0504, r24 ; 0x800504 MYSERIAL.begin(BAUDRATE); 1b3bc: 0e 94 62 b0 call 0x160c4 ; 0x160c4 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1b3c0: 80 ee ldi r24, 0xE0 ; 224 1b3c2: 90 e7 ldi r25, 0x70 ; 112 1b3c4: 90 93 27 04 sts 0x0427, r25 ; 0x800427 <_uartout+0x9> 1b3c8: 80 93 26 04 sts 0x0426, r24 ; 0x800426 <_uartout+0x8> 1b3cc: 10 92 29 04 sts 0x0429, r1 ; 0x800429 <_uartout+0xb> 1b3d0: 10 92 28 04 sts 0x0428, r1 ; 0x800428 <_uartout+0xa> 1b3d4: 10 93 21 04 sts 0x0421, r17 ; 0x800421 <_uartout+0x3> 1b3d8: 10 92 2b 04 sts 0x042B, r1 ; 0x80042b <_uartout+0xd> 1b3dc: 10 92 2a 04 sts 0x042A, r1 ; 0x80042a <_uartout+0xc> stdout = uartout; 1b3e0: 8e e1 ldi r24, 0x1E ; 30 1b3e2: 94 e0 ldi r25, 0x04 ; 4 1b3e4: 90 93 01 17 sts 0x1701, r25 ; 0x801701 <__iob+0x3> 1b3e8: 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); 1b3ec: 60 e0 ldi r22, 0x00 ; 0 1b3ee: 84 ec ldi r24, 0xC4 ; 196 1b3f0: 9f e0 ldi r25, 0x0F ; 15 1b3f2: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b3f6: 80 93 ca 0d sts 0x0DCA, r24 ; 0x800dca if (farm_mode) { 1b3fa: 0f 90 pop r0 1b3fc: 0f 90 pop r0 1b3fe: 0f 90 pop r0 1b400: 0f 90 pop r0 1b402: 88 23 and r24, r24 1b404: 71 f0 breq .+28 ; 0x1b422 no_response = true; //we need confirmation by recieving PRUSA thx 1b406: 00 93 d6 03 sts 0x03D6, r16 ; 0x8003d6 <_ZL11no_response.lto_priv.495> prusa_statistics(8); 1b40a: 88 e0 ldi r24, 0x08 ; 8 1b40c: 0f 94 a0 98 call 0x33140 ; 0x33140 #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1b410: 0e 94 62 b0 call 0x160c4 ; 0x160c4 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1b414: 10 92 85 16 sts 0x1685, r1 ; 0x801685 1b418: 61 e0 ldi r22, 0x01 ; 1 1b41a: 87 e8 ldi r24, 0x87 ; 135 1b41c: 9f e0 ldi r25, 0x0F ; 15 1b41e: 0f 94 a1 a0 call 0x34142 ; 0x34142 } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1b422: 85 e9 ldi r24, 0x95 ; 149 1b424: 97 e8 ldi r25, 0x87 ; 135 1b426: 0e 94 de 72 call 0xe5bc ; 0xe5bc #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1b42a: 87 e7 ldi r24, 0x77 ; 119 1b42c: 9e e9 ldi r25, 0x9E ; 158 1b42e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1b432: 8e e7 ldi r24, 0x7E ; 126 1b434: 97 e8 ldi r25, 0x87 ; 135 1b436: 0f 94 66 9f call 0x33ecc ; 0x33ecc // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1b43a: 60 e0 ldi r22, 0x00 ; 0 1b43c: 8c ea ldi r24, 0xAC ; 172 1b43e: 9c e0 ldi r25, 0x0C ; 12 1b440: 0e 94 78 6f call 0xdef0 ; 0xdef0 1b444: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1b446: 0f 94 3b 63 call 0x2c676 ; 0x2c676 } MMU2::mmu2.Status(); 1b44a: 0f 94 36 41 call 0x2826c ; 0x2826c } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1b44e: 82 ed ldi r24, 0xD2 ; 210 1b450: 96 e8 ldi r25, 0x86 ; 134 1b452: 0e 94 e5 70 call 0xe1ca ; 0xe1ca uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1b456: 62 e0 ldi r22, 0x02 ; 2 1b458: 86 ed ldi r24, 0xD6 ; 214 1b45a: 9e e0 ldi r25, 0x0E ; 14 1b45c: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (status == (uint8_t)EEPROM::Enabled) 1b460: 81 30 cpi r24, 0x01 ; 1 1b462: 09 f0 breq .+2 ; 0x1b466 1b464: 74 c0 rjmp .+232 ; 0x1b54e { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1b466: 83 e7 ldi r24, 0x73 ; 115 1b468: 9b e5 ldi r25, 0x5B ; 91 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1b46a: 0e 94 de 72 call 0xe5bc ; 0xe5bc #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1b46e: 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); 1b470: 10 ff sbrs r17, 0 1b472: 04 c0 rjmp .+8 ; 0x1b47c 1b474: 85 ea ldi r24, 0xA5 ; 165 1b476: 99 e6 ldi r25, 0x69 ; 105 1b478: 0f 94 66 9f call 0x33ecc ; 0x33ecc if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1b47c: 11 ff sbrs r17, 1 1b47e: 04 c0 rjmp .+8 ; 0x1b488 1b480: 85 e9 ldi r24, 0x95 ; 149 1b482: 99 e6 ldi r25, 0x69 ; 105 1b484: 0f 94 66 9f call 0x33ecc ; 0x33ecc if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1b488: 12 ff sbrs r17, 2 1b48a: 04 c0 rjmp .+8 ; 0x1b494 1b48c: 84 e8 ldi r24, 0x84 ; 132 1b48e: 99 e6 ldi r25, 0x69 ; 105 1b490: 0f 94 66 9f call 0x33ecc ; 0x33ecc if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1b494: 13 ff sbrs r17, 3 1b496: 04 c0 rjmp .+8 ; 0x1b4a0 1b498: 84 e7 ldi r24, 0x74 ; 116 1b49a: 99 e6 ldi r25, 0x69 ; 105 1b49c: 0f 94 66 9f call 0x33ecc ; 0x33ecc if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1b4a0: 15 ff sbrs r17, 5 1b4a2: 04 c0 rjmp .+8 ; 0x1b4ac 1b4a4: 84 e6 ldi r24, 0x64 ; 100 1b4a6: 99 e6 ldi r25, 0x69 ; 105 1b4a8: 0f 94 66 9f call 0x33ecc ; 0x33ecc MCUSR = 0; 1b4ac: 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; 1b4ae: 87 e7 ldi r24, 0x77 ; 119 1b4b0: 9e e9 ldi r25, 0x9E ; 158 1b4b2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1b4b6: 84 e5 ldi r24, 0x54 ; 84 1b4b8: 99 e6 ldi r25, 0x69 ; 105 1b4ba: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1b4be: 8a e6 ldi r24, 0x6A ; 106 1b4c0: 97 e8 ldi r25, 0x87 ; 135 1b4c2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1b4c6: 88 e4 ldi r24, 0x48 ; 72 1b4c8: 99 e6 ldi r25, 0x69 ; 105 1b4ca: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1b4ce: 82 e6 ldi r24, 0x62 ; 98 1b4d0: 97 e8 ldi r25, 0x87 ; 135 1b4d2: 0e 94 de 72 call 0xe5bc ; 0xe5bc #endif #endif SERIAL_ECHO_START; 1b4d6: 87 e7 ldi r24, 0x77 ; 119 1b4d8: 9e e9 ldi r25, 0x9E ; 158 1b4da: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1b4de: 89 e3 ldi r24, 0x39 ; 57 1b4e0: 99 e6 ldi r25, 0x69 ; 105 1b4e2: 0e 94 e5 70 call 0xe1ca ; 0xe1ca /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1b4e6: 80 91 fa 16 lds r24, 0x16FA ; 0x8016fa <__brkval> 1b4ea: 90 91 fb 16 lds r25, 0x16FB ; 0x8016fb <__brkval+0x1> 1b4ee: fe 01 movw r30, r28 1b4f0: 31 96 adiw r30, 0x01 ; 1 1b4f2: 7f 01 movw r14, r30 1b4f4: bf 01 movw r22, r30 1b4f6: 00 97 sbiw r24, 0x00 ; 0 1b4f8: 69 f1 breq .+90 ; 0x1b554 1b4fa: 68 1b sub r22, r24 1b4fc: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1b4fe: 07 2e mov r0, r23 1b500: 00 0c add r0, r0 1b502: 88 0b sbc r24, r24 1b504: 99 0b sbc r25, r25 1b506: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1b50a: 82 e2 ldi r24, 0x22 ; 34 1b50c: 99 e6 ldi r25, 0x69 ; 105 1b50e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1b512: 80 ee ldi r24, 0xE0 ; 224 1b514: 96 e0 ldi r25, 0x06 ; 6 1b516: 0f 94 48 41 call 0x28290 ; 0x28290 #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); 1b51a: 6c ef ldi r22, 0xFC ; 252 1b51c: 70 e0 ldi r23, 0x00 ; 0 1b51e: 8e ee ldi r24, 0xEE ; 238 1b520: 9e e0 ldi r25, 0x0E ; 14 1b522: 0e 94 60 6f call 0xdec0 ; 0xdec0 1b526: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1b528: 68 ec ldi r22, 0xC8 ; 200 1b52a: 70 e0 ldi r23, 0x00 ; 0 1b52c: 8c ee ldi r24, 0xEC ; 236 1b52e: 9e e0 ldi r25, 0x0E ; 14 1b530: 0e 94 60 6f call 0xdec0 ; 0xdec0 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1b534: 0c 3f cpi r16, 0xFC ; 252 1b536: 11 05 cpc r17, r1 1b538: 09 f0 breq .+2 ; 0x1b53c 1b53a: f5 c5 rjmp .+3050 ; 0x1c126 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1b53c: 01 e0 ldi r16, 0x01 ; 1 1b53e: 88 3c cpi r24, 0xC8 ; 200 1b540: 91 05 cpc r25, r1 1b542: 09 f4 brne .+2 ; 0x1b546 1b544: 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(); 1b546: 0e 94 6c 75 call 0xead8 ; 0xead8 1b54a: b8 2e mov r11, r24 1b54c: f4 c5 rjmp .+3048 ; 0x1c136 1b54e: 8d e6 ldi r24, 0x6D ; 109 1b550: 9b e5 ldi r25, 0x5B ; 91 1b552: 8b cf rjmp .-234 ; 0x1b46a 1b554: 64 50 subi r22, 0x04 ; 4 1b556: 77 41 sbci r23, 0x17 ; 23 1b558: d2 cf rjmp .-92 ; 0x1b4fe minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1b55a: 81 e3 ldi r24, 0x31 ; 49 1b55c: 91 e0 ldi r25, 0x01 ; 1 1b55e: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.431+0x1> 1b562: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.431> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1b566: c0 90 d9 03 lds r12, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 1b56a: d0 90 da 03 lds r13, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 1b56e: c6 01 movw r24, r12 1b570: 0e 94 b9 bd call 0x17b72 ; 0x17b72 1b574: 20 e0 ldi r18, 0x00 ; 0 1b576: 30 e8 ldi r19, 0x80 ; 128 1b578: 48 e9 ldi r20, 0x98 ; 152 1b57a: 53 e4 ldi r21, 0x43 ; 67 1b57c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1b580: 18 16 cp r1, r24 1b582: 44 f4 brge .+16 ; 0x1b594 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1b584: 20 e1 ldi r18, 0x10 ; 16 1b586: c2 0e add r12, r18 1b588: d1 1c adc r13, r1 1b58a: d0 92 da 03 sts 0x03DA, r13 ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 1b58e: c0 92 d9 03 sts 0x03D9, r12 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 1b592: e9 cf rjmp .-46 ; 0x1b566 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1b594: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b598: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b59c: 0f 94 ea 15 call 0x22bd4 ; 0x22bd4 1b5a0: 20 e0 ldi r18, 0x00 ; 0 1b5a2: 30 e0 ldi r19, 0x00 ; 0 1b5a4: 40 ef ldi r20, 0xF0 ; 240 1b5a6: 51 e4 ldi r21, 0x41 ; 65 1b5a8: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1b5ac: 87 ff sbrs r24, 7 1b5ae: 0a c0 rjmp .+20 ; 0x1b5c4 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1b5b0: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b5b4: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b5b8: 40 97 sbiw r24, 0x10 ; 16 1b5ba: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 1b5be: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 1b5c2: e8 cf rjmp .-48 ; 0x1b594 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1b5c4: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b5c8: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b5cc: 0f 94 ea 15 call 0x22bd4 ; 0x22bd4 1b5d0: 20 e0 ldi r18, 0x00 ; 0 1b5d2: 30 e0 ldi r19, 0x00 ; 0 1b5d4: 4a ef ldi r20, 0xFA ; 250 1b5d6: 52 e4 ldi r21, 0x42 ; 66 1b5d8: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1b5dc: 18 16 cp r1, r24 1b5de: 54 f4 brge .+20 ; 0x1b5f4 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1b5e0: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b5e4: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b5e8: 40 96 adiw r24, 0x10 ; 16 1b5ea: 90 93 d8 03 sts 0x03D8, r25 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 1b5ee: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 1b5f2: e8 cf rjmp .-48 ; 0x1b5c4 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1b5f4: 9f b7 in r25, 0x3f ; 63 1b5f6: f8 94 cli TCNT0 = 0; 1b5f8: 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; 1b5fa: 8f ef ldi r24, 0xFF ; 255 1b5fc: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1b5fe: 83 e3 ldi r24, 0x33 ; 51 1b600: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1b602: 12 e0 ldi r17, 0x02 ; 2 1b604: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1b606: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b60a: 81 60 ori r24, 0x01 ; 1 1b60c: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1b610: 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; 1b612: 80 e8 ldi r24, 0x80 ; 128 1b614: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1b618: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1b61c: 84 60 ori r24, 0x04 ; 4 1b61e: 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; 1b622: 2f b7 in r18, 0x3f ; 63 1b624: f8 94 cli SET_OUTPUT(BEEPER); 1b626: 6a 9a sbi 0x0d, 2 ; 13 WRITE(BEEPER, LOW); 1b628: 72 98 cbi 0x0e, 2 ; 14 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1b62a: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b62e: 80 62 ori r24, 0x20 ; 32 1b630: 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); 1b634: 81 e0 ldi r24, 0x01 ; 1 1b636: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1b63a: 85 e1 ldi r24, 0x15 ; 21 1b63c: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1b640: 8f ef ldi r24, 0xFF ; 255 1b642: 90 e0 ldi r25, 0x00 ; 0 1b644: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1b648: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1b64c: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1b650: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1b654: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1b658: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1b65c: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1b660: 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")); 1b662: 80 ee ldi r24, 0xE0 ; 224 1b664: 96 e8 ldi r25, 0x86 ; 134 1b666: 0f 94 66 9f call 0x33ecc ; 0x33ecc DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1b66a: 8f e5 ldi r24, 0x5F ; 95 1b66c: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1b670: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1b674: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1b678: 80 64 ori r24, 0x40 ; 64 1b67a: 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); 1b67e: 8f e9 ldi r24, 0x9F ; 159 1b680: 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(); 1b684: 0e 94 73 7e call 0xfce6 ; 0xfce6 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1b688: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b68a: f8 94 cli // CTC TCCRxB &= ~(1< 1b690: 8f 7e andi r24, 0xEF ; 239 1b692: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1b69a: 88 60 ori r24, 0x08 ; 8 1b69c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1b6a4: 8d 7f andi r24, 0xFD ; 253 1b6a6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1b6ae: 8e 7f andi r24, 0xFE ; 254 1b6b0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1b6b8: 8f 73 andi r24, 0x3F ; 63 1b6ba: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1b6c2: 8f 7c andi r24, 0xCF ; 207 1b6c4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1b6cc: 84 60 ori r24, 0x04 ; 4 1b6ce: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b6d6: 8d 7f andi r24, 0xFD ; 253 1b6d8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b6e0: 8e 7f andi r24, 0xFE ; 254 1b6e2: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1b6e6: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1b6ea: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1b6ee: 2b ee ldi r18, 0xEB ; 235 1b6f0: 31 e4 ldi r19, 0x41 ; 65 1b6f2: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1b6f6: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1b6fa: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1b6fc: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1b700: 82 60 ori r24, 0x02 ; 2 1b702: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b706: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1b708: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 block_buffer_tail = 0; 1b70c: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 memset(position, 0, sizeof(position)); // clear position 1b710: 80 e1 ldi r24, 0x10 ; 16 1b712: e6 ea ldi r30, 0xA6 ; 166 1b714: f6 e0 ldi r31, 0x06 ; 6 1b716: df 01 movw r26, r30 1b718: 28 2f mov r18, r24 1b71a: 1d 92 st X+, r1 1b71c: 2a 95 dec r18 1b71e: e9 f7 brne .-6 ; 0x1b71a #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1b720: e4 e0 ldi r30, 0x04 ; 4 1b722: f4 e0 ldi r31, 0x04 ; 4 1b724: df 01 movw r26, r30 1b726: 28 2f mov r18, r24 1b728: 1d 92 st X+, r1 1b72a: 2a 95 dec r18 1b72c: e9 f7 brne .-6 ; 0x1b728 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1b72e: e4 ef ldi r30, 0xF4 ; 244 1b730: f3 e0 ldi r31, 0x03 ; 3 1b732: df 01 movw r26, r30 1b734: 1d 92 st X+, r1 1b736: 8a 95 dec r24 1b738: e9 f7 brne .-6 ; 0x1b734 previous_nominal_speed = 0.0; 1b73a: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 1b73e: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 1b742: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 1b746: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> plan_reset_next_e_queue = false; 1b74a: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = false; 1b74e: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1b752: 84 e0 ldi r24, 0x04 ; 4 1b754: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1b758: 48 99 sbic 0x09, 0 ; 9 1b75a: b0 c0 rjmp .+352 ; 0x1b8bc 1b75c: bf ef ldi r27, 0xFF ; 255 1b75e: e3 ed ldi r30, 0xD3 ; 211 1b760: f0 e3 ldi r31, 0x30 ; 48 1b762: b1 50 subi r27, 0x01 ; 1 1b764: e0 40 sbci r30, 0x00 ; 0 1b766: f0 40 sbci r31, 0x00 ; 0 1b768: e1 f7 brne .-8 ; 0x1b762 1b76a: 00 c0 rjmp .+0 ; 0x1b76c 1b76c: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1b76e: 48 99 sbic 0x09, 0 ; 9 1b770: a5 c0 rjmp .+330 ; 0x1b8bc { lcd_clear(); 1b772: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_P(PSTR("Factory RESET")); 1b776: 8a e3 ldi r24, 0x3A ; 58 1b778: 97 e8 ldi r25, 0x87 ; 135 1b77a: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 SET_OUTPUT(BEEPER); 1b77e: 6a 9a sbi 0x0d, 2 ; 13 if(eSoundMode!=e_SOUND_MODE_SILENT) 1b780: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1b784: 82 30 cpi r24, 0x02 ; 2 1b786: 09 f0 breq .+2 ; 0x1b78a WRITE(BEEPER, HIGH); 1b788: 72 9a sbi 0x0e, 2 ; 14 while (!READ(BTN_ENC)); 1b78a: 48 9b sbis 0x09, 0 ; 9 1b78c: fe cf rjmp .-4 ; 0x1b78a WRITE(BEEPER, LOW); 1b78e: 72 98 cbi 0x0e, 2 ; 14 1b790: 2f ef ldi r18, 0xFF ; 255 1b792: 37 ea ldi r19, 0xA7 ; 167 1b794: 81 e6 ldi r24, 0x61 ; 97 1b796: 21 50 subi r18, 0x01 ; 1 1b798: 30 40 sbci r19, 0x00 ; 0 1b79a: 80 40 sbci r24, 0x00 ; 0 1b79c: e1 f7 brne .-8 ; 0x1b796 1b79e: 00 c0 rjmp .+0 ; 0x1b7a0 1b7a0: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1b7a2: 80 e2 ldi r24, 0x20 ; 32 1b7a4: 97 e8 ldi r25, 0x87 ; 135 1b7a6: 9a 83 std Y+2, r25 ; 0x02 1b7a8: 89 83 std Y+1, r24 ; 0x01 1b7aa: 85 e1 ldi r24, 0x15 ; 21 1b7ac: 97 e8 ldi r25, 0x87 ; 135 1b7ae: 9c 83 std Y+4, r25 ; 0x04 1b7b0: 8b 83 std Y+3, r24 ; 0x03 1b7b2: 87 e0 ldi r24, 0x07 ; 7 1b7b4: 97 e8 ldi r25, 0x87 ; 135 1b7b6: 9e 83 std Y+6, r25 ; 0x06 1b7b8: 8d 83 std Y+5, r24 ; 0x05 1b7ba: 8a ef ldi r24, 0xFA ; 250 1b7bc: 96 e8 ldi r25, 0x86 ; 134 1b7be: 98 87 std Y+8, r25 ; 0x08 1b7c0: 8f 83 std Y+7, r24 ; 0x07 1b7c2: 81 ef ldi r24, 0xF1 ; 241 1b7c4: 96 e8 ldi r25, 0x86 ; 134 1b7c6: 9a 87 std Y+10, r25 ; 0x0a 1b7c8: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1b7ca: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_putc_at(0, 0, '>'); 1b7ce: 4e e3 ldi r20, 0x3E ; 62 1b7d0: 60 e0 ldi r22, 0x00 ; 0 1b7d2: 80 e0 ldi r24, 0x00 ; 0 1b7d4: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_consume_click(); 1b7d8: 0e 94 1e 6c call 0xd83c ; 0xd83c } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1b7dc: 10 e0 ldi r17, 0x00 ; 0 1b7de: d1 2c mov r13, r1 1b7e0: 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]); 1b7e2: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b7e6: f6 01 movw r30, r12 1b7e8: e8 0f add r30, r24 1b7ea: f1 1d adc r31, r1 1b7ec: 87 fd sbrc r24, 7 1b7ee: fa 95 dec r31 1b7f0: ee 0f add r30, r30 1b7f2: ff 1f adc r31, r31 1b7f4: ee 0d add r30, r14 1b7f6: ff 1d adc r31, r15 1b7f8: 40 81 ld r20, Z 1b7fa: 51 81 ldd r21, Z+1 ; 0x01 1b7fc: 6c 2d mov r22, r12 1b7fe: 81 e0 ldi r24, 0x01 ; 1 1b800: 0e 94 1a 6a call 0xd434 ; 0xd434 1b804: 9f ef ldi r25, 0xFF ; 255 1b806: c9 1a sub r12, r25 1b808: 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++) { 1b80a: a4 e0 ldi r26, 0x04 ; 4 1b80c: ca 16 cp r12, r26 1b80e: d1 04 cpc r13, r1 1b810: 41 f7 brne .-48 ; 0x1b7e2 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1b812: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1b816: 81 e0 ldi r24, 0x01 ; 1 1b818: 0e 94 8c 7a call 0xf518 ; 0xf518 if (lcd_encoder) { 1b81c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1b820: 90 91 07 05 lds r25, 0x0507 ; 0x800507 1b824: 00 97 sbiw r24, 0x00 ; 0 1b826: 71 f1 breq .+92 ; 0x1b884 if (lcd_encoder < 0) { 1b828: 97 ff sbrs r25, 7 1b82a: 12 c0 rjmp .+36 ; 0x1b850 cursor_pos--; 1b82c: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1b82e: 14 30 cpi r17, 0x04 ; 4 1b830: 0c f4 brge .+2 ; 0x1b834 1b832: 3a c2 rjmp .+1140 ; 0x1bca8 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b834: 87 e0 ldi r24, 0x07 ; 7 1b836: 0f 94 71 2c call 0x258e2 ; 0x258e2 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1b83a: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b83e: 18 16 cp r1, r24 1b840: 2c f0 brlt .+10 ; 0x1b84c first++; 1b842: 8f 5f subi r24, 0xFF ; 255 1b844: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1b848: 0e 94 39 6a call 0xd472 ; 0xd472 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1b84c: 13 e0 ldi r17, 0x03 ; 3 1b84e: 03 c0 rjmp .+6 ; 0x1b856 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b850: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1b852: 14 30 cpi r17, 0x04 ; 4 1b854: 78 f7 brcc .-34 ; 0x1b834 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1b856: 49 ee ldi r20, 0xE9 ; 233 1b858: 56 e8 ldi r21, 0x86 ; 134 1b85a: 60 e0 ldi r22, 0x00 ; 0 1b85c: 80 e0 ldi r24, 0x00 ; 0 1b85e: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(0, cursor_pos); 1b862: 61 2f mov r22, r17 1b864: 80 e0 ldi r24, 0x00 ; 0 1b866: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_putc('>'); 1b86a: 8e e3 ldi r24, 0x3E ; 62 1b86c: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_encoder = 0; 1b870: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1b874: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 1b878: 64 e6 ldi r22, 0x64 ; 100 1b87a: 70 e0 ldi r23, 0x00 ; 0 1b87c: 80 e0 ldi r24, 0x00 ; 0 1b87e: 90 e0 ldi r25, 0x00 ; 0 1b880: 0f 94 4d 0d call 0x21a9a ; 0x21a9a } if (lcd_clicked()) { 1b884: 0e 94 23 6c call 0xd846 ; 0xd846 1b888: 88 23 and r24, r24 1b88a: 09 f4 brne .+2 ; 0x1b88e 1b88c: a8 cf rjmp .-176 ; 0x1b7de return(cursor_pos + first); 1b88e: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b892: 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(); 1b894: 0e 94 39 6a call 0xd472 ; 0xd472 Sound_MakeCustom(100,0,false); 1b898: 40 e0 ldi r20, 0x00 ; 0 1b89a: 70 e0 ldi r23, 0x00 ; 0 1b89c: 60 e0 ldi r22, 0x00 ; 0 1b89e: 84 e6 ldi r24, 0x64 ; 100 1b8a0: 90 e0 ldi r25, 0x00 ; 0 1b8a2: 0f 94 61 31 call 0x262c2 ; 0x262c2 switch (level) { 1b8a6: 12 30 cpi r17, 0x02 ; 2 1b8a8: 09 f4 brne .+2 ; 0x1b8ac 1b8aa: 35 c2 rjmp .+1130 ; 0x1bd16 1b8ac: 08 f0 brcs .+2 ; 0x1b8b0 1b8ae: 0d c2 rjmp .+1050 ; 0x1bcca 1b8b0: 11 23 and r17, r17 1b8b2: 09 f4 brne .+2 ; 0x1b8b6 1b8b4: 28 c2 rjmp .+1104 ; 0x1bd06 1b8b6: 11 30 cpi r17, 0x01 ; 1 1b8b8: 09 f4 brne .+2 ; 0x1b8bc 1b8ba: 28 c2 rjmp .+1104 ; 0x1bd0c case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1b8bc: 82 e0 ldi r24, 0x02 ; 2 1b8be: 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); 1b8c2: 60 e0 ldi r22, 0x00 ; 0 1b8c4: 8f ef ldi r24, 0xFF ; 255 1b8c6: 9f e0 ldi r25, 0x0F ; 15 1b8c8: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1b8cc: 61 e0 ldi r22, 0x01 ; 1 1b8ce: 8f e5 ldi r24, 0x5F ; 95 1b8d0: 9f e0 ldi r25, 0x0F ; 15 1b8d2: 0e 94 78 6f call 0xdef0 ; 0xdef0 void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1b8d6: 0f 94 87 21 call 0x2430e ; 0x2430e 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; 1b8da: 85 e0 ldi r24, 0x05 ; 5 1b8dc: e8 eb ldi r30, 0xB8 ; 184 1b8de: f2 e0 ldi r31, 0x02 ; 2 1b8e0: d7 01 movw r26, r14 1b8e2: 01 90 ld r0, Z+ 1b8e4: 0d 92 st X+, r0 1b8e6: 8a 95 dec r24 1b8e8: e1 f7 brne .-8 ; 0x1b8e2 SET_OUTPUT(X_MS1_PIN); 1b8ea: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1b8ec: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1b8ee: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b8f2: 80 68 ori r24, 0x80 ; 128 1b8f4: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1b8f8: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1b8fa: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b8fe: 80 64 ori r24, 0x40 ; 64 1b900: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1b904: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b908: 80 62 ori r24, 0x20 ; 32 1b90a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1b90e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b912: 88 60 ori r24, 0x08 ; 8 1b914: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1b918: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b91c: 80 61 ori r24, 0x10 ; 16 1b91e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b922: 67 01 movw r12, r14 1b924: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1b926: f6 01 movw r30, r12 1b928: 61 91 ld r22, Z+ 1b92a: 6f 01 movw r12, r30 1b92c: 81 2f mov r24, r17 1b92e: 0f 94 4a 21 call 0x24294 ; 0x24294 1b932: 1f 5f subi r17, 0xFF ; 255 1b934: 15 30 cpi r17, 0x05 ; 5 1b936: b9 f7 brne .-18 ; 0x1b926 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1b938: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b93c: 82 60 ori r24, 0x02 ; 2 1b93e: 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); 1b942: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b946: 81 60 ori r24, 0x01 ; 1 1b948: 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); 1b94c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b950: 84 60 ori r24, 0x04 ; 4 1b952: 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); 1b956: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b95a: 80 64 ori r24, 0x40 ; 64 1b95c: 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); 1b960: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1b962: 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); 1b964: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1b966: 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); 1b968: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1b96a: 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); 1b96c: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1b96e: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1b970: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1b972: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1b974: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1b976: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1b978: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1b97a: 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); 1b97c: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1b97e: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1b980: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1b982: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1b984: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1b986: 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(); 1b988: 17 9a sbi 0x02, 7 ; 2 1b98a: 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); 1b98e: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1b990: 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(); 1b992: 16 9a sbi 0x02, 6 ; 2 1b994: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1b998: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1b99a: 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); 1b99c: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1b99e: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1b9a0: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1b9a6: 8f 7e andi r24, 0xEF ; 239 1b9a8: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1b9b0: 88 60 ori r24, 0x08 ; 8 1b9b2: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1b9ba: 8d 7f andi r24, 0xFD ; 253 1b9bc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1b9c4: 8e 7f andi r24, 0xFE ; 254 1b9c6: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1b9ce: 8f 73 andi r24, 0x3F ; 63 1b9d0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1b9d8: 8f 7c andi r24, 0xCF ; 207 1b9da: 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< 1b9e2: 88 7f andi r24, 0xF8 ; 248 1b9e4: 82 60 ori r24, 0x02 ; 2 1b9e6: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1b9ea: 80 e0 ldi r24, 0x00 ; 0 1b9ec: 90 e4 ldi r25, 0x40 ; 64 1b9ee: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1b9f2: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1b9f6: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1b9fa: 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; 1b9fe: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 1ba02: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> nextAdvanceISR = ADV_NEVER; 1ba06: 8f ef ldi r24, 0xFF ; 255 1ba08: 9f ef ldi r25, 0xFF ; 255 1ba0a: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 1ba0e: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> main_Rate = ADV_NEVER; 1ba12: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 1ba16: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> current_adv_steps = 0; 1ba1a: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 1ba1e: 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; 1ba22: 81 e0 ldi r24, 0x01 ; 1 1ba24: 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(); 1ba28: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1ba2c: 82 60 ori r24, 0x02 ; 2 1ba2e: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1ba32: 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(); 1ba34: 0f 94 c4 8f call 0x31f88 ; 0x31f88 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1ba38: 85 ef ldi r24, 0xF5 ; 245 1ba3a: 91 e1 ldi r25, 0x11 ; 17 1ba3c: 0e 94 50 65 call 0xcaa0 ; 0xcaa0 plan_set_position_curposXYZE(); 1ba40: 0f 94 d1 83 call 0x307a2 ; 0x307a2 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1ba44: 84 e9 ldi r24, 0x94 ; 148 1ba46: 9c e0 ldi r25, 0x0C ; 12 1ba48: 0f 94 7d a0 call 0x340fa ; 0x340fa 1ba4c: 82 34 cpi r24, 0x42 ; 66 1ba4e: 59 f4 brne .+22 ; 0x1ba66 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); 1ba50: 6f ef ldi r22, 0xFF ; 255 1ba52: 84 e9 ldi r24, 0x94 ; 148 1ba54: 9c e0 ldi r25, 0x0C ; 12 1ba56: 0f 94 c5 a0 call 0x3418a ; 0x3418a // 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); 1ba5a: 85 e9 ldi r24, 0x95 ; 149 1ba5c: 9c e0 ldi r25, 0x0C ; 12 1ba5e: 0f 94 8b a0 call 0x34116 ; 0x34116 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1ba62: 0f 94 19 0b call 0x21632 ; 0x21632 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1ba66: 0f 94 dc 52 call 0x2a5b8 ; 0x2a5b8 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1ba6a: 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); 1ba6c: 88 e0 ldi r24, 0x08 ; 8 1ba6e: 0f 94 a0 98 call 0x33140 ; 0x33140 // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1ba72: 8b eb ldi r24, 0xBB ; 187 1ba74: 9f e0 ldi r25, 0x0F ; 15 1ba76: 0f 94 7d a0 call 0x340fa ; 0x340fa 1ba7a: 91 e0 ldi r25, 0x01 ; 1 1ba7c: 81 30 cpi r24, 0x01 ; 1 1ba7e: 09 f0 breq .+2 ; 0x1ba82 1ba80: 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; } 1ba82: 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(); 1ba86: 81 e0 ldi r24, 0x01 ; 1 1ba88: 0f 94 1b 4d call 0x29a36 ; 0x29a36 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1ba8c: 60 e0 ldi r22, 0x00 ; 0 1ba8e: 84 e6 ldi r24, 0x64 ; 100 1ba90: 9f e0 ldi r25, 0x0F ; 15 1ba92: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1ba96: 60 e0 ldi r22, 0x00 ; 0 1ba98: 86 e6 ldi r24, 0x66 ; 102 1ba9a: 9f e0 ldi r25, 0x0F ; 15 1ba9c: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1baa0: 60 e0 ldi r22, 0x00 ; 0 1baa2: 88 e6 ldi r24, 0x68 ; 104 1baa4: 9f e0 ldi r25, 0x0F ; 15 1baa6: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1baaa: 60 e0 ldi r22, 0x00 ; 0 1baac: 85 e6 ldi r24, 0x65 ; 101 1baae: 9f e0 ldi r25, 0x0F ; 15 1bab0: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1bab4: 70 e0 ldi r23, 0x00 ; 0 1bab6: 60 e0 ldi r22, 0x00 ; 0 1bab8: 8f ef ldi r24, 0xFF ; 255 1baba: 9e e0 ldi r25, 0x0E ; 14 1babc: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1bac0: 70 e0 ldi r23, 0x00 ; 0 1bac2: 60 e0 ldi r22, 0x00 ; 0 1bac4: 85 e0 ldi r24, 0x05 ; 5 1bac6: 9f e0 ldi r25, 0x0F ; 15 1bac8: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1bacc: 70 e0 ldi r23, 0x00 ; 0 1bace: 60 e0 ldi r22, 0x00 ; 0 1bad0: 83 e0 ldi r24, 0x03 ; 3 1bad2: 9f e0 ldi r25, 0x0F ; 15 1bad4: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1bad8: 70 e0 ldi r23, 0x00 ; 0 1bada: 60 e0 ldi r22, 0x00 ; 0 1badc: 81 e0 ldi r24, 0x01 ; 1 1bade: 9f e0 ldi r25, 0x0F ; 15 1bae0: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1bae4: 70 e0 ldi r23, 0x00 ; 0 1bae6: 60 e0 ldi r22, 0x00 ; 0 1bae8: 83 ed ldi r24, 0xD3 ; 211 1baea: 9e e0 ldi r25, 0x0E ; 14 1baec: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1baf0: 70 e0 ldi r23, 0x00 ; 0 1baf2: 60 e0 ldi r22, 0x00 ; 0 1baf4: 80 ed ldi r24, 0xD0 ; 208 1baf6: 9e e0 ldi r25, 0x0E ; 14 1baf8: 0e 94 60 6f call 0xdec0 ; 0xdec0 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1bafc: 60 e0 ldi r22, 0x00 ; 0 1bafe: 82 ed ldi r24, 0xD2 ; 210 1bb00: 9e e0 ldi r25, 0x0E ; 14 1bb02: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1bb06: 60 e0 ldi r22, 0x00 ; 0 1bb08: 8f ec ldi r24, 0xCF ; 207 1bb0a: 9e e0 ldi r25, 0x0E ; 14 1bb0c: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1bb10: 88 ea ldi r24, 0xA8 ; 168 1bb12: 9c e0 ldi r25, 0x0C ; 12 1bb14: 0f 94 55 48 call 0x290aa ; 0x290aa if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1bb18: 81 ea ldi r24, 0xA1 ; 161 1bb1a: 9d e0 ldi r25, 0x0D ; 13 1bb1c: 0f 94 7d a0 call 0x340fa ; 0x340fa 1bb20: 8f 3f cpi r24, 0xFF ; 255 1bb22: 71 f4 brne .+28 ; 0x1bb40 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bb24: 60 e0 ldi r22, 0x00 ; 0 1bb26: 81 ea ldi r24, 0xA1 ; 161 1bb28: 9d e0 ldi r25, 0x0D ; 13 1bb2a: 0f 94 a1 a0 call 0x34142 ; 0x34142 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); 1bb2e: 88 ef ldi r24, 0xF8 ; 248 1bb30: 9f e0 ldi r25, 0x0F ; 15 1bb32: 0f 94 8b a0 call 0x34116 ; 0x34116 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1bb36: bc 01 movw r22, r24 1bb38: 80 e5 ldi r24, 0x50 ; 80 1bb3a: 9d e0 ldi r25, 0x0D ; 13 1bb3c: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); 1bb40: 49 e4 ldi r20, 0x49 ; 73 1bb42: c4 2e mov r12, r20 1bb44: 4d e0 ldi r20, 0x0D ; 13 1bb46: d4 2e mov r13, r20 1bb48: 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); 1bb4a: b7 01 movw r22, r14 1bb4c: 81 2f mov r24, r17 1bb4e: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1bb52: a7 01 movw r20, r14 1bb54: 67 e0 ldi r22, 0x07 ; 7 1bb56: 70 e0 ldi r23, 0x00 ; 0 1bb58: c6 01 movw r24, r12 1bb5a: 0e 94 41 6f call 0xde82 ; 0xde82 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++) { 1bb5e: 1f 5f subi r17, 0xFF ; 255 1bb60: fb e0 ldi r31, 0x0B ; 11 1bb62: cf 0e add r12, r31 1bb64: d1 1c adc r13, r1 1bb66: 18 30 cpi r17, 0x08 ; 8 1bb68: 81 f7 brne .-32 ; 0x1bb4a 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)))) 1bb6a: 81 ea ldi r24, 0xA1 ; 161 1bb6c: 9d e0 ldi r25, 0x0D ; 13 1bb6e: 0f 94 7d a0 call 0x340fa ; 0x340fa 1bb72: 0e 94 a3 6f call 0xdf46 ; 0xdf46 1bb76: 81 11 cpse r24, r1 1bb78: 02 c0 rjmp .+4 ; 0x1bb7e { eeprom_switch_to_next_sheet(); 1bb7a: 0e 94 c5 6f call 0xdf8a ; 0xdf8a } check_babystep(); 1bb7e: 0e 94 3d 73 call 0xe67a ; 0xe67a // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1bb82: 80 e8 ldi r24, 0x80 ; 128 1bb84: 9c e0 ldi r25, 0x0C ; 12 1bb86: 0f 94 7d a0 call 0x340fa ; 0x340fa 1bb8a: 8f 3f cpi r24, 0xFF ; 255 1bb8c: 41 f4 brne .+16 ; 0x1bb9e #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); 1bb8e: 40 e1 ldi r20, 0x10 ; 16 1bb90: 50 e0 ldi r21, 0x00 ; 0 1bb92: 60 e8 ldi r22, 0x80 ; 128 1bb94: 7c e0 ldi r23, 0x0C ; 12 1bb96: 88 ec ldi r24, 0xC8 ; 200 1bb98: 92 e0 ldi r25, 0x02 ; 2 1bb9a: 0f 94 91 a0 call 0x34122 ; 0x34122 //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); 1bb9e: 60 e0 ldi r22, 0x00 ; 0 1bba0: 89 e2 ldi r24, 0x29 ; 41 1bba2: 9d e0 ldi r25, 0x0D ; 13 1bba4: 0e 94 78 6f call 0xdef0 ; 0xdef0 #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1bba8: 85 e0 ldi r24, 0x05 ; 5 1bbaa: 9d e0 ldi r25, 0x0D ; 13 1bbac: 0f 94 55 48 call 0x290aa ; 0x290aa eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1bbb0: 8d ee ldi r24, 0xED ; 237 1bbb2: 9f e0 ldi r25, 0x0F ; 15 1bbb4: 0f 94 55 48 call 0x290aa ; 0x290aa eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1bbb8: 81 ef ldi r24, 0xF1 ; 241 1bbba: 9f e0 ldi r25, 0x0F ; 15 1bbbc: 0f 94 55 48 call 0x290aa ; 0x290aa eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1bbc0: 60 e0 ldi r22, 0x00 ; 0 1bbc2: 8e ec ldi r24, 0xCE ; 206 1bbc4: 9e e0 ldi r25, 0x0E ; 14 1bbc6: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1bbca: 61 e0 ldi r22, 0x01 ; 1 1bbcc: 87 ea ldi r24, 0xA7 ; 167 1bbce: 9c e0 ldi r25, 0x0C ; 12 1bbd0: 0e 94 78 6f call 0xdef0 ; 0xdef0 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1bbd4: 8e ef ldi r24, 0xFE ; 254 1bbd6: 9f e0 ldi r25, 0x0F ; 15 1bbd8: 0f 94 7d a0 call 0x340fa ; 0x340fa 1bbdc: 0e 94 d0 6c call 0xd9a0 ; 0xd9a0 1bbe0: 81 11 cpse r24, r1 1bbe2: 02 c0 rjmp .+4 ; 0x1bbe8 lcd_language(); 1bbe4: 0e 94 fa fd call 0x1fbf4 ; 0x1fbf4 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1bbe8: 60 e0 ldi r22, 0x00 ; 0 1bbea: 8f ea ldi r24, 0xAF ; 175 1bbec: 9f e0 ldi r25, 0x0F ; 15 1bbee: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1bbf2: 86 ea ldi r24, 0xA6 ; 166 1bbf4: 9f e0 ldi r25, 0x0F ; 15 1bbf6: 0f 94 7d a0 call 0x340fa ; 0x340fa 1bbfa: 8f 3f cpi r24, 0xFF ; 255 1bbfc: d9 f4 brne .+54 ; 0x1bc34 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bbfe: 61 e0 ldi r22, 0x01 ; 1 1bc00: 86 ea ldi r24, 0xA6 ; 166 1bc02: 9f e0 ldi r25, 0x0F ; 15 1bc04: 0f 94 a1 a0 call 0x34142 ; 0x34142 1bc08: 30 eb ldi r19, 0xB0 ; 176 1bc0a: e3 2e mov r14, r19 1bc0c: 3f e0 ldi r19, 0x0F ; 15 1bc0e: 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); 1bc10: 70 e0 ldi r23, 0x00 ; 0 1bc12: 60 e0 ldi r22, 0x00 ; 0 1bc14: c7 01 movw r24, r14 1bc16: 0f 94 bf a0 call 0x3417e ; 0x3417e 1bc1a: 22 e0 ldi r18, 0x02 ; 2 1bc1c: e2 0e add r14, r18 1bc1e: 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++) { 1bc20: 3a eb ldi r19, 0xBA ; 186 1bc22: e3 16 cp r14, r19 1bc24: 3f e0 ldi r19, 0x0F ; 15 1bc26: f3 06 cpc r15, r19 1bc28: 99 f7 brne .-26 ; 0x1bc10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc2a: 60 e0 ldi r22, 0x00 ; 0 1bc2c: 8f ea ldi r24, 0xAF ; 175 1bc2e: 9f e0 ldi r25, 0x0F ; 15 1bc30: 0f 94 a1 a0 call 0x34142 ; 0x34142 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); 1bc34: 60 e0 ldi r22, 0x00 ; 0 1bc36: 85 ea ldi r24, 0xA5 ; 165 1bc38: 9f e0 ldi r25, 0x0F ; 15 1bc3a: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1bc3e: 60 e0 ldi r22, 0x00 ; 0 1bc40: 8f e7 ldi r24, 0x7F ; 127 1bc42: 9c e0 ldi r25, 0x0C ; 12 1bc44: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1bc48: 60 e0 ldi r22, 0x00 ; 0 1bc4a: 89 e0 ldi r24, 0x09 ; 9 1bc4c: 9f e0 ldi r25, 0x0F ; 15 1bc4e: 0e 94 78 6f call 0xdef0 ; 0xdef0 } 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); 1bc52: 61 e0 ldi r22, 0x01 ; 1 1bc54: 8c ea ldi r24, 0xAC ; 172 1bc56: 9d e0 ldi r25, 0x0D ; 13 1bc58: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1bc5c: 63 e0 ldi r22, 0x03 ; 3 1bc5e: 8b ea ldi r24, 0xAB ; 171 1bc60: 9d e0 ldi r25, 0x0D ; 13 1bc62: 0e 94 78 6f call 0xdef0 ; 0xdef0 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1bc66: 63 e0 ldi r22, 0x03 ; 3 1bc68: 8a ea ldi r24, 0xAA ; 170 1bc6a: 9d e0 ldi r25, 0x0D ; 13 1bc6c: 0e 94 78 6f call 0xdef0 ; 0xdef0 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1bc70: 61 e0 ldi r22, 0x01 ; 1 1bc72: 89 ea ldi r24, 0xA9 ; 169 1bc74: 9d e0 ldi r25, 0x0D ; 13 1bc76: 0e 94 78 6f call 0xdef0 ; 0xdef0 #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); 1bc7a: 84 e0 ldi r24, 0x04 ; 4 1bc7c: 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) { 1bc80: 02 30 cpi r16, 0x02 ; 2 1bc82: 09 f4 brne .+2 ; 0x1bc86 1bc84: 6e c0 rjmp .+220 ; 0x1bd62 1bc86: 03 30 cpi r16, 0x03 ; 3 1bc88: 09 f4 brne .+2 ; 0x1bc8c 1bc8a: 0f c1 rjmp .+542 ; 0x1beaa 1bc8c: 01 30 cpi r16, 0x01 ; 1 1bc8e: 09 f0 breq .+2 ; 0x1bc92 1bc90: 74 c0 rjmp .+232 ; 0x1bd7a //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)); 1bc92: 86 e3 ldi r24, 0x36 ; 54 1bc94: 94 e4 ldi r25, 0x44 ; 68 1bc96: 0e 94 3c 6d call 0xda78 ; 0xda78 1bc9a: 0f 94 19 0b call 0x21632 ; 0x21632 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); 1bc9e: 68 ec ldi r22, 0xC8 ; 200 1bca0: 70 e0 ldi r23, 0x00 ; 0 1bca2: 8c ee ldi r24, 0xEC ; 236 1bca4: 9e e0 ldi r25, 0x0E ; 14 1bca6: 67 c0 rjmp .+206 ; 0x1bd76 first++; lcd_clear(); } } if (cursor_pos < 0) { 1bca8: 1f 3f cpi r17, 0xFF ; 255 1bcaa: 09 f0 breq .+2 ; 0x1bcae 1bcac: d4 cd rjmp .-1112 ; 0x1b856 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1bcae: 87 e0 ldi r24, 0x07 ; 7 1bcb0: 0f 94 71 2c call 0x258e2 ; 0x258e2 if (first > 0) { 1bcb4: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1bcb8: 18 16 cp r1, r24 1bcba: 2c f4 brge .+10 ; 0x1bcc6 first--; 1bcbc: 81 50 subi r24, 0x01 ; 1 1bcbe: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1bcc2: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1bcc6: 10 e0 ldi r17, 0x00 ; 0 1bcc8: c6 cd rjmp .-1140 ; 0x1b856 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1bcca: 13 30 cpi r17, 0x03 ; 3 1bccc: 31 f1 breq .+76 ; 0x1bd1a 1bcce: 14 30 cpi r17, 0x04 ; 4 1bcd0: 09 f0 breq .+2 ; 0x1bcd4 1bcd2: f4 cd rjmp .-1048 ; 0x1b8bc #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1bcd4: 69 e2 ldi r22, 0x29 ; 41 1bcd6: 77 e8 ldi r23, 0x87 ; 135 1bcd8: 80 e0 ldi r24, 0x00 ; 0 1bcda: 90 e1 ldi r25, 0x10 ; 16 1bcdc: 0f 94 bf 91 call 0x3237e ; 0x3237e // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bce0: 10 e0 ldi r17, 0x00 ; 0 1bce2: 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); 1bce4: 6f ef ldi r22, 0xFF ; 255 1bce6: c8 01 movw r24, r16 1bce8: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1bcec: c8 01 movw r24, r16 1bcee: 0f 94 90 91 call 0x32320 ; 0x32320 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bcf2: 0f 5f subi r16, 0xFF ; 255 1bcf4: 1f 4f sbci r17, 0xFF ; 255 1bcf6: 01 15 cp r16, r1 1bcf8: b0 e1 ldi r27, 0x10 ; 16 1bcfa: 1b 07 cpc r17, r27 1bcfc: 99 f7 brne .-26 ; 0x1bce4 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1bcfe: 0f 94 b1 91 call 0x32362 ; 0x32362 softReset(); 1bd02: 0e 94 32 61 call 0xc264 ; 0xc264 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1bd06: 0e 94 3f 6c call 0xd87e ; 0xd87e 1bd0a: d8 cd rjmp .-1104 ; 0x1b8bc break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1bd0c: 0e 94 f7 60 call 0xc1ee ; 0xc1ee lcd_menu_statistics(); 1bd10: 0f 94 6a 1c call 0x238d4 ; 0x238d4 1bd14: d3 cd rjmp .-1114 ; 0x1b8bc break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1bd16: 0e 94 f7 60 call 0xc1ee ; 0xc1ee // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1bd1a: 0e 94 3f 6c call 0xd87e ; 0xd87e // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1bd1e: 84 e0 ldi r24, 0x04 ; 4 1bd20: 0e 94 2b c6 call 0x18c56 ; 0x18c56 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); 1bd24: 62 e0 ldi r22, 0x02 ; 2 1bd26: 8f e5 ldi r24, 0x5F ; 95 1bd28: 9f e0 ldi r25, 0x0F ; 15 1bd2a: 0f 94 c5 a0 call 0x3418a ; 0x3418a lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1bd2e: 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); 1bd32: 60 e0 ldi r22, 0x00 ; 0 1bd34: 84 ec ldi r24, 0xC4 ; 196 1bd36: 9f e0 ldi r25, 0x0F ; 15 1bd38: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1bd3c: 81 e0 ldi r24, 0x01 ; 1 1bd3e: 0e 94 ab 6e call 0xdd56 ; 0xdd56 1bd42: 11 e0 ldi r17, 0x01 ; 1 1bd44: 10 93 85 16 sts 0x1685, r17 ; 0x801685 1bd48: 61 e0 ldi r22, 0x01 ; 1 1bd4a: 87 e0 ldi r24, 0x07 ; 7 1bd4c: 9f e0 ldi r25, 0x0F ; 15 1bd4e: 0f 94 a1 a0 call 0x34142 ; 0x34142 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1bd52: 10 93 86 16 sts 0x1686, r17 ; 0x801686 1bd56: 61 e0 ldi r22, 0x01 ; 1 1bd58: 85 ed ldi r24, 0xD5 ; 213 1bd5a: 9e e0 ldi r25, 0x0E ; 14 1bd5c: 0f 94 a1 a0 call 0x34142 ; 0x34142 1bd60: ad cd rjmp .-1190 ; 0x1b8bc 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)); 1bd62: 85 e1 ldi r24, 0x15 ; 21 1bd64: 94 e4 ldi r25, 0x44 ; 68 1bd66: 0e 94 3c 6d call 0xda78 ; 0xda78 1bd6a: 0f 94 19 0b call 0x21632 ; 0x21632 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); 1bd6e: 6c ef ldi r22, 0xFC ; 252 1bd70: 70 e0 ldi r23, 0x00 ; 0 1bd72: 8e ee ldi r24, 0xEE ; 238 1bd74: 9e e0 ldi r25, 0x0E ; 14 1bd76: 0f 94 db a0 call 0x341b6 ; 0x341b6 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1bd7a: b1 10 cpse r11, r1 1bd7c: 08 c0 rjmp .+16 ; 0x1bd8e 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 1bd7e: 8e e9 ldi r24, 0x9E ; 158 1bd80: 93 e4 ldi r25, 0x43 ; 67 1bd82: 0e 94 3c 6d call 0xda78 ; 0xda78 1bd86: 0f 94 19 0b call 0x21632 ; 0x21632 Config_StoreSettings(); 1bd8a: 0e 94 e7 75 call 0xebce ; 0xebce } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1bd8e: 80 e8 ldi r24, 0x80 ; 128 1bd90: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1bd94: 88 23 and r24, r24 1bd96: c9 f0 breq .+50 ; 0x1bdca CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1bd98: 87 ef ldi r24, 0xF7 ; 247 1bd9a: 9f e0 ldi r25, 0x0F ; 15 1bd9c: 0f 94 7d a0 call 0x340fa ; 0x340fa } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1bda0: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1bda2: 81 30 cpi r24, 0x01 ; 1 1bda4: 71 f4 brne .+28 ; 0x1bdc2 // 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)) { 1bda6: 8a e5 ldi r24, 0x5A ; 90 1bda8: 97 e8 ldi r25, 0x87 ; 135 1bdaa: 0e 94 49 b3 call 0x16692 ; 0x16692 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); 1bdae: 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)) { 1bdb0: 88 23 and r24, r24 1bdb2: 39 f0 breq .+14 ; 0x1bdc2 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1bdb4: 8c e5 ldi r24, 0x5C ; 92 1bdb6: 93 e4 ldi r25, 0x43 ; 67 1bdb8: 0e 94 3c 6d call 0xda78 ; 0xda78 1bdbc: 0f 94 19 0b call 0x21632 ; 0x21632 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1bdc0: 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); 1bdc2: 86 ea ldi r24, 0xA6 ; 166 1bdc4: 9c e0 ldi r25, 0x0C ; 12 1bdc6: 0f 94 a1 a0 call 0x34142 ; 0x34142 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1bdca: 82 e5 ldi r24, 0x52 ; 82 1bdcc: 97 e8 ldi r25, 0x87 ; 135 1bdce: 0e 94 49 b3 call 0x16692 ; 0x16692 1bdd2: 18 2f mov r17, r24 1bdd4: 88 23 and r24, r24 1bdd6: 29 f0 breq .+10 ; 0x1bde2 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1bdd8: 87 e1 ldi r24, 0x17 ; 23 1bdda: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1bdde: 11 e0 ldi r17, 0x01 ; 1 1bde0: 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; 1bde2: f1 2c mov r15, r1 1bde4: 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)); 1bde6: f7 01 movw r30, r14 1bde8: e8 5b subi r30, 0xB8 ; 184 1bdea: f8 47 sbci r31, 0x78 ; 120 1bdec: 64 91 lpm r22, Z 1bdee: c7 01 movw r24, r14 1bdf0: 0f 94 a1 a0 call 0x34142 ; 0x34142 1bdf4: 8f ef ldi r24, 0xFF ; 255 1bdf6: e8 1a sub r14, r24 1bdf8: 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){ 1bdfa: 9a e0 ldi r25, 0x0A ; 10 1bdfc: e9 16 cp r14, r25 1bdfe: f1 04 cpc r15, r1 1be00: 91 f7 brne .-28 ; 0x1bde6 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])); 1be02: e2 e5 ldi r30, 0x52 ; 82 1be04: f7 e8 ldi r31, 0x87 ; 135 1be06: 65 91 lpm r22, Z+ 1be08: 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); 1be0a: 8a e0 ldi r24, 0x0A ; 10 1be0c: 90 e0 ldi r25, 0x00 ; 0 1be0e: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1be12: e4 e5 ldi r30, 0x54 ; 84 1be14: f7 e8 ldi r31, 0x87 ; 135 1be16: 65 91 lpm r22, Z+ 1be18: 74 91 lpm r23, Z 1be1a: 8c e0 ldi r24, 0x0C ; 12 1be1c: 90 e0 ldi r25, 0x00 ; 0 1be1e: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1be22: e6 e5 ldi r30, 0x56 ; 86 1be24: f7 e8 ldi r31, 0x87 ; 135 1be26: 65 91 lpm r22, Z+ 1be28: 74 91 lpm r23, Z 1be2a: 8e e0 ldi r24, 0x0E ; 14 1be2c: 90 e0 ldi r25, 0x00 ; 0 1be2e: 0f 94 bf a0 call 0x3417e ; 0x3417e // 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])); 1be32: e8 e5 ldi r30, 0x58 ; 88 1be34: f7 e8 ldi r31, 0x87 ; 135 1be36: 65 91 lpm r22, Z+ 1be38: 74 91 lpm r23, Z 1be3a: 80 e1 ldi r24, 0x10 ; 16 1be3c: 90 e0 ldi r25, 0x00 ; 0 1be3e: 0f 94 bf a0 call 0x3417e ; 0x3417e run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1be42: 8f e5 ldi r24, 0x5F ; 95 1be44: 9f e0 ldi r25, 0x0F ; 15 1be46: 0f 94 7d a0 call 0x340fa ; 0x340fa 1be4a: 88 23 and r24, r24 1be4c: d9 f1 breq .+118 ; 0x1bec4 // first time run of wizard or service prep lcd_wizard(WizState::Run); 1be4e: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1be50: 0f 94 b2 2d call 0x25b64 ; 0x25b64 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1be54: 83 e0 ldi r24, 0x03 ; 3 1be56: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1be5a: 81 e0 ldi r24, 0x01 ; 1 1be5c: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 1be60: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_update(2); 1be64: 82 e0 ldi r24, 0x02 ; 2 1be66: 0e 94 cd 69 call 0xd39a ; 0xd39a "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); 1be6a: 83 e0 ldi r24, 0x03 ; 3 1be6c: 9d e0 ldi r25, 0x0D ; 13 1be6e: 0f 94 7d a0 call 0x340fa ; 0x340fa 1be72: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1be74: 8f ef ldi r24, 0xFF ; 255 1be76: 81 0f add r24, r17 1be78: 8e 3f cpi r24, 0xFE ; 254 1be7a: 08 f0 brcs .+2 ; 0x1be7e 1be7c: 49 c0 rjmp .+146 ; 0x1bf10 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1be7e: 80 e0 ldi r24, 0x00 ; 0 1be80: 0f 94 71 2c call 0x258e2 ; 0x258e2 { lcd_beeper_quick_feedback(); lcd_clear(); 1be84: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1be88: 83 e0 ldi r24, 0x03 ; 3 1be8a: 99 e6 ldi r25, 0x69 ; 105 1be8c: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 switch(crash_reason) 1be90: 12 30 cpi r17, 0x02 ; 2 1be92: b1 f1 breq .+108 ; 0x1bf00 1be94: 13 30 cpi r17, 0x03 ; 3 1be96: 09 f4 brne .+2 ; 0x1be9a 1be98: 16 c1 rjmp .+556 ; 0x1c0c6 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1be9a: 80 ee ldi r24, 0xE0 ; 224 1be9c: 98 e6 ldi r25, 0x68 ; 104 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1be9e: 11 30 cpi r17, 0x01 ; 1 1bea0: 89 f1 breq .+98 ; 0x1bf04 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1bea2: 81 2f mov r24, r17 1bea4: 0e 94 b5 6a call 0xd56a ; 0xd56a 1bea8: 2f c0 rjmp .+94 ; 0x1bf08 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)); 1beaa: 8a ed ldi r24, 0xDA ; 218 1beac: 93 e4 ldi r25, 0x43 ; 67 1beae: 0e 94 3c 6d call 0xda78 ; 0xda78 1beb2: 0f 94 19 0b call 0x21632 ; 0x21632 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); 1beb6: 6c ef ldi r22, 0xFC ; 252 1beb8: 70 e0 ldi r23, 0x00 ; 0 1beba: 8e ee ldi r24, 0xEE ; 238 1bebc: 9e e0 ldi r25, 0x0E ; 14 1bebe: 0f 94 db a0 call 0x341b6 ; 0x341b6 1bec2: ed ce rjmp .-550 ; 0x1bc9e // 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); 1bec4: 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) { 1bec6: 11 11 cpse r17, r1 1bec8: c3 cf rjmp .-122 ; 0x1be50 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1beca: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1bece: 81 11 cpse r24, r1 1bed0: 07 c0 rjmp .+14 ; 0x1bee0 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1bed2: 8c ee ldi r24, 0xEC ; 236 1bed4: 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)); 1bed6: 0e 94 3c 6d call 0xda78 ; 0xda78 1beda: 0f 94 19 0b call 0x21632 ; 0x21632 1bede: ba cf rjmp .-140 ; 0x1be54 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)) { 1bee0: 84 e0 ldi r24, 0x04 ; 4 1bee2: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1bee6: 81 11 cpse r24, r1 1bee8: 03 c0 rjmp .+6 ; 0x1bef0 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1beea: 84 e7 ldi r24, 0x74 ; 116 1beec: 92 e4 ldi r25, 0x42 ; 66 1beee: f3 cf rjmp .-26 ; 0x1bed6 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1bef0: 80 e1 ldi r24, 0x10 ; 16 1bef2: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 1bef6: 81 11 cpse r24, r1 1bef8: ad cf rjmp .-166 ; 0x1be54 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1befa: 80 e3 ldi r24, 0x30 ; 48 1befc: 97 e4 ldi r25, 0x47 ; 71 1befe: eb cf rjmp .-42 ; 0x1bed6 { 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")); 1bf00: 8f ec ldi r24, 0xCF ; 207 1bf02: 98 e6 ldi r25, 0x68 ; 104 1bf04: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1bf08: 90 e0 ldi r25, 0x00 ; 0 1bf0a: 80 e0 ldi r24, 0x00 ; 0 1bf0c: 0f 94 3d 34 call 0x2687a ; 0x2687a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bf10: 6f ef ldi r22, 0xFF ; 255 1bf12: 83 e0 ldi r24, 0x03 ; 3 1bf14: 9d e0 ldi r25, 0x0D ; 13 1bf16: 0f 94 a1 a0 call 0x34142 ; 0x34142 // 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(); 1bf1a: 0e 94 5c d8 call 0x1b0b8 ; 0x1b0b8 KEEPALIVE_STATE(NOT_BUSY); 1bf1e: 81 e0 ldi r24, 0x01 ; 1 1bf20: 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" ); 1bf24: 88 e1 ldi r24, 0x18 ; 24 1bf26: 98 e2 ldi r25, 0x28 ; 40 1bf28: 0f b6 in r0, 0x3f ; 63 1bf2a: f8 94 cli 1bf2c: a8 95 wdr 1bf2e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bf32: 0f be out 0x3f, r0 ; 63 1bf34: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1bf38: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bf3c: 80 64 ori r24, 0x40 ; 64 1bf3e: 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; 1bf42: 85 e0 ldi r24, 0x05 ; 5 1bf44: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1bf46: 90 e0 ldi r25, 0x00 ; 0 1bf48: e9 2e mov r14, r25 1bf4a: 90 e0 ldi r25, 0x00 ; 0 1bf4c: 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); 1bf4e: cc 24 eor r12, r12 1bf50: 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); 1bf52: 24 e0 ldi r18, 0x04 ; 4 1bf54: 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; 1bf56: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 1bf5a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1bf5e: 88 23 and r24, r24 1bf60: 09 f4 brne .+2 ; 0x1bf64 1bf62: b4 c0 rjmp .+360 ; 0x1c0cc // 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); 1bf64: 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. 1bf68: 0e 94 48 61 call 0xc290 ; 0xc290 1bf6c: 88 23 and r24, r24 1bf6e: 09 f4 brne .+2 ; 0x1bf72 1bf70: b0 c0 rjmp .+352 ; 0x1c0d2 1bf72: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1bf76: 81 30 cpi r24, 0x01 ; 1 1bf78: 09 f0 breq .+2 ; 0x1bf7c 1bf7a: ab c0 rjmp .+342 ; 0x1c0d2 usb_timer.start(); 1bf7c: 85 ed ldi r24, 0xD5 ; 213 1bf7e: 91 e1 ldi r25, 0x11 ; 17 1bf80: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> } else #endif { get_command(); 1bf84: 0e 94 fd 75 call 0xebfa ; 0xebfa // 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) 1bf88: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> 1bf8c: 88 23 and r24, r24 1bf8e: 89 f0 breq .+34 ; 0x1bfb2 return; if(autostart_atmillis.expired(5000)) 1bf90: 68 e8 ldi r22, 0x88 ; 136 1bf92: 73 e1 ldi r23, 0x13 ; 19 1bf94: 8b e7 ldi r24, 0x7B ; 123 1bf96: 96 e1 ldi r25, 0x16 ; 22 1bf98: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1bf9c: 81 11 cpse r24, r1 1bf9e: 09 c0 rjmp .+18 ; 0x1bfb2 return; } autostart_stilltocheck = false; 1bfa0: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.515> if(!mounted) 1bfa4: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1bfa8: 88 23 and r24, r24 1bfaa: 09 f4 brne .+2 ; 0x1bfae 1bfac: 9e c0 rjmp .+316 ; 0x1c0ea 1bfae: 0f 94 af 43 call 0x2875e ; 0x2875e #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1bfb2: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1bfb6: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1bfba: 89 2b or r24, r25 1bfbc: 09 f4 brne .+2 ; 0x1bfc0 1bfbe: 63 c0 rjmp .+198 ; 0x1c086 { cmdbuffer_front_already_processed = false; 1bfc0: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 #ifdef SDSUPPORT if(card.saving) 1bfc4: 80 91 68 13 lds r24, 0x1368 ; 0x801368 1bfc8: 88 23 and r24, r24 1bfca: c1 f1 breq .+112 ; 0x1c03c { // 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) { 1bfcc: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1bfd0: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 1bfd4: 0f 51 subi r16, 0x1F ; 31 1bfd6: 10 4f sbci r17, 0xF0 ; 240 1bfd8: 6b e9 ldi r22, 0x9B ; 155 1bfda: 77 e8 ldi r23, 0x87 ; 135 1bfdc: c8 01 movw r24, r16 1bfde: 0f 94 84 9e call 0x33d08 ; 0x33d08 1bfe2: 89 2b or r24, r25 1bfe4: 09 f0 breq .+2 ; 0x1bfe8 1bfe6: 8e c0 rjmp .+284 ; 0x1c104 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1bfe8: 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)); 1bfec: f8 01 movw r30, r16 1bfee: 01 90 ld r0, Z+ 1bff0: 00 20 and r0, r0 1bff2: e9 f7 brne .-6 ; 0x1bfee 1bff4: 31 97 sbiw r30, 0x01 ; 1 1bff6: bf 01 movw r22, r30 1bff8: 60 1b sub r22, r16 1bffa: 71 0b sbc r23, r17 1bffc: c8 01 movw r24, r16 1bffe: 0f 94 ba 4f call 0x29f74 ; 0x29f74 1c002: 62 e0 ldi r22, 0x02 ; 2 1c004: 70 e0 ldi r23, 0x00 ; 0 1c006: 88 ed ldi r24, 0xD8 ; 216 1c008: 92 e0 ldi r25, 0x02 ; 2 1c00a: 0f 94 ba 4f call 0x29f74 ; 0x29f74 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1c00e: 80 91 fa 15 lds r24, 0x15FA ; 0x8015fa 1c012: 88 23 and r24, r24 1c014: 41 f0 breq .+16 ; 0x1c026 { SERIAL_ERROR_START; 1c016: 8a e5 ldi r24, 0x5A ; 90 1c018: 9e e9 ldi r25, 0x9E ; 158 1c01a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1c01e: 8d ea ldi r24, 0xAD ; 173 1c020: 99 e6 ldi r25, 0x69 ; 105 1c022: 0e 94 de 72 call 0xe5bc ; 0xe5bc card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1c026: 80 91 69 13 lds r24, 0x1369 ; 0x801369 1c02a: 88 23 and r24, r24 1c02c: 09 f4 brne .+2 ; 0x1c030 1c02e: 65 c0 rjmp .+202 ; 0x1c0fa */ void process_commands() { if (!buflen) return; //empty command 1c030: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c034: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c038: 89 2b or r24, r25 1c03a: 11 f0 breq .+4 ; 0x1c040 1c03c: 0e 94 6a 84 call 0x108d4 ; 0x108d4 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1c040: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1c044: 81 11 cpse r24, r1 1c046: 19 c0 rjmp .+50 ; 0x1c07a 1c048: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c04c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c050: 89 2b or r24, r25 1c052: 99 f0 breq .+38 ; 0x1c07a { // 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; 1c054: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb 1c058: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc 1c05c: e2 52 subi r30, 0x22 ; 34 1c05e: f0 4f sbci r31, 0xF0 ; 240 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1c060: 80 81 ld r24, Z 1c062: 82 30 cpi r24, 0x02 ; 2 1c064: 09 f0 breq .+2 ; 0x1c068 1c066: 53 c0 rjmp .+166 ; 0x1c10e { // 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(); 1c068: 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; 1c06a: 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); 1c06c: 81 81 ldd r24, Z+1 ; 0x01 1c06e: 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); 1c070: 0f 94 1d 75 call 0x2ea3a ; 0x2ea3a sei(); 1c074: 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(); 1c076: 0e 94 5e 70 call 0xe0bc ; 0xe0bc */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1c07a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1c07e: 81 11 cpse r24, r1 1c080: 02 c0 rjmp .+4 ; 0x1c086 1c082: 0e 94 e2 72 call 0xe5c4 ; 0xe5c4 } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1c086: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(printingIsPaused()); 1c08a: 0e 94 48 61 call 0xc290 ; 0xc290 1c08e: 0e 94 8c 7a call 0xf518 ; 0xf518 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1c092: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 1c096: 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; 1c098: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> checkHitEndstops(); lcd_update(0); 1c09c: 80 e0 ldi r24, 0x00 ; 0 1c09e: 0e 94 cd 69 call 0xd39a ; 0xd39a 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) { 1c0a2: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1c0a6: 81 11 cpse r24, r1 1c0a8: 07 c0 rjmp .+14 ; 0x1c0b8 return; } avoidRecursion = true; 1c0aa: c0 92 2d 04 sts 0x042D, r12 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> mmu_loop_inner(true); 1c0ae: 81 e0 ldi r24, 0x01 ; 1 1c0b0: 0f 94 f3 64 call 0x2c9e6 ; 0x2c9e6 avoidRecursion = false; 1c0b4: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.503> 1c0b8: e1 14 cp r14, r1 1c0ba: f1 04 cpc r15, r1 1c0bc: 09 f4 brne .+2 ; 0x1c0c0 1c0be: 4b cf rjmp .-362 ; 0x1bf56 1c0c0: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1c0c4: 48 cf rjmp .-368 ; 0x1bf56 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")); 1c0c6: 81 ec ldi r24, 0xC1 ; 193 1c0c8: 98 e6 ldi r25, 0x68 ; 104 1c0ca: 1c cf rjmp .-456 ; 0x1bf04 // 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); 1c0cc: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1c0d0: 4b cf rjmp .-362 ; 0x1bf68 } 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. 1c0d2: 60 e1 ldi r22, 0x10 ; 16 1c0d4: 77 e2 ldi r23, 0x27 ; 39 1c0d6: 85 ed ldi r24, 0xD5 ; 213 1c0d8: 91 e1 ldi r25, 0x11 ; 17 1c0da: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1c0de: 88 23 and r24, r24 1c0e0: 09 f4 brne .+2 ; 0x1c0e4 1c0e2: 50 cf rjmp .-352 ; 0x1bf84 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1c0e4: b0 92 cb 0d sts 0x0DCB, r11 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 1c0e8: 4d cf rjmp .-358 ; 0x1bf84 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1c0ea: 81 e0 ldi r24, 0x01 ; 1 1c0ec: 0f 94 1b 4d call 0x29a36 ; 0x29a36 if(!mounted) //fail 1c0f0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c0f4: 81 11 cpse r24, r1 1c0f6: 5b cf rjmp .-330 ; 0x1bfae 1c0f8: 5c cf rjmp .-328 ; 0x1bfb2 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); 1c0fa: 85 ed ldi r24, 0xD5 ; 213 1c0fc: 99 e6 ldi r25, 0x69 ; 105 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c0fe: 0e 94 de 72 call 0xe5bc ; 0xe5bc 1c102: 9e cf rjmp .-196 ; 0x1c040 if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1c104: 0f 94 82 41 call 0x28304 ; 0x28304 SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c108: 83 ec ldi r24, 0xC3 ; 195 1c10a: 99 e6 ldi r25, 0x69 ; 105 1c10c: f8 cf rjmp .-16 ; 0x1c0fe // 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){ 1c10e: 86 30 cpi r24, 0x06 ; 6 1c110: 09 f0 breq .+2 ; 0x1c114 1c112: b1 cf rjmp .-158 ; 0x1c076 1c114: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1c118: 81 11 cpse r24, r1 1c11a: ad cf rjmp .-166 ; 0x1c076 cli(); 1c11c: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1c11e: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1c120: 81 e0 ldi r24, 0x01 ; 1 1c122: 90 e0 ldi r25, 0x00 ; 0 1c124: a5 cf rjmp .-182 ; 0x1c070 { 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; 1c126: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1c128: 88 3c cpi r24, 0xC8 ; 200 1c12a: 91 05 cpc r25, r1 1c12c: 09 f0 breq .+2 ; 0x1c130 1c12e: 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(); 1c130: 0e 94 56 75 call 0xeaac ; 0xeaac 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; 1c134: 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; 1c136: 82 ea ldi r24, 0xA2 ; 162 1c138: 92 ea ldi r25, 0xA2 ; 162 1c13a: a0 e0 ldi r26, 0x00 ; 0 1c13c: b0 e0 ldi r27, 0x00 ; 0 1c13e: 80 93 24 17 sts 0x1724, r24 ; 0x801724 <__bss_end+0x20> 1c142: 90 93 25 17 sts 0x1725, r25 ; 0x801725 <__bss_end+0x21> 1c146: a0 93 26 17 sts 0x1726, r26 ; 0x801726 <__bss_end+0x22> 1c14a: 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; 1c14e: 10 92 ea 03 sts 0x03EA, r1 ; 0x8003ea <_ZL14iState_sum_min.lto_priv.429> 1c152: 10 92 eb 03 sts 0x03EB, r1 ; 0x8003eb <_ZL14iState_sum_min.lto_priv.429+0x1> 1c156: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec <_ZL14iState_sum_min.lto_priv.429+0x2> 1c15a: 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; 1c15e: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1c162: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1c166: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1c16a: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1c16e: 60 e0 ldi r22, 0x00 ; 0 1c170: 70 e0 ldi r23, 0x00 ; 0 1c172: 8f e7 ldi r24, 0x7F ; 127 1c174: 93 e4 ldi r25, 0x43 ; 67 1c176: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1c17a: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 1c17e: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 1c182: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 1c186: 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; 1c18a: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.427> 1c18e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.427+0x1> 1c192: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.427+0x2> 1c196: 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; 1c19a: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1c19e: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1c1a2: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1c1a6: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1c1aa: 60 e0 ldi r22, 0x00 ; 0 1c1ac: 70 e0 ldi r23, 0x00 ; 0 1c1ae: 8f e7 ldi r24, 0x7F ; 127 1c1b0: 93 e4 ldi r25, 0x43 ; 67 1c1b2: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1c1b6: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 1c1ba: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 1c1be: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 1c1c2: 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); 1c1c6: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1c1c8: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1c1ca: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1c1ce: 88 60 ori r24, 0x08 ; 8 1c1d0: 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)); 1c1d4: 80 91 05 05 lds r24, 0x0505 ; 0x800505 1c1d8: 90 e0 ldi r25, 0x00 ; 0 1c1da: 64 e0 ldi r22, 0x04 ; 4 1c1dc: 95 95 asr r25 1c1de: 87 95 ror r24 1c1e0: 6a 95 dec r22 1c1e2: e1 f7 brne .-8 ; 0x1c1dc 1c1e4: 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; 1c1e8: 8e e1 ldi r24, 0x1E ; 30 1c1ea: 90 e0 ldi r25, 0x00 ; 0 1c1ec: 90 93 dc 03 sts 0x03DC, r25 ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 1c1f0: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db <_ZL8minttemp.lto_priv.422> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1c1f4: c0 90 52 02 lds r12, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 1c1f8: d0 90 53 02 lds r13, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 1c1fc: c6 01 movw r24, r12 1c1fe: 0e 94 b9 bd call 0x17b72 ; 0x17b72 1c202: 20 e0 ldi r18, 0x00 ; 0 1c204: 30 e0 ldi r19, 0x00 ; 0 1c206: 40 ef ldi r20, 0xF0 ; 240 1c208: 51 e4 ldi r21, 0x41 ; 65 1c20a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1c20e: 87 ff sbrs r24, 7 1c210: a4 c9 rjmp .-3256 ; 0x1b55a #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1c212: f0 e1 ldi r31, 0x10 ; 16 1c214: cf 1a sub r12, r31 1c216: d1 08 sbc r13, r1 1c218: d0 92 53 02 sts 0x0253, r13 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 1c21c: c0 92 52 02 sts 0x0252, r12 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 1c220: e9 cf rjmp .-46 ; 0x1c1f4 0001c222 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1c222: 0f 93 push r16 1c224: 1f 93 push r17 1c226: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1c228: 0e 94 71 b1 call 0x162e2 ; 0x162e2 if (*str != '.') 1c22c: fc 01 movw r30, r24 1c22e: 20 81 ld r18, Z 1c230: 2e 32 cpi r18, 0x2E ; 46 1c232: 11 f0 breq .+4 ; 0x1c238 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 1c234: 80 e0 ldi r24, 0x00 ; 0 1c236: 34 c0 rjmp .+104 ; 0x1c2a0 // 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); 1c238: b8 01 movw r22, r16 1c23a: 6e 5f subi r22, 0xFE ; 254 1c23c: 7f 4f sbci r23, 0xFF ; 255 1c23e: 01 96 adiw r24, 0x01 ; 1 1c240: 0e 94 71 b1 call 0x162e2 ; 0x162e2 if (*str != '.') 1c244: fc 01 movw r30, r24 1c246: 20 81 ld r18, Z 1c248: 2e 32 cpi r18, 0x2E ; 46 1c24a: a1 f7 brne .-24 ; 0x1c234 return false; ++str; } str = Number(str, version + 2); 1c24c: b8 01 movw r22, r16 1c24e: 6c 5f subi r22, 0xFC ; 252 1c250: 7f 4f sbci r23, 0xFF ; 255 1c252: 01 96 adiw r24, 0x01 ; 1 1c254: 0e 94 71 b1 call 0x162e2 ; 0x162e2 version[3] = FIRMWARE_REVISION_RELEASED; 1c258: 20 e4 ldi r18, 0x40 ; 64 1c25a: 30 e0 ldi r19, 0x00 ; 0 1c25c: f8 01 movw r30, r16 1c25e: 37 83 std Z+7, r19 ; 0x07 1c260: 26 83 std Z+6, r18 ; 0x06 1c262: fc 01 movw r30, r24 1c264: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1c266: 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'; 1c268: 89 2f mov r24, r25 1c26a: 8f 7d andi r24, 0xDF ; 223 1c26c: c1 f1 breq .+112 ; 0x1c2de 1c26e: 87 ef ldi r24, 0xF7 ; 247 1c270: 89 0f add r24, r25 1c272: 82 30 cpi r24, 0x02 ; 2 1c274: a0 f1 brcs .+104 ; 0x1c2de 1c276: 9d 30 cpi r25, 0x0D ; 13 1c278: 91 f1 breq .+100 ; 0x1c2de 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 == '-'){ 1c27a: 9d 32 cpi r25, 0x2D ; 45 1c27c: 99 f7 brne .-26 ; 0x1c264 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c27e: 11 96 adiw r26, 0x01 ; 1 1c280: 9c 91 ld r25, X 1c282: 92 34 cpi r25, 0x42 ; 66 1c284: e1 f0 breq .+56 ; 0x1c2be 1c286: 7c f4 brge .+30 ; 0x1c2a6 1c288: 91 34 cpi r25, 0x41 ; 65 1c28a: a1 f6 brne .-88 ; 0x1c234 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); 1c28c: 0a 5f subi r16, 0xFA ; 250 1c28e: 1f 4f sbci r17, 0xFF ; 255 1c290: 28 e0 ldi r18, 0x08 ; 8 1c292: 30 e0 ldi r19, 0x00 ; 0 1c294: 45 e0 ldi r20, 0x05 ; 5 1c296: 67 e4 ldi r22, 0x47 ; 71 1c298: 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); 1c29a: cf 01 movw r24, r30 1c29c: 0e 94 27 b5 call 0x16a4e ; 0x16a4e // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1c2a0: 1f 91 pop r17 1c2a2: 0f 91 pop r16 1c2a4: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c2a6: 94 34 cpi r25, 0x44 ; 68 1c2a8: 91 f0 breq .+36 ; 0x1c2ce 1c2aa: 92 35 cpi r25, 0x52 ; 82 1c2ac: 19 f6 brne .-122 ; 0x1c234 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); 1c2ae: 0a 5f subi r16, 0xFA ; 250 1c2b0: 1f 4f sbci r17, 0xFF ; 255 1c2b2: 20 e2 ldi r18, 0x20 ; 32 1c2b4: 30 e0 ldi r19, 0x00 ; 0 1c2b6: 42 e0 ldi r20, 0x02 ; 2 1c2b8: 6b e3 ldi r22, 0x3B ; 59 1c2ba: 75 e8 ldi r23, 0x85 ; 133 1c2bc: ee cf rjmp .-36 ; 0x1c29a 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); 1c2be: 0a 5f subi r16, 0xFA ; 250 1c2c0: 1f 4f sbci r17, 0xFF ; 255 1c2c2: 20 e1 ldi r18, 0x10 ; 16 1c2c4: 30 e0 ldi r19, 0x00 ; 0 1c2c6: 44 e0 ldi r20, 0x04 ; 4 1c2c8: 62 e4 ldi r22, 0x42 ; 66 1c2ca: 75 e8 ldi r23, 0x85 ; 133 1c2cc: e6 cf rjmp .-52 ; 0x1c29a 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); 1c2ce: 0a 5f subi r16, 0xFA ; 250 1c2d0: 1f 4f sbci r17, 0xFF ; 255 1c2d2: 30 e0 ldi r19, 0x00 ; 0 1c2d4: 20 e0 ldi r18, 0x00 ; 0 1c2d6: 43 e0 ldi r20, 0x03 ; 3 1c2d8: 6e e3 ldi r22, 0x3E ; 62 1c2da: 75 e8 ldi r23, 0x85 ; 133 1c2dc: de cf rjmp .-68 ; 0x1c29a // 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; 1c2de: 81 e0 ldi r24, 0x01 ; 1 1c2e0: df cf rjmp .-66 ; 0x1c2a0 0001c2e2 : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c2e2: cf 93 push r28 1c2e4: 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) 1c2e6: 8c e6 ldi r24, 0x6C ; 108 1c2e8: 91 e4 ldi r25, 0x41 ; 65 1c2ea: 0e 94 3c 6d call 0xda78 ; 0xda78 1c2ee: 40 e0 ldi r20, 0x00 ; 0 1c2f0: 60 e0 ldi r22, 0x00 ; 0 1c2f2: 0f 94 89 2d call 0x25b12 ; 0x25b12 1c2f6: 81 11 cpse r24, r1 1c2f8: 20 c0 rjmp .+64 ; 0x1c33a #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c2fa: 0e 94 ad 6c call 0xd95a ; 0xd95a if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c2fe: c2 30 cpi r28, 0x02 ; 2 1c300: e0 f0 brcs .+56 ; 0x1c33a 1c302: 8c 17 cp r24, r28 1c304: d0 f0 brcs .+52 ; 0x1c33a softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c306: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c308: 8a ea ldi r24, 0xAA ; 170 1c30a: 95 e5 ldi r25, 0x55 ; 85 1c30c: dc 01 movw r26, r24 1c30e: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8f8> 1c312: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8f9> 1c316: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8fa> 1c31a: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8fb> boot_app_flags = BOOT_APP_FLG_USER0; 1c31e: 80 e8 ldi r24, 0x80 ; 128 1c320: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8f7> boot_copy_size = 0; 1c324: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8f5> 1c328: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8f4> bootapp_reboot_user0(lang << 3); 1c32c: cc 0f add r28, r28 1c32e: cc 0f add r28, r28 1c330: cc 0f add r28, r28 boot_reserved = reserved; 1c332: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8f6> // bootapp_print_vars(); softReset(); 1c336: 0e 94 32 61 call 0xc264 ; 0xc264 lang_boot_update_start(lang); lcd_update_enable(true); 1c33a: 81 e0 ldi r24, 0x01 ; 1 1c33c: 0e 94 4b 6a call 0xd496 ; 0xd496 menu_goto(lcd_language_menu, 0, true, true); 1c340: 21 e0 ldi r18, 0x01 ; 1 1c342: 41 e0 ldi r20, 0x01 ; 1 1c344: 70 e0 ldi r23, 0x00 ; 0 1c346: 60 e0 ldi r22, 0x00 ; 0 1c348: 85 e1 ldi r24, 0x15 ; 21 1c34a: 97 e3 ldi r25, 0x37 ; 55 1c34c: 0f 94 87 93 call 0x3270e ; 0x3270e 1c350: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c354: cf 91 pop r28 1c356: 08 95 ret 0001c358 : 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)) { 1c358: 0f 93 push r16 1c35a: 1f 93 push r17 1c35c: cf 93 push r28 1c35e: df 93 push r29 1c360: eb 01 movw r28, r22 1c362: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1c364: 81 30 cpi r24, 0x01 ; 1 1c366: 81 f0 breq .+32 ; 0x1c388 1c368: 82 30 cpi r24, 0x02 ; 2 1c36a: 89 f0 breq .+34 ; 0x1c38e case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1c36c: 87 eb ldi r24, 0xB7 ; 183 1c36e: 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); 1c370: 0e 94 3c 6d call 0xda78 ; 0xda78 1c374: 22 e0 ldi r18, 0x02 ; 2 1c376: a8 01 movw r20, r16 1c378: bc 01 movw r22, r24 1c37a: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1c37c: df 91 pop r29 1c37e: cf 91 pop r28 1c380: 1f 91 pop r17 1c382: 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); 1c384: 0d 94 ec 94 jmp 0x329d8 ; 0x329d8 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); 1c388: 80 eb ldi r24, 0xB0 ; 176 1c38a: 90 e4 ldi r25, 0x40 ; 64 1c38c: f1 cf rjmp .-30 ; 0x1c370 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c38e: 87 ea ldi r24, 0xA7 ; 167 1c390: 90 e4 ldi r25, 0x40 ; 64 1c392: ee cf rjmp .-36 ; 0x1c370 0001c394 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c394: 44 e1 ldi r20, 0x14 ; 20 1c396: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1c398: 66 23 and r22, r22 1c39a: 89 f0 breq .+34 ; 0x1c3be strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c39c: bc 01 movw r22, r24 1c39e: 89 e0 ldi r24, 0x09 ; 9 1c3a0: 95 e0 ldi r25, 0x05 ; 5 1c3a2: 0f 94 6a 9e call 0x33cd4 ; 0x33cd4 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1c3a6: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL18lcd_status_message.lto_priv.419+0x14> lcd_status_message_idx = 0; // Print message from beginning 1c3aa: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1c3ae: 8a e7 ldi r24, 0x7A ; 122 1c3b0: 98 e6 ldi r25, 0x68 ; 104 1c3b2: 0e 94 de 72 call 0xe5bc ; 0xe5bc // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1c3b6: 81 e0 ldi r24, 0x01 ; 1 1c3b8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1c3bc: 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); 1c3be: bc 01 movw r22, r24 1c3c0: 89 e0 ldi r24, 0x09 ; 9 1c3c2: 95 e0 ldi r25, 0x05 ; 5 1c3c4: 0f 94 fd a6 call 0x34dfa ; 0x34dfa 1c3c8: ee cf rjmp .-36 ; 0x1c3a6 0001c3ca : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1c3ca: 90 91 8e 03 lds r25, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 1c3ce: 89 17 cp r24, r25 1c3d0: 80 f4 brcc .+32 ; 0x1c3f2 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1c3d2: 91 30 cpi r25, 0x01 ; 1 1c3d4: 61 f4 brne .+24 ; 0x1c3ee } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1c3d6: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 1c3da: 88 23 and r24, r24 1c3dc: 51 f0 breq .+20 ; 0x1c3f2 1c3de: 40 e2 ldi r20, 0x20 ; 32 1c3e0: 5e e4 ldi r21, 0x4E ; 78 1c3e2: 60 e0 ldi r22, 0x00 ; 0 1c3e4: 70 e0 ldi r23, 0x00 ; 0 1c3e6: 8e e1 ldi r24, 0x1E ; 30 1c3e8: 95 e0 ldi r25, 0x05 ; 5 1c3ea: 0d 94 b4 0f jmp 0x21f68 ; 0x21f68 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1c3ee: 80 e0 ldi r24, 0x00 ; 0 1c3f0: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1c3f2: 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; } 1c3f4: 08 95 ret 0001c3f6 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1c3f6: ef 92 push r14 1c3f8: ff 92 push r15 1c3fa: 1f 93 push r17 1c3fc: cf 93 push r28 1c3fe: df 93 push r29 1c400: ec 01 movw r28, r24 1c402: 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)) { 1c404: 86 2f mov r24, r22 1c406: 0e 94 e5 e1 call 0x1c3ca ; 0x1c3ca 1c40a: 88 23 and r24, r24 1c40c: e9 f0 breq .+58 ; 0x1c448 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1c40e: be 01 movw r22, r28 1c410: 89 e0 ldi r24, 0x09 ; 9 1c412: 95 e0 ldi r25, 0x05 ; 5 1c414: 0f 94 2b 9e call 0x33c56 ; 0x33c56 1c418: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1c41a: 8e e1 ldi r24, 0x1E ; 30 1c41c: 95 e0 ldi r25, 0x05 ; 5 1c41e: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> lcd_status_message_level = severity; 1c422: 10 93 8e 03 sts 0x038E, r17 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> custom_message_type = CustomMsg::Status; 1c426: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 1c42a: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 1c42e: ef 28 or r14, r15 1c430: 59 f0 breq .+22 ; 0x1c448 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1c432: 61 e0 ldi r22, 0x01 ; 1 1c434: ce 01 movw r24, r28 1c436: 0e 94 ca e1 call 0x1c394 ; 0x1c394 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c43a: df 91 pop r29 1c43c: cf 91 pop r28 1c43e: 1f 91 pop r17 1c440: ff 90 pop r15 1c442: 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(); 1c444: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c448: df 91 pop r29 1c44a: cf 91 pop r28 1c44c: 1f 91 pop r17 1c44e: ff 90 pop r15 1c450: ef 90 pop r14 1c452: 08 95 ret 0001c454 : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1c454: ef 92 push r14 1c456: ff 92 push r15 1c458: 1f 93 push r17 1c45a: cf 93 push r28 1c45c: df 93 push r29 1c45e: 18 2f mov r17, r24 1c460: eb 01 movw r28, r22 1c462: 7a 01 movw r14, r20 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1c464: 80 e0 ldi r24, 0x00 ; 0 1c466: 0f 94 71 2c call 0x258e2 ; 0x258e2 lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1c46a: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c46e: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c472: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c476: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c47a: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 1c47e: 80 e0 ldi r24, 0x00 ; 0 1c480: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_clear(); 1c484: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1c488: 87 e7 ldi r24, 0x77 ; 119 1c48a: 9f e3 ldi r25, 0x3F ; 63 1c48c: 0e 94 3c 6d call 0xda78 ; 0xda78 1c490: ac 01 movw r20, r24 1c492: 60 e0 ldi r22, 0x00 ; 0 1c494: 80 e0 ldi r24, 0x00 ; 0 1c496: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1c49a: 87 e6 ldi r24, 0x67 ; 103 1c49c: 9f e3 ldi r25, 0x3F ; 63 1c49e: 0e 94 3c 6d call 0xda78 ; 0xda78 1c4a2: ac 01 movw r20, r24 1c4a4: 61 e0 ldi r22, 0x01 ; 1 1c4a6: 80 e0 ldi r24, 0x00 ; 0 1c4a8: 0e 94 1a 6a call 0xd434 ; 0xd434 switch (testError) 1c4ac: 11 50 subi r17, 0x01 ; 1 1c4ae: 19 30 cpi r17, 0x09 ; 9 1c4b0: 88 f4 brcc .+34 ; 0x1c4d4 1c4b2: e1 2f mov r30, r17 1c4b4: f0 e0 ldi r31, 0x00 ; 0 1c4b6: 88 27 eor r24, r24 1c4b8: ef 59 subi r30, 0x9F ; 159 1c4ba: fd 41 sbci r31, 0x1D ; 29 1c4bc: 8f 4f sbci r24, 0xFF ; 255 1c4be: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 1c4c2: a2 e2 ldi r26, 0x22 ; 34 1c4c4: ae e2 ldi r26, 0x2E ; 46 1c4c6: c6 e2 ldi r28, 0x26 ; 38 1c4c8: e7 e2 ldi r30, 0x27 ; 39 1c4ca: f3 e2 ldi r31, 0x23 ; 35 1c4cc: f6 e2 ldi r31, 0x26 ; 38 1c4ce: f9 e2 ldi r31, 0x29 ; 41 1c4d0: fc e2 ldi r31, 0x2C ; 44 1c4d2: 08 e3 ldi r16, 0x38 ; 56 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1c4d4: 83 e5 ldi r24, 0x53 ; 83 1c4d6: 9f e3 ldi r25, 0x3F ; 63 1c4d8: 0e 94 3c 6d call 0xda78 ; 0xda78 1c4dc: ac 01 movw r20, r24 1c4de: 62 e0 ldi r22, 0x02 ; 2 1c4e0: 80 e0 ldi r24, 0x00 ; 0 1c4e2: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1c4e6: 83 e4 ldi r24, 0x43 ; 67 1c4e8: 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)); 1c4ea: 0e 94 3c 6d call 0xda78 ; 0xda78 1c4ee: ac 01 movw r20, r24 1c4f0: 63 e0 ldi r22, 0x03 ; 3 1c4f2: 80 e0 ldi r24, 0x00 ; 0 1c4f4: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1c4f8: 68 ee ldi r22, 0xE8 ; 232 1c4fa: 73 e0 ldi r23, 0x03 ; 3 1c4fc: 80 e0 ldi r24, 0x00 ; 0 1c4fe: 90 e0 ldi r25, 0x00 ; 0 1c500: 0f 94 4d 0d call 0x21a9a ; 0x21a9a 1c504: 80 e0 ldi r24, 0x00 ; 0 1c506: 0f 94 71 2c call 0x258e2 ; 0x258e2 lcd_beeper_quick_feedback(); do { _delay(100); 1c50a: 64 e6 ldi r22, 0x64 ; 100 1c50c: 70 e0 ldi r23, 0x00 ; 0 1c50e: 80 e0 ldi r24, 0x00 ; 0 1c510: 90 e0 ldi r25, 0x00 ; 0 1c512: 0f 94 4d 0d call 0x21a9a ; 0x21a9a manage_heater(); 1c516: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(); 1c51a: 80 e0 ldi r24, 0x00 ; 0 1c51c: 0e 94 8c 7a call 0xf518 ; 0xf518 } while (!lcd_clicked()); 1c520: 0e 94 23 6c call 0xd846 ; 0xd846 1c524: 88 23 and r24, r24 1c526: 89 f3 breq .-30 ; 0x1c50a LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1c528: 89 ec ldi r24, 0xC9 ; 201 1c52a: 9f e3 ldi r25, 0x3F ; 63 1c52c: 0e 94 3c 6d call 0xda78 ; 0xda78 1c530: 62 e0 ldi r22, 0x02 ; 2 1c532: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 lcd_return_to_status(); } 1c536: df 91 pop r29 1c538: cf 91 pop r28 1c53a: 1f 91 pop r17 1c53c: ff 90 pop r15 1c53e: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1c540: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 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)); 1c544: 86 e3 ldi r24, 0x36 ; 54 1c546: 9f e3 ldi r25, 0x3F ; 63 1c548: 0e 94 3c 6d call 0xda78 ; 0xda78 1c54c: ac 01 movw r20, r24 1c54e: 62 e0 ldi r22, 0x02 ; 2 1c550: 80 e0 ldi r24, 0x00 ; 0 1c552: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c556: 87 e2 ldi r24, 0x27 ; 39 1c558: 9f e3 ldi r25, 0x3F ; 63 1c55a: c7 cf rjmp .-114 ; 0x1c4ea break; case TestError::Endstops: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOPS)); 1c55c: 8c e1 ldi r24, 0x1C ; 28 1c55e: 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)); 1c560: 0e 94 3c 6d call 0xda78 ; 0xda78 1c564: ac 01 movw r20, r24 1c566: 62 e0 ldi r22, 0x02 ; 2 1c568: 80 e0 ldi r24, 0x00 ; 0 1c56a: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c56e: 87 e2 ldi r24, 0x27 ; 39 1c570: 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)); 1c572: 0e 94 3c 6d call 0xda78 ; 0xda78 1c576: ac 01 movw r20, r24 1c578: 63 e0 ldi r22, 0x03 ; 3 1c57a: 80 e0 ldi r24, 0x00 ; 0 1c57c: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(18, 3); 1c580: 63 e0 ldi r22, 0x03 ; 3 1c582: 82 e1 ldi r24, 0x12 ; 18 1c584: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print(_error_1); 1c588: ce 01 movw r24, r28 1c58a: 1e c0 rjmp .+60 ; 0x1c5c8 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)); 1c58c: 84 e1 ldi r24, 0x14 ; 20 1c58e: 9f e3 ldi r25, 0x3F ; 63 1c590: 0e 94 3c 6d call 0xda78 ; 0xda78 1c594: ac 01 movw r20, r24 1c596: 62 e0 ldi r22, 0x02 ; 2 1c598: 80 e0 ldi r24, 0x00 ; 0 1c59a: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(18, 2); 1c59e: 62 e0 ldi r22, 0x02 ; 2 1c5a0: 82 e1 ldi r24, 0x12 ; 18 1c5a2: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print(_error_1); 1c5a6: ce 01 movw r24, r28 1c5a8: 0e 94 0d 6c call 0xd81a ; 0xd81a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1c5ac: 8a e0 ldi r24, 0x0A ; 10 1c5ae: 9f e3 ldi r25, 0x3F ; 63 1c5b0: 0e 94 3c 6d call 0xda78 ; 0xda78 1c5b4: ac 01 movw r20, r24 1c5b6: 63 e0 ldi r22, 0x03 ; 3 1c5b8: 80 e0 ldi r24, 0x00 ; 0 1c5ba: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(18, 3); 1c5be: 63 e0 ldi r22, 0x03 ; 3 1c5c0: 82 e1 ldi r24, 0x12 ; 18 1c5c2: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print(_error_2); 1c5c6: 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); 1c5c8: 0e 94 0d 6c call 0xd81a ; 0xd81a 1c5cc: 95 cf rjmp .-214 ; 0x1c4f8 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)); 1c5ce: 88 ef ldi r24, 0xF8 ; 248 1c5d0: 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)); 1c5d2: 0e 94 3c 6d call 0xda78 ; 0xda78 1c5d6: ac 01 movw r20, r24 1c5d8: 62 e0 ldi r22, 0x02 ; 2 1c5da: 80 e0 ldi r24, 0x00 ; 0 1c5dc: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1c5e0: 84 e1 ldi r24, 0x14 ; 20 1c5e2: 9f e3 ldi r25, 0x3F ; 63 1c5e4: c6 cf rjmp .-116 ; 0x1c572 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)); 1c5e6: 80 e9 ldi r24, 0x90 ; 144 1c5e8: 94 e4 ldi r25, 0x44 ; 68 1c5ea: ba cf rjmp .-140 ; 0x1c560 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)); 1c5ec: 8d e7 ldi r24, 0x7D ; 125 1c5ee: 94 e4 ldi r25, 0x44 ; 68 1c5f0: b7 cf rjmp .-146 ; 0x1c560 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)); 1c5f2: 89 ee ldi r24, 0xE9 ; 233 1c5f4: 9e e3 ldi r25, 0x3E ; 62 1c5f6: ed cf rjmp .-38 ; 0x1c5d2 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)); 1c5f8: 8b ed ldi r24, 0xDB ; 219 1c5fa: 9e e3 ldi r25, 0x3E ; 62 1c5fc: 0e 94 3c 6d call 0xda78 ; 0xda78 1c600: ac 01 movw r20, r24 1c602: 62 e0 ldi r22, 0x02 ; 2 1c604: 80 e0 ldi r24, 0x00 ; 0 1c606: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1c60a: 84 ed ldi r24, 0xD4 ; 212 1c60c: 9e e3 ldi r25, 0x3E ; 62 1c60e: b1 cf rjmp .-158 ; 0x1c572 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1c610: 82 ec ldi r24, 0xC2 ; 194 1c612: 9e e3 ldi r25, 0x3E ; 62 1c614: 0e 94 3c 6d call 0xda78 ; 0xda78 1c618: ac 01 movw r20, r24 1c61a: 62 e0 ldi r22, 0x02 ; 2 1c61c: 80 e0 ldi r24, 0x00 ; 0 1c61e: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1c622: 88 eb ldi r24, 0xB8 ; 184 1c624: 9e e3 ldi r25, 0x3E ; 62 1c626: a5 cf rjmp .-182 ; 0x1c572 0001c628 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1c628: 8f 92 push r8 1c62a: 9f 92 push r9 1c62c: af 92 push r10 1c62e: bf 92 push r11 1c630: cf 92 push r12 1c632: df 92 push r13 1c634: ef 92 push r14 1c636: ff 92 push r15 1c638: 0f 93 push r16 1c63a: 1f 93 push r17 1c63c: cf 93 push r28 1c63e: df 93 push r29 1c640: f8 2e mov r15, r24 1c642: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c646: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c64a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c64e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c652: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1c656: 4b 01 movw r8, r22 1c658: 6b 01 movw r12, r22 1c65a: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c65e: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c662: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c666: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c66a: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1c66e: 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 1c670: 9c e3 ldi r25, 0x3C ; 60 1c672: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1c674: 88 ec ldi r24, 0xC8 ; 200 1c676: 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); 1c678: ff 20 and r15, r15 1c67a: 31 f0 breq .+12 ; 0x1c688 1c67c: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1c67e: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1c680: 24 eb ldi r18, 0xB4 ; 180 1c682: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1c684: 90 e0 ldi r25, 0x00 ; 0 1c686: 80 e0 ldi r24, 0x00 ; 0 1c688: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 1c68c: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 target_temperature_bed = (_isbed) ? 100 : 0; 1c690: 84 e6 ldi r24, 0x64 ; 100 1c692: 90 e0 ldi r25, 0x00 ; 0 1c694: f1 10 cpse r15, r1 1c696: 02 c0 rjmp .+4 ; 0x1c69c 1c698: 90 e0 ldi r25, 0x00 ; 0 1c69a: 80 e0 ldi r24, 0x00 ; 0 1c69c: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee 1c6a0: 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(); 1c6a4: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1c6a8: 81 e0 ldi r24, 0x01 ; 1 1c6aa: 0e 94 8c 7a call 0xf518 ; 0xf518 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c6ae: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1c6b0: 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 1c6b2: 85 e0 ldi r24, 0x05 ; 5 1c6b4: 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) 1c6b6: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1c6ba: 81 11 cpse r24, r1 1c6bc: 1c c0 rjmp .+56 ; 0x1c6f6 { manage_heater(); 1c6be: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1c6c2: 81 e0 ldi r24, 0x01 ; 1 1c6c4: 0e 94 8c 7a call 0xf518 ; 0xf518 _progress = (_isbed? 1c6c8: 00 e9 ldi r16, 0x90 ; 144 1c6ca: 11 e0 ldi r17, 0x01 ; 1 1c6cc: 20 e0 ldi r18, 0x00 ; 0 1c6ce: 42 e0 ldi r20, 0x02 ; 2 1c6d0: 6b 2d mov r22, r11 1c6d2: 87 e0 ldi r24, 0x07 ; 7 1c6d4: f1 10 cpse r15, r1 1c6d6: 01 c0 rjmp .+2 ; 0x1c6da 1c6d8: 88 e0 ldi r24, 0x08 ; 8 1c6da: 0e 94 33 b9 call 0x17266 ; 0x17266 1c6de: 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 1c6e0: 8e 2d mov r24, r14 1c6e2: 69 2d mov r22, r9 1c6e4: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 1c6e8: 91 11 cpse r25, r1 1c6ea: 02 c0 rjmp .+4 ; 0x1c6f0 1c6ec: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c6f0: e3 94 inc r14 1c6f2: ea 10 cpse r14, r10 1c6f4: e0 cf rjmp .-64 ; 0x1c6b6 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1c6f6: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c6fa: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c6fe: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c702: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c706: 0f 94 f7 31 call 0x263ee ; 0x263ee 1c70a: b6 01 movw r22, r12 1c70c: dd 0c add r13, r13 1c70e: 88 0b sbc r24, r24 1c710: 99 0b sbc r25, r25 1c712: 4e 01 movw r8, r28 1c714: dd 0f add r29, r29 1c716: aa 08 sbc r10, r10 1c718: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c71a: ff 20 and r15, r15 1c71c: 09 f4 brne .+2 ; 0x1c720 1c71e: 4d c0 rjmp .+154 ; 0x1c7ba 1c720: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1c724: 9b 01 movw r18, r22 1c726: ac 01 movw r20, r24 1c728: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c72c: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c730: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c734: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c738: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c73c: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1c740: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c742: c5 01 movw r24, r10 1c744: b4 01 movw r22, r8 1c746: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1c74a: 9b 01 movw r18, r22 1c74c: ac 01 movw r20, r24 1c74e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c752: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c756: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c75a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c75e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c762: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c766: 10 91 ce 11 lds r17, 0x11CE ; 0x8011ce 1c76a: 11 11 cpse r17, r1 1c76c: 0c c0 rjmp .+24 ; 0x1c786 1c76e: f1 10 cpse r15, r1 1c770: 44 c0 rjmp .+136 ; 0x1c7fa 1c772: 69 30 cpi r22, 0x09 ; 9 1c774: 71 05 cpc r23, r1 1c776: 0c f0 brlt .+2 ; 0x1c77a 1c778: 46 c0 rjmp .+140 ; 0x1c806 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c77a: 8e e1 ldi r24, 0x1E ; 30 1c77c: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1c77e: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c780: c8 17 cp r28, r24 1c782: d9 07 cpc r29, r25 1c784: 3c f4 brge .+14 ; 0x1c794 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1c786: 4a ed ldi r20, 0xDA ; 218 1c788: 52 e0 ldi r21, 0x02 ; 2 1c78a: ba 01 movw r22, r20 1c78c: 80 e0 ldi r24, 0x00 ; 0 1c78e: 0e 94 2a e2 call 0x1c454 ; 0x1c454 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1c792: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1c794: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1c798: 81 e0 ldi r24, 0x01 ; 1 1c79a: 0e 94 8c 7a call 0xf518 ; 0xf518 return _stepresult; } 1c79e: 81 2f mov r24, r17 1c7a0: df 91 pop r29 1c7a2: cf 91 pop r28 1c7a4: 1f 91 pop r17 1c7a6: 0f 91 pop r16 1c7a8: ff 90 pop r15 1c7aa: ef 90 pop r14 1c7ac: df 90 pop r13 1c7ae: cf 90 pop r12 1c7b0: bf 90 pop r11 1c7b2: af 90 pop r10 1c7b4: 9f 90 pop r9 1c7b6: 8f 90 pop r8 1c7b8: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c7ba: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1c7be: 9b 01 movw r18, r22 1c7c0: ac 01 movw r20, r24 1c7c2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c7c6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c7ca: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c7ce: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c7d2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c7d6: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1c7da: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c7dc: c5 01 movw r24, r10 1c7de: b4 01 movw r22, r8 1c7e0: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1c7e4: 9b 01 movw r18, r22 1c7e6: ac 01 movw r20, r24 1c7e8: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c7ec: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c7f0: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c7f4: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c7f8: b2 cf rjmp .-156 ; 0x1c75e */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c7fa: 89 e0 ldi r24, 0x09 ; 9 1c7fc: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c7fe: 6e 31 cpi r22, 0x1E ; 30 1c800: 71 05 cpc r23, r1 1c802: 0c f4 brge .+2 ; 0x1c806 1c804: bc cf rjmp .-136 ; 0x1c77e else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1c806: 4a ed ldi r20, 0xDA ; 218 1c808: 52 e0 ldi r21, 0x02 ; 2 1c80a: ba 01 movw r22, r20 1c80c: 81 e0 ldi r24, 0x01 ; 1 1c80e: 0e 94 2a e2 call 0x1c454 ; 0x1c454 1c812: c0 cf rjmp .-128 ; 0x1c794 0001c814 : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1c814: 2f 92 push r2 1c816: 3f 92 push r3 1c818: 4f 92 push r4 1c81a: 5f 92 push r5 1c81c: 6f 92 push r6 1c81e: 7f 92 push r7 1c820: 8f 92 push r8 1c822: 9f 92 push r9 1c824: af 92 push r10 1c826: bf 92 push r11 1c828: cf 92 push r12 1c82a: df 92 push r13 1c82c: ef 92 push r14 1c82e: ff 92 push r15 1c830: 0f 93 push r16 1c832: 1f 93 push r17 1c834: cf 93 push r28 1c836: df 93 push r29 1c838: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1c83a: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 manage_inactivity(true); 1c83e: 81 e0 ldi r24, 0x01 ; 1 1c840: 0e 94 8c 7a call 0xf518 ; 0xf518 if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1c844: 18 01 movw r2, r16 1c846: 22 0c add r2, r2 1c848: 33 1c adc r3, r3 1c84a: 22 0c add r2, r2 1c84c: 33 1c adc r3, r3 1c84e: e1 01 movw r28, r2 1c850: cb 50 subi r28, 0x0B ; 11 1c852: de 4e sbci r29, 0xEE ; 238 1c854: 88 80 ld r8, Y 1c856: 99 80 ldd r9, Y+1 ; 0x01 1c858: aa 80 ldd r10, Y+2 ; 0x02 1c85a: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1c85c: 20 e0 ldi r18, 0x00 ; 0 1c85e: 30 e0 ldi r19, 0x00 ; 0 1c860: 40 e0 ldi r20, 0x00 ; 0 1c862: 50 e4 ldi r21, 0x40 ; 64 1c864: c5 01 movw r24, r10 1c866: b4 01 movw r22, r8 1c868: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1c86c: 68 83 st Y, r22 1c86e: 79 83 std Y+1, r23 ; 0x01 1c870: 8a 83 std Y+2, r24 ; 0x02 1c872: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c874: 60 e0 ldi r22, 0x00 ; 0 1c876: 70 e0 ldi r23, 0x00 ; 0 1c878: 84 e3 ldi r24, 0x34 ; 52 1c87a: 92 e4 ldi r25, 0x42 ; 66 1c87c: 0f 94 11 85 call 0x30a22 ; 0x30a22 1c880: 95 e0 ldi r25, 0x05 ; 5 1c882: e9 2e mov r14, r25 1c884: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1c886: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 current_position[axis] = current_position[axis] + move; 1c88a: 20 e0 ldi r18, 0x00 ; 0 1c88c: 30 e0 ldi r19, 0x00 ; 0 1c88e: 48 e4 ldi r20, 0x48 ; 72 1c890: 52 e4 ldi r21, 0x42 ; 66 1c892: 68 81 ld r22, Y 1c894: 79 81 ldd r23, Y+1 ; 0x01 1c896: 8a 81 ldd r24, Y+2 ; 0x02 1c898: 9b 81 ldd r25, Y+3 ; 0x03 1c89a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1c89e: 68 83 st Y, r22 1c8a0: 79 83 std Y+1, r23 ; 0x01 1c8a2: 8a 83 std Y+2, r24 ; 0x02 1c8a4: 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); 1c8a6: 6c e6 ldi r22, 0x6C ; 108 1c8a8: 70 e0 ldi r23, 0x00 ; 0 1c8aa: 8e e2 ldi r24, 0x2E ; 46 1c8ac: 0e 94 6c c0 call 0x180d8 ; 0x180d8 st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1c8b0: 60 e0 ldi r22, 0x00 ; 0 1c8b2: 70 e0 ldi r23, 0x00 ; 0 1c8b4: 88 e4 ldi r24, 0x48 ; 72 1c8b6: 93 e4 ldi r25, 0x43 ; 67 1c8b8: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1c8bc: 0f 94 14 22 call 0x24428 ; 0x24428 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1c8c0: 80 91 89 03 lds r24, 0x0389 ; 0x800389 1c8c4: 62 e2 ldi r22, 0x22 ; 34 1c8c6: 70 e0 ldi r23, 0x00 ; 0 1c8c8: 81 11 cpse r24, r1 1c8ca: 02 c0 rjmp .+4 ; 0x1c8d0 1c8cc: 64 e4 ldi r22, 0x44 ; 68 1c8ce: 70 e0 ldi r23, 0x00 ; 0 1c8d0: 8e e2 ldi r24, 0x2E ; 46 1c8d2: 0e 94 6c c0 call 0x180d8 ; 0x180d8 else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1c8d6: 20 e0 ldi r18, 0x00 ; 0 1c8d8: 30 e0 ldi r19, 0x00 ; 0 1c8da: 48 e4 ldi r20, 0x48 ; 72 1c8dc: 52 e4 ldi r21, 0x42 ; 66 1c8de: 68 81 ld r22, Y 1c8e0: 79 81 ldd r23, Y+1 ; 0x01 1c8e2: 8a 81 ldd r24, Y+2 ; 0x02 1c8e4: 9b 81 ldd r25, Y+3 ; 0x03 1c8e6: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c8ea: 68 83 st Y, r22 1c8ec: 79 83 std Y+1, r23 ; 0x01 1c8ee: 8a 83 std Y+2, r24 ; 0x02 1c8f0: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1c8f2: 60 e0 ldi r22, 0x00 ; 0 1c8f4: 70 e0 ldi r23, 0x00 ; 0 1c8f6: 88 e4 ldi r24, 0x48 ; 72 1c8f8: 92 e4 ldi r25, 0x42 ; 66 1c8fa: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1c8fe: 0f 94 14 22 call 0x24428 ; 0x24428 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c902: 1e 99 sbic 0x03, 6 ; 3 1c904: 3a c0 rjmp .+116 ; 0x1c97a 1c906: 1d 99 sbic 0x03, 5 ; 3 1c908: 38 c0 rjmp .+112 ; 0x1c97a 1c90a: 21 e0 ldi r18, 0x01 ; 1 1c90c: e2 1a sub r14, r18 1c90e: 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++) { 1c910: 09 f0 breq .+2 ; 0x1c914 1c912: b9 cf rjmp .-142 ; 0x1c886 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1c914: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1c918: 2b 01 movw r4, r22 1c91a: 3c 01 movw r6, r24 1c91c: 24 ec ldi r18, 0xC4 ; 196 1c91e: 42 0e add r4, r18 1c920: 29 e0 ldi r18, 0x09 ; 9 1c922: 52 1e adc r5, r18 1c924: 61 1c adc r6, r1 1c926: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1c928: 81 e0 ldi r24, 0x01 ; 1 1c92a: 0e 94 8c 7a call 0xf518 ; 0xf518 1c92e: e1 01 movw r28, r2 1c930: cb 50 subi r28, 0x0B ; 11 1c932: de 4e sbci r29, 0xEE ; 238 1c934: c8 80 ld r12, Y 1c936: d9 80 ldd r13, Y+1 ; 0x01 1c938: ea 80 ldd r14, Y+2 ; 0x02 1c93a: 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]) { 1c93c: 20 e0 ldi r18, 0x00 ; 0 1c93e: 30 e0 ldi r19, 0x00 ; 0 1c940: 40 e8 ldi r20, 0x80 ; 128 1c942: 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) || 1c944: 1e 99 sbic 0x03, 6 ; 3 1c946: 26 c0 rjmp .+76 ; 0x1c994 1c948: 1d 99 sbic 0x03, 5 ; 3 1c94a: 24 c0 rjmp .+72 ; 0x1c994 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1c94c: c7 01 movw r24, r14 1c94e: b6 01 movw r22, r12 1c950: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c954: 68 83 st Y, r22 1c956: 79 83 std Y+1, r23 ; 0x01 1c958: 8a 83 std Y+2, r24 ; 0x02 1c95a: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c95c: 60 e0 ldi r22, 0x00 ; 0 1c95e: 70 e0 ldi r23, 0x00 ; 0 1c960: 84 e3 ldi r24, 0x34 ; 52 1c962: 92 e4 ldi r25, 0x42 ; 66 1c964: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1c968: 0f 94 14 22 call 0x24428 ; 0x24428 if (_millis() > timeout_counter) { 1c96c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1c970: 46 16 cp r4, r22 1c972: 57 06 cpc r5, r23 1c974: 68 06 cpc r6, r24 1c976: 79 06 cpc r7, r25 1c978: e8 f6 brcc .-70 ; 0x1c934 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1c97a: 6b ed ldi r22, 0xDB ; 219 1c97c: 72 e0 ldi r23, 0x02 ; 2 1c97e: 01 2b or r16, r17 1c980: 11 f0 breq .+4 ; 0x1c986 1c982: 6d ed ldi r22, 0xDD ; 221 1c984: 72 e0 ldi r23, 0x02 ; 2 1c986: 4a ed ldi r20, 0xDA ; 218 1c988: 52 e0 ldi r21, 0x02 ; 2 1c98a: 87 e0 ldi r24, 0x07 ; 7 1c98c: 0e 94 2a e2 call 0x1c454 ; 0x1c454 return(false); 1c990: 80 e0 ldi r24, 0x00 ; 0 1c992: 30 c0 rjmp .+96 ; 0x1c9f4 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]) { 1c994: c5 01 movw r24, r10 1c996: b4 01 movw r22, r8 1c998: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1c99c: a7 01 movw r20, r14 1c99e: 96 01 movw r18, r12 1c9a0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1c9a4: 18 16 cp r1, r24 1c9a6: 4c f3 brlt .-46 ; 0x1c97a 1c9a8: 20 e0 ldi r18, 0x00 ; 0 1c9aa: 30 e0 ldi r19, 0x00 ; 0 1c9ac: 40 e8 ldi r20, 0x80 ; 128 1c9ae: 5f e3 ldi r21, 0x3F ; 63 1c9b0: c5 01 movw r24, r10 1c9b2: b4 01 movw r22, r8 1c9b4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1c9b8: a7 01 movw r20, r14 1c9ba: 96 01 movw r18, r12 1c9bc: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1c9c0: 87 fd sbrc r24, 7 1c9c2: db cf rjmp .-74 ; 0x1c97a current_position[axis] += 10; 1c9c4: e1 01 movw r28, r2 1c9c6: cb 50 subi r28, 0x0B ; 11 1c9c8: de 4e sbci r29, 0xEE ; 238 1c9ca: 20 e0 ldi r18, 0x00 ; 0 1c9cc: 30 e0 ldi r19, 0x00 ; 0 1c9ce: 40 e2 ldi r20, 0x20 ; 32 1c9d0: 51 e4 ldi r21, 0x41 ; 65 1c9d2: c7 01 movw r24, r14 1c9d4: b6 01 movw r22, r12 1c9d6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1c9da: 68 83 st Y, r22 1c9dc: 79 83 std Y+1, r23 ; 0x01 1c9de: 8a 83 std Y+2, r24 ; 0x02 1c9e0: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c9e2: 60 e0 ldi r22, 0x00 ; 0 1c9e4: 70 e0 ldi r23, 0x00 ; 0 1c9e6: 84 e3 ldi r24, 0x34 ; 52 1c9e8: 92 e4 ldi r25, 0x42 ; 66 1c9ea: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1c9ee: 0f 94 14 22 call 0x24428 ; 0x24428 return(true); 1c9f2: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1c9f4: df 91 pop r29 1c9f6: cf 91 pop r28 1c9f8: 1f 91 pop r17 1c9fa: 0f 91 pop r16 1c9fc: ff 90 pop r15 1c9fe: ef 90 pop r14 1ca00: df 90 pop r13 1ca02: cf 90 pop r12 1ca04: bf 90 pop r11 1ca06: af 90 pop r10 1ca08: 9f 90 pop r9 1ca0a: 8f 90 pop r8 1ca0c: 7f 90 pop r7 1ca0e: 6f 90 pop r6 1ca10: 5f 90 pop r5 1ca12: 4f 90 pop r4 1ca14: 3f 90 pop r3 1ca16: 2f 90 pop r2 1ca18: 08 95 ret 0001ca1a : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca1a: 2f 92 push r2 1ca1c: 3f 92 push r3 1ca1e: 4f 92 push r4 1ca20: 5f 92 push r5 1ca22: 6f 92 push r6 1ca24: 7f 92 push r7 1ca26: 8f 92 push r8 1ca28: 9f 92 push r9 1ca2a: af 92 push r10 1ca2c: bf 92 push r11 1ca2e: cf 92 push r12 1ca30: df 92 push r13 1ca32: ef 92 push r14 1ca34: ff 92 push r15 1ca36: 0f 93 push r16 1ca38: 1f 93 push r17 1ca3a: cf 93 push r28 1ca3c: df 93 push r29 1ca3e: 7c 01 movw r14, r24 1ca40: 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); 1ca42: cb 01 movw r24, r22 1ca44: 6a e0 ldi r22, 0x0A ; 10 1ca46: 70 e0 ldi r23, 0x00 ; 0 1ca48: 0f 94 5a a1 call 0x342b4 ; 0x342b4 <__divmodhi4> 1ca4c: 66 0e add r6, r22 1ca4e: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1ca50: e1 14 cp r14, r1 1ca52: f1 04 cpc r15, r1 1ca54: e1 f4 brne .+56 ; 0x1ca8e current_position[Z_AXIS] += 17; 1ca56: 20 e0 ldi r18, 0x00 ; 0 1ca58: 30 e0 ldi r19, 0x00 ; 0 1ca5a: 48 e8 ldi r20, 0x88 ; 136 1ca5c: 51 e4 ldi r21, 0x41 ; 65 1ca5e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1ca62: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1ca66: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1ca6a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1ca6e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1ca72: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1ca76: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1ca7a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1ca7e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ca82: 60 e0 ldi r22, 0x00 ; 0 1ca84: 70 e0 ldi r23, 0x00 ; 0 1ca86: 84 e3 ldi r24, 0x34 ; 52 1ca88: 92 e4 ldi r25, 0x42 ; 66 1ca8a: 0f 94 11 85 call 0x30a22 ; 0x30a22 } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca8e: 10 e0 ldi r17, 0x00 ; 0 1ca90: 00 e0 ldi r16, 0x00 ; 0 1ca92: d0 e0 ldi r29, 0x00 ; 0 1ca94: c0 e0 ldi r28, 0x00 ; 0 1ca96: d1 2c mov r13, r1 1ca98: c1 2c mov r12, r1 1ca9a: 31 2c mov r3, r1 1ca9c: 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; 1ca9e: 57 01 movw r10, r14 1caa0: aa 0c add r10, r10 1caa2: bb 1c adc r11, r11 1caa4: aa 0c add r10, r10 1caa6: bb 1c adc r11, r11 1caa8: c5 01 movw r24, r10 1caaa: 8b 50 subi r24, 0x0B ; 11 1caac: 9e 4e sbci r25, 0xEE ; 238 1caae: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cab0: 94 e0 ldi r25, 0x04 ; 4 1cab2: 29 2e mov r2, r25 1cab4: 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; 1cab6: 20 e0 ldi r18, 0x00 ; 0 1cab8: 30 e0 ldi r19, 0x00 ; 0 1caba: 40 e8 ldi r20, 0x80 ; 128 1cabc: 5f e3 ldi r21, 0x3F ; 63 1cabe: f4 01 movw r30, r8 1cac0: 60 81 ld r22, Z 1cac2: 71 81 ldd r23, Z+1 ; 0x01 1cac4: 82 81 ldd r24, Z+2 ; 0x02 1cac6: 93 81 ldd r25, Z+3 ; 0x03 1cac8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1cacc: f4 01 movw r30, r8 1cace: 60 83 st Z, r22 1cad0: 71 83 std Z+1, r23 ; 0x01 1cad2: 82 83 std Z+2, r24 ; 0x02 1cad4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cad6: 60 e0 ldi r22, 0x00 ; 0 1cad8: 70 e0 ldi r23, 0x00 ; 0 1cada: 84 e3 ldi r24, 0x34 ; 52 1cadc: 92 e4 ldi r25, 0x42 ; 66 1cade: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1cae2: 0f 94 14 22 call 0x24428 ; 0x24428 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1cae6: 1e 99 sbic 0x03, 6 ; 3 1cae8: 04 c0 rjmp .+8 ; 0x1caf2 1caea: 1d 99 sbic 0x03, 5 ; 3 1caec: 02 c0 rjmp .+4 ; 0x1caf2 1caee: 1c 9b sbis 0x03, 4 ; 3 1caf0: 39 c0 rjmp .+114 ; 0x1cb64 (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1caf2: 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) 1caf4: e1 14 cp r14, r1 1caf6: f1 04 cpc r15, r1 1caf8: 51 f4 brne .+20 ; 0x1cb0e { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cafa: 56 fa bst r5, 6 1cafc: 55 24 eor r5, r5 1cafe: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1cb00: 1d 99 sbic 0x03, 5 ; 3 1cb02: 8e c0 rjmp .+284 ; 0x1cc20 } 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; 1cb04: c2 e0 ldi r28, 0x02 ; 2 1cb06: 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; 1cb08: 44 24 eor r4, r4 1cb0a: 43 94 inc r4 1cb0c: 2c c0 rjmp .+88 ; 0x1cb66 { _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) 1cb0e: f1 e0 ldi r31, 0x01 ; 1 1cb10: ef 16 cp r14, r31 1cb12: f1 04 cpc r15, r1 1cb14: 41 f4 brne .+16 ; 0x1cb26 { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb16: 55 fa bst r5, 5 1cb18: 55 24 eor r5, r5 1cb1a: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1cb1c: 1e 9b sbis 0x03, 6 ; 3 1cb1e: f2 cf rjmp .-28 ; 0x1cb04 1cb20: d0 e0 ldi r29, 0x00 ; 0 1cb22: c0 e0 ldi r28, 0x00 ; 0 1cb24: f1 cf rjmp .-30 ; 0x1cb08 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb26: 54 fa bst r5, 4 1cb28: 55 24 eor r5, r5 1cb2a: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1cb2c: 83 b1 in r24, 0x03 ; 3 1cb2e: 82 95 swap r24 1cb30: 86 95 lsr r24 1cb32: 86 95 lsr r24 1cb34: 83 70 andi r24, 0x03 ; 3 1cb36: 21 e0 ldi r18, 0x01 ; 1 1cb38: 82 27 eor r24, r18 1cb3a: 81 70 andi r24, 0x01 ; 1 1cb3c: c8 2f mov r28, r24 1cb3e: 80 e0 ldi r24, 0x00 ; 0 1cb40: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1cb42: 8f 93 push r24 1cb44: cf 93 push r28 1cb46: 1f 92 push r1 1cb48: 5f 92 push r5 1cb4a: e4 ed ldi r30, 0xD4 ; 212 1cb4c: f3 e8 ldi r31, 0x83 ; 131 1cb4e: ff 93 push r31 1cb50: ef 93 push r30 1cb52: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 1cb56: 0f 90 pop r0 1cb58: 0f 90 pop r0 1cb5a: 0f 90 pop r0 1cb5c: 0f 90 pop r0 1cb5e: 0f 90 pop r0 1cb60: 0f 90 pop r0 1cb62: d2 cf rjmp .-92 ; 0x1cb08 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) || 1cb64: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1cb66: 06 30 cpi r16, 0x06 ; 6 1cb68: 11 05 cpc r17, r1 1cb6a: 0c f0 brlt .+2 ; 0x1cb6e 1cb6c: 4f c0 rjmp .+158 ; 0x1cc0c { _lcd_refresh++; 1cb6e: 0f 5f subi r16, 0xFF ; 255 1cb70: 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(); 1cb72: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1cb76: 81 e0 ldi r24, 0x01 ; 1 1cb78: 0e 94 8c 7a call 0xf518 ; 0xf518 (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1cb7c: 6c 14 cp r6, r12 1cb7e: 7d 04 cpc r7, r13 1cb80: 34 f0 brlt .+12 ; 0x1cb8e 1cb82: 8f ef ldi r24, 0xFF ; 255 1cb84: c8 1a sub r12, r24 1cb86: d8 0a sbc r13, r24 } while (!_stepdone); 1cb88: 44 20 and r4, r4 1cb8a: 09 f4 brne .+2 ; 0x1cb8e 1cb8c: 94 cf rjmp .-216 ; 0x1cab6 if (!_stepresult) 1cb8e: 51 10 cpse r5, r1 1cb90: 20 c0 rjmp .+64 ; 0x1cbd2 { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1cb92: 6d ed ldi r22, 0xDD ; 221 1cb94: 72 e0 ldi r23, 0x02 ; 2 1cb96: 91 e0 ldi r25, 0x01 ; 1 1cb98: e9 16 cp r14, r25 1cb9a: f1 04 cpc r15, r1 1cb9c: 41 f0 breq .+16 ; 0x1cbae if (_axis == Z_AXIS) _error_1 = "Z"; 1cb9e: 6f ed ldi r22, 0xDF ; 223 1cba0: 72 e0 ldi r23, 0x02 ; 2 1cba2: e2 e0 ldi r30, 0x02 ; 2 1cba4: ee 16 cp r14, r30 1cba6: f1 04 cpc r15, r1 1cba8: 11 f0 breq .+4 ; 0x1cbae 1cbaa: 6b ed ldi r22, 0xDB ; 219 1cbac: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1cbae: 4d ed ldi r20, 0xDD ; 221 1cbb0: 52 e0 ldi r21, 0x02 ; 2 1cbb2: c1 30 cpi r28, 0x01 ; 1 1cbb4: d1 05 cpc r29, r1 1cbb6: 31 f0 breq .+12 ; 0x1cbc4 if (_err_endstop == 2) _error_2 = "Z"; 1cbb8: 4f ed ldi r20, 0xDF ; 223 1cbba: 52 e0 ldi r21, 0x02 ; 2 1cbbc: 22 97 sbiw r28, 0x02 ; 2 1cbbe: 11 f0 breq .+4 ; 0x1cbc4 1cbc0: 4b ed ldi r20, 0xDB ; 219 1cbc2: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1cbc4: 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) 1cbc6: c6 14 cp r12, r6 1cbc8: d7 04 cpc r13, r7 1cbca: 0c f4 brge .+2 ; 0x1cbce { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1cbcc: 83 e0 ldi r24, 0x03 ; 3 1cbce: 0e 94 2a e2 call 0x1c454 ; 0x1c454 } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1cbd2: f5 01 movw r30, r10 1cbd4: eb 50 subi r30, 0x0B ; 11 1cbd6: fe 4e sbci r31, 0xEE ; 238 1cbd8: 10 82 st Z, r1 1cbda: 11 82 std Z+1, r1 ; 0x01 1cbdc: 12 82 std Z+2, r1 ; 0x02 1cbde: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1cbe0: 0f 94 d1 83 call 0x307a2 ; 0x307a2 return _stepresult; } 1cbe4: 85 2d mov r24, r5 1cbe6: df 91 pop r29 1cbe8: cf 91 pop r28 1cbea: 1f 91 pop r17 1cbec: 0f 91 pop r16 1cbee: ff 90 pop r15 1cbf0: ef 90 pop r14 1cbf2: df 90 pop r13 1cbf4: cf 90 pop r12 1cbf6: bf 90 pop r11 1cbf8: af 90 pop r10 1cbfa: 9f 90 pop r9 1cbfc: 8f 90 pop r8 1cbfe: 7f 90 pop r7 1cc00: 6f 90 pop r6 1cc02: 5f 90 pop r5 1cc04: 4f 90 pop r4 1cc06: 3f 90 pop r3 1cc08: 2f 90 pop r2 1cc0a: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cc0c: 10 e0 ldi r17, 0x00 ; 0 1cc0e: 00 e0 ldi r16, 0x00 ; 0 1cc10: 20 e0 ldi r18, 0x00 ; 0 1cc12: 43 e0 ldi r20, 0x03 ; 3 1cc14: 63 2d mov r22, r3 1cc16: 82 2d mov r24, r2 1cc18: 0e 94 33 b9 call 0x17266 ; 0x17266 1cc1c: 38 2e mov r3, r24 1cc1e: a9 cf rjmp .-174 ; 0x1cb72 (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; 1cc20: c1 e0 ldi r28, 0x01 ; 1 1cc22: d0 e0 ldi r29, 0x00 ; 0 1cc24: 71 cf rjmp .-286 ; 0x1cb08 0001cc26 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1cc26: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1cc2a: 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; 1cc2e: 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() 1cc32: 81 11 cpse r24, r1 1cc34: 39 c0 rjmp .+114 ; 0x1cca8 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1cc36: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1cc3a: 81 11 cpse r24, r1 1cc3c: 02 c0 rjmp .+4 ; 0x1cc42 #endif ) { return false; // abort if error persists } return true; 1cc3e: 81 e0 ldi r24, 0x01 ; 1 1cc40: 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; 1cc42: 8f ef ldi r24, 0xFF ; 255 1cc44: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1cc48: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1cc4c: 0f 94 f7 31 call 0x263ee ; 0x263ee { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1cc50: 83 e0 ldi r24, 0x03 ; 3 1cc52: 0e 94 ca 6e call 0xdd94 ; 0xdd94 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1cc56: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1cc5a: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1cc5e: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1cc62: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1cc66: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = true; 1cc6a: 81 e0 ldi r24, 0x01 ; 1 1cc6c: 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) 1cc70: 68 ee ldi r22, 0xE8 ; 232 1cc72: 73 e0 ldi r23, 0x03 ; 3 1cc74: 80 e0 ldi r24, 0x00 ; 0 1cc76: 90 e0 ldi r25, 0x00 ; 0 1cc78: 0f 94 4d 0d call 0x21a9a ; 0x21a9a manage_heater(); 1cc7c: 0f 94 f7 31 call 0x263ee ; 0x263ee setExtruderAutoFanState(1); //releases lock on the hotend fan 1cc80: 81 e0 ldi r24, 0x01 ; 1 1cc82: 0e 94 ca 6e call 0xdd94 ; 0xdd94 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1cc86: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1cc8a: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1cc8e: 0f 94 f7 31 call 0x263ee ; 0x263ee _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 1cc92: 80 91 85 03 lds r24, 0x0385 ; 0x800385 1cc96: 90 91 86 03 lds r25, 0x0386 ; 0x800386 1cc9a: 45 97 sbiw r24, 0x15 ; 21 1cc9c: 84 f6 brge .-96 ; 0x1cc3e LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1cc9e: 62 e0 ldi r22, 0x02 ; 2 1cca0: 8f e0 ldi r24, 0x0F ; 15 1cca2: 98 e6 ldi r25, 0x68 ; 104 1cca4: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1cca8: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1ccaa: 08 95 ret 0001ccac : //! @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; 1ccac: 0e 94 13 e6 call 0x1cc26 ; 0x1cc26 1ccb0: 88 23 and r24, r24 1ccb2: 21 f0 breq .+8 ; 0x1ccbc // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1ccb4: 85 e3 ldi r24, 0x35 ; 53 1ccb6: 98 e6 ldi r25, 0x68 ; 104 1ccb8: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc } 1ccbc: 08 95 ret 0001ccbe : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1ccbe: cf 93 push r28 1ccc0: df 93 push r29 1ccc2: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1ccc4: 80 e0 ldi r24, 0x00 ; 0 1ccc6: 0e 94 e5 e1 call 0x1c3ca ; 0x1c3ca 1ccca: 88 23 and r24, r24 1cccc: 31 f0 breq .+12 ; 0x1ccda lcd_updatestatus(message, true); 1ccce: 61 e0 ldi r22, 0x01 ; 1 1ccd0: ce 01 movw r24, r28 } 1ccd2: df 91 pop r29 1ccd4: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1ccd6: 0c 94 ca e1 jmp 0x1c394 ; 0x1c394 } 1ccda: df 91 pop r29 1ccdc: cf 91 pop r28 1ccde: 08 95 ret 0001cce0 : } } void lcd_print_stop_finish(); void lcd_commands() 1cce0: 2f 92 push r2 1cce2: 3f 92 push r3 1cce4: 4f 92 push r4 1cce6: 5f 92 push r5 1cce8: 6f 92 push r6 1ccea: 7f 92 push r7 1ccec: 8f 92 push r8 1ccee: 9f 92 push r9 1ccf0: af 92 push r10 1ccf2: bf 92 push r11 1ccf4: cf 92 push r12 1ccf6: df 92 push r13 1ccf8: ef 92 push r14 1ccfa: ff 92 push r15 1ccfc: 0f 93 push r16 1ccfe: 1f 93 push r17 1cd00: cf 93 push r28 1cd02: df 93 push r29 1cd04: 00 d0 rcall .+0 ; 0x1cd06 1cd06: 1f 92 push r1 1cd08: 1f 92 push r1 1cd0a: cd b7 in r28, 0x3d ; 61 1cd0c: 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) 1cd0e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cd12: 81 30 cpi r24, 0x01 ; 1 1cd14: 09 f0 breq .+2 ; 0x1cd18 1cd16: 5a c0 rjmp .+180 ; 0x1cdcc 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); 1cd18: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cd1c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cd20: 98 13 cpse r25, r24 1cd22: 54 c0 rjmp .+168 ; 0x1cdcc 1cd24: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cd28: 81 11 cpse r24, r1 1cd2a: 50 c0 rjmp .+160 ; 0x1cdcc { custom_message_type = CustomMsg::Status; 1cd2c: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1cd30: 8c e5 ldi r24, 0x5C ; 92 1cd32: 91 e4 ldi r25, 0x41 ; 65 1cd34: 0e 94 3c 6d call 0xda78 ; 0xda78 1cd38: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_commands_type = LcdCommands::Idle; 1cd3c: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1cd40: 82 e0 ldi r24, 0x02 ; 2 1cd42: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1cd46: 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(); 1cd4a: 0f 94 4c 20 call 0x24098 ; 0x24098 save_statistics(); 1cd4e: 0e 94 c3 5f call 0xbf86 ; 0xbf86 // lift Z raise_z(10); 1cd52: 60 e0 ldi r22, 0x00 ; 0 1cd54: 70 e0 ldi r23, 0x00 ; 0 1cd56: 80 e2 ldi r24, 0x20 ; 32 1cd58: 91 e4 ldi r25, 0x41 ; 65 1cd5a: 0e 94 68 67 call 0xced0 ; 0xced0 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1cd5e: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1cd62: 88 23 and r24, r24 1cd64: 21 f1 breq .+72 ; 0x1cdae 1cd66: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1cd6a: 88 23 and r24, r24 1cd6c: 01 f1 breq .+64 ; 0x1cdae current_position[X_AXIS] = X_CANCEL_POS; 1cd6e: 80 e0 ldi r24, 0x00 ; 0 1cd70: 90 e0 ldi r25, 0x00 ; 0 1cd72: a8 e4 ldi r26, 0x48 ; 72 1cd74: b2 e4 ldi r27, 0x42 ; 66 1cd76: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1cd7a: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1cd7e: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1cd82: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = Y_CANCEL_POS; 1cd86: 80 e0 ldi r24, 0x00 ; 0 1cd88: 90 e0 ldi r25, 0x00 ; 0 1cd8a: ae e3 ldi r26, 0x3E ; 62 1cd8c: b3 e4 ldi r27, 0x43 ; 67 1cd8e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1cd92: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1cd96: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1cd9a: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cd9e: 60 e0 ldi r22, 0x00 ; 0 1cda0: 70 e0 ldi r23, 0x00 ; 0 1cda2: 84 e3 ldi r24, 0x34 ; 52 1cda4: 92 e4 ldi r25, 0x42 ; 66 1cda6: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1cdaa: 0f 94 14 22 call 0x24428 ; 0x24428 1cdae: 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()) { 1cdb2: 88 23 and r24, r24 1cdb4: 09 f4 brne .+2 ; 0x1cdb8 1cdb6: bb c0 rjmp .+374 ; 0x1cf2e // time to stop the error beep WRITE(BEEPER, LOW); 1cdb8: 72 98 cbi 0x0e, 2 ; 14 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1cdba: 0f 94 46 12 call 0x2248c ; 0x2248c finishAndDisableSteppers(); //M84 1cdbe: 0e 94 c4 74 call 0xe988 ; 0xe988 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1cdc2: 88 e0 ldi r24, 0x08 ; 8 1cdc4: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb did_pause_print = false; // Clear pause state in case the print was aborted while paused 1cdc8: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1cdcc: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cdd0: 82 30 cpi r24, 0x02 ; 2 1cdd2: 09 f0 breq .+2 ; 0x1cdd6 1cdd4: 63 c0 rjmp .+198 ; 0x1ce9c 1cdd6: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cdda: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cdde: 98 13 cpse r25, r24 1cde0: 5d c0 rjmp .+186 ; 0x1ce9c 1cde2: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cde6: 81 11 cpse r24, r1 1cde8: 59 c0 rjmp .+178 ; 0x1ce9c { if (custom_message_type != CustomMsg::M117) 1cdea: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1cdee: 87 30 cpi r24, 0x07 ; 7 1cdf0: 41 f0 breq .+16 ; 0x1ce02 { custom_message_type = CustomMsg::Status; 1cdf2: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1cdf6: 8d e4 ldi r24, 0x4D ; 77 1cdf8: 91 e4 ldi r25, 0x41 ; 65 1cdfa: 0e 94 3c 6d call 0xda78 ; 0xda78 1cdfe: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe } lcd_commands_type = LcdCommands::Idle; 1ce02: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1ce06: 82 e0 ldi r24, 0x02 ; 2 1ce08: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1ce0c: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1ce10: 0f 94 14 22 call 0x24428 ; 0x24428 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1ce14: 10 92 99 03 sts 0x0399, r1 ; 0x800399 1ce18: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1ce1c: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1ce20: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.493+0x8> 1ce24: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.493+0x9> 1ce28: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.493+0xa> 1ce2c: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.493+0xb> 1ce30: 0e 94 68 67 call 0xced0 ; 0xced0 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1ce34: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1ce38: 88 23 and r24, r24 1ce3a: 51 f1 breq .+84 ; 0x1ce90 1ce3c: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1ce40: 88 23 and r24, r24 1ce42: 31 f1 breq .+76 ; 0x1ce90 current_position[X_AXIS] = pause_position[X_AXIS]; 1ce44: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.493> 1ce48: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.493+0x1> 1ce4c: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.493+0x2> 1ce50: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.493+0x3> 1ce54: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ce58: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ce5c: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ce60: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1ce64: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.493+0x4> 1ce68: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.493+0x5> 1ce6c: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.493+0x6> 1ce70: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.493+0x7> 1ce74: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ce78: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ce7c: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ce80: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(50); 1ce84: 60 e0 ldi r22, 0x00 ; 0 1ce86: 70 e0 ldi r23, 0x00 ; 0 1ce88: 88 e4 ldi r24, 0x48 ; 72 1ce8a: 92 e4 ldi r25, 0x42 ; 66 1ce8c: 0f 94 11 85 call 0x30a22 ; 0x30a22 1ce90: 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()) { 1ce94: 88 23 and r24, r24 1ce96: 09 f4 brne .+2 ; 0x1ce9a 1ce98: 74 c0 rjmp .+232 ; 0x1cf82 // time to stop the error beep WRITE(BEEPER, LOW); 1ce9a: 72 98 cbi 0x0e, 2 ; 14 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1ce9c: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cea0: 84 30 cpi r24, 0x04 ; 4 1cea2: 09 f0 breq .+2 ; 0x1cea6 1cea4: ad c0 rjmp .+346 ; 0x1d000 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1cea6: 85 ea ldi r24, 0xA5 ; 165 1cea8: 9d e0 ldi r25, 0x0D ; 13 1ceaa: 0f 94 8b a0 call 0x34116 ; 0x34116 1ceae: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 1ceb2: 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) 1ceb6: 32 13 cpse r19, r18 1ceb8: 7c c1 rjmp .+760 ; 0x1d1b2 1ceba: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 1cebe: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 1cec2: 23 2b or r18, r19 1cec4: 09 f0 breq .+2 ; 0x1cec8 1cec6: 75 c1 rjmp .+746 ; 0x1d1b2 1cec8: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 1cecc: 29 83 std Y+1, r18 ; 0x01 1cece: 21 11 cpse r18, r1 1ced0: 70 c1 rjmp .+736 ; 0x1d1b2 { if (lcd_commands_step == 0) 1ced2: 20 91 b0 03 lds r18, 0x03B0 ; 0x8003b0 1ced6: 21 11 cpse r18, r1 1ced8: 57 c0 rjmp .+174 ; 0x1cf88 lcd_commands_step = 12; 1ceda: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1cedc: 20 93 b0 03 sts 0x03B0, r18 ; 0x8003b0 } if (lcd_commands_type == LcdCommands::Layer1Cal) { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); const float extrusion_width = (nozzle_dia + 20)/1000.0f; 1cee0: 44 96 adiw r24, 0x14 ; 20 1cee2: bc 01 movw r22, r24 1cee4: 90 e0 ldi r25, 0x00 ; 0 1cee6: 80 e0 ldi r24, 0x00 ; 0 1cee8: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 1ceec: 20 e0 ldi r18, 0x00 ; 0 1ceee: 30 e0 ldi r19, 0x00 ; 0 1cef0: 4a e7 ldi r20, 0x7A ; 122 1cef2: 54 e4 ldi r21, 0x44 ; 68 1cef4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1cef8: 6b 01 movw r12, r22 1cefa: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1cefc: e0 91 b0 03 lds r30, 0x03B0 ; 0x8003b0 1cf00: e1 50 subi r30, 0x01 ; 1 1cf02: ec 30 cpi r30, 0x0C ; 12 1cf04: 08 f0 brcs .+2 ; 0x1cf08 1cf06: 7c c0 rjmp .+248 ; 0x1d000 1cf08: f0 e0 ldi r31, 0x00 ; 0 1cf0a: 88 27 eor r24, r24 1cf0c: e5 57 subi r30, 0x75 ; 117 1cf0e: f8 41 sbci r31, 0x18 ; 24 1cf10: 8f 4f sbci r24, 0xFF ; 255 1cf12: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 1cf16: 9f ea ldi r25, 0xAF ; 175 1cf18: 89 ea ldi r24, 0xA9 ; 169 1cf1a: 85 ea ldi r24, 0xA5 ; 165 1cf1c: 81 ea ldi r24, 0xA1 ; 161 1cf1e: 7d ea ldi r23, 0xAD ; 173 1cf20: 77 ea ldi r23, 0xA7 ; 167 1cf22: 02 ea ldi r16, 0xA2 ; 162 1cf24: 7d e9 ldi r23, 0x9D ; 157 1cf26: 79 e9 ldi r23, 0x99 ; 153 1cf28: 12 e9 ldi r17, 0x92 ; 146 1cf2a: cc e7 ldi r28, 0x7C ; 124 1cf2c: c6 e7 ldi r28, 0x76 ; 118 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1cf2e: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 { #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE); #endif resetFanCheck(); 1cf32: 0e 94 bd 6e call 0xdd7a ; 0xdd7a setExtruderAutoFanState(1); 1cf36: 81 e0 ldi r24, 0x01 ; 1 1cf38: 0e 94 ca 6e call 0xdd94 ; 0xdd94 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cf3c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1cf40: 81 30 cpi r24, 0x01 ; 1 1cf42: 09 f0 breq .+2 ; 0x1cf46 1cf44: 3a cf rjmp .-396 ; 0x1cdba fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1cf46: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 1cf4a: 88 23 and r24, r24 1cf4c: 09 f4 brne .+2 ; 0x1cf50 1cf4e: 35 cf rjmp .-406 ; 0x1cdba #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cf50: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 1cf54: 82 30 cpi r24, 0x02 ; 2 1cf56: 09 f4 brne .+2 ; 0x1cf5a 1cf58: 30 cf rjmp .-416 ; 0x1cdba #endif //FANCHECK ) { // The print was aborted while when the nozzle was cold: // 1. in a paused state => a partial backup in RAM is always available // 2. after a recoverable thermal/fan error had paused the print => only extruder temperature is saved to RAM if (printingIsPaused()) 1cf5a: 0e 94 48 61 call 0xc290 ; 0xc290 1cf5e: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1cf60: 0e 94 36 5f call 0xbe6c ; 0xbe6c } // If the pause state was cleared previously or the target temperature is 0°C in the case // of an unconditional stop. In that scenario we do not want to unload. if (target_temperature[0] >= extrude_min_temp) { 1cf64: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 1cf68: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 1cf6c: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1cf70: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1cf74: 28 17 cp r18, r24 1cf76: 39 07 cpc r19, r25 1cf78: 0c f4 brge .+2 ; 0x1cf7c 1cf7a: 1f cf rjmp .-450 ; 0x1cdba MMU2::mmu2.unload(); // M702 1cf7c: 0f 94 34 6b call 0x2d668 ; 0x2d668 1cf80: 1c cf rjmp .-456 ; 0x1cdba } else { // Turn off the print fan fanSpeed = 0; 1cf82: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 1cf86: 8a cf rjmp .-236 ; 0x1ce9c if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1cf88: 21 50 subi r18, 0x01 ; 1 1cf8a: a8 cf rjmp .-176 ; 0x1cedc preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1cf8c: 65 e0 ldi r22, 0x05 ; 5 1cf8e: 89 eb ldi r24, 0xB9 ; 185 1cf90: 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]))); 1cf92: 0e 94 b9 7d call 0xfb72 ; 0xfb72 1cf96: 34 c0 rjmp .+104 ; 0x1d000 //! @param cmd_buffer character buffer needed to format gcodes //! @param filament filament to use (applies for MMU only) //! @returns true if extra purge distance is needed in case of MMU prints (after a toolchange), otherwise false bool lay1cal_load_filament(uint8_t filament) { if (MMU2::mmu2.Enabled()) 1cf98: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1cf9c: 81 30 cpi r24, 0x01 ; 1 1cf9e: 69 f5 brne .+90 ; 0x1cffa { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1cfa0: 30 91 af 03 lds r19, 0x03AF ; 0x8003af <_ZL16lay1cal_filament.lto_priv.407> 1cfa4: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 1cfa6: 61 e0 ldi r22, 0x01 ; 1 1cfa8: 89 ed ldi r24, 0xD9 ; 217 1cfaa: 9c e6 ldi r25, 0x6C ; 108 1cfac: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommand_P(PSTR("G1 Y-3 F1000")); 1cfb0: 61 e0 ldi r22, 0x01 ; 1 1cfb2: 8c ea ldi r24, 0xAC ; 172 1cfb4: 94 e8 ldi r25, 0x84 ; 132 1cfb6: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommand_P(PSTR("G1 Z0.4 F1000")); 1cfba: 61 e0 ldi r22, 0x01 ; 1 1cfbc: 8e e9 ldi r24, 0x9E ; 158 1cfbe: 94 e8 ldi r25, 0x84 ; 132 1cfc0: 0e 94 3a 7d call 0xfa74 ; 0xfa74 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1cfc4: 0f 94 30 41 call 0x28260 ; 0x28260 if(currentTool == filament ){ 1cfc8: 9b 81 ldd r25, Y+3 ; 0x03 1cfca: 98 17 cp r25, r24 1cfcc: b1 f0 breq .+44 ; 0x1cffa // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1cfce: 8f 3f cpi r24, 0xFF ; 255 1cfd0: 29 f0 breq .+10 ; 0x1cfdc // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1cfd2: 61 e0 ldi r22, 0x01 ; 1 1cfd4: 81 eb ldi r24, 0xB1 ; 177 1cfd6: 98 e6 ldi r25, 0x68 ; 104 1cfd8: 0e 94 3a 7d call 0xfa74 ; 0xfa74 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1cfdc: 1f 92 push r1 1cfde: 2b 81 ldd r18, Y+3 ; 0x03 1cfe0: 2f 93 push r18 1cfe2: 8a e9 ldi r24, 0x9A ; 154 1cfe4: 94 e8 ldi r25, 0x84 ; 132 1cfe6: 9f 93 push r25 1cfe8: 8f 93 push r24 1cfea: 0e 94 d0 7d call 0xfba0 ; 0xfba0 1cfee: 0f 90 pop r0 1cff0: 0f 90 pop r0 1cff2: 0f 90 pop r0 1cff4: 0f 90 pop r0 return true; 1cff6: 31 e0 ldi r19, 0x01 ; 1 1cff8: 39 83 std Y+1, r19 ; 0x01 1cffa: 89 81 ldd r24, Y+1 ; 0x01 1cffc: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1d000: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d004: 83 30 cpi r24, 0x03 ; 3 1d006: 09 f0 breq .+2 ; 0x1d00a 1d008: d4 c0 rjmp .+424 ; 0x1d1b2 if (lcd_commands_step == 0) { 1d00a: 90 91 b0 03 lds r25, 0x03B0 ; 0x8003b0 1d00e: 91 11 cpse r25, r1 1d010: 09 c0 rjmp .+18 ; 0x1d024 custom_message_type = CustomMsg::PidCal; 1d012: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 1d016: 91 e0 ldi r25, 0x01 ; 1 1d018: 90 93 ac 03 sts 0x03AC, r25 ; 0x8003ac lcd_draw_update = 3; 1d01c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_commands_step = 3; 1d020: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1d024: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d028: 83 30 cpi r24, 0x03 ; 3 1d02a: 19 f5 brne .+70 ; 0x1d072 1d02c: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d030: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1d034: 98 13 cpse r25, r24 1d036: 1d c0 rjmp .+58 ; 0x1d072 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1d038: 0f 94 31 12 call 0x22462 ; 0x22462 pid_tuning_finished = false; 1d03c: 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); 1d040: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1d044: 8f 93 push r24 1d046: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1d04a: 8f 93 push r24 1d04c: 8e e2 ldi r24, 0x2E ; 46 1d04e: 95 e8 ldi r25, 0x85 ; 133 1d050: 9f 93 push r25 1d052: 8f 93 push r24 1d054: 0e 94 d0 7d call 0xfba0 ; 0xfba0 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1d058: 82 e4 ldi r24, 0x42 ; 66 1d05a: 91 e4 ldi r25, 0x41 ; 65 1d05c: 0e 94 3c 6d call 0xda78 ; 0xda78 1d060: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_commands_step = 2; 1d064: 82 e0 ldi r24, 0x02 ; 2 1d066: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d06a: 0f 90 pop r0 1d06c: 0f 90 pop r0 1d06e: 0f 90 pop r0 1d070: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1d072: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d076: 82 30 cpi r24, 0x02 ; 2 1d078: 09 f0 breq .+2 ; 0x1d07c 1d07a: 7c c0 rjmp .+248 ; 0x1d174 1d07c: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> 1d080: 88 23 and r24, r24 1d082: 09 f4 brne .+2 ; 0x1d086 1d084: 77 c0 rjmp .+238 ; 0x1d174 custom_message_state = 0; 1d086: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1d08a: 8e e2 ldi r24, 0x2E ; 46 1d08c: 91 e4 ldi r25, 0x41 ; 65 1d08e: 0e 94 3c 6d call 0xda78 ; 0xda78 1d092: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 1d096: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d09a: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1d09e: 30 91 a8 03 lds r19, 0x03A8 ; 0x8003a8 <_Kp> 1d0a2: 39 83 std Y+1, r19 ; 0x01 1d0a4: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 <_Kp+0x1> 1d0a8: 8b 83 std Y+3, r24 ; 0x03 1d0aa: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa <_Kp+0x2> 1d0ae: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab <_Kp+0x3> 1d0b2: 20 e0 ldi r18, 0x00 ; 0 1d0b4: 30 e0 ldi r19, 0x00 ; 0 1d0b6: a9 01 movw r20, r18 1d0b8: b9 81 ldd r27, Y+1 ; 0x01 1d0ba: f8 01 movw r30, r16 1d0bc: 6b 2f mov r22, r27 1d0be: 78 2f mov r23, r24 1d0c0: 8f 2f mov r24, r31 1d0c2: 9e 2f mov r25, r30 1d0c4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1d0c8: 81 11 cpse r24, r1 1d0ca: 1f c0 rjmp .+62 ; 0x1d10a 1d0cc: 20 e0 ldi r18, 0x00 ; 0 1d0ce: 30 e0 ldi r19, 0x00 ; 0 1d0d0: a9 01 movw r20, r18 1d0d2: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 1d0d6: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d0da: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d0de: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d0e2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1d0e6: 81 11 cpse r24, r1 1d0e8: 10 c0 rjmp .+32 ; 0x1d10a 1d0ea: 20 e0 ldi r18, 0x00 ; 0 1d0ec: 30 e0 ldi r19, 0x00 ; 0 1d0ee: a9 01 movw r20, r18 1d0f0: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 1d0f4: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d0f8: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d0fc: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d100: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1d104: 88 23 and r24, r24 1d106: 09 f4 brne .+2 ; 0x1d10a 1d108: 30 c2 rjmp .+1120 ; 0x1d56a enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1d10a: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d10e: 8f 93 push r24 1d110: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d114: 8f 93 push r24 1d116: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d11a: 8f 93 push r24 1d11c: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 <_Kd> 1d120: 8f 93 push r24 1d122: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d126: 8f 93 push r24 1d128: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d12c: 8f 93 push r24 1d12e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d132: 8f 93 push r24 1d134: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 <_Ki> 1d138: 8f 93 push r24 1d13a: 0f 93 push r16 1d13c: 1f 93 push r17 1d13e: 9b 81 ldd r25, Y+3 ; 0x03 1d140: 9f 93 push r25 1d142: 29 81 ldd r18, Y+1 ; 0x01 1d144: 2f 93 push r18 1d146: 87 e1 ldi r24, 0x17 ; 23 1d148: 95 e8 ldi r25, 0x85 ; 133 1d14a: 9f 93 push r25 1d14c: 8f 93 push r24 1d14e: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommand_P(MSG_M500); 1d152: 61 e0 ldi r22, 0x01 ; 1 1d154: 8c eb ldi r24, 0xBC ; 188 1d156: 98 e6 ldi r25, 0x68 ; 104 1d158: 0e 94 3a 7d call 0xfa74 ; 0xfa74 1d15c: 0f b6 in r0, 0x3f ; 63 1d15e: f8 94 cli 1d160: de bf out 0x3e, r29 ; 62 1d162: 0f be out 0x3f, r0 ; 63 1d164: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1d166: 8d e9 ldi r24, 0x9D ; 157 1d168: 93 e0 ldi r25, 0x03 ; 3 1d16a: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> lcd_commands_step = 1; 1d16e: 81 e0 ldi r24, 0x01 ; 1 1d170: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1d174: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d178: 81 30 cpi r24, 0x01 ; 1 1d17a: d9 f4 brne .+54 ; 0x1d1b2 1d17c: 60 ed ldi r22, 0xD0 ; 208 1d17e: 77 e0 ldi r23, 0x07 ; 7 1d180: 8d e9 ldi r24, 0x9D ; 157 1d182: 93 e0 ldi r25, 0x03 ; 3 1d184: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1d188: 88 23 and r24, r24 1d18a: 99 f0 breq .+38 ; 0x1d1b2 lcd_setstatuspgm(MSG_WELCOME); 1d18c: 8b e0 ldi r24, 0x0B ; 11 1d18e: 9c e6 ldi r25, 0x6C ; 108 1d190: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = CustomMsg::Status; 1d194: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 pid_temp = DEFAULT_PID_TEMP; 1d198: 82 ed ldi r24, 0xD2 ; 210 1d19a: 90 e0 ldi r25, 0x00 ; 0 1d19c: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1d1a0: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.409> lcd_commands_step = 0; 1d1a4: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d1a8: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d1ac: 82 e0 ldi r24, 0x02 ; 2 1d1ae: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1d1b2: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d1b6: 85 30 cpi r24, 0x05 ; 5 1d1b8: e9 f4 brne .+58 ; 0x1d1f4 1d1ba: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d1be: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1d1c2: 98 13 cpse r25, r24 1d1c4: 17 c0 rjmp .+46 ; 0x1d1f4 1d1c6: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1d1ca: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1d1ce: 89 2b or r24, r25 1d1d0: 89 f4 brne .+34 ; 0x1d1f4 1d1d2: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 1d1d6: 81 11 cpse r24, r1 1d1d8: 0d c0 rjmp .+26 ; 0x1d1f4 #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) 1d1da: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d1de: 81 30 cpi r24, 0x01 ; 1 1d1e0: 09 f4 brne .+2 ; 0x1d1e4 1d1e2: f8 c1 rjmp .+1008 ; 0x1d5d4 1d1e4: 08 f4 brcc .+2 ; 0x1d1e8 1d1e6: c6 c1 rjmp .+908 ; 0x1d574 1d1e8: 82 30 cpi r24, 0x02 ; 2 1d1ea: 09 f4 brne .+2 ; 0x1d1ee 1d1ec: de c1 rjmp .+956 ; 0x1d5aa 1d1ee: 83 30 cpi r24, 0x03 ; 3 1d1f0: 09 f4 brne .+2 ; 0x1d1f4 1d1f2: c4 c1 rjmp .+904 ; 0x1d57c menu_depth = 3; break; } } } } 1d1f4: 0f 90 pop r0 1d1f6: 0f 90 pop r0 1d1f8: 0f 90 pop r0 1d1fa: 0f 90 pop r0 1d1fc: 0f 90 pop r0 1d1fe: df 91 pop r29 1d200: cf 91 pop r28 1d202: 1f 91 pop r17 1d204: 0f 91 pop r16 1d206: ff 90 pop r15 1d208: ef 90 pop r14 1d20a: df 90 pop r13 1d20c: cf 90 pop r12 1d20e: bf 90 pop r11 1d210: af 90 pop r10 1d212: 9f 90 pop r9 1d214: 8f 90 pop r8 1d216: 7f 90 pop r7 1d218: 6f 90 pop r6 1d21a: 5f 90 pop r5 1d21c: 4f 90 pop r4 1d21e: 3f 90 pop r3 1d220: 2f 90 pop r2 1d222: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1d224: 0e 94 39 6a call 0xd472 ; 0xd472 menu_depth = 0; 1d228: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_babystep_z, true); 1d22c: 61 e0 ldi r22, 0x01 ; 1 1d22e: 8b e9 ldi r24, 0x9B ; 155 1d230: 97 e3 ldi r25, 0x37 ; 55 1d232: 0f 94 ca 94 call 0x32994 ; 0x32994 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 1d236: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1d23a: 81 30 cpi r24, 0x01 ; 1 1d23c: f1 f4 brne .+60 ; 0x1d27a { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1d23e: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1d242: 10 e0 ldi r17, 0x00 ; 0 1d244: 81 11 cpse r24, r1 1d246: 01 c0 rjmp .+2 ; 0x1d24a 1d248: 12 e0 ldi r17, 0x02 ; 2 1d24a: 21 2f mov r18, r17 1d24c: 30 e0 ldi r19, 0x00 ; 0 1d24e: 22 0f add r18, r18 1d250: 33 1f adc r19, r19 1d252: 2a 57 subi r18, 0x7A ; 122 1d254: 3b 47 sbci r19, 0x7B ; 123 1d256: 3a 83 std Y+2, r19 ; 0x02 1d258: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 1d25a: e9 81 ldd r30, Y+1 ; 0x01 1d25c: fa 81 ldd r31, Y+2 ; 0x02 1d25e: 85 91 lpm r24, Z+ 1d260: 94 91 lpm r25, Z 1d262: 61 e0 ldi r22, 0x01 ; 1 1d264: 0e 94 3a 7d call 0xfa74 ; 0xfa74 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) 1d268: 1f 5f subi r17, 0xFF ; 255 1d26a: 89 81 ldd r24, Y+1 ; 0x01 1d26c: 9a 81 ldd r25, Y+2 ; 0x02 1d26e: 02 96 adiw r24, 0x02 ; 2 1d270: 9a 83 std Y+2, r25 ; 0x02 1d272: 89 83 std Y+1, r24 ; 0x01 1d274: 1a 30 cpi r17, 0x0A ; 10 1d276: 89 f7 brne .-30 ; 0x1d25a 1d278: c3 ce rjmp .-634 ; 0x1d000 } } 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)); 1d27a: 20 e0 ldi r18, 0x00 ; 0 1d27c: 30 e0 ldi r19, 0x00 ; 0 1d27e: 40 e8 ldi r20, 0x80 ; 128 1d280: 50 e4 ldi r21, 0x40 ; 64 1d282: c7 01 movw r24, r14 1d284: b6 01 movw r22, r12 1d286: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1d28a: 20 e0 ldi r18, 0x00 ; 0 1d28c: 30 e0 ldi r19, 0x00 ; 0 1d28e: 40 e7 ldi r20, 0x70 ; 112 1d290: 52 e4 ldi r21, 0x42 ; 66 1d292: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d296: 9f 93 push r25 1d298: 8f 93 push r24 1d29a: 7f 93 push r23 1d29c: 6f 93 push r22 1d29e: 1f 92 push r1 1d2a0: 8c e3 ldi r24, 0x3C ; 60 1d2a2: 8f 93 push r24 1d2a4: 22 e7 ldi r18, 0x72 ; 114 1d2a6: 34 e8 ldi r19, 0x84 ; 132 1d2a8: 3f 93 push r19 1d2aa: 2f 93 push r18 1d2ac: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 1d2b0: 20 e0 ldi r18, 0x00 ; 0 1d2b2: 30 e0 ldi r19, 0x00 ; 0 1d2b4: 40 e0 ldi r20, 0x00 ; 0 1d2b6: 51 e4 ldi r21, 0x41 ; 65 1d2b8: c7 01 movw r24, r14 1d2ba: b6 01 movw r22, r12 1d2bc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1d2c0: 20 e0 ldi r18, 0x00 ; 0 1d2c2: 30 e0 ldi r19, 0x00 ; 0 1d2c4: 40 e2 ldi r20, 0x20 ; 32 1d2c6: 52 e4 ldi r21, 0x42 ; 66 1d2c8: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d2cc: 9f 93 push r25 1d2ce: 8f 93 push r24 1d2d0: 7f 93 push r23 1d2d2: 6f 93 push r22 1d2d4: 1f 92 push r1 1d2d6: 84 e6 ldi r24, 0x64 ; 100 1d2d8: 8f 93 push r24 1d2da: 22 e7 ldi r18, 0x72 ; 114 1d2dc: 34 e8 ldi r19, 0x84 ; 132 1d2de: 3f 93 push r19 1d2e0: 2f 93 push r18 1d2e2: 0e 94 d0 7d call 0xfba0 ; 0xfba0 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)); 1d2e6: 0f b6 in r0, 0x3f ; 63 1d2e8: f8 94 cli 1d2ea: de bf out 0x3e, r29 ; 62 1d2ec: 0f be out 0x3f, r0 ; 63 1d2ee: cd bf out 0x3d, r28 ; 61 1d2f0: 87 ce rjmp .-754 ; 0x1d000 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]))); 1d2f2: 67 e0 ldi r22, 0x07 ; 7 1d2f4: 84 e6 ldi r24, 0x64 ; 100 1d2f6: 94 e8 ldi r25, 0x84 ; 132 1d2f8: 4c ce rjmp .-872 ; 0x1cf92 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 1d2fa: 61 e0 ldi r22, 0x01 ; 1 1d2fc: 88 e5 ldi r24, 0x58 ; 88 1d2fe: 94 e8 ldi r25, 0x84 ; 132 1d300: 0e 94 3a 7d call 0xfa74 ; 0xfa74 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 1d304: 8e e3 ldi r24, 0x3E ; 62 1d306: 8f 93 push r24 1d308: 8c e4 ldi r24, 0x4C ; 76 1d30a: 8f 93 push r24 1d30c: 8c ec ldi r24, 0xCC ; 204 1d30e: 8f 93 push r24 1d310: 8d ec ldi r24, 0xCD ; 205 1d312: 8f 93 push r24 1d314: 88 e4 ldi r24, 0x48 ; 72 1d316: 94 e8 ldi r25, 0x84 ; 132 1d318: 9f 93 push r25 1d31a: 8f 93 push r24 1d31c: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommand_P(PSTR("G1 F1080")); 1d320: 61 e0 ldi r22, 0x01 ; 1 1d322: 8f e3 ldi r24, 0x3F ; 63 1d324: 94 e8 ldi r25, 0x84 ; 132 1d326: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 1d32a: 20 e0 ldi r18, 0x00 ; 0 1d32c: 30 e0 ldi r19, 0x00 ; 0 1d32e: 40 e8 ldi r20, 0x80 ; 128 1d330: 50 e4 ldi r21, 0x40 ; 64 1d332: c7 01 movw r24, r14 1d334: b6 01 movw r22, r12 1d336: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1d33a: 20 e0 ldi r18, 0x00 ; 0 1d33c: 30 e0 ldi r19, 0x00 ; 0 1d33e: 48 ec ldi r20, 0xC8 ; 200 1d340: 51 e4 ldi r21, 0x41 ; 65 1d342: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d346: 9f 93 push r25 1d348: 8f 93 push r24 1d34a: 7f 93 push r23 1d34c: 6f 93 push r22 1d34e: 1f 92 push r1 1d350: 1b e9 ldi r17, 0x9B ; 155 1d352: 1f 93 push r17 1d354: 1f 92 push r1 1d356: 8b e4 ldi r24, 0x4B ; 75 1d358: 8f 93 push r24 1d35a: 8d e2 ldi r24, 0x2D ; 45 1d35c: 94 e8 ldi r25, 0x84 ; 132 1d35e: 9f 93 push r25 1d360: 8f 93 push r24 1d362: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 1d366: a7 01 movw r20, r14 1d368: 96 01 movw r18, r12 1d36a: c7 01 movw r24, r14 1d36c: b6 01 movw r22, r12 1d36e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1d372: 20 e0 ldi r18, 0x00 ; 0 1d374: 30 e0 ldi r19, 0x00 ; 0 1d376: 48 ec ldi r20, 0xC8 ; 200 1d378: 51 e4 ldi r21, 0x41 ; 65 1d37a: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d37e: 9f 93 push r25 1d380: 8f 93 push r24 1d382: 7f 93 push r23 1d384: 6f 93 push r22 1d386: 1f 92 push r1 1d388: 1f 93 push r17 1d38a: 1f 92 push r1 1d38c: 84 e6 ldi r24, 0x64 ; 100 1d38e: 8f 93 push r24 1d390: 8d e2 ldi r24, 0x2D ; 45 1d392: 94 e8 ldi r25, 0x84 ; 132 1d394: 9f 93 push r25 1d396: 8f 93 push r24 1d398: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 1d39c: 20 e0 ldi r18, 0x00 ; 0 1d39e: 30 e0 ldi r19, 0x00 ; 0 1d3a0: 48 ec ldi r20, 0xC8 ; 200 1d3a2: 52 e4 ldi r21, 0x42 ; 66 1d3a4: c7 01 movw r24, r14 1d3a6: b6 01 movw r22, r12 1d3a8: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d3ac: 9f 93 push r25 1d3ae: 8f 93 push r24 1d3b0: 7f 93 push r23 1d3b2: 6f 93 push r22 1d3b4: 1f 92 push r1 1d3b6: 1f 93 push r17 1d3b8: 1f 92 push r1 1d3ba: 18 ec ldi r17, 0xC8 ; 200 1d3bc: 1f 93 push r17 1d3be: 8d e2 ldi r24, 0x2D ; 45 1d3c0: 94 e8 ldi r25, 0x84 ; 132 1d3c2: 9f 93 push r25 1d3c4: 8f 93 push r24 1d3c6: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1d3ca: 0f b6 in r0, 0x3f ; 63 1d3cc: f8 94 cli 1d3ce: de bf out 0x3e, r29 ; 62 1d3d0: 0f be out 0x3f, r0 ; 63 1d3d2: cd bf out 0x3d, r28 ; 61 1d3d4: 20 e0 ldi r18, 0x00 ; 0 1d3d6: 30 e0 ldi r19, 0x00 ; 0 1d3d8: 40 ea ldi r20, 0xA0 ; 160 1d3da: 51 e4 ldi r21, 0x41 ; 65 1d3dc: c7 01 movw r24, r14 1d3de: b6 01 movw r22, r12 1d3e0: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d3e4: 9f 93 push r25 1d3e6: 8f 93 push r24 1d3e8: 7f 93 push r23 1d3ea: 6f 93 push r22 1d3ec: 1f 92 push r1 1d3ee: 87 e8 ldi r24, 0x87 ; 135 1d3f0: 8f 93 push r24 1d3f2: 1f 92 push r1 1d3f4: 1f 93 push r17 1d3f6: 2d e2 ldi r18, 0x2D ; 45 1d3f8: 34 e8 ldi r19, 0x84 ; 132 1d3fa: 3f 93 push r19 1d3fc: 2f 93 push r18 1d3fe: 0e 94 d0 7d call 0xfba0 ; 0xfba0 1d402: 71 cf rjmp .-286 ; 0x1d2e6 //! @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); 1d404: 20 e0 ldi r18, 0x00 ; 0 1d406: 30 e0 ldi r19, 0x00 ; 0 1d408: 46 e1 ldi r20, 0x16 ; 22 1d40a: 53 e4 ldi r21, 0x43 ; 67 1d40c: c7 01 movw r24, r14 1d40e: b6 01 movw r22, r12 1d410: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d414: 56 2e mov r5, r22 1d416: 47 2e mov r4, r23 1d418: 38 2e mov r3, r24 1d41a: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1d41c: 20 e0 ldi r18, 0x00 ; 0 1d41e: 30 e0 ldi r19, 0x00 ; 0 1d420: 40 ea ldi r20, 0xA0 ; 160 1d422: 51 e4 ldi r21, 0x41 ; 65 1d424: c7 01 movw r24, r14 1d426: b6 01 movw r22, r12 1d428: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 1d42c: 6b 83 std Y+3, r22 ; 0x03 1d42e: c7 2e mov r12, r23 1d430: 78 2e mov r7, r24 1d432: 69 2e mov r6, r25 1d434: 85 e0 ldi r24, 0x05 ; 5 1d436: 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; 1d438: 81 2c mov r8, r1 1d43a: 91 2c mov r9, r1 1d43c: 96 e1 ldi r25, 0x16 ; 22 1d43e: a9 2e mov r10, r25 1d440: 93 e4 ldi r25, 0x43 ; 67 1d442: 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; 1d444: 32 e3 ldi r19, 0x32 ; 50 1d446: 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; 1d448: 87 e8 ldi r24, 0x87 ; 135 1d44a: 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); 1d44c: 0d e2 ldi r16, 0x2D ; 45 1d44e: 14 e8 ldi r17, 0x84 ; 132 1d450: 9d 81 ldd r25, Y+5 ; 0x05 1d452: e9 2e mov r14, r25 1d454: f1 2c mov r15, r1 1d456: 3c 81 ldd r19, Y+4 ; 0x04 1d458: 23 2f mov r18, r19 1d45a: 30 e0 ldi r19, 0x00 ; 0 1d45c: 3a 83 std Y+2, r19 ; 0x02 1d45e: 29 83 std Y+1, r18 ; 0x01 1d460: 2f 92 push r2 1d462: 3f 92 push r3 1d464: 4f 92 push r4 1d466: 5f 92 push r5 1d468: 1f 92 push r1 1d46a: 9f 93 push r25 1d46c: 1f 92 push r1 1d46e: 8c 81 ldd r24, Y+4 ; 0x04 1d470: 8f 93 push r24 1d472: 1f 93 push r17 1d474: 0f 93 push r16 1d476: 0e 94 d0 7d call 0xfba0 ; 0xfba0 y_pos -= short_length; 1d47a: b7 01 movw r22, r14 1d47c: ff 0c add r15, r15 1d47e: 88 0b sbc r24, r24 1d480: 99 0b sbc r25, r25 1d482: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1d486: 20 e0 ldi r18, 0x00 ; 0 1d488: 30 e0 ldi r19, 0x00 ; 0 1d48a: 40 ea ldi r20, 0xA0 ; 160 1d48c: 51 e4 ldi r21, 0x41 ; 65 1d48e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1d492: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 1d496: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 1d498: 6f 92 push r6 1d49a: 7f 92 push r7 1d49c: cf 92 push r12 1d49e: 9b 81 ldd r25, Y+3 ; 0x03 1d4a0: 9f 93 push r25 1d4a2: 1f 92 push r1 1d4a4: 2d 81 ldd r18, Y+5 ; 0x05 1d4a6: 2f 93 push r18 1d4a8: 1f 92 push r1 1d4aa: 3c 81 ldd r19, Y+4 ; 0x04 1d4ac: 3f 93 push r19 1d4ae: 1f 93 push r17 1d4b0: 0f 93 push r16 1d4b2: 0e 94 d0 7d call 0xfba0 ; 0xfba0 x_pos += long_length; 1d4b6: 29 81 ldd r18, Y+1 ; 0x01 1d4b8: 3a 81 ldd r19, Y+2 ; 0x02 1d4ba: b9 01 movw r22, r18 1d4bc: 33 0f add r19, r19 1d4be: 88 0b sbc r24, r24 1d4c0: 99 0b sbc r25, r25 1d4c2: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1d4c6: a5 01 movw r20, r10 1d4c8: 94 01 movw r18, r8 1d4ca: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1d4ce: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 1d4d2: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 1d4d4: b7 fa bst r11, 7 1d4d6: b0 94 com r11 1d4d8: b7 f8 bld r11, 7 1d4da: b0 94 com r11 1d4dc: 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) 1d4de: 0f b6 in r0, 0x3f ; 63 1d4e0: f8 94 cli 1d4e2: de bf out 0x3e, r29 ; 62 1d4e4: 0f be out 0x3f, r0 ; 63 1d4e6: cd bf out 0x3d, r28 ; 61 1d4e8: d1 10 cpse r13, r1 1d4ea: b2 cf rjmp .-156 ; 0x1d450 1d4ec: 89 cd rjmp .-1262 ; 0x1d000 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 1d4ee: b7 01 movw r22, r14 1d4f0: a6 01 movw r20, r12 1d4f2: 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); 1d4f4: 0f 94 11 53 call 0x2a622 ; 0x2a622 1d4f8: 83 cd rjmp .-1274 ; 0x1d000 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 1d4fa: b7 01 movw r22, r14 1d4fc: a6 01 movw r20, r12 1d4fe: 84 e0 ldi r24, 0x04 ; 4 1d500: f9 cf rjmp .-14 ; 0x1d4f4 break; case 4: lay1cal_square(8, layer_height, extrusion_width); 1d502: b7 01 movw r22, r14 1d504: a6 01 movw r20, r12 1d506: 88 e0 ldi r24, 0x08 ; 8 1d508: f5 cf rjmp .-22 ; 0x1d4f4 break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1d50a: b7 01 movw r22, r14 1d50c: a6 01 movw r20, r12 1d50e: 8c e0 ldi r24, 0x0C ; 12 1d510: f1 cf rjmp .-30 ; 0x1d4f4 1d512: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1d516: 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]))); 1d518: 66 e0 ldi r22, 0x06 ; 6 1d51a: 81 e2 ldi r24, 0x21 ; 33 1d51c: 94 e8 ldi r25, 0x84 ; 132 1d51e: 0e 94 b9 7d call 0xfb72 ; 0xfb72 if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 1d522: 29 81 ldd r18, Y+1 ; 0x01 1d524: 21 30 cpi r18, 0x01 ; 1 1d526: 29 f4 brne .+10 ; 0x1d532 1d528: 61 e0 ldi r22, 0x01 ; 1 1d52a: 81 eb ldi r24, 0xB1 ; 177 1d52c: 98 e6 ldi r25, 0x68 ; 104 1d52e: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommand_P(MSG_M84);// disable motors 1d532: 61 e0 ldi r22, 0x01 ; 1 1d534: 8d ea ldi r24, 0xAD ; 173 1d536: 98 e6 ldi r25, 0x68 ; 104 1d538: 0e 94 3a 7d call 0xfa74 ; 0xfa74 1d53c: 61 cd rjmp .-1342 ; 0x1d000 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1d53e: 8b e0 ldi r24, 0x0B ; 11 1d540: 9c e6 ldi r25, 0x6C ; 108 1d542: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_commands_step = 0; 1d546: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d54a: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d54e: 82 e0 ldi r24, 0x02 ; 2 1d550: 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)) 1d554: 8f e5 ldi r24, 0x5F ; 95 1d556: 9f e0 ldi r25, 0x0F ; 15 1d558: 0f 94 7d a0 call 0x340fa ; 0x340fa 1d55c: 88 23 and r24, r24 1d55e: 09 f4 brne .+2 ; 0x1d562 1d560: 28 ce rjmp .-944 ; 0x1d1b2 lcd_wizard(WizState::RepeatLay1Cal); 1d562: 8b e0 ldi r24, 0x0B ; 11 1d564: 0f 94 b2 2d call 0x25b64 ; 0x25b64 1d568: 4b cd rjmp .-1386 ; 0x1d000 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."); 1d56a: 87 ee ldi r24, 0xE7 ; 231 1d56c: 94 e8 ldi r25, 0x84 ; 132 1d56e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 1d572: f9 cd rjmp .-1038 ; 0x1d166 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1d574: 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; 1d576: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d57a: 3c ce rjmp .-904 ; 0x1d1f4 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)); 1d57c: 87 ef ldi r24, 0xF7 ; 247 1d57e: 90 e4 ldi r25, 0x40 ; 64 1d580: 0e 94 3c 6d call 0xda78 ; 0xda78 1d584: 0f 94 19 0b call 0x21632 ; 0x21632 enquecommand_P(G28W); 1d588: 61 e0 ldi r22, 0x01 ; 1 1d58a: 86 eb ldi r24, 0xB6 ; 182 1d58c: 98 e6 ldi r25, 0x68 ; 104 1d58e: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1d592: 61 e0 ldi r22, 0x01 ; 1 1d594: 84 ed ldi r24, 0xD4 ; 212 1d596: 94 e8 ldi r25, 0x84 ; 132 1d598: 0e 94 3a 7d call 0xfa74 ; 0xfa74 enquecommand_P(PSTR("M109 S280")); 1d59c: 61 e0 ldi r22, 0x01 ; 1 1d59e: 8a ec ldi r24, 0xCA ; 202 1d5a0: 94 e8 ldi r25, 0x84 ; 132 1d5a2: 0e 94 3a 7d call 0xfa74 ; 0xfa74 } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1d5a6: 82 e0 ldi r24, 0x02 ; 2 1d5a8: e6 cf rjmp .-52 ; 0x1d576 break; case 2: enquecommand_P(PSTR("M84 XY")); 1d5aa: 61 e0 ldi r22, 0x01 ; 1 1d5ac: 83 ec ldi r24, 0xC3 ; 195 1d5ae: 94 e8 ldi r25, 0x84 ; 132 1d5b0: 0e 94 3a 7d call 0xfa74 ; 0xfa74 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1d5b4: 8e eb ldi r24, 0xBE ; 190 1d5b6: 90 e4 ldi r25, 0x40 ; 64 1d5b8: 0e 94 3c 6d call 0xda78 ; 0xda78 1d5bc: 41 e0 ldi r20, 0x01 ; 1 1d5be: 60 e0 ldi r22, 0x00 ; 0 1d5c0: 0f 94 89 2d call 0x25b12 ; 0x25b12 1d5c4: 81 11 cpse r24, r1 1d5c6: 16 ce rjmp .-980 ; 0x1d1f4 1d5c8: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d5cc: 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; 1d5d0: 81 e0 ldi r24, 0x01 ; 1 1d5d2: d1 cf rjmp .-94 ; 0x1d576 } break; case 1: lcd_commands_step = 0; 1d5d4: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d5d8: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d5dc: 82 e0 ldi r24, 0x02 ; 2 1d5de: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1d5e2: 20 e0 ldi r18, 0x00 ; 0 1d5e4: 41 e0 ldi r20, 0x01 ; 1 1d5e6: 62 e0 ldi r22, 0x02 ; 2 1d5e8: 70 e0 ldi r23, 0x00 ; 0 1d5ea: 80 eb ldi r24, 0xB0 ; 176 1d5ec: 93 eb ldi r25, 0xB3 ; 179 1d5ee: 0f 94 87 93 call 0x3270e ; 0x3270e menu_depth = 3; 1d5f2: 83 e0 ldi r24, 0x03 ; 3 1d5f4: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 1d5f8: fd cd rjmp .-1030 ; 0x1d1f4 0001d5fa : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1d5fa: 0f 93 push r16 1d5fc: 1f 93 push r17 1d5fe: cf 93 push r28 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1d600: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d604: 82 fb bst r24, 2 1d606: 88 27 eor r24, r24 1d608: 80 f9 bld r24, 0 1d60a: 91 e0 ldi r25, 0x01 ; 1 1d60c: 89 27 eor r24, r25 1d60e: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 1d612: 89 17 cp r24, r25 1d614: 99 f1 breq .+102 ; 0x1d67c { if(menu_menu == lcd_sdcard_menu) { 1d616: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d61a: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d61e: 8e 5f subi r24, 0xFE ; 254 1d620: 9b 4e sbci r25, 0xEB ; 235 1d622: 11 f4 brne .+4 ; 0x1d628 // 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(); 1d624: 0f 94 25 96 call 0x32c4a ; 0x32c4a } lcd_draw_update = 2; 1d628: 82 e0 ldi r24, 0x02 ; 2 1d62a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_oldcardstatus = IS_SD_INSERTED; 1d62e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d632: c1 e0 ldi r28, 0x01 ; 1 1d634: 82 fb bst r24, 2 1d636: 88 27 eor r24, r24 1d638: 80 f9 bld r24, 0 1d63a: 8c 27 eor r24, r28 1d63c: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1d640: 0e 94 b2 6a call 0xd564 ; 0xd564 backlight_wake(); if (lcd_oldcardstatus) 1d644: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 1d648: 88 23 and r24, r24 1d64a: 09 f4 brne .+2 ; 0x1d64e 1d64c: 88 c0 rjmp .+272 ; 0x1d75e { if (!card.mounted) 1d64e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1d652: 81 11 cpse r24, r1 1d654: 04 c0 rjmp .+8 ; 0x1d65e { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1d656: 0f 94 1b 4d call 0x29a36 ; 0x29a36 card.presort_flag = true; //force sorting of the SD menu 1d65a: c0 93 b9 13 sts 0x13B9, r28 ; 0x8013b9 } LCD_MESSAGERPGM(MSG_WELCOME); 1d65e: 8b e0 ldi r24, 0x0B ; 11 1d660: 9c e6 ldi r25, 0x6C ; 108 1d662: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1d666: 10 92 97 03 sts 0x0397, r1 ; 0x800397 menu_submenu(lcd_sdcard_menu, true); 1d66a: 61 e0 ldi r22, 0x01 ; 1 1d66c: 8e ef ldi r24, 0xFE ; 254 1d66e: 9b ee ldi r25, 0xEB ; 235 1d670: 0f 94 ca 94 call 0x32994 ; 0x32994 lcd_timeoutToStatus.start(); 1d674: 81 eb ldi r24, 0xB1 ; 177 1d676: 93 e0 ldi r25, 0x03 ; 3 1d678: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1d67c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1d680: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1d684: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1d688: 20 91 95 03 lds r18, 0x0395 ; 0x800395 1d68c: 30 91 96 03 lds r19, 0x0396 ; 0x800396 1d690: 06 17 cp r16, r22 1d692: 17 07 cpc r17, r23 1d694: 28 07 cpc r18, r24 1d696: 39 07 cpc r19, r25 1d698: e8 f5 brcc .+122 ; 0x1d714 { if (lcd_draw_update) { 1d69a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d69e: 88 23 and r24, r24 1d6a0: 31 f0 breq .+12 ; 0x1d6ae lcd_timeoutToStatus.start(); 1d6a2: 81 eb ldi r24, 0xB1 ; 177 1d6a4: 93 e0 ldi r25, 0x03 ; 3 1d6a6: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> lcd_frame_start(); 1d6aa: 0e 94 ba 69 call 0xd374 ; 0xd374 } (*menu_menu)(); 1d6ae: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d6b2: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d6b6: 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)))); 1d6b8: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d6bc: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d6c0: 8b 59 subi r24, 0x9B ; 155 1d6c2: 97 43 sbci r25, 0x37 ; 55 1d6c4: 09 f4 brne .+2 ; 0x1d6c8 1d6c6: 5e c0 rjmp .+188 ; 0x1d784 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1d6c8: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d6cc: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d6d0: 27 e3 ldi r18, 0x37 ; 55 1d6d2: 81 3c cpi r24, 0xC1 ; 193 1d6d4: 92 07 cpc r25, r18 1d6d6: 09 f0 breq .+2 ; 0x1d6da 1d6d8: 76 c0 rjmp .+236 ; 0x1d7c6 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1d6da: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d6de: 82 30 cpi r24, 0x02 ; 2 1d6e0: 21 f4 brne .+8 ; 0x1d6ea #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1d6e2: 0e 94 b2 6a call 0xd564 ; 0xd564 lcd_status_message_idx = 0; // Re-draw message from beginning 1d6e6: 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--; 1d6ea: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d6ee: 88 23 and r24, r24 1d6f0: 19 f0 breq .+6 ; 0x1d6f8 1d6f2: 81 50 subi r24, 0x01 ; 1 1d6f4: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1d6f8: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1d6fc: 6c 59 subi r22, 0x9C ; 156 1d6fe: 7f 4f sbci r23, 0xFF ; 255 1d700: 8f 4f sbci r24, 0xFF ; 255 1d702: 9f 4f sbci r25, 0xFF ; 255 1d704: 60 93 93 03 sts 0x0393, r22 ; 0x800393 1d708: 70 93 94 03 sts 0x0394, r23 ; 0x800394 1d70c: 80 93 95 03 sts 0x0395, r24 ; 0x800395 1d710: 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))) { 1d714: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d718: 88 23 and r24, r24 1d71a: 99 f0 breq .+38 ; 0x1d742 1d71c: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_ZL11no_response.lto_priv.495> 1d720: 88 23 and r24, r24 1d722: 79 f0 breq .+30 ; 0x1d742 1d724: 60 e1 ldi r22, 0x10 ; 16 1d726: 77 e2 ldi r23, 0x27 ; 39 1d728: 8f e8 ldi r24, 0x8F ; 143 1d72a: 93 e0 ldi r25, 0x03 ; 3 1d72c: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1d730: 88 23 and r24, r24 1d732: 39 f0 breq .+14 ; 0x1d742 //send important status messages periodicaly prusa_statistics(8); 1d734: 88 e0 ldi r24, 0x08 ; 8 1d736: 0f 94 a0 98 call 0x33140 ; 0x33140 NcTime.start(); 1d73a: 8f e8 ldi r24, 0x8F ; 143 1d73c: 93 e0 ldi r25, 0x03 ; 3 1d73e: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1d742: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d746: 84 30 cpi r24, 0x04 ; 4 1d748: 09 f0 breq .+2 ; 0x1d74c 1d74a: 54 c0 rjmp .+168 ; 0x1d7f4 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) { 1d74c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1d750: 81 11 cpse r24, r1 1d752: 50 c0 rjmp .+160 ; 0x1d7f4 if (lcd_draw_update) lcd_draw_update--; lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } 1d754: cf 91 pop r28 1d756: 1f 91 pop r17 1d758: 0f 91 pop r16 1d75a: 0c 94 70 e6 jmp 0x1cce0 ; 0x1cce0 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1d75e: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 1d762: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 1d766: 87 e7 ldi r24, 0x77 ; 119 1d768: 9e e9 ldi r25, 0x9E ; 158 1d76a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1d76e: 8d e8 ldi r24, 0x8D ; 141 1d770: 98 e6 ldi r25, 0x68 ; 104 1d772: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1d776: 87 e6 ldi r24, 0x67 ; 103 1d778: 90 e4 ldi r25, 0x40 ; 64 1d77a: 0e 94 3c 6d call 0xda78 ; 0xda78 1d77e: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 1d782: 7c cf rjmp .-264 ; 0x1d67c // 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)))); 1d784: 0e 94 62 61 call 0xc2c4 ; 0xc2c4 1d788: 81 11 cpse r24, r1 1d78a: 0e c0 rjmp .+28 ; 0x1d7a8 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) 1d78c: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d790: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d794: 30 97 sbiw r30, 0x00 ; 0 1d796: 39 f5 brne .+78 ; 0x1d7e6 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1d798: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_return_to_status(); 1d79c: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_draw_update = 2; 1d7a0: 82 e0 ldi r24, 0x02 ; 2 1d7a2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b 1d7a6: 99 cf rjmp .-206 ; 0x1d6da // 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)))); 1d7a8: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d7ac: 81 11 cpse r24, r1 1d7ae: 8c cf rjmp .-232 ; 0x1d6c8 1d7b0: 40 e9 ldi r20, 0x90 ; 144 1d7b2: 5f e5 ldi r21, 0x5F ; 95 1d7b4: 61 e0 ldi r22, 0x01 ; 1 1d7b6: 70 e0 ldi r23, 0x00 ; 0 1d7b8: 81 eb ldi r24, 0xB1 ; 177 1d7ba: 93 e0 ldi r25, 0x03 ; 3 1d7bc: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> 1d7c0: 81 11 cpse r24, r1 1d7c2: e4 cf rjmp .-56 ; 0x1d78c 1d7c4: 81 cf rjmp .-254 ; 0x1d6c8 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1d7c6: 8b 59 subi r24, 0x9B ; 155 1d7c8: 97 43 sbci r25, 0x37 ; 55 1d7ca: 09 f4 brne .+2 ; 0x1d7ce 1d7cc: 86 cf rjmp .-244 ; 0x1d6da && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d7ce: 40 e3 ldi r20, 0x30 ; 48 1d7d0: 55 e7 ldi r21, 0x75 ; 117 1d7d2: 60 e0 ldi r22, 0x00 ; 0 1d7d4: 70 e0 ldi r23, 0x00 ; 0 1d7d6: 81 eb ldi r24, 0xB1 ; 177 1d7d8: 93 e0 ldi r25, 0x03 ; 3 1d7da: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> 1d7de: 88 23 and r24, r24 1d7e0: 09 f4 brne .+2 ; 0x1d7e4 1d7e2: 7b cf rjmp .-266 ; 0x1d6da 1d7e4: d3 cf rjmp .-90 ; 0x1d78c // 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; 1d7e6: 81 e0 ldi r24, 0x01 ; 1 1d7e8: 80 93 92 03 sts 0x0392, r24 ; 0x800392 (*menu_menu)(); 1d7ec: 19 95 eicall menu_leaving = 0; 1d7ee: 10 92 92 03 sts 0x0392, r1 ; 0x800392 1d7f2: d2 cf rjmp .-92 ; 0x1d798 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(); } 1d7f4: cf 91 pop r28 1d7f6: 1f 91 pop r17 1d7f8: 0f 91 pop r16 1d7fa: 08 95 ret 0001d7fc : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1d7fc: 2f 92 push r2 1d7fe: 3f 92 push r3 1d800: 4f 92 push r4 1d802: 5f 92 push r5 1d804: 6f 92 push r6 1d806: 7f 92 push r7 1d808: 8f 92 push r8 1d80a: 9f 92 push r9 1d80c: af 92 push r10 1d80e: bf 92 push r11 1d810: cf 92 push r12 1d812: df 92 push r13 1d814: ef 92 push r14 1d816: ff 92 push r15 1d818: 0f 93 push r16 1d81a: 1f 93 push r17 1d81c: cf 93 push r28 1d81e: df 93 push r29 1d820: cd b7 in r28, 0x3d ; 61 1d822: de b7 in r29, 0x3e ; 62 1d824: 2d 97 sbiw r28, 0x0d ; 13 1d826: 0f b6 in r0, 0x3f ; 63 1d828: f8 94 cli 1d82a: de bf out 0x3e, r29 ; 62 1d82c: 0f be out 0x3f, r0 ; 63 1d82e: 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) 1d830: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1d834: 81 30 cpi r24, 0x01 ; 1 1d836: 51 f1 breq .+84 ; 0x1d88c 1d838: 30 f0 brcs .+12 ; 0x1d846 1d83a: 82 30 cpi r24, 0x02 ; 2 1d83c: 09 f4 brne .+2 ; 0x1d840 1d83e: 88 c2 rjmp .+1296 ; 0x1dd50 { _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. 1d840: 10 92 64 03 sts 0x0364, r1 ; 0x800364 1d844: 04 c1 rjmp .+520 ; 0x1da4e switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1d846: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1d84a: 88 23 and r24, r24 1d84c: 49 f0 breq .+18 ; 0x1d860 { card.presort_flag = false; 1d84e: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 lcd_update_enabled = false; 1d852: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c card.presort(); 1d856: 0f 94 e3 48 call 0x291c6 ; 0x291c6 lcd_update_enabled = true; 1d85a: 81 e0 ldi r24, 0x01 ; 1 1d85c: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } _md->fileCnt = card.getnrfilenames(); 1d860: 0f 94 cc 47 call 0x28f98 ; 0x28f98 1d864: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 1d868: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1d86c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d870: 81 11 cpse r24, r1 1d872: e7 c0 rjmp .+462 ; 0x1da42 1d874: 89 e0 ldi r24, 0x09 ; 9 1d876: 9f e0 ldi r25, 0x0F ; 15 1d878: 0f 94 7d a0 call 0x340fa ; 0x340fa 1d87c: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e _md->menuState = _standard; 1d880: 81 e0 ldi r24, 0x01 ; 1 1d882: 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. 1d886: 8f ef ldi r24, 0xFF ; 255 1d888: 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. 1d88c: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 1d890: 81 11 cpse r24, r1 1d892: 07 c0 rjmp .+14 ; 0x1d8a2 { _md->lcd_scrollTimer.start(); 1d894: 8f e6 ldi r24, 0x6F ; 111 1d896: 93 e0 ldi r25, 0x03 ; 3 1d898: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> lcd_draw_update = 1; 1d89c: 81 e0 ldi r24, 0x01 ; 1 1d89e: 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. 1d8a2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d8a6: 81 11 cpse r24, r1 1d8a8: 21 c0 rjmp .+66 ; 0x1d8ec 1d8aa: 64 ef ldi r22, 0xF4 ; 244 1d8ac: 71 e0 ldi r23, 0x01 ; 1 1d8ae: 8f e6 ldi r24, 0x6F ; 111 1d8b0: 93 e0 ldi r25, 0x03 ; 3 1d8b2: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1d8b6: 88 23 and r24, r24 1d8b8: a1 f0 breq .+40 ; 0x1d8e2 1d8ba: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 1d8be: 8f 3f cpi r24, 0xFF ; 255 1d8c0: 81 f0 breq .+32 ; 0x1d8e2 { _md->menuState = _scrolling; 1d8c2: 82 e0 ldi r24, 0x02 ; 2 1d8c4: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->offset = 0; 1d8c8: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->scrollPointer = NULL; 1d8cc: 10 92 68 03 sts 0x0368, r1 ; 0x800368 1d8d0: 10 92 67 03 sts 0x0367, r1 ; 0x800367 _md->lcd_scrollTimer.start(); 1d8d4: 8f e6 ldi r24, 0x6F ; 111 1d8d6: 93 e0 ldi r25, 0x03 ; 3 1d8d8: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1d8dc: 81 e0 ldi r24, 0x01 ; 1 1d8de: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update == 0 && !lcd_clicked()) 1d8e2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d8e6: 88 23 and r24, r24 1d8e8: 09 f4 brne .+2 ; 0x1d8ec 1d8ea: ad c0 rjmp .+346 ; 0x1da46 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. 1d8ec: 8f ef ldi r24, 0xFF ; 255 1d8ee: 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(); 1d8f2: 8f e6 ldi r24, 0x6F ; 111 1d8f4: 93 e0 ldi r25, 0x03 ; 3 1d8f6: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> MENU_BEGIN(); 1d8fa: 0f 94 5d 93 call 0x326ba ; 0x326ba 1d8fe: 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); 1d902: ce 01 movw r24, r28 1d904: 01 96 adiw r24, 0x01 ; 1 1d906: 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); 1d908: fd e8 ldi r31, 0x8D ; 141 1d90a: 2f 2e mov r2, r31 1d90c: fc e6 ldi r31, 0x6C ; 108 1d90e: 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(); 1d910: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1d914: 84 30 cpi r24, 0x04 ; 4 1d916: 08 f0 brcs .+2 ; 0x1d91a 1d918: 9a c0 rjmp .+308 ; 0x1da4e 1d91a: 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 1d91e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1d922: 88 23 and r24, r24 1d924: 09 f4 brne .+2 ; 0x1d928 1d926: ac c0 rjmp .+344 ; 0x1da80 1d928: 8a e5 ldi r24, 0x5A ; 90 1d92a: 9e e3 ldi r25, 0x3E ; 62 1d92c: 0e 94 3c 6d call 0xda78 ; 0xda78 1d930: 0f 94 28 96 call 0x32c50 ; 0x32c50 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;}; 1d934: 6c e6 ldi r22, 0x6C ; 108 1d936: 73 e1 ldi r23, 0x13 ; 19 1d938: 85 e1 ldi r24, 0x15 ; 21 1d93a: 94 e1 ldi r25, 0x14 ; 20 1d93c: 0f 94 56 6f call 0x2deac ; 0x2deac card.getWorkDirName(); if (card.filename[0] == '/') 1d940: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1d944: 8f 32 cpi r24, 0x2F ; 47 1d946: 09 f0 breq .+2 ; 0x1d94a 1d948: 9e c0 rjmp .+316 ; 0x1da86 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1d94a: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1d94e: 88 23 and r24, r24 1d950: 41 f0 breq .+16 ; 0x1d962 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1d952: 8f e4 ldi r24, 0x4F ; 79 1d954: 9e e3 ldi r25, 0x3E ; 62 1d956: 0e 94 3c 6d call 0xda78 ; 0xda78 1d95a: 68 ec ldi r22, 0xC8 ; 200 1d95c: 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. 1d95e: 0f 94 da 92 call 0x325b4 ; 0x325b4 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1d962: c0 90 6b 03 lds r12, 0x036B ; 0x80036b 1d966: 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; 1d96a: 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. 1d96c: 91 e0 ldi r25, 0x01 ; 1 1d96e: c9 1a sub r12, r25 1d970: d1 08 sbc r13, r1 1d972: 08 f4 brcc .+2 ; 0x1d976 1d974: e0 c1 rjmp .+960 ; 0x1dd36 { if (menu_item == menu_line) //If the file is on the screen. 1d976: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1d97a: 90 91 30 04 lds r25, 0x0430 ; 0x800430 1d97e: 89 13 cpse r24, r25 1d980: d6 c1 rjmp .+940 ; 0x1dd2e { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1d982: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1d986: c6 01 movw r24, r12 1d988: 0f 94 5a 51 call 0x2a2b4 ; 0x2a2b4 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1d98c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1d990: 90 e0 ldi r25, 0x00 ; 0 1d992: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1d996: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1d99a: 10 91 b6 13 lds r17, 0x13B6 ; 0x8013b6 1d99e: 82 17 cp r24, r18 1d9a0: 93 07 cpc r25, r19 1d9a2: 51 f4 brne .+20 ; 0x1d9b8 { _md->selectedFileID = i; 1d9a4: d0 92 6a 03 sts 0x036A, r13 ; 0x80036a 1d9a8: c0 92 69 03 sts 0x0369, r12 ; 0x800369 _md->isDir = card.filenameIsDir; 1d9ac: 10 93 66 03 sts 0x0366, r17 ; 0x800366 _md->row = menu_row; 1d9b0: 40 91 2e 04 lds r20, 0x042E ; 0x80042e 1d9b4: 40 93 6d 03 sts 0x036D, r20 ; 0x80036d 1d9b8: 40 91 5b 02 lds r20, 0x025B ; 0x80025b } if (card.filenameIsDir) 1d9bc: 11 23 and r17, r17 1d9be: 09 f4 brne .+2 ; 0x1d9c2 1d9c0: 67 c0 rjmp .+206 ; 0x1da90 #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) 1d9c2: 44 23 and r20, r20 1d9c4: e9 f0 breq .+58 ; 0x1da00 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1d9c6: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1d9ca: ec e6 ldi r30, 0x6C ; 108 1d9cc: ae 2e mov r10, r30 1d9ce: e3 e1 ldi r30, 0x13 ; 19 1d9d0: be 2e mov r11, r30 1d9d2: 44 23 and r20, r20 1d9d4: 21 f0 breq .+8 ; 0x1d9de 1d9d6: 71 e8 ldi r23, 0x81 ; 129 1d9d8: a7 2e mov r10, r23 1d9da: 73 e1 ldi r23, 0x13 ; 19 1d9dc: b7 2e mov r11, r23 1d9de: 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)?'>':' '); 1d9e2: 4e e3 ldi r20, 0x3E ; 62 1d9e4: 82 17 cp r24, r18 1d9e6: 93 07 cpc r25, r19 1d9e8: 09 f0 breq .+2 ; 0x1d9ec 1d9ea: 40 e2 ldi r20, 0x20 ; 32 1d9ec: 80 e0 ldi r24, 0x00 ; 0 1d9ee: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc(LCD_STR_FOLDER[0]); 1d9f2: 85 e8 ldi r24, 0x85 ; 133 1d9f4: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_print_pad(longFilename, len); 1d9f8: 62 e1 ldi r22, 0x12 ; 18 1d9fa: c5 01 movw r24, r10 1d9fc: 0e 94 f5 6b call 0xd7ea ; 0xd7ea 1da00: 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)) 1da04: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1da08: 99 23 and r25, r25 1da0a: 09 f4 brne .+2 ; 0x1da0e 1da0c: 90 c1 rjmp .+800 ; 0x1dd2e 1da0e: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1da12: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1da16: 82 17 cp r24, r18 1da18: 13 06 cpc r1, r19 1da1a: 09 f0 breq .+2 ; 0x1da1e 1da1c: 88 c1 rjmp .+784 ; 0x1dd2e { lcd_update_enabled = false; 1da1e: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1da22: 61 e0 ldi r22, 0x01 ; 1 1da24: 8c e6 ldi r24, 0x6C ; 108 1da26: 93 e1 ldi r25, 0x13 ; 19 1da28: 0f 94 6d 4a call 0x294da ; 0x294da lcd_encoder = 0; 1da2c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1da30: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 1da34: 0f 94 7f 93 call 0x326fe ; 0x326fe } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1da38: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c menu_item_ret(); 1da3c: 0f 94 43 92 call 0x32486 ; 0x32486 1da40: 95 cf rjmp .-214 ; 0x1d96c 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); 1da42: 82 e0 ldi r24, 0x02 ; 2 1da44: 1b cf rjmp .-458 ; 0x1d87c _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()) 1da46: 0e 94 23 6c call 0xd846 ; 0xd846 1da4a: 81 11 cpse r24, r1 1da4c: 4f cf rjmp .-354 ; 0x1d8ec _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1da4e: 2d 96 adiw r28, 0x0d ; 13 1da50: 0f b6 in r0, 0x3f ; 63 1da52: f8 94 cli 1da54: de bf out 0x3e, r29 ; 62 1da56: 0f be out 0x3f, r0 ; 63 1da58: cd bf out 0x3d, r28 ; 61 1da5a: df 91 pop r29 1da5c: cf 91 pop r28 1da5e: 1f 91 pop r17 1da60: 0f 91 pop r16 1da62: ff 90 pop r15 1da64: ef 90 pop r14 1da66: df 90 pop r13 1da68: cf 90 pop r12 1da6a: bf 90 pop r11 1da6c: af 90 pop r10 1da6e: 9f 90 pop r9 1da70: 8f 90 pop r8 1da72: 7f 90 pop r7 1da74: 6f 90 pop r6 1da76: 5f 90 pop r5 1da78: 4f 90 pop r4 1da7a: 3f 90 pop r3 1da7c: 2f 90 pop r2 1da7e: 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 1da80: 86 e7 ldi r24, 0x76 ; 118 1da82: 90 e4 ldi r25, 0x40 ; 64 1da84: 53 cf rjmp .-346 ; 0x1d92c 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. 1da86: 62 ed ldi r22, 0xD2 ; 210 1da88: 7a eb ldi r23, 0xBA ; 186 1da8a: 84 ec ldi r24, 0xC4 ; 196 1da8c: 93 e8 ldi r25, 0x83 ; 131 1da8e: 67 cf rjmp .-306 ; 0x1d95e menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1da90: 44 23 and r20, r20 1da92: d1 f0 breq .+52 ; 0x1dac8 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1da94: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1da98: 6c e6 ldi r22, 0x6C ; 108 1da9a: a6 2e mov r10, r22 1da9c: 63 e1 ldi r22, 0x13 ; 19 1da9e: b6 2e mov r11, r22 1daa0: 44 23 and r20, r20 1daa2: 21 f0 breq .+8 ; 0x1daac 1daa4: 51 e8 ldi r21, 0x81 ; 129 1daa6: a5 2e mov r10, r21 1daa8: 53 e1 ldi r21, 0x13 ; 19 1daaa: b5 2e mov r11, r21 1daac: 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)?'>':' '); 1dab0: 4e e3 ldi r20, 0x3E ; 62 1dab2: 82 17 cp r24, r18 1dab4: 93 07 cpc r25, r19 1dab6: 09 f0 breq .+2 ; 0x1daba 1dab8: 40 e2 ldi r20, 0x20 ; 32 1daba: 80 e0 ldi r24, 0x00 ; 0 1dabc: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_print_pad(longFilename, len); 1dac0: 63 e1 ldi r22, 0x13 ; 19 1dac2: c5 01 movw r24, r10 1dac4: 0e 94 f5 6b call 0xd7ea ; 0xd7ea 1dac8: 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)) 1dacc: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1dad0: 99 23 and r25, r25 1dad2: 09 f4 brne .+2 ; 0x1dad6 1dad4: 2c c1 rjmp .+600 ; 0x1dd2e 1dad6: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1dada: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1dade: 82 17 cp r24, r18 1dae0: 13 06 cpc r1, r19 1dae2: 09 f0 breq .+2 ; 0x1dae6 1dae4: 24 c1 rjmp .+584 ; 0x1dd2e { lcd_update_enabled = false; 1dae6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1daea: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1daee: 81 11 cpse r24, r1 1daf0: a3 cf rjmp .-186 ; 0x1da38 // 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); 1daf2: 6c e6 ldi r22, 0x6C ; 108 1daf4: 73 e1 ldi r23, 0x13 ; 19 1daf6: c7 01 movw r24, r14 1daf8: 0f 94 e8 a6 call 0x34dd0 ; 0x34dd0 1dafc: 47 01 movw r8, r14 1dafe: 45 e9 ldi r20, 0x95 ; 149 1db00: a4 2e mov r10, r20 1db02: 4f e0 ldi r20, 0x0F ; 15 1db04: 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] == '.') { 1db06: f4 01 movw r30, r8 1db08: 61 91 ld r22, Z+ 1db0a: 4f 01 movw r8, r30 1db0c: 66 23 and r22, r22 1db0e: 19 f0 breq .+6 ; 0x1db16 1db10: 6e 32 cpi r22, 0x2E ; 46 1db12: 09 f0 breq .+2 ; 0x1db16 1db14: 4b c0 rjmp .+150 ; 0x1dbac 1db16: 60 e0 ldi r22, 0x00 ; 0 1db18: c5 01 movw r24, r10 1db1a: 0f 94 a1 a0 call 0x34142 ; 0x34142 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, '.'); 1db1e: 6e e2 ldi r22, 0x2E ; 46 1db20: 70 e0 ldi r23, 0x00 ; 0 1db22: c7 01 movw r24, r14 1db24: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 1db28: 3c 01 movw r6, r24 if (extension_ptr) { 1db2a: 89 2b or r24, r25 1db2c: 19 f0 breq .+6 ; 0x1db34 extension_ptr++; // skip the '.' 1db2e: 8f ef ldi r24, 0xFF ; 255 1db30: 68 1a sub r6, r24 1db32: 78 0a sbc r7, r24 1db34: 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); 1db36: 31 e9 ldi r19, 0x91 ; 145 1db38: a3 2e mov r10, r19 1db3a: 3c e0 ldi r19, 0x0C ; 12 1db3c: 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') { 1db3e: 61 14 cp r6, r1 1db40: 71 04 cpc r7, r1 1db42: 21 f0 breq .+8 ; 0x1db4c 1db44: f4 01 movw r30, r8 1db46: 60 81 ld r22, Z 1db48: 61 11 cpse r22, r1 1db4a: 01 c0 rjmp .+2 ; 0x1db4e 1db4c: 60 e0 ldi r22, 0x00 ; 0 1db4e: c5 01 movw r24, r10 1db50: 0f 94 a1 a0 call 0x34142 ; 0x34142 1db54: ff ef ldi r31, 0xFF ; 255 1db56: af 1a sub r10, r31 1db58: bf 0a sbc r11, r31 1db5a: 2f ef ldi r18, 0xFF ; 255 1db5c: 82 1a sub r8, r18 1db5e: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1db60: 84 e9 ldi r24, 0x94 ; 148 1db62: a8 16 cp r10, r24 1db64: 8c e0 ldi r24, 0x0C ; 12 1db66: b8 06 cpc r11, r24 1db68: 51 f7 brne .-44 ; 0x1db3e { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1db6a: 60 90 0a 15 lds r6, 0x150A ; 0x80150a 1db6e: 66 2d mov r22, r6 1db70: 8a e5 ldi r24, 0x5A ; 90 1db72: 9f e0 ldi r25, 0x0F ; 15 1db74: 0f 94 a1 a0 call 0x34142 ; 0x34142 1db78: 88 e6 ldi r24, 0x68 ; 104 1db7a: 93 e1 ldi r25, 0x13 ; 19 1db7c: 2a e0 ldi r18, 0x0A ; 10 1db7e: a2 2e mov r10, r18 1db80: 2f e0 ldi r18, 0x0F ; 15 1db82: 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++) { 1db84: 71 2c mov r7, r1 1db86: 4c 01 movw r8, r24 1db88: e9 e0 ldi r30, 0x09 ; 9 1db8a: 8e 0e add r8, r30 1db8c: 91 1c adc r9, r1 1db8e: 76 14 cp r7, r6 1db90: d1 f0 breq .+52 ; 0x1dbc6 #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); 1db92: 48 e0 ldi r20, 0x08 ; 8 1db94: 50 e0 ldi r21, 0x00 ; 0 1db96: b5 01 movw r22, r10 1db98: 8e 5a subi r24, 0xAE ; 174 1db9a: 9f 4f sbci r25, 0xFF ; 255 1db9c: 0f 94 91 a0 call 0x34122 ; 0x34122 1dba0: 73 94 inc r7 1dba2: f8 e0 ldi r31, 0x08 ; 8 1dba4: af 0e add r10, r31 1dba6: b1 1c adc r11, r1 1dba8: c4 01 movw r24, r8 1dbaa: ed cf rjmp .-38 ; 0x1db86 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dbac: c5 01 movw r24, r10 1dbae: 0f 94 a1 a0 call 0x34142 ; 0x34142 1dbb2: ff ef ldi r31, 0xFF ; 255 1dbb4: af 1a sub r10, r31 1dbb6: 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++) { 1dbb8: 2d e9 ldi r18, 0x9D ; 157 1dbba: a2 16 cp r10, r18 1dbbc: 2f e0 ldi r18, 0x0F ; 15 1dbbe: b2 06 cpc r11, r18 1dbc0: 09 f0 breq .+2 ; 0x1dbc4 1dbc2: a1 cf rjmp .-190 ; 0x1db06 1dbc4: ac cf rjmp .-168 ; 0x1db1e /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1dbc6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1dbca: 88 23 and r24, r24 1dbcc: 91 f0 breq .+36 ; 0x1dbf2 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); 1dbce: ff 92 push r15 1dbd0: ef 92 push r14 1dbd2: 3f 92 push r3 1dbd4: 2f 92 push r2 1dbd6: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommand_P(MSG_M24); 1dbda: 61 e0 ldi r22, 0x01 ; 1 1dbdc: 89 e8 ldi r24, 0x89 ; 137 1dbde: 9c e6 ldi r25, 0x6C ; 108 1dbe0: 0e 94 3a 7d call 0xfa74 ; 0xfa74 1dbe4: 0f 90 pop r0 1dbe6: 0f 90 pop r0 1dbe8: 0f 90 pop r0 1dbea: 0f 90 pop r0 } lcd_return_to_status(); 1dbec: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 1dbf0: 23 cf rjmp .-442 ; 0x1da38 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1dbf2: 61 e0 ldi r22, 0x01 ; 1 1dbf4: c7 01 movw r24, r14 1dbf6: 0f 94 a4 4b call 0x29748 ; 0x29748 } uint32_t CardReader::getFileSize() { return filesize; 1dbfa: 40 90 77 16 lds r4, 0x1677 ; 0x801677 1dbfe: 50 90 78 16 lds r5, 0x1678 ; 0x801678 1dc02: 60 90 79 16 lds r6, 0x1679 ; 0x801679 1dc06: 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); 1dc0a: 94 2d mov r25, r4 1dc0c: 85 2d mov r24, r5 1dc0e: 21 e0 ldi r18, 0x01 ; 1 1dc10: 42 16 cp r4, r18 1dc12: 28 e7 ldi r18, 0x78 ; 120 1dc14: 52 06 cpc r5, r18 1dc16: 61 04 cpc r6, r1 1dc18: 71 04 cpc r7, r1 1dc1a: 10 f0 brcs .+4 ; 0x1dc20 1dc1c: 90 e0 ldi r25, 0x00 ; 0 1dc1e: 88 e7 ldi r24, 0x78 ; 120 1dc20: a9 2e mov r10, r25 1dc22: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1dc24: 81 e0 ldi r24, 0x01 ; 1 1dc26: 48 16 cp r4, r24 1dc28: 88 e7 ldi r24, 0x78 ; 120 1dc2a: 58 06 cpc r5, r24 1dc2c: 61 04 cpc r6, r1 1dc2e: 71 04 cpc r7, r1 1dc30: 08 f4 brcc .+2 ; 0x1dc34 1dc32: 5d c0 rjmp .+186 ; 0x1dcee startPos = filesize - END_FILE_SECTION; 1dc34: 98 e7 ldi r25, 0x78 ; 120 1dc36: 59 1a sub r5, r25 1dc38: 61 08 sbc r6, r1 1dc3a: 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);}; 1dc3c: 40 92 7e 16 sts 0x167E, r4 ; 0x80167e 1dc40: 50 92 7f 16 sts 0x167F, r5 ; 0x80167f 1dc44: 60 92 80 16 sts 0x1680, r6 ; 0x801680 1dc48: 70 92 81 16 sts 0x1681, r7 ; 0x801681 1dc4c: c3 01 movw r24, r6 1dc4e: b2 01 movw r22, r4 1dc50: 0f 94 94 43 call 0x28728 ; 0x28728 card.setIndex(startPos); } cmdqueue_reset(); 1dc54: 0e 94 ab 73 call 0xe756 ; 0xe756 cmdqueue_serial_disabled = true; 1dc58: 00 93 61 03 sts 0x0361, r16 ; 0x800361 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1dc5c: 8b e1 ldi r24, 0x1B ; 27 1dc5e: 9e e3 ldi r25, 0x3E ; 62 1dc60: 0e 94 3c 6d call 0xda78 ; 0xda78 1dc64: bc 01 movw r22, r24 1dc66: c5 01 movw r24, r10 1dc68: 0f 94 bf 91 call 0x3237e ; 0x3237e 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; } 1dc6c: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1dc70: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1dc74: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1dc78: b0 91 81 16 lds r27, 0x1681 ; 0x801681 while (!card.eof() && !result) { 1dc7c: 40 91 77 16 lds r20, 0x1677 ; 0x801677 1dc80: 50 91 78 16 lds r21, 0x1678 ; 0x801678 1dc84: 60 91 79 16 lds r22, 0x1679 ; 0x801679 1dc88: 70 91 7a 16 lds r23, 0x167A ; 0x80167a 1dc8c: 84 17 cp r24, r20 1dc8e: 95 07 cpc r25, r21 1dc90: a6 07 cpc r26, r22 1dc92: b7 07 cpc r27, r23 1dc94: 80 f5 brcc .+96 ; 0x1dcf6 1dc96: 11 11 cpse r17, r1 1dc98: 2e c0 rjmp .+92 ; 0x1dcf6 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); }; 1dc9a: 20 91 fd 15 lds r18, 0x15FD ; 0x8015fd 1dc9e: 21 11 cpse r18, r1 1dca0: 03 c0 rjmp .+6 ; 0x1dca8 1dca2: 80 e0 ldi r24, 0x00 ; 0 1dca4: 90 e0 ldi r25, 0x00 ; 0 1dca6: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1dca8: 84 19 sub r24, r4 1dcaa: 95 09 sbc r25, r5 1dcac: 0f 94 90 91 call 0x32320 ; 0x32320 card.sdprinting = true; 1dcb0: 00 93 6a 13 sts 0x136A, r16 ; 0x80136a get_command(); 1dcb4: 0e 94 fd 75 call 0xebfa ; 0xebfa #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1dcb8: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1dcbc: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1dcc0: 89 2b or r24, r25 1dcc2: a1 f2 breq .-88 ; 0x1dc6c { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1dcc4: 8d ea ldi r24, 0xAD ; 173 1dcc6: 98 e6 ldi r25, 0x68 ; 104 1dcc8: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 1dccc: 81 11 cpse r24, r1 1dcce: 05 c0 rjmp .+10 ; 0x1dcda 1dcd0: 8f eb ldi r24, 0xBF ; 191 1dcd2: 93 e8 ldi r25, 0x83 ; 131 1dcd4: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 1dcd8: 81 11 cpse r24, r1 1dcda: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1dcdc: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1dce0: 81 11 cpse r24, r1 1dce2: 02 c0 rjmp .+4 ; 0x1dce8 cmdqueue_pop_front(); 1dce4: 0e 94 5e 70 call 0xe0bc ; 0xe0bc cmdbuffer_front_already_processed = false; 1dce8: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 1dcec: e5 cf rjmp .-54 ; 0x1dcb8 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; 1dcee: 41 2c mov r4, r1 1dcf0: 51 2c mov r5, r1 1dcf2: 32 01 movw r6, r4 1dcf4: af cf rjmp .-162 ; 0x1dc54 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1dcf6: 0f 94 b1 91 call 0x32362 ; 0x32362 cmdqueue_serial_disabled = false; 1dcfa: 10 92 61 03 sts 0x0361, r1 ; 0x800361 card.printingHasFinished(); 1dcfe: 0f 94 dc 4c call 0x299b8 ; 0x299b8 lcd_setstatuspgm(MSG_WELCOME); 1dd02: 8b e0 ldi r24, 0x0B ; 11 1dd04: 9c e6 ldi r25, 0x6C ; 108 1dd06: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 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)) { 1dd0a: 11 11 cpse r17, r1 1dd0c: 60 cf rjmp .-320 ; 0x1dbce result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1dd0e: 8b e2 ldi r24, 0x2B ; 43 1dd10: 9e e3 ldi r25, 0x3E ; 62 1dd12: 0e 94 3c 6d call 0xda78 ; 0xda78 1dd16: 41 e0 ldi r20, 0x01 ; 1 1dd18: 60 e0 ldi r22, 0x00 ; 0 1dd1a: 0f 94 89 2d call 0x25b12 ; 0x25b12 1dd1e: 18 2f mov r17, r24 lcd_update_enable(true); 1dd20: 81 e0 ldi r24, 0x01 ; 1 1dd22: 0e 94 4b 6a call 0xd496 ; 0xd496 } if (result) { 1dd26: 11 23 and r17, r17 1dd28: 09 f4 brne .+2 ; 0x1dd2c 1dd2a: 51 cf rjmp .-350 ; 0x1dbce 1dd2c: 5f cf rjmp .-322 ; 0x1dbec lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1dd2e: 8f 5f subi r24, 0xFF ; 255 1dd30: 80 93 31 04 sts 0x0431, r24 ; 0x800431 1dd34: 1b ce rjmp .-970 ; 0x1d96c else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1dd36: 0f 94 31 93 call 0x32662 ; 0x32662 _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(); 1dd3a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1dd3e: 8f 5f subi r24, 0xFF ; 255 1dd40: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1dd44: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1dd48: 8f 5f subi r24, 0xFF ; 255 1dd4a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1dd4e: e0 cd rjmp .-1088 ; 0x1d910 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. 1dd50: 80 91 63 03 lds r24, 0x0363 ; 0x800363 1dd54: 11 e0 ldi r17, 0x01 ; 1 1dd56: 81 11 cpse r24, r1 1dd58: 05 c0 rjmp .+10 ; 0x1dd64 1dd5a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1dd5e: 81 11 cpse r24, r1 1dd60: 01 c0 rjmp .+2 ; 0x1dd64 1dd62: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1dd64: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1dd68: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1dd6c: 89 2b or r24, r25 1dd6e: 91 f4 brne .+36 ; 0x1dd94 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1dd70: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1dd74: 80 91 69 03 lds r24, 0x0369 ; 0x800369 1dd78: 90 91 6a 03 lds r25, 0x036A ; 0x80036a 1dd7c: 0f 94 5a 51 call 0x2a2b4 ; 0x2a2b4 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1dd80: 80 91 81 13 lds r24, 0x1381 ; 0x801381 1dd84: 81 11 cpse r24, r1 1dd86: 46 c0 rjmp .+140 ; 0x1de14 1dd88: 8c e6 ldi r24, 0x6C ; 108 1dd8a: 93 e1 ldi r25, 0x13 ; 19 1dd8c: 90 93 68 03 sts 0x0368, r25 ; 0x800368 1dd90: 80 93 67 03 sts 0x0367, r24 ; 0x800367 } if (rewindFlag) 1dd94: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1dd96: 10 92 65 03 sts 0x0365, r1 ; 0x800365 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1dd9a: 6c e2 ldi r22, 0x2C ; 44 1dd9c: 71 e0 ldi r23, 0x01 ; 1 1dd9e: 8f e6 ldi r24, 0x6F ; 111 1dda0: 93 e0 ldi r25, 0x03 ; 3 1dda2: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 1dda6: 81 11 cpse r24, r1 1dda8: 03 c0 rjmp .+6 ; 0x1ddb0 1ddaa: 11 23 and r17, r17 1ddac: 09 f4 brne .+2 ; 0x1ddb0 1ddae: 4f ce rjmp .-866 ; 0x1da4e { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1ddb0: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1ddb4: 02 e1 ldi r16, 0x12 ; 18 1ddb6: 81 11 cpse r24, r1 1ddb8: 01 c0 rjmp .+2 ; 0x1ddbc 1ddba: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1ddbc: 4e e3 ldi r20, 0x3E ; 62 1ddbe: 60 91 6d 03 lds r22, 0x036D ; 0x80036d 1ddc2: 80 e0 ldi r24, 0x00 ; 0 1ddc4: 0e 94 26 6a call 0xd44c ; 0xd44c if (_md->isDir) 1ddc8: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1ddcc: 88 23 and r24, r24 1ddce: 19 f0 breq .+6 ; 0x1ddd6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1ddd0: 85 e8 ldi r24, 0x85 ; 133 1ddd2: 0e 94 b5 6a call 0xd56a ; 0xd56a lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1ddd6: 20 91 65 03 lds r18, 0x0365 ; 0x800365 1ddda: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1ddde: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1dde2: 60 2f mov r22, r16 1dde4: 82 0f add r24, r18 1dde6: 91 1d adc r25, r1 1dde8: 0e 94 f5 6b call 0xd7ea ; 0xd7ea 1ddec: 81 11 cpse r24, r1 1ddee: 15 c0 rjmp .+42 ; 0x1de1a { _md->lcd_scrollTimer.start(); 1ddf0: 8f e6 ldi r24, 0x6F ; 111 1ddf2: 93 e0 ldi r25, 0x03 ; 3 1ddf4: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> _md->offset++; 1ddf8: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1ddfc: 8f 5f subi r24, 0xFF ; 255 1ddfe: 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. 1de02: 11 23 and r17, r17 1de04: 09 f4 brne .+2 ; 0x1de08 1de06: 23 ce rjmp .-954 ; 0x1da4e 1de08: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1de0c: 81 e0 ldi r24, 0x01 ; 1 1de0e: 80 93 64 03 sts 0x0364, r24 ; 0x800364 1de12: 1d ce rjmp .-966 ; 0x1da4e #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; 1de14: 81 e8 ldi r24, 0x81 ; 129 1de16: 93 e1 ldi r25, 0x13 ; 19 1de18: b9 cf rjmp .-142 ; 0x1dd8c 1de1a: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 1de1e: f1 cf rjmp .-30 ; 0x1de02 0001de20 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1de20: 61 e0 ldi r22, 0x01 ; 1 1de22: 8f e1 ldi r24, 0x1F ; 31 1de24: 9c e6 ldi r25, 0x6C ; 108 1de26: 0e 94 3a 7d call 0xfa74 ; 0xfa74 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1de2a: 82 e0 ldi r24, 0x02 ; 2 1de2c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1de30: 8d e7 ldi r24, 0x7D ; 125 1de32: 97 e5 ldi r25, 0x57 ; 87 1de34: 0e 94 3c 6d call 0xda78 ; 0xda78 1de38: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_return_to_status(); 1de3c: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_draw_update = 3; 1de40: 83 e0 ldi r24, 0x03 ; 3 1de42: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1de46: 08 95 ret 0001de48 : //! @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; 1de48: 0e 94 13 e6 call 0x1cc26 ; 0x1cc26 1de4c: 88 23 and r24, r24 1de4e: 51 f1 breq .+84 ; 0x1dea4 cmdqueue_serial_disabled = false; 1de50: 10 92 61 03 sts 0x0361, r1 ; 0x800361 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1de54: 8d e7 ldi r24, 0x7D ; 125 1de56: 97 e5 ldi r25, 0x57 ; 87 1de58: 0e 94 3c 6d call 0xda78 ; 0xda78 1de5c: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe st_synchronize(); 1de60: 0f 94 14 22 call 0x24428 ; 0x24428 custom_message_type = CustomMsg::Resuming; 1de64: 88 e0 ldi r24, 0x08 ; 8 1de66: 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(); 1de6a: 0e 94 bd 6e call 0xdd7a ; 0xdd7a setExtruderAutoFanState(1); 1de6e: 81 e0 ldi r24, 0x01 ; 1 1de70: 0e 94 ca 6e call 0xdd94 ; 0xdd94 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1de74: 10 92 ce 11 sts 0x11CE, r1 ; 0x8011ce restore_print_from_ram_and_continue(default_retraction); 1de78: 60 e0 ldi r22, 0x00 ; 0 1de7a: 70 e0 ldi r23, 0x00 ; 0 1de7c: 80 e8 ldi r24, 0x80 ; 128 1de7e: 9f e3 ldi r25, 0x3F ; 63 1de80: 0e 94 cb 61 call 0xc396 ; 0xc396 did_pause_print = false; 1de84: 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(); 1de88: 80 91 59 03 lds r24, 0x0359 ; 0x800359 1de8c: 82 30 cpi r24, 0x02 ; 2 1de8e: 11 f4 brne .+4 ; 0x1de94 1de90: 0f 94 28 20 call 0x24050 ; 0x24050 refresh_cmd_timeout(); 1de94: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1de98: 84 e2 ldi r24, 0x24 ; 36 1de9a: 98 e6 ldi r25, 0x68 ; 104 1de9c: 0e 94 de 72 call 0xe5bc ; 0xe5bc custom_message_type = CustomMsg::Status; 1dea0: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 1dea4: 08 95 ret 0001dea6 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1dea6: cf 93 push r28 1dea8: df 93 push r29 1deaa: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1deac: 80 e0 ldi r24, 0x00 ; 0 1deae: 0e 94 e5 e1 call 0x1c3ca ; 0x1c3ca 1deb2: 88 23 and r24, r24 1deb4: 31 f0 breq .+12 ; 0x1dec2 lcd_updatestatus(message); 1deb6: 60 e0 ldi r22, 0x00 ; 0 1deb8: ce 01 movw r24, r28 } 1deba: df 91 pop r29 1debc: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1debe: 0c 94 ca e1 jmp 0x1c394 ; 0x1c394 } 1dec2: df 91 pop r29 1dec4: cf 91 pop r28 1dec6: 08 95 ret 0001dec8 : 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) { 1dec8: cf 93 push r28 1deca: df 93 push r29 1decc: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1dece: 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) { 1ded0: 66 23 and r22, r22 1ded2: 89 f1 breq .+98 ; 0x1df36 1ded4: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1ded6: 0f 94 31 12 call 0x22462 ; 0x22462 cancel_heatup = true; 1deda: 81 e0 ldi r24, 0x01 ; 1 1dedc: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> heating_status = HeatingStatus::NO_HEATING; 1dee0: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1dee4: 0e 94 1a 5f call 0xbe34 ; 0xbe34 // Abort the planner planner_abort_hard(); 1dee8: 0f 94 8b 86 call 0x30d16 ; 0x30d16 // Reset the queue cmdqueue_reset(); 1deec: 0e 94 ab 73 call 0xe756 ; 0xe756 cmdqueue_serial_disabled = false; 1def0: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1def4: 0f 94 20 22 call 0x24440 ; 0x24440 CRITICAL_SECTION_END; 1def8: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1defa: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b print_job_timer.stop(); 1defe: 0f 94 4c 20 call 0x24098 ; 0x24098 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1df02: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1df06: 88 23 and r24, r24 1df08: 21 f0 breq .+8 ; 0x1df12 // Reset the sd status card.sdprinting = false; 1df0a: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a card.closefile(); 1df0e: 0f 94 82 41 call 0x28304 ; 0x28304 } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1df12: 87 e6 ldi r24, 0x67 ; 103 1df14: 98 e6 ldi r25, 0x68 ; 104 1df16: 0e 94 de 72 call 0xe5bc ; 0xe5bc #ifdef MESH_BED_LEVELING mbl.active = false; 1df1a: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c #endif if (interactive) { 1df1e: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1df20: 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; 1df24: 81 e0 ldi r24, 0x01 ; 1 1df26: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 1df2a: 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(); } 1df2e: df 91 pop r29 1df30: 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(); 1df32: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 } void ConditionalStop() { CRITICAL_SECTION_START; 1df36: 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; 1df38: 81 e0 ldi r24, 0x01 ; 1 1df3a: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> heating_status = HeatingStatus::NO_HEATING; 1df3e: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1df42: 0e 94 1a 5f call 0xbe34 ; 0xbe34 // Abort the planner planner_abort_hard(); 1df46: 0f 94 8b 86 call 0x30d16 ; 0x30d16 // Reset the queue cmdqueue_reset(); 1df4a: 0e 94 ab 73 call 0xe756 ; 0xe756 cmdqueue_serial_disabled = false; 1df4e: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1df52: 0f 94 20 22 call 0x24440 ; 0x24440 CRITICAL_SECTION_END; 1df56: df bf out 0x3f, r29 ; 63 1df58: d4 cf rjmp .-88 ; 0x1df02 0001df5a : } void lcd_print_stop() { print_stop(true); 1df5a: 60 e0 ldi r22, 0x00 ; 0 1df5c: 81 e0 ldi r24, 0x01 ; 1 1df5e: 0c 94 64 ef jmp 0x1dec8 ; 0x1dec8 0001df62 : 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' 1df62: 41 30 cpi r20, 0x01 ; 1 1df64: 41 f4 brne .+16 ; 0x1df76 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1df66: 40 e0 ldi r20, 0x00 ; 0 1df68: 61 e0 ldi r22, 0x01 ; 1 1df6a: 0f 94 89 2d call 0x25b12 ; 0x25b12 1df6e: 81 30 cpi r24, 0x01 ; 1 1df70: 41 f4 brne .+16 ; 0x1df82 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1df72: 0c 94 ad ef jmp 0x1df5a ; 0x1df5a { 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 1df76: 42 30 cpi r20, 0x02 ; 2 1df78: 21 f4 brne .+8 ; 0x1df82 lcd_show_fullscreen_message_and_wait_P(strict); 1df7a: cb 01 movw r24, r22 1df7c: 0f 94 19 0b call 0x21632 ; 0x21632 1df80: f8 cf rjmp .-16 ; 0x1df72 lcd_print_stop(); } } 1df82: 08 95 ret 0001df84 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1df84: 0f 93 push r16 1df86: 1f 93 push r17 1df88: 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)) { 1df8a: 8c ea ldi r24, 0xAC ; 172 1df8c: 9c e0 ldi r25, 0x0C ; 12 1df8e: 0f 94 7d a0 call 0x340fa ; 0x340fa 1df92: 88 23 and r24, r24 1df94: 29 f0 breq .+10 ; 0x1dfa0 return false; } } done: return true; 1df96: 81 e0 ldi r24, 0x01 ; 1 } 1df98: cf 91 pop r28 1df9a: 1f 91 pop r17 1df9c: 0f 91 pop r16 1df9e: 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()) { 1dfa0: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1dfa4: 88 23 and r24, r24 1dfa6: b9 f3 breq .-18 ; 0x1df96 1dfa8: 0e 94 f7 c3 call 0x187ee ; 0x187ee 1dfac: 81 11 cpse r24, r1 1dfae: f3 cf rjmp .-26 ; 0x1df96 if (oCheckFilament == ClCheckMode::_None) { 1dfb0: c0 91 bc 03 lds r28, 0x03BC ; 0x8003bc 1dfb4: cc 23 and r28, r28 1dfb6: 79 f3 breq .-34 ; 0x1df96 goto done; } render_M862_warnings( 1dfb8: 84 e4 ldi r24, 0x44 ; 68 1dfba: 92 e4 ldi r25, 0x42 ; 66 1dfbc: 0e 94 3c 6d call 0xda78 ; 0xda78 1dfc0: 8c 01 movw r16, r24 1dfc2: 8b e1 ldi r24, 0x1B ; 27 1dfc4: 92 e4 ldi r25, 0x42 ; 66 1dfc6: 0e 94 3c 6d call 0xda78 ; 0xda78 1dfca: 4c 2f mov r20, r28 1dfcc: b8 01 movw r22, r16 1dfce: 0e 94 b1 ef call 0x1df62 ; 0x1df62 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1dfd2: 81 e0 ldi r24, 0x01 ; 1 1dfd4: 90 91 c8 0d lds r25, 0x0DC8 ; 0x800dc8 1dfd8: 91 30 cpi r25, 0x01 ; 1 1dfda: f1 f6 brne .-68 ; 0x1df98 1dfdc: 80 e0 ldi r24, 0x00 ; 0 1dfde: dc cf rjmp .-72 ; 0x1df98 0001dfe0 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1dfe0: 1f 93 push r17 1dfe2: cf 93 push r28 1dfe4: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1dfe6: 10 91 bb 03 lds r17, 0x03BB ; 0x8003bb 1dfea: 11 23 and r17, r17 1dfec: 19 f1 breq .+70 ; 0x1e034 1dfee: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1dff0: 85 ea ldi r24, 0xA5 ; 165 1dff2: 9d e0 ldi r25, 0x0D ; 13 1dff4: 0f 94 8b a0 call 0x34116 ; 0x34116 if (nDiameter == nDiameter_um) 1dff8: 8c 17 cp r24, r28 1dffa: 9d 07 cpc r25, r29 1dffc: d9 f0 breq .+54 ; 0x1e034 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1dffe: 8b eb ldi r24, 0xBB ; 187 1e000: 91 e4 ldi r25, 0x41 ; 65 1e002: 0e 94 3c 6d call 0xda78 ; 0xda78 1e006: ec 01 movw r28, r24 1e008: 86 e8 ldi r24, 0x86 ; 134 1e00a: 91 e4 ldi r25, 0x41 ; 65 1e00c: 0e 94 3c 6d call 0xda78 ; 0xda78 1e010: 41 2f mov r20, r17 1e012: be 01 movw r22, r28 1e014: 0e 94 b1 ef call 0x1df62 ; 0x1df62 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1e018: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1e01c: 81 11 cpse r24, r1 1e01e: 0a c0 rjmp .+20 ; 0x1e034 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1e020: 10 92 ba 03 sts 0x03BA, r1 ; 0x8003ba menu_submenu(lcd_hw_setup_menu); 1e024: 60 e0 ldi r22, 0x00 ; 0 1e026: 80 eb ldi r24, 0xB0 ; 176 1e028: 93 eb ldi r25, 0xB3 ; 179 } } 1e02a: df 91 pop r29 1e02c: cf 91 pop r28 1e02e: 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); 1e030: 0d 94 ca 94 jmp 0x32994 ; 0x32994 } } 1e034: df 91 pop r29 1e036: cf 91 pop r28 1e038: 1f 91 pop r17 1e03a: 08 95 ret 0001e03c : } /// @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) { 1e03c: cf 92 push r12 1e03e: df 92 push r13 1e040: ef 92 push r14 1e042: ff 92 push r15 1e044: cf 93 push r28 1e046: 6b 01 movw r12, r22 1e048: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1e04a: 82 e0 ldi r24, 0x02 ; 2 1e04c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1e050: 80 e2 ldi r24, 0x20 ; 32 1e052: 97 e5 ldi r25, 0x57 ; 87 1e054: 0e 94 3c 6d call 0xda78 ; 0xda78 1e058: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 1e05c: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e060: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1e064: 20 e0 ldi r18, 0x00 ; 0 1e066: 30 e0 ldi r19, 0x00 ; 0 1e068: 44 e3 ldi r20, 0x34 ; 52 1e06a: 52 e4 ldi r21, 0x42 ; 66 1e06c: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e070: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e074: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e078: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e07c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e080: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e084: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e088: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e08c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1e090: 6a e0 ldi r22, 0x0A ; 10 1e092: 77 e5 ldi r23, 0x57 ; 87 1e094: 8d ea ldi r24, 0xAD ; 173 1e096: 92 e4 ldi r25, 0x42 ; 66 1e098: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1e09c: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1e0a0: 20 e0 ldi r18, 0x00 ; 0 1e0a2: 30 e0 ldi r19, 0x00 ; 0 1e0a4: 4c e0 ldi r20, 0x0C ; 12 1e0a6: 52 e4 ldi r21, 0x42 ; 66 1e0a8: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e0ac: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e0b0: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e0b4: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e0b8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e0bc: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e0c0: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e0c4: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e0c8: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1e0cc: 69 e2 ldi r22, 0x29 ; 41 1e0ce: 7c e5 ldi r23, 0x5C ; 92 1e0d0: 85 e8 ldi r24, 0x85 ; 133 1e0d2: 91 e4 ldi r25, 0x41 ; 65 1e0d4: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1e0d8: 0f 94 14 22 call 0x24428 ; 0x24428 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1e0dc: 20 e0 ldi r18, 0x00 ; 0 1e0de: 30 e0 ldi r19, 0x00 ; 0 1e0e0: a9 01 movw r20, r18 1e0e2: c7 01 movw r24, r14 1e0e4: b6 01 movw r22, r12 1e0e6: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1e0ea: 88 23 and r24, r24 1e0ec: e1 f0 breq .+56 ; 0x1e126 { current_position[E_AXIS] += unloadLength; 1e0ee: a7 01 movw r20, r14 1e0f0: 96 01 movw r18, r12 1e0f2: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e0f6: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e0fa: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e0fe: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e102: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1e106: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e10a: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e10e: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e112: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1e116: 60 e0 ldi r22, 0x00 ; 0 1e118: 70 e0 ldi r23, 0x00 ; 0 1e11a: 80 e2 ldi r24, 0x20 ; 32 1e11c: 91 e4 ldi r25, 0x41 ; 65 1e11e: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1e122: 0f 94 14 22 call 0x24428 ; 0x24428 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1e126: 82 ef ldi r24, 0xF2 ; 242 1e128: 9b e3 ldi r25, 0x3B ; 59 1e12a: 0e 94 3c 6d call 0xda78 ; 0xda78 1e12e: 0f 94 92 0a call 0x21524 ; 0x21524 //disable extruder steppers so filament can be removed disable_e0(); 1e132: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1e134: 64 e6 ldi r22, 0x64 ; 100 1e136: 70 e0 ldi r23, 0x00 ; 0 1e138: 80 e0 ldi r24, 0x00 ; 0 1e13a: 90 e0 ldi r25, 0x00 ; 0 1e13c: 0f 94 4d 0d call 0x21a9a ; 0x21a9a Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1e140: 82 e0 ldi r24, 0x02 ; 2 1e142: 0f 94 71 2c call 0x258e2 ; 0x258e2 1e146: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1e148: 0e 94 23 6c call 0xd846 ; 0xd846 1e14c: 81 11 cpse r24, r1 1e14e: 07 c0 rjmp .+14 ; 0x1e15e 1e150: c1 50 subi r28, 0x01 ; 1 1e152: 29 f0 breq .+10 ; 0x1e15e delay_keep_alive(100); 1e154: 84 e6 ldi r24, 0x64 ; 100 1e156: 90 e0 ldi r25, 0x00 ; 0 1e158: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 1e15c: f5 cf rjmp .-22 ; 0x1e148 counterBeep++; } st_synchronize(); 1e15e: 0f 94 14 22 call 0x24428 ; 0x24428 while (lcd_clicked()) delay_keep_alive(100); 1e162: 0e 94 23 6c call 0xd846 ; 0xd846 1e166: 88 23 and r24, r24 1e168: 29 f0 breq .+10 ; 0x1e174 1e16a: 84 e6 ldi r24, 0x64 ; 100 1e16c: 90 e0 ldi r25, 0x00 ; 0 1e16e: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 1e172: f7 cf rjmp .-18 ; 0x1e162 lcd_update_enable(true); 1e174: 81 e0 ldi r24, 0x01 ; 1 1e176: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_setstatuspgm(MSG_WELCOME); 1e17a: 8b e0 ldi r24, 0x0B ; 11 1e17c: 9c e6 ldi r25, 0x6C ; 108 1e17e: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = CustomMsg::Status; 1e182: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 clearFilamentAction(); 1e186: 0f 94 01 0c call 0x21802 ; 0x21802 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e18a: 84 e8 ldi r24, 0x84 ; 132 1e18c: 96 e1 ldi r25, 0x16 ; 22 } 1e18e: cf 91 pop r28 1e190: ff 90 pop r15 1e192: ef 90 pop r14 1e194: df 90 pop r13 1e196: cf 90 pop r12 1e198: 0c 94 7b 6e jmp 0xdcf6 ; 0xdcf6 0001e19c : 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() 1e19c: 2f 92 push r2 1e19e: 3f 92 push r3 1e1a0: 4f 92 push r4 1e1a2: 5f 92 push r5 1e1a4: 6f 92 push r6 1e1a6: 7f 92 push r7 1e1a8: 8f 92 push r8 1e1aa: 9f 92 push r9 1e1ac: af 92 push r10 1e1ae: bf 92 push r11 1e1b0: cf 92 push r12 1e1b2: df 92 push r13 1e1b4: ef 92 push r14 1e1b6: ff 92 push r15 1e1b8: 0f 93 push r16 1e1ba: 1f 93 push r17 1e1bc: cf 93 push r28 1e1be: df 93 push r29 1e1c0: 00 d0 rcall .+0 ; 0x1e1c2 1e1c2: 00 d0 rcall .+0 ; 0x1e1c4 1e1c4: 00 d0 rcall .+0 ; 0x1e1c6 1e1c6: cd b7 in r28, 0x3d ; 61 1e1c8: de b7 in r29, 0x3e ; 62 1e1ca: 0c e9 ldi r16, 0x9C ; 156 1e1cc: 12 e1 ldi r17, 0x12 ; 18 1e1ce: 1f 83 std Y+7, r17 ; 0x07 1e1d0: 0e 83 std Y+6, r16 ; 0x06 1e1d2: 2e 80 ldd r2, Y+6 ; 0x06 1e1d4: 3f 80 ldd r3, Y+7 ; 0x07 1e1d6: 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])) 1e1d8: f1 01 movw r30, r2 1e1da: 61 81 ldd r22, Z+1 ; 0x01 1e1dc: 72 81 ldd r23, Z+2 ; 0x02 1e1de: 83 81 ldd r24, Z+3 ; 0x03 1e1e0: 94 81 ldd r25, Z+4 ; 0x04 1e1e2: 9b 01 movw r18, r22 1e1e4: ac 01 movw r20, r24 1e1e6: 0f 94 b3 a5 call 0x34b66 ; 0x34b66 <__unordsf2> 1e1ea: 88 23 and r24, r24 1e1ec: 09 f4 brne .+2 ; 0x1e1f0 1e1ee: 7c c0 rjmp .+248 ; 0x1e2e8 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 1e1f0: 89 81 ldd r24, Y+1 ; 0x01 1e1f2: 0f 94 06 8c call 0x3180c ; 0x3180c 1e1f6: 20 e0 ldi r18, 0x00 ; 0 1e1f8: 30 e0 ldi r19, 0x00 ; 0 1e1fa: 48 eb ldi r20, 0xB8 ; 184 1e1fc: 51 e4 ldi r21, 0x41 ; 65 1e1fe: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1e202: 6b 01 movw r12, r22 1e204: 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)) + 1e206: 20 e0 ldi r18, 0x00 ; 0 1e208: 30 e0 ldi r19, 0x00 ; 0 1e20a: 4c ef ldi r20, 0xFC ; 252 1e20c: 52 e4 ldi r21, 0x42 ; 66 1e20e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e212: 2b 01 movw r4, r22 1e214: 3c 01 movw r6, r24 1e216: 20 e0 ldi r18, 0x00 ; 0 1e218: 30 e0 ldi r19, 0x00 ; 0 1e21a: 44 e6 ldi r20, 0x64 ; 100 1e21c: 53 e4 ldi r21, 0x43 ; 67 1e21e: c7 01 movw r24, r14 1e220: b6 01 movw r22, r12 1e222: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e226: 4b 01 movw r8, r22 1e228: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e22a: 20 e0 ldi r18, 0x00 ; 0 1e22c: 30 e0 ldi r19, 0x00 ; 0 1e22e: 40 ec ldi r20, 0xC0 ; 192 1e230: 51 e4 ldi r21, 0x41 ; 65 1e232: c7 01 movw r24, r14 1e234: b6 01 movw r22, r12 1e236: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e23a: 6b 01 movw r12, r22 1e23c: 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)) + 1e23e: ee 81 ldd r30, Y+6 ; 0x06 1e240: ff 81 ldd r31, Y+7 ; 0x07 1e242: 21 81 ldd r18, Z+1 ; 0x01 1e244: 32 81 ldd r19, Z+2 ; 0x02 1e246: 43 81 ldd r20, Z+3 ; 0x03 1e248: 54 81 ldd r21, Z+4 ; 0x04 1e24a: c3 01 movw r24, r6 1e24c: b2 01 movw r22, r4 1e24e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e252: a5 01 movw r20, r10 1e254: 94 01 movw r18, r8 1e256: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e25a: 20 e0 ldi r18, 0x00 ; 0 1e25c: 30 e9 ldi r19, 0x90 ; 144 1e25e: 42 ea ldi r20, 0xA2 ; 162 1e260: 56 e4 ldi r21, 0x46 ; 70 1e262: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e266: 6a 83 std Y+2, r22 ; 0x02 1e268: 7b 83 std Y+3, r23 ; 0x03 1e26a: 8c 83 std Y+4, r24 ; 0x04 1e26c: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e26e: ee 81 ldd r30, Y+6 ; 0x06 1e270: ff 81 ldd r31, Y+7 ; 0x07 1e272: 25 85 ldd r18, Z+13 ; 0x0d 1e274: 36 85 ldd r19, Z+14 ; 0x0e 1e276: 47 85 ldd r20, Z+15 ; 0x0f 1e278: 50 89 ldd r21, Z+16 ; 0x10 1e27a: c7 01 movw r24, r14 1e27c: b6 01 movw r22, r12 1e27e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e282: a5 01 movw r20, r10 1e284: 94 01 movw r18, r8 1e286: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e28a: 20 e0 ldi r18, 0x00 ; 0 1e28c: 30 e9 ldi r19, 0x90 ; 144 1e28e: 42 e2 ldi r20, 0x22 ; 34 1e290: 56 ec ldi r21, 0xC6 ; 198 1e292: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e296: 9b 01 movw r18, r22 1e298: 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)) + 1e29a: 6a 81 ldd r22, Y+2 ; 0x02 1e29c: 7b 81 ldd r23, Y+3 ; 0x03 1e29e: 8c 81 ldd r24, Y+4 ; 0x04 1e2a0: 9d 81 ldd r25, Y+5 ; 0x05 1e2a2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1e2a6: 4b 01 movw r8, r22 1e2a8: 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)); 1e2aa: ee 81 ldd r30, Y+6 ; 0x06 1e2ac: ff 81 ldd r31, Y+7 ; 0x07 1e2ae: 21 8d ldd r18, Z+25 ; 0x19 1e2b0: 32 8d ldd r19, Z+26 ; 0x1a 1e2b2: 43 8d ldd r20, Z+27 ; 0x1b 1e2b4: 54 8d ldd r21, Z+28 ; 0x1c 1e2b6: c7 01 movw r24, r14 1e2b8: b6 01 movw r22, r12 1e2ba: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e2be: a3 01 movw r20, r6 1e2c0: 92 01 movw r18, r4 1e2c2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e2c6: 20 e0 ldi r18, 0x00 ; 0 1e2c8: 30 e9 ldi r19, 0x90 ; 144 1e2ca: 42 ea ldi r20, 0xA2 ; 162 1e2cc: 56 e4 ldi r21, 0x46 ; 70 1e2ce: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e2d2: 9b 01 movw r18, r22 1e2d4: 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)) + 1e2d6: c5 01 movw r24, r10 1e2d8: b4 01 movw r22, r8 1e2da: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__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] = 1e2de: f1 01 movw r30, r2 1e2e0: 61 83 std Z+1, r22 ; 0x01 1e2e2: 72 83 std Z+2, r23 ; 0x02 1e2e4: 83 83 std Z+3, r24 ; 0x03 1e2e6: 94 83 std Z+4, r25 ; 0x04 1e2e8: f4 e0 ldi r31, 0x04 ; 4 1e2ea: 2f 0e add r2, r31 1e2ec: 31 1c adc r3, r1 1e2ee: 29 81 ldd r18, Y+1 ; 0x01 1e2f0: 2f 5f subi r18, 0xFF ; 255 1e2f2: 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) { 1e2f4: 27 30 cpi r18, 0x07 ; 7 1e2f6: 09 f0 breq .+2 ; 0x1e2fa 1e2f8: 6f cf rjmp .-290 ; 0x1e1d8 1e2fa: 8e 81 ldd r24, Y+6 ; 0x06 1e2fc: 9f 81 ldd r25, Y+7 ; 0x07 1e2fe: 4c 96 adiw r24, 0x1c ; 28 1e300: 9f 83 std Y+7, r25 ; 0x07 1e302: 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) { 1e304: 80 56 subi r24, 0x60 ; 96 1e306: 93 41 sbci r25, 0x13 ; 19 1e308: 09 f0 breq .+2 ; 0x1e30c 1e30a: 63 cf rjmp .-314 ; 0x1e1d2 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() 1e30c: 19 87 std Y+9, r17 ; 0x09 1e30e: 08 87 std Y+8, r16 ; 0x08 1e310: f1 e0 ldi r31, 0x01 ; 1 1e312: 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)) + 1e314: c8 01 movw r24, r16 1e316: 8b 5a subi r24, 0xAB ; 171 1e318: 9f 4f sbci r25, 0xFF ; 255 1e31a: 9f 83 std Y+7, r25 ; 0x07 1e31c: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 1e31e: 18 01 movw r2, r16 1e320: 99 ea ldi r25, 0xA9 ; 169 1e322: 29 0e add r2, r25 1e324: 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])) 1e326: e8 85 ldd r30, Y+8 ; 0x08 1e328: f9 85 ldd r31, Y+9 ; 0x09 1e32a: 65 8d ldd r22, Z+29 ; 0x1d 1e32c: 76 8d ldd r23, Z+30 ; 0x1e 1e32e: 87 8d ldd r24, Z+31 ; 0x1f 1e330: 90 a1 ldd r25, Z+32 ; 0x20 1e332: 9b 01 movw r18, r22 1e334: ac 01 movw r20, r24 1e336: 0f 94 b3 a5 call 0x34b66 ; 0x34b66 <__unordsf2> 1e33a: 88 23 and r24, r24 1e33c: 09 f4 brne .+2 ; 0x1e340 1e33e: 79 c0 rjmp .+242 ; 0x1e432 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 1e340: 89 81 ldd r24, Y+1 ; 0x01 1e342: 0f 94 06 8c call 0x3180c ; 0x3180c 1e346: 20 e0 ldi r18, 0x00 ; 0 1e348: 30 e0 ldi r19, 0x00 ; 0 1e34a: 40 ea ldi r20, 0xA0 ; 160 1e34c: 50 e4 ldi r21, 0x40 ; 64 1e34e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1e352: 6b 01 movw r12, r22 1e354: 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)) + 1e356: 20 e0 ldi r18, 0x00 ; 0 1e358: 30 e0 ldi r19, 0x00 ; 0 1e35a: 48 ed ldi r20, 0xD8 ; 216 1e35c: 52 e4 ldi r21, 0x42 ; 66 1e35e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e362: 2b 01 movw r4, r22 1e364: 3c 01 movw r6, r24 1e366: 20 e0 ldi r18, 0x00 ; 0 1e368: 30 e0 ldi r19, 0x00 ; 0 1e36a: 42 e5 ldi r20, 0x52 ; 82 1e36c: 53 e4 ldi r21, 0x43 ; 67 1e36e: c7 01 movw r24, r14 1e370: b6 01 movw r22, r12 1e372: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e376: 4b 01 movw r8, r22 1e378: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e37a: 20 e0 ldi r18, 0x00 ; 0 1e37c: 30 e0 ldi r19, 0x00 ; 0 1e37e: 40 ec ldi r20, 0xC0 ; 192 1e380: 50 e4 ldi r21, 0x40 ; 64 1e382: c7 01 movw r24, r14 1e384: b6 01 movw r22, r12 1e386: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e38a: 6b 01 movw r12, r22 1e38c: 7c 01 movw r14, r24 1e38e: ee 81 ldd r30, Y+6 ; 0x06 1e390: ff 81 ldd r31, Y+7 ; 0x07 1e392: 20 81 ld r18, Z 1e394: 31 81 ldd r19, Z+1 ; 0x01 1e396: 42 81 ldd r20, Z+2 ; 0x02 1e398: 53 81 ldd r21, Z+3 ; 0x03 1e39a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e39e: a5 01 movw r20, r10 1e3a0: 94 01 movw r18, r8 1e3a2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e3a6: 20 e0 ldi r18, 0x00 ; 0 1e3a8: 30 e9 ldi r19, 0x90 ; 144 1e3aa: 42 e2 ldi r20, 0x22 ; 34 1e3ac: 56 ec ldi r21, 0xC6 ; 198 1e3ae: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e3b2: 6a 83 std Y+2, r22 ; 0x02 1e3b4: 7b 83 std Y+3, r23 ; 0x03 1e3b6: 8c 83 std Y+4, r24 ; 0x04 1e3b8: 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)) + 1e3ba: f8 01 movw r30, r16 1e3bc: 21 81 ldd r18, Z+1 ; 0x01 1e3be: 32 81 ldd r19, Z+2 ; 0x02 1e3c0: 43 81 ldd r20, Z+3 ; 0x03 1e3c2: 54 81 ldd r21, Z+4 ; 0x04 1e3c4: c3 01 movw r24, r6 1e3c6: b2 01 movw r22, r4 1e3c8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e3cc: a5 01 movw r20, r10 1e3ce: 94 01 movw r18, r8 1e3d0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e3d4: 20 e0 ldi r18, 0x00 ; 0 1e3d6: 30 e9 ldi r19, 0x90 ; 144 1e3d8: 42 ea ldi r20, 0xA2 ; 162 1e3da: 56 e4 ldi r21, 0x46 ; 70 1e3dc: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e3e0: 9b 01 movw r18, r22 1e3e2: ac 01 movw r20, r24 1e3e4: 6a 81 ldd r22, Y+2 ; 0x02 1e3e6: 7b 81 ldd r23, Y+3 ; 0x03 1e3e8: 8c 81 ldd r24, Y+4 ; 0x04 1e3ea: 9d 81 ldd r25, Y+5 ; 0x05 1e3ec: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1e3f0: 4b 01 movw r8, r22 1e3f2: 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)); 1e3f4: f1 01 movw r30, r2 1e3f6: 20 81 ld r18, Z 1e3f8: 31 81 ldd r19, Z+1 ; 0x01 1e3fa: 42 81 ldd r20, Z+2 ; 0x02 1e3fc: 53 81 ldd r21, Z+3 ; 0x03 1e3fe: c7 01 movw r24, r14 1e400: b6 01 movw r22, r12 1e402: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e406: a3 01 movw r20, r6 1e408: 92 01 movw r18, r4 1e40a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e40e: 20 e0 ldi r18, 0x00 ; 0 1e410: 30 e9 ldi r19, 0x90 ; 144 1e412: 42 ea ldi r20, 0xA2 ; 162 1e414: 56 e4 ldi r21, 0x46 ; 70 1e416: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e41a: 9b 01 movw r18, r22 1e41c: 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)) + 1e41e: c5 01 movw r24, r10 1e420: b4 01 movw r22, r8 1e422: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__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] = 1e426: e8 85 ldd r30, Y+8 ; 0x08 1e428: f9 85 ldd r31, Y+9 ; 0x09 1e42a: 65 8f std Z+29, r22 ; 0x1d 1e42c: 76 8f std Z+30, r23 ; 0x1e 1e42e: 87 8f std Z+31, r24 ; 0x1f 1e430: 90 a3 std Z+32, r25 ; 0x20 1e432: 88 85 ldd r24, Y+8 ; 0x08 1e434: 99 85 ldd r25, Y+9 ; 0x09 1e436: 4c 96 adiw r24, 0x1c ; 28 1e438: 99 87 std Y+9, r25 ; 0x09 1e43a: 88 87 std Y+8, r24 ; 0x08 1e43c: 99 81 ldd r25, Y+1 ; 0x01 1e43e: 9f 5f subi r25, 0xFF ; 255 1e440: 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) { 1e442: 96 30 cpi r25, 0x06 ; 6 1e444: 09 f0 breq .+2 ; 0x1e448 1e446: 6f cf rjmp .-290 ; 0x1e326 1e448: 0c 5f subi r16, 0xFC ; 252 1e44a: 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) { 1e44c: e2 e1 ldi r30, 0x12 ; 18 1e44e: 08 3b cpi r16, 0xB8 ; 184 1e450: 1e 07 cpc r17, r30 1e452: 09 f0 breq .+2 ; 0x1e456 1e454: 5b cf rjmp .-330 ; 0x1e30c z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 1e456: 29 96 adiw r28, 0x09 ; 9 1e458: 0f b6 in r0, 0x3f ; 63 1e45a: f8 94 cli 1e45c: de bf out 0x3e, r29 ; 62 1e45e: 0f be out 0x3f, r0 ; 63 1e460: cd bf out 0x3d, r28 ; 61 1e462: df 91 pop r29 1e464: cf 91 pop r28 1e466: 1f 91 pop r17 1e468: 0f 91 pop r16 1e46a: ff 90 pop r15 1e46c: ef 90 pop r14 1e46e: df 90 pop r13 1e470: cf 90 pop r12 1e472: bf 90 pop r11 1e474: af 90 pop r10 1e476: 9f 90 pop r9 1e478: 8f 90 pop r8 1e47a: 7f 90 pop r7 1e47c: 6f 90 pop r6 1e47e: 5f 90 pop r5 1e480: 4f 90 pop r4 1e482: 3f 90 pop r3 1e484: 2f 90 pop r2 1e486: 08 95 ret 0001e488 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1e488: 2f 92 push r2 1e48a: 3f 92 push r3 1e48c: 4f 92 push r4 1e48e: 5f 92 push r5 1e490: 6f 92 push r6 1e492: 7f 92 push r7 1e494: 8f 92 push r8 1e496: 9f 92 push r9 1e498: af 92 push r10 1e49a: bf 92 push r11 1e49c: cf 92 push r12 1e49e: df 92 push r13 1e4a0: ef 92 push r14 1e4a2: ff 92 push r15 1e4a4: 0f 93 push r16 1e4a6: 1f 93 push r17 1e4a8: cf 93 push r28 1e4aa: df 93 push r29 1e4ac: cd b7 in r28, 0x3d ; 61 1e4ae: de b7 in r29, 0x3e ; 62 1e4b0: 67 97 sbiw r28, 0x17 ; 23 1e4b2: 0f b6 in r0, 0x3f ; 63 1e4b4: f8 94 cli 1e4b6: de bf out 0x3e, r29 ; 62 1e4b8: 0f be out 0x3f, r0 ; 63 1e4ba: cd bf out 0x3d, r28 ; 61 1e4bc: 08 2f mov r16, r24 1e4be: ce 01 movw r24, r28 1e4c0: 46 96 adiw r24, 0x16 ; 22 1e4c2: 9f 8b std Y+23, r25 ; 0x17 1e4c4: 8e 8b std Y+22, r24 ; 0x16 1e4c6: 83 e0 ldi r24, 0x03 ; 3 1e4c8: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1e4ca: 95 e1 ldi r25, 0x15 ; 21 1e4cc: 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 1e4ce: 0f 94 a1 87 call 0x30f42 ; 0x30f42 tool_change_extruder = slot; 1e4d2: 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)); 1e4d6: 40 2f mov r20, r16 1e4d8: 64 e5 ldi r22, 0x54 ; 84 1e4da: ce 01 movw r24, r28 1e4dc: 01 96 adiw r24, 0x01 ; 1 1e4de: 0f 94 94 87 call 0x30f28 ; 0x30f28 1e4e2: 49 81 ldd r20, Y+1 ; 0x01 1e4e4: 5a 81 ldd r21, Y+2 ; 0x02 1e4e6: 6b 81 ldd r22, Y+3 ; 0x03 1e4e8: 7c 81 ldd r23, Y+4 ; 0x04 1e4ea: 8d 81 ldd r24, Y+5 ; 0x05 1e4ec: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1e4f0: 61 e0 ldi r22, 0x01 ; 1 1e4f2: 81 e0 ldi r24, 0x01 ; 1 1e4f4: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 1e4f8: 18 2f mov r17, r24 1e4fa: 81 11 cpse r24, r1 1e4fc: 07 c0 rjmp .+14 ; 0x1e50c break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1e4fe: 0f 94 f8 86 call 0x30df0 ; 0x30df0 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1e502: 0f 94 07 6a call 0x2d40e ; 0x2d40e // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1e506: 0f 94 f7 6a call 0x2d5ee ; 0x2d5ee 1e50a: e1 cf rjmp .-62 ; 0x1e4ce bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e50c: 0f 94 14 22 call 0x24428 ; 0x24428 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1e510: 0f 94 d7 87 call 0x30fae ; 0x30fae 1e514: 81 30 cpi r24, 0x01 ; 1 1e516: 79 f1 breq .+94 ; 0x1e576 // 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(); 1e518: 0f 94 f7 6a call 0x2d5ee ; 0x2d5ee if (retries == 2 && cutter_enabled()) { 1e51c: 92 e0 ldi r25, 0x02 ; 2 1e51e: f9 12 cpse r15, r25 1e520: 09 c0 rjmp .+18 ; 0x1e534 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; 1e522: 8e ec ldi r24, 0xCE ; 206 1e524: 9e e0 ldi r25, 0x0E ; 14 1e526: 0f 94 7d a0 call 0x340fa ; 0x340fa 1e52a: 81 30 cpi r24, 0x01 ; 1 1e52c: 19 f4 brne .+6 ; 0x1e534 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1e52e: 80 2f mov r24, r16 1e530: 0f 94 e2 6b call 0x2d7c4 ; 0x2d7c4 1e534: 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) { 1e536: f1 10 cpse r15, r1 1e538: ca cf rjmp .-108 ; 0x1e4ce 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()) { 1e53a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e53e: 88 23 and r24, r24 1e540: 09 f4 brne .+2 ; 0x1e544 1e542: ef c0 rjmp .+478 ; 0x1e722 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1e544: 67 96 adiw r28, 0x17 ; 23 1e546: 0f b6 in r0, 0x3f ; 63 1e548: f8 94 cli 1e54a: de bf out 0x3e, r29 ; 62 1e54c: 0f be out 0x3f, r0 ; 63 1e54e: cd bf out 0x3d, r28 ; 61 1e550: df 91 pop r29 1e552: cf 91 pop r28 1e554: 1f 91 pop r17 1e556: 0f 91 pop r16 1e558: ff 90 pop r15 1e55a: ef 90 pop r14 1e55c: df 90 pop r13 1e55e: cf 90 pop r12 1e560: bf 90 pop r11 1e562: af 90 pop r10 1e564: 9f 90 pop r9 1e566: 8f 90 pop r8 1e568: 7f 90 pop r7 1e56a: 6f 90 pop r6 1e56c: 5f 90 pop r5 1e56e: 4f 90 pop r4 1e570: 3f 90 pop r3 1e572: 2f 90 pop r2 1e574: 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(); 1e576: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1e57a: 70 e0 ldi r23, 0x00 ; 0 1e57c: 90 e0 ldi r25, 0x00 ; 0 1e57e: 80 e0 ldi r24, 0x00 ; 0 1e580: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1e584: 9b 01 movw r18, r22 1e586: ac 01 movw r20, r24 1e588: 60 e0 ldi r22, 0x00 ; 0 1e58a: 70 e0 ldi r23, 0x00 ; 0 1e58c: 8c e5 ldi r24, 0x5C ; 92 1e58e: 92 e4 ldi r25, 0x42 ; 66 1e590: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e594: 36 2e mov r3, r22 1e596: 87 2e mov r8, r23 1e598: 98 2e mov r9, r24 1e59a: 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)) 1e59c: 26 2f mov r18, r22 1e59e: 37 2f mov r19, r23 1e5a0: 48 2f mov r20, r24 1e5a2: 59 2f mov r21, r25 1e5a4: 60 e0 ldi r22, 0x00 ; 0 1e5a6: 70 e0 ldi r23, 0x00 ; 0 1e5a8: 80 e2 ldi r24, 0x20 ; 32 1e5aa: 91 e4 ldi r25, 0x41 ; 65 1e5ac: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 1e5b0: 2b 01 movw r4, r22 1e5b2: 3c 01 movw r6, r24 1e5b4: e9 e0 ldi r30, 0x09 ; 9 1e5b6: f5 e0 ldi r31, 0x05 ; 5 1e5b8: 82 2d mov r24, r2 1e5ba: 11 92 st Z+, r1 1e5bc: 8a 95 dec r24 1e5be: e9 f7 brne .-6 ; 0x1e5ba lcd_status_message_idx = 0; 1e5c0: 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); 1e5c4: 83 2d mov r24, r3 1e5c6: 98 2d mov r25, r8 1e5c8: a9 2d mov r26, r9 1e5ca: be 2d mov r27, r14 1e5cc: bc 01 movw r22, r24 1e5ce: 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++) { 1e5d0: 91 2c mov r9, r1 1e5d2: 31 2c mov r3, r1 1e5d4: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e5d6: 5b 01 movw r10, r22 1e5d8: 6c 01 movw r12, r24 1e5da: d7 fa bst r13, 7 1e5dc: d0 94 com r13 1e5de: d7 f8 bld r13, 7 1e5e0: d0 94 com r13 1e5e2: 20 e0 ldi r18, 0x00 ; 0 1e5e4: 30 e0 ldi r19, 0x00 ; 0 1e5e6: 48 e4 ldi r20, 0x48 ; 72 1e5e8: 52 e4 ldi r21, 0x42 ; 66 1e5ea: 0f 94 a3 87 call 0x30f46 ; 0x30f46 1e5ee: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1e5f2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (planner_any_moves()) { 1e5f6: 98 17 cp r25, r24 1e5f8: 09 f4 brne .+2 ; 0x1e5fc 1e5fa: 49 c0 rjmp .+146 ; 0x1e68e filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1e5fc: 11 23 and r17, r17 1e5fe: 31 f0 breq .+12 ; 0x1e60c 1e600: 0f 94 d7 87 call 0x30fae ; 0x30fae 1e604: 11 e0 ldi r17, 0x01 ; 1 1e606: 81 30 cpi r24, 0x01 ; 1 1e608: 09 f0 breq .+2 ; 0x1e60c 1e60a: 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); 1e60c: 83 e0 ldi r24, 0x03 ; 3 1e60e: 0f 94 00 22 call 0x24400 ; 0x24400 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); 1e612: 20 91 01 12 lds r18, 0x1201 ; 0x801201 1e616: 30 91 02 12 lds r19, 0x1202 ; 0x801202 1e61a: 40 91 03 12 lds r20, 0x1203 ; 0x801203 1e61e: 50 91 04 12 lds r21, 0x1204 ; 0x801204 1e622: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1e626: a3 01 movw r20, r6 1e628: 92 01 movw r18, r4 1e62a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1e62e: 0f 94 83 a2 call 0x34506 ; 0x34506 1e632: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 1e636: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1e638: e6 16 cp r14, r22 1e63a: c1 f0 breq .+48 ; 0x1e66c 1e63c: e3 2d mov r30, r3 1e63e: e4 31 cpi r30, 0x14 ; 20 1e640: 08 f0 brcs .+2 ; 0x1e644 1e642: 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); 1e644: 33 24 eor r3, r3 1e646: 33 94 inc r3 1e648: 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] : '-'); 1e64a: 8f ef ldi r24, 0xFF ; 255 1e64c: 11 11 cpse r17, r1 1e64e: 01 c0 rjmp .+2 ; 0x1e652 1e650: 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; 1e652: f0 e0 ldi r31, 0x00 ; 0 1e654: e7 5f subi r30, 0xF7 ; 247 1e656: fa 4f sbci r31, 0xFA ; 250 1e658: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1e65a: 91 e0 ldi r25, 0x01 ; 1 1e65c: 90 93 5b 02 sts 0x025B, r25 ; 0x80025b if (!lcd_update_enabled) lcdui_print_status_line(); 1e660: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 1e664: 81 11 cpse r24, r1 1e666: 02 c0 rjmp .+4 ; 0x1e66c 1e668: 0f 94 f7 0f call 0x21fee ; 0x21fee void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1e66c: 90 e0 ldi r25, 0x00 ; 0 1e66e: 80 e0 ldi r24, 0x00 ; 0 1e670: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 } 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); 1e674: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1e676: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e67a: 88 23 and r24, r24 1e67c: 09 f4 brne .+2 ; 0x1e680 1e67e: b7 cf rjmp .-146 ; 0x1e5ee return false; // power panic or a similar issue happened, bail out fast 1e680: 10 e0 ldi r17, 0x00 ; 0 1e682: 37 c0 rjmp .+110 ; 0x1e6f2 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); 1e684: c6 01 movw r24, r12 1e686: b5 01 movw r22, r10 1e688: 99 24 eor r9, r9 1e68a: 93 94 inc r9 1e68c: aa cf rjmp .-172 ; 0x1e5e2 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++) { 1e68e: 91 e0 ldi r25, 0x01 ; 1 1e690: 99 12 cpse r9, r25 1e692: f8 cf rjmp .-16 ; 0x1e684 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1e694: 0f 94 a1 87 call 0x30f42 ; 0x30f42 if (!filament_inserted) { 1e698: 11 11 cpse r17, r1 1e69a: 08 c0 rjmp .+16 ; 0x1e6ac eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1e69c: 8f ec ldi r24, 0xCF ; 207 1e69e: 9e e0 ldi r25, 0x0E ; 14 1e6a0: 0e 94 97 6f call 0xdf2e ; 0xdf2e eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1e6a4: 80 ed ldi r24, 0xD0 ; 208 1e6a6: 9e e0 ldi r25, 0x0E ; 14 1e6a8: 0e 94 8a 6f call 0xdf14 ; 0xdf14 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); 1e6ac: 44 e1 ldi r20, 0x14 ; 20 1e6ae: 50 e0 ldi r21, 0x00 ; 0 1e6b0: 69 e0 ldi r22, 0x09 ; 9 1e6b2: 75 e0 ldi r23, 0x05 ; 5 1e6b4: ce 01 movw r24, r28 1e6b6: 01 96 adiw r24, 0x01 ; 1 1e6b8: 0f 94 fd a6 call 0x34dfa ; 0x34dfa 1e6bc: fe 01 movw r30, r28 1e6be: 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'; 1e6c0: 81 91 ld r24, Z+ 1e6c2: 87 fd sbrc r24, 7 1e6c4: 2c c0 rjmp .+88 ; 0x1e71e 1e6c6: 80 e3 ldi r24, 0x30 ; 48 1e6c8: df 01 movw r26, r30 1e6ca: 11 97 sbiw r26, 0x01 ; 1 1e6cc: 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++) { 1e6ce: 8e 89 ldd r24, Y+22 ; 0x16 1e6d0: 9f 89 ldd r25, Y+23 ; 0x17 1e6d2: 8e 17 cp r24, r30 1e6d4: 9f 07 cpc r25, r31 1e6d6: a1 f7 brne .-24 ; 0x1e6c0 // 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; 1e6d8: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1e6da: 87 e7 ldi r24, 0x77 ; 119 1e6dc: 9e e9 ldi r25, 0x9E ; 158 1e6de: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 1e6e2: 8d eb ldi r24, 0xBD ; 189 1e6e4: 97 e8 ldi r25, 0x87 ; 135 1e6e6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 1e6ea: ce 01 movw r24, r28 1e6ec: 01 96 adiw r24, 0x01 ; 1 1e6ee: 0f 94 9e 99 call 0x3333c ; 0x3333c SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1e6f2: 8e e1 ldi r24, 0x1E ; 30 1e6f4: 95 e0 ldi r25, 0x05 ; 5 1e6f6: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::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()) { 1e6fa: 11 23 and r17, r17 1e6fc: 09 f4 brne .+2 ; 0x1e700 1e6fe: 0c cf rjmp .-488 ; 0x1e518 // 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 1e700: 80 2f mov r24, r16 1e702: 0f 94 50 41 call 0x282a0 ; 0x282a0 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1e706: 00 93 23 12 sts 0x1223, r16 ; 0x801223 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1e70a: 80 91 98 12 lds r24, 0x1298 ; 0x801298 1e70e: 90 91 99 12 lds r25, 0x1299 ; 0x801299 1e712: 01 96 adiw r24, 0x01 ; 1 1e714: 90 93 99 12 sts 0x1299, r25 ; 0x801299 1e718: 80 93 98 12 sts 0x1298, r24 ; 0x801298 1e71c: 13 cf rjmp .-474 ; 0x1e544 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'; 1e71e: 81 e3 ldi r24, 0x31 ; 49 1e720: d3 cf rjmp .-90 ; 0x1e6c8 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1e722: 8a e2 ldi r24, 0x2A ; 42 1e724: 90 e8 ldi r25, 0x80 ; 128 1e726: 90 93 26 12 sts 0x1226, r25 ; 0x801226 1e72a: 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 1e72e: 61 e0 ldi r22, 0x01 ; 1 1e730: 81 e0 ldi r24, 0x01 ; 1 1e732: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 1e736: c7 ce rjmp .-626 ; 0x1e4c6 0001e738 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1e738: cf 93 push r28 1e73a: df 93 push r29 1e73c: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1e73e: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 1e742: c8 2f mov r28, r24 1e744: 88 23 and r24, r24 1e746: d9 f0 breq .+54 ; 0x1e77e return false; } if (slot != extruder) { 1e748: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1e74c: 8d 17 cp r24, r29 1e74e: b9 f0 breq .+46 ; 0x1e77e 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(); 1e750: 0e 94 a4 61 call 0xc348 ; 0xc348 if (/*FindaDetectsFilament()*/ 1e754: 81 11 cpse r24, r1 1e756: 02 c0 rjmp .+4 ; 0x1e75c /*!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(); 1e758: 0f 94 34 6b call 0x2d668 ; 0x2d668 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1e75c: 0f 94 21 54 call 0x2a842 ; 0x2a842 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e760: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e764: 10 92 85 16 sts 0x1685, r1 ; 0x801685 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e768: 0f 94 14 22 call 0x24428 ; 0x24428 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 1e76c: 8d 2f mov r24, r29 1e76e: 0e 94 44 f2 call 0x1e488 ; 0x1e488 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e772: 84 e8 ldi r24, 0x84 ; 132 1e774: 96 e1 ldi r25, 0x16 ; 22 1e776: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1e77a: 0f 94 4a 54 call 0x2a894 ; 0x2a894 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1e77e: 8c 2f mov r24, r28 1e780: df 91 pop r29 1e782: cf 91 pop r28 1e784: 08 95 ret 0001e786 : { (void)lcd_selftest(); } bool lcd_selftest() { 1e786: cf 92 push r12 1e788: df 92 push r13 1e78a: ef 92 push r14 1e78c: ff 92 push r15 1e78e: 0f 93 push r16 1e790: 1f 93 push r17 1e792: cf 93 push r28 1e794: df 93 push r29 1e796: 00 d0 rcall .+0 ; 0x1e798 1e798: 1f 92 push r1 1e79a: cd b7 in r28, 0x3d ; 61 1e79c: 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(); 1e79e: 0f 94 31 12 call 0x22462 ; 0x22462 uint8_t fanSpeedBckp = fanSpeed; 1e7a2: d0 90 e9 11 lds r13, 0x11E9 ; 0x8011e9 fanSpeed = 255; 1e7a6: 8f ef ldi r24, 0xFF ; 255 1e7a8: 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)); 1e7ac: 8e ec ldi r24, 0xCE ; 206 1e7ae: e8 2e mov r14, r24 1e7b0: 83 e8 ldi r24, 0x83 ; 131 1e7b2: 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()); 1e7b4: 08 ec ldi r16, 0xC8 ; 200 1e7b6: 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)) { 1e7b8: 20 e0 ldi r18, 0x00 ; 0 1e7ba: 30 e0 ldi r19, 0x00 ; 0 1e7bc: 48 e4 ldi r20, 0x48 ; 72 1e7be: 52 e4 ldi r21, 0x42 ; 66 1e7c0: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e7c4: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e7c8: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e7cc: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e7d0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1e7d4: 18 16 cp r1, r24 1e7d6: 8c f0 brlt .+34 ; 0x1e7fa 1e7d8: 20 e0 ldi r18, 0x00 ; 0 1e7da: 30 e0 ldi r19, 0x00 ; 0 1e7dc: 48 e4 ldi r20, 0x48 ; 72 1e7de: 52 e4 ldi r21, 0x42 ; 66 1e7e0: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e7e4: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e7e8: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e7ec: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e7f0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1e7f4: 18 16 cp r1, r24 1e7f6: 0c f0 brlt .+2 ; 0x1e7fa 1e7f8: 42 c0 rjmp .+132 ; 0x1e87e lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1e7fa: 81 e6 ldi r24, 0x61 ; 97 1e7fc: 9e e3 ldi r25, 0x3E ; 62 1e7fe: 0e 94 3c 6d call 0xda78 ; 0xda78 1e802: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1e806: 42 e8 ldi r20, 0x82 ; 130 1e808: 64 e0 ldi r22, 0x04 ; 4 1e80a: 80 e0 ldi r24, 0x00 ; 0 1e80c: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1e810: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e814: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e818: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e81c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e820: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1e824: 7f 93 push r23 1e826: 6f 93 push r22 1e828: ff 92 push r15 1e82a: ef 92 push r14 1e82c: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_putc(LCD_STR_DEGREE[0]); 1e830: 81 e8 ldi r24, 0x81 ; 129 1e832: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1e836: 40 e8 ldi r20, 0x80 ; 128 1e838: 64 e0 ldi r22, 0x04 ; 4 1e83a: 89 e0 ldi r24, 0x09 ; 9 1e83c: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1e840: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e844: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e848: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e84c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e850: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1e854: 7f 93 push r23 1e856: 6f 93 push r22 1e858: 1f 93 push r17 1e85a: 0f 93 push r16 1e85c: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_putc(LCD_STR_DEGREE[0]); 1e860: 81 e8 ldi r24, 0x81 ; 129 1e862: 0e 94 f5 69 call 0xd3ea ; 0xd3ea delay_keep_alive(1000); 1e866: 88 ee ldi r24, 0xE8 ; 232 1e868: 93 e0 ldi r25, 0x03 ; 3 1e86a: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 serialecho_temperatures(); 1e86e: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 1e872: 0f b6 in r0, 0x3f ; 63 1e874: f8 94 cli 1e876: de bf out 0x3e, r29 ; 62 1e878: 0f be out 0x3f, r0 ; 63 1e87a: cd bf out 0x3d, r28 ; 61 1e87c: 9d cf rjmp .-198 ; 0x1e7b8 } fanSpeed = fanSpeedBckp; 1e87e: d0 92 e9 11 sts 0x11E9, r13 ; 0x8011e9 lcd_update_enable(true); 1e882: 81 e0 ldi r24, 0x01 ; 1 1e884: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1e888: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1e88c: 87 ea ldi r24, 0xA7 ; 167 1e88e: 9e e3 ldi r25, 0x3E ; 62 1e890: 0e 94 3c 6d call 0xda78 ; 0xda78 1e894: ac 01 movw r20, r24 1e896: 60 e0 ldi r22, 0x00 ; 0 1e898: 80 e0 ldi r24, 0x00 ; 0 1e89a: 0e 94 1a 6a call 0xd434 ; 0xd434 #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1e89e: 60 ed ldi r22, 0xD0 ; 208 1e8a0: 77 e0 ldi r23, 0x07 ; 7 1e8a2: 80 e0 ldi r24, 0x00 ; 0 1e8a4: 90 e0 ldi r25, 0x00 ; 0 1e8a6: 0f 94 4d 0d call 0x21a9a ; 0x21a9a KEEPALIVE_STATE(IN_HANDLER); 1e8aa: 82 e0 ldi r24, 0x02 ; 2 1e8ac: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1e8b0: 00 ed ldi r16, 0xD0 ; 208 1e8b2: 17 e0 ldi r17, 0x07 ; 7 1e8b4: 21 e0 ldi r18, 0x01 ; 1 1e8b6: 43 e0 ldi r20, 0x03 ; 3 1e8b8: 60 e0 ldi r22, 0x00 ; 0 1e8ba: 80 e0 ldi r24, 0x00 ; 0 1e8bc: 0e 94 33 b9 call 0x17266 ; 0x17266 1e8c0: 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 1e8c2: 83 e0 ldi r24, 0x03 ; 3 1e8c4: 0e 94 ca 6e call 0xdd94 ; 0xdd94 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1e8c8: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1e8cc: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1e8d0: 0f 94 f7 31 call 0x263ee ; 0x263ee // 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]); 1e8d4: 4d e2 ldi r20, 0x2D ; 45 1e8d6: 62 e0 ldi r22, 0x02 ; 2 1e8d8: 82 e1 ldi r24, 0x12 ; 18 1e8da: 0e 94 26 6a call 0xd44c ; 0xd44c delay_keep_alive(1000 / sizeof(symbols)); 1e8de: 84 ef ldi r24, 0xF4 ; 244 1e8e0: 91 e0 ldi r25, 0x01 ; 1 1e8e2: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 // 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]); 1e8e6: 4c e7 ldi r20, 0x7C ; 124 1e8e8: 62 e0 ldi r22, 0x02 ; 2 1e8ea: 82 e1 ldi r24, 0x12 ; 18 1e8ec: 0e 94 26 6a call 0xd44c ; 0xd44c delay_keep_alive(1000 / sizeof(symbols)); 1e8f0: 84 ef ldi r24, 0xF4 ; 244 1e8f2: 91 e0 ldi r25, 0x01 ; 1 1e8f4: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 // 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]); 1e8f8: 4d e2 ldi r20, 0x2D ; 45 1e8fa: 62 e0 ldi r22, 0x02 ; 2 1e8fc: 82 e1 ldi r24, 0x12 ; 18 1e8fe: 0e 94 26 6a call 0xd44c ; 0xd44c delay_keep_alive(1000 / sizeof(symbols)); 1e902: 84 ef ldi r24, 0xF4 ; 244 1e904: 91 e0 ldi r25, 0x01 ; 1 1e906: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 // 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]); 1e90a: 4c e7 ldi r20, 0x7C ; 124 1e90c: 62 e0 ldi r22, 0x02 ; 2 1e90e: 82 e1 ldi r24, 0x12 ; 18 1e910: 0e 94 26 6a call 0xd44c ; 0xd44c delay_keep_alive(1000 / sizeof(symbols)); 1e914: 84 ef ldi r24, 0xF4 ; 244 1e916: 91 e0 ldi r25, 0x01 ; 1 1e918: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1e91c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 1e920: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1e924: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1e928: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1e92c: 90 93 90 16 sts 0x1690, r25 ; 0x801690 #endif fan_measuring = true; 1e930: 81 e0 ldi r24, 0x01 ; 1 1e932: 80 93 84 03 sts 0x0384, r24 ; 0x800384 while(fan_measuring) { 1e936: 80 91 84 03 lds r24, 0x0384 ; 0x800384 1e93a: 88 23 and r24, r24 1e93c: 29 f0 breq .+10 ; 0x1e948 delay_keep_alive(100); 1e93e: 84 e6 ldi r24, 0x64 ; 100 1e940: 90 e0 ldi r25, 0x00 ; 0 1e942: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 1e946: f7 cf rjmp .-18 ; 0x1e936 } gcode_M123(); 1e948: 0e 94 28 60 call 0xc050 ; 0xc050 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 1e94c: 80 e0 ldi r24, 0x00 ; 0 1e94e: 0e 94 ca 6e call 0xdd94 ; 0xdd94 if (fan_speed[0] < failThr) { 1e952: c0 90 85 03 lds r12, 0x0385 ; 0x800385 1e956: d0 90 86 03 lds r13, 0x0386 ; 0x800386 1e95a: 94 e1 ldi r25, 0x14 ; 20 1e95c: c9 16 cp r12, r25 1e95e: d1 04 cpc r13, r1 1e960: 54 f1 brlt .+84 ; 0x1e9b6 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1e962: 00 ed ldi r16, 0xD0 ; 208 1e964: 17 e0 ldi r17, 0x07 ; 7 1e966: 21 e0 ldi r18, 0x01 ; 1 1e968: 43 e0 ldi r20, 0x03 ; 3 1e96a: 6f 2d mov r22, r15 1e96c: 81 e0 ldi r24, 0x01 ; 1 1e96e: 0e 94 33 b9 call 0x17266 ; 0x17266 1e972: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1e974: 60 e0 ldi r22, 0x00 ; 0 1e976: 80 e0 ldi r24, 0x00 ; 0 1e978: 0e 94 a0 b1 call 0x16340 ; 0x16340 #endif //defined(TACH_1) if (!_result) 1e97c: 81 11 cpse r24, r1 1e97e: 3a c0 rjmp .+116 ; 0x1e9f4 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1e980: 4a ed ldi r20, 0xDA ; 218 1e982: 52 e0 ldi r21, 0x02 ; 2 1e984: ba 01 movw r22, r20 1e986: 85 e0 ldi r24, 0x05 ; 5 1e988: 0e 94 2a e2 call 0x1c454 ; 0x1c454 } } if (_swapped_fan) { 1e98c: 86 e4 ldi r24, 0x46 ; 70 1e98e: c8 16 cp r12, r24 1e990: d1 04 cpc r13, r1 1e992: bc f0 brlt .+46 ; 0x1e9c2 //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1e994: 60 e0 ldi r22, 0x00 ; 0 1e996: 81 e0 ldi r24, 0x01 ; 1 1e998: 0e 94 a0 b1 call 0x16340 ; 0x16340 if (_result) { 1e99c: 88 23 and r24, r24 1e99e: d9 f0 breq .+54 ; 0x1e9d6 //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1e9a0: 61 e0 ldi r22, 0x01 ; 1 1e9a2: 80 e0 ldi r24, 0x00 ; 0 1e9a4: 0e 94 a0 b1 call 0x16340 ; 0x16340 if (!_result){ 1e9a8: 81 11 cpse r24, r1 1e9aa: 28 c0 rjmp .+80 ; 0x1e9fc lcd_selftest_error(TestError::PrintFan, "", ""); 1e9ac: 4a ed ldi r20, 0xDA ; 218 1e9ae: 52 e0 ldi r21, 0x02 ; 2 1e9b0: ba 01 movw r22, r20 1e9b2: 85 e0 ldi r24, 0x05 ; 5 1e9b4: 04 c0 rjmp .+8 ; 0x1e9be #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1e9b6: 4a ed ldi r20, 0xDA ; 218 1e9b8: 52 e0 ldi r21, 0x02 ; 2 1e9ba: ba 01 movw r22, r20 1e9bc: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1e9be: 0e 94 2a e2 call 0x1c454 ; 0x1c454 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1e9c2: 08 e8 ldi r16, 0x88 ; 136 1e9c4: 13 e1 ldi r17, 0x13 ; 19 1e9c6: 21 e0 ldi r18, 0x01 ; 1 1e9c8: 43 e0 ldi r20, 0x03 ; 3 1e9ca: 6f 2d mov r22, r15 1e9cc: 8d e0 ldi r24, 0x0D ; 13 1e9ce: 0e 94 33 b9 call 0x17266 ; 0x17266 1e9d2: e1 2c mov r14, r1 1e9d4: 88 c1 rjmp .+784 ; 0x1ece6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1e9d6: 4a ed ldi r20, 0xDA ; 218 1e9d8: 52 e0 ldi r21, 0x02 ; 2 1e9da: ba 01 movw r22, r20 1e9dc: 89 e0 ldi r24, 0x09 ; 9 1e9de: ef cf rjmp .-34 ; 0x1e9be #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1e9e0: 11 e0 ldi r17, 0x01 ; 1 1e9e2: 96 c0 rjmp .+300 ; 0x1eb10 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1e9e4: 89 ec ldi r24, 0xC9 ; 201 1e9e6: 9f e3 ldi r25, 0x3F ; 63 1e9e8: 0e 94 3c 6d call 0xda78 ; 0xda78 1e9ec: 62 e0 ldi r22, 0x02 ; 2 1e9ee: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 1e9f2: 91 c1 rjmp .+802 ; 0x1ed16 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1e9f4: 96 e4 ldi r25, 0x46 ; 70 1e9f6: c9 16 cp r12, r25 1e9f8: d1 04 cpc r13, r1 1e9fa: 64 f6 brge .-104 ; 0x1e994 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1e9fc: 00 ed ldi r16, 0xD0 ; 208 1e9fe: 17 e0 ldi r17, 0x07 ; 7 1ea00: 21 e0 ldi r18, 0x01 ; 1 1ea02: 43 e0 ldi r20, 0x03 ; 3 1ea04: 6f 2d mov r22, r15 1ea06: 82 e0 ldi r24, 0x02 ; 2 1ea08: 0e 94 33 b9 call 0x17266 ; 0x17266 1ea0c: 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) || 1ea0e: 1e 99 sbic 0x03, 6 ; 3 1ea10: 04 c0 rjmp .+8 ; 0x1ea1a { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1ea12: 1d 99 sbic 0x03, 5 ; 3 1ea14: 02 c0 rjmp .+4 ; 0x1ea1a ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1ea16: 1c 9b sbis 0x03, 4 ; 3 1ea18: 48 c0 rjmp .+144 ; 0x1eaaa #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; 1ea1a: 1e 9b sbis 0x03, 6 ; 3 1ea1c: 16 c0 rjmp .+44 ; 0x1ea4a 1ea1e: 20 e0 ldi r18, 0x00 ; 0 1ea20: 30 e0 ldi r19, 0x00 ; 0 1ea22: 40 e2 ldi r20, 0x20 ; 32 1ea24: 51 e4 ldi r21, 0x41 ; 65 1ea26: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 1ea2a: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 1ea2e: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 1ea32: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 1ea36: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1ea3a: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1ea3e: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 1ea42: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1ea46: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1ea4a: 1d 9b sbis 0x03, 5 ; 3 1ea4c: 16 c0 rjmp .+44 ; 0x1ea7a 1ea4e: 20 e0 ldi r18, 0x00 ; 0 1ea50: 30 e0 ldi r19, 0x00 ; 0 1ea52: 40 e2 ldi r20, 0x20 ; 32 1ea54: 51 e4 ldi r21, 0x41 ; 65 1ea56: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 1ea5a: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 1ea5e: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 1ea62: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 1ea66: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1ea6a: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 1ea6e: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 1ea72: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 1ea76: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1ea7a: 1c 9b sbis 0x03, 4 ; 3 1ea7c: 16 c0 rjmp .+44 ; 0x1eaaa 1ea7e: 20 e0 ldi r18, 0x00 ; 0 1ea80: 30 e0 ldi r19, 0x00 ; 0 1ea82: 40 e2 ldi r20, 0x20 ; 32 1ea84: 51 e4 ldi r21, 0x41 ; 65 1ea86: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1ea8a: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1ea8e: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1ea92: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1ea96: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1ea9a: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1ea9e: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1eaa2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1eaa6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1eaaa: 60 e0 ldi r22, 0x00 ; 0 1eaac: 70 e0 ldi r23, 0x00 ; 0 1eaae: 84 e3 ldi r24, 0x34 ; 52 1eab0: 92 e4 ldi r25, 0x42 ; 66 1eab2: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 1eab6: 0f 94 14 22 call 0x24428 ; 0x24428 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eaba: 1e 99 sbic 0x03, 6 ; 3 1eabc: 04 c0 rjmp .+8 ; 0x1eac6 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1eabe: 1d 99 sbic 0x03, 5 ; 3 1eac0: 02 c0 rjmp .+4 ; 0x1eac6 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eac2: 1c 9b sbis 0x03, 4 ; 3 1eac4: 8d cf rjmp .-230 ; 0x1e9e0 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1eac6: 1a 82 std Y+2, r1 ; 0x02 1eac8: 19 82 std Y+1, r1 ; 0x01 1eaca: 1c 82 std Y+4, r1 ; 0x04 1eacc: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1eace: 1e 9b sbis 0x03, 6 ; 3 1ead0: 06 c0 rjmp .+12 ; 0x1eade 1ead2: 6b ed ldi r22, 0xDB ; 219 1ead4: 72 e0 ldi r23, 0x02 ; 2 1ead6: ce 01 movw r24, r28 1ead8: 01 96 adiw r24, 0x01 ; 1 1eada: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1eade: 1d 9b sbis 0x03, 5 ; 3 1eae0: 06 c0 rjmp .+12 ; 0x1eaee 1eae2: 6d ed ldi r22, 0xDD ; 221 1eae4: 72 e0 ldi r23, 0x02 ; 2 1eae6: ce 01 movw r24, r28 1eae8: 01 96 adiw r24, 0x01 ; 1 1eaea: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1eaee: 1c 9b sbis 0x03, 4 ; 3 1eaf0: 06 c0 rjmp .+12 ; 0x1eafe 1eaf2: 6f ed ldi r22, 0xDF ; 223 1eaf4: 72 e0 ldi r23, 0x02 ; 2 1eaf6: ce 01 movw r24, r28 1eaf8: 01 96 adiw r24, 0x01 ; 1 1eafa: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 lcd_selftest_error(TestError::Endstops, _error, ""); 1eafe: 4a ed ldi r20, 0xDA ; 218 1eb00: 52 e0 ldi r21, 0x02 ; 2 1eb02: be 01 movw r22, r28 1eb04: 6f 5f subi r22, 0xFF ; 255 1eb06: 7f 4f sbci r23, 0xFF ; 255 1eb08: 82 e0 ldi r24, 0x02 ; 2 1eb0a: 0e 94 2a e2 call 0x1c454 ; 0x1c454 ((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; 1eb0e: 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(); 1eb10: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 1eb14: 81 e0 ldi r24, 0x01 ; 1 1eb16: 0e 94 8c 7a call 0xf518 ; 0xf518 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1eb1a: 11 23 and r17, r17 1eb1c: 09 f4 brne .+2 ; 0x1eb20 1eb1e: 51 cf rjmp .-350 ; 0x1e9c2 { //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); 1eb20: 00 ed ldi r16, 0xD0 ; 208 1eb22: 17 e0 ldi r17, 0x07 ; 7 1eb24: 21 e0 ldi r18, 0x01 ; 1 1eb26: 43 e0 ldi r20, 0x03 ; 3 1eb28: 6f 2d mov r22, r15 1eb2a: 84 e0 ldi r24, 0x04 ; 4 1eb2c: 0e 94 33 b9 call 0x17266 ; 0x17266 1eb30: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1eb32: 6a ef ldi r22, 0xFA ; 250 1eb34: 70 e0 ldi r23, 0x00 ; 0 1eb36: 90 e0 ldi r25, 0x00 ; 0 1eb38: 80 e0 ldi r24, 0x00 ; 0 1eb3a: 0e 94 0d e5 call 0x1ca1a ; 0x1ca1a } if (_result) 1eb3e: 88 23 and r24, r24 1eb40: 09 f4 brne .+2 ; 0x1eb44 1eb42: 3f cf rjmp .-386 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1eb44: 10 e0 ldi r17, 0x00 ; 0 1eb46: 00 e0 ldi r16, 0x00 ; 0 1eb48: 21 e0 ldi r18, 0x01 ; 1 1eb4a: 43 e0 ldi r20, 0x03 ; 3 1eb4c: 6f 2d mov r22, r15 1eb4e: 84 e0 ldi r24, 0x04 ; 4 1eb50: 0e 94 33 b9 call 0x17266 ; 0x17266 1eb54: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1eb56: 90 e0 ldi r25, 0x00 ; 0 1eb58: 80 e0 ldi r24, 0x00 ; 0 1eb5a: 0e 94 0a e4 call 0x1c814 ; 0x1c814 #endif } if (_result) 1eb5e: 88 23 and r24, r24 1eb60: 09 f4 brne .+2 ; 0x1eb64 1eb62: 2f cf rjmp .-418 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1eb64: 0c ed ldi r16, 0xDC ; 220 1eb66: 15 e0 ldi r17, 0x05 ; 5 1eb68: 21 e0 ldi r18, 0x01 ; 1 1eb6a: 43 e0 ldi r20, 0x03 ; 3 1eb6c: 6f 2d mov r22, r15 1eb6e: 85 e0 ldi r24, 0x05 ; 5 1eb70: 0e 94 33 b9 call 0x17266 ; 0x17266 1eb74: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1eb76: 62 ed ldi r22, 0xD2 ; 210 1eb78: 70 e0 ldi r23, 0x00 ; 0 1eb7a: 81 e0 ldi r24, 0x01 ; 1 1eb7c: 90 e0 ldi r25, 0x00 ; 0 1eb7e: 0e 94 0d e5 call 0x1ca1a ; 0x1ca1a #endif // TMC2130 } if (_result) 1eb82: 88 23 and r24, r24 1eb84: 09 f4 brne .+2 ; 0x1eb88 1eb86: 1d cf rjmp .-454 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1eb88: 10 e0 ldi r17, 0x00 ; 0 1eb8a: 00 e0 ldi r16, 0x00 ; 0 1eb8c: 21 e0 ldi r18, 0x01 ; 1 1eb8e: 43 e0 ldi r20, 0x03 ; 3 1eb90: 6f 2d mov r22, r15 1eb92: 86 e0 ldi r24, 0x06 ; 6 1eb94: 0e 94 33 b9 call 0x17266 ; 0x17266 1eb98: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1eb9a: 81 e0 ldi r24, 0x01 ; 1 1eb9c: 90 e0 ldi r25, 0x00 ; 0 1eb9e: 0e 94 0a e4 call 0x1c814 ; 0x1c814 #endif // TMC2130 } if (_result) 1eba2: 88 23 and r24, r24 1eba4: 09 f4 brne .+2 ; 0x1eba8 1eba6: 0d cf rjmp .-486 ; 0x1e9c2 enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1eba8: ef e4 ldi r30, 0x4F ; 79 1ebaa: f9 e8 ldi r31, 0x89 ; 137 1ebac: 85 91 lpm r24, Z+ 1ebae: 95 91 lpm r25, Z+ 1ebb0: a5 91 lpm r26, Z+ 1ebb2: b4 91 lpm r27, Z 1ebb4: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ebb8: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ebbc: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ebc0: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ebc4: e3 e5 ldi r30, 0x53 ; 83 1ebc6: f9 e8 ldi r31, 0x89 ; 137 1ebc8: 85 91 lpm r24, Z+ 1ebca: 95 91 lpm r25, Z+ 1ebcc: a5 91 lpm r26, Z+ 1ebce: b4 91 lpm r27, Z 1ebd0: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ebd4: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ebd8: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ebdc: 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); 1ebe0: 60 e0 ldi r22, 0x00 ; 0 1ebe2: 70 e0 ldi r23, 0x00 ; 0 1ebe4: 80 e2 ldi r24, 0x20 ; 32 1ebe6: 91 e4 ldi r25, 0x41 ; 65 1ebe8: 0e 94 68 67 call 0xced0 ; 0xced0 set_destination_to_current(); 1ebec: 0e 94 c1 61 call 0xc382 ; 0xc382 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ebf0: 0c ed ldi r16, 0xDC ; 220 1ebf2: 15 e0 ldi r17, 0x05 ; 5 1ebf4: 21 e0 ldi r18, 0x01 ; 1 1ebf6: 43 e0 ldi r20, 0x03 ; 3 1ebf8: 6f 2d mov r22, r15 1ebfa: 86 e0 ldi r24, 0x06 ; 6 1ebfc: 0e 94 33 b9 call 0x17266 ; 0x17266 1ec00: 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); 1ec02: 62 ed ldi r22, 0xD2 ; 210 1ec04: 70 e0 ldi r23, 0x00 ; 0 1ec06: 82 e0 ldi r24, 0x02 ; 2 1ec08: 90 e0 ldi r25, 0x00 ; 0 1ec0a: 0e 94 0d e5 call 0x1ca1a ; 0x1ca1a 1ec0e: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1ec10: 60 e0 ldi r22, 0x00 ; 0 1ec12: 70 e0 ldi r23, 0x00 ; 0 1ec14: 80 ea ldi r24, 0xA0 ; 160 1ec16: 91 e4 ldi r25, 0x41 ; 65 1ec18: 0e 94 68 67 call 0xced0 ; 0xced0 eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1ec1c: 11 23 and r17, r17 1ec1e: 09 f4 brne .+2 ; 0x1ec22 1ec20: d0 ce rjmp .-608 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ec22: 00 ed ldi r16, 0xD0 ; 208 1ec24: 17 e0 ldi r17, 0x07 ; 7 1ec26: 21 e0 ldi r18, 0x01 ; 1 1ec28: 43 e0 ldi r20, 0x03 ; 3 1ec2a: 6f 2d mov r22, r15 1ec2c: 87 e0 ldi r24, 0x07 ; 7 1ec2e: 0e 94 33 b9 call 0x17266 ; 0x17266 1ec32: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ec34: 81 e0 ldi r24, 0x01 ; 1 1ec36: 0e 94 14 e3 call 0x1c628 ; 0x1c628 } if (_result) 1ec3a: 88 23 and r24, r24 1ec3c: 09 f4 brne .+2 ; 0x1ec40 1ec3e: c1 ce rjmp .-638 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ec40: 08 ee ldi r16, 0xE8 ; 232 1ec42: 13 e0 ldi r17, 0x03 ; 3 1ec44: 21 e0 ldi r18, 0x01 ; 1 1ec46: 43 e0 ldi r20, 0x03 ; 3 1ec48: 6f 2d mov r22, r15 1ec4a: 88 e0 ldi r24, 0x08 ; 8 1ec4c: 0e 94 33 b9 call 0x17266 ; 0x17266 1ec50: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1ec52: 80 e0 ldi r24, 0x00 ; 0 1ec54: 0e 94 14 e3 call 0x1c628 ; 0x1c628 1ec58: e8 2e mov r14, r24 } if (_result) 1ec5a: 88 23 and r24, r24 1ec5c: 09 f4 brne .+2 ; 0x1ec60 1ec5e: b1 ce rjmp .-670 ; 0x1e9c2 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1ec60: 00 ed ldi r16, 0xD0 ; 208 1ec62: 17 e0 ldi r17, 0x07 ; 7 1ec64: 21 e0 ldi r18, 0x01 ; 1 1ec66: 43 e0 ldi r20, 0x03 ; 3 1ec68: 6f 2d mov r22, r15 1ec6a: 89 e0 ldi r24, 0x09 ; 9 1ec6c: 0e 94 33 b9 call 0x17266 ; 0x17266 } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 1ec70: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1ec74: 91 30 cpi r25, 0x01 ; 1 1ec76: 79 f5 brne .+94 ; 0x1ecd6 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1ec78: 21 e0 ldi r18, 0x01 ; 1 1ec7a: 43 e0 ldi r20, 0x03 ; 3 1ec7c: 68 2f mov r22, r24 1ec7e: 8a e0 ldi r24, 0x0A ; 10 1ec80: 0e 94 33 b9 call 0x17266 ; 0x17266 1ec84: 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); 1ec86: 86 e8 ldi r24, 0x86 ; 134 1ec88: 9e e3 ldi r25, 0x3E ; 62 1ec8a: 0e 94 3c 6d call 0xda78 ; 0xda78 1ec8e: 70 e0 ldi r23, 0x00 ; 0 1ec90: 60 e0 ldi r22, 0x00 ; 0 1ec92: 0e 94 e5 bc call 0x179ca ; 0x179ca 1ec96: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 1ec98: 10 e0 ldi r17, 0x00 ; 0 1ec9a: 00 e0 ldi r16, 0x00 ; 0 1ec9c: 21 e0 ldi r18, 0x01 ; 1 1ec9e: 41 e0 ldi r20, 0x01 ; 1 1eca0: 60 e0 ldi r22, 0x00 ; 0 1eca2: 8a e0 ldi r24, 0x0A ; 10 1eca4: 0e 94 33 b9 call 0x17266 ; 0x17266 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1eca8: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ecac: 10 92 57 02 sts 0x0257, r1 ; 0x800257 // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 1ecb0: 8d 2d mov r24, r13 1ecb2: 0e 94 9c f3 call 0x1e738 ; 0x1e738 MMU2::mmu2.unload(); //Unload filament 1ecb6: 0f 94 34 6b call 0x2d668 ; 0x2d668 1ecba: 8f ea ldi r24, 0xAF ; 175 1ecbc: 90 e0 ldi r25, 0x00 ; 0 1ecbe: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ecc2: 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 1ecc6: 00 ed ldi r16, 0xD0 ; 208 1ecc8: 17 e0 ldi r17, 0x07 ; 7 1ecca: 21 e0 ldi r18, 0x01 ; 1 1eccc: 43 e0 ldi r20, 0x03 ; 3 1ecce: 6f 2d mov r22, r15 1ecd0: 8b e0 ldi r24, 0x0B ; 11 1ecd2: 0e 94 33 b9 call 0x17266 ; 0x17266 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1ecd6: 08 e8 ldi r16, 0x88 ; 136 1ecd8: 13 e1 ldi r17, 0x13 ; 19 1ecda: 21 e0 ldi r18, 0x01 ; 1 1ecdc: 43 e0 ldi r20, 0x03 ; 3 1ecde: 68 2f mov r22, r24 1ece0: 8c e0 ldi r24, 0x0C ; 12 1ece2: 0e 94 33 b9 call 0x17266 ; 0x17266 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ece6: 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); 1ecea: 61 e0 ldi r22, 0x01 ; 1 1ecec: 8d ea ldi r24, 0xAD ; 173 1ecee: 98 e6 ldi r25, 0x68 ; 104 1ecf0: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_update_enable(true); 1ecf4: 81 e0 ldi r24, 0x01 ; 1 1ecf6: 0e 94 4b 6a call 0xd496 ; 0xd496 if (_result) 1ecfa: ee 20 and r14, r14 1ecfc: 09 f4 brne .+2 ; 0x1ed00 1ecfe: 72 ce rjmp .-796 ; 0x1e9e4 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1ed00: 81 e0 ldi r24, 0x01 ; 1 1ed02: 0e 94 80 c6 call 0x18d00 ; 0x18d00 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1ed06: 89 e9 ldi r24, 0x99 ; 153 1ed08: 9e e3 ldi r25, 0x3E ; 62 1ed0a: 0e 94 3c 6d call 0xda78 ; 0xda78 1ed0e: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_return_to_status(); 1ed12: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1ed16: 81 e0 ldi r24, 0x01 ; 1 1ed18: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1ed1c: 8e 2d mov r24, r14 1ed1e: 0f 90 pop r0 1ed20: 0f 90 pop r0 1ed22: 0f 90 pop r0 1ed24: 0f 90 pop r0 1ed26: df 91 pop r29 1ed28: cf 91 pop r28 1ed2a: 1f 91 pop r17 1ed2c: 0f 91 pop r16 1ed2e: ff 90 pop r15 1ed30: ef 90 pop r14 1ed32: df 90 pop r13 1ed34: cf 90 pop r12 1ed36: 08 95 ret 0001ed38 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1ed38: 0c 94 c3 f3 jmp 0x1e786 ; 0x1e786 0001ed3c : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1ed3c: cf 93 push r28 1ed3e: 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); 1ed40: 84 ed ldi r24, 0xD4 ; 212 1ed42: 9b e3 ldi r25, 0x3B ; 59 1ed44: 0e 94 3c 6d call 0xda78 ; 0xda78 1ed48: 6c 2f mov r22, r28 1ed4a: 0f 94 d9 86 call 0x30db2 ; 0x30db2 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1ed4e: 8c 2f mov r24, r28 1ed50: 0e 94 9c f3 call 0x1e738 ; 0x1e738 1ed54: 0f 94 14 22 call 0x24428 ; 0x24428 planner_synchronize(); unload(); 1ed58: 0f 94 34 6b call 0x2d668 ; 0x2d668 ScreenUpdateEnable(); 1ed5c: 0f 94 d6 86 call 0x30dac ; 0x30dac MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1ed60: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1ed62: 0d 94 01 0c jmp 0x21802 ; 0x21802 0001ed66 : 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(){ 1ed66: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 1ed68: c0 e0 ldi r28, 0x00 ; 0 1ed6a: 84 ed ldi r24, 0xD4 ; 212 1ed6c: 9b e3 ldi r25, 0x3B ; 59 1ed6e: 0e 94 3c 6d call 0xda78 ; 0xda78 1ed72: 6c 2f mov r22, r28 1ed74: 0f 94 d9 86 call 0x30db2 ; 0x30db2 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1ed78: 8c 2f mov r24, r28 1ed7a: 0e 94 9c f3 call 0x1e738 ; 0x1e738 1ed7e: 0f 94 14 22 call 0x24428 ; 0x24428 planner_synchronize(); unload(); 1ed82: 0f 94 34 6b call 0x2d668 ; 0x2d668 ScreenUpdateEnable(); 1ed86: 0f 94 d6 86 call 0x30dac ; 0x30dac 1ed8a: cf 5f subi r28, 0xFF ; 255 1ed8c: c5 30 cpi r28, 0x05 ; 5 1ed8e: 69 f7 brne .-38 ; 0x1ed6a MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1ed90: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1ed92: 0d 94 01 0c jmp 0x21802 ; 0x21802 0001ed96 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1ed96: cf 93 push r28 1ed98: df 93 push r29 1ed9a: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1ed9c: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 1eda0: c8 2f mov r28, r24 1eda2: 88 23 and r24, r24 1eda4: 69 f1 breq .+90 ; 0x1ee00 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1eda6: 88 ec ldi r24, 0xC8 ; 200 1eda8: 90 e0 ldi r25, 0x00 ; 0 1edaa: 0f 94 20 8b call 0x31640 ; 0x31640 (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); 1edae: 82 e0 ldi r24, 0x02 ; 2 1edb0: 0f 94 71 2c call 0x258e2 ; 0x258e2 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1edb4: 84 ec ldi r24, 0xC4 ; 196 1edb6: 9a e5 ldi r25, 0x5A ; 90 1edb8: 0e 94 3c 6d call 0xda78 ; 0xda78 1edbc: 6d 2f mov r22, r29 1edbe: 0f 94 d9 86 call 0x30db2 ; 0x30db2 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1edc2: 0f 94 21 54 call 0x2a842 ; 0x2a842 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1edc6: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1edca: 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 1edce: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1edd2: 83 36 cpi r24, 0x63 ; 99 1edd4: 29 f0 breq .+10 ; 0x1ede0 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1edd6: 62 e1 ldi r22, 0x12 ; 18 1edd8: 84 ef ldi r24, 0xF4 ; 244 1edda: 99 e9 ldi r25, 0x99 ; 153 1eddc: 0f 94 2c 54 call 0x2a858 ; 0x2a858 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1ede0: 8d 2f mov r24, r29 1ede2: 0e 94 44 f2 call 0x1e488 ; 0x1e488 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1ede6: 0e 94 35 b2 call 0x1646a ; 0x1646a 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); 1edea: 83 e0 ldi r24, 0x03 ; 3 1edec: 0f 94 71 2c call 0x258e2 ; 0x258e2 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1edf0: 84 e8 ldi r24, 0x84 ; 132 1edf2: 96 e1 ldi r25, 0x16 ; 22 1edf4: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1edf8: 0f 94 4a 54 call 0x2a894 ; 0x2a894 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1edfc: 0f 94 d6 86 call 0x30dac ; 0x30dac return true; } 1ee00: 8c 2f mov r24, r28 1ee02: df 91 pop r29 1ee04: cf 91 pop r28 1ee06: 08 95 ret 0001ee08 : /// 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) { 1ee08: 1f 93 push r17 1ee0a: cf 93 push r28 1ee0c: df 93 push r29 1ee0e: c8 2f mov r28, r24 1ee10: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1ee12: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 1ee16: d8 2f mov r29, r24 1ee18: 88 23 and r24, r24 1ee1a: a9 f0 breq .+42 ; 0x1ee46 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee1c: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee20: 10 92 85 16 sts 0x1685, r1 ; 0x801685 return false; } FSensorBlockRunout blockRunout; switch (code) { 1ee24: c3 36 cpi r28, 0x63 ; 99 1ee26: 11 f1 breq .+68 ; 0x1ee6c 1ee28: c8 37 cpi r28, 0x78 ; 120 1ee2a: 91 f0 breq .+36 ; 0x1ee50 1ee2c: cf 33 cpi r28, 0x3F ; 63 1ee2e: 39 f4 brne .+14 ; 0x1ee3e case '?': { waitForHotendTargetTemp(100, [] {}); 1ee30: 84 e6 ldi r24, 0x64 ; 100 1ee32: 90 e0 ldi r25, 0x00 ; 0 1ee34: 0f 94 20 8b call 0x31640 ; 0x31640 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> load_filament_to_nozzle(slot); 1ee38: 81 2f mov r24, r17 1ee3a: 0e 94 cb f6 call 0x1ed96 ; 0x1ed96 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1ee3e: 84 e8 ldi r24, 0x84 ; 132 1ee40: 96 e1 ldi r25, 0x16 ; 22 1ee42: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 execute_load_to_nozzle_sequence(); } break; } return true; } 1ee46: 8d 2f mov r24, r29 1ee48: df 91 pop r29 1ee4a: cf 91 pop r28 1ee4c: 1f 91 pop r17 1ee4e: 08 95 ret 1ee50: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ee54: 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); 1ee58: 81 2f mov r24, r17 1ee5a: 0e 94 9c f3 call 0x1e738 ; 0x1e738 1ee5e: 8f ea ldi r24, 0xAF ; 175 1ee60: 90 e0 ldi r25, 0x00 ; 0 1ee62: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ee66: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1ee6a: e9 cf rjmp .-46 ; 0x1ee3e thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1ee6c: 84 e6 ldi r24, 0x64 ; 100 1ee6e: 90 e0 ldi r25, 0x00 ; 0 1ee70: 0f 94 20 8b call 0x31640 ; 0x31640 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> execute_load_to_nozzle_sequence(); 1ee74: 0e 94 35 b2 call 0x1646a ; 0x1646a 1ee78: e2 cf rjmp .-60 ; 0x1ee3e 0001ee7a : 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); 1ee7a: 0e 94 cb f6 call 0x1ed96 ; 0x1ed96 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1ee7e: 0e 94 00 5f call 0xbe00 ; 0xbe00 st_synchronize(); 1ee82: 0f 94 14 22 call 0x24428 ; 0x24428 // Ask user if the extruded color is correct: lcd_return_to_status(); 1ee86: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_load_filament_color_check(); 1ee8a: 0f 94 7b 2f call 0x25ef6 ; 0x25ef6 lcd_setstatuspgm(MSG_WELCOME); 1ee8e: 8b e0 ldi r24, 0x0B ; 11 1ee90: 9c e6 ldi r25, 0x6C ; 108 1ee92: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = CustomMsg::Status; 1ee96: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 // Clear the filament action clearFilamentAction(); 1ee9a: 0d 94 01 0c jmp 0x21802 ; 0x21802 0001ee9e : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1ee9e: 1f 93 push r17 1eea0: cf 93 push r28 1eea2: df 93 push r29 1eea4: 00 d0 rcall .+0 ; 0x1eea6 1eea6: 1f 92 push r1 1eea8: 1f 92 push r1 1eeaa: cd b7 in r28, 0x3d ; 61 1eeac: de b7 in r29, 0x3e ; 62 1eeae: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1eeb0: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 1eeb4: 88 23 and r24, r24 1eeb6: d9 f0 breq .+54 ; 0x1eeee void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1eeb8: 41 2f mov r20, r17 1eeba: 62 e5 ldi r22, 0x52 ; 82 1eebc: ce 01 movw r24, r28 1eebe: 01 96 adiw r24, 0x01 ; 1 1eec0: 0f 94 94 87 call 0x30f28 ; 0x30f28 1eec4: 49 81 ldd r20, Y+1 ; 0x01 1eec6: 5a 81 ldd r21, Y+2 ; 0x02 1eec8: 6b 81 ldd r22, Y+3 ; 0x03 1eeca: 7c 81 ldd r23, Y+4 ; 0x04 1eecc: 8d 81 ldd r24, Y+5 ; 0x05 1eece: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 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)); 1eed2: 60 e0 ldi r22, 0x00 ; 0 1eed4: 80 e0 ldi r24, 0x00 ; 0 1eed6: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 1eeda: 88 23 and r24, r24 1eedc: 69 f3 breq .-38 ; 0x1eeb8 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1eede: 20 91 40 12 lds r18, 0x1240 ; 0x801240 1eee2: 30 91 41 12 lds r19, 0x1241 ; 0x801241 1eee6: 30 93 91 12 sts 0x1291, r19 ; 0x801291 1eeea: 20 93 90 12 sts 0x1290, r18 ; 0x801290 return true; } 1eeee: 0f 90 pop r0 1eef0: 0f 90 pop r0 1eef2: 0f 90 pop r0 1eef4: 0f 90 pop r0 1eef6: 0f 90 pop r0 1eef8: df 91 pop r29 1eefa: cf 91 pop r28 1eefc: 1f 91 pop r17 1eefe: 08 95 ret 0001ef00 : 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) { 1ef00: fc 01 movw r30, r24 switch(*oCheckSetting) { 1ef02: 80 81 ld r24, Z 1ef04: 88 23 and r24, r24 1ef06: 21 f0 breq .+8 ; 0x1ef10 1ef08: 81 30 cpi r24, 0x01 ; 1 1ef0a: 29 f4 brne .+10 ; 0x1ef16 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef0c: 82 e0 ldi r24, 0x02 ; 2 1ef0e: 01 c0 rjmp .+2 ; 0x1ef12 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 1ef10: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef12: 80 83 st Z, r24 1ef14: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 1ef16: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 1ef18: 08 95 ret 0001ef1a : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 1ef1a: fc 01 movw r30, r24 1ef1c: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 1ef1e: 90 32 cpi r25, 0x20 ; 32 1ef20: 49 f0 breq .+18 ; 0x1ef34 1ef22: 87 ef ldi r24, 0xF7 ; 247 1ef24: 89 0f add r24, r25 1ef26: 82 30 cpi r24, 0x02 ; 2 1ef28: 28 f0 brcs .+10 ; 0x1ef34 1ef2a: 81 e0 ldi r24, 0x01 ; 1 1ef2c: 9d 30 cpi r25, 0x0D ; 13 1ef2e: 19 f0 breq .+6 ; 0x1ef36 1ef30: 80 e0 ldi r24, 0x00 ; 0 1ef32: 08 95 ret 1ef34: 81 e0 ldi r24, 0x01 ; 1 } 1ef36: 08 95 ret 0001ef38 : 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; 1ef38: 88 3e cpi r24, 0xE8 ; 232 1ef3a: 23 e0 ldi r18, 0x03 ; 3 1ef3c: 92 07 cpc r25, r18 1ef3e: 10 f0 brcs .+4 ; 0x1ef44 1ef40: 87 ee ldi r24, 0xE7 ; 231 1ef42: 93 e0 ldi r25, 0x03 ; 3 } 1ef44: 08 95 ret 0001ef46 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1ef46: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 1ef4a: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 1ef4e: 2f ef ldi r18, 0xFF ; 255 1ef50: 3f ef ldi r19, 0xFF ; 255 1ef52: 89 17 cp r24, r25 1ef54: 71 f0 breq .+28 ; 0x1ef72 _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 1ef56: e9 2f mov r30, r25 1ef58: f0 e0 ldi r31, 0x00 ; 0 1ef5a: ed 54 subi r30, 0x4D ; 77 1ef5c: f2 4f sbci r31, 0xF2 ; 242 1ef5e: 20 81 ld r18, Z 1ef60: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1ef62: 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 1ef64: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 1ef68: 98 17 cp r25, r24 1ef6a: 08 f0 brcs .+2 ; 0x1ef6e 1ef6c: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1ef6e: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 return rbuf_get(uart2_ibuf); } 1ef72: c9 01 movw r24, r18 1ef74: 08 95 ret 0001ef76 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1ef76: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1ef7a: 95 ff sbrs r25, 5 1ef7c: fc cf rjmp .-8 ; 0x1ef76 UDR2 = c; // transmit byte 1ef7e: 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; } 1ef82: 90 e0 ldi r25, 0x00 ; 0 1ef84: 80 e0 ldi r24, 0x00 ; 0 1ef86: 08 95 ret 0001ef88 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1ef88: 3f b7 in r19, 0x3f ; 63 cli(); 1ef8a: f8 94 cli m = timer2_overflow_count; 1ef8c: 80 91 69 06 lds r24, 0x0669 ; 0x800669 1ef90: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 1ef94: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 1ef98: b0 91 6c 06 lds r27, 0x066C ; 0x80066c #if defined(TCNT2) t = TCNT2; 1ef9c: 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)) 1efa0: b8 9b sbis 0x17, 0 ; 23 1efa2: 05 c0 rjmp .+10 ; 0x1efae 1efa4: 2f 3f cpi r18, 0xFF ; 255 1efa6: 19 f0 breq .+6 ; 0x1efae m++; 1efa8: 01 96 adiw r24, 0x01 ; 1 1efaa: a1 1d adc r26, r1 1efac: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1efae: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1efb0: ba 2f mov r27, r26 1efb2: a9 2f mov r26, r25 1efb4: 98 2f mov r25, r24 1efb6: 88 27 eor r24, r24 1efb8: bc 01 movw r22, r24 1efba: cd 01 movw r24, r26 1efbc: 62 0f add r22, r18 1efbe: 71 1d adc r23, r1 1efc0: 81 1d adc r24, r1 1efc2: 91 1d adc r25, r1 1efc4: 42 e0 ldi r20, 0x02 ; 2 1efc6: 66 0f add r22, r22 1efc8: 77 1f adc r23, r23 1efca: 88 1f adc r24, r24 1efcc: 99 1f adc r25, r25 1efce: 4a 95 dec r20 1efd0: d1 f7 brne .-12 ; 0x1efc6 } 1efd2: 08 95 ret 0001efd4 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1efd4: 2f 92 push r2 1efd6: 3f 92 push r3 1efd8: 4f 92 push r4 1efda: 5f 92 push r5 1efdc: 6f 92 push r6 1efde: 7f 92 push r7 1efe0: 8f 92 push r8 1efe2: 9f 92 push r9 1efe4: af 92 push r10 1efe6: bf 92 push r11 1efe8: cf 92 push r12 1efea: df 92 push r13 1efec: ef 92 push r14 1efee: ff 92 push r15 1eff0: 0f 93 push r16 1eff2: 1f 93 push r17 1eff4: cf 93 push r28 1eff6: df 93 push r29 1eff8: cd b7 in r28, 0x3d ; 61 1effa: de b7 in r29, 0x3e ; 62 1effc: 2e 97 sbiw r28, 0x0e ; 14 1effe: 0f b6 in r0, 0x3f ; 63 1f000: f8 94 cli 1f002: de bf out 0x3e, r29 ; 62 1f004: 0f be out 0x3f, r0 ; 63 1f006: 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]); 1f008: 20 90 5c 06 lds r2, 0x065C ; 0x80065c 1f00c: 30 90 5d 06 lds r3, 0x065D ; 0x80065d 1f010: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 1f014: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 1f018: 60 90 60 06 lds r6, 0x0660 ; 0x800660 1f01c: 70 90 61 06 lds r7, 0x0661 ; 0x800661 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1f020: 21 14 cp r2, r1 1f022: 31 04 cpc r3, r1 1f024: 39 f4 brne .+14 ; 0x1f034 pid_output = 0; pid_reset[e] = true; 1f026: 81 e0 ldi r24, 0x01 ; 1 1f028: 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; 1f02c: 81 2c mov r8, r1 1f02e: 91 2c mov r9, r1 1f030: 54 01 movw r10, r8 1f032: f9 c0 rjmp .+498 ; 0x1f226 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1f034: b1 01 movw r22, r2 1f036: 03 2c mov r0, r3 1f038: 00 0c add r0, r0 1f03a: 88 0b sbc r24, r24 1f03c: 99 0b sbc r25, r25 1f03e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1f042: a3 01 movw r20, r6 1f044: 92 01 movw r18, r4 1f046: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f04a: 6b 01 movw r12, r22 1f04c: 7c 01 movw r14, r24 if(pid_reset[e]) { 1f04e: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1f052: 88 23 and r24, r24 1f054: 91 f0 breq .+36 ; 0x1f07a iState_sum[e] = 0.0; 1f056: 10 92 31 06 sts 0x0631, r1 ; 0x800631 1f05a: 10 92 32 06 sts 0x0632, r1 ; 0x800632 1f05e: 10 92 33 06 sts 0x0633, r1 ; 0x800633 1f062: 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) 1f066: 10 92 2d 06 sts 0x062D, r1 ; 0x80062d 1f06a: 10 92 2e 06 sts 0x062E, r1 ; 0x80062e 1f06e: 10 92 2f 06 sts 0x062F, r1 ; 0x80062f 1f072: 10 92 30 06 sts 0x0630, r1 ; 0x800630 pid_reset[e] = false; 1f076: 10 92 35 06 sts 0x0635, r1 ; 0x800635 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1f07a: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 1f07e: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 1f082: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 1f086: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 1f08a: c7 01 movw r24, r14 1f08c: b6 01 movw r22, r12 1f08e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f092: 69 83 std Y+1, r22 ; 0x01 1f094: 7a 83 std Y+2, r23 ; 0x02 1f096: 8b 83 std Y+3, r24 ; 0x03 1f098: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1f09a: 20 91 31 06 lds r18, 0x0631 ; 0x800631 1f09e: 30 91 32 06 lds r19, 0x0632 ; 0x800632 1f0a2: 40 91 33 06 lds r20, 0x0633 ; 0x800633 1f0a6: 50 91 34 06 lds r21, 0x0634 ; 0x800634 1f0aa: c7 01 movw r24, r14 1f0ac: b6 01 movw r22, r12 1f0ae: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f0b2: 4b 01 movw r8, r22 1f0b4: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1f0b6: 20 91 ea 03 lds r18, 0x03EA ; 0x8003ea <_ZL14iState_sum_min.lto_priv.429> 1f0ba: 2d 87 std Y+13, r18 ; 0x0d 1f0bc: 30 91 eb 03 lds r19, 0x03EB ; 0x8003eb <_ZL14iState_sum_min.lto_priv.429+0x1> 1f0c0: 39 87 std Y+9, r19 ; 0x09 1f0c2: 10 91 ec 03 lds r17, 0x03EC ; 0x8003ec <_ZL14iState_sum_min.lto_priv.429+0x2> 1f0c6: 00 91 ed 03 lds r16, 0x03ED ; 0x8003ed <_ZL14iState_sum_min.lto_priv.429+0x3> 1f0ca: 41 2f mov r20, r17 1f0cc: 50 2f mov r21, r16 1f0ce: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f0d2: 87 fd sbrc r24, 7 1f0d4: 17 c0 rjmp .+46 ; 0x1f104 1f0d6: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 1f0da: 8d 87 std Y+13, r24 ; 0x0d 1f0dc: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 1f0e0: 99 87 std Y+9, r25 ; 0x09 1f0e2: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 1f0e6: 00 91 e9 03 lds r16, 0x03E9 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.430+0x3> 1f0ea: 9c 01 movw r18, r24 1f0ec: 41 2f mov r20, r17 1f0ee: 50 2f mov r21, r16 1f0f0: b4 01 movw r22, r8 1f0f2: c5 01 movw r24, r10 1f0f4: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1f0f8: 18 16 cp r1, r24 1f0fa: 24 f0 brlt .+8 ; 0x1f104 1f0fc: 8d 86 std Y+13, r8 ; 0x0d 1f0fe: 99 86 std Y+9, r9 ; 0x09 1f100: 1a 2d mov r17, r10 1f102: 0b 2d mov r16, r11 1f104: 8d 85 ldd r24, Y+13 ; 0x0d 1f106: 99 85 ldd r25, Y+9 ; 0x09 1f108: a1 2f mov r26, r17 1f10a: b0 2f mov r27, r16 1f10c: 80 93 31 06 sts 0x0631, r24 ; 0x800631 1f110: 90 93 32 06 sts 0x0632, r25 ; 0x800632 1f114: a0 93 33 06 sts 0x0633, r26 ; 0x800633 1f118: b0 93 34 06 sts 0x0634, r27 ; 0x800634 iTerm[e] = cs.Ki * iState_sum[e]; 1f11c: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1f120: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1f124: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1f128: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1f12c: bc 01 movw r22, r24 1f12e: 81 2f mov r24, r17 1f130: 90 2f mov r25, r16 1f132: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f136: 6d 83 std Y+5, r22 ; 0x05 1f138: 7e 83 std Y+6, r23 ; 0x06 1f13a: 8f 83 std Y+7, r24 ; 0x07 1f13c: 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 1f13e: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1f142: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 1f146: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 1f14a: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 1f14e: c3 01 movw r24, r6 1f150: b2 01 movw r22, r4 1f152: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f156: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 1f15a: 30 91 a3 04 lds r19, 0x04A3 ; 0x8004a3 1f15e: 40 91 a4 04 lds r20, 0x04A4 ; 0x8004a4 1f162: 50 91 a5 04 lds r21, 0x04A5 ; 0x8004a5 1f166: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f16a: 20 ed ldi r18, 0xD0 ; 208 1f16c: 3c ec ldi r19, 0xCC ; 204 1f16e: 4c e4 ldi r20, 0x4C ; 76 1f170: 5d e3 ldi r21, 0x3D ; 61 1f172: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f176: 4b 01 movw r8, r22 1f178: 5c 01 movw r10, r24 1f17a: 23 e3 ldi r18, 0x33 ; 51 1f17c: 33 e3 ldi r19, 0x33 ; 51 1f17e: 43 e7 ldi r20, 0x73 ; 115 1f180: 5f e3 ldi r21, 0x3F ; 63 1f182: 60 91 2d 06 lds r22, 0x062D ; 0x80062d 1f186: 70 91 2e 06 lds r23, 0x062E ; 0x80062e 1f18a: 80 91 2f 06 lds r24, 0x062F ; 0x80062f 1f18e: 90 91 30 06 lds r25, 0x0630 ; 0x800630 1f192: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f196: 9b 01 movw r18, r22 1f198: ac 01 movw r20, r24 1f19a: c5 01 movw r24, r10 1f19c: b4 01 movw r22, r8 1f19e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f1a2: 4b 01 movw r8, r22 1f1a4: 5c 01 movw r10, r24 1f1a6: 80 92 2d 06 sts 0x062D, r8 ; 0x80062d 1f1aa: 90 92 2e 06 sts 0x062E, r9 ; 0x80062e 1f1ae: a0 92 2f 06 sts 0x062F, r10 ; 0x80062f 1f1b2: 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) 1f1b6: 2d 81 ldd r18, Y+5 ; 0x05 1f1b8: 3e 81 ldd r19, Y+6 ; 0x06 1f1ba: 4f 81 ldd r20, Y+7 ; 0x07 1f1bc: 58 85 ldd r21, Y+8 ; 0x08 1f1be: 69 81 ldd r22, Y+1 ; 0x01 1f1c0: 7a 81 ldd r23, Y+2 ; 0x02 1f1c2: 8b 81 ldd r24, Y+3 ; 0x03 1f1c4: 9c 81 ldd r25, Y+4 ; 0x04 1f1c6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f1ca: a5 01 movw r20, r10 1f1cc: 94 01 movw r18, r8 1f1ce: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f1d2: 4b 01 movw r8, r22 1f1d4: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1f1d6: 20 e0 ldi r18, 0x00 ; 0 1f1d8: 30 e0 ldi r19, 0x00 ; 0 1f1da: 4f e7 ldi r20, 0x7F ; 127 1f1dc: 53 e4 ldi r21, 0x43 ; 67 1f1de: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f1e2: 20 e0 ldi r18, 0x00 ; 0 1f1e4: 30 e0 ldi r19, 0x00 ; 0 1f1e6: 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) { 1f1e8: 18 16 cp r1, r24 1f1ea: 0c f0 brlt .+2 ; 0x1f1ee 1f1ec: 6d c1 rjmp .+730 ; 0x1f4c8 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f1ee: c7 01 movw r24, r14 1f1f0: b6 01 movw r22, r12 1f1f2: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1f1f6: 18 16 cp r1, r24 1f1f8: 84 f4 brge .+32 ; 0x1f21a 1f1fa: a7 01 movw r20, r14 1f1fc: 96 01 movw r18, r12 1f1fe: 6d 85 ldd r22, Y+13 ; 0x0d 1f200: 79 85 ldd r23, Y+9 ; 0x09 1f202: 81 2f mov r24, r17 1f204: 90 2f mov r25, r16 1f206: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f20a: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f20e: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f212: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f216: 90 93 34 06 sts 0x0634, r25 ; 0x800634 pid_output=PID_MAX; 1f21a: 81 2c mov r8, r1 1f21c: 91 2c mov r9, r1 1f21e: 3f e7 ldi r19, 0x7F ; 127 1f220: a3 2e mov r10, r19 1f222: 33 e4 ldi r19, 0x43 ; 67 1f224: 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; 1f226: 40 92 29 06 sts 0x0629, r4 ; 0x800629 1f22a: 50 92 2a 06 sts 0x062A, r5 ; 0x80062a 1f22e: 60 92 2b 06 sts 0x062B, r6 ; 0x80062b 1f232: 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)) 1f236: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.431> 1f23a: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.431+0x1> 1f23e: 07 2e mov r0, r23 1f240: 00 0c add r0, r0 1f242: 88 0b sbc r24, r24 1f244: 99 0b sbc r25, r25 1f246: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1f24a: 9b 01 movw r18, r22 1f24c: ac 01 movw r20, r24 1f24e: c3 01 movw r24, r6 1f250: b2 01 movw r22, r4 1f252: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f256: 87 ff sbrs r24, 7 1f258: 57 c1 rjmp .+686 ; 0x1f508 1f25a: 23 28 or r2, r3 1f25c: 09 f4 brne .+2 ; 0x1f260 1f25e: 54 c1 rjmp .+680 ; 0x1f508 soft_pwm[e] = (int)pid_output >> 1; 1f260: c5 01 movw r24, r10 1f262: b4 01 movw r22, r8 1f264: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1f268: 75 95 asr r23 1f26a: 67 95 ror r22 1f26c: 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); 1f270: 20 91 55 06 lds r18, 0x0655 ; 0x800655 1f274: 30 91 56 06 lds r19, 0x0656 ; 0x800656 1f278: 3a 83 std Y+2, r19 ; 0x02 1f27a: 29 83 std Y+1, r18 ; 0x01 1f27c: 40 90 57 06 lds r4, 0x0657 ; 0x800657 1f280: 50 90 58 06 lds r5, 0x0658 ; 0x800658 1f284: 60 90 59 06 lds r6, 0x0659 ; 0x800659 1f288: 70 90 5a 06 lds r7, 0x065A ; 0x80065a #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1f28c: b9 01 movw r22, r18 1f28e: 33 0f add r19, r19 1f290: 88 0b sbc r24, r24 1f292: 99 0b sbc r25, r25 1f294: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 1f298: a3 01 movw r20, r6 1f29a: 92 01 movw r18, r4 1f29c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f2a0: 6b 01 movw r12, r22 1f2a2: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1f2a4: 20 91 a6 04 lds r18, 0x04A6 ; 0x8004a6 1f2a8: 30 91 a7 04 lds r19, 0x04A7 ; 0x8004a7 1f2ac: 40 91 a8 04 lds r20, 0x04A8 ; 0x8004a8 1f2b0: 50 91 a9 04 lds r21, 0x04A9 ; 0x8004a9 1f2b4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f2b8: 6d 83 std Y+5, r22 ; 0x05 1f2ba: 7e 83 std Y+6, r23 ; 0x06 1f2bc: 8f 83 std Y+7, r24 ; 0x07 1f2be: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1f2c0: 20 91 3e 06 lds r18, 0x063E ; 0x80063e 1f2c4: 30 91 3f 06 lds r19, 0x063F ; 0x80063f 1f2c8: 40 91 40 06 lds r20, 0x0640 ; 0x800640 1f2cc: 50 91 41 06 lds r21, 0x0641 ; 0x800641 1f2d0: c7 01 movw r24, r14 1f2d2: b6 01 movw r22, r12 1f2d4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f2d8: 5b 01 movw r10, r22 1f2da: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1f2dc: 30 91 e2 03 lds r19, 0x03E2 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.427> 1f2e0: 3e 87 std Y+14, r19 ; 0x0e 1f2e2: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.427+0x1> 1f2e6: 8d 87 std Y+13, r24 ; 0x0d 1f2e8: 30 90 e4 03 lds r3, 0x03E4 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.427+0x2> 1f2ec: 20 90 e5 03 lds r2, 0x03E5 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.427+0x3> 1f2f0: 23 2f mov r18, r19 1f2f2: 38 2f mov r19, r24 1f2f4: 43 2d mov r20, r3 1f2f6: 52 2d mov r21, r2 1f2f8: b5 01 movw r22, r10 1f2fa: c8 01 movw r24, r16 1f2fc: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f300: 87 fd sbrc r24, 7 1f302: 18 c0 rjmp .+48 ; 0x1f334 1f304: 90 91 de 03 lds r25, 0x03DE ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 1f308: 9e 87 std Y+14, r25 ; 0x0e 1f30a: 20 91 df 03 lds r18, 0x03DF ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 1f30e: 2d 87 std Y+13, r18 ; 0x0d 1f310: 30 90 e0 03 lds r3, 0x03E0 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 1f314: 20 90 e1 03 lds r2, 0x03E1 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.428+0x3> 1f318: 29 2f mov r18, r25 1f31a: 3d 85 ldd r19, Y+13 ; 0x0d 1f31c: 43 2d mov r20, r3 1f31e: 52 2d mov r21, r2 1f320: b5 01 movw r22, r10 1f322: c8 01 movw r24, r16 1f324: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1f328: 18 16 cp r1, r24 1f32a: 24 f0 brlt .+8 ; 0x1f334 1f32c: ae 86 std Y+14, r10 ; 0x0e 1f32e: bd 86 std Y+13, r11 ; 0x0d 1f330: 30 2e mov r3, r16 1f332: 21 2e mov r2, r17 1f334: 8e 85 ldd r24, Y+14 ; 0x0e 1f336: 9d 85 ldd r25, Y+13 ; 0x0d 1f338: a3 2d mov r26, r3 1f33a: b2 2d mov r27, r2 1f33c: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 1f340: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f 1f344: a0 93 40 06 sts 0x0640, r26 ; 0x800640 1f348: b0 93 41 06 sts 0x0641, r27 ; 0x800641 iTerm_bed = cs.bedKi * temp_iState_bed; 1f34c: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1f350: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1f354: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1f358: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1f35c: bc 01 movw r22, r24 1f35e: 83 2d mov r24, r3 1f360: 92 2d mov r25, r2 1f362: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f366: 69 87 std Y+9, r22 ; 0x09 1f368: 7a 87 std Y+10, r23 ; 0x0a 1f36a: 8b 87 std Y+11, r24 ; 0x0b 1f36c: 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); 1f36e: 20 91 3a 06 lds r18, 0x063A ; 0x80063a 1f372: 30 91 3b 06 lds r19, 0x063B ; 0x80063b 1f376: 40 91 3c 06 lds r20, 0x063C ; 0x80063c 1f37a: 50 91 3d 06 lds r21, 0x063D ; 0x80063d 1f37e: c3 01 movw r24, r6 1f380: b2 01 movw r22, r4 1f382: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f386: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1f38a: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1f38e: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 1f392: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 1f396: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f39a: 20 ed ldi r18, 0xD0 ; 208 1f39c: 3c ec ldi r19, 0xCC ; 204 1f39e: 4c e4 ldi r20, 0x4C ; 76 1f3a0: 5d e3 ldi r21, 0x3D ; 61 1f3a2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f3a6: 4b 01 movw r8, r22 1f3a8: 5c 01 movw r10, r24 1f3aa: 23 e3 ldi r18, 0x33 ; 51 1f3ac: 33 e3 ldi r19, 0x33 ; 51 1f3ae: 43 e7 ldi r20, 0x73 ; 115 1f3b0: 5f e3 ldi r21, 0x3F ; 63 1f3b2: 60 91 36 06 lds r22, 0x0636 ; 0x800636 1f3b6: 70 91 37 06 lds r23, 0x0637 ; 0x800637 1f3ba: 80 91 38 06 lds r24, 0x0638 ; 0x800638 1f3be: 90 91 39 06 lds r25, 0x0639 ; 0x800639 1f3c2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 1f3c6: 9b 01 movw r18, r22 1f3c8: ac 01 movw r20, r24 1f3ca: c5 01 movw r24, r10 1f3cc: b4 01 movw r22, r8 1f3ce: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f3d2: 4b 01 movw r8, r22 1f3d4: 5c 01 movw r10, r24 1f3d6: 80 92 36 06 sts 0x0636, r8 ; 0x800636 1f3da: 90 92 37 06 sts 0x0637, r9 ; 0x800637 1f3de: a0 92 38 06 sts 0x0638, r10 ; 0x800638 1f3e2: b0 92 39 06 sts 0x0639, r11 ; 0x800639 temp_dState_bed = pid_input; 1f3e6: 40 92 3a 06 sts 0x063A, r4 ; 0x80063a 1f3ea: 50 92 3b 06 sts 0x063B, r5 ; 0x80063b 1f3ee: 60 92 3c 06 sts 0x063C, r6 ; 0x80063c 1f3f2: 70 92 3d 06 sts 0x063D, r7 ; 0x80063d pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1f3f6: 29 85 ldd r18, Y+9 ; 0x09 1f3f8: 3a 85 ldd r19, Y+10 ; 0x0a 1f3fa: 4b 85 ldd r20, Y+11 ; 0x0b 1f3fc: 5c 85 ldd r21, Y+12 ; 0x0c 1f3fe: 6d 81 ldd r22, Y+5 ; 0x05 1f400: 7e 81 ldd r23, Y+6 ; 0x06 1f402: 8f 81 ldd r24, Y+7 ; 0x07 1f404: 98 85 ldd r25, Y+8 ; 0x08 1f406: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 1f40a: a5 01 movw r20, r10 1f40c: 94 01 movw r18, r8 1f40e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f412: 4b 01 movw r8, r22 1f414: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1f416: 20 e0 ldi r18, 0x00 ; 0 1f418: 30 e0 ldi r19, 0x00 ; 0 1f41a: 4f e7 ldi r20, 0x7F ; 127 1f41c: 53 e4 ldi r21, 0x43 ; 67 1f41e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f422: 20 e0 ldi r18, 0x00 ; 0 1f424: 30 e0 ldi r19, 0x00 ; 0 1f426: 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) { 1f428: 18 16 cp r1, r24 1f42a: 0c f0 brlt .+2 ; 0x1f42e 1f42c: 70 c0 rjmp .+224 ; 0x1f50e if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f42e: c7 01 movw r24, r14 1f430: b6 01 movw r22, r12 1f432: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 1f436: 18 16 cp r1, r24 1f438: 84 f4 brge .+32 ; 0x1f45a 1f43a: a7 01 movw r20, r14 1f43c: 96 01 movw r18, r12 1f43e: 6e 85 ldd r22, Y+14 ; 0x0e 1f440: 7d 85 ldd r23, Y+13 ; 0x0d 1f442: 83 2d mov r24, r3 1f444: 92 2d mov r25, r2 1f446: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f44a: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f44e: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f452: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f456: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=MAX_BED_POWER; 1f45a: 81 2c mov r8, r1 1f45c: 91 2c mov r9, r1 1f45e: 9f e7 ldi r25, 0x7F ; 127 1f460: a9 2e mov r10, r25 1f462: 93 e4 ldi r25, 0x43 ; 67 1f464: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1f466: 20 e0 ldi r18, 0x00 ; 0 1f468: 30 e0 ldi r19, 0x00 ; 0 1f46a: 4a ef ldi r20, 0xFA ; 250 1f46c: 52 e4 ldi r21, 0x42 ; 66 1f46e: c3 01 movw r24, r6 1f470: b2 01 movw r22, r4 1f472: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f476: 87 ff sbrs r24, 7 1f478: 6d c0 rjmp .+218 ; 0x1f554 { soft_pwm_bed = (int)pid_output >> 1; 1f47a: c5 01 movw r24, r10 1f47c: b4 01 movw r22, r8 1f47e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 1f482: 75 95 asr r23 1f484: 67 95 ror r22 1f486: 60 93 5b 06 sts 0x065B, r22 ; 0x80065b soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1f48a: 89 81 ldd r24, Y+1 ; 0x01 1f48c: 9a 81 ldd r25, Y+2 ; 0x02 1f48e: 89 2b or r24, r25 1f490: 11 f4 brne .+4 ; 0x1f496 { soft_pwm_bed = 0; 1f492: 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); } 1f496: 2e 96 adiw r28, 0x0e ; 14 1f498: 0f b6 in r0, 0x3f ; 63 1f49a: f8 94 cli 1f49c: de bf out 0x3e, r29 ; 62 1f49e: 0f be out 0x3f, r0 ; 63 1f4a0: cd bf out 0x3d, r28 ; 61 1f4a2: df 91 pop r29 1f4a4: cf 91 pop r28 1f4a6: 1f 91 pop r17 1f4a8: 0f 91 pop r16 1f4aa: ff 90 pop r15 1f4ac: ef 90 pop r14 1f4ae: df 90 pop r13 1f4b0: cf 90 pop r12 1f4b2: bf 90 pop r11 1f4b4: af 90 pop r10 1f4b6: 9f 90 pop r9 1f4b8: 8f 90 pop r8 1f4ba: 7f 90 pop r7 1f4bc: 6f 90 pop r6 1f4be: 5f 90 pop r5 1f4c0: 4f 90 pop r4 1f4c2: 3f 90 pop r3 1f4c4: 2f 90 pop r2 1f4c6: 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) { 1f4c8: c5 01 movw r24, r10 1f4ca: b4 01 movw r22, r8 1f4cc: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f4d0: 87 ff sbrs r24, 7 1f4d2: a9 ce rjmp .-686 ; 0x1f226 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f4d4: 20 e0 ldi r18, 0x00 ; 0 1f4d6: 30 e0 ldi r19, 0x00 ; 0 1f4d8: a9 01 movw r20, r18 1f4da: c7 01 movw r24, r14 1f4dc: b6 01 movw r22, r12 1f4de: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f4e2: 87 ff sbrs r24, 7 1f4e4: a3 cd rjmp .-1210 ; 0x1f02c 1f4e6: a7 01 movw r20, r14 1f4e8: 96 01 movw r18, r12 1f4ea: 6d 85 ldd r22, Y+13 ; 0x0d 1f4ec: 79 85 ldd r23, Y+9 ; 0x09 1f4ee: 81 2f mov r24, r17 1f4f0: 90 2f mov r25, r16 1f4f2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f4f6: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f4fa: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f4fe: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f502: 90 93 34 06 sts 0x0634, r25 ; 0x800634 1f506: 92 cd rjmp .-1244 ; 0x1f02c // 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; 1f508: 10 92 62 06 sts 0x0662, r1 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 1f50c: b1 ce rjmp .-670 ; 0x1f270 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){ 1f50e: c5 01 movw r24, r10 1f510: b4 01 movw r22, r8 1f512: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f516: 87 ff sbrs r24, 7 1f518: a6 cf rjmp .-180 ; 0x1f466 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f51a: 20 e0 ldi r18, 0x00 ; 0 1f51c: 30 e0 ldi r19, 0x00 ; 0 1f51e: a9 01 movw r20, r18 1f520: c7 01 movw r24, r14 1f522: b6 01 movw r22, r12 1f524: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 1f528: 87 ff sbrs r24, 7 1f52a: 10 c0 rjmp .+32 ; 0x1f54c 1f52c: a7 01 movw r20, r14 1f52e: 96 01 movw r18, r12 1f530: 6e 85 ldd r22, Y+14 ; 0x0e 1f532: 7d 85 ldd r23, Y+13 ; 0x0d 1f534: 83 2d mov r24, r3 1f536: 92 2d mov r25, r2 1f538: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 1f53c: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f540: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f544: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f548: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=0; 1f54c: 81 2c mov r8, r1 1f54e: 91 2c mov r9, r1 1f550: 54 01 movw r10, r8 1f552: 89 cf rjmp .-238 ; 0x1f466 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1f554: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1f558: 98 cf rjmp .-208 ; 0x1f48a 0001f55a : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1f55e: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 1f562: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 1f566: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c target_temperature_bed_isr = target_temperature_bed; 1f56a: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 1f56e: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 1f572: 90 93 56 06 sts 0x0656, r25 ; 0x800656 1f576: 80 93 55 06 sts 0x0655, r24 ; 0x800655 } 1f57a: 08 95 ret 0001f57c : /* 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() { 1f57c: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f57e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f580: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1f582: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f586: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1f588: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f58c: 8d 7f andi r24, 0xFD ; 253 1f58e: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f592: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1f598: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 1f59c: a0 91 60 06 lds r26, 0x0660 ; 0x800660 1f5a0: b0 91 61 06 lds r27, 0x0661 ; 0x800661 1f5a4: 80 93 c4 0d sts 0x0DC4, r24 ; 0x800dc4 1f5a8: 90 93 c5 0d sts 0x0DC5, r25 ; 0x800dc5 1f5ac: a0 93 c6 0d sts 0x0DC6, r26 ; 0x800dc6 1f5b0: b0 93 c7 0d sts 0x0DC7, r27 ; 0x800dc7 current_temperature_bed = current_temperature_bed_isr; 1f5b4: 80 91 57 06 lds r24, 0x0657 ; 0x800657 1f5b8: 90 91 58 06 lds r25, 0x0658 ; 0x800658 1f5bc: a0 91 59 06 lds r26, 0x0659 ; 0x800659 1f5c0: b0 91 5a 06 lds r27, 0x065A ; 0x80065a 1f5c4: 80 93 8a 03 sts 0x038A, r24 ; 0x80038a 1f5c8: 90 93 8b 03 sts 0x038B, r25 ; 0x80038b 1f5cc: a0 93 8c 03 sts 0x038C, r26 ; 0x80038c 1f5d0: b0 93 8d 03 sts 0x038D, r27 ; 0x80038d #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 1f5d4: 80 91 43 06 lds r24, 0x0643 ; 0x800643 1f5d8: 90 91 44 06 lds r25, 0x0644 ; 0x800644 1f5dc: a0 91 45 06 lds r26, 0x0645 ; 0x800645 1f5e0: b0 91 46 06 lds r27, 0x0646 ; 0x800646 1f5e4: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e 1f5e8: 90 93 8f 06 sts 0x068F, r25 ; 0x80068f 1f5ec: a0 93 90 06 sts 0x0690, r26 ; 0x800690 1f5f0: 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) { 1f5f4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 1f5f8: 81 11 cpse r24, r1 1f5fa: 02 c0 rjmp .+4 ; 0x1f600 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 1f5fc: 0e 94 ad fa call 0x1f55a ; 0x1f55a } temp_meas_ready = false; 1f600: 10 92 42 06 sts 0x0642, r1 ; 0x800642 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f604: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f606: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 1f608: cc 23 and r28, r28 1f60a: 29 f0 breq .+10 ; 0x1f616 1f60c: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f610: 82 60 ori r24, 0x02 ; 2 1f612: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f616: 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; } 1f618: cf 91 pop r28 1f61a: 08 95 ret 0001f61c : { // 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) 1f61c: 81 30 cpi r24, 0x01 ; 1 1f61e: 61 f1 breq .+88 ; 0x1f678 1f620: 20 f0 brcs .+8 ; 0x1f62a 1f622: 82 30 cpi r24, 0x02 ; 2 1f624: 09 f4 brne .+2 ; 0x1f628 1f626: 4b c0 rjmp .+150 ; 0x1f6be 1f628: 08 95 ret { case X_AXIS: { enable_x(); 1f62a: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 1f62c: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f630: 81 e0 ldi r24, 0x01 ; 1 1f632: 29 2f mov r18, r25 1f634: 22 70 andi r18, 0x02 ; 2 1f636: 91 ff sbrs r25, 1 1f638: 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) { 1f63a: 86 17 cp r24, r22 1f63c: 59 f0 breq .+22 ; 0x1f654 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 1f63e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f642: 66 23 and r22, r22 1f644: a9 f0 breq .+42 ; 0x1f670 1f646: 82 60 ori r24, 0x02 ; 2 1f648: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 1f64c: 8b e8 ldi r24, 0x8B ; 139 1f64e: 91 e0 ldi r25, 0x01 ; 1 1f650: 01 97 sbiw r24, 0x01 ; 1 1f652: f1 f7 brne .-4 ; 0x1f650 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 1f654: 40 9a sbi 0x08, 0 ; 8 1f656: 83 e0 ldi r24, 0x03 ; 3 1f658: 90 e0 ldi r25, 0x00 ; 0 1f65a: 01 97 sbiw r24, 0x01 ; 1 1f65c: f1 f7 brne .-4 ; 0x1f65a #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 1f65e: 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); 1f660: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f664: 22 23 and r18, r18 1f666: 31 f0 breq .+12 ; 0x1f674 1f668: 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); 1f66a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 1f66e: 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); 1f670: 8d 7f andi r24, 0xFD ; 253 1f672: ea cf rjmp .-44 ; 0x1f648 #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); 1f674: 8d 7f andi r24, 0xFD ; 253 1f676: f9 cf rjmp .-14 ; 0x1f66a } break; case Y_AXIS: { enable_y(); 1f678: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 1f67a: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f67e: 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) { 1f680: 86 17 cp r24, r22 1f682: 59 f0 breq .+22 ; 0x1f69a WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 1f684: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f688: 66 23 and r22, r22 1f68a: 99 f0 breq .+38 ; 0x1f6b2 1f68c: 91 60 ori r25, 0x01 ; 1 1f68e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f692: eb e8 ldi r30, 0x8B ; 139 1f694: f1 e0 ldi r31, 0x01 ; 1 1f696: 31 97 sbiw r30, 0x01 ; 1 1f698: f1 f7 brne .-4 ; 0x1f696 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 1f69a: 41 9a sbi 0x08, 1 ; 8 1f69c: e3 e0 ldi r30, 0x03 ; 3 1f69e: f0 e0 ldi r31, 0x00 ; 0 1f6a0: 31 97 sbiw r30, 0x01 ; 1 1f6a2: f1 f7 brne .-4 ; 0x1f6a0 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 1f6a4: 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); 1f6a6: 88 23 and r24, r24 1f6a8: 31 f0 breq .+12 ; 0x1f6b6 1f6aa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6ae: 81 60 ori r24, 0x01 ; 1 1f6b0: dc cf rjmp .-72 ; 0x1f66a 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); 1f6b2: 9e 7f andi r25, 0xFE ; 254 1f6b4: ec cf rjmp .-40 ; 0x1f68e #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); 1f6b6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6ba: 8e 7f andi r24, 0xFE ; 254 1f6bc: d6 cf rjmp .-84 ; 0x1f66a } break; case Z_AXIS: { enable_z(); 1f6be: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 1f6c0: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f6c4: 81 e0 ldi r24, 0x01 ; 1 1f6c6: 29 2f mov r18, r25 1f6c8: 24 70 andi r18, 0x04 ; 4 1f6ca: 92 ff sbrs r25, 2 1f6cc: 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) { 1f6ce: 68 17 cp r22, r24 1f6d0: 59 f0 breq .+22 ; 0x1f6e8 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 1f6d2: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6d6: 66 23 and r22, r22 1f6d8: b1 f0 breq .+44 ; 0x1f706 1f6da: 94 60 ori r25, 0x04 ; 4 1f6dc: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6e0: eb e8 ldi r30, 0x8B ; 139 1f6e2: f1 e0 ldi r31, 0x01 ; 1 1f6e4: 31 97 sbiw r30, 0x01 ; 1 1f6e6: f1 f7 brne .-4 ; 0x1f6e4 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 1f6e8: 42 9a sbi 0x08, 2 ; 8 1f6ea: e3 e0 ldi r30, 0x03 ; 3 1f6ec: f0 e0 ldi r31, 0x00 ; 0 1f6ee: 31 97 sbiw r30, 0x01 ; 1 1f6f0: f1 f7 brne .-4 ; 0x1f6ee #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_HI(Z2_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 1f6f2: 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) { 1f6f4: 68 17 cp r22, r24 1f6f6: 09 f4 brne .+2 ; 0x1f6fa 1f6f8: ba cf rjmp .-140 ; 0x1f66e WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f6fa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6fe: 22 23 and r18, r18 1f700: 21 f0 breq .+8 ; 0x1f70a 1f702: 84 60 ori r24, 0x04 ; 4 1f704: b2 cf rjmp .-156 ; 0x1f66a 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); 1f706: 9b 7f andi r25, 0xFB ; 251 1f708: e9 cf rjmp .-46 ; 0x1f6dc 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); 1f70a: 8b 7f andi r24, 0xFB ; 251 1f70c: ae cf rjmp .-164 ; 0x1f66a 0001f70e : } } static void checkRx(void) { if (selectedSerialPort == 0) { 1f70e: 80 91 04 05 lds r24, 0x0504 ; 0x800504 1f712: 81 11 cpse r24, r1 1f714: 25 c0 rjmp .+74 ; 0x1f760 if((M_UCSRxA & (1< 1f71a: 87 ff sbrs r24, 7 1f71c: 3d c0 rjmp .+122 ; 0x1f798 // Test for a framing error. if (M_UCSRxA & (1< 1f722: 84 ff sbrs r24, 4 1f724: 03 c0 rjmp .+6 ; 0x1f72c // 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); 1f726: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 1f72a: 08 95 ret } else { unsigned char c = M_UDRx; 1f72c: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f730: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f734: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f738: c9 01 movw r24, r18 1f73a: 01 96 adiw r24, 0x01 ; 1 1f73c: 8f 77 andi r24, 0x7F ; 127 1f73e: 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) { 1f740: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f744: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f748: 86 17 cp r24, r22 1f74a: 97 07 cpc r25, r23 1f74c: 29 f1 breq .+74 ; 0x1f798 // 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; 1f74e: 21 5d subi r18, 0xD1 ; 209 1f750: 3a 4f sbci r19, 0xFA ; 250 1f752: f9 01 movw r30, r18 1f754: 40 83 st Z, r20 rx_buffer.head = i; 1f756: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 1f75a: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 1f75e: 1c c0 rjmp .+56 ; 0x1f798 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 1f764: 87 ff sbrs r24, 7 1f766: 18 c0 rjmp .+48 ; 0x1f798 // Test for a framing error. if (UCSR1A & (1< 1f76c: 84 ff sbrs r24, 4 1f76e: 03 c0 rjmp .+6 ; 0x1f776 // 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); 1f770: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 1f774: 08 95 ret } else { unsigned char c = UDR1; 1f776: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f77a: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f77e: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f782: c9 01 movw r24, r18 1f784: 01 96 adiw r24, 0x01 ; 1 1f786: 8f 77 andi r24, 0x7F ; 127 1f788: 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) { 1f78a: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f78e: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f792: 68 17 cp r22, r24 1f794: 79 07 cpc r23, r25 1f796: d9 f6 brne .-74 ; 0x1f74e M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 1f798: 08 95 ret 0001f79a : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 1f79a: 93 e0 ldi r25, 0x03 ; 3 1f79c: 81 11 cpse r24, r1 1f79e: 91 e0 ldi r25, 0x01 ; 1 for(nI=0;nI delayMicroseconds(200); WRITE(BEEPER,LOW); 1f7b2: 72 98 cbi 0x0e, 2 ; 14 1f7b4: f9 01 movw r30, r18 1f7b6: 31 97 sbiw r30, 0x01 ; 1 1f7b8: f1 f7 brne .-4 ; 0x1f7b6 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); } } 1f7c0: 08 95 ret 0001f7c2 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 1f7c2: 8a e0 ldi r24, 0x0A ; 10 1f7c4: 2b e8 ldi r18, 0x8B ; 139 1f7c6: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 1f7c8: 72 9a sbi 0x0e, 2 ; 14 1f7ca: f9 01 movw r30, r18 1f7cc: 31 97 sbiw r30, 0x01 ; 1 1f7ce: f1 f7 brne .-4 ; 0x1f7cc delayMicroseconds(100); WRITE(BEEPER,LOW); 1f7d0: 72 98 cbi 0x0e, 2 ; 14 1f7d2: f9 01 movw r30, r18 1f7d4: 31 97 sbiw r30, 0x01 ; 1 1f7d6: f1 f7 brne .-4 ; 0x1f7d4 1f7d8: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 1f7da: b1 f7 brne .-20 ; 0x1f7c8 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 1f7dc: 08 95 ret 0001f7de : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f7de: 0f 94 5d 93 call 0x326ba ; 0x326ba 1f7e2: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1f7e6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f7ea: 84 30 cpi r24, 0x04 ; 4 1f7ec: d8 f5 brcc .+118 ; 0x1f864 1f7ee: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1f7f2: 8f ee ldi r24, 0xEF ; 239 1f7f4: 9a e3 ldi r25, 0x3A ; 58 1f7f6: 0e 94 3c 6d call 0xda78 ; 0xda78 1f7fa: 0f 94 28 96 call 0x32c50 ; 0x32c50 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1f7fe: 8a e4 ldi r24, 0x4A ; 74 1f800: 96 e5 ldi r25, 0x56 ; 86 1f802: 0e 94 3c 6d call 0xda78 ; 0xda78 1f806: 41 e5 ldi r20, 0x51 ; 81 1f808: 5c ef ldi r21, 0xFC ; 252 1f80a: bc 01 movw r22, r24 1f80c: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1f810: 0e 94 ac e1 call 0x1c358 ; 0x1c358 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1f814: 82 e4 ldi r24, 0x42 ; 66 1f816: 96 e5 ldi r25, 0x56 ; 86 1f818: 0e 94 3c 6d call 0xda78 ; 0xda78 1f81c: 47 e4 ldi r20, 0x47 ; 71 1f81e: 5c ef ldi r21, 0xFC ; 252 1f820: bc 01 movw r22, r24 1f822: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 1f826: 0e 94 ac e1 call 0x1c358 ; 0x1c358 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1f82a: 4d e3 ldi r20, 0x3D ; 61 1f82c: 5c ef ldi r21, 0xFC ; 252 1f82e: 62 e0 ldi r22, 0x02 ; 2 1f830: 7c e6 ldi r23, 0x6C ; 108 1f832: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1f836: 0e 94 ac e1 call 0x1c358 ; 0x1c358 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1f83a: 43 e3 ldi r20, 0x33 ; 51 1f83c: 5c ef ldi r21, 0xFC ; 252 1f83e: 68 ed ldi r22, 0xD8 ; 216 1f840: 79 e6 ldi r23, 0x69 ; 105 1f842: 80 91 bc 03 lds r24, 0x03BC ; 0x8003bc 1f846: 0e 94 ac e1 call 0x1c358 ; 0x1c358 MENU_END(); 1f84a: 0f 94 31 93 call 0x32662 ; 0x32662 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f84e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f852: 8f 5f subi r24, 0xFF ; 255 1f854: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1f858: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1f85c: 8f 5f subi r24, 0xFF ; 255 1f85e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1f862: c1 cf rjmp .-126 ; 0x1f7e6 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(); } 1f864: 08 95 ret 0001f866 : 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); 1f866: 8c eb ldi r24, 0xBC ; 188 1f868: 93 e0 ldi r25, 0x03 ; 3 1f86a: 0e 94 80 f7 call 0x1ef00 ; 0x1ef00 1f86e: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1f872: 80 e2 ldi r24, 0x20 ; 32 1f874: 9c e0 ldi r25, 0x0C ; 12 1f876: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f87a : 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); 1f87a: 87 eb ldi r24, 0xB7 ; 183 1f87c: 93 e0 ldi r25, 0x03 ; 3 1f87e: 0e 94 80 f7 call 0x1ef00 ; 0x1ef00 1f882: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 1f886: 83 ea ldi r24, 0xA3 ; 163 1f888: 9d e0 ldi r25, 0x0D ; 13 1f88a: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f88e : 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); 1f88e: 88 eb ldi r24, 0xB8 ; 184 1f890: 93 e0 ldi r25, 0x03 ; 3 1f892: 0e 94 80 f7 call 0x1ef00 ; 0x1ef00 1f896: 60 91 b8 03 lds r22, 0x03B8 ; 0x8003b8 1f89a: 84 ea ldi r24, 0xA4 ; 164 1f89c: 9d e0 ldi r25, 0x0D ; 13 1f89e: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f8a2 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 1f8a2: 8b eb ldi r24, 0xBB ; 187 1f8a4: 93 e0 ldi r25, 0x03 ; 3 1f8a6: 0e 94 80 f7 call 0x1ef00 ; 0x1ef00 1f8aa: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 1f8ae: 88 ea ldi r24, 0xA8 ; 168 1f8b0: 9d e0 ldi r25, 0x0D ; 13 1f8b2: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f8b6 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1f8b6: 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; 1f8ba: 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) { 1f8bc: 81 11 cpse r24, r1 1f8be: 01 c0 rjmp .+2 ; 0x1f8c2 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 1f8c0: 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; 1f8c2: 60 93 8c 16 sts 0x168C, r22 ; 0x80168c 1f8c6: 87 e4 ldi r24, 0x47 ; 71 1f8c8: 9d e0 ldi r25, 0x0D ; 13 1f8ca: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f8ce : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 1f8ce: e4 e8 ldi r30, 0x84 ; 132 1f8d0: f6 e1 ldi r31, 0x16 ; 22 1f8d2: 61 81 ldd r22, Z+1 ; 0x01 1f8d4: 81 e0 ldi r24, 0x01 ; 1 1f8d6: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1f8d8: 61 83 std Z+1, r22 ; 0x01 1f8da: 87 e0 ldi r24, 0x07 ; 7 1f8dc: 9f e0 ldi r25, 0x0F ; 15 1f8de: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f8e2 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 1f8e2: e4 e8 ldi r30, 0x84 ; 132 1f8e4: f6 e1 ldi r31, 0x16 ; 22 1f8e6: 62 81 ldd r22, Z+2 ; 0x02 1f8e8: 81 e0 ldi r24, 0x01 ; 1 1f8ea: 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; 1f8ec: 62 83 std Z+2, r22 ; 0x02 1f8ee: 85 ed ldi r24, 0xD5 ; 213 1f8f0: 9e e0 ldi r25, 0x0E ; 14 1f8f2: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f8f6 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 1f8f6: eb ed ldi r30, 0xDB ; 219 1f8f8: f5 e1 ldi r31, 0x15 ; 21 1f8fa: 60 81 ld r22, Z 1f8fc: 81 e0 ldi r24, 0x01 ; 1 1f8fe: 68 27 eor r22, r24 1f900: 60 83 st Z, r22 1f902: 8b eb ldi r24, 0xBB ; 187 1f904: 9f e0 ldi r25, 0x0F ; 15 1f906: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001f90a : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 1f90a: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1f90e: 81 30 cpi r24, 0x01 ; 1 1f910: 71 f0 breq .+28 ; 0x1f92e 1f912: 20 f0 brcs .+8 ; 0x1f91c 1f914: 82 30 cpi r24, 0x02 ; 2 1f916: 69 f4 brne .+26 ; 0x1f932 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1f918: 83 e0 ldi r24, 0x03 ; 3 1f91a: 01 c0 rjmp .+2 ; 0x1f91e void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1f91c: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1f91e: 80 93 15 04 sts 0x0415, r24 ; 0x800415 1f922: 60 91 15 04 lds r22, 0x0415 ; 0x800415 1f926: 87 ed ldi r24, 0xD7 ; 215 1f928: 9e e0 ldi r25, 0x0E ; 14 1f92a: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 1f92e: 82 e0 ldi r24, 0x02 ; 2 1f930: f6 cf rjmp .-20 ; 0x1f91e break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1f932: 10 92 15 04 sts 0x0415, r1 ; 0x800415 1f936: f5 cf rjmp .-22 ; 0x1f922 0001f938 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 1f938: 60 91 40 02 lds r22, 0x0240 ; 0x800240 1f93c: 81 e0 ldi r24, 0x01 ; 1 1f93e: 68 27 eor r22, r24 1f940: 60 93 40 02 sts 0x0240, r22 ; 0x800240 1f944: 87 e8 ldi r24, 0x87 ; 135 1f946: 9f e0 ldi r25, 0x0F ; 15 1f948: 0f 94 a1 a0 call 0x34142 ; 0x34142 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. 1f94c: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1f950: 81 11 cpse r24, r1 1f952: 02 c0 rjmp .+4 ; 0x1f958 1f954: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c #endif //FANCHECK } 1f958: 08 95 ret 0001f95a : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1f95a: cf 93 push r28 1f95c: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1f95e: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 1f962: 8c 33 cpi r24, 0x3C ; 60 1f964: e1 f0 breq .+56 ; 0x1f99e 1f966: 80 35 cpi r24, 0x50 ; 80 1f968: 01 f1 breq .+64 ; 0x1f9aa 1f96a: 88 32 cpi r24, 0x28 ; 40 1f96c: 91 f0 breq .+36 ; 0x1f992 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1f96e: 88 e2 ldi r24, 0x28 ; 40 1f970: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=400; 1f974: c0 e9 ldi r28, 0x90 ; 144 1f976: d1 e0 ldi r29, 0x01 ; 1 1f978: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 1f97c: 87 ea ldi r24, 0xA7 ; 167 1f97e: 9d e0 ldi r25, 0x0D ; 13 1f980: 0f 94 a1 a0 call 0x34142 ; 0x34142 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1f984: be 01 movw r22, r28 1f986: 85 ea ldi r24, 0xA5 ; 165 1f988: 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); } 1f98a: df 91 pop r29 1f98c: cf 91 pop r28 1f98e: 0d 94 bf a0 jmp 0x3417e ; 0x3417e case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1f992: 8c e3 ldi r24, 0x3C ; 60 1f994: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=600; 1f998: c8 e5 ldi r28, 0x58 ; 88 1f99a: d2 e0 ldi r29, 0x02 ; 2 1f99c: ed cf rjmp .-38 ; 0x1f978 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1f99e: 80 e5 ldi r24, 0x50 ; 80 1f9a0: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=800; 1f9a4: c0 e2 ldi r28, 0x20 ; 32 1f9a6: d3 e0 ldi r29, 0x03 ; 3 1f9a8: e7 cf rjmp .-50 ; 0x1f978 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1f9aa: 89 e1 ldi r24, 0x19 ; 25 1f9ac: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=250; 1f9b0: ca ef ldi r28, 0xFA ; 250 1f9b2: d0 e0 ldi r29, 0x00 ; 0 1f9b4: e1 cf rjmp .-62 ; 0x1f978 0001f9b6 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1f9b6: cf 93 push r28 1f9b8: df 93 push r29 MENU_BEGIN(); 1f9ba: 0f 94 5d 93 call 0x326ba ; 0x326ba 1f9be: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1f9c2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f9c6: 84 30 cpi r24, 0x04 ; 4 1f9c8: 08 f0 brcs .+2 ; 0x1f9cc 1f9ca: 96 c0 rjmp .+300 ; 0x1faf8 1f9cc: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1f9d0: 86 e7 ldi r24, 0x76 ; 118 1f9d2: 90 e4 ldi r25, 0x40 ; 64 1f9d4: 0e 94 3c 6d call 0xda78 ; 0xda78 1f9d8: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1f9dc: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1f9e0: 88 23 and r24, r24 1f9e2: f1 f1 breq .+124 ; 0x1fa60 1f9e4: 81 e7 ldi r24, 0x71 ; 113 1f9e6: 9b e5 ldi r25, 0x5B ; 91 1f9e8: 0e 94 3c 6d call 0xda78 ; 0xda78 1f9ec: ec 01 movw r28, r24 1f9ee: 8e e9 ldi r24, 0x9E ; 158 1f9f0: 9d e3 ldi r25, 0x3D ; 61 1f9f2: 0e 94 3c 6d call 0xda78 ; 0xda78 1f9f6: 22 e0 ldi r18, 0x02 ; 2 1f9f8: 40 ee ldi r20, 0xE0 ; 224 1f9fa: 5d ef ldi r21, 0xFD ; 253 1f9fc: be 01 movw r22, r28 1f9fe: 0f 94 ec 94 call 0x329d8 ; 0x329d8 1fa02: 80 91 84 16 lds r24, 0x1684 ; 0x801684 if (fsensor.isEnabled()) { 1fa06: 88 23 and r24, r24 1fa08: 09 f4 brne .+2 ; 0x1fa0c 1fa0a: 66 c0 rjmp .+204 ; 0x1fad8 if (fsensor.isError()) { 1fa0c: 83 30 cpi r24, 0x03 ; 3 1fa0e: 59 f5 brne .+86 ; 0x1fa66 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1fa10: 8d ed ldi r24, 0xDD ; 221 1fa12: 9d e3 ldi r25, 0x3D ; 61 1fa14: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa18: ec 01 movw r28, r24 1fa1a: 8e e0 ldi r24, 0x0E ; 14 1fa1c: 96 e5 ldi r25, 0x56 ; 86 1fa1e: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa22: 22 e0 ldi r18, 0x02 ; 2 1fa24: 47 ee ldi r20, 0xE7 ; 231 1fa26: 5d ef ldi r21, 0xFD ; 253 1fa28: be 01 movw r22, r28 1fa2a: 0f 94 ec 94 call 0x329d8 ; 0x329d8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1fa2e: 8d ed ldi r24, 0xDD ; 221 1fa30: 9d e3 ldi r25, 0x3D ; 61 1fa32: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa36: ec 01 movw r28, r24 1fa38: 80 e0 ldi r24, 0x00 ; 0 1fa3a: 96 e5 ldi r25, 0x56 ; 86 1fa3c: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa40: 22 e0 ldi r18, 0x02 ; 2 1fa42: 47 ee ldi r20, 0xE7 ; 231 1fa44: 5d ef ldi r21, 0xFD ; 253 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); 1fa46: be 01 movw r22, r28 1fa48: 0f 94 ec 94 call 0x329d8 ; 0x329d8 #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()) { 1fa4c: 80 91 8c 16 lds r24, 0x168C ; 0x80168c 1fa50: 88 23 and r24, r24 1fa52: 99 f1 breq .+102 ; 0x1faba 1fa54: 81 30 cpi r24, 0x01 ; 1 1fa56: 09 f4 brne .+2 ; 0x1fa5a 1fa58: 4c c0 rjmp .+152 ; 0x1faf2 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(); 1fa5a: 0e 94 5b fc call 0x1f8b6 ; 0x1f8b6 1fa5e: 3c c0 rjmp .+120 ; 0x1fad8 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); 1fa60: 8b e6 ldi r24, 0x6B ; 107 1fa62: 9b e5 ldi r25, 0x5B ; 91 1fa64: c1 cf rjmp .-126 ; 0x1f9e8 #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); 1fa66: 80 91 86 16 lds r24, 0x1686 ; 0x801686 1fa6a: 88 23 and r24, r24 1fa6c: 01 f1 breq .+64 ; 0x1faae 1fa6e: 81 e7 ldi r24, 0x71 ; 113 1fa70: 9b e5 ldi r25, 0x5B ; 91 1fa72: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa76: ec 01 movw r28, r24 1fa78: 8e e0 ldi r24, 0x0E ; 14 1fa7a: 96 e5 ldi r25, 0x56 ; 86 1fa7c: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa80: 22 e0 ldi r18, 0x02 ; 2 1fa82: 41 e7 ldi r20, 0x71 ; 113 1fa84: 5c ef ldi r21, 0xFC ; 252 1fa86: be 01 movw r22, r28 1fa88: 0f 94 ec 94 call 0x329d8 ; 0x329d8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fa8c: 80 91 85 16 lds r24, 0x1685 ; 0x801685 1fa90: 88 23 and r24, r24 1fa92: 81 f0 breq .+32 ; 0x1fab4 1fa94: 81 e7 ldi r24, 0x71 ; 113 1fa96: 9b e5 ldi r25, 0x5B ; 91 1fa98: 0e 94 3c 6d call 0xda78 ; 0xda78 1fa9c: ec 01 movw r28, r24 1fa9e: 80 e0 ldi r24, 0x00 ; 0 1faa0: 96 e5 ldi r25, 0x56 ; 86 1faa2: 0e 94 3c 6d call 0xda78 ; 0xda78 1faa6: 22 e0 ldi r18, 0x02 ; 2 1faa8: 47 e6 ldi r20, 0x67 ; 103 1faaa: 5c ef ldi r21, 0xFC ; 252 1faac: cc cf rjmp .-104 ; 0x1fa46 #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); 1faae: 8b e6 ldi r24, 0x6B ; 107 1fab0: 9b e5 ldi r25, 0x5B ; 91 1fab2: df cf rjmp .-66 ; 0x1fa72 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fab4: 8b e6 ldi r24, 0x6B ; 107 1fab6: 9b e5 ldi r25, 0x5B ; 91 1fab8: ef cf rjmp .-34 ; 0x1fa98 #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); 1faba: 88 ef ldi r24, 0xF8 ; 248 1fabc: 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); 1fabe: 0e 94 3c 6d call 0xda78 ; 0xda78 1fac2: ec 01 movw r28, r24 1fac4: 8c ee ldi r24, 0xEC ; 236 1fac6: 95 e5 ldi r25, 0x55 ; 85 1fac8: 0e 94 3c 6d call 0xda78 ; 0xda78 1facc: 22 e0 ldi r18, 0x02 ; 2 1face: 4b e5 ldi r20, 0x5B ; 91 1fad0: 5c ef ldi r21, 0xFC ; 252 1fad2: be 01 movw r22, r28 1fad4: 0f 94 ec 94 call 0x329d8 ; 0x329d8 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1fad8: 0f 94 31 93 call 0x32662 ; 0x32662 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1fadc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fae0: 8f 5f subi r24, 0xFF ; 255 1fae2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fae6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1faea: 8f 5f subi r24, 0xFF ; 255 1faec: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1faf0: 68 cf rjmp .-304 ; 0x1f9c2 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); 1faf2: 84 ee ldi r24, 0xE4 ; 228 1faf4: 95 e5 ldi r25, 0x55 ; 85 1faf6: e3 cf rjmp .-58 ; 0x1fabe lcd_fsensor_actionNA_set(); } } MENU_END(); } 1faf8: df 91 pop r29 1fafa: cf 91 pop r28 1fafc: 08 95 ret 0001fafe : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 1fafe: 86 ed ldi r24, 0xD6 ; 214 1fb00: 9e e0 ldi r25, 0x0E ; 14 1fb02: 0f 94 7d a0 call 0x340fa ; 0x340fa if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fb06: 61 e0 ldi r22, 0x01 ; 1 1fb08: 82 30 cpi r24, 0x02 ; 2 1fb0a: 09 f0 breq .+2 ; 0x1fb0e 1fb0c: 62 e0 ldi r22, 0x02 ; 2 1fb0e: 86 ed ldi r24, 0xD6 ; 214 1fb10: 9e e0 ldi r25, 0x0E ; 14 1fb12: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001fb16 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 1fb16: 8e ec ldi r24, 0xCE ; 206 1fb18: 9e e0 ldi r25, 0x0E ; 14 1fb1a: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fb1e: 60 e0 ldi r22, 0x00 ; 0 1fb20: 81 30 cpi r24, 0x01 ; 1 1fb22: 09 f0 breq .+2 ; 0x1fb26 1fb24: 61 e0 ldi r22, 0x01 ; 1 1fb26: 8e ec ldi r24, 0xCE ; 206 1fb28: 9e e0 ldi r25, 0x0E ; 14 1fb2a: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001fb2e : 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); 1fb2e: 8f ea ldi r24, 0xAF ; 175 1fb30: 9f e0 ldi r25, 0x0F ; 15 1fb32: 0f 94 7d a0 call 0x340fa ; 0x340fa temp_cal_active = !temp_cal_active; 1fb36: 61 e0 ldi r22, 0x01 ; 1 1fb38: 81 11 cpse r24, r1 1fb3a: 60 e0 ldi r22, 0x00 ; 0 1fb3c: 8f ea ldi r24, 0xAF ; 175 1fb3e: 9f e0 ldi r25, 0x0F ; 15 1fb40: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0001fb44 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1fb44: 89 e0 ldi r24, 0x09 ; 9 1fb46: 9f e0 ldi r25, 0x0F ; 15 1fb48: 0f 94 7d a0 call 0x340fa ; 0x340fa switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1fb4c: 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) { 1fb4e: 88 23 and r24, r24 1fb50: 21 f0 breq .+8 ; 0x1fb5a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1fb52: 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) { 1fb54: 81 30 cpi r24, 0x01 ; 1 1fb56: 09 f0 breq .+2 ; 0x1fb5a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1fb58: 60 e0 ldi r22, 0x00 ; 0 1fb5a: 89 e0 ldi r24, 0x09 ; 9 1fb5c: 9f e0 ldi r25, 0x0F ; 15 1fb5e: 0f 94 a1 a0 call 0x34142 ; 0x34142 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1fb62: 81 e0 ldi r24, 0x01 ; 1 1fb64: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } 1fb68: 08 95 ret 0001fb6a : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 1fb6a: 87 ea ldi r24, 0xA7 ; 167 1fb6c: 9c e0 ldi r25, 0x0C ; 12 1fb6e: 0f 94 7d a0 call 0x340fa ; 0x340fa if (eeprom_setting != 0) 1fb72: 81 11 cpse r24, r1 1fb74: 05 c0 rjmp .+10 ; 0x1fb80 return false; switch(eFilamentAction) { 1fb76: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1fb7a: 81 50 subi r24, 0x01 ; 1 1fb7c: 88 30 cpi r24, 0x08 ; 8 1fb7e: 10 f0 brcs .+4 ; 0x1fb84 #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; 1fb80: 80 e0 ldi r24, 0x00 ; 0 1fb82: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 1fb84: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 1fb86: 08 95 ret 0001fb88 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1fb88: 8c ea ldi r24, 0xAC ; 172 1fb8a: 9c e0 ldi r25, 0x0C ; 12 1fb8c: 0f 94 7d a0 call 0x340fa ; 0x340fa if (current_state) 1fb90: 88 23 and r24, r24 1fb92: 99 f0 breq .+38 ; 0x1fbba StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1fb94: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1fb98: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 1fb9c: 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)); 1fba0: 8c ea ldi r24, 0xAC ; 172 1fba2: 9c e0 ldi r25, 0x0C ; 12 1fba4: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fba8: 61 e0 ldi r22, 0x01 ; 1 1fbaa: 81 11 cpse r24, r1 1fbac: 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); 1fbae: 8c ea ldi r24, 0xAC ; 172 1fbb0: 9c e0 ldi r25, 0x0C ; 12 1fbb2: 0f 94 c5 a0 call 0x3418a ; 0x3418a { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 1fbb6: 0d 94 36 41 jmp 0x2826c ; 0x2826c { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1fbba: 0f 94 3b 63 call 0x2c676 ; 0x2c676 1fbbe: f0 cf rjmp .-32 ; 0x1fba0 0001fbc0 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1fbc0: 81 e0 ldi r24, 0x01 ; 1 1fbc2: 90 91 84 16 lds r25, 0x1684 ; 0x801684 1fbc6: 91 11 cpse r25, r1 1fbc8: 80 e0 ldi r24, 0x00 ; 0 1fbca: 0c 94 ab 6e jmp 0xdd56 ; 0xdd56 0001fbce : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1fbce: 0d 94 dc 52 jmp 0x2a5b8 ; 0x2a5b8 0001fbd2 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1fbd2: 0e 94 b2 6a call 0xd564 ; 0xd564 lcd_status_message_idx = 0; // Re-draw message from beginning 1fbd6: 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); 1fbda: 20 e0 ldi r18, 0x00 ; 0 1fbdc: 41 e0 ldi r20, 0x01 ; 1 1fbde: 70 e0 ldi r23, 0x00 ; 0 1fbe0: 60 e0 ldi r22, 0x00 ; 0 1fbe2: 81 ec ldi r24, 0xC1 ; 193 1fbe4: 97 e3 ldi r25, 0x37 ; 55 1fbe6: 0f 94 87 93 call 0x3270e ; 0x3270e menu_depth = 0; 1fbea: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 1fbee: 10 92 62 03 sts 0x0362, r1 ; 0x800362 } 1fbf2: 08 95 ret 0001fbf4 : } } #if (LANG_MODE != 0) void lcd_language() { 1fbf4: cf 93 push r28 1fbf6: df 93 push r29 lcd_update_enable(true); 1fbf8: 81 e0 ldi r24, 0x01 ; 1 1fbfa: 0e 94 4b 6a call 0xd496 ; 0xd496 menu_goto(lcd_language_menu, 0, true, true); 1fbfe: 21 e0 ldi r18, 0x01 ; 1 1fc00: 41 e0 ldi r20, 0x01 ; 1 1fc02: 70 e0 ldi r23, 0x00 ; 0 1fc04: 60 e0 ldi r22, 0x00 ; 0 1fc06: 85 e1 ldi r24, 0x15 ; 21 1fc08: 97 e3 ldi r25, 0x37 ; 55 1fc0a: 0f 94 87 93 call 0x3270e ; 0x3270e 1fc0e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1fc12: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 1fc16: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 1fc1a: 0e 94 30 6c call 0xd860 ; 0xd860 1fc1e: c1 5c subi r28, 0xC1 ; 193 1fc20: d7 43 sbci r29, 0x37 ; 55 1fc22: 39 f0 breq .+14 ; 0x1fc32 1fc24: 81 11 cpse r24, r1 1fc26: 07 c0 rjmp .+14 ; 0x1fc36 { delay_keep_alive(50); 1fc28: 82 e3 ldi r24, 0x32 ; 50 1fc2a: 90 e0 ldi r25, 0x00 ; 0 1fc2c: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 1fc30: f0 cf rjmp .-32 ; 0x1fc12 } if (lang_is_selected()) 1fc32: 88 23 and r24, r24 1fc34: 21 f0 breq .+8 ; 0x1fc3e lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1fc36: df 91 pop r29 1fc38: 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(); 1fc3a: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 else lang_select(LANG_ID_PRI); 1fc3e: 80 e0 ldi r24, 0x00 ; 0 } 1fc40: df 91 pop r29 1fc42: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1fc44: 0c 94 d0 6c jmp 0xd9a0 ; 0xd9a0 0001fc48 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 1fc48: 61 e0 ldi r22, 0x01 ; 1 1fc4a: 8d e1 ldi r24, 0x1D ; 29 1fc4c: 99 e9 ldi r25, 0x99 ; 153 1fc4e: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 1fc52: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 0001fc56 : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 1fc56: 61 e0 ldi r22, 0x01 ; 1 1fc58: 87 e1 ldi r24, 0x17 ; 23 1fc5a: 99 e9 ldi r25, 0x99 ; 153 1fc5c: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 1fc60: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 0001fc64 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 1fc64: 61 e0 ldi r22, 0x01 ; 1 1fc66: 83 e1 ldi r24, 0x13 ; 19 1fc68: 99 e9 ldi r25, 0x99 ; 153 1fc6a: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 1fc6e: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 0001fc72 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 1fc72: 61 e0 ldi r22, 0x01 ; 1 1fc74: 8f e0 ldi r24, 0x0F ; 15 1fc76: 99 e9 ldi r25, 0x99 ; 153 1fc78: 0e 94 3a 7d call 0xfa74 ; 0xfa74 lcd_return_to_status(); 1fc7c: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 0001fc80 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fc80: 0f 94 5d 93 call 0x326ba ; 0x326ba 1fc84: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fc88: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fc8c: 84 30 cpi r24, 0x04 ; 4 1fc8e: a8 f5 brcc .+106 ; 0x1fcfa 1fc90: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1fc94: 88 ef ldi r24, 0xF8 ; 248 1fc96: 9d e3 ldi r25, 0x3D ; 61 1fc98: 0e 94 3c 6d call 0xda78 ; 0xda78 1fc9c: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1fca0: 82 e4 ldi r24, 0x42 ; 66 1fca2: 9e e4 ldi r25, 0x4E ; 78 1fca4: 0e 94 3c 6d call 0xda78 ; 0xda78 1fca8: 6f e9 ldi r22, 0x9F ; 159 1fcaa: 77 e3 ldi r23, 0x37 ; 55 1fcac: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1fcb0: 89 e3 ldi r24, 0x39 ; 57 1fcb2: 9e e4 ldi r25, 0x4E ; 78 1fcb4: 0e 94 3c 6d call 0xda78 ; 0xda78 1fcb8: 6b e9 ldi r22, 0x9B ; 155 1fcba: 78 e3 ldi r23, 0x38 ; 56 1fcbc: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1fcc0: 80 e3 ldi r24, 0x30 ; 48 1fcc2: 9e e4 ldi r25, 0x4E ; 78 1fcc4: 0e 94 3c 6d call 0xda78 ; 0xda78 1fcc8: 6f e2 ldi r22, 0x2F ; 47 1fcca: 78 e3 ldi r23, 0x38 ; 56 1fccc: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1fcd0: 85 e2 ldi r24, 0x25 ; 37 1fcd2: 9e e4 ldi r25, 0x4E ; 78 1fcd4: 0e 94 3c 6d call 0xda78 ; 0xda78 1fcd8: 61 e0 ldi r22, 0x01 ; 1 1fcda: 77 e3 ldi r23, 0x37 ; 55 1fcdc: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_END(); 1fce0: 0f 94 31 93 call 0x32662 ; 0x32662 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fce4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fce8: 8f 5f subi r24, 0xFF ; 255 1fcea: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fcee: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fcf2: 8f 5f subi r24, 0xFF ; 255 1fcf4: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fcf8: c7 cf rjmp .-114 ; 0x1fc88 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(); } 1fcfa: 08 95 ret 0001fcfc : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fcfc: 0f 94 5d 93 call 0x326ba ; 0x326ba 1fd00: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fd04: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd08: 84 30 cpi r24, 0x04 ; 4 1fd0a: 68 f5 brcc .+90 ; 0x1fd66 1fd0c: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1fd10: 8a e5 ldi r24, 0x5A ; 90 1fd12: 9e e3 ldi r25, 0x3E ; 62 1fd14: 0e 94 3c 6d call 0xda78 ; 0xda78 1fd18: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 1fd1c: 82 e8 ldi r24, 0x82 ; 130 1fd1e: 99 e4 ldi r25, 0x49 ; 73 1fd20: 0e 94 3c 6d call 0xda78 ; 0xda78 1fd24: 6d ea ldi r22, 0xAD ; 173 1fd26: 77 e3 ldi r23, 0x37 ; 55 1fd28: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 1fd2c: 8a e7 ldi r24, 0x7A ; 122 1fd2e: 99 e4 ldi r25, 0x49 ; 73 1fd30: 0e 94 3c 6d call 0xda78 ; 0xda78 1fd34: 67 e9 ldi r22, 0x97 ; 151 1fd36: 78 e3 ldi r23, 0x38 ; 56 1fd38: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 1fd3c: 8e eb ldi r24, 0xBE ; 190 1fd3e: 99 e4 ldi r25, 0x49 ; 73 1fd40: 0e 94 3c 6d call 0xda78 ; 0xda78 1fd44: 61 eb ldi r22, 0xB1 ; 177 1fd46: 77 e3 ldi r23, 0x37 ; 55 1fd48: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_END(); 1fd4c: 0f 94 31 93 call 0x32662 ; 0x32662 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fd50: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd54: 8f 5f subi r24, 0xFF ; 255 1fd56: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fd5a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fd5e: 8f 5f subi r24, 0xFF ; 255 1fd60: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fd64: cf cf rjmp .-98 ; 0x1fd04 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(); } 1fd66: 08 95 ret 0001fd68 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 1fd68: ef 92 push r14 1fd6a: ff 92 push r15 1fd6c: 0f 93 push r16 1fd6e: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 1fd70: 80 91 71 03 lds r24, 0x0371 ; 0x800371 1fd74: 81 11 cpse r24, r1 1fd76: 35 c0 rjmp .+106 ; 0x1fde2 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 1fd78: 80 ec ldi r24, 0xC0 ; 192 1fd7a: 9f e0 ldi r25, 0x0F ; 15 1fd7c: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fd80: 81 30 cpi r24, 0x01 ; 1 1fd82: 61 f5 brne .+88 ; 0x1fddc { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 1fd84: 8f eb ldi r24, 0xBF ; 191 1fd86: 9f e0 ldi r25, 0x0F ; 15 1fd88: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fd8c: 08 2e mov r0, r24 1fd8e: 00 0c add r0, r0 1fd90: 99 0b sbc r25, r25 1fd92: 90 93 73 03 sts 0x0373, r25 ; 0x800373 1fd96: 80 93 72 03 sts 0x0372, r24 ; 0x800372 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 1fd9a: 8e eb ldi r24, 0xBE ; 190 1fd9c: 9f e0 ldi r25, 0x0F ; 15 1fd9e: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fda2: 08 2e mov r0, r24 1fda4: 00 0c add r0, r0 1fda6: 99 0b sbc r25, r25 1fda8: 90 93 75 03 sts 0x0375, r25 ; 0x800375 1fdac: 80 93 74 03 sts 0x0374, r24 ; 0x800374 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 1fdb0: 8d eb ldi r24, 0xBD ; 189 1fdb2: 9f e0 ldi r25, 0x0F ; 15 1fdb4: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fdb8: 08 2e mov r0, r24 1fdba: 00 0c add r0, r0 1fdbc: 99 0b sbc r25, r25 1fdbe: 90 93 77 03 sts 0x0377, r25 ; 0x800377 1fdc2: 80 93 76 03 sts 0x0376, r24 ; 0x800376 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1fdc6: 8c eb ldi r24, 0xBC ; 188 1fdc8: 9f e0 ldi r25, 0x0F ; 15 1fdca: 0f 94 7d a0 call 0x340fa ; 0x340fa 1fdce: 08 2e mov r0, r24 1fdd0: 00 0c add r0, r0 1fdd2: 99 0b sbc r25, r25 1fdd4: 90 93 79 03 sts 0x0379, r25 ; 0x800379 1fdd8: 80 93 78 03 sts 0x0378, r24 ; 0x800378 } _md->status = 1; 1fddc: 81 e0 ldi r24, 0x01 ; 1 1fdde: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } MENU_BEGIN(); 1fde2: 0f 94 5d 93 call 0x326ba ; 0x326ba 1fde6: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fdea: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fdee: 84 30 cpi r24, 0x04 ; 4 1fdf0: 08 f0 brcs .+2 ; 0x1fdf4 1fdf2: 6e c0 rjmp .+220 ; 0x1fed0 1fdf4: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1fdf8: 0f 94 dd 91 call 0x323ba ; 0x323ba 1fdfc: 88 23 and r24, r24 1fdfe: e9 f0 breq .+58 ; 0x1fe3a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fe00: 60 91 72 03 lds r22, 0x0372 ; 0x800372 1fe04: 8f eb ldi r24, 0xBF ; 191 1fe06: 9f e0 ldi r25, 0x0F ; 15 1fe08: 0f 94 a1 a0 call 0x34142 ; 0x34142 1fe0c: 60 91 76 03 lds r22, 0x0376 ; 0x800376 1fe10: 8d eb ldi r24, 0xBD ; 189 1fe12: 9f e0 ldi r25, 0x0F ; 15 1fe14: 0f 94 a1 a0 call 0x34142 ; 0x34142 1fe18: 60 91 78 03 lds r22, 0x0378 ; 0x800378 1fe1c: 8c eb ldi r24, 0xBC ; 188 1fe1e: 9f e0 ldi r25, 0x0F ; 15 1fe20: 0f 94 a1 a0 call 0x34142 ; 0x34142 1fe24: 60 91 74 03 lds r22, 0x0374 ; 0x800374 1fe28: 8e eb ldi r24, 0xBE ; 190 1fe2a: 9f e0 ldi r25, 0x0F ; 15 1fe2c: 0f 94 a1 a0 call 0x34142 ; 0x34142 1fe30: 61 e0 ldi r22, 0x01 ; 1 1fe32: 80 ec ldi r24, 0xC0 ; 192 1fe34: 9f e0 ldi r25, 0x0F ; 15 1fe36: 0f 94 a1 a0 call 0x34142 ; 0x34142 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)); 1fe3a: 86 e7 ldi r24, 0x76 ; 118 1fe3c: 90 e4 ldi r25, 0x40 ; 64 1fe3e: 0e 94 3c 6d call 0xda78 ; 0xda78 1fe42: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fe46: 8d e9 ldi r24, 0x9D ; 157 1fe48: 9c e4 ldi r25, 0x4C ; 76 1fe4a: 0e 94 3c 6d call 0xda78 ; 0xda78 1fe4e: f1 2c mov r15, r1 1fe50: e1 2c mov r14, r1 1fe52: 04 e6 ldi r16, 0x64 ; 100 1fe54: 10 e0 ldi r17, 0x00 ; 0 1fe56: 2c e9 ldi r18, 0x9C ; 156 1fe58: 3f ef ldi r19, 0xFF ; 255 1fe5a: 40 e1 ldi r20, 0x10 ; 16 1fe5c: 62 e7 ldi r22, 0x72 ; 114 1fe5e: 73 e0 ldi r23, 0x03 ; 3 1fe60: 0f 94 ad 93 call 0x3275a ; 0x3275a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fe64: 8c e8 ldi r24, 0x8C ; 140 1fe66: 9c e4 ldi r25, 0x4C ; 76 1fe68: 0e 94 3c 6d call 0xda78 ; 0xda78 1fe6c: 2c e9 ldi r18, 0x9C ; 156 1fe6e: 3f ef ldi r19, 0xFF ; 255 1fe70: 40 e1 ldi r20, 0x10 ; 16 1fe72: 64 e7 ldi r22, 0x74 ; 116 1fe74: 73 e0 ldi r23, 0x03 ; 3 1fe76: 0f 94 ad 93 call 0x3275a ; 0x3275a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fe7a: 8b e7 ldi r24, 0x7B ; 123 1fe7c: 9c e4 ldi r25, 0x4C ; 76 1fe7e: 0e 94 3c 6d call 0xda78 ; 0xda78 1fe82: 2c e9 ldi r18, 0x9C ; 156 1fe84: 3f ef ldi r19, 0xFF ; 255 1fe86: 40 e1 ldi r20, 0x10 ; 16 1fe88: 66 e7 ldi r22, 0x76 ; 118 1fe8a: 73 e0 ldi r23, 0x03 ; 3 1fe8c: 0f 94 ad 93 call 0x3275a ; 0x3275a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fe90: 8a e6 ldi r24, 0x6A ; 106 1fe92: 9c e4 ldi r25, 0x4C ; 76 1fe94: 0e 94 3c 6d call 0xda78 ; 0xda78 1fe98: 2c e9 ldi r18, 0x9C ; 156 1fe9a: 3f ef ldi r19, 0xFF ; 255 1fe9c: 40 e1 ldi r20, 0x10 ; 16 1fe9e: 68 e7 ldi r22, 0x78 ; 120 1fea0: 73 e0 ldi r23, 0x03 ; 3 1fea2: 0f 94 ad 93 call 0x3275a ; 0x3275a MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 1fea6: 89 e1 ldi r24, 0x19 ; 25 1fea8: 9c e3 ldi r25, 0x3C ; 60 1feaa: 0e 94 3c 6d call 0xda78 ; 0xda78 1feae: 6d ec ldi r22, 0xCD ; 205 1feb0: 77 e3 ldi r23, 0x37 ; 55 1feb2: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_END(); 1feb6: 0f 94 31 93 call 0x32662 ; 0x32662 _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(); 1feba: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1febe: 8f 5f subi r24, 0xFF ; 255 1fec0: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fec4: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fec8: 8f 5f subi r24, 0xFF ; 255 1feca: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fece: 8d cf rjmp .-230 ; 0x1fdea 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(); } 1fed0: 1f 91 pop r17 1fed2: 0f 91 pop r16 1fed4: ff 90 pop r15 1fed6: ef 90 pop r14 1fed8: 08 95 ret 0001feda : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 1feda: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 1fede: 8e ea ldi r24, 0xAE ; 174 1fee0: 9c e4 ldi r25, 0x4C ; 76 1fee2: 0e 94 3c 6d call 0xda78 ; 0xda78 1fee6: ac 01 movw r20, r24 1fee8: 60 e0 ldi r22, 0x00 ; 0 1feea: 80 e0 ldi r24, 0x00 ; 0 1feec: 0e 94 1a 6a call 0xd434 ; 0xd434 pid_temp += lcd_encoder; 1fef0: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1fef4: 90 91 4f 02 lds r25, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1fef8: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1fefc: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1ff00: 82 0f add r24, r18 1ff02: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 1ff04: 82 33 cpi r24, 0x32 ; 50 1ff06: 21 e0 ldi r18, 0x01 ; 1 1ff08: 92 07 cpc r25, r18 1ff0a: 50 f1 brcs .+84 ; 0x1ff60 1ff0c: 81 e3 ldi r24, 0x31 ; 49 1ff0e: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 1ff10: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1ff14: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.409> lcd_encoder = 0; 1ff18: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1ff1c: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_set_cursor(1, 2); 1ff20: 62 e0 ldi r22, 0x02 ; 2 1ff22: 81 e0 ldi r24, 0x01 ; 1 1ff24: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%3u"), pid_temp); 1ff28: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.409+0x1> 1ff2c: 8f 93 push r24 1ff2e: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.409> 1ff32: 8f 93 push r24 1ff34: 86 e7 ldi r24, 0x76 ; 118 1ff36: 98 e9 ldi r25, 0x98 ; 152 1ff38: 9f 93 push r25 1ff3a: 8f 93 push r24 1ff3c: 0e 94 df 69 call 0xd3be ; 0xd3be if (lcd_clicked()) { 1ff40: 0e 94 23 6c call 0xd846 ; 0xd846 1ff44: 0f 90 pop r0 1ff46: 0f 90 pop r0 1ff48: 0f 90 pop r0 1ff4a: 0f 90 pop r0 1ff4c: 88 23 and r24, r24 1ff4e: 71 f0 breq .+28 ; 0x1ff6c lcd_commands_type = LcdCommands::PidExtruder; 1ff50: 83 e0 ldi r24, 0x03 ; 3 1ff52: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 1ff56: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_update(2); 1ff5a: 82 e0 ldi r24, 0x02 ; 2 1ff5c: 0c 94 cd 69 jmp 0xd39a ; 0xd39a { 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; 1ff60: 8e 31 cpi r24, 0x1E ; 30 1ff62: 91 05 cpc r25, r1 1ff64: a8 f6 brcc .-86 ; 0x1ff10 1ff66: 8e e1 ldi r24, 0x1E ; 30 1ff68: 90 e0 ldi r25, 0x00 ; 0 1ff6a: d2 cf rjmp .-92 ; 0x1ff10 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 1ff6c: 08 95 ret 0001ff6e : #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){ 1ff6e: cf 93 push r28 1ff70: df 93 push r29 1ff72: cd b7 in r28, 0x3d ; 61 1ff74: de b7 in r29, 0x3e ; 62 1ff76: 2f 97 sbiw r28, 0x0f ; 15 1ff78: 0f b6 in r0, 0x3f ; 63 1ff7a: f8 94 cli 1ff7c: de bf out 0x3e, r29 ; 62 1ff7e: 0f be out 0x3f, r0 ; 63 1ff80: cd bf out 0x3d, r28 ; 61 1ff82: fc 01 movw r30, r24 1ff84: de 01 movw r26, r28 1ff86: 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; 1ff88: 90 e0 ldi r25, 0x00 ; 0 1ff8a: 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); 1ff8c: 84 91 lpm r24, Z 1ff8e: 41 e0 ldi r20, 0x01 ; 1 1ff90: 49 0f add r20, r25 if( ! b ) 1ff92: 88 23 and r24, r24 1ff94: 29 f0 breq .+10 ; 0x1ffa0 break; dst[i] = b; 1ff96: 8d 93 st X+, r24 1ff98: 31 96 adiw r30, 0x01 ; 1 1ff9a: 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 1ff9c: 4d 30 cpi r20, 0x0D ; 13 1ff9e: b1 f7 brne .-20 ; 0x1ff8c uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 1ffa0: f9 01 movw r30, r18 1ffa2: e9 0f add r30, r25 1ffa4: f1 1d adc r31, r1 1ffa6: 8a e3 ldi r24, 0x3A ; 58 1ffa8: 80 83 st Z, r24 ++i; 1ffaa: 9f 5f subi r25, 0xFF ; 255 1ffac: f9 01 movw r30, r18 1ffae: e9 0f add r30, r25 1ffb0: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 1ffb2: 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 1ffb4: 9e 30 cpi r25, 0x0E ; 14 1ffb6: 19 f0 breq .+6 ; 0x1ffbe dst[i] = ' '; 1ffb8: 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 1ffba: 9f 5f subi r25, 0xFF ; 255 1ffbc: fb cf rjmp .-10 ; 0x1ffb4 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 1ffbe: 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 1ffc0: 7f 93 push r23 1ffc2: 6f 93 push r22 1ffc4: 3f 93 push r19 1ffc6: 2f 93 push r18 1ffc8: 8b e5 ldi r24, 0x5B ; 91 1ffca: 96 e9 ldi r25, 0x96 ; 150 1ffcc: 9f 93 push r25 1ffce: 8f 93 push r24 1ffd0: 0e 94 df 69 call 0xd3be ; 0xd3be 1ffd4: 0f 90 pop r0 1ffd6: 0f 90 pop r0 1ffd8: 0f 90 pop r0 1ffda: 0f 90 pop r0 1ffdc: 0f 90 pop r0 1ffde: 0f 90 pop r0 } 1ffe0: 2f 96 adiw r28, 0x0f ; 15 1ffe2: 0f b6 in r0, 0x3f ; 63 1ffe4: f8 94 cli 1ffe6: de bf out 0x3e, r29 ; 62 1ffe8: 0f be out 0x3f, r0 ; 63 1ffea: cd bf out 0x3d, r28 ; 61 1ffec: df 91 pop r29 1ffee: cf 91 pop r28 1fff0: 08 95 ret 0001fff2 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1fff2: af 92 push r10 1fff4: bf 92 push r11 1fff6: cf 92 push r12 1fff8: df 92 push r13 1fffa: ef 92 push r14 1fffc: ff 92 push r15 1fffe: 0f 93 push r16 20000: 1f 93 push r17 20002: cf 93 push r28 20004: df 93 push r29 20006: 00 d0 rcall .+0 ; 0x20008 20008: 00 d0 rcall .+0 ; 0x2000a 2000a: 1f 92 push r1 2000c: cd b7 in r28, 0x3d ; 61 2000e: 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)) || 20010: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20014: 81 11 cpse r24, r1 20016: 18 c0 rjmp .+48 ; 0x20048 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))) || 20018: 81 ea ldi r24, 0xA1 ; 161 2001a: 9d e0 ldi r25, 0x0D ; 13 2001c: 0f 94 7d a0 call 0x340fa ; 0x340fa 20020: 18 2f mov r17, r24 20022: 0e 94 a3 6f call 0xdf46 ; 0xdf46 20026: 88 23 and r24, r24 20028: 79 f0 breq .+30 ; 0x20048 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 2002a: 80 e1 ldi r24, 0x10 ; 16 2002c: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 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))) || 20030: 88 23 and r24, r24 20032: 51 f0 breq .+20 ; 0x20048 (!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))))) 20034: 2b e0 ldi r18, 0x0B ; 11 20036: 12 9f mul r17, r18 20038: c0 01 movw r24, r0 2003a: 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 2003c: 80 5b subi r24, 0xB0 ; 176 2003e: 92 4f sbci r25, 0xF2 ; 242 20040: 0f 94 8b a0 call 0x34116 ; 0x34116 } 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)) || 20044: 89 2b or r24, r25 20046: f1 f4 brne .+60 ; 0x20084 (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) 20048: 80 91 64 03 lds r24, 0x0364 ; 0x800364 2004c: 88 23 and r24, r24 2004e: 71 f0 breq .+28 ; 0x2006c { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 20050: 81 ea ldi r24, 0xA1 ; 161 20052: 9d e0 ldi r25, 0x0D ; 13 20054: 0f 94 7d a0 call 0x340fa ; 0x340fa 20058: 2b e0 ldi r18, 0x0B ; 11 2005a: 82 9f mul r24, r18 2005c: c0 01 movw r24, r0 2005e: 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); 20060: 6f ef ldi r22, 0xFF ; 255 20062: 7f ef ldi r23, 0xFF ; 255 20064: 80 5b subi r24, 0xB0 ; 176 20066: 92 4f sbci r25, 0xF2 ; 242 20068: 0f 94 bf a0 call 0x3417e ; 0x3417e } // 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()); 2006c: 0e 94 23 6c call 0xd846 ; 0xd846 20070: 21 e0 ldi r18, 0x01 ; 1 20072: 81 11 cpse r24, r1 20074: 20 e0 ldi r18, 0x00 ; 0 20076: 41 e0 ldi r20, 0x01 ; 1 20078: 70 e0 ldi r23, 0x00 ; 0 2007a: 60 e0 ldi r22, 0x00 ; 0 2007c: 81 e5 ldi r24, 0x51 ; 81 2007e: 97 e3 ldi r25, 0x37 ; 55 20080: 0f 94 87 93 call 0x3270e ; 0x3270e } if (lcd_encoder) { 20084: 20 91 06 05 lds r18, 0x0506 ; 0x800506 20088: 30 91 07 05 lds r19, 0x0507 ; 0x800507 2008c: 21 15 cp r18, r1 2008e: 31 05 cpc r19, r1 20090: 59 f0 breq .+22 ; 0x200a8 menuData->reset = lcd_encoder > 0; 20092: 81 e0 ldi r24, 0x01 ; 1 20094: 12 16 cp r1, r18 20096: 13 06 cpc r1, r19 20098: 0c f0 brlt .+2 ; 0x2009c 2009a: 80 e0 ldi r24, 0x00 ; 0 2009c: 80 93 64 03 sts 0x0364, r24 ; 0x800364 lcd_encoder = 0; // Reset 200a0: 10 92 07 05 sts 0x0507, r1 ; 0x800507 200a4: 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)); 200a8: 81 ea ldi r24, 0xA1 ; 161 200aa: 9d e0 ldi r25, 0x0D ; 13 200ac: 0f 94 7d a0 call 0x340fa ; 0x340fa 200b0: 1b e0 ldi r17, 0x0B ; 11 200b2: 81 9f mul r24, r17 200b4: b0 01 movw r22, r0 200b6: 11 24 eor r1, r1 200b8: 67 5b subi r22, 0xB7 ; 183 200ba: 72 4f sbci r23, 0xF2 ; 242 200bc: 47 e0 ldi r20, 0x07 ; 7 200be: 50 e0 ldi r21, 0x00 ; 0 200c0: ce 01 movw r24, r28 200c2: 01 96 adiw r24, 0x01 ; 1 200c4: 7c 01 movw r14, r24 200c6: 0f 94 6d a0 call 0x340da ; 0x340da lcd_home(); 200ca: 0e 94 32 6a call 0xd464 ; 0xd464 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]; 200ce: 81 ea ldi r24, 0xA1 ; 161 200d0: 9d e0 ldi r25, 0x0D ; 13 200d2: 0f 94 7d a0 call 0x340fa ; 0x340fa 200d6: 81 9f mul r24, r17 200d8: c0 01 movw r24, r0 200da: 11 24 eor r1, r1 200dc: 80 5b subi r24, 0xB0 ; 176 200de: 92 4f sbci r25, 0xF2 ; 242 200e0: 0f 94 8b a0 call 0x34116 ; 0x34116 200e4: bc 01 movw r22, r24 200e6: 99 0f add r25, r25 200e8: 88 0b sbc r24, r24 200ea: 99 0b sbc r25, r25 200ec: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 200f0: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 200f4: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 200f8: 40 91 40 04 lds r20, 0x0440 ; 0x800440 200fc: 50 91 41 04 lds r21, 0x0441 ; 0x800441 20100: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 20104: d6 2e mov r13, r22 20106: c7 2e mov r12, r23 20108: b8 2e mov r11, r24 2010a: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 2010c: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20110: 0e e3 ldi r16, 0x3E ; 62 20112: 10 e2 ldi r17, 0x20 ; 32 20114: 81 11 cpse r24, r1 20116: 02 c0 rjmp .+4 ; 0x2011c 20118: 00 e2 ldi r16, 0x20 ; 32 2011a: 1e e3 ldi r17, 0x3E ; 62 2011c: 8b e4 ldi r24, 0x4B ; 75 2011e: 9e e4 ldi r25, 0x4E ; 78 20120: 0e 94 3c 6d call 0xda78 ; 0xda78 20124: 1f 92 push r1 20126: 0f 93 push r16 20128: 1f 92 push r1 2012a: 1f 93 push r17 2012c: af 92 push r10 2012e: bf 92 push r11 20130: cf 92 push r12 20132: df 92 push r13 20134: ff 92 push r15 20136: ef 92 push r14 20138: 9f 93 push r25 2013a: 8f 93 push r24 2013c: 0e 94 df 69 call 0xd3be ; 0xd3be 20140: 0f b6 in r0, 0x3f ; 63 20142: f8 94 cli 20144: de bf out 0x3e, r29 ; 62 20146: 0f be out 0x3f, r0 ; 63 20148: 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. } 2014a: 27 96 adiw r28, 0x07 ; 7 2014c: 0f b6 in r0, 0x3f ; 63 2014e: f8 94 cli 20150: de bf out 0x3e, r29 ; 62 20152: 0f be out 0x3f, r0 ; 63 20154: cd bf out 0x3d, r28 ; 61 20156: df 91 pop r29 20158: cf 91 pop r28 2015a: 1f 91 pop r17 2015c: 0f 91 pop r16 2015e: ff 90 pop r15 20160: ef 90 pop r14 20162: df 90 pop r13 20164: cf 90 pop r12 20166: bf 90 pop r11 20168: af 90 pop r10 2016a: 08 95 ret 0002016c : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2016c: cf 93 push r28 2016e: df 93 push r29 MENU_BEGIN(); 20170: 0f 94 5d 93 call 0x326ba ; 0x326ba 20174: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 20178: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 2017c: 84 30 cpi r24, 0x04 ; 4 2017e: 08 f0 brcs .+2 ; 0x20182 20180: 5c c0 rjmp .+184 ; 0x2023a 20182: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 20186: 0e 94 30 6c call 0xd860 ; 0xd860 2018a: 88 23 and r24, r24 2018c: 31 f0 breq .+12 ; 0x2019a 2018e: 88 ef ldi r24, 0xF8 ; 248 20190: 9d e3 ldi r25, 0x3D ; 61 20192: 0e 94 3c 6d call 0xda78 ; 0xda78 20196: 0f 94 28 96 call 0x32c50 ; 0x32c50 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2019a: 8e e6 ldi r24, 0x6E ; 110 2019c: 95 e6 ldi r25, 0x65 ; 101 2019e: 0e 94 46 6c call 0xd88c ; 0xd88c 201a2: 0f 94 0b 93 call 0x32616 ; 0x32616 201a6: 88 23 and r24, r24 201a8: 49 f0 breq .+18 ; 0x201bc #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 201aa: 80 e0 ldi r24, 0x00 ; 0 201ac: 0e 94 d0 6c call 0xd9a0 ; 0xd9a0 201b0: 81 11 cpse r24, r1 201b2: 43 c0 rjmp .+134 ; 0x2023a MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 201b4: df 91 pop r29 201b6: cf 91 pop r28 201b8: 0c 94 71 e1 jmp 0x1c2e2 ; 0x1c2e2 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(); 201bc: 0e 94 ad 6c call 0xd95a ; 0xd95a 201c0: 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) 201c2: c1 e0 ldi r28, 0x01 ; 1 201c4: cd 17 cp r28, r29 201c6: 60 f5 brcc .+88 ; 0x20220 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; 201c8: 80 e0 ldi r24, 0x00 ; 0 201ca: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 201cc: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 201ce: fc 01 movw r30, r24 201d0: 45 91 lpm r20, Z+ 201d2: 55 91 lpm r21, Z+ 201d4: 65 91 lpm r22, Z+ 201d6: 74 91 lpm r23, Z 201d8: 45 3a cpi r20, 0xA5 ; 165 201da: 5a 45 sbci r21, 0x5A ; 90 201dc: 64 4b sbci r22, 0xB4 ; 180 201de: 7b 44 sbci r23, 0x4B ; 75 201e0: 19 f0 breq .+6 ; 0x201e8 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; 201e2: 8f e3 ldi r24, 0x3F ; 63 201e4: 9f e3 ldi r25, 0x3F ; 63 201e6: 06 c0 rjmp .+12 ; 0x201f4 #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 201e8: fc 01 movw r30, r24 201ea: c2 13 cpse r28, r18 201ec: 10 c0 rjmp .+32 ; 0x2020e 201ee: 3a 96 adiw r30, 0x0a ; 10 201f0: 85 91 lpm r24, Z+ 201f2: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 201f4: 0e 94 46 6c call 0xd88c ; 0xd88c 201f8: 0f 94 0b 93 call 0x32616 ; 0x32616 201fc: 88 23 and r24, r24 201fe: 71 f0 breq .+28 ; 0x2021c #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 20200: 8c 2f mov r24, r28 20202: 0e 94 d0 6c call 0xd9a0 ; 0xd9a0 20206: 81 11 cpse r24, r1 20208: 18 c0 rjmp .+48 ; 0x2023a 2020a: 8c 2f mov r24, r28 2020c: d3 cf rjmp .-90 ; 0x201b4 table += pgm_read_word((uint16_t*)(table + 4)); 2020e: 34 96 adiw r30, 0x04 ; 4 20210: 45 91 lpm r20, Z+ 20212: 54 91 lpm r21, Z 20214: 84 0f add r24, r20 20216: 95 1f adc r25, r21 count++; 20218: 2f 5f subi r18, 0xFF ; 255 2021a: d9 cf rjmp .-78 ; 0x201ce } } 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) 2021c: cf 5f subi r28, 0xFF ; 255 2021e: d2 cf rjmp .-92 ; 0x201c4 #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 20220: 0f 94 31 93 call 0x32662 ; 0x32662 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 20224: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20228: 8f 5f subi r24, 0xFF ; 255 2022a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 2022e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 20232: 8f 5f subi r24, 0xFF ; 255 20234: 80 93 30 04 sts 0x0430, r24 ; 0x800430 20238: 9f cf rjmp .-194 ; 0x20178 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2023a: df 91 pop r29 2023c: cf 91 pop r28 2023e: 08 95 ret 00020240 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 20240: df 92 push r13 20242: ef 92 push r14 20244: ff 92 push r15 20246: 0f 93 push r16 20248: 1f 93 push r17 2024a: cf 93 push r28 2024c: df 93 push r29 2024e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20252: 0e 94 32 6a call 0xd464 ; 0xd464 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] ); 20256: c5 e8 ldi r28, 0x85 ; 133 20258: d3 e0 ldi r29, 0x03 ; 3 2025a: 8a 81 ldd r24, Y+2 ; 0x02 2025c: 9b 81 ldd r25, Y+3 ; 0x03 2025e: 2c e3 ldi r18, 0x3C ; 60 20260: f2 2e mov r15, r18 20262: f8 9e mul r15, r24 20264: 80 01 movw r16, r0 20266: f9 9e mul r15, r25 20268: 10 0d add r17, r0 2026a: 11 24 eor r1, r1 2026c: 8b e9 ldi r24, 0x9B ; 155 2026e: 9f e3 ldi r25, 0x3F ; 63 20270: 0e 94 3c 6d call 0xda78 ; 0xda78 20274: e8 2e mov r14, r24 20276: d9 2e mov r13, r25 20278: 88 81 ld r24, Y 2027a: 99 81 ldd r25, Y+1 ; 0x01 2027c: f8 9e mul r15, r24 2027e: e0 01 movw r28, r0 20280: f9 9e mul r15, r25 20282: d0 0d add r29, r0 20284: 11 24 eor r1, r1 20286: 88 ea ldi r24, 0xA8 ; 168 20288: 9f e3 ldi r25, 0x3F ; 63 2028a: 0e 94 3c 6d call 0xda78 ; 0xda78 2028e: 1f 93 push r17 20290: 0f 93 push r16 20292: df 92 push r13 20294: ef 92 push r14 20296: df 93 push r29 20298: cf 93 push r28 2029a: 9f 93 push r25 2029c: 8f 93 push r24 2029e: 81 ed ldi r24, 0xD1 ; 209 202a0: 95 e9 ldi r25, 0x95 ; 149 202a2: 9f 93 push r25 202a4: 8f 93 push r24 202a6: 0e 94 df 69 call 0xd3be ; 0xd3be menu_back_if_clicked(); 202aa: 8d b7 in r24, 0x3d ; 61 202ac: 9e b7 in r25, 0x3e ; 62 202ae: 0a 96 adiw r24, 0x0a ; 10 202b0: 0f b6 in r0, 0x3f ; 63 202b2: f8 94 cli 202b4: 9e bf out 0x3e, r25 ; 62 202b6: 0f be out 0x3f, r0 ; 63 202b8: 8d bf out 0x3d, r24 ; 61 } 202ba: df 91 pop r29 202bc: cf 91 pop r28 202be: 1f 91 pop r17 202c0: 0f 91 pop r16 202c2: ff 90 pop r15 202c4: ef 90 pop r14 202c6: 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(); 202c8: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 000202cc : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 202cc: cf 92 push r12 202ce: df 92 push r13 202d0: ef 92 push r14 202d2: ff 92 push r15 202d4: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 202d8: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 202dc: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 202e0: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 202e4: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 202e8: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 202ec: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 202f0: 6b 01 movw r12, r22 202f2: 8a e4 ldi r24, 0x4A ; 74 202f4: 96 e5 ldi r25, 0x56 ; 86 202f6: 0e 94 3c 6d call 0xda78 ; 0xda78 202fa: b6 01 movw r22, r12 202fc: 0e 94 b7 ff call 0x1ff6e ; 0x1ff6e lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 20300: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20304: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20308: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 2030c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20310: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 20314: 6b 01 movw r12, r22 20316: 8f e2 ldi r24, 0x2F ; 47 20318: 96 e5 ldi r25, 0x56 ; 86 2031a: 0e 94 3c 6d call 0xda78 ; 0xda78 2031e: b6 01 movw r22, r12 20320: 0e 94 b7 ff call 0x1ff6e ; 0x1ff6e #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 20324: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 20328: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 2032c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20330: 90 91 91 06 lds r25, 0x0691 ; 0x800691 20334: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 20338: 8c ed ldi r24, 0xDC ; 220 2033a: 9b e6 ldi r25, 0x6B ; 107 2033c: 0e 94 b7 ff call 0x1ff6e ; 0x1ff6e #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 20340: ff 90 pop r15 20342: ef 90 pop r14 20344: df 90 pop r13 20346: 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(); 20348: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 0002034c : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 2034c: bf 92 push r11 2034e: cf 92 push r12 20350: df 92 push r13 20352: ef 92 push r14 20354: ff 92 push r15 20356: 0f 93 push r16 20358: 1f 93 push r17 2035a: cf 93 push r28 2035c: df 93 push r29 2035e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 20362: 85 e6 ldi r24, 0x65 ; 101 20364: 9f e0 ldi r25, 0x0F ; 15 20366: 0f 94 7d a0 call 0x340fa ; 0x340fa 2036a: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 2036c: 81 e0 ldi r24, 0x01 ; 1 2036e: 9f e0 ldi r25, 0x0F ; 15 20370: 0f 94 8b a0 call 0x34116 ; 0x34116 20374: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 20378: c8 2e mov r12, r24 2037a: b9 2e mov r11, r25 lcd_home(); 2037c: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P(failStatsFmt, 20380: 88 ef ldi r24, 0xF8 ; 248 20382: 99 e4 ldi r25, 0x49 ; 73 20384: 0e 94 3c 6d call 0xda78 ; 0xda78 20388: e8 2e mov r14, r24 2038a: d9 2e mov r13, r25 2038c: 87 ee ldi r24, 0xE7 ; 231 2038e: 99 e4 ldi r25, 0x49 ; 73 20390: 0e 94 3c 6d call 0xda78 ; 0xda78 20394: 08 2f mov r16, r24 20396: f9 2e mov r15, r25 20398: 88 ef ldi r24, 0xF8 ; 248 2039a: 99 e4 ldi r25, 0x49 ; 73 2039c: 0e 94 3c 6d call 0xda78 ; 0xda78 203a0: ec 01 movw r28, r24 203a2: 81 ed ldi r24, 0xD1 ; 209 203a4: 99 e4 ldi r25, 0x49 ; 73 203a6: 0e 94 3c 6d call 0xda78 ; 0xda78 203aa: bf 92 push r11 203ac: cf 92 push r12 203ae: df 92 push r13 203b0: ef 92 push r14 203b2: ff 92 push r15 203b4: 0f 93 push r16 203b6: 1f 92 push r1 203b8: 1f 93 push r17 203ba: df 93 push r29 203bc: cf 93 push r28 203be: 9f 93 push r25 203c0: 8f 93 push r24 203c2: 88 e3 ldi r24, 0x38 ; 56 203c4: 96 e9 ldi r25, 0x96 ; 150 203c6: 9f 93 push r25 203c8: 8f 93 push r24 203ca: 0e 94 df 69 call 0xd3be ; 0xd3be _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 203ce: 8d b7 in r24, 0x3d ; 61 203d0: 9e b7 in r25, 0x3e ; 62 203d2: 0e 96 adiw r24, 0x0e ; 14 203d4: 0f b6 in r0, 0x3f ; 63 203d6: f8 94 cli 203d8: 9e bf out 0x3e, r25 ; 62 203da: 0f be out 0x3f, r0 ; 63 203dc: 8d bf out 0x3d, r24 ; 61 } 203de: df 91 pop r29 203e0: cf 91 pop r28 203e2: 1f 91 pop r17 203e4: 0f 91 pop r16 203e6: ff 90 pop r15 203e8: ef 90 pop r14 203ea: df 90 pop r13 203ec: cf 90 pop r12 203ee: 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(); 203f0: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 000203f4 : //! | 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() { 203f4: 8f 92 push r8 203f6: 9f 92 push r9 203f8: af 92 push r10 203fa: bf 92 push r11 203fc: cf 92 push r12 203fe: df 92 push r13 20400: ef 92 push r14 20402: ff 92 push r15 20404: 0f 93 push r16 20406: 1f 93 push r17 20408: cf 93 push r28 2040a: df 93 push r29 2040c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20410: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P( 20414: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 20418: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 2041c: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 20420: 98 2e mov r9, r24 20422: 89 2e mov r8, r25 20424: 8c ea ldi r24, 0xAC ; 172 20426: 99 e4 ldi r25, 0x49 ; 73 20428: 0e 94 3c 6d call 0xda78 ; 0xda78 2042c: b8 2e mov r11, r24 2042e: a9 2e mov r10, r25 20430: 80 ed ldi r24, 0xD0 ; 208 20432: 9e e0 ldi r25, 0x0E ; 14 20434: 0f 94 8b a0 call 0x34116 ; 0x34116 20438: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 2043c: d8 2e mov r13, r24 2043e: c9 2e mov r12, r25 20440: 8b e9 ldi r24, 0x9B ; 155 20442: 99 e4 ldi r25, 0x49 ; 73 20444: 0e 94 3c 6d call 0xda78 ; 0xda78 20448: f8 2e mov r15, r24 2044a: e9 2e mov r14, r25 2044c: 83 ed ldi r24, 0xD3 ; 211 2044e: 9e e0 ldi r25, 0x0E ; 14 20450: 0f 94 8b a0 call 0x34116 ; 0x34116 20454: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 20458: 18 2f mov r17, r24 2045a: 09 2f mov r16, r25 2045c: 8f e8 ldi r24, 0x8F ; 143 2045e: 99 e4 ldi r25, 0x49 ; 73 20460: 0e 94 3c 6d call 0xda78 ; 0xda78 20464: ec 01 movw r28, r24 20466: 87 ee ldi r24, 0xE7 ; 231 20468: 99 e4 ldi r25, 0x49 ; 73 2046a: 0e 94 3c 6d call 0xda78 ; 0xda78 2046e: 8f 92 push r8 20470: 9f 92 push r9 20472: af 92 push r10 20474: bf 92 push r11 20476: cf 92 push r12 20478: df 92 push r13 2047a: ef 92 push r14 2047c: ff 92 push r15 2047e: 0f 93 push r16 20480: 1f 93 push r17 20482: df 93 push r29 20484: cf 93 push r28 20486: 9f 93 push r25 20488: 8f 93 push r24 2048a: 8b e0 ldi r24, 0x0B ; 11 2048c: 96 e9 ldi r25, 0x96 ; 150 2048e: 9f 93 push r25 20490: 8f 93 push r24 20492: 0e 94 df 69 call 0xd3be ; 0xd3be ), _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(); 20496: 8d b7 in r24, 0x3d ; 61 20498: 9e b7 in r25, 0x3e ; 62 2049a: 40 96 adiw r24, 0x10 ; 16 2049c: 0f b6 in r0, 0x3f ; 63 2049e: f8 94 cli 204a0: 9e bf out 0x3e, r25 ; 62 204a2: 0f be out 0x3f, r0 ; 63 204a4: 8d bf out 0x3d, r24 ; 61 } 204a6: df 91 pop r29 204a8: cf 91 pop r28 204aa: 1f 91 pop r17 204ac: 0f 91 pop r16 204ae: ff 90 pop r15 204b0: ef 90 pop r14 204b2: df 90 pop r13 204b4: cf 90 pop r12 204b6: bf 90 pop r11 204b8: af 90 pop r10 204ba: 9f 90 pop r9 204bc: 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(); 204be: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 000204c2 : //! | 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() { 204c2: cf 92 push r12 204c4: df 92 push r13 204c6: ef 92 push r14 204c8: ff 92 push r15 204ca: 0f 93 push r16 204cc: 1f 93 push r17 204ce: cf 93 push r28 204d0: df 93 push r29 204d2: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 204d6: 0e 94 32 6a call 0xd464 ; 0xd464 " %-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) )); 204da: 8f ec ldi r24, 0xCF ; 207 204dc: 9e e0 ldi r25, 0x0E ; 14 204de: 0f 94 7d a0 call 0x340fa ; 0x340fa //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 204e2: 90 e0 ldi r25, 0x00 ; 0 204e4: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 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 3c 6d call 0xda78 ; 0xda78 204f4: f8 2e mov r15, r24 204f6: 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) ), 204f8: 82 ed ldi r24, 0xD2 ; 210 204fa: 9e e0 ldi r25, 0x0E ; 14 204fc: 0f 94 7d a0 call 0x340fa ; 0x340fa //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 20500: 90 e0 ldi r25, 0x00 ; 0 20502: 0e 94 9c f7 call 0x1ef38 ; 0x1ef38 20506: 18 2f mov r17, r24 20508: 09 2f mov r16, r25 2050a: 8f e8 ldi r24, 0x8F ; 143 2050c: 99 e4 ldi r25, 0x49 ; 73 2050e: 0e 94 3c 6d call 0xda78 ; 0xda78 20512: ec 01 movw r28, r24 20514: 81 ed ldi r24, 0xD1 ; 209 20516: 99 e4 ldi r25, 0x49 ; 73 20518: 0e 94 3c 6d call 0xda78 ; 0xda78 2051c: cf 92 push r12 2051e: df 92 push r13 20520: ef 92 push r14 20522: ff 92 push r15 20524: 0f 93 push r16 20526: 1f 93 push r17 20528: df 93 push r29 2052a: cf 93 push r28 2052c: 9f 93 push r25 2052e: 8f 93 push r24 20530: 8c ee ldi r24, 0xEC ; 236 20532: 95 e9 ldi r25, 0x95 ; 149 20534: 9f 93 push r25 20536: 8f 93 push r24 20538: 0e 94 df 69 call 0xd3be ; 0xd3be " %-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(); 2053c: 8d b7 in r24, 0x3d ; 61 2053e: 9e b7 in r25, 0x3e ; 62 20540: 0c 96 adiw r24, 0x0c ; 12 20542: 0f b6 in r0, 0x3f ; 63 20544: f8 94 cli 20546: 9e bf out 0x3e, r25 ; 62 20548: 0f be out 0x3f, r0 ; 63 2054a: 8d bf out 0x3d, r24 ; 61 } 2054c: df 91 pop r29 2054e: cf 91 pop r28 20550: 1f 91 pop r17 20552: 0f 91 pop r16 20554: ff 90 pop r15 20556: ef 90 pop r14 20558: df 90 pop r13 2055a: 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(); 2055c: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 00020560 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 20560: 81 30 cpi r24, 0x01 ; 1 20562: 21 f4 brne .+8 ; 0x2056c case STATE_ON: lcd_puts_P(_N(" 1")); 20564: 82 ed ldi r24, 0xD2 ; 210 20566: 9b e6 ldi r25, 0x6B ; 107 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 20568: 0c 94 f1 69 jmp 0xd3e2 ; 0xd3e2 2056c: 8e ec ldi r24, 0xCE ; 206 2056e: 9b e6 ldi r25, 0x6B ; 107 20570: fb cf rjmp .-10 ; 0x20568 00020572 : //! |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() { 20572: 2f 92 push r2 20574: 3f 92 push r3 20576: 4f 92 push r4 20578: 5f 92 push r5 2057a: 6f 92 push r6 2057c: 7f 92 push r7 2057e: 8f 92 push r8 20580: 9f 92 push r9 20582: af 92 push r10 20584: bf 92 push r11 20586: cf 92 push r12 20588: df 92 push r13 2058a: ef 92 push r14 2058c: ff 92 push r15 2058e: 0f 93 push r16 20590: 1f 93 push r17 20592: cf 93 push r28 20594: df 93 push r29 20596: cd b7 in r28, 0x3d ; 61 20598: de b7 in r29, 0x3e ; 62 2059a: a8 97 sbiw r28, 0x28 ; 40 2059c: 0f b6 in r0, 0x3f ; 63 2059e: f8 94 cli 205a0: de bf out 0x3e, r29 ; 62 205a2: 0f be out 0x3f, r0 ; 63 205a4: 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); 205a6: 48 e0 ldi r20, 0x08 ; 8 205a8: 50 e0 ldi r21, 0x00 ; 0 205aa: 65 ee ldi r22, 0xE5 ; 229 205ac: 7f e0 ldi r23, 0x0F ; 15 205ae: ce 01 movw r24, r28 205b0: 41 96 adiw r24, 0x11 ; 17 205b2: 0f 94 6d a0 call 0x340da ; 0x340da eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 205b6: 48 e0 ldi r20, 0x08 ; 8 205b8: 50 e0 ldi r21, 0x00 ; 0 205ba: 6d ed ldi r22, 0xDD ; 221 205bc: 7f e0 ldi r23, 0x0F ; 15 205be: ce 01 movw r24, r28 205c0: 09 96 adiw r24, 0x09 ; 9 205c2: 0f 94 6d a0 call 0x340da ; 0x340da eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 205c6: 48 e0 ldi r20, 0x08 ; 8 205c8: 50 e0 ldi r21, 0x00 ; 0 205ca: 65 ed ldi r22, 0xD5 ; 213 205cc: 7f e0 ldi r23, 0x0F ; 15 205ce: ce 01 movw r24, r28 205d0: 01 96 adiw r24, 0x01 ; 1 205d2: 0f 94 6d a0 call 0x340da ; 0x340da 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]; 205d6: 8d 84 ldd r8, Y+13 ; 0x0d 205d8: 9e 84 ldd r9, Y+14 ; 0x0e 205da: af 84 ldd r10, Y+15 ; 0x0f 205dc: b8 88 ldd r11, Y+16 ; 0x10 205de: ef e4 ldi r30, 0x4F ; 79 205e0: f9 e8 ldi r31, 0x89 ; 137 205e2: 25 91 lpm r18, Z+ 205e4: 35 91 lpm r19, Z+ 205e6: 45 91 lpm r20, Z+ 205e8: 54 91 lpm r21, Z 205ea: cd 80 ldd r12, Y+5 ; 0x05 205ec: de 80 ldd r13, Y+6 ; 0x06 205ee: ef 80 ldd r14, Y+7 ; 0x07 205f0: f8 84 ldd r15, Y+8 ; 0x08 205f2: e3 e5 ldi r30, 0x53 ; 83 205f4: f9 e8 ldi r31, 0x89 ; 137 205f6: 85 91 lpm r24, Z+ 205f8: 95 91 lpm r25, Z+ 205fa: a5 91 lpm r26, Z+ 205fc: b4 91 lpm r27, Z 205fe: 8d a3 std Y+37, r24 ; 0x25 20600: 9e a3 std Y+38, r25 ; 0x26 20602: af a3 std Y+39, r26 ; 0x27 20604: b8 a7 std Y+40, r27 ; 0x28 20606: 8d 89 ldd r24, Y+21 ; 0x15 20608: 9e 89 ldd r25, Y+22 ; 0x16 2060a: af 89 ldd r26, Y+23 ; 0x17 2060c: b8 8d ldd r27, Y+24 ; 0x18 2060e: 89 a3 std Y+33, r24 ; 0x21 20610: 9a a3 std Y+34, r25 ; 0x22 20612: ab a3 std Y+35, r26 ; 0x23 20614: bc a3 std Y+36, r27 ; 0x24 20616: c5 01 movw r24, r10 20618: b4 01 movw r22, r8 2061a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2061e: 2b 01 movw r4, r22 20620: 3c 01 movw r6, r24 20622: 2d a1 ldd r18, Y+37 ; 0x25 20624: 3e a1 ldd r19, Y+38 ; 0x26 20626: 4f a1 ldd r20, Y+39 ; 0x27 20628: 58 a5 ldd r21, Y+40 ; 0x28 2062a: c7 01 movw r24, r14 2062c: b6 01 movw r22, r12 2062e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 20632: 9b 01 movw r18, r22 20634: ac 01 movw r20, r24 20636: c3 01 movw r24, r6 20638: b2 01 movw r22, r4 2063a: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2063e: 29 a1 ldd r18, Y+33 ; 0x21 20640: 3a a1 ldd r19, Y+34 ; 0x22 20642: 4b a1 ldd r20, Y+35 ; 0x23 20644: 5c a1 ldd r21, Y+36 ; 0x24 20646: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2064a: 20 e0 ldi r18, 0x00 ; 0 2064c: 30 e0 ldi r19, 0x00 ; 0 2064e: 40 e9 ldi r20, 0x90 ; 144 20650: 50 e4 ldi r21, 0x40 ; 64 20652: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 20656: 1b 01 movw r2, r22 20658: 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]; 2065a: e7 e5 ldi r30, 0x57 ; 87 2065c: f9 e8 ldi r31, 0x89 ; 137 2065e: 25 91 lpm r18, Z+ 20660: 35 91 lpm r19, Z+ 20662: 45 91 lpm r20, Z+ 20664: 54 91 lpm r21, Z 20666: eb e5 ldi r30, 0x5B ; 91 20668: f9 e8 ldi r31, 0x89 ; 137 2066a: 45 90 lpm r4, Z+ 2066c: 55 90 lpm r5, Z+ 2066e: 65 90 lpm r6, Z+ 20670: 74 90 lpm r7, Z 20672: c5 01 movw r24, r10 20674: b4 01 movw r22, r8 20676: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2067a: 4b 01 movw r8, r22 2067c: 5c 01 movw r10, r24 2067e: a3 01 movw r20, r6 20680: 92 01 movw r18, r4 20682: c7 01 movw r24, r14 20684: b6 01 movw r22, r12 20686: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2068a: 9b 01 movw r18, r22 2068c: ac 01 movw r20, r24 2068e: c5 01 movw r24, r10 20690: b4 01 movw r22, r8 20692: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 20696: 29 a1 ldd r18, Y+33 ; 0x21 20698: 3a a1 ldd r19, Y+34 ; 0x22 2069a: 4b a1 ldd r20, Y+35 ; 0x23 2069c: 5c a1 ldd r21, Y+36 ; 0x24 2069e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 206a2: 20 e0 ldi r18, 0x00 ; 0 206a4: 30 e0 ldi r19, 0x00 ; 0 206a6: 40 e9 ldi r20, 0x90 ; 144 206a8: 50 e4 ldi r21, 0x40 ; 64 206aa: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 206ae: 6d 8f std Y+29, r22 ; 0x1d 206b0: 7e 8f std Y+30, r23 ; 0x1e 206b2: 8f 8f std Y+31, r24 ; 0x1f 206b4: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 206b6: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P(_N( 206ba: 83 e1 ldi r24, 0x13 ; 19 206bc: 9c e4 ldi r25, 0x4C ; 76 206be: 0e 94 3c 6d call 0xda78 ; 0xda78 206c2: d8 2e mov r13, r24 206c4: c9 2e mov r12, r25 206c6: 8c e0 ldi r24, 0x0C ; 12 206c8: 9c e4 ldi r25, 0x4C ; 76 206ca: 0e 94 3c 6d call 0xda78 ; 0xda78 206ce: f8 2e mov r15, r24 206d0: e9 2e mov r14, r25 206d2: 86 ef ldi r24, 0xF6 ; 246 206d4: 9b e4 ldi r25, 0x4B ; 75 206d6: 0e 94 3c 6d call 0xda78 ; 0xda78 206da: cf 92 push r12 206dc: df 92 push r13 206de: ef 92 push r14 206e0: ff 92 push r15 206e2: 20 e0 ldi r18, 0x00 ; 0 206e4: 34 e8 ldi r19, 0x84 ; 132 206e6: 3f 93 push r19 206e8: 2f 93 push r18 206ea: 9f 93 push r25 206ec: 8f 93 push r24 206ee: 8c e8 ldi r24, 0x8C ; 140 206f0: 9b e6 ldi r25, 0x6B ; 107 206f2: 9f 93 push r25 206f4: 8f 93 push r24 206f6: 0e 94 df 69 call 0xd3be ; 0xd3be _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 206fa: 62 e0 ldi r22, 0x02 ; 2 206fc: 8b e0 ldi r24, 0x0B ; 11 206fe: 0e 94 06 6a call 0xd40c ; 0xd40c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 20702: 0f b6 in r0, 0x3f ; 63 20704: f8 94 cli 20706: de bf out 0x3e, r29 ; 62 20708: 0f be out 0x3f, r0 ; 63 2070a: cd bf out 0x3d, r28 ; 61 2070c: 20 e0 ldi r18, 0x00 ; 0 2070e: 30 e0 ldi r19, 0x00 ; 0 20710: 48 e4 ldi r20, 0x48 ; 72 20712: 53 e4 ldi r21, 0x43 ; 67 20714: 62 2d mov r22, r2 20716: 73 2d mov r23, r3 20718: 80 2f mov r24, r16 2071a: 91 2f mov r25, r17 2071c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 20720: 87 ff sbrs r24, 7 20722: 51 c0 rjmp .+162 ; 0x207c6 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 20724: 1f 93 push r17 20726: 0f 93 push r16 20728: 3f 92 push r3 2072a: 2f 92 push r2 2072c: 84 e8 ldi r24, 0x84 ; 132 2072e: 9b e6 ldi r25, 0x6B ; 107 20730: 9f 93 push r25 20732: 8f 93 push r24 20734: 0e 94 df 69 call 0xd3be ; 0xd3be 20738: 0f 90 pop r0 2073a: 0f 90 pop r0 2073c: 0f 90 pop r0 2073e: 0f 90 pop r0 20740: 0f 90 pop r0 20742: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 20744: 63 e0 ldi r22, 0x03 ; 3 20746: 8b e0 ldi r24, 0x0B ; 11 20748: 0e 94 06 6a call 0xd40c ; 0xd40c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2074c: 1d 8d ldd r17, Y+29 ; 0x1d 2074e: 0e 8d ldd r16, Y+30 ; 0x1e 20750: ff 8c ldd r15, Y+31 ; 0x1f 20752: e8 a0 ldd r14, Y+32 ; 0x20 20754: 20 e0 ldi r18, 0x00 ; 0 20756: 30 e0 ldi r19, 0x00 ; 0 20758: 48 e4 ldi r20, 0x48 ; 72 2075a: 53 e4 ldi r21, 0x43 ; 67 2075c: d8 01 movw r26, r16 2075e: f7 01 movw r30, r14 20760: 6b 2f mov r22, r27 20762: 7a 2f mov r23, r26 20764: 8f 2f mov r24, r31 20766: 9e 2f mov r25, r30 20768: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2076c: 87 fd sbrc r24, 7 2076e: 32 c0 rjmp .+100 ; 0x207d4 20770: 8d ed ldi r24, 0xDD ; 221 20772: 9d e3 ldi r25, 0x3D ; 61 20774: 0e 94 3c 6d call 0xda78 ; 0xda78 20778: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 2077c: 0e 94 23 6c call 0xd846 ; 0xd846 20780: 88 23 and r24, r24 20782: 41 f0 breq .+16 ; 0x20794 menu_goto(lcd_menu_xyz_skew, 0, true); 20784: 20 e0 ldi r18, 0x00 ; 0 20786: 41 e0 ldi r20, 0x01 ; 1 20788: 70 e0 ldi r23, 0x00 ; 0 2078a: 60 e0 ldi r22, 0x00 ; 0 2078c: 85 e5 ldi r24, 0x55 ; 85 2078e: 97 e3 ldi r25, 0x37 ; 55 20790: 0f 94 87 93 call 0x3270e ; 0x3270e } 20794: a8 96 adiw r28, 0x28 ; 40 20796: 0f b6 in r0, 0x3f ; 63 20798: f8 94 cli 2079a: de bf out 0x3e, r29 ; 62 2079c: 0f be out 0x3f, r0 ; 63 2079e: cd bf out 0x3d, r28 ; 61 207a0: df 91 pop r29 207a2: cf 91 pop r28 207a4: 1f 91 pop r17 207a6: 0f 91 pop r16 207a8: ff 90 pop r15 207aa: ef 90 pop r14 207ac: df 90 pop r13 207ae: cf 90 pop r12 207b0: bf 90 pop r11 207b2: af 90 pop r10 207b4: 9f 90 pop r9 207b6: 8f 90 pop r8 207b8: 7f 90 pop r7 207ba: 6f 90 pop r6 207bc: 5f 90 pop r5 207be: 4f 90 pop r4 207c0: 3f 90 pop r3 207c2: 2f 90 pop r2 207c4: 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)); 207c6: 8d ed ldi r24, 0xDD ; 221 207c8: 9d e3 ldi r25, 0x3D ; 61 207ca: 0e 94 3c 6d call 0xda78 ; 0xda78 207ce: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 207d2: b8 cf rjmp .-144 ; 0x20744 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 207d4: ef 92 push r14 207d6: ff 92 push r15 207d8: 0f 93 push r16 207da: 1f 93 push r17 207dc: 84 e8 ldi r24, 0x84 ; 132 207de: 9b e6 ldi r25, 0x6B ; 107 207e0: 9f 93 push r25 207e2: 8f 93 push r24 207e4: 0e 94 df 69 call 0xd3be ; 0xd3be 207e8: 0f 90 pop r0 207ea: 0f 90 pop r0 207ec: 0f 90 pop r0 207ee: 0f 90 pop r0 207f0: 0f 90 pop r0 207f2: 0f 90 pop r0 207f4: c3 cf rjmp .-122 ; 0x2077c 000207f6 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 207f6: 8a ee ldi r24, 0xEA ; 234 207f8: 9a e6 ldi r25, 0x6A ; 106 207fa: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 000207fe : * 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) { 207fe: af 92 push r10 20800: bf 92 push r11 20802: cf 92 push r12 20804: df 92 push r13 20806: ef 92 push r14 20808: ff 92 push r15 2080a: 0f 93 push r16 2080c: 1f 93 push r17 2080e: cf 93 push r28 20810: df 93 push r29 20812: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 20814: 0e 94 ba 69 call 0xd374 ; 0xd374 * @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; 20818: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 2081a: 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; 2081c: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 2081e: 6f 2d mov r22, r15 20820: 80 e0 ldi r24, 0x00 ; 0 20822: 0e 94 06 6a call 0xd40c ; 0xd40c // 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) 20826: c6 01 movw r24, r12 20828: 0e 94 8d f7 call 0x1ef1a ; 0x1ef1a 2082c: 88 23 and r24, r24 2082e: 29 f0 breq .+10 ; 0x2083a 20830: 8f ef ldi r24, 0xFF ; 255 20832: c8 1a sub r12, r24 20834: d8 0a sbc r13, r24 20836: 09 f4 brne .+2 ; 0x2083a 20838: 49 c0 rjmp .+146 ; 0x208cc 2083a: c6 01 movw r24, r12 2083c: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 20840: 84 31 cpi r24, 0x14 ; 20 20842: 91 05 cpc r25, r1 20844: 10 f0 brcs .+4 ; 0x2084a 20846: 84 e1 ldi r24, 0x14 ; 20 20848: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 2084a: e6 01 movw r28, r12 2084c: c8 0f add r28, r24 2084e: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 20850: e3 e0 ldi r30, 0x03 ; 3 20852: fe 12 cpse r15, r30 20854: 0a c0 rjmp .+20 ; 0x2086a 20856: 84 31 cpi r24, 0x14 ; 20 20858: 41 f4 brne .+16 ; 0x2086a // 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; 2085a: fe 01 movw r30, r28 2085c: 84 91 lpm r24, Z 2085e: e1 2c mov r14, r1 if (multi_screen) 20860: 88 23 and r24, r24 20862: 19 f0 breq .+6 ; 0x2086a msgend = (msgend2 -= 2); 20864: 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; 20866: ee 24 eor r14, r14 20868: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 2086a: fe 01 movw r30, r28 2086c: 84 91 lpm r24, Z 2086e: 88 23 and r24, r24 20870: 09 f4 brne .+2 ; 0x20874 20872: 40 c0 rjmp .+128 ; 0x208f4 20874: ce 01 movw r24, r28 20876: 0e 94 8d f7 call 0x1ef1a ; 0x1ef1a 2087a: 81 11 cpse r24, r1 2087c: 3b c0 rjmp .+118 ; 0x208f4 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); 2087e: fe 01 movw r30, r28 20880: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 20882: 92 ed ldi r25, 0xD2 ; 210 20884: 98 0f add r25, r24 20886: 92 30 cpi r25, 0x02 ; 2 20888: a8 f1 brcs .+106 ; 0x208f4 2088a: 8c 32 cpi r24, 0x2C ; 44 2088c: 99 f1 breq .+102 ; 0x208f4 2088e: 96 ec ldi r25, 0xC6 ; 198 20890: 98 0f add r25, r24 20892: 92 30 cpi r25, 0x02 ; 2 20894: 78 f1 brcs .+94 ; 0x208f4 20896: 8f 33 cpi r24, 0x3F ; 63 20898: 69 f1 breq .+90 ; 0x208f4 2089a: 81 32 cpi r24, 0x21 ; 33 2089c: 59 f1 breq .+86 ; 0x208f4 2089e: 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)) 208a0: c0 16 cp r12, r16 208a2: d1 06 cpc r13, r17 208a4: 58 f4 brcc .+22 ; 0x208bc 208a6: 58 01 movw r10, r16 208a8: f1 e0 ldi r31, 0x01 ; 1 208aa: af 1a sub r10, r31 208ac: b1 08 sbc r11, r1 208ae: c5 01 movw r24, r10 208b0: 0e 94 8d f7 call 0x1ef1a ; 0x1ef1a 208b4: 81 11 cpse r24, r1 208b6: 1d c0 rjmp .+58 ; 0x208f2 -- msgend; 208b8: 85 01 movw r16, r10 208ba: f2 cf rjmp .-28 ; 0x208a0 if (msgend == msg) 208bc: c0 16 cp r12, r16 208be: d1 06 cpc r13, r17 208c0: c9 f0 breq .+50 ; 0x208f4 208c2: 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) { 208c4: f3 94 inc r15 208c6: 84 e0 ldi r24, 0x04 ; 4 208c8: f8 12 cpse r15, r24 208ca: a9 cf rjmp .-174 ; 0x2081e } lcd_print(c); } } if (multi_screen) { 208cc: ee 20 and r14, r14 208ce: f9 f0 breq .+62 ; 0x2090e // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 208d0: 48 e8 ldi r20, 0x88 ; 136 208d2: 63 e0 ldi r22, 0x03 ; 3 208d4: 83 e1 ldi r24, 0x13 ; 19 208d6: 0e 94 26 6a call 0xd44c ; 0xd44c } return multi_screen ? msgend : NULL; } 208da: ce 01 movw r24, r28 208dc: df 91 pop r29 208de: cf 91 pop r28 208e0: 1f 91 pop r17 208e2: 0f 91 pop r16 208e4: ff 90 pop r15 208e6: ef 90 pop r14 208e8: df 90 pop r13 208ea: cf 90 pop r12 208ec: bf 90 pop r11 208ee: af 90 pop r10 208f0: 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)) 208f2: 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) { 208f4: cc 16 cp r12, r28 208f6: dd 06 cpc r13, r29 208f8: 28 f7 brcc .-54 ; 0x208c4 char c = char(pgm_read_byte(msg)); 208fa: f6 01 movw r30, r12 208fc: 84 91 lpm r24, Z if (c == '\n') { 208fe: 8a 30 cpi r24, 0x0A ; 10 20900: 09 f3 breq .-62 ; 0x208c4 20902: 0e 94 b5 6a call 0xd56a ; 0xd56a -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 20906: ff ef ldi r31, 0xFF ; 255 20908: cf 1a sub r12, r31 2090a: df 0a sbc r13, r31 2090c: f3 cf rjmp .-26 ; 0x208f4 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 2090e: d0 e0 ldi r29, 0x00 ; 0 20910: c0 e0 ldi r28, 0x00 ; 0 20912: e3 cf rjmp .-58 ; 0x208da 00020914 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 20914: 89 e4 ldi r24, 0x49 ; 73 20916: 9b e4 ldi r25, 0x4B ; 75 20918: 0e 94 3c 6d call 0xda78 ; 0xda78 2091c: 0f 94 ff 03 call 0x207fe ; 0x207fe menu_back_if_clicked(); 20920: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 00020924 : } _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(); 20924: 0e 94 fa 6f call 0xdff4 ; 0xdff4 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 20928: 10 92 71 03 sts 0x0371, r1 ; 0x800371 } 2092c: 08 95 ret 0002092e : //! |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() { 2092e: cf 93 push r28 20930: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 20932: 87 e4 ldi r24, 0x47 ; 71 20934: 9c e4 ldi r25, 0x4C ; 76 20936: 0e 94 3c 6d call 0xda78 ; 0xda78 2093a: ac 01 movw r20, r24 2093c: 60 e0 ldi r22, 0x00 ; 0 2093e: 80 e0 ldi r24, 0x00 ; 0 20940: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 1, STR_SEPARATOR); 20944: 40 e0 ldi r20, 0x00 ; 0 20946: 54 e8 ldi r21, 0x84 ; 132 20948: 61 e0 ldi r22, 0x01 ; 1 2094a: 80 e0 ldi r24, 0x00 ; 0 2094c: 0e 94 1a 6a call 0xd434 ; 0xd434 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 20950: 62 e0 ldi r22, 0x02 ; 2 20952: 80 e0 ldi r24, 0x00 ; 0 20954: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20958: 85 ee ldi r24, 0xE5 ; 229 2095a: 9f e0 ldi r25, 0x0F ; 15 2095c: 0f 94 85 a0 call 0x3410a ; 0x3410a 20960: 9f 93 push r25 20962: 8f 93 push r24 20964: 7f 93 push r23 20966: 6f 93 push r22 20968: 1f 92 push r1 2096a: 88 e5 ldi r24, 0x58 ; 88 2096c: 8f 93 push r24 2096e: c1 e5 ldi r28, 0x51 ; 81 20970: d8 e9 ldi r29, 0x98 ; 152 20972: df 93 push r29 20974: cf 93 push r28 20976: 0e 94 df 69 call 0xd3be ; 0xd3be { 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); 2097a: 63 e0 ldi r22, 0x03 ; 3 2097c: 80 e0 ldi r24, 0x00 ; 0 2097e: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20982: 89 ee ldi r24, 0xE9 ; 233 20984: 9f e0 ldi r25, 0x0F ; 15 20986: 0f 94 85 a0 call 0x3410a ; 0x3410a 2098a: 9f 93 push r25 2098c: 8f 93 push r24 2098e: 7f 93 push r23 20990: 6f 93 push r22 20992: 1f 92 push r1 20994: 89 e5 ldi r24, 0x59 ; 89 20996: 8f 93 push r24 20998: df 93 push r29 2099a: cf 93 push r28 2099c: 0e 94 df 69 call 0xd3be ; 0xd3be } menu_back_if_clicked(); 209a0: 8d b7 in r24, 0x3d ; 61 209a2: 9e b7 in r25, 0x3e ; 62 209a4: 40 96 adiw r24, 0x10 ; 16 209a6: 0f b6 in r0, 0x3f ; 63 209a8: f8 94 cli 209aa: 9e bf out 0x3e, r25 ; 62 209ac: 0f be out 0x3f, r0 ; 63 209ae: 8d bf out 0x3d, r24 ; 61 } 209b0: df 91 pop r29 209b2: 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(); 209b4: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 000209b8 : //! ---------------------- //! 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() { 209b8: cf 92 push r12 209ba: df 92 push r13 209bc: ef 92 push r14 209be: ff 92 push r15 209c0: 0f 93 push r16 209c2: 1f 93 push r17 209c4: cf 93 push r28 209c6: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 209c8: 80 e6 ldi r24, 0x60 ; 96 209ca: 9f e0 ldi r25, 0x0F ; 15 209cc: 0f 94 85 a0 call 0x3410a ; 0x3410a 209d0: 6b 01 movw r12, r22 209d2: 7c 01 movw r14, r24 lcd_home(); 209d4: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P(_N( 209d8: 89 e3 ldi r24, 0x39 ; 57 209da: 9c e4 ldi r25, 0x4C ; 76 209dc: 0e 94 3c 6d call 0xda78 ; 0xda78 209e0: 18 2f mov r17, r24 209e2: 09 2f mov r16, r25 209e4: 8b e2 ldi r24, 0x2B ; 43 209e6: 9c e4 ldi r25, 0x4C ; 76 209e8: 0e 94 3c 6d call 0xda78 ; 0xda78 209ec: ec 01 movw r28, r24 209ee: 8b e1 ldi r24, 0x1B ; 27 209f0: 9c e4 ldi r25, 0x4C ; 76 209f2: 0e 94 3c 6d call 0xda78 ; 0xda78 209f6: 2e e3 ldi r18, 0x3E ; 62 209f8: 2f 93 push r18 209fa: 20 e8 ldi r18, 0x80 ; 128 209fc: 2f 93 push r18 209fe: 1f 92 push r1 20a00: 1f 92 push r1 20a02: 0f 93 push r16 20a04: 1f 93 push r17 20a06: 2d e3 ldi r18, 0x3D ; 61 20a08: 2f 93 push r18 20a0a: 25 ef ldi r18, 0xF5 ; 245 20a0c: 2f 93 push r18 20a0e: 22 ec ldi r18, 0xC2 ; 194 20a10: 2f 93 push r18 20a12: 20 e9 ldi r18, 0x90 ; 144 20a14: 2f 93 push r18 20a16: df 93 push r29 20a18: cf 93 push r28 20a1a: 20 e0 ldi r18, 0x00 ; 0 20a1c: 34 e8 ldi r19, 0x84 ; 132 20a1e: 3f 93 push r19 20a20: 2f 93 push r18 20a22: 9f 93 push r25 20a24: 8f 93 push r24 20a26: 81 ea ldi r24, 0xA1 ; 161 20a28: 9b e6 ldi r25, 0x6B ; 107 20a2a: 9f 93 push r25 20a2c: 8f 93 push r24 20a2e: 0e 94 df 69 call 0xd3be ; 0xd3be _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); 20a32: 60 e0 ldi r22, 0x00 ; 0 20a34: 8f e0 ldi r24, 0x0F ; 15 20a36: 0e 94 06 6a call 0xd40c ; 0xd40c if (angleDiff < 100){ 20a3a: 8d b7 in r24, 0x3d ; 61 20a3c: 9e b7 in r25, 0x3e ; 62 20a3e: 42 96 adiw r24, 0x12 ; 18 20a40: 0f b6 in r0, 0x3f ; 63 20a42: f8 94 cli 20a44: 9e bf out 0x3e, r25 ; 62 20a46: 0f be out 0x3f, r0 ; 63 20a48: 8d bf out 0x3d, r24 ; 61 20a4a: 20 e0 ldi r18, 0x00 ; 0 20a4c: 30 e0 ldi r19, 0x00 ; 0 20a4e: 48 ec ldi r20, 0xC8 ; 200 20a50: 52 e4 ldi r21, 0x42 ; 66 20a52: c7 01 movw r24, r14 20a54: b6 01 movw r22, r12 20a56: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 20a5a: 87 ff sbrs r24, 7 20a5c: 32 c0 rjmp .+100 ; 0x20ac2 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 20a5e: 20 e0 ldi r18, 0x00 ; 0 20a60: 30 e0 ldi r19, 0x00 ; 0 20a62: 44 e3 ldi r20, 0x34 ; 52 20a64: 53 e4 ldi r21, 0x43 ; 67 20a66: c7 01 movw r24, r14 20a68: b6 01 movw r22, r12 20a6a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 20a6e: 2b ed ldi r18, 0xDB ; 219 20a70: 3f e0 ldi r19, 0x0F ; 15 20a72: 49 e4 ldi r20, 0x49 ; 73 20a74: 50 e4 ldi r21, 0x40 ; 64 20a76: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__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)); 20a7a: 9f 93 push r25 20a7c: 8f 93 push r24 20a7e: 7f 93 push r23 20a80: 6f 93 push r22 20a82: 8a e9 ldi r24, 0x9A ; 154 20a84: 9b e6 ldi r25, 0x6B ; 107 20a86: 9f 93 push r25 20a88: 8f 93 push r24 20a8a: 0e 94 df 69 call 0xd3be ; 0xd3be 20a8e: 0f 90 pop r0 20a90: 0f 90 pop r0 20a92: 0f 90 pop r0 20a94: 0f 90 pop r0 20a96: 0f 90 pop r0 20a98: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 20a9a: 0e 94 23 6c call 0xd846 ; 0xd846 20a9e: 88 23 and r24, r24 20aa0: b9 f0 breq .+46 ; 0x20ad0 menu_goto(lcd_menu_xyz_offset, 0, true); 20aa2: 20 e0 ldi r18, 0x00 ; 0 20aa4: 41 e0 ldi r20, 0x01 ; 1 20aa6: 70 e0 ldi r23, 0x00 ; 0 20aa8: 60 e0 ldi r22, 0x00 ; 0 20aaa: 8f eb ldi r24, 0xBF ; 191 20aac: 97 e3 ldi r25, 0x37 ; 55 } 20aae: df 91 pop r29 20ab0: cf 91 pop r28 20ab2: 1f 91 pop r17 20ab4: 0f 91 pop r16 20ab6: ff 90 pop r15 20ab8: ef 90 pop r14 20aba: df 90 pop r13 20abc: 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); 20abe: 0d 94 87 93 jmp 0x3270e ; 0x3270e ); 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)); 20ac2: 8d ed ldi r24, 0xDD ; 221 20ac4: 9d e3 ldi r25, 0x3D ; 61 20ac6: 0e 94 3c 6d call 0xda78 ; 0xda78 20aca: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 20ace: e5 cf rjmp .-54 ; 0x20a9a } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 20ad0: df 91 pop r29 20ad2: cf 91 pop r28 20ad4: 1f 91 pop r17 20ad6: 0f 91 pop r16 20ad8: ff 90 pop r15 20ada: ef 90 pop r14 20adc: df 90 pop r13 20ade: cf 90 pop r12 20ae0: 08 95 ret 00020ae2 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 20ae2: 2f 92 push r2 20ae4: 3f 92 push r3 20ae6: 4f 92 push r4 20ae8: 5f 92 push r5 20aea: 6f 92 push r6 20aec: 7f 92 push r7 20aee: 9f 92 push r9 20af0: af 92 push r10 20af2: bf 92 push r11 20af4: cf 92 push r12 20af6: df 92 push r13 20af8: ef 92 push r14 20afa: ff 92 push r15 20afc: 0f 93 push r16 20afe: 1f 93 push r17 20b00: cf 93 push r28 20b02: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 20b04: 70 91 05 12 lds r23, 0x1205 ; 0x801205 20b08: 71 11 cpse r23, r1 20b0a: 04 c0 rjmp .+8 ; 0x20b14 <_lcd_move(char const*, unsigned char, int, int)+0x32> 20b0c: 70 91 06 12 lds r23, 0x1206 ; 0x801206 20b10: 77 23 and r23, r23 20b12: 99 f0 breq .+38 ; 0x20b3a <_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(); } 20b14: df 91 pop r29 20b16: cf 91 pop r28 20b18: 1f 91 pop r17 20b1a: 0f 91 pop r16 20b1c: ff 90 pop r15 20b1e: ef 90 pop r14 20b20: df 90 pop r13 20b22: cf 90 pop r12 20b24: bf 90 pop r11 20b26: af 90 pop r10 20b28: 9f 90 pop r9 20b2a: 7f 90 pop r7 20b2c: 6f 90 pop r6 20b2e: 5f 90 pop r5 20b30: 4f 90 pop r4 20b32: 3f 90 pop r3 20b34: 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(); 20b36: 0d 94 25 96 jmp 0x32c4a ; 0x32c4a 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) 20b3a: 70 91 64 03 lds r23, 0x0364 ; 0x800364 20b3e: 71 11 cpse r23, r1 20b40: 09 c0 rjmp .+18 ; 0x20b54 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 20b42: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> check_endstops = check; 20b46: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> { _md->endstopsEnabledPrevious = enable_endstops(false); 20b4a: 70 93 65 03 sts 0x0365, r23 ; 0x800365 _md->initialized = true; 20b4e: 71 e0 ldi r23, 0x01 ; 1 20b50: 70 93 64 03 sts 0x0364, r23 ; 0x800364 20b54: 19 01 movw r2, r18 20b56: 6a 01 movw r12, r20 20b58: c6 2f mov r28, r22 20b5a: d9 2f mov r29, r25 20b5c: 98 2e mov r9, r24 } if (lcd_encoder != 0) 20b5e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 20b62: 90 91 07 05 lds r25, 0x0507 ; 0x800507 20b66: 89 2b or r24, r25 20b68: 09 f4 brne .+2 ; 0x20b6c <_lcd_move(char const*, unsigned char, int, int)+0x8a> 20b6a: 71 c0 rjmp .+226 ; 0x20c4e <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 20b6c: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 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; 20b70: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 20b74: 8f 5f subi r24, 0xFF ; 255 20b76: 80 31 cpi r24, 0x10 ; 16 20b78: 09 f4 brne .+2 ; 0x20b7c <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 20b7a: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 20b7c: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 20b80: 98 17 cp r25, r24 20b82: 09 f4 brne .+2 ; 0x20b86 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 20b84: 64 c0 rjmp .+200 ; 0x20c4e <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 20b86: 84 e0 ldi r24, 0x04 ; 4 20b88: c8 9f mul r28, r24 20b8a: 80 01 movw r16, r0 20b8c: 11 24 eor r1, r1 20b8e: f8 01 movw r30, r16 20b90: eb 50 subi r30, 0x0B ; 11 20b92: fe 4e sbci r31, 0xEE ; 238 20b94: 5f 01 movw r10, r30 20b96: 60 91 06 05 lds r22, 0x0506 ; 0x800506 20b9a: 70 91 07 05 lds r23, 0x0507 ; 0x800507 20b9e: 07 2e mov r0, r23 20ba0: 00 0c add r0, r0 20ba2: 88 0b sbc r24, r24 20ba4: 99 0b sbc r25, r25 20ba6: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 20baa: f5 01 movw r30, r10 20bac: 20 81 ld r18, Z 20bae: 31 81 ldd r19, Z+1 ; 0x01 20bb0: 42 81 ldd r20, Z+2 ; 0x02 20bb2: 53 81 ldd r21, Z+3 ; 0x03 20bb4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 20bb8: 2b 01 movw r4, r22 20bba: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20bbc: b6 01 movw r22, r12 20bbe: dd 0c add r13, r13 20bc0: 88 0b sbc r24, r24 20bc2: 99 0b sbc r25, r25 20bc4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 20bc8: 6b 01 movw r12, r22 20bca: 7c 01 movw r14, r24 20bcc: ac 01 movw r20, r24 20bce: 9b 01 movw r18, r22 20bd0: c3 01 movw r24, r6 20bd2: b2 01 movw r22, r4 20bd4: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 20bd8: f5 01 movw r30, r10 20bda: 87 fd sbrc r24, 7 20bdc: 7d c0 rjmp .+250 ; 0x20cd8 <_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; 20bde: 40 82 st Z, r4 20be0: 51 82 std Z+1, r5 ; 0x01 20be2: 62 82 std Z+2, r6 ; 0x02 20be4: 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; 20be6: b1 01 movw r22, r2 20be8: 33 0c add r3, r3 20bea: 88 0b sbc r24, r24 20bec: 99 0b sbc r25, r25 20bee: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 20bf2: 2b 01 movw r4, r22 20bf4: 3c 01 movw r6, r24 20bf6: c8 01 movw r24, r16 20bf8: 8b 50 subi r24, 0x0B ; 11 20bfa: 9e 4e sbci r25, 0xEE ; 238 20bfc: 7c 01 movw r14, r24 20bfe: a3 01 movw r20, r6 20c00: 92 01 movw r18, r4 20c02: fc 01 movw r30, r24 20c04: 60 81 ld r22, Z 20c06: 71 81 ldd r23, Z+1 ; 0x01 20c08: 82 81 ldd r24, Z+2 ; 0x02 20c0a: 93 81 ldd r25, Z+3 ; 0x03 20c0c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 20c10: 18 16 cp r1, r24 20c12: 2c f4 brge .+10 ; 0x20c1e <_lcd_move(char const*, unsigned char, int, int)+0x13c> 20c14: f7 01 movw r30, r14 20c16: 40 82 st Z, r4 20c18: 51 82 std Z+1, r5 ; 0x01 20c1a: 62 82 std Z+2, r6 ; 0x02 20c1c: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 20c1e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20c22: 10 92 06 05 sts 0x0506, r1 ; 0x800506 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 20c26: 69 ef ldi r22, 0xF9 ; 249 20c28: 71 e1 ldi r23, 0x11 ; 17 20c2a: 85 ef ldi r24, 0xF5 ; 245 20c2c: 91 e1 ldi r25, 0x11 ; 17 20c2e: 0e 94 31 64 call 0xc862 ; 0xc862 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 20c32: f8 01 movw r30, r16 20c34: ef 51 subi r30, 0x1F ; 31 20c36: fd 4f sbci r31, 0xFD ; 253 20c38: 60 81 ld r22, Z 20c3a: 71 81 ldd r23, Z+1 ; 0x01 20c3c: 82 81 ldd r24, Z+2 ; 0x02 20c3e: 93 81 ldd r25, Z+3 ; 0x03 20c40: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 20c44: 0f 94 11 85 call 0x30a22 ; 0x30a22 lcd_draw_update = 1; 20c48: 81 e0 ldi r24, 0x01 ; 1 20c4a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 20c4e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20c52: 88 23 and r24, r24 20c54: 11 f1 breq .+68 ; 0x20c9a <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 20c56: 61 e0 ldi r22, 0x01 ; 1 20c58: 80 e0 ldi r24, 0x00 ; 0 20c5a: 0e 94 06 6a call 0xd40c ; 0xd40c menu_draw_float31(name, current_position[axis]); 20c5e: 84 e0 ldi r24, 0x04 ; 4 20c60: c8 9f mul r28, r24 20c62: f0 01 movw r30, r0 20c64: 11 24 eor r1, r1 20c66: eb 50 subi r30, 0x0B ; 11 20c68: 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); 20c6a: 83 81 ldd r24, Z+3 ; 0x03 20c6c: 8f 93 push r24 20c6e: 82 81 ldd r24, Z+2 ; 0x02 20c70: 8f 93 push r24 20c72: 81 81 ldd r24, Z+1 ; 0x01 20c74: 8f 93 push r24 20c76: 80 81 ld r24, Z 20c78: 8f 93 push r24 20c7a: df 93 push r29 20c7c: 9f 92 push r9 20c7e: 88 e3 ldi r24, 0x38 ; 56 20c80: 98 e9 ldi r25, 0x98 ; 152 20c82: 9f 93 push r25 20c84: 8f 93 push r24 20c86: 0e 94 df 69 call 0xd3be ; 0xd3be 20c8a: ed b7 in r30, 0x3d ; 61 20c8c: fe b7 in r31, 0x3e ; 62 20c8e: 38 96 adiw r30, 0x08 ; 8 20c90: 0f b6 in r0, 0x3f ; 63 20c92: f8 94 cli 20c94: fe bf out 0x3e, r31 ; 62 20c96: 0f be out 0x3f, r0 ; 63 20c98: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 20c9a: 80 91 92 03 lds r24, 0x0392 ; 0x800392 20c9e: 81 11 cpse r24, r1 20ca0: 04 c0 rjmp .+8 ; 0x20caa <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 20ca2: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20ca6: 88 23 and r24, r24 20ca8: 21 f0 breq .+8 ; 0x20cb2 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 20caa: 80 91 65 03 lds r24, 0x0365 ; 0x800365 20cae: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.362> menu_back_if_clicked(); } 20cb2: df 91 pop r29 20cb4: cf 91 pop r28 20cb6: 1f 91 pop r17 20cb8: 0f 91 pop r16 20cba: ff 90 pop r15 20cbc: ef 90 pop r14 20cbe: df 90 pop r13 20cc0: cf 90 pop r12 20cc2: bf 90 pop r11 20cc4: af 90 pop r10 20cc6: 9f 90 pop r9 20cc8: 7f 90 pop r7 20cca: 6f 90 pop r6 20ccc: 5f 90 pop r5 20cce: 4f 90 pop r4 20cd0: 3f 90 pop r3 20cd2: 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(); 20cd4: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20cd8: c0 82 st Z, r12 20cda: d1 82 std Z+1, r13 ; 0x01 20cdc: e2 82 std Z+2, r14 ; 0x02 20cde: f3 82 std Z+3, r15 ; 0x03 20ce0: 82 cf rjmp .-252 ; 0x20be6 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00020ce2 : } // 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); 20ce2: 2a ef ldi r18, 0xFA ; 250 20ce4: 30 e0 ldi r19, 0x00 ; 0 20ce6: 50 e0 ldi r21, 0x00 ; 0 20ce8: 40 e0 ldi r20, 0x00 ; 0 20cea: 60 e0 ldi r22, 0x00 ; 0 20cec: 8c e5 ldi r24, 0x5C ; 92 20cee: 98 e9 ldi r25, 0x98 ; 152 20cf0: 0d 94 71 05 jmp 0x20ae2 ; 0x20ae2 <_lcd_move(char const*, unsigned char, int, int)> 00020cf4 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 20cf4: 22 ed ldi r18, 0xD2 ; 210 20cf6: 30 e0 ldi r19, 0x00 ; 0 20cf8: 4c ef ldi r20, 0xFC ; 252 20cfa: 5f ef ldi r21, 0xFF ; 255 20cfc: 61 e0 ldi r22, 0x01 ; 1 20cfe: 8f e5 ldi r24, 0x5F ; 95 20d00: 98 e9 ldi r25, 0x98 ; 152 20d02: 0d 94 71 05 jmp 0x20ae2 ; 0x20ae2 <_lcd_move(char const*, unsigned char, int, int)> 00020d06 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 20d06: 22 ed ldi r18, 0xD2 ; 210 20d08: 30 e0 ldi r19, 0x00 ; 0 20d0a: 50 e0 ldi r21, 0x00 ; 0 20d0c: 40 e0 ldi r20, 0x00 ; 0 20d0e: 62 e0 ldi r22, 0x02 ; 2 20d10: 82 e6 ldi r24, 0x62 ; 98 20d12: 98 e9 ldi r25, 0x98 ; 152 20d14: 0d 94 71 05 jmp 0x20ae2 ; 0x20ae2 <_lcd_move(char const*, unsigned char, int, int)> 00020d18 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20d18: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20d1c: 81 11 cpse r24, r1 20d1e: 03 c0 rjmp .+6 ; 0x20d26 20d20: 82 e0 ldi r24, 0x02 ; 2 20d22: 0d 94 09 96 jmp 0x32c12 ; 0x32c12 20d26: 81 e0 ldi r24, 0x01 ; 1 20d28: fc cf rjmp .-8 ; 0x20d22 00020d2a : } // 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); 20d2a: 5f 93 push r21 20d2c: 4f 93 push r20 20d2e: 7f 93 push r23 20d30: 6f 93 push r22 20d32: 28 2f mov r18, r24 20d34: 08 2e mov r0, r24 20d36: 00 0c add r0, r0 20d38: 33 0b sbc r19, r19 20d3a: 3f 93 push r19 20d3c: 8f 93 push r24 20d3e: 86 e7 ldi r24, 0x76 ; 118 20d40: 9a e6 ldi r25, 0x6A ; 106 20d42: 9f 93 push r25 20d44: 8f 93 push r24 20d46: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_space(9 - chars); 20d4a: 2d b7 in r18, 0x3d ; 61 20d4c: 3e b7 in r19, 0x3e ; 62 20d4e: 28 5f subi r18, 0xF8 ; 248 20d50: 3f 4f sbci r19, 0xFF ; 255 20d52: 0f b6 in r0, 0x3f ; 63 20d54: f8 94 cli 20d56: 3e bf out 0x3e, r19 ; 62 20d58: 0f be out 0x3f, r0 ; 63 20d5a: 2d bf out 0x3d, r18 ; 61 20d5c: 99 e0 ldi r25, 0x09 ; 9 20d5e: 98 1b sub r25, r24 20d60: 89 2f mov r24, r25 20d62: 0c 94 fc 69 jmp 0xd3f8 ; 0xd3f8 00020d66 : default: return false; } } void lcd_print_target_temps_first_line() { 20d66: cf 93 push r28 20d68: df 93 push r29 lcd_home(); 20d6a: 0e 94 32 6a call 0xd464 ; 0xd464 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 20d6e: c0 91 f1 11 lds r28, 0x11F1 ; 0x8011f1 20d72: d0 91 f2 11 lds r29, 0x11F2 ; 0x8011f2 20d76: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 20d7a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20d7e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20d82: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20d86: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 20d8a: ae 01 movw r20, r28 20d8c: 82 e8 ldi r24, 0x82 ; 130 20d8e: 0f 94 95 06 call 0x20d2a ; 0x20d2a lcd_set_cursor(10, 0); 20d92: 60 e0 ldi r22, 0x00 ; 0 20d94: 8a e0 ldi r24, 0x0A ; 10 20d96: 0e 94 06 6a call 0xd40c ; 0xd40c FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 20d9a: c0 91 ed 11 lds r28, 0x11ED ; 0x8011ed 20d9e: d0 91 ee 11 lds r29, 0x11EE ; 0x8011ee int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 20da2: 20 97 sbiw r28, 0x00 ; 0 20da4: 81 f0 breq .+32 ; 0x20dc6 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 20da6: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20daa: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20dae: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20db2: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20db6: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 20dba: ae 01 movw r20, r28 20dbc: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 20dbe: df 91 pop r29 20dc0: 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); 20dc2: 0d 94 95 06 jmp 0x20d2a ; 0x20d2a } else { lcd_space(10); 20dc6: 8a e0 ldi r24, 0x0A ; 10 } } 20dc8: df 91 pop r29 20dca: 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); 20dcc: 0c 94 fc 69 jmp 0xd3f8 ; 0xd3f8 00020dd0 : 20dd0: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 20dd4: 0f 94 b3 06 call 0x20d66 ; 0x20d66 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 20dd8: 84 ea ldi r24, 0xA4 ; 164 20dda: 9a e4 ldi r25, 0x4A ; 74 20ddc: 0e 94 3c 6d call 0xda78 ; 0xda78 20de0: ac 01 movw r20, r24 20de2: 61 e0 ldi r22, 0x01 ; 1 20de4: 80 e0 ldi r24, 0x00 ; 0 20de6: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(0,2); 20dea: 62 e0 ldi r22, 0x02 ; 2 20dec: 80 e0 ldi r24, 0x00 ; 0 20dee: 0e 94 06 6a call 0xd40c ; 0xd40c switch(eFilamentAction) { 20df2: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20df6: 83 30 cpi r24, 0x03 ; 3 20df8: 81 f1 breq .+96 ; 0x20e5a 20dfa: 48 f4 brcc .+18 ; 0x20e0e 20dfc: 81 30 cpi r24, 0x01 ; 1 20dfe: 60 f0 brcs .+24 ; 0x20e18 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 20e00: 81 e9 ldi r24, 0x91 ; 145 20e02: 9a e4 ldi r25, 0x4A ; 74 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 20e04: 0e 94 3c 6d call 0xda78 ; 0xda78 20e08: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 20e0c: 05 c0 rjmp .+10 ; 0x20e18 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) { 20e0e: 85 30 cpi r24, 0x05 ; 5 20e10: 21 f1 breq .+72 ; 0x20e5a 20e12: b0 f3 brcs .-20 ; 0x20e00 20e14: 88 30 cpi r24, 0x08 ; 8 20e16: a1 f3 breq .-24 ; 0x20e00 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 20e18: 0e 94 23 6c call 0xd846 ; 0xd846 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 20e1c: 81 11 cpse r24, r1 20e1e: 09 c0 rjmp .+18 ; 0x20e32 20e20: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20e24: 81 50 subi r24, 0x01 ; 1 20e26: 82 30 cpi r24, 0x02 ; 2 20e28: 28 f5 brcc .+74 ; 0x20e74 20e2a: 80 91 88 16 lds r24, 0x1688 ; 0x801688 20e2e: 88 23 and r24, r24 20e30: 09 f1 breq .+66 ; 0x20e74 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 20e32: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20e36: 81 11 cpse r24, r1 20e38: 13 c0 rjmp .+38 ; 0x20e60 20e3a: 83 e0 ldi r24, 0x03 ; 3 20e3c: 0f 94 09 96 call 0x32c12 ; 0x32c12 switch(eFilamentAction) { 20e40: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20e44: 82 30 cpi r24, 0x02 ; 2 20e46: 71 f0 breq .+28 ; 0x20e64 20e48: 83 30 cpi r24, 0x03 ; 3 20e4a: 81 f0 breq .+32 ; 0x20e6c 20e4c: 81 30 cpi r24, 0x01 ; 1 20e4e: 91 f4 brne .+36 ; 0x20e74 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 20e50: 61 e0 ldi r22, 0x01 ; 1 20e52: 87 e3 ldi r24, 0x37 ; 55 20e54: 9b e6 ldi r25, 0x6B ; 107 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20e56: 0c 94 3a 7d jmp 0xfa74 ; 0xfa74 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)); 20e5a: 8c e7 ldi r24, 0x7C ; 124 20e5c: 9a e4 ldi r25, 0x4A ; 74 20e5e: d2 cf rjmp .-92 ; 0x20e04 #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); 20e60: 82 e0 ldi r24, 0x02 ; 2 20e62: ec cf rjmp .-40 ; 0x20e3c switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 20e64: 81 e0 ldi r24, 0x01 ; 1 20e66: 80 93 62 03 sts 0x0362, r24 ; 0x800362 20e6a: f2 cf rjmp .-28 ; 0x20e50 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20e6c: 61 e0 ldi r22, 0x01 ; 1 20e6e: 81 eb ldi r24, 0xB1 ; 177 20e70: 98 e6 ldi r25, 0x68 ; 104 20e72: f1 cf rjmp .-30 ; 0x20e56 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 20e74: 08 95 ret 00020e76 : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 20e76: 80 e0 ldi r24, 0x00 ; 0 20e78: 0c 94 e8 74 jmp 0xe9d0 ; 0xe9d0 00020e7c : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 20e7c: ef 92 push r14 20e7e: ff 92 push r15 20e80: 0f 93 push r16 20e82: 1f 93 push r17 20e84: cf 93 push r28 20e86: 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) 20e88: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20e8c: 88 23 and r24, r24 20e8e: 29 f0 breq .+10 ; 0x20e9a 20e90: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 20e94: 92 30 cpi r25, 0x02 ; 2 20e96: 09 f0 breq .+2 ; 0x20e9a 20e98: 74 c1 rjmp .+744 ; 0x21182 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 20e9a: 81 e0 ldi r24, 0x01 ; 1 20e9c: 80 93 64 03 sts 0x0364, r24 ; 0x800364 20ea0: 80 91 db 15 lds r24, 0x15DB ; 0x8015db _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 20ea4: 80 93 65 03 sts 0x0365, r24 ; 0x800365 if (_md->is_flash_air) { 20ea8: 88 23 and r24, r24 20eaa: 21 f0 breq .+8 ; 0x20eb4 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 20eac: 86 e6 ldi r24, 0x66 ; 102 20eae: 93 e0 ldi r25, 0x03 ; 3 20eb0: 0f 94 28 52 call 0x2a450 ; 0x2a450 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20eb4: 0f 94 5d 93 call 0x326ba ; 0x326ba 20eb8: 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); 20ebc: 86 e9 ldi r24, 0x96 ; 150 20ebe: e8 2e mov r14, r24 20ec0: 86 e9 ldi r24, 0x96 ; 150 20ec2: 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]); 20ec4: c5 e6 ldi r28, 0x65 ; 101 20ec6: d6 e9 ldi r29, 0x96 ; 150 20ec8: 0a e6 ldi r16, 0x6A ; 106 20eca: 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(); 20ecc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20ed0: 84 30 cpi r24, 0x04 ; 4 20ed2: 08 f0 brcs .+2 ; 0x20ed6 20ed4: 7d c1 rjmp .+762 ; 0x211d0 20ed6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20eda: 8a e5 ldi r24, 0x5A ; 90 20edc: 9e e3 ldi r25, 0x3E ; 62 20ede: 0e 94 3c 6d call 0xda78 ; 0xda78 20ee2: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR("Firmware:")); 20ee6: 8a ef ldi r24, 0xFA ; 250 20ee8: 96 e9 ldi r25, 0x96 ; 150 20eea: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20eee: 8d ee ldi r24, 0xED ; 237 20ef0: 96 e9 ldi r25, 0x96 ; 150 20ef2: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20ef6: 8f ed ldi r24, 0xDF ; 223 20ef8: 96 e9 ldi r25, 0x96 ; 150 20efa: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 20efe: 8f ec ldi r24, 0xCF ; 207 20f00: 96 e9 ldi r25, 0x96 ; 150 20f02: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 20f06: 8b e2 ldi r24, 0x2B ; 43 20f08: 9b e6 ldi r25, 0x6B ; 107 20f0a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 20f0e: 89 e1 ldi r24, 0x19 ; 25 20f10: 9b e6 ldi r25, 0x6B ; 107 20f12: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 20f16: 88 e0 ldi r24, 0x08 ; 8 20f18: 9b e6 ldi r25, 0x6B ; 107 20f1a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(STR_SEPARATOR); 20f1e: 80 e0 ldi r24, 0x00 ; 0 20f20: 94 e8 ldi r25, 0x84 ; 132 20f22: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 20f26: 82 ec ldi r24, 0xC2 ; 194 20f28: 96 e9 ldi r25, 0x96 ; 150 20f2a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 20f2e: 89 eb ldi r24, 0xB9 ; 185 20f30: 96 e9 ldi r25, 0x96 ; 150 20f32: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 20f36: 8f ea ldi r24, 0xAF ; 175 20f38: 96 e9 ldi r25, 0x96 ; 150 20f3a: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(STR_SEPARATOR); 20f3e: 80 e0 ldi r24, 0x00 ; 0 20f40: 94 e8 ldi r25, 0x84 ; 132 20f42: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(_T(MSG_DATE)); 20f46: 84 e7 ldi r24, 0x74 ; 116 20f48: 9a e4 ldi r25, 0x4A ; 74 20f4a: 0e 94 3c 6d call 0xda78 ; 0xda78 20f4e: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 20f52: 84 ea ldi r24, 0xA4 ; 164 20f54: 96 e9 ldi r25, 0x96 ; 150 20f56: 0f 94 28 96 call 0x32c50 ; 0x32c50 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); 20f5a: 80 e0 ldi r24, 0x00 ; 0 20f5c: 94 e8 ldi r25, 0x84 ; 132 20f5e: 0f 94 28 96 call 0x32c50 ; 0x32c50 if (MMU2::mmu2.Enabled()) 20f62: 80 91 94 12 lds r24, 0x1294 ; 0x801294 20f66: 81 30 cpi r24, 0x01 ; 1 20f68: 09 f0 breq .+2 ; 0x20f6c 20f6a: 2d c1 rjmp .+602 ; 0x211c6 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 20f6c: 84 e6 ldi r24, 0x64 ; 100 20f6e: 9a e4 ldi r25, 0x4A ; 74 20f70: 0e 94 3c 6d call 0xda78 ; 0xda78 20f74: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 20f78: 8f e9 ldi r24, 0x9F ; 159 20f7a: 96 e9 ldi r25, 0x96 ; 150 20f7c: 0f 94 28 96 call 0x32c50 ; 0x32c50 if (((menu_item - 1) == menu_line) && lcd_draw_update) 20f80: 80 91 31 04 lds r24, 0x0431 ; 0x800431 20f84: 81 50 subi r24, 0x01 ; 1 20f86: 99 0b sbc r25, r25 20f88: 20 91 30 04 lds r18, 0x0430 ; 0x800430 20f8c: 28 17 cp r18, r24 20f8e: 19 06 cpc r1, r25 20f90: 49 f5 brne .+82 ; 0x20fe4 20f92: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20f96: 88 23 and r24, r24 20f98: 29 f1 breq .+74 ; 0x20fe4 { lcd_set_cursor(6, menu_row); 20f9a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 20f9e: 86 e0 ldi r24, 0x06 ; 6 20fa0: 0e 94 06 6a call 0xd40c ; 0xd40c 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) { 20fa4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 20fa8: 81 30 cpi r24, 0x01 ; 1 20faa: 09 f0 breq .+2 ; 0x20fae 20fac: 05 c1 rjmp .+522 ; 0x211b8 20fae: 80 91 74 12 lds r24, 0x1274 ; 0x801274 20fb2: 90 91 75 12 lds r25, 0x1275 ; 0x801275 20fb6: 20 91 76 12 lds r18, 0x1276 ; 0x801276 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 20fba: 88 23 and r24, r24 20fbc: 09 f4 brne .+2 ; 0x20fc0 20fbe: fc c0 rjmp .+504 ; 0x211b8 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 20fc0: 1f 92 push r1 20fc2: 2f 93 push r18 20fc4: 1f 92 push r1 20fc6: 9f 93 push r25 20fc8: 1f 92 push r1 20fca: 8f 93 push r24 20fcc: ff 92 push r15 20fce: ef 92 push r14 20fd0: 0e 94 df 69 call 0xd3be ; 0xd3be 20fd4: 8d b7 in r24, 0x3d ; 61 20fd6: 9e b7 in r25, 0x3e ; 62 20fd8: 08 96 adiw r24, 0x08 ; 8 20fda: 0f b6 in r0, 0x3f ; 63 20fdc: f8 94 cli 20fde: 9e bf out 0x3e, r25 ; 62 20fe0: 0f be out 0x3f, r0 ; 63 20fe2: 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) { 20fe4: 80 91 65 03 lds r24, 0x0365 ; 0x800365 20fe8: 88 23 and r24, r24 20fea: 09 f4 brne .+2 ; 0x20fee 20fec: 40 c0 rjmp .+128 ; 0x2106e MENU_ITEM_BACK_P(STR_SEPARATOR); 20fee: 80 e0 ldi r24, 0x00 ; 0 20ff0: 94 e8 ldi r25, 0x84 ; 132 20ff2: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 20ff6: 85 e7 ldi r24, 0x75 ; 117 20ff8: 96 e9 ldi r25, 0x96 ; 150 20ffa: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" ")); 20ffe: 83 e7 ldi r24, 0x73 ; 115 21000: 96 e9 ldi r25, 0x96 ; 150 21002: 0f 94 28 96 call 0x32c50 ; 0x32c50 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 21006: 80 91 31 04 lds r24, 0x0431 ; 0x800431 2100a: 81 50 subi r24, 0x01 ; 1 2100c: 99 0b sbc r25, r25 2100e: 20 91 30 04 lds r18, 0x0430 ; 0x800430 21012: 28 17 cp r18, r24 21014: 19 06 cpc r1, r25 21016: 59 f5 brne .+86 ; 0x2106e 21018: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 2101c: 88 23 and r24, r24 2101e: 39 f1 breq .+78 ; 0x2106e lcd_set_cursor(2, menu_row); 21020: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 21024: 82 e0 ldi r24, 0x02 ; 2 21026: 0e 94 06 6a call 0xd40c ; 0xd40c 2102a: 80 91 69 03 lds r24, 0x0369 ; 0x800369 2102e: 1f 92 push r1 21030: 8f 93 push r24 21032: 80 91 68 03 lds r24, 0x0368 ; 0x800368 21036: 1f 92 push r1 21038: 8f 93 push r24 2103a: 80 91 67 03 lds r24, 0x0367 ; 0x800367 2103e: 1f 92 push r1 21040: 8f 93 push r24 21042: 80 91 66 03 lds r24, 0x0366 ; 0x800366 21046: 1f 92 push r1 21048: 8f 93 push r24 2104a: df 93 push r29 2104c: cf 93 push r28 2104e: 1f 93 push r17 21050: 0f 93 push r16 21052: 0f 94 94 9f call 0x33f28 ; 0x33f28 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 21056: 8a e6 ldi r24, 0x6A ; 106 21058: 93 e0 ldi r25, 0x03 ; 3 2105a: 0e 94 0d 6c call 0xd81a ; 0xd81a 2105e: 8d b7 in r24, 0x3d ; 61 21060: 9e b7 in r25, 0x3e ; 62 21062: 0c 96 adiw r24, 0x0c ; 12 21064: 0f b6 in r0, 0x3f ; 63 21066: f8 94 cli 21068: 9e bf out 0x3e, r25 ; 62 2106a: 0f be out 0x3f, r0 ; 63 2106c: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 2106e: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 21072: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 21076: a0 91 7f 06 lds r26, 0x067F ; 0x80067f 2107a: b0 91 80 06 lds r27, 0x0680 ; 0x800680 2107e: 89 2b or r24, r25 21080: 8a 2b or r24, r26 21082: 8b 2b or r24, r27 21084: 09 f4 brne .+2 ; 0x21088 21086: 42 c0 rjmp .+132 ; 0x2110c MENU_ITEM_BACK_P(STR_SEPARATOR); 21088: 80 e0 ldi r24, 0x00 ; 0 2108a: 94 e8 ldi r25, 0x84 ; 132 2108c: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 21090: 87 e4 ldi r24, 0x47 ; 71 21092: 9a e4 ldi r25, 0x4A ; 74 21094: 0e 94 3c 6d call 0xda78 ; 0xda78 21098: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_BACK_P(PSTR(" ")); 2109c: 81 e7 ldi r24, 0x71 ; 113 2109e: 96 e9 ldi r25, 0x96 ; 150 210a0: 0f 94 28 96 call 0x32c50 ; 0x32c50 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 210a4: 80 91 31 04 lds r24, 0x0431 ; 0x800431 210a8: 81 50 subi r24, 0x01 ; 1 210aa: 99 0b sbc r25, r25 210ac: 20 91 30 04 lds r18, 0x0430 ; 0x800430 210b0: 28 17 cp r18, r24 210b2: 19 06 cpc r1, r25 210b4: 59 f5 brne .+86 ; 0x2110c 210b6: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 210ba: 88 23 and r24, r24 210bc: 39 f1 breq .+78 ; 0x2110c lcd_set_cursor(2, menu_row); 210be: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 210c2: 82 e0 ldi r24, 0x02 ; 2 210c4: 0e 94 06 6a call 0xd40c ; 0xd40c 210c8: 80 91 80 06 lds r24, 0x0680 ; 0x800680 210cc: 1f 92 push r1 210ce: 8f 93 push r24 210d0: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 210d4: 1f 92 push r1 210d6: 8f 93 push r24 210d8: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 210dc: 1f 92 push r1 210de: 8f 93 push r24 210e0: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 210e4: 1f 92 push r1 210e6: 8f 93 push r24 210e8: df 93 push r29 210ea: cf 93 push r28 210ec: 1f 93 push r17 210ee: 0f 93 push r16 210f0: 0f 94 94 9f call 0x33f28 ; 0x33f28 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 210f4: 8a e6 ldi r24, 0x6A ; 106 210f6: 93 e0 ldi r25, 0x03 ; 3 210f8: 0e 94 0d 6c call 0xd81a ; 0xd81a 210fc: 8d b7 in r24, 0x3d ; 61 210fe: 9e b7 in r25, 0x3e ; 62 21100: 0c 96 adiw r24, 0x0c ; 12 21102: 0f b6 in r0, 0x3f ; 63 21104: f8 94 cli 21106: 9e bf out 0x3e, r25 ; 62 21108: 0f be out 0x3f, r0 ; 63 2110a: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 2110c: 80 e0 ldi r24, 0x00 ; 0 2110e: 94 e8 ldi r25, 0x84 ; 132 21110: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 21114: 84 e3 ldi r24, 0x34 ; 52 21116: 9a e4 ldi r25, 0x4A ; 74 21118: 0e 94 3c 6d call 0xda78 ; 0xda78 2111c: 61 e3 ldi r22, 0x31 ; 49 2111e: 78 e3 ldi r23, 0x38 ; 56 21120: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 21124: 84 e2 ldi r24, 0x24 ; 36 21126: 9a e4 ldi r25, 0x4A ; 74 21128: 0e 94 3c 6d call 0xda78 ; 0xda78 2112c: 63 e8 ldi r22, 0x83 ; 131 2112e: 77 e3 ldi r23, 0x37 ; 55 21130: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 21134: 86 e1 ldi r24, 0x16 ; 22 21136: 9a e4 ldi r25, 0x4A ; 74 21138: 0e 94 3c 6d call 0xda78 ; 0xda78 2113c: 69 e3 ldi r22, 0x39 ; 57 2113e: 77 e3 ldi r23, 0x37 ; 55 21140: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #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); 21144: 87 e0 ldi r24, 0x07 ; 7 21146: 9a e4 ldi r25, 0x4A ; 74 21148: 0e 94 3c 6d call 0xda78 ; 0xda78 2114c: 6f e1 ldi r22, 0x1F ; 31 2114e: 77 e3 ldi r23, 0x37 ; 55 21150: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 21154: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 21158: 88 23 and r24, r24 2115a: 31 f0 breq .+12 ; 0x21168 MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 2115c: 65 ee ldi r22, 0xE5 ; 229 2115e: 78 e3 ldi r23, 0x38 ; 56 21160: 89 ef ldi r24, 0xF9 ; 249 21162: 9a e6 ldi r25, 0x6A ; 106 21164: 0f 94 da 92 call 0x325b4 ; 0x325b4 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(); 21168: 0f 94 31 93 call 0x32662 ; 0x32662 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 2116c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21170: 8f 5f subi r24, 0xFF ; 255 21172: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 21176: 80 91 30 04 lds r24, 0x0430 ; 0x800430 2117a: 8f 5f subi r24, 0xFF ; 255 2117c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 21180: a5 ce rjmp .-694 ; 0x20ecc _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) 21182: 90 91 65 03 lds r25, 0x0365 ; 0x800365 21186: 99 23 and r25, r25 21188: 09 f4 brne .+2 ; 0x2118c 2118a: 94 ce rjmp .-728 ; 0x20eb4 2118c: 40 91 66 03 lds r20, 0x0366 ; 0x800366 21190: 50 91 67 03 lds r21, 0x0367 ; 0x800367 21194: 60 91 68 03 lds r22, 0x0368 ; 0x800368 21198: 70 91 69 03 lds r23, 0x0369 ; 0x800369 2119c: 45 2b or r20, r21 2119e: 46 2b or r20, r22 211a0: 47 2b or r20, r23 211a2: 09 f0 breq .+2 ; 0x211a6 211a4: 87 ce rjmp .-754 ; 0x20eb4 211a6: 8f 5f subi r24, 0xFF ; 255 211a8: 80 31 cpi r24, 0x10 ; 16 211aa: 19 f0 breq .+6 ; 0x211b2 211ac: 80 93 64 03 sts 0x0364, r24 ; 0x800364 211b0: 81 ce rjmp .-766 ; 0x20eb4 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 211b2: 10 92 64 03 sts 0x0364, r1 ; 0x800364 211b6: 7e ce rjmp .-772 ; 0x20eb4 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)); 211b8: 8a e5 ldi r24, 0x5A ; 90 211ba: 9a e4 ldi r25, 0x4A ; 74 211bc: 0e 94 3c 6d call 0xda78 ; 0xda78 211c0: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 211c4: 0f cf rjmp .-482 ; 0x20fe4 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 211c6: 87 e8 ldi r24, 0x87 ; 135 211c8: 96 e9 ldi r25, 0x96 ; 150 211ca: 0f 94 28 96 call 0x32c50 ; 0x32c50 211ce: 0a cf rjmp .-492 ; 0x20fe4 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 211d0: df 91 pop r29 211d2: cf 91 pop r28 211d4: 1f 91 pop r17 211d6: 0f 91 pop r16 211d8: ff 90 pop r15 211da: ef 90 pop r14 211dc: 08 95 ret 000211de : { 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) { 211de: 80 91 64 03 lds r24, 0x0364 ; 0x800364 211e2: 81 11 cpse r24, r1 211e4: 19 c0 rjmp .+50 ; 0x21218 lcd_clear(); 211e6: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 211ea: 8e eb ldi r24, 0xBE ; 190 211ec: 99 e4 ldi r25, 0x49 ; 73 211ee: 0e 94 3c 6d call 0xda78 ; 0xda78 211f2: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_putc(':'); 211f6: 8a e3 ldi r24, 0x3A ; 58 211f8: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_set_cursor(10, 1); 211fc: 61 e0 ldi r22, 0x01 ; 1 211fe: 8a e0 ldi r24, 0x0A ; 10 21200: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 21204: 88 ea ldi r24, 0xA8 ; 168 21206: 9c e0 ldi r25, 0x0C ; 12 21208: 0f 94 85 a0 call 0x3410a ; 0x3410a void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 2120c: 4a e0 ldi r20, 0x0A ; 10 2120e: 0e 94 5a 6b call 0xd6b4 ; 0xd6b4 _md->initialized = true; 21212: 81 e0 ldi r24, 0x01 ; 1 21214: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } menu_back_if_clicked(); 21218: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 0002121c : } 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){ 2121c: 0f 93 push r16 2121e: 1f 93 push r17 21220: cf 93 push r28 21222: df 93 push r29 21224: ec 01 movw r28, r24 21226: cb 01 movw r24, r22 21228: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 2122a: 4a 81 ldd r20, Y+2 ; 0x02 2122c: 41 30 cpi r20, 0x01 ; 1 2122e: 29 f0 breq .+10 ; 0x2123a 21230: 88 f0 brcs .+34 ; 0x21254 21232: 42 30 cpi r20, 0x02 ; 2 21234: 09 f1 breq .+66 ; 0x21278 21236: 43 30 cpi r20, 0x03 ; 3 21238: d1 f4 brne .+52 ; 0x2126e 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 ){ 2123a: 8b 81 ldd r24, Y+3 ; 0x03 2123c: 81 11 cpse r24, r1 2123e: 25 c0 rjmp .+74 ; 0x2128a state = next_state; // advance to the next state 21240: 82 e0 ldi r24, 0x02 ; 2 21242: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 21244: 63 e0 ldi r22, 0x03 ; 3 21246: 89 e8 ldi r24, 0x89 ; 137 21248: 95 e9 ldi r25, 0x95 ; 149 2124a: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 2124e: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 21250: 8b 83 std Y+3, r24 ; 0x03 21252: 0d c0 rjmp .+26 ; 0x2126e //! @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 ){ 21254: a9 01 movw r20, r18 21256: 98 01 movw r18, r16 21258: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2125c: 18 16 cp r1, r24 2125e: 3c f4 brge .+14 ; 0x2126e lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 21260: 63 e0 ldi r22, 0x03 ; 3 21262: 88 81 ld r24, Y 21264: 99 81 ldd r25, Y+1 ; 0x01 21266: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 state = States::TempAboveMintemp; 2126a: 81 e0 ldi r24, 0x01 ; 1 2126c: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 2126e: df 91 pop r29 21270: cf 91 pop r28 21272: 1f 91 pop r17 21274: 0f 91 pop r16 21276: 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 ){ 21278: 8b 81 ldd r24, Y+3 ; 0x03 2127a: 81 11 cpse r24, r1 2127c: 06 c0 rjmp .+12 ; 0x2128a 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); 2127e: 88 81 ld r24, Y 21280: 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 21282: 23 e0 ldi r18, 0x03 ; 3 21284: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 21286: 63 e0 ldi r22, 0x03 ; 3 21288: e0 cf rjmp .-64 ; 0x2124a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 2128a: 81 50 subi r24, 0x01 ; 1 2128c: e1 cf rjmp .-62 ; 0x21250 0002128e : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 2128e: cf 93 push r28 21290: df 93 push r29 if(IsStopped() == false) { 21292: 90 91 ce 11 lds r25, 0x11CE ; 0x8011ce 21296: 91 11 cpse r25, r1 21298: 21 c0 rjmp .+66 ; 0x212dc 2129a: c6 2f mov r28, r22 2129c: d8 2f mov r29, r24 if (isPreheat) { 2129e: 88 23 and r24, r24 212a0: 09 f1 breq .+66 ; 0x212e4 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 212a2: 8d e2 ldi r24, 0x2D ; 45 212a4: 95 e9 ldi r25, 0x95 ; 149 212a6: 66 23 and r22, r22 212a8: 11 f0 breq .+4 ; 0x212ae 212aa: 8b e3 ldi r24, 0x3B ; 59 212ac: 95 e9 ldi r25, 0x95 ; 149 212ae: 63 e0 ldi r22, 0x03 ; 3 212b0: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 SERIAL_ERROR_START; 212b4: 8a e5 ldi r24, 0x5A ; 90 212b6: 9e e9 ldi r25, 0x9E ; 158 212b8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 212bc: 8a e0 ldi r24, 0x0A ; 10 212be: 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) { 212c0: c1 11 cpse r28, r1 212c2: 02 c0 rjmp .+4 ; 0x212c8 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 212c4: 88 ee ldi r24, 0xE8 ; 232 212c6: 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"); 212c8: 0e 94 de 72 call 0xe5bc ; 0xe5bc } } prusa_statistics(0); 212cc: 80 e0 ldi r24, 0x00 ; 0 212ce: 0f 94 a0 98 call 0x33140 ; 0x33140 prusa_statistics(isPreheat? 91 : 90); 212d2: 8a e5 ldi r24, 0x5A ; 90 212d4: d1 11 cpse r29, r1 212d6: 8b e5 ldi r24, 0x5B ; 91 212d8: 0f 94 a0 98 call 0x33140 ; 0x33140 } ThermalStop(); } 212dc: df 91 pop r29 212de: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 212e0: 0d 94 d3 42 jmp 0x285a6 ; 0x285a6 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); 212e4: 84 ec ldi r24, 0xC4 ; 196 212e6: 94 e9 ldi r25, 0x94 ; 148 212e8: 66 23 and r22, r22 212ea: 11 f0 breq .+4 ; 0x212f0 212ec: 84 ed ldi r24, 0xD4 ; 212 212ee: 94 e9 ldi r25, 0x94 ; 148 212f0: 63 e0 ldi r22, 0x03 ; 3 212f2: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 SERIAL_ERROR_START; 212f6: 8a e5 ldi r24, 0x5A ; 90 212f8: 9e e9 ldi r25, 0x9E ; 158 212fa: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 212fe: 8b ea ldi r24, 0xAB ; 171 21300: 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) { 21302: c1 11 cpse r28, r1 21304: e1 cf rjmp .-62 ; 0x212c8 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 21306: 83 e9 ldi r24, 0x93 ; 147 21308: 94 e9 ldi r25, 0x94 ; 148 2130a: de cf rjmp .-68 ; 0x212c8 0002130c : } static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 2130c: 72 9a sbi 0x0e, 2 ; 14 2130e: 2f ef ldi r18, 0xFF ; 255 21310: 89 e6 ldi r24, 0x69 ; 105 21312: 98 e1 ldi r25, 0x18 ; 24 21314: 21 50 subi r18, 0x01 ; 1 21316: 80 40 sbci r24, 0x00 ; 0 21318: 90 40 sbci r25, 0x00 ; 0 2131a: e1 f7 brne .-8 ; 0x21314 2131c: 00 c0 rjmp .+0 ; 0x2131e 2131e: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 21320: 72 98 cbi 0x0e, 2 ; 14 } 21322: 08 95 ret 00021324 : 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() { 21324: cf 93 push r28 21326: 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); 21328: 80 91 40 02 lds r24, 0x0240 ; 0x800240 2132c: 88 23 and r24, r24 2132e: 89 f0 breq .+34 ; 0x21352 21330: 81 e7 ldi r24, 0x71 ; 113 21332: 9b e5 ldi r25, 0x5B ; 91 21334: 0e 94 3c 6d call 0xda78 ; 0xda78 21338: ec 01 movw r28, r24 2133a: 85 e3 ldi r24, 0x35 ; 53 2133c: 96 e5 ldi r25, 0x56 ; 86 2133e: 0e 94 3c 6d call 0xda78 ; 0xda78 21342: 22 e0 ldi r18, 0x02 ; 2 21344: 4c e9 ldi r20, 0x9C ; 156 21346: 5c ef ldi r21, 0xFC ; 252 21348: be 01 movw r22, r28 } 2134a: df 91 pop r29 2134c: 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); 2134e: 0d 94 ec 94 jmp 0x329d8 ; 0x329d8 21352: 8b e6 ldi r24, 0x6B ; 107 21354: 9b e5 ldi r25, 0x5B ; 91 21356: ee cf rjmp .-36 ; 0x21334 00021358 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 21358: ef 92 push r14 2135a: ff 92 push r15 2135c: 0f 93 push r16 2135e: 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); 21360: 8a e4 ldi r24, 0x4A ; 74 21362: 96 e5 ldi r25, 0x56 ; 86 21364: 0e 94 3c 6d call 0xda78 ; 0xda78 21368: 28 ec ldi r18, 0xC8 ; 200 2136a: e2 2e mov r14, r18 2136c: f1 2c mov r15, r1 2136e: 07 e2 ldi r16, 0x27 ; 39 21370: 11 e0 ldi r17, 0x01 ; 1 21372: 30 e0 ldi r19, 0x00 ; 0 21374: 20 e0 ldi r18, 0x00 ; 0 21376: 40 e1 ldi r20, 0x10 ; 16 21378: 61 ef ldi r22, 0xF1 ; 241 2137a: 71 e1 ldi r23, 0x11 ; 17 2137c: 0f 94 ad 93 call 0x3275a ; 0x3275a #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); 21380: 8f e2 ldi r24, 0x2F ; 47 21382: 96 e5 ldi r25, 0x56 ; 86 21384: 0e 94 3c 6d call 0xda78 ; 0xda78 21388: 32 e3 ldi r19, 0x32 ; 50 2138a: e3 2e mov r14, r19 2138c: f1 2c mov r15, r1 2138e: 08 e7 ldi r16, 0x78 ; 120 21390: 10 e0 ldi r17, 0x00 ; 0 21392: 30 e0 ldi r19, 0x00 ; 0 21394: 20 e0 ldi r18, 0x00 ; 0 21396: 40 e1 ldi r20, 0x10 ; 16 21398: 6d ee ldi r22, 0xED ; 237 2139a: 71 e1 ldi r23, 0x11 ; 17 2139c: 0f 94 ad 93 call 0x3275a ; 0x3275a #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 213a0: 83 e2 ldi r24, 0x23 ; 35 213a2: 96 e5 ldi r25, 0x56 ; 86 213a4: 0e 94 3c 6d call 0xda78 ; 0xda78 213a8: 4f e7 ldi r20, 0x7F ; 127 213aa: e4 2e mov r14, r20 213ac: f1 2c mov r15, r1 213ae: 0f ef ldi r16, 0xFF ; 255 213b0: 10 e0 ldi r17, 0x00 ; 0 213b2: 30 e0 ldi r19, 0x00 ; 0 213b4: 20 e0 ldi r18, 0x00 ; 0 213b6: 48 e0 ldi r20, 0x08 ; 8 213b8: 69 ee ldi r22, 0xE9 ; 233 213ba: 71 e1 ldi r23, 0x11 ; 17 213bc: 0f 94 ad 93 call 0x3275a ; 0x3275a } 213c0: 1f 91 pop r17 213c2: 0f 91 pop r16 213c4: ff 90 pop r15 213c6: ef 90 pop r14 213c8: 08 95 ret 000213ca : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 213ca: cf 93 push r28 213cc: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 213ce: 86 ed ldi r24, 0xD6 ; 214 213d0: 9e e0 ldi r25, 0x0E ; 14 213d2: 0f 94 7d a0 call 0x340fa ; 0x340fa 213d6: 81 30 cpi r24, 0x01 ; 1 213d8: 19 f5 brne .+70 ; 0x21420 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 213da: 81 e7 ldi r24, 0x71 ; 113 213dc: 9b e5 ldi r25, 0x5B ; 91 213de: 0e 94 3c 6d call 0xda78 ; 0xda78 213e2: 22 e0 ldi r18, 0x02 ; 2 213e4: 4f e7 ldi r20, 0x7F ; 127 213e6: 5d ef ldi r21, 0xFD ; 253 213e8: bc 01 movw r22, r24 213ea: 88 ef ldi r24, 0xF8 ; 248 213ec: 9b e6 ldi r25, 0x6B ; 107 213ee: 0f 94 ec 94 call 0x329d8 ; 0x329d8 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 213f2: 8e ec ldi r24, 0xCE ; 206 213f4: 9e e0 ldi r25, 0x0E ; 14 213f6: 0f 94 7d a0 call 0x340fa ; 0x340fa 213fa: 81 30 cpi r24, 0x01 ; 1 213fc: a1 f4 brne .+40 ; 0x21426 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 213fe: 81 e7 ldi r24, 0x71 ; 113 21400: 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); 21402: 0e 94 3c 6d call 0xda78 ; 0xda78 21406: ec 01 movw r28, r24 21408: 8a e1 ldi r24, 0x1A ; 26 2140a: 96 e5 ldi r25, 0x56 ; 86 2140c: 0e 94 3c 6d call 0xda78 ; 0xda78 21410: 22 e0 ldi r18, 0x02 ; 2 21412: 4b e8 ldi r20, 0x8B ; 139 21414: 5d ef ldi r21, 0xFD ; 253 21416: 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 } 21418: df 91 pop r29 2141a: 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); 2141c: 0d 94 ec 94 jmp 0x329d8 ; 0x329d8 #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); 21420: 8b e6 ldi r24, 0x6B ; 107 21422: 9b e5 ldi r25, 0x5B ; 91 21424: dc cf rjmp .-72 ; 0x213de 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); 21426: 8b e6 ldi r24, 0x6B ; 107 21428: 9b e5 ldi r25, 0x5B ; 91 2142a: eb cf rjmp .-42 ; 0x21402 0002142c : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 2142c: 40 e0 ldi r20, 0x00 ; 0 2142e: 59 e9 ldi r21, 0x99 ; 153 21430: 60 e0 ldi r22, 0x00 ; 0 21432: 80 e0 ldi r24, 0x00 ; 0 21434: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 21438: 1e 99 sbic 0x03, 6 ; 3 2143a: 16 c0 rjmp .+44 ; 0x21468 2143c: 4a ef ldi r20, 0xFA ; 250 2143e: 58 e9 ldi r21, 0x98 ; 152 21440: 61 e0 ldi r22, 0x01 ; 1 21442: 80 e0 ldi r24, 0x00 ; 0 21444: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 21448: 1d 9b sbis 0x03, 5 ; 3 2144a: 11 c0 rjmp .+34 ; 0x2146e 2144c: 47 ef ldi r20, 0xF7 ; 247 2144e: 58 e9 ldi r21, 0x98 ; 152 21450: 62 e0 ldi r22, 0x02 ; 2 21452: 80 e0 ldi r24, 0x00 ; 0 21454: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 21458: 1c 9b sbis 0x03, 4 ; 3 2145a: 0c c0 rjmp .+24 ; 0x21474 2145c: 41 ef ldi r20, 0xF1 ; 241 2145e: 58 e9 ldi r21, 0x98 ; 152 21460: 63 e0 ldi r22, 0x03 ; 3 21462: 80 e0 ldi r24, 0x00 ; 0 21464: 0c 94 1a 6a jmp 0xd434 ; 0xd434 } #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"))); 21468: 4d ef ldi r20, 0xFD ; 253 2146a: 58 e9 ldi r21, 0x98 ; 152 2146c: e9 cf rjmp .-46 ; 0x21440 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 2146e: 44 ef ldi r20, 0xF4 ; 244 21470: 58 e9 ldi r21, 0x98 ; 152 21472: ee cf rjmp .-36 ; 0x21450 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 21474: 4e ee ldi r20, 0xEE ; 238 21476: 58 e9 ldi r21, 0x98 ; 152 21478: f3 cf rjmp .-26 ; 0x21460 0002147a : } static void menu_show_end_stops() { lcd_show_end_stops(); 2147a: 0f 94 16 0a call 0x2142c ; 0x2142c menu_back_if_clicked(); 2147e: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 00021482 : //! @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) { 21482: cf 92 push r12 21484: df 92 push r13 21486: ef 92 push r14 21488: ff 92 push r15 2148a: 0f 93 push r16 2148c: 1f 93 push r17 2148e: cf 93 push r28 21490: df 93 push r29 21492: d8 2f mov r29, r24 21494: 6b 01 movw r12, r22 21496: 7a 01 movw r14, r20 21498: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 2149a: 40 e2 ldi r20, 0x20 ; 32 2149c: 81 11 cpse r24, r1 2149e: 01 c0 rjmp .+2 ; 0x214a2 214a0: 4e e3 ldi r20, 0x3E ; 62 214a2: 63 e0 ldi r22, 0x03 ; 3 214a4: 80 e0 ldi r24, 0x00 ; 0 214a6: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_puts_P(first_choice); 214aa: c6 01 movw r24, r12 214ac: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 214b0: 40 e2 ldi r20, 0x20 ; 32 214b2: d1 30 cpi r29, 0x01 ; 1 214b4: 09 f4 brne .+2 ; 0x214b8 214b6: 4e e3 ldi r20, 0x3E ; 62 214b8: 63 e0 ldi r22, 0x03 ; 3 214ba: 8c 2f mov r24, r28 214bc: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_puts_P(second_choice); 214c0: c7 01 movw r24, r14 214c2: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 if (third_choice) { 214c6: 01 15 cp r16, r1 214c8: 11 05 cpc r17, r1 214ca: 19 f1 breq .+70 ; 0x21512 214cc: c8 01 movw r24, r16 214ce: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> 214d2: d8 2e mov r13, r24 214d4: c7 01 movw r24, r14 214d6: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__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; 214da: 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;} 214dc: 93 e1 ldi r25, 0x13 ; 19 214de: 9d 19 sub r25, r13 214e0: 8c 0f add r24, r28 214e2: 89 17 cp r24, r25 214e4: 08 f4 brcc .+2 ; 0x214e8 214e6: 89 2f mov r24, r25 214e8: 83 31 cpi r24, 0x13 ; 19 214ea: 08 f0 brcs .+2 ; 0x214ee 214ec: 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 ? '>': ' '); 214ee: 40 e2 ldi r20, 0x20 ; 32 214f0: d2 30 cpi r29, 0x02 ; 2 214f2: 09 f4 brne .+2 ; 0x214f6 214f4: 4e e3 ldi r20, 0x3E ; 62 214f6: 63 e0 ldi r22, 0x03 ; 3 214f8: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_puts_P(third_choice); 214fc: c8 01 movw r24, r16 } } 214fe: df 91 pop r29 21500: cf 91 pop r28 21502: 1f 91 pop r17 21504: 0f 91 pop r16 21506: ff 90 pop r15 21508: ef 90 pop r14 2150a: df 90 pop r13 2150c: 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); 2150e: 0c 94 f1 69 jmp 0xd3e2 ; 0xd3e2 } } 21512: df 91 pop r29 21514: cf 91 pop r28 21516: 1f 91 pop r17 21518: 0f 91 pop r16 2151a: ff 90 pop r15 2151c: ef 90 pop r14 2151e: df 90 pop r13 21520: cf 90 pop r12 21522: 08 95 ret 00021524 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 21524: cf 93 push r28 21526: df 93 push r29 21528: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 2152a: 80 e0 ldi r24, 0x00 ; 0 2152c: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 21530: 0e 94 39 6a call 0xd472 ; 0xd472 return lcd_display_message_fullscreen_nonBlocking_P(msg); 21534: ce 01 movw r24, r28 } 21536: df 91 pop r29 21538: 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); 2153a: 0d 94 ff 03 jmp 0x207fe ; 0x207fe 0002153e : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 2153e: cf 92 push r12 21540: df 92 push r13 21542: ef 92 push r14 21544: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 21546: 80 e0 ldi r24, 0x00 ; 0 21548: 90 e0 ldi r25, 0x00 ; 0 2154a: a8 ec ldi r26, 0xC8 ; 200 2154c: b2 e4 ldi r27, 0x42 ; 66 2154e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 21552: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 21556: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 2155a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2155e: 65 e5 ldi r22, 0x55 ; 85 21560: 75 e5 ldi r23, 0x55 ; 85 21562: 85 e5 ldi r24, 0x55 ; 85 21564: 91 e4 ldi r25, 0x41 ; 65 21566: 0f 94 11 85 call 0x30a22 ; 0x30a22 delay_keep_alive(2000); 2156a: 80 ed ldi r24, 0xD0 ; 208 2156c: 97 e0 ldi r25, 0x07 ; 7 2156e: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 21572: 87 e0 ldi r24, 0x07 ; 7 21574: 9f e4 ldi r25, 0x4F ; 79 21576: 0e 94 3c 6d call 0xda78 ; 0xda78 2157a: 0f 94 92 0a call 0x21524 ; 0x21524 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2157e: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 21582: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 21586: 07 2e mov r0, r23 21588: 00 0c add r0, r0 2158a: 88 0b sbc r24, r24 2158c: 99 0b sbc r25, r25 2158e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 21592: 9b 01 movw r18, r22 21594: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 21596: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2159a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2159e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 215a2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 215a6: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 215aa: 9f 77 andi r25, 0x7F ; 127 215ac: 20 e0 ldi r18, 0x00 ; 0 215ae: 30 e0 ldi r19, 0x00 ; 0 215b0: 40 ea ldi r20, 0xA0 ; 160 215b2: 50 e4 ldi r21, 0x40 ; 64 215b4: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 215b8: 18 16 cp r1, r24 215ba: b4 f5 brge .+108 ; 0x21628 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 215bc: 87 e0 ldi r24, 0x07 ; 7 215be: 9f e4 ldi r25, 0x4F ; 79 215c0: 0e 94 3c 6d call 0xda78 ; 0xda78 215c4: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_set_cursor(0, 4); 215c8: 64 e0 ldi r22, 0x04 ; 4 215ca: 80 e0 ldi r24, 0x00 ; 0 215cc: 0e 94 06 6a call 0xd40c ; 0xd40c 215d0: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 215d4: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 215d8: 07 2e mov r0, r23 215da: 00 0c add r0, r0 215dc: 88 0b sbc r24, r24 215de: 99 0b sbc r25, r25 215e0: 0f 94 0b 9b call 0x33616 ; 0x33616 <__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)); 215e4: 20 e0 ldi r18, 0x00 ; 0 215e6: 30 e0 ldi r19, 0x00 ; 0 215e8: 40 e0 ldi r20, 0x00 ; 0 215ea: 5f e3 ldi r21, 0x3F ; 63 215ec: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 215f0: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 215f4: 6b 01 movw r12, r22 215f6: 20 e0 ldi r18, 0x00 ; 0 215f8: 30 e0 ldi r19, 0x00 ; 0 215fa: 40 e0 ldi r20, 0x00 ; 0 215fc: 5f e3 ldi r21, 0x3F ; 63 215fe: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21602: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21606: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2160a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2160e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 21612: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 21616: a6 01 movw r20, r12 21618: 82 e8 ldi r24, 0x82 ; 130 2161a: 0f 94 95 06 call 0x20d2a ; 0x20d2a delay_keep_alive(1000); 2161e: 88 ee ldi r24, 0xE8 ; 232 21620: 93 e0 ldi r25, 0x03 ; 3 21622: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 21626: ab cf rjmp .-170 ; 0x2157e } } 21628: ff 90 pop r15 2162a: ef 90 pop r14 2162c: df 90 pop r13 2162e: cf 90 pop r12 21630: 08 95 ret 00021632 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 21632: cf 92 push r12 21634: df 92 push r13 21636: ef 92 push r14 21638: ff 92 push r15 2163a: 0f 93 push r16 2163c: 1f 93 push r17 2163e: cf 93 push r28 21640: df 93 push r29 21642: d8 2e mov r13, r24 21644: 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) 21646: 01 e0 ldi r16, 0x01 ; 1 21648: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2164c: 81 11 cpse r24, r1 2164e: 01 c0 rjmp .+2 ; 0x21652 21650: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 21652: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 21656: 8d 2d mov r24, r13 21658: 9c 2d mov r25, r12 2165a: 0f 94 92 0a call 0x21524 ; 0x21524 2165e: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 21660: 0e 94 1e 6c call 0xd83c ; 0xd83c KEEPALIVE_STATE(PAUSED_FOR_USER); 21664: 84 e0 ldi r24, 0x04 ; 4 21666: 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); 2166a: 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) { 2166c: 20 97 sbiw r28, 0x00 ; 0 2166e: 29 f4 brne .+10 ; 0x2167a // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 21670: 49 e8 ldi r20, 0x89 ; 137 21672: 63 e0 ldi r22, 0x03 ; 3 21674: 83 e1 ldi r24, 0x13 ; 19 21676: 0e 94 26 6a call 0xd44c ; 0xd44c * @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); 2167a: 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); 2167c: 82 e3 ldi r24, 0x32 ; 50 2167e: 90 e0 ldi r25, 0x00 ; 0 21680: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (lcd_clicked()) { 21684: 0e 94 23 6c call 0xd846 ; 0xd846 21688: 88 23 and r24, r24 2168a: 81 f0 breq .+32 ; 0x216ac if (msg_next == NULL) { 2168c: 20 97 sbiw r28, 0x00 ; 0 2168e: 81 f4 brne .+32 ; 0x216b0 KEEPALIVE_STATE(IN_HANDLER); 21690: 82 e0 ldi r24, 0x02 ; 2 21692: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 21696: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 2169a: df 91 pop r29 2169c: cf 91 pop r28 2169e: 1f 91 pop r17 216a0: 0f 91 pop r16 216a2: ff 90 pop r15 216a4: ef 90 pop r14 216a6: df 90 pop r13 216a8: cf 90 pop r12 216aa: 08 95 ret 216ac: 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) { 216ae: 31 f7 brne .-52 ; 0x2167c else { break; } } } if (multi_screen) { 216b0: e1 14 cp r14, r1 216b2: f1 04 cpc r15, r1 216b4: d9 f2 breq .-74 ; 0x2166c if (msg_next == NULL) 216b6: 20 97 sbiw r28, 0x00 ; 0 216b8: 11 f4 brne .+4 ; 0x216be msg_next = msg; 216ba: cd 2d mov r28, r13 216bc: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 216be: ce 01 movw r24, r28 216c0: 0f 94 92 0a call 0x21524 ; 0x21524 216c4: ec 01 movw r28, r24 216c6: d2 cf rjmp .-92 ; 0x2166c 000216c8 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 216c8: cf 93 push r28 216ca: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 216cc: 89 ef ldi r24, 0xF9 ; 249 216ce: 90 e5 ldi r25, 0x50 ; 80 216d0: 0e 94 3c 6d call 0xda78 ; 0xda78 216d4: 0f 94 19 0b call 0x21632 ; 0x21632 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 216d8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 216dc: 81 30 cpi r24, 0x01 ; 1 216de: 69 f4 brne .+26 ; 0x216fa { lcd_show_fullscreen_message_and_wait_P( 216e0: 80 ea ldi r24, 0xA0 ; 160 216e2: 90 e5 ldi r25, 0x50 ; 80 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 216e4: 0e 94 3c 6d call 0xda78 ; 0xda78 216e8: 0f 94 19 0b call 0x21632 ; 0x21632 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 216ec: 8e ec ldi r24, 0xCE ; 206 216ee: 9f e4 ldi r25, 0x4F ; 79 216f0: 0e 94 3c 6d call 0xda78 ; 0xda78 _T(MSG_WIZARD_V2_CAL_2)); } 216f4: 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( 216f6: 0d 94 19 0b jmp 0x21632 ; 0x21632 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 216fa: cc 23 and r28, r28 216fc: b9 f3 breq .-18 ; 0x216ec { lcd_show_fullscreen_message_and_wait_P( 216fe: 8e e6 ldi r24, 0x6E ; 110 21700: 90 e5 ldi r25, 0x50 ; 80 21702: f0 cf rjmp .-32 ; 0x216e4 00021704 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 21704: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21708: 81 30 cpi r24, 0x01 ; 1 2170a: 71 f4 brne .+28 ; 0x21728 lcd_show_fullscreen_message_and_wait_P( 2170c: 85 e7 ldi r24, 0x75 ; 117 2170e: 9f e4 ldi r25, 0x4F ; 79 21710: 0e 94 3c 6d call 0xda78 ; 0xda78 21714: 0f 94 19 0b call 0x21632 ; 0x21632 _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; 21718: 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; 2171a: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 2171e: 61 e0 ldi r22, 0x01 ; 1 21720: 81 e2 ldi r24, 0x21 ; 33 21722: 99 e9 ldi r25, 0x99 ; 153 21724: 0c 94 3a 7d jmp 0xfa74 ; 0xfa74 // 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( 21728: 89 e2 ldi r24, 0x29 ; 41 2172a: 9f e4 ldi r25, 0x4F ; 79 2172c: 0e 94 3c 6d call 0xda78 ; 0xda78 21730: 0f 94 19 0b call 0x21632 ; 0x21632 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 21734: 80 e0 ldi r24, 0x00 ; 0 21736: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 2173a: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 2173e: 84 ec ldi r24, 0xC4 ; 196 21740: 9a e5 ldi r25, 0x5A ; 90 21742: 0e 94 3c 6d call 0xda78 ; 0xda78 21746: ac 01 movw r20, r24 21748: 62 e0 ldi r22, 0x02 ; 2 2174a: 80 e0 ldi r24, 0x00 ; 0 2174c: 0e 94 1a 6a call 0xd434 ; 0xd434 eFilamentAction = FilamentAction::Load; 21750: 81 e0 ldi r24, 0x01 ; 1 21752: e3 cf rjmp .-58 ; 0x2171a 00021754 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 21754: cf 93 push r28 21756: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 21758: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 disable_x(); 2175c: 17 9a sbi 0x02, 7 ; 2 2175e: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); 21762: 16 9a sbi 0x02, 6 ; 2 21764: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); 21768: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2176a: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 2176e: 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); 21772: 68 2f mov r22, r24 21774: 86 ea ldi r24, 0xA6 ; 166 21776: 9f e0 ldi r25, 0x0F ; 15 21778: 0f 94 a1 a0 call 0x34142 ; 0x34142 2177c: 6c 2f mov r22, r28 2177e: 8f ea ldi r24, 0xAF ; 175 21780: 9f e0 ldi r25, 0x0F ; 15 21782: 0f 94 a1 a0 call 0x34142 ; 0x34142 // 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) { 21786: cc 23 and r28, r28 21788: 89 f0 breq .+34 ; 0x217ac SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 2178a: 85 eb ldi r24, 0xB5 ; 181 2178c: 98 e9 ldi r25, 0x98 ; 152 2178e: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 21792: 89 ec ldi r24, 0xC9 ; 201 21794: 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)); 21796: 0e 94 3c 6d call 0xda78 ; 0xda78 2179a: 0f 94 19 0b call 0x21632 ; 0x21632 } lcd_update_enable(true); 2179e: 81 e0 ldi r24, 0x01 ; 1 217a0: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_update(2); 217a4: 82 e0 ldi r24, 0x02 ; 2 } 217a6: 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); 217a8: 0c 94 cd 69 jmp 0xd39a ; 0xd39a 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."); 217ac: 8a e7 ldi r24, 0x7A ; 122 217ae: 98 e9 ldi r25, 0x98 ; 152 217b0: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 217b4: 8e ea ldi r24, 0xAE ; 174 217b6: 9d e4 ldi r25, 0x4D ; 77 217b8: ee cf rjmp .-36 ; 0x21796 000217ba : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 217ba: 1f 93 push r17 217bc: cf 93 push r28 217be: 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); 217c0: 64 e6 ldi r22, 0x64 ; 100 217c2: 70 e0 ldi r23, 0x00 ; 0 217c4: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 217c8: 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++) { 217ca: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 217cc: 4e e2 ldi r20, 0x2E ; 46 217ce: 63 e0 ldi r22, 0x03 ; 3 217d0: 81 2f mov r24, r17 217d2: 0e 94 26 6a call 0xd44c ; 0xd44c //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 217d6: ce 01 movw r24, r28 217d8: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 217dc: ce 01 movw r24, r28 217de: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 217e2: ce 01 movw r24, r28 217e4: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 217e8: ce 01 movw r24, r28 217ea: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 217ee: ce 01 movw r24, r28 217f0: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 217f4: 1f 5f subi r17, 0xFF ; 255 217f6: 14 31 cpi r17, 0x14 ; 20 217f8: 49 f7 brne .-46 ; 0x217cc //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 217fa: df 91 pop r29 217fc: cf 91 pop r28 217fe: 1f 91 pop r17 21800: 08 95 ret 00021802 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 21802: 10 92 62 03 sts 0x0362, r1 ; 0x800362 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 21806: 08 95 ret 00021808 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 21808: cf 93 push r28 MENU_BEGIN(); 2180a: 0f 94 5d 93 call 0x326ba ; 0x326ba 2180e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 21812: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21816: 84 30 cpi r24, 0x04 ; 4 21818: 08 f0 brcs .+2 ; 0x2181c 2181a: b1 c0 rjmp .+354 ; 0x2197e 2181c: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 21820: 8f e5 ldi r24, 0x5F ; 95 21822: 9f e0 ldi r25, 0x0F ; 15 21824: 0f 94 7d a0 call 0x340fa ; 0x340fa 21828: 81 11 cpse r24, r1 2182a: 0f c0 rjmp .+30 ; 0x2184a { ON_MENU_LEAVE( 2182c: 0f 94 dd 91 call 0x323ba ; 0x323ba 21830: 81 11 cpse r24, r1 21832: 0f 94 01 0c call 0x21802 ; 0x21802 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 21836: 80 91 62 03 lds r24, 0x0362 ; 0x800362 2183a: 8a 30 cpi r24, 0x0A ; 10 2183c: a9 f1 breq .+106 ; 0x218a8 2183e: 8a e5 ldi r24, 0x5A ; 90 21840: 9e e3 ldi r25, 0x3E ; 62 21842: 0e 94 3c 6d call 0xda78 ; 0xda78 21846: 0f 94 28 96 call 0x32c50 ; 0x32c50 } if (farm_mode) 2184a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 2184e: 88 23 and r24, r24 21850: 71 f1 breq .+92 ; 0x218ae { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 21852: 63 e9 ldi r22, 0x93 ; 147 21854: 78 e3 ldi r23, 0x38 ; 56 21856: 87 e2 ldi r24, 0x27 ; 39 21858: 98 e9 ldi r25, 0x98 ; 152 2185a: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 2185e: 6b ec ldi r22, 0xCB ; 203 21860: 78 e3 ldi r23, 0x38 ; 56 21862: 87 e1 ldi r24, 0x17 ; 23 21864: 98 e9 ldi r25, 0x98 ; 152 21866: 0f 94 da 92 call 0x325b4 ; 0x325b4 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); 2186a: 8f e5 ldi r24, 0x5F ; 95 2186c: 9f e0 ldi r25, 0x0F ; 15 2186e: 0f 94 7d a0 call 0x340fa ; 0x340fa 21872: 81 11 cpse r24, r1 21874: 0c c0 rjmp .+24 ; 0x2188e 21876: 80 91 62 03 lds r24, 0x0362 ; 0x800362 2187a: 89 30 cpi r24, 0x09 ; 9 2187c: 41 f4 brne .+16 ; 0x2188e 2187e: 8b e0 ldi r24, 0x0B ; 11 21880: 9b e4 ldi r25, 0x4B ; 75 21882: 0e 94 3c 6d call 0xda78 ; 0xda78 21886: 61 e0 ldi r22, 0x01 ; 1 21888: 78 e3 ldi r23, 0x38 ; 56 2188a: 0f 94 da 92 call 0x325b4 ; 0x325b4 MENU_END(); 2188e: 0f 94 31 93 call 0x32662 ; 0x32662 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 21892: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21896: 8f 5f subi r24, 0xFF ; 255 21898: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 2189c: 80 91 30 04 lds r24, 0x0430 ; 0x800430 218a0: 8f 5f subi r24, 0xFF ; 255 218a2: 80 93 30 04 sts 0x0430, r24 ; 0x800430 218a6: b5 cf rjmp .-150 ; 0x21812 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)); 218a8: 86 e7 ldi r24, 0x76 ; 118 218aa: 90 e4 ldi r25, 0x40 ; 64 218ac: ca cf rjmp .-108 ; 0x21842 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(); 218ae: 0e 94 b5 fd call 0x1fb6a ; 0x1fb6a 218b2: 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); 218b4: 8c ef ldi r24, 0xFC ; 252 218b6: 97 e9 ldi r25, 0x97 ; 151 218b8: cc 23 and r28, r28 218ba: 11 f0 breq .+4 ; 0x218c0 218bc: 8b e0 ldi r24, 0x0B ; 11 218be: 98 e9 ldi r25, 0x98 ; 152 218c0: 67 e4 ldi r22, 0x47 ; 71 218c2: 77 e3 ldi r23, 0x37 ; 55 218c4: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 218c8: 81 ee ldi r24, 0xE1 ; 225 218ca: 97 e9 ldi r25, 0x97 ; 151 218cc: cc 23 and r28, r28 218ce: 11 f0 breq .+4 ; 0x218d4 218d0: 80 ef ldi r24, 0xF0 ; 240 218d2: 97 e9 ldi r25, 0x97 ; 151 218d4: 6d ee ldi r22, 0xED ; 237 218d6: 77 e3 ldi r23, 0x37 ; 55 218d8: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 218dc: 85 ec ldi r24, 0xC5 ; 197 218de: 97 e9 ldi r25, 0x97 ; 151 218e0: cc 23 and r28, r28 218e2: 11 f0 breq .+4 ; 0x218e8 218e4: 85 ed ldi r24, 0xD5 ; 213 218e6: 97 e9 ldi r25, 0x97 ; 151 218e8: 6f ea ldi r22, 0xAF ; 175 218ea: 77 e3 ldi r23, 0x37 ; 55 218ec: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 218f0: 89 ea ldi r24, 0xA9 ; 169 218f2: 97 e9 ldi r25, 0x97 ; 151 218f4: cc 23 and r28, r28 218f6: 11 f0 breq .+4 ; 0x218fc 218f8: 89 eb ldi r24, 0xB9 ; 185 218fa: 97 e9 ldi r25, 0x97 ; 151 218fc: 63 e2 ldi r22, 0x23 ; 35 218fe: 78 e3 ldi r23, 0x38 ; 56 21900: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 21904: 8e e8 ldi r24, 0x8E ; 142 21906: 97 e9 ldi r25, 0x97 ; 151 21908: cc 23 and r28, r28 2190a: 11 f0 breq .+4 ; 0x21910 2190c: 8d e9 ldi r24, 0x9D ; 157 2190e: 97 e9 ldi r25, 0x97 ; 151 21910: 6b e4 ldi r22, 0x4B ; 75 21912: 77 e3 ldi r23, 0x37 ; 55 21914: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 21918: 83 e7 ldi r24, 0x73 ; 115 2191a: 97 e9 ldi r25, 0x97 ; 151 2191c: cc 23 and r28, r28 2191e: 11 f0 breq .+4 ; 0x21924 21920: 82 e8 ldi r24, 0x82 ; 130 21922: 97 e9 ldi r25, 0x97 ; 151 21924: 61 e6 ldi r22, 0x61 ; 97 21926: 77 e3 ldi r23, 0x37 ; 55 21928: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 2192c: 87 e5 ldi r24, 0x57 ; 87 2192e: 97 e9 ldi r25, 0x97 ; 151 21930: cc 23 and r28, r28 21932: 11 f0 breq .+4 ; 0x21938 21934: 87 e6 ldi r24, 0x67 ; 103 21936: 97 e9 ldi r25, 0x97 ; 151 21938: 6f e3 ldi r22, 0x3F ; 63 2193a: 77 e3 ldi r23, 0x37 ; 55 2193c: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 21940: 8b e3 ldi r24, 0x3B ; 59 21942: 97 e9 ldi r25, 0x97 ; 151 21944: cc 23 and r28, r28 21946: 11 f0 breq .+4 ; 0x2194c 21948: 8b e4 ldi r24, 0x4B ; 75 2194a: 97 e9 ldi r25, 0x97 ; 151 2194c: 6b e8 ldi r22, 0x8B ; 139 2194e: 77 e3 ldi r23, 0x37 ; 55 21950: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 21954: 8f e1 ldi r24, 0x1F ; 31 21956: 97 e9 ldi r25, 0x97 ; 151 21958: cc 23 and r28, r28 2195a: 11 f0 breq .+4 ; 0x21960 2195c: 8f e2 ldi r24, 0x2F ; 47 2195e: 97 e9 ldi r25, 0x97 ; 151 21960: 6b e7 ldi r22, 0x7B ; 123 21962: 77 e3 ldi r23, 0x37 ; 55 21964: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 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); 21968: 84 e0 ldi r24, 0x04 ; 4 2196a: 97 e9 ldi r25, 0x97 ; 151 2196c: cc 23 and r28, r28 2196e: 11 f0 breq .+4 ; 0x21974 21970: 83 e1 ldi r24, 0x13 ; 19 21972: 97 e9 ldi r25, 0x97 ; 151 21974: 6b e4 ldi r22, 0x4B ; 75 21976: 78 e3 ldi r23, 0x38 ; 56 21978: 0f 94 db 95 call 0x32bb6 ; 0x32bb6 2197c: 76 cf rjmp .-276 ; 0x2186a } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 2197e: cf 91 pop r28 21980: 08 95 ret 00021982 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 21982: 89 e0 ldi r24, 0x09 ; 9 21984: 80 93 62 03 sts 0x0362, r24 ; 0x800362 lcd_generic_preheat_menu(); 21988: 0d 94 04 0c jmp 0x21808 ; 0x21808 0002198c : // 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); 2198c: 81 e0 ldi r24, 0x01 ; 1 2198e: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 21992: 0f 94 30 41 call 0x28260 ; 0x28260 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; 21996: 90 91 7c 12 lds r25, 0x127C ; 0x80127c 2199a: 93 36 cpi r25, 0x63 ; 99 2199c: 09 f4 brne .+2 ; 0x219a0 2199e: 9f ef ldi r25, 0xFF ; 255 219a0: 89 13 cpse r24, r25 219a2: 0e c0 rjmp .+28 ; 0x219c0 lcd_putc('F'); 219a4: 86 e4 ldi r24, 0x46 ; 70 219a6: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 219aa: 0f 94 30 41 call 0x28260 ; 0x28260 219ae: 8f 3f cpi r24, 0xFF ; 255 219b0: 29 f0 breq .+10 ; 0x219bc 219b2: 8f 5c subi r24, 0xCF ; 207 219b4: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 219b8: 83 e0 ldi r24, 0x03 ; 3 219ba: 08 95 ret 219bc: 8f e3 ldi r24, 0x3F ; 63 219be: fa cf rjmp .-12 ; 0x219b4 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 219c0: 8f 3f cpi r24, 0xFF ; 255 219c2: 89 f0 breq .+34 ; 0x219e6 219c4: 8f 5c subi r24, 0xCF ; 207 219c6: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_putc('>'); 219ca: 8e e3 ldi r24, 0x3E ; 62 219cc: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 219d0: 80 91 7c 12 lds r24, 0x127C ; 0x80127c 219d4: 83 36 cpi r24, 0x63 ; 99 219d6: 49 f0 breq .+18 ; 0x219ea lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 219d8: 8f 3f cpi r24, 0xFF ; 255 219da: 39 f0 breq .+14 ; 0x219ea 219dc: 8f 5c subi r24, 0xCF ; 207 219de: 0e 94 f5 69 call 0xd3ea ; 0xd3ea chars += 3; 219e2: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 219e4: 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'); 219e6: 8f e3 ldi r24, 0x3F ; 63 219e8: ee cf rjmp .-36 ; 0x219c6 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 219ea: 8f e3 ldi r24, 0x3F ; 63 219ec: f8 cf rjmp .-16 ; 0x219de 000219ee <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 219ee: 1f 92 push r1 219f0: 0f 92 push r0 219f2: 0f b6 in r0, 0x3f ; 63 219f4: 0f 92 push r0 219f6: 11 24 eor r1, r1 219f8: 0b b6 in r0, 0x3b ; 59 219fa: 0f 92 push r0 219fc: 2f 93 push r18 219fe: 3f 93 push r19 21a00: 4f 93 push r20 21a02: 5f 93 push r21 21a04: 6f 93 push r22 21a06: 7f 93 push r23 21a08: 8f 93 push r24 21a0a: 9f 93 push r25 21a0c: af 93 push r26 21a0e: bf 93 push r27 21a10: ef 93 push r30 21a12: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 21a14: 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 21a18: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 uint8_t buf_r = ptr[2]; //get read index 21a1c: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 21a20: e8 2f mov r30, r24 21a22: f0 e0 ldi r31, 0x00 ; 0 21a24: ed 54 subi r30, 0x4D ; 77 21a26: f2 4f sbci r31, 0xF2 ; 242 21a28: 20 83 st Z, r18 buf_w++; //incerment write index 21a2a: 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 21a2c: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 21a30: 82 17 cp r24, r18 21a32: 08 f0 brcs .+2 ; 0x21a36 <__vector_51+0x48> 21a34: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 21a36: 98 13 cpse r25, r24 21a38: 17 c0 rjmp .+46 ; 0x21a68 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 21a3a: 88 e9 ldi r24, 0x98 ; 152 21a3c: 95 e9 ldi r25, 0x95 ; 149 21a3e: 0f 94 66 9f call 0x33ecc ; 0x33ecc } } 21a42: ff 91 pop r31 21a44: ef 91 pop r30 21a46: bf 91 pop r27 21a48: af 91 pop r26 21a4a: 9f 91 pop r25 21a4c: 8f 91 pop r24 21a4e: 7f 91 pop r23 21a50: 6f 91 pop r22 21a52: 5f 91 pop r21 21a54: 4f 91 pop r20 21a56: 3f 91 pop r19 21a58: 2f 91 pop r18 21a5a: 0f 90 pop r0 21a5c: 0b be out 0x3b, r0 ; 59 21a5e: 0f 90 pop r0 21a60: 0f be out 0x3f, r0 ; 63 21a62: 0f 90 pop r0 21a64: 1f 90 pop r1 21a66: 18 95 reti ptr[1] = buf_w; //store write index 21a68: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 21a6c: ea cf rjmp .-44 ; 0x21a42 <__vector_51+0x54> 00021a6e <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21a6e: 1f 92 push r1 21a70: 0f 92 push r0 21a72: 0f b6 in r0, 0x3f ; 63 21a74: 0f 92 push r0 21a76: 11 24 eor r1, r1 WRITE(BEEPER, 0); 21a78: 72 98 cbi 0x0e, 2 ; 14 } 21a7a: 0f 90 pop r0 21a7c: 0f be out 0x3f, r0 ; 63 21a7e: 0f 90 pop r0 21a80: 1f 90 pop r1 21a82: 18 95 reti 00021a84 <__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) { 21a84: 1f 92 push r1 21a86: 0f 92 push r0 21a88: 0f b6 in r0, 0x3f ; 63 21a8a: 0f 92 push r0 21a8c: 11 24 eor r1, r1 WRITE(BEEPER, 1); 21a8e: 72 9a sbi 0x0e, 2 ; 14 } 21a90: 0f 90 pop r0 21a92: 0f be out 0x3f, r0 ; 63 21a94: 0f 90 pop r0 21a96: 1f 90 pop r1 21a98: 18 95 reti 00021a9a : void delay2(unsigned long ms) { 21a9a: 8f 92 push r8 21a9c: 9f 92 push r9 21a9e: af 92 push r10 21aa0: bf 92 push r11 21aa2: cf 92 push r12 21aa4: df 92 push r13 21aa6: ef 92 push r14 21aa8: ff 92 push r15 21aaa: 6b 01 movw r12, r22 21aac: 7c 01 movw r14, r24 uint32_t start = micros2(); 21aae: 0e 94 c4 f7 call 0x1ef88 ; 0x1ef88 21ab2: 4b 01 movw r8, r22 21ab4: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 21ab6: c1 14 cp r12, r1 21ab8: d1 04 cpc r13, r1 21aba: e1 04 cpc r14, r1 21abc: f1 04 cpc r15, r1 21abe: b9 f0 breq .+46 ; 0x21aee 21ac0: 0e 94 c4 f7 call 0x1ef88 ; 0x1ef88 21ac4: 68 19 sub r22, r8 21ac6: 79 09 sbc r23, r9 21ac8: 8a 09 sbc r24, r10 21aca: 9b 09 sbc r25, r11 21acc: 68 3e cpi r22, 0xE8 ; 232 21ace: 73 40 sbci r23, 0x03 ; 3 21ad0: 81 05 cpc r24, r1 21ad2: 91 05 cpc r25, r1 21ad4: 80 f3 brcs .-32 ; 0x21ab6 { ms--; 21ad6: 21 e0 ldi r18, 0x01 ; 1 21ad8: c2 1a sub r12, r18 21ada: d1 08 sbc r13, r1 21adc: e1 08 sbc r14, r1 21ade: f1 08 sbc r15, r1 start += 1000; 21ae0: 88 ee ldi r24, 0xE8 ; 232 21ae2: 88 0e add r8, r24 21ae4: 83 e0 ldi r24, 0x03 ; 3 21ae6: 98 1e adc r9, r24 21ae8: a1 1c adc r10, r1 21aea: b1 1c adc r11, r1 21aec: e4 cf rjmp .-56 ; 0x21ab6 } } } 21aee: ff 90 pop r15 21af0: ef 90 pop r14 21af2: df 90 pop r13 21af4: cf 90 pop r12 21af6: bf 90 pop r11 21af8: af 90 pop r10 21afa: 9f 90 pop r9 21afc: 8f 90 pop r8 21afe: 08 95 ret 00021b00 : * @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() { 21b00: ef 92 push r14 21b02: ff 92 push r15 21b04: 0f 93 push r16 21b06: 1f 93 push r17 21b08: cf 93 push r28 21b0a: df 93 push r29 21b0c: cd b7 in r28, 0x3d ; 61 21b0e: de b7 in r29, 0x3e ; 62 21b10: 63 97 sbiw r28, 0x13 ; 19 21b12: 0f b6 in r0, 0x3f ; 63 21b14: f8 94 cli 21b16: de bf out 0x3e, r29 ; 62 21b18: 0f be out 0x3f, r0 ; 63 21b1a: 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) 21b1c: 80 91 64 03 lds r24, 0x0364 ; 0x800364 21b20: 81 11 cpse r24, r1 21b22: 3a c0 rjmp .+116 ; 0x21b98 { // Menu was entered. // Initialize its status. _md->status = 1; 21b24: 81 e0 ldi r24, 0x01 ; 1 21b26: 80 93 64 03 sts 0x0364, r24 ; 0x800364 check_babystep(); 21b2a: 0e 94 3d 73 call 0xe67a ; 0xe67a if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 21b2e: 81 ea ldi r24, 0xA1 ; 161 21b30: 9d e0 ldi r25, 0x0D ; 13 21b32: 0f 94 7d a0 call 0x340fa ; 0x340fa 21b36: 18 2f mov r17, r24 21b38: 0e 94 a3 6f call 0xdf46 ; 0xdf46 21b3c: 81 11 cpse r24, r1 21b3e: ee c0 rjmp .+476 ; 0x21d1c _md->babystepMemZ = 0; 21b40: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21b44: 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)) 21b48: 80 e1 ldi r24, 0x10 ; 16 21b4a: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 21b4e: 81 11 cpse r24, r1 21b50: 04 c0 rjmp .+8 ; 0x21b5a _md->babystepMemZ = 0; 21b52: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21b56: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 21b5a: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21b5e: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21b62: 07 2e mov r0, r23 21b64: 00 0c add r0, r0 21b66: 88 0b sbc r24, r24 21b68: 99 0b sbc r25, r25 21b6a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 21b6e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21b72: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21b76: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21b7a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21b7e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 21b82: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21b86: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21b8a: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21b8e: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a lcd_draw_update = 1; 21b92: 81 e0 ldi r24, 0x01 ; 1 21b94: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 21b98: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21b9c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21ba0: 00 97 sbiw r24, 0x00 ; 0 21ba2: f1 f1 breq .+124 ; 0x21c20 { _md->babystepMemZ += lcd_encoder; 21ba4: 20 91 65 03 lds r18, 0x0365 ; 0x800365 21ba8: 30 91 66 03 lds r19, 0x0366 ; 0x800366 21bac: 28 0f add r18, r24 21bae: 39 1f adc r19, r25 21bb0: 30 93 66 03 sts 0x0366, r19 ; 0x800366 21bb4: 20 93 65 03 sts 0x0365, r18 ; 0x800365 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 21bb8: 21 36 cpi r18, 0x61 ; 97 21bba: 40 ef ldi r20, 0xF0 ; 240 21bbc: 34 07 cpc r19, r20 21bbe: 0c f0 brlt .+2 ; 0x21bc2 21bc0: ba c0 rjmp .+372 ; 0x21d36 21bc2: 81 e6 ldi r24, 0x61 ; 97 21bc4: 90 ef ldi r25, 0xF0 ; 240 21bc6: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21bca: 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]; 21bce: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21bd2: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21bd6: 07 2e mov r0, r23 21bd8: 00 0c add r0, r0 21bda: 88 0b sbc r24, r24 21bdc: 99 0b sbc r25, r25 21bde: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 21be2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21be6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21bea: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21bee: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21bf2: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 21bf6: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21bfa: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21bfe: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21c02: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a _delay(50); 21c06: 62 e3 ldi r22, 0x32 ; 50 21c08: 70 e0 ldi r23, 0x00 ; 0 21c0a: 80 e0 ldi r24, 0x00 ; 0 21c0c: 90 e0 ldi r25, 0x00 ; 0 21c0e: 0f 94 4d 0d call 0x21a9a ; 0x21a9a lcd_encoder = 0; 21c12: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21c16: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_draw_update = 1; 21c1a: 81 e0 ldi r24, 0x01 ; 1 21c1c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update) 21c20: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21c24: 88 23 and r24, r24 21c26: c9 f1 breq .+114 ; 0x21c9a { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 21c28: 81 ea ldi r24, 0xA1 ; 161 21c2a: 9d e0 ldi r25, 0x0D ; 13 21c2c: 0f 94 7d a0 call 0x340fa ; 0x340fa 21c30: 2b e0 ldi r18, 0x0B ; 11 21c32: 82 9f mul r24, r18 21c34: c0 01 movw r24, r0 21c36: 11 24 eor r1, r1 21c38: be 01 movw r22, r28 21c3a: 6f 5f subi r22, 0xFF ; 255 21c3c: 7f 4f sbci r23, 0xFF ; 255 21c3e: 87 5b subi r24, 0xB7 ; 183 21c40: 92 4f sbci r25, 0xF2 ; 242 21c42: 0f 94 f7 91 call 0x323ee ; 0x323ee lcd_home(); 21c46: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_print(buffer.c); 21c4a: ce 01 movw r24, r28 21c4c: 01 96 adiw r24, 0x01 ; 1 21c4e: 0e 94 0d 6c call 0xd81a ; 0xd81a lcd_set_cursor(0, 1); 21c52: 61 e0 ldi r22, 0x01 ; 1 21c54: 80 e0 ldi r24, 0x00 ; 0 21c56: 0e 94 06 6a call 0xd40c ; 0xd40c menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 21c5a: 10 91 67 03 lds r17, 0x0367 ; 0x800367 21c5e: 00 91 68 03 lds r16, 0x0368 ; 0x800368 21c62: f0 90 69 03 lds r15, 0x0369 ; 0x800369 21c66: e0 90 6a 03 lds r14, 0x036A ; 0x80036a 21c6a: 8c e5 ldi r24, 0x5C ; 92 21c6c: 9c e4 ldi r25, 0x4C ; 76 21c6e: 0e 94 3c 6d call 0xda78 ; 0xda78 //! (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); 21c72: ef 92 push r14 21c74: ff 92 push r15 21c76: 0f 93 push r16 21c78: 1f 93 push r17 21c7a: 9f 93 push r25 21c7c: 8f 93 push r24 21c7e: 1f 92 push r1 21c80: 80 e2 ldi r24, 0x20 ; 32 21c82: 8f 93 push r24 21c84: 85 e6 ldi r24, 0x65 ; 101 21c86: 98 e9 ldi r25, 0x98 ; 152 21c88: 9f 93 push r25 21c8a: 8f 93 push r24 21c8c: 0e 94 df 69 call 0xd3be ; 0xd3be 21c90: 0f b6 in r0, 0x3f ; 63 21c92: f8 94 cli 21c94: de bf out 0x3e, r29 ; 62 21c96: 0f be out 0x3f, r0 ; 63 21c98: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 21c9a: 80 91 63 03 lds r24, 0x0363 ; 0x800363 21c9e: 81 11 cpse r24, r1 21ca0: 04 c0 rjmp .+8 ; 0x21caa 21ca2: 80 91 92 03 lds r24, 0x0392 ; 0x800392 21ca6: 88 23 and r24, r24 21ca8: 51 f1 breq .+84 ; 0x21cfe { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 21caa: 81 ea ldi r24, 0xA1 ; 161 21cac: 9d e0 ldi r25, 0x0D ; 13 21cae: 0f 94 7d a0 call 0x340fa ; 0x340fa 21cb2: 9b e0 ldi r25, 0x0B ; 11 21cb4: 89 9f mul r24, r25 21cb6: 80 01 movw r16, r0 21cb8: 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); 21cba: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21cbe: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21cc2: c8 01 movw r24, r16 21cc4: 80 5b subi r24, 0xB0 ; 176 21cc6: 92 4f sbci r25, 0xF2 ; 242 21cc8: 0f 94 bf a0 call 0x3417e ; 0x3417e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 21ccc: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 21cd0: c8 01 movw r24, r16 21cd2: 8e 5a subi r24, 0xAE ; 174 21cd4: 92 4f sbci r25, 0xF2 ; 242 21cd6: 0f 94 a1 a0 call 0x34142 ; 0x34142 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); 21cda: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 21cde: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 21ce2: 80 91 90 06 lds r24, 0x0690 ; 0x800690 21ce6: 90 91 91 06 lds r25, 0x0691 ; 0x800691 21cea: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 21cee: c8 01 movw r24, r16 21cf0: 8d 5a subi r24, 0xAD ; 173 21cf2: 92 4f sbci r25, 0xF2 ; 242 21cf4: 0f 94 a1 a0 call 0x34142 ; 0x34142 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 21cf8: 80 e1 ldi r24, 0x10 ; 16 21cfa: 0e 94 80 c6 call 0x18d00 ; 0x18d00 } menu_back_if_clicked(); 21cfe: 0f 94 c7 96 call 0x32d8e ; 0x32d8e } 21d02: 63 96 adiw r28, 0x13 ; 19 21d04: 0f b6 in r0, 0x3f ; 63 21d06: f8 94 cli 21d08: de bf out 0x3e, r29 ; 62 21d0a: 0f be out 0x3f, r0 ; 63 21d0c: cd bf out 0x3d, r28 ; 61 21d0e: df 91 pop r29 21d10: cf 91 pop r28 21d12: 1f 91 pop r17 21d14: 0f 91 pop r16 21d16: ff 90 pop r15 21d18: ef 90 pop r14 21d1a: 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-> 21d1c: 2b e0 ldi r18, 0x0B ; 11 21d1e: 12 9f mul r17, r18 21d20: c0 01 movw r24, r0 21d22: 11 24 eor r1, r1 21d24: 80 5b subi r24, 0xB0 ; 176 21d26: 92 4f sbci r25, 0xF2 ; 242 21d28: 0f 94 8b a0 call 0x34116 ; 0x34116 21d2c: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21d30: 80 93 65 03 sts 0x0365, r24 ; 0x800365 21d34: 09 cf rjmp .-494 ; 0x21b48 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 21d36: 12 16 cp r1, r18 21d38: 13 06 cpc r1, r19 21d3a: 2c f4 brge .+10 ; 0x21d46 21d3c: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21d40: 10 92 65 03 sts 0x0365, r1 ; 0x800365 21d44: 44 cf rjmp .-376 ; 0x21bce extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 21d46: 2f b7 in r18, 0x3f ; 63 21d48: f8 94 cli babystepsTodo[Z_AXIS] += n; 21d4a: 40 91 8c 06 lds r20, 0x068C ; 0x80068c 21d4e: 50 91 8d 06 lds r21, 0x068D ; 0x80068d 21d52: 84 0f add r24, r20 21d54: 95 1f adc r25, r21 21d56: 90 93 8d 06 sts 0x068D, r25 ; 0x80068d 21d5a: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c CRITICAL_SECTION_END 21d5e: 2f bf out 0x3f, r18 ; 63 21d60: 36 cf rjmp .-404 ; 0x21bce 00021d62 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 21d62: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21d66: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21d6a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21d6e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 21d72: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 21d76: 20 91 57 02 lds r18, 0x0257 ; 0x800257 21d7a: 30 91 58 02 lds r19, 0x0258 ; 0x800258 21d7e: 26 17 cp r18, r22 21d80: 37 07 cpc r19, r23 21d82: 0c f0 brlt .+2 ; 0x21d86 21d84: 65 c0 rjmp .+202 ; 0x21e50 { if (lcd_encoder != 0) 21d86: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21d8a: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21d8e: 89 2b or r24, r25 21d90: b9 f1 breq .+110 ; 0x21e00 { refresh_cmd_timeout(); 21d92: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 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; 21d96: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 21d9a: 8f 5f subi r24, 0xFF ; 255 21d9c: 80 31 cpi r24, 0x10 ; 16 21d9e: 09 f4 brne .+2 ; 0x21da2 next_block_index = 0; 21da0: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 21da2: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 21da6: 98 17 cp r25, r24 21da8: 59 f1 breq .+86 ; 0x21e00 { current_position[E_AXIS] += lcd_encoder; 21daa: 60 91 06 05 lds r22, 0x0506 ; 0x800506 21dae: 70 91 07 05 lds r23, 0x0507 ; 0x800507 21db2: 07 2e mov r0, r23 21db4: 00 0c add r0, r0 21db6: 88 0b sbc r24, r24 21db8: 99 0b sbc r25, r25 21dba: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 21dbe: 9b 01 movw r18, r22 21dc0: ac 01 movw r20, r24 21dc2: 60 91 01 12 lds r22, 0x1201 ; 0x801201 21dc6: 70 91 02 12 lds r23, 0x1202 ; 0x801202 21dca: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21dce: 90 91 04 12 lds r25, 0x1204 ; 0x801204 21dd2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 21dd6: 60 93 01 12 sts 0x1201, r22 ; 0x801201 21dda: 70 93 02 12 sts 0x1202, r23 ; 0x801202 21dde: 80 93 03 12 sts 0x1203, r24 ; 0x801203 21de2: 90 93 04 12 sts 0x1204, r25 ; 0x801204 lcd_encoder = 0; 21de6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21dea: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 21dee: 65 e5 ldi r22, 0x55 ; 85 21df0: 75 e5 ldi r23, 0x55 ; 85 21df2: 85 ed ldi r24, 0xD5 ; 213 21df4: 9f e3 ldi r25, 0x3F ; 63 21df6: 0f 94 11 85 call 0x30a22 ; 0x30a22 lcd_draw_update = 1; 21dfa: 81 e0 ldi r24, 0x01 ; 1 21dfc: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 21e00: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21e04: 88 23 and r24, r24 21e06: 11 f1 breq .+68 ; 0x21e4c { lcd_set_cursor(0, 1); 21e08: 61 e0 ldi r22, 0x01 ; 1 21e0a: 80 e0 ldi r24, 0x00 ; 0 21e0c: 0e 94 06 6a call 0xd40c ; 0xd40c //! 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); 21e10: 80 91 04 12 lds r24, 0x1204 ; 0x801204 21e14: 8f 93 push r24 21e16: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21e1a: 8f 93 push r24 21e1c: 80 91 02 12 lds r24, 0x1202 ; 0x801202 21e20: 8f 93 push r24 21e22: 80 91 01 12 lds r24, 0x1201 ; 0x801201 21e26: 8f 93 push r24 21e28: 87 e4 ldi r24, 0x47 ; 71 21e2a: 98 e9 ldi r25, 0x98 ; 152 21e2c: 9f 93 push r25 21e2e: 8f 93 push r24 21e30: 88 e3 ldi r24, 0x38 ; 56 21e32: 98 e9 ldi r25, 0x98 ; 152 21e34: 9f 93 push r25 21e36: 8f 93 push r24 21e38: 0e 94 df 69 call 0xd3be ; 0xd3be 21e3c: 8d b7 in r24, 0x3d ; 61 21e3e: 9e b7 in r25, 0x3e ; 62 21e40: 08 96 adiw r24, 0x08 ; 8 21e42: 0f b6 in r0, 0x3f ; 63 21e44: f8 94 cli 21e46: 9e bf out 0x3e, r25 ; 62 21e48: 0f be out 0x3f, r0 ; 63 21e4a: 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(); 21e4c: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e }; } void show_preheat_nozzle_warning() { lcd_clear(); 21e50: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 21e54: 8d ee ldi r24, 0xED ; 237 21e56: 9b e4 ldi r25, 0x4B ; 75 21e58: 0e 94 3c 6d call 0xda78 ; 0xda78 21e5c: ac 01 movw r20, r24 21e5e: 60 e0 ldi r22, 0x00 ; 0 21e60: 80 e0 ldi r24, 0x00 ; 0 21e62: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 21e66: 87 ed ldi r24, 0xD7 ; 215 21e68: 9b e4 ldi r25, 0x4B ; 75 21e6a: 0e 94 3c 6d call 0xda78 ; 0xda78 21e6e: ac 01 movw r20, r24 21e70: 62 e0 ldi r22, 0x02 ; 2 21e72: 80 e0 ldi r24, 0x00 ; 0 21e74: 0e 94 1a 6a call 0xd434 ; 0xd434 _delay(2000); 21e78: 60 ed ldi r22, 0xD0 ; 208 21e7a: 77 e0 ldi r23, 0x07 ; 7 21e7c: 80 e0 ldi r24, 0x00 ; 0 21e7e: 90 e0 ldi r25, 0x00 ; 0 21e80: 0f 94 4d 0d call 0x21a9a ; 0x21a9a lcd_clear(); 21e84: 0e 94 39 6a call 0xd472 ; 0xd472 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 21e88: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 00021e8c : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21e8c: 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(); 21e8e: f8 94 cli m = timer2_millis; 21e90: 60 91 65 06 lds r22, 0x0665 ; 0x800665 21e94: 70 91 66 06 lds r23, 0x0666 ; 0x800666 21e98: 80 91 67 06 lds r24, 0x0667 ; 0x800667 21e9c: 90 91 68 06 lds r25, 0x0668 ; 0x800668 SREG = oldSREG; 21ea0: 2f bf out 0x3f, r18 ; 63 return m; } 21ea2: 08 95 ret 00021ea4 : //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 21ea4: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 21ea8: 81 11 cpse r24, r1 21eaa: 06 c0 rjmp .+12 ; 0x21eb8 21eac: 60 e0 ldi r22, 0x00 ; 0 21eae: 70 e0 ldi r23, 0x00 ; 0 21eb0: 80 e8 ldi r24, 0x80 ; 128 21eb2: 9f eb ldi r25, 0xBF ; 191 21eb4: 0f 94 8f 41 call 0x2831e ; 0x2831e //! @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); 21eb8: 8a ed ldi r24, 0xDA ; 218 21eba: 9a e6 ldi r25, 0x6A ; 106 21ebc: 0e 94 de 72 call 0xe5bc ; 0xe5bc // Indicate that the printer is paused did_pause_print = true; 21ec0: 81 e0 ldi r24, 0x01 ; 1 21ec2: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b } else return false; } bool Stopwatch::pause() { if (isRunning()) { 21ec6: 80 91 59 03 lds r24, 0x0359 ; 0x800359 21eca: 81 30 cpi r24, 0x01 ; 1 21ecc: 69 f4 brne .+26 ; 0x21ee8 state = PAUSED; 21ece: 82 e0 ldi r24, 0x02 ; 2 21ed0: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 21ed4: 0f 94 46 0f call 0x21e8c ; 0x21e8c 21ed8: 60 93 78 06 sts 0x0678, r22 ; 0x800678 21edc: 70 93 79 06 sts 0x0679, r23 ; 0x800679 21ee0: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 21ee4: 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; 21ee8: 82 e0 ldi r24, 0x02 ; 2 21eea: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 21eee: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 00021ef2 ::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) 21ef2: ff 92 push r15 21ef4: 0f 93 push r16 21ef6: 1f 93 push r17 21ef8: cf 93 push r28 21efa: df 93 push r29 { if (!m_isRunning) return false; 21efc: fc 01 movw r30, r24 21efe: f0 80 ld r15, Z 21f00: f1 10 cpse r15, r1 21f02: 08 c0 rjmp .+16 ; 0x21f14 ::expired(unsigned short)+0x22> 21f04: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 21f06: 8f 2d mov r24, r15 21f08: df 91 pop r29 21f0a: cf 91 pop r28 21f0c: 1f 91 pop r17 21f0e: 0f 91 pop r16 21f10: ff 90 pop r15 21f12: 08 95 ret 21f14: 8b 01 movw r16, r22 21f16: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21f18: 0f 94 46 0f call 0x21e8c ; 0x21e8c if (m_started <= m_started + msPeriod) 21f1c: 89 81 ldd r24, Y+1 ; 0x01 21f1e: 9a 81 ldd r25, Y+2 ; 0x02 21f20: 08 0f add r16, r24 21f22: 19 1f adc r17, r25 21f24: 08 17 cp r16, r24 21f26: 19 07 cpc r17, r25 21f28: 40 f0 brcs .+16 ; 0x21f3a ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 21f2a: 60 17 cp r22, r16 21f2c: 71 07 cpc r23, r17 21f2e: 18 f4 brcc .+6 ; 0x21f36 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21f30: 68 17 cp r22, r24 21f32: 79 07 cpc r23, r25 21f34: 38 f7 brcc .-50 ; 0x21f04 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 21f36: 18 82 st Y, r1 21f38: e6 cf rjmp .-52 ; 0x21f06 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21f3a: 60 17 cp r22, r16 21f3c: 71 07 cpc r23, r17 21f3e: c0 f7 brcc .-16 ; 0x21f30 ::expired(unsigned short)+0x3e> 21f40: e1 cf rjmp .-62 ; 0x21f04 ::expired(unsigned short)+0x12> 00021f42 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 21f42: fc 01 movw r30, r24 21f44: 20 81 ld r18, Z 21f46: 21 11 cpse r18, r1 21f48: 0d 94 79 0f jmp 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> } 21f4c: 81 e0 ldi r24, 0x01 ; 1 21f4e: 08 95 ret 00021f50 ::start()>: /** * @brief Start timer */ template void Timer::start() 21f50: cf 93 push r28 21f52: df 93 push r29 21f54: ec 01 movw r28, r24 { m_started = _millis(); 21f56: 0f 94 46 0f call 0x21e8c ; 0x21e8c 21f5a: 7a 83 std Y+2, r23 ; 0x02 21f5c: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 21f5e: 81 e0 ldi r24, 0x01 ; 1 21f60: 88 83 st Y, r24 } 21f62: df 91 pop r29 21f64: cf 91 pop r28 21f66: 08 95 ret 00021f68 ::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) 21f68: 8f 92 push r8 21f6a: 9f 92 push r9 21f6c: af 92 push r10 21f6e: bf 92 push r11 21f70: cf 92 push r12 21f72: df 92 push r13 21f74: ef 92 push r14 21f76: ff 92 push r15 21f78: 1f 93 push r17 21f7a: cf 93 push r28 21f7c: df 93 push r29 { if (!m_isRunning) return false; 21f7e: fc 01 movw r30, r24 21f80: 10 81 ld r17, Z 21f82: 11 11 cpse r17, r1 21f84: 0e c0 rjmp .+28 ; 0x21fa2 ::expired(unsigned long)+0x3a> 21f86: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 21f88: 81 2f mov r24, r17 21f8a: df 91 pop r29 21f8c: cf 91 pop r28 21f8e: 1f 91 pop r17 21f90: ff 90 pop r15 21f92: ef 90 pop r14 21f94: df 90 pop r13 21f96: cf 90 pop r12 21f98: bf 90 pop r11 21f9a: af 90 pop r10 21f9c: 9f 90 pop r9 21f9e: 8f 90 pop r8 21fa0: 08 95 ret 21fa2: 6a 01 movw r12, r20 21fa4: 7b 01 movw r14, r22 21fa6: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21fa8: 0f 94 46 0f call 0x21e8c ; 0x21e8c 21fac: 4b 01 movw r8, r22 21fae: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 21fb0: 89 81 ldd r24, Y+1 ; 0x01 21fb2: 9a 81 ldd r25, Y+2 ; 0x02 21fb4: ab 81 ldd r26, Y+3 ; 0x03 21fb6: bc 81 ldd r27, Y+4 ; 0x04 21fb8: c8 0e add r12, r24 21fba: d9 1e adc r13, r25 21fbc: ea 1e adc r14, r26 21fbe: fb 1e adc r15, r27 21fc0: c8 16 cp r12, r24 21fc2: d9 06 cpc r13, r25 21fc4: ea 06 cpc r14, r26 21fc6: fb 06 cpc r15, r27 21fc8: 60 f0 brcs .+24 ; 0x21fe2 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 21fca: 8c 14 cp r8, r12 21fcc: 9d 04 cpc r9, r13 21fce: ae 04 cpc r10, r14 21fd0: bf 04 cpc r11, r15 21fd2: 28 f4 brcc .+10 ; 0x21fde ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21fd4: 88 16 cp r8, r24 21fd6: 99 06 cpc r9, r25 21fd8: aa 06 cpc r10, r26 21fda: bb 06 cpc r11, r27 21fdc: a0 f6 brcc .-88 ; 0x21f86 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 21fde: 18 82 st Y, r1 21fe0: d3 cf rjmp .-90 ; 0x21f88 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21fe2: 8c 14 cp r8, r12 21fe4: 9d 04 cpc r9, r13 21fe6: ae 04 cpc r10, r14 21fe8: bf 04 cpc r11, r15 21fea: a0 f7 brcc .-24 ; 0x21fd4 ::expired(unsigned long)+0x6c> 21fec: cc cf rjmp .-104 ; 0x21f86 ::expired(unsigned long)+0x1e> 00021fee : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 21fee: 0f 93 push r16 21ff0: 1f 93 push r17 21ff2: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 21ff4: 80 91 99 03 lds r24, 0x0399 ; 0x800399 21ff8: 88 23 and r24, r24 21ffa: 09 f4 brne .+2 ; 0x21ffe 21ffc: 4d c0 rjmp .+154 ; 0x22098 heating_status_counter++; 21ffe: 80 91 71 06 lds r24, 0x0671 ; 0x800671 22002: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 22004: 8e 30 cpi r24, 0x0E ; 14 22006: b0 f4 brcc .+44 ; 0x22034 //! @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++; 22008: 80 93 71 06 sts 0x0671, r24 ; 0x800671 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 2200c: 63 e0 ldi r22, 0x03 ; 3 2200e: 87 e0 ldi r24, 0x07 ; 7 22010: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_space(13); 22014: 8d e0 ldi r24, 0x0D ; 13 22016: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2201a: c0 e0 ldi r28, 0x00 ; 0 2201c: 80 91 71 06 lds r24, 0x0671 ; 0x800671 22020: c8 17 cp r28, r24 22022: 58 f4 brcc .+22 ; 0x2203a lcd_putc_at(7 + dots, 3, '.'); 22024: 4e e2 ldi r20, 0x2E ; 46 22026: 63 e0 ldi r22, 0x03 ; 3 22028: 87 e0 ldi r24, 0x07 ; 7 2202a: 8c 0f add r24, r28 2202c: 0e 94 26 6a call 0xd44c ; 0xd44c heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 22030: cf 5f subi r28, 0xFF ; 255 22032: f4 cf rjmp .-24 ; 0x2201c 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; 22034: 10 92 71 06 sts 0x0671, r1 ; 0x800671 22038: e9 cf rjmp .-46 ; 0x2200c lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 2203a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2203e: 82 30 cpi r24, 0x02 ; 2 22040: d1 f0 breq .+52 ; 0x22076 22042: 30 f4 brcc .+12 ; 0x22050 22044: 81 30 cpi r24, 0x01 ; 1 22046: 59 f0 breq .+22 ; 0x2205e case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 22048: cf 91 pop r28 2204a: 1f 91 pop r17 2204c: 0f 91 pop r16 2204e: 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) { 22050: 83 30 cpi r24, 0x03 ; 3 22052: f9 f0 breq .+62 ; 0x22092 22054: 84 30 cpi r24, 0x04 ; 4 22056: c1 f7 brne .-16 ; 0x22048 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)); 22058: 87 e4 ldi r24, 0x47 ; 71 2205a: 99 e4 ldi r25, 0x49 ; 73 2205c: 0e c0 rjmp .+28 ; 0x2207a 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)); 2205e: 80 e7 ldi r24, 0x70 ; 112 22060: 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)); 22062: 0e 94 3c 6d call 0xda78 ; 0xda78 22066: ac 01 movw r20, r24 22068: 63 e0 ldi r22, 0x03 ; 3 2206a: 80 e0 ldi r24, 0x00 ; 0 break; } } } 2206c: cf 91 pop r28 2206e: 1f 91 pop r17 22070: 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)); 22072: 0c 94 1a 6a jmp 0xd434 ; 0xd434 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)); 22076: 80 e6 ldi r24, 0x60 ; 96 22078: 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)); 2207a: 0e 94 3c 6d call 0xda78 ; 0xda78 2207e: ac 01 movw r20, r24 22080: 63 e0 ldi r22, 0x03 ; 3 22082: 80 e0 ldi r24, 0x00 ; 0 22084: 0e 94 1a 6a call 0xd434 ; 0xd434 heating_status = HeatingStatus::NO_HEATING; 22088: 10 92 99 03 sts 0x0399, r1 ; 0x800399 heating_status_counter = 0; 2208c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 22090: db cf rjmp .-74 ; 0x22048 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)); 22092: 82 e5 ldi r24, 0x52 ; 82 22094: 99 e4 ldi r25, 0x49 ; 73 22096: e5 cf rjmp .-54 ; 0x22062 break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 22098: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 2209c: 88 23 and r24, r24 2209e: 61 f1 breq .+88 ; 0x220f8 break; default: break; } } else if ((IS_SD_PRINTING) && 220a0: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 220a4: 81 11 cpse r24, r1 220a6: 28 c0 rjmp .+80 ; 0x220f8 (custom_message_type == CustomMsg::Status) && 220a8: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 220ac: 82 30 cpi r24, 0x02 ; 2 220ae: 20 f5 brcc .+72 ; 0x220f8 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 220b0: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 220b4: 81 11 cpse r24, r1 220b6: 16 c0 rjmp .+44 ; 0x220e4 (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); 220b8: 80 91 81 13 lds r24, 0x1381 ; 0x801381 220bc: 88 23 and r24, r24 220be: 09 f4 brne .+2 ; 0x220c2 220c0: 35 c0 rjmp .+106 ; 0x2212c 220c2: 81 e8 ldi r24, 0x81 ; 129 220c4: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 220c6: 20 91 cc 0d lds r18, 0x0DCC ; 0x800dcc 220ca: 64 e1 ldi r22, 0x14 ; 20 220cc: 82 0f add r24, r18 220ce: 91 1d adc r25, r1 220d0: 0e 94 f5 6b call 0xd7ea ; 0xd7ea 220d4: 81 11 cpse r24, r1 220d6: 2d c0 rjmp .+90 ; 0x22132 { scrollstuff++; 220d8: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 220dc: 8f 5f subi r24, 0xFF ; 255 220de: 80 93 cc 0d sts 0x0DCC, r24 ; 0x800dcc 220e2: b2 cf rjmp .-156 ; 0x22048 220e4: 40 e2 ldi r20, 0x20 ; 32 220e6: 5e e4 ldi r21, 0x4E ; 78 220e8: 60 e0 ldi r22, 0x00 ; 0 220ea: 70 e0 ldi r23, 0x00 ; 0 220ec: 8e e1 ldi r24, 0x1E ; 30 220ee: 95 e0 ldi r25, 0x05 ; 5 220f0: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> 220f4: 81 11 cpse r24, r1 220f6: e0 cf rjmp .-64 ; 0x220b8 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) 220f8: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 220fc: 81 11 cpse r24, r1 220fe: 1c c0 rjmp .+56 ; 0x22138 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 22100: e0 91 c7 06 lds r30, 0x06C7 ; 0x8006c7 22104: ea 30 cpi r30, 0x0A ; 10 22106: 08 f0 brcs .+2 ; 0x2210a 22108: 9f cf rjmp .-194 ; 0x22048 2210a: f0 e0 ldi r31, 0x00 ; 0 2210c: 88 27 eor r24, r24 2210e: e4 57 subi r30, 0x74 ; 116 22110: ff 4e sbci r31, 0xEF ; 239 22112: 8e 4f sbci r24, 0xFE ; 254 22114: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 22118: 27 37 cpi r18, 0x77 ; 119 2211a: d7 37 cpi r29, 0x77 ; 119 2211c: 27 37 cpi r18, 0x77 ; 119 2211e: 7d 37 cpi r23, 0x7D ; 125 22120: 67 38 cpi r22, 0x87 ; 135 22122: 77 38 cpi r23, 0x87 ; 135 22124: 27 37 cpi r18, 0x77 ; 119 22126: 27 37 cpi r18, 0x77 ; 119 22128: d3 38 cpi r29, 0x83 ; 131 2212a: 27 37 cpi r18, 0x77 ; 119 (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); 2212c: 8c e6 ldi r24, 0x6C ; 108 2212e: 93 e1 ldi r25, 0x13 ; 19 22130: ca cf rjmp .-108 ; 0x220c6 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 22132: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 22136: 88 cf rjmp .-240 ; 0x22048 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 22138: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.418> 2213c: 88 23 and r24, r24 2213e: 01 f3 breq .-64 ; 0x22100 * 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; 22140: 0f 94 46 0f call 0x21e8c ; 0x21e8c 22144: 00 91 1f 05 lds r16, 0x051F ; 0x80051f <_ZL26lcd_status_message_timeout.lto_priv.418+0x1> 22148: 10 91 20 05 lds r17, 0x0520 ; 0x800520 <_ZL26lcd_status_message_timeout.lto_priv.418+0x2> 2214c: 20 91 21 05 lds r18, 0x0521 ; 0x800521 <_ZL26lcd_status_message_timeout.lto_priv.418+0x3> 22150: 30 91 22 05 lds r19, 0x0522 ; 0x800522 <_ZL26lcd_status_message_timeout.lto_priv.418+0x4> 22154: 60 1b sub r22, r16 22156: 71 0b sbc r23, r17 22158: 82 0b sbc r24, r18 2215a: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 2215c: 60 3a cpi r22, 0xA0 ; 160 2215e: 7f 40 sbci r23, 0x0F ; 15 22160: 81 05 cpc r24, r1 22162: 91 05 cpc r25, r1 22164: 68 f6 brcc .-102 ; 0x22100 22166: 70 cf rjmp .-288 ; 0x22048 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); 22168: 63 e0 ldi r22, 0x03 ; 3 2216a: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 2216e: 0e 94 06 6a call 0xd40c ; 0xd40c const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 22172: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 22176: c4 e1 ldi r28, 0x14 ; 20 22178: 6c 2f mov r22, r28 2217a: 68 1b sub r22, r24 2217c: 90 e0 ldi r25, 0x00 ; 0 2217e: 87 5f subi r24, 0xF7 ; 247 22180: 9a 4f sbci r25, 0xFA ; 250 22182: 0e 94 f5 6b call 0xd7ea ; 0xd7ea lcd_status_message_idx = LCD_WIDTH - padding; 22186: c8 1b sub r28, r24 22188: c0 93 08 05 sts 0x0508, r28 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.415> 2218c: 5d cf rjmp .-326 ; 0x22048 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 2218e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22192: 8b 30 cpi r24, 0x0B ; 11 22194: 08 f1 brcs .+66 ; 0x221d8 lcd_set_cursor(0, 3); 22196: 63 e0 ldi r22, 0x03 ; 3 22198: 80 e0 ldi r24, 0x00 ; 0 2219a: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_space(LCD_WIDTH); 2219e: 84 e1 ldi r24, 0x14 ; 20 221a0: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 221a4: 87 e3 ldi r24, 0x37 ; 55 221a6: 99 e4 ldi r25, 0x49 ; 73 221a8: 0e 94 3c 6d call 0xda78 ; 0xda78 221ac: ac 01 movw r20, r24 221ae: 63 e0 ldi r22, 0x03 ; 3 221b0: 80 e0 ldi r24, 0x00 ; 0 221b2: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_puts_P(PSTR(" : ")); 221b6: 84 ec ldi r24, 0xC4 ; 196 221b8: 95 e9 ldi r25, 0x95 ; 149 221ba: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_print(custom_message_state - 10); 221be: 60 91 ac 03 lds r22, 0x03AC ; 0x8003ac 221c2: 6a 50 subi r22, 0x0A ; 10 221c4: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 221c6: 07 2e mov r0, r23 221c8: 00 0c add r0, r0 221ca: 88 0b sbc r24, r24 221cc: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 221ce: cf 91 pop r28 221d0: 1f 91 pop r17 221d2: 0f 91 pop r16 221d4: 0c 94 bf 6b jmp 0xd77e ; 0xd77e 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) { 221d8: 83 30 cpi r24, 0x03 ; 3 221da: 31 f4 brne .+12 ; 0x221e8 lcd_setstatuspgm(MSG_WELCOME); 221dc: 8b e0 ldi r24, 0x0B ; 11 221de: 9c e6 ldi r25, 0x6C ; 108 221e0: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe custom_message_type = CustomMsg::Status; 221e4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } if (custom_message_state > 3 && custom_message_state <= 10) { 221e8: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 221ec: 84 50 subi r24, 0x04 ; 4 221ee: 87 30 cpi r24, 0x07 ; 7 221f0: 08 f0 brcs .+2 ; 0x221f4 221f2: 2a cf rjmp .-428 ; 0x22048 lcd_set_cursor(0, 3); 221f4: 63 e0 ldi r22, 0x03 ; 3 221f6: 80 e0 ldi r24, 0x00 ; 0 221f8: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_space(19); 221fc: 83 e1 ldi r24, 0x13 ; 19 221fe: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 22202: 84 e2 ldi r24, 0x24 ; 36 22204: 99 e4 ldi r25, 0x49 ; 73 22206: 0e 94 3c 6d call 0xda78 ; 0xda78 2220a: ac 01 movw r20, r24 2220c: 63 e0 ldi r22, 0x03 ; 3 2220e: 80 e0 ldi r24, 0x00 ; 0 22210: 0e 94 1a 6a call 0xd434 ; 0xd434 custom_message_state--; 22214: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22218: 81 50 subi r24, 0x01 ; 1 2221a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 2221e: 14 cf rjmp .-472 ; 0x22048 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 22220: 64 e1 ldi r22, 0x14 ; 20 22222: 89 e0 ldi r24, 0x09 ; 9 22224: 95 e0 ldi r25, 0x05 ; 5 22226: 0e 94 f5 6b call 0xd7ea ; 0xd7ea if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 2222a: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 2222e: 30 91 70 06 lds r19, 0x0670 ; 0x800670 22232: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 22236: 90 91 6e 06 lds r25, 0x066E ; 0x80066e 2223a: 82 17 cp r24, r18 2223c: 93 07 cpc r25, r19 2223e: 0c f4 brge .+2 ; 0x22242 22240: 03 cf rjmp .-506 ; 0x22048 22242: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22246: 88 23 and r24, r24 22248: 09 f4 brne .+2 ; 0x2224c 2224a: fe ce rjmp .-516 ; 0x22048 lcd_set_cursor(10, 3); 2224c: 63 e0 ldi r22, 0x03 ; 3 2224e: 8a e0 ldi r24, 0x0A ; 10 22250: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 22254: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 22258: 8f 93 push r24 2225a: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 2225e: 8f 93 push r24 22260: 80 91 70 06 lds r24, 0x0670 ; 0x800670 22264: 8f 93 push r24 22266: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 2226a: 8f 93 push r24 2226c: 8b eb ldi r24, 0xBB ; 187 2226e: 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); 22270: 9f 93 push r25 22272: 8f 93 push r24 22274: 0e 94 df 69 call 0xd3be ; 0xd3be 22278: 0f 90 pop r0 2227a: 0f 90 pop r0 2227c: 0f 90 pop r0 2227e: 0f 90 pop r0 22280: 0f 90 pop r0 22282: 0f 90 pop r0 22284: e1 ce rjmp .-574 ; 0x22048 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); 22286: 63 e0 ldi r22, 0x03 ; 3 22288: 80 e0 ldi r24, 0x00 ; 0 2228a: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 2228e: c0 91 ac 03 lds r28, 0x03AC ; 0x8003ac 22292: 86 e3 ldi r24, 0x36 ; 54 22294: 9b e3 ldi r25, 0x3B ; 59 22296: 0e 94 3c 6d call 0xda78 ; 0xda78 2229a: 1f 92 push r1 2229c: cf 93 push r28 2229e: 9f 93 push r25 222a0: 8f 93 push r24 222a2: 8d ea ldi r24, 0xAD ; 173 222a4: 95 e9 ldi r25, 0x95 ; 149 222a6: e4 cf rjmp .-56 ; 0x22270 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 222a8: 84 e1 ldi r24, 0x14 ; 20 222aa: 99 e4 ldi r25, 0x49 ; 73 222ac: 0e 94 3c 6d call 0xda78 ; 0xda78 222b0: ac 01 movw r20, r24 222b2: 63 e0 ldi r22, 0x03 ; 3 222b4: 80 e0 ldi r24, 0x00 ; 0 222b6: 0e 94 1a 6a call 0xd434 ; 0xd434 if (custom_message_state <= PINDA_HEAT_T) { 222ba: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222be: 89 37 cpi r24, 0x79 ; 121 222c0: 08 f0 brcs .+2 ; 0x222c4 222c2: c2 ce rjmp .-636 ; 0x22048 lcd_puts_P(PSTR(": ")); 222c4: 8a ea ldi r24, 0xAA ; 170 222c6: 95 e9 ldi r25, 0x95 ; 149 222c8: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 222cc: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222d0: 0e 94 b5 6a call 0xd56a ; 0xd56a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 222d4: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 222d6: cf 91 pop r28 222d8: 1f 91 pop r17 222da: 0f 91 pop r16 222dc: 0c 94 b5 6a jmp 0xd56a ; 0xd56a lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 222e0: 83 e0 ldi r24, 0x03 ; 3 222e2: 99 e4 ldi r25, 0x49 ; 73 222e4: be ce rjmp .-644 ; 0x22062 000222e6 ::start()>: /** * @brief Start timer */ template void Timer::start() 222e6: cf 93 push r28 222e8: df 93 push r29 222ea: ec 01 movw r28, r24 { m_started = _millis(); 222ec: 0f 94 46 0f call 0x21e8c ; 0x21e8c 222f0: 69 83 std Y+1, r22 ; 0x01 222f2: 7a 83 std Y+2, r23 ; 0x02 222f4: 8b 83 std Y+3, r24 ; 0x03 222f6: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 222f8: 81 e0 ldi r24, 0x01 ; 1 222fa: 88 83 st Y, r24 } 222fc: df 91 pop r29 222fe: cf 91 pop r28 22300: 08 95 ret 00022302 : //! 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) { 22302: cf 92 push r12 22304: df 92 push r13 22306: ef 92 push r14 22308: ff 92 push r15 2230a: 1f 93 push r17 2230c: cf 93 push r28 2230e: df 93 push r29 22310: cd b7 in r28, 0x3d ; 61 22312: de b7 in r29, 0x3e ; 62 22314: 64 97 sbiw r28, 0x14 ; 20 22316: 0f b6 in r0, 0x3f ; 63 22318: f8 94 cli 2231a: de bf out 0x3e, r29 ; 62 2231c: 0f be out 0x3f, r0 ; 63 2231e: cd bf out 0x3d, r28 ; 61 22320: 7c 01 movw r14, r24 22322: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 22324: 63 e7 ldi r22, 0x73 ; 115 22326: 75 e9 ldi r23, 0x95 ; 149 22328: ce 01 movw r24, r28 2232a: 01 96 adiw r24, 0x01 ; 1 2232c: 0f 94 34 9e call 0x33c68 ; 0x33c68 strcat_P(msg, type); 22330: b7 01 movw r22, r14 22332: ce 01 movw r24, r28 22334: 01 96 adiw r24, 0x01 ; 1 22336: 0f 94 20 9e call 0x33c40 ; 0x33c40 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 2233a: 83 e0 ldi r24, 0x03 ; 3 2233c: 0e 94 e5 e1 call 0x1c3ca ; 0x1c3ca 22340: 88 23 and r24, r24 22342: e1 f0 breq .+56 ; 0x2237c bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 22344: be 01 movw r22, r28 22346: 6f 5f subi r22, 0xFF ; 255 22348: 7f 4f sbci r23, 0xFF ; 255 2234a: 89 e0 ldi r24, 0x09 ; 9 2234c: 95 e0 ldi r25, 0x05 ; 5 2234e: 0f 94 df a6 call 0x34dbe ; 0x34dbe 22352: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 22354: 8e e1 ldi r24, 0x1E ; 30 22356: 95 e0 ldi r25, 0x05 ; 5 22358: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> lcd_status_message_level = severity; 2235c: 83 e0 ldi r24, 0x03 ; 3 2235e: 80 93 8e 03 sts 0x038E, r24 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> custom_message_type = CustomMsg::Status; 22362: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 22366: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 2236a: cd 28 or r12, r13 2236c: 39 f0 breq .+14 ; 0x2237c // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 2236e: 60 e0 ldi r22, 0x00 ; 0 22370: ce 01 movw r24, r28 22372: 01 96 adiw r24, 0x01 ; 1 22374: 0e 94 ca e1 call 0x1c394 ; 0x1c394 lcd_return_to_status(); 22378: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 2237c: 8a e5 ldi r24, 0x5A ; 90 2237e: 9e e9 ldi r25, 0x9E ; 158 22380: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if(e != EXTRUDERS) { 22384: 11 30 cpi r17, 0x01 ; 1 22386: 51 f0 breq .+20 ; 0x2239c 22388: 61 2f mov r22, r17 2238a: 70 e0 ldi r23, 0x00 ; 0 2238c: 90 e0 ldi r25, 0x00 ; 0 2238e: 80 e0 ldi r24, 0x00 ; 0 22390: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 22394: 80 e7 ldi r24, 0x70 ; 112 22396: 95 e9 ldi r25, 0x95 ; 149 22398: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } SERIAL_ERRORPGM("Heaters switched off. "); 2239c: 89 e5 ldi r24, 0x59 ; 89 2239e: 95 e9 ldi r25, 0x95 ; 149 223a0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORRPGM(type); 223a4: c7 01 movw r24, r14 223a6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNPGM(" triggered!"); 223aa: 8d e4 ldi r24, 0x4D ; 77 223ac: 95 e9 ldi r25, 0x95 ; 149 223ae: 0e 94 de 72 call 0xe5bc ; 0xe5bc } 223b2: 64 96 adiw r28, 0x14 ; 20 223b4: 0f b6 in r0, 0x3f ; 63 223b6: f8 94 cli 223b8: de bf out 0x3e, r29 ; 62 223ba: 0f be out 0x3f, r0 ; 63 223bc: cd bf out 0x3d, r28 ; 61 223be: df 91 pop r29 223c0: cf 91 pop r28 223c2: 1f 91 pop r17 223c4: ff 90 pop r15 223c6: ef 90 pop r14 223c8: df 90 pop r13 223ca: cf 90 pop r12 223cc: 08 95 ret 000223ce <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 223ce: 1f 92 push r1 223d0: 0f 92 push r0 223d2: 0f b6 in r0, 0x3f ; 63 223d4: 0f 92 push r0 223d6: 11 24 eor r1, r1 223d8: 2f 93 push r18 223da: 3f 93 push r19 223dc: 8f 93 push r24 223de: 9f 93 push r25 223e0: af 93 push r26 223e2: 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; 223e4: 80 91 65 06 lds r24, 0x0665 ; 0x800665 223e8: 90 91 66 06 lds r25, 0x0666 ; 0x800666 223ec: a0 91 67 06 lds r26, 0x0667 ; 0x800667 223f0: b0 91 68 06 lds r27, 0x0668 ; 0x800668 unsigned char f = timer2_fract; 223f4: 30 91 64 06 lds r19, 0x0664 ; 0x800664 m += MILLIS_INC; f += FRACT_INC; 223f8: 23 e0 ldi r18, 0x03 ; 3 223fa: 23 0f add r18, r19 if (f >= FRACT_MAX) 223fc: 2d 37 cpi r18, 0x7D ; 125 223fe: 58 f5 brcc .+86 ; 0x22456 <__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; 22400: 01 96 adiw r24, 0x01 ; 1 22402: a1 1d adc r26, r1 22404: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 22406: 20 93 64 06 sts 0x0664, r18 ; 0x800664 timer2_millis = m; 2240a: 80 93 65 06 sts 0x0665, r24 ; 0x800665 2240e: 90 93 66 06 sts 0x0666, r25 ; 0x800666 22412: a0 93 67 06 sts 0x0667, r26 ; 0x800667 22416: b0 93 68 06 sts 0x0668, r27 ; 0x800668 timer2_overflow_count++; 2241a: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2241e: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 22422: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 22426: b0 91 6c 06 lds r27, 0x066C ; 0x80066c 2242a: 01 96 adiw r24, 0x01 ; 1 2242c: a1 1d adc r26, r1 2242e: b1 1d adc r27, r1 22430: 80 93 69 06 sts 0x0669, r24 ; 0x800669 22434: 90 93 6a 06 sts 0x066A, r25 ; 0x80066a 22438: a0 93 6b 06 sts 0x066B, r26 ; 0x80066b 2243c: b0 93 6c 06 sts 0x066C, r27 ; 0x80066c } 22440: bf 91 pop r27 22442: af 91 pop r26 22444: 9f 91 pop r25 22446: 8f 91 pop r24 22448: 3f 91 pop r19 2244a: 2f 91 pop r18 2244c: 0f 90 pop r0 2244e: 0f be out 0x3f, r0 ; 63 22450: 0f 90 pop r0 22452: 1f 90 pop r1 22454: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 22456: 26 e8 ldi r18, 0x86 ; 134 22458: 23 0f add r18, r19 m += 1; 2245a: 02 96 adiw r24, 0x02 ; 2 2245c: a1 1d adc r26, r1 2245e: b1 1d adc r27, r1 22460: d2 cf rjmp .-92 ; 0x22406 <__vector_15+0x38> 00022462 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 22462: 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; 22464: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 22468: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2246c: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 22470: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22474: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22476: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 22478: 0e 94 ad fa call 0x1f55a ; 0x1f55a temp_mgr_pid(); 2247c: 0e 94 ea f7 call 0x1efd4 ; 0x1efd4 // 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); 22480: 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; 22482: 10 92 92 06 sts 0x0692, r1 ; 0x800692 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22486: cf bf out 0x3f, r28 ; 63 #endif } } 22488: cf 91 pop r28 2248a: 08 95 ret 0002248c : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 2248c: 0f 94 31 12 call 0x22462 ; 0x22462 fanSpeed = 0; 22490: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 lcd_return_to_status(); 22494: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 00022498 : // 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) { 22498: 1f 93 push r17 2249a: cf 93 push r28 2249c: df 93 push r29 2249e: c8 2f mov r28, r24 224a0: 16 2f mov r17, r22 224a2: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 224a4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 224a8: 80 fd sbrc r24, 0 224aa: 18 c0 rjmp .+48 ; 0x224dc 224ac: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 224b0: 81 11 cpse r24, r1 224b2: 14 c0 rjmp .+40 ; 0x224dc saved_bed_temperature = target_temperature_bed; 224b4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 224b8: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_temperature = target_temperature[index]; 224bc: e6 2f mov r30, r22 224be: f0 e0 ldi r31, 0x00 ; 0 224c0: ee 0f add r30, r30 224c2: ff 1f adc r31, r31 224c4: ef 50 subi r30, 0x0F ; 15 224c6: fe 4e sbci r31, 0xEE ; 238 224c8: 80 81 ld r24, Z 224ca: 91 81 ldd r25, Z+1 ; 0x01 224cc: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 224d0: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_fan_speed = fanSpeed; 224d4: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 224d8: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 224dc: 0f 94 31 12 call 0x22462 ; 0x22462 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 224e0: 0e 94 bd 6e call 0xdd7a ; 0xdd7a setExtruderAutoFanState(3); 224e4: 83 e0 ldi r24, 0x03 ; 3 224e6: 0e 94 ca 6e call 0xdd94 ; 0xdd94 SET_OUTPUT(FAN_PIN); 224ea: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 224ee: 88 60 ori r24, 0x08 ; 8 224f0: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 224f4: 8f ef ldi r24, 0xFF ; 255 224f6: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 224fa: 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) { 224fe: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22502: 80 ff sbrs r24, 0 22504: 07 c0 rjmp .+14 ; 0x22514 22506: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2250a: 82 95 swap r24 2250c: 86 95 lsr r24 2250e: 87 70 andi r24, 0x07 ; 7 22510: d8 17 cp r29, r24 22512: c0 f4 brcc .+48 ; 0x22544 temp_error_state.source = (uint8_t)source; 22514: c3 70 andi r28, 0x03 ; 3 22516: cc 0f add r28, r28 22518: cc 0f add r28, r28 2251a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2251e: 83 7f andi r24, 0xF3 ; 243 22520: 8c 2b or r24, r28 22522: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.index = index; 22526: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2252a: 10 fb bst r17, 0 2252c: 84 f9 bld r24, 4 2252e: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.type = (uint8_t)type; 22532: d2 95 swap r29 22534: dd 0f add r29, r29 22536: d0 7e andi r29, 0xE0 ; 224 22538: 40 91 9a 03 lds r20, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2253c: 4f 71 andi r20, 0x1F ; 31 2253e: 4d 2b or r20, r29 22540: 40 93 9a 03 sts 0x039A, r20 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } // always set the error state temp_error_state.error = true; 22544: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22548: 81 60 ori r24, 0x01 ; 1 2254a: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> temp_error_state.assert = true; 2254e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22552: 82 60 ori r24, 0x02 ; 2 22554: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.420> } 22558: df 91 pop r29 2255a: cf 91 pop r28 2255c: 1f 91 pop r17 2255e: 08 95 ret 00022560 : 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) { 22560: 2f 92 push r2 22562: 3f 92 push r3 22564: 4f 92 push r4 22566: 5f 92 push r5 22568: 6f 92 push r6 2256a: 7f 92 push r7 2256c: 8f 92 push r8 2256e: 9f 92 push r9 22570: af 92 push r10 22572: bf 92 push r11 22574: cf 92 push r12 22576: df 92 push r13 22578: ef 92 push r14 2257a: ff 92 push r15 2257c: 0f 93 push r16 2257e: 1f 93 push r17 22580: cf 93 push r28 22582: df 93 push r29 22584: cd b7 in r28, 0x3d ; 61 22586: de b7 in r29, 0x3e ; 62 22588: 2c 97 sbiw r28, 0x0c ; 12 2258a: 0f b6 in r0, 0x3f ; 63 2258c: f8 94 cli 2258e: de bf out 0x3e, r29 ; 62 22590: 0f be out 0x3f, r0 ; 63 22592: cd bf out 0x3d, r28 ; 61 22594: 28 2e mov r2, r24 22596: 49 83 std Y+1, r20 ; 0x01 22598: 5a 83 std Y+2, r21 ; 0x02 2259a: 6b 83 std Y+3, r22 ; 0x03 2259c: 7c 83 std Y+4, r23 ; 0x04 2259e: 28 01 movw r4, r16 225a0: 39 01 movw r6, r18 225a2: 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) 225a4: 0f 94 46 0f call 0x21e8c ; 0x21e8c 225a8: 02 2d mov r16, r2 225aa: 10 e0 ldi r17, 0x00 ; 0 225ac: 98 01 movw r18, r16 225ae: 22 0f add r18, r18 225b0: 33 1f adc r19, r19 225b2: 22 0f add r18, r18 225b4: 33 1f adc r19, r19 225b6: 3c 87 std Y+12, r19 ; 0x0c 225b8: 2b 87 std Y+11, r18 ; 0x0b 225ba: f9 01 movw r30, r18 225bc: e7 5f subi r30, 0xF7 ; 247 225be: f9 4f sbci r31, 0xF9 ; 249 225c0: 80 80 ld r8, Z 225c2: 91 80 ldd r9, Z+1 ; 0x01 225c4: a2 80 ldd r10, Z+2 ; 0x02 225c6: b3 80 ldd r11, Z+3 ; 0x03 225c8: 68 19 sub r22, r8 225ca: 79 09 sbc r23, r9 225cc: 8a 09 sbc r24, r10 225ce: 9b 09 sbc r25, r11 225d0: 61 3d cpi r22, 0xD1 ; 209 225d2: 77 40 sbci r23, 0x07 ; 7 225d4: 81 05 cpc r24, r1 225d6: 91 05 cpc r25, r1 225d8: 08 f4 brcc .+2 ; 0x225dc 225da: ea c0 rjmp .+468 ; 0x227b0 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 225dc: 33 20 and r3, r3 225de: 09 f4 brne .+2 ; 0x225e2 225e0: 75 c0 rjmp .+234 ; 0x226cc { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 225e2: 88 e6 ldi r24, 0x68 ; 104 225e4: 91 e0 ldi r25, 0x01 ; 1 225e6: 9a 87 std Y+10, r25 ; 0x0a 225e8: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 225ea: 80 e0 ldi r24, 0x00 ; 0 225ec: 90 e0 ldi r25, 0x00 ; 0 225ee: a0 ea ldi r26, 0xA0 ; 160 225f0: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 225f2: 8d 83 std Y+5, r24 ; 0x05 225f4: 9e 83 std Y+6, r25 ; 0x06 225f6: af 83 std Y+7, r26 ; 0x07 225f8: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 225fa: 0f 94 46 0f call 0x21e8c ; 0x21e8c 225fe: eb 85 ldd r30, Y+11 ; 0x0b 22600: fc 85 ldd r31, Y+12 ; 0x0c 22602: e7 5f subi r30, 0xF7 ; 247 22604: f9 4f sbci r31, 0xF9 ; 249 22606: 60 83 st Z, r22 22608: 71 83 std Z+1, r23 ; 0x01 2260a: 82 83 std Z+2, r24 ; 0x02 2260c: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2260e: 20 e0 ldi r18, 0x00 ; 0 22610: 30 e0 ldi r19, 0x00 ; 0 22612: a9 01 movw r20, r18 22614: c7 01 movw r24, r14 22616: b6 01 movw r22, r12 22618: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2261c: 81 11 cpse r24, r1 2261e: 07 c0 rjmp .+14 ; 0x2262e { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22620: f8 01 movw r30, r16 22622: ee 0f add r30, r30 22624: ff 1f adc r31, r31 22626: eb 5f subi r30, 0xFB ; 251 22628: f9 4f sbci r31, 0xF9 ; 249 2262a: 11 82 std Z+1, r1 ; 0x01 2262c: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2262e: ab 85 ldd r26, Y+11 ; 0x0b 22630: bc 85 ldd r27, Y+12 ; 0x0c 22632: a3 50 subi r26, 0x03 ; 3 22634: ba 4f sbci r27, 0xFA ; 250 22636: 5d 01 movw r10, r26 22638: 29 81 ldd r18, Y+1 ; 0x01 2263a: 3a 81 ldd r19, Y+2 ; 0x02 2263c: 4b 81 ldd r20, Y+3 ; 0x03 2263e: 5c 81 ldd r21, Y+4 ; 0x04 22640: 6d 91 ld r22, X+ 22642: 7d 91 ld r23, X+ 22644: 8d 91 ld r24, X+ 22646: 9c 91 ld r25, X 22648: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2264c: 88 23 and r24, r24 2264e: 09 f4 brne .+2 ; 0x22652 22650: 91 c0 rjmp .+290 ; 0x22774 { if (_target_temperature > 0) 22652: 20 e0 ldi r18, 0x00 ; 0 22654: 30 e0 ldi r19, 0x00 ; 0 22656: a9 01 movw r20, r18 22658: 69 81 ldd r22, Y+1 ; 0x01 2265a: 7a 81 ldd r23, Y+2 ; 0x02 2265c: 8b 81 ldd r24, Y+3 ; 0x03 2265e: 9c 81 ldd r25, Y+4 ; 0x04 22660: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22664: f8 01 movw r30, r16 22666: e5 50 subi r30, 0x05 ; 5 22668: fa 4f sbci r31, 0xFA ; 250 2266a: 18 16 cp r1, r24 2266c: c4 f5 brge .+112 ; 0x226de { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 2266e: 81 e0 ldi r24, 0x01 ; 1 22670: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 22672: 89 81 ldd r24, Y+1 ; 0x01 22674: 9a 81 ldd r25, Y+2 ; 0x02 22676: ab 81 ldd r26, Y+3 ; 0x03 22678: bc 81 ldd r27, Y+4 ; 0x04 2267a: f5 01 movw r30, r10 2267c: 80 83 st Z, r24 2267e: 91 83 std Z+1, r25 ; 0x01 22680: a2 83 std Z+2, r26 ; 0x02 22682: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 22684: eb 85 ldd r30, Y+11 ; 0x0b 22686: fc 85 ldd r31, Y+12 ; 0x0c 22688: ed 50 subi r30, 0x0D ; 13 2268a: fa 4f sbci r31, 0xFA ; 250 2268c: 40 82 st Z, r4 2268e: 51 82 std Z+1, r5 ; 0x01 22690: 62 82 std Z+2, r6 ; 0x02 22692: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 22694: f8 01 movw r30, r16 22696: ef 50 subi r30, 0x0F ; 15 22698: fa 4f sbci r31, 0xFA ; 250 2269a: 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)) 2269c: a3 01 movw r20, r6 2269e: 92 01 movw r18, r4 226a0: bc 01 movw r22, r24 226a2: cd 01 movw r24, r26 226a4: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 226a8: 18 16 cp r1, r24 226aa: 1c f5 brge .+70 ; 0x226f2 { __preheat_counter[_heater_id]++; 226ac: f8 01 movw r30, r16 226ae: ef 50 subi r30, 0x0F ; 15 226b0: fa 4f sbci r31, 0xFA ; 250 226b2: 80 81 ld r24, Z 226b4: 8f 5f subi r24, 0xFF ; 255 226b6: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 226b8: 31 10 cpse r3, r1 226ba: c7 c0 rjmp .+398 ; 0x2284a 226bc: 89 30 cpi r24, 0x09 ; 9 226be: c8 f0 brcs .+50 ; 0x226f2 { __delta=2.0; 226c0: 81 2c mov r8, r1 226c2: 91 2c mov r9, r1 226c4: a1 2c mov r10, r1 226c6: 50 e4 ldi r21, 0x40 ; 64 226c8: b5 2e mov r11, r21 226ca: e8 c0 rjmp .+464 ; 0x2289c #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 226cc: ad e2 ldi r26, 0x2D ; 45 226ce: b0 e0 ldi r27, 0x00 ; 0 226d0: ba 87 std Y+10, r27 ; 0x0a 226d2: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 226d4: 80 e0 ldi r24, 0x00 ; 0 226d6: 90 e0 ldi r25, 0x00 ; 0 226d8: a0 e7 ldi r26, 0x70 ; 112 226da: b1 e4 ldi r27, 0x41 ; 65 226dc: 8a cf rjmp .-236 ; 0x225f2 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 226de: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 226e0: 89 81 ldd r24, Y+1 ; 0x01 226e2: 9a 81 ldd r25, Y+2 ; 0x02 226e4: ab 81 ldd r26, Y+3 ; 0x03 226e6: bc 81 ldd r27, Y+4 ; 0x04 226e8: f5 01 movw r30, r10 226ea: 80 83 st Z, r24 226ec: 91 83 std Z+1, r25 ; 0x01 226ee: a2 83 std Z+2, r26 ; 0x02 226f0: 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) 226f2: 2d 81 ldd r18, Y+5 ; 0x05 226f4: 3e 81 ldd r19, Y+6 ; 0x06 226f6: 4f 81 ldd r20, Y+7 ; 0x07 226f8: 58 85 ldd r21, Y+8 ; 0x08 226fa: 69 81 ldd r22, Y+1 ; 0x01 226fc: 7a 81 ldd r23, Y+2 ; 0x02 226fe: 8b 81 ldd r24, Y+3 ; 0x03 22700: 9c 81 ldd r25, Y+4 ; 0x04 22702: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 22706: a3 01 movw r20, r6 22708: 92 01 movw r18, r4 2270a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2270e: 87 ff sbrs r24, 7 22710: 46 c0 rjmp .+140 ; 0x2279e 22712: f8 01 movw r30, r16 22714: e5 50 subi r30, 0x05 ; 5 22716: fa 4f sbci r31, 0xFA ; 250 22718: 80 81 ld r24, Z 2271a: 81 30 cpi r24, 0x01 ; 1 2271c: 49 f4 brne .+18 ; 0x22730 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2271e: 82 e0 ldi r24, 0x02 ; 2 22720: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22722: f8 01 movw r30, r16 22724: ee 0f add r30, r30 22726: ff 1f adc r31, r31 22728: eb 5f subi r30, 0xFB ; 251 2272a: f9 4f sbci r31, 0xF9 ; 249 2272c: 11 82 std Z+1, r1 ; 0x01 2272e: 10 82 st Z, r1 } if (_output > 0) 22730: 20 e0 ldi r18, 0x00 ; 0 22732: 30 e0 ldi r19, 0x00 ; 0 22734: a9 01 movw r20, r18 22736: c7 01 movw r24, r14 22738: b6 01 movw r22, r12 2273a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2273e: 18 16 cp r1, r24 22740: bc f5 brge .+110 ; 0x227b0 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 22742: 29 81 ldd r18, Y+1 ; 0x01 22744: 3a 81 ldd r19, Y+2 ; 0x02 22746: 4b 81 ldd r20, Y+3 ; 0x03 22748: 5c 81 ldd r21, Y+4 ; 0x04 2274a: 6d 81 ldd r22, Y+5 ; 0x05 2274c: 7e 81 ldd r23, Y+6 ; 0x06 2274e: 8f 81 ldd r24, Y+7 ; 0x07 22750: 98 85 ldd r25, Y+8 ; 0x08 22752: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 22756: a3 01 movw r20, r6 22758: 92 01 movw r18, r4 2275a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2275e: 18 16 cp r1, r24 22760: 0c f0 brlt .+2 ; 0x22764 22762: 3f c0 rjmp .+126 ; 0x227e2 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 22764: 00 0f add r16, r16 22766: 11 1f adc r17, r17 22768: f8 01 movw r30, r16 2276a: eb 5f subi r30, 0xFB ; 251 2276c: f9 4f sbci r31, 0xF9 ; 249 2276e: 11 82 std Z+1, r1 ; 0x01 22770: 10 82 st Z, r1 22772: 1e c0 rjmp .+60 ; 0x227b0 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)) 22774: a3 01 movw r20, r6 22776: 92 01 movw r18, r4 22778: 69 81 ldd r22, Y+1 ; 0x01 2277a: 7a 81 ldd r23, Y+2 ; 0x02 2277c: 8b 81 ldd r24, Y+3 ; 0x03 2277e: 9c 81 ldd r25, Y+4 ; 0x04 22780: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22784: 18 16 cp r1, r24 22786: 0c f0 brlt .+2 ; 0x2278a 22788: b4 cf rjmp .-152 ; 0x226f2 2278a: f8 01 movw r30, r16 2278c: e5 50 subi r30, 0x05 ; 5 2278e: fa 4f sbci r31, 0xFA ; 250 22790: 80 81 ld r24, Z 22792: 81 30 cpi r24, 0x01 ; 1 22794: 09 f0 breq .+2 ; 0x22798 22796: ad cf rjmp .-166 ; 0x226f2 22798: 89 cf rjmp .-238 ; 0x226ac 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; 2279a: 10 82 st Z, r1 2279c: 97 c0 rjmp .+302 ; 0x228cc temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 2279e: 20 e0 ldi r18, 0x00 ; 0 227a0: 30 e0 ldi r19, 0x00 ; 0 227a2: a9 01 movw r20, r18 227a4: c7 01 movw r24, r14 227a6: b6 01 movw r22, r12 227a8: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 227ac: 18 16 cp r1, r24 227ae: cc f0 brlt .+50 ; 0x227e2 } } } } } 227b0: 2c 96 adiw r28, 0x0c ; 12 227b2: 0f b6 in r0, 0x3f ; 63 227b4: f8 94 cli 227b6: de bf out 0x3e, r29 ; 62 227b8: 0f be out 0x3f, r0 ; 63 227ba: cd bf out 0x3d, r28 ; 61 227bc: df 91 pop r29 227be: cf 91 pop r28 227c0: 1f 91 pop r17 227c2: 0f 91 pop r16 227c4: ff 90 pop r15 227c6: ef 90 pop r14 227c8: df 90 pop r13 227ca: cf 90 pop r12 227cc: bf 90 pop r11 227ce: af 90 pop r10 227d0: 9f 90 pop r9 227d2: 8f 90 pop r8 227d4: 7f 90 pop r7 227d6: 6f 90 pop r6 227d8: 5f 90 pop r5 227da: 4f 90 pop r4 227dc: 3f 90 pop r3 227de: 2f 90 pop r2 227e0: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 227e2: f8 01 movw r30, r16 227e4: e5 50 subi r30, 0x05 ; 5 227e6: fa 4f sbci r31, 0xFA ; 250 227e8: 80 81 ld r24, Z 227ea: 82 30 cpi r24, 0x02 ; 2 227ec: 08 f3 brcs .-62 ; 0x227b0 { temp_runaway_error_counter[_heater_id]++; 227ee: 00 0f add r16, r16 227f0: 11 1f adc r17, r17 227f2: f8 01 movw r30, r16 227f4: eb 5f subi r30, 0xFB ; 251 227f6: f9 4f sbci r31, 0xF9 ; 249 227f8: 80 81 ld r24, Z 227fa: 91 81 ldd r25, Z+1 ; 0x01 227fc: 01 96 adiw r24, 0x01 ; 1 227fe: 91 83 std Z+1, r25 ; 0x01 22800: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 22802: 88 0f add r24, r24 22804: 99 1f adc r25, r25 22806: e9 85 ldd r30, Y+9 ; 0x09 22808: fa 85 ldd r31, Y+10 ; 0x0a 2280a: e8 17 cp r30, r24 2280c: f9 07 cpc r31, r25 2280e: 80 f6 brcc .-96 ; 0x227b0 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 22810: 43 e0 ldi r20, 0x03 ; 3 22812: 62 2d mov r22, r2 22814: 83 2d mov r24, r3 } } } } } 22816: 2c 96 adiw r28, 0x0c ; 12 22818: 0f b6 in r0, 0x3f ; 63 2281a: f8 94 cli 2281c: de bf out 0x3e, r29 ; 62 2281e: 0f be out 0x3f, r0 ; 63 22820: cd bf out 0x3d, r28 ; 61 22822: df 91 pop r29 22824: cf 91 pop r28 22826: 1f 91 pop r17 22828: 0f 91 pop r16 2282a: ff 90 pop r15 2282c: ef 90 pop r14 2282e: df 90 pop r13 22830: cf 90 pop r12 22832: bf 90 pop r11 22834: af 90 pop r10 22836: 9f 90 pop r9 22838: 8f 90 pop r8 2283a: 7f 90 pop r7 2283c: 6f 90 pop r6 2283e: 5f 90 pop r5 22840: 4f 90 pop r4 22842: 3f 90 pop r3 22844: 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); 22846: 0d 94 4c 12 jmp 0x22498 ; 0x22498 } 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 2284a: 81 31 cpi r24, 0x11 ; 17 2284c: 08 f4 brcc .+2 ; 0x22850 2284e: 51 cf rjmp .-350 ; 0x226f2 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 22850: 20 e0 ldi r18, 0x00 ; 0 22852: 30 e0 ldi r19, 0x00 ; 0 22854: 44 eb ldi r20, 0xB4 ; 180 22856: 52 e4 ldi r21, 0x42 ; 66 22858: c3 01 movw r24, r6 2285a: b2 01 movw r22, r4 2285c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 22860: 81 2c mov r8, r1 22862: 91 2c mov r9, r1 22864: e0 e4 ldi r30, 0x40 ; 64 22866: ae 2e mov r10, r30 22868: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 2286a: 18 16 cp r1, r24 2286c: 2c f4 brge .+10 ; 0x22878 2286e: 81 2c mov r8, r1 22870: 91 2c mov r9, r1 22872: a1 2c mov r10, r1 22874: 70 e4 ldi r23, 0x40 ; 64 22876: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 22878: 20 e0 ldi r18, 0x00 ; 0 2287a: 30 e0 ldi r19, 0x00 ; 0 2287c: 42 ed ldi r20, 0xD2 ; 210 2287e: 52 e4 ldi r21, 0x42 ; 66 22880: c3 01 movw r24, r6 22882: b2 01 movw r22, r4 22884: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22888: 18 16 cp r1, r24 2288a: 44 f4 brge .+16 ; 0x2289c 2288c: 6a e9 ldi r22, 0x9A ; 154 2288e: 86 2e mov r8, r22 22890: 69 e9 ldi r22, 0x99 ; 153 22892: 96 2e mov r9, r22 22894: 69 e1 ldi r22, 0x19 ; 25 22896: a6 2e mov r10, r22 22898: 6f e3 ldi r22, 0x3F ; 63 2289a: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 2289c: eb 85 ldd r30, Y+11 ; 0x0b 2289e: fc 85 ldd r31, Y+12 ; 0x0c 228a0: ed 50 subi r30, 0x0D ; 13 228a2: fa 4f sbci r31, 0xFA ; 250 228a4: 20 81 ld r18, Z 228a6: 31 81 ldd r19, Z+1 ; 0x01 228a8: 42 81 ldd r20, Z+2 ; 0x02 228aa: 53 81 ldd r21, Z+3 ; 0x03 228ac: c3 01 movw r24, r6 228ae: b2 01 movw r22, r4 228b0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 228b4: a5 01 movw r20, r10 228b6: 94 01 movw r18, r8 228b8: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 228bc: f8 01 movw r30, r16 228be: e1 51 subi r30, 0x11 ; 17 228c0: fa 4f sbci r31, 0xFA ; 250 228c2: 87 ff sbrs r24, 7 228c4: 6a cf rjmp .-300 ; 0x2279a __preheat_errors[_heater_id]++; 228c6: 80 81 ld r24, Z 228c8: 8f 5f subi r24, 0xFF ; 255 228ca: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 228cc: 80 81 ld r24, Z 228ce: 90 e0 ldi r25, 0x00 ; 0 228d0: 31 10 cpse r3, r1 228d2: 04 c0 rjmp .+8 ; 0x228dc 228d4: 06 97 sbiw r24, 0x06 ; 6 228d6: 4c f0 brlt .+18 ; 0x228ea set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 228d8: 80 e0 ldi r24, 0x00 ; 0 228da: 03 c0 rjmp .+6 ; 0x228e2 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 228dc: 04 97 sbiw r24, 0x04 ; 4 228de: 2c f0 brlt .+10 ; 0x228ea set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 228e0: 81 e0 ldi r24, 0x01 ; 1 228e2: 42 e0 ldi r20, 0x02 ; 2 228e4: 62 2d mov r22, r2 228e6: 0f 94 4c 12 call 0x22498 ; 0x22498 __preheat_start[_heater_id] = _current_temperature; 228ea: 2b 85 ldd r18, Y+11 ; 0x0b 228ec: 3c 85 ldd r19, Y+12 ; 0x0c 228ee: 2d 50 subi r18, 0x0D ; 13 228f0: 3a 4f sbci r19, 0xFA ; 250 228f2: d9 01 movw r26, r18 228f4: 4d 92 st X+, r4 228f6: 5d 92 st X+, r5 228f8: 6d 92 st X+, r6 228fa: 7c 92 st X, r7 228fc: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 228fe: f8 01 movw r30, r16 22900: ef 50 subi r30, 0x0F ; 15 22902: fa 4f sbci r31, 0xFA ; 250 22904: 10 82 st Z, r1 22906: f5 ce rjmp .-534 ; 0x226f2 00022908 : //! @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() { 22908: 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); 2290a: 89 e2 ldi r24, 0x29 ; 41 2290c: 9d e0 ldi r25, 0x0D ; 13 2290e: 0f 94 7d a0 call 0x340fa ; 0x340fa 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; 22912: 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. 22914: 8f 3f cpi r24, 0xFF ; 255 22916: 91 f4 brne .+36 ; 0x2293c { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22918: 20 e0 ldi r18, 0x00 ; 0 2291a: 30 e0 ldi r19, 0x00 ; 0 2291c: 40 ef ldi r20, 0xF0 ; 240 2291e: 51 e4 ldi r21, 0x41 ; 65 22920: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 22924: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 22928: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2292c: 90 91 91 06 lds r25, 0x0691 ; 0x800691 22930: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22934: 87 ff sbrs r24, 7 22936: 04 c0 rjmp .+8 ; 0x22940 #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22938: c0 e0 ldi r28, 0x00 ; 0 2293a: 02 c0 rjmp .+4 ; 0x22940 2293c: 81 11 cpse r24, r1 2293e: fc cf rjmp .-8 ; 0x22938 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 22940: 8c 2f mov r24, r28 22942: cf 91 pop r28 22944: 08 95 ret 00022946 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 22946: 1f 92 push r1 22948: 0f 92 push r0 2294a: 0f b6 in r0, 0x3f ; 63 2294c: 0f 92 push r0 2294e: 11 24 eor r1, r1 22950: 0b b6 in r0, 0x3b ; 59 22952: 0f 92 push r0 22954: ff 92 push r15 22956: 0f 93 push r16 22958: 1f 93 push r17 2295a: 2f 93 push r18 2295c: 3f 93 push r19 2295e: 4f 93 push r20 22960: 5f 93 push r21 22962: 6f 93 push r22 22964: 7f 93 push r23 22966: 8f 93 push r24 22968: 9f 93 push r25 2296a: af 93 push r26 2296c: bf 93 push r27 2296e: cf 93 push r28 22970: df 93 push r29 22972: ef 93 push r30 22974: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 22976: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2297a: 8b 7f andi r24, 0xFB ; 251 2297c: 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(); 22980: 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) 22982: 48 99 sbic 0x09, 0 ; 9 22984: c6 c0 rjmp .+396 ; 0x22b12 <__vector_14+0x1cc> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 22986: 68 ec ldi r22, 0xC8 ; 200 22988: 70 e0 ldi r23, 0x00 ; 0 2298a: 8f e1 ldi r24, 0x1F ; 31 2298c: 96 e0 ldi r25, 0x06 ; 6 2298e: 0f 94 a1 0f call 0x21f42 ; 0x21f42 ::expired_cont(unsigned short)> 22992: 88 23 and r24, r24 22994: b9 f0 breq .+46 ; 0x229c4 <__vector_14+0x7e> buttonBlanking.start(); 22996: 8f e1 ldi r24, 0x1F ; 31 22998: 96 e0 ldi r25, 0x06 ; 6 2299a: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> safetyTimer.start(); 2299e: 8a e1 ldi r24, 0x1A ; 26 229a0: 96 e0 ldi r25, 0x06 ; 6 229a2: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 229a6: 80 91 19 06 lds r24, 0x0619 ; 0x800619 229aa: 81 11 cpse r24, r1 229ac: a3 c0 rjmp .+326 ; 0x22af4 <__vector_14+0x1ae> 229ae: 80 91 18 06 lds r24, 0x0618 ; 0x800618 229b2: 81 11 cpse r24, r1 229b4: 9f c0 rjmp .+318 ; 0x22af4 <__vector_14+0x1ae> { longPressTimer.start(); 229b6: 85 e1 ldi r24, 0x15 ; 21 229b8: 96 e0 ldi r25, 0x06 ; 6 229ba: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> lcd_button_pressed = 1; 229be: 81 e0 ldi r24, 0x01 ; 1 229c0: 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); 229c4: 8c b1 in r24, 0x0c ; 12 229c6: 80 95 com r24 229c8: 88 1f adc r24, r24 229ca: 88 27 eor r24, r24 229cc: 88 1f adc r24, r24 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 229ce: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 229d2: 93 ff sbrs r25, 3 229d4: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 229d6: e0 91 12 06 lds r30, 0x0612 ; 0x800612 229da: e8 17 cp r30, r24 229dc: e1 f0 breq .+56 ; 0x22a16 <__vector_14+0xd0> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 229de: 24 e0 ldi r18, 0x04 ; 4 229e0: e2 9f mul r30, r18 229e2: f0 01 movw r30, r0 229e4: 11 24 eor r1, r1 229e6: e8 2b or r30, r24 229e8: e7 58 subi r30, 0x87 ; 135 229ea: fa 46 sbci r31, 0x6A ; 106 229ec: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 229ee: 90 91 11 06 lds r25, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> 229f2: e9 0f add r30, r25 229f4: e0 93 11 06 sts 0x0611, r30 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.502> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 229f8: 0e 2e mov r0, r30 229fa: 00 0c add r0, r0 229fc: ff 0b sbc r31, r31 229fe: f7 ff sbrs r31, 7 22a00: 03 c0 rjmp .+6 ; 0x22a08 <__vector_14+0xc2> 22a02: f1 95 neg r31 22a04: e1 95 neg r30 22a06: f1 09 sbc r31, r1 22a08: 34 97 sbiw r30, 0x04 ; 4 22a0a: 1c f0 brlt .+6 ; 0x22a12 <__vector_14+0xcc> lcd_backlight_wake_trigger = true; // flag event, knob rotated 22a0c: 91 e0 ldi r25, 0x01 ; 1 22a0e: 90 93 13 06 sts 0x0613, r25 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> } enc_bits_old = enc_bits; 22a12: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 22a16: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a1a: 81 11 cpse r24, r1 22a1c: 08 c0 rjmp .+16 ; 0x22a2e <__vector_14+0xe8> { soft_pwm_0 = soft_pwm[0]; 22a1e: 80 91 62 06 lds r24, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 22a22: 80 93 28 06 sts 0x0628, r24 ; 0x800628 if(soft_pwm_0 > 0) 22a26: 88 23 and r24, r24 22a28: 09 f4 brne .+2 ; 0x22a2c <__vector_14+0xe6> 22a2a: 87 c0 rjmp .+270 ; 0x22b3a <__vector_14+0x1f4> { WRITE(HEATER_0_PIN,1); 22a2c: 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) 22a2e: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a32: 8f 70 andi r24, 0x0F ; 15 22a34: a9 f4 brne .+42 ; 0x22a60 <__vector_14+0x11a> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 22a36: 80 91 05 05 lds r24, 0x0505 ; 0x800505 22a3a: 90 e0 ldi r25, 0x00 ; 0 22a3c: 24 e0 ldi r18, 0x04 ; 4 22a3e: 95 95 asr r25 22a40: 87 95 ror r24 22a42: 2a 95 dec r18 22a44: e1 f7 brne .-8 ; 0x22a3e <__vector_14+0xf8> 22a46: 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); 22a4a: 89 2b or r24, r25 22a4c: 09 f4 brne .+2 ; 0x22a50 <__vector_14+0x10a> 22a4e: 77 c0 rjmp .+238 ; 0x22b3e <__vector_14+0x1f8> 22a50: 9f b7 in r25, 0x3f ; 63 22a52: f8 94 cli 22a54: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22a58: 88 60 ori r24, 0x08 ; 8 22a5a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22a5e: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22a60: 90 91 28 06 lds r25, 0x0628 ; 0x800628 22a64: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a68: 98 17 cp r25, r24 22a6a: 08 f4 brcc .+2 ; 0x22a6e <__vector_14+0x128> { WRITE(HEATER_0_PIN,0); 22a6c: 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); 22a6e: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a72: 8f 70 andi r24, 0x0F ; 15 22a74: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.432> 22a78: 98 17 cp r25, r24 22a7a: 40 f4 brcc .+16 ; 0x22a8c <__vector_14+0x146> 22a7c: 9f b7 in r25, 0x3f ; 63 22a7e: f8 94 cli 22a80: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22a84: 87 7f andi r24, 0xF7 ; 247 22a86: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22a8a: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 22a8c: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a90: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22a92: 8f 77 andi r24, 0x7F ; 127 22a94: 80 93 70 02 sts 0x0270, r24 ; 0x800270 22a98: 10 e0 ldi r17, 0x00 ; 0 22a9a: 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 22a9c: e8 01 movw r28, r16 22a9e: cc 0f add r28, r28 22aa0: dd 1f adc r29, r29 22aa2: c8 57 subi r28, 0x78 ; 120 22aa4: d9 4f sbci r29, 0xF9 ; 249 22aa6: 88 81 ld r24, Y 22aa8: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 22aaa: 18 16 cp r1, r24 22aac: 19 06 cpc r1, r25 22aae: 0c f0 brlt .+2 ; 0x22ab2 <__vector_14+0x16c> 22ab0: 4c c0 rjmp .+152 ; 0x22b4a <__vector_14+0x204> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22ab2: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22ab4: f8 94 cli babystep(axis,/*fwd*/true); 22ab6: 61 e0 ldi r22, 0x01 ; 1 22ab8: 80 2f mov r24, r16 22aba: 0e 94 0e fb call 0x1f61c ; 0x1f61c babystepsTodo[axis]--; //less to do next time 22abe: 88 81 ld r24, Y 22ac0: 99 81 ldd r25, Y+1 ; 0x01 22ac2: 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 22ac4: 99 83 std Y+1, r25 ; 0x01 22ac6: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22ac8: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 22aca: 0f 5f subi r16, 0xFF ; 255 22acc: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 22ace: 03 30 cpi r16, 0x03 ; 3 22ad0: 11 05 cpc r17, r1 22ad2: 21 f7 brne .-56 ; 0x22a9c <__vector_14+0x156> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 22ad4: 80 91 24 17 lds r24, 0x1724 ; 0x801724 <__bss_end+0x20> 22ad8: 90 91 25 17 lds r25, 0x1725 ; 0x801725 <__bss_end+0x21> 22adc: a0 91 26 17 lds r26, 0x1726 ; 0x801726 <__bss_end+0x22> 22ae0: b0 91 27 17 lds r27, 0x1727 ; 0x801727 <__bss_end+0x23> 22ae4: 82 3a cpi r24, 0xA2 ; 162 22ae6: 92 4a sbci r25, 0xA2 ; 162 22ae8: a1 05 cpc r26, r1 22aea: b1 05 cpc r27, r1 22aec: d9 f1 breq .+118 ; 0x22b64 <__vector_14+0x21e> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 22aee: 81 e0 ldi r24, 0x01 ; 1 22af0: 0e 94 36 75 call 0xea6c ; 0xea6c if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 22af4: 68 ee ldi r22, 0xE8 ; 232 22af6: 73 e0 ldi r23, 0x03 ; 3 22af8: 85 e1 ldi r24, 0x15 ; 21 22afa: 96 e0 ldi r25, 0x06 ; 6 22afc: 0f 94 79 0f call 0x21ef2 ; 0x21ef2 ::expired(unsigned short)> 22b00: 88 23 and r24, r24 22b02: 09 f4 brne .+2 ; 0x22b06 <__vector_14+0x1c0> 22b04: 5f cf rjmp .-322 ; 0x229c4 <__vector_14+0x7e> { lcd_long_press_active = 1; 22b06: 81 e0 ldi r24, 0x01 ; 1 22b08: 80 93 18 06 sts 0x0618, r24 ; 0x800618 lcd_longpress_trigger = 1; 22b0c: 80 93 14 06 sts 0x0614, r24 ; 0x800614 22b10: 59 cf rjmp .-334 ; 0x229c4 <__vector_14+0x7e> } } } else { //button not pressed if (lcd_button_pressed) 22b12: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22b16: 88 23 and r24, r24 22b18: 09 f4 brne .+2 ; 0x22b1c <__vector_14+0x1d6> 22b1a: 54 cf rjmp .-344 ; 0x229c4 <__vector_14+0x7e> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 22b1c: 10 92 19 06 sts 0x0619, r1 ; 0x800619 if (!lcd_long_press_active) 22b20: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22b24: 81 11 cpse r24, r1 22b26: 03 c0 rjmp .+6 ; 0x22b2e <__vector_14+0x1e8> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22b28: 81 e0 ldi r24, 0x01 ; 1 22b2a: 80 93 63 03 sts 0x0363, r24 ; 0x800363 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22b2e: 81 e0 ldi r24, 0x01 ; 1 22b30: 80 93 13 06 sts 0x0613, r24 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.501> lcd_long_press_active = 0; 22b34: 10 92 18 06 sts 0x0618, r1 ; 0x800618 22b38: 45 cf rjmp .-374 ; 0x229c4 <__vector_14+0x7e> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 22b3a: 75 98 cbi 0x0e, 5 ; 14 22b3c: 78 cf rjmp .-272 ; 0x22a2e <__vector_14+0xe8> #ifdef FAN_SOFT_PWM if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0) { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22b3e: 9f b7 in r25, 0x3f ; 63 22b40: f8 94 cli 22b42: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22b46: 87 7f andi r24, 0xF7 ; 247 22b48: 88 cf rjmp .-240 ; 0x22a5a <__vector_14+0x114> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 22b4a: 89 2b or r24, r25 22b4c: 09 f4 brne .+2 ; 0x22b50 <__vector_14+0x20a> 22b4e: bd cf rjmp .-134 ; 0x22aca <__vector_14+0x184> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22b50: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22b52: f8 94 cli babystep(axis,/*fwd*/false); 22b54: 60 e0 ldi r22, 0x00 ; 0 22b56: 80 2f mov r24, r16 22b58: 0e 94 0e fb call 0x1f61c ; 0x1f61c babystepsTodo[axis]++; //less to do next time 22b5c: 88 81 ld r24, Y 22b5e: 99 81 ldd r25, Y+1 ; 0x01 22b60: 01 96 adiw r24, 0x01 ; 1 22b62: b0 cf rjmp .-160 ; 0x22ac4 <__vector_14+0x17e> #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) void readFanTach() { static bool fan_state[2]; #ifdef FAN_SOFT_PWM if (READ(TACH_0) != fan_state[0]) { 22b64: 96 b1 in r25, 0x06 ; 6 22b66: 80 91 26 06 lds r24, 0x0626 ; 0x800626 22b6a: 99 1f adc r25, r25 22b6c: 99 27 eor r25, r25 22b6e: 99 1f adc r25, r25 22b70: 98 17 cp r25, r24 22b72: 91 f0 breq .+36 ; 0x22b98 <__vector_14+0x252> if(fan_measuring) fan_edge_counter[0] ++; 22b74: 90 91 84 03 lds r25, 0x0384 ; 0x800384 22b78: 99 23 and r25, r25 22b7a: 51 f0 breq .+20 ; 0x22b90 <__vector_14+0x24a> 22b7c: 20 91 22 06 lds r18, 0x0622 ; 0x800622 22b80: 30 91 23 06 lds r19, 0x0623 ; 0x800623 22b84: 2f 5f subi r18, 0xFF ; 255 22b86: 3f 4f sbci r19, 0xFF ; 255 22b88: 30 93 23 06 sts 0x0623, r19 ; 0x800623 22b8c: 20 93 22 06 sts 0x0622, r18 ; 0x800622 fan_state[0] = !fan_state[0]; 22b90: 91 e0 ldi r25, 0x01 ; 1 22b92: 89 27 eor r24, r25 22b94: 80 93 26 06 sts 0x0626, r24 ; 0x800626 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22b98: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 22b9a: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22b9e: 84 60 ori r24, 0x04 ; 4 22ba0: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22ba4: ff 91 pop r31 22ba6: ef 91 pop r30 22ba8: df 91 pop r29 22baa: cf 91 pop r28 22bac: bf 91 pop r27 22bae: af 91 pop r26 22bb0: 9f 91 pop r25 22bb2: 8f 91 pop r24 22bb4: 7f 91 pop r23 22bb6: 6f 91 pop r22 22bb8: 5f 91 pop r21 22bba: 4f 91 pop r20 22bbc: 3f 91 pop r19 22bbe: 2f 91 pop r18 22bc0: 1f 91 pop r17 22bc2: 0f 91 pop r16 22bc4: ff 90 pop r15 22bc6: 0f 90 pop r0 22bc8: 0b be out 0x3b, r0 ; 59 22bca: 0f 90 pop r0 22bcc: 0f be out 0x3f, r0 ; 63 22bce: 0f 90 pop r0 22bd0: 1f 90 pop r1 22bd2: 18 95 reti 00022bd4 : 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) { 22bd4: 4f 92 push r4 22bd6: 5f 92 push r5 22bd8: 6f 92 push r6 22bda: 7f 92 push r7 22bdc: af 92 push r10 22bde: bf 92 push r11 22be0: cf 92 push r12 22be2: df 92 push r13 22be4: ef 92 push r14 22be6: ff 92 push r15 22be8: 0f 93 push r16 22bea: 1f 93 push r17 22bec: cf 93 push r28 22bee: df 93 push r29 22bf0: 24 e0 ldi r18, 0x04 ; 4 22bf2: 30 e0 ldi r19, 0x00 ; 0 22bf4: 41 e0 ldi r20, 0x01 ; 1 22bf6: 50 e0 ldi r21, 0x00 ; 0 22bf8: d9 01 movw r26, r18 22bfa: a1 56 subi r26, 0x61 ; 97 22bfc: bc 46 sbci r27, 0x6C ; 108 float celsius = 0; byte i; for (i=1; i raw) 22bfe: fd 01 movw r30, r26 22c00: 65 91 lpm r22, Z+ 22c02: 74 91 lpm r23, Z 22c04: 86 17 cp r24, r22 22c06: 97 07 cpc r25, r23 22c08: 0c f0 brlt .+2 ; 0x22c0c 22c0a: 80 c0 rjmp .+256 ; 0x22d0c { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22c0c: 41 50 subi r20, 0x01 ; 1 22c0e: 51 09 sbc r21, r1 22c10: 44 0f add r20, r20 22c12: 55 1f adc r21, r21 22c14: 44 0f add r20, r20 22c16: 55 1f adc r21, r21 22c18: 8a 01 movw r16, r20 22c1a: 0f 55 subi r16, 0x5F ; 95 22c1c: 1c 46 sbci r17, 0x6C ; 108 22c1e: f8 01 movw r30, r16 22c20: c5 90 lpm r12, Z+ 22c22: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22c24: 41 56 subi r20, 0x61 ; 97 22c26: 5c 46 sbci r21, 0x6C ; 108 22c28: fa 01 movw r30, r20 22c2a: 65 91 lpm r22, Z+ 22c2c: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22c2e: f9 01 movw r30, r18 22c30: ef 55 subi r30, 0x5F ; 95 22c32: fc 46 sbci r31, 0x6C ; 108 22c34: c5 91 lpm r28, Z+ 22c36: d4 91 lpm r29, Z 22c38: f8 01 movw r30, r16 22c3a: 05 91 lpm r16, Z+ 22c3c: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22c3e: fd 01 movw r30, r26 22c40: e5 90 lpm r14, Z+ 22c42: f4 90 lpm r15, Z 22c44: fa 01 movw r30, r20 22c46: a5 90 lpm r10, Z+ 22c48: 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])) * 22c4a: 86 1b sub r24, r22 22c4c: 97 0b sbc r25, r23 22c4e: bc 01 movw r22, r24 22c50: 99 0f add r25, r25 22c52: 88 0b sbc r24, r24 22c54: 99 0b sbc r25, r25 22c56: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22c5a: 2b 01 movw r4, r22 22c5c: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22c5e: be 01 movw r22, r28 22c60: 60 1b sub r22, r16 22c62: 71 0b sbc r23, r17 22c64: 07 2e mov r0, r23 22c66: 00 0c add r0, r0 22c68: 88 0b sbc r24, r24 22c6a: 99 0b sbc r25, r25 22c6c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22c70: 9b 01 movw r18, r22 22c72: 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])) * 22c74: c3 01 movw r24, r6 22c76: b2 01 movw r22, r4 22c78: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 22c7c: 2b 01 movw r4, r22 22c7e: 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])); 22c80: b7 01 movw r22, r14 22c82: 6a 19 sub r22, r10 22c84: 7b 09 sbc r23, r11 22c86: 07 2e mov r0, r23 22c88: 00 0c add r0, r0 22c8a: 88 0b sbc r24, r24 22c8c: 99 0b sbc r25, r25 22c8e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22c92: 9b 01 movw r18, r22 22c94: 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])) / 22c96: c3 01 movw r24, r6 22c98: b2 01 movw r22, r4 22c9a: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 22c9e: 2b 01 movw r4, r22 22ca0: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22ca2: b6 01 movw r22, r12 22ca4: dd 0c add r13, r13 22ca6: 88 0b sbc r24, r24 22ca8: 99 0b sbc r25, r25 22caa: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22cae: 9b 01 movw r18, r22 22cb0: ac 01 movw r20, r24 22cb2: c3 01 movw r24, r6 22cb4: b2 01 movw r22, r4 22cb6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22cba: 6b 01 movw r12, r22 22cbc: 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) 22cbe: 20 e0 ldi r18, 0x00 ; 0 22cc0: 30 e0 ldi r19, 0x00 ; 0 22cc2: 40 e2 ldi r20, 0x20 ; 32 22cc4: 52 e4 ldi r21, 0x42 ; 66 22cc6: c7 01 movw r24, r14 22cc8: b6 01 movw r22, r12 22cca: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22cce: 87 fd sbrc r24, 7 22cd0: 30 c0 rjmp .+96 ; 0x22d32 22cd2: 20 e0 ldi r18, 0x00 ; 0 22cd4: 30 e0 ldi r19, 0x00 ; 0 22cd6: 48 e4 ldi r20, 0x48 ; 72 22cd8: 52 e4 ldi r21, 0x42 ; 66 22cda: c7 01 movw r24, r14 22cdc: b6 01 movw r22, r12 22cde: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 22ce2: 18 16 cp r1, r24 22ce4: 34 f1 brlt .+76 ; 0x22d32 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 22ce6: 20 e0 ldi r18, 0x00 ; 0 22ce8: 30 e0 ldi r19, 0x00 ; 0 22cea: 40 e2 ldi r20, 0x20 ; 32 22cec: 52 e4 ldi r21, 0x42 ; 66 22cee: c7 01 movw r24, r14 22cf0: b6 01 movw r22, r12 22cf2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 22cf6: 20 e0 ldi r18, 0x00 ; 0 22cf8: 30 e0 ldi r19, 0x00 ; 0 22cfa: 40 e0 ldi r20, 0x00 ; 0 22cfc: 5f e3 ldi r21, 0x3F ; 63 22cfe: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 22d02: 9b 01 movw r18, r22 22d04: 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; 22d06: c7 01 movw r24, r14 22d08: b6 01 movw r22, r12 22d0a: 43 c0 rjmp .+134 ; 0x22d92 22d0c: 4f 5f subi r20, 0xFF ; 255 22d0e: 5f 4f sbci r21, 0xFF ; 255 22d10: 2c 5f subi r18, 0xFC ; 252 22d12: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22d1a: 6e cf rjmp .-292 ; 0x22bf8 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22d1c: e1 e9 ldi r30, 0x91 ; 145 22d1e: f4 e9 ldi r31, 0x94 ; 148 22d20: 65 91 lpm r22, Z+ 22d22: 74 91 lpm r23, Z 22d24: 07 2e mov r0, r23 22d26: 00 0c add r0, r0 22d28: 88 0b sbc r24, r24 22d2a: 99 0b sbc r25, r25 22d2c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22d30: c4 cf rjmp .-120 ; 0x22cba if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 22d32: 20 e0 ldi r18, 0x00 ; 0 22d34: 30 e0 ldi r19, 0x00 ; 0 22d36: 48 e4 ldi r20, 0x48 ; 72 22d38: 52 e4 ldi r21, 0x42 ; 66 22d3a: c7 01 movw r24, r14 22d3c: b6 01 movw r22, r12 22d3e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22d42: 18 16 cp r1, r24 22d44: dc f5 brge .+118 ; 0x22dbc 22d46: 20 e0 ldi r18, 0x00 ; 0 22d48: 30 e0 ldi r19, 0x00 ; 0 22d4a: 48 ec ldi r20, 0xC8 ; 200 22d4c: 52 e4 ldi r21, 0x42 ; 66 22d4e: c7 01 movw r24, r14 22d50: b6 01 movw r22, r12 22d52: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 22d56: 18 16 cp r1, r24 22d58: 8c f1 brlt .+98 ; 0x22dbc { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 22d5a: 20 e0 ldi r18, 0x00 ; 0 22d5c: 30 e0 ldi r19, 0x00 ; 0 22d5e: 40 ea ldi r20, 0xA0 ; 160 22d60: 50 e4 ldi r21, 0x40 ; 64 22d62: c7 01 movw r24, r14 22d64: b6 01 movw r22, r12 22d66: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 22d6a: 2b 01 movw r4, r22 22d6c: 3c 01 movw r6, r24 22d6e: 20 e0 ldi r18, 0x00 ; 0 22d70: 30 e0 ldi r19, 0x00 ; 0 22d72: 48 e4 ldi r20, 0x48 ; 72 22d74: 52 e4 ldi r21, 0x42 ; 66 22d76: c7 01 movw r24, r14 22d78: b6 01 movw r22, r12 22d7a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 22d7e: 2d ec ldi r18, 0xCD ; 205 22d80: 3c ec ldi r19, 0xCC ; 204 22d82: 4c ec ldi r20, 0xCC ; 204 22d84: 5d e3 ldi r21, 0x3D ; 61 22d86: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 22d8a: 9b 01 movw r18, r22 22d8c: ac 01 movw r20, r24 22d8e: c3 01 movw r24, r6 22d90: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22d92: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 22d96: 6b 01 movw r12, r22 22d98: 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 } 22d9a: c7 01 movw r24, r14 22d9c: b6 01 movw r22, r12 22d9e: df 91 pop r29 22da0: cf 91 pop r28 22da2: 1f 91 pop r17 22da4: 0f 91 pop r16 22da6: ff 90 pop r15 22da8: ef 90 pop r14 22daa: df 90 pop r13 22dac: cf 90 pop r12 22dae: bf 90 pop r11 22db0: af 90 pop r10 22db2: 7f 90 pop r7 22db4: 6f 90 pop r6 22db6: 5f 90 pop r5 22db8: 4f 90 pop r4 22dba: 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) 22dbc: 20 e0 ldi r18, 0x00 ; 0 22dbe: 30 e0 ldi r19, 0x00 ; 0 22dc0: 48 ec ldi r20, 0xC8 ; 200 22dc2: 52 e4 ldi r21, 0x42 ; 66 22dc4: c7 01 movw r24, r14 22dc6: b6 01 movw r22, r12 22dc8: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22dcc: 18 16 cp r1, r24 22dce: 2c f7 brge .-54 ; 0x22d9a { celsius = celsius + _offset; 22dd0: 20 e0 ldi r18, 0x00 ; 0 22dd2: 30 e0 ldi r19, 0x00 ; 0 22dd4: 40 e2 ldi r20, 0x20 ; 32 22dd6: 51 e4 ldi r21, 0x41 ; 65 22dd8: 96 cf rjmp .-212 ; 0x22d06 00022dda <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 22dda: 1f 92 push r1 22ddc: 0f 92 push r0 22dde: 0f b6 in r0, 0x3f ; 63 22de0: 0f 92 push r0 22de2: 11 24 eor r1, r1 22de4: 0b b6 in r0, 0x3b ; 59 22de6: 0f 92 push r0 22de8: 4f 92 push r4 22dea: 5f 92 push r5 22dec: 6f 92 push r6 22dee: 7f 92 push r7 22df0: 8f 92 push r8 22df2: 9f 92 push r9 22df4: af 92 push r10 22df6: bf 92 push r11 22df8: cf 92 push r12 22dfa: df 92 push r13 22dfc: ef 92 push r14 22dfe: ff 92 push r15 22e00: 0f 93 push r16 22e02: 1f 93 push r17 22e04: 2f 93 push r18 22e06: 3f 93 push r19 22e08: 4f 93 push r20 22e0a: 5f 93 push r21 22e0c: 6f 93 push r22 22e0e: 7f 93 push r23 22e10: 8f 93 push r24 22e12: 9f 93 push r25 22e14: af 93 push r26 22e16: bf 93 push r27 22e18: cf 93 push r28 22e1a: df 93 push r29 22e1c: ef 93 push r30 22e1e: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22e20: 80 91 63 06 lds r24, 0x0663 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> 22e24: 88 23 and r24, r24 22e26: 09 f4 brne .+2 ; 0x22e2a <__vector_32+0x50> 22e28: 22 c1 rjmp .+580 ; 0x2306e <__vector_32+0x294> adc_values_ready = false; 22e2a: 10 92 63 06 sts 0x0663, r1 ; 0x800663 <_ZL16adc_values_ready.lto_priv.517> adc_start_cycle(); 22e2e: 0e 94 73 7e call 0xfce6 ; 0xfce6 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 22e32: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22e36: 8d 7f andi r24, 0xFD ; 253 22e38: 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(); 22e3c: 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 22e42: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 22e46: 0e 94 b9 bd call 0x17b72 ; 0x17b72 22e4a: 4b 01 movw r8, r22 22e4c: 5c 01 movw r10, r24 22e4e: 80 92 5e 06 sts 0x065E, r8 ; 0x80065e 22e52: 90 92 5f 06 sts 0x065F, r9 ; 0x80065f 22e56: a0 92 60 06 sts 0x0660, r10 ; 0x800660 22e5a: b0 92 61 06 sts 0x0661, r11 ; 0x800661 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22e5e: 00 91 4b 06 lds r16, 0x064B ; 0x80064b 22e62: 10 91 4c 06 lds r17, 0x064C ; 0x80064c 22e66: c8 01 movw r24, r16 22e68: 0f 94 ea 15 call 0x22bd4 ; 0x22bd4 22e6c: 6b 01 movw r12, r22 22e6e: 7c 01 movw r14, r24 22e70: c0 92 57 06 sts 0x0657, r12 ; 0x800657 22e74: d0 92 58 06 sts 0x0658, r13 ; 0x800658 22e78: e0 92 59 06 sts 0x0659, r14 ; 0x800659 22e7c: f0 92 5a 06 sts 0x065A, r15 ; 0x80065a #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22e80: 80 91 47 06 lds r24, 0x0647 ; 0x800647 22e84: 90 91 48 06 lds r25, 0x0648 ; 0x800648 22e88: 0f 94 ea 15 call 0x22bd4 ; 0x22bd4 22e8c: 60 93 43 06 sts 0x0643, r22 ; 0x800643 22e90: 70 93 44 06 sts 0x0644, r23 ; 0x800644 22e94: 80 93 45 06 sts 0x0645, r24 ; 0x800645 22e98: 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; 22e9c: 81 e0 ldi r24, 0x01 ; 1 22e9e: 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; 22ea2: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 22ea6: 8d 7f andi r24, 0xFD ; 253 22ea8: 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]) { 22eac: c0 91 49 06 lds r28, 0x0649 ; 0x800649 22eb0: d0 91 4a 06 lds r29, 0x064A ; 0x80064a 22eb4: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.425> 22eb8: 90 91 da 03 lds r25, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.425+0x1> 22ebc: 8c 17 cp r24, r28 22ebe: 9d 07 cpc r25, r29 22ec0: 2c f0 brlt .+10 ; 0x22ecc <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 22ec2: 40 e0 ldi r20, 0x00 ; 0 22ec4: 60 e0 ldi r22, 0x00 ; 0 22ec6: 80 e0 ldi r24, 0x00 ; 0 22ec8: 0f 94 4c 12 call 0x22498 ; 0x22498 } //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) { 22ecc: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.426> 22ed0: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.426+0x1> 22ed4: 80 17 cp r24, r16 22ed6: 91 07 cpc r25, r17 22ed8: 2c f0 brlt .+10 ; 0x22ee4 <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 22eda: 40 e0 ldi r20, 0x00 ; 0 22edc: 60 e0 ldi r22, 0x00 ; 0 22ede: 81 e0 ldi r24, 0x01 ; 1 22ee0: 0f 94 4c 12 call 0x22498 ; 0x22498 { // 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]) { 22ee4: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.422> 22ee8: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 22eec: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 22ef0: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 22ef4: 68 17 cp r22, r24 22ef6: 79 07 cpc r23, r25 22ef8: 0c f0 brlt .+2 ; 0x22efc <__vector_32+0x122> 22efa: dc c0 rjmp .+440 ; 0x230b4 <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 22efc: 10 91 54 06 lds r17, 0x0654 ; 0x800654 22f00: 11 11 cpse r17, r1 22f02: 12 c0 rjmp .+36 ; 0x22f28 <__vector_32+0x14e> 22f04: 6b 5f subi r22, 0xFB ; 251 22f06: 7f 4f sbci r23, 0xFF ; 255 22f08: 07 2e mov r0, r23 22f0a: 00 0c add r0, r0 22f0c: 88 0b sbc r24, r24 22f0e: 99 0b sbc r25, r25 22f10: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 22f14: 9b 01 movw r18, r22 22f16: ac 01 movw r20, r24 22f18: 11 e0 ldi r17, 0x01 ; 1 22f1a: c5 01 movw r24, r10 22f1c: b4 01 movw r22, r8 22f1e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22f22: 18 16 cp r1, r24 22f24: 0c f0 brlt .+2 ; 0x22f28 <__vector_32+0x14e> 22f26: 10 e0 ldi r17, 0x00 ; 0 22f28: 10 93 54 06 sts 0x0654, r17 ; 0x800654 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 22f2c: 68 e9 ldi r22, 0x98 ; 152 22f2e: 7a e3 ldi r23, 0x3A ; 58 22f30: 81 e5 ldi r24, 0x51 ; 81 22f32: 96 e0 ldi r25, 0x06 ; 6 22f34: 0f 94 a1 0f call 0x21f42 ; 0x21f42 ::expired_cont(unsigned short)> 22f38: 81 11 cpse r24, r1 22f3a: 02 c0 rjmp .+4 ; 0x22f40 <__vector_32+0x166> 22f3c: 11 23 and r17, r17 22f3e: 79 f0 breq .+30 ; 0x22f5e <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 22f40: 81 e0 ldi r24, 0x01 ; 1 22f42: 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]) { 22f46: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.424> 22f4a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.424+0x1> 22f4e: c8 17 cp r28, r24 22f50: d9 07 cpc r29, r25 22f52: 2c f0 brlt .+10 ; 0x22f5e <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 22f54: 41 e0 ldi r20, 0x01 ; 1 22f56: 60 e0 ldi r22, 0x00 ; 0 22f58: 80 e0 ldi r24, 0x00 ; 0 22f5a: 0f 94 4c 12 call 0x22498 ; 0x22498 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 22f5e: 80 91 55 06 lds r24, 0x0655 ; 0x800655 22f62: 90 91 56 06 lds r25, 0x0656 ; 0x800656 22f66: 4f 97 sbiw r24, 0x1f ; 31 22f68: 0c f4 brge .+2 ; 0x22f6c <__vector_32+0x192> 22f6a: ab c0 rjmp .+342 ; 0x230c2 <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 22f6c: c0 91 50 06 lds r28, 0x0650 ; 0x800650 22f70: c1 11 cpse r28, r1 22f72: 0c c0 rjmp .+24 ; 0x22f8c <__vector_32+0x1b2> 22f74: c1 e0 ldi r28, 0x01 ; 1 22f76: 20 e0 ldi r18, 0x00 ; 0 22f78: 30 e0 ldi r19, 0x00 ; 0 22f7a: 4c e0 ldi r20, 0x0C ; 12 22f7c: 52 e4 ldi r21, 0x42 ; 66 22f7e: c7 01 movw r24, r14 22f80: b6 01 movw r22, r12 22f82: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 22f86: 18 16 cp r1, r24 22f88: 0c f0 brlt .+2 ; 0x22f8c <__vector_32+0x1b2> 22f8a: c0 e0 ldi r28, 0x00 ; 0 22f8c: c0 93 50 06 sts 0x0650, r28 ; 0x800650 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 22f90: 60 e5 ldi r22, 0x50 ; 80 22f92: 73 ec ldi r23, 0xC3 ; 195 22f94: 8d e4 ldi r24, 0x4D ; 77 22f96: 96 e0 ldi r25, 0x06 ; 6 22f98: 0f 94 a1 0f call 0x21f42 ; 0x21f42 ::expired_cont(unsigned short)> 22f9c: 81 11 cpse r24, r1 22f9e: 02 c0 rjmp .+4 ; 0x22fa4 <__vector_32+0x1ca> 22fa0: cc 23 and r28, r28 22fa2: 99 f0 breq .+38 ; 0x22fca <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 22fa4: 81 e0 ldi r24, 0x01 ; 1 22fa6: 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) { 22faa: 20 91 4b 06 lds r18, 0x064B ; 0x80064b 22fae: 30 91 4c 06 lds r19, 0x064C ; 0x80064c 22fb2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.423> 22fb6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.423+0x1> 22fba: 28 17 cp r18, r24 22fbc: 39 07 cpc r19, r25 22fbe: 2c f0 brlt .+10 ; 0x22fca <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 22fc0: 41 e0 ldi r20, 0x01 ; 1 22fc2: 60 e0 ldi r22, 0x00 ; 0 22fc4: 81 e0 ldi r24, 0x01 ; 1 22fc6: 0f 94 4c 12 call 0x22498 ; 0x22498 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); 22fca: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 22fce: 70 e0 ldi r23, 0x00 ; 0 22fd0: 90 e0 ldi r25, 0x00 ; 0 22fd2: 80 e0 ldi r24, 0x00 ; 0 22fd4: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 22fd8: 6b 01 movw r12, r22 22fda: 7c 01 movw r14, r24 22fdc: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 22fe0: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 22fe4: 60 90 60 06 lds r6, 0x0660 ; 0x800660 22fe8: 70 90 61 06 lds r7, 0x0661 ; 0x800661 22fec: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 22ff0: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 22ff4: 07 2e mov r0, r23 22ff6: 00 0c add r0, r0 22ff8: 88 0b sbc r24, r24 22ffa: 99 0b sbc r25, r25 22ffc: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 23000: ab 01 movw r20, r22 23002: bc 01 movw r22, r24 23004: a1 2c mov r10, r1 23006: 93 01 movw r18, r6 23008: 82 01 movw r16, r4 2300a: 81 e0 ldi r24, 0x01 ; 1 2300c: 0f 94 b0 12 call 0x22560 ; 0x22560 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 23010: 60 91 5b 06 lds r22, 0x065B ; 0x80065b 23014: 70 e0 ldi r23, 0x00 ; 0 23016: 90 e0 ldi r25, 0x00 ; 0 23018: 80 e0 ldi r24, 0x00 ; 0 2301a: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2301e: 6b 01 movw r12, r22 23020: 7c 01 movw r14, r24 23022: 40 90 57 06 lds r4, 0x0657 ; 0x800657 23026: 50 90 58 06 lds r5, 0x0658 ; 0x800658 2302a: 60 90 59 06 lds r6, 0x0659 ; 0x800659 2302e: 70 90 5a 06 lds r7, 0x065A ; 0x80065a 23032: 60 91 55 06 lds r22, 0x0655 ; 0x800655 23036: 70 91 56 06 lds r23, 0x0656 ; 0x800656 2303a: 07 2e mov r0, r23 2303c: 00 0c add r0, r0 2303e: 88 0b sbc r24, r24 23040: 99 0b sbc r25, r25 23042: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 23046: ab 01 movw r20, r22 23048: bc 01 movw r22, r24 2304a: aa 24 eor r10, r10 2304c: a3 94 inc r10 2304e: 93 01 movw r18, r6 23050: 82 01 movw r16, r4 23052: 80 e0 ldi r24, 0x00 ; 0 23054: 0f 94 b0 12 call 0x22560 ; 0x22560 thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 23058: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> 2305c: 81 11 cpse r24, r1 temp_mgr_pid(); 2305e: 0e 94 ea f7 call 0x1efd4 ; 0x1efd4 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 23062: 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(); 23064: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 23068: 82 60 ori r24, 0x02 ; 2 2306a: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 2306e: ff 91 pop r31 23070: ef 91 pop r30 23072: df 91 pop r29 23074: cf 91 pop r28 23076: bf 91 pop r27 23078: af 91 pop r26 2307a: 9f 91 pop r25 2307c: 8f 91 pop r24 2307e: 7f 91 pop r23 23080: 6f 91 pop r22 23082: 5f 91 pop r21 23084: 4f 91 pop r20 23086: 3f 91 pop r19 23088: 2f 91 pop r18 2308a: 1f 91 pop r17 2308c: 0f 91 pop r16 2308e: ff 90 pop r15 23090: ef 90 pop r14 23092: df 90 pop r13 23094: cf 90 pop r12 23096: bf 90 pop r11 23098: af 90 pop r10 2309a: 9f 90 pop r9 2309c: 8f 90 pop r8 2309e: 7f 90 pop r7 230a0: 6f 90 pop r6 230a2: 5f 90 pop r5 230a4: 4f 90 pop r4 230a6: 0f 90 pop r0 230a8: 0b be out 0x3b, r0 ; 59 230aa: 0f 90 pop r0 230ac: 0f be out 0x3f, r0 ; 63 230ae: 0f 90 pop r0 230b0: 1f 90 pop r1 230b2: 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(); 230b4: 81 e5 ldi r24, 0x51 ; 81 230b6: 96 e0 ldi r25, 0x06 ; 6 230b8: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> bCheckingOnHeater=false; 230bc: 10 92 54 06 sts 0x0654, r1 ; 0x800654 230c0: 4e cf rjmp .-356 ; 0x22f5e <__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(); 230c2: 8d e4 ldi r24, 0x4D ; 77 230c4: 96 e0 ldi r25, 0x06 ; 6 230c6: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> bCheckingOnBed=false; 230ca: 10 92 50 06 sts 0x0650, r1 ; 0x800650 230ce: 7d cf rjmp .-262 ; 0x22fca <__vector_32+0x1f0> 000230d0 : 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; 230d0: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 230d4: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 230d8: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 230dc: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 230e0: 60 e0 ldi r22, 0x00 ; 0 230e2: 70 e0 ldi r23, 0x00 ; 0 230e4: 8f e7 ldi r24, 0x7F ; 127 230e6: 93 e4 ldi r25, 0x43 ; 67 230e8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 230ec: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.430> 230f0: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.430+0x1> 230f4: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.430+0x2> 230f8: 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; 230fc: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 23100: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 23104: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 23108: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 2310c: 60 e0 ldi r22, 0x00 ; 0 2310e: 70 e0 ldi r23, 0x00 ; 0 23110: 8f e7 ldi r24, 0x7F ; 127 23112: 93 e4 ldi r25, 0x43 ; 67 23114: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 23118: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.428> 2311c: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.428+0x1> 23120: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.428+0x2> 23124: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.428+0x3> #endif } 23128: 08 95 ret 0002312a : #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) { 2312a: 2f 92 push r2 2312c: 3f 92 push r3 2312e: 4f 92 push r4 23130: 5f 92 push r5 23132: 6f 92 push r6 23134: 7f 92 push r7 23136: 8f 92 push r8 23138: 9f 92 push r9 2313a: af 92 push r10 2313c: bf 92 push r11 2313e: cf 92 push r12 23140: df 92 push r13 23142: ef 92 push r14 23144: ff 92 push r15 23146: 0f 93 push r16 23148: 1f 93 push r17 2314a: cf 93 push r28 2314c: df 93 push r29 2314e: cd b7 in r28, 0x3d ; 61 23150: de b7 in r29, 0x3e ; 62 23152: e0 97 sbiw r28, 0x30 ; 48 23154: 0f b6 in r0, 0x3f ; 63 23156: f8 94 cli 23158: de bf out 0x3e, r29 ; 62 2315a: 0f be out 0x3f, r0 ; 63 2315c: cd bf out 0x3d, r28 ; 61 2315e: 6a 87 std Y+10, r22 ; 0x0a 23160: 7b 87 std Y+11, r23 ; 0x0b 23162: 8c 87 std Y+12, r24 ; 0x0c 23164: 9d 87 std Y+13, r25 ; 0x0d 23166: 1a 01 movw r2, r20 23168: 3a a7 std Y+42, r19 ; 0x2a 2316a: 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(); 2316c: 0f 94 31 12 call 0x22462 ; 0x22462 pid_tuning_finished = false; 23170: 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; 23174: 29 a5 ldd r18, Y+41 ; 0x29 23176: 3a a5 ldd r19, Y+42 ; 0x2a 23178: 30 93 6e 06 sts 0x066E, r19 ; 0x80066e 2317c: 20 93 6d 06 sts 0x066D, r18 ; 0x80066d float input = 0.0; pid_cycle=0; 23180: 10 92 70 06 sts 0x0670, r1 ; 0x800670 23184: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f bool heating = true; unsigned long temp_millis = _millis(); 23188: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2318c: 6e 83 std Y+6, r22 ; 0x06 2318e: 7f 83 std Y+7, r23 ; 0x07 23190: 88 87 std Y+8, r24 ; 0x08 23192: 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 23194: 37 fe sbrs r3, 7 23196: ff c0 rjmp .+510 ; 0x23396 23198: 3d e2 ldi r19, 0x2D ; 45 2319a: 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(); 2319c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 231a0: 6c a3 std Y+36, r22 ; 0x24 231a2: 7d a3 std Y+37, r23 ; 0x25 231a4: 8e a3 std Y+38, r24 ; 0x26 231a6: 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."); 231a8: 8e ef ldi r24, 0xFE ; 254 231aa: 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) 231ac: 12 14 cp r1, r2 231ae: 13 04 cpc r1, r3 231b0: 0c f4 brge .+2 ; 0x231b4 231b2: 8a c2 rjmp .+1300 ; 0x236c8 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 231b4: 8b ee ldi r24, 0xEB ; 235 231b6: 92 e9 ldi r25, 0x92 ; 146 231b8: 0e 94 de 72 call 0xe5bc ; 0xe5bc 231bc: 6a 85 ldd r22, Y+10 ; 0x0a 231be: 7b 85 ldd r23, Y+11 ; 0x0b 231c0: 8c 85 ldd r24, Y+12 ; 0x0c 231c2: 9d 85 ldd r25, Y+13 ; 0x0d 231c4: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 231c8: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 231ca: 21 14 cp r2, r1 231cc: 31 04 cpc r3, r1 231ce: 09 f4 brne .+2 ; 0x231d2 231d0: e5 c0 rjmp .+458 ; 0x2339c { soft_pwm_bed = (MAX_BED_POWER)/2; 231d2: 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 231d6: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 231da: 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 231de: 8e 81 ldd r24, Y+6 ; 0x06 231e0: 9f 81 ldd r25, Y+7 ; 0x07 231e2: a8 85 ldd r26, Y+8 ; 0x08 231e4: b9 85 ldd r27, Y+9 ; 0x09 231e6: 8e 87 std Y+14, r24 ; 0x0e 231e8: 9f 87 std Y+15, r25 ; 0x0f 231ea: a8 8b std Y+16, r26 ; 0x10 231ec: b9 8b std Y+17, r27 ; 0x11 231ee: 88 a3 std Y+32, r24 ; 0x20 231f0: 99 a3 std Y+33, r25 ; 0x21 231f2: aa a3 std Y+34, r26 ; 0x22 231f4: bb a3 std Y+35, r27 ; 0x23 231f6: 1a 8a std Y+18, r1 ; 0x12 231f8: 90 e4 ldi r25, 0x40 ; 64 231fa: 9b 8b std Y+19, r25 ; 0x13 231fc: ac e1 ldi r26, 0x1C ; 28 231fe: ac 8b std Y+20, r26 ; 0x14 23200: b6 e4 ldi r27, 0x46 ; 70 23202: bd 8b std Y+21, r27 ; 0x15 23204: 1e 8a std Y+22, r1 ; 0x16 23206: 1f 8a std Y+23, r1 ; 0x17 23208: 18 8e std Y+24, r1 ; 0x18 2320a: 19 8e std Y+25, r1 ; 0x19 2320c: 6f e7 ldi r22, 0x7F ; 127 2320e: c6 2e mov r12, r22 23210: d1 2c mov r13, r1 23212: e1 2c mov r14, r1 23214: f1 2c mov r15, r1 23216: 00 e0 ldi r16, 0x00 ; 0 23218: 10 e0 ldi r17, 0x00 ; 0 2321a: 18 aa std Y+48, r1 ; 0x30 2321c: 1f a6 std Y+47, r1 ; 0x2f 2321e: 1d 82 std Y+5, r1 ; 0x05 23220: 2f e7 ldi r18, 0x7F ; 127 23222: 30 e0 ldi r19, 0x00 ; 0 23224: 40 e0 ldi r20, 0x00 ; 0 23226: 50 e0 ldi r21, 0x00 ; 0 23228: 29 83 std Y+1, r18 ; 0x01 2322a: 3a 83 std Y+2, r19 ; 0x02 2322c: 4b 83 std Y+3, r20 ; 0x03 2322e: 5c 83 std Y+4, r21 ; 0x04 23230: 1b 8e std Y+27, r1 ; 0x1b 23232: 1c 8e std Y+28, r1 ; 0x1c 23234: 1d 8e std Y+29, r1 ; 0x1d 23236: 1e 8e std Y+30, r1 ; 0x1e 23238: 31 e0 ldi r19, 0x01 ; 1 2323a: 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(); 2323c: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2323e: 40 91 42 06 lds r20, 0x0642 ; 0x800642 23242: 48 a7 std Y+40, r20 ; 0x28 23244: 44 23 and r20, r20 23246: 09 f4 brne .+2 ; 0x2324a 23248: 2c c2 rjmp .+1112 ; 0x236a2 updateTemperatures(); 2324a: 0e 94 be fa call 0x1f57c ; 0x1f57c input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2324e: 21 14 cp r2, r1 23250: 31 04 cpc r3, r1 23252: 09 f0 breq .+2 ; 0x23256 23254: aa c0 rjmp .+340 ; 0x233aa 23256: 00 91 c4 0d lds r16, 0x0DC4 ; 0x800dc4 2325a: 10 91 c5 0d lds r17, 0x0DC5 ; 0x800dc5 2325e: 50 91 c6 0d lds r21, 0x0DC6 ; 0x800dc6 23262: 58 ab std Y+48, r21 ; 0x30 23264: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 23268: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2326a: 2e 89 ldd r18, Y+22 ; 0x16 2326c: 3f 89 ldd r19, Y+23 ; 0x17 2326e: 48 8d ldd r20, Y+24 ; 0x18 23270: 59 8d ldd r21, Y+25 ; 0x19 23272: b8 01 movw r22, r16 23274: 88 a9 ldd r24, Y+48 ; 0x30 23276: 9f a5 ldd r25, Y+47 ; 0x2f 23278: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2327c: 87 fd sbrc r24, 7 2327e: 06 c0 rjmp .+12 ; 0x2328c 23280: 0e 8b std Y+22, r16 ; 0x16 23282: 1f 8b std Y+23, r17 ; 0x17 23284: b8 a9 ldd r27, Y+48 ; 0x30 23286: b8 8f std Y+24, r27 ; 0x18 23288: 2f a5 ldd r18, Y+47 ; 0x2f 2328a: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2328c: 2a 89 ldd r18, Y+18 ; 0x12 2328e: 3b 89 ldd r19, Y+19 ; 0x13 23290: 4c 89 ldd r20, Y+20 ; 0x14 23292: 5d 89 ldd r21, Y+21 ; 0x15 23294: b8 01 movw r22, r16 23296: 88 a9 ldd r24, Y+48 ; 0x30 23298: 9f a5 ldd r25, Y+47 ; 0x2f 2329a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2329e: 18 16 cp r1, r24 232a0: 34 f0 brlt .+12 ; 0x232ae 232a2: 0a 8b std Y+18, r16 ; 0x12 232a4: 1b 8b std Y+19, r17 ; 0x13 232a6: 38 a9 ldd r19, Y+48 ; 0x30 232a8: 3c 8b std Y+20, r19 ; 0x14 232aa: 4f a5 ldd r20, Y+47 ; 0x2f 232ac: 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) { 232ae: 0f 94 46 0f call 0x21e8c ; 0x21e8c 232b2: 2c a1 ldd r18, Y+36 ; 0x24 232b4: 3d a1 ldd r19, Y+37 ; 0x25 232b6: 4e a1 ldd r20, Y+38 ; 0x26 232b8: 5f a1 ldd r21, Y+39 ; 0x27 232ba: 62 1b sub r22, r18 232bc: 73 0b sbc r23, r19 232be: 84 0b sbc r24, r20 232c0: 95 0b sbc r25, r21 232c2: 65 3c cpi r22, 0xC5 ; 197 232c4: 79 40 sbci r23, 0x09 ; 9 232c6: 81 05 cpc r24, r1 232c8: 91 05 cpc r25, r1 232ca: 40 f0 brcs .+16 ; 0x232dc checkExtruderAutoFans(); 232cc: 0e 94 16 6f call 0xde2c ; 0xde2c extruder_autofan_last_check = _millis(); 232d0: 0f 94 46 0f call 0x21e8c ; 0x21e8c 232d4: 6c a3 std Y+36, r22 ; 0x24 232d6: 7d a3 std Y+37, r23 ; 0x25 232d8: 8e a3 std Y+38, r24 ; 0x26 232da: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 232dc: 4a 8d ldd r20, Y+26 ; 0x1a 232de: 44 23 and r20, r20 232e0: 09 f4 brne .+2 ; 0x232e4 232e2: 4c c0 rjmp .+152 ; 0x2337c 232e4: 2a 85 ldd r18, Y+10 ; 0x0a 232e6: 3b 85 ldd r19, Y+11 ; 0x0b 232e8: 4c 85 ldd r20, Y+12 ; 0x0c 232ea: 5d 85 ldd r21, Y+13 ; 0x0d 232ec: b8 01 movw r22, r16 232ee: 88 a9 ldd r24, Y+48 ; 0x30 232f0: 9f a5 ldd r25, Y+47 ; 0x2f 232f2: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 232f6: 18 16 cp r1, r24 232f8: 0c f0 brlt .+2 ; 0x232fc 232fa: d3 c1 rjmp .+934 ; 0x236a2 if(_millis() - t2 > 5000) { 232fc: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23300: 2e 85 ldd r18, Y+14 ; 0x0e 23302: 3f 85 ldd r19, Y+15 ; 0x0f 23304: 48 89 ldd r20, Y+16 ; 0x10 23306: 59 89 ldd r21, Y+17 ; 0x11 23308: 62 1b sub r22, r18 2330a: 73 0b sbc r23, r19 2330c: 84 0b sbc r24, r20 2330e: 95 0b sbc r25, r21 23310: 69 38 cpi r22, 0x89 ; 137 23312: 73 41 sbci r23, 0x13 ; 19 23314: 81 05 cpc r24, r1 23316: 91 05 cpc r25, r1 23318: 08 f4 brcc .+2 ; 0x2331c 2331a: c3 c1 rjmp .+902 ; 0x236a2 2331c: d7 01 movw r26, r14 2331e: c6 01 movw r24, r12 23320: 29 81 ldd r18, Y+1 ; 0x01 23322: 3a 81 ldd r19, Y+2 ; 0x02 23324: 4b 81 ldd r20, Y+3 ; 0x03 23326: 5c 81 ldd r21, Y+4 ; 0x04 23328: 82 1b sub r24, r18 2332a: 93 0b sbc r25, r19 2332c: a4 0b sbc r26, r20 2332e: b5 0b sbc r27, r21 23330: b5 95 asr r27 23332: a7 95 ror r26 23334: 97 95 ror r25 23336: 87 95 ror r24 heating=false; if (extruder<0) { 23338: 21 14 cp r2, r1 2333a: 31 04 cpc r3, r1 2333c: 09 f4 brne .+2 ; 0x23340 2333e: 40 c0 rjmp .+128 ; 0x233c0 soft_pwm_bed = (bias - d) >> 1; 23340: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 23344: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23348: 6e 83 std Y+6, r22 ; 0x06 2334a: 7f 83 std Y+7, r23 ; 0x07 2334c: 88 87 std Y+8, r24 ; 0x08 2334e: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 23350: dc 01 movw r26, r24 23352: cb 01 movw r24, r22 23354: 2e 85 ldd r18, Y+14 ; 0x0e 23356: 3f 85 ldd r19, Y+15 ; 0x0f 23358: 48 89 ldd r20, Y+16 ; 0x10 2335a: 59 89 ldd r21, Y+17 ; 0x11 2335c: 82 1b sub r24, r18 2335e: 93 0b sbc r25, r19 23360: a4 0b sbc r26, r20 23362: b5 0b sbc r27, r21 23364: 8b 8f std Y+27, r24 ; 0x1b 23366: 9c 8f std Y+28, r25 ; 0x1c 23368: ad 8f std Y+29, r26 ; 0x1d 2336a: be 8f std Y+30, r27 ; 0x1e max=temp; 2336c: 3a 85 ldd r19, Y+10 ; 0x0a 2336e: 3e 8b std Y+22, r19 ; 0x16 23370: 4b 85 ldd r20, Y+11 ; 0x0b 23372: 4f 8b std Y+23, r20 ; 0x17 23374: 5c 85 ldd r21, Y+12 ; 0x0c 23376: 58 8f std Y+24, r21 ; 0x18 23378: 8d 85 ldd r24, Y+13 ; 0x0d 2337a: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2337c: 2a 85 ldd r18, Y+10 ; 0x0a 2337e: 3b 85 ldd r19, Y+11 ; 0x0b 23380: 4c 85 ldd r20, Y+12 ; 0x0c 23382: 5d 85 ldd r21, Y+13 ; 0x0d 23384: b8 01 movw r22, r16 23386: 88 a9 ldd r24, Y+48 ; 0x30 23388: 9f a5 ldd r25, Y+47 ; 0x2f 2338a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2338e: 87 fd sbrc r24, 7 23390: 1a c0 rjmp .+52 ; 0x233c6 if(_millis() - t1 > 5000) { 23392: 1a 8e std Y+26, r1 ; 0x1a 23394: 86 c1 rjmp .+780 ; 0x236a2 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 23396: 4a e0 ldi r20, 0x0A ; 10 23398: 4f 8f std Y+31, r20 ; 0x1f 2339a: 00 cf rjmp .-512 ; 0x2319c 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; 2339c: 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 233a0: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 233a4: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 233a8: 1a cf rjmp .-460 ; 0x231de wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 233aa: 00 91 8a 03 lds r16, 0x038A ; 0x80038a 233ae: 10 91 8b 03 lds r17, 0x038B ; 0x80038b 233b2: 90 91 8c 03 lds r25, 0x038C ; 0x80038c 233b6: 98 ab std Y+48, r25 ; 0x30 233b8: a0 91 8d 03 lds r26, 0x038D ; 0x80038d 233bc: af a7 std Y+47, r26 ; 0x2f 233be: 55 cf rjmp .-342 ; 0x2326a heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 233c0: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 233c4: bf cf rjmp .-130 ; 0x23344 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 233c6: 0f 94 46 0f call 0x21e8c ; 0x21e8c 233ca: 2e 81 ldd r18, Y+6 ; 0x06 233cc: 3f 81 ldd r19, Y+7 ; 0x07 233ce: 48 85 ldd r20, Y+8 ; 0x08 233d0: 59 85 ldd r21, Y+9 ; 0x09 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: 69 38 cpi r22, 0x89 ; 137 233dc: 73 41 sbci r23, 0x13 ; 19 233de: 81 05 cpc r24, r1 233e0: 91 05 cpc r25, r1 233e2: b8 f2 brcs .-82 ; 0x23392 heating=true; t2=_millis(); 233e4: 0f 94 46 0f call 0x21e8c ; 0x21e8c 233e8: 6e 87 std Y+14, r22 ; 0x0e 233ea: 7f 87 std Y+15, r23 ; 0x0f 233ec: 88 8b std Y+16, r24 ; 0x10 233ee: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 233f0: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 233f4: 90 91 70 06 lds r25, 0x0670 ; 0x800670 233f8: 18 16 cp r1, r24 233fa: 19 06 cpc r1, r25 233fc: 0c f0 brlt .+2 ; 0x23400 233fe: 2c c1 rjmp .+600 ; 0x23658 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 23400: 8e 85 ldd r24, Y+14 ; 0x0e 23402: 9f 85 ldd r25, Y+15 ; 0x0f 23404: a8 89 ldd r26, Y+16 ; 0x10 23406: b9 89 ldd r27, Y+17 ; 0x11 23408: 2e 81 ldd r18, Y+6 ; 0x06 2340a: 3f 81 ldd r19, Y+7 ; 0x07 2340c: 48 85 ldd r20, Y+8 ; 0x08 2340e: 59 85 ldd r21, Y+9 ; 0x09 23410: 82 1b sub r24, r18 23412: 93 0b sbc r25, r19 23414: a4 0b sbc r26, r20 23416: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 23418: 4b 8c ldd r4, Y+27 ; 0x1b 2341a: 5c 8c ldd r5, Y+28 ; 0x1c 2341c: 6d 8c ldd r6, Y+29 ; 0x1d 2341e: 7e 8c ldd r7, Y+30 ; 0x1e 23420: 48 0e add r4, r24 23422: 59 1e adc r5, r25 23424: 6a 1e adc r6, r26 23426: 7b 1e adc r7, r27 23428: 2b 8d ldd r18, Y+27 ; 0x1b 2342a: 3c 8d ldd r19, Y+28 ; 0x1c 2342c: 4d 8d ldd r20, Y+29 ; 0x1d 2342e: 5e 8d ldd r21, Y+30 ; 0x1e 23430: 28 1b sub r18, r24 23432: 39 0b sbc r19, r25 23434: 4a 0b sbc r20, r26 23436: 5b 0b sbc r21, r27 23438: 69 81 ldd r22, Y+1 ; 0x01 2343a: 7a 81 ldd r23, Y+2 ; 0x02 2343c: 8b 81 ldd r24, Y+3 ; 0x03 2343e: 9c 81 ldd r25, Y+4 ; 0x04 23440: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 23444: a3 01 movw r20, r6 23446: 92 01 movw r18, r4 23448: 0f 94 6e a1 call 0x342dc ; 0x342dc <__divmodsi4> 2344c: da 01 movw r26, r20 2344e: c9 01 movw r24, r18 23450: 8c 0d add r24, r12 23452: 9d 1d adc r25, r13 23454: ae 1d adc r26, r14 23456: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 23458: 84 31 cpi r24, 0x14 ; 20 2345a: 91 05 cpc r25, r1 2345c: a1 05 cpc r26, r1 2345e: b1 05 cpc r27, r1 23460: 0c f4 brge .+2 ; 0x23464 23462: 3c c1 rjmp .+632 ; 0x236dc 23464: 6c 01 movw r12, r24 23466: 7d 01 movw r14, r26 23468: 3c ee ldi r19, 0xEC ; 236 2346a: c3 16 cp r12, r19 2346c: d1 04 cpc r13, r1 2346e: e1 04 cpc r14, r1 23470: f1 04 cpc r15, r1 23472: 2c f0 brlt .+10 ; 0x2347e 23474: 4b ee ldi r20, 0xEB ; 235 23476: c4 2e mov r12, r20 23478: d1 2c mov r13, r1 2347a: e1 2c mov r14, r1 2347c: 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; 2347e: 80 38 cpi r24, 0x80 ; 128 23480: 91 05 cpc r25, r1 23482: a1 05 cpc r26, r1 23484: b1 05 cpc r27, r1 23486: 0c f4 brge .+2 ; 0x2348a 23488: 37 c1 rjmp .+622 ; 0x236f8 2348a: 8e ef ldi r24, 0xFE ; 254 2348c: 90 e0 ldi r25, 0x00 ; 0 2348e: a0 e0 ldi r26, 0x00 ; 0 23490: b0 e0 ldi r27, 0x00 ; 0 23492: 8c 19 sub r24, r12 23494: 9d 09 sbc r25, r13 23496: ae 09 sbc r26, r14 23498: bf 09 sbc r27, r15 2349a: 89 83 std Y+1, r24 ; 0x01 2349c: 9a 83 std Y+2, r25 ; 0x02 2349e: ab 83 std Y+3, r26 ; 0x03 234a0: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 234a2: 83 ee ldi r24, 0xE3 ; 227 234a4: 92 e9 ldi r25, 0x92 ; 146 234a6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 234aa: c7 01 movw r24, r14 234ac: b6 01 movw r22, r12 234ae: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 234b2: 8e ed ldi r24, 0xDE ; 222 234b4: 92 e9 ldi r25, 0x92 ; 146 234b6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 234ba: 69 81 ldd r22, Y+1 ; 0x01 234bc: 7a 81 ldd r23, Y+2 ; 0x02 234be: 8b 81 ldd r24, Y+3 ; 0x03 234c0: 9c 81 ldd r25, Y+4 ; 0x04 234c2: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 234c6: 87 ed ldi r24, 0xD7 ; 215 234c8: 92 e9 ldi r25, 0x92 ; 146 234ca: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 234ce: 42 e0 ldi r20, 0x02 ; 2 234d0: 6a 89 ldd r22, Y+18 ; 0x12 234d2: 7b 89 ldd r23, Y+19 ; 0x13 234d4: 8c 89 ldd r24, Y+20 ; 0x14 234d6: 9d 89 ldd r25, Y+21 ; 0x15 234d8: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 234dc: 80 ed ldi r24, 0xD0 ; 208 234de: 92 e9 ldi r25, 0x92 ; 146 234e0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 234e4: 6e 89 ldd r22, Y+22 ; 0x16 234e6: 7f 89 ldd r23, Y+23 ; 0x17 234e8: 88 8d ldd r24, Y+24 ; 0x18 234ea: 99 8d ldd r25, Y+25 ; 0x19 234ec: 0f 94 2b 41 call 0x28256 ; 0x28256 if(pid_cycle > 2) { 234f0: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 234f4: 90 91 70 06 lds r25, 0x0670 ; 0x800670 234f8: 03 97 sbiw r24, 0x03 ; 3 234fa: 0c f4 brge .+2 ; 0x234fe 234fc: ad c0 rjmp .+346 ; 0x23658 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 234fe: 69 81 ldd r22, Y+1 ; 0x01 23500: 7a 81 ldd r23, Y+2 ; 0x02 23502: 8b 81 ldd r24, Y+3 ; 0x03 23504: 9c 81 ldd r25, Y+4 ; 0x04 23506: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2350a: 20 e0 ldi r18, 0x00 ; 0 2350c: 30 e0 ldi r19, 0x00 ; 0 2350e: 40 e8 ldi r20, 0x80 ; 128 23510: 50 e4 ldi r21, 0x40 ; 64 23512: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 23516: 4b 01 movw r8, r22 23518: 5c 01 movw r10, r24 2351a: 2a 89 ldd r18, Y+18 ; 0x12 2351c: 3b 89 ldd r19, Y+19 ; 0x13 2351e: 4c 89 ldd r20, Y+20 ; 0x14 23520: 5d 89 ldd r21, Y+21 ; 0x15 23522: 6e 89 ldd r22, Y+22 ; 0x16 23524: 7f 89 ldd r23, Y+23 ; 0x17 23526: 88 8d ldd r24, Y+24 ; 0x18 23528: 99 8d ldd r25, Y+25 ; 0x19 2352a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2352e: 20 ed ldi r18, 0xD0 ; 208 23530: 3f e0 ldi r19, 0x0F ; 15 23532: 49 e4 ldi r20, 0x49 ; 73 23534: 50 e4 ldi r21, 0x40 ; 64 23536: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2353a: 20 e0 ldi r18, 0x00 ; 0 2353c: 30 e0 ldi r19, 0x00 ; 0 2353e: 40 e0 ldi r20, 0x00 ; 0 23540: 5f e3 ldi r21, 0x3F ; 63 23542: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 23546: 9b 01 movw r18, r22 23548: ac 01 movw r20, r24 2354a: c5 01 movw r24, r10 2354c: b4 01 movw r22, r8 2354e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 23552: 4b 01 movw r8, r22 23554: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 23556: c3 01 movw r24, r6 23558: b2 01 movw r22, r4 2355a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2355e: 20 e0 ldi r18, 0x00 ; 0 23560: 30 e0 ldi r19, 0x00 ; 0 23562: 4a e7 ldi r20, 0x7A ; 122 23564: 54 e4 ldi r21, 0x44 ; 68 23566: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2356a: 2b 01 movw r4, r22 2356c: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2356e: 8a ec ldi r24, 0xCA ; 202 23570: 92 e9 ldi r25, 0x92 ; 146 23572: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 23576: 42 e0 ldi r20, 0x02 ; 2 23578: c5 01 movw r24, r10 2357a: b4 01 movw r22, r8 2357c: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 23580: 84 ec ldi r24, 0xC4 ; 196 23582: 92 e9 ldi r25, 0x92 ; 146 23584: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 23588: c3 01 movw r24, r6 2358a: b2 01 movw r22, r4 2358c: 0f 94 2b 41 call 0x28256 ; 0x28256 _Kp = 0.6*Ku; 23590: 2a e9 ldi r18, 0x9A ; 154 23592: 39 e9 ldi r19, 0x99 ; 153 23594: 49 e1 ldi r20, 0x19 ; 25 23596: 5f e3 ldi r21, 0x3F ; 63 23598: c5 01 movw r24, r10 2359a: b4 01 movw r22, r8 2359c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 235a0: 4b 01 movw r8, r22 235a2: 5c 01 movw r10, r24 235a4: 80 92 a8 03 sts 0x03A8, r8 ; 0x8003a8 <_Kp> 235a8: 90 92 a9 03 sts 0x03A9, r9 ; 0x8003a9 <_Kp+0x1> 235ac: a0 92 aa 03 sts 0x03AA, r10 ; 0x8003aa <_Kp+0x2> 235b0: b0 92 ab 03 sts 0x03AB, r11 ; 0x8003ab <_Kp+0x3> _Ki = 2*_Kp/Tu; 235b4: ac 01 movw r20, r24 235b6: 9b 01 movw r18, r22 235b8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 235bc: a3 01 movw r20, r6 235be: 92 01 movw r18, r4 235c0: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 235c4: 60 93 a4 03 sts 0x03A4, r22 ; 0x8003a4 <_Ki> 235c8: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 <_Ki+0x1> 235cc: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 <_Ki+0x2> 235d0: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 <_Ki+0x3> _Kd = _Kp*Tu/8; 235d4: a3 01 movw r20, r6 235d6: 92 01 movw r18, r4 235d8: c5 01 movw r24, r10 235da: b4 01 movw r22, r8 235dc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 235e0: 20 e0 ldi r18, 0x00 ; 0 235e2: 30 e0 ldi r19, 0x00 ; 0 235e4: 40 e0 ldi r20, 0x00 ; 0 235e6: 5e e3 ldi r21, 0x3E ; 62 235e8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 235ec: 60 93 a0 03 sts 0x03A0, r22 ; 0x8003a0 <_Kd> 235f0: 70 93 a1 03 sts 0x03A1, r23 ; 0x8003a1 <_Kd+0x1> 235f4: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 <_Kd+0x2> 235f8: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 235fc: 86 eb ldi r24, 0xB6 ; 182 235fe: 92 e9 ldi r25, 0x92 ; 146 23600: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 23604: 80 eb ldi r24, 0xB0 ; 176 23606: 92 e9 ldi r25, 0x92 ; 146 23608: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2360c: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 <_Kp> 23610: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 <_Kp+0x1> 23614: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa <_Kp+0x2> 23618: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab <_Kp+0x3> 2361c: 0f 94 2b 41 call 0x28256 ; 0x28256 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 23620: 8a ea ldi r24, 0xAA ; 170 23622: 92 e9 ldi r25, 0x92 ; 146 23624: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 23628: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 2362c: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 23630: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 23634: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 23638: 0f 94 2b 41 call 0x28256 ; 0x28256 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2363c: 84 ea ldi r24, 0xA4 ; 164 2363e: 92 e9 ldi r25, 0x92 ; 146 23640: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 23644: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 23648: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 2364c: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 23650: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 23654: 0f 94 2b 41 call 0x28256 ; 0x28256 23658: 89 81 ldd r24, Y+1 ; 0x01 2365a: 9a 81 ldd r25, Y+2 ; 0x02 2365c: ab 81 ldd r26, Y+3 ; 0x03 2365e: bc 81 ldd r27, Y+4 ; 0x04 23660: 8c 0d add r24, r12 23662: 9d 1d adc r25, r13 23664: ae 1d adc r26, r14 23666: bf 1d adc r27, r15 23668: b5 95 asr r27 2366a: a7 95 ror r26 2366c: 97 95 ror r25 2366e: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 23670: 21 14 cp r2, r1 23672: 31 04 cpc r3, r1 23674: 09 f4 brne .+2 ; 0x23678 23676: 45 c0 rjmp .+138 ; 0x23702 { soft_pwm_bed = (bias + d) >> 1; 23678: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2367c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23680: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23684: 01 96 adiw r24, 0x01 ; 1 23686: 90 93 70 06 sts 0x0670, r25 ; 0x800670 2368a: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f min=temp; 2368e: 3a 85 ldd r19, Y+10 ; 0x0a 23690: 3a 8b std Y+18, r19 ; 0x12 23692: 4b 85 ldd r20, Y+11 ; 0x0b 23694: 4b 8b std Y+19, r20 ; 0x13 23696: 5c 85 ldd r21, Y+12 ; 0x0c 23698: 5c 8b std Y+20, r21 ; 0x14 2369a: 8d 85 ldd r24, Y+13 ; 0x0d 2369c: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2369e: 98 a5 ldd r25, Y+40 ; 0x28 236a0: 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)) { 236a2: 20 e0 ldi r18, 0x00 ; 0 236a4: 30 e0 ldi r19, 0x00 ; 0 236a6: 40 ea ldi r20, 0xA0 ; 160 236a8: 51 e4 ldi r21, 0x41 ; 65 236aa: 6a 85 ldd r22, Y+10 ; 0x0a 236ac: 7b 85 ldd r23, Y+11 ; 0x0b 236ae: 8c 85 ldd r24, Y+12 ; 0x0c 236b0: 9d 85 ldd r25, Y+13 ; 0x0d 236b2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 236b6: 98 01 movw r18, r16 236b8: 48 a9 ldd r20, Y+48 ; 0x30 236ba: 5f a5 ldd r21, Y+47 ; 0x2f 236bc: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 236c0: 87 ff sbrs r24, 7 236c2: 22 c0 rjmp .+68 ; 0x23708 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 236c4: 8a e7 ldi r24, 0x7A ; 122 236c6: 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"); 236c8: 0e 94 de 72 call 0xe5bc ; 0xe5bc pid_tuning_finished = true; 236cc: 81 e0 ldi r24, 0x01 ; 1 236ce: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> pid_cycle = 0; 236d2: 10 92 70 06 sts 0x0670, r1 ; 0x800670 236d6: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 236da: 98 c0 rjmp .+304 ; 0x2380c 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); 236dc: 34 e1 ldi r19, 0x14 ; 20 236de: c3 2e mov r12, r19 236e0: d1 2c mov r13, r1 236e2: e1 2c mov r14, r1 236e4: f1 2c mov r15, r1 236e6: 24 e1 ldi r18, 0x14 ; 20 236e8: 30 e0 ldi r19, 0x00 ; 0 236ea: 40 e0 ldi r20, 0x00 ; 0 236ec: 50 e0 ldi r21, 0x00 ; 0 236ee: 29 83 std Y+1, r18 ; 0x01 236f0: 3a 83 std Y+2, r19 ; 0x02 236f2: 4b 83 std Y+3, r20 ; 0x03 236f4: 5c 83 std Y+4, r21 ; 0x04 236f6: d5 ce rjmp .-598 ; 0x234a2 236f8: c9 82 std Y+1, r12 ; 0x01 236fa: da 82 std Y+2, r13 ; 0x02 236fc: eb 82 std Y+3, r14 ; 0x03 236fe: fc 82 std Y+4, r15 ; 0x04 23700: d0 ce rjmp .-608 ; 0x234a2 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 23702: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 23706: ba cf rjmp .-140 ; 0x2367c SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 23708: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2370c: 28 a1 ldd r18, Y+32 ; 0x20 2370e: 39 a1 ldd r19, Y+33 ; 0x21 23710: 4a a1 ldd r20, Y+34 ; 0x22 23712: 5b a1 ldd r21, Y+35 ; 0x23 23714: 62 1b sub r22, r18 23716: 73 0b sbc r23, r19 23718: 84 0b sbc r24, r20 2371a: 95 0b sbc r25, r21 2371c: 61 3d cpi r22, 0xD1 ; 209 2371e: 77 40 sbci r23, 0x07 ; 7 23720: 81 05 cpc r24, r1 23722: 91 05 cpc r25, r1 23724: 58 f1 brcs .+86 ; 0x2377c int p; if (extruder<0){ p=soft_pwm_bed; 23726: a0 90 5b 06 lds r10, 0x065B ; 0x80065b 2372a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2372c: 87 e7 ldi r24, 0x77 ; 119 2372e: 92 e9 ldi r25, 0x92 ; 146 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 23730: 21 14 cp r2, r1 23732: 31 04 cpc r3, r1 23734: 29 f4 brne .+10 ; 0x23740 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 23736: a0 90 62 06 lds r10, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.504> 2373a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2373c: 84 e7 ldi r24, 0x74 ; 116 2373e: 92 e9 ldi r25, 0x92 ; 146 23740: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 23744: 42 e0 ldi r20, 0x02 ; 2 23746: b8 01 movw r22, r16 23748: 88 a9 ldd r24, Y+48 ; 0x30 2374a: 9f a5 ldd r25, Y+47 ; 0x2f 2374c: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 23750: 80 e7 ldi r24, 0x70 ; 112 23752: 92 e9 ldi r25, 0x92 ; 146 23754: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOLLN(p); 23758: c5 01 movw r24, r10 2375a: 0f 94 48 41 call 0x28290 ; 0x28290 if (safety_check_cycles == 0) { //save ambient temp 2375e: 4d 81 ldd r20, Y+5 ; 0x05 23760: 44 23 and r20, r20 23762: 09 f4 brne .+2 ; 0x23766 23764: 6c c0 rjmp .+216 ; 0x2383e temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 23766: 5f 8d ldd r21, Y+31 ; 0x1f 23768: 45 17 cp r20, r21 2376a: 70 f5 brcc .+92 ; 0x237c8 safety_check_cycles++; 2376c: 4f 5f subi r20, 0xFF ; 255 2376e: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 23770: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23774: 68 a3 std Y+32, r22 ; 0x20 23776: 79 a3 std Y+33, r23 ; 0x21 23778: 8a a3 std Y+34, r24 ; 0x22 2377a: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2377c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23780: 4b 01 movw r8, r22 23782: 5c 01 movw r10, r24 23784: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23788: 4e 80 ldd r4, Y+6 ; 0x06 2378a: 5f 80 ldd r5, Y+7 ; 0x07 2378c: 68 84 ldd r6, Y+8 ; 0x08 2378e: 79 84 ldd r7, Y+9 ; 0x09 23790: 2e 85 ldd r18, Y+14 ; 0x0e 23792: 3f 85 ldd r19, Y+15 ; 0x0f 23794: 48 89 ldd r20, Y+16 ; 0x10 23796: 59 89 ldd r21, Y+17 ; 0x11 23798: 42 0e add r4, r18 2379a: 53 1e adc r5, r19 2379c: 64 1e adc r6, r20 2379e: 75 1e adc r7, r21 237a0: 84 18 sub r8, r4 237a2: 95 08 sbc r9, r5 237a4: a6 08 sbc r10, r6 237a6: b7 08 sbc r11, r7 237a8: 86 0e add r8, r22 237aa: 97 1e adc r9, r23 237ac: a8 1e adc r10, r24 237ae: b9 1e adc r11, r25 237b0: 31 e8 ldi r19, 0x81 ; 129 237b2: 83 16 cp r8, r19 237b4: 3f e4 ldi r19, 0x4F ; 79 237b6: 93 06 cpc r9, r19 237b8: 32 e1 ldi r19, 0x12 ; 18 237ba: a3 06 cpc r10, r19 237bc: b1 04 cpc r11, r1 237be: 08 f4 brcc .+2 ; 0x237c2 237c0: 47 c0 rjmp .+142 ; 0x23850 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 237c2: 83 e5 ldi r24, 0x53 ; 83 237c4: 92 e9 ldi r25, 0x92 ; 146 237c6: 80 cf rjmp .-256 ; 0x236c8 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 237c8: 8d 81 ldd r24, Y+5 ; 0x05 237ca: 9f 8d ldd r25, Y+31 ; 0x1f 237cc: 89 13 cpse r24, r25 237ce: d0 cf rjmp .-96 ; 0x23770 safety_check_cycles++; 237d0: 8f 5f subi r24, 0xFF ; 255 237d2: 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) { 237d4: 2b a5 ldd r18, Y+43 ; 0x2b 237d6: 3c a5 ldd r19, Y+44 ; 0x2c 237d8: 4d a5 ldd r20, Y+45 ; 0x2d 237da: 5e a5 ldd r21, Y+46 ; 0x2e 237dc: b8 01 movw r22, r16 237de: 88 a9 ldd r24, Y+48 ; 0x30 237e0: 9f a5 ldd r25, Y+47 ; 0x2f 237e2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 237e6: 9f 77 andi r25, 0x7F ; 127 237e8: 20 e0 ldi r18, 0x00 ; 0 237ea: 30 e0 ldi r19, 0x00 ; 0 237ec: 40 ea ldi r20, 0xA0 ; 160 237ee: 50 e4 ldi r21, 0x40 ; 64 237f0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 237f4: 87 ff sbrs r24, 7 237f6: bc cf rjmp .-136 ; 0x23770 temp_runaway_stop(false, (extruder<0)); 237f8: 63 2d mov r22, r3 237fa: 66 1f adc r22, r22 237fc: 66 27 eor r22, r22 237fe: 66 1f adc r22, r22 23800: 80 e0 ldi r24, 0x00 ; 0 23802: 0f 94 47 09 call 0x2128e ; 0x2128e pid_tuning_finished = true; 23806: 81 e0 ldi r24, 0x01 ; 1 23808: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.421> pid_cycle = 0; return; } lcd_update(0); } } 2380c: e0 96 adiw r28, 0x30 ; 48 2380e: 0f b6 in r0, 0x3f ; 63 23810: f8 94 cli 23812: de bf out 0x3e, r29 ; 62 23814: 0f be out 0x3f, r0 ; 63 23816: cd bf out 0x3d, r28 ; 61 23818: df 91 pop r29 2381a: cf 91 pop r28 2381c: 1f 91 pop r17 2381e: 0f 91 pop r16 23820: ff 90 pop r15 23822: ef 90 pop r14 23824: df 90 pop r13 23826: cf 90 pop r12 23828: bf 90 pop r11 2382a: af 90 pop r10 2382c: 9f 90 pop r9 2382e: 8f 90 pop r8 23830: 7f 90 pop r7 23832: 6f 90 pop r6 23834: 5f 90 pop r5 23836: 4f 90 pop r4 23838: 3f 90 pop r3 2383a: 2f 90 pop r2 2383c: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2383e: 0b a7 std Y+43, r16 ; 0x2b 23840: 1c a7 std Y+44, r17 ; 0x2c 23842: a8 a9 ldd r26, Y+48 ; 0x30 23844: ad a7 std Y+45, r26 ; 0x2d 23846: bf a5 ldd r27, Y+47 ; 0x2f 23848: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2384a: 21 e0 ldi r18, 0x01 ; 1 2384c: 2d 83 std Y+5, r18 ; 0x05 2384e: 90 cf rjmp .-224 ; 0x23770 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 23850: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23854: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23858: 49 a5 ldd r20, Y+41 ; 0x29 2385a: 5a a5 ldd r21, Y+42 ; 0x2a 2385c: 48 17 cp r20, r24 2385e: 59 07 cpc r21, r25 23860: 1c f4 brge .+6 ; 0x23868 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 23862: 87 ef ldi r24, 0xF7 ; 247 23864: 91 e9 ldi r25, 0x91 ; 145 23866: 30 cf rjmp .-416 ; 0x236c8 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 23868: 80 e0 ldi r24, 0x00 ; 0 2386a: 0e 94 cd 69 call 0xd39a ; 0xd39a 2386e: e6 cc rjmp .-1588 ; 0x2323c 00023870 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 23870: 0f 93 push r16 23872: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 23874: 80 91 59 03 lds r24, 0x0359 ; 0x800359 23878: 81 30 cpi r24, 0x01 ; 1 2387a: 19 f5 brne .+70 ; 0x238c2 2387c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 23880: 00 91 e9 05 lds r16, 0x05E9 ; 0x8005e9 23884: 10 91 ea 05 lds r17, 0x05EA ; 0x8005ea 23888: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 2388c: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 23890: 60 1b sub r22, r16 23892: 71 0b sbc r23, r17 23894: 82 0b sbc r24, r18 23896: 93 0b sbc r25, r19 23898: 28 ee ldi r18, 0xE8 ; 232 2389a: 33 e0 ldi r19, 0x03 ; 3 2389c: 40 e0 ldi r20, 0x00 ; 0 2389e: 50 e0 ldi r21, 0x00 ; 0 238a0: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 238a4: 60 91 e5 05 lds r22, 0x05E5 ; 0x8005e5 238a8: 70 91 e6 05 lds r23, 0x05E6 ; 0x8005e6 238ac: 80 91 e7 05 lds r24, 0x05E7 ; 0x8005e7 238b0: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 238b4: 62 0f add r22, r18 238b6: 73 1f adc r23, r19 238b8: 84 1f adc r24, r20 238ba: 95 1f adc r25, r21 } 238bc: 1f 91 pop r17 238be: 0f 91 pop r16 238c0: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 238c2: 60 91 78 06 lds r22, 0x0678 ; 0x800678 238c6: 70 91 79 06 lds r23, 0x0679 ; 0x800679 238ca: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 238ce: 90 91 7b 06 lds r25, 0x067B ; 0x80067b 238d2: d6 cf rjmp .-84 ; 0x23880 000238d4 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 238d4: 4f 92 push r4 238d6: 5f 92 push r5 238d8: 6f 92 push r6 238da: 7f 92 push r7 238dc: 8f 92 push r8 238de: 9f 92 push r9 238e0: af 92 push r10 238e2: bf 92 push r11 238e4: cf 92 push r12 238e6: df 92 push r13 238e8: ef 92 push r14 238ea: ff 92 push r15 238ec: 0f 93 push r16 238ee: 1f 93 push r17 238f0: cf 93 push r28 238f2: df 93 push r29 238f4: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 238f8: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 238fc: 88 23 and r24, r24 238fe: 09 f4 brne .+2 ; 0x23902 23900: 6e c0 rjmp .+220 ; 0x239de { const float _met = ((float)total_filament_used) / (100000.f); 23902: 60 91 84 06 lds r22, 0x0684 ; 0x800684 23906: 70 91 85 06 lds r23, 0x0685 ; 0x800685 2390a: 80 91 86 06 lds r24, 0x0686 ; 0x800686 2390e: 90 91 87 06 lds r25, 0x0687 ; 0x800687 23912: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 23916: 20 e0 ldi r18, 0x00 ; 0 23918: 30 e5 ldi r19, 0x50 ; 80 2391a: 43 ec ldi r20, 0xC3 ; 195 2391c: 57 e4 ldi r21, 0x47 ; 71 2391e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 23922: 56 2e mov r5, r22 23924: 47 2e mov r4, r23 23926: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 23928: 0f 94 38 1c call 0x23870 ; 0x23870 2392c: 6b 01 movw r12, r22 2392e: 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(); 23930: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P(_N( 23934: 8a ec ldi r24, 0xCA ; 202 23936: 9b e4 ldi r25, 0x4B ; 75 23938: 0e 94 3c 6d call 0xda78 ; 0xda78 2393c: 18 2f mov r17, r24 2393e: 09 2f mov r16, r25 23940: 8a eb ldi r24, 0xBA ; 186 23942: 9b e4 ldi r25, 0x4B ; 75 23944: 0e 94 3c 6d call 0xda78 ; 0xda78 23948: 78 2e mov r7, r24 2394a: 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; 2394c: 8c e3 ldi r24, 0x3C ; 60 2394e: 88 2e mov r8, r24 23950: 91 2c mov r9, r1 23952: a1 2c mov r10, r1 23954: b1 2c mov r11, r1 23956: c7 01 movw r24, r14 23958: b6 01 movw r22, r12 2395a: a5 01 movw r20, r10 2395c: 94 01 movw r18, r8 2395e: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23962: 7f 93 push r23 23964: 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; 23966: ca 01 movw r24, r20 23968: b9 01 movw r22, r18 2396a: a5 01 movw r20, r10 2396c: 94 01 movw r18, r8 2396e: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23972: 7f 93 push r23 23974: 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; 23976: c7 01 movw r24, r14 23978: b6 01 movw r22, r12 2397a: 20 e1 ldi r18, 0x10 ; 16 2397c: 3e e0 ldi r19, 0x0E ; 14 2397e: 40 e0 ldi r20, 0x00 ; 0 23980: 50 e0 ldi r21, 0x00 ; 0 23982: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23986: 5f 93 push r21 23988: 4f 93 push r20 2398a: 3f 93 push r19 2398c: 2f 93 push r18 2398e: 0f 93 push r16 23990: 1f 93 push r17 23992: df 93 push r29 23994: cf 93 push r28 23996: 4f 92 push r4 23998: 5f 92 push r5 2399a: 6f 92 push r6 2399c: 7f 92 push r7 2399e: 80 e6 ldi r24, 0x60 ; 96 239a0: 9b e6 ldi r25, 0x6B ; 107 239a2: 9f 93 push r25 239a4: 8f 93 push r24 239a6: 0e 94 df 69 call 0xd3be ; 0xd3be "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 239aa: 8d b7 in r24, 0x3d ; 61 239ac: 9e b7 in r25, 0x3e ; 62 239ae: 42 96 adiw r24, 0x12 ; 18 239b0: 0f b6 in r0, 0x3f ; 63 239b2: f8 94 cli 239b4: 9e bf out 0x3e, r25 ; 62 239b6: 0f be out 0x3f, r0 ; 63 239b8: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 239ba: df 91 pop r29 239bc: cf 91 pop r28 239be: 1f 91 pop r17 239c0: 0f 91 pop r16 239c2: ff 90 pop r15 239c4: ef 90 pop r14 239c6: df 90 pop r13 239c8: cf 90 pop r12 239ca: bf 90 pop r11 239cc: af 90 pop r10 239ce: 9f 90 pop r9 239d0: 8f 90 pop r8 239d2: 7f 90 pop r7 239d4: 6f 90 pop r6 239d6: 5f 90 pop r5 239d8: 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(); 239da: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 239de: 81 ef ldi r24, 0xF1 ; 241 239e0: 9f e0 ldi r25, 0x0F ; 15 239e2: 0f 94 85 a0 call 0x3410a ; 0x3410a 239e6: 2b 01 movw r4, r22 239e8: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 239ea: 8d ee ldi r24, 0xED ; 237 239ec: 9f e0 ldi r25, 0x0F ; 15 239ee: 0f 94 85 a0 call 0x3410a ; 0x3410a 239f2: 6b 01 movw r12, r22 239f4: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 239f6: 0e 94 32 6a call 0xd464 ; 0xd464 lcd_printf_P(_N( 239fa: 87 ea ldi r24, 0xA7 ; 167 239fc: 9b e4 ldi r25, 0x4B ; 75 239fe: 0e 94 3c 6d call 0xda78 ; 0xda78 23a02: 98 2e mov r9, r24 23a04: 89 2e mov r8, r25 23a06: 86 e9 ldi r24, 0x96 ; 150 23a08: 9b e4 ldi r25, 0x4B ; 75 23a0a: 0e 94 3c 6d call 0xda78 ; 0xda78 23a0e: b8 2e mov r11, r24 23a10: 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; 23a12: c7 01 movw r24, r14 23a14: b6 01 movw r22, r12 23a16: 2c e3 ldi r18, 0x3C ; 60 23a18: 30 e0 ldi r19, 0x00 ; 0 23a1a: 40 e0 ldi r20, 0x00 ; 0 23a1c: 50 e0 ldi r21, 0x00 ; 0 23a1e: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23a22: 7f 93 push r23 23a24: 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; 23a26: ca 01 movw r24, r20 23a28: b9 01 movw r22, r18 23a2a: 28 e1 ldi r18, 0x18 ; 24 23a2c: 30 e0 ldi r19, 0x00 ; 0 23a2e: 40 e0 ldi r20, 0x00 ; 0 23a30: 50 e0 ldi r21, 0x00 ; 0 23a32: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23a36: 7f 93 push r23 23a38: 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; 23a3a: c7 01 movw r24, r14 23a3c: b6 01 movw r22, r12 23a3e: 20 ea ldi r18, 0xA0 ; 160 23a40: 35 e0 ldi r19, 0x05 ; 5 23a42: 40 e0 ldi r20, 0x00 ; 0 23a44: 50 e0 ldi r21, 0x00 ; 0 23a46: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23a4a: 5f 93 push r21 23a4c: 4f 93 push r20 23a4e: 3f 93 push r19 23a50: 2f 93 push r18 23a52: 8f 92 push r8 23a54: 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; 23a56: c3 01 movw r24, r6 23a58: b2 01 movw r22, r4 23a5a: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 23a5e: 20 e0 ldi r18, 0x00 ; 0 23a60: 30 e0 ldi r19, 0x00 ; 0 23a62: 48 ec ldi r20, 0xC8 ; 200 23a64: 52 e4 ldi r21, 0x42 ; 66 23a66: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23a6a: 9f 93 push r25 23a6c: 8f 93 push r24 23a6e: 7f 93 push r23 23a70: 6f 93 push r22 23a72: af 92 push r10 23a74: bf 92 push r11 23a76: 8c e3 ldi r24, 0x3C ; 60 23a78: 9b e6 ldi r25, 0x6B ; 107 23a7a: 9f 93 push r25 23a7c: 8f 93 push r24 23a7e: 0e 94 df 69 call 0xd3be ; 0xd3be "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 23a82: 8d b7 in r24, 0x3d ; 61 23a84: 9e b7 in r25, 0x3e ; 62 23a86: 42 96 adiw r24, 0x12 ; 18 23a88: 0f b6 in r0, 0x3f ; 63 23a8a: f8 94 cli 23a8c: 9e bf out 0x3e, r25 ; 62 23a8e: 0f be out 0x3f, r0 ; 63 23a90: 8d bf out 0x3d, r24 ; 61 23a92: 93 cf rjmp .-218 ; 0x239ba 00023a94 : 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()") { 23a94: cf 92 push r12 23a96: df 92 push r13 23a98: ef 92 push r14 23a9a: ff 92 push r15 23a9c: 0f 93 push r16 23a9e: 1f 93 push r17 23aa0: cf 93 push r28 23aa2: df 93 push r29 23aa4: 00 d0 rcall .+0 ; 0x23aa6 23aa6: 00 d0 rcall .+0 ; 0x23aa8 23aa8: 1f 92 push r1 23aaa: 1f 92 push r1 23aac: cd b7 in r28, 0x3d ; 61 23aae: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 23ab0: 80 91 06 05 lds r24, 0x0506 ; 0x800506 23ab4: 90 91 07 05 lds r25, 0x0507 ; 0x800507 23ab8: 00 97 sbiw r24, 0x00 ; 0 23aba: e1 f1 breq .+120 ; 0x23b34 { const int16_t initial_feedmultiply = feedmultiply; 23abc: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 23ac0: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23ac4: 24 36 cpi r18, 0x64 ; 100 23ac6: 31 05 cpc r19, r1 23ac8: 4c f4 brge .+18 ; 0x23adc 23aca: ac 01 movw r20, r24 23acc: 42 0f add r20, r18 23ace: 53 1f adc r21, r19 23ad0: 45 36 cpi r20, 0x65 ; 101 23ad2: 51 05 cpc r21, r1 23ad4: 6c f4 brge .+26 ; 0x23af0 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; 23ad6: 82 0f add r24, r18 23ad8: 93 1f adc r25, r19 23ada: 0c c0 rjmp .+24 ; 0x23af4 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23adc: 24 36 cpi r18, 0x64 ; 100 23ade: 31 05 cpc r19, r1 23ae0: 09 f4 brne .+2 ; 0x23ae4 23ae2: 55 c0 rjmp .+170 ; 0x23b8e (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 23ae4: ac 01 movw r20, r24 23ae6: 42 0f add r20, r18 23ae8: 53 1f adc r21, r19 23aea: 44 36 cpi r20, 0x64 ; 100 23aec: 51 05 cpc r21, r1 23aee: 9c f7 brge .-26 ; 0x23ad6 { feedmultiply = 100; 23af0: 84 e6 ldi r24, 0x64 ; 100 23af2: 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; 23af4: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23af8: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 23afc: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23b00: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 23b04: 82 17 cp r24, r18 23b06: 93 07 cpc r25, r19 23b08: a9 f0 breq .+42 ; 0x23b34 feedmultiply = constrain(feedmultiply, 10, 999); 23b0a: 88 3e cpi r24, 0xE8 ; 232 23b0c: 53 e0 ldi r21, 0x03 ; 3 23b0e: 95 07 cpc r25, r21 23b10: 14 f0 brlt .+4 ; 0x23b16 23b12: 87 ee ldi r24, 0xE7 ; 231 23b14: 93 e0 ldi r25, 0x03 ; 3 23b16: 8a 30 cpi r24, 0x0A ; 10 23b18: 91 05 cpc r25, r1 23b1a: 14 f4 brge .+4 ; 0x23b20 23b1c: 8a e0 ldi r24, 0x0A ; 10 23b1e: 90 e0 ldi r25, 0x00 ; 0 23b20: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23b24: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 23b28: 10 92 07 05 sts 0x0507, r1 ; 0x800507 23b2c: 10 92 06 05 sts 0x0506, r1 ; 0x800506 refresh_saved_feedrate_multiplier_in_ram(); 23b30: 0e 94 50 5f call 0xbea0 ; 0xbea0 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 23b34: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 23b38: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 23b3a: 10 92 77 06 sts 0x0677, r1 ; 0x800677 } if (lcd_status_update_delay) 23b3e: 10 91 77 06 lds r17, 0x0677 ; 0x800677 23b42: 11 23 and r17, r17 23b44: 91 f1 breq .+100 ; 0x23baa lcd_status_update_delay--; 23b46: 2f ef ldi r18, 0xFF ; 255 23b48: 21 0f add r18, r17 23b4a: 20 93 77 06 sts 0x0677, r18 ; 0x800677 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 23b4e: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 23b52: 81 11 cpse r24, r1 23b54: 0d c0 rjmp .+26 ; 0x23b70 23b56: 0e 94 23 6c call 0xd846 ; 0xd846 23b5a: 88 23 and r24, r24 23b5c: 49 f0 breq .+18 ; 0x23b70 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 23b5e: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_main_menu); 23b62: 60 e0 ldi r22, 0x00 ; 0 23b64: 8d ef ldi r24, 0xFD ; 253 23b66: 93 ec ldi r25, 0xC3 ; 195 23b68: 0f 94 ca 94 call 0x32994 ; 0x32994 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 23b6c: 0e 94 b2 6a call 0xd564 ; 0xd564 } } 23b70: 28 96 adiw r28, 0x08 ; 8 23b72: 0f b6 in r0, 0x3f ; 63 23b74: f8 94 cli 23b76: de bf out 0x3e, r29 ; 62 23b78: 0f be out 0x3f, r0 ; 63 23b7a: cd bf out 0x3d, r28 ; 61 23b7c: df 91 pop r29 23b7e: cf 91 pop r28 23b80: 1f 91 pop r17 23b82: 0f 91 pop r16 23b84: ff 90 pop r15 23b86: ef 90 pop r14 23b88: df 90 pop r13 23b8a: cf 90 pop r12 23b8c: 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) { 23b8e: 8b 30 cpi r24, 0x0B ; 11 23b90: 91 05 cpc r25, r1 23b92: 1c f0 brlt .+6 ; 0x23b9a feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 23b94: 86 5a subi r24, 0xA6 ; 166 23b96: 9f 4f sbci r25, 0xFF ; 255 23b98: ad cf rjmp .-166 ; 0x23af4 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 23b9a: 86 3f cpi r24, 0xF6 ; 246 23b9c: 4f ef ldi r20, 0xFF ; 255 23b9e: 94 07 cpc r25, r20 23ba0: 0c f0 brlt .+2 ; 0x23ba4 23ba2: ac cf rjmp .-168 ; 0x23afc feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 23ba4: 82 59 subi r24, 0x92 ; 146 23ba6: 9f 4f sbci r25, 0xFF ; 255 23ba8: a5 cf rjmp .-182 ; 0x23af4 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; 23baa: 6a e0 ldi r22, 0x0A ; 10 23bac: 60 93 77 06 sts 0x0677, r22 ; 0x800677 ReInitLCD++; 23bb0: 80 91 76 06 lds r24, 0x0676 ; 0x800676 23bb4: 8f 5f subi r24, 0xFF ; 255 23bb6: 80 93 76 06 sts 0x0676, r24 ; 0x800676 if (ReInitLCD == 30) 23bba: 8e 31 cpi r24, 0x1E ; 30 23bbc: 09 f0 breq .+2 ; 0x23bc0 23bbe: 9f c0 rjmp .+318 ; 0x23cfe { ReInitLCD = 0 ; 23bc0: 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(); 23bc4: 0e 94 b2 6a call 0xd564 ; 0xd564 lcd_status_message_idx = 0; // Re-draw message from beginning 23bc8: 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(); 23bcc: 0e 94 ba 69 call 0xd374 ; 0xd374 lcd_home(); //line 0 23bd0: 0e 94 32 6a call 0xd464 ; 0xd464 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 23bd4: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 23bd8: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 23bdc: 07 2e mov r0, r23 23bde: 00 0c add r0, r0 23be0: 88 0b sbc r24, r24 23be2: 99 0b sbc r25, r25 23be4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__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)); 23be8: 20 e0 ldi r18, 0x00 ; 0 23bea: 30 e0 ldi r19, 0x00 ; 0 23bec: 40 e0 ldi r20, 0x00 ; 0 23bee: 5f e3 ldi r21, 0x3F ; 63 23bf0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 23bf4: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 23bf8: 6b 01 movw r12, r22 23bfa: 20 e0 ldi r18, 0x00 ; 0 23bfc: 30 e0 ldi r19, 0x00 ; 0 23bfe: 40 e0 ldi r20, 0x00 ; 0 23c00: 5f e3 ldi r21, 0x3F ; 63 23c02: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 23c06: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 23c0a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 23c0e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 23c12: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 23c16: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 23c1a: a6 01 movw r20, r12 23c1c: 82 e8 ldi r24, 0x82 ; 130 23c1e: 0f 94 95 06 call 0x20d2a ; 0x20d2a lcd_space(3); //3 spaces 23c22: 83 e0 ldi r24, 0x03 ; 3 23c24: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 23c28: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 23c2c: 81 30 cpi r24, 0x01 ; 1 23c2e: 09 f0 breq .+2 ; 0x23c32 23c30: 6e c0 rjmp .+220 ; 0x23d0e lcd_puts_P(_N("Z --- ")); 23c32: 89 e8 ldi r24, 0x89 ; 137 23c34: 9a e6 ldi r25, 0x6A ; 106 23c36: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 23c3a: 61 e0 ldi r22, 0x01 ; 1 23c3c: 80 e0 ldi r24, 0x00 ; 0 23c3e: 0e 94 06 6a call 0xd40c ; 0xd40c }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 23c42: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 23c46: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 23c4a: 07 2e mov r0, r23 23c4c: 00 0c add r0, r0 23c4e: 88 0b sbc r24, r24 23c50: 99 0b sbc r25, r25 23c52: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 23c56: 20 e0 ldi r18, 0x00 ; 0 23c58: 30 e0 ldi r19, 0x00 ; 0 23c5a: 40 e0 ldi r20, 0x00 ; 0 23c5c: 5f e3 ldi r21, 0x3F ; 63 23c5e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 23c62: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 23c66: 6b 01 movw r12, r22 23c68: 20 e0 ldi r18, 0x00 ; 0 23c6a: 30 e0 ldi r19, 0x00 ; 0 23c6c: 40 e0 ldi r20, 0x00 ; 0 23c6e: 5f e3 ldi r21, 0x3F ; 63 23c70: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 23c74: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 23c78: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 23c7c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 23c80: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 23c84: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 23c88: a6 01 movw r20, r12 23c8a: 80 e8 ldi r24, 0x80 ; 128 23c8c: 0f 94 95 06 call 0x20d2a ; 0x20d2a lcd_space(3); //3 spaces 23c90: 83 e0 ldi r24, 0x03 ; 3 23c92: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 23c96: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 23c9a: 8f 93 push r24 23c9c: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23ca0: 8f 93 push r24 23ca2: 82 e9 ldi r24, 0x92 ; 146 23ca4: 9a e6 ldi r25, 0x6A ; 106 23ca6: 9f 93 push r25 23ca8: 8f 93 push r24 23caa: 0e 94 df 69 call 0xd3be ; 0xd3be lcd_space(8 - chars); 23cae: 98 e0 ldi r25, 0x08 ; 8 23cb0: 98 1b sub r25, r24 23cb2: 89 2f mov r24, r25 23cb4: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 23cb8: 62 e0 ldi r22, 0x02 ; 2 23cba: 80 e0 ldi r24, 0x00 ; 0 23cbc: 0e 94 06 6a call 0xd40c ; 0xd40c } // 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(" ")); 23cc0: 0f 90 pop r0 23cc2: 0f 90 pop r0 23cc4: 0f 90 pop r0 23cc6: 0f 90 pop r0 23cc8: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 23ccc: e0 90 6a 13 lds r14, 0x136A ; 0x80136a 23cd0: 81 11 cpse r24, r1 23cd2: 3e c0 rjmp .+124 ; 0x23d50 23cd4: 25 ea ldi r18, 0xA5 ; 165 23cd6: c2 2e mov r12, r18 23cd8: 2a e6 ldi r18, 0x6A ; 106 23cda: d2 2e mov r13, r18 23cdc: e1 10 cpse r14, r1 23cde: 3c c0 rjmp .+120 ; 0x23d58 23ce0: 89 ea ldi r24, 0xA9 ; 169 23ce2: c8 2e mov r12, r24 23ce4: 8a e6 ldi r24, 0x6A ; 106 23ce6: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23ce8: 0e 94 a4 61 call 0xc348 ; 0xc348 23cec: f8 2e mov r15, r24 23cee: 88 23 and r24, r24 23cf0: d9 f1 breq .+118 ; 0x23d68 23cf2: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23cf6: 8f 3f cpi r24, 0xFF ; 255 23cf8: 89 f5 brne .+98 ; 0x23d5c 23cfa: f1 2c mov r15, r1 23cfc: 35 c0 rjmp .+106 ; 0x23d68 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 23cfe: 0f 94 38 a1 call 0x34270 ; 0x34270 <__divmodqi4> 23d02: 91 11 cpse r25, r1 23d04: 63 cf rjmp .-314 ; 0x23bcc lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 23d06: 80 e0 ldi r24, 0x00 ; 0 23d08: 0e 94 71 6a call 0xd4e2 ; 0xd4e2 23d0c: 5d cf rjmp .-326 ; 0x23bc8 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]?' ':'?'); 23d0e: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 23d12: 88 23 and r24, r24 23d14: d9 f0 breq .+54 ; 0x23d4c 23d16: 80 e2 ldi r24, 0x20 ; 32 23d18: 1f 92 push r1 23d1a: 8f 93 push r24 23d1c: 80 91 00 12 lds r24, 0x1200 ; 0x801200 23d20: 8f 93 push r24 23d22: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 23d26: 8f 93 push r24 23d28: 80 91 fe 11 lds r24, 0x11FE ; 0x8011fe 23d2c: 8f 93 push r24 23d2e: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 23d32: 8f 93 push r24 23d34: 80 e8 ldi r24, 0x80 ; 128 23d36: 9a e6 ldi r25, 0x6A ; 106 23d38: 9f 93 push r25 23d3a: 8f 93 push r24 23d3c: 0e 94 df 69 call 0xd3be ; 0xd3be 23d40: 0f b6 in r0, 0x3f ; 63 23d42: f8 94 cli 23d44: de bf out 0x3e, r29 ; 62 23d46: 0f be out 0x3f, r0 ; 63 23d48: cd bf out 0x3d, r28 ; 61 23d4a: 77 cf rjmp .-274 ; 0x23c3a 23d4c: 8f e3 ldi r24, 0x3F ; 63 23d4e: e4 cf rjmp .-56 ; 0x23d18 } // 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(" ")); 23d50: 9d ea ldi r25, 0xAD ; 173 23d52: c9 2e mov r12, r25 23d54: 9a e6 ldi r25, 0x6A ; 106 23d56: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23d58: ee 20 and r14, r14 23d5a: 31 f2 breq .-116 ; 0x23ce8 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23d5c: 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)); 23d60: ff 24 eor r15, r15 23d62: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23d64: 88 23 and r24, r24 23d66: 99 f1 breq .+102 ; 0x23dce { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 23d68: 81 ea ldi r24, 0xA1 ; 161 23d6a: 9d e0 ldi r25, 0x0D ; 13 23d6c: 0f 94 7d a0 call 0x340fa ; 0x340fa 23d70: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 23d72: 0e 94 b1 6f call 0xdf62 ; 0xdf62 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 23d76: 87 fd sbrc r24, 7 23d78: 2a c0 rjmp .+84 ; 0x23dce 23d7a: 08 17 cp r16, r24 23d7c: 41 f1 breq .+80 ; 0x23dce { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 23d7e: 9b e0 ldi r25, 0x0B ; 11 23d80: 09 02 muls r16, r25 23d82: b0 01 movw r22, r0 23d84: 11 24 eor r1, r1 23d86: 67 5b subi r22, 0xB7 ; 183 23d88: 72 4f sbci r23, 0xF2 ; 242 23d8a: 47 e0 ldi r20, 0x07 ; 7 23d8c: 50 e0 ldi r21, 0x00 ; 0 23d8e: 8e 01 movw r16, r28 23d90: 0f 5f subi r16, 0xFF ; 255 23d92: 1f 4f sbci r17, 0xFF ; 255 23d94: c8 01 movw r24, r16 23d96: 0f 94 6d a0 call 0x340da ; 0x340da sheet[7] = '\0'; 23d9a: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 23d9c: 1f 93 push r17 23d9e: 0f 93 push r16 23da0: 8c ec ldi r24, 0xCC ; 204 23da2: 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()); 23da4: 9f 93 push r25 23da6: 8f 93 push r24 23da8: 0e 94 df 69 call 0xd3be ; 0xd3be 23dac: 0f 90 pop r0 23dae: 0f 90 pop r0 23db0: 0f 90 pop r0 23db2: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 23db4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 23db8: 81 30 cpi r24, 0x01 ; 1 23dba: 09 f0 breq .+2 ; 0x23dbe 23dbc: 5a c0 rjmp .+180 ; 0x23e72 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 23dbe: 0f 94 c6 0c call 0x2198c ; 0x2198c 23dc2: 95 e0 ldi r25, 0x05 ; 5 23dc4: 98 1b sub r25, r24 23dc6: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 23dc8: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 23dcc: 5f c0 rjmp .+190 ; 0x23e8c lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 23dce: e1 10 cpse r14, r1 23dd0: 04 c0 rjmp .+8 ; 0x23dda 23dd2: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.417> 23dd6: 81 11 cpse r24, r1 23dd8: 42 c0 rjmp .+132 ; 0x23e5e // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 23dda: df 92 push r13 23ddc: cf 92 push r12 23dde: 88 ec ldi r24, 0xC8 ; 200 23de0: 95 e9 ldi r25, 0x95 ; 149 23de2: 9f 93 push r25 23de4: 8f 93 push r24 23de6: 0e 94 df 69 call 0xd3be ; 0xd3be 23dea: 0f 90 pop r0 23dec: 0f 90 pop r0 23dee: 0f 90 pop r0 23df0: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 23df2: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23df6: 85 36 cpi r24, 0x65 ; 101 23df8: d0 f1 brcs .+116 ; 0x23e6e 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;}; 23dfa: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 23dfe: 88 23 and r24, r24 23e00: 19 f1 breq .+70 ; 0x23e48 23e02: 80 91 77 16 lds r24, 0x1677 ; 0x801677 23e06: 90 91 78 16 lds r25, 0x1678 ; 0x801678 23e0a: a0 91 79 16 lds r26, 0x1679 ; 0x801679 23e0e: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 23e12: 00 97 sbiw r24, 0x00 ; 0 23e14: a1 05 cpc r26, r1 23e16: b1 05 cpc r27, r1 23e18: b9 f0 breq .+46 ; 0x23e48 23e1a: bc 01 movw r22, r24 23e1c: cd 01 movw r24, r26 23e1e: 6d 59 subi r22, 0x9D ; 157 23e20: 7f 4f sbci r23, 0xFF ; 255 23e22: 8f 4f sbci r24, 0xFF ; 255 23e24: 9f 4f sbci r25, 0xFF ; 255 23e26: 24 e6 ldi r18, 0x64 ; 100 23e28: 30 e0 ldi r19, 0x00 ; 0 23e2a: 40 e0 ldi r20, 0x00 ; 0 23e2c: 50 e0 ldi r21, 0x00 ; 0 23e2e: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 23e32: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 23e36: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 23e3a: 80 91 80 16 lds r24, 0x1680 ; 0x801680 23e3e: 90 91 81 16 lds r25, 0x1681 ; 0x801681 23e42: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 23e46: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23e48: 21 2f mov r18, r17 23e4a: 30 e0 ldi r19, 0x00 ; 0 23e4c: 8f e9 ldi r24, 0x9F ; 159 23e4e: 9a e6 ldi r25, 0x6A ; 106 23e50: f1 10 cpse r15, r1 23e52: 02 c0 rjmp .+4 ; 0x23e58 23e54: 89 e9 ldi r24, 0x99 ; 153 23e56: 9a e6 ldi r25, 0x6A ; 106 23e58: 3f 93 push r19 23e5a: 2f 93 push r18 23e5c: a3 cf rjmp .-186 ; 0x23da4 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 23e5e: 81 e0 ldi r24, 0x01 ; 1 23e60: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 lcd_print(hostName); // Two characters 23e64: 82 e7 ldi r24, 0x72 ; 114 23e66: 96 e0 ldi r25, 0x06 ; 6 23e68: 0e 94 0d 6c call 0xd81a ; 0xd81a 23e6c: c2 cf rjmp .-124 ; 0x23df2 23e6e: 18 2f mov r17, r24 23e70: eb cf rjmp .-42 ; 0x23e48 lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 23e72: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23e76: 88 23 and r24, r24 23e78: 09 f4 brne .+2 ; 0x23e7c 23e7a: a5 c0 rjmp .+330 ; 0x23fc6 } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 23e7c: 81 eb ldi r24, 0xB1 ; 177 23e7e: 9a e6 ldi r25, 0x6A ; 106 23e80: 9f 93 push r25 23e82: 8f 93 push r24 23e84: 0e 94 df 69 call 0xd3be ; 0xd3be 23e88: 0f 90 pop r0 23e8a: 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()) { 23e8c: 0e 94 a4 61 call 0xc348 ; 0xc348 23e90: 88 23 and r24, r24 23e92: 09 f4 brne .+2 ; 0x23e96 23e94: ac c0 rjmp .+344 ; 0x23fee 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) 23e96: c0 90 74 02 lds r12, 0x0274 ; 0x800274 23e9a: 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) 23e9e: e0 90 72 02 lds r14, 0x0272 ; 0x800272 23ea2: f0 90 73 02 lds r15, 0x0273 ; 0x800273 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 23ea6: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23eaa: 8a 30 cpi r24, 0x0A ; 10 23eac: 11 f4 brne .+4 ; 0x23eb2 clock_interval = 0; 23eae: 10 92 75 06 sts 0x0675, r1 ; 0x800675 clock_interval++; 23eb2: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23eb6: 8f 5f subi r24, 0xFF ; 255 23eb8: 80 93 75 06 sts 0x0675, r24 ; 0x800675 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 23ebc: 2f ef ldi r18, 0xFF ; 255 23ebe: e2 16 cp r14, r18 23ec0: f2 06 cpc r15, r18 23ec2: 21 f0 breq .+8 ; 0x23ecc 23ec4: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 23ec6: 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) { 23ec8: 86 30 cpi r24, 0x06 ; 6 23eca: 70 f4 brcc .+28 ; 0x23ee8 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 23ecc: 3f ef ldi r19, 0xFF ; 255 23ece: c3 16 cp r12, r19 23ed0: d3 06 cpc r13, r19 23ed2: 09 f0 breq .+2 ; 0x23ed6 23ed4: 7a c0 rjmp .+244 ; 0x23fca print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 23ed6: 0f 94 38 1c call 0x23870 ; 0x23870 23eda: 2c e3 ldi r18, 0x3C ; 60 23edc: 30 e0 ldi r19, 0x00 ; 0 23ede: 40 e0 ldi r20, 0x00 ; 0 23ee0: 50 e0 ldi r21, 0x00 ; 0 23ee2: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__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 = ' '; 23ee6: 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)) { 23ee8: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 23eec: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 23ef0: 44 36 cpi r20, 0x64 ; 100 23ef2: 51 05 cpc r21, r1 23ef4: 09 f4 brne .+2 ; 0x23ef8 23ef6: 6c c0 rjmp .+216 ; 0x23fd0 23ef8: c2 16 cp r12, r18 23efa: d3 06 cpc r13, r19 23efc: 21 f0 breq .+8 ; 0x23f06 23efe: e2 16 cp r14, r18 23f00: f3 06 cpc r15, r19 23f02: 09 f0 breq .+2 ; 0x23f06 23f04: 65 c0 rjmp .+202 ; 0x23fd0 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); 23f06: a4 e6 ldi r26, 0x64 ; 100 23f08: b0 e0 ldi r27, 0x00 ; 0 23f0a: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 23f0e: 9a 01 movw r18, r20 23f10: 55 0f add r21, r21 23f12: 44 0b sbc r20, r20 23f14: 55 0b sbc r21, r21 23f16: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 23f1a: 4f e3 ldi r20, 0x3F ; 63 23f1c: e4 2e mov r14, r20 23f1e: 04 2e mov r0, r20 23f20: 00 0c add r0, r0 23f22: ff 08 sbc r15, r15 23f24: e1 2f mov r30, r17 23f26: 01 2e mov r0, r17 23f28: 00 0c add r0, r0 23f2a: ff 0b sbc r31, r31 23f2c: c9 01 movw r24, r18 23f2e: 6c e3 ldi r22, 0x3C ; 60 23f30: 70 e0 ldi r23, 0x00 ; 0 23f32: 0f 94 46 a1 call 0x3428c ; 0x3428c <__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 23f36: 20 37 cpi r18, 0x70 ; 112 23f38: 37 41 sbci r19, 0x17 ; 23 23f3a: 08 f0 brcs .+2 ; 0x23f3e 23f3c: 4b c0 rjmp .+150 ; 0x23fd4 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 23f3e: ff 92 push r15 23f40: 4f 93 push r20 23f42: ff 93 push r31 23f44: 1f 93 push r17 23f46: 9f 93 push r25 23f48: 8f 93 push r24 23f4a: 7f 93 push r23 23f4c: 6f 93 push r22 23f4e: 8b ec ldi r24, 0xCB ; 203 23f50: 9a e6 ldi r25, 0x6A ; 106 23f52: 9f 93 push r25 23f54: 8f 93 push r24 23f56: 0e 94 df 69 call 0xd3be ; 0xd3be else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 23f5a: 0f b6 in r0, 0x3f ; 63 23f5c: f8 94 cli 23f5e: de bf out 0x3e, r29 ; 62 23f60: 0f be out 0x3f, r0 ; 63 23f62: 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); 23f64: 98 e0 ldi r25, 0x08 ; 8 23f66: 98 1b sub r25, r24 23f68: 89 2f mov r24, r25 23f6a: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 23f6e: 63 e0 ldi r22, 0x03 ; 3 23f70: 80 e0 ldi r24, 0x00 ; 0 23f72: 0e 94 06 6a call 0xd40c ; 0xd40c #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 23f76: 0f 94 f7 0f call 0x21fee ; 0x21fee } SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { 23f7a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23f7e: 88 23 and r24, r24 23f80: b1 f0 breq .+44 ; 0x23fae farm_timer--; 23f82: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 23f86: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 23f88: d9 f1 breq .+118 ; 0x24000 SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 23f8a: 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) { 23f8e: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 23f92: 85 30 cpi r24, 0x05 ; 5 23f94: e1 f1 breq .+120 ; 0x2400e 23f96: 88 30 cpi r24, 0x08 ; 8 23f98: 51 f4 brne .+20 ; 0x23fae case 8: prusa_statistics(21); 23f9a: 85 e1 ldi r24, 0x15 ; 21 23f9c: 0f 94 a0 98 call 0x33140 ; 0x33140 if(eFilamentAction != FilamentAction::None) 23fa0: 80 91 62 03 lds r24, 0x0362 ; 0x800362 23fa4: 88 23 and r24, r24 23fa6: 19 f0 breq .+6 ; 0x23fae prusa_statistics(22); 23fa8: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 23faa: 0f 94 a0 98 call 0x33140 ; 0x33140 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 23fae: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 23fb2: 88 23 and r24, r24 23fb4: 09 f4 brne .+2 ; 0x23fb8 23fb6: cb cd rjmp .-1130 ; 0x23b4e 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) { 23fb8: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 23fbc: 81 11 cpse r24, r1 23fbe: c7 cd rjmp .-1138 ; 0x23b4e 23fc0: 0e 94 70 e6 call 0x1cce0 ; 0x1cce0 23fc4: c4 cd rjmp .-1144 ; 0x23b4e lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 23fc6: 85 e0 ldi r24, 0x05 ; 5 23fc8: ff ce rjmp .-514 ; 0x23dc8 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) { 23fca: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 23fcc: 12 e5 ldi r17, 0x52 ; 82 23fce: 8c cf rjmp .-232 ; 0x23ee8 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 = ' '; 23fd0: 40 e2 ldi r20, 0x20 ; 32 23fd2: a4 cf rjmp .-184 ; 0x23f1c } 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); 23fd4: ff 92 push r15 23fd6: 4f 93 push r20 23fd8: ff 93 push r31 23fda: 1f 93 push r17 23fdc: 7f 93 push r23 23fde: 6f 93 push r22 23fe0: 80 ec ldi r24, 0xC0 ; 192 23fe2: 9a e6 ldi r25, 0x6A ; 106 23fe4: 9f 93 push r25 23fe6: 8f 93 push r24 23fe8: 0e 94 df 69 call 0xd3be ; 0xd3be 23fec: b6 cf rjmp .-148 ; 0x23f5a } 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 "--:-- ")); 23fee: 87 eb ldi r24, 0xB7 ; 183 23ff0: 9a e6 ldi r25, 0x6A ; 106 23ff2: 9f 93 push r25 23ff4: 8f 93 push r24 23ff6: 0e 94 df 69 call 0xd3be ; 0xd3be 23ffa: 0f 90 pop r0 23ffc: 0f 90 pop r0 23ffe: b2 cf rjmp .-156 ; 0x23f64 void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 24000: 8a e0 ldi r24, 0x0A ; 10 24002: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> prusa_statistics(0); 24006: 80 e0 ldi r24, 0x00 ; 0 24008: 0f 94 a0 98 call 0x33140 ; 0x33140 2400c: c0 cf rjmp .-128 ; 0x23f8e prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 2400e: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 24012: 88 23 and r24, r24 24014: 61 f2 breq .-104 ; 0x23fae prusa_statistics(20); 24016: 84 e1 ldi r24, 0x14 ; 20 24018: c8 cf rjmp .-112 ; 0x23faa 0002401a : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2401a: 10 92 59 03 sts 0x0359, r1 ; 0x800359 startTimestamp = 0; 2401e: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 24022: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 24026: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 2402a: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec stopTimestamp = 0; 2402e: 10 92 78 06 sts 0x0678, r1 ; 0x800678 24032: 10 92 79 06 sts 0x0679, r1 ; 0x800679 24036: 10 92 7a 06 sts 0x067A, r1 ; 0x80067a 2403a: 10 92 7b 06 sts 0x067B, r1 ; 0x80067b accumulator = 0; 2403e: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 24042: 10 92 e6 05 sts 0x05E6, r1 ; 0x8005e6 24046: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 2404a: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 } 2404e: 08 95 ret 00024050 : /** * @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; } 24050: 80 91 59 03 lds r24, 0x0359 ; 0x800359 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 24054: 81 30 cpi r24, 0x01 ; 1 24056: f1 f0 breq .+60 ; 0x24094 if (isPaused()) accumulator = duration(); 24058: 82 30 cpi r24, 0x02 ; 2 2405a: c9 f4 brne .+50 ; 0x2408e 2405c: 0f 94 38 1c call 0x23870 ; 0x23870 24060: 60 93 e5 05 sts 0x05E5, r22 ; 0x8005e5 24064: 70 93 e6 05 sts 0x05E6, r23 ; 0x8005e6 24068: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 2406c: 90 93 e8 05 sts 0x05E8, r25 ; 0x8005e8 else reset(); state = RUNNING; 24070: 81 e0 ldi r24, 0x01 ; 1 24072: 80 93 59 03 sts 0x0359, r24 ; 0x800359 startTimestamp = _millis(); 24076: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2407a: 60 93 e9 05 sts 0x05E9, r22 ; 0x8005e9 2407e: 70 93 ea 05 sts 0x05EA, r23 ; 0x8005ea 24082: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 24086: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 2408a: 81 e0 ldi r24, 0x01 ; 1 2408c: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2408e: 0f 94 0d 20 call 0x2401a ; 0x2401a 24092: ee cf rjmp .-36 ; 0x24070 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 24094: 80 e0 ldi r24, 0x00 ; 0 } 24096: 08 95 ret 00024098 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 24098: 80 91 59 03 lds r24, 0x0359 ; 0x800359 2409c: 81 50 subi r24, 0x01 ; 1 2409e: 82 30 cpi r24, 0x02 ; 2 240a0: 70 f4 brcc .+28 ; 0x240be state = STOPPED; 240a2: 10 92 59 03 sts 0x0359, r1 ; 0x800359 stopTimestamp = _millis(); 240a6: 0f 94 46 0f call 0x21e8c ; 0x21e8c 240aa: 60 93 78 06 sts 0x0678, r22 ; 0x800678 240ae: 70 93 79 06 sts 0x0679, r23 ; 0x800679 240b2: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 240b6: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 240ba: 81 e0 ldi r24, 0x01 ; 1 240bc: 08 95 ret return true; } else return false; 240be: 80 e0 ldi r24, 0x00 ; 0 } 240c0: 08 95 ret 000240c2 : #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); 240c2: 2f ef ldi r18, 0xFF ; 255 240c4: 30 e0 ldi r19, 0x00 ; 0 240c6: dc 01 movw r26, r24 240c8: 0f 94 9d a1 call 0x3433a ; 0x3433a <__usmulhisi3> 240cc: 20 ed ldi r18, 0xD0 ; 208 240ce: 37 e0 ldi r19, 0x07 ; 7 240d0: 40 e0 ldi r20, 0x00 ; 0 240d2: 50 e0 ldi r21, 0x00 ; 0 240d4: 0f 94 6e a1 call 0x342dc ; 0x342dc <__divmodsi4> 240d8: b9 01 movw r22, r18 240da: 8c e2 ldi r24, 0x2C ; 44 240dc: 0c 94 6c c0 jmp 0x180d8 ; 0x180d8 000240e0 : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 240e0: cf 93 push r28 240e2: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 240e4: 8a ee ldi r24, 0xEA ; 234 240e6: 91 e9 ldi r25, 0x91 ; 145 240e8: 0e 94 de 72 call 0xe5bc ; 0xe5bc SERIAL_PROTOCOLPGM("X: "); 240ec: 86 ee ldi r24, 0xE6 ; 230 240ee: 91 e9 ldi r25, 0x91 ; 145 240f0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL( READ(X_MS1_PIN)); 240f4: 62 b3 in r22, 0x12 ; 18 240f6: 66 95 lsr r22 240f8: 61 70 andi r22, 0x01 ; 1 240fa: 70 e0 ldi r23, 0x00 ; 0 240fc: 90 e0 ldi r25, 0x00 ; 0 240fe: 80 e0 ldi r24, 0x00 ; 0 24100: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 24104: 82 b3 in r24, 0x12 ; 18 24106: 81 70 andi r24, 0x01 ; 1 24108: 90 e0 ldi r25, 0x00 ; 0 2410a: 0f 94 48 41 call 0x28290 ; 0x28290 SERIAL_PROTOCOLPGM("Y: "); 2410e: 82 ee ldi r24, 0xE2 ; 226 24110: 91 e9 ldi r25, 0x91 ; 145 24112: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 24116: c6 e0 ldi r28, 0x06 ; 6 24118: d1 e0 ldi r29, 0x01 ; 1 2411a: 68 81 ld r22, Y 2411c: 06 2e mov r0, r22 2411e: 00 0c add r0, r0 24120: 77 0b sbc r23, r23 24122: 88 0b sbc r24, r24 24124: 99 0b sbc r25, r25 24126: 66 27 eor r22, r22 24128: 97 fd sbrc r25, 7 2412a: 63 95 inc r22 2412c: 77 27 eor r23, r23 2412e: 88 27 eor r24, r24 24130: 99 27 eor r25, r25 24132: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 24136: 82 b3 in r24, 0x12 ; 18 24138: 82 fb bst r24, 2 2413a: 88 27 eor r24, r24 2413c: 80 f9 bld r24, 0 2413e: 90 e0 ldi r25, 0x00 ; 0 24140: 0f 94 48 41 call 0x28290 ; 0x28290 SERIAL_PROTOCOLPGM("Z: "); 24144: 8e ed ldi r24, 0xDE ; 222 24146: 91 e9 ldi r25, 0x91 ; 145 24148: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 2414c: 68 81 ld r22, Y 2414e: 66 fb bst r22, 6 24150: 66 27 eor r22, r22 24152: 60 f9 bld r22, 0 24154: 70 e0 ldi r23, 0x00 ; 0 24156: 90 e0 ldi r25, 0x00 ; 0 24158: 80 e0 ldi r24, 0x00 ; 0 2415a: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 2415e: 88 81 ld r24, Y 24160: 85 fb bst r24, 5 24162: 88 27 eor r24, r24 24164: 80 f9 bld r24, 0 24166: 90 e0 ldi r25, 0x00 ; 0 24168: 0f 94 48 41 call 0x28290 ; 0x28290 SERIAL_PROTOCOLPGM("E0: "); 2416c: 89 ed ldi r24, 0xD9 ; 217 2416e: 91 e9 ldi r25, 0x91 ; 145 24170: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 24174: 68 81 ld r22, Y 24176: 63 fb bst r22, 3 24178: 66 27 eor r22, r22 2417a: 60 f9 bld r22, 0 2417c: 70 e0 ldi r23, 0x00 ; 0 2417e: 90 e0 ldi r25, 0x00 ; 0 24180: 80 e0 ldi r24, 0x00 ; 0 24182: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 24186: 88 81 ld r24, Y 24188: 82 95 swap r24 2418a: 81 70 andi r24, 0x01 ; 1 2418c: 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 } 2418e: df 91 pop r29 24190: 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)); 24192: 0d 94 48 41 jmp 0x28290 ; 0x28290 00024196 : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 24196: 67 fd sbrc r22, 7 24198: 08 c0 rjmp .+16 ; 0x241aa 2419a: 81 30 cpi r24, 0x01 ; 1 2419c: 21 f1 breq .+72 ; 0x241e6 2419e: d8 f0 brcs .+54 ; 0x241d6 241a0: 82 30 cpi r24, 0x02 ; 2 241a2: 99 f1 breq .+102 ; 0x2420a 241a4: 83 30 cpi r24, 0x03 ; 3 241a6: 09 f4 brne .+2 ; 0x241aa 241a8: 42 c0 rjmp .+132 ; 0x2422e 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) 241aa: 47 fd sbrc r20, 7 241ac: 4c c0 rjmp .+152 ; 0x24246 241ae: 81 30 cpi r24, 0x01 ; 1 241b0: 09 f4 brne .+2 ; 0x241b4 241b2: 55 c0 rjmp .+170 ; 0x2425e 241b4: 08 f4 brcc .+2 ; 0x241b8 241b6: 4d c0 rjmp .+154 ; 0x24252 241b8: 82 30 cpi r24, 0x02 ; 2 241ba: 09 f4 brne .+2 ; 0x241be 241bc: 56 c0 rjmp .+172 ; 0x2426a 241be: 83 30 cpi r24, 0x03 ; 3 241c0: 09 f0 breq .+2 ; 0x241c4 241c2: 41 c0 rjmp .+130 ; 0x24246 { 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; 241c4: 9f b7 in r25, 0x3f ; 63 241c6: 44 23 and r20, r20 241c8: 09 f4 brne .+2 ; 0x241cc 241ca: 5f c0 rjmp .+190 ; 0x2428a 241cc: f8 94 cli 241ce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 241d2: 80 61 ori r24, 0x10 ; 16 241d4: 51 c0 rjmp .+162 ; 0x24278 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; 241d6: 66 23 and r22, r22 241d8: 21 f0 breq .+8 ; 0x241e2 241da: 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) 241dc: 47 ff sbrs r20, 7 241de: 39 c0 rjmp .+114 ; 0x24252 241e0: 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; 241e2: a1 98 cbi 0x14, 1 ; 20 241e4: fb cf rjmp .-10 ; 0x241dc case 1: WRITE( Y_MS1_PIN,ms1); break; 241e6: 9f b7 in r25, 0x3f ; 63 241e8: 66 23 and r22, r22 241ea: 51 f0 breq .+20 ; 0x24200 241ec: f8 94 cli 241ee: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 241f2: 80 68 ori r24, 0x80 ; 128 241f4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 241f8: 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) 241fa: 47 ff sbrs r20, 7 241fc: 30 c0 rjmp .+96 ; 0x2425e 241fe: 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; 24200: f8 94 cli 24202: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24206: 8f 77 andi r24, 0x7F ; 127 24208: f5 cf rjmp .-22 ; 0x241f4 case 2: WRITE( Z_MS1_PIN,ms1); break; 2420a: 9f b7 in r25, 0x3f ; 63 2420c: 66 23 and r22, r22 2420e: 51 f0 breq .+20 ; 0x24224 24210: f8 94 cli 24212: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24216: 80 64 ori r24, 0x40 ; 64 24218: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2421c: 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) 2421e: 47 ff sbrs r20, 7 24220: 24 c0 rjmp .+72 ; 0x2426a 24222: 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; 24224: f8 94 cli 24226: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2422a: 8f 7b andi r24, 0xBF ; 191 2422c: f5 cf rjmp .-22 ; 0x24218 case 3: WRITE(E0_MS1_PIN,ms1); break; 2422e: 9f b7 in r25, 0x3f ; 63 24230: 66 23 and r22, r22 24232: 51 f0 breq .+20 ; 0x24248 24234: f8 94 cli 24236: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2423a: 88 60 ori r24, 0x08 ; 8 2423c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24240: 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) 24242: 47 ff sbrs r20, 7 24244: bf cf rjmp .-130 ; 0x241c4 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 } } 24246: 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; 24248: f8 94 cli 2424a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2424e: 87 7f andi r24, 0xF7 ; 247 24250: f5 cf rjmp .-22 ; 0x2423c case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 24252: 44 23 and r20, r20 24254: 11 f0 breq .+4 ; 0x2425a 24256: a0 9a sbi 0x14, 0 ; 20 24258: 08 95 ret 2425a: a0 98 cbi 0x14, 0 ; 20 2425c: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 2425e: 44 23 and r20, r20 24260: 11 f0 breq .+4 ; 0x24266 24262: a2 9a sbi 0x14, 2 ; 20 24264: 08 95 ret 24266: a2 98 cbi 0x14, 2 ; 20 24268: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 2426a: 9f b7 in r25, 0x3f ; 63 2426c: 44 23 and r20, r20 2426e: 41 f0 breq .+16 ; 0x24280 24270: f8 94 cli 24272: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24276: 80 62 ori r24, 0x20 ; 32 24278: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2427c: 9f bf out 0x3f, r25 ; 63 2427e: 08 95 ret 24280: f8 94 cli 24282: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24286: 8f 7d andi r24, 0xDF ; 223 24288: f7 cf rjmp .-18 ; 0x24278 case 3: WRITE(E0_MS2_PIN,ms2); break; 2428a: f8 94 cli 2428c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24290: 8f 7e andi r24, 0xEF ; 239 24292: f2 cf rjmp .-28 ; 0x24278 00024294 : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 24294: 64 30 cpi r22, 0x04 ; 4 24296: 81 f0 breq .+32 ; 0x242b8 24298: 30 f4 brcc .+12 ; 0x242a6 2429a: 61 30 cpi r22, 0x01 ; 1 2429c: 49 f0 breq .+18 ; 0x242b0 { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 2429e: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 242a0: 62 30 cpi r22, 0x02 ; 2 242a2: 69 f0 breq .+26 ; 0x242be 242a4: 08 95 ret 242a6: 68 30 cpi r22, 0x08 ; 8 242a8: 49 f0 breq .+18 ; 0x242bc 242aa: 60 31 cpi r22, 0x10 ; 16 242ac: 39 f0 breq .+14 ; 0x242bc 242ae: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 242b0: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 242b2: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 242b4: 0d 94 cb 20 jmp 0x24196 ; 0x24196 { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 242b8: 41 e0 ldi r20, 0x01 ; 1 242ba: fb cf rjmp .-10 ; 0x242b2 case 8: microstep_ms(driver,MICROSTEP8); break; 242bc: 41 e0 ldi r20, 0x01 ; 1 242be: 61 e0 ldi r22, 0x01 ; 1 242c0: f9 cf rjmp .-14 ; 0x242b4 000242c2 : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 242c2: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 242c4: 81 11 cpse r24, r1 242c6: 0e c0 rjmp .+28 ; 0x242e4 242c8: 2f ef ldi r18, 0xFF ; 255 242ca: 30 e0 ldi r19, 0x00 ; 0 242cc: 0f 94 9d a1 call 0x3433a ; 0x3433a <__usmulhisi3> 242d0: 20 ed ldi r18, 0xD0 ; 208 242d2: 37 e0 ldi r19, 0x07 ; 7 242d4: 40 e0 ldi r20, 0x00 ; 0 242d6: 50 e0 ldi r21, 0x00 ; 0 242d8: 0f 94 6e a1 call 0x342dc ; 0x342dc <__divmodsi4> 242dc: b9 01 movw r22, r18 242de: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 242e0: 0c 94 6c c0 jmp 0x180d8 ; 0x180d8 242e4: 81 30 cpi r24, 0x01 ; 1 242e6: 69 f4 brne .+26 ; 0x24302 242e8: 2f ef ldi r18, 0xFF ; 255 242ea: 30 e0 ldi r19, 0x00 ; 0 242ec: 0f 94 9d a1 call 0x3433a ; 0x3433a <__usmulhisi3> 242f0: 20 ed ldi r18, 0xD0 ; 208 242f2: 37 e0 ldi r19, 0x07 ; 7 242f4: 40 e0 ldi r20, 0x00 ; 0 242f6: 50 e0 ldi r21, 0x00 ; 0 242f8: 0f 94 6e a1 call 0x342dc ; 0x342dc <__divmodsi4> 242fc: b9 01 movw r22, r18 242fe: 8d e2 ldi r24, 0x2D ; 45 24300: ef cf rjmp .-34 ; 0x242e0 if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 24302: 82 30 cpi r24, 0x02 ; 2 24304: 19 f4 brne .+6 ; 0x2430c 24306: cb 01 movw r24, r22 24308: 0d 94 61 20 jmp 0x240c2 ; 0x240c2 } 2430c: 08 95 ret 0002430e : #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); 2430e: 8f ef ldi r24, 0xFF ; 255 24310: 9f e0 ldi r25, 0x0F ; 15 24312: 0f 94 7d a0 call 0x340fa ; 0x340fa SilentModeMenu = SilentMode; 24316: 80 93 89 03 sts 0x0389, r24 ; 0x800389 SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 2431a: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2431e: 98 60 ori r25, 0x08 ; 8 24320: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 24324: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24328: 90 61 ori r25, 0x10 ; 16 2432a: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 2432e: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24332: 90 62 ori r25, 0x20 ; 32 24334: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 24338: 88 23 and r24, r24 2433a: 21 f0 breq .+8 ; 0x24344 2433c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 24340: 88 23 and r24, r24 24342: 59 f1 breq .+86 ; 0x2439a motor_current_setting[0] = motor_current_setting_loud[0]; 24344: 8c e1 ldi r24, 0x1C ; 28 24346: 92 e0 ldi r25, 0x02 ; 2 24348: 90 93 62 02 sts 0x0262, r25 ; 0x800262 2434c: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_loud[1]; 24350: 8e e3 ldi r24, 0x3E ; 62 24352: 93 e0 ldi r25, 0x03 ; 3 24354: 90 93 64 02 sts 0x0264, r25 ; 0x800264 24358: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_loud[2]; 2435c: 84 ef ldi r24, 0xF4 ; 244 2435e: 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]; 24360: 90 93 66 02 sts 0x0266, r25 ; 0x800266 24364: 80 93 65 02 sts 0x0265, r24 ; 0x800265 } st_current_set(0, motor_current_setting[0]); 24368: 60 91 61 02 lds r22, 0x0261 ; 0x800261 2436c: 70 91 62 02 lds r23, 0x0262 ; 0x800262 24370: 80 e0 ldi r24, 0x00 ; 0 24372: 0f 94 61 21 call 0x242c2 ; 0x242c2 st_current_set(1, motor_current_setting[1]); 24376: 6e e3 ldi r22, 0x3E ; 62 24378: 73 e0 ldi r23, 0x03 ; 3 2437a: 81 e0 ldi r24, 0x01 ; 1 2437c: 0f 94 61 21 call 0x242c2 ; 0x242c2 24380: 80 91 65 02 lds r24, 0x0265 ; 0x800265 24384: 90 91 66 02 lds r25, 0x0266 ; 0x800266 24388: 0f 94 61 20 call 0x240c2 ; 0x240c2 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); 2438c: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 24390: 88 7f andi r24, 0xF8 ; 248 24392: 81 60 ori r24, 0x01 ; 1 24394: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 24398: 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]; 2439a: 8e e0 ldi r24, 0x0E ; 14 2439c: 91 e0 ldi r25, 0x01 ; 1 2439e: 90 93 62 02 sts 0x0262, r25 ; 0x800262 243a2: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_silent[1]; 243a6: 8e e3 ldi r24, 0x3E ; 62 243a8: 93 e0 ldi r25, 0x03 ; 3 243aa: 90 93 64 02 sts 0x0264, r25 ; 0x800264 243ae: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_silent[2]; 243b2: 82 ec ldi r24, 0xC2 ; 194 243b4: 91 e0 ldi r25, 0x01 ; 1 243b6: d4 cf rjmp .-88 ; 0x24360 000243b8 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 243b8: 80 91 89 03 lds r24, 0x0389 ; 0x800389 243bc: 88 23 and r24, r24 243be: 21 f0 breq .+8 ; 0x243c8 243c0: 81 30 cpi r24, 0x01 ; 1 243c2: 69 f4 brne .+26 ; 0x243de 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; 243c4: 82 e0 ldi r24, 0x02 ; 2 243c6: 01 c0 rjmp .+2 ; 0x243ca #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; 243c8: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 243ca: 80 93 89 03 sts 0x0389, r24 ; 0x800389 243ce: 60 91 89 03 lds r22, 0x0389 ; 0x800389 243d2: 8f ef ldi r24, 0xFF ; 255 243d4: 9f e0 ldi r25, 0x0F ; 15 243d6: 0f 94 a1 a0 call 0x34142 ; 0x34142 // 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(); 243da: 0d 94 87 21 jmp 0x2430e ; 0x2430e 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; 243de: 10 92 89 03 sts 0x0389, r1 ; 0x800389 243e2: f5 cf rjmp .-22 ; 0x243ce 000243e4 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 243e4: 2f b7 in r18, 0x3f ; 63 243e6: f8 94 cli count_pos = count_position[axis]; 243e8: 94 e0 ldi r25, 0x04 ; 4 243ea: 89 9f mul r24, r25 243ec: f0 01 movw r30, r0 243ee: 11 24 eor r1, r1 243f0: ea 54 subi r30, 0x4A ; 74 243f2: f9 4f sbci r31, 0xF9 ; 249 243f4: 60 81 ld r22, Z 243f6: 71 81 ldd r23, Z+1 ; 0x01 243f8: 82 81 ldd r24, Z+2 ; 0x02 243fa: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 243fc: 2f bf out 0x3f, r18 ; 63 return count_pos; } 243fe: 08 95 ret 00024400 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 24400: cf 93 push r28 24402: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 24404: 0f 94 f2 21 call 0x243e4 ; 0x243e4 24408: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2440c: 24 e0 ldi r18, 0x04 ; 4 2440e: c2 9f mul r28, r18 24410: f0 01 movw r30, r0 24412: 11 24 eor r1, r1 24414: ea 5c subi r30, 0xCA ; 202 24416: fb 4f sbci r31, 0xFB ; 251 24418: 20 81 ld r18, Z 2441a: 31 81 ldd r19, Z+1 ; 0x01 2441c: 42 81 ldd r20, Z+2 ; 0x02 2441e: 53 81 ldd r21, Z+3 ; 0x03 24420: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> } 24424: cf 91 pop r28 24426: 08 95 ret 00024428 : 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); 24428: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2442c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 24430: 98 17 cp r25, r24 24432: 29 f0 breq .+10 ; 0x2443e manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 24434: 90 e0 ldi r25, 0x00 ; 0 24436: 80 e0 ldi r24, 0x00 ; 0 24438: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 2443c: f5 cf rjmp .-22 ; 0x24428 #endif //TMC2130 } } 2443e: 08 95 ret 00024440 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 24440: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 24442: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 24446: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2444a: 80 ed ldi r24, 0xD0 ; 208 2444c: 97 e0 ldi r25, 0x07 ; 7 2444e: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24452: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 24456: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 2445a: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2445e: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 24462: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24466: 01 97 sbiw r24, 0x01 ; 1 24468: 8e 3f cpi r24, 0xFE ; 254 2446a: 9f 4f sbci r25, 0xFF ; 255 2446c: 20 f4 brcc .+8 ; 0x24476 nextAdvanceISR = 0; 2446e: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24472: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> #endif } 24476: 08 95 ret 00024478 <__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) { 24478: 1f 92 push r1 2447a: 0f 92 push r0 2447c: 0f b6 in r0, 0x3f ; 63 2447e: 0f 92 push r0 24480: 11 24 eor r1, r1 24482: 0b b6 in r0, 0x3b ; 59 24484: 0f 92 push r0 24486: 4f 92 push r4 24488: 5f 92 push r5 2448a: 6f 92 push r6 2448c: 7f 92 push r7 2448e: 8f 92 push r8 24490: cf 92 push r12 24492: df 92 push r13 24494: ef 92 push r14 24496: ff 92 push r15 24498: 1f 93 push r17 2449a: 2f 93 push r18 2449c: 3f 93 push r19 2449e: 4f 93 push r20 244a0: 5f 93 push r21 244a2: 6f 93 push r22 244a4: 7f 93 push r23 244a6: 8f 93 push r24 244a8: 9f 93 push r25 244aa: af 93 push r26 244ac: bf 93 push r27 244ae: cf 93 push r28 244b0: df 93 push r29 244b2: ef 93 push r30 244b4: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 244b6: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 244ba: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 244be: 9c 01 movw r18, r24 244c0: 21 50 subi r18, 0x01 ; 1 244c2: 31 09 sbc r19, r1 244c4: 2e 3f cpi r18, 0xFE ; 254 244c6: 3f 4f sbci r19, 0xFF ; 255 244c8: 90 f4 brcc .+36 ; 0x244ee <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 244ca: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 244ce: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 244d2: 28 17 cp r18, r24 244d4: 39 07 cpc r19, r25 244d6: 08 f0 brcs .+2 ; 0x244da <__vector_17+0x62> 244d8: f9 c0 rjmp .+498 ; 0x246cc <__vector_17+0x254> nextAdvanceISR -= OCR1A; 244da: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 244de: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 244e2: 82 1b sub r24, r18 244e4: 93 0b sbc r25, r19 244e6: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 244ea: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 244ee: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 244f2: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 244f6: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 244fa: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 244fe: 28 17 cp r18, r24 24500: 39 07 cpc r19, r25 24502: 08 f0 brcs .+2 ; 0x24506 <__vector_17+0x8e> 24504: e8 c0 rjmp .+464 ; 0x246d6 <__vector_17+0x25e> nextMainISR -= OCR1A; 24506: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2450a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2450e: 82 1b sub r24, r18 24510: 93 0b sbc r25, r19 24512: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24516: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2451a: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 2451e: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24522: 89 2b or r24, r25 24524: 11 f0 breq .+4 ; 0x2452a <__vector_17+0xb2> 24526: 0d 94 27 2b jmp 0x2564e ; 0x2564e <__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) 2452a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2452e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24532: 30 97 sbiw r30, 0x00 ; 0 24534: 09 f0 breq .+2 ; 0x24538 <__vector_17+0xc0> 24536: 82 c1 rjmp .+772 ; 0x2483c <__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) { 24538: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2453c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 24540: 98 17 cp r25, r24 24542: 09 f4 brne .+2 ; 0x24546 <__vector_17+0xce> 24544: 35 c3 rjmp .+1642 ; 0x24bb0 <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 24546: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 2454a: 2c 2f mov r18, r28 2454c: 30 e0 ldi r19, 0x00 ; 0 2454e: 5e e6 ldi r21, 0x6E ; 110 24550: c5 9f mul r28, r21 24552: e0 01 movw r28, r0 24554: 11 24 eor r1, r1 24556: c8 53 subi r28, 0x38 ; 56 24558: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 2455a: fe 01 movw r30, r28 2455c: e9 5b subi r30, 0xB9 ; 185 2455e: ff 4f sbci r31, 0xFF ; 255 24560: 41 e0 ldi r20, 0x01 ; 1 24562: 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(); 24564: d0 93 e5 11 sts 0x11E5, r29 ; 0x8011e5 24568: c0 93 e4 11 sts 0x11E4, r28 ; 0x8011e4 if (current_block != NULL) { 2456c: 20 97 sbiw r28, 0x00 ; 0 2456e: 09 f4 brne .+2 ; 0x24572 <__vector_17+0xfa> 24570: 1f c3 rjmp .+1598 ; 0x24bb0 <__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; 24572: 10 92 e1 05 sts 0x05E1, r1 ; 0x8005e1 24576: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 2457a: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 2457e: 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; 24582: 10 92 e0 05 sts 0x05E0, r1 ; 0x8005e0 acc_step_rate = uint16_t(current_block->initial_rate); 24586: 8a ad ldd r24, Y+58 ; 0x3a 24588: 9b ad ldd r25, Y+59 ; 0x3b 2458a: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 2458e: 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; 24592: 81 34 cpi r24, 0x41 ; 65 24594: ac e9 ldi r26, 0x9C ; 156 24596: 9a 07 cpc r25, r26 24598: 08 f0 brcs .+2 ; 0x2459c <__vector_17+0x124> 2459a: a2 c0 rjmp .+324 ; 0x246e0 <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2459c: 81 32 cpi r24, 0x21 ; 33 2459e: be e4 ldi r27, 0x4E ; 78 245a0: 9b 07 cpc r25, r27 245a2: 08 f4 brcc .+2 ; 0x245a6 <__vector_17+0x12e> 245a4: a0 c0 rjmp .+320 ; 0x246e6 <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 245a6: 96 95 lsr r25 245a8: 87 95 ror r24 245aa: 96 95 lsr r25 245ac: 87 95 ror r24 step_loops = 4; 245ae: 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; 245b0: 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 245b4: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 245b6: 81 15 cp r24, r1 245b8: f8 e0 ldi r31, 0x08 ; 8 245ba: 9f 07 cpc r25, r31 245bc: 08 f4 brcc .+2 ; 0x245c0 <__vector_17+0x148> 245be: a4 c0 rjmp .+328 ; 0x24708 <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 245c0: e9 2f mov r30, r25 245c2: ff 27 eor r31, r31 245c4: ee 0f add r30, r30 245c6: ff 1f adc r31, r31 245c8: ee 0f add r30, r30 245ca: ff 1f adc r31, r31 245cc: af 01 movw r20, r30 245ce: 47 52 subi r20, 0x27 ; 39 245d0: 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); 245d2: fa 01 movw r30, r20 245d4: 32 96 adiw r30, 0x02 ; 2 245d6: a5 91 lpm r26, Z+ 245d8: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 245da: fa 01 movw r30, r20 245dc: 45 91 lpm r20, Z+ 245de: 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. ); 245e0: b8 9f mul r27, r24 245e2: b0 01 movw r22, r0 245e4: a8 9f mul r26, r24 245e6: 00 0c add r0, r0 245e8: 61 1d adc r22, r1 245ea: 11 24 eor r1, r1 245ec: 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); 245ee: 46 1b sub r20, r22 245f0: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 245f2: ca 01 movw r24, r20 245f4: 44 36 cpi r20, 0x64 ; 100 245f6: 51 05 cpc r21, r1 245f8: 10 f4 brcc .+4 ; 0x245fe <__vector_17+0x186> 245fa: 84 e6 ldi r24, 0x64 ; 100 245fc: 90 e0 ldi r25, 0x00 ; 0 245fe: b0 e0 ldi r27, 0x00 ; 0 24600: a0 e0 ldi r26, 0x00 ; 0 24602: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 24606: 90 93 da 05 sts 0x05DA, r25 ; 0x8005da 2460a: a0 93 db 05 sts 0x05DB, r26 ; 0x8005db 2460e: b0 93 dc 05 sts 0x05DC, r27 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 24612: 4e e6 ldi r20, 0x6E ; 110 24614: 42 9f mul r20, r18 24616: c0 01 movw r24, r0 24618: 43 9f mul r20, r19 2461a: 90 0d add r25, r0 2461c: 11 24 eor r1, r1 2461e: 88 53 subi r24, 0x38 ; 56 24620: 99 4f sbci r25, 0xF9 ; 249 24622: fc 01 movw r30, r24 24624: e4 5b subi r30, 0xB4 ; 180 24626: ff 4f sbci r31, 0xFF ; 255 24628: 40 81 ld r20, Z 2462a: 44 23 and r20, r20 2462c: 49 f0 breq .+18 ; 0x24640 <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 2462e: 81 5b subi r24, 0xB1 ; 177 24630: 9f 4f sbci r25, 0xFF ; 255 24632: dc 01 movw r26, r24 24634: 8d 91 ld r24, X+ 24636: 9c 91 ld r25, X 24638: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 2463c: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 } e_steps = 0; 24640: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 nextAdvanceISR = ADV_NEVER; 24644: 8f ef ldi r24, 0xFF ; 255 24646: 9f ef ldi r25, 0xFF ; 255 24648: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2464c: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> LA_phase = -1; 24650: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 24654: 8e e6 ldi r24, 0x6E ; 110 24656: 82 9f mul r24, r18 24658: f0 01 movw r30, r0 2465a: 83 9f mul r24, r19 2465c: f0 0d add r31, r0 2465e: 11 24 eor r1, r1 24660: e8 53 subi r30, 0x38 ; 56 24662: f9 4f sbci r31, 0xF9 ; 249 24664: 85 a9 ldd r24, Z+53 ; 0x35 24666: 84 ff sbrs r24, 4 24668: 08 c0 rjmp .+16 ; 0x2467a <__vector_17+0x202> count_position[E_AXIS] = 0; 2466a: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 2466e: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 24672: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 24676: 10 92 c5 06 sts 0x06C5, r1 ; 0x8006c5 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2467a: 83 ff sbrs r24, 3 2467c: 61 c0 rjmp .+194 ; 0x24740 <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 2467e: 8e e6 ldi r24, 0x6E ; 110 24680: 82 9f mul r24, r18 24682: f0 01 movw r30, r0 24684: 83 9f mul r24, r19 24686: f0 0d add r31, r0 24688: 11 24 eor r1, r1 2468a: e8 53 subi r30, 0x38 ; 56 2468c: f9 4f sbci r31, 0xF9 ; 249 2468e: 80 89 ldd r24, Z+16 ; 0x10 24690: 91 89 ldd r25, Z+17 ; 0x11 24692: 96 95 lsr r25 24694: 87 95 ror r24 24696: 91 95 neg r25 24698: 81 95 neg r24 2469a: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2469c: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 246a0: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 246a4: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 246a8: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 246ac: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 246b0: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 246b4: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 246b8: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 246bc: 81 e0 ldi r24, 0x01 ; 1 246be: 24 85 ldd r18, Z+12 ; 0x0c 246c0: 35 85 ldd r19, Z+13 ; 0x0d 246c2: 23 2b or r18, r19 246c4: 09 f0 breq .+2 ; 0x246c8 <__vector_17+0x250> 246c6: 7d c0 rjmp .+250 ; 0x247c2 <__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; 246c8: 80 e0 ldi r24, 0x00 ; 0 246ca: 7b c0 rjmp .+246 ; 0x247c2 <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 246cc: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 246d0: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 246d4: 0c cf rjmp .-488 ; 0x244ee <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 246d6: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 246da: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 246de: 1d cf rjmp .-454 ; 0x2451a <__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; 246e0: 80 e4 ldi r24, 0x40 ; 64 246e2: 9c e9 ldi r25, 0x9C ; 156 246e4: 60 cf rjmp .-320 ; 0x245a6 <__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 246e6: 81 31 cpi r24, 0x11 ; 17 246e8: e7 e2 ldi r30, 0x27 ; 39 246ea: 9e 07 cpc r25, r30 246ec: 20 f0 brcs .+8 ; 0x246f6 <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 246ee: 96 95 lsr r25 246f0: 87 95 ror r24 step_loops = 2; 246f2: 42 e0 ldi r20, 0x02 ; 2 246f4: 5d cf rjmp .-326 ; 0x245b0 <__vector_17+0x138> } else { step_loops = 1; 246f6: 40 93 dd 05 sts 0x05DD, r20 ; 0x8005dd 246fa: 80 32 cpi r24, 0x20 ; 32 246fc: 91 05 cpc r25, r1 246fe: 08 f0 brcs .+2 ; 0x24702 <__vector_17+0x28a> 24700: 59 cf rjmp .-334 ; 0x245b4 <__vector_17+0x13c> 24702: 80 e2 ldi r24, 0x20 ; 32 24704: 90 e0 ldi r25, 0x00 ; 0 24706: 56 cf rjmp .-340 ; 0x245b4 <__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; 24708: bc 01 movw r22, r24 2470a: 76 95 lsr r23 2470c: 67 95 ror r22 2470e: 6c 7f andi r22, 0xFC ; 252 24710: 67 52 subi r22, 0x27 ; 39 24712: 76 47 sbci r23, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 24714: fb 01 movw r30, r22 24716: 45 91 lpm r20, Z+ 24718: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2471a: fb 01 movw r30, r22 2471c: 32 96 adiw r30, 0x02 ; 2 2471e: a5 91 lpm r26, Z+ 24720: b4 91 lpm r27, Z 24722: 87 70 andi r24, 0x07 ; 7 24724: 99 27 eor r25, r25 24726: 8a 9f mul r24, r26 24728: b0 01 movw r22, r0 2472a: 8b 9f mul r24, r27 2472c: 70 0d add r23, r0 2472e: 9a 9f mul r25, r26 24730: 70 0d add r23, r0 24732: 11 24 eor r1, r1 24734: e3 e0 ldi r30, 0x03 ; 3 24736: 76 95 lsr r23 24738: 67 95 ror r22 2473a: ea 95 dec r30 2473c: e1 f7 brne .-8 ; 0x24736 <__vector_17+0x2be> 2473e: 57 cf rjmp .-338 ; 0x245ee <__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); 24740: 8e e6 ldi r24, 0x6E ; 110 24742: 82 9f mul r24, r18 24744: f0 01 movw r30, r0 24746: 83 9f mul r24, r19 24748: f0 0d add r31, r0 2474a: 11 24 eor r1, r1 2474c: e8 53 subi r30, 0x38 ; 56 2474e: f9 4f sbci r31, 0xF9 ; 249 24750: 80 89 ldd r24, Z+16 ; 0x10 24752: 91 89 ldd r25, Z+17 ; 0x11 24754: a2 89 ldd r26, Z+18 ; 0x12 24756: b3 89 ldd r27, Z+19 ; 0x13 24758: b6 95 lsr r27 2475a: a7 95 ror r26 2475c: 97 95 ror r25 2475e: 87 95 ror r24 24760: b0 95 com r27 24762: a0 95 com r26 24764: 90 95 com r25 24766: 81 95 neg r24 24768: 9f 4f sbci r25, 0xFF ; 255 2476a: af 4f sbci r26, 0xFF ; 255 2476c: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2476e: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24772: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24776: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 2477a: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 2477e: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24782: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24786: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 2478a: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc 2478e: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24792: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24796: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 2479a: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 2479e: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 247a2: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 247a6: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 247aa: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 247ae: 81 e0 ldi r24, 0x01 ; 1 247b0: 44 85 ldd r20, Z+12 ; 0x0c 247b2: 55 85 ldd r21, Z+13 ; 0x0d 247b4: 66 85 ldd r22, Z+14 ; 0x0e 247b6: 77 85 ldd r23, Z+15 ; 0x0f 247b8: 45 2b or r20, r21 247ba: 46 2b or r20, r22 247bc: 47 2b or r20, r23 247be: 09 f4 brne .+2 ; 0x247c2 <__vector_17+0x34a> 247c0: 83 cf rjmp .-250 ; 0x246c8 <__vector_17+0x250> 247c2: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 #endif } step_events_completed.wide = 0; 247c6: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 247ca: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 247ce: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 247d2: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 // Set directions. out_bits = current_block->direction_bits; 247d6: 88 8d ldd r24, Y+24 ; 0x18 247d8: 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); 247e0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247e4: 8d 7f andi r24, 0xFD ; 253 247e6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 247ea: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 247ec: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if((out_bits & (1< 247f4: 81 ff sbrs r24, 1 247f6: cc c1 rjmp .+920 ; 0x24b90 <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 247f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247fc: 8e 7f andi r24, 0xFE ; 254 247fe: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 24802: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 24804: 80 93 5e 02 sts 0x025E, r24 ; 0x80025e } if ((out_bits & (1< 2480c: 82 ff sbrs r24, 2 2480e: c7 c1 rjmp .+910 ; 0x24b9e <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 24810: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24814: 8b 7f andi r24, 0xFB ; 251 24816: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2481a: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2481c: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 24820: 80 91 bf 05 lds r24, 0x05BF ; 0x8005bf 24824: 83 ff sbrs r24, 3 24826: c2 c1 rjmp .+900 ; 0x24bac <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 24828: 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; 2482a: 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) 2482e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24832: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24836: 30 97 sbiw r30, 0x00 ; 0 24838: 09 f4 brne .+2 ; 0x2483c <__vector_17+0x3c4> 2483a: 09 c7 rjmp .+3602 ; 0x2564e <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2483c: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 24840: 50 91 bc 05 lds r21, 0x05BC ; 0x8005bc 24844: 88 23 and r24, r24 24846: 09 f4 brne .+2 ; 0x2484a <__vector_17+0x3d2> 24848: 6c c0 rjmp .+216 ; 0x24922 <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 2484a: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> uint8_t _endstop = endstop; 2484e: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 24852: 90 91 bd 05 lds r25, 0x05BD ; 0x8005bd #ifndef COREXY if ((out_bits & (1< 2485a: 30 ff sbrs r19, 0 2485c: 1d c0 rjmp .+58 ; 0x24898 <__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)); 2485e: 1e 9b sbis 0x03, 6 ; 3 24860: c6 c1 rjmp .+908 ; 0x24bee <__vector_17+0x776> 24862: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 24864: 49 2f mov r20, r25 24866: 41 70 andi r20, 0x01 ; 1 24868: 48 23 and r20, r24 2486a: b1 f0 breq .+44 ; 0x24898 <__vector_17+0x420> 2486c: c0 80 ld r12, Z 2486e: d1 80 ldd r13, Z+1 ; 0x01 24870: e2 80 ldd r14, Z+2 ; 0x02 24872: f3 80 ldd r15, Z+3 ; 0x03 24874: 1c 14 cp r1, r12 24876: 1d 04 cpc r1, r13 24878: 1e 04 cpc r1, r14 2487a: 1f 04 cpc r1, r15 2487c: 6c f4 brge .+26 ; 0x24898 <__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); 2487e: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 24880: c0 88 ldd r12, Z+16 ; 0x10 24882: d1 88 ldd r13, Z+17 ; 0x11 24884: e2 88 ldd r14, Z+18 ; 0x12 24886: f3 88 ldd r15, Z+19 ; 0x13 24888: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 2488c: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 24890: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24894: 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)); 2489c: 1d 9b sbis 0x03, 5 ; 3 2489e: a9 c1 rjmp .+850 ; 0x24bf2 <__vector_17+0x77a> 248a0: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 248a2: 49 2f mov r20, r25 248a4: 42 70 andi r20, 0x02 ; 2 248a6: 48 23 and r20, r24 248a8: b1 f0 breq .+44 ; 0x248d6 <__vector_17+0x45e> 248aa: c4 80 ldd r12, Z+4 ; 0x04 248ac: d5 80 ldd r13, Z+5 ; 0x05 248ae: e6 80 ldd r14, Z+6 ; 0x06 248b0: f7 80 ldd r15, Z+7 ; 0x07 248b2: 1c 14 cp r1, r12 248b4: 1d 04 cpc r1, r13 248b6: 1e 04 cpc r1, r14 248b8: 1f 04 cpc r1, r15 248ba: 6c f4 brge .+26 ; 0x248d6 <__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); 248bc: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 248be: c0 88 ldd r12, Z+16 ; 0x10 248c0: d1 88 ldd r13, Z+17 ; 0x11 248c2: e2 88 ldd r14, Z+18 ; 0x12 248c4: f3 88 ldd r15, Z+19 ; 0x13 248c6: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 248ca: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 248ce: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 248d2: 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) { 248da: 51 11 cpse r21, r1 248dc: 1c c0 rjmp .+56 ; 0x24916 <__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)); 248de: 1c 9b sbis 0x03, 4 ; 3 248e0: 8a c1 rjmp .+788 ; 0x24bf6 <__vector_17+0x77e> 248e2: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 248e4: 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)) { 248e6: 98 23 and r25, r24 248e8: b1 f0 breq .+44 ; 0x24916 <__vector_17+0x49e> 248ea: c0 84 ldd r12, Z+8 ; 0x08 248ec: d1 84 ldd r13, Z+9 ; 0x09 248ee: e2 84 ldd r14, Z+10 ; 0x0a 248f0: f3 84 ldd r15, Z+11 ; 0x0b 248f2: 1c 14 cp r1, r12 248f4: 1d 04 cpc r1, r13 248f6: 1e 04 cpc r1, r14 248f8: 1f 04 cpc r1, r15 248fa: 6c f4 brge .+26 ; 0x24916 <__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); 248fc: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 248fe: c0 88 ldd r12, Z+16 ; 0x10 24900: d1 88 ldd r13, Z+17 ; 0x11 24902: e2 88 ldd r14, Z+18 ; 0x12 24904: f3 88 ldd r15, Z+19 ; 0x13 24906: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 2490a: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 2490e: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24912: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 } #endif } endstop = _endstop; 24916: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 2491a: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 2491e: 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) { 24922: 55 23 and r21, r21 24924: f9 f0 breq .+62 ; 0x24964 <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 24926: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> uint8_t _endstop = endstop; 2492a: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 2492e: 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)); 24932: 1c 9b sbis 0x03, 4 ; 3 24934: 69 c1 rjmp .+722 ; 0x24c08 <__vector_17+0x790> 24936: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 24938: 94 70 andi r25, 0x04 ; 4 2493a: 98 23 and r25, r24 2493c: 69 f0 breq .+26 ; 0x24958 <__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); 2493e: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 24940: 40 89 ldd r20, Z+16 ; 0x10 24942: 51 89 ldd r21, Z+17 ; 0x11 24944: 62 89 ldd r22, Z+18 ; 0x12 24946: 73 89 ldd r23, Z+19 ; 0x13 24948: 40 93 c0 05 sts 0x05C0, r20 ; 0x8005c0 2494c: 50 93 c1 05 sts 0x05C1, r21 ; 0x8005c1 24950: 60 93 c2 05 sts 0x05C2, r22 ; 0x8005c2 24954: 70 93 c3 05 sts 0x05C3, r23 ; 0x8005c3 } endstop = _endstop; 24958: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 2495c: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 24960: 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) 24964: 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) 24966: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 24968: 83 ff sbrs r24, 3 2496a: 50 c1 rjmp .+672 ; 0x24c0c <__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) 2496c: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24970: c8 17 cp r28, r24 24972: 08 f0 brcs .+2 ; 0x24976 <__vector_17+0x4fe> 24974: bd c2 rjmp .+1402 ; 0x24ef0 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24976: 0e 94 87 fb call 0x1f70e ; 0x1f70e // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2497a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2497e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24982: 80 81 ld r24, Z 24984: 91 81 ldd r25, Z+1 ; 0x01 24986: 20 91 c5 05 lds r18, 0x05C5 ; 0x8005c5 2498a: 30 91 c6 05 lds r19, 0x05C6 ; 0x8005c6 2498e: 82 0f add r24, r18 24990: 93 1f adc r25, r19 24992: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24996: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 if (counter[X_AXIS].lo > 0) { 2499a: 18 16 cp r1, r24 2499c: 19 06 cpc r1, r25 2499e: 6c f5 brge .+90 ; 0x249fa <__vector_17+0x582> STEP_NC_HI(X_AXIS); 249a0: 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; 249a2: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 249a6: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 249aa: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 249ae: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 249b2: 20 89 ldd r18, Z+16 ; 0x10 249b4: 31 89 ldd r19, Z+17 ; 0x11 249b6: 82 1b sub r24, r18 249b8: 93 0b sbc r25, r19 249ba: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 249be: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 count_position[X_AXIS]+=count_direction[X_AXIS]; 249c2: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 249c6: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 249ca: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 249ce: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 249d2: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 249d6: 89 2f mov r24, r25 249d8: 99 0f add r25, r25 249da: 99 0b sbc r25, r25 249dc: aa 0b sbc r26, r26 249de: bb 0b sbc r27, r27 249e0: 84 0f add r24, r20 249e2: 95 1f adc r25, r21 249e4: a6 1f adc r26, r22 249e6: b7 1f adc r27, r23 249e8: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 249ec: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 249f0: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 249f4: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 249f8: 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; 249fa: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 249fe: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a02: 84 81 ldd r24, Z+4 ; 0x04 24a04: 95 81 ldd r25, Z+5 ; 0x05 24a06: 20 91 c9 05 lds r18, 0x05C9 ; 0x8005c9 24a0a: 30 91 ca 05 lds r19, 0x05CA ; 0x8005ca 24a0e: 82 0f add r24, r18 24a10: 93 1f adc r25, r19 24a12: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24a16: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 if (counter[Y_AXIS].lo > 0) { 24a1a: 18 16 cp r1, r24 24a1c: 19 06 cpc r1, r25 24a1e: 4c f5 brge .+82 ; 0x24a72 <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 24a20: 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; 24a22: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a26: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a2a: 20 89 ldd r18, Z+16 ; 0x10 24a2c: 31 89 ldd r19, Z+17 ; 0x11 24a2e: 82 1b sub r24, r18 24a30: 93 0b sbc r25, r19 24a32: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24a36: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24a3a: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24a3e: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24a42: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24a46: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24a4a: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24a4e: 89 2f mov r24, r25 24a50: 99 0f add r25, r25 24a52: 99 0b sbc r25, r25 24a54: aa 0b sbc r26, r26 24a56: bb 0b sbc r27, r27 24a58: 84 0f add r24, r20 24a5a: 95 1f adc r25, r21 24a5c: a6 1f adc r26, r22 24a5e: b7 1f adc r27, r23 24a60: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24a64: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24a68: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24a6c: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24a70: 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; 24a72: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a76: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a7a: 80 85 ldd r24, Z+8 ; 0x08 24a7c: 91 85 ldd r25, Z+9 ; 0x09 24a7e: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 24a82: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 24a86: 82 0f add r24, r18 24a88: 93 1f adc r25, r19 24a8a: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24a8e: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd if (counter[Z_AXIS].lo > 0) { 24a92: 18 16 cp r1, r24 24a94: 19 06 cpc r1, r25 24a96: 4c f5 brge .+82 ; 0x24aea <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 24a98: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 24a9a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a9e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24aa2: 20 89 ldd r18, Z+16 ; 0x10 24aa4: 31 89 ldd r19, Z+17 ; 0x11 24aa6: 82 1b sub r24, r18 24aa8: 93 0b sbc r25, r19 24aaa: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24aae: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24ab2: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24ab6: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24aba: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24abe: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24ac2: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24ac6: 89 2f mov r24, r25 24ac8: 99 0f add r25, r25 24aca: 99 0b sbc r25, r25 24acc: aa 0b sbc r26, r26 24ace: bb 0b sbc r27, r27 24ad0: 84 0f add r24, r20 24ad2: 95 1f adc r25, r21 24ad4: a6 1f adc r26, r22 24ad6: b7 1f adc r27, r23 24ad8: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24adc: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24ae0: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24ae4: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24ae8: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 24aea: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24aee: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24af2: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24af6: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24afa: 24 85 ldd r18, Z+12 ; 0x0c 24afc: 35 85 ldd r19, Z+13 ; 0x0d 24afe: 82 0f add r24, r18 24b00: 93 1f adc r25, r19 24b02: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24b06: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24b0a: 20 89 ldd r18, Z+16 ; 0x10 24b0c: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 24b0e: 18 16 cp r1, r24 24b10: 19 06 cpc r1, r25 24b12: 44 f5 brge .+80 ; 0x24b64 <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 24b14: 82 1b sub r24, r18 24b16: 93 0b sbc r25, r19 24b18: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24b1c: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 count_position[E_AXIS] += count_direction[E_AXIS]; 24b20: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24b24: 40 91 c2 06 lds r20, 0x06C2 ; 0x8006c2 24b28: 50 91 c3 06 lds r21, 0x06C3 ; 0x8006c3 24b2c: 60 91 c4 06 lds r22, 0x06C4 ; 0x8006c4 24b30: 70 91 c5 06 lds r23, 0x06C5 ; 0x8006c5 24b34: 89 2f mov r24, r25 24b36: 99 0f add r25, r25 24b38: 99 0b sbc r25, r25 24b3a: aa 0b sbc r26, r26 24b3c: bb 0b sbc r27, r27 24b3e: 84 0f add r24, r20 24b40: 95 1f adc r25, r21 24b42: a6 1f adc r26, r22 24b44: b7 1f adc r27, r23 24b46: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24b4a: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24b4e: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24b52: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24b56: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24b5a: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24b5e: 89 0f add r24, r25 24b60: 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) 24b64: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24b68: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24b6c: 01 96 adiw r24, 0x01 ; 1 24b6e: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24b72: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24b76: 82 17 cp r24, r18 24b78: 93 07 cpc r25, r19 24b7a: 08 f0 brcs .+2 ; 0x24b7e <__vector_17+0x706> 24b7c: b9 c1 rjmp .+882 ; 0x24ef0 <__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) 24b7e: cf 5f subi r28, 0xFF ; 255 24b80: f5 ce rjmp .-534 ; 0x2496c <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 24b86: 82 60 ori r24, 0x02 ; 2 24b88: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 24b8c: 81 e0 ldi r24, 0x01 ; 1 24b8e: 2e ce rjmp .-932 ; 0x247ec <__vector_17+0x374> } if((out_bits & (1< 24b94: 81 60 ori r24, 0x01 ; 1 24b96: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 24b9a: 81 e0 ldi r24, 0x01 ; 1 24b9c: 33 ce rjmp .-922 ; 0x24804 <__vector_17+0x38c> } if ((out_bits & (1< 24ba2: 84 60 ori r24, 0x04 ; 4 24ba4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 24ba8: 81 e0 ldi r24, 0x01 ; 1 24baa: 38 ce rjmp .-912 ; 0x2481c <__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; 24bac: 81 e0 ldi r24, 0x01 ; 1 24bae: 3d ce rjmp .-902 ; 0x2482a <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 24bb0: 80 ed ldi r24, 0xD0 ; 208 24bb2: 97 e0 ldi r25, 0x07 ; 7 24bb4: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 24bb8: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 24bbc: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 24bc0: 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; 24bc4: 8f ef ldi r24, 0xFF ; 255 24bc6: 9f ef ldi r25, 0xFF ; 255 24bc8: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 24bcc: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> e_steps = 0; 24bd0: 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) 24bd4: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 24bd8: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 24bdc: 00 97 sbiw r24, 0x00 ; 0 24bde: 09 f4 brne .+2 ; 0x24be2 <__vector_17+0x76a> 24be0: 26 ce rjmp .-948 ; 0x2482e <__vector_17+0x3b6> --current_adv_steps; 24be2: 01 97 sbiw r24, 0x01 ; 1 24be4: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 24be8: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 24bec: 20 ce rjmp .-960 ; 0x2482e <__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)); 24bee: 8e 7f andi r24, 0xFE ; 254 24bf0: 39 ce rjmp .-910 ; 0x24864 <__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)); 24bf2: 8d 7f andi r24, 0xFD ; 253 24bf4: 56 ce rjmp .-852 ; 0x248a2 <__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)); 24bf6: 8b 7f andi r24, 0xFB ; 251 24bf8: 75 ce rjmp .-790 ; 0x248e4 <__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)); 24bfa: 01 99 sbic 0x00, 1 ; 0 24bfc: 03 c0 rjmp .+6 ; 0x24c04 <__vector_17+0x78c> 24bfe: 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)) { 24c00: 90 74 andi r25, 0x40 ; 64 24c02: 71 ce rjmp .-798 ; 0x248e6 <__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)); 24c04: 8f 7b andi r24, 0xBF ; 191 24c06: fc cf rjmp .-8 ; 0x24c00 <__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)); 24c08: 8b 7f andi r24, 0xFB ; 251 24c0a: 96 ce rjmp .-724 ; 0x24938 <__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) 24c0c: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24c10: c8 17 cp r28, r24 24c12: 08 f0 brcs .+2 ; 0x24c16 <__vector_17+0x79e> 24c14: 6d c1 rjmp .+730 ; 0x24ef0 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24c16: 0e 94 87 fb call 0x1f70e ; 0x1f70e // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 24c1a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c1e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c22: 80 81 ld r24, Z 24c24: 91 81 ldd r25, Z+1 ; 0x01 24c26: a2 81 ldd r26, Z+2 ; 0x02 24c28: b3 81 ldd r27, Z+3 ; 0x03 24c2a: 40 91 c5 05 lds r20, 0x05C5 ; 0x8005c5 24c2e: 50 91 c6 05 lds r21, 0x05C6 ; 0x8005c6 24c32: 60 91 c7 05 lds r22, 0x05C7 ; 0x8005c7 24c36: 70 91 c8 05 lds r23, 0x05C8 ; 0x8005c8 24c3a: 84 0f add r24, r20 24c3c: 95 1f adc r25, r21 24c3e: a6 1f adc r26, r22 24c40: b7 1f adc r27, r23 24c42: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24c46: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24c4a: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24c4e: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 if (counter[X_AXIS].wide > 0) { 24c52: 18 16 cp r1, r24 24c54: 19 06 cpc r1, r25 24c56: 1a 06 cpc r1, r26 24c58: 1b 06 cpc r1, r27 24c5a: cc f5 brge .+114 ; 0x24cce <__vector_17+0x856> STEP_NC_HI(X_AXIS); 24c5c: 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; 24c5e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c62: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c66: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24c6a: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24c6e: a0 91 c7 05 lds r26, 0x05C7 ; 0x8005c7 24c72: b0 91 c8 05 lds r27, 0x05C8 ; 0x8005c8 24c76: 40 89 ldd r20, Z+16 ; 0x10 24c78: 51 89 ldd r21, Z+17 ; 0x11 24c7a: 62 89 ldd r22, Z+18 ; 0x12 24c7c: 73 89 ldd r23, Z+19 ; 0x13 24c7e: 84 1b sub r24, r20 24c80: 95 0b sbc r25, r21 24c82: a6 0b sbc r26, r22 24c84: b7 0b sbc r27, r23 24c86: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24c8a: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24c8e: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24c92: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 count_position[X_AXIS]+=count_direction[X_AXIS]; 24c96: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24c9a: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24c9e: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24ca2: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24ca6: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24caa: 89 2f mov r24, r25 24cac: 99 0f add r25, r25 24cae: 99 0b sbc r25, r25 24cb0: aa 0b sbc r26, r26 24cb2: bb 0b sbc r27, r27 24cb4: 84 0f add r24, r20 24cb6: 95 1f adc r25, r21 24cb8: a6 1f adc r26, r22 24cba: b7 1f adc r27, r23 24cbc: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24cc0: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24cc4: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24cc8: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24ccc: 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; 24cce: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24cd2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24cd6: 84 81 ldd r24, Z+4 ; 0x04 24cd8: 95 81 ldd r25, Z+5 ; 0x05 24cda: a6 81 ldd r26, Z+6 ; 0x06 24cdc: b7 81 ldd r27, Z+7 ; 0x07 24cde: 40 91 c9 05 lds r20, 0x05C9 ; 0x8005c9 24ce2: 50 91 ca 05 lds r21, 0x05CA ; 0x8005ca 24ce6: 60 91 cb 05 lds r22, 0x05CB ; 0x8005cb 24cea: 70 91 cc 05 lds r23, 0x05CC ; 0x8005cc 24cee: 84 0f add r24, r20 24cf0: 95 1f adc r25, r21 24cf2: a6 1f adc r26, r22 24cf4: b7 1f adc r27, r23 24cf6: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24cfa: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24cfe: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24d02: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc if (counter[Y_AXIS].wide > 0) { 24d06: 18 16 cp r1, r24 24d08: 19 06 cpc r1, r25 24d0a: 1a 06 cpc r1, r26 24d0c: 1b 06 cpc r1, r27 24d0e: 8c f5 brge .+98 ; 0x24d72 <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 24d10: 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; 24d12: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d16: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d1a: 40 89 ldd r20, Z+16 ; 0x10 24d1c: 51 89 ldd r21, Z+17 ; 0x11 24d1e: 62 89 ldd r22, Z+18 ; 0x12 24d20: 73 89 ldd r23, Z+19 ; 0x13 24d22: 84 1b sub r24, r20 24d24: 95 0b sbc r25, r21 24d26: a6 0b sbc r26, r22 24d28: b7 0b sbc r27, r23 24d2a: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24d2e: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24d32: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24d36: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24d3a: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24d3e: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24d42: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24d46: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24d4a: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24d4e: 89 2f mov r24, r25 24d50: 99 0f add r25, r25 24d52: 99 0b sbc r25, r25 24d54: aa 0b sbc r26, r26 24d56: bb 0b sbc r27, r27 24d58: 84 0f add r24, r20 24d5a: 95 1f adc r25, r21 24d5c: a6 1f adc r26, r22 24d5e: b7 1f adc r27, r23 24d60: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24d64: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24d68: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24d6c: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24d70: 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; 24d72: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d76: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d7a: 80 85 ldd r24, Z+8 ; 0x08 24d7c: 91 85 ldd r25, Z+9 ; 0x09 24d7e: a2 85 ldd r26, Z+10 ; 0x0a 24d80: b3 85 ldd r27, Z+11 ; 0x0b 24d82: 40 91 cd 05 lds r20, 0x05CD ; 0x8005cd 24d86: 50 91 ce 05 lds r21, 0x05CE ; 0x8005ce 24d8a: 60 91 cf 05 lds r22, 0x05CF ; 0x8005cf 24d8e: 70 91 d0 05 lds r23, 0x05D0 ; 0x8005d0 24d92: 84 0f add r24, r20 24d94: 95 1f adc r25, r21 24d96: a6 1f adc r26, r22 24d98: b7 1f adc r27, r23 24d9a: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24d9e: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24da2: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24da6: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 if (counter[Z_AXIS].wide > 0) { 24daa: 18 16 cp r1, r24 24dac: 19 06 cpc r1, r25 24dae: 1a 06 cpc r1, r26 24db0: 1b 06 cpc r1, r27 24db2: 8c f5 brge .+98 ; 0x24e16 <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 24db4: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 24db6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24dba: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24dbe: 40 89 ldd r20, Z+16 ; 0x10 24dc0: 51 89 ldd r21, Z+17 ; 0x11 24dc2: 62 89 ldd r22, Z+18 ; 0x12 24dc4: 73 89 ldd r23, Z+19 ; 0x13 24dc6: 84 1b sub r24, r20 24dc8: 95 0b sbc r25, r21 24dca: a6 0b sbc r26, r22 24dcc: b7 0b sbc r27, r23 24dce: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24dd2: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24dd6: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24dda: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24dde: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24de2: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24de6: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24dea: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24dee: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24df2: 89 2f mov r24, r25 24df4: 99 0f add r25, r25 24df6: 99 0b sbc r25, r25 24df8: aa 0b sbc r26, r26 24dfa: bb 0b sbc r27, r27 24dfc: 84 0f add r24, r20 24dfe: 95 1f adc r25, r21 24e00: a6 1f adc r26, r22 24e02: b7 1f adc r27, r23 24e04: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24e08: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24e0c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24e10: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24e14: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 24e16: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e1a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e1e: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24e22: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24e26: a0 91 d3 05 lds r26, 0x05D3 ; 0x8005d3 24e2a: b0 91 d4 05 lds r27, 0x05D4 ; 0x8005d4 24e2e: 44 85 ldd r20, Z+12 ; 0x0c 24e30: 55 85 ldd r21, Z+13 ; 0x0d 24e32: 66 85 ldd r22, Z+14 ; 0x0e 24e34: 77 85 ldd r23, Z+15 ; 0x0f 24e36: 84 0f add r24, r20 24e38: 95 1f adc r25, r21 24e3a: a6 1f adc r26, r22 24e3c: b7 1f adc r27, r23 24e3e: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24e42: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24e46: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24e4a: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 24e4e: 40 89 ldd r20, Z+16 ; 0x10 24e50: 51 89 ldd r21, Z+17 ; 0x11 24e52: 62 89 ldd r22, Z+18 ; 0x12 24e54: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 24e56: 18 16 cp r1, r24 24e58: 19 06 cpc r1, r25 24e5a: 1a 06 cpc r1, r26 24e5c: 1b 06 cpc r1, r27 24e5e: 74 f5 brge .+92 ; 0x24ebc <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 24e60: 84 1b sub r24, r20 24e62: 95 0b sbc r25, r21 24e64: a6 0b sbc r26, r22 24e66: b7 0b sbc r27, r23 24e68: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24e6c: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24e70: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24e74: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 count_position[E_AXIS] += count_direction[E_AXIS]; 24e78: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24e7c: c0 90 c2 06 lds r12, 0x06C2 ; 0x8006c2 24e80: d0 90 c3 06 lds r13, 0x06C3 ; 0x8006c3 24e84: e0 90 c4 06 lds r14, 0x06C4 ; 0x8006c4 24e88: f0 90 c5 06 lds r15, 0x06C5 ; 0x8006c5 24e8c: 89 2f mov r24, r25 24e8e: 99 0f add r25, r25 24e90: 99 0b sbc r25, r25 24e92: aa 0b sbc r26, r26 24e94: bb 0b sbc r27, r27 24e96: 8c 0d add r24, r12 24e98: 9d 1d adc r25, r13 24e9a: ae 1d adc r26, r14 24e9c: bf 1d adc r27, r15 24e9e: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24ea2: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24ea6: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24eaa: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24eae: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24eb2: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24eb6: 89 0f add r24, r25 24eb8: 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) 24ebc: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24ec0: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24ec4: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 24ec8: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 24ecc: 01 96 adiw r24, 0x01 ; 1 24ece: a1 1d adc r26, r1 24ed0: b1 1d adc r27, r1 24ed2: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24ed6: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24eda: a0 93 c2 05 sts 0x05C2, r26 ; 0x8005c2 24ede: b0 93 c3 05 sts 0x05C3, r27 ; 0x8005c3 24ee2: 84 17 cp r24, r20 24ee4: 95 07 cpc r25, r21 24ee6: a6 07 cpc r26, r22 24ee8: b7 07 cpc r27, r23 24eea: 10 f4 brcc .+4 ; 0x24ef0 <__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) 24eec: cf 5f subi r28, 0xFF ; 255 24eee: 8e ce rjmp .-740 ; 0x24c0c <__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); 24ef0: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24ef4: 88 23 and r24, r24 24ef6: 39 f0 breq .+14 ; 0x24f06 <__vector_17+0xa8e> 24ef8: 87 ff sbrs r24, 7 24efa: f2 c0 rjmp .+484 ; 0x250e0 <__vector_17+0xc68> 24efc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24f00: 80 64 ori r24, 0x40 ; 64 24f02: 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) { 24f06: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 24f0a: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 24f0e: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 24f12: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 24f16: c0 91 e4 11 lds r28, 0x11E4 ; 0x8011e4 24f1a: d0 91 e5 11 lds r29, 0x11E5 ; 0x8011e5 24f1e: 89 8d ldd r24, Y+25 ; 0x19 24f20: 9a 8d ldd r25, Y+26 ; 0x1a 24f22: ab 8d ldd r26, Y+27 ; 0x1b 24f24: bc 8d ldd r27, Y+28 ; 0x1c 24f26: 84 17 cp r24, r20 24f28: 95 07 cpc r25, r21 24f2a: a6 07 cpc r26, r22 24f2c: b7 07 cpc r27, r23 24f2e: 08 f4 brcc .+2 ; 0x24f32 <__vector_17+0xaba> 24f30: 37 c1 rjmp .+622 ; 0x251a0 <__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); 24f32: c0 90 d9 05 lds r12, 0x05D9 ; 0x8005d9 24f36: d0 90 da 05 lds r13, 0x05DA ; 0x8005da 24f3a: e0 90 db 05 lds r14, 0x05DB ; 0x8005db 24f3e: 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. ); 24f42: 2c 89 ldd r18, Y+20 ; 0x14 24f44: 3d 89 ldd r19, Y+21 ; 0x15 24f46: 4e 89 ldd r20, Y+22 ; 0x16 24f48: aa 27 eor r26, r26 24f4a: c3 9e mul r12, r19 24f4c: b1 2d mov r27, r1 24f4e: d4 9e mul r13, r20 24f50: c0 01 movw r24, r0 24f52: e4 9e mul r14, r20 24f54: 90 0d add r25, r0 24f56: e3 9e mul r14, r19 24f58: 80 0d add r24, r0 24f5a: 91 1d adc r25, r1 24f5c: c4 9e mul r12, r20 24f5e: b0 0d add r27, r0 24f60: 81 1d adc r24, r1 24f62: 9a 1f adc r25, r26 24f64: d3 9e mul r13, r19 24f66: b0 0d add r27, r0 24f68: 81 1d adc r24, r1 24f6a: 9a 1f adc r25, r26 24f6c: e2 9e mul r14, r18 24f6e: b0 0d add r27, r0 24f70: 81 1d adc r24, r1 24f72: 9a 1f adc r25, r26 24f74: d2 9e mul r13, r18 24f76: b1 0d add r27, r1 24f78: 8a 1f adc r24, r26 24f7a: 9a 1f adc r25, r26 24f7c: bb 0f add r27, r27 24f7e: 8a 1f adc r24, r26 24f80: 9a 1f adc r25, r26 24f82: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 24f84: 2a ad ldd r18, Y+58 ; 0x3a 24f86: 3b ad ldd r19, Y+59 ; 0x3b 24f88: 82 0f add r24, r18 24f8a: 93 1f adc r25, r19 24f8c: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 24f90: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 24f94: 2e a9 ldd r18, Y+54 ; 0x36 24f96: 3f a9 ldd r19, Y+55 ; 0x37 24f98: 28 17 cp r18, r24 24f9a: 39 07 cpc r19, r25 24f9c: 20 f4 brcc .+8 ; 0x24fa6 <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 24f9e: 30 93 df 05 sts 0x05DF, r19 ; 0x8005df 24fa2: 20 93 de 05 sts 0x05DE, r18 ; 0x8005de // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 24fa6: 80 91 de 05 lds r24, 0x05DE ; 0x8005de 24faa: 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; 24fae: 81 34 cpi r24, 0x41 ; 65 24fb0: bc e9 ldi r27, 0x9C ; 156 24fb2: 9b 07 cpc r25, r27 24fb4: 08 f0 brcs .+2 ; 0x24fb8 <__vector_17+0xb40> 24fb6: 98 c0 rjmp .+304 ; 0x250e8 <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 24fb8: 81 32 cpi r24, 0x21 ; 33 24fba: ee e4 ldi r30, 0x4E ; 78 24fbc: 9e 07 cpc r25, r30 24fbe: 08 f4 brcc .+2 ; 0x24fc2 <__vector_17+0xb4a> 24fc0: 96 c0 rjmp .+300 ; 0x250ee <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 24fc2: 96 95 lsr r25 24fc4: 87 95 ror r24 24fc6: 96 95 lsr r25 24fc8: 87 95 ror r24 step_loops = 4; 24fca: 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; 24fcc: 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 24fd0: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 24fd2: 81 15 cp r24, r1 24fd4: 28 e0 ldi r18, 0x08 ; 8 24fd6: 92 07 cpc r25, r18 24fd8: 08 f4 brcc .+2 ; 0x24fdc <__vector_17+0xb64> 24fda: 9b c0 rjmp .+310 ; 0x25112 <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 24fdc: e9 2f mov r30, r25 24fde: ff 27 eor r31, r31 24fe0: ee 0f add r30, r30 24fe2: ff 1f adc r31, r31 24fe4: ee 0f add r30, r30 24fe6: ff 1f adc r31, r31 24fe8: 9f 01 movw r18, r30 24fea: 27 52 subi r18, 0x27 ; 39 24fec: 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); 24fee: f9 01 movw r30, r18 24ff0: 32 96 adiw r30, 0x02 ; 2 24ff2: 45 91 lpm r20, Z+ 24ff4: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 24ff6: f9 01 movw r30, r18 24ff8: 25 91 lpm r18, Z+ 24ffa: 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. ); 24ffc: 58 9f mul r21, r24 24ffe: b0 01 movw r22, r0 25000: 48 9f mul r20, r24 25002: 00 0c add r0, r0 25004: 61 1d adc r22, r1 25006: 11 24 eor r1, r1 25008: 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); 2500a: 26 1b sub r18, r22 2500c: 37 0b sbc r19, r23 2500e: c9 01 movw r24, r18 25010: 24 36 cpi r18, 0x64 ; 100 25012: 31 05 cpc r19, r1 25014: 10 f4 brcc .+4 ; 0x2501a <__vector_17+0xba2> 25016: 84 e6 ldi r24, 0x64 ; 100 25018: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2501a: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 2501e: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 25022: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 25026: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> acceleration_time += timer; 2502a: c8 0e add r12, r24 2502c: d9 1e adc r13, r25 2502e: e1 1c adc r14, r1 25030: f1 1c adc r15, r1 25032: c0 92 d9 05 sts 0x05D9, r12 ; 0x8005d9 25036: d0 92 da 05 sts 0x05DA, r13 ; 0x8005da 2503a: e0 92 db 05 sts 0x05DB, r14 ; 0x8005db 2503e: f0 92 dc 05 sts 0x05DC, r15 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 25042: fe 01 movw r30, r28 25044: e4 5b subi r30, 0xB4 ; 180 25046: ff 4f sbci r31, 0xFF ; 255 25048: 80 81 ld r24, Z 2504a: 81 11 cpse r24, r1 2504c: 80 c0 rjmp .+256 ; 0x2514e <__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; 2504e: 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) { 25050: 80 ff sbrs r24, 0 25052: 16 c0 rjmp .+44 ; 0x25080 <__vector_17+0xc08> LA_phase = -1; 25054: 9f ef ldi r25, 0xFF ; 255 25056: 90 93 d5 05 sts 0x05D5, r25 ; 0x8005d5 if (current_adv_steps == target_adv_steps) { 2505a: e0 91 16 04 lds r30, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 2505e: f0 91 17 04 lds r31, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 25062: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 25066: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 2506a: e2 17 cp r30, r18 2506c: f3 07 cpc r31, r19 2506e: 09 f0 breq .+2 ; 0x25072 <__vector_17+0xbfa> 25070: 27 c2 rjmp .+1102 ; 0x254c0 <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 25072: 8f ef ldi r24, 0xFF ; 255 25074: 9f ef ldi r25, 0xFF ; 255 25076: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2507a: 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; 2507e: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 25080: 80 fd sbrc r24, 0 25082: 07 c0 rjmp .+14 ; 0x25092 <__vector_17+0xc1a> 25084: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 25088: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2508c: 01 96 adiw r24, 0x01 ; 1 2508e: 09 f4 brne .+2 ; 0x25092 <__vector_17+0xc1a> 25090: b7 c2 rjmp .+1390 ; 0x25600 <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 25092: e0 91 18 04 lds r30, 0x0418 ; 0x800418 <_ZL9main_Rate.lto_priv.435> 25096: 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; 2509a: 80 91 b6 05 lds r24, 0x05B6 ; 0x8005b6 2509e: 90 91 b7 05 lds r25, 0x05B7 ; 0x8005b7 250a2: a0 91 b8 05 lds r26, 0x05B8 ; 0x8005b8 250a6: b0 91 b9 05 lds r27, 0x05B9 ; 0x8005b9 250aa: 2c 01 movw r4, r24 250ac: 3d 01 movw r6, r26 250ae: 4e 0e add r4, r30 250b0: 5f 1e adc r5, r31 250b2: 61 1c adc r6, r1 250b4: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 250b6: 9e 01 movw r18, r28 250b8: 23 5b subi r18, 0xB3 ; 179 250ba: 3f 4f sbci r19, 0xFF ; 255 250bc: d9 01 movw r26, r18 250be: cd 90 ld r12, X+ 250c0: dc 90 ld r13, X 250c2: f1 2c mov r15, r1 250c4: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 250c6: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 250c8: 4c 14 cp r4, r12 250ca: 5d 04 cpc r5, r13 250cc: 6e 04 cpc r6, r14 250ce: 7f 04 cpc r7, r15 250d0: 08 f4 brcc .+2 ; 0x250d4 <__vector_17+0xc5c> 250d2: 26 c2 rjmp .+1100 ; 0x25520 <__vector_17+0x10a8> { ++ticks; 250d4: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 250d6: 4c 18 sub r4, r12 250d8: 5d 08 sbc r5, r13 250da: 6e 08 sbc r6, r14 250dc: 7f 08 sbc r7, r15 250de: f4 cf rjmp .-24 ; 0x250c8 <__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); 250e0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 250e4: 8f 7b andi r24, 0xBF ; 191 250e6: 0d cf rjmp .-486 ; 0x24f02 <__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; 250e8: 80 e4 ldi r24, 0x40 ; 64 250ea: 9c e9 ldi r25, 0x9C ; 156 250ec: 6a cf rjmp .-300 ; 0x24fc2 <__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 250ee: 81 31 cpi r24, 0x11 ; 17 250f0: f7 e2 ldi r31, 0x27 ; 39 250f2: 9f 07 cpc r25, r31 250f4: 20 f0 brcs .+8 ; 0x250fe <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 250f6: 96 95 lsr r25 250f8: 87 95 ror r24 step_loops = 2; 250fa: 22 e0 ldi r18, 0x02 ; 2 250fc: 67 cf rjmp .-306 ; 0x24fcc <__vector_17+0xb54> } else { step_loops = 1; 250fe: 21 e0 ldi r18, 0x01 ; 1 25100: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 25104: 80 32 cpi r24, 0x20 ; 32 25106: 91 05 cpc r25, r1 25108: 08 f0 brcs .+2 ; 0x2510c <__vector_17+0xc94> 2510a: 62 cf rjmp .-316 ; 0x24fd0 <__vector_17+0xb58> 2510c: 80 e2 ldi r24, 0x20 ; 32 2510e: 90 e0 ldi r25, 0x00 ; 0 25110: 5f cf rjmp .-322 ; 0x24fd0 <__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; 25112: ac 01 movw r20, r24 25114: 56 95 lsr r21 25116: 47 95 ror r20 25118: 4c 7f andi r20, 0xFC ; 252 2511a: 47 52 subi r20, 0x27 ; 39 2511c: 56 47 sbci r21, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 2511e: fa 01 movw r30, r20 25120: 25 91 lpm r18, Z+ 25122: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25124: fa 01 movw r30, r20 25126: 32 96 adiw r30, 0x02 ; 2 25128: 65 91 lpm r22, Z+ 2512a: 74 91 lpm r23, Z 2512c: 87 70 andi r24, 0x07 ; 7 2512e: 99 27 eor r25, r25 25130: 86 9f mul r24, r22 25132: a0 01 movw r20, r0 25134: 87 9f mul r24, r23 25136: 50 0d add r21, r0 25138: 96 9f mul r25, r22 2513a: 50 0d add r21, r0 2513c: 11 24 eor r1, r1 2513e: 73 e0 ldi r23, 0x03 ; 3 25140: 56 95 lsr r21 25142: 47 95 ror r20 25144: 7a 95 dec r23 25146: e1 f7 brne .-8 ; 0x25140 <__vector_17+0xcc8> 25148: 24 1b sub r18, r20 2514a: 35 0b sbc r19, r21 2514c: 60 cf rjmp .-320 ; 0x2500e <__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) { 2514e: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 25152: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25156: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 2515a: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 2515e: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 25162: 90 e0 ldi r25, 0x00 ; 0 25164: b0 e0 ldi r27, 0x00 ; 0 25166: a0 e0 ldi r26, 0x00 ; 0 25168: 84 17 cp r24, r20 2516a: 95 07 cpc r25, r21 2516c: a6 07 cpc r26, r22 2516e: b7 07 cpc r27, r23 25170: 08 f4 brcc .+2 ; 0x25174 <__vector_17+0xcfc> 25172: 6d cf rjmp .-294 ; 0x2504e <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 25174: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25178: 81 11 cpse r24, r1 2517a: 02 c0 rjmp .+4 ; 0x25180 <__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; 2517c: 83 e0 ldi r24, 0x03 ; 3 2517e: 68 cf rjmp .-304 ; 0x25050 <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 25180: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25184: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 25188: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 2518c: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 25190: 28 17 cp r18, r24 25192: 39 07 cpc r19, r25 25194: 98 f7 brcc .-26 ; 0x2517c <__vector_17+0xd04> target_adv_steps = current_adv_steps; 25196: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 2519a: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 2519e: ee cf rjmp .-36 ; 0x2517c <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 251a0: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 251a4: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 251a8: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 251ac: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 251b0: 4d 8d ldd r20, Y+29 ; 0x1d 251b2: 5e 8d ldd r21, Y+30 ; 0x1e 251b4: 6f 8d ldd r22, Y+31 ; 0x1f 251b6: 78 a1 ldd r23, Y+32 ; 0x20 251b8: 48 17 cp r20, r24 251ba: 59 07 cpc r21, r25 251bc: 6a 07 cpc r22, r26 251be: 7b 07 cpc r23, r27 251c0: 08 f0 brcs .+2 ; 0x251c4 <__vector_17+0xd4c> 251c2: e3 c0 rjmp .+454 ; 0x2538a <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 251c4: c0 90 e1 05 lds r12, 0x05E1 ; 0x8005e1 251c8: d0 90 e2 05 lds r13, 0x05E2 ; 0x8005e2 251cc: e0 90 e3 05 lds r14, 0x05E3 ; 0x8005e3 251d0: 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. ); 251d4: 6c 88 ldd r6, Y+20 ; 0x14 251d6: 7d 88 ldd r7, Y+21 ; 0x15 251d8: 8e 88 ldd r8, Y+22 ; 0x16 251da: aa 27 eor r26, r26 251dc: c7 9c mul r12, r7 251de: b1 2d mov r27, r1 251e0: d8 9c mul r13, r8 251e2: f0 01 movw r30, r0 251e4: e8 9c mul r14, r8 251e6: f0 0d add r31, r0 251e8: e7 9c mul r14, r7 251ea: e0 0d add r30, r0 251ec: f1 1d adc r31, r1 251ee: c8 9c mul r12, r8 251f0: b0 0d add r27, r0 251f2: e1 1d adc r30, r1 251f4: fa 1f adc r31, r26 251f6: d7 9c mul r13, r7 251f8: b0 0d add r27, r0 251fa: e1 1d adc r30, r1 251fc: fa 1f adc r31, r26 251fe: e6 9c mul r14, r6 25200: b0 0d add r27, r0 25202: e1 1d adc r30, r1 25204: fa 1f adc r31, r26 25206: d6 9c mul r13, r6 25208: b1 0d add r27, r1 2520a: ea 1f adc r30, r26 2520c: fa 1f adc r31, r26 2520e: bb 0f add r27, r27 25210: ea 1f adc r30, r26 25212: fa 1f adc r31, r26 25214: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 25216: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 2521a: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 2521e: 8e ad ldd r24, Y+62 ; 0x3e 25220: 9f ad ldd r25, Y+63 ; 0x3f 25222: 2e 17 cp r18, r30 25224: 3f 07 cpc r19, r31 25226: 30 f0 brcs .+12 ; 0x25234 <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 25228: 2e 1b sub r18, r30 2522a: 3f 0b sbc r19, r31 2522c: 82 17 cp r24, r18 2522e: 93 07 cpc r25, r19 25230: 08 f4 brcc .+2 ; 0x25234 <__vector_17+0xdbc> 25232: 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; 25234: 81 34 cpi r24, 0x41 ; 65 25236: ac e9 ldi r26, 0x9C ; 156 25238: 9a 07 cpc r25, r26 2523a: 08 f0 brcs .+2 ; 0x2523e <__vector_17+0xdc6> 2523c: 75 c0 rjmp .+234 ; 0x25328 <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2523e: 81 32 cpi r24, 0x21 ; 33 25240: be e4 ldi r27, 0x4E ; 78 25242: 9b 07 cpc r25, r27 25244: 08 f4 brcc .+2 ; 0x25248 <__vector_17+0xdd0> 25246: 73 c0 rjmp .+230 ; 0x2532e <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 25248: 96 95 lsr r25 2524a: 87 95 ror r24 2524c: 96 95 lsr r25 2524e: 87 95 ror r24 step_loops = 4; 25250: 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; 25252: 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 25256: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 25258: 81 15 cp r24, r1 2525a: f8 e0 ldi r31, 0x08 ; 8 2525c: 9f 07 cpc r25, r31 2525e: 08 f4 brcc .+2 ; 0x25262 <__vector_17+0xdea> 25260: 78 c0 rjmp .+240 ; 0x25352 <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 25262: e9 2f mov r30, r25 25264: ff 27 eor r31, r31 25266: ee 0f add r30, r30 25268: ff 1f adc r31, r31 2526a: ee 0f add r30, r30 2526c: ff 1f adc r31, r31 2526e: 9f 01 movw r18, r30 25270: 27 52 subi r18, 0x27 ; 39 25272: 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); 25274: f9 01 movw r30, r18 25276: 32 96 adiw r30, 0x02 ; 2 25278: a5 91 lpm r26, Z+ 2527a: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2527c: f9 01 movw r30, r18 2527e: 25 91 lpm r18, Z+ 25280: 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. ); 25282: b8 9f mul r27, r24 25284: f0 01 movw r30, r0 25286: a8 9f mul r26, r24 25288: 00 0c add r0, r0 2528a: e1 1d adc r30, r1 2528c: 11 24 eor r1, r1 2528e: 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); 25290: 2e 1b sub r18, r30 25292: 3f 0b sbc r19, r31 25294: c9 01 movw r24, r18 25296: 24 36 cpi r18, 0x64 ; 100 25298: 31 05 cpc r19, r1 2529a: 10 f4 brcc .+4 ; 0x252a0 <__vector_17+0xe28> 2529c: 84 e6 ldi r24, 0x64 ; 100 2529e: 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); 252a0: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 252a4: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 252a8: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 252ac: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.435> deceleration_time += timer; 252b0: c8 0e add r12, r24 252b2: d9 1e adc r13, r25 252b4: e1 1c adc r14, r1 252b6: f1 1c adc r15, r1 252b8: c0 92 e1 05 sts 0x05E1, r12 ; 0x8005e1 252bc: d0 92 e2 05 sts 0x05E2, r13 ; 0x8005e2 252c0: e0 92 e3 05 sts 0x05E3, r14 ; 0x8005e3 252c4: f0 92 e4 05 sts 0x05E4, r15 ; 0x8005e4 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 252c8: fe 01 movw r30, r28 252ca: e4 5b subi r30, 0xB4 ; 180 252cc: ff 4f sbci r31, 0xFF ; 255 252ce: 80 81 ld r24, Z 252d0: 88 23 and r24, r24 252d2: 09 f4 brne .+2 ; 0x252d6 <__vector_17+0xe5e> 252d4: bc ce rjmp .-648 ; 0x2504e <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 252d6: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 252da: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 252de: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 252e2: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 252e6: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd 252ea: 42 0f add r20, r18 252ec: 51 1d adc r21, r1 252ee: 61 1d adc r22, r1 252f0: 71 1d adc r23, r1 252f2: 48 17 cp r20, r24 252f4: 59 07 cpc r21, r25 252f6: 6a 07 cpc r22, r26 252f8: 7b 07 cpc r23, r27 252fa: 08 f4 brcc .+2 ; 0x252fe <__vector_17+0xe86> 252fc: a8 ce rjmp .-688 ; 0x2504e <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 252fe: 35 96 adiw r30, 0x05 ; 5 25300: 20 81 ld r18, Z 25302: 31 81 ldd r19, Z+1 ; 0x01 25304: 30 93 d8 05 sts 0x05D8, r19 ; 0x8005d8 25308: 20 93 d7 05 sts 0x05D7, r18 ; 0x8005d7 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2530c: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25310: 88 23 and r24, r24 25312: 09 f4 brne .+2 ; 0x25316 <__vector_17+0xe9e> 25314: 33 cf rjmp .-410 ; 0x2517c <__vector_17+0xd04> 25316: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 2531a: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 2531e: 82 17 cp r24, r18 25320: 93 07 cpc r25, r19 25322: 08 f0 brcs .+2 ; 0x25326 <__vector_17+0xeae> 25324: 2b cf rjmp .-426 ; 0x2517c <__vector_17+0xd04> 25326: 37 cf rjmp .-402 ; 0x25196 <__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; 25328: 80 e4 ldi r24, 0x40 ; 64 2532a: 9c e9 ldi r25, 0x9C ; 156 2532c: 8d cf rjmp .-230 ; 0x25248 <__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 2532e: 81 31 cpi r24, 0x11 ; 17 25330: e7 e2 ldi r30, 0x27 ; 39 25332: 9e 07 cpc r25, r30 25334: 20 f0 brcs .+8 ; 0x2533e <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 25336: 96 95 lsr r25 25338: 87 95 ror r24 step_loops = 2; 2533a: 22 e0 ldi r18, 0x02 ; 2 2533c: 8a cf rjmp .-236 ; 0x25252 <__vector_17+0xdda> } else { step_loops = 1; 2533e: 21 e0 ldi r18, 0x01 ; 1 25340: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 25344: 80 32 cpi r24, 0x20 ; 32 25346: 91 05 cpc r25, r1 25348: 08 f0 brcs .+2 ; 0x2534c <__vector_17+0xed4> 2534a: 85 cf rjmp .-246 ; 0x25256 <__vector_17+0xdde> 2534c: 80 e2 ldi r24, 0x20 ; 32 2534e: 90 e0 ldi r25, 0x00 ; 0 25350: 82 cf rjmp .-252 ; 0x25256 <__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; 25352: dc 01 movw r26, r24 25354: b6 95 lsr r27 25356: a7 95 ror r26 25358: ac 7f andi r26, 0xFC ; 252 2535a: a7 52 subi r26, 0x27 ; 39 2535c: b6 47 sbci r27, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 2535e: fd 01 movw r30, r26 25360: 25 91 lpm r18, Z+ 25362: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25364: fd 01 movw r30, r26 25366: 32 96 adiw r30, 0x02 ; 2 25368: a5 91 lpm r26, Z+ 2536a: b4 91 lpm r27, Z 2536c: 87 70 andi r24, 0x07 ; 7 2536e: 99 27 eor r25, r25 25370: 8a 9f mul r24, r26 25372: f0 01 movw r30, r0 25374: 8b 9f mul r24, r27 25376: f0 0d add r31, r0 25378: 9a 9f mul r25, r26 2537a: f0 0d add r31, r0 2537c: 11 24 eor r1, r1 2537e: a3 e0 ldi r26, 0x03 ; 3 25380: f6 95 lsr r31 25382: e7 95 ror r30 25384: aa 95 dec r26 25386: e1 f7 brne .-8 ; 0x25380 <__vector_17+0xf08> 25388: 83 cf rjmp .-250 ; 0x25290 <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 2538a: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 2538e: 88 23 and r24, r24 25390: 71 f0 breq .+28 ; 0x253ae <__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; 25392: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 25394: 20 91 ba 05 lds r18, 0x05BA ; 0x8005ba 25398: 30 91 bb 05 lds r19, 0x05BB ; 0x8005bb 2539c: 30 93 1d 04 sts 0x041D, r19 ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 253a0: 20 93 1c 04 sts 0x041C, r18 ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 253a4: 30 93 19 04 sts 0x0419, r19 ; 0x800419 <_ZL9main_Rate.lto_priv.435+0x1> 253a8: 20 93 18 04 sts 0x0418, r18 ; 0x800418 <_ZL9main_Rate.lto_priv.435> 253ac: 51 ce rjmp .-862 ; 0x25050 <__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); 253ae: 8e a9 ldd r24, Y+54 ; 0x36 253b0: 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; 253b2: 81 34 cpi r24, 0x41 ; 65 253b4: 2c e9 ldi r18, 0x9C ; 156 253b6: 92 07 cpc r25, r18 253b8: 08 f0 brcs .+2 ; 0x253bc <__vector_17+0xf44> 253ba: 4e c0 rjmp .+156 ; 0x25458 <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 253bc: 81 32 cpi r24, 0x21 ; 33 253be: 4e e4 ldi r20, 0x4E ; 78 253c0: 94 07 cpc r25, r20 253c2: 08 f4 brcc .+2 ; 0x253c6 <__vector_17+0xf4e> 253c4: 4c c0 rjmp .+152 ; 0x2545e <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 253c6: 96 95 lsr r25 253c8: 87 95 ror r24 253ca: 96 95 lsr r25 253cc: 87 95 ror r24 step_loops = 4; 253ce: 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; 253d0: 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 253d4: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 253d6: 81 15 cp r24, r1 253d8: a8 e0 ldi r26, 0x08 ; 8 253da: 9a 07 cpc r25, r26 253dc: 08 f4 brcc .+2 ; 0x253e0 <__vector_17+0xf68> 253de: 51 c0 rjmp .+162 ; 0x25482 <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 253e0: e9 2f mov r30, r25 253e2: ff 27 eor r31, r31 253e4: ee 0f add r30, r30 253e6: ff 1f adc r31, r31 253e8: ee 0f add r30, r30 253ea: ff 1f adc r31, r31 253ec: 9f 01 movw r18, r30 253ee: 27 52 subi r18, 0x27 ; 39 253f0: 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); 253f2: f9 01 movw r30, r18 253f4: 32 96 adiw r30, 0x02 ; 2 253f6: 65 91 lpm r22, Z+ 253f8: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 253fa: f9 01 movw r30, r18 253fc: 25 91 lpm r18, Z+ 253fe: 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. ); 25400: 78 9f mul r23, r24 25402: a0 01 movw r20, r0 25404: 68 9f mul r22, r24 25406: 00 0c add r0, r0 25408: 41 1d adc r20, r1 2540a: 11 24 eor r1, r1 2540c: 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); 2540e: c9 01 movw r24, r18 25410: 84 1b sub r24, r20 25412: 95 0b sbc r25, r21 25414: 84 36 cpi r24, 0x64 ; 100 25416: 91 05 cpc r25, r1 25418: 10 f4 brcc .+4 ; 0x2541e <__vector_17+0xfa6> 2541a: 84 e6 ldi r24, 0x64 ; 100 2541c: 90 e0 ldi r25, 0x00 ; 0 2541e: 90 93 bb 05 sts 0x05BB, r25 ; 0x8005bb 25422: 80 93 ba 05 sts 0x05BA, r24 ; 0x8005ba step_loops_nominal = step_loops; 25426: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 2542a: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2542e: fe 01 movw r30, r28 25430: e4 5b subi r30, 0xB4 ; 180 25432: ff 4f sbci r31, 0xFF ; 255 25434: 80 81 ld r24, Z 25436: 88 23 and r24, r24 25438: 09 f4 brne .+2 ; 0x2543c <__vector_17+0xfc4> 2543a: ab cf rjmp .-170 ; 0x25392 <__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) 2543c: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25440: 88 23 and r24, r24 25442: 41 f0 breq .+16 ; 0x25454 <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 25444: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25448: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 2544c: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 25450: 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; 25454: 81 e0 ldi r24, 0x01 ; 1 25456: 9e cf rjmp .-196 ; 0x25394 <__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; 25458: 80 e4 ldi r24, 0x40 ; 64 2545a: 9c e9 ldi r25, 0x9C ; 156 2545c: b4 cf rjmp .-152 ; 0x253c6 <__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 2545e: 81 31 cpi r24, 0x11 ; 17 25460: 57 e2 ldi r21, 0x27 ; 39 25462: 95 07 cpc r25, r21 25464: 20 f0 brcs .+8 ; 0x2546e <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 25466: 96 95 lsr r25 25468: 87 95 ror r24 step_loops = 2; 2546a: 22 e0 ldi r18, 0x02 ; 2 2546c: b1 cf rjmp .-158 ; 0x253d0 <__vector_17+0xf58> } else { step_loops = 1; 2546e: 21 e0 ldi r18, 0x01 ; 1 25470: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 25474: 80 32 cpi r24, 0x20 ; 32 25476: 91 05 cpc r25, r1 25478: 08 f0 brcs .+2 ; 0x2547c <__vector_17+0x1004> 2547a: ac cf rjmp .-168 ; 0x253d4 <__vector_17+0xf5c> 2547c: 80 e2 ldi r24, 0x20 ; 32 2547e: 90 e0 ldi r25, 0x00 ; 0 25480: a9 cf rjmp .-174 ; 0x253d4 <__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; 25482: 9c 01 movw r18, r24 25484: 36 95 lsr r19 25486: 27 95 ror r18 25488: 2c 7f andi r18, 0xFC ; 252 2548a: 27 52 subi r18, 0x27 ; 39 2548c: 36 47 sbci r19, 0x76 ; 118 timer = (unsigned short)pgm_read_word_near(table_address); 2548e: f9 01 movw r30, r18 25490: 45 91 lpm r20, Z+ 25492: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25494: f9 01 movw r30, r18 25496: 32 96 adiw r30, 0x02 ; 2 25498: 65 91 lpm r22, Z+ 2549a: 74 91 lpm r23, Z 2549c: 87 70 andi r24, 0x07 ; 7 2549e: 99 27 eor r25, r25 254a0: 86 9f mul r24, r22 254a2: 90 01 movw r18, r0 254a4: 87 9f mul r24, r23 254a6: 30 0d add r19, r0 254a8: 96 9f mul r25, r22 254aa: 30 0d add r19, r0 254ac: 11 24 eor r1, r1 254ae: a3 e0 ldi r26, 0x03 ; 3 254b0: 36 95 lsr r19 254b2: 27 95 ror r18 254b4: aa 95 dec r26 254b6: e1 f7 brne .-8 ; 0x254b0 <__vector_17+0x1038> 254b8: ca 01 movw r24, r20 254ba: 82 1b sub r24, r18 254bc: 93 0b sbc r25, r19 254be: aa cf rjmp .-172 ; 0x25414 <__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; 254c0: de 01 movw r26, r28 254c2: a3 5b subi r26, 0xB3 ; 179 254c4: bf 4f sbci r27, 0xFF ; 255 254c6: 4d 91 ld r20, X+ 254c8: 5c 91 ld r21, X 254ca: 11 97 sbiw r26, 0x01 ; 1 254cc: 70 e0 ldi r23, 0x00 ; 0 254ce: 60 e0 ldi r22, 0x00 ; 0 254d0: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 254d4: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 254d8: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 254dc: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 e_step_loops = current_block->advance_step_loops; 254e0: 16 96 adiw r26, 0x06 ; 6 254e2: 9c 91 ld r25, X 254e4: 90 93 b5 05 sts 0x05B5, r25 ; 0x8005b5 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 254e8: 98 2f mov r25, r24 254ea: 92 70 andi r25, 0x02 ; 2 254ec: 09 f4 brne .+2 ; 0x254f0 <__vector_17+0x1078> 254ee: c8 cd rjmp .-1136 ; 0x25080 <__vector_17+0xc08> 254f0: 90 91 c4 05 lds r25, 0x05C4 ; 0x8005c4 254f4: 99 23 and r25, r25 254f6: 09 f4 brne .+2 ; 0x254fa <__vector_17+0x1082> 254f8: c3 cd rjmp .-1146 ; 0x25080 <__vector_17+0xc08> 254fa: 2e 17 cp r18, r30 254fc: 3f 07 cpc r19, r31 254fe: 08 f0 brcs .+2 ; 0x25502 <__vector_17+0x108a> 25500: bf cd rjmp .-1154 ; 0x25080 <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 25502: 44 0f add r20, r20 25504: 55 1f adc r21, r21 25506: 66 1f adc r22, r22 25508: 77 1f adc r23, r23 2550a: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 2550e: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 25512: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 25516: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 LA_phase = 0; 2551a: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 2551e: b0 cd rjmp .-1184 ; 0x25080 <__vector_17+0xc08> 25520: 40 92 b6 05 sts 0x05B6, r4 ; 0x8005b6 25524: 50 92 b7 05 sts 0x05B7, r5 ; 0x8005b7 25528: 60 92 b8 05 sts 0x05B8, r6 ; 0x8005b8 2552c: 70 92 b9 05 sts 0x05B9, r7 ; 0x8005b9 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 25530: 61 11 cpse r22, r1 25532: 1d c0 rjmp .+58 ; 0x2556e <__vector_17+0x10f6> { eISR_Rate = timer; 25534: f0 93 b4 05 sts 0x05B4, r31 ; 0x8005b4 25538: e0 93 b3 05 sts 0x05B3, r30 ; 0x8005b3 nextAdvanceISR = timer; 2553c: f0 93 1b 04 sts 0x041B, r31 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 25540: 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) { 25544: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 25548: 87 fd sbrc r24, 7 2554a: 5a c0 rjmp .+180 ; 0x25600 <__vector_17+0x1188> if (step_loops == e_step_loops) 2554c: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 25550: 10 91 b5 05 lds r17, 0x05B5 ; 0x8005b5 25554: c3 5b subi r28, 0xB3 ; 179 25556: df 4f sbci r29, 0xFF ; 255 25558: 28 81 ld r18, Y 2555a: 39 81 ldd r19, Y+1 ; 0x01 2555c: 81 13 cpse r24, r17 2555e: 35 c0 rjmp .+106 ; 0x255ca <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 25560: 81 e0 ldi r24, 0x01 ; 1 25562: 2e 17 cp r18, r30 25564: 3f 07 cpc r19, r31 25566: 08 f4 brcc .+2 ; 0x2556a <__vector_17+0x10f2> 25568: 49 c0 rjmp .+146 ; 0x255fc <__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); 2556a: 80 e0 ldi r24, 0x00 ; 0 2556c: 47 c0 rjmp .+142 ; 0x255fc <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2556e: 64 30 cpi r22, 0x04 ; 4 25570: 28 f5 brcc .+74 ; 0x255bc <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 25572: 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); 25574: 63 30 cpi r22, 0x03 ; 3 25576: a9 f0 breq .+42 ; 0x255a2 <__vector_17+0x112a> 25578: 66 95 lsr r22 2557a: af 01 movw r20, r30 2557c: 02 c0 rjmp .+4 ; 0x25582 <__vector_17+0x110a> 2557e: 56 95 lsr r21 25580: 47 95 ror r20 25582: 6a 95 dec r22 25584: e2 f7 brpl .-8 ; 0x2557e <__vector_17+0x1106> 25586: 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); 25588: 70 93 b4 05 sts 0x05B4, r23 ; 0x8005b4 2558c: 60 93 b3 05 sts 0x05B3, r22 ; 0x8005b3 } nextAdvanceISR = eISR_Rate; 25590: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 25594: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 25598: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 2559c: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 255a0: d1 cf rjmp .-94 ; 0x25544 <__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; 255a2: 9f 01 movw r18, r30 255a4: ab ea ldi r26, 0xAB ; 171 255a6: ba ea ldi r27, 0xAA ; 170 255a8: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 255ac: 41 e1 ldi r20, 0x11 ; 17 255ae: 96 95 lsr r25 255b0: 87 95 ror r24 255b2: 77 95 ror r23 255b4: 67 95 ror r22 255b6: 4a 95 dec r20 255b8: d1 f7 brne .-12 ; 0x255ae <__vector_17+0x1136> 255ba: e6 cf rjmp .-52 ; 0x25588 <__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); 255bc: 70 e0 ldi r23, 0x00 ; 0 255be: 6f 5f subi r22, 0xFF ; 255 255c0: 7f 4f sbci r23, 0xFF ; 255 255c2: cf 01 movw r24, r30 255c4: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 255c8: df cf rjmp .-66 ; 0x25588 <__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); 255ca: 83 30 cpi r24, 0x03 ; 3 255cc: 09 f4 brne .+2 ; 0x255d0 <__vector_17+0x1158> 255ce: a2 c0 rjmp .+324 ; 0x25714 <__vector_17+0x129c> 255d0: 86 95 lsr r24 255d2: a9 01 movw r20, r18 255d4: 02 c0 rjmp .+4 ; 0x255da <__vector_17+0x1162> 255d6: 56 95 lsr r21 255d8: 47 95 ror r20 255da: 8a 95 dec r24 255dc: e2 f7 brpl .-8 ; 0x255d6 <__vector_17+0x115e> 255de: 13 30 cpi r17, 0x03 ; 3 255e0: 09 f4 brne .+2 ; 0x255e4 <__vector_17+0x116c> 255e2: a6 c0 rjmp .+332 ; 0x25730 <__vector_17+0x12b8> 255e4: 16 95 lsr r17 255e6: bf 01 movw r22, r30 255e8: 02 c0 rjmp .+4 ; 0x255ee <__vector_17+0x1176> 255ea: 76 95 lsr r23 255ec: 67 95 ror r22 255ee: 1a 95 dec r17 255f0: e2 f7 brpl .-8 ; 0x255ea <__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); 255f2: 81 e0 ldi r24, 0x01 ; 1 255f4: 46 17 cp r20, r22 255f6: 57 07 cpc r21, r23 255f8: 08 f0 brcs .+2 ; 0x255fc <__vector_17+0x1184> 255fa: b7 cf rjmp .-146 ; 0x2556a <__vector_17+0x10f2> 255fc: 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(); 25600: 0e 94 87 fb call 0x1f70e ; 0x1f70e #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 25604: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 25608: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 2560c: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 25610: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 25614: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 25618: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 2561c: 80 89 ldd r24, Z+16 ; 0x10 2561e: 91 89 ldd r25, Z+17 ; 0x11 25620: a2 89 ldd r26, Z+18 ; 0x12 25622: b3 89 ldd r27, Z+19 ; 0x13 25624: 48 17 cp r20, r24 25626: 59 07 cpc r21, r25 25628: 6a 07 cpc r22, r26 2562a: 7b 07 cpc r23, r27 2562c: 80 f0 brcs .+32 ; 0x2564e <__vector_17+0x11d6> current_block = NULL; 2562e: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 25632: 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) { 25636: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2563a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2563e: 98 17 cp r25, r24 25640: 31 f0 breq .+12 ; 0x2564e <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 25642: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 25646: 8f 5f subi r24, 0xFF ; 255 25648: 8f 70 andi r24, 0x0F ; 15 2564a: 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; 2564e: 60 91 1a 04 lds r22, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 25652: 70 91 1b 04 lds r23, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> if (eisr) 25656: 61 15 cp r22, r1 25658: 71 05 cpc r23, r1 2565a: 09 f0 breq .+2 ; 0x2565e <__vector_17+0x11e6> 2565c: 46 c0 rjmp .+140 ; 0x256ea <__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) { 2565e: 40 91 16 04 lds r20, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25662: 50 91 17 04 lds r21, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 25666: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 2566a: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 2566e: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 25672: 24 17 cp r18, r20 25674: 35 07 cpc r19, r21 25676: 08 f0 brcs .+2 ; 0x2567a <__vector_17+0x1202> 25678: 6c c0 rjmp .+216 ; 0x25752 <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 2567a: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 2567e: 91 30 cpi r25, 0x01 ; 1 25680: 41 f0 breq .+16 ; 0x25692 <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 25682: 42 1b sub r20, r18 25684: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 25686: 94 17 cp r25, r20 25688: 15 06 cpc r1, r21 2568a: 19 f0 breq .+6 ; 0x25692 <__vector_17+0x121a> 2568c: 10 f0 brcs .+4 ; 0x25692 <__vector_17+0x121a> e_step_loops = d_steps; 2568e: 40 93 b5 05 sts 0x05B5, r20 ; 0x8005b5 } e_steps -= e_step_loops; 25692: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 25696: 89 1b sub r24, r25 25698: 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); 2569c: 88 23 and r24, r24 2569e: 39 f0 breq .+14 ; 0x256ae <__vector_17+0x1236> 256a0: 87 ff sbrs r24, 7 256a2: 53 c0 rjmp .+166 ; 0x2574a <__vector_17+0x12d2> 256a4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 256a8: 80 64 ori r24, 0x40 ; 64 256aa: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 256ae: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 256b2: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 256b6: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 256ba: 82 1b sub r24, r18 256bc: 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; 256be: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 256c2: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> } if (current_adv_steps == target_adv_steps) { 256c6: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 256ca: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 256ce: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 256d2: 90 91 d8 05 lds r25, 0x05D8 ; 0x8005d8 256d6: 28 17 cp r18, r24 256d8: 39 07 cpc r19, r25 256da: 09 f0 breq .+2 ; 0x256de <__vector_17+0x1266> 256dc: 66 c0 rjmp .+204 ; 0x257aa <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 256de: 8f ef ldi r24, 0xFF ; 255 256e0: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 256e2: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 256e6: 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)) { 256ea: 40 91 d6 05 lds r20, 0x05D6 ; 0x8005d6 256ee: 41 11 cpse r20, r1 256f0: 61 c0 rjmp .+194 ; 0x257b4 <__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) 256f2: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> 256f6: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 256fa: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.433> 256fe: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.433+0x1> 25702: 8f 3f cpi r24, 0xFF ; 255 25704: 98 07 cpc r25, r24 25706: 09 f0 breq .+2 ; 0x2570a <__vector_17+0x1292> 25708: 88 c0 rjmp .+272 ; 0x2581a <__vector_17+0x13a2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2570a: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2570e: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 25712: 8e c0 rjmp .+284 ; 0x25830 <__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; 25714: ab ea ldi r26, 0xAB ; 171 25716: ba ea ldi r27, 0xAA ; 170 25718: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 2571c: ab 01 movw r20, r22 2571e: bc 01 movw r22, r24 25720: 31 e1 ldi r19, 0x11 ; 17 25722: 76 95 lsr r23 25724: 67 95 ror r22 25726: 57 95 ror r21 25728: 47 95 ror r20 2572a: 3a 95 dec r19 2572c: d1 f7 brne .-12 ; 0x25722 <__vector_17+0x12aa> 2572e: 57 cf rjmp .-338 ; 0x255de <__vector_17+0x1166> 25730: 9f 01 movw r18, r30 25732: ab ea ldi r26, 0xAB ; 171 25734: ba ea ldi r27, 0xAA ; 170 25736: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 2573a: 21 e1 ldi r18, 0x11 ; 17 2573c: 96 95 lsr r25 2573e: 87 95 ror r24 25740: 77 95 ror r23 25742: 67 95 ror r22 25744: 2a 95 dec r18 25746: d1 f7 brne .-12 ; 0x2573c <__vector_17+0x12c4> 25748: 54 cf rjmp .-344 ; 0x255f2 <__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); 2574a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2574e: 8f 7b andi r24, 0xBF ; 191 25750: ac cf rjmp .-168 ; 0x256aa <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 25752: 42 17 cp r20, r18 25754: 53 07 cpc r21, r19 25756: 08 f0 brcs .+2 ; 0x2575a <__vector_17+0x12e2> 25758: b6 cf rjmp .-148 ; 0x256c6 <__vector_17+0x124e> // compression if (e_step_loops != 1) { 2575a: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 2575e: 91 30 cpi r25, 0x01 ; 1 25760: 41 f0 breq .+16 ; 0x25772 <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 25762: 24 1b sub r18, r20 25764: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 25766: 92 17 cp r25, r18 25768: 13 06 cpc r1, r19 2576a: 19 f0 breq .+6 ; 0x25772 <__vector_17+0x12fa> 2576c: 10 f0 brcs .+4 ; 0x25772 <__vector_17+0x12fa> e_step_loops = d_steps; 2576e: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 } e_steps += e_step_loops; 25772: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 25776: 89 0f add r24, r25 25778: 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); 2577c: 88 23 and r24, r24 2577e: 39 f0 breq .+14 ; 0x2578e <__vector_17+0x1316> 25780: 87 ff sbrs r24, 7 25782: 0f c0 rjmp .+30 ; 0x257a2 <__vector_17+0x132a> 25784: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25788: 80 64 ori r24, 0x40 ; 64 2578a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2578e: 80 91 b5 05 lds r24, 0x05B5 ; 0x8005b5 25792: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> 25796: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 2579a: 82 0f add r24, r18 2579c: 93 2f mov r25, r19 2579e: 91 1d adc r25, r1 257a0: 8e cf rjmp .-228 ; 0x256be <__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); 257a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 257a6: 8f 7b andi r24, 0xBF ; 191 257a8: f0 cf rjmp .-32 ; 0x2578a <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 257aa: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 257ae: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 257b2: 97 cf rjmp .-210 ; 0x256e2 <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 257b4: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 257b8: 87 fd sbrc r24, 7 257ba: 0e c0 rjmp .+28 ; 0x257d8 <__vector_17+0x1360> 257bc: 08 2e mov r0, r24 257be: 00 0c add r0, r0 257c0: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 257c2: 21 e0 ldi r18, 0x01 ; 1 257c4: 30 e0 ldi r19, 0x00 ; 0 257c6: 61 15 cp r22, r1 257c8: 71 05 cpc r23, r1 257ca: 11 f0 breq .+4 ; 0x257d0 <__vector_17+0x1358> 257cc: 30 e0 ldi r19, 0x00 ; 0 257ce: 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)) { 257d0: 82 17 cp r24, r18 257d2: 93 07 cpc r25, r19 257d4: 09 f0 breq .+2 ; 0x257d8 <__vector_17+0x1360> 257d6: 8d cf rjmp .-230 ; 0x256f2 <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 257d8: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 257dc: 67 2b or r22, r23 257de: 11 f0 breq .+4 ; 0x257e4 <__vector_17+0x136c> 257e0: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd max_ticks = min(abs(e_steps), max_ticks); 257e4: 84 2f mov r24, r20 257e6: 04 2e mov r0, r20 257e8: 00 0c add r0, r0 257ea: 99 0b sbc r25, r25 257ec: 97 ff sbrs r25, 7 257ee: 03 c0 rjmp .+6 ; 0x257f6 <__vector_17+0x137e> 257f0: 91 95 neg r25 257f2: 81 95 neg r24 257f4: 91 09 sbc r25, r1 257f6: 30 e0 ldi r19, 0x00 ; 0 257f8: 28 17 cp r18, r24 257fa: 39 07 cpc r19, r25 257fc: 0c f4 brge .+2 ; 0x25800 <__vector_17+0x1388> 257fe: c9 01 movw r24, r18 25800: 21 e0 ldi r18, 0x01 ; 1 25802: 47 ff sbrs r20, 7 25804: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 25806: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 25808: 90 91 d6 05 lds r25, 0x05D6 ; 0x8005d6 2580c: 92 0f add r25, r18 2580e: 90 93 d6 05 sts 0x05D6, r25 ; 0x8005d6 STEP_NC_LO(E_AXIS); 25812: 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); 25814: 81 50 subi r24, 0x01 ; 1 25816: b9 f7 brne .-18 ; 0x25806 <__vector_17+0x138e> 25818: 6c cf rjmp .-296 ; 0x256f2 <__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) 2581a: ac 01 movw r20, r24 2581c: 48 5d subi r20, 0xD8 ; 216 2581e: 5f 4f sbci r21, 0xFF ; 255 25820: 42 17 cp r20, r18 25822: 53 07 cpc r21, r19 25824: 08 f0 brcs .+2 ; 0x25828 <__vector_17+0x13b0> 25826: 71 cf rjmp .-286 ; 0x2570a <__vector_17+0x1292> OCR1A = nextAdvanceISR; 25828: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2582c: 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) { 25830: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 25834: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25838: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2583c: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 25840: 40 96 adiw r24, 0x10 ; 16 25842: 28 17 cp r18, r24 25844: 39 07 cpc r19, r25 25846: 48 f4 brcc .+18 ; 0x2585a <__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; 25848: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2584c: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 25850: 40 96 adiw r24, 0x10 ; 16 25852: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25856: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2585a: ff 91 pop r31 2585c: ef 91 pop r30 2585e: df 91 pop r29 25860: cf 91 pop r28 25862: bf 91 pop r27 25864: af 91 pop r26 25866: 9f 91 pop r25 25868: 8f 91 pop r24 2586a: 7f 91 pop r23 2586c: 6f 91 pop r22 2586e: 5f 91 pop r21 25870: 4f 91 pop r20 25872: 3f 91 pop r19 25874: 2f 91 pop r18 25876: 1f 91 pop r17 25878: ff 90 pop r15 2587a: ef 90 pop r14 2587c: df 90 pop r13 2587e: cf 90 pop r12 25880: 8f 90 pop r8 25882: 7f 90 pop r7 25884: 6f 90 pop r6 25886: 5f 90 pop r5 25888: 4f 90 pop r4 2588a: 0f 90 pop r0 2588c: 0b be out 0x3b, r0 ; 59 2588e: 0f 90 pop r0 25890: 0f be out 0x3f, r0 ; 63 25892: 0f 90 pop r0 25894: 1f 90 pop r1 25896: 18 95 reti 00025898 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 25898: 90 91 bc 05 lds r25, 0x05BC ; 0x8005bc check_z_endstop = check; 2589c: 80 93 bc 05 sts 0x05BC, r24 ; 0x8005bc CRITICAL_SECTION_START; 258a0: 2f b7 in r18, 0x3f ; 63 258a2: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 258a4: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 258a8: 8b 7f andi r24, 0xFB ; 251 258aa: 80 93 2c 04 sts 0x042C, r24 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_END; 258ae: 2f bf out 0x3f, r18 ; 63 return old; } 258b0: 89 2f mov r24, r25 258b2: 08 95 ret 000258b4 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 258b4: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_START; 258b8: 2f b7 in r18, 0x3f ; 63 258ba: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 258bc: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> 258c0: 9b 7f andi r25, 0xFB ; 251 258c2: 90 93 2c 04 sts 0x042C, r25 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> CRITICAL_SECTION_END; 258c6: 2f bf out 0x3f, r18 ; 63 return hit; } 258c8: 82 fb bst r24, 2 258ca: 88 27 eor r24, r24 258cc: 80 f9 bld r24, 0 258ce: 08 95 ret 000258d0 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 258d0: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.437> endstop_hit = 0; 258d4: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.437> return old; 258d8: 81 e0 ldi r24, 0x01 ; 1 258da: 91 11 cpse r25, r1 258dc: 01 c0 rjmp .+2 ; 0x258e0 258de: 80 e0 ldi r24, 0x00 ; 0 } 258e0: 08 95 ret 000258e2 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 258e2: 90 91 15 04 lds r25, 0x0415 ; 0x800415 258e6: 91 30 cpi r25, 0x01 ; 1 258e8: 99 f0 breq .+38 ; 0x25910 258ea: 28 f0 brcs .+10 ; 0x258f6 258ec: 92 30 cpi r25, 0x02 ; 2 258ee: a1 f0 breq .+40 ; 0x25918 258f0: 93 30 cpi r25, 0x03 ; 3 258f2: b1 f0 breq .+44 ; 0x25920 258f4: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 258f6: 81 11 cpse r24, r1 258f8: 02 c0 rjmp .+4 ; 0x258fe 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(); 258fa: 0c 94 e1 fb jmp 0x1f7c2 ; 0x1f7c2 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 258fe: 82 30 cpi r24, 0x02 ; 2 25900: 11 f4 brne .+4 ; 0x25906 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 25902: 0d 94 86 09 jmp 0x2130c ; 0x2130c 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) 25906: 85 30 cpi r24, 0x05 ; 5 25908: 81 f5 brne .+96 ; 0x2596a Sound_DoSound_Alert(false); 2590a: 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); 2590c: 0c 94 cd fb jmp 0x1f79a ; 0x1f79a 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) 25910: 88 23 and r24, r24 25912: 99 f3 breq .-26 ; 0x258fa Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25914: 82 30 cpi r24, 0x02 ; 2 25916: a9 f3 breq .-22 ; 0x25902 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25918: 85 30 cpi r24, 0x05 ; 5 2591a: 39 f5 brne .+78 ; 0x2596a Sound_DoSound_Alert(true); 2591c: 81 e0 ldi r24, 0x01 ; 1 2591e: f6 cf rjmp .-20 ; 0x2590c 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) 25920: 88 23 and r24, r24 25922: 59 f3 breq .-42 ; 0x258fa Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25924: 82 30 cpi r24, 0x02 ; 2 25926: 69 f3 breq .-38 ; 0x25902 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25928: 85 30 cpi r24, 0x05 ; 5 2592a: 79 f3 breq .-34 ; 0x2590a Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2592c: 86 30 cpi r24, 0x06 ; 6 2592e: 71 f4 brne .+28 ; 0x2594c 25930: 85 e0 ldi r24, 0x05 ; 5 25932: 27 e2 ldi r18, 0x27 ; 39 25934: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 25936: 72 9a sbi 0x0e, 2 ; 14 25938: f9 01 movw r30, r18 2593a: 31 97 sbiw r30, 0x01 ; 1 2593c: f1 f7 brne .-4 ; 0x2593a delayMicroseconds(75); WRITE(BEEPER,LOW); 2593e: 72 98 cbi 0x0e, 2 ; 14 25940: f9 01 movw r30, r18 25942: 31 97 sbiw r30, 0x01 ; 1 25944: f1 f7 brne .-4 ; 0x25942 25946: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 25948: b1 f7 brne .-20 ; 0x25936 2594a: 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) 2594c: 87 30 cpi r24, 0x07 ; 7 2594e: 69 f4 brne .+26 ; 0x2596a 25950: 84 e1 ldi r24, 0x14 ; 20 25952: 23 e7 ldi r18, 0x73 ; 115 25954: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 25956: 72 9a sbi 0x0e, 2 ; 14 25958: f9 01 movw r30, r18 2595a: 31 97 sbiw r30, 0x01 ; 1 2595c: f1 f7 brne .-4 ; 0x2595a delayMicroseconds(94); WRITE(BEEPER,LOW); 2595e: 72 98 cbi 0x0e, 2 ; 14 25960: f9 01 movw r30, r18 25962: 31 97 sbiw r30, 0x01 ; 1 25964: f1 f7 brne .-4 ; 0x25962 25966: 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++) 25968: b1 f7 brne .-20 ; 0x25956 Sound_DoSound_Blind_Alert(); break; default: break; } } 2596a: 08 95 ret 0002596c : //! @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 ) { 2596c: 2f 92 push r2 2596e: 3f 92 push r3 25970: 4f 92 push r4 25972: 5f 92 push r5 25974: 6f 92 push r6 25976: 7f 92 push r7 25978: 8f 92 push r8 2597a: 9f 92 push r9 2597c: af 92 push r10 2597e: bf 92 push r11 25980: cf 92 push r12 25982: df 92 push r13 25984: ef 92 push r14 25986: ff 92 push r15 25988: 0f 93 push r16 2598a: 1f 93 push r17 2598c: cf 93 push r28 2598e: df 93 push r29 25990: 00 d0 rcall .+0 ; 0x25992 25992: 00 d0 rcall .+0 ; 0x25994 25994: cd b7 in r28, 0x3d ; 61 25996: de b7 in r29, 0x3e ; 62 25998: 5c 01 movw r10, r24 2599a: 6c 83 std Y+4, r22 ; 0x04 2599c: 34 2e mov r3, r20 2599e: 3b 83 std Y+3, r19 ; 0x03 259a0: 2a 83 std Y+2, r18 ; 0x02 259a2: 48 01 movw r8, r16 259a4: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 259a6: 00 97 sbiw r24, 0x00 ; 0 259a8: 09 f0 breq .+2 ; 0x259ac 259aa: 51 c0 rjmp .+162 ; 0x25a4e 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); 259ac: 87 01 movw r16, r14 259ae: 22 2d mov r18, r2 259b0: a4 01 movw r20, r8 259b2: 6a 81 ldd r22, Y+2 ; 0x02 259b4: 7b 81 ldd r23, Y+3 ; 0x03 259b6: 83 2d mov r24, r3 259b8: 0f 94 41 0a call 0x21482 ; 0x21482 259bc: d1 2c mov r13, r1 259be: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 259c0: 0f 94 46 0f call 0x21e8c ; 0x21e8c 259c4: 2b 01 movw r4, r22 259c6: 3c 01 movw r6, r24 lcd_consume_click(); 259c8: 0e 94 1e 6c call 0xd83c ; 0xd83c KEEPALIVE_STATE(PAUSED_FOR_USER); 259cc: 84 e0 ldi r24, 0x04 ; 4 259ce: 80 93 78 02 sts 0x0278, r24 ; 0x800278 259d2: de 82 std Y+6, r13 ; 0x06 259d4: cd 82 std Y+5, r12 ; 0x05 259d6: 24 e6 ldi r18, 0x64 ; 100 259d8: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 259da: 82 e3 ldi r24, 0x32 ; 50 259dc: 90 e0 ldi r25, 0x00 ; 0 259de: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 259e2: 3c 81 ldd r19, Y+4 ; 0x04 259e4: 31 11 cpse r19, r1 259e6: 3a c0 rjmp .+116 ; 0x25a5c current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 259e8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 259ec: 90 91 07 05 lds r25, 0x0507 ; 0x800507 259f0: 00 97 sbiw r24, 0x00 ; 0 259f2: 09 f0 breq .+2 ; 0x259f6 259f4: 42 c0 rjmp .+132 ; 0x25a7a } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 259f6: 0e 94 23 6c call 0xd846 ; 0xd846 259fa: 88 23 and r24, r24 259fc: 09 f4 brne .+2 ; 0x25a00 259fe: 67 c0 rjmp .+206 ; 0x25ace if (msg_next == NULL) { 25a00: 8d 81 ldd r24, Y+5 ; 0x05 25a02: 9e 81 ldd r25, Y+6 ; 0x06 25a04: 89 2b or r24, r25 25a06: 09 f0 breq .+2 ; 0x25a0a 25a08: 5e c0 rjmp .+188 ; 0x25ac6 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 25a0a: 82 e0 ldi r24, 0x02 ; 2 25a0c: 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; 25a10: 91 e0 ldi r25, 0x01 ; 1 25a12: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c lcd_draw_update = 2; 25a16: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b return current_selection; } 25a1a: 83 2d mov r24, r3 25a1c: 26 96 adiw r28, 0x06 ; 6 25a1e: 0f b6 in r0, 0x3f ; 63 25a20: f8 94 cli 25a22: de bf out 0x3e, r29 ; 62 25a24: 0f be out 0x3f, r0 ; 63 25a26: cd bf out 0x3d, r28 ; 61 25a28: df 91 pop r29 25a2a: cf 91 pop r28 25a2c: 1f 91 pop r17 25a2e: 0f 91 pop r16 25a30: ff 90 pop r15 25a32: ef 90 pop r14 25a34: df 90 pop r13 25a36: cf 90 pop r12 25a38: bf 90 pop r11 25a3a: af 90 pop r10 25a3c: 9f 90 pop r9 25a3e: 8f 90 pop r8 25a40: 7f 90 pop r7 25a42: 6f 90 pop r6 25a44: 5f 90 pop r5 25a46: 4f 90 pop r4 25a48: 3f 90 pop r3 25a4a: 2f 90 pop r2 25a4c: 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; 25a4e: 0f 94 92 0a call 0x21524 ; 0x21524 25a52: 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) { 25a54: 89 2b or r24, r25 25a56: 09 f0 breq .+2 ; 0x25a5a 25a58: b3 cf rjmp .-154 ; 0x259c0 25a5a: a8 cf rjmp .-176 ; 0x259ac 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) { 25a5c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 25a60: 64 19 sub r22, r4 25a62: 75 09 sbc r23, r5 25a64: 86 09 sbc r24, r6 25a66: 97 09 sbc r25, r7 25a68: 61 33 cpi r22, 0x31 ; 49 25a6a: 75 47 sbci r23, 0x75 ; 117 25a6c: 81 05 cpc r24, r1 25a6e: 91 05 cpc r25, r1 25a70: 08 f4 brcc .+2 ; 0x25a74 25a72: ba cf rjmp .-140 ; 0x259e8 current_selection = LCD_BUTTON_TIMEOUT; 25a74: 33 24 eor r3, r3 25a76: 3a 94 dec r3 25a78: c8 cf rjmp .-112 ; 0x25a0a goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 25a7a: 2d 81 ldd r18, Y+5 ; 0x05 25a7c: 3e 81 ldd r19, Y+6 ; 0x06 25a7e: 23 2b or r18, r19 25a80: f9 f4 brne .+62 ; 0x25ac0 if (third_choice) { // third_choice is not nullptr, safe to dereference 25a82: e1 14 cp r14, r1 25a84: f1 04 cpc r15, r1 25a86: b1 f0 breq .+44 ; 0x25ab4 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25a88: 97 ff sbrs r25, 7 25a8a: 0f c0 rjmp .+30 ; 0x25aaa 25a8c: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 25a8e: 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); 25a90: 87 01 movw r16, r14 25a92: 22 2d mov r18, r2 25a94: a4 01 movw r20, r8 25a96: 6a 81 ldd r22, Y+2 ; 0x02 25a98: 7b 81 ldd r23, Y+3 ; 0x03 25a9a: 83 2d mov r24, r3 25a9c: 0f 94 41 0a call 0x21482 ; 0x21482 lcd_encoder = 0; 25aa0: 10 92 07 05 sts 0x0507, r1 ; 0x800507 25aa4: 10 92 06 05 sts 0x0506, r1 ; 0x800506 25aa8: a6 cf rjmp .-180 ; 0x259f6 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) { 25aaa: 32 e0 ldi r19, 0x02 ; 2 25aac: 33 16 cp r3, r19 25aae: 81 f3 breq .-32 ; 0x25a90 // Rotating knob clockwise current_selection++; 25ab0: 33 94 inc r3 25ab2: ee cf rjmp .-36 ; 0x25a90 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25ab4: 39 2e mov r3, r25 25ab6: 30 94 com r3 25ab8: 33 1c adc r3, r3 25aba: 33 24 eor r3, r3 25abc: 33 1c adc r3, r3 25abe: e8 cf rjmp .-48 ; 0x25a90 } } 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); 25ac0: 87 e0 ldi r24, 0x07 ; 7 25ac2: 0f 94 71 2c call 0x258e2 ; 0x258e2 goto exit; } else break; } } if (multi_screen) { 25ac6: c1 14 cp r12, r1 25ac8: d1 04 cpc r13, r1 25aca: 79 f4 brne .+30 ; 0x25aea 25acc: 84 cf rjmp .-248 ; 0x259d6 25ace: 99 81 ldd r25, Y+1 ; 0x01 25ad0: 91 50 subi r25, 0x01 ; 1 25ad2: 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) { 25ad4: 91 11 cpse r25, r1 25ad6: 81 cf rjmp .-254 ; 0x259da goto exit; } else break; } } if (multi_screen) { 25ad8: c1 14 cp r12, r1 25ada: d1 04 cpc r13, r1 25adc: 61 f0 breq .+24 ; 0x25af6 if (msg_next == NULL) { 25ade: 2d 81 ldd r18, Y+5 ; 0x05 25ae0: 3e 81 ldd r19, Y+6 ; 0x06 25ae2: 23 2b or r18, r19 25ae4: 11 f4 brne .+4 ; 0x25aea 25ae6: be 82 std Y+6, r11 ; 0x06 25ae8: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 25aea: 8d 81 ldd r24, Y+5 ; 0x05 25aec: 9e 81 ldd r25, Y+6 ; 0x06 25aee: 0f 94 92 0a call 0x21524 ; 0x21524 25af2: 9e 83 std Y+6, r25 ; 0x06 25af4: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 25af6: 8d 81 ldd r24, Y+5 ; 0x05 25af8: 9e 81 ldd r25, Y+6 ; 0x06 25afa: 89 2b or r24, r25 25afc: 09 f0 breq .+2 ; 0x25b00 25afe: 6b cf rjmp .-298 ; 0x259d6 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 41 0a call 0x21482 ; 0x21482 25b10: 62 cf rjmp .-316 ; 0x259d6 00025b12 : //! @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) { 25b12: bf 92 push r11 25b14: cf 92 push r12 25b16: df 92 push r13 25b18: ef 92 push r14 25b1a: ff 92 push r15 25b1c: 0f 93 push r16 25b1e: 1f 93 push r17 25b20: cf 93 push r28 25b22: df 93 push r29 25b24: ec 01 movw r28, r24 25b26: d6 2e mov r13, r22 25b28: 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); 25b2a: 89 e0 ldi r24, 0x09 ; 9 25b2c: 9e e3 ldi r25, 0x3E ; 62 25b2e: 0e 94 3c 6d call 0xda78 ; 0xda78 25b32: 8c 01 movw r16, r24 25b34: 83 e0 ldi r24, 0x03 ; 3 25b36: 9e e3 ldi r25, 0x3E ; 62 25b38: 0e 94 3c 6d call 0xda78 ; 0xda78 25b3c: 2a e0 ldi r18, 0x0A ; 10 25b3e: c2 2e mov r12, r18 25b40: f1 2c mov r15, r1 25b42: e1 2c mov r14, r1 25b44: 9c 01 movw r18, r24 25b46: 4b 2d mov r20, r11 25b48: 6d 2d mov r22, r13 25b4a: ce 01 movw r24, r28 25b4c: 0f 94 b6 2c call 0x2596c ; 0x2596c } 25b50: df 91 pop r29 25b52: cf 91 pop r28 25b54: 1f 91 pop r17 25b56: 0f 91 pop r16 25b58: ff 90 pop r15 25b5a: ef 90 pop r14 25b5c: df 90 pop r13 25b5e: cf 90 pop r12 25b60: bf 90 pop r11 25b62: 08 95 ret 00025b64 : //! ---------------------- | ---------------- //! 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) { 25b64: af 92 push r10 25b66: bf 92 push r11 25b68: cf 92 push r12 25b6a: df 92 push r13 25b6c: ef 92 push r14 25b6e: ff 92 push r15 25b70: 0f 93 push r16 25b72: 1f 93 push r17 25b74: cf 93 push r28 25b76: 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); 25b78: 88 23 and r24, r24 25b7a: 29 f0 breq .+10 ; 0x25b86 25b7c: 61 e0 ldi r22, 0x01 ; 1 25b7e: 8f e5 ldi r24, 0x5F ; 95 25b80: 9f e0 ldi r25, 0x0F ; 15 25b82: 0f 94 a1 a0 call 0x34142 ; 0x34142 FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25b86: 89 e2 ldi r24, 0x29 ; 41 25b88: e8 2e mov r14, r24 25b8a: 89 e9 ldi r24, 0x99 ; 153 25b8c: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25b8e: 97 ed ldi r25, 0xD7 ; 215 25b90: c9 2e mov r12, r25 25b92: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25b94: 2c e3 ldi r18, 0x3C ; 60 25b96: a2 2e mov r10, r18 25b98: b1 2c mov r11, r1 25b9a: 0c 2f mov r16, r28 25b9c: 10 e0 ldi r17, 0x00 ; 0 25b9e: 1f 92 push r1 25ba0: cf 93 push r28 25ba2: ff 92 push r15 25ba4: ef 92 push r14 25ba6: 0f 94 3f 9f call 0x33e7e ; 0x33e7e switch (state) { 25baa: 0f 90 pop r0 25bac: 0f 90 pop r0 25bae: 0f 90 pop r0 25bb0: 0f 90 pop r0 25bb2: ef ef ldi r30, 0xFF ; 255 25bb4: ec 0f add r30, r28 25bb6: ed 30 cpi r30, 0x0D ; 13 25bb8: a0 f4 brcc .+40 ; 0x25be2 25bba: f0 e0 ldi r31, 0x00 ; 0 25bbc: 88 27 eor r24, r24 25bbe: ec 51 subi r30, 0x1C ; 28 25bc0: f2 4d sbci r31, 0xD2 ; 210 25bc2: 8e 4f sbci r24, 0xFE ; 254 25bc4: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 25bc8: 61 38 cpi r22, 0x81 ; 129 25bca: 73 38 cpi r23, 0x83 ; 131 25bcc: 35 37 cpi r19, 0x75 ; 117 25bce: c5 38 cpi r28, 0x85 ; 133 25bd0: df 37 cpi r29, 0x7F ; 127 25bd2: 85 37 cpi r24, 0x75 ; 117 25bd4: 0b 37 cpi r16, 0x7B ; 123 25bd6: c7 38 cpi r28, 0x87 ; 135 25bd8: 99 38 cpi r25, 0x89 ; 137 25bda: 1b 37 cpi r17, 0x7B ; 123 25bdc: 91 38 cpi r25, 0x81 ; 129 25bde: 05 37 cpi r16, 0x75 ; 117 25be0: 05 37 cpi r16, 0x75 ; 117 // 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; 25be2: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 25be6: 8f e5 ldi r24, 0x5F ; 95 25be8: 9f e0 ldi r25, 0x0F ; 15 25bea: 0f 94 7d a0 call 0x340fa ; 0x340fa 25bee: 82 30 cpi r24, 0x02 ; 2 25bf0: 39 f4 brne .+14 ; 0x25c00 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 25bf2: 8f e3 ldi r24, 0x3F ; 63 25bf4: 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)); 25bf6: 0e 94 3c 6d call 0xda78 ; 0xda78 25bfa: 0f 94 19 0b call 0x21632 ; 0x21632 25bfe: 0f c0 rjmp .+30 ; 0x25c1e // 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); 25c00: 8a ed ldi r24, 0xDA ; 218 25c02: 94 e5 ldi r25, 0x54 ; 84 25c04: 0e 94 3c 6d call 0xda78 ; 0xda78 25c08: 40 e0 ldi r20, 0x00 ; 0 25c0a: 60 e0 ldi r22, 0x00 ; 0 25c0c: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25c10: 81 11 cpse r24, r1 25c12: 07 c0 rjmp .+14 ; 0x25c22 25c14: 61 e0 ldi r22, 0x01 ; 1 25c16: 8f e5 ldi r24, 0x5F ; 95 25c18: 9f e0 ldi r25, 0x0F ; 15 25c1a: 0f 94 a1 a0 call 0x34142 ; 0x34142 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 25c1e: c1 e0 ldi r28, 0x01 ; 1 25c20: bc cf rjmp .-136 ; 0x25b9a 25c22: 60 e0 ldi r22, 0x00 ; 0 25c24: 8f e5 ldi r24, 0x5F ; 95 25c26: 9f e0 ldi r25, 0x0F ; 15 25c28: 0f 94 a1 a0 call 0x34142 ; 0x34142 25c2c: 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); 25c2e: 10 e0 ldi r17, 0x00 ; 0 25c30: 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); 25c32: 1f 93 push r17 25c34: 0f 93 push r16 25c36: 82 ee ldi r24, 0xE2 ; 226 25c38: 9b e6 ldi r25, 0x6B ; 107 25c3a: 9f 93 push r25 25c3c: 8f 93 push r24 25c3e: 0f 94 3f 9f call 0x33e7e ; 0x33e7e switch (state) { 25c42: 0f 90 pop r0 25c44: 0f 90 pop r0 25c46: 0f 90 pop r0 25c48: 0f 90 pop r0 25c4a: cc 30 cpi r28, 0x0C ; 12 25c4c: 09 f4 brne .+2 ; 0x25c50 25c4e: ed c0 rjmp .+474 ; 0x25e2a 25c50: cd 30 cpi r28, 0x0D ; 13 25c52: 09 f4 brne .+2 ; 0x25c56 25c54: ff c0 rjmp .+510 ; 0x25e54 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 25c56: 89 e3 ldi r24, 0x39 ; 57 25c58: 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) { 25c5a: cc 23 and r28, r28 25c5c: 09 f4 brne .+2 ; 0x25c60 25c5e: fc c0 rjmp .+504 ; 0x25e58 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 25c60: 81 e0 ldi r24, 0x01 ; 1 25c62: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_update(2); 25c66: 82 e0 ldi r24, 0x02 ; 2 } 25c68: cf 91 pop r28 25c6a: 1f 91 pop r17 25c6c: 0f 91 pop r16 25c6e: ff 90 pop r15 25c70: ef 90 pop r14 25c72: df 90 pop r13 25c74: cf 90 pop r12 25c76: bf 90 pop r11 25c78: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 25c7a: 0c 94 cd 69 jmp 0xd39a ; 0xd39a lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25c7e: 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)) { 25c82: 81 e0 ldi r24, 0x01 ; 1 25c84: 0e 94 4f d8 call 0x1b09e ; 0x1b09e state = S::Selftest; 25c88: 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)) { 25c8a: 88 23 and r24, r24 25c8c: 09 f4 brne .+2 ; 0x25c90 25c8e: 85 cf rjmp .-246 ; 0x25b9a state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 25c90: 82 e0 ldi r24, 0x02 ; 2 25c92: 0e 94 4f d8 call 0x1b09e ; 0x1b09e // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 25c96: 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)) { 25c98: 88 23 and r24, r24 25c9a: 09 f4 brne .+2 ; 0x25c9e 25c9c: 7e cf rjmp .-260 ; 0x25b9a // 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)) { 25c9e: 84 e0 ldi r24, 0x04 ; 4 25ca0: 0e 94 4f d8 call 0x1b09e ; 0x1b09e state = S::Z; 25ca4: 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)) { 25ca6: 88 23 and r24, r24 25ca8: 09 f4 brne .+2 ; 0x25cac 25caa: 77 cf rjmp .-274 ; 0x25b9a 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)) { 25cac: 80 e1 ldi r24, 0x10 ; 16 25cae: 0e 94 4f d8 call 0x1b09e ; 0x1b09e state = S::IsFil; 25cb2: 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)) { 25cb4: 88 23 and r24, r24 25cb6: 09 f4 brne .+2 ; 0x25cba 25cb8: 70 cf rjmp .-288 ; 0x25b9a state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 25cba: cc e0 ldi r28, 0x0C ; 12 25cbc: 6e cf rjmp .-292 ; 0x25b9a } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 25cbe: 81 e9 ldi r24, 0x91 ; 145 25cc0: 94 e5 ldi r25, 0x54 ; 84 25cc2: 0e 94 3c 6d call 0xda78 ; 0xda78 25cc6: 0f 94 19 0b call 0x21632 ; 0x21632 wizard_event = lcd_selftest(); 25cca: 0e 94 c3 f3 call 0x1e786 ; 0x1e786 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); 25cce: 81 11 cpse r24, r1 25cd0: a6 cf rjmp .-180 ; 0x25c1e } 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); 25cd2: cd e0 ldi r28, 0x0D ; 13 25cd4: 62 cf rjmp .-316 ; 0x25b9a break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 25cd6: 83 e5 ldi r24, 0x53 ; 83 25cd8: 94 e5 ldi r25, 0x54 ; 84 25cda: 0e 94 3c 6d call 0xda78 ; 0xda78 25cde: 0f 94 19 0b call 0x21632 ; 0x21632 wizard_event = gcode_M45(false, 0); 25ce2: 80 e0 ldi r24, 0x00 ; 0 25ce4: 0e 94 8d c6 call 0x18d1a ; 0x18d1a 25ce8: f2 cf rjmp .-28 ; 0x25cce state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 25cea: 8b e2 ldi r24, 0x2B ; 43 25cec: 94 e5 ldi r25, 0x54 ; 84 25cee: 0e 94 3c 6d call 0xda78 ; 0xda78 25cf2: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 25cf6: 8d ef ldi r24, 0xFD ; 253 25cf8: 93 e5 ldi r25, 0x53 ; 83 25cfa: 0e 94 3c 6d call 0xda78 ; 0xda78 25cfe: 0f 94 19 0b call 0x21632 ; 0x21632 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 25d02: 8d ed ldi r24, 0xDD ; 221 25d04: 93 e5 ldi r25, 0x53 ; 83 25d06: 0e 94 3c 6d call 0xda78 ; 0xda78 25d0a: 0f 94 19 0b call 0x21632 ; 0x21632 wizard_event = gcode_M45(true, 0); 25d0e: 81 e0 ldi r24, 0x01 ; 1 25d10: 0e 94 8d c6 call 0x18d1a ; 0x18d1a if (!wizard_event) { 25d14: 88 23 and r24, r24 25d16: e9 f2 breq .-70 ; 0x25cd2 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 25d18: 60 e0 ldi r22, 0x00 ; 0 25d1a: 70 e0 ldi r23, 0x00 ; 0 25d1c: 88 ed ldi r24, 0xD8 ; 216 25d1e: 91 e4 ldi r25, 0x41 ; 65 25d20: 0e 94 ca 67 call 0xcf94 ; 0xcf94 if(!MMU2::mmu2.Enabled()) { 25d24: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25d28: 81 30 cpi r24, 0x01 ; 1 25d2a: 09 f4 brne .+2 ; 0x25d2e 25d2c: 78 cf rjmp .-272 ; 0x25c1e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25d2e: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25d32: 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)); 25d36: 88 eb ldi r24, 0xB8 ; 184 25d38: 93 e5 ldi r25, 0x53 ; 83 25d3a: 0e 94 3c 6d call 0xda78 ; 0xda78 25d3e: 0f 94 92 0a call 0x21524 ; 0x21524 wait_preheat(); 25d42: 0f 94 9f 0a call 0x2153e ; 0x2153e unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 25d46: 60 e0 ldi r22, 0x00 ; 0 25d48: 70 e0 ldi r23, 0x00 ; 0 25d4a: cb 01 movw r24, r22 25d4c: 0e 94 1e f0 call 0x1e03c ; 0x1e03c lcd_wizard_load(); // load filament 25d50: 0f 94 82 0b call 0x21704 ; 0x21704 25d54: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 25d58: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 25d5c: 60 cf rjmp .-320 ; 0x25c1e 25d5e: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25d62: c0 92 f1 11 sts 0x11F1, r12 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25d66: b0 92 ee 11 sts 0x11EE, r11 ; 0x8011ee 25d6a: 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); 25d6e: 82 ea ldi r24, 0xA2 ; 162 25d70: 93 e5 ldi r25, 0x53 ; 83 25d72: 0e 94 3c 6d call 0xda78 ; 0xda78 25d76: 41 e0 ldi r20, 0x01 ; 1 25d78: 60 e0 ldi r22, 0x00 ; 0 25d7a: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25d7e: 88 23 and r24, r24 25d80: 09 f1 breq .+66 ; 0x25dc4 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 25d82: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25d86: c7 e0 ldi r28, 0x07 ; 7 25d88: 81 30 cpi r24, 0x01 ; 1 25d8a: 09 f4 brne .+2 ; 0x25d8e 25d8c: 06 cf rjmp .-500 ; 0x25b9a else state = S::Preheat; 25d8e: c6 e0 ldi r28, 0x06 ; 6 25d90: 04 cf rjmp .-504 ; 0x25b9a } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 25d92: 20 e0 ldi r18, 0x00 ; 0 25d94: 41 e0 ldi r20, 0x01 ; 1 25d96: 70 e0 ldi r23, 0x00 ; 0 25d98: 60 e0 ldi r22, 0x00 ; 0 25d9a: 8f e4 ldi r24, 0x4F ; 79 25d9c: 98 e3 ldi r25, 0x38 ; 56 25d9e: 0f 94 87 93 call 0x3270e ; 0x3270e lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 25da2: 81 e6 ldi r24, 0x61 ; 97 25da4: 93 e5 ldi r25, 0x53 ; 83 25da6: 0e 94 3c 6d call 0xda78 ; 0xda78 25daa: 0f 94 19 0b call 0x21632 ; 0x21632 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); 25dae: 06 e0 ldi r16, 0x06 ; 6 25db0: 10 e0 ldi r17, 0x00 ; 0 25db2: 3f cf rjmp .-386 ; 0x25c32 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(); 25db4: 0f 94 9f 0a call 0x2153e ; 0x2153e lcd_wizard_load(); 25db8: 0f 94 82 0b call 0x21704 ; 0x21704 state = S::Lay1CalHot; 25dbc: ca e0 ldi r28, 0x0A ; 10 25dbe: ed ce rjmp .-550 ; 0x25b9a break; case S::LoadFilCold: lcd_wizard_load(); 25dc0: 0f 94 82 0b call 0x21704 ; 0x21704 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; 25dc4: c9 e0 ldi r28, 0x09 ; 9 25dc6: e9 ce rjmp .-558 ; 0x25b9a case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 25dc8: 81 e0 ldi r24, 0x01 ; 1 25dca: 0f 94 64 0b call 0x216c8 ; 0x216c8 menu_goto(lcd_v2_calibration, 0, true); 25dce: 20 e0 ldi r18, 0x00 ; 0 25dd0: 41 e0 ldi r20, 0x01 ; 1 25dd2: 70 e0 ldi r23, 0x00 ; 0 25dd4: 60 e0 ldi r22, 0x00 ; 0 25dd6: 81 e5 ldi r24, 0x51 ; 81 25dd8: 97 e3 ldi r25, 0x37 ; 55 25dda: 0f 94 87 93 call 0x3270e ; 0x3270e 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); 25dde: 09 e0 ldi r16, 0x09 ; 9 25de0: 10 e0 ldi r17, 0x00 ; 0 25de2: 27 cf rjmp .-434 ; 0x25c32 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); 25de4: 80 e0 ldi r24, 0x00 ; 0 25de6: 0f 94 64 0b call 0x216c8 ; 0x216c8 lcd_commands_type = LcdCommands::Layer1Cal; 25dea: 84 e0 ldi r24, 0x04 ; 4 25dec: 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); 25df0: 0a e0 ldi r16, 0x0A ; 10 25df2: 10 e0 ldi r17, 0x00 ; 0 25df4: 1e cf rjmp .-452 ; 0x25c32 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); 25df6: 8e e0 ldi r24, 0x0E ; 14 25df8: 93 e5 ldi r25, 0x53 ; 83 25dfa: 0e 94 3c 6d call 0xda78 ; 0xda78 25dfe: 41 e0 ldi r20, 0x01 ; 1 25e00: 60 e0 ldi r22, 0x00 ; 0 25e02: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 25e06: 81 11 cpse r24, r1 25e08: 07 c0 rjmp .+14 ; 0x25e18 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 25e0a: 8e ed ldi r24, 0xDE ; 222 25e0c: 92 e5 ldi r25, 0x52 ; 82 25e0e: 0e 94 3c 6d call 0xda78 ; 0xda78 25e12: 0f 94 19 0b call 0x21632 ; 0x21632 25e16: d6 cf rjmp .-84 ; 0x25dc4 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 25e18: 88 e7 ldi r24, 0x78 ; 120 25e1a: 92 e5 ldi r25, 0x52 ; 82 25e1c: ec ce rjmp .-552 ; 0x25bf6 25e1e: 60 e0 ldi r22, 0x00 ; 0 25e20: 8f e5 ldi r24, 0x5F ; 95 25e22: 9f e0 ldi r25, 0x0F ; 15 25e24: 0f 94 a1 a0 call 0x34142 ; 0x34142 25e28: 04 cf rjmp .-504 ; 0x25c32 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 25e2a: 8a e1 ldi r24, 0x1A ; 26 25e2c: 92 e5 ldi r25, 0x52 ; 82 25e2e: 0e 94 3c 6d call 0xda78 ; 0xda78 25e32: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25e34: 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); 25e38: 8b e0 ldi r24, 0x0B ; 11 25e3a: 9c e6 ldi r25, 0x6C ; 108 25e3c: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe lcd_return_to_status(); 25e40: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 default: // exiting for later re-entry break; } if (msg) { 25e44: 01 15 cp r16, r1 25e46: 11 05 cpc r17, r1 25e48: 09 f4 brne .+2 ; 0x25e4c 25e4a: 0a cf rjmp .-492 ; 0x25c60 lcd_show_fullscreen_message_and_wait_P(msg); 25e4c: c8 01 movw r24, r16 25e4e: 0f 94 19 0b call 0x21632 ; 0x21632 25e52: 06 cf rjmp .-500 ; 0x25c60 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 25e54: 88 eb ldi r24, 0xB8 ; 184 25e56: 91 e5 ldi r25, 0x51 ; 81 25e58: 0e 94 3c 6d call 0xda78 ; 0xda78 25e5c: 8c 01 movw r16, r24 25e5e: f2 cf rjmp .-28 ; 0x25e44 00025e60 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 25e60: cf 93 push r28 25e62: 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); 25e64: 8b e9 ldi r24, 0x9B ; 155 25e66: 91 e5 ldi r25, 0x51 ; 81 25e68: 0e 94 3c 6d call 0xda78 ; 0xda78 25e6c: 41 e0 ldi r20, 0x01 ; 1 25e6e: 4c 27 eor r20, r28 25e70: 60 e0 ldi r22, 0x00 ; 0 25e72: 0f 94 89 2d call 0x25b12 ; 0x25b12 25e76: 91 e0 ldi r25, 0x01 ; 1 25e78: 81 11 cpse r24, r1 25e7a: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 25e7c: c9 17 cp r28, r25 25e7e: 59 f0 breq .+22 ; 0x25e96 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 25e80: 81 e7 ldi r24, 0x71 ; 113 25e82: 91 e5 ldi r25, 0x51 ; 81 25e84: cc 23 and r28, r28 25e86: 11 f0 breq .+4 ; 0x25e8c 25e88: 89 e0 ldi r24, 0x09 ; 9 25e8a: 97 e4 ldi r25, 0x47 ; 71 25e8c: 0e 94 3c 6d call 0xda78 ; 0xda78 } #endif //STEEL_SHEET } 25e90: 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)); 25e92: 0d 94 19 0b jmp 0x21632 ; 0x21632 } #endif //STEEL_SHEET } 25e96: cf 91 pop r28 25e98: 08 95 ret 00025e9a : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 25e9a: cf 93 push r28 25e9c: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 25e9e: 88 e4 ldi r24, 0x48 ; 72 25ea0: 91 e5 ldi r25, 0x51 ; 81 25ea2: 0e 94 3c 6d call 0xda78 ; 0xda78 25ea6: 40 e0 ldi r20, 0x00 ; 0 25ea8: 6c 2f mov r22, r28 25eaa: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (result == LCD_LEFT_BUTTON_CHOICE) { 25eae: 81 11 cpse r24, r1 25eb0: 03 c0 rjmp .+6 ; 0x25eb8 lcd_mesh_calibration_z(); } } 25eb2: 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(); 25eb4: 0c 94 2b fe jmp 0x1fc56 ; 0x1fc56 } } 25eb8: cf 91 pop r28 25eba: 08 95 ret 00025ebc : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 25ebc: 87 e1 ldi r24, 0x17 ; 23 25ebe: 0e 94 4f d8 call 0x1b09e ; 0x1b09e 25ec2: 81 11 cpse r24, r1 25ec4: 06 c0 rjmp .+12 ; 0x25ed2 // 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); 25ec6: 87 e1 ldi r24, 0x17 ; 23 25ec8: 0e 94 2b c6 call 0x18c56 ; 0x18c56 lcd_wizard(WizState::Run); 25ecc: 80 e0 ldi r24, 0x00 ; 0 25ece: 0d 94 b2 2d jmp 0x25b64 ; 0x25b64 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); 25ed2: 86 ea ldi r24, 0xA6 ; 166 25ed4: 9e e4 ldi r25, 0x4E ; 78 25ed6: 0e 94 3c 6d call 0xda78 ; 0xda78 25eda: 41 e0 ldi r20, 0x01 ; 1 25edc: 60 e0 ldi r22, 0x00 ; 0 25ede: 0f 94 89 2d call 0x25b12 ; 0x25b12 } if (result) { 25ee2: 88 23 and r24, r24 25ee4: 81 f3 breq .-32 ; 0x25ec6 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 25ee6: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 lcd_update_enable(true); 25eea: 81 e0 ldi r24, 0x01 ; 1 25eec: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_update(2); 25ef0: 82 e0 ldi r24, 0x02 ; 2 25ef2: 0c 94 cd 69 jmp 0xd39a ; 0xd39a 00025ef6 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 25ef6: cf 92 push r12 25ef8: ef 92 push r14 25efa: ff 92 push r15 25efc: 0f 93 push r16 25efe: 1f 93 push r17 25f00: cf 93 push r28 25f02: 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); 25f04: 81 e4 ldi r24, 0x41 ; 65 25f06: 9b e4 ldi r25, 0x4B ; 75 25f08: 0e 94 3c 6d call 0xda78 ; 0xda78 25f0c: 7c 01 movw r14, r24 25f0e: 89 e0 ldi r24, 0x09 ; 9 25f10: 9e e3 ldi r25, 0x3E ; 62 25f12: 0e 94 3c 6d call 0xda78 ; 0xda78 25f16: 8c 01 movw r16, r24 25f18: 83 e0 ldi r24, 0x03 ; 3 25f1a: 9e e3 ldi r25, 0x3E ; 62 25f1c: 0e 94 3c 6d call 0xda78 ; 0xda78 25f20: ec 01 movw r28, r24 25f22: 86 e1 ldi r24, 0x16 ; 22 25f24: 9b e4 ldi r25, 0x4B ; 75 25f26: 0e 94 3c 6d call 0xda78 ; 0xda78 25f2a: 28 e0 ldi r18, 0x08 ; 8 25f2c: c2 2e mov r12, r18 25f2e: 9e 01 movw r18, r28 25f30: 40 e0 ldi r20, 0x00 ; 0 25f32: 60 e0 ldi r22, 0x00 ; 0 25f34: 0f 94 b6 2c call 0x2596c ; 0x2596c while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 25f38: 81 30 cpi r24, 0x01 ; 1 25f3a: 29 f4 brne .+10 ; 0x25f46 load_filament_final_feed(); 25f3c: 0e 94 00 5f call 0xbe00 ; 0xbe00 st_synchronize(); 25f40: 0f 94 14 22 call 0x24428 ; 0x24428 25f44: df cf rjmp .-66 ; 0x25f04 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) { 25f46: 82 30 cpi r24, 0x02 ; 2 25f48: 61 f4 brne .+24 ; 0x25f62 unload_filament(FILAMENTCHANGE_FINALRETRACT); 25f4a: 60 e0 ldi r22, 0x00 ; 0 25f4c: 70 e0 ldi r23, 0x00 ; 0 25f4e: cb 01 movw r24, r22 } } 25f50: df 91 pop r29 25f52: cf 91 pop r28 25f54: 1f 91 pop r17 25f56: 0f 91 pop r16 25f58: ff 90 pop r15 25f5a: ef 90 pop r14 25f5c: 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); 25f5e: 0c 94 1e f0 jmp 0x1e03c ; 0x1e03c } } 25f62: df 91 pop r29 25f64: cf 91 pop r28 25f66: 1f 91 pop r17 25f68: 0f 91 pop r16 25f6a: ff 90 pop r15 25f6c: ef 90 pop r14 25f6e: cf 90 pop r12 25f70: 08 95 ret 00025f72 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 25f72: 0f 93 push r16 25f74: 1f 93 push r17 25f76: cf 93 push r28 25f78: df 93 push r29 25f7a: 8c 01 movw r16, r24 25f7c: 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; 25f7e: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 25f82: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 25f86: 0e 94 b5 fd call 0x1fb6a ; 0x1fb6a 25f8a: 81 11 cpse r24, r1 25f8c: 04 c0 rjmp .+8 ; 0x25f96 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25f8e: d0 93 ee 11 sts 0x11EE, r29 ; 0x8011ee 25f92: c0 93 ed 11 sts 0x11ED, r28 ; 0x8011ed { const FilamentAction action = eFilamentAction; 25f96: c0 91 62 03 lds r28, 0x0362 ; 0x800362 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 25f9a: 87 ef ldi r24, 0xF7 ; 247 25f9c: 8c 0f add r24, r28 25f9e: 82 30 cpi r24, 0x02 ; 2 25fa0: f8 f4 brcc .+62 ; 0x25fe0 { lcd_return_to_status(); 25fa2: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 if (action == FilamentAction::Lay1Cal) 25fa6: ca 30 cpi r28, 0x0A ; 10 25fa8: 41 f4 brne .+16 ; 0x25fba { lcd_commands_type = LcdCommands::Layer1Cal; 25faa: 84 e0 ldi r24, 0x04 ; 4 25fac: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 } menu_back(); clearFilamentAction(); } } } 25fb0: df 91 pop r29 25fb2: cf 91 pop r28 25fb4: 1f 91 pop r17 25fb6: 0f 91 pop r16 25fb8: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 25fba: 60 e0 ldi r22, 0x00 ; 0 25fbc: 70 e0 ldi r23, 0x00 ; 0 25fbe: 80 e2 ldi r24, 0x20 ; 32 25fc0: 91 e4 ldi r25, 0x41 ; 65 25fc2: 0e 94 ca 67 call 0xcf94 ; 0xcf94 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 25fc6: 8f e5 ldi r24, 0x5F ; 95 25fc8: 9f e0 ldi r25, 0x0F ; 15 25fca: 0f 94 7d a0 call 0x340fa ; 0x340fa 25fce: 88 23 and r24, r24 25fd0: 79 f3 breq .-34 ; 0x25fb0 lcd_wizard(WizState::LoadFilHot); 25fd2: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 25fd4: df 91 pop r29 25fd6: cf 91 pop r28 25fd8: 1f 91 pop r17 25fda: 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); 25fdc: 0d 94 b2 2d jmp 0x25b64 ; 0x25b64 25fe0: 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) 25fe4: 80 91 83 06 lds r24, 0x0683 ; 0x800683 25fe8: 81 11 cpse r24, r1 25fea: 12 c0 rjmp .+36 ; 0x26010 25fec: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 25ff0: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 25ff4: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 25ff8: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 25ffc: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 26000: 60 1b sub r22, r16 26002: 71 0b sbc r23, r17 26004: 6c 5f subi r22, 0xFC ; 252 26006: 7f 4f sbci r23, 0xFF ; 255 26008: 69 30 cpi r22, 0x09 ; 9 2600a: 71 05 cpc r23, r1 2600c: 08 f0 brcs .+2 ; 0x26010 2600e: 60 c0 rjmp .+192 ; 0x260d0 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 26010: c1 50 subi r28, 0x01 ; 1 26012: c8 30 cpi r28, 0x08 ; 8 26014: 88 f5 brcc .+98 ; 0x26078 26016: ec 2f mov r30, r28 26018: f0 e0 ldi r31, 0x00 ; 0 2601a: 88 27 eor r24, r24 2601c: ed 5e subi r30, 0xED ; 237 2601e: ff 4c sbci r31, 0xCF ; 207 26020: 8e 4f sbci r24, 0xFE ; 254 26022: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 26026: 7b 38 cpi r23, 0x8B ; 139 26028: 7b 38 cpi r23, 0x8B ; 139 2602a: 7b 38 cpi r23, 0x8B ; 139 2602c: 55 38 cpi r21, 0x85 ; 133 2602e: eb 37 cpi r30, 0x7B ; 123 26030: 95 38 cpi r25, 0x85 ; 133 26032: a9 38 cpi r26, 0x89 ; 137 26034: 6b 38 cpi r22, 0x8B ; 139 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 26036: c3 e6 ldi r28, 0x63 ; 99 26038: dc eb ldi r29, 0xBC ; 188 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2603a: 80 91 81 06 lds r24, 0x0681 ; 0x800681 2603e: 88 23 and r24, r24 26040: 29 f0 breq .+10 ; 0x2604c Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 26042: 82 e0 ldi r24, 0x02 ; 2 26044: 0f 94 71 2c call 0x258e2 ; 0x258e2 bFilamentWaitingFlag = false; 26048: 10 92 81 06 sts 0x0681, r1 ; 0x800681 } if (filamentActionMenu) { 2604c: 20 97 sbiw r28, 0x00 ; 0 2604e: 09 f4 brne .+2 ; 0x26052 26050: af cf rjmp .-162 ; 0x25fb0 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 26052: 0f 94 8c 06 call 0x20d18 ; 0x20d18 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 26056: 61 e0 ldi r22, 0x01 ; 1 26058: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2605a: df 91 pop r29 2605c: cf 91 pop r28 2605e: 1f 91 pop r17 26060: 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); 26062: 0d 94 ca 94 jmp 0x32994 ; 0x32994 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 26066: 80 91 81 06 lds r24, 0x0681 ; 0x800681 2606a: 88 23 and r24, r24 2606c: 41 f0 breq .+16 ; 0x2607e 2606e: 61 e0 ldi r22, 0x01 ; 1 26070: 89 e6 ldi r24, 0x69 ; 105 26072: 97 e3 ldi r25, 0x37 ; 55 26074: 0f 94 ca 94 call 0x32994 ; 0x32994 // 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; 26078: d0 e0 ldi r29, 0x00 ; 0 2607a: c0 e0 ldi r28, 0x00 ; 0 2607c: de cf rjmp .-68 ; 0x2603a case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2607e: 0f 94 8c 06 call 0x20d18 ; 0x20d18 if (eFilamentAction == FilamentAction::AutoLoad) { 26082: 80 91 62 03 lds r24, 0x0362 ; 0x800362 26086: 82 30 cpi r24, 0x02 ; 2 26088: 19 f4 brne .+6 ; 0x26090 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2608a: 81 e0 ldi r24, 0x01 ; 1 2608c: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } if (eFilamentAction == FilamentAction::Load) 26090: 80 91 62 03 lds r24, 0x0362 ; 0x800362 26094: 81 30 cpi r24, 0x01 ; 1 26096: 31 f4 brne .+12 ; 0x260a4 enquecommand_P(MSG_M701); // load filament 26098: 61 e0 ldi r22, 0x01 ; 1 2609a: 87 e3 ldi r24, 0x37 ; 55 2609c: 9b e6 ldi r25, 0x6B ; 107 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2609e: 0e 94 3a 7d call 0xfa74 ; 0xfa74 260a2: ea cf rjmp .-44 ; 0x26078 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 260a4: 83 30 cpi r24, 0x03 ; 3 260a6: 41 f7 brne .-48 ; 0x26078 enquecommand_P(MSG_M702); // unload filament 260a8: 61 e0 ldi r22, 0x01 ; 1 260aa: 81 eb ldi r24, 0xB1 ; 177 260ac: 98 e6 ldi r25, 0x68 ; 104 260ae: f7 cf rjmp .-18 ; 0x2609e break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 260b0: cd ed ldi r28, 0xDD ; 221 260b2: db eb ldi r29, 0xBB ; 187 260b4: c2 cf rjmp .-124 ; 0x2603a break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 260b6: 0f 94 8c 06 call 0x20d18 ; 0x20d18 MMU2::mmu2.unload(); 260ba: 0f 94 34 6b call 0x2d668 ; 0x2d668 // 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(); 260be: 0f 94 01 0c call 0x21802 ; 0x21802 260c2: da cf rjmp .-76 ; 0x26078 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 260c4: cb e5 ldi r28, 0x5B ; 91 260c6: dc eb ldi r29, 0xBC ; 188 260c8: b8 cf rjmp .-144 ; 0x2603a break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 260ca: c3 e5 ldi r28, 0x53 ; 83 260cc: dc eb ldi r29, 0xBC ; 188 260ce: b5 cf rjmp .-150 ; 0x2603a menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 260d0: 80 91 81 06 lds r24, 0x0681 ; 0x800681 260d4: 88 23 and r24, r24 260d6: 21 f0 breq .+8 ; 0x260e0 260d8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 260dc: 88 23 and r24, r24 260de: 71 f1 breq .+92 ; 0x2613c // 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; 260e0: 81 e0 ldi r24, 0x01 ; 1 260e2: 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; 260e6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_clear(); 260ea: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 260ee: 8c e9 ldi r24, 0x9C ; 156 260f0: 9e e4 ldi r25, 0x4E ; 78 260f2: 0e 94 3c 6d call 0xda78 ; 0xda78 260f6: ac 01 movw r20, r24 260f8: 63 e0 ldi r22, 0x03 ; 3 260fa: 80 e0 ldi r24, 0x00 ; 0 260fc: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(0, 1); 26100: 61 e0 ldi r22, 0x01 ; 1 26102: 80 e0 ldi r24, 0x00 ; 0 26104: 0e 94 06 6a call 0xd40c ; 0xd40c switch (eFilamentAction) 26108: e0 91 62 03 lds r30, 0x0362 ; 0x800362 2610c: e1 50 subi r30, 0x01 ; 1 2610e: e8 30 cpi r30, 0x08 ; 8 26110: a8 f4 brcc .+42 ; 0x2613c 26112: f0 e0 ldi r31, 0x00 ; 0 26114: 88 27 eor r24, r24 26116: e0 57 subi r30, 0x70 ; 112 26118: ff 4c sbci r31, 0xCF ; 207 2611a: 8e 4f sbci r24, 0xFE ; 254 2611c: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 26120: 59 37 cpi r21, 0x79 ; 121 26122: 59 37 cpi r21, 0x79 ; 121 26124: 75 37 cpi r23, 0x75 ; 117 26126: 59 37 cpi r21, 0x79 ; 121 26128: 75 37 cpi r23, 0x75 ; 117 2612a: cf 37 cpi r28, 0x7F ; 127 2612c: 17 37 cpi r17, 0x77 ; 119 2612e: 59 37 cpi r21, 0x79 ; 121 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 26130: 86 ef ldi r24, 0xF6 ; 246 26132: 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)); 26134: 0e 94 3c 6d call 0xda78 ; 0xda78 26138: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 // handled earlier break; } } if (bFilamentWaitingFlag) { 2613c: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26140: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 26142: 0f 94 b3 06 call 0x20d66 ; 0x20d66 } if (lcd_clicked()) 26146: 0e 94 23 6c call 0xd846 ; 0xd846 2614a: 88 23 and r24, r24 2614c: 09 f4 brne .+2 ; 0x26150 2614e: 30 cf rjmp .-416 ; 0x25fb0 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 26150: 10 92 81 06 sts 0x0681, r1 ; 0x800681 if (!bFilamentPreheatState) 26154: 80 91 82 06 lds r24, 0x0682 ; 0x800682 26158: 81 11 cpse r24, r1 2615a: 0e c0 rjmp .+28 ; 0x26178 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2615c: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 26160: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 26164: 0e 94 48 61 call 0xc290 ; 0xc290 26168: 81 11 cpse r24, r1 2616a: 04 c0 rjmp .+8 ; 0x26174 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2616c: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 26170: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed menu_back(); 26174: 0f 94 25 96 call 0x32c4a ; 0x32c4a } menu_back(); 26178: 0f 94 25 96 call 0x32c4a ; 0x32c4a clearFilamentAction(); } } } 2617c: df 91 pop r29 2617e: cf 91 pop r28 26180: 1f 91 pop r17 26182: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 26184: 0d 94 01 0c jmp 0x21802 ; 0x21802 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)); 26188: 8f ed ldi r24, 0xDF ; 223 2618a: 9a e4 ldi r25, 0x4A ; 74 2618c: d3 cf rjmp .-90 ; 0x26134 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2618e: 89 ec ldi r24, 0xC9 ; 201 26190: 9a e4 ldi r25, 0x4A ; 74 26192: d0 cf rjmp .-96 ; 0x26134 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 26194: 85 eb ldi r24, 0xB5 ; 181 26196: 9a e4 ldi r25, 0x4A ; 74 26198: cd cf rjmp .-102 ; 0x26134 0002619a : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2619a: 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) ); 2619e: 40 91 94 12 lds r20, 0x1294 ; 0x801294 261a2: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 261a6: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 261aa: 41 30 cpi r20, 0x01 ; 1 261ac: 59 f0 breq .+22 ; 0x261c4 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() 261ae: 10 92 83 06 sts 0x0683, r1 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 261b2: 80 91 57 02 lds r24, 0x0257 ; 0x800257 261b6: 90 91 58 02 lds r25, 0x0258 ; 0x800258 261ba: 28 17 cp r18, r24 261bc: 39 07 cpc r19, r25 261be: 5c f4 brge .+22 ; 0x261d6 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 261c0: 0d 94 04 0c jmp 0x21808 ; 0x21808 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() 261c4: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 261c8: 91 11 cpse r25, r1 261ca: f1 cf rjmp .-30 ; 0x261ae && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 261cc: 86 50 subi r24, 0x06 ; 6 261ce: 82 30 cpi r24, 0x02 ; 2 261d0: 70 f7 brcc .-36 ; 0x261ae 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() 261d2: 40 93 83 06 sts 0x0683, r20 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 261d6: 81 e0 ldi r24, 0x01 ; 1 261d8: 80 93 82 06 sts 0x0682, r24 ; 0x800682 mFilamentItem(target_temperature[0], target_temperature_bed); 261dc: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 261e0: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 261e4: c9 01 movw r24, r18 261e6: 0f 94 b9 2f call 0x25f72 ; 0x25f72 bFilamentSkipPreheat = false; // Reset flag 261ea: 10 92 83 06 sts 0x0683, r1 ; 0x800683 } else { lcd_generic_preheat_menu(); } } 261ee: 08 95 ret 000261f0 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 261f0: 82 e0 ldi r24, 0x02 ; 2 261f2: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 000261f6 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 261f6: 81 e0 ldi r24, 0x01 ; 1 261f8: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 000261fc : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 261fc: 83 e0 ldi r24, 0x03 ; 3 261fe: 0d 94 cd 30 jmp 0x2619a ; 0x2619a 00026202 : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 26202: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 26206: 60 e5 ldi r22, 0x50 ; 80 26208: 70 e0 ldi r23, 0x00 ; 0 2620a: 8a ef ldi r24, 0xFA ; 250 2620c: 90 e0 ldi r25, 0x00 ; 0 2620e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026212 : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 26212: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 26216: 70 e0 ldi r23, 0x00 ; 0 26218: 60 e0 ldi r22, 0x00 ; 0 2621a: 8a ef ldi r24, 0xFA ; 250 2621c: 90 e0 ldi r25, 0x00 ; 0 2621e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026222 : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 26222: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 26226: 6c e3 ldi r22, 0x3C ; 60 26228: 70 e0 ldi r23, 0x00 ; 0 2622a: 87 ed ldi r24, 0xD7 ; 215 2622c: 90 e0 ldi r25, 0x00 ; 0 2622e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026232 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 26232: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 26236: 65 e5 ldi r22, 0x55 ; 85 26238: 70 e0 ldi r23, 0x00 ; 0 2623a: 86 ee ldi r24, 0xE6 ; 230 2623c: 90 e0 ldi r25, 0x00 ; 0 2623e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026242 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 26242: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 26246: 69 e6 ldi r22, 0x69 ; 105 26248: 70 e0 ldi r23, 0x00 ; 0 2624a: 84 e0 ldi r24, 0x04 ; 4 2624c: 91 e0 ldi r25, 0x01 ; 1 2624e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026252 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 26252: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 26256: 69 e6 ldi r22, 0x69 ; 105 26258: 70 e0 ldi r23, 0x00 ; 0 2625a: 83 e1 ldi r24, 0x13 ; 19 2625c: 91 e0 ldi r25, 0x01 ; 1 2625e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026262 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 26262: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 26266: 6b e4 ldi r22, 0x4B ; 75 26268: 70 e0 ldi r23, 0x00 ; 0 2626a: 87 ed ldi r24, 0xD7 ; 215 2626c: 90 e0 ldi r25, 0x00 ; 0 2626e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026272 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 26272: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 26276: 6a e5 ldi r22, 0x5A ; 90 26278: 70 e0 ldi r23, 0x00 ; 0 2627a: 83 e1 ldi r24, 0x13 ; 19 2627c: 91 e0 ldi r25, 0x01 ; 1 2627e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026282 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 26282: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 26286: 64 e6 ldi r22, 0x64 ; 100 26288: 70 e0 ldi r23, 0x00 ; 0 2628a: 8f ef ldi r24, 0xFF ; 255 2628c: 90 e0 ldi r25, 0x00 ; 0 2628e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 00026292 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 26292: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 26296: 64 e6 ldi r22, 0x64 ; 100 26298: 70 e0 ldi r23, 0x00 ; 0 2629a: 8c ed ldi r24, 0xDC ; 220 2629c: 90 e0 ldi r25, 0x00 ; 0 2629e: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 000262a2 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 262a2: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 262a6: 64 e6 ldi r22, 0x64 ; 100 262a8: 70 e0 ldi r23, 0x00 ; 0 262aa: 8e ef ldi r24, 0xFE ; 254 262ac: 90 e0 ldi r25, 0x00 ; 0 262ae: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 000262b2 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 262b2: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 262b6: 62 e3 ldi r22, 0x32 ; 50 262b8: 70 e0 ldi r23, 0x00 ; 0 262ba: 80 ef ldi r24, 0xF0 ; 240 262bc: 90 e0 ldi r25, 0x00 ; 0 262be: 0d 94 b9 2f jmp 0x25f72 ; 0x25f72 000262c2 : } 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){ 262c2: cf 92 push r12 262c4: df 92 push r13 262c6: ef 92 push r14 262c8: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 262ca: 41 11 cpse r20, r1 262cc: 04 c0 rjmp .+8 ; 0x262d6 262ce: 20 91 15 04 lds r18, 0x0415 ; 0x800415 262d2: 22 30 cpi r18, 0x02 ; 2 262d4: 61 f0 breq .+24 ; 0x262ee 262d6: 9b 01 movw r18, r22 262d8: 6c 01 movw r12, r24 262da: f1 2c mov r15, r1 262dc: e1 2c mov r14, r1 if(!tone_) { 262de: 67 2b or r22, r23 262e0: 59 f4 brne .+22 ; 0x262f8 WRITE(BEEPER, HIGH); 262e2: 72 9a sbi 0x0e, 2 ; 14 _delay(ms); 262e4: c7 01 movw r24, r14 262e6: b6 01 movw r22, r12 262e8: 0f 94 4d 0d call 0x21a9a ; 0x21a9a 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); 262ec: 72 98 cbi 0x0e, 2 ; 14 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 262ee: ff 90 pop r15 262f0: ef 90 pop r14 262f2: df 90 pop r13 262f4: cf 90 pop r12 262f6: 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); 262f8: 22 0f add r18, r18 262fa: 33 1f adc r19, r19 262fc: 50 e0 ldi r21, 0x00 ; 0 262fe: 40 e0 ldi r20, 0x00 ; 0 26300: 60 e0 ldi r22, 0x00 ; 0 26302: 74 e2 ldi r23, 0x24 ; 36 26304: 84 ef ldi r24, 0xF4 ; 244 26306: 90 e0 ldi r25, 0x00 ; 0 26308: 0f 94 6e a1 call 0x342dc ; 0x342dc <__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; 2630c: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2630e: 21 15 cp r18, r1 26310: 31 05 cpc r19, r1 26312: 81 e0 ldi r24, 0x01 ; 1 26314: 48 07 cpc r20, r24 26316: 51 05 cpc r21, r1 26318: 44 f0 brlt .+16 ; 0x2632a pwm_freq /= 64; // Increase prescaler to 64 2631a: 86 e0 ldi r24, 0x06 ; 6 2631c: 56 95 lsr r21 2631e: 47 95 ror r20 26320: 37 95 ror r19 26322: 27 95 ror r18 26324: 8a 95 dec r24 26326: d1 f7 brne .-12 ; 0x2631c prescalarbits = 0b011; 26328: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2632a: 21 50 subi r18, 0x01 ; 1 2632c: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2632e: 4f b7 in r20, 0x3f ; 63 26330: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 26332: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 26336: 88 7f andi r24, 0xF8 ; 248 26338: 89 2b or r24, r25 2633a: 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); 2633e: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 26342: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26346: 26 9f mul r18, r22 26348: c0 01 movw r24, r0 2634a: 27 9f mul r18, r23 2634c: 90 0d add r25, r0 2634e: 36 9f mul r19, r22 26350: 90 0d add r25, r0 26352: 11 24 eor r1, r1 26354: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26358: 6f ef ldi r22, 0xFF ; 255 2635a: 70 e0 ldi r23, 0x00 ; 0 2635c: 51 ff sbrs r21, 1 2635e: 04 c0 rjmp .+8 ; 0x26368 26360: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 26364: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26368: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 2636c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26370: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 26374: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26378: 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); 2637c: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26380: 83 60 ori r24, 0x03 ; 3 26382: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 26386: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 26388: c7 01 movw r24, r14 2638a: b6 01 movw r22, r12 2638c: 0f 94 4d 0d call 0x21a9a ; 0x21a9a } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 26390: 2f b7 in r18, 0x3f ; 63 26392: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 26394: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 26398: 88 7f andi r24, 0xF8 ; 248 2639a: 85 60 ori r24, 0x05 ; 5 2639c: 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); 263a0: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 263a4: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 263a8: 3f ef ldi r19, 0xFF ; 255 263aa: 34 9f mul r19, r20 263ac: c0 01 movw r24, r0 263ae: 35 9f mul r19, r21 263b0: 90 0d add r25, r0 263b2: 11 24 eor r1, r1 263b4: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 263b8: 6f ef ldi r22, 0xFF ; 255 263ba: 70 e0 ldi r23, 0x00 ; 0 263bc: 31 ff sbrs r19, 1 263be: 04 c0 rjmp .+8 ; 0x263c8 263c0: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 263c4: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 263c8: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 263cc: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 263d0: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 263d4: 8f ef ldi r24, 0xFF ; 255 263d6: 90 e0 ldi r25, 0x00 ; 0 263d8: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 263dc: 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)); 263e0: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 263e4: 8c 7f andi r24, 0xFC ; 252 263e6: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 263ea: 2f bf out 0x3f, r18 ; 63 263ec: 7f cf rjmp .-258 ; 0x262ec 000263ee : } void handle_temp_error(); void manage_heater() { 263ee: cf 92 push r12 263f0: df 92 push r13 263f2: ef 92 push r14 263f4: ff 92 push r15 263f6: 0f 93 push r16 263f8: 1f 93 push r17 263fa: cf 93 push r28 263fc: df 93 push r29 263fe: 1f 92 push r1 26400: 1f 92 push r1 26402: cd b7 in r28, 0x3d ; 61 26404: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 26406: 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) 26408: 80 91 42 06 lds r24, 0x0642 ; 0x800642 2640c: 88 23 and r24, r24 2640e: 09 f4 brne .+2 ; 0x26412 26410: 29 c2 rjmp .+1106 ; 0x26864 return; // syncronize temperatures with isr updateTemperatures(); 26412: 0e 94 be fa call 0x1f57c ; 0x1f57c if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 26416: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2641a: 88 23 and r24, r24 2641c: 89 f1 breq .+98 ; 0x26480 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 2641e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26422: 82 95 swap r24 26424: 86 95 lsr r24 26426: 87 70 andi r24, 0x07 ; 7 26428: 81 30 cpi r24, 0x01 ; 1 2642a: 01 f1 breq .+64 ; 0x2646c 2642c: 08 f4 brcc .+2 ; 0x26430 2642e: be c1 rjmp .+892 ; 0x267ac 26430: 84 30 cpi r24, 0x04 ; 4 26432: 30 f5 brcc .+76 ; 0x26480 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 26434: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26438: 86 95 lsr r24 2643a: 86 95 lsr r24 2643c: 83 70 andi r24, 0x03 ; 3 2643e: 82 30 cpi r24, 0x02 ; 2 26440: f8 f4 brcc .+62 ; 0x26480 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 26442: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26446: 86 95 lsr r24 26448: 86 95 lsr r24 2644a: 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), 2644c: 90 91 9a 03 lds r25, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26450: 92 95 swap r25 26452: 96 95 lsr r25 26454: 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( 26456: 61 e0 ldi r22, 0x01 ; 1 26458: 81 30 cpi r24, 0x01 ; 1 2645a: 09 f0 breq .+2 ; 0x2645e 2645c: 60 e0 ldi r22, 0x00 ; 0 2645e: 81 e0 ldi r24, 0x01 ; 1 26460: 92 30 cpi r25, 0x02 ; 2 26462: 09 f0 breq .+2 ; 0x26466 26464: 80 e0 ldi r24, 0x00 ; 0 26466: 0f 94 47 09 call 0x2128e ; 0x2128e 2646a: 0a c0 rjmp .+20 ; 0x26480 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 2646c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26470: 86 95 lsr r24 26472: 86 95 lsr r24 26474: 83 70 andi r24, 0x03 ; 3 26476: 09 f4 brne .+2 ; 0x2647a 26478: 4b c1 rjmp .+662 ; 0x26710 2647a: 81 30 cpi r24, 0x01 ; 1 2647c: 09 f4 brne .+2 ; 0x26480 2647e: 79 c1 rjmp .+754 ; 0x26772 #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)) { 26480: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26484: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26488: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 2648c: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26490: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26494: 60 1b sub r22, r16 26496: 71 0b sbc r23, r17 26498: 82 0b sbc r24, r18 2649a: 93 0b sbc r25, r19 2649c: 69 38 cpi r22, 0x89 ; 137 2649e: 73 41 sbci r23, 0x13 ; 19 264a0: 81 05 cpc r24, r1 264a2: 91 05 cpc r25, r1 264a4: d0 f0 brcs .+52 ; 0x264da 264a6: 80 91 84 03 lds r24, 0x0384 ; 0x800384 264aa: 81 11 cpse r24, r1 264ac: 16 c0 rjmp .+44 ; 0x264da extruder_autofan_last_check = _millis(); 264ae: 0f 94 46 0f call 0x21e8c ; 0x21e8c 264b2: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 264b6: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 264ba: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 264be: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fanSpeedBckp = fanSpeedSoftPwm; 264c2: 80 91 05 05 lds r24, 0x0505 ; 0x800505 264c6: 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 264ca: 8b 34 cpi r24, 0x4B ; 75 264cc: 18 f0 brcs .+6 ; 0x264d4 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 264ce: 8f ef ldi r24, 0xFF ; 255 264d0: 80 93 05 05 sts 0x0505, r24 ; 0x800505 } fan_measuring = true; 264d4: 81 e0 ldi r24, 0x01 ; 1 264d6: 80 93 84 03 sts 0x0384, r24 ; 0x800384 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 264da: 0f 94 46 0f call 0x21e8c ; 0x21e8c 264de: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 264e2: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 264e6: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 264ea: 30 91 90 16 lds r19, 0x1690 ; 0x801690 264ee: 60 1b sub r22, r16 264f0: 71 0b sbc r23, r17 264f2: 82 0b sbc r24, r18 264f4: 93 0b sbc r25, r19 264f6: 65 36 cpi r22, 0x65 ; 101 264f8: 71 05 cpc r23, r1 264fa: 81 05 cpc r24, r1 264fc: 91 05 cpc r25, r1 264fe: 08 f4 brcc .+2 ; 0x26502 26500: a5 c1 rjmp .+842 ; 0x2684c 26502: 80 91 84 03 lds r24, 0x0384 ; 0x800384 26506: 88 23 and r24, r24 26508: 09 f4 brne .+2 ; 0x2650c 2650a: a0 c1 rjmp .+832 ; 0x2684c #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))); 2650c: 60 91 22 06 lds r22, 0x0622 ; 0x800622 26510: 70 91 23 06 lds r23, 0x0623 ; 0x800623 26514: 07 2e mov r0, r23 26516: 00 0c add r0, r0 26518: 88 0b sbc r24, r24 2651a: 99 0b sbc r25, r25 2651c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 26520: 6b 01 movw r12, r22 26522: 7c 01 movw r14, r24 26524: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26528: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 2652c: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 26530: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26534: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26538: 60 1b sub r22, r16 2653a: 71 0b sbc r23, r17 2653c: 82 0b sbc r24, r18 2653e: 93 0b sbc r25, r19 26540: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 26544: 9b 01 movw r18, r22 26546: ac 01 movw r20, r24 26548: 60 e0 ldi r22, 0x00 ; 0 2654a: 70 e0 ldi r23, 0x00 ; 0 2654c: 8a e7 ldi r24, 0x7A ; 122 2654e: 93 e4 ldi r25, 0x43 ; 67 26550: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 26554: a7 01 movw r20, r14 26556: 96 01 movw r18, r12 26558: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2655c: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 26560: 70 93 86 03 sts 0x0386, r23 ; 0x800386 26564: 60 93 85 03 sts 0x0385, r22 ; 0x800385 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 26568: 60 91 24 06 lds r22, 0x0624 ; 0x800624 2656c: 70 91 25 06 lds r23, 0x0625 ; 0x800625 26570: 07 2e mov r0, r23 26572: 00 0c add r0, r0 26574: 88 0b sbc r24, r24 26576: 99 0b sbc r25, r25 26578: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2657c: 6b 01 movw r12, r22 2657e: 7c 01 movw r14, r24 26580: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26584: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26588: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 2658c: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26590: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26594: 60 1b sub r22, r16 26596: 71 0b sbc r23, r17 26598: 82 0b sbc r24, r18 2659a: 93 0b sbc r25, r19 2659c: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 265a0: 9b 01 movw r18, r22 265a2: ac 01 movw r20, r24 265a4: 60 e0 ldi r22, 0x00 ; 0 265a6: 70 e0 ldi r23, 0x00 ; 0 265a8: 8a e7 ldi r24, 0x7A ; 122 265aa: 93 e4 ldi r25, 0x43 ; 67 265ac: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 265b0: a7 01 movw r20, r14 265b2: 96 01 movw r18, r12 265b4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 265b8: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 265bc: 70 93 88 03 sts 0x0388, r23 ; 0x800388 265c0: 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; 265c4: 10 92 23 06 sts 0x0623, r1 ; 0x800623 265c8: 10 92 22 06 sts 0x0622, r1 ; 0x800622 fan_edge_counter[1] = 0; 265cc: 10 92 25 06 sts 0x0625, r1 ; 0x800625 265d0: 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) 265d4: 83 e0 ldi r24, 0x03 ; 3 265d6: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 265d8: 82 e0 ldi r24, 0x02 ; 2 265da: 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) 265dc: 80 91 40 02 lds r24, 0x0240 ; 0x800240 265e0: 88 23 and r24, r24 265e2: 51 f0 breq .+20 ; 0x265f8 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 265e4: 87 e8 ldi r24, 0x87 ; 135 265e6: 9f e0 ldi r25, 0x0F ; 15 265e8: 0f 94 7d a0 call 0x340fa ; 0x340fa 265ec: 91 e0 ldi r25, 0x01 ; 1 265ee: 81 11 cpse r24, r1 265f0: 01 c0 rjmp .+2 ; 0x265f4 265f2: 90 e0 ldi r25, 0x00 ; 0 265f4: 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]++;} 265f8: 80 91 85 03 lds r24, 0x0385 ; 0x800385 265fc: 90 91 86 03 lds r25, 0x0386 ; 0x800386 26600: 44 97 sbiw r24, 0x14 ; 20 26602: 0c f0 brlt .+2 ; 0x26606 26604: f2 c0 rjmp .+484 ; 0x267ea 26606: 20 e0 ldi r18, 0x00 ; 0 26608: 30 e0 ldi r19, 0x00 ; 0 2660a: 48 e4 ldi r20, 0x48 ; 72 2660c: 52 e4 ldi r21, 0x42 ; 66 2660e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 26612: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 26616: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2661a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2661e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 26622: 18 16 cp r1, r24 26624: 0c f0 brlt .+2 ; 0x26628 26626: e1 c0 rjmp .+450 ; 0x267ea 26628: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 2662c: 8f 5f subi r24, 0xFF ; 255 2662e: 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){ 26632: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 26636: 81 11 cpse r24, r1 26638: 0b c0 rjmp .+22 ; 0x26650 2663a: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee 2663e: 81 11 cpse r24, r1 26640: 07 c0 rjmp .+14 ; 0x26650 26642: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 26646: 82 30 cpi r24, 0x02 ; 2 26648: 19 f4 brne .+6 ; 0x26650 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 2664a: 81 e0 ldi r24, 0x01 ; 1 2664c: 80 93 9c 03 sts 0x039C, r24 ; 0x80039c } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 26650: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 26654: 81 30 cpi r24, 0x01 ; 1 26656: 61 f4 brne .+24 ; 0x26670 26658: 0e 94 a4 61 call 0xc348 ; 0xc348 2665c: 81 11 cpse r24, r1 2665e: 08 c0 rjmp .+16 ; 0x26670 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 26660: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 26664: 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 26668: 8b e0 ldi r24, 0x0B ; 11 2666a: 9c e6 ldi r25, 0x6C ; 108 2666c: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 26670: 80 91 40 02 lds r24, 0x0240 ; 0x800240 26674: 88 23 and r24, r24 26676: 09 f4 brne .+2 ; 0x2667a 26678: d9 c0 rjmp .+434 ; 0x2682c 2667a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 2667e: 82 30 cpi r24, 0x02 ; 2 26680: 09 f4 brne .+2 ; 0x26684 26682: d4 c0 rjmp .+424 ; 0x2682c 26684: 8d ee ldi r24, 0xED ; 237 26686: e8 2e mov r14, r24 26688: 85 e0 ldi r24, 0x05 ; 5 2668a: f8 2e mov r15, r24 2668c: ce 01 movw r24, r28 2668e: 01 96 adiw r24, 0x01 ; 1 26690: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 26692: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 26694: 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]) 26696: f7 01 movw r30, r14 26698: 91 91 ld r25, Z+ 2669a: 7f 01 movw r14, r30 2669c: f6 01 movw r30, r12 2669e: 81 91 ld r24, Z+ 266a0: 6f 01 movw r12, r30 266a2: 89 17 cp r24, r25 266a4: 80 f5 brcc .+96 ; 0x26706 { fan_speed_errors[fan] = 0; 266a6: f7 01 movw r30, r14 266a8: 31 97 sbiw r30, 0x01 ; 1 266aa: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 266ac: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 266b0: 82 30 cpi r24, 0x02 ; 2 266b2: 49 f1 breq .+82 ; 0x26706 fan_check_error = EFCE_REPORTED; 266b4: 00 93 9c 03 sts 0x039C, r16 ; 0x80039c if (printJobOngoing()) { 266b8: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 266bc: 88 23 and r24, r24 266be: 09 f4 brne .+2 ; 0x266c2 266c0: 9a c0 rjmp .+308 ; 0x267f6 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 266c2: 0e 94 48 61 call 0xc290 ; 0xc290 266c6: 81 11 cpse r24, r1 266c8: 07 c0 rjmp .+14 ; 0x266d8 if (usb_timer.running()) 266ca: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 266ce: 88 23 and r24, r24 266d0: 09 f4 brne .+2 ; 0x266d4 266d2: 8e c0 rjmp .+284 ; 0x267f0 lcd_pause_usb_print(); 266d4: 0f 94 fb 03 call 0x207f6 ; 0x207f6 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 266d8: 11 30 cpi r17, 0x01 ; 1 266da: 09 f4 brne .+2 ; 0x266de 266dc: 93 c0 rjmp .+294 ; 0x26804 //! 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); 266de: 88 e2 ldi r24, 0x28 ; 40 266e0: 93 e9 ldi r25, 0x93 ; 147 266e2: 0e 94 de 72 call 0xe5bc ; 0xe5bc if (get_message_level() == 0) { 266e6: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 266ea: 81 11 cpse r24, r1 266ec: 0c c0 rjmp .+24 ; 0x26706 Sound_MakeCustom(200,0,true); 266ee: 41 e0 ldi r20, 0x01 ; 1 266f0: 70 e0 ldi r23, 0x00 ; 0 266f2: 60 e0 ldi r22, 0x00 ; 0 266f4: 88 ec ldi r24, 0xC8 ; 200 266f6: 90 e0 ldi r25, 0x00 ; 0 266f8: 0f 94 61 31 call 0x262c2 ; 0x262c2 LCD_ALERTMESSAGERPGM(lcdMsg); 266fc: 62 e0 ldi r22, 0x02 ; 2 266fe: 8f e0 ldi r24, 0x0F ; 15 26700: 98 e6 ldi r25, 0x68 ; 104 26702: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 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++) 26706: 11 30 cpi r17, 0x01 ; 1 26708: 09 f4 brne .+2 ; 0x2670c 2670a: 90 c0 rjmp .+288 ; 0x2682c 2670c: 11 e0 ldi r17, 0x01 ; 1 2670e: c3 cf rjmp .-122 ; 0x26696 case TempErrorSource::hotend: if(temp_error_state.assert) { 26710: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26714: 81 ff sbrs r24, 1 26716: 12 c0 rjmp .+36 ; 0x2673c min_temp_error(temp_error_state.index); 26718: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 2671c: 62 95 swap r22 2671e: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 26720: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 26724: 81 11 cpse r24, r1 26726: 07 c0 rjmp .+14 ; 0x26736 temp_error_messagepgm(err, e); 26728: 83 e8 ldi r24, 0x83 ; 131 2672a: 93 e9 ldi r25, 0x93 ; 147 2672c: 0f 94 81 11 call 0x22302 ; 0x22302 prusa_statistics(92); 26730: 8c e5 ldi r24, 0x5C ; 92 26732: 0f 94 a0 98 call 0x33140 ; 0x33140 } ThermalStop(); 26736: 0f 94 d3 42 call 0x285a6 ; 0x285a6 2673a: a2 ce rjmp .-700 ; 0x26480 // 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); 2673c: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.422> 26740: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.422+0x1> 26744: 6b 5f subi r22, 0xFB ; 251 26746: 7f 4f sbci r23, 0xFF ; 255 26748: 07 2e mov r0, r23 2674a: 00 0c add r0, r0 2674c: 88 0b sbc r24, r24 2674e: 99 0b sbc r25, r25 26750: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 26754: 8b 01 movw r16, r22 26756: 9c 01 movw r18, r24 26758: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 2675c: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 26760: 60 91 c6 0d lds r22, 0x0DC6 ; 0x800dc6 26764: 70 91 c7 0d lds r23, 0x0DC7 ; 0x800dc7 26768: 8c e6 ldi r24, 0x6C ; 108 2676a: 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); 2676c: 0f 94 0e 09 call 0x2121c ; 0x2121c 26770: 87 ce rjmp .-754 ; 0x26480 // 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) { 26772: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 26776: 81 ff sbrs r24, 1 26778: 0a c0 rjmp .+20 ; 0x2678e ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 2677a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2677e: 81 11 cpse r24, r1 26780: da cf rjmp .-76 ; 0x26736 temp_error_messagepgm(err); 26782: 61 e0 ldi r22, 0x01 ; 1 26784: 87 e7 ldi r24, 0x77 ; 119 26786: 93 e9 ldi r25, 0x93 ; 147 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 26788: 0f 94 81 11 call 0x22302 ; 0x22302 2678c: d4 cf rjmp .-88 ; 0x26736 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); 2678e: 40 91 8a 03 lds r20, 0x038A ; 0x80038a 26792: 50 91 8b 03 lds r21, 0x038B ; 0x80038b 26796: 60 91 8c 03 lds r22, 0x038C ; 0x80038c 2679a: 70 91 8d 03 lds r23, 0x038D ; 0x80038d 2679e: 00 e0 ldi r16, 0x00 ; 0 267a0: 10 e0 ldi r17, 0x00 ; 0 267a2: 2c e0 ldi r18, 0x0C ; 12 267a4: 32 e4 ldi r19, 0x42 ; 66 267a6: 88 e6 ldi r24, 0x68 ; 104 267a8: 92 e0 ldi r25, 0x02 ; 2 267aa: e0 cf rjmp .-64 ; 0x2676c break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 267ac: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 267b0: 86 95 lsr r24 267b2: 86 95 lsr r24 267b4: 83 70 andi r24, 0x03 ; 3 267b6: 59 f0 breq .+22 ; 0x267ce 267b8: 81 30 cpi r24, 0x01 ; 1 267ba: 09 f0 breq .+2 ; 0x267be 267bc: 61 ce rjmp .-830 ; 0x26480 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 267be: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 267c2: 81 11 cpse r24, r1 267c4: b8 cf rjmp .-144 ; 0x26736 temp_error_messagepgm(PSTR("MAXTEMP BED")); 267c6: 61 e0 ldi r22, 0x01 ; 1 267c8: 83 e9 ldi r24, 0x93 ; 147 267ca: 93 e9 ldi r25, 0x93 ; 147 267cc: dd cf rjmp .-70 ; 0x26788 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 267ce: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.420> 267d2: 62 95 swap r22 267d4: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 267d6: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 267da: 81 11 cpse r24, r1 267dc: ac cf rjmp .-168 ; 0x26736 temp_error_messagepgm(PSTR("MAXTEMP"), e); 267de: 8b e8 ldi r24, 0x8B ; 139 267e0: 93 e9 ldi r25, 0x93 ; 147 267e2: 0f 94 81 11 call 0x22302 ; 0x22302 prusa_statistics(93); 267e6: 8d e5 ldi r24, 0x5D ; 93 267e8: a4 cf rjmp .-184 ; 0x26732 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; 267ea: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 267ee: 21 cf rjmp .-446 ; 0x26632 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 267f0: 0f 94 52 0f call 0x21ea4 ; 0x21ea4 267f4: 71 cf rjmp .-286 ; 0x266d8 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 267f6: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 267fa: 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; 267fe: 10 92 99 03 sts 0x0399, r1 ; 0x800399 26802: 6a cf rjmp .-300 ; 0x266d8 //! 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); 26804: 80 e5 ldi r24, 0x50 ; 80 26806: 93 e9 ldi r25, 0x93 ; 147 26808: 0e 94 de 72 call 0xe5bc ; 0xe5bc if (get_message_level() == 0) { 2680c: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.406> 26810: 81 11 cpse r24, r1 26812: 0c c0 rjmp .+24 ; 0x2682c Sound_MakeCustom(200,0,true); 26814: 41 e0 ldi r20, 0x01 ; 1 26816: 70 e0 ldi r23, 0x00 ; 0 26818: 60 e0 ldi r22, 0x00 ; 0 2681a: 88 ec ldi r24, 0xC8 ; 200 2681c: 90 e0 ldi r25, 0x00 ; 0 2681e: 0f 94 61 31 call 0x262c2 ; 0x262c2 LCD_ALERTMESSAGERPGM(lcdMsg); 26822: 62 e0 ldi r22, 0x02 ; 2 26824: 82 e6 ldi r24, 0x62 ; 98 26826: 9a e6 ldi r25, 0x6A ; 106 26828: 0e 94 fb e1 call 0x1c3f6 ; 0x1c3f6 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 2682c: 80 91 67 02 lds r24, 0x0267 ; 0x800267 26830: 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(); 26834: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26838: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 2683c: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 26840: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 26844: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = false; 26848: 10 92 84 03 sts 0x0384, r1 ; 0x800384 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 2684c: 0f 90 pop r0 2684e: 0f 90 pop r0 26850: df 91 pop r29 26852: cf 91 pop r28 26854: 1f 91 pop r17 26856: 0f 91 pop r16 26858: ff 90 pop r15 2685a: ef 90 pop r14 2685c: df 90 pop r13 2685e: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 26860: 0c 94 16 6f jmp 0xde2c ; 0xde2c 26864: 0f 90 pop r0 26866: 0f 90 pop r0 26868: df 91 pop r29 2686a: cf 91 pop r28 2686c: 1f 91 pop r17 2686e: 0f 91 pop r16 26870: ff 90 pop r15 26872: ef 90 pop r14 26874: df 90 pop r13 26876: cf 90 pop r12 26878: 08 95 ret 0002687a : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2687a: 4f 92 push r4 2687c: 5f 92 push r5 2687e: 6f 92 push r6 26880: 7f 92 push r7 26882: 8f 92 push r8 26884: 9f 92 push r9 26886: af 92 push r10 26888: bf 92 push r11 2688a: cf 92 push r12 2688c: df 92 push r13 2688e: ef 92 push r14 26890: ff 92 push r15 26892: 0f 93 push r16 26894: 1f 93 push r17 26896: cf 93 push r28 26898: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 2689a: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2689e: 28 ee ldi r18, 0xE8 ; 232 268a0: 33 e0 ldi r19, 0x03 ; 3 268a2: 40 e0 ldi r20, 0x00 ; 0 268a4: 50 e0 ldi r21, 0x00 ; 0 268a6: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 268aa: 69 01 movw r12, r18 268ac: 7a 01 movw r14, r20 lcd_consume_click(); 268ae: 0e 94 1e 6c call 0xd83c ; 0xd83c KEEPALIVE_STATE(PAUSED_FOR_USER); 268b2: 84 e0 ldi r24, 0x04 ; 4 268b4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 268b8: 88 ee ldi r24, 0xE8 ; 232 268ba: 88 2e mov r8, r24 268bc: 83 e0 ldi r24, 0x03 ; 3 268be: 98 2e mov r9, r24 268c0: a1 2c mov r10, r1 268c2: b1 2c mov r11, r1 268c4: 28 01 movw r4, r16 268c6: 71 2c mov r7, r1 268c8: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 268ca: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 268ce: 81 e0 ldi r24, 0x01 ; 1 268d0: 0e 94 8c 7a call 0xf518 ; 0xf518 bDelayed = ((_millis()/1000-nTime0) > nDelay); 268d4: 0f 94 46 0f call 0x21e8c ; 0x21e8c 268d8: a5 01 movw r20, r10 268da: 94 01 movw r18, r8 268dc: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 268e0: 2c 19 sub r18, r12 268e2: 3d 09 sbc r19, r13 268e4: 4e 09 sbc r20, r14 268e6: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 268e8: 42 16 cp r4, r18 268ea: 53 06 cpc r5, r19 268ec: 64 06 cpc r6, r20 268ee: 75 06 cpc r7, r21 268f0: 20 f4 brcc .+8 ; 0x268fa 268f2: c1 e0 ldi r28, 0x01 ; 1 268f4: 01 15 cp r16, r1 268f6: 11 05 cpc r17, r1 268f8: 09 f4 brne .+2 ; 0x268fc 268fa: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 268fc: 0e 94 23 6c call 0xd846 ; 0xd846 26900: 81 11 cpse r24, r1 26902: 02 c0 rjmp .+4 ; 0x26908 26904: cc 23 and r28, r28 26906: 09 f3 breq .-62 ; 0x268ca KEEPALIVE_STATE(IN_HANDLER); 26908: 82 e0 ldi r24, 0x02 ; 2 2690a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 2690e: 81 e0 ldi r24, 0x01 ; 1 26910: 8c 27 eor r24, r28 26912: cf 91 pop r28 26914: 1f 91 pop r17 26916: 0f 91 pop r16 26918: ff 90 pop r15 2691a: ef 90 pop r14 2691c: df 90 pop r13 2691e: cf 90 pop r12 26920: bf 90 pop r11 26922: af 90 pop r10 26924: 9f 90 pop r9 26926: 8f 90 pop r8 26928: 7f 90 pop r7 2692a: 6f 90 pop r6 2692c: 5f 90 pop r5 2692e: 4f 90 pop r4 26930: 08 95 ret 00026932 : // 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) { 26932: 9f 92 push r9 26934: af 92 push r10 26936: bf 92 push r11 26938: cf 92 push r12 2693a: df 92 push r13 2693c: ef 92 push r14 2693e: ff 92 push r15 26940: 0f 93 push r16 26942: 1f 93 push r17 26944: cf 93 push r28 26946: df 93 push r29 26948: 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; 2694a: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2694e: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 26952: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 26956: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2695a: 0f 94 d1 83 call 0x307a2 ; 0x307a2 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 2695e: 8d e4 ldi r24, 0x4D ; 77 26960: 9d e4 ldi r25, 0x4D ; 77 26962: 91 10 cpse r9, r1 26964: 02 c0 rjmp .+4 ; 0x2696a 26966: 8a ee ldi r24, 0xEA ; 234 26968: 9c e4 ldi r25, 0x4C ; 76 2696a: 0e 94 3c 6d call 0xda78 ; 0xda78 2696e: b8 2e mov r11, r24 26970: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 26972: 0f 94 92 0a call 0x21524 ; 0x21524 26976: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 26978: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2697c: 6b 01 movw r12, r22 2697e: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 26980: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26984: 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); 26988: 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(); 2698a: 0f 94 f7 31 call 0x263ee ; 0x263ee manage_inactivity(true); 2698e: 81 e0 ldi r24, 0x01 ; 1 26990: 0e 94 8c 7a call 0xf518 ; 0xf518 if (lcd_encoder) { 26994: 80 91 06 05 lds r24, 0x0506 ; 0x800506 26998: 90 91 07 05 lds r25, 0x0507 ; 0x800507 2699c: 89 2b or r24, r25 2699e: d9 f1 breq .+118 ; 0x26a16 _delay(50); 269a0: 62 e3 ldi r22, 0x32 ; 50 269a2: 70 e0 ldi r23, 0x00 ; 0 269a4: 80 e0 ldi r24, 0x00 ; 0 269a6: 90 e0 ldi r25, 0x00 ; 0 269a8: 0f 94 4d 0d call 0x21a9a ; 0x21a9a 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; 269ac: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 269b0: 8f 5f subi r24, 0xFF ; 255 269b2: 80 31 cpi r24, 0x10 ; 16 269b4: 09 f4 brne .+2 ; 0x269b8 next_block_index = 0; 269b6: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 269b8: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) { 269bc: 98 17 cp r25, r24 269be: 59 f1 breq .+86 ; 0x26a16 // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 269c0: 60 91 06 05 lds r22, 0x0506 ; 0x800506 269c4: 70 91 07 05 lds r23, 0x0507 ; 0x800507 269c8: 77 ff sbrs r23, 7 269ca: 03 c0 rjmp .+6 ; 0x269d2 269cc: 71 95 neg r23 269ce: 61 95 neg r22 269d0: 71 09 sbc r23, r1 269d2: 07 2e mov r0, r23 269d4: 00 0c add r0, r0 269d6: 88 0b sbc r24, r24 269d8: 99 0b sbc r25, r25 269da: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 269de: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 269e2: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 269e6: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 269ea: 50 91 00 12 lds r21, 0x1200 ; 0x801200 269ee: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 269f2: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 269f6: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 269fa: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 269fe: 90 93 00 12 sts 0x1200, r25 ; 0x801200 lcd_encoder = 0; 26a02: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26a06: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 26a0a: 65 e5 ldi r22, 0x55 ; 85 26a0c: 75 e5 ldi r23, 0x55 ; 85 26a0e: 85 e8 ldi r24, 0x85 ; 133 26a10: 91 e4 ldi r25, 0x41 ; 65 26a12: 0f 94 11 85 call 0x30a22 ; 0x30a22 } } if (lcd_clicked()) { 26a16: 0e 94 23 6c call 0xd846 ; 0xd846 26a1a: 88 23 and r24, r24 26a1c: c9 f1 breq .+114 ; 0x26a90 // Abort a move if in progress. planner_abort_hard(); 26a1e: 0f 94 8b 86 call 0x30d16 ; 0x30d16 planner_aborted = false; 26a22: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac while (lcd_clicked()) ; 26a26: 0e 94 23 6c call 0xd846 ; 0xd846 26a2a: 81 11 cpse r24, r1 26a2c: fc cf rjmp .-8 ; 0x26a26 _delay(10); 26a2e: 6a e0 ldi r22, 0x0A ; 10 26a30: 70 e0 ldi r23, 0x00 ; 0 26a32: 80 e0 ldi r24, 0x00 ; 0 26a34: 90 e0 ldi r25, 0x00 ; 0 26a36: 0f 94 4d 0d call 0x21a9a ; 0x21a9a while (lcd_clicked()) ; 26a3a: 0e 94 23 6c call 0xd846 ; 0xd846 26a3e: 81 11 cpse r24, r1 26a40: fc cf rjmp .-8 ; 0x26a3a 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); 26a42: 81 ec ldi r24, 0xC1 ; 193 26a44: 9c e4 ldi r25, 0x4C ; 76 26a46: 0e 94 3c 6d call 0xda78 ; 0xda78 26a4a: 41 e0 ldi r20, 0x01 ; 1 26a4c: 60 e0 ldi r22, 0x00 ; 0 26a4e: 0f 94 89 2d call 0x25b12 ; 0x25b12 if (result == LCD_BUTTON_TIMEOUT) 26a52: 8f 3f cpi r24, 0xFF ; 255 26a54: d1 f1 breq .+116 ; 0x26aca goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 26a56: 81 11 cpse r24, r1 26a58: 82 cf rjmp .-252 ; 0x2695e // 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; 26a5a: 80 e0 ldi r24, 0x00 ; 0 26a5c: 90 e0 ldi r25, 0x00 ; 0 26a5e: a6 e5 ldi r26, 0x56 ; 86 26a60: b3 e4 ldi r27, 0x43 ; 67 26a62: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 26a66: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 26a6a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 26a6e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 } plan_set_position_curposXYZE(); 26a72: 0f 94 d1 83 call 0x307a2 ; 0x307a2 return true; 26a76: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 26a78: df 91 pop r29 26a7a: cf 91 pop r28 26a7c: 1f 91 pop r17 26a7e: 0f 91 pop r16 26a80: ff 90 pop r15 26a82: ef 90 pop r14 26a84: df 90 pop r13 26a86: cf 90 pop r12 26a88: bf 90 pop r11 26a8a: af 90 pop r10 26a8c: 9f 90 pop r9 26a8e: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 26a90: 01 15 cp r16, r1 26a92: 11 05 cpc r17, r1 26a94: 09 f4 brne .+2 ; 0x26a98 26a96: 79 cf rjmp .-270 ; 0x2698a 26a98: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26a9c: 6c 19 sub r22, r12 26a9e: 7d 09 sbc r23, r13 26aa0: 8e 09 sbc r24, r14 26aa2: 9f 09 sbc r25, r15 26aa4: 69 38 cpi r22, 0x89 ; 137 26aa6: 73 41 sbci r23, 0x13 ; 19 26aa8: 81 05 cpc r24, r1 26aaa: 91 05 cpc r25, r1 26aac: 08 f4 brcc .+2 ; 0x26ab0 26aae: 6d cf rjmp .-294 ; 0x2698a if (msg_next == NULL) 26ab0: 20 97 sbiw r28, 0x00 ; 0 26ab2: 11 f4 brne .+4 ; 0x26ab8 msg_next = msg; 26ab4: cb 2d mov r28, r11 26ab6: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 26ab8: ce 01 movw r24, r28 26aba: 0f 94 92 0a call 0x21524 ; 0x21524 26abe: ec 01 movw r28, r24 previous_millis_msg = _millis(); 26ac0: 0f 94 46 0f call 0x21e8c ; 0x21e8c 26ac4: 6b 01 movw r12, r22 26ac6: 7c 01 movw r14, r24 26ac8: 60 cf rjmp .-320 ; 0x2698a } plan_set_position_curposXYZE(); return true; canceled: return false; 26aca: 80 e0 ldi r24, 0x00 ; 0 26acc: d5 cf rjmp .-86 ; 0x26a78 00026ace : /// 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() { 26ace: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 26ad0: c0 91 15 04 lds r28, 0x0415 ; 0x800415 26ad4: c2 30 cpi r28, 0x02 ; 2 26ad6: 59 f1 breq .+86 ; 0x26b2e // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 26ad8: c1 30 cpi r28, 0x01 ; 1 26ada: 69 f4 brne .+26 ; 0x26af6 if (bFirst) return; 26adc: 80 91 2e 05 lds r24, 0x052E ; 0x80052e <_ZL6bFirst.lto_priv.455> 26ae0: 81 11 cpse r24, r1 26ae2: 25 c0 rjmp .+74 ; 0x26b2e Sound_MakeCustom(80, 0, false); 26ae4: 40 e0 ldi r20, 0x00 ; 0 26ae6: 70 e0 ldi r23, 0x00 ; 0 26ae8: 60 e0 ldi r22, 0x00 ; 0 26aea: 80 e5 ldi r24, 0x50 ; 80 26aec: 90 e0 ldi r25, 0x00 ; 0 26aee: 0f 94 61 31 call 0x262c2 ; 0x262c2 bFirst = true; 26af2: 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)) { 26af6: 60 ed ldi r22, 0xD0 ; 208 26af8: 77 e0 ldi r23, 0x07 ; 7 26afa: 8b e2 ldi r24, 0x2B ; 43 26afc: 95 e0 ldi r25, 0x05 ; 5 26afe: 0f 94 a1 0f call 0x21f42 ; 0x21f42 ::expired_cont(unsigned short)> 26b02: 88 23 and r24, r24 26b04: a1 f0 breq .+40 ; 0x26b2e beep_timer.start(); 26b06: 8b e2 ldi r24, 0x2B ; 43 26b08: 95 e0 ldi r25, 0x05 ; 5 26b0a: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 26b0e: 80 91 15 04 lds r24, 0x0415 ; 0x800415 26b12: 81 11 cpse r24, r1 26b14: 08 c0 rjmp .+16 ; 0x26b26 Sound_MakeCustom(80, 0, false); 26b16: 40 e0 ldi r20, 0x00 ; 0 26b18: 70 e0 ldi r23, 0x00 ; 0 26b1a: 60 e0 ldi r22, 0x00 ; 0 26b1c: 80 e5 ldi r24, 0x50 ; 80 26b1e: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 26b20: 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); 26b22: 0d 94 61 31 jmp 0x262c2 ; 0x262c2 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 26b26: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 26b28: 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); 26b2a: 0d 94 71 2c jmp 0x258e2 ; 0x258e2 } } #endif // BEEPER > 0 } 26b2e: cf 91 pop r28 26b30: 08 95 ret 00026b32 : { #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; 26b32: 98 b1 in r25, 0x08 ; 8 26b34: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 26b36: 89 2b or r24, r25 26b38: 88 b9 out 0x08, r24 ; 8 asm("nop"); 26b3a: 00 00 nop PORTC = portC; //set step signals to zero 26b3c: 98 b9 out 0x08, r25 ; 8 asm("nop"); 26b3e: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 26b40: 08 95 ret 00026b42 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 26b42: 82 30 cpi r24, 0x02 ; 2 26b44: b9 f0 breq .+46 ; 0x26b74 26b46: 83 30 cpi r24, 0x03 ; 3 26b48: e9 f0 breq .+58 ; 0x26b84 26b4a: 81 30 cpi r24, 0x01 ; 1 26b4c: 59 f0 breq .+22 ; 0x26b64 { #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; 26b4e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26b52: 61 11 cpse r22, r1 26b54: 05 c0 rjmp .+10 ; 0x26b60 26b56: 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; 26b58: 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"); 26b5c: 00 00 nop } 26b5e: 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; 26b60: 8d 7f andi r24, 0xFD ; 253 26b62: fa cf rjmp .-12 ; 0x26b58 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 26b64: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26b68: 61 11 cpse r22, r1 26b6a: 02 c0 rjmp .+4 ; 0x26b70 26b6c: 81 60 ori r24, 0x01 ; 1 26b6e: f4 cf rjmp .-24 ; 0x26b58 26b70: 8e 7f andi r24, 0xFE ; 254 26b72: f2 cf rjmp .-28 ; 0x26b58 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 26b74: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26b78: 61 11 cpse r22, r1 26b7a: 02 c0 rjmp .+4 ; 0x26b80 26b7c: 84 60 ori r24, 0x04 ; 4 26b7e: ec cf rjmp .-40 ; 0x26b58 26b80: 8b 7f andi r24, 0xFB ; 251 26b82: ea cf rjmp .-44 ; 0x26b58 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 26b84: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26b88: 61 30 cpi r22, 0x01 ; 1 26b8a: 11 f4 brne .+4 ; 0x26b90 26b8c: 80 64 ori r24, 0x40 ; 64 26b8e: e4 cf rjmp .-56 ; 0x26b58 26b90: 8f 7b andi r24, 0xBF ; 191 26b92: e2 cf rjmp .-60 ; 0x26b58 00026b94 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 26b94: cf 93 push r28 if (cacheDirty_) { 26b96: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 26b9a: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 26b9c: 88 23 and r24, r24 26b9e: a1 f0 breq .+40 ; 0x26bc8 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 26ba0: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26ba4: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26ba8: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26bac: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26bb0: 29 ed ldi r18, 0xD9 ; 217 26bb2: 3d e0 ldi r19, 0x0D ; 13 26bb4: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26bb8: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26bbc: 0f 94 f0 70 call 0x2e1e0 ; 0x2e1e0 26bc0: c8 2f mov r28, r24 26bc2: 81 11 cpse r24, r1 26bc4: 04 c0 rjmp .+8 ; 0x26bce cacheDirty_ = 0; } return true; fail: return false; 26bc6: c0 e0 ldi r28, 0x00 ; 0 } 26bc8: 8c 2f mov r24, r28 26bca: cf 91 pop r28 26bcc: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 26bce: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 26bd2: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 26bd6: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 26bda: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 26bde: 41 15 cp r20, r1 26be0: 51 05 cpc r21, r1 26be2: 61 05 cpc r22, r1 26be4: 71 05 cpc r23, r1 26be6: 91 f0 breq .+36 ; 0x26c0c if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 26be8: 29 ed ldi r18, 0xD9 ; 217 26bea: 3d e0 ldi r19, 0x0D ; 13 26bec: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26bf0: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26bf4: 0f 94 f0 70 call 0x2e1e0 ; 0x2e1e0 26bf8: 88 23 and r24, r24 26bfa: 29 f3 breq .-54 ; 0x26bc6 goto fail; } cacheMirrorBlock_ = 0; 26bfc: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 26c00: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 26c04: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 26c08: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 } cacheDirty_ = 0; 26c0c: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 26c10: db cf rjmp .-74 ; 0x26bc8 00026c12 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 26c12: cf 92 push r12 26c14: df 92 push r13 26c16: ef 92 push r14 26c18: ff 92 push r15 26c1a: cf 93 push r28 26c1c: 6b 01 movw r12, r22 26c1e: 7c 01 movw r14, r24 26c20: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 26c22: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 26c26: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 26c2a: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 26c2e: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 26c32: 8c 15 cp r24, r12 26c34: 9d 05 cpc r25, r13 26c36: ae 05 cpc r26, r14 26c38: bf 05 cpc r27, r15 26c3a: 01 f1 breq .+64 ; 0x26c7c if (!cacheFlush()) goto fail; 26c3c: 0f 94 ca 35 call 0x26b94 ; 0x26b94 26c40: 81 11 cpse r24, r1 26c42: 08 c0 rjmp .+16 ; 0x26c54 } if (dirty) cacheDirty_ = true; return true; fail: return false; 26c44: c0 e0 ldi r28, 0x00 ; 0 } 26c46: 8c 2f mov r24, r28 26c48: cf 91 pop r28 26c4a: ff 90 pop r15 26c4c: ef 90 pop r14 26c4e: df 90 pop r13 26c50: cf 90 pop r12 26c52: 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; 26c54: 29 ed ldi r18, 0xD9 ; 217 26c56: 3d e0 ldi r19, 0x0D ; 13 26c58: b7 01 movw r22, r14 26c5a: a6 01 movw r20, r12 26c5c: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26c60: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26c64: 0f 94 54 71 call 0x2e2a8 ; 0x2e2a8 26c68: 88 23 and r24, r24 26c6a: 61 f3 breq .-40 ; 0x26c44 cacheBlockNumber_ = blockNumber; 26c6c: c0 92 cd 0d sts 0x0DCD, r12 ; 0x800dcd 26c70: d0 92 ce 0d sts 0x0DCE, r13 ; 0x800dce 26c74: e0 92 cf 0d sts 0x0DCF, r14 ; 0x800dcf 26c78: f0 92 d0 0d sts 0x0DD0, r15 ; 0x800dd0 } if (dirty) cacheDirty_ = true; 26c7c: cc 23 and r28, r28 26c7e: 21 f0 breq .+8 ; 0x26c88 26c80: 81 e0 ldi r24, 0x01 ; 1 26c82: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 26c86: df cf rjmp .-66 ; 0x26c46 return true; 26c88: c1 e0 ldi r28, 0x01 ; 1 26c8a: dd cf rjmp .-70 ; 0x26c46 00026c8c : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 26c8c: 4f 92 push r4 26c8e: 5f 92 push r5 26c90: 6f 92 push r6 26c92: 7f 92 push r7 26c94: 8f 92 push r8 26c96: 9f 92 push r9 26c98: af 92 push r10 26c9a: bf 92 push r11 26c9c: cf 92 push r12 26c9e: df 92 push r13 26ca0: ef 92 push r14 26ca2: ff 92 push r15 26ca4: 0f 93 push r16 26ca6: 1f 93 push r17 26ca8: cf 93 push r28 26caa: df 93 push r29 26cac: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 26cae: 42 30 cpi r20, 0x02 ; 2 26cb0: 51 05 cpc r21, r1 26cb2: 61 05 cpc r22, r1 26cb4: 71 05 cpc r23, r1 26cb6: 90 f4 brcc .+36 ; 0x26cdc // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 26cb8: 80 e0 ldi r24, 0x00 ; 0 } 26cba: df 91 pop r29 26cbc: cf 91 pop r28 26cbe: 1f 91 pop r17 26cc0: 0f 91 pop r16 26cc2: ff 90 pop r15 26cc4: ef 90 pop r14 26cc6: df 90 pop r13 26cc8: cf 90 pop r12 26cca: bf 90 pop r11 26ccc: af 90 pop r10 26cce: 9f 90 pop r9 26cd0: 8f 90 pop r8 26cd2: 7f 90 pop r7 26cd4: 6f 90 pop r6 26cd6: 5f 90 pop r5 26cd8: 4f 90 pop r4 26cda: 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; 26cdc: 89 85 ldd r24, Y+9 ; 0x09 26cde: 9a 85 ldd r25, Y+10 ; 0x0a 26ce0: ab 85 ldd r26, Y+11 ; 0x0b 26ce2: bc 85 ldd r27, Y+12 ; 0x0c 26ce4: 01 96 adiw r24, 0x01 ; 1 26ce6: a1 1d adc r26, r1 26ce8: b1 1d adc r27, r1 26cea: 84 17 cp r24, r20 26cec: 95 07 cpc r25, r21 26cee: a6 07 cpc r26, r22 26cf0: b7 07 cpc r27, r23 26cf2: 10 f3 brcs .-60 ; 0x26cb8 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 26cf4: 8f 89 ldd r24, Y+23 ; 0x17 26cf6: 80 31 cpi r24, 0x10 ; 16 26cf8: c9 f5 brne .+114 ; 0x26d6c lba = fatStartBlock_ + (cluster >> 8); 26cfa: 85 2e mov r8, r21 26cfc: 96 2e mov r9, r22 26cfe: a7 2e mov r10, r23 26d00: bb 24 eor r11, r11 26d02: 8b 89 ldd r24, Y+19 ; 0x13 26d04: 9c 89 ldd r25, Y+20 ; 0x14 26d06: ad 89 ldd r26, Y+21 ; 0x15 26d08: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26d0a: 88 0e add r8, r24 26d0c: 99 1e adc r9, r25 26d0e: aa 1e adc r10, r26 26d10: bb 1e adc r11, r27 26d12: 28 01 movw r4, r16 26d14: 39 01 movw r6, r18 26d16: 6a 01 movw r12, r20 26d18: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 26d1a: 41 e0 ldi r20, 0x01 ; 1 26d1c: c5 01 movw r24, r10 26d1e: b4 01 movw r22, r8 26d20: 0f 94 09 36 call 0x26c12 ; 0x26c12 26d24: 88 23 and r24, r24 26d26: 41 f2 breq .-112 ; 0x26cb8 // store entry if (fatType_ == 16) { 26d28: 9f 89 ldd r25, Y+23 ; 0x17 26d2a: 90 31 cpi r25, 0x10 ; 16 26d2c: 81 f5 brne .+96 ; 0x26d8e cacheBuffer_.fat16[cluster & 0XFF] = value; 26d2e: dd 24 eor r13, r13 26d30: ee 24 eor r14, r14 26d32: ff 24 eor r15, r15 26d34: f6 01 movw r30, r12 26d36: ee 0f add r30, r30 26d38: ff 1f adc r31, r31 26d3a: e7 52 subi r30, 0x27 ; 39 26d3c: f2 4f sbci r31, 0xF2 ; 242 26d3e: 11 83 std Z+1, r17 ; 0x01 26d40: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 26d42: 9a 89 ldd r25, Y+18 ; 0x12 26d44: 92 30 cpi r25, 0x02 ; 2 26d46: 08 f4 brcc .+2 ; 0x26d4a 26d48: b8 cf rjmp .-144 ; 0x26cba 26d4a: 4d 81 ldd r20, Y+5 ; 0x05 26d4c: 5e 81 ldd r21, Y+6 ; 0x06 26d4e: 6f 81 ldd r22, Y+7 ; 0x07 26d50: 78 85 ldd r23, Y+8 ; 0x08 26d52: 84 0e add r8, r20 26d54: 95 1e adc r9, r21 26d56: a6 1e adc r10, r22 26d58: b7 1e adc r11, r23 26d5a: 80 92 d1 0d sts 0x0DD1, r8 ; 0x800dd1 26d5e: 90 92 d2 0d sts 0x0DD2, r9 ; 0x800dd2 26d62: a0 92 d3 0d sts 0x0DD3, r10 ; 0x800dd3 26d66: b0 92 d4 0d sts 0x0DD4, r11 ; 0x800dd4 26d6a: a7 cf rjmp .-178 ; 0x26cba cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26d6c: 80 32 cpi r24, 0x20 ; 32 26d6e: 09 f0 breq .+2 ; 0x26d72 26d70: a3 cf rjmp .-186 ; 0x26cb8 lba = fatStartBlock_ + (cluster >> 7); 26d72: 8b 89 ldd r24, Y+19 ; 0x13 26d74: 9c 89 ldd r25, Y+20 ; 0x14 26d76: ad 89 ldd r26, Y+21 ; 0x15 26d78: be 89 ldd r27, Y+22 ; 0x16 26d7a: 4a 01 movw r8, r20 26d7c: 5b 01 movw r10, r22 26d7e: e7 e0 ldi r30, 0x07 ; 7 26d80: b6 94 lsr r11 26d82: a7 94 ror r10 26d84: 97 94 ror r9 26d86: 87 94 ror r8 26d88: ea 95 dec r30 26d8a: d1 f7 brne .-12 ; 0x26d80 26d8c: be cf rjmp .-132 ; 0x26d0a if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 26d8e: e8 94 clt 26d90: c7 f8 bld r12, 7 26d92: dd 24 eor r13, r13 26d94: ee 24 eor r14, r14 26d96: ff 24 eor r15, r15 26d98: f6 01 movw r30, r12 26d9a: ee 0f add r30, r30 26d9c: ff 1f adc r31, r31 26d9e: ee 0f add r30, r30 26da0: ff 1f adc r31, r31 26da2: e7 52 subi r30, 0x27 ; 39 26da4: f2 4f sbci r31, 0xF2 ; 242 26da6: 40 82 st Z, r4 26da8: 51 82 std Z+1, r5 ; 0x01 26daa: 62 82 std Z+2, r6 ; 0x02 26dac: 73 82 std Z+3, r7 ; 0x03 26dae: c9 cf rjmp .-110 ; 0x26d42 00026db0 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 26db0: cf 92 push r12 26db2: df 92 push r13 26db4: ef 92 push r14 26db6: ff 92 push r15 26db8: 0f 93 push r16 26dba: 1f 93 push r17 26dbc: cf 93 push r28 26dbe: df 93 push r29 26dc0: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 26dc2: 81 85 ldd r24, Z+9 ; 0x09 26dc4: 92 85 ldd r25, Z+10 ; 0x0a 26dc6: a3 85 ldd r26, Z+11 ; 0x0b 26dc8: b4 85 ldd r27, Z+12 ; 0x0c 26dca: 01 96 adiw r24, 0x01 ; 1 26dcc: a1 1d adc r26, r1 26dce: b1 1d adc r27, r1 26dd0: 84 17 cp r24, r20 26dd2: 95 07 cpc r25, r21 26dd4: a6 07 cpc r26, r22 26dd6: b7 07 cpc r27, r23 26dd8: 50 f4 brcc .+20 ; 0x26dee *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 26dda: 80 e0 ldi r24, 0x00 ; 0 } 26ddc: df 91 pop r29 26dde: cf 91 pop r28 26de0: 1f 91 pop r17 26de2: 0f 91 pop r16 26de4: ff 90 pop r15 26de6: ef 90 pop r14 26de8: df 90 pop r13 26dea: cf 90 pop r12 26dec: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 26dee: 87 89 ldd r24, Z+23 ; 0x17 26df0: 80 31 cpi r24, 0x10 ; 16 26df2: a9 f5 brne .+106 ; 0x26e5e lba = fatStartBlock_ + (cluster >> 8); 26df4: bb 27 eor r27, r27 26df6: a7 2f mov r26, r23 26df8: 96 2f mov r25, r22 26dfa: 85 2f mov r24, r21 26dfc: c3 88 ldd r12, Z+19 ; 0x13 26dfe: d4 88 ldd r13, Z+20 ; 0x14 26e00: e5 88 ldd r14, Z+21 ; 0x15 26e02: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26e04: 8c 0d add r24, r12 26e06: 9d 1d adc r25, r13 26e08: ae 1d adc r26, r14 26e0a: bf 1d adc r27, r15 26e0c: e9 01 movw r28, r18 26e0e: 6a 01 movw r12, r20 26e10: 7b 01 movw r14, r22 26e12: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 26e14: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26e18: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26e1c: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26e20: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26e24: 84 17 cp r24, r20 26e26: 95 07 cpc r25, r21 26e28: a6 07 cpc r26, r22 26e2a: b7 07 cpc r27, r23 26e2c: 49 f5 brne .+82 ; 0x26e80 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 26e2e: f8 01 movw r30, r16 26e30: 87 89 ldd r24, Z+23 ; 0x17 26e32: 80 31 cpi r24, 0x10 ; 16 26e34: 69 f5 brne .+90 ; 0x26e90 *value = cacheBuffer_.fat16[cluster & 0XFF]; 26e36: b7 01 movw r22, r14 26e38: a6 01 movw r20, r12 26e3a: 55 27 eor r21, r21 26e3c: 66 27 eor r22, r22 26e3e: 77 27 eor r23, r23 26e40: 44 0f add r20, r20 26e42: 55 1f adc r21, r21 26e44: 47 52 subi r20, 0x27 ; 39 26e46: 52 4f sbci r21, 0xF2 ; 242 26e48: fa 01 movw r30, r20 26e4a: 80 81 ld r24, Z 26e4c: 91 81 ldd r25, Z+1 ; 0x01 26e4e: b0 e0 ldi r27, 0x00 ; 0 26e50: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 26e52: 88 83 st Y, r24 26e54: 99 83 std Y+1, r25 ; 0x01 26e56: aa 83 std Y+2, r26 ; 0x02 26e58: bb 83 std Y+3, r27 ; 0x03 26e5a: 81 e0 ldi r24, 0x01 ; 1 26e5c: bf cf rjmp .-130 ; 0x26ddc *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26e5e: 80 32 cpi r24, 0x20 ; 32 26e60: 09 f0 breq .+2 ; 0x26e64 26e62: bb cf rjmp .-138 ; 0x26dda lba = fatStartBlock_ + (cluster >> 7); 26e64: c3 88 ldd r12, Z+19 ; 0x13 26e66: d4 88 ldd r13, Z+20 ; 0x14 26e68: e5 88 ldd r14, Z+21 ; 0x15 26e6a: f6 88 ldd r15, Z+22 ; 0x16 26e6c: db 01 movw r26, r22 26e6e: ca 01 movw r24, r20 26e70: c7 e0 ldi r28, 0x07 ; 7 26e72: b6 95 lsr r27 26e74: a7 95 ror r26 26e76: 97 95 ror r25 26e78: 87 95 ror r24 26e7a: ca 95 dec r28 26e7c: d1 f7 brne .-12 ; 0x26e72 26e7e: c2 cf rjmp .-124 ; 0x26e04 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 26e80: 40 e0 ldi r20, 0x00 ; 0 26e82: bc 01 movw r22, r24 26e84: cd 01 movw r24, r26 26e86: 0f 94 09 36 call 0x26c12 ; 0x26c12 26e8a: 81 11 cpse r24, r1 26e8c: d0 cf rjmp .-96 ; 0x26e2e 26e8e: a5 cf rjmp .-182 ; 0x26dda } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 26e90: b7 01 movw r22, r14 26e92: a6 01 movw r20, r12 26e94: 4f 77 andi r20, 0x7F ; 127 26e96: 55 27 eor r21, r21 26e98: 66 27 eor r22, r22 26e9a: 77 27 eor r23, r23 26e9c: 44 0f add r20, r20 26e9e: 55 1f adc r21, r21 26ea0: 44 0f add r20, r20 26ea2: 55 1f adc r21, r21 26ea4: 47 52 subi r20, 0x27 ; 39 26ea6: 52 4f sbci r21, 0xF2 ; 242 26ea8: fa 01 movw r30, r20 26eaa: 80 81 ld r24, Z 26eac: 91 81 ldd r25, Z+1 ; 0x01 26eae: a2 81 ldd r26, Z+2 ; 0x02 26eb0: b3 81 ldd r27, Z+3 ; 0x03 26eb2: bf 70 andi r27, 0x0F ; 15 26eb4: ce cf rjmp .-100 ; 0x26e52 00026eb6 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 26eb6: 4f 92 push r4 26eb8: 5f 92 push r5 26eba: 6f 92 push r6 26ebc: 7f 92 push r7 26ebe: af 92 push r10 26ec0: bf 92 push r11 26ec2: cf 92 push r12 26ec4: df 92 push r13 26ec6: ef 92 push r14 26ec8: ff 92 push r15 26eca: 0f 93 push r16 26ecc: 1f 93 push r17 26ece: cf 93 push r28 26ed0: df 93 push r29 26ed2: 00 d0 rcall .+0 ; 0x26ed4 26ed4: 1f 92 push r1 26ed6: cd b7 in r28, 0x3d ; 61 26ed8: de b7 in r29, 0x3e ; 62 26eda: 8c 01 movw r16, r24 26edc: 49 83 std Y+1, r20 ; 0x01 26ede: 5a 83 std Y+2, r21 ; 0x02 26ee0: 6b 83 std Y+3, r22 ; 0x03 26ee2: 7c 83 std Y+4, r23 ; 0x04 26ee4: 59 01 movw r10, r18 uint32_t s = 0; 26ee6: c1 2c mov r12, r1 26ee8: d1 2c mov r13, r1 26eea: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 26eec: 41 2c mov r4, r1 26eee: 82 e0 ldi r24, 0x02 ; 2 26ef0: 58 2e mov r5, r24 26ef2: 61 2c mov r6, r1 26ef4: 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; 26ef6: 49 81 ldd r20, Y+1 ; 0x01 26ef8: 5a 81 ldd r21, Y+2 ; 0x02 26efa: 6b 81 ldd r22, Y+3 ; 0x03 26efc: 7c 81 ldd r23, Y+4 ; 0x04 26efe: 9e 01 movw r18, r28 26f00: 2f 5f subi r18, 0xFF ; 255 26f02: 3f 4f sbci r19, 0xFF ; 255 26f04: c8 01 movw r24, r16 26f06: 0f 94 d8 36 call 0x26db0 ; 0x26db0 26f0a: 88 23 and r24, r24 26f0c: 19 f1 breq .+70 ; 0x26f54 s += 512UL << clusterSizeShift_; 26f0e: f8 01 movw r30, r16 26f10: 85 85 ldd r24, Z+13 ; 0x0d 26f12: a3 01 movw r20, r6 26f14: 92 01 movw r18, r4 26f16: 04 c0 rjmp .+8 ; 0x26f20 26f18: 22 0f add r18, r18 26f1a: 33 1f adc r19, r19 26f1c: 44 1f adc r20, r20 26f1e: 55 1f adc r21, r21 26f20: 8a 95 dec r24 26f22: d2 f7 brpl .-12 ; 0x26f18 26f24: da 01 movw r26, r20 26f26: c9 01 movw r24, r18 26f28: c8 0e add r12, r24 26f2a: d9 1e adc r13, r25 26f2c: ea 1e adc r14, r26 26f2e: fb 1e adc r15, r27 } while (!isEOC(cluster)); 26f30: 49 81 ldd r20, Y+1 ; 0x01 26f32: 5a 81 ldd r21, Y+2 ; 0x02 26f34: 6b 81 ldd r22, Y+3 ; 0x03 26f36: 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; 26f38: 87 89 ldd r24, Z+23 ; 0x17 26f3a: 80 31 cpi r24, 0x10 ; 16 26f3c: f1 f4 brne .+60 ; 0x26f7a 26f3e: 81 e0 ldi r24, 0x01 ; 1 26f40: 48 3f cpi r20, 0xF8 ; 248 26f42: 5f 4f sbci r21, 0xFF ; 255 26f44: 61 05 cpc r22, r1 26f46: 71 05 cpc r23, r1 26f48: b0 f2 brcs .-84 ; 0x26ef6 *size = s; 26f4a: f5 01 movw r30, r10 26f4c: c0 82 st Z, r12 26f4e: d1 82 std Z+1, r13 ; 0x01 26f50: e2 82 std Z+2, r14 ; 0x02 26f52: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 26f54: 0f 90 pop r0 26f56: 0f 90 pop r0 26f58: 0f 90 pop r0 26f5a: 0f 90 pop r0 26f5c: df 91 pop r29 26f5e: cf 91 pop r28 26f60: 1f 91 pop r17 26f62: 0f 91 pop r16 26f64: ff 90 pop r15 26f66: ef 90 pop r14 26f68: df 90 pop r13 26f6a: cf 90 pop r12 26f6c: bf 90 pop r11 26f6e: af 90 pop r10 26f70: 7f 90 pop r7 26f72: 6f 90 pop r6 26f74: 5f 90 pop r5 26f76: 4f 90 pop r4 26f78: 08 95 ret return cluster >= FAT32EOC_MIN; 26f7a: 81 e0 ldi r24, 0x01 ; 1 26f7c: 48 3f cpi r20, 0xF8 ; 248 26f7e: 5f 4f sbci r21, 0xFF ; 255 26f80: 6f 4f sbci r22, 0xFF ; 255 26f82: 7f 40 sbci r23, 0x0F ; 15 26f84: 08 f4 brcc .+2 ; 0x26f88 26f86: b7 cf rjmp .-146 ; 0x26ef6 26f88: e0 cf rjmp .-64 ; 0x26f4a 00026f8a : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 26f8a: cf 92 push r12 26f8c: df 92 push r13 26f8e: ef 92 push r14 26f90: ff 92 push r15 26f92: 1f 93 push r17 26f94: cf 93 push r28 26f96: df 93 push r29 26f98: ec 01 movw r28, r24 26f9a: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 26f9c: e1 11 cpse r30, r1 26f9e: 09 c0 rjmp .+18 ; 0x26fb2 26fa0: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 26fa2: df 91 pop r29 26fa4: cf 91 pop r28 26fa6: 1f 91 pop r17 26fa8: ff 90 pop r15 26faa: ef 90 pop r14 26fac: df 90 pop r13 26fae: cf 90 pop r12 26fb0: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 26fb2: 89 81 ldd r24, Y+1 ; 0x01 26fb4: 80 ff sbrs r24, 0 26fb6: f4 cf rjmp .-24 ; 0x26fa0 gfOffset = curPosition_ & 0X1FF; // offset in block 26fb8: 48 85 ldd r20, Y+8 ; 0x08 26fba: 59 85 ldd r21, Y+9 ; 0x09 26fbc: 6a 85 ldd r22, Y+10 ; 0x0a 26fbe: 7b 85 ldd r23, Y+11 ; 0x0b 26fc0: 9a 01 movw r18, r20 26fc2: 31 70 andi r19, 0x01 ; 1 26fc4: 3a a3 std Y+34, r19 ; 0x22 26fc6: 29 a3 std Y+33, r18 ; 0x21 26fc8: 89 8d ldd r24, Y+25 ; 0x19 26fca: 9a 8d ldd r25, Y+26 ; 0x1a 26fcc: 6a 01 movw r12, r20 26fce: 7b 01 movw r14, r22 26fd0: f9 e0 ldi r31, 0x09 ; 9 26fd2: f6 94 lsr r15 26fd4: e7 94 ror r14 26fd6: d7 94 ror r13 26fd8: c7 94 ror r12 26fda: fa 95 dec r31 26fdc: d1 f7 brne .-12 ; 0x26fd2 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 26fde: e2 30 cpi r30, 0x02 ; 2 26fe0: 79 f4 brne .+30 ; 0x27000 // 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); 26fe2: fc 01 movw r30, r24 26fe4: 82 8d ldd r24, Z+26 ; 0x1a 26fe6: 93 8d ldd r25, Z+27 ; 0x1b 26fe8: a4 8d ldd r26, Z+28 ; 0x1c 26fea: b5 8d ldd r27, Z+29 ; 0x1d 26fec: 8c 0d add r24, r12 26fee: 9d 1d adc r25, r13 26ff0: ae 1d adc r26, r14 26ff2: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 26ff4: 8d 8f std Y+29, r24 ; 0x1d 26ff6: 9e 8f std Y+30, r25 ; 0x1e 26ff8: af 8f std Y+31, r26 ; 0x1f 26ffa: b8 a3 std Y+32, r27 ; 0x20 } return true; 26ffc: 81 e0 ldi r24, 0x01 ; 1 26ffe: d1 cf rjmp .-94 ; 0x26fa2 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);} 27000: fc 01 movw r30, r24 27002: 14 81 ldd r17, Z+4 ; 0x04 27004: 11 50 subi r17, 0x01 ; 1 27006: 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) { 27008: 23 2b or r18, r19 2700a: 71 f4 brne .+28 ; 0x27028 2700c: 11 11 cpse r17, r1 2700e: 0c c0 rjmp .+24 ; 0x27028 // start of new cluster if (curPosition_ == 0) { 27010: 45 2b or r20, r21 27012: 46 2b or r20, r22 27014: 47 2b or r20, r23 27016: 31 f5 brne .+76 ; 0x27064 // use first cluster in file curCluster_ = firstCluster_; 27018: 8d 89 ldd r24, Y+21 ; 0x15 2701a: 9e 89 ldd r25, Y+22 ; 0x16 2701c: af 89 ldd r26, Y+23 ; 0x17 2701e: b8 8d ldd r27, Y+24 ; 0x18 27020: 8c 83 std Y+4, r24 ; 0x04 27022: 9d 83 std Y+5, r25 ; 0x05 27024: ae 83 std Y+6, r26 ; 0x06 27026: 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; 27028: e9 8d ldd r30, Y+25 ; 0x19 2702a: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2702c: 8c 81 ldd r24, Y+4 ; 0x04 2702e: 9d 81 ldd r25, Y+5 ; 0x05 27030: ae 81 ldd r26, Y+6 ; 0x06 27032: bf 81 ldd r27, Y+7 ; 0x07 27034: 02 97 sbiw r24, 0x02 ; 2 27036: a1 09 sbc r26, r1 27038: b1 09 sbc r27, r1 2703a: 25 85 ldd r18, Z+13 ; 0x0d 2703c: 04 c0 rjmp .+8 ; 0x27046 2703e: 88 0f add r24, r24 27040: 99 1f adc r25, r25 27042: aa 1f adc r26, r26 27044: bb 1f adc r27, r27 27046: 2a 95 dec r18 27048: d2 f7 brpl .-12 ; 0x2703e 2704a: 46 85 ldd r20, Z+14 ; 0x0e 2704c: 57 85 ldd r21, Z+15 ; 0x0f 2704e: 60 89 ldd r22, Z+16 ; 0x10 27050: 71 89 ldd r23, Z+17 ; 0x11 27052: 84 0f add r24, r20 27054: 95 1f adc r25, r21 27056: a6 1f adc r26, r22 27058: b7 1f adc r27, r23 2705a: 81 0f add r24, r17 2705c: 91 1d adc r25, r1 2705e: a1 1d adc r26, r1 27060: b1 1d adc r27, r1 27062: c8 cf rjmp .-112 ; 0x26ff4 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 27064: 4c 81 ldd r20, Y+4 ; 0x04 27066: 5d 81 ldd r21, Y+5 ; 0x05 27068: 6e 81 ldd r22, Y+6 ; 0x06 2706a: 7f 81 ldd r23, Y+7 ; 0x07 2706c: 9e 01 movw r18, r28 2706e: 2c 5f subi r18, 0xFC ; 252 27070: 3f 4f sbci r19, 0xFF ; 255 27072: 0f 94 d8 36 call 0x26db0 ; 0x26db0 27076: 81 11 cpse r24, r1 27078: d7 cf rjmp .-82 ; 0x27028 2707a: 92 cf rjmp .-220 ; 0x26fa0 0002707c : * 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) { 2707c: df 92 push r13 2707e: ef 92 push r14 27080: ff 92 push r15 27082: 0f 93 push r16 27084: 1f 93 push r17 27086: cf 93 push r28 27088: df 93 push r29 2708a: 8c 01 movw r16, r24 2708c: eb 01 movw r28, r22 2708e: 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; 27090: 8d e0 ldi r24, 0x0D ; 13 27092: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 27094: 40 e2 ldi r20, 0x20 ; 32 27096: 50 e0 ldi r21, 0x00 ; 0 27098: be 01 movw r22, r28 2709a: c8 01 movw r24, r16 2709c: 0f 94 0d 72 call 0x2e41a ; 0x2e41a if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 270a0: 80 32 cpi r24, 0x20 ; 32 270a2: 91 05 cpc r25, r1 270a4: 71 f0 breq .+28 ; 0x270c2 270a6: 21 e0 ldi r18, 0x01 ; 1 270a8: 89 2b or r24, r25 270aa: 09 f4 brne .+2 ; 0x270ae 270ac: 20 e0 ldi r18, 0x00 ; 0 270ae: 82 2f mov r24, r18 270b0: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 270b2: df 91 pop r29 270b4: cf 91 pop r28 270b6: 1f 91 pop r17 270b8: 0f 91 pop r16 270ba: ff 90 pop r15 270bc: ef 90 pop r14 270be: df 90 pop r13 270c0: 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; 270c2: 28 81 ld r18, Y 270c4: 22 23 and r18, r18 270c6: 09 f4 brne .+2 ; 0x270ca 270c8: 3f c0 rjmp .+126 ; 0x27148 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 270ca: 25 3e cpi r18, 0xE5 ; 229 270cc: 19 f3 breq .-58 ; 0x27094 270ce: 2e 32 cpi r18, 0x2E ; 46 270d0: 09 f3 breq .-62 ; 0x27094 //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) 270d2: 3b 85 ldd r19, Y+11 ; 0x0b 270d4: 3f 73 andi r19, 0x3F ; 63 270d6: 3f 30 cpi r19, 0x0F ; 15 270d8: 99 f5 brne .+102 ; 0x27140 270da: e1 14 cp r14, r1 270dc: f1 04 cpc r15, r1 270de: 81 f1 breq .+96 ; 0x27140 { 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) 270e0: 4a 8d ldd r20, Y+26 ; 0x1a 270e2: 5b 8d ldd r21, Y+27 ; 0x1b 270e4: 45 2b or r20, r21 270e6: 61 f5 brne .+88 ; 0x27140 270e8: 2f 71 andi r18, 0x1F ; 31 270ea: 3f ef ldi r19, 0xFF ; 255 270ec: 32 0f add r19, r18 270ee: 34 30 cpi r19, 0x04 ; 4 270f0: 38 f5 brcc .+78 ; 0x27140 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 270f2: 21 50 subi r18, 0x01 ; 1 270f4: 33 0b sbc r19, r19 270f6: d2 9e mul r13, r18 270f8: c0 01 movw r24, r0 270fa: d3 9e mul r13, r19 270fc: 90 0d add r25, r0 270fe: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 27100: f7 01 movw r30, r14 27102: e8 0f add r30, r24 27104: f9 1f adc r31, r25 27106: 29 81 ldd r18, Y+1 ; 0x01 27108: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2710a: 2b 81 ldd r18, Y+3 ; 0x03 2710c: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2710e: 2d 81 ldd r18, Y+5 ; 0x05 27110: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 27112: 2f 81 ldd r18, Y+7 ; 0x07 27114: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 27116: 29 85 ldd r18, Y+9 ; 0x09 27118: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2711a: 2e 85 ldd r18, Y+14 ; 0x0e 2711c: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2711e: 28 89 ldd r18, Y+16 ; 0x10 27120: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 27122: 2a 89 ldd r18, Y+18 ; 0x12 27124: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 27126: 2c 89 ldd r18, Y+20 ; 0x14 27128: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2712a: 2e 89 ldd r18, Y+22 ; 0x16 2712c: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2712e: 28 8d ldd r18, Y+24 ; 0x18 27130: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 27132: 2c 8d ldd r18, Y+28 ; 0x1c 27134: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 27136: 2e 8d ldd r18, Y+30 ; 0x1e 27138: 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) 2713a: 28 81 ld r18, Y 2713c: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2713e: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 27140: 2b 85 ldd r18, Y+11 ; 0x0b 27142: 23 fd sbrc r18, 3 27144: a7 cf rjmp .-178 ; 0x27094 27146: b5 cf rjmp .-150 ; 0x270b2 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; 27148: 80 e0 ldi r24, 0x00 ; 0 2714a: b3 cf rjmp .-154 ; 0x270b2 0002714c : * \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() { 2714c: cf 93 push r28 2714e: df 93 push r29 27150: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 27152: 8b 81 ldd r24, Y+3 ; 0x03 27154: 88 23 and r24, r24 27156: 49 f1 breq .+82 ; 0x271aa if (flags_ & F_FILE_DIR_DIRTY) { 27158: 89 81 ldd r24, Y+1 ; 0x01 2715a: 87 ff sbrs r24, 7 2715c: 22 c0 rjmp .+68 ; 0x271a2 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2715e: 61 e0 ldi r22, 0x01 ; 1 27160: ce 01 movw r24, r28 27162: 0f 94 3c 6f call 0x2de78 ; 0x2de78 27166: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 27168: 89 2b or r24, r25 2716a: f9 f0 breq .+62 ; 0x271aa 2716c: 80 81 ld r24, Z 2716e: 85 3e cpi r24, 0xE5 ; 229 27170: e1 f0 breq .+56 ; 0x271aa // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 27172: 8b 81 ldd r24, Y+3 ; 0x03 27174: 82 30 cpi r24, 0x02 ; 2 27176: 40 f4 brcc .+16 ; 0x27188 27178: 89 89 ldd r24, Y+17 ; 0x11 2717a: 9a 89 ldd r25, Y+18 ; 0x12 2717c: ab 89 ldd r26, Y+19 ; 0x13 2717e: bc 89 ldd r27, Y+20 ; 0x14 27180: 84 8f std Z+28, r24 ; 0x1c 27182: 95 8f std Z+29, r25 ; 0x1d 27184: a6 8f std Z+30, r26 ; 0x1e 27186: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 27188: 8d 89 ldd r24, Y+21 ; 0x15 2718a: 9e 89 ldd r25, Y+22 ; 0x16 2718c: 93 8f std Z+27, r25 ; 0x1b 2718e: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 27190: 8d 89 ldd r24, Y+21 ; 0x15 27192: 9e 89 ldd r25, Y+22 ; 0x16 27194: af 89 ldd r26, Y+23 ; 0x17 27196: b8 8d ldd r27, Y+24 ; 0x18 27198: b5 8b std Z+21, r27 ; 0x15 2719a: 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; 2719c: 89 81 ldd r24, Y+1 ; 0x01 2719e: 8f 77 andi r24, 0x7F ; 127 271a0: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 271a2: df 91 pop r29 271a4: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 271a6: 0d 94 ca 35 jmp 0x26b94 ; 0x26b94 fail: writeError = true; 271aa: 81 e0 ldi r24, 0x01 ; 1 271ac: 88 83 st Y, r24 return false; } 271ae: 80 e0 ldi r24, 0x00 ; 0 271b0: df 91 pop r29 271b2: cf 91 pop r28 271b4: 08 95 ret 000271b6 : * \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) { 271b6: 8f 92 push r8 271b8: 9f 92 push r9 271ba: af 92 push r10 271bc: bf 92 push r11 271be: cf 92 push r12 271c0: df 92 push r13 271c2: ef 92 push r14 271c4: ff 92 push r15 271c6: 0f 93 push r16 271c8: 1f 93 push r17 271ca: cf 93 push r28 271cc: df 93 push r29 271ce: ec 01 movw r28, r24 271d0: 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; 271d2: 81 11 cpse r24, r1 271d4: 0e c0 rjmp .+28 ; 0x271f2 done: return true; fail: return false; 271d6: 80 e0 ldi r24, 0x00 ; 0 } 271d8: df 91 pop r29 271da: cf 91 pop r28 271dc: 1f 91 pop r17 271de: 0f 91 pop r16 271e0: ff 90 pop r15 271e2: ef 90 pop r14 271e4: df 90 pop r13 271e6: cf 90 pop r12 271e8: bf 90 pop r11 271ea: af 90 pop r10 271ec: 9f 90 pop r9 271ee: 8f 90 pop r8 271f0: 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; 271f2: 09 89 ldd r16, Y+17 ; 0x11 271f4: 1a 89 ldd r17, Y+18 ; 0x12 271f6: 2b 89 ldd r18, Y+19 ; 0x13 271f8: 3c 89 ldd r19, Y+20 ; 0x14 271fa: 04 17 cp r16, r20 271fc: 15 07 cpc r17, r21 271fe: 26 07 cpc r18, r22 27200: 37 07 cpc r19, r23 27202: 48 f3 brcs .-46 ; 0x271d6 27204: 4a 01 movw r8, r20 27206: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 27208: 82 30 cpi r24, 0x02 ; 2 2720a: 31 f4 brne .+12 ; 0x27218 curPosition_ = pos; 2720c: 88 86 std Y+8, r8 ; 0x08 2720e: 99 86 std Y+9, r9 ; 0x09 27210: aa 86 std Y+10, r10 ; 0x0a 27212: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 27214: 81 e0 ldi r24, 0x01 ; 1 27216: e0 cf rjmp .-64 ; 0x271d8 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 27218: 81 14 cp r8, r1 2721a: 91 04 cpc r9, r1 2721c: a1 04 cpc r10, r1 2721e: b1 04 cpc r11, r1 27220: 49 f4 brne .+18 ; 0x27234 // set position to start of file curCluster_ = 0; 27222: 1c 82 std Y+4, r1 ; 0x04 27224: 1d 82 std Y+5, r1 ; 0x05 27226: 1e 82 std Y+6, r1 ; 0x06 27228: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2722a: 18 86 std Y+8, r1 ; 0x08 2722c: 19 86 std Y+9, r1 ; 0x09 2722e: 1a 86 std Y+10, r1 ; 0x0a 27230: 1b 86 std Y+11, r1 ; 0x0b 27232: f0 cf rjmp .-32 ; 0x27214 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 27234: 08 85 ldd r16, Y+8 ; 0x08 27236: 19 85 ldd r17, Y+9 ; 0x09 27238: 2a 85 ldd r18, Y+10 ; 0x0a 2723a: 3b 85 ldd r19, Y+11 ; 0x0b 2723c: e9 8d ldd r30, Y+25 ; 0x19 2723e: fa 8d ldd r31, Y+26 ; 0x1a 27240: 85 85 ldd r24, Z+13 ; 0x0d 27242: 90 e0 ldi r25, 0x00 ; 0 27244: 09 96 adiw r24, 0x09 ; 9 27246: b9 01 movw r22, r18 27248: a8 01 movw r20, r16 2724a: 41 50 subi r20, 0x01 ; 1 2724c: 51 09 sbc r21, r1 2724e: 61 09 sbc r22, r1 27250: 71 09 sbc r23, r1 27252: 08 2e mov r0, r24 27254: 04 c0 rjmp .+8 ; 0x2725e 27256: 76 95 lsr r23 27258: 67 95 ror r22 2725a: 57 95 ror r21 2725c: 47 95 ror r20 2725e: 0a 94 dec r0 27260: d2 f7 brpl .-12 ; 0x27256 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 27262: 75 01 movw r14, r10 27264: 64 01 movw r12, r8 27266: e1 e0 ldi r30, 0x01 ; 1 27268: ce 1a sub r12, r30 2726a: d1 08 sbc r13, r1 2726c: e1 08 sbc r14, r1 2726e: f1 08 sbc r15, r1 27270: 04 c0 rjmp .+8 ; 0x2727a 27272: f6 94 lsr r15 27274: e7 94 ror r14 27276: d7 94 ror r13 27278: c7 94 ror r12 2727a: 8a 95 dec r24 2727c: d2 f7 brpl .-12 ; 0x27272 if (nNew < nCur || curPosition_ == 0) { 2727e: c4 16 cp r12, r20 27280: d5 06 cpc r13, r21 27282: e6 06 cpc r14, r22 27284: f7 06 cpc r15, r23 27286: 20 f0 brcs .+8 ; 0x27290 27288: 01 2b or r16, r17 2728a: 02 2b or r16, r18 2728c: 03 2b or r16, r19 2728e: 11 f5 brne .+68 ; 0x272d4 // must follow chain from first cluster curCluster_ = firstCluster_; 27290: 8d 89 ldd r24, Y+21 ; 0x15 27292: 9e 89 ldd r25, Y+22 ; 0x16 27294: af 89 ldd r26, Y+23 ; 0x17 27296: b8 8d ldd r27, Y+24 ; 0x18 27298: 8c 83 std Y+4, r24 ; 0x04 2729a: 9d 83 std Y+5, r25 ; 0x05 2729c: ae 83 std Y+6, r26 ; 0x06 2729e: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 272a0: 8e 01 movw r16, r28 272a2: 0c 5f subi r16, 0xFC ; 252 272a4: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 272a6: c1 14 cp r12, r1 272a8: d1 04 cpc r13, r1 272aa: e1 04 cpc r14, r1 272ac: f1 04 cpc r15, r1 272ae: 09 f4 brne .+2 ; 0x272b2 272b0: ad cf rjmp .-166 ; 0x2720c if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 272b2: 4c 81 ldd r20, Y+4 ; 0x04 272b4: 5d 81 ldd r21, Y+5 ; 0x05 272b6: 6e 81 ldd r22, Y+6 ; 0x06 272b8: 7f 81 ldd r23, Y+7 ; 0x07 272ba: 98 01 movw r18, r16 272bc: 89 8d ldd r24, Y+25 ; 0x19 272be: 9a 8d ldd r25, Y+26 ; 0x1a 272c0: 0f 94 d8 36 call 0x26db0 ; 0x26db0 272c4: 91 e0 ldi r25, 0x01 ; 1 272c6: c9 1a sub r12, r25 272c8: d1 08 sbc r13, r1 272ca: e1 08 sbc r14, r1 272cc: f1 08 sbc r15, r1 272ce: 81 11 cpse r24, r1 272d0: ea cf rjmp .-44 ; 0x272a6 272d2: 81 cf rjmp .-254 ; 0x271d6 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 272d4: c4 1a sub r12, r20 272d6: d5 0a sbc r13, r21 272d8: e6 0a sbc r14, r22 272da: f7 0a sbc r15, r23 272dc: e1 cf rjmp .-62 ; 0x272a0 000272de : 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() { 272de: cf 93 push r28 272e0: df 93 push r29 if (MMU2::mmu2.Enabled()) { 272e2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 272e6: 81 30 cpi r24, 0x01 ; 1 272e8: f9 f4 brne .+62 ; 0x27328 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 272ea: 8c e9 ldi r24, 0x9C ; 156 272ec: 9e e4 ldi r25, 0x4E ; 78 272ee: 0e 94 3c 6d call 0xda78 ; 0xda78 272f2: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 272f4: 86 e8 ldi r24, 0x86 ; 134 272f6: 9e e3 ldi r25, 0x3E ; 62 272f8: 0e 94 3c 6d call 0xda78 ; 0xda78 272fc: be 01 movw r22, r28 272fe: 6f 5f subi r22, 0xFF ; 255 27300: 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 27302: 0e 94 e5 bc call 0x179ca ; 0x179ca if (filament < MMU_FILAMENT_COUNT) { 27306: 85 30 cpi r24, 0x05 ; 5 27308: a0 f5 brcc .+104 ; 0x27372 lay1cal_filament = filament; 2730a: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af <_ZL16lay1cal_filament.lto_priv.407> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2730e: 8a e0 ldi r24, 0x0A ; 10 27310: 80 93 62 03 sts 0x0362, r24 ; 0x800362 menu_goto(lcd_generic_preheat_menu, 0, true); 27314: 20 e0 ldi r18, 0x00 ; 0 27316: 41 e0 ldi r20, 0x01 ; 1 27318: 70 e0 ldi r23, 0x00 ; 0 2731a: 60 e0 ldi r22, 0x00 ; 0 2731c: 85 e4 ldi r24, 0x45 ; 69 2731e: 97 e3 ldi r25, 0x37 ; 55 } 27320: df 91 pop r29 27322: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 27324: 0d 94 87 93 jmp 0x3270e ; 0x3270e menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 27328: 8f e5 ldi r24, 0x5F ; 95 2732a: 9f e0 ldi r25, 0x0F ; 15 2732c: 0f 94 7d a0 call 0x340fa ; 0x340fa 27330: 81 11 cpse r24, r1 27332: ed cf rjmp .-38 ; 0x2730e { bool loaded = false; if (fsensor.isReady()) { 27334: 80 91 84 16 lds r24, 0x1684 ; 0x801684 27338: 82 30 cpi r24, 0x02 ; 2 2733a: f9 f4 brne .+62 ; 0x2737a loaded = fsensor.getFilamentPresent(); 2733c: 0e 94 f7 c3 call 0x187ee ; 0x187ee 27340: 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) { 27342: 91 11 cpse r25, r1 27344: e4 cf rjmp .-56 ; 0x2730e lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 27346: 8e e7 ldi r24, 0x7E ; 126 27348: 9e e4 ldi r25, 0x4E ; 78 2734a: 0e 94 3c 6d call 0xda78 ; 0xda78 2734e: 0f 94 92 0a call 0x21524 ; 0x21524 lcd_consume_click(); 27352: 0e 94 1e 6c call 0xd83c ; 0xd83c 27356: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 27358: 84 e6 ldi r24, 0x64 ; 100 2735a: 90 e0 ldi r25, 0x00 ; 0 2735c: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 if (lcd_clicked()) { 27360: 0e 94 23 6c call 0xd846 ; 0xd846 27364: 81 11 cpse r24, r1 27366: 02 c0 rjmp .+4 ; 0x2736c 27368: 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 2736a: b1 f7 brne .-20 ; 0x27358 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2736c: 81 e0 ldi r24, 0x01 ; 1 2736e: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 27372: df 91 pop r29 27374: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 27376: 0d 94 25 96 jmp 0x32c4a ; 0x32c4a { 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); 2737a: 82 ea ldi r24, 0xA2 ; 162 2737c: 93 e5 ldi r25, 0x53 ; 83 2737e: 0e 94 3c 6d call 0xda78 ; 0xda78 27382: 41 e0 ldi r20, 0x01 ; 1 27384: 60 e0 ldi r22, 0x00 ; 0 27386: 0f 94 89 2d call 0x25b12 ; 0x25b12 2738a: 91 e0 ldi r25, 0x01 ; 1 2738c: 81 11 cpse r24, r1 2738e: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 27390: 81 e0 ldi r24, 0x01 ; 1 27392: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 27396: d5 cf rjmp .-86 ; 0x27342 00027398 : 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()") { 27398: cf 93 push r28 2739a: 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); 2739e: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 273a0: 4c ed ldi r20, 0xDC ; 220 273a2: 5b e6 ldi r21, 0x6B ; 107 273a4: 60 e0 ldi r22, 0x00 ; 0 273a6: 80 e0 ldi r24, 0x00 ; 0 273a8: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(LCD_WIDTH - 14, 0); 273ac: 60 e0 ldi r22, 0x00 ; 0 273ae: 86 e0 ldi r24, 0x06 ; 6 273b0: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print_state(pinda_state); 273b4: c4 fb bst r28, 4 273b6: 88 27 eor r24, r24 273b8: 80 f9 bld r24, 0 273ba: 0f 94 b0 02 call 0x20560 ; 0x20560 if (MMU2::mmu2.Enabled()) { 273be: 80 91 94 12 lds r24, 0x1294 ; 0x801294 273c2: 81 30 cpi r24, 0x01 ; 1 273c4: 99 f4 brne .+38 ; 0x273ec inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 273c6: c1 e0 ldi r28, 0x01 ; 1 273c8: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 273cc: 81 11 cpse r24, r1 273ce: 01 c0 rjmp .+2 ; 0x273d2 273d0: 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 273d2: 46 ed ldi r20, 0xD6 ; 214 273d4: 5b e6 ldi r21, 0x6B ; 107 273d6: 60 e0 ldi r22, 0x00 ; 0 273d8: 8a e0 ldi r24, 0x0A ; 10 273da: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(LCD_WIDTH - 3, 0); 273de: 60 e0 ldi r22, 0x00 ; 0 273e0: 81 e1 ldi r24, 0x11 ; 17 273e2: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print_state(finda_state); 273e6: 8c 2f mov r24, r28 273e8: 0f 94 b0 02 call 0x20560 ; 0x20560 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 273ec: 0e 94 f7 c3 call 0x187ee ; 0x187ee 273f0: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 273f2: 8e e9 ldi r24, 0x9E ; 158 273f4: 9d e3 ldi r25, 0x3D ; 61 273f6: 0e 94 3c 6d call 0xda78 ; 0xda78 273fa: ac 01 movw r20, r24 273fc: 61 e0 ldi r22, 0x01 ; 1 273fe: 80 e0 ldi r24, 0x00 ; 0 27400: 0e 94 1a 6a call 0xd434 ; 0xd434 lcd_set_cursor(LCD_WIDTH - 3, 1); 27404: 61 e0 ldi r22, 0x01 ; 1 27406: 81 e1 ldi r24, 0x11 ; 17 27408: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print_state(idler_state); 2740c: 8c 2f mov r24, r28 2740e: 0f 94 b0 02 call 0x20560 ; 0x20560 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(); } 27412: 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(); 27414: 0d 94 c7 96 jmp 0x32d8e ; 0x32d8e 00027418 : } // 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; 27418: e2 e0 ldi r30, 0x02 ; 2 2741a: f6 e1 ldi r31, 0x16 ; 22 2741c: 40 81 ld r20, Z 2741e: 51 81 ldd r21, Z+1 ; 0x01 27420: 62 81 ldd r22, Z+2 ; 0x02 27422: 73 81 ldd r23, Z+3 ; 0x03 27424: 48 0f add r20, r24 27426: 59 1f adc r21, r25 27428: 61 1d adc r22, r1 2742a: 71 1d adc r23, r1 2742c: 40 83 st Z, r20 2742e: 51 83 std Z+1, r21 ; 0x01 27430: 62 83 std Z+2, r22 ; 0x02 27432: 73 83 std Z+3, r23 ; 0x03 } 27434: 08 95 ret 00027436 : 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){ 27436: 2f 92 push r2 27438: 3f 92 push r3 2743a: 4f 92 push r4 2743c: 5f 92 push r5 2743e: 6f 92 push r6 27440: 7f 92 push r7 27442: 8f 92 push r8 27444: 9f 92 push r9 27446: af 92 push r10 27448: bf 92 push r11 2744a: cf 92 push r12 2744c: df 92 push r13 2744e: ef 92 push r14 27450: ff 92 push r15 27452: 0f 93 push r16 27454: 1f 93 push r17 27456: cf 93 push r28 27458: df 93 push r29 2745a: 00 d0 rcall .+0 ; 0x2745c 2745c: 1f 92 push r1 2745e: 1f 92 push r1 27460: cd b7 in r28, 0x3d ; 61 27462: de b7 in r29, 0x3e ; 62 27464: 1c 01 movw r2, r24 27466: 2a 01 movw r4, r20 27468: 3b 01 movw r6, r22 2746a: 00 e2 ldi r16, 0x20 ; 32 2746c: 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){ 2746e: 19 82 std Y+1, r1 ; 0x01 27470: 99 81 ldd r25, Y+1 ; 0x01 27472: 89 2f mov r24, r25 27474: 90 e0 ldi r25, 0x00 ; 0 27476: 9b 83 std Y+3, r25 ; 0x03 27478: 8a 83 std Y+2, r24 ; 0x02 2747a: 80 17 cp r24, r16 2747c: 91 07 cpc r25, r17 2747e: 9c f5 brge .+102 ; 0x274e6 if (points[j] > points[j + 1]) 27480: 88 0f add r24, r24 27482: 99 1f adc r25, r25 27484: 88 0f add r24, r24 27486: 99 1f adc r25, r25 27488: 9d 83 std Y+5, r25 ; 0x05 2748a: 8c 83 std Y+4, r24 ; 0x04 2748c: 82 0d add r24, r2 2748e: 93 1d adc r25, r3 27490: 9b 83 std Y+3, r25 ; 0x03 27492: 8a 83 std Y+2, r24 ; 0x02 27494: fc 01 movw r30, r24 27496: c0 80 ld r12, Z 27498: d1 80 ldd r13, Z+1 ; 0x01 2749a: e2 80 ldd r14, Z+2 ; 0x02 2749c: f3 80 ldd r15, Z+3 ; 0x03 2749e: 8c 81 ldd r24, Y+4 ; 0x04 274a0: 9d 81 ldd r25, Y+5 ; 0x05 274a2: 04 96 adiw r24, 0x04 ; 4 274a4: 82 0d add r24, r2 274a6: 93 1d adc r25, r3 274a8: 9d 83 std Y+5, r25 ; 0x05 274aa: 8c 83 std Y+4, r24 ; 0x04 274ac: fc 01 movw r30, r24 274ae: 80 80 ld r8, Z 274b0: 91 80 ldd r9, Z+1 ; 0x01 274b2: a2 80 ldd r10, Z+2 ; 0x02 274b4: b3 80 ldd r11, Z+3 ; 0x03 274b6: a5 01 movw r20, r10 274b8: 94 01 movw r18, r8 274ba: c7 01 movw r24, r14 274bc: b6 01 movw r22, r12 274be: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 274c2: 18 16 cp r1, r24 274c4: 64 f4 brge .+24 ; 0x274de SWAP(points[j], points[j + 1]); 274c6: ea 81 ldd r30, Y+2 ; 0x02 274c8: fb 81 ldd r31, Y+3 ; 0x03 274ca: 80 82 st Z, r8 274cc: 91 82 std Z+1, r9 ; 0x01 274ce: a2 82 std Z+2, r10 ; 0x02 274d0: b3 82 std Z+3, r11 ; 0x03 274d2: ec 81 ldd r30, Y+4 ; 0x04 274d4: fd 81 ldd r31, Y+5 ; 0x05 274d6: c0 82 st Z, r12 274d8: d1 82 std Z+1, r13 ; 0x01 274da: e2 82 std Z+2, r14 ; 0x02 274dc: 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){ 274de: f9 81 ldd r31, Y+1 ; 0x01 274e0: ff 5f subi r31, 0xFF ; 255 274e2: f9 83 std Y+1, r31 ; 0x01 274e4: c5 cf rjmp .-118 ; 0x27470 274e6: 01 50 subi r16, 0x01 ; 1 274e8: 11 09 sbc r17, r1 274ea: 08 f6 brcc .-126 ; 0x2746e /// 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]; 274ec: f1 01 movw r30, r2 274ee: e0 5c subi r30, 0xC0 ; 192 274f0: 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); 274f2: 20 81 ld r18, Z 274f4: 31 81 ldd r19, Z+1 ; 0x01 274f6: 42 81 ldd r20, Z+2 ; 0x02 274f8: 53 81 ldd r21, Z+3 ; 0x03 274fa: c3 01 movw r24, r6 274fc: b2 01 movw r22, r4 274fe: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 27502: 6b 01 movw r12, r22 27504: 7c 01 movw r14, r24 27506: 20 e0 ldi r18, 0x00 ; 0 27508: 30 e0 ldi r19, 0x00 ; 0 2750a: 40 e0 ldi r20, 0x00 ; 0 2750c: 5f eb ldi r21, 0xBF ; 191 2750e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 27512: 87 fd sbrc r24, 7 27514: 10 c0 rjmp .+32 ; 0x27536 27516: 20 e0 ldi r18, 0x00 ; 0 27518: 30 e0 ldi r19, 0x00 ; 0 2751a: 40 e0 ldi r20, 0x00 ; 0 2751c: 5f e3 ldi r21, 0x3F ; 63 2751e: c7 01 movw r24, r14 27520: b6 01 movw r22, r12 27522: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 27526: 18 16 cp r1, r24 27528: 5c f4 brge .+22 ; 0x27540 2752a: c1 2c mov r12, r1 2752c: d1 2c mov r13, r1 2752e: e1 2c mov r14, r1 27530: 8f e3 ldi r24, 0x3F ; 63 27532: f8 2e mov r15, r24 27534: 05 c0 rjmp .+10 ; 0x27540 27536: c1 2c mov r12, r1 27538: d1 2c mov r13, r1 2753a: e1 2c mov r14, r1 2753c: 9f eb ldi r25, 0xBF ; 191 2753e: f9 2e mov r15, r25 } 27540: c7 01 movw r24, r14 27542: b6 01 movw r22, r12 27544: 0f 90 pop r0 27546: 0f 90 pop r0 27548: 0f 90 pop r0 2754a: 0f 90 pop r0 2754c: 0f 90 pop r0 2754e: df 91 pop r29 27550: cf 91 pop r28 27552: 1f 91 pop r17 27554: 0f 91 pop r16 27556: ff 90 pop r15 27558: ef 90 pop r14 2755a: df 90 pop r13 2755c: cf 90 pop r12 2755e: bf 90 pop r11 27560: af 90 pop r10 27562: 9f 90 pop r9 27564: 8f 90 pop r8 27566: 7f 90 pop r7 27568: 6f 90 pop r6 2756a: 5f 90 pop r5 2756c: 4f 90 pop r4 2756e: 3f 90 pop r3 27570: 2f 90 pop r2 27572: 08 95 ret 00027574 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 27574: 0f 94 46 0f call 0x21e8c ; 0x21e8c 27578: 60 93 34 12 sts 0x1234, r22 ; 0x801234 2757c: 70 93 35 12 sts 0x1235, r23 ; 0x801235 27580: 80 93 36 12 sts 0x1236, r24 ; 0x801236 27584: 90 93 37 12 sts 0x1237, r25 ; 0x801237 } 27588: 08 95 ret 0002758a : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2758a: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 2758e: 88 23 and r24, r24 27590: 69 f0 breq .+26 ; 0x275ac 27592: 80 91 79 12 lds r24, 0x1279 ; 0x801279 27596: 88 23 and r24, r24 27598: 49 f0 breq .+18 ; 0x275ac SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2759a: 8e ee ldi r24, 0xEE ; 238 2759c: 9d e9 ldi r25, 0x9D ; 157 2759e: 0e 94 de 72 call 0xe5bc ; 0xe5bc retryAttempts--; 275a2: 80 91 79 12 lds r24, 0x1279 ; 0x801279 275a6: 81 50 subi r24, 0x01 ; 1 275a8: 80 93 79 12 sts 0x1279, r24 ; 0x801279 } } 275ac: 08 95 ret 000275ae : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 275ae: 9f 92 push r9 275b0: af 92 push r10 275b2: bf 92 push r11 275b4: cf 92 push r12 275b6: df 92 push r13 275b8: ef 92 push r14 275ba: ff 92 push r15 275bc: 0f 93 push r16 275be: 1f 93 push r17 275c0: cf 93 push r28 275c2: df 93 push r29 275c4: cd b7 in r28, 0x3d ; 61 275c6: de b7 in r29, 0x3e ; 62 275c8: e0 97 sbiw r28, 0x30 ; 48 275ca: 0f b6 in r0, 0x3f ; 63 275cc: f8 94 cli 275ce: de bf out 0x3e, r29 ; 62 275d0: 0f be out 0x3f, r0 ; 63 275d2: cd bf out 0x3d, r28 ; 61 275d4: 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()]; 275d6: e0 90 62 12 lds r14, 0x1262 ; 0x801262 275da: fe 01 movw r30, r28 275dc: 31 96 adiw r30, 0x01 ; 1 275de: 21 e0 ldi r18, 0x01 ; 1 275e0: 30 e0 ldi r19, 0x00 ; 0 275e2: 5f 01 movw r10, r30 275e4: f1 2c mov r15, r1 275e6: 40 e1 ldi r20, 0x10 ; 16 275e8: c4 2e mov r12, r20 275ea: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 275ec: 50 e2 ldi r21, 0x20 ; 32 275ee: 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()]; 275f0: c7 01 movw r24, r14 275f2: 82 1b sub r24, r18 275f4: 93 0b sbc r25, r19 275f6: b6 01 movw r22, r12 275f8: 0f 94 5a a1 call 0x342b4 ; 0x342b4 <__divmodhi4> 275fc: dc 01 movw r26, r24 275fe: bb 27 eor r27, r27 27600: ab 5d subi r26, 0xDB ; 219 27602: bd 4e sbci r27, 0xED ; 237 27604: 9d 96 adiw r26, 0x2d ; 45 27606: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 27608: 48 2f mov r20, r24 2760a: 50 e0 ldi r21, 0x00 ; 0 2760c: 94 e0 ldi r25, 0x04 ; 4 2760e: 55 95 asr r21 27610: 47 95 ror r20 27612: 9a 95 dec r25 27614: e1 f7 brne .-8 ; 0x2760e lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 27616: 96 ef ldi r25, 0xF6 ; 246 27618: 94 0f add r25, r20 2761a: 96 30 cpi r25, 0x06 ; 6 2761c: a8 f1 brcs .+106 ; 0x27688 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2761e: 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); 27620: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 27622: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 27624: 96 ef ldi r25, 0xF6 ; 246 27626: 98 0f add r25, r24 27628: 96 30 cpi r25, 0x06 ; 6 2762a: 80 f1 brcs .+96 ; 0x2768c case 5: case 6: case 7: case 8: case 9: return c + '0'; 2762c: 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); 2762e: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 27630: 92 82 std Z+2, r9 ; 0x02 27632: 2f 5f subi r18, 0xFF ; 255 27634: 3f 4f sbci r19, 0xFF ; 255 27636: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 27638: 21 31 cpi r18, 0x11 ; 17 2763a: 31 05 cpc r19, r1 2763c: c9 f6 brne .-78 ; 0x275f0 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 2763e: 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); 27640: 87 e7 ldi r24, 0x77 ; 119 27642: 9e e9 ldi r25, 0x9E ; 158 27644: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 27648: 81 e7 ldi r24, 0x71 ; 113 2764a: 9e e9 ldi r25, 0x9E ; 158 2764c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 27650: c8 01 movw r24, r16 27652: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOPGM(", last bytes: "); 27656: 89 e1 ldi r24, 0x19 ; 25 27658: 9e e9 ldi r25, 0x9E ; 158 2765a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(lrb); 2765e: c5 01 movw r24, r10 27660: 0f 94 9e 99 call 0x3333c ; 0x3333c } 27664: e0 96 adiw r28, 0x30 ; 48 27666: 0f b6 in r0, 0x3f ; 63 27668: f8 94 cli 2766a: de bf out 0x3e, r29 ; 62 2766c: 0f be out 0x3f, r0 ; 63 2766e: cd bf out 0x3d, r28 ; 61 27670: df 91 pop r29 27672: cf 91 pop r28 27674: 1f 91 pop r17 27676: 0f 91 pop r16 27678: ff 90 pop r15 2767a: ef 90 pop r14 2767c: df 90 pop r13 2767e: cf 90 pop r12 27680: bf 90 pop r11 27682: af 90 pop r10 27684: 9f 90 pop r9 27686: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 27688: 49 5a subi r20, 0xA9 ; 169 2768a: ca cf rjmp .-108 ; 0x27620 2768c: 89 5a subi r24, 0xA9 ; 169 2768e: cf cf rjmp .-98 ; 0x2762e 00027690 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 27690: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 27692: 90 91 39 12 lds r25, 0x1239 ; 0x801239 27696: 9a 30 cpi r25, 0x0A ; 10 27698: 11 f4 brne .+4 ; 0x2769e cause = ss; 2769a: 60 93 38 12 sts 0x1238, r22 ; 0x801238 } --occurrences; 2769e: 91 50 subi r25, 0x01 ; 1 276a0: 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)) { 276a4: 91 11 cpse r25, r1 276a6: 0d c0 rjmp .+26 ; 0x276c2 276a8: c9 01 movw r24, r18 LogError(msg_P); 276aa: 0f 94 d7 3a call 0x275ae ; 0x275ae SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 276ae: 8a e0 ldi r24, 0x0A ; 10 276b0: 9e e9 ldi r25, 0x9E ; 158 276b2: 0e 94 de 72 call 0xe5bc ; 0xe5bc /// @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; } 276b6: 8a e0 ldi r24, 0x0A ; 10 276b8: 80 93 39 12 sts 0x1239, r24 ; 0x801239 276bc: 80 91 38 12 lds r24, 0x1238 ; 0x801238 276c0: 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 276c2: 80 e0 ldi r24, 0x00 ; 0 } } 276c4: 08 95 ret 000276c6 : } *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) { 276c6: cf 93 push r28 276c8: df 93 push r29 276ca: cd b7 in r28, 0x3d ; 61 276cc: de b7 in r29, 0x3e ; 62 276ce: 2e 97 sbiw r28, 0x0e ; 14 276d0: 0f b6 in r0, 0x3f ; 63 276d2: f8 94 cli 276d4: de bf out 0x3e, r29 ; 62 276d6: 0f be out 0x3f, r0 ; 63 276d8: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 276da: 2e e3 ldi r18, 0x3E ; 62 276dc: 30 e0 ldi r19, 0x00 ; 0 276de: 3a 83 std Y+2, r19 ; 0x02 276e0: 29 83 std Y+1, r18 ; 0x01 276e2: fe 01 movw r30, r28 276e4: 33 96 adiw r30, 0x03 ; 3 276e6: 2c e0 ldi r18, 0x0C ; 12 276e8: df 01 movw r26, r30 276ea: 1d 92 st X+, r1 276ec: 2a 95 dec r18 276ee: e9 f7 brne .-6 ; 0x276ea 276f0: de 01 movw r26, r28 276f2: 12 96 adiw r26, 0x02 ; 2 276f4: 48 2f mov r20, r24 276f6: fc 01 movw r30, r24 276f8: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 276fa: 8e 2f mov r24, r30 276fc: 84 1b sub r24, r20 276fe: 86 17 cp r24, r22 27700: 40 f4 brcc .+16 ; 0x27712 uint8_t b = txbuff[i]; 27702: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 27704: 90 ee ldi r25, 0xE0 ; 224 27706: 98 0f add r25, r24 27708: 90 36 cpi r25, 0x60 ; 96 2770a: 08 f0 brcs .+2 ; 0x2770e b = '.'; 2770c: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2770e: 8d 93 st X+, r24 27710: f4 cf rjmp .-24 ; 0x276fa } tmp[size + 1] = 0; 27712: f9 01 movw r30, r18 27714: e6 0f add r30, r22 27716: f1 1d adc r31, r1 27718: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2771a: 4e e0 ldi r20, 0x0E ; 14 2771c: 50 e0 ldi r21, 0x00 ; 0 2771e: 6d e7 ldi r22, 0x7D ; 125 27720: 7e e9 ldi r23, 0x9E ; 158 27722: ce 01 movw r24, r28 27724: 01 96 adiw r24, 0x01 ; 1 27726: 0f 94 5c 9e call 0x33cb8 ; 0x33cb8 2772a: 89 2b or r24, r25 2772c: 59 f4 brne .+22 ; 0x27744 2772e: 4e e0 ldi r20, 0x0E ; 14 27730: 50 e0 ldi r21, 0x00 ; 0 27732: be 01 movw r22, r28 27734: 6f 5f subi r22, 0xFF ; 255 27736: 7f 4f sbci r23, 0xFF ; 255 27738: 85 e1 ldi r24, 0x15 ; 21 2773a: 92 e1 ldi r25, 0x12 ; 18 2773c: 0f 94 ef a6 call 0x34dde ; 0x34dde 27740: 89 2b or r24, r25 27742: 61 f0 breq .+24 ; 0x2775c // 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); 27744: 87 e7 ldi r24, 0x77 ; 119 27746: 9e e9 ldi r25, 0x9E ; 158 27748: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2774c: 81 e7 ldi r24, 0x71 ; 113 2774e: 9e e9 ldi r25, 0x9E ; 158 27750: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 27754: ce 01 movw r24, r28 27756: 01 96 adiw r24, 0x01 ; 1 27758: 0f 94 9e 99 call 0x3333c ; 0x3333c } strncpy(lastMsg, tmp, rqs); 2775c: 4e e0 ldi r20, 0x0E ; 14 2775e: 50 e0 ldi r21, 0x00 ; 0 27760: be 01 movw r22, r28 27762: 6f 5f subi r22, 0xFF ; 255 27764: 7f 4f sbci r23, 0xFF ; 255 27766: 85 e1 ldi r24, 0x15 ; 21 27768: 92 e1 ldi r25, 0x12 ; 18 2776a: 0f 94 fd a6 call 0x34dfa ; 0x34dfa } 2776e: 2e 96 adiw r28, 0x0e ; 14 27770: 0f b6 in r0, 0x3f ; 63 27772: f8 94 cli 27774: de bf out 0x3e, r29 ; 62 27776: 0f be out 0x3f, r0 ; 63 27778: cd bf out 0x3d, r28 ; 61 2777a: df 91 pop r29 2777c: cf 91 pop r28 2777e: 08 95 ret 00027780 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 27780: cf 92 push r12 27782: df 92 push r13 27784: ef 92 push r14 27786: ff 92 push r15 27788: 1f 93 push r17 2778a: cf 93 push r28 2778c: df 93 push r29 2778e: cd b7 in r28, 0x3d ; 61 27790: de b7 in r29, 0x3e ; 62 27792: 62 97 sbiw r28, 0x12 ; 18 27794: 0f b6 in r0, 0x3f ; 63 27796: f8 94 cli 27798: de bf out 0x3e, r29 ; 62 2779a: 0f be out 0x3f, r0 ; 63 2779c: cd bf out 0x3d, r28 ; 61 2779e: 4e 87 std Y+14, r20 ; 0x0e 277a0: 5f 87 std Y+15, r21 ; 0x0f 277a2: 68 8b std Y+16, r22 ; 0x10 277a4: 79 8b std Y+17, r23 ; 0x11 277a6: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 277a8: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 277aa: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 277ac: 51 11 cpse r21, r1 277ae: 31 c0 rjmp .+98 ; 0x27812 *dst = '0'; 277b0: 80 e3 ldi r24, 0x30 ; 48 277b2: 8a 83 std Y+2, r24 ; 0x02 return 1; 277b4: 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); 277b6: e1 e0 ldi r30, 0x01 ; 1 277b8: e1 0f add r30, r17 277ba: 81 e0 ldi r24, 0x01 ; 1 277bc: 90 e0 ldi r25, 0x00 ; 0 277be: 8c 0f add r24, r28 277c0: 9d 1f adc r25, r29 277c2: 8e 0f add r24, r30 277c4: 91 1d adc r25, r1 277c6: fc 01 movw r30, r24 277c8: 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 277ca: 9a e2 ldi r25, 0x2A ; 42 277cc: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 277ce: 81 11 cpse r24, r1 277d0: 27 c0 rjmp .+78 ; 0x27820 *dst = '0'; 277d2: 80 e3 ldi r24, 0x30 ; 48 277d4: 81 83 std Z+1, r24 ; 0x01 return 1; 277d6: 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); 277d8: 1e 5f subi r17, 0xFE ; 254 277da: 18 0f add r17, r24 txbuff[i] = '\n'; 277dc: e1 e0 ldi r30, 0x01 ; 1 277de: f0 e0 ldi r31, 0x00 ; 0 277e0: ec 0f add r30, r28 277e2: fd 1f adc r31, r29 277e4: e1 0f add r30, r17 277e6: f1 1d adc r31, r1 277e8: 8a e0 ldi r24, 0x0A ; 10 277ea: 80 83 st Z, r24 ++i; 277ec: 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); 277ee: fe 01 movw r30, r28 277f0: 31 96 adiw r30, 0x01 ; 1 277f2: 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--){ 277f4: 6f 01 movw r12, r30 277f6: c1 0e add r12, r17 277f8: d1 1c adc r13, r1 277fa: ec 14 cp r14, r12 277fc: fd 04 cpc r15, r13 277fe: b1 f0 breq .+44 ; 0x2782c fputc(*buffer, uart2io); 27800: f7 01 movw r30, r14 27802: 81 91 ld r24, Z+ 27804: 7f 01 movw r14, r30 27806: 67 e0 ldi r22, 0x07 ; 7 27808: 72 e1 ldi r23, 0x12 ; 18 2780a: 90 e0 ldi r25, 0x00 ; 0 2780c: 0f 94 e5 9e call 0x33dca ; 0x33dca 27810: f4 cf rjmp .-24 ; 0x277fa 27812: be 01 movw r22, r28 27814: 6e 5f subi r22, 0xFE ; 254 27816: 7f 4f sbci r23, 0xFF ; 255 27818: 0f 94 44 87 call 0x30e88 ; 0x30e88 2781c: 18 2f mov r17, r24 2781e: cb cf rjmp .-106 ; 0x277b6 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); 27820: bf 01 movw r22, r30 27822: 6f 5f subi r22, 0xFF ; 255 27824: 7f 4f sbci r23, 0xFF ; 255 27826: 0f 94 44 87 call 0x30e88 ; 0x30e88 2782a: d6 cf rjmp .-84 ; 0x277d8 LogRequestMsg(txbuff, len); 2782c: 61 2f mov r22, r17 2782e: ce 01 movw r24, r28 27830: 01 96 adiw r24, 0x01 ; 1 27832: 0f 94 63 3b call 0x276c6 ; 0x276c6 RecordUARTActivity(); 27836: 0f 94 ba 3a call 0x27574 ; 0x27574 } 2783a: 62 96 adiw r28, 0x12 ; 18 2783c: 0f b6 in r0, 0x3f ; 63 2783e: f8 94 cli 27840: de bf out 0x3e, r29 ; 62 27842: 0f be out 0x3f, r0 ; 63 27844: cd bf out 0x3d, r28 ; 61 27846: df 91 pop r29 27848: cf 91 pop r28 2784a: 1f 91 pop r17 2784c: ff 90 pop r15 2784e: ef 90 pop r14 27850: df 90 pop r13 27852: cf 90 pop r12 27854: 08 95 ret 00027856 : 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) { 27856: 8f 92 push r8 27858: 9f 92 push r9 2785a: af 92 push r10 2785c: bf 92 push r11 2785e: df 92 push r13 27860: ef 92 push r14 27862: ff 92 push r15 27864: 0f 93 push r16 27866: 1f 93 push r17 27868: cf 93 push r28 2786a: df 93 push r29 2786c: cd b7 in r28, 0x3d ; 61 2786e: de b7 in r29, 0x3e ; 62 27870: 67 97 sbiw r28, 0x17 ; 23 27872: 0f b6 in r0, 0x3f ; 63 27874: f8 94 cli 27876: de bf out 0x3e, r29 ; 62 27878: 0f be out 0x3f, r0 ; 63 2787a: cd bf out 0x3d, r28 ; 61 2787c: 18 2f mov r17, r24 2787e: 7b 01 movw r14, r22 27880: d4 2e mov r13, r20 27882: 07 e5 ldi r16, 0x57 ; 87 27884: 0b 8b std Y+19, r16 ; 0x13 27886: 8c 8b std Y+20, r24 ; 0x14 27888: 7e 8b std Y+22, r23 ; 0x16 2788a: 6d 8b std Y+21, r22 ; 0x15 2788c: ce 01 movw r24, r28 2788e: 43 96 adiw r24, 0x13 ; 19 27890: 0f 94 70 87 call 0x30ee0 ; 0x30ee0 27894: 8f 8b std Y+23, r24 ; 0x17 27896: 0e 87 std Y+14, r16 ; 0x0e 27898: 1f 87 std Y+15, r17 ; 0x0f 2789a: f9 8a std Y+17, r15 ; 0x11 2789c: e8 8a std Y+16, r14 ; 0x10 2789e: ce 01 movw r24, r28 278a0: 0e 96 adiw r24, 0x0e ; 14 278a2: 0f 94 70 87 call 0x30ee0 ; 0x30ee0 278a6: 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; 278a8: 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) { 278aa: 11 11 cpse r17, r1 278ac: 27 c0 rjmp .+78 ; 0x278fc *dst = '0'; 278ae: 80 e3 ldi r24, 0x30 ; 48 278b0: 8a 83 std Y+2, r24 ; 0x02 return 1; 278b2: 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); 278b4: e1 e0 ldi r30, 0x01 ; 1 278b6: e8 0f add r30, r24 dst[i] = ' '; 278b8: 21 e0 ldi r18, 0x01 ; 1 278ba: 30 e0 ldi r19, 0x00 ; 0 278bc: 2c 0f add r18, r28 278be: 3d 1f adc r19, r29 278c0: 2e 0f add r18, r30 278c2: 31 1d adc r19, r1 278c4: f9 01 movw r30, r18 278c6: 90 e2 ldi r25, 0x20 ; 32 278c8: 90 83 st Z, r25 return i + 1; 278ca: 02 e0 ldi r16, 0x02 ; 2 278cc: 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); 278ce: aa 24 eor r10, r10 278d0: a3 94 inc r10 278d2: b1 2c mov r11, r1 278d4: ac 0e add r10, r28 278d6: bd 1e adc r11, r29 278d8: a0 0e add r10, r16 278da: 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) { 278dc: e1 14 cp r14, r1 278de: f1 04 cpc r15, r1 278e0: 39 f1 breq .+78 ; 0x27930 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 278e2: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 278e4: c7 01 movw r24, r14 278e6: 88 27 eor r24, r24 278e8: 90 7f andi r25, 0xF0 ; 240 278ea: 89 2b or r24, r25 278ec: 71 f4 brne .+28 ; 0x2790a value <<= 4U; 278ee: 24 e0 ldi r18, 0x04 ; 4 278f0: ee 0c add r14, r14 278f2: ff 1c adc r15, r15 278f4: 2a 95 dec r18 278f6: e1 f7 brne .-8 ; 0x278f0 --charsOut; 278f8: 11 50 subi r17, 0x01 ; 1 278fa: f4 cf rjmp .-24 ; 0x278e4 278fc: be 01 movw r22, r28 278fe: 6e 5f subi r22, 0xFE ; 254 27900: 7f 4f sbci r23, 0xFF ; 255 27902: 81 2f mov r24, r17 27904: 0f 94 44 87 call 0x30e88 ; 0x30e88 27908: d5 cf rjmp .-86 ; 0x278b4 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2790a: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2790c: 88 2d mov r24, r8 2790e: 8a 19 sub r24, r10 27910: 81 17 cp r24, r17 27912: 90 f4 brcc .+36 ; 0x27938 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 27914: 8f 2d mov r24, r15 27916: 82 95 swap r24 27918: 8f 70 andi r24, 0x0F ; 15 2791a: 94 e0 ldi r25, 0x04 ; 4 2791c: ee 0c add r14, r14 2791e: ff 1c adc r15, r15 27920: 9a 95 dec r25 27922: e1 f7 brne .-8 ; 0x2791c 27924: 0f 94 3a 87 call 0x30e74 ; 0x30e74 27928: f4 01 movw r30, r8 2792a: 81 93 st Z+, r24 2792c: 4f 01 movw r8, r30 2792e: ee cf rjmp .-36 ; 0x2790c } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 27930: 80 e3 ldi r24, 0x30 ; 48 27932: f5 01 movw r30, r10 27934: 80 83 st Z, r24 return 1; 27936: 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); 27938: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2793a: e1 e0 ldi r30, 0x01 ; 1 2793c: f0 e0 ldi r31, 0x00 ; 0 2793e: ec 0f add r30, r28 27940: fd 1f adc r31, r29 27942: e1 0f add r30, r17 27944: f1 1d adc r31, r1 27946: 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 27948: 9a e2 ldi r25, 0x2A ; 42 2794a: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2794c: 81 11 cpse r24, r1 2794e: 21 c0 rjmp .+66 ; 0x27992 *dst = '0'; 27950: 80 e3 ldi r24, 0x30 ; 48 27952: 81 83 std Z+1, r24 ; 0x01 return 1; 27954: 81 e0 ldi r24, 0x01 ; 1 27956: 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); 27958: 18 0f add r17, r24 txbuff[i] = '\n'; 2795a: e1 e0 ldi r30, 0x01 ; 1 2795c: f0 e0 ldi r31, 0x00 ; 0 2795e: ec 0f add r30, r28 27960: fd 1f adc r31, r29 27962: e1 0f add r30, r17 27964: f1 1d adc r31, r1 27966: 8a e0 ldi r24, 0x0A ; 10 27968: 80 83 st Z, r24 ++i; 2796a: 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); 2796c: 9e 01 movw r18, r28 2796e: 2f 5f subi r18, 0xFF ; 255 27970: 3f 4f sbci r19, 0xFF ; 255 27972: 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--){ 27974: 59 01 movw r10, r18 27976: a1 0e add r10, r17 27978: b1 1c adc r11, r1 2797a: ea 14 cp r14, r10 2797c: fb 04 cpc r15, r11 2797e: 79 f0 breq .+30 ; 0x2799e fputc(*buffer, uart2io); 27980: f7 01 movw r30, r14 27982: 81 91 ld r24, Z+ 27984: 7f 01 movw r14, r30 27986: 67 e0 ldi r22, 0x07 ; 7 27988: 72 e1 ldi r23, 0x12 ; 18 2798a: 90 e0 ldi r25, 0x00 ; 0 2798c: 0f 94 e5 9e call 0x33dca ; 0x33dca 27990: f4 cf rjmp .-24 ; 0x2797a 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); 27992: bf 01 movw r22, r30 27994: 6f 5f subi r22, 0xFF ; 255 27996: 7f 4f sbci r23, 0xFF ; 255 27998: 0f 94 44 87 call 0x30e88 ; 0x30e88 2799c: dc cf rjmp .-72 ; 0x27956 LogRequestMsg(txbuff, len); 2799e: 61 2f mov r22, r17 279a0: ce 01 movw r24, r28 279a2: 01 96 adiw r24, 0x01 ; 1 279a4: 0f 94 63 3b call 0x276c6 ; 0x276c6 RecordUARTActivity(); 279a8: 0f 94 ba 3a call 0x27574 ; 0x27574 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 279ac: d0 92 28 12 sts 0x1228, r13 ; 0x801228 } 279b0: 67 96 adiw r28, 0x17 ; 23 279b2: 0f b6 in r0, 0x3f ; 63 279b4: f8 94 cli 279b6: de bf out 0x3e, r29 ; 62 279b8: 0f be out 0x3f, r0 ; 63 279ba: cd bf out 0x3d, r28 ; 61 279bc: df 91 pop r29 279be: cf 91 pop r28 279c0: 1f 91 pop r17 279c2: 0f 91 pop r16 279c4: ff 90 pop r15 279c6: ef 90 pop r14 279c8: df 90 pop r13 279ca: bf 90 pop r11 279cc: af 90 pop r10 279ce: 9f 90 pop r9 279d0: 8f 90 pop r8 279d2: 08 95 ret 000279d4 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 279d4: 20 91 73 12 lds r18, 0x1273 ; 0x801273 279d8: 2f 5f subi r18, 0xFF ; 255 279da: 20 93 73 12 sts 0x1273, r18 ; 0x801273 if (regIndex >= initRegs8Count) { 279de: 22 30 cpi r18, 0x02 ; 2 279e0: 78 f4 brcc .+30 ; 0x27a00 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 279e2: 30 e0 ldi r19, 0x00 ; 0 279e4: f9 01 movw r30, r18 279e6: e8 5f subi r30, 0xF8 ; 248 279e8: f1 46 sbci r31, 0x61 ; 97 279ea: 84 91 lpm r24, Z 279ec: 2f 58 subi r18, 0x8F ; 143 279ee: 3d 4e sbci r19, 0xED ; 237 279f0: f9 01 movw r30, r18 279f2: 60 81 ld r22, Z 279f4: 70 e0 ldi r23, 0x00 ; 0 279f6: 49 e0 ldi r20, 0x09 ; 9 279f8: 0f 94 2b 3c call 0x27856 ; 0x27856 } return false; 279fc: 80 e0 ldi r24, 0x00 ; 0 279fe: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 27a00: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 27a02: 08 95 ret 00027a04 : * \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) { 27a04: 8f 92 push r8 27a06: 9f 92 push r9 27a08: af 92 push r10 27a0a: bf 92 push r11 27a0c: cf 92 push r12 27a0e: df 92 push r13 27a10: ef 92 push r14 27a12: ff 92 push r15 27a14: cf 93 push r28 27a16: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 27a18: 27 ed ldi r18, 0xD7 ; 215 27a1a: 35 e1 ldi r19, 0x15 ; 21 27a1c: 30 93 d7 0d sts 0x0DD7, r19 ; 0x800dd7 27a20: 20 93 d6 0d sts 0x0DD6, r18 ; 0x800dd6 fatType_ = 0; 27a24: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 allocSearchStart_ = 2; 27a28: 42 e0 ldi r20, 0x02 ; 2 27a2a: 50 e0 ldi r21, 0x00 ; 0 27a2c: 60 e0 ldi r22, 0x00 ; 0 27a2e: 70 e0 ldi r23, 0x00 ; 0 27a30: 40 93 dc 15 sts 0x15DC, r20 ; 0x8015dc 27a34: 50 93 dd 15 sts 0x15DD, r21 ; 0x8015dd 27a38: 60 93 de 15 sts 0x15DE, r22 ; 0x8015de 27a3c: 70 93 df 15 sts 0x15DF, r23 ; 0x8015df cacheDirty_ = 0; // cacheFlush() will write block if true 27a40: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheMirrorBlock_ = 0; 27a44: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 27a48: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 27a4c: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 27a50: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 cacheBlockNumber_ = 0XFFFFFFFF; 27a54: 4f ef ldi r20, 0xFF ; 255 27a56: 5f ef ldi r21, 0xFF ; 255 27a58: ba 01 movw r22, r20 27a5a: 40 93 cd 0d sts 0x0DCD, r20 ; 0x800dcd 27a5e: 50 93 ce 0d sts 0x0DCE, r21 ; 0x800dce 27a62: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 27a66: 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) { 27a6a: 88 23 and r24, r24 27a6c: 09 f4 brne .+2 ; 0x27a70 27a6e: 70 c0 rjmp .+224 ; 0x27b50 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27a70: 40 e0 ldi r20, 0x00 ; 0 27a72: 60 e0 ldi r22, 0x00 ; 0 27a74: 70 e0 ldi r23, 0x00 ; 0 27a76: cb 01 movw r24, r22 27a78: 0f 94 09 36 call 0x26c12 ; 0x26c12 27a7c: 81 11 cpse r24, r1 27a7e: 0d c0 rjmp .+26 ; 0x27a9a fatType_ = 32; } return true; fail: return false; 27a80: c0 e0 ldi r28, 0x00 ; 0 } 27a82: 8c 2f mov r24, r28 27a84: df 91 pop r29 27a86: cf 91 pop r28 27a88: ff 90 pop r15 27a8a: ef 90 pop r14 27a8c: df 90 pop r13 27a8e: cf 90 pop r12 27a90: bf 90 pop r11 27a92: af 90 pop r10 27a94: 9f 90 pop r9 27a96: 8f 90 pop r8 27a98: 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 || 27a9a: 80 91 97 0f lds r24, 0x0F97 ; 0x800f97 27a9e: 8f 77 andi r24, 0x7F ; 127 27aa0: 79 f7 brne .-34 ; 0x27a80 27aa2: 80 91 a3 0f lds r24, 0x0FA3 ; 0x800fa3 27aa6: 90 91 a4 0f lds r25, 0x0FA4 ; 0x800fa4 27aaa: a0 91 a5 0f lds r26, 0x0FA5 ; 0x800fa5 27aae: b0 91 a6 0f lds r27, 0x0FA6 ; 0x800fa6 27ab2: 84 36 cpi r24, 0x64 ; 100 27ab4: 91 05 cpc r25, r1 27ab6: a1 05 cpc r26, r1 27ab8: b1 05 cpc r27, r1 27aba: 10 f3 brcs .-60 ; 0x27a80 p->totalSectors < 100 || p->firstSector == 0) { 27abc: c0 90 9f 0f lds r12, 0x0F9F ; 0x800f9f 27ac0: d0 90 a0 0f lds r13, 0x0FA0 ; 0x800fa0 27ac4: e0 90 a1 0f lds r14, 0x0FA1 ; 0x800fa1 27ac8: 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 || 27acc: c1 14 cp r12, r1 27ace: d1 04 cpc r13, r1 27ad0: e1 04 cpc r14, r1 27ad2: f1 04 cpc r15, r1 27ad4: a9 f2 breq .-86 ; 0x27a80 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27ad6: 40 e0 ldi r20, 0x00 ; 0 27ad8: c7 01 movw r24, r14 27ada: b6 01 movw r22, r12 27adc: 0f 94 09 36 call 0x26c12 ; 0x26c12 27ae0: c8 2f mov r28, r24 27ae2: 88 23 and r24, r24 27ae4: 69 f2 breq .-102 ; 0x27a80 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 27ae6: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 27aea: 90 91 e5 0d lds r25, 0x0DE5 ; 0x800de5 27aee: 81 15 cp r24, r1 27af0: 92 40 sbci r25, 0x02 ; 2 27af2: 31 f6 brne .-116 ; 0x27a80 fbs->fatCount == 0 || 27af4: 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 || 27af8: aa 23 and r26, r26 27afa: 11 f2 breq .-124 ; 0x27a80 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 27afc: 60 91 e7 0d lds r22, 0x0DE7 ; 0x800de7 27b00: 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 || 27b04: 61 15 cp r22, r1 27b06: 71 05 cpc r23, r1 27b08: 09 f4 brne .+2 ; 0x27b0c 27b0a: ba cf rjmp .-140 ; 0x27a80 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 27b0c: 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 || 27b10: 22 23 and r18, r18 27b12: 09 f4 brne .+2 ; 0x27b16 27b14: b5 cf rjmp .-150 ; 0x27a80 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 27b16: a0 93 ee 15 sts 0x15EE, r26 ; 0x8015ee blocksPerCluster_ = fbs->sectorsPerCluster; 27b1a: 20 93 e0 15 sts 0x15E0, r18 ; 0x8015e0 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 27b1e: 90 e0 ldi r25, 0x00 ; 0 27b20: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 27b22: 30 e0 ldi r19, 0x00 ; 0 27b24: e1 e0 ldi r30, 0x01 ; 1 27b26: f0 e0 ldi r31, 0x00 ; 0 27b28: d8 2f mov r29, r24 27b2a: af 01 movw r20, r30 27b2c: 08 2e mov r0, r24 27b2e: 02 c0 rjmp .+4 ; 0x27b34 27b30: 44 0f add r20, r20 27b32: 55 1f adc r21, r21 27b34: 0a 94 dec r0 27b36: e2 f7 brpl .-8 ; 0x27b30 27b38: 24 17 cp r18, r20 27b3a: 35 07 cpc r19, r21 27b3c: 69 f0 breq .+26 ; 0x27b58 27b3e: 41 e0 ldi r20, 0x01 ; 1 27b40: 48 0f add r20, r24 27b42: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 27b44: 89 30 cpi r24, 0x09 ; 9 27b46: 91 05 cpc r25, r1 27b48: 79 f7 brne .-34 ; 0x27b28 27b4a: 40 93 e9 15 sts 0x15E9, r20 ; 0x8015e9 27b4e: 98 cf rjmp .-208 ; 0x27a80 * 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; 27b50: c1 2c mov r12, r1 27b52: d1 2c mov r13, r1 27b54: 76 01 movw r14, r12 27b56: bf cf rjmp .-130 ; 0x27ad6 27b58: 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 ? 27b5c: 20 91 ef 0d lds r18, 0x0DEF ; 0x800def 27b60: 30 91 f0 0d lds r19, 0x0DF0 ; 0x800df0 27b64: 50 e0 ldi r21, 0x00 ; 0 27b66: 40 e0 ldi r20, 0x00 ; 0 27b68: 21 15 cp r18, r1 27b6a: 31 05 cpc r19, r1 27b6c: 41 f4 brne .+16 ; 0x27b7e 27b6e: 20 91 fd 0d lds r18, 0x0DFD ; 0x800dfd 27b72: 30 91 fe 0d lds r19, 0x0DFE ; 0x800dfe 27b76: 40 91 ff 0d lds r20, 0x0DFF ; 0x800dff 27b7a: 50 91 00 0e lds r21, 0x0E00 ; 0x800e00 27b7e: 20 93 e1 15 sts 0x15E1, r18 ; 0x8015e1 27b82: 30 93 e2 15 sts 0x15E2, r19 ; 0x8015e2 27b86: 40 93 e3 15 sts 0x15E3, r20 ; 0x8015e3 27b8a: 50 93 e4 15 sts 0x15E4, r21 ; 0x8015e4 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 27b8e: 46 01 movw r8, r12 27b90: 57 01 movw r10, r14 27b92: 86 0e add r8, r22 27b94: 97 1e adc r9, r23 27b96: a1 1c adc r10, r1 27b98: b1 1c adc r11, r1 27b9a: 80 92 ef 15 sts 0x15EF, r8 ; 0x8015ef 27b9e: 90 92 f0 15 sts 0x15F0, r9 ; 0x8015f0 27ba2: a0 92 f1 15 sts 0x15F1, r10 ; 0x8015f1 27ba6: b0 92 f2 15 sts 0x15F2, r11 ; 0x8015f2 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 27baa: e0 91 ea 0d lds r30, 0x0DEA ; 0x800dea 27bae: f0 91 eb 0d lds r31, 0x0DEB ; 0x800deb 27bb2: f0 93 f5 15 sts 0x15F5, r31 ; 0x8015f5 27bb6: e0 93 f4 15 sts 0x15F4, r30 ; 0x8015f4 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 27bba: b0 e0 ldi r27, 0x00 ; 0 27bbc: 0f 94 12 a1 call 0x34224 ; 0x34224 <__muluhisi3> 27bc0: dc 01 movw r26, r24 27bc2: cb 01 movw r24, r22 27bc4: 88 0d add r24, r8 27bc6: 99 1d adc r25, r9 27bc8: aa 1d adc r26, r10 27bca: bb 1d adc r27, r11 27bcc: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27bd0: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27bd4: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27bd8: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 27bdc: 25 e0 ldi r18, 0x05 ; 5 27bde: ee 0f add r30, r30 27be0: ff 1f adc r31, r31 27be2: 2a 95 dec r18 27be4: e1 f7 brne .-8 ; 0x27bde 27be6: e1 50 subi r30, 0x01 ; 1 27be8: fe 4f sbci r31, 0xFE ; 254 27bea: ef 2f mov r30, r31 27bec: ff 27 eor r31, r31 27bee: e6 95 lsr r30 27bf0: 8e 0f add r24, r30 27bf2: 9f 1f adc r25, r31 27bf4: a1 1d adc r26, r1 27bf6: b1 1d adc r27, r1 27bf8: 80 93 ea 15 sts 0x15EA, r24 ; 0x8015ea 27bfc: 90 93 eb 15 sts 0x15EB, r25 ; 0x8015eb 27c00: a0 93 ec 15 sts 0x15EC, r26 ; 0x8015ec 27c04: b0 93 ed 15 sts 0x15ED, r27 ; 0x8015ed // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 27c08: 80 90 ec 0d lds r8, 0x0DEC ; 0x800dec 27c0c: 90 90 ed 0d lds r9, 0x0DED ; 0x800ded 27c10: b1 2c mov r11, r1 27c12: a1 2c mov r10, r1 27c14: 81 14 cp r8, r1 27c16: 91 04 cpc r9, r1 27c18: 41 f4 brne .+16 ; 0x27c2a 27c1a: 80 90 f9 0d lds r8, 0x0DF9 ; 0x800df9 27c1e: 90 90 fa 0d lds r9, 0x0DFA ; 0x800dfa 27c22: a0 90 fb 0d lds r10, 0x0DFB ; 0x800dfb 27c26: b0 90 fc 0d lds r11, 0x0DFC ; 0x800dfc fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 27c2a: c8 1a sub r12, r24 27c2c: d9 0a sbc r13, r25 27c2e: ea 0a sbc r14, r26 27c30: fb 0a sbc r15, r27 27c32: c8 0c add r12, r8 27c34: d9 1c adc r13, r9 27c36: ea 1c adc r14, r10 27c38: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 27c3a: 04 c0 rjmp .+8 ; 0x27c44 27c3c: f6 94 lsr r15 27c3e: e7 94 ror r14 27c40: d7 94 ror r13 27c42: c7 94 ror r12 27c44: da 95 dec r29 27c46: d2 f7 brpl .-12 ; 0x27c3c 27c48: c0 92 e5 15 sts 0x15E5, r12 ; 0x8015e5 27c4c: d0 92 e6 15 sts 0x15E6, r13 ; 0x8015e6 27c50: e0 92 e7 15 sts 0x15E7, r14 ; 0x8015e7 27c54: f0 92 e8 15 sts 0x15E8, r15 ; 0x8015e8 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 27c58: 85 ef ldi r24, 0xF5 ; 245 27c5a: c8 16 cp r12, r24 27c5c: 8f e0 ldi r24, 0x0F ; 15 27c5e: d8 06 cpc r13, r24 27c60: e1 04 cpc r14, r1 27c62: f1 04 cpc r15, r1 27c64: 20 f4 brcc .+8 ; 0x27c6e fatType_ = 12; 27c66: 8c e0 ldi r24, 0x0C ; 12 27c68: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27c6c: 09 cf rjmp .-494 ; 0x27a80 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 27c6e: 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) { 27c70: 25 ef ldi r18, 0xF5 ; 245 27c72: c2 16 cp r12, r18 27c74: 2f ef ldi r18, 0xFF ; 255 27c76: d2 06 cpc r13, r18 27c78: e1 04 cpc r14, r1 27c7a: f1 04 cpc r15, r1 27c7c: 88 f0 brcs .+34 ; 0x27ca0 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 27c7e: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 27c82: 90 91 06 0e lds r25, 0x0E06 ; 0x800e06 27c86: a0 91 07 0e lds r26, 0x0E07 ; 0x800e07 27c8a: b0 91 08 0e lds r27, 0x0E08 ; 0x800e08 27c8e: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27c92: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27c96: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27c9a: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 fatType_ = 32; 27c9e: 80 e2 ldi r24, 0x20 ; 32 27ca0: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27ca4: ee ce rjmp .-548 ; 0x27a82 00027ca6 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 27ca6: 0f 93 push r16 27ca8: 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_ ){ 27caa: 60 91 17 16 lds r22, 0x1617 ; 0x801617 27cae: 70 91 18 16 lds r23, 0x1618 ; 0x801618 27cb2: 80 91 19 16 lds r24, 0x1619 ; 0x801619 27cb6: 90 91 1a 16 lds r25, 0x161A ; 0x80161a 27cba: 00 91 cd 0d lds r16, 0x0DCD ; 0x800dcd 27cbe: 10 91 ce 0d lds r17, 0x0DCE ; 0x800dce 27cc2: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 27cc6: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 27cca: 60 17 cp r22, r16 27ccc: 71 07 cpc r23, r17 27cce: 82 07 cpc r24, r18 27cd0: 93 07 cpc r25, r19 27cd2: 39 f1 breq .+78 ; 0x27d22 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 27cd4: 40 e0 ldi r20, 0x00 ; 0 27cd6: 0f 94 09 36 call 0x26c12 ; 0x26c12 27cda: 88 23 and r24, r24 27cdc: f9 f0 breq .+62 ; 0x27d1c return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 27cde: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 27ce2: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 27ce6: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 27cea: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 27cee: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 27cf2: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 27cf6: 42 1b sub r20, r18 27cf8: 53 0b sbc r21, r19 27cfa: 61 09 sbc r22, r1 27cfc: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 27cfe: 41 30 cpi r20, 0x01 ; 1 27d00: 92 e0 ldi r25, 0x02 ; 2 27d02: 59 07 cpc r21, r25 27d04: 61 05 cpc r22, r1 27d06: 71 05 cpc r23, r1 27d08: 20 f0 brcs .+8 ; 0x27d12 27d0a: 40 e0 ldi r20, 0x00 ; 0 27d0c: 52 e0 ldi r21, 0x02 ; 2 27d0e: 60 e0 ldi r22, 0x00 ; 0 27d10: 70 e0 ldi r23, 0x00 ; 0 27d12: 47 52 subi r20, 0x27 ; 39 27d14: 52 4f sbci r21, 0xF2 ; 242 27d16: 9a e0 ldi r25, 0x0A ; 10 27d18: fa 01 movw r30, r20 27d1a: 90 83 st Z, r25 } return true; } 27d1c: 1f 91 pop r17 27d1e: 0f 91 pop r16 27d20: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 27d22: 81 e0 ldi r24, 0x01 ; 1 27d24: fb cf rjmp .-10 ; 0x27d1c 00027d26 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 27d26: 20 e0 ldi r18, 0x00 ; 0 27d28: 30 e0 ldi r19, 0x00 ; 0 27d2a: 40 ea ldi r20, 0xA0 ; 160 27d2c: 52 e4 ldi r21, 0x42 ; 66 27d2e: 60 e0 ldi r22, 0x00 ; 0 27d30: 70 e0 ldi r23, 0x00 ; 0 27d32: 80 ea ldi r24, 0xA0 ; 160 27d34: 92 ec ldi r25, 0xC2 ; 194 27d36: 0d 94 a3 87 jmp 0x30f46 ; 0x30f46 00027d3a : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 27d3a: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27d3e: 91 fd sbrc r25, 1 27d40: 17 c0 rjmp .+46 ; 0x27d70 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 27d42: 88 23 and r24, r24 27d44: a9 f0 breq .+42 ; 0x27d70 27d46: 92 fd sbrc r25, 2 27d48: 13 c0 rjmp .+38 ; 0x27d70 Disable_E0(); 27d4a: 0f 94 a1 87 call 0x30f42 ; 0x30f42 resume_hotend_temp = thermal_degTargetHotend(); 27d4e: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 27d52: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 27d56: 90 93 8a 12 sts 0x128A, r25 ; 0x80128a 27d5a: 80 93 89 12 sts 0x1289, r24 ; 0x801289 mmu_print_saved |= SavedState::CooldownPending; 27d5e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27d62: 84 60 ori r24, 0x04 ; 4 27d64: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Heater cooldown pending")); 27d68: 85 ed ldi r24, 0xD5 ; 213 27d6a: 9a e9 ldi r25, 0x9A ; 154 27d6c: 0d 94 c7 87 jmp 0x30f8e ; 0x30f8e } } 27d70: 08 95 ret 00027d72 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 27d72: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27d76: 80 ff sbrs r24, 0 27d78: 45 c0 rjmp .+138 ; 0x27e04 LogEchoEvent_P(PSTR("Resuming XYZ")); 27d7a: 8d ee ldi r24, 0xED ; 237 27d7c: 9a e9 ldi r25, 0x9A ; 154 27d7e: 0f 94 c7 87 call 0x30f8e ; 0x30f8e // 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)); 27d82: 80 91 81 12 lds r24, 0x1281 ; 0x801281 27d86: 90 91 82 12 lds r25, 0x1282 ; 0x801282 27d8a: a0 91 83 12 lds r26, 0x1283 ; 0x801283 27d8e: 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; 27d92: 40 91 7d 12 lds r20, 0x127D ; 0x80127d 27d96: 50 91 7e 12 lds r21, 0x127E ; 0x80127e 27d9a: 60 91 7f 12 lds r22, 0x127F ; 0x80127f 27d9e: 70 91 80 12 lds r23, 0x1280 ; 0x801280 27da2: 40 93 f5 11 sts 0x11F5, r20 ; 0x8011f5 27da6: 50 93 f6 11 sts 0x11F6, r21 ; 0x8011f6 27daa: 60 93 f7 11 sts 0x11F7, r22 ; 0x8011f7 27dae: 70 93 f8 11 sts 0x11F8, r23 ; 0x8011f8 current_position[Y_AXIS] = ry; 27db2: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 27db6: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 27dba: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 27dbe: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc planner_line_to_current_position_sync(feedRate_mm_s); 27dc2: 60 e0 ldi r22, 0x00 ; 0 27dc4: 70 e0 ldi r23, 0x00 ; 0 27dc6: 88 e4 ldi r24, 0x48 ; 72 27dc8: 92 e4 ldi r25, 0x42 ; 66 27dca: 0f 94 c3 87 call 0x30f86 ; 0x30f86 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 27dce: 80 91 85 12 lds r24, 0x1285 ; 0x801285 27dd2: 90 91 86 12 lds r25, 0x1286 ; 0x801286 27dd6: a0 91 87 12 lds r26, 0x1287 ; 0x801287 27dda: b0 91 88 12 lds r27, 0x1288 ; 0x801288 27dde: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 27de2: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 27de6: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 27dea: b0 93 00 12 sts 0x1200, r27 ; 0x801200 planner_line_to_current_position_sync(feedRate_mm_s); 27dee: 60 e0 ldi r22, 0x00 ; 0 27df0: 70 e0 ldi r23, 0x00 ; 0 27df2: 80 e7 ldi r24, 0x70 ; 112 27df4: 91 e4 ldi r25, 0x41 ; 65 27df6: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // 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); 27dfa: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27dfe: 8e 7f andi r24, 0xFE ; 254 27e00: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } } 27e04: 08 95 ret 00027e06 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 27e06: 0f 93 push r16 27e08: 1f 93 push r17 27e0a: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 27e0c: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27e10: 91 11 cpse r25, r1 27e12: 72 c0 rjmp .+228 ; 0x27ef8 27e14: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 27e16: 82 ec ldi r24, 0xC2 ; 194 27e18: 9a e9 ldi r25, 0x9A ; 154 27e1a: 0f 94 c7 87 call 0x30f8e ; 0x30f8e Disable_E0(); 27e1e: 0f 94 a1 87 call 0x30f42 ; 0x30f42 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 27e22: 0f 94 14 22 call 0x24428 ; 0x24428 /// 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; 27e26: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 27e2a: 81 11 cpse r24, r1 27e2c: 02 c0 rjmp .+4 ; 0x27e32 27e2e: 0e 94 b9 5e call 0xbd72 ; 0xbd72 // 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) { 27e32: cc 23 and r28, r28 27e34: 09 f4 brne .+2 ; 0x27e38 27e36: 60 c0 rjmp .+192 ; 0x27ef8 mmu_print_saved |= SavedState::ParkExtruder; 27e38: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27e3c: 81 60 ori r24, 0x01 ; 1 27e3e: 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]); 27e42: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 27e46: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 27e4a: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 27e4e: b0 91 00 12 lds r27, 0x1200 ; 0x801200 27e52: 40 91 f9 11 lds r20, 0x11F9 ; 0x8011f9 27e56: 50 91 fa 11 lds r21, 0x11FA ; 0x8011fa 27e5a: 60 91 fb 11 lds r22, 0x11FB ; 0x8011fb 27e5e: 70 91 fc 11 lds r23, 0x11FC ; 0x8011fc resume_position = planner_current_position(); // save current pos 27e62: 00 91 f5 11 lds r16, 0x11F5 ; 0x8011f5 27e66: 10 91 f6 11 lds r17, 0x11F6 ; 0x8011f6 27e6a: 20 91 f7 11 lds r18, 0x11F7 ; 0x8011f7 27e6e: 30 91 f8 11 lds r19, 0x11F8 ; 0x8011f8 27e72: 00 93 7d 12 sts 0x127D, r16 ; 0x80127d 27e76: 10 93 7e 12 sts 0x127E, r17 ; 0x80127e 27e7a: 20 93 7f 12 sts 0x127F, r18 ; 0x80127f 27e7e: 30 93 80 12 sts 0x1280, r19 ; 0x801280 27e82: 40 93 81 12 sts 0x1281, r20 ; 0x801281 27e86: 50 93 82 12 sts 0x1282, r21 ; 0x801282 27e8a: 60 93 83 12 sts 0x1283, r22 ; 0x801283 27e8e: 70 93 84 12 sts 0x1284, r23 ; 0x801284 27e92: 80 93 85 12 sts 0x1285, r24 ; 0x801285 27e96: 90 93 86 12 sts 0x1286, r25 ; 0x801286 27e9a: a0 93 87 12 sts 0x1287, r26 ; 0x801287 27e9e: 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); 27ea2: 60 e0 ldi r22, 0x00 ; 0 27ea4: 70 e0 ldi r23, 0x00 ; 0 27ea6: 80 ea ldi r24, 0xA0 ; 160 27ea8: 91 e4 ldi r25, 0x41 ; 65 27eaa: 0e 94 68 67 call 0xced0 ; 0xced0 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 27eae: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 27eb2: 88 23 and r24, r24 27eb4: 09 f1 breq .+66 ; 0x27ef8 27eb6: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 27eba: 88 23 and r24, r24 27ebc: e9 f0 breq .+58 ; 0x27ef8 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; 27ebe: 80 e0 ldi r24, 0x00 ; 0 27ec0: 90 e0 ldi r25, 0x00 ; 0 27ec2: aa ef ldi r26, 0xFA ; 250 27ec4: b2 e4 ldi r27, 0x42 ; 66 27ec6: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 27eca: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 27ece: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 27ed2: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 27ed6: 10 92 f9 11 sts 0x11F9, r1 ; 0x8011f9 27eda: 10 92 fa 11 sts 0x11FA, r1 ; 0x8011fa 27ede: 10 92 fb 11 sts 0x11FB, r1 ; 0x8011fb 27ee2: 10 92 fc 11 sts 0x11FC, r1 ; 0x8011fc planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 27ee6: 60 e0 ldi r22, 0x00 ; 0 27ee8: 70 e0 ldi r23, 0x00 ; 0 27eea: 88 e4 ldi r24, 0x48 ; 72 27eec: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 27eee: cf 91 pop r28 27ef0: 1f 91 pop r17 27ef2: 0f 91 pop r16 27ef4: 0d 94 c3 87 jmp 0x30f86 ; 0x30f86 27ef8: cf 91 pop r28 27efa: 1f 91 pop r17 27efc: 0f 91 pop r16 27efe: 08 95 ret 00027f00 : 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){ 27f00: ef 92 push r14 27f02: ff 92 push r15 27f04: 0f 93 push r16 27f06: 1f 93 push r17 27f08: cf 93 push r28 27f0a: df 93 push r29 27f0c: 1f 92 push r1 27f0e: 1f 92 push r1 27f10: cd b7 in r28, 0x3d ; 61 27f12: de b7 in r29, 0x3e ; 62 27f14: f8 2e mov r15, r24 27f16: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 27f18: 80 e1 ldi r24, 0x10 ; 16 27f1a: 97 e2 ldi r25, 0x27 ; 39 27f1c: 9a 83 std Y+2, r25 ; 0x02 27f1e: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 27f20: 8a 01 movw r16, r20 27f22: 16 95 lsr r17 27f24: 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); 27f26: 8f 2d mov r24, r15 27f28: 0e 94 74 c2 call 0x184e8 ; 0x184e8 while (steps--){ 27f2c: 01 50 subi r16, 0x01 ; 1 27f2e: 11 09 sbc r17, r1 27f30: 78 f0 brcs .+30 ; 0x27f50 accelerate_1_step(axes, acc, delay_us, min_delay_us); 27f32: 28 ec ldi r18, 0xC8 ; 200 27f34: 30 e0 ldi r19, 0x00 ; 0 27f36: ae 01 movw r20, r28 27f38: 4f 5f subi r20, 0xFF ; 255 27f3a: 5f 4f sbci r21, 0xFF ; 255 27f3c: 68 ee ldi r22, 0xE8 ; 232 27f3e: 73 e0 ldi r23, 0x03 ; 3 27f40: 8f 2d mov r24, r15 27f42: 0e 94 43 c1 call 0x18286 ; 0x18286 update_position_1_step(axes, dir); 27f46: 6e 2d mov r22, r14 27f48: 8f 2d mov r24, r15 27f4a: 0e 94 8d c2 call 0x1851a ; 0x1851a 27f4e: ee cf rjmp .-36 ; 0x27f2c } /// \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); 27f50: 6e 2d mov r22, r14 27f52: 8f 2d mov r24, r15 27f54: 0e 94 74 c2 call 0x184e8 ; 0x184e8 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); } 27f58: 0f 90 pop r0 27f5a: 0f 90 pop r0 27f5c: df 91 pop r29 27f5e: cf 91 pop r28 27f60: 1f 91 pop r17 27f62: 0f 91 pop r16 27f64: ff 90 pop r15 27f66: ef 90 pop r14 27f68: 08 95 ret 00027f6a : 27f6a: ef 92 push r14 27f6c: ff 92 push r15 27f6e: 0f 93 push r16 27f70: 1f 93 push r17 27f72: cf 93 push r28 27f74: df 93 push r29 27f76: cd b7 in r28, 0x3d ; 61 27f78: de b7 in r29, 0x3e ; 62 27f7a: 2f 97 sbiw r28, 0x0f ; 15 27f7c: 0f b6 in r0, 0x3f ; 63 27f7e: f8 94 cli 27f80: de bf out 0x3e, r29 ; 62 27f82: 0f be out 0x3f, r0 ; 63 27f84: cd bf out 0x3d, r28 ; 61 27f86: 10 92 23 12 sts 0x1223, r1 ; 0x801223 27f8a: 05 e2 ldi r16, 0x25 ; 37 27f8c: 12 e1 ldi r17, 0x12 ; 18 27f8e: ee 24 eor r14, r14 27f90: e3 94 inc r14 27f92: f1 2c mov r15, r1 27f94: d8 01 movw r26, r16 27f96: 11 96 adiw r26, 0x01 ; 1 27f98: fc 92 st X, r15 27f9a: ee 92 st -X, r14 27f9c: 12 96 adiw r26, 0x02 ; 2 27f9e: 1c 92 st X, r1 27fa0: 12 97 sbiw r26, 0x02 ; 2 27fa2: 82 e8 ldi r24, 0x82 ; 130 27fa4: 13 96 adiw r26, 0x03 ; 3 27fa6: 8c 93 st X, r24 27fa8: 40 e0 ldi r20, 0x00 ; 0 27faa: 60 e0 ldi r22, 0x00 ; 0 27fac: 8a e2 ldi r24, 0x2A ; 42 27fae: 92 e1 ldi r25, 0x12 ; 18 27fb0: 0f 94 94 87 call 0x30f28 ; 0x30f28 27fb4: 40 e0 ldi r20, 0x00 ; 0 27fb6: 60 e0 ldi r22, 0x00 ; 0 27fb8: 8f e2 ldi r24, 0x2F ; 47 27fba: 92 e1 ldi r25, 0x12 ; 18 27fbc: 0f 94 94 87 call 0x30f28 ; 0x30f28 27fc0: f8 01 movw r30, r16 27fc2: 17 86 std Z+15, r1 ; 0x0f 27fc4: 10 8a std Z+16, r1 ; 0x10 27fc6: 11 8a std Z+17, r1 ; 0x11 27fc8: 12 8a std Z+18, r1 ; 0x12 27fca: 13 8a std Z+19, r1 ; 0x13 27fcc: 8a e0 ldi r24, 0x0A ; 10 27fce: 84 8b std Z+20, r24 ; 0x14 27fd0: 40 e0 ldi r20, 0x00 ; 0 27fd2: 60 e0 ldi r22, 0x00 ; 0 27fd4: ce 01 movw r24, r28 27fd6: 01 96 adiw r24, 0x01 ; 1 27fd8: 0f 94 94 87 call 0x30f28 ; 0x30f28 27fdc: 85 e0 ldi r24, 0x05 ; 5 27fde: fe 01 movw r30, r28 27fe0: 31 96 adiw r30, 0x01 ; 1 27fe2: de 01 movw r26, r28 27fe4: 16 96 adiw r26, 0x06 ; 6 27fe6: 01 90 ld r0, Z+ 27fe8: 0d 92 st X+, r0 27fea: 8a 95 dec r24 27fec: e1 f7 brne .-8 ; 0x27fe6 27fee: 85 e0 ldi r24, 0x05 ; 5 27ff0: fe 01 movw r30, r28 27ff2: 36 96 adiw r30, 0x06 ; 6 27ff4: aa e3 ldi r26, 0x3A ; 58 27ff6: b2 e1 ldi r27, 0x12 ; 18 27ff8: 01 90 ld r0, Z+ 27ffa: 0d 92 st X+, r0 27ffc: 8a 95 dec r24 27ffe: e1 f7 brne .-8 ; 0x27ff8 28000: d8 01 movw r26, r16 28002: 5a 96 adiw r26, 0x1a ; 26 28004: 1c 92 st X, r1 28006: 5a 97 sbiw r26, 0x1a ; 26 28008: 5c 96 adiw r26, 0x1c ; 28 2800a: 1c 92 st X, r1 2800c: 1e 92 st -X, r1 2800e: 5b 97 sbiw r26, 0x1b ; 27 28010: 8a e3 ldi r24, 0x3A ; 58 28012: 92 e1 ldi r25, 0x12 ; 18 28014: 0f 94 83 87 call 0x30f06 ; 0x30f06 28018: f8 01 movw r30, r16 2801a: 81 8f std Z+25, r24 ; 0x19 2801c: 15 8e std Z+29, r1 ; 0x1d 2801e: 16 8e std Z+30, r1 ; 0x1e 28020: 40 e0 ldi r20, 0x00 ; 0 28022: 60 e0 ldi r22, 0x00 ; 0 28024: 84 e4 ldi r24, 0x44 ; 68 28026: 92 e1 ldi r25, 0x12 ; 18 28028: 0f 94 94 87 call 0x30f28 ; 0x30f28 2802c: d8 01 movw r26, r16 2802e: 94 96 adiw r26, 0x24 ; 36 28030: 1c 92 st X, r1 28032: 40 e0 ldi r20, 0x00 ; 0 28034: 60 e0 ldi r22, 0x00 ; 0 28036: ce 01 movw r24, r28 28038: 0b 96 adiw r24, 0x0b ; 11 2803a: 0f 94 94 87 call 0x30f28 ; 0x30f28 2803e: 85 e0 ldi r24, 0x05 ; 5 28040: fe 01 movw r30, r28 28042: 3b 96 adiw r30, 0x0b ; 11 28044: de 01 movw r26, r28 28046: 11 96 adiw r26, 0x01 ; 1 28048: 01 90 ld r0, Z+ 2804a: 0d 92 st X+, r0 2804c: 8a 95 dec r24 2804e: e1 f7 brne .-8 ; 0x28048 28050: 85 e0 ldi r24, 0x05 ; 5 28052: fe 01 movw r30, r28 28054: 31 96 adiw r30, 0x01 ; 1 28056: aa e4 ldi r26, 0x4A ; 74 28058: b2 e1 ldi r27, 0x12 ; 18 2805a: 01 90 ld r0, Z+ 2805c: 0d 92 st X+, r0 2805e: 8a 95 dec r24 28060: e1 f7 brne .-8 ; 0x2805a 28062: f8 01 movw r30, r16 28064: 12 a6 std Z+42, r1 ; 0x2a 28066: 14 a6 std Z+44, r1 ; 0x2c 28068: 13 a6 std Z+43, r1 ; 0x2b 2806a: 8a e4 ldi r24, 0x4A ; 74 2806c: 92 e1 ldi r25, 0x12 ; 18 2806e: 0f 94 83 87 call 0x30f06 ; 0x30f06 28072: d8 01 movw r26, r16 28074: 99 96 adiw r26, 0x29 ; 41 28076: 8c 93 st X, r24 28078: 99 97 sbiw r26, 0x29 ; 41 2807a: dd 96 adiw r26, 0x3d ; 61 2807c: 1c 92 st X, r1 2807e: dd 97 sbiw r26, 0x3d ; 61 28080: 84 e2 ldi r24, 0x24 ; 36 28082: 92 e1 ldi r25, 0x12 ; 18 28084: df 96 adiw r26, 0x3f ; 63 28086: 9c 93 st X, r25 28088: 8e 93 st -X, r24 2808a: de 97 sbiw r26, 0x3e ; 62 2808c: f0 92 66 12 sts 0x1266, r15 ; 0x801266 28090: e0 92 65 12 sts 0x1265, r14 ; 0x801265 28094: 10 92 67 12 sts 0x1267, r1 ; 0x801267 28098: 1f ef ldi r17, 0xFF ; 255 2809a: 10 93 68 12 sts 0x1268, r17 ; 0x801268 2809e: 0f 94 d7 87 call 0x30fae ; 0x30fae 280a2: 80 93 69 12 sts 0x1269, r24 ; 0x801269 280a6: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 280aa: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 280ae: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c 280b2: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 280b6: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 280ba: 10 92 70 12 sts 0x1270, r1 ; 0x801270 280be: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 280c2: 10 92 73 12 sts 0x1273, r1 ; 0x801273 280c6: 10 92 74 12 sts 0x1274, r1 ; 0x801274 280ca: 10 92 75 12 sts 0x1275, r1 ; 0x801275 280ce: 10 92 76 12 sts 0x1276, r1 ; 0x801276 280d2: 83 e0 ldi r24, 0x03 ; 3 280d4: 80 93 79 12 sts 0x1279, r24 ; 0x801279 280d8: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a 280dc: 85 e0 ldi r24, 0x05 ; 5 280de: 80 93 71 12 sts 0x1271, r24 ; 0x801271 280e2: 84 e1 ldi r24, 0x14 ; 20 280e4: 80 93 72 12 sts 0x1272, r24 ; 0x801272 280e8: 83 e6 ldi r24, 0x63 ; 99 280ea: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b 280ee: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c 280f2: 10 92 7d 12 sts 0x127D, r1 ; 0x80127d 280f6: 10 92 7e 12 sts 0x127E, r1 ; 0x80127e 280fa: 10 92 7f 12 sts 0x127F, r1 ; 0x80127f 280fe: 10 92 80 12 sts 0x1280, r1 ; 0x801280 28102: 10 92 81 12 sts 0x1281, r1 ; 0x801281 28106: 10 92 82 12 sts 0x1282, r1 ; 0x801282 2810a: 10 92 83 12 sts 0x1283, r1 ; 0x801283 2810e: 10 92 84 12 sts 0x1284, r1 ; 0x801284 28112: 10 92 85 12 sts 0x1285, r1 ; 0x801285 28116: 10 92 86 12 sts 0x1286, r1 ; 0x801286 2811a: 10 92 87 12 sts 0x1287, r1 ; 0x801287 2811e: 10 92 88 12 sts 0x1288, r1 ; 0x801288 28122: 10 92 8a 12 sts 0x128A, r1 ; 0x80128a 28126: 10 92 89 12 sts 0x1289, r1 ; 0x801289 2812a: 10 92 8b 12 sts 0x128B, r1 ; 0x80128b 2812e: 8e e2 ldi r24, 0x2E ; 46 28130: 90 e8 ldi r25, 0x80 ; 128 28132: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 28136: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c 2813a: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e 2813e: 10 93 8f 12 sts 0x128F, r17 ; 0x80128f 28142: 10 92 91 12 sts 0x1291, r1 ; 0x801291 28146: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2814a: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2814e: 82 e0 ldi r24, 0x02 ; 2 28150: 80 93 93 12 sts 0x1293, r24 ; 0x801293 28154: 10 92 94 12 sts 0x1294, r1 ; 0x801294 28158: 10 92 95 12 sts 0x1295, r1 ; 0x801295 2815c: 10 92 96 12 sts 0x1296, r1 ; 0x801296 28160: 10 92 97 12 sts 0x1297, r1 ; 0x801297 28164: 10 92 99 12 sts 0x1299, r1 ; 0x801299 28168: 10 92 98 12 sts 0x1298, r1 ; 0x801298 2816c: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b 28170: 10 92 9a 12 sts 0x129A, r1 ; 0x80129a 28174: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 28178: e8 e6 ldi r30, 0x68 ; 104 2817a: f3 e1 ldi r31, 0x13 ; 19 2817c: 10 92 f0 13 sts 0x13F0, r1 ; 0x8013f0 28180: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 28184: 10 92 15 14 sts 0x1415, r1 ; 0x801415 28188: 10 92 18 14 sts 0x1418, r1 ; 0x801418 2818c: 89 e1 ldi r24, 0x19 ; 25 2818e: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 28192: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 28196: 10 92 db 15 sts 0x15DB, r1 ; 0x8015db 2819a: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 2819e: 10 92 fa 15 sts 0x15FA, r1 ; 0x8015fa 281a2: 10 92 fd 15 sts 0x15FD, r1 ; 0x8015fd 281a6: 10 92 7b 16 sts 0x167B, r1 ; 0x80167b 281aa: 10 92 7d 16 sts 0x167D, r1 ; 0x80167d 281ae: 10 92 7c 16 sts 0x167C, r1 ; 0x80167c 281b2: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 281b6: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b 281ba: 10 92 77 16 sts 0x1677, r1 ; 0x801677 281be: 10 92 78 16 sts 0x1678, r1 ; 0x801678 281c2: 10 92 79 16 sts 0x1679, r1 ; 0x801679 281c6: 10 92 7a 16 sts 0x167A, r1 ; 0x80167a 281ca: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 281ce: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 281d2: 10 92 80 16 sts 0x1680, r1 ; 0x801680 281d6: 10 92 81 16 sts 0x1681, r1 ; 0x801681 281da: 12 82 std Z+2, r1 ; 0x02 281dc: 13 82 std Z+3, r1 ; 0x03 281de: 10 82 st Z, r1 281e0: 11 82 std Z+1, r1 ; 0x01 281e2: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a 281e6: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d 281ea: e8 e3 ldi r30, 0x38 ; 56 281ec: f4 e1 ldi r31, 0x14 ; 20 281ee: 82 ed ldi r24, 0xD2 ; 210 281f0: df 01 movw r26, r30 281f2: 1d 92 st X+, r1 281f4: 8a 95 dec r24 281f6: e9 f7 brne .-6 ; 0x281f2 281f8: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 281fc: 10 92 b8 13 sts 0x13B8, r1 ; 0x8013b8 28200: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 28204: 8b e7 ldi r24, 0x7B ; 123 28206: 96 e1 ldi r25, 0x16 ; 22 28208: 0f 94 a8 0f call 0x21f50 ; 0x21f50 ::start()> 2820c: e1 e6 ldi r30, 0x61 ; 97 2820e: f3 e1 ldi r31, 0x13 ; 19 28210: 11 82 std Z+1, r1 ; 0x01 28212: 12 82 std Z+2, r1 ; 0x02 28214: 13 82 std Z+3, r1 ; 0x03 28216: 14 82 std Z+4, r1 ; 0x04 28218: 15 82 std Z+5, r1 ; 0x05 2821a: 16 82 std Z+6, r1 ; 0x06 2821c: 10 83 st Z, r17 2821e: e4 e8 ldi r30, 0x84 ; 132 28220: f6 e1 ldi r31, 0x16 ; 22 28222: 15 82 std Z+5, r1 ; 0x05 28224: 17 82 std Z+7, r1 ; 0x07 28226: 16 82 std Z+6, r1 ; 0x06 28228: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2822c: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 28230: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 28234: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 28238: 90 93 90 16 sts 0x1690, r25 ; 0x801690 2823c: 2f 96 adiw r28, 0x0f ; 15 2823e: 0f b6 in r0, 0x3f ; 63 28240: f8 94 cli 28242: de bf out 0x3e, r29 ; 62 28244: 0f be out 0x3f, r0 ; 63 28246: cd bf out 0x3d, r28 ; 61 28248: df 91 pop r29 2824a: cf 91 pop r28 2824c: 1f 91 pop r17 2824e: 0f 91 pop r16 28250: ff 90 pop r15 28252: ef 90 pop r14 28254: 08 95 ret 00028256 : 28256: 42 e0 ldi r20, 0x02 ; 2 28258: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2825c: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 00028260 : 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; 28260: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 28264: 83 36 cpi r24, 0x63 ; 99 28266: 09 f4 brne .+2 ; 0x2826a 28268: 8f ef ldi r24, 0xFF ; 255 } 2826a: 08 95 ret 0002826c : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2826c: 85 e8 ldi r24, 0x85 ; 133 2826e: 9e e9 ldi r25, 0x9E ; 158 28270: 0e 94 e5 70 call 0xe1ca ; 0xe1ca uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 28274: 60 e0 ldi r22, 0x00 ; 0 28276: 8c ea ldi r24, 0xAC ; 172 28278: 9c e0 ldi r25, 0x0C ; 12 2827a: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (status == 1) { 2827e: 81 30 cpi r24, 0x01 ; 1 28280: 21 f4 brne .+8 ; 0x2828a SERIAL_ECHOLNRPGM(_O(MSG_ON)); 28282: 83 e7 ldi r24, 0x73 ; 115 28284: 9b e5 ldi r25, 0x5B ; 91 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 28286: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 2828a: 8d e6 ldi r24, 0x6D ; 109 2828c: 9b e5 ldi r25, 0x5B ; 91 2828e: fb cf rjmp .-10 ; 0x28286 00028290 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 28290: bc 01 movw r22, r24 28292: 99 0f add r25, r25 28294: 88 0b sbc r24, r24 28296: 99 0b sbc r25, r25 28298: 0f 94 43 97 call 0x32e86 ; 0x32e86 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2829c: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 000282a0 : 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){ 282a0: cf 93 push r28 282a2: c8 2f mov r28, r24 extruder = ex; 282a4: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 282a8: 87 e7 ldi r24, 0x77 ; 119 282aa: 9e e9 ldi r25, 0x9E ; 158 282ac: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 282b0: 8b e6 ldi r24, 0x6B ; 107 282b2: 9e e9 ldi r25, 0x9E ; 158 282b4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 282b8: 81 e6 ldi r24, 0x61 ; 97 282ba: 9e e9 ldi r25, 0x9E ; 158 282bc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN((int)ex); 282c0: 8c 2f mov r24, r28 282c2: 90 e0 ldi r25, 0x00 ; 0 } 282c4: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 282c6: 0d 94 48 41 jmp 0x28290 ; 0x28290 000282ca : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 282ca: 28 9a sbi 0x05, 0 ; 5 } 282cc: 08 95 ret 000282ce : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 282ce: 0f 93 push r16 282d0: 1f 93 push r17 282d2: cf 93 push r28 282d4: df 93 push r29 282d6: ec 01 movw r28, r24 uint16_t t0 = _millis(); 282d8: 0f 94 46 0f call 0x21e8c ; 0x21e8c 282dc: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 282de: 0f 94 90 70 call 0x2e120 ; 0x2e120 282e2: 8f 3f cpi r24, 0xFF ; 255 282e4: 69 f0 breq .+26 ; 0x28300 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 282e6: 0f 94 46 0f call 0x21e8c ; 0x21e8c 282ea: 60 1b sub r22, r16 282ec: 71 0b sbc r23, r17 282ee: 6c 17 cp r22, r28 282f0: 7d 07 cpc r23, r29 282f2: a8 f3 brcs .-22 ; 0x282de } return true; fail: return false; 282f4: 80 e0 ldi r24, 0x00 ; 0 } 282f6: df 91 pop r29 282f8: cf 91 pop r28 282fa: 1f 91 pop r17 282fc: 0f 91 pop r16 282fe: 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; 28300: 81 e0 ldi r24, 0x01 ; 1 28302: f9 cf rjmp .-14 ; 0x282f6 00028304 : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 28304: 8a ef ldi r24, 0xFA ; 250 28306: 95 e1 ldi r25, 0x15 ; 21 28308: 0f 94 a6 38 call 0x2714c ; 0x2714c file.close(); 2830c: 8a ef ldi r24, 0xFA ; 250 2830e: 95 e1 ldi r25, 0x15 ; 21 28310: 0f 94 33 6f call 0x2de66 ; 0x2de66 saving = false; 28314: e8 e6 ldi r30, 0x68 ; 104 28316: f3 e1 ldi r31, 0x13 ; 19 28318: 10 82 st Z, r1 logging = false; 2831a: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 2831c: 08 95 ret 0002831e : //! 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) 2831e: cf 92 push r12 28320: df 92 push r13 28322: ef 92 push r14 28324: ff 92 push r15 28326: 0f 93 push r16 28328: 1f 93 push r17 2832a: cf 93 push r28 2832c: df 93 push r29 2832e: eb 01 movw r28, r22 28330: 18 2f mov r17, r24 28332: 09 2f mov r16, r25 { if (saved_printing) return; cli(); 28334: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 28336: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 2833a: 88 23 and r24, r24 2833c: 09 f4 brne .+2 ; 0x28340 2833e: d8 c0 rjmp .+432 ; 0x284f0 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 28340: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc 28344: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd 28348: a0 91 de 11 lds r26, 0x11DE ; 0x8011de 2834c: b0 91 df 11 lds r27, 0x11DF ; 0x8011df 28350: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 28354: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 28358: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 2835c: b0 93 db 11 sts 0x11DB, r27 ; 0x8011db sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 28360: 0f 94 06 75 call 0x2ea0c ; 0x2ea0c saved_sdpos -= sdlen_planner; 28364: c0 90 d8 11 lds r12, 0x11D8 ; 0x8011d8 28368: d0 90 d9 11 lds r13, 0x11D9 ; 0x8011d9 2836c: e0 90 da 11 lds r14, 0x11DA ; 0x8011da 28370: f0 90 db 11 lds r15, 0x11DB ; 0x8011db 28374: c8 1a sub r12, r24 28376: d9 0a sbc r13, r25 28378: e1 08 sbc r14, r1 2837a: f1 08 sbc r15, r1 2837c: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 28380: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 28384: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 28388: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 2838c: 0e 94 1e 70 call 0xe03c ; 0xe03c saved_sdpos -= sdlen_cmdqueue; 28390: c8 1a sub r12, r24 28392: d9 0a sbc r13, r25 28394: e1 08 sbc r14, r1 28396: f1 08 sbc r15, r1 28398: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 2839c: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 283a0: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 283a4: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_SD; 283a8: 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; 283ac: 20 91 06 12 lds r18, 0x1206 ; 0x801206 283b0: f0 90 05 12 lds r15, 0x1205 ; 0x801205 283b4: 21 11 cpse r18, r1 283b6: 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)) 283b8: 80 91 e4 11 lds r24, 0x11E4 ; 0x8011e4 283bc: 90 91 e5 11 lds r25, 0x11E5 ; 0x8011e5 283c0: 00 97 sbiw r24, 0x00 ; 0 283c2: 09 f4 brne .+2 ; 0x283c6 283c4: d1 c0 rjmp .+418 ; 0x28568 283c6: 21 11 cpse r18, r1 283c8: cf c0 rjmp .+414 ; 0x28568 283ca: 20 91 05 12 lds r18, 0x1205 ; 0x801205 283ce: 21 11 cpse r18, r1 283d0: cb c0 rjmp .+406 ; 0x28568 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 283d2: fc 01 movw r30, r24 283d4: e8 5a subi r30, 0xA8 ; 168 283d6: ff 4f sbci r31, 0xFF ; 255 283d8: 20 e1 ldi r18, 0x10 ; 16 283da: ae e7 ldi r26, 0x7E ; 126 283dc: b2 e0 ldi r27, 0x02 ; 2 283de: 01 90 ld r0, Z+ 283e0: 0d 92 st X+, r0 283e2: 2a 95 dec r18 283e4: e1 f7 brne .-8 ; 0x283de saved_feedrate2 = current_block->gcode_feedrate; 283e6: fc 01 movw r30, r24 283e8: e6 59 subi r30, 0x96 ; 150 283ea: ff 4f sbci r31, 0xFF ; 255 283ec: 20 81 ld r18, Z 283ee: 31 81 ldd r19, Z+1 ; 0x01 283f0: 30 93 e3 11 sts 0x11E3, r19 ; 0x8011e3 283f4: 20 93 e2 11 sts 0x11E2, r18 ; 0x8011e2 saved_segment_idx = current_block->segment_idx; 283f8: 88 59 subi r24, 0x98 ; 152 283fa: 9f 4f sbci r25, 0xFF ; 255 283fc: fc 01 movw r30, r24 283fe: 80 81 ld r24, Z 28400: 91 81 ldd r25, Z+1 ; 0x01 28402: 90 93 e1 11 sts 0x11E1, r25 ; 0x8011e1 28406: 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 2840a: 0f 94 8b 86 call 0x30d16 ; 0x30d16 memcpy(saved_pos, current_position, sizeof(saved_pos)); 2840e: 80 e1 ldi r24, 0x10 ; 16 28410: e5 ef ldi r30, 0xF5 ; 245 28412: f1 e1 ldi r31, 0x11 ; 17 28414: a0 e9 ldi r26, 0x90 ; 144 28416: b2 e0 ldi r27, 0x02 ; 2 28418: 01 90 ld r0, Z+ 2841a: 0d 92 st X+, r0 2841c: 8a 95 dec r24 2841e: e1 f7 brne .-8 ; 0x28418 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 28420: ff 20 and r15, r15 28422: 61 f0 breq .+24 ; 0x2843c 28424: 80 e0 ldi r24, 0x00 ; 0 28426: 90 e0 ldi r25, 0x00 ; 0 28428: a0 e8 ldi r26, 0x80 ; 128 2842a: bf eb ldi r27, 0xBF ; 191 2842c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 28430: 90 93 91 02 sts 0x0291, r25 ; 0x800291 28434: a0 93 92 02 sts 0x0292, r26 ; 0x800292 28438: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 2843c: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 28440: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 28444: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.500+0x1> 28448: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.500> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 2844c: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 28450: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 28454: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 28458: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); 2845c: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 28460: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 28464: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 28468: 83 fb bst r24, 3 2846a: 88 27 eor r24, r24 2846c: 80 f9 bld r24, 0 2846e: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; 28472: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 28476: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 cmdqueue_reset(); //empty cmdqueue 2847a: 0e 94 ab 73 call 0xe756 ; 0xe756 card.sdprinting = false; 2847e: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a // card.closefile(); saved_printing = true; 28482: 81 e0 ldi r24, 0x01 ; 1 28484: 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(); 28488: 0f 94 20 22 call 0x24440 ; 0x24440 sei(); 2848c: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 2848e: 20 e0 ldi r18, 0x00 ; 0 28490: 30 e0 ldi r19, 0x00 ; 0 28492: a9 01 movw r20, r18 28494: f8 01 movw r30, r16 28496: 6c 2f mov r22, r28 28498: 7d 2f mov r23, r29 2849a: 8f 2f mov r24, r31 2849c: 90 2f mov r25, r16 2849e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 284a2: 88 23 and r24, r24 284a4: e1 f0 breq .+56 ; 0x284de // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 284a6: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea 284aa: 81 11 cpse r24, r1 284ac: 05 c0 rjmp .+10 ; 0x284b8 enquecommand_P(MSG_M83); 284ae: 61 e0 ldi r22, 0x01 ; 1 284b0: 89 ed ldi r24, 0xD9 ; 217 284b2: 9c e6 ldi r25, 0x6C ; 108 284b4: 0e 94 3a 7d call 0xfa74 ; 0xfa74 // 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); 284b8: 0f 93 push r16 284ba: 1f 93 push r17 284bc: df 93 push r29 284be: cf 93 push r28 284c0: 89 ec ldi r24, 0xC9 ; 201 284c2: 9c e6 ldi r25, 0x6C ; 108 284c4: 9f 93 push r25 284c6: 8f 93 push r24 284c8: 0e 94 d0 7d call 0xfba0 ; 0xfba0 284cc: 81 e0 ldi r24, 0x01 ; 1 284ce: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 284d2: 0f 90 pop r0 284d4: 0f 90 pop r0 284d6: 0f 90 pop r0 284d8: 0f 90 pop r0 284da: 0f 90 pop r0 284dc: 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(); } } 284de: df 91 pop r29 284e0: cf 91 pop r28 284e2: 1f 91 pop r17 284e4: 0f 91 pop r16 284e6: ff 90 pop r15 284e8: ef 90 pop r14 284ea: df 90 pop r13 284ec: cf 90 pop r12 284ee: 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 284f0: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 284f4: 88 23 and r24, r24 284f6: b1 f1 breq .+108 ; 0x28564 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 284f8: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 284fc: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 28500: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 28504: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 28508: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 2850c: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 28510: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 28514: 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 28518: 0f 94 06 75 call 0x2ea0c ; 0x2ea0c saved_sdpos -= nlines; 2851c: 40 91 d8 11 lds r20, 0x11D8 ; 0x8011d8 28520: 50 91 d9 11 lds r21, 0x11D9 ; 0x8011d9 28524: 60 91 da 11 lds r22, 0x11DA ; 0x8011da 28528: 70 91 db 11 lds r23, 0x11DB ; 0x8011db 2852c: 48 1b sub r20, r24 2852e: 51 09 sbc r21, r1 28530: 61 09 sbc r22, r1 28532: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 28534: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 28538: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 2853c: 09 2e mov r0, r25 2853e: 00 0c add r0, r0 28540: aa 0b sbc r26, r26 28542: bb 0b sbc r27, r27 28544: 48 1b sub r20, r24 28546: 59 0b sbc r21, r25 28548: 6a 0b sbc r22, r26 2854a: 7b 0b sbc r23, r27 2854c: 40 93 d8 11 sts 0x11D8, r20 ; 0x8011d8 28550: 50 93 d9 11 sts 0x11D9, r21 ; 0x8011d9 28554: 60 93 da 11 sts 0x11DA, r22 ; 0x8011da 28558: 70 93 db 11 sts 0x11DB, r23 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 2855c: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 2855e: 80 93 79 02 sts 0x0279, r24 ; 0x800279 28562: 24 cf rjmp .-440 ; 0x283ac 28564: 82 e0 ldi r24, 0x02 ; 2 28566: fb cf rjmp .-10 ; 0x2855e saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 28568: 80 e0 ldi r24, 0x00 ; 0 2856a: 90 e0 ldi r25, 0x00 ; 0 2856c: a0 e8 ldi r26, 0x80 ; 128 2856e: bf eb ldi r27, 0xBF ; 191 28570: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 28574: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 28578: a0 93 80 02 sts 0x0280, r26 ; 0x800280 2857c: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 28580: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 28584: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 28588: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2858c: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 28590: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 28594: 70 93 e3 11 sts 0x11E3, r23 ; 0x8011e3 28598: 60 93 e2 11 sts 0x11E2, r22 ; 0x8011e2 saved_segment_idx = 0; 2859c: 10 92 e1 11 sts 0x11E1, r1 ; 0x8011e1 285a0: 10 92 e0 11 sts 0x11E0, r1 ; 0x8011e0 285a4: 32 cf rjmp .-412 ; 0x2840a 000285a6 : // "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) { 285a6: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 285aa: 81 11 cpse r24, r1 285ac: 1d c0 rjmp .+58 ; 0x285e8 Stopped = true; 285ae: 81 e0 ldi r24, 0x01 ; 1 285b0: 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); 285b4: 61 e0 ldi r22, 0x01 ; 1 285b6: 80 e0 ldi r24, 0x00 ; 0 285b8: 0e 94 64 ef call 0x1dec8 ; 0x1dec8 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 285bc: 8a e5 ldi r24, 0x5A ; 90 285be: 9e e9 ldi r25, 0x9E ; 158 285c0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 285c4: 84 e9 ldi r24, 0x94 ; 148 285c6: 9c e6 ldi r25, 0x6C ; 108 285c8: 0e 94 de 72 call 0xe5bc ; 0xe5bc // 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)); 285cc: 80 e6 ldi r24, 0x60 ; 96 285ce: 9b e5 ldi r25, 0x5B ; 91 285d0: 0e 94 3c 6d call 0xda78 ; 0xda78 285d4: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe // 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); 285d8: 72 9a sbi 0x0e, 2 ; 14 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 285da: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 285de: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 285e2: 81 60 ori r24, 0x01 ; 1 285e4: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd } } } 285e8: 08 95 ret 000285ea : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 285ea: 0f 93 push r16 285ec: 1f 93 push r17 285ee: cf 93 push r28 285f0: df 93 push r29 285f2: ec 01 movw r28, r24 285f4: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> 285f8: 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) 285fa: 80 36 cpi r24, 0x60 ; 96 285fc: 91 05 cpc r25, r1 285fe: 08 f0 brcs .+2 ; 0x28602 28600: 85 c0 rjmp .+266 ; 0x2870c return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 28602: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 28606: 81 11 cpse r24, r1 28608: 05 c0 rjmp .+10 ; 0x28614 cmdqueue_pop_front(); 2860a: 0e 94 5e 70 call 0xe0bc ; 0xe0bc cmdbuffer_front_already_processed = true; 2860e: 81 e0 ldi r24, 0x01 ; 1 28610: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } if (bufindr == bufindw && buflen > 0) 28614: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb 28618: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc 2861c: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.514> 28620: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.514+0x1> 28624: 48 17 cp r20, r24 28626: 59 07 cpc r21, r25 28628: 41 f4 brne .+16 ; 0x2863a 2862a: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 2862e: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 28632: 12 16 cp r1, r18 28634: 13 06 cpc r1, r19 28636: 0c f4 brge .+2 ; 0x2863a 28638: 69 c0 rjmp .+210 ; 0x2870c // 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; 2863a: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda 2863e: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb 28642: 12 16 cp r1, r18 28644: 13 06 cpc r1, r19 28646: 0c f0 brlt .+2 ; 0x2864a 28648: 41 c0 rjmp .+130 ; 0x286cc 2864a: 9c 01 movw r18, r24 2864c: 2f 59 subi r18, 0x9F ; 159 2864e: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 28650: 84 17 cp r24, r20 28652: 95 07 cpc r25, r21 28654: e8 f5 brcc .+122 ; 0x286d0 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 28656: 44 50 subi r20, 0x04 ; 4 28658: 51 09 sbc r21, r1 2865a: 40 1b sub r20, r16 2865c: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2865e: 42 17 cp r20, r18 28660: 53 07 cpc r21, r19 28662: 0c f4 brge .+2 ; 0x28666 28664: 53 c0 rjmp .+166 ; 0x2870c } } 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); 28666: 50 93 cc 11 sts 0x11CC, r21 ; 0x8011cc 2866a: 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; 2866e: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 28672: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 28676: fc 01 movw r30, r24 28678: e2 52 subi r30, 0x22 ; 34 2867a: f0 4f sbci r31, 0xF0 ; 240 2867c: 23 e0 ldi r18, 0x03 ; 3 2867e: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 28680: be 01 movw r22, r28 28682: 8f 51 subi r24, 0x1F ; 31 28684: 90 4f sbci r25, 0xF0 ; 240 28686: 0f 94 34 9e call 0x33c68 ; 0x33c68 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2868a: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 2868e: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 28692: 01 96 adiw r24, 0x01 ; 1 28694: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 28698: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHO_START; 2869c: 87 e7 ldi r24, 0x77 ; 119 2869e: 9e e9 ldi r25, 0x9E ; 158 286a0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(enqueingFront); 286a4: 81 e4 ldi r24, 0x41 ; 65 286a6: 9e e9 ldi r25, 0x9E ; 158 286a8: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 286ac: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 286b0: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc } }*/ static FORCE_INLINE void print(const char *str) { write(str); 286b4: 8f 51 subi r24, 0x1F ; 31 286b6: 90 4f sbci r25, 0xF0 ; 240 286b8: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHOLNPGM("\""); 286bc: 8f e3 ldi r24, 0x3F ; 63 286be: 9e e9 ldi r25, 0x9E ; 158 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 286c0: df 91 pop r29 286c2: cf 91 pop r28 286c4: 1f 91 pop r17 286c6: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 286c8: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc // 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) 286cc: 9c 01 movw r18, r24 286ce: c0 cf rjmp .-128 ; 0x28650 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 286d0: c8 01 movw r24, r16 286d2: 04 96 adiw r24, 0x04 ; 4 286d4: 48 17 cp r20, r24 286d6: 59 07 cpc r21, r25 286d8: 28 f0 brcs .+10 ; 0x286e4 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 286da: 44 50 subi r20, 0x04 ; 4 286dc: 51 09 sbc r21, r1 286de: 40 1b sub r20, r16 286e0: 51 0b sbc r21, r17 286e2: c1 cf rjmp .-126 ; 0x28666 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 286e4: 89 ee ldi r24, 0xE9 ; 233 286e6: 91 e0 ldi r25, 0x01 ; 1 286e8: bc 01 movw r22, r24 286ea: 60 1b sub r22, r16 286ec: 71 0b sbc r23, r17 286ee: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 286f0: 62 17 cp r22, r18 286f2: 73 07 cpc r23, r19 286f4: 5c f0 brlt .+22 ; 0x2870c memset(cmdbuffer, 0, bufindr); 286f6: 70 e0 ldi r23, 0x00 ; 0 286f8: 60 e0 ldi r22, 0x00 ; 0 286fa: 8e ed ldi r24, 0xDE ; 222 286fc: 9f e0 ldi r25, 0x0F ; 15 286fe: 0f 94 af a6 call 0x34d5e ; 0x34d5e bufindr = bufindr_new; 28702: 10 93 cc 11 sts 0x11CC, r17 ; 0x8011cc 28706: 00 93 cb 11 sts 0x11CB, r16 ; 0x8011cb 2870a: b1 cf rjmp .-158 ; 0x2866e SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2870c: 8a e5 ldi r24, 0x5A ; 90 2870e: 9e e9 ldi r25, 0x9E ; 158 28710: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(enqueingFront); 28714: 81 e4 ldi r24, 0x41 ; 65 28716: 9e e9 ldi r25, 0x9E ; 158 28718: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2871c: ce 01 movw r24, r28 2871e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 28722: 88 e2 ldi r24, 0x28 ; 40 28724: 9e e9 ldi r25, 0x9E ; 158 28726: cc cf rjmp .-104 ; 0x286c0 00028728 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 28728: ab 01 movw r20, r22 2872a: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2872c: 8a ef ldi r24, 0xFA ; 250 2872e: 95 e1 ldi r25, 0x15 ; 21 28730: 0f 94 db 38 call 0x271b6 ; 0x271b6 28734: 81 11 cpse r24, r1 28736: 02 c0 rjmp .+4 ; 0x2873c 28738: 80 e0 ldi r24, 0x00 ; 0 2873a: 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() ) 2873c: 8a ef ldi r24, 0xFA ; 250 2873e: 95 e1 ldi r25, 0x15 ; 21 28740: 0f 94 c5 37 call 0x26f8a ; 0x26f8a 28744: 88 23 and r24, r24 28746: c1 f3 breq .-16 ; 0x28738 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; 28748: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 2874c: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 28750: 27 52 subi r18, 0x27 ; 39 28752: 32 4f sbci r19, 0xF2 ; 242 28754: 30 93 16 16 sts 0x1616, r19 ; 0x801616 28758: 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; } 2875c: 08 95 ret 0002875e : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2875e: 8f 92 push r8 28760: 9f 92 push r9 28762: af 92 push r10 28764: bf 92 push r11 28766: cf 92 push r12 28768: df 92 push r13 2876a: ef 92 push r14 2876c: ff 92 push r15 2876e: 0f 93 push r16 28770: 1f 93 push r17 28772: cf 93 push r28 28774: df 93 push r29 28776: cd b7 in r28, 0x3d ; 61 28778: de b7 in r29, 0x3e ; 62 2877a: ee 97 sbiw r28, 0x3e ; 62 2877c: 0f b6 in r0, 0x3f ; 63 2877e: f8 94 cli 28780: de bf out 0x3e, r29 ; 62 28782: 0f be out 0x3f, r0 ; 63 28784: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 28786: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 2878a: 8f 93 push r24 2878c: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 28790: 8f 93 push r24 28792: 83 ee ldi r24, 0xE3 ; 227 28794: 9d e9 ldi r25, 0x9D ; 157 28796: 9f 93 push r25 28798: 8f 93 push r24 2879a: 8e 01 movw r16, r28 2879c: 0f 5d subi r16, 0xDF ; 223 2879e: 1f 4f sbci r17, 0xFF ; 255 287a0: 1f 93 push r17 287a2: 0f 93 push r16 287a4: 0f 94 94 9f call 0x33f28 ; 0x33f28 287a8: 0f 90 pop r0 287aa: 0f 90 pop r0 287ac: 0f 90 pop r0 287ae: 0f 90 pop r0 287b0: 0f 90 pop r0 287b2: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 287b4: f1 2c mov r15, r1 287b6: f8 01 movw r30, r16 287b8: 01 90 ld r0, Z+ 287ba: 00 20 and r0, r0 287bc: e9 f7 brne .-6 ; 0x287b8 287be: 31 97 sbiw r30, 0x01 ; 1 287c0: e0 1b sub r30, r16 287c2: f1 0b sbc r31, r17 287c4: fe 16 cp r15, r30 287c6: 84 f4 brge .+32 ; 0x287e8 autoname[i]=tolower(autoname[i]); 287c8: 68 01 movw r12, r16 287ca: cf 0c add r12, r15 287cc: d1 1c adc r13, r1 287ce: f7 fc sbrc r15, 7 287d0: da 94 dec r13 287d2: f6 01 movw r30, r12 287d4: 80 81 ld r24, Z 287d6: 08 2e mov r0, r24 287d8: 00 0c add r0, r0 287da: 99 0b sbc r25, r25 287dc: 0f 94 91 a6 call 0x34d22 ; 0x34d22 287e0: f6 01 movw r30, r12 287e2: 80 83 st Z, r24 287e4: f3 94 inc r15 287e6: e7 cf rjmp .-50 ; 0x287b6 dir_t p; root.rewind(); 287e8: 80 ef ldi r24, 0xF0 ; 240 287ea: 93 e1 ldi r25, 0x13 ; 19 287ec: 0e 94 c1 70 call 0xe182 ; 0xe182 bool found=false; 287f0: a1 2c mov r10, r1 287f2: ce 01 movw r24, r28 287f4: 01 96 adiw r24, 0x01 ; 1 287f6: 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); 287f8: 8d e8 ldi r24, 0x8D ; 141 287fa: c8 2e mov r12, r24 287fc: 8c e6 ldi r24, 0x6C ; 108 287fe: 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; 28800: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 28804: 82 30 cpi r24, 0x02 ; 2 28806: 08 f4 brcc .+2 ; 0x2880a 28808: 50 c0 rjmp .+160 ; 0x288aa 2880a: 80 91 f8 13 lds r24, 0x13F8 ; 0x8013f8 2880e: 90 91 f9 13 lds r25, 0x13F9 ; 0x8013f9 28812: a0 91 fa 13 lds r26, 0x13FA ; 0x8013fa 28816: b0 91 fb 13 lds r27, 0x13FB ; 0x8013fb 2881a: 8f 71 andi r24, 0x1F ; 31 2881c: 99 27 eor r25, r25 2881e: aa 27 eor r26, r26 28820: bb 27 eor r27, r27 28822: 89 2b or r24, r25 28824: 8a 2b or r24, r26 28826: 8b 2b or r24, r27 28828: 09 f0 breq .+2 ; 0x2882c 2882a: 3f c0 rjmp .+126 ; 0x288aa 2882c: 50 e0 ldi r21, 0x00 ; 0 2882e: 40 e0 ldi r20, 0x00 ; 0 28830: b7 01 movw r22, r14 28832: 80 ef ldi r24, 0xF0 ; 240 28834: 93 e1 ldi r25, 0x13 ; 19 28836: 0f 94 3e 38 call 0x2707c ; 0x2707c dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2883a: 18 16 cp r1, r24 2883c: b4 f5 brge .+108 ; 0x288aa { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2883e: b1 2c mov r11, r1 28840: f7 01 movw r30, r14 28842: 01 90 ld r0, Z+ 28844: 00 20 and r0, r0 28846: e9 f7 brne .-6 ; 0x28842 28848: 31 97 sbiw r30, 0x01 ; 1 2884a: ee 19 sub r30, r14 2884c: ff 09 sbc r31, r15 2884e: be 16 cp r11, r30 28850: 74 f4 brge .+28 ; 0x2886e p.name[i]=tolower(p.name[i]); 28852: 47 01 movw r8, r14 28854: 8b 0c add r8, r11 28856: 91 1c adc r9, r1 28858: b7 fc sbrc r11, 7 2885a: 9a 94 dec r9 2885c: f4 01 movw r30, r8 2885e: 80 81 ld r24, Z 28860: 90 e0 ldi r25, 0x00 ; 0 28862: 0f 94 91 a6 call 0x34d22 ; 0x34d22 28866: f4 01 movw r30, r8 28868: 80 83 st Z, r24 2886a: b3 94 inc r11 2886c: e9 cf rjmp .-46 ; 0x28840 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2886e: 8a 85 ldd r24, Y+10 ; 0x0a 28870: 8e 37 cpi r24, 0x7E ; 126 28872: 31 f2 breq .-116 ; 0x28800 if(strncmp((char*)p.name,autoname,5)==0) 28874: 45 e0 ldi r20, 0x05 ; 5 28876: 50 e0 ldi r21, 0x00 ; 0 28878: b8 01 movw r22, r16 2887a: c7 01 movw r24, r14 2887c: 0f 94 ef a6 call 0x34dde ; 0x34dde 28880: 89 2b or r24, r25 28882: 09 f0 breq .+2 ; 0x28886 28884: bd cf rjmp .-134 ; 0x28800 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 28886: 1f 93 push r17 28888: 0f 93 push r16 2888a: df 92 push r13 2888c: cf 92 push r12 2888e: 0e 94 d0 7d call 0xfba0 ; 0xfba0 // M24: Start/resume SD print enquecommand_P(MSG_M24); 28892: 61 e0 ldi r22, 0x01 ; 1 28894: 89 e8 ldi r24, 0x89 ; 137 28896: 9c e6 ldi r25, 0x6C ; 108 28898: 0e 94 3a 7d call 0xfa74 ; 0xfa74 2889c: 0f 90 pop r0 2889e: 0f 90 pop r0 288a0: 0f 90 pop r0 288a2: 0f 90 pop r0 found=true; 288a4: aa 24 eor r10, r10 288a6: a3 94 inc r10 288a8: ab cf rjmp .-170 ; 0x28800 } } if(!found) lastnr=-1; 288aa: 8f ef ldi r24, 0xFF ; 255 288ac: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 288ae: aa 20 and r10, r10 288b0: 29 f0 breq .+10 ; 0x288bc lastnr=-1; else lastnr++; 288b2: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 288b6: 90 91 b8 13 lds r25, 0x13B8 ; 0x8013b8 288ba: 01 96 adiw r24, 0x01 ; 1 288bc: 90 93 b8 13 sts 0x13B8, r25 ; 0x8013b8 288c0: 80 93 b7 13 sts 0x13B7, r24 ; 0x8013b7 } 288c4: ee 96 adiw r28, 0x3e ; 62 288c6: 0f b6 in r0, 0x3f ; 63 288c8: f8 94 cli 288ca: de bf out 0x3e, r29 ; 62 288cc: 0f be out 0x3f, r0 ; 63 288ce: cd bf out 0x3d, r28 ; 61 288d0: df 91 pop r29 288d2: cf 91 pop r28 288d4: 1f 91 pop r17 288d6: 0f 91 pop r16 288d8: ff 90 pop r15 288da: ef 90 pop r14 288dc: df 90 pop r13 288de: cf 90 pop r12 288e0: bf 90 pop r11 288e2: af 90 pop r10 288e4: 9f 90 pop r9 288e6: 8f 90 pop r8 288e8: 08 95 ret 000288ea : * \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) { 288ea: 8f 92 push r8 288ec: 9f 92 push r9 288ee: af 92 push r10 288f0: bf 92 push r11 288f2: cf 92 push r12 288f4: df 92 push r13 288f6: ef 92 push r14 288f8: ff 92 push r15 288fa: 0f 93 push r16 288fc: 1f 93 push r17 288fe: cf 93 push r28 28900: df 93 push r29 28902: 00 d0 rcall .+0 ; 0x28904 28904: 1f 92 push r1 28906: cd b7 in r28, 0x3d ; 61 28908: de b7 in r29, 0x3e ; 62 2890a: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2890c: 83 81 ldd r24, Z+3 ; 0x03 2890e: 81 30 cpi r24, 0x01 ; 1 28910: 11 f0 breq .+4 ; 0x28916 // set file to correct position return seekSet(newPos); fail: return false; 28912: 80 e0 ldi r24, 0x00 ; 0 28914: 60 c0 rjmp .+192 ; 0x289d6 * \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; 28916: 81 81 ldd r24, Z+1 ; 0x01 28918: 81 ff sbrs r24, 1 2891a: fb cf rjmp .-10 ; 0x28912 // 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; 2891c: 81 89 ldd r24, Z+17 ; 0x11 2891e: 92 89 ldd r25, Z+18 ; 0x12 28920: a3 89 ldd r26, Z+19 ; 0x13 28922: b4 89 ldd r27, Z+20 ; 0x14 28924: 89 2b or r24, r25 28926: 8a 2b or r24, r26 28928: 8b 2b or r24, r27 2892a: 09 f4 brne .+2 ; 0x2892e 2892c: 6e c0 rjmp .+220 ; 0x28a0a 2892e: 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; 28930: 40 e0 ldi r20, 0x00 ; 0 28932: 50 e0 ldi r21, 0x00 ; 0 28934: ba 01 movw r22, r20 28936: cf 01 movw r24, r30 28938: 0f 94 db 38 call 0x271b6 ; 0x271b6 2893c: 88 23 and r24, r24 2893e: 49 f3 breq .-46 ; 0x28912 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 28940: f7 01 movw r30, r14 28942: c1 8c ldd r12, Z+25 ; 0x19 28944: d2 8c ldd r13, Z+26 ; 0x1a 28946: 85 88 ldd r8, Z+21 ; 0x15 28948: 96 88 ldd r9, Z+22 ; 0x16 2894a: a7 88 ldd r10, Z+23 ; 0x17 2894c: 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; 2894e: 82 e0 ldi r24, 0x02 ; 2 28950: 90 e0 ldi r25, 0x00 ; 0 28952: a0 e0 ldi r26, 0x00 ; 0 28954: b0 e0 ldi r27, 0x00 ; 0 28956: f6 01 movw r30, r12 28958: 80 83 st Z, r24 2895a: 91 83 std Z+1, r25 ; 0x01 2895c: a2 83 std Z+2, r26 ; 0x02 2895e: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 28960: 9e 01 movw r18, r28 28962: 2f 5f subi r18, 0xFF ; 255 28964: 3f 4f sbci r19, 0xFF ; 255 28966: b5 01 movw r22, r10 28968: a4 01 movw r20, r8 2896a: c6 01 movw r24, r12 2896c: 0f 94 d8 36 call 0x26db0 ; 0x26db0 28970: 88 23 and r24, r24 28972: 79 f2 breq .-98 ; 0x28912 // free cluster if (!fatPut(cluster, 0)) goto fail; 28974: 00 e0 ldi r16, 0x00 ; 0 28976: 10 e0 ldi r17, 0x00 ; 0 28978: 98 01 movw r18, r16 2897a: b5 01 movw r22, r10 2897c: a4 01 movw r20, r8 2897e: c6 01 movw r24, r12 28980: 0f 94 46 36 call 0x26c8c ; 0x26c8c 28984: 88 23 and r24, r24 28986: 29 f2 breq .-118 ; 0x28912 cluster = next; 28988: 89 80 ldd r8, Y+1 ; 0x01 2898a: 9a 80 ldd r9, Y+2 ; 0x02 2898c: ab 80 ldd r10, Y+3 ; 0x03 2898e: 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; 28990: f6 01 movw r30, r12 28992: 87 89 ldd r24, Z+23 ; 0x17 28994: 80 31 cpi r24, 0x10 ; 16 28996: 81 f5 brne .+96 ; 0x289f8 28998: f8 ef ldi r31, 0xF8 ; 248 2899a: 8f 16 cp r8, r31 2899c: ff ef ldi r31, 0xFF ; 255 2899e: 9f 06 cpc r9, r31 289a0: a1 04 cpc r10, r1 289a2: b1 04 cpc r11, r1 289a4: e8 f2 brcs .-70 ; 0x28960 firstCluster_ = 0; 289a6: f7 01 movw r30, r14 289a8: 15 8a std Z+21, r1 ; 0x15 289aa: 16 8a std Z+22, r1 ; 0x16 289ac: 17 8a std Z+23, r1 ; 0x17 289ae: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 289b0: 11 8a std Z+17, r1 ; 0x11 289b2: 12 8a std Z+18, r1 ; 0x12 289b4: 13 8a std Z+19, r1 ; 0x13 289b6: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 289b8: 81 81 ldd r24, Z+1 ; 0x01 289ba: 80 68 ori r24, 0x80 ; 128 289bc: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 289be: c7 01 movw r24, r14 289c0: 0f 94 a6 38 call 0x2714c ; 0x2714c 289c4: 88 23 and r24, r24 289c6: 09 f4 brne .+2 ; 0x289ca 289c8: a4 cf rjmp .-184 ; 0x28912 // set file to correct position return seekSet(newPos); 289ca: 40 e0 ldi r20, 0x00 ; 0 289cc: 50 e0 ldi r21, 0x00 ; 0 289ce: ba 01 movw r22, r20 289d0: c7 01 movw r24, r14 289d2: 0f 94 db 38 call 0x271b6 ; 0x271b6 fail: return false; } 289d6: 0f 90 pop r0 289d8: 0f 90 pop r0 289da: 0f 90 pop r0 289dc: 0f 90 pop r0 289de: df 91 pop r29 289e0: cf 91 pop r28 289e2: 1f 91 pop r17 289e4: 0f 91 pop r16 289e6: ff 90 pop r15 289e8: ef 90 pop r14 289ea: df 90 pop r13 289ec: cf 90 pop r12 289ee: bf 90 pop r11 289f0: af 90 pop r10 289f2: 9f 90 pop r9 289f4: 8f 90 pop r8 289f6: 08 95 ret return cluster >= FAT32EOC_MIN; 289f8: 88 ef ldi r24, 0xF8 ; 248 289fa: 88 16 cp r8, r24 289fc: 8f ef ldi r24, 0xFF ; 255 289fe: 98 06 cpc r9, r24 28a00: a8 06 cpc r10, r24 28a02: 8f e0 ldi r24, 0x0F ; 15 28a04: b8 06 cpc r11, r24 28a06: 78 f6 brcc .-98 ; 0x289a6 28a08: ab cf rjmp .-170 ; 0x28960 // 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; 28a0a: 81 e0 ldi r24, 0x01 ; 1 28a0c: e4 cf rjmp .-56 ; 0x289d6 00028a0e : +* 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) { 28a0e: 2f 92 push r2 28a10: 3f 92 push r3 28a12: 4f 92 push r4 28a14: 5f 92 push r5 28a16: 6f 92 push r6 28a18: 7f 92 push r7 28a1a: 8f 92 push r8 28a1c: 9f 92 push r9 28a1e: af 92 push r10 28a20: bf 92 push r11 28a22: cf 92 push r12 28a24: df 92 push r13 28a26: ef 92 push r14 28a28: ff 92 push r15 28a2a: 0f 93 push r16 28a2c: 1f 93 push r17 28a2e: cf 93 push r28 28a30: df 93 push r29 28a32: cd b7 in r28, 0x3d ; 61 28a34: de b7 in r29, 0x3e ; 62 28a36: c6 57 subi r28, 0x76 ; 118 28a38: d1 09 sbc r29, r1 28a3a: 0f b6 in r0, 0x3f ; 63 28a3c: f8 94 cli 28a3e: de bf out 0x3e, r29 ; 62 28a40: 0f be out 0x3f, r0 ; 63 28a42: cd bf out 0x3d, r28 ; 61 28a44: 4c 01 movw r8, r24 28a46: 6b 01 movw r12, r22 28a48: 3a 01 movw r6, r20 28a4a: e5 96 adiw r28, 0x35 ; 53 28a4c: 2f af std Y+63, r18 ; 0x3f 28a4e: e5 97 sbiw r28, 0x35 ; 53 28a50: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 28a52: 2d b6 in r2, 0x3d ; 61 28a54: 3e b6 in r3, 0x3e ; 62 28a56: 10 2f mov r17, r16 28a58: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 28a5a: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28a5e: 8f 5f subi r24, 0xFF ; 255 28a60: 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()) { 28a64: fb 01 movw r30, r22 28a66: 80 85 ldd r24, Z+8 ; 0x08 28a68: 91 85 ldd r25, Z+9 ; 0x09 28a6a: a2 85 ldd r26, Z+10 ; 0x0a 28a6c: b3 85 ldd r27, Z+11 ; 0x0b 28a6e: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28a72: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28a76: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28a7a: b0 93 80 13 sts 0x1380, r27 ; 0x801380 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 28a7e: 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); 28a80: 5e 01 movw r10, r28 28a82: f7 e6 ldi r31, 0x67 ; 103 28a84: af 0e add r10, r31 28a86: 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; 28a88: f6 01 movw r30, r12 28a8a: 83 81 ldd r24, Z+3 ; 0x03 28a8c: 82 30 cpi r24, 0x02 ; 2 28a8e: 08 f4 brcc .+2 ; 0x28a92 28a90: c0 c1 rjmp .+896 ; 0x28e12 28a92: 80 85 ldd r24, Z+8 ; 0x08 28a94: 91 85 ldd r25, Z+9 ; 0x09 28a96: a2 85 ldd r26, Z+10 ; 0x0a 28a98: b3 85 ldd r27, Z+11 ; 0x0b 28a9a: 8f 71 andi r24, 0x1F ; 31 28a9c: 99 27 eor r25, r25 28a9e: aa 27 eor r26, r26 28aa0: bb 27 eor r27, r27 28aa2: 89 2b or r24, r25 28aa4: 8a 2b or r24, r26 28aa6: 8b 2b or r24, r27 28aa8: 09 f0 breq .+2 ; 0x28aac 28aaa: b3 c1 rjmp .+870 ; 0x28e12 //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'; 28aac: 10 92 81 13 sts 0x1381, r1 ; 0x801381 28ab0: 41 e8 ldi r20, 0x81 ; 129 28ab2: 53 e1 ldi r21, 0x13 ; 19 28ab4: be 01 movw r22, r28 28ab6: 69 5b subi r22, 0xB9 ; 185 28ab8: 7f 4f sbci r23, 0xFF ; 255 28aba: c6 01 movw r24, r12 28abc: 0f 94 3e 38 call 0x2707c ; 0x2707c } 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()) { 28ac0: 18 16 cp r1, r24 28ac2: 0c f0 brlt .+2 ; 0x28ac6 28ac4: a6 c1 rjmp .+844 ; 0x28e12 if (recursionCnt > MAX_DIR_DEPTH) 28ac6: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28aca: 87 30 cpi r24, 0x07 ; 7 28acc: 08 f0 brcs .+2 ; 0x28ad0 28ace: a1 c1 rjmp .+834 ; 0x28e12 return; uint8_t pn0 = p.name[0]; 28ad0: 28 96 adiw r28, 0x08 ; 8 28ad2: 8f ad ldd r24, Y+63 ; 0x3f 28ad4: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 28ad6: 88 23 and r24, r24 28ad8: 09 f4 brne .+2 ; 0x28adc 28ada: 9b c1 rjmp .+822 ; 0x28e12 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 28adc: 85 3e cpi r24, 0xE5 ; 229 28ade: 09 f4 brne .+2 ; 0x28ae2 28ae0: 39 c1 rjmp .+626 ; 0x28d54 28ae2: 8e 32 cpi r24, 0x2E ; 46 28ae4: 09 f4 brne .+2 ; 0x28ae8 28ae6: 36 c1 rjmp .+620 ; 0x28d54 if (longFilename[0] == '.') continue; 28ae8: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28aec: 8e 32 cpi r24, 0x2E ; 46 28aee: 09 f4 brne .+2 ; 0x28af2 28af0: 31 c1 rjmp .+610 ; 0x28d54 28af2: 63 96 adiw r28, 0x13 ; 19 28af4: 8f ad ldd r24, Y+63 ; 0x3f 28af6: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 28af8: 98 2f mov r25, r24 28afa: 9a 70 andi r25, 0x0A ; 10 28afc: 09 f0 breq .+2 ; 0x28b00 28afe: 2a c1 rjmp .+596 ; 0x28d54 28b00: 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; 28b02: 91 e0 ldi r25, 0x01 ; 1 28b04: 80 31 cpi r24, 0x10 ; 16 28b06: 19 f0 breq .+6 ; 0x28b0e 28b08: 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 28b0a: 80 31 cpi r24, 0x10 ; 16 28b0c: 31 f4 brne .+12 ; 0x28b1a 28b0e: e5 96 adiw r28, 0x35 ; 53 28b10: ff ad ldd r31, Y+63 ; 0x3f 28b12: e5 97 sbiw r28, 0x35 ; 53 28b14: ff 23 and r31, r31 28b16: 09 f4 brne .+2 ; 0x28b1a 28b18: 94 c0 rjmp .+296 ; 0x28c42 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 28b1a: 90 93 b6 13 sts 0x13B6, r25 ; 0x8013b6 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 28b1e: 80 31 cpi r24, 0x10 ; 16 28b20: 61 f0 breq .+24 ; 0x28b3a 28b22: 60 96 adiw r28, 0x10 ; 16 28b24: 8f ad ldd r24, Y+63 ; 0x3f 28b26: 60 97 sbiw r28, 0x10 ; 16 28b28: 87 34 cpi r24, 0x47 ; 71 28b2a: 09 f0 breq .+2 ; 0x28b2e 28b2c: 13 c1 rjmp .+550 ; 0x28d54 28b2e: 61 96 adiw r28, 0x11 ; 17 28b30: 8f ad ldd r24, Y+63 ; 0x3f 28b32: 61 97 sbiw r28, 0x11 ; 17 28b34: 8e 37 cpi r24, 0x7E ; 126 28b36: 09 f4 brne .+2 ; 0x28b3a 28b38: 0d c1 rjmp .+538 ; 0x28d54 switch (lsAction) { 28b3a: e5 96 adiw r28, 0x35 ; 53 28b3c: ff ad ldd r31, Y+63 ; 0x3f 28b3e: e5 97 sbiw r28, 0x35 ; 53 28b40: f1 30 cpi r31, 0x01 ; 1 28b42: 09 f4 brne .+2 ; 0x28b46 28b44: 1b c1 rjmp .+566 ; 0x28d7c 28b46: f2 30 cpi r31, 0x02 ; 2 28b48: 09 f4 brne .+2 ; 0x28b4c 28b4a: 25 c1 rjmp .+586 ; 0x28d96 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 28b4c: be 01 movw r22, r28 28b4e: 69 5b subi r22, 0xB9 ; 185 28b50: 7f 4f sbci r23, 0xFF ; 255 28b52: 8c e6 ldi r24, 0x6C ; 108 28b54: 93 e1 ldi r25, 0x13 ; 19 28b56: 0e 94 ab 70 call 0xe156 ; 0xe156 28b5a: c4 01 movw r24, r8 28b5c: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 28b60: 8c e6 ldi r24, 0x6C ; 108 28b62: 93 e1 ldi r25, 0x13 ; 19 28b64: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 28b68: 80 e2 ldi r24, 0x20 ; 32 28b6a: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 28b6e: a7 96 adiw r28, 0x27 ; 39 28b70: 6c ad ldd r22, Y+60 ; 0x3c 28b72: 7d ad ldd r23, Y+61 ; 0x3d 28b74: 8e ad ldd r24, Y+62 ; 0x3e 28b76: 9f ad ldd r25, Y+63 ; 0x3f 28b78: a7 97 sbiw r28, 0x27 ; 39 28b7a: 4a e0 ldi r20, 0x0A ; 10 28b7c: 0f 94 cd 96 call 0x32d9a ; 0x32d9a SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 28b80: 51 fe sbrs r5, 1 28b82: 45 c0 rjmp .+138 ; 0x28c0e { crmodDate = p.lastWriteDate; 28b84: a1 96 adiw r28, 0x21 ; 33 28b86: 2e ad ldd r18, Y+62 ; 0x3e 28b88: 3f ad ldd r19, Y+63 ; 0x3f 28b8a: a1 97 sbiw r28, 0x21 ; 33 28b8c: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28b90: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28b94: 6f 96 adiw r28, 0x1f ; 31 28b96: 4e ad ldd r20, Y+62 ; 0x3e 28b98: 5f ad ldd r21, Y+63 ; 0x3f 28b9a: 6f 97 sbiw r28, 0x1f ; 31 28b9c: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28ba0: 40 93 79 13 sts 0x1379, r20 ; 0x801379 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 28ba4: 69 96 adiw r28, 0x19 ; 25 28ba6: 8e ad ldd r24, Y+62 ; 0x3e 28ba8: 9f ad ldd r25, Y+63 ; 0x3f 28baa: 69 97 sbiw r28, 0x19 ; 25 28bac: 28 17 cp r18, r24 28bae: 39 07 cpc r19, r25 28bb0: 50 f0 brcs .+20 ; 0x28bc6 28bb2: 28 17 cp r18, r24 28bb4: 39 07 cpc r19, r25 28bb6: 99 f4 brne .+38 ; 0x28bde 28bb8: 67 96 adiw r28, 0x17 ; 23 28bba: 2e ad ldd r18, Y+62 ; 0x3e 28bbc: 3f ad ldd r19, Y+63 ; 0x3f 28bbe: 67 97 sbiw r28, 0x17 ; 23 28bc0: 42 17 cp r20, r18 28bc2: 53 07 cpc r21, r19 28bc4: 60 f4 brcc .+24 ; 0x28bde crmodDate = p.creationDate; 28bc6: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28bca: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28bce: 67 96 adiw r28, 0x17 ; 23 28bd0: 8e ad ldd r24, Y+62 ; 0x3e 28bd2: 9f ad ldd r25, Y+63 ; 0x3f 28bd4: 67 97 sbiw r28, 0x17 ; 23 28bd6: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28bda: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 28bde: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 28be2: 8f 93 push r24 28be4: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 28be8: 8f 93 push r24 28bea: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 28bee: 8f 93 push r24 28bf0: 80 91 79 13 lds r24, 0x1379 ; 0x801379 28bf4: 8f 93 push r24 28bf6: 20 ec ldi r18, 0xC0 ; 192 28bf8: 3d e9 ldi r19, 0x9D ; 157 28bfa: 3f 93 push r19 28bfc: 2f 93 push r18 28bfe: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 28c02: 0f 90 pop r0 28c04: 0f 90 pop r0 28c06: 0f 90 pop r0 28c08: 0f 90 pop r0 28c0a: 0f 90 pop r0 28c0c: 0f 90 pop r0 } if (lsParams.LFN) 28c0e: 11 23 and r17, r17 28c10: 99 f0 breq .+38 ; 0x28c38 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28c12: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28c16: 88 23 and r24, r24 28c18: 09 f4 brne .+2 ; 0x28c1c 28c1a: ba c0 rjmp .+372 ; 0x28d90 28c1c: 81 e8 ldi r24, 0x81 ; 129 28c1e: 93 e1 ldi r25, 0x13 ; 19 28c20: 9f 93 push r25 28c22: 8f 93 push r24 28c24: ea eb ldi r30, 0xBA ; 186 28c26: fd e9 ldi r31, 0x9D ; 157 28c28: ff 93 push r31 28c2a: ef 93 push r30 28c2c: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 28c30: 0f 90 pop r0 28c32: 0f 90 pop r0 28c34: 0f 90 pop r0 28c36: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 28c38: 0f 94 9d 98 call 0x3313a ; 0x3313a manage_heater(); 28c3c: 0f 94 f7 31 call 0x263ee ; 0x263ee 28c40: 89 c0 rjmp .+274 ; 0x28d54 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 28c42: 2d b7 in r18, 0x3d ; 61 28c44: 3e b7 in r19, 0x3e ; 62 28c46: e7 96 adiw r28, 0x37 ; 55 28c48: 3f af std Y+63, r19 ; 0x3f 28c4a: 2e af std Y+62, r18 ; 0x3e 28c4c: 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); 28c4e: be 01 movw r22, r28 28c50: 69 5b subi r22, 0xB9 ; 185 28c52: 7f 4f sbci r23, 0xFF ; 255 28c54: c5 01 movw r24, r10 28c56: 0e 94 ab 70 call 0xe156 ; 0xe156 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 28c5a: f4 01 movw r30, r8 28c5c: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 28c5e: 88 23 and r24, r24 28c60: 09 f4 brne .+2 ; 0x28c64 28c62: 86 c0 rjmp .+268 ; 0x28d70 28c64: 01 90 ld r0, Z+ 28c66: 00 20 and r0, r0 28c68: e9 f7 brne .-6 ; 0x28c64 28c6a: 31 97 sbiw r30, 0x01 ; 1 28c6c: e8 19 sub r30, r8 28c6e: f9 09 sbc r31, r9 28c70: d5 01 movw r26, r10 28c72: 0d 90 ld r0, X+ 28c74: 00 20 and r0, r0 28c76: e9 f7 brne .-6 ; 0x28c72 28c78: ea 19 sub r30, r10 28c7a: fb 09 sbc r31, r11 char path[len]; 28c7c: ea 0f add r30, r26 28c7e: fb 1f adc r31, r27 28c80: 31 96 adiw r30, 0x01 ; 1 28c82: 2d b7 in r18, 0x3d ; 61 28c84: 3e b7 in r19, 0x3e ; 62 28c86: 2e 1b sub r18, r30 28c88: 3f 0b sbc r19, r31 28c8a: 0f b6 in r0, 0x3f ; 63 28c8c: f8 94 cli 28c8e: 3e bf out 0x3e, r19 ; 62 28c90: 0f be out 0x3f, r0 ; 63 28c92: 2d bf out 0x3d, r18 ; 61 28c94: ed b7 in r30, 0x3d ; 61 28c96: fe b7 in r31, 0x3e ; 62 28c98: 31 96 adiw r30, 0x01 ; 1 28c9a: 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 28c9c: 61 ef ldi r22, 0xF1 ; 241 28c9e: 72 e0 ldi r23, 0x02 ; 2 28ca0: 81 11 cpse r24, r1 28ca2: b4 01 movw r22, r8 28ca4: c7 01 movw r24, r14 28ca6: 0f 94 e8 a6 call 0x34dd0 ; 0x34dd0 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 28caa: b5 01 movw r22, r10 28cac: c7 01 movw r24, r14 28cae: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 strcat(path, "/"); // 1 character 28cb2: 61 ef ldi r22, 0xF1 ; 241 28cb4: 72 e0 ldi r23, 0x02 ; 2 28cb6: c7 01 movw r24, r14 28cb8: 0f 94 c9 a6 call 0x34d92 ; 0x34d92 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 28cbc: 11 23 and r17, r17 28cbe: a9 f0 breq .+42 ; 0x28cea printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 28cc0: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28cc4: 81 11 cpse r24, r1 28cc6: 57 c0 rjmp .+174 ; 0x28d76 28cc8: c5 01 movw r24, r10 28cca: 9f 93 push r25 28ccc: 8f 93 push r24 28cce: ff 92 push r15 28cd0: ef 92 push r14 28cd2: 2f ec ldi r18, 0xCF ; 207 28cd4: 3d e9 ldi r19, 0x9D ; 157 28cd6: 3f 93 push r19 28cd8: 2f 93 push r18 28cda: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 28cde: 0f 90 pop r0 28ce0: 0f 90 pop r0 28ce2: 0f 90 pop r0 28ce4: 0f 90 pop r0 28ce6: 0f 90 pop r0 28ce8: 0f 90 pop r0 28cea: 1c a2 std Y+36, r1 ; 0x24 28cec: 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); 28cee: 21 e0 ldi r18, 0x01 ; 1 28cf0: a5 01 movw r20, r10 28cf2: b6 01 movw r22, r12 28cf4: ce 01 movw r24, r28 28cf6: 84 96 adiw r24, 0x24 ; 36 28cf8: 0f 94 2a 9a call 0x33454 ; 0x33454 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); 28cfc: 83 e2 ldi r24, 0x23 ; 35 28cfe: fe 01 movw r30, r28 28d00: b4 96 adiw r30, 0x24 ; 36 28d02: de 01 movw r26, r28 28d04: 11 96 adiw r26, 0x01 ; 1 28d06: 01 90 ld r0, Z+ 28d08: 0d 92 st X+, r0 28d0a: 8a 95 dec r24 28d0c: e1 f7 brne .-8 ; 0x28d06 28d0e: 10 fb bst r17, 0 28d10: 50 f8 bld r5, 0 28d12: 05 2d mov r16, r5 28d14: 20 e0 ldi r18, 0x00 ; 0 28d16: 50 e0 ldi r21, 0x00 ; 0 28d18: 40 e0 ldi r20, 0x00 ; 0 28d1a: be 01 movw r22, r28 28d1c: 6f 5f subi r22, 0xFF ; 255 28d1e: 7f 4f sbci r23, 0xFF ; 255 28d20: c7 01 movw r24, r14 28d22: 0f 94 07 45 call 0x28a0e ; 0x28a0e 28d26: ce 01 movw r24, r28 28d28: 01 96 adiw r24, 0x01 ; 1 28d2a: 0e 94 c6 70 call 0xe18c ; 0xe18c // close() is done automatically by destructor of SdFile if (lsParams.LFN) 28d2e: 11 23 and r17, r17 28d30: 21 f0 breq .+8 ; 0x28d3a puts_P(PSTR("DIR_EXIT")); 28d32: 86 ec ldi r24, 0xC6 ; 198 28d34: 9d e9 ldi r25, 0x9D ; 157 28d36: 0f 94 66 9f call 0x33ecc ; 0x33ecc 28d3a: ce 01 movw r24, r28 28d3c: 84 96 adiw r24, 0x24 ; 36 28d3e: 0e 94 c6 70 call 0xe18c ; 0xe18c 28d42: e7 96 adiw r28, 0x37 ; 55 28d44: ee ad ldd r30, Y+62 ; 0x3e 28d46: ff ad ldd r31, Y+63 ; 0x3f 28d48: e7 97 sbiw r28, 0x37 ; 55 28d4a: 0f b6 in r0, 0x3f ; 63 28d4c: f8 94 cli 28d4e: fe bf out 0x3e, r31 ; 62 28d50: 0f be out 0x3f, r0 ; 63 28d52: 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()) { 28d54: f6 01 movw r30, r12 28d56: 80 85 ldd r24, Z+8 ; 0x08 28d58: 91 85 ldd r25, Z+9 ; 0x09 28d5a: a2 85 ldd r26, Z+10 ; 0x0a 28d5c: b3 85 ldd r27, Z+11 ; 0x0b 28d5e: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28d62: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28d66: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28d6a: b0 93 80 13 sts 0x1380, r27 ; 0x801380 28d6e: 8c ce rjmp .-744 ; 0x28a88 // 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; 28d70: e1 e0 ldi r30, 0x01 ; 1 28d72: f0 e0 ldi r31, 0x00 ; 0 28d74: 7d cf rjmp .-262 ; 0x28c70 // 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); 28d76: 81 e8 ldi r24, 0x81 ; 129 28d78: 93 e1 ldi r25, 0x13 ; 19 28d7a: a7 cf rjmp .-178 ; 0x28cca else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 28d7c: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28d80: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28d84: 01 96 adiw r24, 0x01 ; 1 28d86: 90 93 83 16 sts 0x1683, r25 ; 0x801683 28d8a: 80 93 82 16 sts 0x1682, r24 ; 0x801682 28d8e: e2 cf rjmp .-60 ; 0x28d54 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28d90: 8c e6 ldi r24, 0x6C ; 108 28d92: 93 e1 ldi r25, 0x13 ; 19 28d94: 45 cf rjmp .-374 ; 0x28c20 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 28d96: be 01 movw r22, r28 28d98: 69 5b subi r22, 0xB9 ; 185 28d9a: 7f 4f sbci r23, 0xFF ; 255 28d9c: 8c e6 ldi r24, 0x6C ; 108 28d9e: 93 e1 ldi r25, 0x13 ; 19 28da0: 0e 94 ab 70 call 0xe156 ; 0xe156 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 28da4: a1 96 adiw r28, 0x21 ; 33 28da6: 2e ad ldd r18, Y+62 ; 0x3e 28da8: 3f ad ldd r19, Y+63 ; 0x3f 28daa: a1 97 sbiw r28, 0x21 ; 33 28dac: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28db0: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28db4: 6f 96 adiw r28, 0x1f ; 31 28db6: 4e ad ldd r20, Y+62 ; 0x3e 28db8: 5f ad ldd r21, Y+63 ; 0x3f 28dba: 6f 97 sbiw r28, 0x1f ; 31 28dbc: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28dc0: 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 ) ){ 28dc4: 69 96 adiw r28, 0x19 ; 25 28dc6: 8e ad ldd r24, Y+62 ; 0x3e 28dc8: 9f ad ldd r25, Y+63 ; 0x3f 28dca: 69 97 sbiw r28, 0x19 ; 25 28dcc: 28 17 cp r18, r24 28dce: 39 07 cpc r19, r25 28dd0: 50 f0 brcs .+20 ; 0x28de6 28dd2: 28 17 cp r18, r24 28dd4: 39 07 cpc r19, r25 28dd6: 99 f4 brne .+38 ; 0x28dfe 28dd8: 67 96 adiw r28, 0x17 ; 23 28dda: 2e ad ldd r18, Y+62 ; 0x3e 28ddc: 3f ad ldd r19, Y+63 ; 0x3f 28dde: 67 97 sbiw r28, 0x17 ; 23 28de0: 42 17 cp r20, r18 28de2: 53 07 cpc r21, r19 28de4: 60 f4 brcc .+24 ; 0x28dfe crmodDate = p.creationDate; 28de6: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28dea: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28dee: 67 96 adiw r28, 0x17 ; 23 28df0: 8e ad ldd r24, Y+62 ; 0x3e 28df2: 9f ad ldd r25, Y+63 ; 0x3f 28df4: 67 97 sbiw r28, 0x17 ; 23 28df6: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28dfa: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } //writeDate = p.lastAccessDate; if (match != NULL) { 28dfe: 61 14 cp r6, r1 28e00: 71 04 cpc r7, r1 28e02: 59 f1 breq .+86 ; 0x28e5a if (strcasecmp(match, filename) == 0) return; 28e04: 6c e6 ldi r22, 0x6C ; 108 28e06: 73 e1 ldi r23, 0x13 ; 19 28e08: c3 01 movw r24, r6 28e0a: 0f 94 b6 a6 call 0x34d6c ; 0x34d6c 28e0e: 89 2b or r24, r25 28e10: 59 f5 brne .+86 ; 0x28e68 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 28e12: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28e16: 81 50 subi r24, 0x01 ; 1 28e18: 80 93 d8 0d sts 0x0DD8, r24 ; 0x800dd8 cnt++; break; } } } // while readDir } 28e1c: 0f b6 in r0, 0x3f ; 63 28e1e: f8 94 cli 28e20: 3e be out 0x3e, r3 ; 62 28e22: 0f be out 0x3f, r0 ; 63 28e24: 2d be out 0x3d, r2 ; 61 28e26: ca 58 subi r28, 0x8A ; 138 28e28: df 4f sbci r29, 0xFF ; 255 28e2a: 0f b6 in r0, 0x3f ; 63 28e2c: f8 94 cli 28e2e: de bf out 0x3e, r29 ; 62 28e30: 0f be out 0x3f, r0 ; 63 28e32: cd bf out 0x3d, r28 ; 61 28e34: df 91 pop r29 28e36: cf 91 pop r28 28e38: 1f 91 pop r17 28e3a: 0f 91 pop r16 28e3c: ff 90 pop r15 28e3e: ef 90 pop r14 28e40: df 90 pop r13 28e42: cf 90 pop r12 28e44: bf 90 pop r11 28e46: af 90 pop r10 28e48: 9f 90 pop r9 28e4a: 8f 90 pop r8 28e4c: 7f 90 pop r7 28e4e: 6f 90 pop r6 28e50: 5f 90 pop r5 28e52: 4f 90 pop r4 28e54: 3f 90 pop r3 28e56: 2f 90 pop r2 28e58: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 28e5a: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28e5e: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28e62: 48 16 cp r4, r24 28e64: 19 06 cpc r1, r25 28e66: a9 f2 breq .-86 ; 0x28e12 cnt++; 28e68: 43 94 inc r4 28e6a: 74 cf rjmp .-280 ; 0x28d54 00028e6c : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 28e6c: cf 92 push r12 28e6e: df 92 push r13 28e70: ef 92 push r14 28e72: ff 92 push r15 28e74: 0f 93 push r16 28e76: cf 93 push r28 28e78: df 93 push r29 28e7a: cd b7 in r28, 0x3d ; 61 28e7c: de b7 in r29, 0x3e ; 62 28e7e: a3 97 sbiw r28, 0x23 ; 35 28e80: 0f b6 in r0, 0x3f ; 63 28e82: f8 94 cli 28e84: de bf out 0x3e, r29 ; 62 28e86: 0f be out 0x3f, r0 ; 63 28e88: cd bf out 0x3d, r28 ; 61 28e8a: 6c 01 movw r12, r24 { curDir=&workDir; 28e8c: 83 e1 ldi r24, 0x13 ; 19 28e8e: e8 2e mov r14, r24 28e90: 84 e1 ldi r24, 0x14 ; 20 28e92: f8 2e mov r15, r24 28e94: 85 e1 ldi r24, 0x15 ; 21 28e96: 94 e1 ldi r25, 0x14 ; 20 28e98: d7 01 movw r26, r14 28e9a: 8d 93 st X+, r24 28e9c: 9c 93 st X, r25 nrFiles=nr; 28e9e: 10 92 83 16 sts 0x1683, r1 ; 0x801683 28ea2: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->rewind(); 28ea6: 0e 94 c1 70 call 0xe182 ; 0xe182 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 28eaa: 00 e0 ldi r16, 0x00 ; 0 28eac: 0e 7f andi r16, 0xFE ; 254 28eae: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 28eb0: d7 01 movw r26, r14 28eb2: ed 91 ld r30, X+ 28eb4: fc 91 ld r31, X 28eb6: 83 e2 ldi r24, 0x23 ; 35 28eb8: de 01 movw r26, r28 28eba: 11 96 adiw r26, 0x01 ; 1 28ebc: 01 90 ld r0, Z+ 28ebe: 0d 92 st X+, r0 28ec0: 8a 95 dec r24 28ec2: e1 f7 brne .-8 ; 0x28ebc 28ec4: 22 e0 ldi r18, 0x02 ; 2 28ec6: a6 01 movw r20, r12 28ec8: be 01 movw r22, r28 28eca: 6f 5f subi r22, 0xFF ; 255 28ecc: 7f 4f sbci r23, 0xFF ; 255 28ece: 8a ed ldi r24, 0xDA ; 218 28ed0: 92 e0 ldi r25, 0x02 ; 2 28ed2: 0f 94 07 45 call 0x28a0e ; 0x28a0e 28ed6: ce 01 movw r24, r28 28ed8: 01 96 adiw r24, 0x01 ; 1 28eda: 0e 94 c6 70 call 0xe18c ; 0xe18c } 28ede: a3 96 adiw r28, 0x23 ; 35 28ee0: 0f b6 in r0, 0x3f ; 63 28ee2: f8 94 cli 28ee4: de bf out 0x3e, r29 ; 62 28ee6: 0f be out 0x3f, r0 ; 63 28ee8: cd bf out 0x3d, r28 ; 61 28eea: df 91 pop r29 28eec: cf 91 pop r28 28eee: 0f 91 pop r16 28ef0: ff 90 pop r15 28ef2: ef 90 pop r14 28ef4: df 90 pop r13 28ef6: cf 90 pop r12 28ef8: 08 95 ret 00028efa : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 28efa: ef 92 push r14 28efc: ff 92 push r15 28efe: 0f 93 push r16 28f00: cf 93 push r28 28f02: df 93 push r29 28f04: cd b7 in r28, 0x3d ; 61 28f06: de b7 in r29, 0x3e ; 62 28f08: a3 97 sbiw r28, 0x23 ; 35 28f0a: 0f b6 in r0, 0x3f ; 63 28f0c: f8 94 cli 28f0e: de bf out 0x3e, r29 ; 62 28f10: 0f be out 0x3f, r0 ; 63 28f12: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 28f14: 23 e1 ldi r18, 0x13 ; 19 28f16: e2 2e mov r14, r18 28f18: 24 e1 ldi r18, 0x14 ; 20 28f1a: f2 2e mov r15, r18 28f1c: 25 e1 ldi r18, 0x15 ; 21 28f1e: 34 e1 ldi r19, 0x14 ; 20 28f20: d7 01 movw r26, r14 28f22: 2d 93 st X+, r18 28f24: 3c 93 st X, r19 nrFiles = 0; 28f26: 10 92 83 16 sts 0x1683, r1 ; 0x801683 28f2a: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->seekSet((uint32_t)entry << 5); 28f2e: b0 e0 ldi r27, 0x00 ; 0 28f30: a0 e0 ldi r26, 0x00 ; 0 28f32: ac 01 movw r20, r24 28f34: bd 01 movw r22, r26 28f36: e5 e0 ldi r30, 0x05 ; 5 28f38: 44 0f add r20, r20 28f3a: 55 1f adc r21, r21 28f3c: 66 1f adc r22, r22 28f3e: 77 1f adc r23, r23 28f40: ea 95 dec r30 28f42: d1 f7 brne .-12 ; 0x28f38 28f44: c9 01 movw r24, r18 28f46: 0f 94 db 38 call 0x271b6 ; 0x271b6 28f4a: 00 e0 ldi r16, 0x00 ; 0 28f4c: 0e 7f andi r16, 0xFE ; 254 28f4e: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 28f50: d7 01 movw r26, r14 28f52: ed 91 ld r30, X+ 28f54: fc 91 ld r31, X 28f56: 83 e2 ldi r24, 0x23 ; 35 28f58: de 01 movw r26, r28 28f5a: 11 96 adiw r26, 0x01 ; 1 28f5c: 01 90 ld r0, Z+ 28f5e: 0d 92 st X+, r0 28f60: 8a 95 dec r24 28f62: e1 f7 brne .-8 ; 0x28f5c 28f64: 22 e0 ldi r18, 0x02 ; 2 28f66: 50 e0 ldi r21, 0x00 ; 0 28f68: 40 e0 ldi r20, 0x00 ; 0 28f6a: be 01 movw r22, r28 28f6c: 6f 5f subi r22, 0xFF ; 255 28f6e: 7f 4f sbci r23, 0xFF ; 255 28f70: 8a ed ldi r24, 0xDA ; 218 28f72: 92 e0 ldi r25, 0x02 ; 2 28f74: 0f 94 07 45 call 0x28a0e ; 0x28a0e 28f78: ce 01 movw r24, r28 28f7a: 01 96 adiw r24, 0x01 ; 1 28f7c: 0e 94 c6 70 call 0xe18c ; 0xe18c } 28f80: a3 96 adiw r28, 0x23 ; 35 28f82: 0f b6 in r0, 0x3f ; 63 28f84: f8 94 cli 28f86: de bf out 0x3e, r29 ; 62 28f88: 0f be out 0x3f, r0 ; 63 28f8a: cd bf out 0x3d, r28 ; 61 28f8c: df 91 pop r29 28f8e: cf 91 pop r28 28f90: 0f 91 pop r16 28f92: ff 90 pop r15 28f94: ef 90 pop r14 28f96: 08 95 ret 00028f98 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 28f98: cf 92 push r12 28f9a: df 92 push r13 28f9c: ef 92 push r14 28f9e: ff 92 push r15 28fa0: 0f 93 push r16 28fa2: cf 93 push r28 28fa4: df 93 push r29 28fa6: cd b7 in r28, 0x3d ; 61 28fa8: de b7 in r29, 0x3e ; 62 28faa: a3 97 sbiw r28, 0x23 ; 35 28fac: 0f b6 in r0, 0x3f ; 63 28fae: f8 94 cli 28fb0: de bf out 0x3e, r29 ; 62 28fb2: 0f be out 0x3f, r0 ; 63 28fb4: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 28fb6: 83 e1 ldi r24, 0x13 ; 19 28fb8: c8 2e mov r12, r24 28fba: 84 e1 ldi r24, 0x14 ; 20 28fbc: d8 2e mov r13, r24 28fbe: 85 e1 ldi r24, 0x15 ; 21 28fc0: 94 e1 ldi r25, 0x14 ; 20 28fc2: d6 01 movw r26, r12 28fc4: 8d 93 st X+, r24 28fc6: 9c 93 st X, r25 nrFiles=0; 28fc8: 22 e8 ldi r18, 0x82 ; 130 28fca: e2 2e mov r14, r18 28fcc: 26 e1 ldi r18, 0x16 ; 22 28fce: f2 2e mov r15, r18 28fd0: f7 01 movw r30, r14 28fd2: 11 82 std Z+1, r1 ; 0x01 28fd4: 10 82 st Z, r1 curDir->rewind(); 28fd6: 0e 94 c1 70 call 0xe182 ; 0xe182 28fda: 00 e0 ldi r16, 0x00 ; 0 28fdc: 0e 7f andi r16, 0xFE ; 254 28fde: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 28fe0: d6 01 movw r26, r12 28fe2: ed 91 ld r30, X+ 28fe4: fc 91 ld r31, X 28fe6: 83 e2 ldi r24, 0x23 ; 35 28fe8: de 01 movw r26, r28 28fea: 11 96 adiw r26, 0x01 ; 1 28fec: 01 90 ld r0, Z+ 28fee: 0d 92 st X+, r0 28ff0: 8a 95 dec r24 28ff2: e1 f7 brne .-8 ; 0x28fec 28ff4: 21 e0 ldi r18, 0x01 ; 1 28ff6: 50 e0 ldi r21, 0x00 ; 0 28ff8: 40 e0 ldi r20, 0x00 ; 0 28ffa: be 01 movw r22, r28 28ffc: 6f 5f subi r22, 0xFF ; 255 28ffe: 7f 4f sbci r23, 0xFF ; 255 29000: 8a ed ldi r24, 0xDA ; 218 29002: 92 e0 ldi r25, 0x02 ; 2 29004: 0f 94 07 45 call 0x28a0e ; 0x28a0e 29008: ce 01 movw r24, r28 2900a: 01 96 adiw r24, 0x01 ; 1 2900c: 0e 94 c6 70 call 0xe18c ; 0xe18c //SERIAL_ECHOLN(nrFiles); return nrFiles; } 29010: f7 01 movw r30, r14 29012: 80 81 ld r24, Z 29014: 91 81 ldd r25, Z+1 ; 0x01 29016: a3 96 adiw r28, 0x23 ; 35 29018: 0f b6 in r0, 0x3f ; 63 2901a: f8 94 cli 2901c: de bf out 0x3e, r29 ; 62 2901e: 0f be out 0x3f, r0 ; 63 29020: cd bf out 0x3d, r28 ; 61 29022: df 91 pop r29 29024: cf 91 pop r28 29026: 0f 91 pop r16 29028: ff 90 pop r15 2902a: ef 90 pop r14 2902c: df 90 pop r13 2902e: cf 90 pop r12 29030: 08 95 ret 00029032 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 29032: cf 93 push r28 29034: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29036: 8f e2 ldi r24, 0x2F ; 47 29038: 0e 94 cc 70 call 0xe198 ; 0xe198 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2903c: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2903e: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 29040: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29044: c8 17 cp r28, r24 29046: 60 f4 brcc .+24 ; 0x29060 { SERIAL_PROTOCOL(dir_names[i]); 29048: cd 9f mul r28, r29 2904a: c0 01 movw r24, r0 2904c: 11 24 eor r1, r1 2904e: 86 54 subi r24, 0x46 ; 70 29050: 9c 4e sbci r25, 0xEC ; 236 29052: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 29056: 8f e2 ldi r24, 0x2F ; 47 29058: 0e 94 cc 70 call 0xe198 ; 0xe198 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2905c: cf 5f subi r28, 0xFF ; 255 2905e: f0 cf rjmp .-32 ; 0x29040 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 29060: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29064: 81 11 cpse r24, r1 29066: 06 c0 rjmp .+12 ; 0x29074 29068: 8c e6 ldi r24, 0x6C ; 108 2906a: 93 e1 ldi r25, 0x13 ; 19 } 2906c: df 91 pop r29 2906e: cf 91 pop r28 29070: 0c 94 2e 7d jmp 0xfa5c ; 0xfa5c for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 29074: 81 e8 ldi r24, 0x81 ; 129 29076: 93 e1 ldi r25, 0x13 ; 19 29078: f9 cf rjmp .-14 ; 0x2906c 0002907a : 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) { 2907a: cf 92 push r12 2907c: df 92 push r13 2907e: ef 92 push r14 29080: ff 92 push r15 29082: 6b 01 movw r12, r22 29084: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 29086: 88 ea ldi r24, 0xA8 ; 168 29088: 9c e0 ldi r25, 0x0C ; 12 2908a: 0f 94 85 a0 call 0x3410a ; 0x3410a 2908e: ab 01 movw r20, r22 29090: bc 01 movw r22, r24 29092: 4c 0d add r20, r12 29094: 5d 1d adc r21, r13 29096: 6e 1d adc r22, r14 29098: 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); 2909a: 88 ea ldi r24, 0xA8 ; 168 2909c: 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); } 2909e: ff 90 pop r15 290a0: ef 90 pop r14 290a2: df 90 pop r13 290a4: 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); 290a6: 0d 94 d3 a0 jmp 0x341a6 ; 0x341a6 000290aa : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 290aa: cf 93 push r28 290ac: df 93 push r29 290ae: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 290b0: 0f 94 85 a0 call 0x3410a ; 0x3410a if (val == EEPROM_EMPTY_VALUE32) { 290b4: 6f 3f cpi r22, 0xFF ; 255 290b6: 2f ef ldi r18, 0xFF ; 255 290b8: 72 07 cpc r23, r18 290ba: 82 07 cpc r24, r18 290bc: 92 07 cpc r25, r18 290be: 49 f4 brne .+18 ; 0x290d2 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); 290c0: 40 e0 ldi r20, 0x00 ; 0 290c2: 50 e0 ldi r21, 0x00 ; 0 290c4: ba 01 movw r22, r20 290c6: ce 01 movw r24, r28 290c8: 0f 94 d3 a0 call 0x341a6 ; 0x341a6 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; 290cc: 60 e0 ldi r22, 0x00 ; 0 290ce: 70 e0 ldi r23, 0x00 ; 0 290d0: cb 01 movw r24, r22 } return val; } 290d2: df 91 pop r29 290d4: cf 91 pop r28 290d6: 08 95 ret 000290d8 : : "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(){ 290d8: 0f 93 push r16 290da: 1f 93 push r17 290dc: cf 93 push r28 290de: df 93 push r29 if( ! gfEnsureBlock() ){ 290e0: 0f 94 53 3e call 0x27ca6 ; 0x27ca6 290e4: 88 23 and r24, r24 290e6: 39 f1 breq .+78 ; 0x29136 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; 290e8: 20 91 15 16 lds r18, 0x1615 ; 0x801615 290ec: 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; 290f0: 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; 290f2: 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 == ';' ){ 290f4: 88 81 ld r24, Y 290f6: 8b 33 cpi r24, 0x3B ; 59 290f8: 51 f5 brne .+84 ; 0x2914e // 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); 290fa: fe 01 movw r30, r28 000290fc : 290fc: 61 91 ld r22, Z+ 290fe: 6a 30 cpi r22, 0x0A ; 10 29100: e9 f7 brne .-6 ; 0x290fc 29102: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 29104: cf 01 movw r24, r30 29106: 89 5d subi r24, 0xD9 ; 217 29108: 9d 40 sbci r25, 0x0D ; 13 2910a: 81 30 cpi r24, 0x01 ; 1 2910c: 92 40 sbci r25, 0x02 ; 2 2910e: e4 f0 brlt .+56 ; 0x29148 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 29110: ce 01 movw r24, r28 29112: 82 1b sub r24, r18 29114: 93 0b sbc r25, r19 29116: 01 97 sbiw r24, 0x01 ; 1 29118: 0f 94 0c 3a call 0x27418 ; 0x27418 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2911c: 8a ef ldi r24, 0xFA ; 250 2911e: 95 e1 ldi r25, 0x15 ; 21 29120: 0f 94 c5 37 call 0x26f8a ; 0x26f8a 29124: 88 23 and r24, r24 29126: 39 f0 breq .+14 ; 0x29136 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 29128: 0f 94 53 3e call 0x27ca6 ; 0x27ca6 rdPtr = start = blockBuffBegin; 2912c: 29 ed ldi r18, 0xD9 ; 217 2912e: 3d e0 ldi r19, 0x0D ; 13 29130: 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 29132: 81 11 cpse r24, r1 29134: e2 cf rjmp .-60 ; 0x290fa } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 29136: 89 ed ldi r24, 0xD9 ; 217 29138: 9f e0 ldi r25, 0x0F ; 15 2913a: 90 93 16 16 sts 0x1616, r25 ; 0x801616 2913e: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return -1; 29142: cf ef ldi r28, 0xFF ; 255 29144: df ef ldi r29, 0xFF ; 255 29146: 34 c0 rjmp .+104 ; 0x291b0 29148: 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){ 2914a: c1 f5 brne .+112 ; 0x291bc // 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 2914c: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 2914e: ce 01 movw r24, r28 29150: 82 1b sub r24, r18 29152: 93 0b sbc r25, r19 29154: 01 96 adiw r24, 0x01 ; 1 29156: 0f 94 0c 3a call 0x27418 ; 0x27418 int16_t rv = *rdPtr++; 2915a: ce 01 movw r24, r28 2915c: 01 96 adiw r24, 0x01 ; 1 2915e: c8 81 ld r28, Y 29160: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 29162: 00 91 02 16 lds r16, 0x1602 ; 0x801602 29166: 10 91 03 16 lds r17, 0x1603 ; 0x801603 2916a: 20 91 04 16 lds r18, 0x1604 ; 0x801604 2916e: 30 91 05 16 lds r19, 0x1605 ; 0x801605 29172: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 29176: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2917a: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 2917e: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 29182: 04 17 cp r16, r20 29184: 15 07 cpc r17, r21 29186: 26 07 cpc r18, r22 29188: 37 07 cpc r19, r23 2918a: a8 f6 brcc .-86 ; 0x29136 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 2918c: 9c 01 movw r18, r24 2918e: 29 5d subi r18, 0xD9 ; 217 29190: 3d 40 sbci r19, 0x0D ; 13 29192: 21 15 cp r18, r1 29194: 32 40 sbci r19, 0x02 ; 2 29196: 44 f0 brlt .+16 ; 0x291a8 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 29198: 8a ef ldi r24, 0xFA ; 250 2919a: 95 e1 ldi r25, 0x15 ; 21 2919c: 0f 94 c5 37 call 0x26f8a ; 0x26f8a 291a0: 88 23 and r24, r24 291a2: 49 f2 breq .-110 ; 0x29136 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 291a4: 89 ed ldi r24, 0xD9 ; 217 291a6: 9d e0 ldi r25, 0x0D ; 13 } // save the current read ptr for the next run gfReadPtr = rdPtr; 291a8: 90 93 16 16 sts 0x1616, r25 ; 0x801616 291ac: 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; } 291b0: ce 01 movw r24, r28 291b2: df 91 pop r29 291b4: cf 91 pop r28 291b6: 1f 91 pop r17 291b8: 0f 91 pop r16 291ba: 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 == ';' ){ 291bc: 88 81 ld r24, Y 291be: 8b 33 cpi r24, 0x3B ; 59 291c0: 09 f4 brne .+2 ; 0x291c4 291c2: 98 cf rjmp .-208 ; 0x290f4 291c4: c3 cf rjmp .-122 ; 0x2914c 000291c6 : * 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() { 291c6: 2f 92 push r2 291c8: 3f 92 push r3 291ca: 4f 92 push r4 291cc: 5f 92 push r5 291ce: 6f 92 push r6 291d0: 7f 92 push r7 291d2: 8f 92 push r8 291d4: 9f 92 push r9 291d6: af 92 push r10 291d8: bf 92 push r11 291da: cf 92 push r12 291dc: df 92 push r13 291de: ef 92 push r14 291e0: ff 92 push r15 291e2: 0f 93 push r16 291e4: 1f 93 push r17 291e6: cf 93 push r28 291e8: df 93 push r29 291ea: cd b7 in r28, 0x3d ; 61 291ec: de b7 in r29, 0x3e ; 62 291ee: ed 97 sbiw r28, 0x3d ; 61 291f0: 0f b6 in r0, 0x3f ; 63 291f2: f8 94 cli 291f4: de bf out 0x3e, r29 ; 62 291f6: 0f be out 0x3f, r0 ; 63 291f8: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 291fa: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 291fe: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b lastSortedFilePosition = 0; 29202: 10 92 d6 15 sts 0x15D6, r1 ; 0x8015d6 29206: 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 2920a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2920e: 82 fd sbrc r24, 2 29210: f7 c0 rjmp .+494 ; 0x29400 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 29212: 89 e0 ldi r24, 0x09 ; 9 29214: 9f e0 ldi r25, 0x0F ; 15 29216: 0f 94 7d a0 call 0x340fa ; 0x340fa 2921a: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2921c: 82 e0 ldi r24, 0x02 ; 2 2921e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 29222: 0f 94 cc 47 call 0x28f98 ; 0x28f98 29226: 6c 01 movw r12, r24 if (fileCnt > 0) { 29228: 00 97 sbiw r24, 0x00 ; 0 2922a: 09 f4 brne .+2 ; 0x2922e 2922c: e6 c0 rjmp .+460 ; 0x293fa // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2922e: 85 36 cpi r24, 0x65 ; 101 29230: 91 05 cpc r25, r1 29232: 80 f0 brcs .+32 ; 0x29254 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 29234: 32 e0 ldi r19, 0x02 ; 2 29236: 33 16 cp r3, r19 29238: 51 f0 breq .+20 ; 0x2924e 2923a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 2923e: 81 11 cpse r24, r1 29240: 06 c0 rjmp .+12 ; 0x2924e lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 29242: 8d e0 ldi r24, 0x0D ; 13 29244: 9b e5 ldi r25, 0x5B ; 91 29246: 0e 94 3c 6d call 0xda78 ; 0xda78 2924a: 0f 94 19 0b call 0x21632 ; 0x21632 } fileCnt = SDSORT_LIMIT; 2924e: f4 e6 ldi r31, 0x64 ; 100 29250: cf 2e mov r12, r31 29252: d1 2c mov r13, r1 } sort_count = fileCnt; 29254: d0 92 0c 15 sts 0x150C, r13 ; 0x80150c 29258: c0 92 0b 15 sts 0x150B, r12 ; 0x80150b 2925c: 6d e0 ldi r22, 0x0D ; 13 2925e: 66 2e mov r6, r22 29260: 65 e1 ldi r22, 0x15 ; 21 29262: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 29264: f1 2c mov r15, r1 29266: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 29268: 75 e1 ldi r23, 0x15 ; 21 2926a: a7 2e mov r10, r23 2926c: 74 e1 ldi r23, 0x14 ; 20 2926e: b7 2e mov r11, r23 nrFiles = 1; 29270: 88 24 eor r8, r8 29272: 83 94 inc r8 29274: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 29276: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2927a: 82 fd sbrc r24, 2 2927c: c1 c0 rjmp .+386 ; 0x29400 manage_heater(); 2927e: 0f 94 f7 31 call 0x263ee ; 0x263ee if (i == 0) 29282: e1 14 cp r14, r1 29284: f1 04 cpc r15, r1 29286: 09 f0 breq .+2 ; 0x2928a 29288: d4 c0 rjmp .+424 ; 0x29432 getfilename(0); 2928a: 90 e0 ldi r25, 0x00 ; 0 2928c: 80 e0 ldi r24, 0x00 ; 0 2928e: 0f 94 36 47 call 0x28e6c ; 0x28e6c else getfilename_next(position); sort_entries[i] = position >> 5; 29292: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 29296: 90 91 7e 13 lds r25, 0x137E ; 0x80137e 2929a: a0 91 7f 13 lds r26, 0x137F ; 0x80137f 2929e: b0 91 80 13 lds r27, 0x1380 ; 0x801380 292a2: 55 e0 ldi r21, 0x05 ; 5 292a4: b6 95 lsr r27 292a6: a7 95 ror r26 292a8: 97 95 ror r25 292aa: 87 95 ror r24 292ac: 5a 95 dec r21 292ae: d1 f7 brne .-12 ; 0x292a4 292b0: f3 01 movw r30, r6 292b2: 81 93 st Z+, r24 292b4: 91 93 st Z+, r25 292b6: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 292b8: ff ef ldi r31, 0xFF ; 255 292ba: ef 1a sub r14, r31 292bc: ff 0a sbc r15, r31 292be: ce 14 cp r12, r14 292c0: df 04 cpc r13, r15 292c2: c9 f6 brne .-78 ; 0x29276 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 292c4: 21 e0 ldi r18, 0x01 ; 1 292c6: e2 16 cp r14, r18 292c8: f1 04 cpc r15, r1 292ca: 09 f4 brne .+2 ; 0x292ce 292cc: 96 c0 rjmp .+300 ; 0x293fa 292ce: 32 e0 ldi r19, 0x02 ; 2 292d0: 33 16 cp r3, r19 292d2: 09 f4 brne .+2 ; 0x292d6 292d4: 92 c0 rjmp .+292 ; 0x293fa 292d6: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 292da: 21 11 cpse r18, r1 292dc: 8e c0 rjmp .+284 ; 0x293fa #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 292de: 90 93 d6 15 sts 0x15D6, r25 ; 0x8015d6 292e2: 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)); 292e6: 8d ef ldi r24, 0xFD ; 253 292e8: 9a e5 ldi r25, 0x5A ; 90 292ea: 0e 94 3c 6d call 0xda78 ; 0xda78 292ee: ee 9c mul r14, r14 292f0: 90 01 movw r18, r0 292f2: ef 9c mul r14, r15 292f4: 30 0d add r19, r0 292f6: 30 0d add r19, r0 292f8: 11 24 eor r1, r1 292fa: bc 01 movw r22, r24 292fc: c9 01 movw r24, r18 292fe: 96 95 lsr r25 29300: 87 95 ror r24 29302: 0f 94 bf 91 call 0x3237e ; 0x3237e 29306: 3f e0 ldi r19, 0x0F ; 15 29308: a3 2e mov r10, r19 2930a: 35 e1 ldi r19, 0x15 ; 21 2930c: 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; 2930e: 91 2c mov r9, r1 29310: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 29312: cc 24 eor r12, r12 29314: c3 94 inc r12 29316: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 29318: c4 01 movw r24, r8 2931a: 0f 94 90 91 call 0x32320 ; 0x32320 counter += i; 2931e: 8c 0c add r8, r12 29320: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 29322: f5 01 movw r30, r10 29324: 01 90 ld r0, Z+ 29326: f0 81 ld r31, Z 29328: e0 2d mov r30, r0 2932a: f9 af std Y+57, r31 ; 0x39 2932c: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2932e: cf 01 movw r24, r30 29330: 0f 94 7d 47 call 0x28efa ; 0x28efa strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 29334: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29338: 6c e6 ldi r22, 0x6C ; 108 2933a: 73 e1 ldi r23, 0x13 ; 19 2933c: 88 23 and r24, r24 2933e: 11 f0 breq .+4 ; 0x29344 29340: 61 e8 ldi r22, 0x81 ; 129 29342: 73 e1 ldi r23, 0x13 ; 19 29344: ce 01 movw r24, r28 29346: 01 96 adiw r24, 0x01 ; 1 29348: 0f 94 e8 a6 call 0x34dd0 ; 0x34dd0 crmod_date_bckp = crmodDate; 2934c: 60 90 7b 13 lds r6, 0x137B ; 0x80137b 29350: 70 90 7c 13 lds r7, 0x137C ; 0x80137c crmod_time_bckp = crmodTime; 29354: 20 91 79 13 lds r18, 0x1379 ; 0x801379 29358: 30 91 7a 13 lds r19, 0x137A ; 0x80137a 2935c: 3b af std Y+59, r19 ; 0x3b 2935e: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 29360: 20 90 b6 13 lds r2, 0x13B6 ; 0x8013b6 29364: bf aa std Y+55, r11 ; 0x37 29366: ae aa std Y+54, r10 ; 0x36 29368: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2936a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2936e: 82 fd sbrc r24, 2 29370: 47 c0 rjmp .+142 ; 0x29400 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 29372: 0f 94 f7 31 call 0x263ee ; 0x263ee const uint16_t o2 = sort_entries[j - 1]; 29376: c8 01 movw r24, r16 29378: 01 97 sbiw r24, 0x01 ; 1 2937a: 9d af std Y+61, r25 ; 0x3d 2937c: 8c af std Y+60, r24 ; 0x3c 2937e: ee a9 ldd r30, Y+54 ; 0x36 29380: ff a9 ldd r31, Y+55 ; 0x37 29382: 52 90 ld r5, -Z 29384: 42 90 ld r4, -Z 29386: ff ab std Y+55, r31 ; 0x37 29388: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2938a: c2 01 movw r24, r4 2938c: 0f 94 7d 47 call 0x28efa ; 0x28efa char *name2 = LONGEST_FILENAME; // use the string in-place 29390: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29394: 6c e6 ldi r22, 0x6C ; 108 29396: 73 e1 ldi r23, 0x13 ; 19 29398: 88 23 and r24, r24 2939a: 11 f0 breq .+4 ; 0x293a0 2939c: 61 e8 ldi r22, 0x81 ; 129 2939e: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 293a0: 31 10 cpse r3, r1 293a2: 8a c0 rjmp .+276 ; 0x294b8 293a4: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 293a8: 28 12 cpse r2, r24 293aa: 83 c0 rjmp .+262 ; 0x294b2 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 293ac: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 293b0: 90 91 7c 13 lds r25, 0x137C ; 0x80137c 293b4: 68 16 cp r6, r24 293b6: 79 06 cpc r7, r25 293b8: 09 f0 breq .+2 ; 0x293bc 293ba: 6c c0 rjmp .+216 ; 0x29494 293bc: 80 91 79 13 lds r24, 0x1379 ; 0x801379 293c0: 90 91 7a 13 lds r25, 0x137A ; 0x80137a 293c4: 2a ad ldd r18, Y+58 ; 0x3a 293c6: 3b ad ldd r19, Y+59 ; 0x3b 293c8: 82 17 cp r24, r18 293ca: 93 07 cpc r25, r19 293cc: 08 f0 brcs .+2 ; 0x293d0 293ce: 66 c0 rjmp .+204 ; 0x2949c #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 293d0: 00 0f add r16, r16 293d2: 11 1f adc r17, r17 293d4: f8 01 movw r30, r16 293d6: e3 5f subi r30, 0xF3 ; 243 293d8: fa 4e sbci r31, 0xEA ; 234 293da: 28 ad ldd r18, Y+56 ; 0x38 293dc: 39 ad ldd r19, Y+57 ; 0x39 293de: 31 83 std Z+1, r19 ; 0x01 293e0: 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){ 293e2: 3f ef ldi r19, 0xFF ; 255 293e4: c3 1a sub r12, r19 293e6: d3 0a sbc r13, r19 293e8: 82 e0 ldi r24, 0x02 ; 2 293ea: a8 0e add r10, r24 293ec: b1 1c adc r11, r1 293ee: ec 14 cp r14, r12 293f0: fd 04 cpc r15, r13 293f2: 09 f0 breq .+2 ; 0x293f6 293f4: 91 cf rjmp .-222 ; 0x29318 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 293f6: 0f 94 b1 91 call 0x32362 ; 0x32362 } } KEEPALIVE_STATE(NOT_BUSY); 293fa: 81 e0 ldi r24, 0x01 ; 1 293fc: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 29400: ed 96 adiw r28, 0x3d ; 61 29402: 0f b6 in r0, 0x3f ; 63 29404: f8 94 cli 29406: de bf out 0x3e, r29 ; 62 29408: 0f be out 0x3f, r0 ; 63 2940a: cd bf out 0x3d, r28 ; 61 2940c: df 91 pop r29 2940e: cf 91 pop r28 29410: 1f 91 pop r17 29412: 0f 91 pop r16 29414: ff 90 pop r15 29416: ef 90 pop r14 29418: df 90 pop r13 2941a: cf 90 pop r12 2941c: bf 90 pop r11 2941e: af 90 pop r10 29420: 9f 90 pop r9 29422: 8f 90 pop r8 29424: 7f 90 pop r7 29426: 6f 90 pop r6 29428: 5f 90 pop r5 2942a: 4f 90 pop r4 2942c: 3f 90 pop r3 2942e: 2f 90 pop r2 29430: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 29432: 40 91 7d 13 lds r20, 0x137D ; 0x80137d 29436: 50 91 7e 13 lds r21, 0x137E ; 0x80137e 2943a: 60 91 7f 13 lds r22, 0x137F ; 0x80137f 2943e: 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; 29442: b0 92 14 14 sts 0x1414, r11 ; 0x801414 29446: a0 92 13 14 sts 0x1413, r10 ; 0x801413 nrFiles = 1; 2944a: 90 92 83 16 sts 0x1683, r9 ; 0x801683 2944e: 80 92 82 16 sts 0x1682, r8 ; 0x801682 curDir->seekSet(position); 29452: 85 e1 ldi r24, 0x15 ; 21 29454: 94 e1 ldi r25, 0x14 ; 20 29456: 0f 94 db 38 call 0x271b6 ; 0x271b6 2945a: 1e 7f andi r17, 0xFE ; 254 2945c: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2945e: e0 91 13 14 lds r30, 0x1413 ; 0x801413 29462: f0 91 14 14 lds r31, 0x1414 ; 0x801414 29466: 83 e2 ldi r24, 0x23 ; 35 29468: de 01 movw r26, r28 2946a: 11 96 adiw r26, 0x01 ; 1 2946c: 01 90 ld r0, Z+ 2946e: 0d 92 st X+, r0 29470: 8a 95 dec r24 29472: e1 f7 brne .-8 ; 0x2946c 29474: 01 2f mov r16, r17 29476: 22 e0 ldi r18, 0x02 ; 2 29478: 50 e0 ldi r21, 0x00 ; 0 2947a: 40 e0 ldi r20, 0x00 ; 0 2947c: be 01 movw r22, r28 2947e: 6f 5f subi r22, 0xFF ; 255 29480: 7f 4f sbci r23, 0xFF ; 255 29482: 8a ed ldi r24, 0xDA ; 218 29484: 92 e0 ldi r25, 0x02 ; 2 29486: 0f 94 07 45 call 0x28a0e ; 0x28a0e 2948a: ce 01 movw r24, r28 2948c: 01 96 adiw r24, 0x01 ; 1 2948e: 0e 94 c6 70 call 0xe18c ; 0xe18c 29492: ff ce rjmp .-514 ; 0x29292 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)) 29494: 86 15 cp r24, r6 29496: 97 05 cpc r25, r7 29498: 08 f4 brcc .+2 ; 0x2949c 2949a: 9a cf rjmp .-204 ; 0x293d0 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2949c: ee a9 ldd r30, Y+54 ; 0x36 2949e: ff a9 ldd r31, Y+55 ; 0x37 294a0: 53 82 std Z+3, r5 ; 0x03 294a2: 42 82 std Z+2, r4 ; 0x02 294a4: 0c ad ldd r16, Y+60 ; 0x3c 294a6: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 294a8: 01 15 cp r16, r1 294aa: 11 05 cpc r17, r1 294ac: 09 f0 breq .+2 ; 0x294b0 294ae: 5d cf rjmp .-326 ; 0x2936a 294b0: 8f cf rjmp .-226 ; 0x293d0 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)) 294b2: 22 20 and r2, r2 294b4: 99 f3 breq .-26 ; 0x2949c 294b6: 8c cf rjmp .-232 ; 0x293d0 294b8: 31 e0 ldi r19, 0x01 ; 1 294ba: 33 12 cpse r3, r19 294bc: ef cf rjmp .-34 ; 0x2949c getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 294be: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 294c2: 28 12 cpse r2, r24 294c4: 07 c0 rjmp .+14 ; 0x294d4 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 294c6: ce 01 movw r24, r28 294c8: 01 96 adiw r24, 0x01 ; 1 294ca: 0f 94 b6 a6 call 0x34d6c ; 0x34d6c 294ce: 97 fd sbrc r25, 7 294d0: e5 cf rjmp .-54 ; 0x2949c 294d2: 7e cf rjmp .-260 ; 0x293d0 294d4: 21 10 cpse r2, r1 294d6: e2 cf rjmp .-60 ; 0x2949c 294d8: 7b cf rjmp .-266 ; 0x293d0 000294da : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 294da: cf 92 push r12 294dc: df 92 push r13 294de: ef 92 push r14 294e0: ff 92 push r15 294e2: 0f 93 push r16 294e4: 1f 93 push r17 294e6: cf 93 push r28 294e8: df 93 push r29 294ea: cd b7 in r28, 0x3d ; 61 294ec: de b7 in r29, 0x3e ; 62 294ee: a3 97 sbiw r28, 0x23 ; 35 294f0: 0f b6 in r0, 0x3f ; 63 294f2: f8 94 cli 294f4: de bf out 0x3e, r29 ; 62 294f6: 0f be out 0x3f, r0 ; 63 294f8: cd bf out 0x3d, r28 ; 61 294fa: 7c 01 movw r14, r24 294fc: 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) {} 294fe: 19 82 std Y+1, r1 ; 0x01 29500: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 29502: 80 91 18 14 lds r24, 0x1418 ; 0x801418 parent=&workDir; 29506: 95 e1 ldi r25, 0x15 ; 21 29508: c9 2e mov r12, r25 2950a: 94 e1 ldi r25, 0x14 ; 20 2950c: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2950e: 81 11 cpse r24, r1 29510: 04 c0 rjmp .+8 ; 0x2951a } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 29512: 80 ef ldi r24, 0xF0 ; 240 29514: c8 2e mov r12, r24 29516: 83 e1 ldi r24, 0x13 ; 19 29518: 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); 2951a: 21 e0 ldi r18, 0x01 ; 1 2951c: a7 01 movw r20, r14 2951e: b6 01 movw r22, r12 29520: ce 01 movw r24, r28 29522: 01 96 adiw r24, 0x01 ; 1 29524: 0f 94 2a 9a call 0x33454 ; 0x33454 29528: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2952a: 88 23 and r24, r24 2952c: 21 f1 breq .+72 ; 0x29576 2952e: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29532: 85 30 cpi r24, 0x05 ; 5 29534: 00 f5 brcc .+64 ; 0x29576 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 29536: 29 e0 ldi r18, 0x09 ; 9 29538: 82 9f mul r24, r18 2953a: c0 01 movw r24, r0 2953c: 11 24 eor r1, r1 2953e: b7 01 movw r22, r14 29540: 86 54 subi r24, 0x46 ; 70 29542: 9c 4e sbci r25, 0xEC ; 236 29544: 0f 94 e8 a6 call 0x34dd0 ; 0x34dd0 puts(relpath); 29548: c7 01 movw r24, r14 2954a: 0f 94 0c a7 call 0x34e18 ; 0x34e18 if (workDirDepth < MAX_DIR_DEPTH) { 2954e: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29552: 86 30 cpi r24, 0x06 ; 6 29554: 80 f1 brcs .+96 ; 0x295b6 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 29556: 83 e2 ldi r24, 0x23 ; 35 29558: fe 01 movw r30, r28 2955a: 31 96 adiw r30, 0x01 ; 1 2955c: a5 e1 ldi r26, 0x15 ; 21 2955e: b4 e1 ldi r27, 0x14 ; 20 29560: 01 90 ld r0, Z+ 29562: 0d 92 st X+, r0 29564: 8a 95 dec r24 29566: e1 f7 brne .-8 ; 0x29560 #ifdef SDCARD_SORT_ALPHA if (doPresort) 29568: 00 23 and r16, r16 2956a: 09 f4 brne .+2 ; 0x2956e 2956c: 4c c0 rjmp .+152 ; 0x29606 presort(); 2956e: 0f 94 e3 48 call 0x291c6 ; 0x291c6 else presort_flag = true; #endif return 1; 29572: 10 2f mov r17, r16 29574: 0c c0 rjmp .+24 ; 0x2958e if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 29576: 87 e7 ldi r24, 0x77 ; 119 29578: 9e e9 ldi r25, 0x9E ; 158 2957a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2957e: 83 e7 ldi r24, 0x73 ; 115 29580: 9c e6 ldi r25, 0x6C ; 108 29582: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(relpath); 29586: c7 01 movw r24, r14 29588: 0f 94 9e 99 call 0x3333c ; 0x3333c return 0; 2958c: 10 e0 ldi r17, 0x00 ; 0 2958e: ce 01 movw r24, r28 29590: 01 96 adiw r24, 0x01 ; 1 29592: 0e 94 c6 70 call 0xe18c ; 0xe18c else presort_flag = true; #endif return 1; } } 29596: 81 2f mov r24, r17 29598: a3 96 adiw r28, 0x23 ; 35 2959a: 0f b6 in r0, 0x3f ; 63 2959c: f8 94 cli 2959e: de bf out 0x3e, r29 ; 62 295a0: 0f be out 0x3f, r0 ; 63 295a2: cd bf out 0x3d, r28 ; 61 295a4: df 91 pop r29 295a6: cf 91 pop r28 295a8: 1f 91 pop r17 295aa: 0f 91 pop r16 295ac: ff 90 pop r15 295ae: ef 90 pop r14 295b0: df 90 pop r13 295b2: cf 90 pop r12 295b4: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 295b6: 8f 5f subi r24, 0xFF ; 255 295b8: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDirParents[d+1] = workDirParents[d]; 295bc: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 295be: 81 50 subi r24, 0x01 ; 1 295c0: c8 f0 brcs .+50 ; 0x295f4 workDirParents[d+1] = workDirParents[d]; 295c2: 28 2f mov r18, r24 295c4: 30 e0 ldi r19, 0x00 ; 0 295c6: a9 01 movw r20, r18 295c8: 4f 5f subi r20, 0xFF ; 255 295ca: 5f 4f sbci r21, 0xFF ; 255 295cc: 94 9f mul r25, r20 295ce: d0 01 movw r26, r0 295d0: 95 9f mul r25, r21 295d2: b0 0d add r27, r0 295d4: 11 24 eor r1, r1 295d6: a8 5c subi r26, 0xC8 ; 200 295d8: bb 4e sbci r27, 0xEB ; 235 295da: 92 9f mul r25, r18 295dc: f0 01 movw r30, r0 295de: 93 9f mul r25, r19 295e0: f0 0d add r31, r0 295e2: 11 24 eor r1, r1 295e4: e8 5c subi r30, 0xC8 ; 200 295e6: fb 4e sbci r31, 0xEB ; 235 295e8: 29 2f mov r18, r25 295ea: 01 90 ld r0, Z+ 295ec: 0d 92 st X+, r0 295ee: 2a 95 dec r18 295f0: e1 f7 brne .-8 ; 0x295ea 295f2: e5 cf rjmp .-54 ; 0x295be workDirParents[0]=*parent; 295f4: 83 e2 ldi r24, 0x23 ; 35 295f6: f6 01 movw r30, r12 295f8: a8 e3 ldi r26, 0x38 ; 56 295fa: b4 e1 ldi r27, 0x14 ; 20 295fc: 01 90 ld r0, Z+ 295fe: 0d 92 st X+, r0 29600: 8a 95 dec r24 29602: e1 f7 brne .-8 ; 0x295fc 29604: a8 cf rjmp .-176 ; 0x29556 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 29606: 81 e0 ldi r24, 0x01 ; 1 29608: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2960c: c0 cf rjmp .-128 ; 0x2958e 0002960e : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2960e: 93 e2 ldi r25, 0x23 ; 35 29610: e0 ef ldi r30, 0xF0 ; 240 29612: f3 e1 ldi r31, 0x13 ; 19 29614: a5 e1 ldi r26, 0x15 ; 21 29616: b4 e1 ldi r27, 0x14 ; 20 29618: 01 90 ld r0, Z+ 2961a: 0d 92 st X+, r0 2961c: 9a 95 dec r25 2961e: e1 f7 brne .-8 ; 0x29618 workDirDepth = 0; 29620: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a curDir=&workDir; 29624: 25 e1 ldi r18, 0x15 ; 21 29626: 34 e1 ldi r19, 0x14 ; 20 29628: 30 93 14 14 sts 0x1414, r19 ; 0x801414 2962c: 20 93 13 14 sts 0x1413, r18 ; 0x801413 #ifdef SDCARD_SORT_ALPHA if (doPresort) 29630: 81 11 cpse r24, r1 presort(); 29632: 0d 94 e3 48 jmp 0x291c6 ; 0x291c6 else presort_flag = true; 29636: 81 e0 ldi r24, 0x01 ; 1 29638: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 #endif } 2963c: 08 95 ret 0002963e : * * @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) 2963e: 8f 92 push r8 29640: 9f 92 push r9 29642: af 92 push r10 29644: bf 92 push r11 29646: cf 92 push r12 29648: df 92 push r13 2964a: ef 92 push r14 2964c: ff 92 push r15 2964e: 0f 93 push r16 29650: 1f 93 push r17 29652: cf 93 push r28 29654: df 93 push r29 29656: cd b7 in r28, 0x3d ; 61 29658: de b7 in r29, 0x3e ; 62 2965a: 2d 97 sbiw r28, 0x0d ; 13 2965c: 0f b6 in r0, 0x3f ; 63 2965e: f8 94 cli 29660: de bf out 0x3e, r29 ; 62 29662: 0f be out 0x3f, r0 ; 63 29664: cd bf out 0x3d, r28 ; 61 { curDir=&root; 29666: 20 ef ldi r18, 0xF0 ; 240 29668: 33 e1 ldi r19, 0x13 ; 19 2966a: 30 93 14 14 sts 0x1414, r19 ; 0x801414 2966e: 20 93 13 14 sts 0x1413, r18 ; 0x801413 if (!fileName) 29672: dc 01 movw r26, r24 29674: ed 91 ld r30, X+ 29676: fc 91 ld r31, X 29678: 30 97 sbiw r30, 0x00 ; 0 2967a: a1 f4 brne .+40 ; 0x296a4 } else //relative path { curDir = &workDir; } return 1; 2967c: 81 e0 ldi r24, 0x01 ; 1 } 2967e: 2d 96 adiw r28, 0x0d ; 13 29680: 0f b6 in r0, 0x3f ; 63 29682: f8 94 cli 29684: de bf out 0x3e, r29 ; 62 29686: 0f be out 0x3f, r0 ; 63 29688: cd bf out 0x3d, r28 ; 61 2968a: df 91 pop r29 2968c: cf 91 pop r28 2968e: 1f 91 pop r17 29690: 0f 91 pop r16 29692: ff 90 pop r15 29694: ef 90 pop r14 29696: df 90 pop r13 29698: cf 90 pop r12 2969a: bf 90 pop r11 2969c: af 90 pop r10 2969e: 9f 90 pop r9 296a0: 8f 90 pop r8 296a2: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 296a4: 20 81 ld r18, Z 296a6: 2f 32 cpi r18, 0x2F ; 47 296a8: 09 f0 breq .+2 ; 0x296ac 296aa: 47 c0 rjmp .+142 ; 0x2973a 296ac: 6c 01 movw r12, r24 { cdroot(false); 296ae: 80 e0 ldi r24, 0x00 ; 0 296b0: 0f 94 07 4b call 0x2960e ; 0x2960e dirname_start = fileName + 1; 296b4: f6 01 movw r30, r12 296b6: 00 81 ld r16, Z 296b8: 11 81 ldd r17, Z+1 ; 0x01 296ba: 0f 5f subi r16, 0xFF ; 255 296bc: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 296be: 95 e1 ldi r25, 0x15 ; 21 296c0: 89 2e mov r8, r25 296c2: 94 e1 ldi r25, 0x14 ; 20 296c4: 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) 296c6: d8 01 movw r26, r16 296c8: 8c 91 ld r24, X 296ca: 88 23 and r24, r24 296cc: b9 f2 breq .-82 ; 0x2967c { dirname_end = strchr(dirname_start, '/'); 296ce: 6f e2 ldi r22, 0x2F ; 47 296d0: 70 e0 ldi r23, 0x00 ; 0 296d2: c8 01 movw r24, r16 296d4: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 296d8: 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) 296da: 00 97 sbiw r24, 0x00 ; 0 296dc: 51 f1 breq .+84 ; 0x29732 296de: 08 17 cp r16, r24 296e0: 19 07 cpc r17, r25 296e2: 38 f5 brcc .+78 ; 0x29732 { 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); 296e4: 7c 01 movw r14, r24 296e6: e0 1a sub r14, r16 296e8: f1 0a sbc r15, r17 296ea: bd e0 ldi r27, 0x0D ; 13 296ec: eb 16 cp r14, r27 296ee: f1 04 cpc r15, r1 296f0: 18 f0 brcs .+6 ; 0x296f8 296f2: 8c e0 ldi r24, 0x0C ; 12 296f4: e8 2e mov r14, r24 296f6: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 296f8: a7 01 movw r20, r14 296fa: b8 01 movw r22, r16 296fc: ce 01 movw r24, r28 296fe: 01 96 adiw r24, 0x01 ; 1 29700: 0f 94 fd a6 call 0x34dfa ; 0x34dfa subdirname[len] = 0; 29704: e1 e0 ldi r30, 0x01 ; 1 29706: f0 e0 ldi r31, 0x00 ; 0 29708: ec 0f add r30, r28 2970a: fd 1f adc r31, r29 2970c: ee 0d add r30, r14 2970e: ff 1d adc r31, r15 29710: 10 82 st Z, r1 if (!chdir(subdirname, false)) 29712: 60 e0 ldi r22, 0x00 ; 0 29714: ce 01 movw r24, r28 29716: 01 96 adiw r24, 0x01 ; 1 29718: 0f 94 6d 4a call 0x294da ; 0x294da 2971c: 88 23 and r24, r24 2971e: 09 f4 brne .+2 ; 0x29722 29720: ae cf rjmp .-164 ; 0x2967e return 0; curDir = &workDir; 29722: 90 92 14 14 sts 0x1414, r9 ; 0x801414 29726: 80 92 13 14 sts 0x1413, r8 ; 0x801413 dirname_start = dirname_end + 1; 2972a: 85 01 movw r16, r10 2972c: 0f 5f subi r16, 0xFF ; 255 2972e: 1f 4f sbci r17, 0xFF ; 255 29730: ca cf rjmp .-108 ; 0x296c6 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 29732: f6 01 movw r30, r12 29734: 11 83 std Z+1, r17 ; 0x01 29736: 00 83 st Z, r16 29738: a1 cf rjmp .-190 ; 0x2967c } } else //relative path { curDir = &workDir; 2973a: 85 e1 ldi r24, 0x15 ; 21 2973c: 94 e1 ldi r25, 0x14 ; 20 2973e: 90 93 14 14 sts 0x1414, r25 ; 0x801414 29742: 80 93 13 14 sts 0x1413, r24 ; 0x801413 29746: 9a cf rjmp .-204 ; 0x2967c 00029748 : 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*/){ 29748: bf 92 push r11 2974a: cf 92 push r12 2974c: df 92 push r13 2974e: ef 92 push r14 29750: ff 92 push r15 29752: 0f 93 push r16 29754: 1f 93 push r17 29756: cf 93 push r28 29758: df 93 push r29 2975a: 1f 92 push r1 2975c: 1f 92 push r1 2975e: cd b7 in r28, 0x3d ; 61 29760: de b7 in r29, 0x3e ; 62 if(!mounted) 29762: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 29766: 22 23 and r18, r18 29768: 09 f4 brne .+2 ; 0x2976c 2976a: ef c0 rjmp .+478 ; 0x2994a 2976c: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2976e: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 29772: 88 23 and r24, r24 29774: 09 f4 brne .+2 ; 0x29778 29776: 04 c1 rjmp .+520 ; 0x29980 if(!replace_current){ 29778: 61 11 cpse r22, r1 2977a: f6 c0 rjmp .+492 ; 0x29968 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2977c: d0 90 1d 16 lds r13, 0x161D ; 0x80161d 29780: dd 20 and r13, r13 29782: 21 f0 breq .+8 ; 0x2978c // 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); 29784: 85 e8 ldi r24, 0x85 ; 133 29786: 9d e9 ldi r25, 0x9D ; 157 29788: 0e 94 6a 73 call 0xe6d4 ; 0xe6d4 return; } SERIAL_ECHO_START; 2978c: 87 e7 ldi r24, 0x77 ; 119 2978e: 9e e9 ldi r25, 0x9E ; 158 29790: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(ofSubroutineCallTgt); 29794: 8c e6 ldi r24, 0x6C ; 108 29796: 9d e9 ldi r25, 0x9D ; 157 29798: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2979c: c7 01 movw r24, r14 2979e: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 297a2: 81 e6 ldi r24, 0x61 ; 97 297a4: 9d e9 ldi r25, 0x9D ; 157 297a6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 297aa: 00 91 1d 16 lds r16, 0x161D ; 0x80161d 297ae: 25 e5 ldi r18, 0x55 ; 85 297b0: 02 9f mul r16, r18 297b2: 80 01 movw r16, r0 297b4: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 297b6: 0e 5d subi r16, 0xDE ; 222 297b8: 19 4e sbci r17, 0xE9 ; 233 297ba: 8f e2 ldi r24, 0x2F ; 47 297bc: f8 01 movw r30, r16 297be: 81 93 st Z+, r24 297c0: 8f 01 movw r16, r30 297c2: cc 24 eor r12, r12 297c4: c3 94 inc r12 for(uint8_t i=0;i 297ce: d8 16 cp r13, r24 297d0: b0 f4 brcc .+44 ; 0x297fe { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 297d2: db 9c mul r13, r11 297d4: c0 01 movw r24, r0 297d6: 11 24 eor r1, r1 297d8: b8 01 movw r22, r16 297da: 88 5c subi r24, 0xC8 ; 200 297dc: 9b 4e sbci r25, 0xEB ; 235 297de: 0f 94 56 6f call 0x2deac ; 0x2deac 297e2: c8 01 movw r24, r16 297e4: 8c 01 movw r16, r24 297e6: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 297e8: f8 01 movw r30, r16 297ea: 20 81 ld r18, Z 297ec: 22 23 and r18, r18 297ee: 29 f0 breq .+10 ; 0x297fa 297f0: f4 e5 ldi r31, 0x54 ; 84 297f2: fc 15 cp r31, r12 297f4: 10 f0 brcs .+4 ; 0x297fa {t++;cnt++;} //crawl counter forward. 297f6: c3 94 inc r12 297f8: f5 cf rjmp .-22 ; 0x297e4 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) 297fe: 27 e4 ldi r18, 0x47 ; 71 29800: 2c 15 cp r18, r12 29802: 08 f4 brcc .+2 ; 0x29806 29804: ae c0 rjmp .+348 ; 0x29962 file.getFilename(t); 29806: b8 01 movw r22, r16 29808: 8a ef ldi r24, 0xFA ; 250 2980a: 95 e1 ldi r25, 0x15 ; 21 2980c: 0f 94 56 6f call 0x2deac ; 0x2deac SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 29810: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29814: f5 e5 ldi r31, 0x55 ; 85 29816: 8f 9f mul r24, r31 29818: c0 01 movw r24, r0 2981a: 11 24 eor r1, r1 2981c: 8e 5d subi r24, 0xDE ; 222 2981e: 99 4e sbci r25, 0xE9 ; 233 29820: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHORPGM(ofPos); 29824: 8b e5 ldi r24, 0x5B ; 91 29826: 9d e9 ldi r25, 0x9D ; 157 29828: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2982c: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 29830: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 29834: 80 91 80 16 lds r24, 0x1680 ; 0x801680 29838: 90 91 81 16 lds r25, 0x1681 ; 0x801681 2983c: 4a e0 ldi r20, 0x0A ; 10 2983e: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29842: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 29846: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 2984a: 24 e0 ldi r18, 0x04 ; 4 2984c: 82 9f mul r24, r18 2984e: f0 01 movw r30, r0 29850: 11 24 eor r1, r1 29852: e2 5e subi r30, 0xE2 ; 226 29854: f9 4e sbci r31, 0xE9 ; 233 29856: 40 91 7e 16 lds r20, 0x167E ; 0x80167e 2985a: 50 91 7f 16 lds r21, 0x167F ; 0x80167f 2985e: 60 91 80 16 lds r22, 0x1680 ; 0x801680 29862: 70 91 81 16 lds r23, 0x1681 ; 0x801681 29866: 40 83 st Z, r20 29868: 51 83 std Z+1, r21 ; 0x01 2986a: 62 83 std Z+2, r22 ; 0x02 2986c: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2986e: 8f 5f subi r24, 0xFF ; 255 29870: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 29874: 8a ef ldi r24, 0xFA ; 250 29876: 95 e1 ldi r25, 0x15 ; 21 29878: 0f 94 33 6f call 0x2de66 ; 0x2de66 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; 2987c: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 29880: fa 82 std Y+2, r15 ; 0x02 29882: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 29884: ce 01 movw r24, r28 29886: 01 96 adiw r24, 0x01 ; 1 29888: 0f 94 1f 4b call 0x2963e ; 0x2963e 2988c: 88 23 and r24, r24 2988e: 09 f4 brne .+2 ; 0x29892 29890: 5c c0 rjmp .+184 ; 0x2994a */ 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) ){ 29892: 49 81 ldd r20, Y+1 ; 0x01 29894: 5a 81 ldd r21, Y+2 ; 0x02 29896: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2989a: 70 91 14 14 lds r23, 0x1414 ; 0x801414 2989e: 21 e0 ldi r18, 0x01 ; 1 298a0: 8a ef ldi r24, 0xFA ; 250 298a2: 95 e1 ldi r25, 0x15 ; 21 298a4: 0f 94 2a 9a call 0x33454 ; 0x33454 298a8: 88 23 and r24, r24 298aa: 09 f4 brne .+2 ; 0x298ae 298ac: 77 c0 rjmp .+238 ; 0x2999c // compute the block to start with if( ! gfComputeNextFileBlock() ) 298ae: 8a ef ldi r24, 0xFA ; 250 298b0: 95 e1 ldi r25, 0x15 ; 21 298b2: 0f 94 c5 37 call 0x26f8a ; 0x26f8a 298b6: 88 23 and r24, r24 298b8: 09 f4 brne .+2 ; 0x298bc 298ba: 70 c0 rjmp .+224 ; 0x2999c 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; 298bc: 80 91 1b 16 lds r24, 0x161B ; 0x80161b 298c0: 90 91 1c 16 lds r25, 0x161C ; 0x80161c 298c4: 87 52 subi r24, 0x27 ; 39 298c6: 92 4f sbci r25, 0xF2 ; 242 298c8: 90 93 16 16 sts 0x1616, r25 ; 0x801616 298cc: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 298d0: 89 81 ldd r24, Y+1 ; 0x01 298d2: 9a 81 ldd r25, Y+2 ; 0x02 298d4: 0f 94 36 47 call 0x28e6c ; 0x28e6c filesize = file.fileSize(); 298d8: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 298dc: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 298e0: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 298e4: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 298e8: 80 93 77 16 sts 0x1677, r24 ; 0x801677 298ec: 90 93 78 16 sts 0x1678, r25 ; 0x801678 298f0: a0 93 79 16 sts 0x1679, r26 ; 0x801679 298f4: b0 93 7a 16 sts 0x167A, r27 ; 0x80167a SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 298f8: 8b e2 ldi r24, 0x2B ; 43 298fa: 9d e9 ldi r25, 0x9D ; 157 298fc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca printAbsFilenameFast(); 29900: 0f 94 19 48 call 0x29032 ; 0x29032 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 29904: 83 e2 ldi r24, 0x23 ; 35 29906: 9d e9 ldi r25, 0x9D ; 157 29908: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2990c: 60 91 77 16 lds r22, 0x1677 ; 0x801677 29910: 70 91 78 16 lds r23, 0x1678 ; 0x801678 29914: 80 91 79 16 lds r24, 0x1679 ; 0x801679 29918: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 2991c: 4a e0 ldi r20, 0x0A ; 10 2991e: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29922: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_PROTOCOLLN(filesize); sdpos = 0; 29926: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 2992a: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 2992e: 10 92 80 16 sts 0x1680, r1 ; 0x801680 29932: 10 92 81 16 sts 0x1681, r1 ; 0x801681 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 29936: 85 e1 ldi r24, 0x15 ; 21 29938: 9d e9 ldi r25, 0x9D ; 157 2993a: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_setstatuspgm(ofFileSelected); 2993e: 85 e1 ldi r24, 0x15 ; 21 29940: 9d e9 ldi r25, 0x9D ; 157 29942: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe scrollstuff = 0; 29946: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2994a: 0f 90 pop r0 2994c: 0f 90 pop r0 2994e: df 91 pop r29 29950: cf 91 pop r28 29952: 1f 91 pop r17 29954: 0f 91 pop r16 29956: ff 90 pop r15 29958: ef 90 pop r14 2995a: df 90 pop r13 2995c: cf 90 pop r12 2995e: bf 90 pop r11 29960: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 29962: f8 01 movw r30, r16 29964: 10 82 st Z, r1 29966: 54 cf rjmp .-344 ; 0x29810 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 29968: 87 e7 ldi r24, 0x77 ; 119 2996a: 9e e9 ldi r25, 0x9E ; 158 2996c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(ofNowDoingFile); 29970: 8a e4 ldi r24, 0x4A ; 74 29972: 9d e9 ldi r25, 0x9D ; 157 29974: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(name); 29978: c7 01 movw r24, r14 2997a: 0f 94 9e 99 call 0x3333c ; 0x3333c 2997e: 7a cf rjmp .-268 ; 0x29874 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 29980: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 29984: 87 e7 ldi r24, 0x77 ; 119 29986: 9e e9 ldi r25, 0x9E ; 158 29988: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(ofNowFreshFile); 2998c: 89 e3 ldi r24, 0x39 ; 57 2998e: 9d e9 ldi r25, 0x9D ; 157 29990: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(name); 29994: c7 01 movw r24, r14 29996: 0f 94 9e 99 call 0x3333c ; 0x3333c 2999a: 70 cf rjmp .-288 ; 0x2987c SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2999c: 8f e5 ldi r24, 0x5F ; 95 2999e: 9c e6 ldi r25, 0x6C ; 108 299a0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 299a4: 89 81 ldd r24, Y+1 ; 0x01 299a6: 9a 81 ldd r25, Y+2 ; 0x02 299a8: 0e 94 2e 7d call 0xfa5c ; 0xfa5c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 299ac: 8e e2 ldi r24, 0x2E ; 46 299ae: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 299b2: 0f 94 9d 98 call 0x3313a ; 0x3313a 299b6: c9 cf rjmp .-110 ; 0x2994a 000299b8 : void CardReader::printingHasFinished() { st_synchronize(); 299b8: 0f 94 14 22 call 0x24428 ; 0x24428 file.close(); 299bc: 8a ef ldi r24, 0xFA ; 250 299be: 95 e1 ldi r25, 0x15 ; 21 299c0: 0f 94 33 6f call 0x2de66 ; 0x2de66 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 299c4: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 299c8: 88 23 and r24, r24 299ca: 69 f1 breq .+90 ; 0x29a26 { file_subcall_ctr--; 299cc: 81 50 subi r24, 0x01 ; 1 299ce: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 299d2: 25 e5 ldi r18, 0x55 ; 85 299d4: 82 9f mul r24, r18 299d6: c0 01 movw r24, r0 299d8: 11 24 eor r1, r1 299da: 61 e0 ldi r22, 0x01 ; 1 299dc: 8e 5d subi r24, 0xDE ; 222 299de: 99 4e sbci r25, 0xE9 ; 233 299e0: 0f 94 a4 4b call 0x29748 ; 0x29748 setIndex(filespos[file_subcall_ctr]); 299e4: e0 91 1d 16 lds r30, 0x161D ; 0x80161d 299e8: 84 e0 ldi r24, 0x04 ; 4 299ea: e8 9f mul r30, r24 299ec: f0 01 movw r30, r0 299ee: 11 24 eor r1, r1 299f0: e2 5e subi r30, 0xE2 ; 226 299f2: f9 4e sbci r31, 0xE9 ; 233 299f4: 60 81 ld r22, Z 299f6: 71 81 ldd r23, Z+1 ; 0x01 299f8: 82 81 ldd r24, Z+2 ; 0x02 299fa: 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);}; 299fc: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 29a00: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 29a04: 80 93 80 16 sts 0x1680, r24 ; 0x801680 29a08: 90 93 81 16 sts 0x1681, r25 ; 0x801681 29a0c: 0f 94 94 43 call 0x28728 ; 0x28728 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 29a10: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29a14: 88 23 and r24, r24 29a16: 71 f0 breq .+28 ; 0x29a34 { sdprinting = true; 29a18: 81 e0 ldi r24, 0x01 ; 1 29a1a: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 29a1e: 85 e0 ldi r24, 0x05 ; 5 29a20: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.365> 29a24: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 29a26: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 29a2a: 83 e0 ldi r24, 0x03 ; 3 29a2c: 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(); 29a30: 0c 94 c4 74 jmp 0xe988 ; 0xe988 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 29a34: 08 95 ret 00029a36 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 29a36: cf 92 push r12 29a38: df 92 push r13 29a3a: ef 92 push r14 29a3c: ff 92 push r15 29a3e: 0f 93 push r16 29a40: 1f 93 push r17 29a42: cf 93 push r28 29a44: df 93 push r29 29a46: 08 2f mov r16, r24 { mounted = false; 29a48: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b if(root.isOpen()) 29a4c: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 29a50: 88 23 and r24, r24 29a52: 21 f0 breq .+8 ; 0x29a5c root.close(); 29a54: 80 ef ldi r24, 0xF0 ; 240 29a56: 93 e1 ldi r25, 0x13 ; 19 29a58: 0f 94 33 6f call 0x2de66 ; 0x2de66 * \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; 29a5c: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 29a60: 10 92 d7 15 sts 0x15D7, r1 ; 0x8015d7 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 29a64: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29a68: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 29a6a: 0f 94 65 41 call 0x282ca ; 0x282ca SET_OUTPUT(SDSS); 29a6e: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 29a70: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 29a72: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 29a74: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 29a76: 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); 29a78: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 29a7a: 85 e0 ldi r24, 0x05 ; 5 29a7c: 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); 29a80: 82 e5 ldi r24, 0x52 ; 82 29a82: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 29a84: 1d bc out 0x2d, r1 ; 45 29a86: 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); 29a88: 8f ef ldi r24, 0xFF ; 255 29a8a: 0f 94 8b 70 call 0x2e116 ; 0x2e116 29a8e: 11 50 subi r17, 0x01 ; 1 29a90: d9 f7 brne .-10 ; 0x29a88 WRITE(MISO, 1); // temporarily enable the MISO line pullup 29a92: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 29a94: 20 e0 ldi r18, 0x00 ; 0 29a96: 30 e0 ldi r19, 0x00 ; 0 29a98: a9 01 movw r20, r18 29a9a: 60 e0 ldi r22, 0x00 ; 0 29a9c: 87 ed ldi r24, 0xD7 ; 215 29a9e: 95 e1 ldi r25, 0x15 ; 21 29aa0: 0f 94 97 70 call 0x2e12e ; 0x2e12e 29aa4: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29aa8: 81 30 cpi r24, 0x01 ; 1 29aaa: 61 f0 breq .+24 ; 0x29ac4 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29aac: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29ab0: 6c 1b sub r22, r28 29ab2: 7d 0b sbc r23, r29 29ab4: 61 3d cpi r22, 0xD1 ; 209 29ab6: 77 40 sbci r23, 0x07 ; 7 29ab8: 68 f3 brcs .-38 ; 0x29a94 WRITE(MISO, 0); // disable the MISO line pullup 29aba: 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;} 29abc: 81 e0 ldi r24, 0x01 ; 1 29abe: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 29ac2: 22 c0 rjmp .+68 ; 0x29b08 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 29ac4: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 29ac6: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29aca: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 29acc: 88 e0 ldi r24, 0x08 ; 8 29ace: 9d e9 ldi r25, 0x9D ; 157 29ad0: 0e 94 de 72 call 0xe5bc ; 0xe5bc spiSend(0XFF); 29ad4: 8f ef ldi r24, 0xFF ; 255 29ad6: 0f 94 8b 70 call 0x2e116 ; 0x2e116 while ((status_ = spiRec()) != 0xFF) 29ada: 0f 94 90 70 call 0x2e120 ; 0x2e120 29ade: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29ae2: 8f 3f cpi r24, 0xFF ; 255 29ae4: 59 f1 breq .+86 ; 0x29b3c { spiSend(0XFF); 29ae6: 8f ef ldi r24, 0xFF ; 255 29ae8: 0f 94 8b 70 call 0x2e116 ; 0x2e116 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 29aec: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29af0: 6c 1b sub r22, r28 29af2: 7d 0b sbc r23, r29 29af4: 62 32 cpi r22, 0x22 ; 34 29af6: 71 05 cpc r23, r1 29af8: 80 f3 brcs .-32 ; 0x29ada 29afa: 82 e0 ldi r24, 0x02 ; 2 29afc: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 29b00: 87 ef ldi r24, 0xF7 ; 247 29b02: 9c e9 ldi r25, 0x9C ; 156 29b04: 0e 94 de 72 call 0xe5bc ; 0xe5bc #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 29b08: 0f 94 65 41 call 0x282ca ; 0x282ca #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 29b0c: 87 e7 ldi r24, 0x77 ; 119 29b0e: 9e e9 ldi r25, 0x9E ; 158 29b10: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 29b14: 82 e5 ldi r24, 0x52 ; 82 29b16: 9c e6 ldi r25, 0x6C ; 108 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29b18: 0e 94 de 72 call 0xe5bc ; 0xe5bc } if (mounted) 29b1c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29b20: 88 23 and r24, r24 29b22: 09 f4 brne .+2 ; 0x29b26 29b24: 9a c0 rjmp .+308 ; 0x29c5a { cdroot(doPresort); 29b26: 80 2f mov r24, r16 } } 29b28: df 91 pop r29 29b2a: cf 91 pop r28 29b2c: 1f 91 pop r17 29b2e: 0f 91 pop r16 29b30: ff 90 pop r15 29b32: ef 90 pop r14 29b34: df 90 pop r13 29b36: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 29b38: 0d 94 07 4b jmp 0x2960e ; 0x2960e goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29b3c: 2a ea ldi r18, 0xAA ; 170 29b3e: 31 e0 ldi r19, 0x01 ; 1 29b40: 40 e0 ldi r20, 0x00 ; 0 29b42: 50 e0 ldi r21, 0x00 ; 0 29b44: 68 e0 ldi r22, 0x08 ; 8 29b46: 87 ed ldi r24, 0xD7 ; 215 29b48: 95 e1 ldi r25, 0x15 ; 21 29b4a: 0f 94 97 70 call 0x2e12e ; 0x2e12e 29b4e: 82 ff sbrs r24, 2 29b50: 2b c0 rjmp .+86 ; 0x29ba8 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;} 29b52: 81 e0 ldi r24, 0x01 ; 1 29b54: 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; 29b58: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29b5c: c1 2c mov r12, r1 29b5e: d1 2c mov r13, r1 29b60: 76 01 movw r14, r12 29b62: 82 30 cpi r24, 0x02 ; 2 29b64: 29 f4 brne .+10 ; 0x29b70 29b66: c1 2c mov r12, r1 29b68: d1 2c mov r13, r1 29b6a: e1 2c mov r14, r1 29b6c: 80 e4 ldi r24, 0x40 ; 64 29b6e: 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); 29b70: 20 e0 ldi r18, 0x00 ; 0 29b72: 30 e0 ldi r19, 0x00 ; 0 29b74: a9 01 movw r20, r18 29b76: 67 e3 ldi r22, 0x37 ; 55 29b78: 87 ed ldi r24, 0xD7 ; 215 29b7a: 95 e1 ldi r25, 0x15 ; 21 29b7c: 0f 94 97 70 call 0x2e12e ; 0x2e12e return cardCommand(cmd, arg); 29b80: a7 01 movw r20, r14 29b82: 96 01 movw r18, r12 29b84: 69 e2 ldi r22, 0x29 ; 41 29b86: 87 ed ldi r24, 0xD7 ; 215 29b88: 95 e1 ldi r25, 0x15 ; 21 29b8a: 0f 94 97 70 call 0x2e12e ; 0x2e12e while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 29b8e: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29b92: 88 23 and r24, r24 29b94: b1 f0 breq .+44 ; 0x29bc2 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29b96: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29b9a: 6c 1b sub r22, r28 29b9c: 7d 0b sbc r23, r29 29b9e: 61 3d cpi r22, 0xD1 ; 209 29ba0: 77 40 sbci r23, 0x07 ; 7 29ba2: 30 f3 brcs .-52 ; 0x29b70 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29ba4: 8a e0 ldi r24, 0x0A ; 10 29ba6: 8b cf rjmp .-234 ; 0x29abe goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29ba8: 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(); 29baa: 0f 94 90 70 call 0x2e120 ; 0x2e120 29bae: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29bb2: 11 50 subi r17, 0x01 ; 1 29bb4: d1 f7 brne .-12 ; 0x29baa if (status_ != 0XAA) { 29bb6: 8a 3a cpi r24, 0xAA ; 170 29bb8: 11 f0 breq .+4 ; 0x29bbe 29bba: 82 e0 ldi r24, 0x02 ; 2 29bbc: 80 cf rjmp .-256 ; 0x29abe 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;} 29bbe: 82 e0 ldi r24, 0x02 ; 2 29bc0: c9 cf rjmp .-110 ; 0x29b54 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 29bc2: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29bc6: 82 30 cpi r24, 0x02 ; 2 29bc8: d1 f4 brne .+52 ; 0x29bfe if (cardCommand(CMD58, 0)) { 29bca: 20 e0 ldi r18, 0x00 ; 0 29bcc: 30 e0 ldi r19, 0x00 ; 0 29bce: a9 01 movw r20, r18 29bd0: 6a e3 ldi r22, 0x3A ; 58 29bd2: 87 ed ldi r24, 0xD7 ; 215 29bd4: 95 e1 ldi r25, 0x15 ; 21 29bd6: 0f 94 97 70 call 0x2e12e ; 0x2e12e 29bda: 88 23 and r24, r24 29bdc: 11 f0 breq .+4 ; 0x29be2 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29bde: 88 e0 ldi r24, 0x08 ; 8 29be0: 6e cf rjmp .-292 ; 0x29abe error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 29be2: 0f 94 90 70 call 0x2e120 ; 0x2e120 29be6: 80 7c andi r24, 0xC0 ; 192 29be8: 80 3c cpi r24, 0xC0 ; 192 29bea: 19 f4 brne .+6 ; 0x29bf2 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;} 29bec: 83 e0 ldi r24, 0x03 ; 3 29bee: 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(); 29bf2: 0f 94 90 70 call 0x2e120 ; 0x2e120 29bf6: 0f 94 90 70 call 0x2e120 ; 0x2e120 29bfa: 0f 94 90 70 call 0x2e120 ; 0x2e120 } chipSelectHigh(); 29bfe: 0f 94 65 41 call 0x282ca ; 0x282ca bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 29c02: 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);} 29c06: 81 e0 ldi r24, 0x01 ; 1 29c08: 0f 94 02 3d call 0x27a04 ; 0x27a04 29c0c: 81 11 cpse r24, r1 29c0e: 0c c0 rjmp .+24 ; 0x29c28 29c10: 80 e0 ldi r24, 0x00 ; 0 29c12: 0f 94 02 3d call 0x27a04 ; 0x27a04 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 29c16: 81 11 cpse r24, r1 29c18: 07 c0 rjmp .+14 ; 0x29c28 { SERIAL_ERROR_START; 29c1a: 8a e5 ldi r24, 0x5A ; 90 29c1c: 9e e9 ldi r25, 0x9E ; 158 29c1e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 29c22: 8f e3 ldi r24, 0x3F ; 63 29c24: 9c e6 ldi r25, 0x6C ; 108 29c26: 78 cf rjmp .-272 ; 0x29b18 } else if (!root.openRoot(&volume)) 29c28: 6c ed ldi r22, 0xDC ; 220 29c2a: 75 e1 ldi r23, 0x15 ; 21 29c2c: 80 ef ldi r24, 0xF0 ; 240 29c2e: 93 e1 ldi r25, 0x13 ; 19 29c30: 0f 94 e3 6e call 0x2ddc6 ; 0x2ddc6 29c34: 81 11 cpse r24, r1 29c36: 07 c0 rjmp .+14 ; 0x29c46 { SERIAL_ERROR_START; 29c38: 8a e5 ldi r24, 0x5A ; 90 29c3a: 9e e9 ldi r25, 0x9E ; 158 29c3c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 29c40: 8f e2 ldi r24, 0x2F ; 47 29c42: 9c e6 ldi r25, 0x6C ; 108 29c44: 69 cf rjmp .-302 ; 0x29b18 } else { mounted = true; 29c46: 81 e0 ldi r24, 0x01 ; 1 29c48: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b SERIAL_ECHO_START; 29c4c: 87 e7 ldi r24, 0x77 ; 119 29c4e: 9e e9 ldi r25, 0x9E ; 158 29c50: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29c54: 84 e2 ldi r24, 0x24 ; 36 29c56: 9c e6 ldi r25, 0x6C ; 108 29c58: 5f cf rjmp .-322 ; 0x29b18 if (mounted) { cdroot(doPresort); } } 29c5a: df 91 pop r29 29c5c: cf 91 pop r28 29c5e: 1f 91 pop r17 29c60: 0f 91 pop r16 29c62: ff 90 pop r15 29c64: ef 90 pop r14 29c66: df 90 pop r13 29c68: cf 90 pop r12 29c6a: 08 95 ret 00029c6c : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 29c6c: 4f 92 push r4 29c6e: 5f 92 push r5 29c70: 6f 92 push r6 29c72: 7f 92 push r7 29c74: 8f 92 push r8 29c76: 9f 92 push r9 29c78: af 92 push r10 29c7a: bf 92 push r11 29c7c: cf 92 push r12 29c7e: df 92 push r13 29c80: ef 92 push r14 29c82: ff 92 push r15 29c84: 4b 01 movw r8, r22 29c86: 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]; 29c88: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29c8c: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29c90: 07 2e mov r0, r23 29c92: 00 0c add r0, r0 29c94: 88 0b sbc r24, r24 29c96: 99 0b sbc r25, r25 29c98: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> if (!degTargetHotend(extruder)) 29c9c: 20 e0 ldi r18, 0x00 ; 0 29c9e: 30 e0 ldi r19, 0x00 ; 0 29ca0: a9 01 movw r20, r18 29ca2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 29ca6: 88 23 and r24, r24 29ca8: d1 f0 breq .+52 ; 0x29cde #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; 29caa: 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; 29cae: cc 24 eor r12, r12 29cb0: ca 94 dec r12 29cb2: dc 2c mov r13, r12 29cb4: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29cb6: 98 ee ldi r25, 0xE8 ; 232 29cb8: 49 2e mov r4, r25 29cba: 93 e0 ldi r25, 0x03 ; 3 29cbc: 59 2e mov r5, r25 29cbe: 61 2c mov r6, r1 29cc0: 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) || 29cc2: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.375> 29cc6: 81 11 cpse r24, r1 29cc8: 0a c0 rjmp .+20 ; 0x29cde 29cca: 2f ef ldi r18, 0xFF ; 255 29ccc: c2 16 cp r12, r18 29cce: d2 06 cpc r13, r18 29cd0: e2 06 cpc r14, r18 29cd2: f2 06 cpc r15, r18 29cd4: 89 f4 brne .+34 ; 0x29cf8 (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) { 29cd6: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 29cda: 82 30 cpi r24, 0x02 ; 2 29cdc: b9 f4 brne .+46 ; 0x29d0c { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 29cde: ff 90 pop r15 29ce0: ef 90 pop r14 29ce2: df 90 pop r13 29ce4: cf 90 pop r12 29ce6: bf 90 pop r11 29ce8: af 90 pop r10 29cea: 9f 90 pop r9 29cec: 8f 90 pop r8 29cee: 7f 90 pop r7 29cf0: 6f 90 pop r6 29cf2: 5f 90 pop r5 29cf4: 4f 90 pop r4 29cf6: 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) || 29cf8: f7 fc sbrc r15, 7 29cfa: f1 cf rjmp .-30 ; 0x29cde (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 29cfc: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29d00: 6c 19 sub r22, r12 29d02: 7d 09 sbc r23, r13 29d04: 68 3b cpi r22, 0xB8 ; 184 29d06: 7b 40 sbci r23, 0x0B ; 11 29d08: 30 f3 brcs .-52 ; 0x29cd6 29d0a: e9 cf rjmp .-46 ; 0x29cde 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) 29d0c: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29d10: 68 19 sub r22, r8 29d12: 79 09 sbc r23, r9 29d14: 8a 09 sbc r24, r10 29d16: 9b 09 sbc r25, r11 29d18: 69 3e cpi r22, 0xE9 ; 233 29d1a: 73 40 sbci r23, 0x03 ; 3 29d1c: 81 05 cpc r24, r1 29d1e: 91 05 cpc r25, r1 29d20: 08 f4 brcc .+2 ; 0x29d24 29d22: 42 c0 rjmp .+132 ; 0x29da8 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 29d24: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29d28: 81 11 cpse r24, r1 29d2a: 3a c0 rjmp .+116 ; 0x29da0 SERIAL_PROTOCOLPGM("T:"); 29d2c: 84 ef ldi r24, 0xF4 ; 244 29d2e: 9c e9 ldi r25, 0x9C ; 156 29d30: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 29d34: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29d38: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29d3c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29d40: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29d44: 41 e0 ldi r20, 0x01 ; 1 29d46: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 29d4a: 80 ef ldi r24, 0xF0 ; 240 29d4c: 9c e9 ldi r25, 0x9C ; 156 29d4e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 29d52: 60 e0 ldi r22, 0x00 ; 0 29d54: 70 e0 ldi r23, 0x00 ; 0 29d56: cb 01 movw r24, r22 29d58: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 29d5c: 8c ee ldi r24, 0xEC ; 236 29d5e: 9c e9 ldi r25, 0x9C ; 156 29d60: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (residencyStart > -1) 29d64: f7 fc sbrc r15, 7 29d66: 52 c0 rjmp .+164 ; 0x29e0c { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29d68: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29d6c: 46 01 movw r8, r12 29d6e: 57 01 movw r10, r14 29d70: 58 eb ldi r21, 0xB8 ; 184 29d72: 85 0e add r8, r21 29d74: 5b e0 ldi r21, 0x0B ; 11 29d76: 95 1e adc r9, r21 29d78: a1 1c adc r10, r1 29d7a: b1 1c adc r11, r1 29d7c: a5 01 movw r20, r10 29d7e: 94 01 movw r18, r8 29d80: 26 1b sub r18, r22 29d82: 37 0b sbc r19, r23 29d84: 48 0b sbc r20, r24 29d86: 59 0b sbc r21, r25 29d88: ca 01 movw r24, r20 29d8a: b9 01 movw r22, r18 29d8c: a3 01 movw r20, r6 29d8e: 92 01 movw r18, r4 29d90: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 29d94: ca 01 movw r24, r20 29d96: b9 01 movw r22, r18 29d98: 0f 94 43 97 call 0x32e86 ; 0x32e86 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29d9c: 0f 94 9d 98 call 0x3313a ; 0x3313a } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 29da0: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29da4: 4b 01 movw r8, r22 29da6: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 29da8: 90 e0 ldi r25, 0x00 ; 0 29daa: 80 e0 ldi r24, 0x00 ; 0 29dac: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 #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))) || 29db0: 3f ef ldi r19, 0xFF ; 255 29db2: c3 16 cp r12, r19 29db4: d3 06 cpc r13, r19 29db6: e3 06 cpc r14, r19 29db8: f3 06 cpc r15, r19 29dba: 09 f0 breq .+2 ; 0x29dbe 29dbc: 46 c0 rjmp .+140 ; 0x29e4a } 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))) || 29dbe: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.492> 29dc2: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29dc6: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29dca: 88 23 and r24, r24 29dcc: 19 f1 breq .+70 ; 0x29e14 29dce: 07 2e mov r0, r23 29dd0: 00 0c add r0, r0 29dd2: 88 0b sbc r24, r24 29dd4: 99 0b sbc r25, r25 29dd6: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 29dda: 20 e0 ldi r18, 0x00 ; 0 29ddc: 30 e0 ldi r19, 0x00 ; 0 29dde: 40 e8 ldi r20, 0x80 ; 128 29de0: 5f e3 ldi r21, 0x3F ; 63 29de2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 29de6: 9b 01 movw r18, r22 29de8: ac 01 movw r20, r24 29dea: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29dee: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29df2: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29df6: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29dfa: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 29dfe: 87 fd sbrc r24, 7 29e00: 60 cf rjmp .-320 ; 0x29cc2 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 29e02: 0f 94 46 0f call 0x21e8c ; 0x21e8c 29e06: 6b 01 movw r12, r22 29e08: 7c 01 movw r14, r24 29e0a: 5b cf rjmp .-330 ; 0x29cc2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29e0c: 8f e3 ldi r24, 0x3F ; 63 29e0e: 0e 94 cc 70 call 0xe198 ; 0xe198 29e12: c4 cf rjmp .-120 ; 0x29d9c 29e14: 07 2e mov r0, r23 29e16: 00 0c add r0, r0 29e18: 88 0b sbc r24, r24 29e1a: 99 0b sbc r25, r25 29e1c: 0f 94 0b 9b call 0x33616 ; 0x33616 <__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))) || 29e20: 20 e0 ldi r18, 0x00 ; 0 29e22: 30 e0 ldi r19, 0x00 ; 0 29e24: 40 e8 ldi r20, 0x80 ; 128 29e26: 5f e3 ldi r21, 0x3F ; 63 29e28: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 29e2c: 9b 01 movw r18, r22 29e2e: ac 01 movw r20, r24 29e30: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29e34: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29e38: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29e3c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29e40: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 29e44: 18 16 cp r1, r24 29e46: ec f6 brge .-70 ; 0x29e02 29e48: 3c cf rjmp .-392 ; 0x29cc2 29e4a: f7 fc sbrc r15, 7 29e4c: 3a cf rjmp .-396 ; 0x29cc2 29e4e: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29e52: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29e56: 07 2e mov r0, r23 29e58: 00 0c add r0, r0 29e5a: 88 0b sbc r24, r24 29e5c: 99 0b sbc r25, r25 29e5e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 29e62: 9b 01 movw r18, r22 29e64: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 29e66: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29e6a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29e6e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29e72: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29e76: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 29e7a: 9f 77 andi r25, 0x7F ; 127 29e7c: 20 e0 ldi r18, 0x00 ; 0 29e7e: 30 e0 ldi r19, 0x00 ; 0 29e80: 40 ea ldi r20, 0xA0 ; 160 29e82: 50 e4 ldi r21, 0x40 ; 64 29e84: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 29e88: 18 16 cp r1, r24 29e8a: 0c f0 brlt .+2 ; 0x29e8e 29e8c: 1a cf rjmp .-460 ; 0x29cc2 29e8e: b9 cf rjmp .-142 ; 0x29e02 00029e90 : // 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) { 29e90: 1f 93 push r17 29e92: cf 93 push r28 29e94: df 93 push r29 29e96: ec 01 movw r28, r24 29e98: 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()) { 29e9a: 80 91 67 12 lds r24, 0x1267 ; 0x801267 29e9e: 83 30 cpi r24, 0x03 ; 3 29ea0: 09 f4 brne .+2 ; 0x29ea4 29ea2: 4e c0 rjmp .+156 ; 0x29f40 29ea4: 8c 31 cpi r24, 0x1C ; 28 29ea6: 09 f4 brne .+2 ; 0x29eaa 29ea8: 52 c0 rjmp .+164 ; 0x29f4e break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 29eaa: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 29eae: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 29eb2: 8c 17 cp r24, r28 29eb4: 9d 07 cpc r25, r29 29eb6: 79 f1 breq .+94 ; 0x29f16 lastErrorCode = ec; 29eb8: d0 93 8d 12 sts 0x128D, r29 ; 0x80128d 29ebc: c0 93 8c 12 sts 0x128C, r28 ; 0x80128c lastErrorSource = res; 29ec0: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 29ec4: ce 01 movw r24, r28 29ec6: 0f 94 d9 87 call 0x30fb2 ; 0x30fb2 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); 29eca: e8 2f mov r30, r24 29ecc: f0 e0 ldi r31, 0x00 ; 0 29ece: ee 0f add r30, r30 29ed0: ff 1f adc r31, r31 29ed2: e3 5f subi r30, 0xF3 ; 243 29ed4: f3 46 sbci r31, 0x63 ; 99 29ed6: 85 91 lpm r24, Z+ 29ed8: 94 91 lpm r25, Z 29eda: 02 96 adiw r24, 0x02 ; 2 29edc: 0f 94 c7 87 call 0x30f8e ; 0x30f8e if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 29ee0: c1 30 cpi r28, 0x01 ; 1 29ee2: d1 05 cpc r29, r1 29ee4: c1 f0 breq .+48 ; 0x29f16 29ee6: cc 30 cpi r28, 0x0C ; 12 29ee8: 80 e8 ldi r24, 0x80 ; 128 29eea: d8 07 cpc r29, r24 29eec: a1 f0 breq .+40 ; 0x29f16 29eee: c9 32 cpi r28, 0x29 ; 41 29ef0: 80 e8 ldi r24, 0x80 ; 128 29ef2: d8 07 cpc r29, r24 29ef4: 81 f0 breq .+32 ; 0x29f16 IncrementMMUFails(); 29ef6: 0f 94 f8 86 call 0x30df0 ; 0x30df0 | (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 29efa: ce 01 movw r24, r28 29efc: 88 27 eor r24, r24 29efe: 9e 77 andi r25, 0x7E ; 126 29f00: 89 2b or r24, r25 29f02: 49 f0 breq .+18 ; 0x29f16 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 29f04: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 29f08: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 29f0c: 01 96 adiw r24, 0x01 ; 1 29f0e: 90 93 9b 12 sts 0x129B, r25 ; 0x80129b 29f12: 80 93 9a 12 sts 0x129A, r24 ; 0x80129a return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 29f16: 80 91 79 12 lds r24, 0x1279 ; 0x801279 29f1a: 88 23 and r24, r24 29f1c: d9 f0 breq .+54 ; 0x29f54 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 29f1e: 11 e0 ldi r17, 0x01 ; 1 29f20: 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) { 29f24: ce 01 movw r24, r28 29f26: 0f 94 64 8a call 0x314c8 ; 0x314c8 29f2a: 8f 3f cpi r24, 0xFF ; 255 29f2c: 99 f0 breq .+38 ; 0x29f54 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 29f2e: 10 93 7a 12 sts 0x127A, r17 ; 0x80127a logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 29f32: 8a ef ldi r24, 0xFA ; 250 29f34: 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"); } 29f36: df 91 pop r29 29f38: cf 91 pop r28 29f3a: 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"); 29f3c: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc // 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; 29f40: 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(); 29f44: 0f 94 8b 86 call 0x30d16 ; 0x30d16 // 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; 29f48: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 29f4c: ae cf rjmp .-164 ; 0x29eaa 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; 29f4e: 10 92 96 12 sts 0x1296, r1 ; 0x801296 29f52: f8 cf rjmp .-16 ; 0x29f44 29f54: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 29f58: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 29f5c: 81 11 cpse r24, r1 29f5e: 06 c0 rjmp .+12 ; 0x29f6c 29f60: 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"); } 29f62: df 91 pop r29 29f64: cf 91 pop r28 29f66: 1f 91 pop r17 29f68: 0d 94 2a 89 jmp 0x31254 ; 0x31254 29f6c: df 91 pop r29 29f6e: cf 91 pop r28 29f70: 1f 91 pop r17 29f72: 08 95 ret 00029f74 : * \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) { 29f74: 2f 92 push r2 29f76: 3f 92 push r3 29f78: 4f 92 push r4 29f7a: 5f 92 push r5 29f7c: 6f 92 push r6 29f7e: 7f 92 push r7 29f80: 8f 92 push r8 29f82: 9f 92 push r9 29f84: af 92 push r10 29f86: bf 92 push r11 29f88: cf 92 push r12 29f8a: df 92 push r13 29f8c: ef 92 push r14 29f8e: ff 92 push r15 29f90: 0f 93 push r16 29f92: 1f 93 push r17 29f94: cf 93 push r28 29f96: df 93 push r29 29f98: 00 d0 rcall .+0 ; 0x29f9a 29f9a: 1f 92 push r1 29f9c: cd b7 in r28, 0x3d ; 61 29f9e: de b7 in r29, 0x3e ; 62 29fa0: 5c 01 movw r10, r24 29fa2: 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; 29fa4: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 29fa8: 81 30 cpi r24, 0x01 ; 1 29faa: 09 f0 breq .+2 ; 0x29fae 29fac: de c0 rjmp .+444 ; 0x2a16a 29fae: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 29fb2: 81 ff sbrs r24, 1 29fb4: da c0 rjmp .+436 ; 0x2a16a // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 29fb6: 82 fd sbrc r24, 2 29fb8: bc c0 rjmp .+376 ; 0x2a132 * \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) { 29fba: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 29fbc: 21 2c mov r2, r1 29fbe: 32 e0 ldi r19, 0x02 ; 2 29fc0: 33 2e mov r3, r19 29fc2: 00 91 02 16 lds r16, 0x1602 ; 0x801602 29fc6: 10 91 03 16 lds r17, 0x1603 ; 0x801603 29fca: 20 91 04 16 lds r18, 0x1604 ; 0x801604 29fce: 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) { 29fd2: e1 14 cp r14, r1 29fd4: f1 04 cpc r15, r1 29fd6: 09 f4 brne .+2 ; 0x29fda 29fd8: 30 c1 rjmp .+608 ; 0x2a23a uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 29fda: 80 91 13 16 lds r24, 0x1613 ; 0x801613 29fde: 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);} 29fe2: dc 01 movw r26, r24 29fe4: 14 96 adiw r26, 0x04 ; 4 29fe6: 7c 90 ld r7, X 29fe8: 7a 94 dec r7 29fea: b9 01 movw r22, r18 29fec: a8 01 movw r20, r16 29fee: 29 e0 ldi r18, 0x09 ; 9 29ff0: 76 95 lsr r23 29ff2: 67 95 ror r22 29ff4: 57 95 ror r21 29ff6: 47 95 ror r20 29ff8: 2a 95 dec r18 29ffa: d1 f7 brne .-12 ; 0x29ff0 29ffc: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 29ffe: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2a000: 71 10 cpse r7, r1 2a002: 25 c0 rjmp .+74 ; 0x2a04e 2a004: 01 15 cp r16, r1 2a006: 11 05 cpc r17, r1 2a008: 11 f5 brne .+68 ; 0x2a04e 2a00a: 40 91 fe 15 lds r20, 0x15FE ; 0x8015fe 2a00e: 50 91 ff 15 lds r21, 0x15FF ; 0x8015ff 2a012: 60 91 00 16 lds r22, 0x1600 ; 0x801600 2a016: 70 91 01 16 lds r23, 0x1601 ; 0x801601 // start of new cluster if (curCluster_ == 0) { 2a01a: 41 15 cp r20, r1 2a01c: 51 05 cpc r21, r1 2a01e: 61 05 cpc r22, r1 2a020: 71 05 cpc r23, r1 2a022: 09 f0 breq .+2 ; 0x2a026 2a024: a8 c0 rjmp .+336 ; 0x2a176 if (firstCluster_ == 0) { 2a026: 80 91 0f 16 lds r24, 0x160F ; 0x80160f 2a02a: 90 91 10 16 lds r25, 0x1610 ; 0x801610 2a02e: a0 91 11 16 lds r26, 0x1611 ; 0x801611 2a032: b0 91 12 16 lds r27, 0x1612 ; 0x801612 2a036: 00 97 sbiw r24, 0x00 ; 0 2a038: a1 05 cpc r26, r1 2a03a: b1 05 cpc r27, r1 2a03c: 09 f0 breq .+2 ; 0x2a040 2a03e: b4 c0 rjmp .+360 ; 0x2a1a8 } 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; 2a040: 8a ef ldi r24, 0xFA ; 250 2a042: 95 e1 ldi r25, 0x15 ; 21 2a044: 0f 94 90 6f call 0x2df20 ; 0x2df20 2a048: 88 23 and r24, r24 2a04a: 09 f4 brne .+2 ; 0x2a04e 2a04c: 8e c0 rjmp .+284 ; 0x2a16a curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a04e: c1 01 movw r24, r2 2a050: 80 1b sub r24, r16 2a052: 91 0b sbc r25, r17 2a054: 67 01 movw r12, r14 2a056: 8e 15 cp r24, r14 2a058: 9f 05 cpc r25, r15 2a05a: 08 f4 brcc .+2 ; 0x2a05e 2a05c: 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; 2a05e: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a062: f0 91 14 16 lds r31, 0x1614 ; 0x801614 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2a066: 80 91 fe 15 lds r24, 0x15FE ; 0x8015fe 2a06a: 90 91 ff 15 lds r25, 0x15FF ; 0x8015ff 2a06e: a0 91 00 16 lds r26, 0x1600 ; 0x801600 2a072: b0 91 01 16 lds r27, 0x1601 ; 0x801601 2a076: 02 97 sbiw r24, 0x02 ; 2 2a078: a1 09 sbc r26, r1 2a07a: b1 09 sbc r27, r1 2a07c: 25 85 ldd r18, Z+13 ; 0x0d 2a07e: 04 c0 rjmp .+8 ; 0x2a088 2a080: 88 0f add r24, r24 2a082: 99 1f adc r25, r25 2a084: aa 1f adc r26, r26 2a086: bb 1f adc r27, r27 2a088: 2a 95 dec r18 2a08a: d2 f7 brpl .-12 ; 0x2a080 2a08c: 46 85 ldd r20, Z+14 ; 0x0e 2a08e: 57 85 ldd r21, Z+15 ; 0x0f 2a090: 60 89 ldd r22, Z+16 ; 0x10 2a092: 71 89 ldd r23, Z+17 ; 0x11 2a094: 84 0f add r24, r20 2a096: 95 1f adc r25, r21 2a098: a6 1f adc r26, r22 2a09a: b7 1f adc r27, r23 2a09c: 9c 01 movw r18, r24 2a09e: ad 01 movw r20, r26 2a0a0: 27 0d add r18, r7 2a0a2: 31 1d adc r19, r1 2a0a4: 41 1d adc r20, r1 2a0a6: 51 1d adc r21, r1 2a0a8: 29 01 movw r4, r18 2a0aa: 3a 01 movw r6, r20 if (n == 512) { 2a0ac: c1 14 cp r12, r1 2a0ae: 32 e0 ldi r19, 0x02 ; 2 2a0b0: d3 06 cpc r13, r19 2a0b2: 09 f0 breq .+2 ; 0x2a0b6 2a0b4: 8a c0 rjmp .+276 ; 0x2a1ca // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2a0b6: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2a0ba: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2a0be: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2a0c2: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2a0c6: 48 16 cp r4, r24 2a0c8: 59 06 cpc r5, r25 2a0ca: 6a 06 cpc r6, r26 2a0cc: 7b 06 cpc r7, r27 2a0ce: 69 f4 brne .+26 ; 0x2a0ea 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; 2a0d0: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a0d4: 8f ef ldi r24, 0xFF ; 255 2a0d6: 9f ef ldi r25, 0xFF ; 255 2a0d8: dc 01 movw r26, r24 2a0da: 80 93 cd 0d sts 0x0DCD, r24 ; 0x800dcd 2a0de: 90 93 ce 0d sts 0x0DCE, r25 ; 0x800dce 2a0e2: a0 93 cf 0d sts 0x0DCF, r26 ; 0x800dcf 2a0e6: 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); 2a0ea: 95 01 movw r18, r10 2a0ec: b3 01 movw r22, r6 2a0ee: a2 01 movw r20, r4 2a0f0: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2a0f4: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2a0f8: 0f 94 f0 70 call 0x2e1e0 ; 0x2e1e0 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2a0fc: 88 23 and r24, r24 2a0fe: a9 f1 breq .+106 ; 0x2a16a if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2a100: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a104: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a108: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a10c: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a110: 8c 0d add r24, r12 2a112: 9d 1d adc r25, r13 2a114: a1 1d adc r26, r1 2a116: b1 1d adc r27, r1 2a118: 80 93 02 16 sts 0x1602, r24 ; 0x801602 2a11c: 90 93 03 16 sts 0x1603, r25 ; 0x801603 2a120: a0 93 04 16 sts 0x1604, r26 ; 0x801604 2a124: b0 93 05 16 sts 0x1605, r27 ; 0x801605 src += n; 2a128: ac 0c add r10, r12 2a12a: bd 1c adc r11, r13 nToWrite -= n; 2a12c: ec 18 sub r14, r12 2a12e: fd 08 sbc r15, r13 2a130: 48 cf rjmp .-368 ; 0x29fc2 // 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_) { 2a132: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 2a136: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2a13a: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 2a13e: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 2a142: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a146: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a14a: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a14e: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a152: 48 17 cp r20, r24 2a154: 59 07 cpc r21, r25 2a156: 6a 07 cpc r22, r26 2a158: 7b 07 cpc r23, r27 2a15a: 09 f4 brne .+2 ; 0x2a15e 2a15c: 2e cf rjmp .-420 ; 0x29fba } /** 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);} 2a15e: 8a ef ldi r24, 0xFA ; 250 2a160: 95 e1 ldi r25, 0x15 ; 21 2a162: 0f 94 db 38 call 0x271b6 ; 0x271b6 if (!seekEnd()) goto fail; 2a166: 81 11 cpse r24, r1 2a168: 28 cf rjmp .-432 ; 0x29fba } return nbyte; fail: // return for write error writeError = true; 2a16a: 81 e0 ldi r24, 0x01 ; 1 2a16c: 80 93 fa 15 sts 0x15FA, r24 ; 0x8015fa return -1; 2a170: 8f ef ldi r24, 0xFF ; 255 2a172: 9f ef ldi r25, 0xFF ; 255 2a174: 81 c0 rjmp .+258 ; 0x2a278 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2a176: 9e 01 movw r18, r28 2a178: 2f 5f subi r18, 0xFF ; 255 2a17a: 3f 4f sbci r19, 0xFF ; 255 2a17c: 0f 94 d8 36 call 0x26db0 ; 0x26db0 2a180: 88 23 and r24, r24 2a182: 99 f3 breq .-26 ; 0x2a16a if (vol_->isEOC(next)) { 2a184: 89 81 ldd r24, Y+1 ; 0x01 2a186: 9a 81 ldd r25, Y+2 ; 0x02 2a188: ab 81 ldd r26, Y+3 ; 0x03 2a18a: 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; 2a18c: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a190: f0 91 14 16 lds r31, 0x1614 ; 0x801614 2a194: 27 89 ldd r18, Z+23 ; 0x17 2a196: 20 31 cpi r18, 0x10 ; 16 2a198: 81 f4 brne .+32 ; 0x2a1ba 2a19a: 88 3f cpi r24, 0xF8 ; 248 2a19c: ef ef ldi r30, 0xFF ; 255 2a19e: 9e 07 cpc r25, r30 2a1a0: a1 05 cpc r26, r1 2a1a2: b1 05 cpc r27, r1 2a1a4: 08 f0 brcs .+2 ; 0x2a1a8 2a1a6: 4c cf rjmp .-360 ; 0x2a040 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2a1a8: 80 93 fe 15 sts 0x15FE, r24 ; 0x8015fe 2a1ac: 90 93 ff 15 sts 0x15FF, r25 ; 0x8015ff 2a1b0: a0 93 00 16 sts 0x1600, r26 ; 0x801600 2a1b4: b0 93 01 16 sts 0x1601, r27 ; 0x801601 2a1b8: 4a cf rjmp .-364 ; 0x2a04e return cluster >= FAT32EOC_MIN; 2a1ba: 88 3f cpi r24, 0xF8 ; 248 2a1bc: ff ef ldi r31, 0xFF ; 255 2a1be: 9f 07 cpc r25, r31 2a1c0: af 07 cpc r26, r31 2a1c2: ff e0 ldi r31, 0x0F ; 15 2a1c4: bf 07 cpc r27, r31 2a1c6: 80 f3 brcs .-32 ; 0x2a1a8 2a1c8: 3b cf rjmp .-394 ; 0x2a040 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2a1ca: 01 15 cp r16, r1 2a1cc: 11 05 cpc r17, r1 2a1ce: 69 f5 brne .+90 ; 0x2a22a 2a1d0: 40 91 02 16 lds r20, 0x1602 ; 0x801602 2a1d4: 50 91 03 16 lds r21, 0x1603 ; 0x801603 2a1d8: 60 91 04 16 lds r22, 0x1604 ; 0x801604 2a1dc: 70 91 05 16 lds r23, 0x1605 ; 0x801605 2a1e0: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a1e4: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a1e8: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a1ec: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a1f0: 48 17 cp r20, r24 2a1f2: 59 07 cpc r21, r25 2a1f4: 6a 07 cpc r22, r26 2a1f6: 7b 07 cpc r23, r27 2a1f8: c0 f0 brcs .+48 ; 0x2a22a // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2a1fa: 0f 94 ca 35 call 0x26b94 ; 0x26b94 2a1fe: 88 23 and r24, r24 2a200: 09 f4 brne .+2 ; 0x2a204 2a202: b3 cf rjmp .-154 ; 0x2a16a 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; 2a204: 81 e0 ldi r24, 0x01 ; 1 2a206: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a20a: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2a20e: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2a212: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2a216: 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); 2a21a: a6 01 movw r20, r12 2a21c: b5 01 movw r22, r10 2a21e: c8 01 movw r24, r16 2a220: 87 52 subi r24, 0x27 ; 39 2a222: 92 4f sbci r25, 0xF2 ; 242 2a224: 0f 94 a6 a6 call 0x34d4c ; 0x34d4c 2a228: 6b cf rjmp .-298 ; 0x2a100 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; 2a22a: 41 e0 ldi r20, 0x01 ; 1 2a22c: c3 01 movw r24, r6 2a22e: b2 01 movw r22, r4 2a230: 0f 94 09 36 call 0x26c12 ; 0x26c12 2a234: 81 11 cpse r24, r1 2a236: f1 cf rjmp .-30 ; 0x2a21a 2a238: 98 cf rjmp .-208 ; 0x2a16a } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2a23a: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a23e: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a242: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a246: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a24a: 80 17 cp r24, r16 2a24c: 91 07 cpc r25, r17 2a24e: a2 07 cpc r26, r18 2a250: b3 07 cpc r27, r19 2a252: 68 f4 brcc .+26 ; 0x2a26e 2a254: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2a258: 00 93 0b 16 sts 0x160B, r16 ; 0x80160b 2a25c: 10 93 0c 16 sts 0x160C, r17 ; 0x80160c 2a260: 20 93 0d 16 sts 0x160D, r18 ; 0x80160d 2a264: 30 93 0e 16 sts 0x160E, r19 ; 0x80160e flags_ |= F_FILE_DIR_DIRTY; 2a268: 80 68 ori r24, 0x80 ; 128 2a26a: 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) { 2a26e: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a272: 83 fd sbrc r24, 3 2a274: 18 c0 rjmp .+48 ; 0x2a2a6 if (!sync()) goto fail; } return nbyte; 2a276: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2a278: 0f 90 pop r0 2a27a: 0f 90 pop r0 2a27c: 0f 90 pop r0 2a27e: 0f 90 pop r0 2a280: df 91 pop r29 2a282: cf 91 pop r28 2a284: 1f 91 pop r17 2a286: 0f 91 pop r16 2a288: ff 90 pop r15 2a28a: ef 90 pop r14 2a28c: df 90 pop r13 2a28e: cf 90 pop r12 2a290: bf 90 pop r11 2a292: af 90 pop r10 2a294: 9f 90 pop r9 2a296: 8f 90 pop r8 2a298: 7f 90 pop r7 2a29a: 6f 90 pop r6 2a29c: 5f 90 pop r5 2a29e: 4f 90 pop r4 2a2a0: 3f 90 pop r3 2a2a2: 2f 90 pop r2 2a2a4: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2a2a6: 8a ef ldi r24, 0xFA ; 250 2a2a8: 95 e1 ldi r25, 0x15 ; 21 2a2aa: 0f 94 a6 38 call 0x2714c ; 0x2714c 2a2ae: 81 11 cpse r24, r1 2a2b0: e2 cf rjmp .-60 ; 0x2a276 2a2b2: 5b cf rjmp .-330 ; 0x2a16a 0002a2b4 : #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) { 2a2b4: 0f 93 push r16 2a2b6: cf 93 push r28 2a2b8: df 93 push r29 2a2ba: cd b7 in r28, 0x3d ; 61 2a2bc: de b7 in r29, 0x3e ; 62 2a2be: a3 97 sbiw r28, 0x23 ; 35 2a2c0: 0f b6 in r0, 0x3f ; 63 2a2c2: f8 94 cli 2a2c4: de bf out 0x3e, r29 ; 62 2a2c6: 0f be out 0x3f, r0 ; 63 2a2c8: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2a2ca: 20 91 0b 15 lds r18, 0x150B ; 0x80150b 2a2ce: 30 91 0c 15 lds r19, 0x150C ; 0x80150c 2a2d2: 82 17 cp r24, r18 2a2d4: 93 07 cpc r25, r19 2a2d6: d8 f4 brcc .+54 ; 0x2a30e getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2a2d8: 61 30 cpi r22, 0x01 ; 1 2a2da: 31 f4 brne .+12 ; 0x2a2e8 2a2dc: 21 50 subi r18, 0x01 ; 1 2a2de: 31 09 sbc r19, r1 2a2e0: a9 01 movw r20, r18 2a2e2: 48 1b sub r20, r24 2a2e4: 59 0b sbc r21, r25 2a2e6: ca 01 movw r24, r20 2a2e8: 88 0f add r24, r24 2a2ea: 99 1f adc r25, r25 2a2ec: fc 01 movw r30, r24 2a2ee: e3 5f subi r30, 0xF3 ; 243 2a2f0: fa 4e sbci r31, 0xEA ; 234 2a2f2: 80 81 ld r24, Z 2a2f4: 91 81 ldd r25, Z+1 ; 0x01 2a2f6: 0f 94 7d 47 call 0x28efa ; 0x28efa else getfilename_afterMaxSorting(nr); } 2a2fa: a3 96 adiw r28, 0x23 ; 35 2a2fc: 0f b6 in r0, 0x3f ; 63 2a2fe: f8 94 cli 2a300: de bf out 0x3e, r29 ; 62 2a302: 0f be out 0x3f, r0 ; 63 2a304: cd bf out 0x3d, r28 ; 61 2a306: df 91 pop r29 2a308: cf 91 pop r28 2a30a: 0f 91 pop r16 2a30c: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2a30e: 45 e1 ldi r20, 0x15 ; 21 2a310: 54 e1 ldi r21, 0x14 ; 20 2a312: 50 93 14 14 sts 0x1414, r21 ; 0x801414 2a316: 40 93 13 14 sts 0x1413, r20 ; 0x801413 nrFiles = entry - sort_count + 1; 2a31a: 82 1b sub r24, r18 2a31c: 93 0b sbc r25, r19 2a31e: 01 96 adiw r24, 0x01 ; 1 2a320: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2a324: 80 93 82 16 sts 0x1682, r24 ; 0x801682 curDir->seekSet(lastSortedFilePosition << 5); 2a328: 40 91 d5 15 lds r20, 0x15D5 ; 0x8015d5 2a32c: 50 91 d6 15 lds r21, 0x15D6 ; 0x8015d6 2a330: 85 e0 ldi r24, 0x05 ; 5 2a332: 44 0f add r20, r20 2a334: 55 1f adc r21, r21 2a336: 8a 95 dec r24 2a338: e1 f7 brne .-8 ; 0x2a332 2a33a: 70 e0 ldi r23, 0x00 ; 0 2a33c: 60 e0 ldi r22, 0x00 ; 0 2a33e: 85 e1 ldi r24, 0x15 ; 21 2a340: 94 e1 ldi r25, 0x14 ; 20 2a342: 0f 94 db 38 call 0x271b6 ; 0x271b6 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2a346: 00 e0 ldi r16, 0x00 ; 0 2a348: 0e 7f andi r16, 0xFE ; 254 2a34a: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2a34c: e0 91 13 14 lds r30, 0x1413 ; 0x801413 2a350: f0 91 14 14 lds r31, 0x1414 ; 0x801414 2a354: 83 e2 ldi r24, 0x23 ; 35 2a356: de 01 movw r26, r28 2a358: 11 96 adiw r26, 0x01 ; 1 2a35a: 01 90 ld r0, Z+ 2a35c: 0d 92 st X+, r0 2a35e: 8a 95 dec r24 2a360: e1 f7 brne .-8 ; 0x2a35a 2a362: 22 e0 ldi r18, 0x02 ; 2 2a364: 50 e0 ldi r21, 0x00 ; 0 2a366: 40 e0 ldi r20, 0x00 ; 0 2a368: be 01 movw r22, r28 2a36a: 6f 5f subi r22, 0xFF ; 255 2a36c: 7f 4f sbci r23, 0xFF ; 255 2a36e: 8a ed ldi r24, 0xDA ; 218 2a370: 92 e0 ldi r25, 0x02 ; 2 2a372: 0f 94 07 45 call 0x28a0e ; 0x28a0e 2a376: ce 01 movw r24, r28 2a378: 01 96 adiw r24, 0x01 ; 1 2a37a: 0e 94 c6 70 call 0xe18c ; 0xe18c 2a37e: bd cf rjmp .-134 ; 0x2a2fa 0002a380 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2a380: 0f 93 push r16 2a382: 1f 93 push r17 2a384: cf 93 push r28 2a386: df 93 push r29 2a388: 1f 92 push r1 2a38a: 1f 92 push r1 2a38c: cd b7 in r28, 0x3d ; 61 2a38e: de b7 in r29, 0x3e ; 62 { if(!mounted) 2a390: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 2a394: 22 23 and r18, r18 2a396: 69 f1 breq .+90 ; 0x2a3f2 2a398: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2a39a: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a39e: 88 23 and r24, r24 2a3a0: 79 f1 breq .+94 ; 0x2a400 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2a3a2: 81 e2 ldi r24, 0x21 ; 33 2a3a4: 9b e9 ldi r25, 0x9B ; 155 2a3a6: 0e 94 de 72 call 0xe5bc ; 0xe5bc 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; 2a3aa: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 2a3ae: 1a 83 std Y+2, r17 ; 0x02 2a3b0: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2a3b2: ce 01 movw r24, r28 2a3b4: 01 96 adiw r24, 0x01 ; 1 2a3b6: 0f 94 1f 4b call 0x2963e ; 0x2963e 2a3ba: 88 23 and r24, r24 2a3bc: d1 f0 breq .+52 ; 0x2a3f2 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2a3be: 49 81 ldd r20, Y+1 ; 0x01 2a3c0: 5a 81 ldd r21, Y+2 ; 0x02 2a3c2: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2a3c6: 70 91 14 14 lds r23, 0x1414 ; 0x801414 2a3ca: 26 e5 ldi r18, 0x56 ; 86 2a3cc: 8a ef ldi r24, 0xFA ; 250 2a3ce: 95 e1 ldi r25, 0x15 ; 21 2a3d0: 0f 94 2a 9a call 0x33454 ; 0x33454 2a3d4: 81 11 cpse r24, r1 2a3d6: 22 c0 rjmp .+68 ; 0x2a41c SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2a3d8: 8f e5 ldi r24, 0x5F ; 95 2a3da: 9c e6 ldi r25, 0x6C ; 108 2a3dc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2a3e0: 89 81 ldd r24, Y+1 ; 0x01 2a3e2: 9a 81 ldd r25, Y+2 ; 0x02 2a3e4: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 2a3e8: 8e e2 ldi r24, 0x2E ; 46 2a3ea: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2a3ee: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2a3f2: 0f 90 pop r0 2a3f4: 0f 90 pop r0 2a3f6: df 91 pop r29 2a3f8: cf 91 pop r28 2a3fa: 1f 91 pop r17 2a3fc: 0f 91 pop r16 2a3fe: 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 2a400: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 2a404: 87 e7 ldi r24, 0x77 ; 119 2a406: 9e e9 ldi r25, 0x9E ; 158 2a408: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(ofNowFreshFile); 2a40c: 89 e3 ldi r24, 0x39 ; 57 2a40e: 9d e9 ldi r25, 0x9D ; 157 2a410: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN(name); 2a414: c8 01 movw r24, r16 2a416: 0f 94 9e 99 call 0x3333c ; 0x3333c 2a41a: c7 cf rjmp .-114 ; 0x2a3aa 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; 2a41c: 81 e0 ldi r24, 0x01 ; 1 2a41e: 80 93 68 13 sts 0x1368, r24 ; 0x801368 getfilename(0, fname); 2a422: 89 81 ldd r24, Y+1 ; 0x01 2a424: 9a 81 ldd r25, Y+2 ; 0x02 2a426: 0f 94 36 47 call 0x28e6c ; 0x28e6c SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2a42a: 8f e0 ldi r24, 0x0F ; 15 2a42c: 9b e9 ldi r25, 0x9B ; 155 2a42e: 0e 94 e5 70 call 0xe1ca ; 0xe1ca printAbsFilenameFast(); 2a432: 0f 94 19 48 call 0x29032 ; 0x29032 SERIAL_PROTOCOLLN(); 2a436: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2a43a: 85 e1 ldi r24, 0x15 ; 21 2a43c: 9d e9 ldi r25, 0x9D ; 157 2a43e: 0e 94 de 72 call 0xe5bc ; 0xe5bc lcd_setstatuspgm(ofFileSelected); 2a442: 85 e1 ldi r24, 0x15 ; 21 2a444: 9d e9 ldi r25, 0x9D ; 157 2a446: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe scrollstuff = 0; 2a44a: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 2a44e: d1 cf rjmp .-94 ; 0x2a3f2 0002a450 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2a450: 0f 93 push r16 2a452: 1f 93 push r17 2a454: cf 93 push r28 2a456: df 93 push r29 2a458: ec 01 movw r28, r24 { memset(ip, 0, 4); 2a45a: 84 e0 ldi r24, 0x04 ; 4 2a45c: fe 01 movw r30, r28 2a45e: 11 92 st Z+, r1 2a460: 8a 95 dec r24 2a462: e9 f7 brne .-6 ; 0x2a45e /** 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 2a464: 23 e0 ldi r18, 0x03 ; 3 2a466: 30 ea ldi r19, 0xA0 ; 160 2a468: 4a e0 ldi r20, 0x0A ; 10 2a46a: 50 e9 ldi r21, 0x90 ; 144 2a46c: 60 e3 ldi r22, 0x30 ; 48 2a46e: 87 ed ldi r24, 0xD7 ; 215 2a470: 95 e1 ldi r25, 0x15 ; 21 2a472: 0f 94 97 70 call 0x2e12e ; 0x2e12e 2a476: 88 23 and r24, r24 2a478: 91 f0 breq .+36 ; 0x2a49e 2a47a: 23 e0 ldi r18, 0x03 ; 3 2a47c: 30 ea ldi r19, 0xA0 ; 160 2a47e: 4a e0 ldi r20, 0x0A ; 10 2a480: 50 e9 ldi r21, 0x90 ; 144 2a482: 61 e1 ldi r22, 0x11 ; 17 2a484: 87 ed ldi r24, 0xD7 ; 215 2a486: 95 e1 ldi r25, 0x15 ; 21 2a488: 0f 94 97 70 call 0x2e12e ; 0x2e12e 2a48c: 88 23 and r24, r24 2a48e: 39 f0 breq .+14 ; 0x2a49e bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a490: 80 e8 ldi r24, 0x80 ; 128 2a492: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2a496: 0f 94 65 41 call 0x282ca ; 0x282ca return false; 2a49a: 80 e0 ldi r24, 0x00 ; 0 2a49c: 2f c0 rjmp .+94 ; 0x2a4fc //------------------------------------------------------------------------------ /** 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(); 2a49e: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2a4a2: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a4a4: 0f 94 90 70 call 0x2e120 ; 0x2e120 2a4a8: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 2a4ac: 8f 3f cpi r24, 0xFF ; 255 2a4ae: 69 f4 brne .+26 ; 0x2a4ca if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a4b0: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2a4b4: 60 1b sub r22, r16 2a4b6: 71 0b sbc r23, r17 2a4b8: 6d 32 cpi r22, 0x2D ; 45 2a4ba: 71 40 sbci r23, 0x01 ; 1 2a4bc: 98 f3 brcs .-26 ; 0x2a4a4 2a4be: 81 e1 ldi r24, 0x11 ; 17 2a4c0: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 goto fail; } return true; fail: chipSelectHigh(); 2a4c4: 0f 94 65 41 call 0x282ca ; 0x282ca 2a4c8: e6 cf rjmp .-52 ; 0x2a496 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a4ca: 8e 3f cpi r24, 0xFE ; 254 2a4cc: 11 f0 breq .+4 ; 0x2a4d2 2a4ce: 8f e0 ldi r24, 0x0F ; 15 2a4d0: f7 cf rjmp .-18 ; 0x2a4c0 2a4d2: 8e 01 movw r16, r28 2a4d4: 0c 5f subi r16, 0xFC ; 252 2a4d6: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2a4d8: 0f 94 90 70 call 0x2e120 ; 0x2e120 2a4dc: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2a4de: c0 17 cp r28, r16 2a4e0: d1 07 cpc r29, r17 2a4e2: d1 f7 brne .-12 ; 0x2a4d8 2a4e4: ce ef ldi r28, 0xFE ; 254 2a4e6: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2a4e8: 0f 94 90 70 call 0x2e120 ; 0x2e120 2a4ec: 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) { 2a4ee: e1 f7 brne .-8 ; 0x2a4e8 spiRec(); } chipSelectHigh(); 2a4f0: 0f 94 65 41 call 0x282ca ; 0x282ca spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2a4f4: 8f ef ldi r24, 0xFF ; 255 2a4f6: 0f 94 8b 70 call 0x2e116 ; 0x2e116 2a4fa: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2a4fc: df 91 pop r29 2a4fe: cf 91 pop r28 2a500: 1f 91 pop r17 2a502: 0f 91 pop r16 2a504: 08 95 ret 0002a506 : } 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) 2a506: cf 92 push r12 2a508: df 92 push r13 2a50a: ef 92 push r14 2a50c: ff 92 push r15 2a50e: 0f 93 push r16 2a510: 1f 93 push r17 2a512: cf 93 push r28 2a514: df 93 push r29 2a516: ec 01 movw r28, r24 2a518: 8b 01 movw r16, r22 2a51a: 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) 2a51c: 01 15 cp r16, r1 2a51e: 11 05 cpc r17, r1 2a520: 09 f4 brne .+2 ; 0x2a524 2a522: 41 c0 rjmp .+130 ; 0x2a5a6 void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2a524: 8d 2f mov r24, r29 2a526: 0e 94 13 70 call 0xe026 ; 0xe026 print_hex_byte(val & 0xFF); 2a52a: 8c 2f mov r24, r28 2a52c: 0e 94 13 70 call 0xe026 ; 0xe026 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2a530: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a534: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a538: 80 e2 ldi r24, 0x20 ; 32 2a53a: 90 e0 ldi r25, 0x00 ; 0 2a53c: 0f 94 e5 9e call 0x33dca ; 0x33dca 2a540: 6e 01 movw r12, r28 2a542: 80 e1 ldi r24, 0x10 ; 16 2a544: c8 0e add r12, r24 2a546: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2a548: 81 e0 ldi r24, 0x01 ; 1 2a54a: e8 16 cp r14, r24 2a54c: 39 f1 breq .+78 ; 0x2a59c { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2a54e: 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; 2a550: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2a552: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a556: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a55a: 80 e2 ldi r24, 0x20 ; 32 2a55c: 90 e0 ldi r25, 0x00 ; 0 2a55e: 0f 94 e5 9e call 0x33dca ; 0x33dca print_hex_byte(data); 2a562: 8f 2d mov r24, r15 2a564: 0e 94 13 70 call 0xe026 ; 0xe026 count_line--; count--; 2a568: 01 50 subi r16, 0x01 ; 1 2a56a: 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)) 2a56c: 0f b6 in r0, 0x3f ; 63 2a56e: 07 fe sbrs r0, 7 2a570: 06 c0 rjmp .+12 ; 0x2a57e 2a572: c8 01 movw r24, r16 2a574: 9f 71 andi r25, 0x1F ; 31 2a576: 89 2b or r24, r25 2a578: 29 f4 brne .+10 ; 0x2a584 manage_heater(); 2a57a: 0f 94 f7 31 call 0x263ee ; 0x263ee while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2a57e: 01 15 cp r16, r1 2a580: 11 05 cpc r17, r1 2a582: 19 f0 breq .+6 ; 0x2a58a 2a584: cc 15 cp r28, r12 2a586: dd 05 cpc r29, r13 2a588: f9 f6 brne .-66 ; 0x2a548 // 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'); 2a58a: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a58e: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a592: 8a e0 ldi r24, 0x0A ; 10 2a594: 90 e0 ldi r25, 0x00 ; 0 2a596: 0f 94 e5 9e call 0x33dca ; 0x33dca 2a59a: c0 cf rjmp .-128 ; 0x2a51c { 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; 2a59c: ce 01 movw r24, r28 2a59e: 0f 94 7d a0 call 0x340fa ; 0x340fa 2a5a2: f8 2e mov r15, r24 2a5a4: d5 cf rjmp .-86 ; 0x2a550 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2a5a6: df 91 pop r29 2a5a8: cf 91 pop r28 2a5aa: 1f 91 pop r17 2a5ac: 0f 91 pop r16 2a5ae: ff 90 pop r15 2a5b0: ef 90 pop r14 2a5b2: df 90 pop r13 2a5b4: cf 90 pop r12 2a5b6: 08 95 ret 0002a5b8 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 2a5b8: 80 91 84 16 lds r24, 0x1684 ; 0x801684 2a5bc: 83 30 cpi r24, 0x03 ; 3 2a5be: 21 f4 brne .+8 ; 0x2a5c8 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 2a5c0: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup 2a5c2: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; 2a5c4: 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 2a5c8: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 1); // pullup 2a5ca: 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(); } 2a5cc: 84 e8 ldi r24, 0x84 ; 132 2a5ce: 96 e1 ldi r25, 0x16 ; 22 2a5d0: 0c 94 7b 6e jmp 0xdcf6 ; 0xdcf6 0002a5d4 : //! //! @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) 2a5d4: cf 92 push r12 2a5d6: df 92 push r13 2a5d8: ef 92 push r14 2a5da: ff 92 push r15 2a5dc: 69 01 movw r12, r18 2a5de: 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); 2a5e0: 2d ec ldi r18, 0xCD ; 205 2a5e2: 3c ec ldi r19, 0xCC ; 204 2a5e4: 4c e4 ldi r20, 0x4C ; 76 2a5e6: 5e e3 ldi r21, 0x3E ; 62 2a5e8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2a5ec: 2d ec ldi r18, 0xCD ; 205 2a5ee: 3c ec ldi r19, 0xCC ; 204 2a5f0: 4c e4 ldi r20, 0x4C ; 76 2a5f2: 5e e3 ldi r21, 0x3E ; 62 2a5f4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a5f8: 2d ef ldi r18, 0xFD ; 253 2a5fa: 3d ea ldi r19, 0xAD ; 173 2a5fc: 40 e0 ldi r20, 0x00 ; 0 2a5fe: 5d e3 ldi r21, 0x3D ; 61 2a600: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2a604: a7 01 movw r20, r14 2a606: 96 01 movw r18, r12 2a608: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a60c: 24 e2 ldi r18, 0x24 ; 36 2a60e: 30 ef ldi r19, 0xF0 ; 240 2a610: 49 e1 ldi r20, 0x19 ; 25 2a612: 50 e4 ldi r21, 0x40 ; 64 2a614: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> } 2a618: ff 90 pop r15 2a61a: ef 90 pop r14 2a61c: df 90 pop r13 2a61e: cf 90 pop r12 2a620: 08 95 ret 0002a622 : //! //! 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) 2a622: 2f 92 push r2 2a624: 3f 92 push r3 2a626: 4f 92 push r4 2a628: 5f 92 push r5 2a62a: 6f 92 push r6 2a62c: 7f 92 push r7 2a62e: 8f 92 push r8 2a630: 9f 92 push r9 2a632: af 92 push r10 2a634: bf 92 push r11 2a636: cf 92 push r12 2a638: df 92 push r13 2a63a: ef 92 push r14 2a63c: ff 92 push r15 2a63e: 0f 93 push r16 2a640: 1f 93 push r17 2a642: cf 93 push r28 2a644: df 93 push r29 2a646: 00 d0 rcall .+0 ; 0x2a648 2a648: 1f 92 push r1 2a64a: 1f 92 push r1 2a64c: cd b7 in r28, 0x3d ; 61 2a64e: de b7 in r29, 0x3e ; 62 2a650: 8c 83 std Y+4, r24 ; 0x04 2a652: 4a 01 movw r8, r20 2a654: 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); 2a656: 23 e4 ldi r18, 0x43 ; 67 2a658: 3d ec ldi r19, 0xCD ; 205 2a65a: 4f e2 ldi r20, 0x2F ; 47 2a65c: 5d e3 ldi r21, 0x3D ; 61 2a65e: cb 01 movw r24, r22 2a660: b4 01 movw r22, r8 2a662: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2a666: 6b 01 movw r12, r22 2a668: 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); 2a66a: 20 e0 ldi r18, 0x00 ; 0 2a66c: 30 e0 ldi r19, 0x00 ; 0 2a66e: 40 ea ldi r20, 0xA0 ; 160 2a670: 51 e4 ldi r21, 0x41 ; 65 2a672: c5 01 movw r24, r10 2a674: b4 01 movw r22, r8 2a676: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 2a67a: 56 2e mov r5, r22 2a67c: 47 2e mov r4, r23 2a67e: 38 2e mov r3, r24 2a680: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 2a682: a7 01 movw r20, r14 2a684: 96 01 movw r18, r12 2a686: c5 01 movw r24, r10 2a688: b4 01 movw r22, r8 2a68a: 0f 94 ea 52 call 0x2a5d4 ; 0x2a5d4 2a68e: 69 83 std Y+1, r22 ; 0x01 2a690: 7a 83 std Y+2, r23 ; 0x02 2a692: 8b 83 std Y+3, r24 ; 0x03 2a694: 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) 2a696: bc 80 ldd r11, Y+4 ; 0x04 2a698: 8b 2d mov r24, r11 2a69a: 90 e0 ldi r25, 0x00 ; 0 2a69c: 9c 01 movw r18, r24 2a69e: 2d 5f subi r18, 0xFD ; 253 2a6a0: 3f 4f sbci r19, 0xFF ; 255 2a6a2: 3d 83 std Y+5, r19 ; 0x05 2a6a4: 2c 83 std Y+4, r18 ; 0x04 2a6a6: 0b 2d mov r16, r11 2a6a8: 10 e0 ldi r17, 0x00 ; 0 2a6aa: 8c 81 ldd r24, Y+4 ; 0x04 2a6ac: 9d 81 ldd r25, Y+5 ; 0x05 2a6ae: 80 17 cp r24, r16 2a6b0: 91 07 cpc r25, r17 2a6b2: 0c f4 brge .+2 ; 0x2a6b6 2a6b4: a1 c0 rjmp .+322 ; 0x2a7f8 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 2a6b6: 2f 92 push r2 2a6b8: 3f 92 push r3 2a6ba: 4f 92 push r4 2a6bc: 5f 92 push r5 2a6be: b8 01 movw r22, r16 2a6c0: 01 2e mov r0, r17 2a6c2: 00 0c add r0, r0 2a6c4: 88 0b sbc r24, r24 2a6c6: 99 0b sbc r25, r25 2a6c8: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2a6cc: a7 01 movw r20, r14 2a6ce: 96 01 movw r18, r12 2a6d0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a6d4: 9b 01 movw r18, r22 2a6d6: ac 01 movw r20, r24 2a6d8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2a6dc: 9b 01 movw r18, r22 2a6de: ac 01 movw r20, r24 2a6e0: 60 e0 ldi r22, 0x00 ; 0 2a6e2: 70 e0 ldi r23, 0x00 ; 0 2a6e4: 8c e0 ldi r24, 0x0C ; 12 2a6e6: 92 e4 ldi r25, 0x42 ; 66 2a6e8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2a6ec: 9f 93 push r25 2a6ee: 8f 93 push r24 2a6f0: 7f 93 push r23 2a6f2: 6f 93 push r22 2a6f4: 1f 92 push r1 2a6f6: 96 e4 ldi r25, 0x46 ; 70 2a6f8: 9f 93 push r25 2a6fa: 2a ef ldi r18, 0xFA ; 250 2a6fc: 3a e9 ldi r19, 0x9A ; 154 2a6fe: 3f 93 push r19 2a700: 2f 93 push r18 2a702: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 2a706: b8 01 movw r22, r16 2a708: 66 0f add r22, r22 2a70a: 77 1f adc r23, r23 2a70c: 6f 5f subi r22, 0xFF ; 255 2a70e: 7f 4f sbci r23, 0xFF ; 255 2a710: 07 2e mov r0, r23 2a712: 00 0c add r0, r0 2a714: 88 0b sbc r24, r24 2a716: 99 0b sbc r25, r25 2a718: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2a71c: a7 01 movw r20, r14 2a71e: 96 01 movw r18, r12 2a720: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a724: 9b 01 movw r18, r22 2a726: ac 01 movw r20, r24 2a728: 60 e0 ldi r22, 0x00 ; 0 2a72a: 70 e0 ldi r23, 0x00 ; 0 2a72c: 8c e0 ldi r24, 0x0C ; 12 2a72e: 92 e4 ldi r25, 0x42 ; 66 2a730: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2a734: 96 2e mov r9, r22 2a736: 87 2e mov r8, r23 2a738: 78 2e mov r7, r24 2a73a: 69 2e mov r6, r25 2a73c: af 92 push r10 2a73e: 9b 81 ldd r25, Y+3 ; 0x03 2a740: 9f 93 push r25 2a742: 2a 81 ldd r18, Y+2 ; 0x02 2a744: 2f 93 push r18 2a746: 39 81 ldd r19, Y+1 ; 0x01 2a748: 3f 93 push r19 2a74a: 6f 92 push r6 2a74c: 7f 92 push r7 2a74e: 8f 92 push r8 2a750: 9f 92 push r9 2a752: 1f 92 push r1 2a754: 86 e4 ldi r24, 0x46 ; 70 2a756: 8f 93 push r24 2a758: 2a ef ldi r18, 0xFA ; 250 2a75a: 3a e9 ldi r19, 0x9A ; 154 2a75c: 3f 93 push r19 2a75e: 2f 93 push r18 2a760: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 2a764: 2f 92 push r2 2a766: 3f 92 push r3 2a768: 4f 92 push r4 2a76a: 5f 92 push r5 2a76c: 6f 92 push r6 2a76e: 7f 92 push r7 2a770: 8f 92 push r8 2a772: 9f 92 push r9 2a774: 1f 92 push r1 2a776: 92 e3 ldi r25, 0x32 ; 50 2a778: 9f 93 push r25 2a77a: 2a ef ldi r18, 0xFA ; 250 2a77c: 3a e9 ldi r19, 0x9A ; 154 2a77e: 3f 93 push r19 2a780: 2f 93 push r18 2a782: 0e 94 d0 7d call 0xfba0 ; 0xfba0 enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 2a786: 0f b6 in r0, 0x3f ; 63 2a788: f8 94 cli 2a78a: de bf out 0x3e, r29 ; 62 2a78c: 0f be out 0x3f, r0 ; 63 2a78e: cd bf out 0x3d, r28 ; 61 2a790: af 92 push r10 2a792: 3b 81 ldd r19, Y+3 ; 0x03 2a794: 3f 93 push r19 2a796: 8a 81 ldd r24, Y+2 ; 0x02 2a798: 8f 93 push r24 2a79a: 99 81 ldd r25, Y+1 ; 0x01 2a79c: 9f 93 push r25 2a79e: b8 01 movw r22, r16 2a7a0: 6f 5f subi r22, 0xFF ; 255 2a7a2: 7f 4f sbci r23, 0xFF ; 255 2a7a4: 07 2e mov r0, r23 2a7a6: 00 0c add r0, r0 2a7a8: 88 0b sbc r24, r24 2a7aa: 99 0b sbc r25, r25 2a7ac: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2a7b0: a7 01 movw r20, r14 2a7b2: 96 01 movw r18, r12 2a7b4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a7b8: 9b 01 movw r18, r22 2a7ba: ac 01 movw r20, r24 2a7bc: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2a7c0: 9b 01 movw r18, r22 2a7c2: ac 01 movw r20, r24 2a7c4: 60 e0 ldi r22, 0x00 ; 0 2a7c6: 70 e0 ldi r23, 0x00 ; 0 2a7c8: 8c e0 ldi r24, 0x0C ; 12 2a7ca: 92 e4 ldi r25, 0x42 ; 66 2a7cc: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2a7d0: 9f 93 push r25 2a7d2: 8f 93 push r24 2a7d4: 7f 93 push r23 2a7d6: 6f 93 push r22 2a7d8: 1f 92 push r1 2a7da: 22 e3 ldi r18, 0x32 ; 50 2a7dc: 2f 93 push r18 2a7de: 8a ef ldi r24, 0xFA ; 250 2a7e0: 9a e9 ldi r25, 0x9A ; 154 2a7e2: 9f 93 push r25 2a7e4: 8f 93 push r24 2a7e6: 0e 94 d0 7d call 0xfba0 ; 0xfba0 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) 2a7ea: b3 94 inc r11 2a7ec: 0f b6 in r0, 0x3f ; 63 2a7ee: f8 94 cli 2a7f0: de bf out 0x3e, r29 ; 62 2a7f2: 0f be out 0x3f, r0 ; 63 2a7f4: cd bf out 0x3d, r28 ; 61 2a7f6: 57 cf rjmp .-338 ; 0x2a6a6 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); } } 2a7f8: 0f 90 pop r0 2a7fa: 0f 90 pop r0 2a7fc: 0f 90 pop r0 2a7fe: 0f 90 pop r0 2a800: 0f 90 pop r0 2a802: df 91 pop r29 2a804: cf 91 pop r28 2a806: 1f 91 pop r17 2a808: 0f 91 pop r16 2a80a: ff 90 pop r15 2a80c: ef 90 pop r14 2a80e: df 90 pop r13 2a810: cf 90 pop r12 2a812: bf 90 pop r11 2a814: af 90 pop r10 2a816: 9f 90 pop r9 2a818: 8f 90 pop r8 2a81a: 7f 90 pop r7 2a81c: 6f 90 pop r6 2a81e: 5f 90 pop r5 2a820: 4f 90 pop r4 2a822: 3f 90 pop r3 2a824: 2f 90 pop r2 2a826: 08 95 ret 0002a828 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2a828: 9f b7 in r25, 0x3f ; 63 2a82a: 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)); 2a82c: 80 e1 ldi r24, 0x10 ; 16 2a82e: e6 ea ldi r30, 0xA6 ; 166 2a830: f6 e0 ldi r31, 0x06 ; 6 2a832: a6 eb ldi r26, 0xB6 ; 182 2a834: b6 e0 ldi r27, 0x06 ; 6 2a836: 01 90 ld r0, Z+ 2a838: 0d 92 st X+, r0 2a83a: 8a 95 dec r24 2a83c: e1 f7 brne .-8 ; 0x2a836 CRITICAL_SECTION_END; 2a83e: 9f bf out 0x3f, r25 ; 63 } 2a840: 08 95 ret 0002a842 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2a842: 89 e0 ldi r24, 0x09 ; 9 2a844: 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])) 2a848: e7 e3 ldi r30, 0x37 ; 55 2a84a: fb e9 ldi r31, 0x9B ; 155 2a84c: 85 91 lpm r24, Z+ 2a84e: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2a850: 0e 94 3c 6d call 0xda78 ; 0xda78 2a854: 0c 94 5f e6 jmp 0x1ccbe ; 0x1ccbe 0002a858 : 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) { 2a858: 1f 93 push r17 2a85a: cf 93 push r28 2a85c: df 93 push r29 2a85e: ec 01 movw r28, r24 2a860: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2a862: 0f 94 14 22 call 0x24428 ; 0x24428 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))); 2a866: fe 01 movw r30, r28 2a868: 34 96 adiw r30, 0x04 ; 4 2a86a: 25 91 lpm r18, Z+ 2a86c: 35 91 lpm r19, Z+ 2a86e: 45 91 lpm r20, Z+ 2a870: 54 91 lpm r21, Z 2a872: fe 01 movw r30, r28 2a874: 65 91 lpm r22, Z+ 2a876: 75 91 lpm r23, Z+ 2a878: 85 91 lpm r24, Z+ 2a87a: 94 91 lpm r25, Z 2a87c: 0f 94 a3 87 call 0x30f46 ; 0x30f46 step++; 2a880: 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) { 2a882: 11 50 subi r17, 0x01 ; 1 2a884: 81 f7 brne .-32 ; 0x2a866 2a886: 0f 94 14 22 call 0x24428 ; 0x24428 // 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(); } 2a88a: df 91 pop r29 2a88c: cf 91 pop r28 2a88e: 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(); 2a890: 0d 94 a1 87 jmp 0x30f42 ; 0x30f42 0002a894 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2a894: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 2a898: 81 11 cpse r24, r1 2a89a: 04 c0 rjmp .+8 ; 0x2a8a4 lcd_setstatuspgm(MSG_WELCOME); 2a89c: 8b e0 ldi r24, 0x0B ; 11 2a89e: 9c e6 ldi r25, 0x6C ; 108 2a8a0: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe } custom_message_type = CustomMsg::Status; 2a8a4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 2a8a8: 08 95 ret 0002a8aa : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2a8aa: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2a8ae: 88 23 and r24, r24 2a8b0: 11 f0 breq .+4 ; 0x2a8b6 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; 2a8b2: 81 e0 ldi r24, 0x01 ; 1 2a8b4: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2a8b6: 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; } } 2a8b8: 08 95 ret 0002a8ba : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2a8ba: 2f 92 push r2 2a8bc: 3f 92 push r3 2a8be: 4f 92 push r4 2a8c0: 5f 92 push r5 2a8c2: 6f 92 push r6 2a8c4: 7f 92 push r7 2a8c6: 8f 92 push r8 2a8c8: 9f 92 push r9 2a8ca: af 92 push r10 2a8cc: bf 92 push r11 2a8ce: cf 92 push r12 2a8d0: df 92 push r13 2a8d2: ef 92 push r14 2a8d4: ff 92 push r15 2a8d6: 0f 93 push r16 2a8d8: 1f 93 push r17 2a8da: cf 93 push r28 2a8dc: df 93 push r29 2a8de: 00 d0 rcall .+0 ; 0x2a8e0 2a8e0: 00 d0 rcall .+0 ; 0x2a8e2 2a8e2: 00 d0 rcall .+0 ; 0x2a8e4 2a8e4: 1f 92 push r1 2a8e6: 1f 92 push r1 2a8e8: cd b7 in r28, 0x3d ; 61 2a8ea: de b7 in r29, 0x3e ; 62 2a8ec: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a8ee: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 2a8f2: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2a8f4: 81 e0 ldi r24, 0x01 ; 1 2a8f6: 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) 2a8fa: 9b 81 ldd r25, Y+3 ; 0x03 2a8fc: 92 30 cpi r25, 0x02 ; 2 2a8fe: 09 f4 brne .+2 ; 0x2a902 2a900: 5b c1 rjmp .+694 ; 0x2abb8 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); 2a902: a9 2f mov r26, r25 2a904: b0 e0 ldi r27, 0x00 ; 0 2a906: ba 83 std Y+2, r27 ; 0x02 2a908: a9 83 std Y+1, r26 ; 0x01 2a90a: fd 01 movw r30, r26 2a90c: ef 50 subi r30, 0x0F ; 15 2a90e: 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); 2a910: 24 91 lpm r18, Z 2a912: 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]; 2a914: 8d 01 movw r16, r26 2a916: 00 0f add r16, r16 2a918: 11 1f adc r17, r17 2a91a: 00 0f add r16, r16 2a91c: 11 1f adc r17, r17 2a91e: f8 01 movw r30, r16 2a920: ed 50 subi r30, 0x0D ; 13 2a922: fd 4f sbci r31, 0xFD ; 253 2a924: 40 80 ld r4, Z 2a926: 51 80 ldd r5, Z+1 ; 0x01 2a928: 62 80 ldd r6, Z+2 ; 0x02 2a92a: 73 80 ldd r7, Z+3 ; 0x03 2a92c: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2a930: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2a934: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2a938: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2a93c: c3 01 movw r24, r6 2a93e: b2 01 movw r22, r4 2a940: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 2a944: 4b 01 movw r8, r22 2a946: 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; 2a948: c8 01 movw r24, r16 2a94a: 8b 50 subi r24, 0x0B ; 11 2a94c: 9e 4e sbci r25, 0xEE ; 238 2a94e: 1c 01 movw r2, r24 2a950: dc 01 movw r26, r24 2a952: 1d 92 st X+, r1 2a954: 1d 92 st X+, r1 2a956: 1d 92 st X+, r1 2a958: 1c 92 st X, r1 2a95a: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2a95c: 0f 94 d1 83 call 0x307a2 ; 0x307a2 set_destination_to_current(); 2a960: 0e 94 c1 61 call 0xc382 ; 0xc382 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2a964: bc 81 ldd r27, Y+4 ; 0x04 2a966: 6b 2f mov r22, r27 2a968: bb 0f add r27, r27 2a96a: 77 0b sbc r23, r23 2a96c: 88 0b sbc r24, r24 2a96e: 99 0b sbc r25, r25 2a970: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2a974: 6b 01 movw r12, r22 2a976: 7c 01 movw r14, r24 2a978: f8 01 movw r30, r16 2a97a: ed 56 subi r30, 0x6D ; 109 2a97c: f9 4f sbci r31, 0xF9 ; 249 2a97e: fb 87 std Y+11, r31 ; 0x0b 2a980: ea 87 std Y+10, r30 ; 0x0a 2a982: 20 e0 ldi r18, 0x00 ; 0 2a984: 30 e0 ldi r19, 0x00 ; 0 2a986: 40 e4 ldi r20, 0x40 ; 64 2a988: 50 ec ldi r21, 0xC0 ; 192 2a98a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2a98e: aa 85 ldd r26, Y+10 ; 0x0a 2a990: bb 85 ldd r27, Y+11 ; 0x0b 2a992: 6d 93 st X+, r22 2a994: 7d 93 st X+, r23 2a996: 8d 93 st X+, r24 2a998: 9c 93 st X, r25 2a99a: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a99c: c5 01 movw r24, r10 2a99e: b4 01 movw r22, r8 2a9a0: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2a9a4: 0f 94 14 22 call 0x24428 ; 0x24428 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2a9a8: 0f 94 68 2c call 0x258d0 ; 0x258d0 2a9ac: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(false); current_position[axis] = 0; 2a9b0: f1 01 movw r30, r2 2a9b2: 10 82 st Z, r1 2a9b4: 11 82 std Z+1, r1 ; 0x01 2a9b6: 12 82 std Z+2, r1 ; 0x02 2a9b8: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2a9ba: 0f 94 d1 83 call 0x307a2 ; 0x307a2 destination[axis] = 1. * axis_home_dir; 2a9be: aa 85 ldd r26, Y+10 ; 0x0a 2a9c0: bb 85 ldd r27, Y+11 ; 0x0b 2a9c2: cd 92 st X+, r12 2a9c4: dd 92 st X+, r13 2a9c6: ed 92 st X+, r14 2a9c8: fc 92 st X, r15 2a9ca: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a9cc: c5 01 movw r24, r10 2a9ce: b4 01 movw r22, r8 2a9d0: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2a9d4: 0f 94 14 22 call 0x24428 ; 0x24428 2a9d8: b1 e0 ldi r27, 0x01 ; 1 2a9da: 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); 2a9de: f8 01 movw r30, r16 2a9e0: eb 51 subi r30, 0x1B ; 27 2a9e2: 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); 2a9e4: 85 91 lpm r24, Z+ 2a9e6: 95 91 lpm r25, Z+ 2a9e8: a5 91 lpm r26, Z+ 2a9ea: b4 91 lpm r27, Z 2a9ec: 8e 83 std Y+6, r24 ; 0x06 2a9ee: 9f 83 std Y+7, r25 ; 0x07 2a9f0: a8 87 std Y+8, r26 ; 0x08 2a9f2: 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); 2a9f4: 2d ec ldi r18, 0xCD ; 205 2a9f6: 3c ec ldi r19, 0xCC ; 204 2a9f8: 4c e8 ldi r20, 0x8C ; 140 2a9fa: 5f e3 ldi r21, 0x3F ; 63 2a9fc: c7 01 movw r24, r14 2a9fe: b6 01 movw r22, r12 2aa00: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aa04: 2e 81 ldd r18, Y+6 ; 0x06 2aa06: 3f 81 ldd r19, Y+7 ; 0x07 2aa08: 48 85 ldd r20, Y+8 ; 0x08 2aa0a: 59 85 ldd r21, Y+9 ; 0x09 2aa0c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aa10: aa 85 ldd r26, Y+10 ; 0x0a 2aa12: bb 85 ldd r27, Y+11 ; 0x0b 2aa14: 6d 93 st X+, r22 2aa16: 7d 93 st X+, r23 2aa18: 8d 93 st X+, r24 2aa1a: 9c 93 st X, r25 2aa1c: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aa1e: c5 01 movw r24, r10 2aa20: b4 01 movw r22, r8 2aa22: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2aa26: 0f 94 14 22 call 0x24428 ; 0x24428 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(); 2aa2a: 0f 94 68 2c call 0x258d0 ; 0x258d0 2aa2e: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.362> enable_endstops(false); current_position[axis] = 0; 2aa32: f1 01 movw r30, r2 2aa34: 10 82 st Z, r1 2aa36: 11 82 std Z+1, r1 ; 0x01 2aa38: 12 82 std Z+2, r1 ; 0x02 2aa3a: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2aa3c: 0f 94 d1 83 call 0x307a2 ; 0x307a2 destination[axis] = -10.f * axis_home_dir; 2aa40: 20 e0 ldi r18, 0x00 ; 0 2aa42: 30 e0 ldi r19, 0x00 ; 0 2aa44: 40 e2 ldi r20, 0x20 ; 32 2aa46: 51 ec ldi r21, 0xC1 ; 193 2aa48: c7 01 movw r24, r14 2aa4a: b6 01 movw r22, r12 2aa4c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aa50: aa 85 ldd r26, Y+10 ; 0x0a 2aa52: bb 85 ldd r27, Y+11 ; 0x0b 2aa54: 6d 93 st X+, r22 2aa56: 7d 93 st X+, r23 2aa58: 8d 93 st X+, r24 2aa5a: 9c 93 st X, r25 2aa5c: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aa5e: c5 01 movw r24, r10 2aa60: b4 01 movw r22, r8 2aa62: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2aa66: 0f 94 14 22 call 0x24428 ; 0x24428 endstops_hit_on_purpose(); 2aa6a: 0f 94 68 2c call 0x258d0 ; 0x258d0 2aa6e: b1 e0 ldi r27, 0x01 ; 1 2aa70: 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; 2aa74: 20 e0 ldi r18, 0x00 ; 0 2aa76: 30 e0 ldi r19, 0x00 ; 0 2aa78: 40 e3 ldi r20, 0x30 ; 48 2aa7a: 51 e4 ldi r21, 0x41 ; 65 2aa7c: c7 01 movw r24, r14 2aa7e: b6 01 movw r22, r12 2aa80: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aa84: ea 85 ldd r30, Y+10 ; 0x0a 2aa86: fb 85 ldd r31, Y+11 ; 0x0b 2aa88: 60 83 st Z, r22 2aa8a: 71 83 std Z+1, r23 ; 0x01 2aa8c: 82 83 std Z+2, r24 ; 0x02 2aa8e: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2aa90: 20 e0 ldi r18, 0x00 ; 0 2aa92: 30 e0 ldi r19, 0x00 ; 0 2aa94: 40 e0 ldi r20, 0x00 ; 0 2aa96: 5f e3 ldi r21, 0x3F ; 63 2aa98: c3 01 movw r24, r6 2aa9a: b2 01 movw r22, r4 2aa9c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aaa0: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2aaa4: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2aaa8: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2aaac: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2aab0: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 2aab4: 6b 01 movw r12, r22 2aab6: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aab8: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2aabc: 0f 94 14 22 call 0x24428 ; 0x24428 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(); 2aac0: 0f 94 68 2c call 0x258d0 ; 0x258d0 2aac4: 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); 2aac8: 8b 81 ldd r24, Y+3 ; 0x03 2aaca: 0e 94 a2 60 call 0xc144 ; 0xc144 axis_known_position[axis] = true; 2aace: e9 81 ldd r30, Y+1 ; 0x01 2aad0: fa 81 ldd r31, Y+2 ; 0x02 2aad2: ed 55 subi r30, 0x5D ; 93 2aad4: f9 4f sbci r31, 0xF9 ; 249 2aad6: 21 e0 ldi r18, 0x01 ; 1 2aad8: 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; 2aada: 8c 81 ldd r24, Y+4 ; 0x04 2aadc: 99 27 eor r25, r25 2aade: 81 95 neg r24 2aae0: 0c f4 brge .+2 ; 0x2aae4 2aae2: 90 95 com r25 2aae4: bc 01 movw r22, r24 2aae6: 07 2e mov r0, r23 2aae8: 00 0c add r0, r0 2aaea: 88 0b sbc r24, r24 2aaec: 99 0b sbc r25, r25 2aaee: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2aaf2: 2a e0 ldi r18, 0x0A ; 10 2aaf4: 37 ed ldi r19, 0xD7 ; 215 2aaf6: 43 e2 ldi r20, 0x23 ; 35 2aaf8: 5c e3 ldi r21, 0x3C ; 60 2aafa: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2aafe: 20 e0 ldi r18, 0x00 ; 0 2ab00: 30 e0 ldi r19, 0x00 ; 0 2ab02: 40 e8 ldi r20, 0x80 ; 128 2ab04: 52 e4 ldi r21, 0x42 ; 66 2ab06: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ab0a: 4b 01 movw r8, r22 2ab0c: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2ab0e: ac 01 movw r20, r24 2ab10: 9b 01 movw r18, r22 2ab12: d1 01 movw r26, r2 2ab14: 6d 91 ld r22, X+ 2ab16: 7d 91 ld r23, X+ 2ab18: 8d 91 ld r24, X+ 2ab1a: 9c 91 ld r25, X 2ab1c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2ab20: f1 01 movw r30, r2 2ab22: 60 83 st Z, r22 2ab24: 71 83 std Z+1, r23 ; 0x01 2ab26: 82 83 std Z+2, r24 ; 0x02 2ab28: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2ab2a: 0f 94 d1 83 call 0x307a2 ; 0x307a2 current_position[axis] += dist; 2ab2e: d1 01 movw r26, r2 2ab30: 2d 91 ld r18, X+ 2ab32: 3d 91 ld r19, X+ 2ab34: 4d 91 ld r20, X+ 2ab36: 5c 91 ld r21, X 2ab38: c5 01 movw r24, r10 2ab3a: b4 01 movw r22, r8 2ab3c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2ab40: f1 01 movw r30, r2 2ab42: 60 83 st Z, r22 2ab44: 71 83 std Z+1, r23 ; 0x01 2ab46: 82 83 std Z+2, r24 ; 0x02 2ab48: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2ab4a: aa 85 ldd r26, Y+10 ; 0x0a 2ab4c: bb 85 ldd r27, Y+11 ; 0x0b 2ab4e: 6d 93 st X+, r22 2ab50: 7d 93 st X+, r23 2ab52: 8d 93 st X+, r24 2ab54: 9c 93 st X, r25 2ab56: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2ab58: 20 e0 ldi r18, 0x00 ; 0 2ab5a: 30 e0 ldi r19, 0x00 ; 0 2ab5c: 40 e0 ldi r20, 0x00 ; 0 2ab5e: 5f e3 ldi r21, 0x3F ; 63 2ab60: c7 01 movw r24, r14 2ab62: b6 01 movw r22, r12 2ab64: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ab68: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2ab6c: 0f 94 14 22 call 0x24428 ; 0x24428 feedrate = 0.0; 2ab70: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2ab74: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2ab78: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2ab7c: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2ab80: 2d 81 ldd r18, Y+5 ; 0x05 2ab82: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.362> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2ab86: 2b 96 adiw r28, 0x0b ; 11 2ab88: 0f b6 in r0, 0x3f ; 63 2ab8a: f8 94 cli 2ab8c: de bf out 0x3e, r29 ; 62 2ab8e: 0f be out 0x3f, r0 ; 63 2ab90: cd bf out 0x3d, r28 ; 61 2ab92: df 91 pop r29 2ab94: cf 91 pop r28 2ab96: 1f 91 pop r17 2ab98: 0f 91 pop r16 2ab9a: ff 90 pop r15 2ab9c: ef 90 pop r14 2ab9e: df 90 pop r13 2aba0: cf 90 pop r12 2aba2: bf 90 pop r11 2aba4: af 90 pop r10 2aba6: 9f 90 pop r9 2aba8: 8f 90 pop r8 2abaa: 7f 90 pop r7 2abac: 6f 90 pop r6 2abae: 5f 90 pop r5 2abb0: 4f 90 pop r4 2abb2: 3f 90 pop r3 2abb4: 2f 90 pop r2 2abb6: 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); 2abb8: e3 ef ldi r30, 0xF3 ; 243 2abba: f9 e9 ldi r31, 0x99 ; 153 2abbc: b4 91 lpm r27, Z 2abbe: 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; 2abc0: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2abc4: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2abc8: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2abcc: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2abd0: 0f 94 d1 83 call 0x307a2 ; 0x307a2 #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); 2abd4: ed ee ldi r30, 0xED ; 237 2abd6: f9 e9 ldi r31, 0x99 ; 153 2abd8: 85 90 lpm r8, Z+ 2abda: 95 90 lpm r9, Z+ 2abdc: a5 90 lpm r10, Z+ 2abde: 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; 2abe0: e9 81 ldd r30, Y+1 ; 0x01 2abe2: 6e 2f mov r22, r30 2abe4: ee 0f add r30, r30 2abe6: 77 0b sbc r23, r23 2abe8: 88 0b sbc r24, r24 2abea: 99 0b sbc r25, r25 2abec: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2abf0: 6b 01 movw r12, r22 2abf2: 7c 01 movw r14, r24 2abf4: 20 e0 ldi r18, 0x00 ; 0 2abf6: 30 e0 ldi r19, 0x00 ; 0 2abf8: 40 ec ldi r20, 0xC0 ; 192 2abfa: 5f e3 ldi r21, 0x3F ; 63 2abfc: c5 01 movw r24, r10 2abfe: b4 01 movw r22, r8 2ac00: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ac04: a7 01 movw r20, r14 2ac06: 96 01 movw r18, r12 2ac08: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ac0c: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ac10: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ac14: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ac18: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis]; 2ac1c: 80 e0 ldi r24, 0x00 ; 0 2ac1e: 90 e0 ldi r25, 0x00 ; 0 2ac20: a8 e4 ldi r26, 0x48 ; 72 2ac22: b4 e4 ldi r27, 0x44 ; 68 2ac24: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ac28: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2ac2c: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2ac30: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ac34: bc 01 movw r22, r24 2ac36: cd 01 movw r24, r26 2ac38: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 2ac3c: 4b 01 movw r8, r22 2ac3e: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ac40: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2ac44: 0f 94 14 22 call 0x24428 ; 0x24428 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2ac48: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2ac4c: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2ac50: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2ac54: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2ac58: 0f 94 d1 83 call 0x307a2 ; 0x307a2 #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); 2ac5c: 01 ee ldi r16, 0xE1 ; 225 2ac5e: 19 e9 ldi r17, 0x99 ; 153 2ac60: f8 01 movw r30, r16 2ac62: 65 91 lpm r22, Z+ 2ac64: 75 91 lpm r23, Z+ 2ac66: 85 91 lpm r24, Z+ 2ac68: 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; 2ac6a: 90 58 subi r25, 0x80 ; 128 2ac6c: a7 01 movw r20, r14 2ac6e: 96 01 movw r18, r12 2ac70: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ac74: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ac78: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ac7c: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ac80: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ac84: c5 01 movw r24, r10 2ac86: b4 01 movw r22, r8 2ac88: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2ac8c: 0f 94 14 22 call 0x24428 ; 0x24428 #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); 2ac90: f8 01 movw r30, r16 2ac92: 65 91 lpm r22, Z+ 2ac94: 75 91 lpm r23, Z+ 2ac96: 85 91 lpm r24, Z+ 2ac98: 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; 2ac9a: 9b 01 movw r18, r22 2ac9c: ac 01 movw r20, r24 2ac9e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2aca2: a7 01 movw r20, r14 2aca4: 96 01 movw r18, r12 2aca6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2acaa: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2acae: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2acb2: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2acb6: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis] / 2; 2acba: 80 e0 ldi r24, 0x00 ; 0 2acbc: 90 e0 ldi r25, 0x00 ; 0 2acbe: a8 ec ldi r26, 0xC8 ; 200 2acc0: b3 e4 ldi r27, 0x43 ; 67 2acc2: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2acc6: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2acca: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2acce: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2acd2: bc 01 movw r22, r24 2acd4: cd 01 movw r24, r26 2acd6: 0e 94 58 60 call 0xc0b0 ; 0xc0b0 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2acda: 0f 94 de 84 call 0x309bc ; 0x309bc st_synchronize(); 2acde: 0f 94 14 22 call 0x24428 ; 0x24428 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2ace2: 82 e0 ldi r24, 0x02 ; 2 2ace4: 0e 94 a2 60 call 0xc144 ; 0xc144 destination[axis] = current_position[axis]; 2ace8: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 2acec: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 2acf0: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 2acf4: b0 91 00 12 lds r27, 0x1200 ; 0x801200 2acf8: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2acfc: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 2ad00: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 2ad04: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e feedrate = 0.0; 2ad08: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2ad0c: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2ad10: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2ad14: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2ad18: 0f 94 68 2c call 0x258d0 ; 0x258d0 axis_known_position[axis] = true; 2ad1c: f1 e0 ldi r31, 0x01 ; 1 2ad1e: f0 93 a5 06 sts 0x06A5, r31 ; 0x8006a5 2ad22: 2e cf rjmp .-420 ; 0x2ab80 0002ad24 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2ad24: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c memset(z_values, 0, sizeof(z_values)); 2ad28: ed e9 ldi r30, 0x9D ; 157 2ad2a: f2 e1 ldi r31, 0x12 ; 18 2ad2c: 84 ec ldi r24, 0xC4 ; 196 2ad2e: df 01 movw r26, r30 2ad30: 1d 92 st X+, r1 2ad32: 8a 95 dec r24 2ad34: e9 f7 brne .-6 ; 0x2ad30 } 2ad36: 08 95 ret 0002ad38 : 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 2ad38: 2f 92 push r2 2ad3a: 3f 92 push r3 2ad3c: 4f 92 push r4 2ad3e: 5f 92 push r5 2ad40: 6f 92 push r6 2ad42: 7f 92 push r7 2ad44: 8f 92 push r8 2ad46: 9f 92 push r9 2ad48: af 92 push r10 2ad4a: bf 92 push r11 2ad4c: cf 92 push r12 2ad4e: df 92 push r13 2ad50: ef 92 push r14 2ad52: ff 92 push r15 2ad54: 0f 93 push r16 2ad56: 1f 93 push r17 2ad58: cf 93 push r28 2ad5a: df 93 push r29 2ad5c: 00 d0 rcall .+0 ; 0x2ad5e 2ad5e: cd b7 in r28, 0x3d ; 61 2ad60: de b7 in r29, 0x3e ; 62 2ad62: 4b 01 movw r8, r22 2ad64: 5c 01 movw r10, r24 2ad66: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2ad68: 81 e0 ldi r24, 0x01 ; 1 2ad6a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2ad6e: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 2ad72: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2ad74: 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); 2ad78: 80 e0 ldi r24, 0x00 ; 0 2ad7a: 0f 94 4c 2c call 0x25898 ; 0x25898 2ad7e: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2ad80: 0f 94 5a 2c call 0x258b4 ; 0x258b4 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2ad84: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ad88: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ad8c: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ad90: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 2ad94: 65 e5 ldi r22, 0x55 ; 85 2ad96: 75 e5 ldi r23, 0x55 ; 85 2ad98: 85 e5 ldi r24, 0x55 ; 85 2ad9a: 91 e4 ldi r25, 0x41 ; 65 2ad9c: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // 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(); 2ada0: 0f 94 f1 8d call 0x31be2 ; 0x31be2 if (! endstop_z_hit_on_purpose()) 2ada4: 0f 94 5a 2c call 0x258b4 ; 0x258b4 2ada8: 8b 83 std Y+3, r24 ; 0x03 2adaa: 88 23 and r24, r24 2adac: 09 f4 brne .+2 ; 0x2adb0 2adae: eb c0 rjmp .+470 ; 0x2af86 { //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) 2adb0: 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; 2adb2: c1 2c mov r12, r1 2adb4: d1 2c mov r13, r1 2adb6: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2adb8: 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) 2adba: 8a 81 ldd r24, Y+2 ; 0x02 2adbc: 80 17 cp r24, r16 2adbe: 08 f0 brcs .+2 ; 0x2adc2 2adc0: a4 c0 rjmp .+328 ; 0x2af0a { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2adc2: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2adc6: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2adca: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2adce: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2add2: 20 e0 ldi r18, 0x00 ; 0 2add4: 30 e0 ldi r19, 0x00 ; 0 2add6: 40 e0 ldi r20, 0x00 ; 0 2add8: 5f e3 ldi r21, 0x3F ; 63 2adda: 31 10 cpse r3, r1 2addc: 04 c0 rjmp .+8 ; 0x2ade6 2adde: 2d ec ldi r18, 0xCD ; 205 2ade0: 3c ec ldi r19, 0xCC ; 204 2ade2: 4c e4 ldi r20, 0x4C ; 76 2ade4: 5e e3 ldi r21, 0x3E ; 62 2ade6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2adea: 2b 01 movw r4, r22 2adec: 3c 01 movw r6, r24 2adee: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 2adf2: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 2adf6: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 2adfa: 70 92 00 12 sts 0x1200, r7 ; 0x801200 float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2adfe: 65 e5 ldi r22, 0x55 ; 85 2ae00: 75 e5 ldi r23, 0x55 ; 85 2ae02: 85 e5 ldi r24, 0x55 ; 85 2ae04: 91 e4 ldi r25, 0x41 ; 65 2ae06: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2ae0a: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ae0e: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ae12: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ae16: 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)); 2ae1a: 65 e5 ldi r22, 0x55 ; 85 2ae1c: 75 e5 ldi r23, 0x55 ; 85 2ae1e: 85 e5 ldi r24, 0x55 ; 85 2ae20: 90 e4 ldi r25, 0x40 ; 64 2ae22: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // 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(); 2ae26: 0f 94 f1 8d call 0x31be2 ; 0x31be2 //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) { 2ae2a: a3 01 movw r20, r6 2ae2c: 92 01 movw r18, r4 2ae2e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2ae32: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2ae36: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2ae3a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2ae3e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2ae42: 9f 77 andi r25, 0x7F ; 127 2ae44: 2d ec ldi r18, 0xCD ; 205 2ae46: 3c ec ldi r19, 0xCC ; 204 2ae48: 4c ec ldi r20, 0xCC ; 204 2ae4a: 5c e3 ldi r21, 0x3C ; 60 2ae4c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2ae50: 87 ff sbrs r24, 7 2ae52: 16 c0 rjmp .+44 ; 0x2ae80 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2ae54: 60 e0 ldi r22, 0x00 ; 0 2ae56: 70 e0 ldi r23, 0x00 ; 0 2ae58: 80 e0 ldi r24, 0x00 ; 0 2ae5a: 9f e3 ldi r25, 0x3F ; 63 2ae5c: 0e 94 68 67 call 0xced0 ; 0xced0 current_position[Z_AXIS] = minimum_z; 2ae60: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ae64: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ae68: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ae6c: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2ae70: 65 e5 ldi r22, 0x55 ; 85 2ae72: 75 e5 ldi r23, 0x55 ; 85 2ae74: 85 e5 ldi r24, 0x55 ; 85 2ae76: 90 e4 ldi r25, 0x40 ; 64 2ae78: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // 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(); 2ae7c: 0f 94 f1 8d call 0x31be2 ; 0x31be2 } if (!endstop_z_hit_on_purpose()) 2ae80: 0f 94 5a 2c call 0x258b4 ; 0x258b4 2ae84: 28 2e mov r2, r24 2ae86: 88 23 and r24, r24 2ae88: 09 f4 brne .+2 ; 0x2ae8c 2ae8a: 7d c0 rjmp .+250 ; 0x2af86 2ae8c: 40 90 fd 11 lds r4, 0x11FD ; 0x8011fd 2ae90: 50 90 fe 11 lds r5, 0x11FE ; 0x8011fe 2ae94: 60 90 ff 11 lds r6, 0x11FF ; 0x8011ff 2ae98: 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; 2ae9c: 9a 81 ldd r25, Y+2 ; 0x02 2ae9e: 99 23 and r25, r25 2aea0: d9 f0 breq .+54 ; 0x2aed8 2aea2: 69 2f mov r22, r25 2aea4: 70 e0 ldi r23, 0x00 ; 0 2aea6: 90 e0 ldi r25, 0x00 ; 0 2aea8: 80 e0 ldi r24, 0x00 ; 0 2aeaa: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2aeae: 9b 01 movw r18, r22 2aeb0: ac 01 movw r20, r24 2aeb2: c7 01 movw r24, r14 2aeb4: b6 01 movw r22, r12 2aeb6: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2aeba: 9b 01 movw r18, r22 2aebc: ac 01 movw r20, r24 2aebe: c3 01 movw r24, r6 2aec0: b2 01 movw r22, r4 2aec2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2aec6: 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 2aec8: 2d ec ldi r18, 0xCD ; 205 2aeca: 3c ec ldi r19, 0xCC ; 204 2aecc: 4c e4 ldi r20, 0x4C ; 76 2aece: 5d e3 ldi r21, 0x3D ; 61 2aed0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2aed4: 18 16 cp r1, r24 2aed6: 64 f0 brlt .+24 ; 0x2aef0 #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]; 2aed8: a3 01 movw r20, r6 2aeda: 92 01 movw r18, r4 2aedc: c7 01 movw r24, r14 2aede: b6 01 movw r22, r12 2aee0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2aee4: 6b 01 movw r12, r22 2aee6: 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) 2aee8: 8a 81 ldd r24, Y+2 ; 0x02 2aeea: 8f 5f subi r24, 0xFF ; 255 2aeec: 8a 83 std Y+2, r24 ; 0x02 2aeee: 65 cf rjmp .-310 ; 0x2adba 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 2aef0: 31 10 cpse r3, r1 2aef2: 49 c0 rjmp .+146 ; 0x2af86 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2aef4: 84 ef ldi r24, 0xF4 ; 244 2aef6: 91 e0 ldi r25, 0x01 ; 1 2aef8: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 //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; 2aefc: 32 2c mov r3, r2 i = -1; 2aefe: 2f ef ldi r18, 0xFF ; 255 2af00: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2af02: c1 2c mov r12, r1 2af04: d1 2c mov r13, r1 2af06: 76 01 movw r14, r12 2af08: ef cf rjmp .-34 ; 0x2aee8 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2af0a: 02 30 cpi r16, 0x02 ; 2 2af0c: 38 f5 brcc .+78 ; 0x2af5c goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2af0e: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 2af12: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 2af16: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 2af1a: f0 92 00 12 sts 0x1200, r15 ; 0x801200 2af1e: 99 81 ldd r25, Y+1 ; 0x01 2af20: 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); 2af24: 81 2f mov r24, r17 2af26: 0f 94 4c 2c call 0x25898 ; 0x25898 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2af2a: 10 92 92 06 sts 0x0692, r1 ; 0x800692 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2af2e: 8b 81 ldd r24, Y+3 ; 0x03 2af30: 0f 90 pop r0 2af32: 0f 90 pop r0 2af34: 0f 90 pop r0 2af36: df 91 pop r29 2af38: cf 91 pop r28 2af3a: 1f 91 pop r17 2af3c: 0f 91 pop r16 2af3e: ff 90 pop r15 2af40: ef 90 pop r14 2af42: df 90 pop r13 2af44: cf 90 pop r12 2af46: bf 90 pop r11 2af48: af 90 pop r10 2af4a: 9f 90 pop r9 2af4c: 8f 90 pop r8 2af4e: 7f 90 pop r7 2af50: 6f 90 pop r6 2af52: 5f 90 pop r5 2af54: 4f 90 pop r4 2af56: 3f 90 pop r3 2af58: 2f 90 pop r2 2af5a: 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); 2af5c: 60 2f mov r22, r16 2af5e: 70 e0 ldi r23, 0x00 ; 0 2af60: 90 e0 ldi r25, 0x00 ; 0 2af62: 80 e0 ldi r24, 0x00 ; 0 2af64: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2af68: 9b 01 movw r18, r22 2af6a: ac 01 movw r20, r24 2af6c: c7 01 movw r24, r14 2af6e: b6 01 movw r22, r12 2af70: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2af74: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 2af78: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 2af7c: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 2af80: 90 93 00 12 sts 0x1200, r25 ; 0x801200 2af84: cc cf rjmp .-104 ; 0x2af1e 2af86: 29 81 ldd r18, Y+1 ; 0x01 2af88: 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); 2af8c: 81 2f mov r24, r17 2af8e: 0f 94 4c 2c call 0x25898 ; 0x25898 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2af92: 10 92 92 06 sts 0x0692, r1 ; 0x800692 return false; 2af96: 1b 82 std Y+3, r1 ; 0x03 2af98: ca cf rjmp .-108 ; 0x2af2e 0002af9a : /// 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){ 2af9a: 2f 92 push r2 2af9c: 3f 92 push r3 2af9e: 4f 92 push r4 2afa0: 5f 92 push r5 2afa2: 6f 92 push r6 2afa4: 7f 92 push r7 2afa6: 8f 92 push r8 2afa8: 9f 92 push r9 2afaa: af 92 push r10 2afac: bf 92 push r11 2afae: cf 92 push r12 2afb0: df 92 push r13 2afb2: ef 92 push r14 2afb4: ff 92 push r15 2afb6: 0f 93 push r16 2afb8: 1f 93 push r17 2afba: cf 93 push r28 2afbc: df 93 push r29 2afbe: cd b7 in r28, 0x3d ; 61 2afc0: de b7 in r29, 0x3e ; 62 2afc2: cd 5b subi r28, 0xBD ; 189 2afc4: d1 40 sbci r29, 0x01 ; 1 2afc6: 0f b6 in r0, 0x3f ; 63 2afc8: f8 94 cli 2afca: de bf out 0x3e, r29 ; 62 2afcc: 0f be out 0x3f, r0 ; 63 2afce: cd bf out 0x3d, r28 ; 61 2afd0: c3 57 subi r28, 0x73 ; 115 2afd2: de 4f sbci r29, 0xFE ; 254 2afd4: 99 83 std Y+1, r25 ; 0x01 2afd6: 88 83 st Y, r24 2afd8: cd 58 subi r28, 0x8D ; 141 2afda: d1 40 sbci r29, 0x01 ; 1 2afdc: c1 57 subi r28, 0x71 ; 113 2afde: de 4f sbci r29, 0xFE ; 254 2afe0: 79 83 std Y+1, r23 ; 0x01 2afe2: 68 83 st Y, r22 2afe4: cf 58 subi r28, 0x8F ; 143 2afe6: d1 40 sbci r29, 0x01 ; 1 2afe8: ce 56 subi r28, 0x6E ; 110 2afea: de 4f sbci r29, 0xFE ; 254 2afec: 59 83 std Y+1, r21 ; 0x01 2afee: 48 83 st Y, r20 2aff0: c2 59 subi r28, 0x92 ; 146 2aff2: d1 40 sbci r29, 0x01 ; 1 2aff4: 84 e1 ldi r24, 0x14 ; 20 2aff6: cf 56 subi r28, 0x6F ; 111 2aff8: de 4f sbci r29, 0xFE ; 254 2affa: 88 83 st Y, r24 2affc: c1 59 subi r28, 0x91 ; 145 2affe: 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; 2b000: ce 56 subi r28, 0x6E ; 110 2b002: de 4f sbci r29, 0xFE ; 254 2b004: a8 81 ld r26, Y 2b006: b9 81 ldd r27, Y+1 ; 0x01 2b008: c2 59 subi r28, 0x92 ; 146 2b00a: d1 40 sbci r29, 0x01 ; 1 2b00c: 8d 91 ld r24, X+ 2b00e: 9d 91 ld r25, X+ 2b010: 0d 90 ld r0, X+ 2b012: bc 91 ld r27, X 2b014: a0 2d mov r26, r0 2b016: c6 56 subi r28, 0x66 ; 102 2b018: de 4f sbci r29, 0xFE ; 254 2b01a: 88 83 st Y, r24 2b01c: 99 83 std Y+1, r25 ; 0x01 2b01e: aa 83 std Y+2, r26 ; 0x02 2b020: bb 83 std Y+3, r27 ; 0x03 2b022: ca 59 subi r28, 0x9A ; 154 2b024: d1 40 sbci r29, 0x01 ; 1 2b026: c1 57 subi r28, 0x71 ; 113 2b028: de 4f sbci r29, 0xFE ; 254 2b02a: a8 81 ld r26, Y 2b02c: b9 81 ldd r27, Y+1 ; 0x01 2b02e: cf 58 subi r28, 0x8F ; 143 2b030: d1 40 sbci r29, 0x01 ; 1 2b032: 8d 91 ld r24, X+ 2b034: 9d 91 ld r25, X+ 2b036: 0d 90 ld r0, X+ 2b038: bc 91 ld r27, X 2b03a: a0 2d mov r26, r0 2b03c: ca 54 subi r28, 0x4A ; 74 2b03e: de 4f sbci r29, 0xFE ; 254 2b040: 88 83 st Y, r24 2b042: 99 83 std Y+1, r25 ; 0x01 2b044: aa 83 std Y+2, r26 ; 0x02 2b046: bb 83 std Y+3, r27 ; 0x03 2b048: c6 5b subi r28, 0xB6 ; 182 2b04a: d1 40 sbci r29, 0x01 ; 1 2b04c: c3 57 subi r28, 0x73 ; 115 2b04e: de 4f sbci r29, 0xFE ; 254 2b050: a8 81 ld r26, Y 2b052: b9 81 ldd r27, Y+1 ; 0x01 2b054: cd 58 subi r28, 0x8D ; 141 2b056: d1 40 sbci r29, 0x01 ; 1 2b058: 8d 91 ld r24, X+ 2b05a: 9d 91 ld r25, X+ 2b05c: 0d 90 ld r0, X+ 2b05e: bc 91 ld r27, X 2b060: a0 2d mov r26, r0 2b062: c6 54 subi r28, 0x46 ; 70 2b064: de 4f sbci r29, 0xFE ; 254 2b066: 88 83 st Y, r24 2b068: 99 83 std Y+1, r25 ; 0x01 2b06a: aa 83 std Y+2, r26 ; 0x02 2b06c: bb 83 std Y+3, r27 ; 0x03 2b06e: ca 5b subi r28, 0xBA ; 186 2b070: d1 40 sbci r29, 0x01 ; 1 2b072: fe 01 movw r30, r28 2b074: e7 5f subi r30, 0xF7 ; 247 2b076: fe 4f sbci r31, 0xFE ; 254 2b078: c8 55 subi r28, 0x58 ; 88 2b07a: de 4f sbci r29, 0xFE ; 254 2b07c: f9 83 std Y+1, r31 ; 0x01 2b07e: e8 83 st Y, r30 2b080: c8 5a subi r28, 0xA8 ; 168 2b082: d1 40 sbci r29, 0x01 ; 1 2b084: ce 01 movw r24, r28 2b086: 8b 57 subi r24, 0x7B ; 123 2b088: 9f 4f sbci r25, 0xFF ; 255 2b08a: ca 55 subi r28, 0x5A ; 90 2b08c: de 4f sbci r29, 0xFE ; 254 2b08e: 99 83 std Y+1, r25 ; 0x01 2b090: 88 83 st Y, r24 2b092: c6 5a subi r28, 0xA6 ; 166 2b094: d1 40 sbci r29, 0x01 ; 1 2b096: de 01 movw r26, r28 2b098: 11 96 adiw r26, 0x01 ; 1 2b09a: c8 56 subi r28, 0x68 ; 104 2b09c: de 4f sbci r29, 0xFE ; 254 2b09e: b9 83 std Y+1, r27 ; 0x01 2b0a0: a8 83 st Y, r26 2b0a2: c8 59 subi r28, 0x98 ; 152 2b0a4: d1 40 sbci r29, 0x01 ; 1 2b0a6: 31 2c mov r3, r1 2b0a8: 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; 2b0aa: b1 01 movw r22, r2 2b0ac: 03 2c mov r0, r3 2b0ae: 00 0c add r0, r0 2b0b0: 88 0b sbc r24, r24 2b0b2: 99 0b sbc r25, r25 2b0b4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b0b8: 2a e1 ldi r18, 0x1A ; 26 2b0ba: 38 ef ldi r19, 0xF8 ; 248 2b0bc: 42 e4 ldi r20, 0x42 ; 66 2b0be: 5e e3 ldi r21, 0x3E ; 62 2b0c0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b0c4: 6b 01 movw r12, r22 2b0c6: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b0c8: 0f 94 65 a5 call 0x34aca ; 0x34aca 2b0cc: c2 56 subi r28, 0x62 ; 98 2b0ce: de 4f sbci r29, 0xFE ; 254 2b0d0: 68 83 st Y, r22 2b0d2: 79 83 std Y+1, r23 ; 0x01 2b0d4: 8a 83 std Y+2, r24 ; 0x02 2b0d6: 9b 83 std Y+3, r25 ; 0x03 2b0d8: ce 59 subi r28, 0x9E ; 158 2b0da: d1 40 sbci r29, 0x01 ; 1 2b0dc: c7 01 movw r24, r14 2b0de: b6 01 movw r22, r12 2b0e0: 0f 94 9f a2 call 0x3453e ; 0x3453e 2b0e4: ce 55 subi r28, 0x5E ; 94 2b0e6: de 4f sbci r29, 0xFE ; 254 2b0e8: 68 83 st Y, r22 2b0ea: 79 83 std Y+1, r23 ; 0x01 2b0ec: 8a 83 std Y+2, r24 ; 0x02 2b0ee: 9b 83 std Y+3, r25 ; 0x03 2b0f0: c2 5a subi r28, 0xA2 ; 162 2b0f2: d1 40 sbci r29, 0x01 ; 1 2b0f4: 9b 01 movw r18, r22 2b0f6: ac 01 movw r20, r24 2b0f8: c6 56 subi r28, 0x66 ; 102 2b0fa: de 4f sbci r29, 0xFE ; 254 2b0fc: 68 81 ld r22, Y 2b0fe: 79 81 ldd r23, Y+1 ; 0x01 2b100: 8a 81 ldd r24, Y+2 ; 0x02 2b102: 9b 81 ldd r25, Y+3 ; 0x03 2b104: ca 59 subi r28, 0x9A ; 154 2b106: d1 40 sbci r29, 0x01 ; 1 2b108: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b10c: c6 54 subi r28, 0x46 ; 70 2b10e: de 4f sbci r29, 0xFE ; 254 2b110: 28 81 ld r18, Y 2b112: 39 81 ldd r19, Y+1 ; 0x01 2b114: 4a 81 ldd r20, Y+2 ; 0x02 2b116: 5b 81 ldd r21, Y+3 ; 0x03 2b118: ca 5b subi r28, 0xBA ; 186 2b11a: d1 40 sbci r29, 0x01 ; 1 2b11c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b120: 6b 01 movw r12, r22 2b122: 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) 2b124: 20 e0 ldi r18, 0x00 ; 0 2b126: 30 e0 ldi r19, 0x00 ; 0 2b128: a9 01 movw r20, r18 2b12a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2b12e: 18 16 cp r1, r24 2b130: 0c f0 brlt .+2 ; 0x2b134 2b132: 7a c2 rjmp .+1268 ; 0x2b628 // 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; 2b134: c2 56 subi r28, 0x62 ; 98 2b136: de 4f sbci r29, 0xFE ; 254 2b138: 28 81 ld r18, Y 2b13a: 39 81 ldd r19, Y+1 ; 0x01 2b13c: 4a 81 ldd r20, Y+2 ; 0x02 2b13e: 5b 81 ldd r21, Y+3 ; 0x03 2b140: ce 59 subi r28, 0x9E ; 158 2b142: d1 40 sbci r29, 0x01 ; 1 2b144: c6 56 subi r28, 0x66 ; 102 2b146: de 4f sbci r29, 0xFE ; 254 2b148: 68 81 ld r22, Y 2b14a: 79 81 ldd r23, Y+1 ; 0x01 2b14c: 8a 81 ldd r24, Y+2 ; 0x02 2b14e: 9b 81 ldd r25, Y+3 ; 0x03 2b150: ca 59 subi r28, 0x9A ; 154 2b152: d1 40 sbci r29, 0x01 ; 1 2b154: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b158: ca 54 subi r28, 0x4A ; 74 2b15a: de 4f sbci r29, 0xFE ; 254 2b15c: 28 81 ld r18, Y 2b15e: 39 81 ldd r19, Y+1 ; 0x01 2b160: 4a 81 ldd r20, Y+2 ; 0x02 2b162: 5b 81 ldd r21, Y+3 ; 0x03 2b164: c6 5b subi r28, 0xB6 ; 182 2b166: d1 40 sbci r29, 0x01 ; 1 2b168: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b16c: 4b 01 movw r8, r22 2b16e: 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) 2b170: 20 e0 ldi r18, 0x00 ; 0 2b172: 30 e0 ldi r19, 0x00 ; 0 2b174: a9 01 movw r20, r18 2b176: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2b17a: 18 16 cp r1, r24 2b17c: 0c f0 brlt .+2 ; 0x2b180 2b17e: 54 c2 rjmp .+1192 ; 0x2b628 2b180: 20 e0 ldi r18, 0x00 ; 0 2b182: 30 e0 ldi r19, 0x00 ; 0 2b184: 48 ef ldi r20, 0xF8 ; 248 2b186: 51 e4 ldi r21, 0x41 ; 65 2b188: c7 01 movw r24, r14 2b18a: b6 01 movw r22, r12 2b18c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2b190: 87 ff sbrs r24, 7 2b192: 4a c2 rjmp .+1172 ; 0x2b628 2b194: 20 e0 ldi r18, 0x00 ; 0 2b196: 30 e0 ldi r19, 0x00 ; 0 2b198: 48 ef ldi r20, 0xF8 ; 248 2b19a: 51 e4 ldi r21, 0x41 ; 65 2b19c: c5 01 movw r24, r10 2b19e: b4 01 movw r22, r8 2b1a0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2b1a4: 87 ff sbrs r24, 7 2b1a6: 40 c2 rjmp .+1152 ; 0x2b628 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b1a8: c7 01 movw r24, r14 2b1aa: b6 01 movw r22, r12 2b1ac: 0f 94 4c a3 call 0x34698 ; 0x34698 2b1b0: 9b 01 movw r18, r22 2b1b2: ac 01 movw r20, r24 2b1b4: c7 01 movw r24, r14 2b1b6: b6 01 movw r22, r12 2b1b8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2b1bc: 2b 01 movw r4, r22 2b1be: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b1c0: c5 01 movw r24, r10 2b1c2: b4 01 movw r22, r8 2b1c4: 0f 94 4c a3 call 0x34698 ; 0x34698 2b1c8: 9b 01 movw r18, r22 2b1ca: ac 01 movw r20, r24 2b1cc: c5 01 movw r24, r10 2b1ce: b4 01 movw r22, r8 2b1d0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2b1d4: cc 56 subi r28, 0x6C ; 108 2b1d6: de 4f sbci r29, 0xFE ; 254 2b1d8: 68 83 st Y, r22 2b1da: 79 83 std Y+1, r23 ; 0x01 2b1dc: 8a 83 std Y+2, r24 ; 0x02 2b1de: 9b 83 std Y+3, r25 ; 0x03 2b1e0: c4 59 subi r28, 0x94 ; 148 2b1e2: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b1e4: a3 01 movw r20, r6 2b1e6: 92 01 movw r18, r4 2b1e8: 60 e0 ldi r22, 0x00 ; 0 2b1ea: 70 e0 ldi r23, 0x00 ; 0 2b1ec: 80 e8 ldi r24, 0x80 ; 128 2b1ee: 9f e3 ldi r25, 0x3F ; 63 2b1f0: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2b1f4: c2 55 subi r28, 0x52 ; 82 2b1f6: de 4f sbci r29, 0xFE ; 254 2b1f8: 68 83 st Y, r22 2b1fa: 79 83 std Y+1, r23 ; 0x01 2b1fc: 8a 83 std Y+2, r24 ; 0x02 2b1fe: 9b 83 std Y+3, r25 ; 0x03 2b200: ce 5a subi r28, 0xAE ; 174 2b202: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b204: cc 56 subi r28, 0x6C ; 108 2b206: de 4f sbci r29, 0xFE ; 254 2b208: 28 81 ld r18, Y 2b20a: 39 81 ldd r19, Y+1 ; 0x01 2b20c: 4a 81 ldd r20, Y+2 ; 0x02 2b20e: 5b 81 ldd r21, Y+3 ; 0x03 2b210: c4 59 subi r28, 0x94 ; 148 2b212: d1 40 sbci r29, 0x01 ; 1 2b214: 60 e0 ldi r22, 0x00 ; 0 2b216: 70 e0 ldi r23, 0x00 ; 0 2b218: 80 e8 ldi r24, 0x80 ; 128 2b21a: 9f e3 ldi r25, 0x3F ; 63 2b21c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2b220: ce 54 subi r28, 0x4E ; 78 2b222: de 4f sbci r29, 0xFE ; 254 2b224: 68 83 st Y, r22 2b226: 79 83 std Y+1, r23 ; 0x01 2b228: 8a 83 std Y+2, r24 ; 0x02 2b22a: 9b 83 std Y+3, r25 ; 0x03 2b22c: c2 5b subi r28, 0xB2 ; 178 2b22e: 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; 2b230: c7 01 movw r24, r14 2b232: b6 01 movw r22, r12 2b234: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2b238: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b23a: fb 01 movw r30, r22 2b23c: 31 96 adiw r30, 0x01 ; 1 2b23e: c6 55 subi r28, 0x56 ; 86 2b240: de 4f sbci r29, 0xFE ; 254 2b242: f9 83 std Y+1, r31 ; 0x01 2b244: e8 83 st Y, r30 2b246: ca 5a subi r28, 0xAA ; 170 2b248: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b24a: c5 01 movw r24, r10 2b24c: b4 01 movw r22, r8 2b24e: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b252: 8b 01 movw r16, r22 2b254: 95 e0 ldi r25, 0x05 ; 5 2b256: 00 0f add r16, r16 2b258: 11 1f adc r17, r17 2b25a: 9a 95 dec r25 2b25c: e1 f7 brne .-8 ; 0x2b256 const uint16_t idx01 = c0 + 32 * r1; 2b25e: c8 01 movw r24, r16 2b260: 80 96 adiw r24, 0x20 ; 32 2b262: c4 55 subi r28, 0x54 ; 84 2b264: de 4f sbci r29, 0xFE ; 254 2b266: 99 83 std Y+1, r25 ; 0x01 2b268: 88 83 st Y, r24 2b26a: cc 5a subi r28, 0xAC ; 172 2b26c: 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]; 2b26e: f8 01 movw r30, r16 2b270: ec 0d add r30, r12 2b272: fd 1d adc r31, r13 2b274: e8 53 subi r30, 0x38 ; 56 2b276: f9 4f sbci r31, 0xF9 ; 249 2b278: 60 81 ld r22, Z 2b27a: 70 e0 ldi r23, 0x00 ; 0 2b27c: 90 e0 ldi r25, 0x00 ; 0 2b27e: 80 e0 ldi r24, 0x00 ; 0 2b280: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b284: 4b 01 movw r8, r22 2b286: 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; 2b288: ce 54 subi r28, 0x4E ; 78 2b28a: de 4f sbci r29, 0xFE ; 254 2b28c: 28 81 ld r18, Y 2b28e: 39 81 ldd r19, Y+1 ; 0x01 2b290: 4a 81 ldd r20, Y+2 ; 0x02 2b292: 5b 81 ldd r21, Y+3 ; 0x03 2b294: c2 5b subi r28, 0xB2 ; 178 2b296: d1 40 sbci r29, 0x01 ; 1 2b298: c2 55 subi r28, 0x52 ; 82 2b29a: de 4f sbci r29, 0xFE ; 254 2b29c: 68 81 ld r22, Y 2b29e: 79 81 ldd r23, Y+1 ; 0x01 2b2a0: 8a 81 ldd r24, Y+2 ; 0x02 2b2a2: 9b 81 ldd r25, Y+3 ; 0x03 2b2a4: ce 5a subi r28, 0xAE ; 174 2b2a6: d1 40 sbci r29, 0x01 ; 1 2b2a8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b2ac: 9b 01 movw r18, r22 2b2ae: 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]; 2b2b0: c5 01 movw r24, r10 2b2b2: b4 01 movw r22, r8 2b2b4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b2b8: 4b 01 movw r8, r22 2b2ba: 5c 01 movw r10, r24 2b2bc: c4 55 subi r28, 0x54 ; 84 2b2be: de 4f sbci r29, 0xFE ; 254 2b2c0: e8 81 ld r30, Y 2b2c2: f9 81 ldd r31, Y+1 ; 0x01 2b2c4: cc 5a subi r28, 0xAC ; 172 2b2c6: d1 40 sbci r29, 0x01 ; 1 2b2c8: ec 0d add r30, r12 2b2ca: fd 1d adc r31, r13 2b2cc: e8 53 subi r30, 0x38 ; 56 2b2ce: f9 4f sbci r31, 0xF9 ; 249 2b2d0: 60 81 ld r22, Z 2b2d2: 70 e0 ldi r23, 0x00 ; 0 2b2d4: 90 e0 ldi r25, 0x00 ; 0 2b2d6: 80 e0 ldi r24, 0x00 ; 0 2b2d8: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b2dc: 6b 01 movw r12, r22 2b2de: 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; 2b2e0: c2 55 subi r28, 0x52 ; 82 2b2e2: de 4f sbci r29, 0xFE ; 254 2b2e4: 28 81 ld r18, Y 2b2e6: 39 81 ldd r19, Y+1 ; 0x01 2b2e8: 4a 81 ldd r20, Y+2 ; 0x02 2b2ea: 5b 81 ldd r21, Y+3 ; 0x03 2b2ec: ce 5a subi r28, 0xAE ; 174 2b2ee: d1 40 sbci r29, 0x01 ; 1 2b2f0: cc 56 subi r28, 0x6C ; 108 2b2f2: de 4f sbci r29, 0xFE ; 254 2b2f4: 68 81 ld r22, Y 2b2f6: 79 81 ldd r23, Y+1 ; 0x01 2b2f8: 8a 81 ldd r24, Y+2 ; 0x02 2b2fa: 9b 81 ldd r25, Y+3 ; 0x03 2b2fc: c4 59 subi r28, 0x94 ; 148 2b2fe: d1 40 sbci r29, 0x01 ; 1 2b300: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b304: 9b 01 movw r18, r22 2b306: 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]; 2b308: c7 01 movw r24, r14 2b30a: b6 01 movw r22, r12 2b30c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b310: 9b 01 movw r18, r22 2b312: ac 01 movw r20, r24 2b314: c5 01 movw r24, r10 2b316: b4 01 movw r22, r8 2b318: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b31c: 6b 01 movw r12, r22 2b31e: 7c 01 movw r14, r24 2b320: c6 55 subi r28, 0x56 ; 86 2b322: de 4f sbci r29, 0xFE ; 254 2b324: a8 81 ld r26, Y 2b326: b9 81 ldd r27, Y+1 ; 0x01 2b328: ca 5a subi r28, 0xAA ; 170 2b32a: d1 40 sbci r29, 0x01 ; 1 2b32c: 0a 0f add r16, r26 2b32e: 1b 1f adc r17, r27 2b330: f8 01 movw r30, r16 2b332: e8 53 subi r30, 0x38 ; 56 2b334: f9 4f sbci r31, 0xF9 ; 249 2b336: 60 81 ld r22, Z 2b338: 70 e0 ldi r23, 0x00 ; 0 2b33a: 90 e0 ldi r25, 0x00 ; 0 2b33c: 80 e0 ldi r24, 0x00 ; 0 2b33e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b342: 4b 01 movw r8, r22 2b344: 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; 2b346: ce 54 subi r28, 0x4E ; 78 2b348: de 4f sbci r29, 0xFE ; 254 2b34a: 28 81 ld r18, Y 2b34c: 39 81 ldd r19, Y+1 ; 0x01 2b34e: 4a 81 ldd r20, Y+2 ; 0x02 2b350: 5b 81 ldd r21, Y+3 ; 0x03 2b352: c2 5b subi r28, 0xB2 ; 178 2b354: d1 40 sbci r29, 0x01 ; 1 2b356: c3 01 movw r24, r6 2b358: b2 01 movw r22, r4 2b35a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b35e: 9b 01 movw r18, r22 2b360: 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]; 2b362: c5 01 movw r24, r10 2b364: b4 01 movw r22, r8 2b366: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b36a: 9b 01 movw r18, r22 2b36c: ac 01 movw r20, r24 2b36e: c7 01 movw r24, r14 2b370: b6 01 movw r22, r12 2b372: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b376: 6b 01 movw r12, r22 2b378: 7c 01 movw r14, r24 2b37a: c6 55 subi r28, 0x56 ; 86 2b37c: de 4f sbci r29, 0xFE ; 254 2b37e: e8 81 ld r30, Y 2b380: f9 81 ldd r31, Y+1 ; 0x01 2b382: ca 5a subi r28, 0xAA ; 170 2b384: d1 40 sbci r29, 0x01 ; 1 2b386: c4 55 subi r28, 0x54 ; 84 2b388: de 4f sbci r29, 0xFE ; 254 2b38a: 88 81 ld r24, Y 2b38c: 99 81 ldd r25, Y+1 ; 0x01 2b38e: cc 5a subi r28, 0xAC ; 172 2b390: d1 40 sbci r29, 0x01 ; 1 2b392: e8 0f add r30, r24 2b394: f9 1f adc r31, r25 2b396: e8 53 subi r30, 0x38 ; 56 2b398: f9 4f sbci r31, 0xF9 ; 249 2b39a: 60 81 ld r22, Z 2b39c: 70 e0 ldi r23, 0x00 ; 0 2b39e: 90 e0 ldi r25, 0x00 ; 0 2b3a0: 80 e0 ldi r24, 0x00 ; 0 2b3a2: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b3a6: 4b 01 movw r8, r22 2b3a8: 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; 2b3aa: cc 56 subi r28, 0x6C ; 108 2b3ac: de 4f sbci r29, 0xFE ; 254 2b3ae: 28 81 ld r18, Y 2b3b0: 39 81 ldd r19, Y+1 ; 0x01 2b3b2: 4a 81 ldd r20, Y+2 ; 0x02 2b3b4: 5b 81 ldd r21, Y+3 ; 0x03 2b3b6: c4 59 subi r28, 0x94 ; 148 2b3b8: d1 40 sbci r29, 0x01 ; 1 2b3ba: c3 01 movw r24, r6 2b3bc: b2 01 movw r22, r4 2b3be: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b3c2: 9b 01 movw r18, r22 2b3c4: 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]; 2b3c6: c5 01 movw r24, r10 2b3c8: b4 01 movw r22, r8 2b3ca: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b3ce: 9b 01 movw r18, r22 2b3d0: ac 01 movw r20, r24 2b3d2: c7 01 movw r24, r14 2b3d4: b6 01 movw r22, r12 2b3d6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__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; 2b3da: 20 e0 ldi r18, 0x00 ; 0 2b3dc: 30 e0 ldi r19, 0x00 ; 0 2b3de: 40 e0 ldi r20, 0x00 ; 0 2b3e0: 52 e4 ldi r21, 0x42 ; 66 2b3e2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2b3e6: 6b 01 movw r12, r22 2b3e8: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2b3ea: ac 01 movw r20, r24 2b3ec: 9b 01 movw r18, r22 2b3ee: ce 55 subi r28, 0x5E ; 94 2b3f0: de 4f sbci r29, 0xFE ; 254 2b3f2: 68 81 ld r22, Y 2b3f4: 79 81 ldd r23, Y+1 ; 0x01 2b3f6: 8a 81 ldd r24, Y+2 ; 0x02 2b3f8: 9b 81 ldd r25, Y+3 ; 0x03 2b3fa: c2 5a subi r28, 0xA2 ; 162 2b3fc: d1 40 sbci r29, 0x01 ; 1 2b3fe: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b402: c8 55 subi r28, 0x58 ; 88 2b404: de 4f sbci r29, 0xFE ; 254 2b406: a8 81 ld r26, Y 2b408: b9 81 ldd r27, Y+1 ; 0x01 2b40a: c8 5a subi r28, 0xA8 ; 168 2b40c: d1 40 sbci r29, 0x01 ; 1 2b40e: 6d 93 st X+, r22 2b410: 7d 93 st X+, r23 2b412: 8d 93 st X+, r24 2b414: 9d 93 st X+, r25 2b416: c8 55 subi r28, 0x58 ; 88 2b418: de 4f sbci r29, 0xFE ; 254 2b41a: b9 83 std Y+1, r27 ; 0x01 2b41c: a8 83 st Y, r26 2b41e: c8 5a subi r28, 0xA8 ; 168 2b420: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2b422: a7 01 movw r20, r14 2b424: 96 01 movw r18, r12 2b426: c2 56 subi r28, 0x62 ; 98 2b428: de 4f sbci r29, 0xFE ; 254 2b42a: 68 81 ld r22, Y 2b42c: 79 81 ldd r23, Y+1 ; 0x01 2b42e: 8a 81 ldd r24, Y+2 ; 0x02 2b430: 9b 81 ldd r25, Y+3 ; 0x03 2b432: ce 59 subi r28, 0x9E ; 158 2b434: d1 40 sbci r29, 0x01 ; 1 2b436: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2b43a: ca 55 subi r28, 0x5A ; 90 2b43c: de 4f sbci r29, 0xFE ; 254 2b43e: e8 81 ld r30, Y 2b440: f9 81 ldd r31, Y+1 ; 0x01 2b442: c6 5a subi r28, 0xA6 ; 166 2b444: d1 40 sbci r29, 0x01 ; 1 2b446: 61 93 st Z+, r22 2b448: 71 93 st Z+, r23 2b44a: 81 93 st Z+, r24 2b44c: 91 93 st Z+, r25 2b44e: ca 55 subi r28, 0x5A ; 90 2b450: de 4f sbci r29, 0xFE ; 254 2b452: f9 83 std Y+1, r31 ; 0x01 2b454: e8 83 st Y, r30 2b456: c6 5a subi r28, 0xA6 ; 166 2b458: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2b45a: c8 56 subi r28, 0x68 ; 104 2b45c: de 4f sbci r29, 0xFE ; 254 2b45e: a8 81 ld r26, Y 2b460: b9 81 ldd r27, Y+1 ; 0x01 2b462: c8 59 subi r28, 0x98 ; 152 2b464: d1 40 sbci r29, 0x01 ; 1 2b466: cd 92 st X+, r12 2b468: dd 92 st X+, r13 2b46a: ed 92 st X+, r14 2b46c: fd 92 st X+, r15 2b46e: c8 56 subi r28, 0x68 ; 104 2b470: de 4f sbci r29, 0xFE ; 254 2b472: b9 83 std Y+1, r27 ; 0x01 2b474: a8 83 st Y, r26 2b476: c8 59 subi r28, 0x98 ; 152 2b478: d1 40 sbci r29, 0x01 ; 1 2b47a: bf ef ldi r27, 0xFF ; 255 2b47c: 2b 1a sub r2, r27 2b47e: 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){ 2b480: e1 e2 ldi r30, 0x21 ; 33 2b482: 2e 16 cp r2, r30 2b484: 31 04 cpc r3, r1 2b486: 09 f0 breq .+2 ; 0x2b48a 2b488: 10 ce rjmp .-992 ; 0x2b0aa 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); 2b48a: 40 e0 ldi r20, 0x00 ; 0 2b48c: 50 e0 ldi r21, 0x00 ; 0 2b48e: 60 e0 ldi r22, 0x00 ; 0 2b490: 7d e3 ldi r23, 0x3D ; 61 2b492: ce 01 movw r24, r28 2b494: 87 5f subi r24, 0xF7 ; 247 2b496: 9e 4f sbci r25, 0xFE ; 254 2b498: 0f 94 1b 3a call 0x27436 ; 0x27436 2b49c: 9b 01 movw r18, r22 2b49e: ac 01 movw r20, r24 2b4a0: c3 57 subi r28, 0x73 ; 115 2b4a2: de 4f sbci r29, 0xFE ; 254 2b4a4: a8 81 ld r26, Y 2b4a6: b9 81 ldd r27, Y+1 ; 0x01 2b4a8: cd 58 subi r28, 0x8D ; 141 2b4aa: d1 40 sbci r29, 0x01 ; 1 2b4ac: 6d 91 ld r22, X+ 2b4ae: 7d 91 ld r23, X+ 2b4b0: 8d 91 ld r24, X+ 2b4b2: 9c 91 ld r25, X 2b4b4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b4b8: c3 57 subi r28, 0x73 ; 115 2b4ba: de 4f sbci r29, 0xFE ; 254 2b4bc: e8 81 ld r30, Y 2b4be: f9 81 ldd r31, Y+1 ; 0x01 2b4c0: cd 58 subi r28, 0x8D ; 141 2b4c2: d1 40 sbci r29, 0x01 ; 1 2b4c4: 60 83 st Z, r22 2b4c6: 71 83 std Z+1, r23 ; 0x01 2b4c8: 82 83 std Z+2, r24 ; 0x02 2b4ca: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2b4cc: 40 e0 ldi r20, 0x00 ; 0 2b4ce: 50 e0 ldi r21, 0x00 ; 0 2b4d0: 60 e0 ldi r22, 0x00 ; 0 2b4d2: 7d e3 ldi r23, 0x3D ; 61 2b4d4: ce 01 movw r24, r28 2b4d6: 8b 57 subi r24, 0x7B ; 123 2b4d8: 9f 4f sbci r25, 0xFF ; 255 2b4da: 0f 94 1b 3a call 0x27436 ; 0x27436 2b4de: 9b 01 movw r18, r22 2b4e0: ac 01 movw r20, r24 2b4e2: c1 57 subi r28, 0x71 ; 113 2b4e4: de 4f sbci r29, 0xFE ; 254 2b4e6: a8 81 ld r26, Y 2b4e8: b9 81 ldd r27, Y+1 ; 0x01 2b4ea: cf 58 subi r28, 0x8F ; 143 2b4ec: d1 40 sbci r29, 0x01 ; 1 2b4ee: 6d 91 ld r22, X+ 2b4f0: 7d 91 ld r23, X+ 2b4f2: 8d 91 ld r24, X+ 2b4f4: 9c 91 ld r25, X 2b4f6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b4fa: c1 57 subi r28, 0x71 ; 113 2b4fc: de 4f sbci r29, 0xFE ; 254 2b4fe: e8 81 ld r30, Y 2b500: f9 81 ldd r31, Y+1 ; 0x01 2b502: cf 58 subi r28, 0x8F ; 143 2b504: d1 40 sbci r29, 0x01 ; 1 2b506: 60 83 st Z, r22 2b508: 71 83 std Z+1, r23 ; 0x01 2b50a: 82 83 std Z+2, r24 ; 0x02 2b50c: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2b50e: 40 e0 ldi r20, 0x00 ; 0 2b510: 50 e0 ldi r21, 0x00 ; 0 2b512: 60 e8 ldi r22, 0x80 ; 128 2b514: 7c e3 ldi r23, 0x3C ; 60 2b516: ce 01 movw r24, r28 2b518: 01 96 adiw r24, 0x01 ; 1 2b51a: 0f 94 1b 3a call 0x27436 ; 0x27436 2b51e: ce 56 subi r28, 0x6E ; 110 2b520: de 4f sbci r29, 0xFE ; 254 2b522: a8 81 ld r26, Y 2b524: b9 81 ldd r27, Y+1 ; 0x01 2b526: c2 59 subi r28, 0x92 ; 146 2b528: d1 40 sbci r29, 0x01 ; 1 2b52a: 2d 91 ld r18, X+ 2b52c: 3d 91 ld r19, X+ 2b52e: 4d 91 ld r20, X+ 2b530: 5c 91 ld r21, X 2b532: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b536: 16 2f mov r17, r22 2b538: 07 2f mov r16, r23 2b53a: f8 2e mov r15, r24 2b53c: e9 2e mov r14, r25 r = MAX(2, r); 2b53e: 20 e0 ldi r18, 0x00 ; 0 2b540: 30 e0 ldi r19, 0x00 ; 0 2b542: 40 e0 ldi r20, 0x00 ; 0 2b544: 50 e4 ldi r21, 0x40 ; 64 2b546: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2b54a: 18 16 cp r1, r24 2b54c: 2c f0 brlt .+10 ; 0x2b558 2b54e: 10 e0 ldi r17, 0x00 ; 0 2b550: 00 e0 ldi r16, 0x00 ; 0 2b552: f1 2c mov r15, r1 2b554: 80 e4 ldi r24, 0x40 ; 64 2b556: e8 2e mov r14, r24 2b558: a8 01 movw r20, r16 2b55a: 97 01 movw r18, r14 2b55c: 85 2f mov r24, r21 2b55e: 90 2f mov r25, r16 2b560: a3 2f mov r26, r19 2b562: be 2d mov r27, r14 2b564: ce 56 subi r28, 0x6E ; 110 2b566: de 4f sbci r29, 0xFE ; 254 2b568: e8 81 ld r30, Y 2b56a: f9 81 ldd r31, Y+1 ; 0x01 2b56c: c2 59 subi r28, 0x92 ; 146 2b56e: d1 40 sbci r29, 0x01 ; 1 2b570: 80 83 st Z, r24 2b572: 91 83 std Z+1, r25 ; 0x01 2b574: a2 83 std Z+2, r26 ; 0x02 2b576: b3 83 std Z+3, r27 ; 0x03 2b578: cf 56 subi r28, 0x6F ; 111 2b57a: de 4f sbci r29, 0xFE ; 254 2b57c: f8 81 ld r31, Y 2b57e: c1 59 subi r28, 0x91 ; 145 2b580: d1 40 sbci r29, 0x01 ; 1 2b582: f1 50 subi r31, 0x01 ; 1 2b584: cf 56 subi r28, 0x6F ; 111 2b586: de 4f sbci r29, 0xFE ; 254 2b588: f8 83 st Y, r31 2b58a: c1 59 subi r28, 0x91 ; 145 2b58c: 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){ 2b58e: f1 11 cpse r31, r1 2b590: 37 cd rjmp .-1426 ; 0x2b000 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2b592: ef 92 push r14 2b594: ff 92 push r15 2b596: 0f 93 push r16 2b598: 1f 93 push r17 2b59a: c1 57 subi r28, 0x71 ; 113 2b59c: de 4f sbci r29, 0xFE ; 254 2b59e: a8 81 ld r26, Y 2b5a0: b9 81 ldd r27, Y+1 ; 0x01 2b5a2: cf 58 subi r28, 0x8F ; 143 2b5a4: d1 40 sbci r29, 0x01 ; 1 2b5a6: 13 96 adiw r26, 0x03 ; 3 2b5a8: 8c 91 ld r24, X 2b5aa: 13 97 sbiw r26, 0x03 ; 3 2b5ac: 8f 93 push r24 2b5ae: 12 96 adiw r26, 0x02 ; 2 2b5b0: 8c 91 ld r24, X 2b5b2: 12 97 sbiw r26, 0x02 ; 2 2b5b4: 8f 93 push r24 2b5b6: 11 96 adiw r26, 0x01 ; 1 2b5b8: 8c 91 ld r24, X 2b5ba: 11 97 sbiw r26, 0x01 ; 1 2b5bc: 8f 93 push r24 2b5be: 8c 91 ld r24, X 2b5c0: 8f 93 push r24 2b5c2: c3 57 subi r28, 0x73 ; 115 2b5c4: de 4f sbci r29, 0xFE ; 254 2b5c6: e8 81 ld r30, Y 2b5c8: f9 81 ldd r31, Y+1 ; 0x01 2b5ca: cd 58 subi r28, 0x8D ; 141 2b5cc: d1 40 sbci r29, 0x01 ; 1 2b5ce: 83 81 ldd r24, Z+3 ; 0x03 2b5d0: 8f 93 push r24 2b5d2: 82 81 ldd r24, Z+2 ; 0x02 2b5d4: 8f 93 push r24 2b5d6: 81 81 ldd r24, Z+1 ; 0x01 2b5d8: 8f 93 push r24 2b5da: 80 81 ld r24, Z 2b5dc: 8f 93 push r24 2b5de: 8d eb ldi r24, 0xBD ; 189 2b5e0: 99 e9 ldi r25, 0x99 ; 153 2b5e2: 9f 93 push r25 2b5e4: 8f 93 push r24 2b5e6: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 2b5ea: 0f b6 in r0, 0x3f ; 63 2b5ec: f8 94 cli 2b5ee: de bf out 0x3e, r29 ; 62 2b5f0: 0f be out 0x3f, r0 ; 63 2b5f2: cd bf out 0x3d, r28 ; 61 } 2b5f4: c3 54 subi r28, 0x43 ; 67 2b5f6: de 4f sbci r29, 0xFE ; 254 2b5f8: 0f b6 in r0, 0x3f ; 63 2b5fa: f8 94 cli 2b5fc: de bf out 0x3e, r29 ; 62 2b5fe: 0f be out 0x3f, r0 ; 63 2b600: cd bf out 0x3d, r28 ; 61 2b602: df 91 pop r29 2b604: cf 91 pop r28 2b606: 1f 91 pop r17 2b608: 0f 91 pop r16 2b60a: ff 90 pop r15 2b60c: ef 90 pop r14 2b60e: df 90 pop r13 2b610: cf 90 pop r12 2b612: bf 90 pop r11 2b614: af 90 pop r10 2b616: 9f 90 pop r9 2b618: 8f 90 pop r8 2b61a: 7f 90 pop r7 2b61c: 6f 90 pop r6 2b61e: 5f 90 pop r5 2b620: 4f 90 pop r4 2b622: 3f 90 pop r3 2b624: 2f 90 pop r2 2b626: 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; 2b628: 60 e0 ldi r22, 0x00 ; 0 2b62a: 70 e0 ldi r23, 0x00 ; 0 2b62c: cb 01 movw r24, r22 2b62e: d5 ce rjmp .-598 ; 0x2b3da 0002b630 : } /// 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){ 2b630: 2f 92 push r2 2b632: 3f 92 push r3 2b634: 4f 92 push r4 2b636: 5f 92 push r5 2b638: 6f 92 push r6 2b63a: 7f 92 push r7 2b63c: 8f 92 push r8 2b63e: 9f 92 push r9 2b640: af 92 push r10 2b642: bf 92 push r11 2b644: cf 92 push r12 2b646: df 92 push r13 2b648: ef 92 push r14 2b64a: ff 92 push r15 2b64c: 0f 93 push r16 2b64e: 1f 93 push r17 2b650: cf 93 push r28 2b652: df 93 push r29 2b654: 00 d0 rcall .+0 ; 0x2b656 2b656: 1f 92 push r1 2b658: 1f 92 push r1 2b65a: cd b7 in r28, 0x3d ; 61 2b65c: de b7 in r29, 0x3e ; 62 2b65e: 2b 01 movw r4, r22 2b660: 1a 01 movw r2, r20 2b662: f1 2c mov r15, r1 2b664: 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; 2b666: 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; 2b668: 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; 2b66a: 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){ 2b66c: 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); 2b66e: 66 24 eor r6, r6 2b670: 63 94 inc r6 2b672: 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){ 2b674: 70 e0 ldi r23, 0x00 ; 0 2b676: 60 e0 ldi r22, 0x00 ; 0 2b678: 97 01 movw r18, r14 2b67a: 28 53 subi r18, 0x38 ; 56 2b67c: 39 4f sbci r19, 0xF9 ; 249 2b67e: 3a 83 std Y+2, r19 ; 0x02 2b680: 29 83 std Y+1, r18 ; 0x01 2b682: 86 2e mov r8, r22 2b684: c9 80 ldd r12, Y+1 ; 0x01 2b686: da 80 ldd r13, Y+2 ; 0x02 2b688: c6 0e add r12, r22 2b68a: d7 1e adc r13, r23 2b68c: 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; 2b68e: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b690: 40 e0 ldi r20, 0x00 ; 0 2b692: 30 e0 ldi r19, 0x00 ; 0 2b694: 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; 2b696: ae ef ldi r26, 0xFE ; 254 2b698: a4 0f add r26, r20 2b69a: 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; 2b69c: 44 23 and r20, r20 2b69e: 19 f0 breq .+6 ; 0x2b6a6 2b6a0: 4b 30 cpi r20, 0x0B ; 11 2b6a2: 09 f0 breq .+2 ; 0x2b6a6 2b6a4: 7d c0 rjmp .+250 ; 0x2b7a0 2b6a6: ae ef ldi r26, 0xFE ; 254 2b6a8: a2 0f add r26, r18 2b6aa: a8 30 cpi r26, 0x08 ; 8 2b6ac: 08 f4 brcc .+2 ; 0x2b6b0 2b6ae: 7a c0 rjmp .+244 ; 0x2b7a4 2b6b0: 2f 5f subi r18, 0xFF ; 255 2b6b2: 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){ 2b6b4: 2c 30 cpi r18, 0x0C ; 12 2b6b6: 31 05 cpc r19, r1 2b6b8: 89 f7 brne .-30 ; 0x2b69c /// 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){ 2b6ba: 4f 5f subi r20, 0xFF ; 255 2b6bc: 20 e2 ldi r18, 0x20 ; 32 2b6be: c2 0e add r12, r18 2b6c0: d1 1c adc r13, r1 2b6c2: 32 96 adiw r30, 0x02 ; 2 2b6c4: 4c 30 cpi r20, 0x0C ; 12 2b6c6: 29 f7 brne .-54 ; 0x2b692 // 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){ 2b6c8: 3c 81 ldd r19, Y+4 ; 0x04 2b6ca: 30 17 cp r19, r16 2b6cc: 18 f4 brcc .+6 ; 0x2b6d4 2b6ce: 0c 83 std Y+4, r16 ; 0x04 2b6d0: 5d 83 std Y+5, r21 ; 0x05 2b6d2: 18 2d mov r17, r8 2b6d4: 6f 5f subi r22, 0xFF ; 255 2b6d6: 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){ 2b6d8: 64 31 cpi r22, 0x14 ; 20 2b6da: 71 05 cpc r23, r1 2b6dc: 91 f6 brne .-92 ; 0x2b682 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){ 2b6de: 5f 5f subi r21, 0xFF ; 255 2b6e0: a0 e2 ldi r26, 0x20 ; 32 2b6e2: ea 0e add r14, r26 2b6e4: f1 1c adc r15, r1 2b6e6: 54 31 cpi r21, 0x14 ; 20 2b6e8: 29 f6 brne .-118 ; 0x2b674 // 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); 2b6ea: ec 81 ldd r30, Y+4 ; 0x04 2b6ec: 6e 2f mov r22, r30 2b6ee: 70 e0 ldi r23, 0x00 ; 0 2b6f0: 90 e0 ldi r25, 0x00 ; 0 2b6f2: 80 e0 ldi r24, 0x00 ; 0 2b6f4: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b6f8: 23 ec ldi r18, 0xC3 ; 195 2b6fa: 35 ef ldi r19, 0xF5 ; 245 2b6fc: 48 ea ldi r20, 0xA8 ; 168 2b6fe: 5f e3 ldi r21, 0x3F ; 63 2b700: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2b704: 9f 93 push r25 2b706: 8f 93 push r24 2b708: 7f 93 push r23 2b70a: 6f 93 push r22 2b70c: fd 81 ldd r31, Y+5 ; 0x05 2b70e: 6f 2f mov r22, r31 2b710: 70 e0 ldi r23, 0x00 ; 0 2b712: 90 e0 ldi r25, 0x00 ; 0 2b714: 80 e0 ldi r24, 0x00 ; 0 2b716: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b71a: 20 e0 ldi r18, 0x00 ; 0 2b71c: 30 e0 ldi r19, 0x00 ; 0 2b71e: 40 eb ldi r20, 0xB0 ; 176 2b720: 50 e4 ldi r21, 0x40 ; 64 2b722: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b726: 9f 93 push r25 2b728: 8f 93 push r24 2b72a: 7f 93 push r23 2b72c: 6f 93 push r22 2b72e: 61 2f mov r22, r17 2b730: 70 e0 ldi r23, 0x00 ; 0 2b732: 90 e0 ldi r25, 0x00 ; 0 2b734: 80 e0 ldi r24, 0x00 ; 0 2b736: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2b73a: 20 e0 ldi r18, 0x00 ; 0 2b73c: 30 e0 ldi r19, 0x00 ; 0 2b73e: 40 eb ldi r20, 0xB0 ; 176 2b740: 50 e4 ldi r21, 0x40 ; 64 2b742: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2b746: 9f 93 push r25 2b748: 8f 93 push r24 2b74a: 7f 93 push r23 2b74c: 6f 93 push r22 2b74e: 89 e9 ldi r24, 0x99 ; 153 2b750: 99 e9 ldi r25, 0x99 ; 153 2b752: 9f 93 push r25 2b754: 8f 93 push r24 2b756: 0f 94 3f 9f call 0x33e7e ; 0x33e7e *pc = max_c; 2b75a: f2 01 movw r30, r4 2b75c: 10 83 st Z, r17 *pr = max_r; 2b75e: 2d 81 ldd r18, Y+5 ; 0x05 2b760: f1 01 movw r30, r2 2b762: 20 83 st Z, r18 2b764: 0f b6 in r0, 0x3f ; 63 2b766: f8 94 cli 2b768: de bf out 0x3e, r29 ; 62 2b76a: 0f be out 0x3f, r0 ; 63 2b76c: cd bf out 0x3d, r28 ; 61 return max_match; } 2b76e: 8c 81 ldd r24, Y+4 ; 0x04 2b770: 0f 90 pop r0 2b772: 0f 90 pop r0 2b774: 0f 90 pop r0 2b776: 0f 90 pop r0 2b778: 0f 90 pop r0 2b77a: df 91 pop r29 2b77c: cf 91 pop r28 2b77e: 1f 91 pop r17 2b780: 0f 91 pop r16 2b782: ff 90 pop r15 2b784: ef 90 pop r14 2b786: df 90 pop r13 2b788: cf 90 pop r12 2b78a: bf 90 pop r11 2b78c: af 90 pop r10 2b78e: 9f 90 pop r9 2b790: 8f 90 pop r8 2b792: 7f 90 pop r7 2b794: 6f 90 pop r6 2b796: 5f 90 pop r5 2b798: 4f 90 pop r4 2b79a: 3f 90 pop r3 2b79c: 2f 90 pop r2 2b79e: 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; 2b7a0: 22 23 and r18, r18 2b7a2: 11 f0 breq .+4 ; 0x2b7a8 2b7a4: 2b 30 cpi r18, 0x0B ; 11 2b7a6: 21 f4 brne .+8 ; 0x2b7b0 2b7a8: ab 81 ldd r26, Y+3 ; 0x03 2b7aa: a8 30 cpi r26, 0x08 ; 8 2b7ac: 08 f0 brcs .+2 ; 0x2b7b0 2b7ae: 80 cf rjmp .-256 ; 0x2b6b0 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b7b0: 99 24 eor r9, r9 2b7b2: 93 94 inc r9 2b7b4: d6 01 movw r26, r12 2b7b6: a2 0f add r26, r18 2b7b8: b3 1f adc r27, r19 2b7ba: ac 91 ld r26, X 2b7bc: a1 31 cpi r26, 0x11 ; 17 2b7be: 08 f4 brcc .+2 ; 0x2b7c2 2b7c0: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b7c2: a0 80 ld r10, Z 2b7c4: b1 80 ldd r11, Z+1 ; 0x01 2b7c6: d3 01 movw r26, r6 2b7c8: 02 2e mov r0, r18 2b7ca: 02 c0 rjmp .+4 ; 0x2b7d0 2b7cc: aa 0f add r26, r26 2b7ce: bb 1f adc r27, r27 2b7d0: 0a 94 dec r0 2b7d2: e2 f7 brpl .-8 ; 0x2b7cc 2b7d4: aa 21 and r26, r10 2b7d6: bb 21 and r27, r11 2b7d8: bb 24 eor r11, r11 2b7da: b3 94 inc r11 2b7dc: ab 2b or r26, r27 2b7de: 09 f4 brne .+2 ; 0x2b7e2 2b7e0: b1 2c mov r11, r1 if (high_pix == high_pat) 2b7e2: 9b 10 cpse r9, r11 2b7e4: 65 cf rjmp .-310 ; 0x2b6b0 match++; 2b7e6: 0f 5f subi r16, 0xFF ; 255 2b7e8: 63 cf rjmp .-314 ; 0x2b6b0 0002b7ea : 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){ 2b7ea: 2f 92 push r2 2b7ec: 3f 92 push r3 2b7ee: 4f 92 push r4 2b7f0: 5f 92 push r5 2b7f2: 6f 92 push r6 2b7f4: 7f 92 push r7 2b7f6: 8f 92 push r8 2b7f8: 9f 92 push r9 2b7fa: af 92 push r10 2b7fc: bf 92 push r11 2b7fe: cf 92 push r12 2b800: df 92 push r13 2b802: ef 92 push r14 2b804: ff 92 push r15 2b806: 0f 93 push r16 2b808: 1f 93 push r17 2b80a: cf 93 push r28 2b80c: df 93 push r29 2b80e: cd b7 in r28, 0x3d ; 61 2b810: de b7 in r29, 0x3e ; 62 2b812: ca 55 subi r28, 0x5A ; 90 2b814: d1 09 sbc r29, r1 2b816: 0f b6 in r0, 0x3f ; 63 2b818: f8 94 cli 2b81a: de bf out 0x3e, r29 ; 62 2b81c: 0f be out 0x3f, r0 ; 63 2b81e: cd bf out 0x3d, r28 ; 61 2b820: 63 96 adiw r28, 0x13 ; 19 2b822: 9f af std Y+63, r25 ; 0x3f 2b824: 8e af std Y+62, r24 ; 0x3e 2b826: 63 97 sbiw r28, 0x13 ; 19 2b828: 8b 01 movw r16, r22 2b82a: 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 2b82c: 7e 01 movw r14, r28 2b82e: 25 e4 ldi r18, 0x45 ; 69 2b830: e2 0e add r14, r18 2b832: f1 1c adc r15, r1 2b834: 80 e1 ldi r24, 0x10 ; 16 2b836: 97 e2 ldi r25, 0x27 ; 39 2b838: f7 01 movw r30, r14 2b83a: 91 83 std Z+1, r25 ; 0x01 2b83c: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2b83e: 88 e8 ldi r24, 0x88 ; 136 2b840: 99 e9 ldi r25, 0x99 ; 153 2b842: 9f 93 push r25 2b844: 8f 93 push r24 2b846: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 2b84a: 28 ec ldi r18, 0xC8 ; 200 2b84c: 36 e0 ldi r19, 0x06 ; 6 2b84e: 61 96 adiw r28, 0x11 ; 17 2b850: 3f af std Y+63, r19 ; 0x3f 2b852: 2e af std Y+62, r18 ; 0x3e 2b854: 61 97 sbiw r28, 0x11 ; 17 2b856: c8 01 movw r24, r16 2b858: 80 5e subi r24, 0xE0 ; 224 2b85a: 93 40 sbci r25, 0x03 ; 3 2b85c: 2b 96 adiw r28, 0x0b ; 11 2b85e: 9f af std Y+63, r25 ; 0x3f 2b860: 8e af std Y+62, r24 ; 0x3e 2b862: 2b 97 sbiw r28, 0x0b ; 11 2b864: 0f 90 pop r0 2b866: 0f 90 pop r0 2b868: e0 e4 ldi r30, 0x40 ; 64 2b86a: f0 e0 ldi r31, 0x00 ; 0 2b86c: 29 96 adiw r28, 0x09 ; 9 2b86e: ff af std Y+63, r31 ; 0x3f 2b870: ee af std Y+62, r30 ; 0x3e 2b872: 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); 2b874: 63 96 adiw r28, 0x13 ; 19 2b876: 2e ad ldd r18, Y+62 ; 0x3e 2b878: 3f ad ldd r19, Y+63 ; 0x3f 2b87a: 63 97 sbiw r28, 0x13 ; 19 2b87c: 20 5e subi r18, 0xE0 ; 224 2b87e: 33 40 sbci r19, 0x03 ; 3 2b880: 69 96 adiw r28, 0x19 ; 25 2b882: 3f af std Y+63, r19 ; 0x3f 2b884: 2e af std Y+62, r18 ; 0x3e 2b886: 69 97 sbiw r28, 0x19 ; 25 2b888: 29 96 adiw r28, 0x09 ; 9 2b88a: 4e ac ldd r4, Y+62 ; 0x3e 2b88c: 5f ac ldd r5, Y+63 ; 0x3f 2b88e: 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){ 2b890: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2b892: 63 96 adiw r28, 0x13 ; 19 2b894: 8e ad ldd r24, Y+62 ; 0x3e 2b896: 9f ad ldd r25, Y+63 ; 0x3f 2b898: 63 97 sbiw r28, 0x13 ; 19 2b89a: 80 52 subi r24, 0x20 ; 32 2b89c: 9c 4f sbci r25, 0xFC ; 252 2b89e: 6b 96 adiw r28, 0x1b ; 27 2b8a0: 9f af std Y+63, r25 ; 0x3f 2b8a2: 8e af std Y+62, r24 ; 0x3e 2b8a4: 6b 97 sbiw r28, 0x1b ; 27 2b8a6: 60 90 be 06 lds r6, 0x06BE ; 0x8006be 2b8aa: 70 90 bf 06 lds r7, 0x06BF ; 0x8006bf 2b8ae: 80 90 c0 06 lds r8, 0x06C0 ; 0x8006c0 2b8b2: 90 90 c1 06 lds r9, 0x06C1 ; 0x8006c1 2b8b6: 6b 96 adiw r28, 0x1b ; 27 2b8b8: ae ac ldd r10, Y+62 ; 0x3e 2b8ba: bf ac ldd r11, Y+63 ; 0x3f 2b8bc: 6b 97 sbiw r28, 0x1b ; 27 2b8be: 31 10 cpse r3, r1 2b8c0: 04 c0 rjmp .+8 ; 0x2b8ca 2b8c2: 69 96 adiw r28, 0x19 ; 25 2b8c4: ae ac ldd r10, Y+62 ; 0x3e 2b8c6: bf ac ldd r11, Y+63 ; 0x3f 2b8c8: 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; 2b8ca: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2b8ce: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2b8d2: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2b8d6: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2b8da: f5 01 movw r30, r10 2b8dc: e8 1b sub r30, r24 2b8de: f9 0b sbc r31, r25 2b8e0: 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) 2b8e2: 71 f0 breq .+28 ; 0x2b900 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)); 2b8e4: af 01 movw r20, r30 2b8e6: f7 ff sbrs r31, 7 2b8e8: 04 c0 rjmp .+8 ; 0x2b8f2 2b8ea: 44 27 eor r20, r20 2b8ec: 55 27 eor r21, r21 2b8ee: 4e 1b sub r20, r30 2b8f0: 5f 0b sbc r21, r31 2b8f2: 69 2f mov r22, r25 2b8f4: 66 1f adc r22, r22 2b8f6: 66 27 eor r22, r22 2b8f8: 66 1f adc r22, r22 2b8fa: 81 e0 ldi r24, 0x01 ; 1 2b8fc: 0f 94 80 3f call 0x27f00 ; 0x27f00 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2b900: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2b904: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2b908: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2b90c: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2b910: 2b 96 adiw r28, 0x0b ; 11 2b912: 4e ad ldd r20, Y+62 ; 0x3e 2b914: 5f ad ldd r21, Y+63 ; 0x3f 2b916: 2b 97 sbiw r28, 0x0b ; 11 2b918: 48 1b sub r20, r24 2b91a: 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)); 2b91c: 57 fd sbrc r21, 7 2b91e: b2 c0 rjmp .+356 ; 0x2ba84 2b920: 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) 2b922: 41 15 cp r20, r1 2b924: 51 05 cpc r21, r1 2b926: 09 f0 breq .+2 ; 0x2b92a 2b928: ae c0 rjmp .+348 ; 0x2ba86 // 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; 2b92a: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2b92e: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2b932: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2b936: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2b93a: 68 1a sub r6, r24 2b93c: 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)); 2b93e: 77 fc sbrc r7, 7 2b940: ab c0 rjmp .+342 ; 0x2ba98 2b942: 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) 2b944: 61 14 cp r6, r1 2b946: 71 04 cpc r7, r1 2b948: 09 f0 breq .+2 ; 0x2b94c 2b94a: a7 c0 rjmp .+334 ; 0x2ba9a 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); 2b94c: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 2b950: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 2b954: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 2b958: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 2b95c: 00 e0 ldi r16, 0x00 ; 0 2b95e: 28 ec ldi r18, 0xC8 ; 200 2b960: 30 e0 ldi r19, 0x00 ; 0 2b962: 2b 96 adiw r28, 0x0b ; 11 2b964: 6e ad ldd r22, Y+62 ; 0x3e 2b966: 7f ad ldd r23, Y+63 ; 0x3f 2b968: 2b 97 sbiw r28, 0x0b ; 11 2b96a: c5 01 movw r24, r10 2b96c: 0e 94 cd c2 call 0x1859a ; 0x1859a sm4_set_dir(X_AXIS, d); 2b970: 63 2d mov r22, r3 2b972: 80 e0 ldi r24, 0x00 ; 0 2b974: 0f 94 a1 35 call 0x26b42 ; 0x26b42 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2b978: 5f 92 push r5 2b97a: 4f 92 push r4 2b97c: 84 e8 ldi r24, 0x84 ; 132 2b97e: 99 e9 ldi r25, 0x99 ; 153 2b980: 9f 93 push r25 2b982: 8f 93 push r24 2b984: 0f 94 3f 9f call 0x33e7e ; 0x33e7e lcd_set_cursor(4,3); 2b988: 63 e0 ldi r22, 0x03 ; 3 2b98a: 84 e0 ldi r24, 0x04 ; 4 2b98c: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2b990: 5f 92 push r5 2b992: 4f 92 push r4 2b994: 85 e7 ldi r24, 0x75 ; 117 2b996: 99 e9 ldi r25, 0x99 ; 153 2b998: 9f 93 push r25 2b99a: 8f 93 push r24 2b99c: 0e 94 df 69 call 0xd3be ; 0xd3be 2b9a0: 0f b6 in r0, 0x3f ; 63 2b9a2: f8 94 cli 2b9a4: de bf out 0x3e, r29 ; 62 2b9a6: 0f be out 0x3f, r0 ; 63 2b9a8: cd bf out 0x3d, r28 ; 61 2b9aa: 21 e0 ldi r18, 0x01 ; 1 2b9ac: 30 e0 ldi r19, 0x00 ; 0 2b9ae: 31 10 cpse r3, r1 2b9b0: 02 c0 rjmp .+4 ; 0x2b9b6 2b9b2: 2f ef ldi r18, 0xFF ; 255 2b9b4: 3f ef ldi r19, 0xFF ; 255 2b9b6: 40 ec ldi r20, 0xC0 ; 192 2b9b8: 42 03 mulsu r20, r18 2b9ba: c0 01 movw r24, r0 2b9bc: 43 9f mul r20, r19 2b9be: 90 0d add r25, r0 2b9c0: 11 24 eor r1, r1 2b9c2: 67 96 adiw r28, 0x17 ; 23 2b9c4: 9f af std Y+63, r25 ; 0x3f 2b9c6: 8e af std Y+62, r24 ; 0x3e 2b9c8: 67 97 sbiw r28, 0x17 ; 23 2b9ca: 40 ee ldi r20, 0xE0 ; 224 2b9cc: 53 e0 ldi r21, 0x03 ; 3 2b9ce: 24 9f mul r18, r20 2b9d0: 40 01 movw r8, r0 2b9d2: 25 9f mul r18, r21 2b9d4: 90 0c add r9, r0 2b9d6: 34 9f mul r19, r20 2b9d8: 90 0c add r9, r0 2b9da: 11 24 eor r1, r1 2b9dc: 63 96 adiw r28, 0x13 ; 19 2b9de: ee ad ldd r30, Y+62 ; 0x3e 2b9e0: ff ad ldd r31, Y+63 ; 0x3f 2b9e2: 63 97 sbiw r28, 0x13 ; 19 2b9e4: 8e 0e add r8, r30 2b9e6: 9f 1e adc r9, r31 2b9e8: 9e 01 movw r18, r28 2b9ea: 2f 5f subi r18, 0xFF ; 255 2b9ec: 3f 4f sbci r19, 0xFF ; 255 2b9ee: 2d 96 adiw r28, 0x0d ; 13 2b9f0: 3f af std Y+63, r19 ; 0x3f 2b9f2: 2e af std Y+62, r18 ; 0x3e 2b9f4: 2d 97 sbiw r28, 0x0d ; 13 2b9f6: 61 96 adiw r28, 0x11 ; 17 2b9f8: 8e ad ldd r24, Y+62 ; 0x3e 2b9fa: 9f ad ldd r25, Y+63 ; 0x3f 2b9fc: 61 97 sbiw r28, 0x11 ; 17 2b9fe: 2f 96 adiw r28, 0x0f ; 15 2ba00: 9f af std Y+63, r25 ; 0x3f 2ba02: 8e af std Y+62, r24 ; 0x3e 2ba04: 2f 97 sbiw r28, 0x0f ; 15 2ba06: 71 2c mov r7, r1 2ba08: 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; 2ba0a: e0 e1 ldi r30, 0x10 ; 16 2ba0c: f7 e2 ldi r31, 0x27 ; 39 2ba0e: 27 96 adiw r28, 0x07 ; 7 2ba10: ff af std Y+63, r31 ; 0x3f 2ba12: ee af std Y+62, r30 ; 0x3e 2ba14: 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); 2ba16: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2ba1a: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2ba1e: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2ba22: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2ba26: 84 01 movw r16, r8 2ba28: 08 1b sub r16, r24 2ba2a: 19 0b sbc r17, r25 2ba2c: 17 ff sbrs r17, 7 2ba2e: 03 c0 rjmp .+6 ; 0x2ba36 2ba30: 11 95 neg r17 2ba32: 01 95 neg r16 2ba34: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2ba36: 98 01 movw r18, r16 2ba38: 35 95 asr r19 2ba3a: 27 95 ror r18 2ba3c: 65 96 adiw r28, 0x15 ; 21 2ba3e: 3f af std Y+63, r19 ; 0x3f 2ba40: 2e af std Y+62, r18 ; 0x3e 2ba42: 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; 2ba44: 1c 9b sbis 0x03, 4 ; 3 2ba46: 33 c0 rjmp .+102 ; 0x2baae 2ba48: 45 e0 ldi r20, 0x05 ; 5 2ba4a: 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); 2ba4c: 65 96 adiw r28, 0x15 ; 21 2ba4e: ae ac ldd r10, Y+62 ; 0x3e 2ba50: bf ac ldd r11, Y+63 ; 0x3f 2ba52: 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); 2ba54: 63 2d mov r22, r3 2ba56: 82 2d mov r24, r2 2ba58: 0e 94 74 c2 call 0x184e8 ; 0x184e8 while (steps--){ 2ba5c: 31 e0 ldi r19, 0x01 ; 1 2ba5e: a3 1a sub r10, r19 2ba60: b1 08 sbc r11, r1 2ba62: 40 f1 brcs .+80 ; 0x2bab4 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2ba64: 28 ec ldi r18, 0xC8 ; 200 2ba66: 30 e0 ldi r19, 0x00 ; 0 2ba68: a7 01 movw r20, r14 2ba6a: 68 ee ldi r22, 0xE8 ; 232 2ba6c: 73 e0 ldi r23, 0x03 ; 3 2ba6e: 82 2d mov r24, r2 2ba70: 0e 94 43 c1 call 0x18286 ; 0x18286 update_position_1_step(axes, dir); 2ba74: 63 2d mov r22, r3 2ba76: 82 2d mov r24, r2 2ba78: 0e 94 8d c2 call 0x1851a ; 0x1851a 2ba7c: ef cf rjmp .-34 ; 0x2ba5c 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){ 2ba7e: 33 24 eor r3, r3 2ba80: 33 94 inc r3 2ba82: 11 cf rjmp .-478 ; 0x2b8a6 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)); 2ba84: 62 e0 ldi r22, 0x02 ; 2 2ba86: 57 ff sbrs r21, 7 2ba88: 03 c0 rjmp .+6 ; 0x2ba90 2ba8a: 51 95 neg r21 2ba8c: 41 95 neg r20 2ba8e: 51 09 sbc r21, r1 2ba90: 82 e0 ldi r24, 0x02 ; 2 2ba92: 0f 94 80 3f call 0x27f00 ; 0x27f00 2ba96: 49 cf rjmp .-366 ; 0x2b92a // 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)); 2ba98: 64 e0 ldi r22, 0x04 ; 4 2ba9a: a3 01 movw r20, r6 2ba9c: 77 fe sbrs r7, 7 2ba9e: 03 c0 rjmp .+6 ; 0x2baa6 2baa0: 51 95 neg r21 2baa2: 41 95 neg r20 2baa4: 51 09 sbc r21, r1 2baa6: 84 e0 ldi r24, 0x04 ; 4 2baa8: 0f 94 80 3f call 0x27f00 ; 0x27f00 2baac: 4f cf rjmp .-354 ; 0x2b94c 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; 2baae: 22 24 eor r2, r2 2bab0: 23 94 inc r2 2bab2: cc cf rjmp .-104 ; 0x2ba4c 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); 2bab4: 65 96 adiw r28, 0x15 ; 21 2bab6: ee ad ldd r30, Y+62 ; 0x3e 2bab8: ff ad ldd r31, Y+63 ; 0x3f 2baba: 65 97 sbiw r28, 0x15 ; 21 2babc: 0e 1b sub r16, r30 2babe: 1f 0b sbc r17, r31 2bac0: 23 96 adiw r28, 0x03 ; 3 2bac2: 1f af std Y+63, r17 ; 0x3f 2bac4: 0e af std Y+62, r16 ; 0x3e 2bac6: 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); 2bac8: 63 2d mov r22, r3 2baca: 82 2d mov r24, r2 2bacc: 0e 94 74 c2 call 0x184e8 ; 0x184e8 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2bad0: 9e 01 movw r18, r28 2bad2: 2f 5b subi r18, 0xBF ; 191 2bad4: 3f 4f sbci r19, 0xFF ; 255 2bad6: a7 01 movw r20, r14 2bad8: 68 ee ldi r22, 0xE8 ; 232 2bada: 73 e0 ldi r23, 0x03 ; 3 2badc: 82 2d mov r24, r2 2bade: 0e 94 ea c1 call 0x183d4 ; 0x183d4 2bae2: 88 23 and r24, r24 2bae4: 29 f0 breq .+10 ; 0x2baf0 update_position_1_step(axes, dir); 2bae6: 63 2d mov r22, r3 2bae8: 82 2d mov r24, r2 2baea: 0e 94 8d c2 call 0x1851a ; 0x1851a 2baee: f0 cf rjmp .-32 ; 0x2bad0 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2baf0: 60 e0 ldi r22, 0x00 ; 0 2baf2: 82 e0 ldi r24, 0x02 ; 2 2baf4: 0f 94 a1 35 call 0x26b42 ; 0x26b42 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2baf8: 20 e1 ldi r18, 0x10 ; 16 2bafa: 37 e2 ldi r19, 0x27 ; 39 2bafc: 27 96 adiw r28, 0x07 ; 7 2bafe: 3f af std Y+63, r19 ; 0x3f 2bb00: 2e af std Y+62, r18 ; 0x3e 2bb02: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2bb04: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bb08: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bb0c: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bb10: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bb14: 00 5a subi r16, 0xA0 ; 160 2bb16: 16 4f sbci r17, 0xF6 ; 246 2bb18: 17 ff sbrs r17, 7 2bb1a: 02 c0 rjmp .+4 ; 0x2bb20 2bb1c: 0f 5f subi r16, 0xFF ; 255 2bb1e: 1f 4f sbci r17, 0xFF ; 255 2bb20: 15 95 asr r17 2bb22: 07 95 ror r16 2bb24: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb28: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb2c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb30: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb34: 80 17 cp r24, r16 2bb36: 91 07 cpc r25, r17 2bb38: f4 f4 brge .+60 ; 0x2bb76 if (!_PINDA){ 2bb3a: 1c 9b sbis 0x03, 4 ; 3 2bb3c: 1c c0 rjmp .+56 ; 0x2bb76 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2bb3e: 28 ec ldi r18, 0xC8 ; 200 2bb40: 30 e0 ldi r19, 0x00 ; 0 2bb42: a7 01 movw r20, r14 2bb44: 68 ee ldi r22, 0xE8 ; 232 2bb46: 73 e0 ldi r23, 0x03 ; 3 2bb48: 84 e0 ldi r24, 0x04 ; 4 2bb4a: 0e 94 43 c1 call 0x18286 ; 0x18286 /// 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_){ 2bb4e: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb52: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb56: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb5a: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb5e: 01 96 adiw r24, 0x01 ; 1 2bb60: a1 1d adc r26, r1 2bb62: b1 1d adc r27, r1 2bb64: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bb68: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bb6c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bb70: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bb74: d7 cf rjmp .-82 ; 0x2bb24 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2bb76: 1c 9b sbis 0x03, 4 ; 3 2bb78: 3f c0 rjmp .+126 ; 0x2bbf8 steps_to_go = MAX(0, max_z - _Z); 2bb7a: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb7e: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb82: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb86: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb8a: e0 e6 ldi r30, 0x60 ; 96 2bb8c: f9 e0 ldi r31, 0x09 ; 9 2bb8e: e8 1b sub r30, r24 2bb90: f9 0b sbc r31, r25 2bb92: cf 01 movw r24, r30 2bb94: f7 ff sbrs r31, 7 2bb96: 02 c0 rjmp .+4 ; 0x2bb9c 2bb98: 90 e0 ldi r25, 0x00 ; 0 2bb9a: 80 e0 ldi r24, 0x00 ; 0 2bb9c: 25 96 adiw r28, 0x05 ; 5 2bb9e: 9f af std Y+63, r25 ; 0x3f 2bba0: 8e af std Y+62, r24 ; 0x3e 2bba2: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2bba4: 1c 9b sbis 0x03, 4 ; 3 2bba6: 28 c0 rjmp .+80 ; 0x2bbf8 2bba8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bbac: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bbb0: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bbb4: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bbb8: 80 36 cpi r24, 0x60 ; 96 2bbba: 99 40 sbci r25, 0x09 ; 9 2bbbc: ec f4 brge .+58 ; 0x2bbf8 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2bbbe: 9e 01 movw r18, r28 2bbc0: 2d 5b subi r18, 0xBD ; 189 2bbc2: 3f 4f sbci r19, 0xFF ; 255 2bbc4: a7 01 movw r20, r14 2bbc6: 68 ee ldi r22, 0xE8 ; 232 2bbc8: 73 e0 ldi r23, 0x03 ; 3 2bbca: 84 e0 ldi r24, 0x04 ; 4 2bbcc: 0e 94 ea c1 call 0x183d4 ; 0x183d4 ++_Z_; 2bbd0: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bbd4: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bbd8: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bbdc: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bbe0: 01 96 adiw r24, 0x01 ; 1 2bbe2: a1 1d adc r26, r1 2bbe4: b1 1d adc r27, r1 2bbe6: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bbea: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bbee: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bbf2: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bbf6: d6 cf rjmp .-84 ; 0x2bba4 /// \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); 2bbf8: 60 e0 ldi r22, 0x00 ; 0 2bbfa: 84 e0 ldi r24, 0x04 ; 4 2bbfc: 0e 94 74 c2 call 0x184e8 ; 0x184e8 while (delay_us < MAX_DELAY){ 2bc00: f7 01 movw r30, r14 2bc02: 20 81 ld r18, Z 2bc04: 31 81 ldd r19, Z+1 ; 0x01 2bc06: 20 31 cpi r18, 0x10 ; 16 2bc08: f7 e2 ldi r31, 0x27 ; 39 2bc0a: 3f 07 cpc r19, r31 2bc0c: 58 f4 brcc .+22 ; 0x2bc24 accelerate_1_step(axes, -dec, delay_us, delay_us); 2bc0e: a7 01 movw r20, r14 2bc10: 68 e1 ldi r22, 0x18 ; 24 2bc12: 7c ef ldi r23, 0xFC ; 252 2bc14: 84 e0 ldi r24, 0x04 ; 4 2bc16: 0e 94 43 c1 call 0x18286 ; 0x18286 update_position_1_step(axes, dir); 2bc1a: 60 e0 ldi r22, 0x00 ; 0 2bc1c: 84 e0 ldi r24, 0x04 ; 4 2bc1e: 0e 94 8d c2 call 0x1851a ; 0x1851a 2bc22: ee cf rjmp .-36 ; 0x2bc00 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2bc24: 61 e0 ldi r22, 0x01 ; 1 2bc26: 82 e0 ldi r24, 0x02 ; 2 2bc28: 0f 94 a1 35 call 0x26b42 ; 0x26b42 /// speed up current_delay_us = MAX_DELAY; 2bc2c: 20 e1 ldi r18, 0x10 ; 16 2bc2e: 37 e2 ldi r19, 0x27 ; 39 2bc30: f7 01 movw r30, r14 2bc32: 31 83 std Z+1, r19 ; 0x01 2bc34: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2bc36: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bc3a: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bc3e: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bc42: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bc46: 0c 0d add r16, r12 2bc48: 1d 1d adc r17, r13 2bc4a: 17 ff sbrs r17, 7 2bc4c: 02 c0 rjmp .+4 ; 0x2bc52 2bc4e: 0f 5f subi r16, 0xFF ; 255 2bc50: 1f 4f sbci r17, 0xFF ; 255 2bc52: 15 95 asr r17 2bc54: 07 95 ror r16 2bc56: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bc5a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bc5e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bc62: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bc66: 08 17 cp r16, r24 2bc68: 19 07 cpc r17, r25 2bc6a: 0c f0 brlt .+2 ; 0x2bc6e 2bc6c: d9 c0 rjmp .+434 ; 0x2be20 if (_PINDA){ 2bc6e: 1c 9b sbis 0x03, 4 ; 3 2bc70: bb c0 rjmp .+374 ; 0x2bde8 z_trig = _Z; 2bc72: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bc76: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bc7a: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bc7e: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2bc82: 1c 99 sbic 0x03, 4 ; 3 2bc84: 28 c0 rjmp .+80 ; 0x2bcd6 steps_to_go = MAX(0, _Z - min_z); 2bc86: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bc8a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bc8e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bc92: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bc96: 8c 19 sub r24, r12 2bc98: 9d 09 sbc r25, r13 2bc9a: 97 ff sbrs r25, 7 2bc9c: 02 c0 rjmp .+4 ; 0x2bca2 2bc9e: 90 e0 ldi r25, 0x00 ; 0 2bca0: 80 e0 ldi r24, 0x00 ; 0 2bca2: 25 96 adiw r28, 0x05 ; 5 2bca4: 9f af std Y+63, r25 ; 0x3f 2bca6: 8e af std Y+62, r24 ; 0x3e 2bca8: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2bcaa: 1c 99 sbic 0x03, 4 ; 3 2bcac: 0c c0 rjmp .+24 ; 0x2bcc6 2bcae: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcb2: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcb6: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcba: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcbe: c8 16 cp r12, r24 2bcc0: d9 06 cpc r13, r25 2bcc2: 0c f4 brge .+2 ; 0x2bcc6 2bcc4: af c0 rjmp .+350 ; 0x2be24 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2bcc6: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bcca: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bcce: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bcd2: 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){ 2bcd6: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcda: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcde: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bce2: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bce6: c8 16 cp r12, r24 2bce8: d9 06 cpc r13, r25 2bcea: 3c f4 brge .+14 ; 0x2bcfa 2bcec: f7 01 movw r30, r14 2bcee: 80 81 ld r24, Z 2bcf0: 91 81 ldd r25, Z+1 ; 0x01 2bcf2: 80 31 cpi r24, 0x10 ; 16 2bcf4: 97 42 sbci r25, 0x27 ; 39 2bcf6: 08 f4 brcc .+2 ; 0x2bcfa 2bcf8: b2 c0 rjmp .+356 ; 0x2be5e 2bcfa: 0c 19 sub r16, r12 2bcfc: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2bcfe: 31 10 cpse r3, r1 2bd00: ca c0 rjmp .+404 ; 0x2be96 line_buffer[c] = (uint16_t)(z_trig - min_z); 2bd02: f3 01 movw r30, r6 2bd04: ee 0f add r30, r30 2bd06: ff 1f adc r31, r31 2bd08: 21 e0 ldi r18, 0x01 ; 1 2bd0a: 30 e0 ldi r19, 0x00 ; 0 2bd0c: 2c 0f add r18, r28 2bd0e: 3d 1f adc r19, r29 2bd10: e2 0f add r30, r18 2bd12: f3 1f adc r31, r19 2bd14: 11 83 std Z+1, r17 ; 0x01 2bd16: 00 83 st Z, r16 2bd18: ff ef ldi r31, 0xFF ; 255 2bd1a: 6f 1a sub r6, r31 2bd1c: 7f 0a sbc r7, r31 2bd1e: 67 96 adiw r28, 0x17 ; 23 2bd20: 2e ad ldd r18, Y+62 ; 0x3e 2bd22: 3f ad ldd r19, Y+63 ; 0x3f 2bd24: 67 97 sbiw r28, 0x17 ; 23 2bd26: 82 0e add r8, r18 2bd28: 93 1e adc r9, r19 2bd2a: 2d 96 adiw r28, 0x0d ; 13 2bd2c: 8e ad ldd r24, Y+62 ; 0x3e 2bd2e: 9f ad ldd r25, Y+63 ; 0x3f 2bd30: 2d 97 sbiw r28, 0x0d ; 13 2bd32: 02 97 sbiw r24, 0x02 ; 2 2bd34: 2d 96 adiw r28, 0x0d ; 13 2bd36: 9f af std Y+63, r25 ; 0x3f 2bd38: 8e af std Y+62, r24 ; 0x3e 2bd3a: 2d 97 sbiw r28, 0x0d ; 13 2bd3c: 2f 96 adiw r28, 0x0f ; 15 2bd3e: ee ad ldd r30, Y+62 ; 0x3e 2bd40: ff ad ldd r31, Y+63 ; 0x3f 2bd42: 2f 97 sbiw r28, 0x0f ; 15 2bd44: 31 97 sbiw r30, 0x01 ; 1 2bd46: 2f 96 adiw r28, 0x0f ; 15 2bd48: ff af std Y+63, r31 ; 0x3f 2bd4a: ee af std Y+62, r30 ; 0x3e 2bd4c: 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 2bd4e: f0 e2 ldi r31, 0x20 ; 32 2bd50: 6f 16 cp r6, r31 2bd52: 71 04 cpc r7, r1 2bd54: 09 f0 breq .+2 ; 0x2bd58 2bd56: 59 ce rjmp .-846 ; 0x2ba0a 2bd58: 21 e0 ldi r18, 0x01 ; 1 2bd5a: 42 1a sub r4, r18 2bd5c: 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){ 2bd5e: 31 e0 ldi r19, 0x01 ; 1 2bd60: 33 12 cpse r3, r19 2bd62: 8d ce rjmp .-742 ; 0x2ba7e 2bd64: 61 96 adiw r28, 0x11 ; 17 2bd66: 8e ad ldd r24, Y+62 ; 0x3e 2bd68: 9f ad ldd r25, Y+63 ; 0x3f 2bd6a: 61 97 sbiw r28, 0x11 ; 17 2bd6c: 80 96 adiw r24, 0x20 ; 32 2bd6e: 61 96 adiw r28, 0x11 ; 17 2bd70: 9f af std Y+63, r25 ; 0x3f 2bd72: 8e af std Y+62, r24 ; 0x3e 2bd74: 61 97 sbiw r28, 0x11 ; 17 2bd76: 2b 96 adiw r28, 0x0b ; 11 2bd78: ee ad ldd r30, Y+62 ; 0x3e 2bd7a: ff ad ldd r31, Y+63 ; 0x3f 2bd7c: 2b 97 sbiw r28, 0x0b ; 11 2bd7e: e0 5c subi r30, 0xC0 ; 192 2bd80: ff 4f sbci r31, 0xFF ; 255 2bd82: 2b 96 adiw r28, 0x0b ; 11 2bd84: ff af std Y+63, r31 ; 0x3f 2bd86: ee af std Y+62, r30 ; 0x3e 2bd88: 2b 97 sbiw r28, 0x0b ; 11 2bd8a: 29 96 adiw r28, 0x09 ; 9 2bd8c: 2e ad ldd r18, Y+62 ; 0x3e 2bd8e: 3f ad ldd r19, Y+63 ; 0x3f 2bd90: 29 97 sbiw r28, 0x09 ; 9 2bd92: 22 50 subi r18, 0x02 ; 2 2bd94: 31 09 sbc r19, r1 2bd96: 29 96 adiw r28, 0x09 ; 9 2bd98: 3f af std Y+63, r19 ; 0x3f 2bd9a: 2e af std Y+62, r18 ; 0x3e 2bd9c: 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 2bd9e: 23 2b or r18, r19 2bda0: 09 f0 breq .+2 ; 0x2bda4 2bda2: 72 cd rjmp .-1308 ; 0x2b888 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); 2bda4: 83 e7 ldi r24, 0x73 ; 115 2bda6: 99 e9 ldi r25, 0x99 ; 153 2bda8: 9f 93 push r25 2bdaa: 8f 93 push r24 2bdac: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 2bdb0: 0f 90 pop r0 2bdb2: 0f 90 pop r0 } 2bdb4: c6 5a subi r28, 0xA6 ; 166 2bdb6: df 4f sbci r29, 0xFF ; 255 2bdb8: 0f b6 in r0, 0x3f ; 63 2bdba: f8 94 cli 2bdbc: de bf out 0x3e, r29 ; 62 2bdbe: 0f be out 0x3f, r0 ; 63 2bdc0: cd bf out 0x3d, r28 ; 61 2bdc2: df 91 pop r29 2bdc4: cf 91 pop r28 2bdc6: 1f 91 pop r17 2bdc8: 0f 91 pop r16 2bdca: ff 90 pop r15 2bdcc: ef 90 pop r14 2bdce: df 90 pop r13 2bdd0: cf 90 pop r12 2bdd2: bf 90 pop r11 2bdd4: af 90 pop r10 2bdd6: 9f 90 pop r9 2bdd8: 8f 90 pop r8 2bdda: 7f 90 pop r7 2bddc: 6f 90 pop r6 2bdde: 5f 90 pop r5 2bde0: 4f 90 pop r4 2bde2: 3f 90 pop r3 2bde4: 2f 90 pop r2 2bde6: 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); 2bde8: 28 ec ldi r18, 0xC8 ; 200 2bdea: 30 e0 ldi r19, 0x00 ; 0 2bdec: a7 01 movw r20, r14 2bdee: 68 ee ldi r22, 0xE8 ; 232 2bdf0: 73 e0 ldi r23, 0x03 ; 3 2bdf2: 84 e0 ldi r24, 0x04 ; 4 2bdf4: 0e 94 43 c1 call 0x18286 ; 0x18286 /// 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_){ 2bdf8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bdfc: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be00: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be04: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be08: 01 97 sbiw r24, 0x01 ; 1 2be0a: a1 09 sbc r26, r1 2be0c: b1 09 sbc r27, r1 2be0e: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2be12: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2be16: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2be1a: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2be1e: 1b cf rjmp .-458 ; 0x2bc56 2be20: 86 01 movw r16, r12 2be22: 2f cf rjmp .-418 ; 0x2bc82 } /// 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); 2be24: 9e 01 movw r18, r28 2be26: 2d 5b subi r18, 0xBD ; 189 2be28: 3f 4f sbci r19, 0xFF ; 255 2be2a: a7 01 movw r20, r14 2be2c: 68 ee ldi r22, 0xE8 ; 232 2be2e: 73 e0 ldi r23, 0x03 ; 3 2be30: 84 e0 ldi r24, 0x04 ; 4 2be32: 0e 94 ea c1 call 0x183d4 ; 0x183d4 --_Z_; 2be36: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be3a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be3e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be42: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be46: 01 97 sbiw r24, 0x01 ; 1 2be48: a1 09 sbc r26, r1 2be4a: b1 09 sbc r27, r1 2be4c: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2be50: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2be54: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2be58: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2be5c: 26 cf rjmp .-436 ; 0x2bcaa } 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); 2be5e: 28 ec ldi r18, 0xC8 ; 200 2be60: 30 e0 ldi r19, 0x00 ; 0 2be62: a7 01 movw r20, r14 2be64: 68 e1 ldi r22, 0x18 ; 24 2be66: 7c ef ldi r23, 0xFC ; 252 2be68: 84 e0 ldi r24, 0x04 ; 4 2be6a: 0e 94 43 c1 call 0x18286 ; 0x18286 --_Z_; 2be6e: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be72: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be76: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be7a: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be7e: 01 97 sbiw r24, 0x01 ; 1 2be80: a1 09 sbc r26, r1 2be82: b1 09 sbc r27, r1 2be84: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2be88: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2be8c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2be90: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2be94: 20 cf rjmp .-448 ; 0x2bcd6 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); 2be96: 2d 96 adiw r28, 0x0d ; 13 2be98: ee ad ldd r30, Y+62 ; 0x3e 2be9a: ff ad ldd r31, Y+63 ; 0x3f 2be9c: 2d 97 sbiw r28, 0x0d ; 13 2be9e: 86 ad ldd r24, Z+62 ; 0x3e 2bea0: 97 ad ldd r25, Z+63 ; 0x3f 2bea2: 01 2e mov r0, r17 2bea4: 00 0c add r0, r0 2bea6: 22 0b sbc r18, r18 2bea8: 33 0b sbc r19, r19 2beaa: 08 0f add r16, r24 2beac: 19 1f adc r17, r25 2beae: 21 1d adc r18, r1 2beb0: 31 1d adc r19, r1 2beb2: 36 95 lsr r19 2beb4: 27 95 ror r18 2beb6: 17 95 ror r17 2beb8: 07 95 ror r16 2beba: 0f 3f cpi r16, 0xFF ; 255 2bebc: 11 05 cpc r17, r1 2bebe: 21 05 cpc r18, r1 2bec0: 31 05 cpc r19, r1 2bec2: 29 f0 breq .+10 ; 0x2bece 2bec4: 20 f0 brcs .+8 ; 0x2bece 2bec6: 0f ef ldi r16, 0xFF ; 255 2bec8: 10 e0 ldi r17, 0x00 ; 0 2beca: 20 e0 ldi r18, 0x00 ; 0 2becc: 30 e0 ldi r19, 0x00 ; 0 2bece: 2f 96 adiw r28, 0x0f ; 15 2bed0: ee ad ldd r30, Y+62 ; 0x3e 2bed2: ff ad ldd r31, Y+63 ; 0x3f 2bed4: 2f 97 sbiw r28, 0x0f ; 15 2bed6: 07 8f std Z+31, r16 ; 0x1f 2bed8: 1f cf rjmp .-450 ; 0x2bd18 0002beda : /// 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) 2beda: 2f 92 push r2 2bedc: 3f 92 push r3 2bede: 4f 92 push r4 2bee0: 5f 92 push r5 2bee2: 6f 92 push r6 2bee4: 7f 92 push r7 2bee6: 8f 92 push r8 2bee8: 9f 92 push r9 2beea: af 92 push r10 2beec: bf 92 push r11 2beee: cf 92 push r12 2bef0: df 92 push r13 2bef2: ef 92 push r14 2bef4: ff 92 push r15 2bef6: 0f 93 push r16 2bef8: 1f 93 push r17 2befa: cf 93 push r28 2befc: df 93 push r29 2befe: cd b7 in r28, 0x3d ; 61 2bf00: de b7 in r29, 0x3e ; 62 2bf02: 6c 97 sbiw r28, 0x1c ; 28 2bf04: 0f b6 in r0, 0x3f ; 63 2bf06: f8 94 cli 2bf08: de bf out 0x3e, r29 ; 62 2bf0a: 0f be out 0x3f, r0 ; 63 2bf0c: cd bf out 0x3d, r28 ; 61 2bf0e: 6c 01 movw r12, r24 2bf10: 5b 01 movw r10, r22 2bf12: 4a 01 movw r8, r20 2bf14: 19 01 movw r2, r18 2bf16: 18 87 std Y+8, r17 ; 0x08 2bf18: 0f 83 std Y+7, r16 ; 0x07 2bf1a: fa 82 std Y+2, r15 ; 0x02 2bf1c: 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; 2bf1e: d7 01 movw r26, r14 2bf20: 8d 91 ld r24, X+ 2bf22: 9c 91 ld r25, X 2bf24: 60 ed ldi r22, 0xD0 ; 208 2bf26: 72 e0 ldi r23, 0x02 ; 2 2bf28: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 2bf2c: 9c 8f std Y+28, r25 ; 0x1c 2bf2e: 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); 2bf30: 9f 93 push r25 2bf32: 8f 93 push r24 2bf34: 3f 92 push r3 2bf36: 2f 93 push r18 2bf38: 1f 92 push r1 2bf3a: 84 e6 ldi r24, 0x64 ; 100 2bf3c: 8f 93 push r24 2bf3e: 9f 92 push r9 2bf40: 8f 92 push r8 2bf42: bf 92 push r11 2bf44: af 92 push r10 2bf46: df 92 push r13 2bf48: cf 92 push r12 2bf4a: 8b e3 ldi r24, 0x3B ; 59 2bf4c: 99 e9 ldi r25, 0x99 ; 153 2bf4e: 9f 93 push r25 2bf50: 8f 93 push r24 2bf52: 0f 94 3f 9f call 0x33e7e ; 0x33e7e 2bf56: 0f b6 in r0, 0x3f ; 63 2bf58: f8 94 cli 2bf5a: de bf out 0x3e, r29 ; 62 2bf5c: 0f be out 0x3f, r0 ; 63 2bf5e: 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; 2bf60: 22 27 eor r18, r18 2bf62: 33 27 eor r19, r19 2bf64: 22 19 sub r18, r2 2bf66: 33 09 sbc r19, r3 2bf68: 3a 8f std Y+26, r19 ; 0x1a 2bf6a: 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)); 2bf6c: c4 01 movw r24, r8 2bf6e: 99 0c add r9, r9 2bf70: aa 0b sbc r26, r26 2bf72: bb 0b sbc r27, r27 2bf74: 89 87 std Y+9, r24 ; 0x09 2bf76: 9a 87 std Y+10, r25 ; 0x0a 2bf78: ab 87 std Y+11, r26 ; 0x0b 2bf7a: 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)); 2bf7c: 95 01 movw r18, r10 2bf7e: bb 0c add r11, r11 2bf80: 44 0b sbc r20, r20 2bf82: 55 0b sbc r21, r21 2bf84: 29 8b std Y+17, r18 ; 0x11 2bf86: 3a 8b std Y+18, r19 ; 0x12 2bf88: 4b 8b std Y+19, r20 ; 0x13 2bf8a: 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)); 2bf8c: c6 01 movw r24, r12 2bf8e: dd 0c add r13, r13 2bf90: aa 0b sbc r26, r26 2bf92: bb 0b sbc r27, r27 2bf94: 8d 8b std Y+21, r24 ; 0x15 2bf96: 9e 8b std Y+22, r25 ; 0x16 2bf98: af 8b std Y+23, r26 ; 0x17 2bf9a: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2bf9c: 12 14 cp r1, r2 2bf9e: 13 04 cpc r1, r3 2bfa0: 0c f0 brlt .+2 ; 0x2bfa4 2bfa2: ba c0 rjmp .+372 ; 0x2c118 { dad = dad_max - (ad / k); 2bfa4: 8b 8d ldd r24, Y+27 ; 0x1b 2bfa6: 9c 8d ldd r25, Y+28 ; 0x1c 2bfa8: 6c e3 ldi r22, 0x3C ; 60 2bfaa: 70 e0 ldi r23, 0x00 ; 0 2bfac: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 2bfb0: 10 e1 ldi r17, 0x10 ; 16 2bfb2: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2bfb4: 2b 8d ldd r18, Y+27 ; 0x1b 2bfb6: 3c 8d ldd r19, Y+28 ; 0x1c 2bfb8: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2bfba: 0f 94 9d a1 call 0x3433a ; 0x3433a <__usmulhisi3> 2bfbe: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2bfc2: 20 e0 ldi r18, 0x00 ; 0 2bfc4: 30 e0 ldi r19, 0x00 ; 0 2bfc6: 44 e3 ldi r20, 0x34 ; 52 2bfc8: 54 e4 ldi r21, 0x44 ; 68 2bfca: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2bfce: 6b 01 movw r12, r22 2bfd0: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2bfd2: 6f 81 ldd r22, Y+7 ; 0x07 2bfd4: 78 85 ldd r23, Y+8 ; 0x08 2bfd6: eb 8d ldd r30, Y+27 ; 0x1b 2bfd8: fc 8d ldd r31, Y+28 ; 0x1c 2bfda: 6e 0f add r22, r30 2bfdc: 7f 1f adc r23, r31 2bfde: 90 e0 ldi r25, 0x00 ; 0 2bfe0: 80 e0 ldi r24, 0x00 ; 0 2bfe2: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2bfe6: 25 e3 ldi r18, 0x35 ; 53 2bfe8: 3a ef ldi r19, 0xFA ; 250 2bfea: 4e e8 ldi r20, 0x8E ; 142 2bfec: 5c e3 ldi r21, 0x3C ; 60 2bfee: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2bff2: 4b 01 movw r8, r22 2bff4: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2bff6: 0f 94 9f a2 call 0x3453e ; 0x3453e 2bffa: 6b 83 std Y+3, r22 ; 0x03 2bffc: 7c 83 std Y+4, r23 ; 0x04 2bffe: 8d 83 std Y+5, r24 ; 0x05 2c000: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2c002: c5 01 movw r24, r10 2c004: b4 01 movw r22, r8 2c006: 0f 94 65 a5 call 0x34aca ; 0x34aca 2c00a: 2b 01 movw r4, r22 2c00c: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2c00e: 69 85 ldd r22, Y+9 ; 0x09 2c010: 7a 85 ldd r23, Y+10 ; 0x0a 2c012: 8b 85 ldd r24, Y+11 ; 0x0b 2c014: 9c 85 ldd r25, Y+12 ; 0x0c 2c016: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2c01a: 4b 01 movw r8, r22 2c01c: 5c 01 movw r10, r24 2c01e: 2b 8d ldd r18, Y+27 ; 0x1b 2c020: 3c 8d ldd r19, Y+28 ; 0x1c 2c022: a4 e6 ldi r26, 0x64 ; 100 2c024: b0 e0 ldi r27, 0x00 ; 0 2c026: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 2c02a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2c02e: 20 e0 ldi r18, 0x00 ; 0 2c030: 30 e0 ldi r19, 0x00 ; 0 2c032: 44 e3 ldi r20, 0x34 ; 52 2c034: 54 e4 ldi r21, 0x44 ; 68 2c036: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2c03a: 9b 01 movw r18, r22 2c03c: ac 01 movw r20, r24 2c03e: c5 01 movw r24, r10 2c040: b4 01 movw r22, r8 2c042: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c046: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 2c04a: 6d 87 std Y+13, r22 ; 0x0d 2c04c: 7e 87 std Y+14, r23 ; 0x0e 2c04e: 8f 87 std Y+15, r24 ; 0x0f 2c050: 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)); 2c052: 69 89 ldd r22, Y+17 ; 0x11 2c054: 7a 89 ldd r23, Y+18 ; 0x12 2c056: 8b 89 ldd r24, Y+19 ; 0x13 2c058: 9c 89 ldd r25, Y+20 ; 0x14 2c05a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2c05e: 4b 01 movw r8, r22 2c060: 5c 01 movw r10, r24 2c062: a3 01 movw r20, r6 2c064: 92 01 movw r18, r4 2c066: c7 01 movw r24, r14 2c068: b6 01 movw r22, r12 2c06a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c06e: 9b 01 movw r18, r22 2c070: ac 01 movw r20, r24 2c072: c5 01 movw r24, r10 2c074: b4 01 movw r22, r8 2c076: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2c07a: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 2c07e: 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)); 2c080: 6d 89 ldd r22, Y+21 ; 0x15 2c082: 7e 89 ldd r23, Y+22 ; 0x16 2c084: 8f 89 ldd r24, Y+23 ; 0x17 2c086: 98 8d ldd r25, Y+24 ; 0x18 2c088: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2c08c: 2b 01 movw r4, r22 2c08e: 3c 01 movw r6, r24 2c090: a7 01 movw r20, r14 2c092: 96 01 movw r18, r12 2c094: 6b 81 ldd r22, Y+3 ; 0x03 2c096: 7c 81 ldd r23, Y+4 ; 0x04 2c098: 8d 81 ldd r24, Y+5 ; 0x05 2c09a: 9e 81 ldd r25, Y+6 ; 0x06 2c09c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c0a0: 9b 01 movw r18, r22 2c0a2: ac 01 movw r20, r24 2c0a4: c3 01 movw r24, r6 2c0a6: b2 01 movw r22, r4 2c0a8: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2c0ac: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 2c0b0: 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)) 2c0b2: 01 e0 ldi r16, 0x01 ; 1 2c0b4: 20 e4 ldi r18, 0x40 ; 64 2c0b6: 31 e0 ldi r19, 0x01 ; 1 2c0b8: 4d 85 ldd r20, Y+13 ; 0x0d 2c0ba: 5e 85 ldd r21, Y+14 ; 0x0e 2c0bc: b4 01 movw r22, r8 2c0be: 0e 94 cd c2 call 0x1859a ; 0x1859a 2c0c2: 21 2f mov r18, r17 2c0c4: 30 e0 ldi r19, 0x00 ; 0 2c0c6: 88 23 and r24, r24 2c0c8: b9 f1 breq .+110 ; 0x2c138 2c0ca: 4b 8d ldd r20, Y+27 ; 0x1b 2c0cc: 5c 8d ldd r21, Y+28 ; 0x1c 2c0ce: 42 0f add r20, r18 2c0d0: 53 1f adc r21, r19 { ad += dad + 1; 2c0d2: 4f 5f subi r20, 0xFF ; 255 2c0d4: 5f 4f sbci r21, 0xFF ; 255 2c0d6: 5c 8f std Y+28, r21 ; 0x1c 2c0d8: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2c0da: eb 8d ldd r30, Y+27 ; 0x1b 2c0dc: fc 8d ldd r31, Y+28 ; 0x1c 2c0de: a9 81 ldd r26, Y+1 ; 0x01 2c0e0: ba 81 ldd r27, Y+2 ; 0x02 2c0e2: ed 93 st X+, r30 2c0e4: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2c0e6: 6c 96 adiw r28, 0x1c ; 28 2c0e8: 0f b6 in r0, 0x3f ; 63 2c0ea: f8 94 cli 2c0ec: de bf out 0x3e, r29 ; 62 2c0ee: 0f be out 0x3f, r0 ; 63 2c0f0: cd bf out 0x3d, r28 ; 61 2c0f2: df 91 pop r29 2c0f4: cf 91 pop r28 2c0f6: 1f 91 pop r17 2c0f8: 0f 91 pop r16 2c0fa: ff 90 pop r15 2c0fc: ef 90 pop r14 2c0fe: df 90 pop r13 2c100: cf 90 pop r12 2c102: bf 90 pop r11 2c104: af 90 pop r10 2c106: 9f 90 pop r9 2c108: 8f 90 pop r8 2c10a: 7f 90 pop r7 2c10c: 6f 90 pop r6 2c10e: 5f 90 pop r5 2c110: 4f 90 pop r4 2c112: 3f 90 pop r3 2c114: 2f 90 pop r2 2c116: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c118: 2f ec ldi r18, 0xCF ; 207 2c11a: 32 e0 ldi r19, 0x02 ; 2 2c11c: ab 8d ldd r26, Y+27 ; 0x1b 2c11e: bc 8d ldd r27, Y+28 ; 0x1c 2c120: 2a 1b sub r18, r26 2c122: 3b 0b sbc r19, r27 2c124: c9 01 movw r24, r18 2c126: 6c e3 ldi r22, 0x3C ; 60 2c128: 70 e0 ldi r23, 0x00 ; 0 2c12a: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 2c12e: 10 e1 ldi r17, 0x10 ; 16 2c130: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c132: a9 8d ldd r26, Y+25 ; 0x19 2c134: ba 8d ldd r27, Y+26 ; 0x1a 2c136: 41 cf rjmp .-382 ; 0x2bfba // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c138: 2f 5f subi r18, 0xFF ; 255 2c13a: 3f 4f sbci r19, 0xFF ; 255 2c13c: ab 8d ldd r26, Y+27 ; 0x1b 2c13e: bc 8d ldd r27, Y+28 ; 0x1c 2c140: a2 0f add r26, r18 2c142: b3 1f adc r27, r19 2c144: bc 8f std Y+28, r27 ; 0x1c 2c146: ab 8f std Y+27, r26 ; 0x1b 2c148: a0 3d cpi r26, 0xD0 ; 208 2c14a: b2 40 sbci r27, 0x02 ; 2 2c14c: 08 f4 brcc .+2 ; 0x2c150 2c14e: 26 cf rjmp .-436 ; 0x2bf9c 2c150: c4 cf rjmp .-120 ; 0x2c0da 0002c152 : float mesh_bed_leveling::get_z(float x, float y) { 2c152: 2f 92 push r2 2c154: 3f 92 push r3 2c156: 4f 92 push r4 2c158: 5f 92 push r5 2c15a: 6f 92 push r6 2c15c: 7f 92 push r7 2c15e: 8f 92 push r8 2c160: 9f 92 push r9 2c162: af 92 push r10 2c164: bf 92 push r11 2c166: cf 92 push r12 2c168: df 92 push r13 2c16a: ef 92 push r14 2c16c: ff 92 push r15 2c16e: 0f 93 push r16 2c170: 1f 93 push r17 2c172: cf 93 push r28 2c174: df 93 push r29 2c176: 00 d0 rcall .+0 ; 0x2c178 2c178: 00 d0 rcall .+0 ; 0x2c17a 2c17a: 00 d0 rcall .+0 ; 0x2c17c 2c17c: 1f 92 push r1 2c17e: cd b7 in r28, 0x3d ; 61 2c180: de b7 in r29, 0x3e ; 62 2c182: 2b 01 movw r4, r22 2c184: 3c 01 movw r6, r24 2c186: 49 01 movw r8, r18 2c188: 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)); 2c18a: 20 e0 ldi r18, 0x00 ; 0 2c18c: 30 e0 ldi r19, 0x00 ; 0 2c18e: 40 ec ldi r20, 0xC0 ; 192 2c190: 51 e4 ldi r21, 0x41 ; 65 2c192: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c196: 20 e0 ldi r18, 0x00 ; 0 2c198: 30 e0 ldi r19, 0x00 ; 0 2c19a: 48 e0 ldi r20, 0x08 ; 8 2c19c: 52 e4 ldi r21, 0x42 ; 66 2c19e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2c1a2: 6b 01 movw r12, r22 2c1a4: 7c 01 movw r14, r24 2c1a6: 0f 94 4c a3 call 0x34698 ; 0x34698 2c1aa: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> if (i < 0) { i = 0; 2c1ae: 31 2c mov r3, r1 2c1b0: 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) { 2c1b2: 77 fd sbrc r23, 7 2c1b4: 1e c0 rjmp .+60 ; 0x2c1f2 2c1b6: 1b 01 movw r2, r22 2c1b8: 66 30 cpi r22, 0x06 ; 6 2c1ba: 71 05 cpc r23, r1 2c1bc: 1c f0 brlt .+6 ; 0x2c1c4 2c1be: 45 e0 ldi r20, 0x05 ; 5 2c1c0: 24 2e mov r2, r20 2c1c2: 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; } 2c1c4: 82 2d mov r24, r2 2c1c6: 0f 94 06 8c call 0x3180c ; 0x3180c 2c1ca: 20 e0 ldi r18, 0x00 ; 0 2c1cc: 30 e0 ldi r19, 0x00 ; 0 2c1ce: 48 eb ldi r20, 0xB8 ; 184 2c1d0: 51 e4 ldi r21, 0x41 ; 65 2c1d2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2c1d6: 9b 01 movw r18, r22 2c1d8: 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; 2c1da: c3 01 movw r24, r6 2c1dc: b2 01 movw r22, r4 2c1de: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c1e2: 20 e0 ldi r18, 0x00 ; 0 2c1e4: 30 e0 ldi r19, 0x00 ; 0 2c1e6: 48 e0 ldi r20, 0x08 ; 8 2c1e8: 52 e4 ldi r21, 0x42 ; 66 2c1ea: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2c1ee: 6b 01 movw r12, r22 2c1f0: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 2c1f2: 20 e0 ldi r18, 0x00 ; 0 2c1f4: 30 e0 ldi r19, 0x00 ; 0 2c1f6: 40 ec ldi r20, 0xC0 ; 192 2c1f8: 50 e4 ldi r21, 0x40 ; 64 2c1fa: c5 01 movw r24, r10 2c1fc: b4 01 movw r22, r8 2c1fe: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c202: 20 e0 ldi r18, 0x00 ; 0 2c204: 30 e0 ldi r19, 0x00 ; 0 2c206: 48 e0 ldi r20, 0x08 ; 8 2c208: 52 e4 ldi r21, 0x42 ; 66 2c20a: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2c20e: 69 83 std Y+1, r22 ; 0x01 2c210: 7a 83 std Y+2, r23 ; 0x02 2c212: 8b 83 std Y+3, r24 ; 0x03 2c214: 9c 83 std Y+4, r25 ; 0x04 2c216: 0f 94 4c a3 call 0x34698 ; 0x34698 2c21a: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> if (j < 0) { 2c21e: 77 fd sbrc r23, 7 2c220: da c0 rjmp .+436 ; 0x2c3d6 2c222: 7a 87 std Y+10, r23 ; 0x0a 2c224: 69 87 std Y+9, r22 ; 0x09 2c226: 66 30 cpi r22, 0x06 ; 6 2c228: 71 05 cpc r23, r1 2c22a: 24 f0 brlt .+8 ; 0x2c234 2c22c: e5 e0 ldi r30, 0x05 ; 5 2c22e: f0 e0 ldi r31, 0x00 ; 0 2c230: fa 87 std Y+10, r31 ; 0x0a 2c232: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 2c234: 89 85 ldd r24, Y+9 ; 0x09 2c236: 0f 94 06 8c call 0x3180c ; 0x3180c 2c23a: 20 e0 ldi r18, 0x00 ; 0 2c23c: 30 e0 ldi r19, 0x00 ; 0 2c23e: 40 ea ldi r20, 0xA0 ; 160 2c240: 50 e4 ldi r21, 0x40 ; 64 2c242: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2c246: 9b 01 movw r18, r22 2c248: 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; 2c24a: c5 01 movw r24, r10 2c24c: b4 01 movw r22, r8 2c24e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c252: 20 e0 ldi r18, 0x00 ; 0 2c254: 30 e0 ldi r19, 0x00 ; 0 2c256: 48 e0 ldi r20, 0x08 ; 8 2c258: 52 e4 ldi r21, 0x42 ; 66 2c25a: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2c25e: 69 83 std Y+1, r22 ; 0x01 2c260: 7a 83 std Y+2, r23 ; 0x02 2c262: 8b 83 std Y+3, r24 ; 0x03 2c264: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 2c266: a7 01 movw r20, r14 2c268: 96 01 movw r18, r12 2c26a: 60 e0 ldi r22, 0x00 ; 0 2c26c: 70 e0 ldi r23, 0x00 ; 0 2c26e: 80 e8 ldi r24, 0x80 ; 128 2c270: 9f e3 ldi r25, 0x3F ; 63 2c272: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c276: 2b 01 movw r4, r22 2c278: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 2c27a: 91 01 movw r18, r2 2c27c: 2f 5f subi r18, 0xFF ; 255 2c27e: 3f 4f sbci r19, 0xFF ; 255 2c280: 3e 83 std Y+6, r19 ; 0x06 2c282: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 2c284: 89 85 ldd r24, Y+9 ; 0x09 2c286: 9a 85 ldd r25, Y+10 ; 0x0a 2c288: 01 96 adiw r24, 0x01 ; 1 2c28a: 98 87 std Y+8, r25 ; 0x08 2c28c: 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]; 2c28e: 27 e0 ldi r18, 0x07 ; 7 2c290: e9 85 ldd r30, Y+9 ; 0x09 2c292: fa 85 ldd r31, Y+10 ; 0x0a 2c294: 2e 9f mul r18, r30 2c296: 80 01 movw r16, r0 2c298: 2f 9f mul r18, r31 2c29a: 10 0d add r17, r0 2c29c: 11 24 eor r1, r1 2c29e: f8 01 movw r30, r16 2c2a0: e2 0d add r30, r2 2c2a2: f3 1d adc r31, r3 2c2a4: ee 0f add r30, r30 2c2a6: ff 1f adc r31, r31 2c2a8: ee 0f add r30, r30 2c2aa: ff 1f adc r31, r31 2c2ac: e4 56 subi r30, 0x64 ; 100 2c2ae: fd 4e sbci r31, 0xED ; 237 2c2b0: 21 81 ldd r18, Z+1 ; 0x01 2c2b2: 32 81 ldd r19, Z+2 ; 0x02 2c2b4: 43 81 ldd r20, Z+3 ; 0x03 2c2b6: 54 81 ldd r21, Z+4 ; 0x04 2c2b8: c3 01 movw r24, r6 2c2ba: b2 01 movw r22, r4 2c2bc: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c2c0: 4b 01 movw r8, r22 2c2c2: 5c 01 movw r10, r24 2c2c4: ed 81 ldd r30, Y+5 ; 0x05 2c2c6: fe 81 ldd r31, Y+6 ; 0x06 2c2c8: e0 0f add r30, r16 2c2ca: f1 1f adc r31, r17 2c2cc: ee 0f add r30, r30 2c2ce: ff 1f adc r31, r31 2c2d0: ee 0f add r30, r30 2c2d2: ff 1f adc r31, r31 2c2d4: e4 56 subi r30, 0x64 ; 100 2c2d6: fd 4e sbci r31, 0xED ; 237 2c2d8: 21 81 ldd r18, Z+1 ; 0x01 2c2da: 32 81 ldd r19, Z+2 ; 0x02 2c2dc: 43 81 ldd r20, Z+3 ; 0x03 2c2de: 54 81 ldd r21, Z+4 ; 0x04 2c2e0: c7 01 movw r24, r14 2c2e2: b6 01 movw r22, r12 2c2e4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c2e8: 9b 01 movw r18, r22 2c2ea: ac 01 movw r20, r24 2c2ec: c5 01 movw r24, r10 2c2ee: b4 01 movw r22, r8 2c2f0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2c2f4: 4b 01 movw r8, r22 2c2f6: 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; 2c2f8: 29 81 ldd r18, Y+1 ; 0x01 2c2fa: 3a 81 ldd r19, Y+2 ; 0x02 2c2fc: 4b 81 ldd r20, Y+3 ; 0x03 2c2fe: 5c 81 ldd r21, Y+4 ; 0x04 2c300: 60 e0 ldi r22, 0x00 ; 0 2c302: 70 e0 ldi r23, 0x00 ; 0 2c304: 80 e8 ldi r24, 0x80 ; 128 2c306: 9f e3 ldi r25, 0x3F ; 63 2c308: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2c30c: 9b 01 movw r18, r22 2c30e: ac 01 movw r20, r24 2c310: c5 01 movw r24, r10 2c312: b4 01 movw r22, r8 2c314: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c318: 4b 01 movw r8, r22 2c31a: 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]; 2c31c: 27 e0 ldi r18, 0x07 ; 7 2c31e: ef 81 ldd r30, Y+7 ; 0x07 2c320: f8 85 ldd r31, Y+8 ; 0x08 2c322: 2e 9f mul r18, r30 2c324: c0 01 movw r24, r0 2c326: 2f 9f mul r18, r31 2c328: 90 0d add r25, r0 2c32a: 11 24 eor r1, r1 2c32c: 9a 87 std Y+10, r25 ; 0x0a 2c32e: 89 87 std Y+9, r24 ; 0x09 2c330: fc 01 movw r30, r24 2c332: e2 0d add r30, r2 2c334: f3 1d adc r31, r3 2c336: ee 0f add r30, r30 2c338: ff 1f adc r31, r31 2c33a: ee 0f add r30, r30 2c33c: ff 1f adc r31, r31 2c33e: e4 56 subi r30, 0x64 ; 100 2c340: fd 4e sbci r31, 0xED ; 237 2c342: 21 81 ldd r18, Z+1 ; 0x01 2c344: 32 81 ldd r19, Z+2 ; 0x02 2c346: 43 81 ldd r20, Z+3 ; 0x03 2c348: 54 81 ldd r21, Z+4 ; 0x04 2c34a: c3 01 movw r24, r6 2c34c: b2 01 movw r22, r4 2c34e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c352: 2b 01 movw r4, r22 2c354: 3c 01 movw r6, r24 2c356: 89 85 ldd r24, Y+9 ; 0x09 2c358: 9a 85 ldd r25, Y+10 ; 0x0a 2c35a: ed 81 ldd r30, Y+5 ; 0x05 2c35c: fe 81 ldd r31, Y+6 ; 0x06 2c35e: 8e 0f add r24, r30 2c360: 9f 1f adc r25, r31 2c362: 88 0f add r24, r24 2c364: 99 1f adc r25, r25 2c366: 88 0f add r24, r24 2c368: 99 1f adc r25, r25 2c36a: 84 56 subi r24, 0x64 ; 100 2c36c: 9d 4e sbci r25, 0xED ; 237 2c36e: fc 01 movw r30, r24 2c370: 21 81 ldd r18, Z+1 ; 0x01 2c372: 32 81 ldd r19, Z+2 ; 0x02 2c374: 43 81 ldd r20, Z+3 ; 0x03 2c376: 54 81 ldd r21, Z+4 ; 0x04 2c378: c7 01 movw r24, r14 2c37a: b6 01 movw r22, r12 2c37c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c380: 9b 01 movw r18, r22 2c382: ac 01 movw r20, r24 2c384: c3 01 movw r24, r6 2c386: b2 01 movw r22, r4 2c388: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> return (1.f-t) * z0 + t * z1; 2c38c: 29 81 ldd r18, Y+1 ; 0x01 2c38e: 3a 81 ldd r19, Y+2 ; 0x02 2c390: 4b 81 ldd r20, Y+3 ; 0x03 2c392: 5c 81 ldd r21, Y+4 ; 0x04 2c394: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2c398: 9b 01 movw r18, r22 2c39a: ac 01 movw r20, r24 2c39c: c5 01 movw r24, r10 2c39e: b4 01 movw r22, r8 2c3a0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> } 2c3a4: 2a 96 adiw r28, 0x0a ; 10 2c3a6: 0f b6 in r0, 0x3f ; 63 2c3a8: f8 94 cli 2c3aa: de bf out 0x3e, r29 ; 62 2c3ac: 0f be out 0x3f, r0 ; 63 2c3ae: cd bf out 0x3d, r28 ; 61 2c3b0: df 91 pop r29 2c3b2: cf 91 pop r28 2c3b4: 1f 91 pop r17 2c3b6: 0f 91 pop r16 2c3b8: ff 90 pop r15 2c3ba: ef 90 pop r14 2c3bc: df 90 pop r13 2c3be: cf 90 pop r12 2c3c0: bf 90 pop r11 2c3c2: af 90 pop r10 2c3c4: 9f 90 pop r9 2c3c6: 8f 90 pop r8 2c3c8: 7f 90 pop r7 2c3ca: 6f 90 pop r6 2c3cc: 5f 90 pop r5 2c3ce: 4f 90 pop r4 2c3d0: 3f 90 pop r3 2c3d2: 2f 90 pop r2 2c3d4: 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; 2c3d6: 1a 86 std Y+10, r1 ; 0x0a 2c3d8: 19 86 std Y+9, r1 ; 0x09 2c3da: 45 cf rjmp .-374 ; 0x2c266 0002c3dc : 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) { 2c3dc: 1f 93 push r17 2c3de: cf 93 push r28 2c3e0: df 93 push r29 2c3e2: 00 d0 rcall .+0 ; 0x2c3e4 2c3e4: 1f 92 push r1 2c3e6: 1f 92 push r1 2c3e8: cd b7 in r28, 0x3d ; 61 2c3ea: de b7 in r29, 0x3e ; 62 2c3ec: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 2c3ee: 48 2f mov r20, r24 2c3f0: 62 e5 ldi r22, 0x52 ; 82 2c3f2: ce 01 movw r24, r28 2c3f4: 01 96 adiw r24, 0x01 ; 1 2c3f6: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c3fa: 49 81 ldd r20, Y+1 ; 0x01 2c3fc: 5a 81 ldd r21, Y+2 ; 0x02 2c3fe: 6b 81 ldd r22, Y+3 ; 0x03 2c400: 7c 81 ldd r23, Y+4 ; 0x04 2c402: 8d 81 ldd r24, Y+5 ; 0x05 2c404: 0f 94 c0 3b call 0x27780 ; 0x27780 scopeState = nextState; 2c408: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c40c: 0f 90 pop r0 2c40e: 0f 90 pop r0 2c410: 0f 90 pop r0 2c412: 0f 90 pop r0 2c414: 0f 90 pop r0 2c416: df 91 pop r29 2c418: cf 91 pop r28 2c41a: 1f 91 pop r17 2c41c: 08 95 ret 0002c41e : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 2c41e: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 2c422: e5 e0 ldi r30, 0x05 ; 5 2c424: fe e9 ldi r31, 0x9E ; 158 2c426: 84 91 lpm r24, Z 2c428: 67 e0 ldi r22, 0x07 ; 7 2c42a: 0d 94 ee 61 jmp 0x2c3dc ; 0x2c3dc 0002c42e : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 2c42e: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c432: ae 2f mov r26, r30 2c434: b0 e0 ldi r27, 0x00 ; 0 2c436: aa 0f add r26, r26 2c438: bb 1f adc r27, r27 2c43a: a3 59 subi r26, 0x93 ; 147 2c43c: bd 4e sbci r27, 0xED ; 237 2c43e: 20 91 40 12 lds r18, 0x1240 ; 0x801240 2c442: 30 91 41 12 lds r19, 0x1241 ; 0x801241 2c446: 2d 93 st X+, r18 2c448: 3c 93 st X, r19 ++regIndex; 2c44a: ef 5f subi r30, 0xFF ; 255 2c44c: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs16Count) { 2c450: e2 30 cpi r30, 0x02 ; 2 2c452: 40 f4 brcc .+16 ; 0x2c464 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c454: f0 e0 ldi r31, 0x00 ; 0 2c456: e4 51 subi r30, 0x14 ; 20 2c458: f2 46 sbci r31, 0x62 ; 98 2c45a: 84 91 lpm r24, Z 2c45c: 68 e0 ldi r22, 0x08 ; 8 2c45e: 0f 94 ee 61 call 0x2c3dc ; 0x2c3dc } return ScopeState::Reading16bitRegisters; 2c462: 88 e0 ldi r24, 0x08 ; 8 } 2c464: 08 95 ret 0002c466 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 2c466: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c46a: ae 2f mov r26, r30 2c46c: b0 e0 ldi r27, 0x00 ; 0 2c46e: a6 59 subi r26, 0x96 ; 150 2c470: bd 4e sbci r27, 0xED ; 237 2c472: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c476: 8c 93 st X, r24 ++regIndex; 2c478: ef 5f subi r30, 0xFF ; 255 2c47a: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs8Count) { 2c47e: e3 30 cpi r30, 0x03 ; 3 2c480: 40 f0 brcs .+16 ; 0x2c492 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 2c482: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c486: ec ee ldi r30, 0xEC ; 236 2c488: fd e9 ldi r31, 0x9D ; 157 2c48a: 84 91 lpm r24, Z 2c48c: 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); 2c48e: 0d 94 ee 61 jmp 0x2c3dc ; 0x2c3dc 2c492: f0 e0 ldi r31, 0x00 ; 0 2c494: eb 5f subi r30, 0xFB ; 251 2c496: f1 46 sbci r31, 0x61 ; 97 2c498: 84 91 lpm r24, Z 2c49a: 67 e0 ldi r22, 0x07 ; 7 2c49c: f8 cf rjmp .-16 ; 0x2c48e 0002c49e : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 2c49e: cf 93 push r28 2c4a0: df 93 push r29 2c4a2: 00 d0 rcall .+0 ; 0x2c4a4 2c4a4: 00 d0 rcall .+0 ; 0x2c4a6 2c4a6: 00 d0 rcall .+0 ; 0x2c4a8 2c4a8: 1f 92 push r1 2c4aa: cd b7 in r28, 0x3d ; 61 2c4ac: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 2c4ae: 80 91 2f 12 lds r24, 0x122F ; 0x80122f 2c4b2: 82 34 cpi r24, 0x42 ; 66 2c4b4: 09 f4 brne .+2 ; 0x2c4b8 2c4b6: 46 c0 rjmp .+140 ; 0x2c544 2c4b8: b8 f5 brcc .+110 ; 0x2c528 2c4ba: 88 23 and r24, r24 2c4bc: 09 f4 brne .+2 ; 0x2c4c0 2c4be: 72 c0 rjmp .+228 ; 0x2c5a4 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 2c4c0: 84 e0 ldi r24, 0x04 ; 4 2c4c2: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2c4c6: 85 e0 ldi r24, 0x05 ; 5 2c4c8: ef e2 ldi r30, 0x2F ; 47 2c4ca: f2 e1 ldi r31, 0x12 ; 18 2c4cc: de 01 movw r26, r28 2c4ce: 16 96 adiw r26, 0x06 ; 6 2c4d0: 01 90 ld r0, Z+ 2c4d2: 0d 92 st X+, r0 2c4d4: 8a 95 dec r24 2c4d6: e1 f7 brne .-8 ; 0x2c4d0 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2c4d8: 85 e0 ldi r24, 0x05 ; 5 2c4da: fe 01 movw r30, r28 2c4dc: 36 96 adiw r30, 0x06 ; 6 2c4de: aa e2 ldi r26, 0x2A ; 42 2c4e0: b2 e1 ldi r27, 0x12 ; 18 2c4e2: 01 90 ld r0, Z+ 2c4e4: 0d 92 st X+, r0 2c4e6: 8a 95 dec r24 2c4e8: e1 f7 brne .-8 ; 0x2c4e2 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 2c4ea: 40 e0 ldi r20, 0x00 ; 0 2c4ec: 60 e0 ldi r22, 0x00 ; 0 2c4ee: ce 01 movw r24, r28 2c4f0: 01 96 adiw r24, 0x01 ; 1 2c4f2: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c4f6: 85 e0 ldi r24, 0x05 ; 5 2c4f8: fe 01 movw r30, r28 2c4fa: 31 96 adiw r30, 0x01 ; 1 2c4fc: af e2 ldi r26, 0x2F ; 47 2c4fe: b2 e1 ldi r27, 0x12 ; 18 2c500: 01 90 ld r0, Z+ 2c502: 0d 92 st X+, r0 2c504: 8a 95 dec r24 2c506: e1 f7 brne .-8 ; 0x2c500 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2c508: 85 e0 ldi r24, 0x05 ; 5 2c50a: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2c50e: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2c512: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2c516: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2c51a: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2c51e: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2c522: 0f 94 c0 3b call 0x27780 ; 0x27780 2c526: 2e c0 rjmp .+92 ; 0x2c584 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 2c528: 82 35 cpi r24, 0x52 ; 82 2c52a: b1 f1 breq .+108 ; 0x2c598 2c52c: 87 35 cpi r24, 0x57 ; 87 2c52e: 41 f6 brne .-112 ; 0x2c4c0 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); 2c530: 60 91 31 12 lds r22, 0x1231 ; 0x801231 2c534: 70 91 32 12 lds r23, 0x1232 ; 0x801232 2c538: 4c e0 ldi r20, 0x0C ; 12 2c53a: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c53e: 0f 94 2b 3c call 0x27856 ; 0x27856 2c542: 11 c0 rjmp .+34 ; 0x2c566 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 2c544: 40 91 30 12 lds r20, 0x1230 ; 0x801230 2c548: 62 e4 ldi r22, 0x42 ; 66 2c54a: ce 01 movw r24, r28 2c54c: 01 96 adiw r24, 0x01 ; 1 2c54e: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c552: 49 81 ldd r20, Y+1 ; 0x01 2c554: 5a 81 ldd r21, Y+2 ; 0x02 2c556: 6b 81 ldd r22, Y+3 ; 0x03 2c558: 7c 81 ldd r23, Y+4 ; 0x04 2c55a: 8d 81 ldd r24, Y+5 ; 0x05 2c55c: 0f 94 c0 3b call 0x27780 ; 0x27780 scopeState = ScopeState::ButtonSent; 2c560: 8a e0 ldi r24, 0x0A ; 10 2c562: 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); 2c566: 40 e0 ldi r20, 0x00 ; 0 2c568: 60 e0 ldi r22, 0x00 ; 0 2c56a: ce 01 movw r24, r28 2c56c: 01 96 adiw r24, 0x01 ; 1 2c56e: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c572: 85 e0 ldi r24, 0x05 ; 5 2c574: fe 01 movw r30, r28 2c576: 31 96 adiw r30, 0x01 ; 1 2c578: af e2 ldi r26, 0x2F ; 47 2c57a: b2 e1 ldi r27, 0x12 ; 18 2c57c: 01 90 ld r0, Z+ 2c57e: 0d 92 st X+, r0 2c580: 8a 95 dec r24 2c582: e1 f7 brne .-8 ; 0x2c57c default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 2c584: 81 e0 ldi r24, 0x01 ; 1 } } 2c586: 2a 96 adiw r28, 0x0a ; 10 2c588: 0f b6 in r0, 0x3f ; 63 2c58a: f8 94 cli 2c58c: de bf out 0x3e, r29 ; 62 2c58e: 0f be out 0x3f, r0 ; 63 2c590: cd bf out 0x3d, r28 ; 61 2c592: df 91 pop r29 2c594: cf 91 pop r28 2c596: 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); 2c598: 6b e0 ldi r22, 0x0B ; 11 2c59a: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c59e: 0f 94 ee 61 call 0x2c3dc ; 0x2c3dc 2c5a2: e1 cf rjmp .-62 ; 0x2c566 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 2c5a4: 80 e0 ldi r24, 0x00 ; 0 2c5a6: ef cf rjmp .-34 ; 0x2c586 0002c5a8 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 2c5a8: cf 93 push r28 2c5aa: df 93 push r29 2c5ac: 00 d0 rcall .+0 ; 0x2c5ae 2c5ae: 1f 92 push r1 2c5b0: 1f 92 push r1 2c5b2: cd b7 in r28, 0x3d ; 61 2c5b4: de b7 in r29, 0x3e ; 62 2c5b6: 49 83 std Y+1, r20 ; 0x01 2c5b8: 5a 83 std Y+2, r21 ; 0x02 2c5ba: 6b 83 std Y+3, r22 ; 0x03 2c5bc: 7c 83 std Y+4, r23 ; 0x04 2c5be: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 2c5c0: 85 e0 ldi r24, 0x05 ; 5 2c5c2: fe 01 movw r30, r28 2c5c4: 31 96 adiw r30, 0x01 ; 1 2c5c6: af e2 ldi r26, 0x2F ; 47 2c5c8: b2 e1 ldi r27, 0x12 ; 18 2c5ca: 01 90 ld r0, Z+ 2c5cc: 0d 92 st X+, r0 2c5ce: 8a 95 dec r24 2c5d0: e1 f7 brne .-8 ; 0x2c5ca if (!ExpectsResponse()) { 2c5d2: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2c5d6: 87 ff sbrs r24, 7 2c5d8: 09 c0 rjmp .+18 ; 0x2c5ec ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 2c5da: 0f 90 pop r0 2c5dc: 0f 90 pop r0 2c5de: 0f 90 pop r0 2c5e0: 0f 90 pop r0 2c5e2: 0f 90 pop r0 2c5e4: df 91 pop r29 2c5e6: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 2c5e8: 0d 94 4f 62 jmp 0x2c49e ; 0x2c49e } // otherwise wait for an empty window to activate the request } 2c5ec: 0f 90 pop r0 2c5ee: 0f 90 pop r0 2c5f0: 0f 90 pop r0 2c5f2: 0f 90 pop r0 2c5f4: 0f 90 pop r0 2c5f6: df 91 pop r29 2c5f8: cf 91 pop r28 2c5fa: 08 95 ret 0002c5fc : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2c5fc: cf 93 push r28 2c5fe: df 93 push r29 2c600: 00 d0 rcall .+0 ; 0x2c602 2c602: 1f 92 push r1 2c604: 1f 92 push r1 2c606: cd b7 in r28, 0x3d ; 61 2c608: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2c60a: 48 2f mov r20, r24 2c60c: 68 e5 ldi r22, 0x58 ; 88 2c60e: ce 01 movw r24, r28 2c610: 01 96 adiw r24, 0x01 ; 1 2c612: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c616: 49 81 ldd r20, Y+1 ; 0x01 2c618: 5a 81 ldd r21, Y+2 ; 0x02 2c61a: 6b 81 ldd r22, Y+3 ; 0x03 2c61c: 7c 81 ldd r23, Y+4 ; 0x04 2c61e: 8d 81 ldd r24, Y+5 ; 0x05 2c620: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 } 2c624: 0f 90 pop r0 2c626: 0f 90 pop r0 2c628: 0f 90 pop r0 2c62a: 0f 90 pop r0 2c62c: 0f 90 pop r0 2c62e: df 91 pop r29 2c630: cf 91 pop r28 2c632: 08 95 ret 0002c634 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 2c634: 1f 93 push r17 2c636: cf 93 push r28 2c638: df 93 push r29 2c63a: 00 d0 rcall .+0 ; 0x2c63c 2c63c: 1f 92 push r1 2c63e: 1f 92 push r1 2c640: cd b7 in r28, 0x3d ; 61 2c642: de b7 in r29, 0x3e ; 62 2c644: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 2c646: 48 2f mov r20, r24 2c648: 63 e5 ldi r22, 0x53 ; 83 2c64a: ce 01 movw r24, r28 2c64c: 01 96 adiw r24, 0x01 ; 1 2c64e: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c652: 49 81 ldd r20, Y+1 ; 0x01 2c654: 5a 81 ldd r21, Y+2 ; 0x02 2c656: 6b 81 ldd r22, Y+3 ; 0x03 2c658: 7c 81 ldd r23, Y+4 ; 0x04 2c65a: 8d 81 ldd r24, Y+5 ; 0x05 2c65c: 0f 94 c0 3b call 0x27780 ; 0x27780 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 2c660: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c664: 0f 90 pop r0 2c666: 0f 90 pop r0 2c668: 0f 90 pop r0 2c66a: 0f 90 pop r0 2c66c: 0f 90 pop r0 2c66e: df 91 pop r29 2c670: cf 91 pop r28 2c672: 1f 91 pop r17 2c674: 08 95 ret 0002c676 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 2c676: 1f 93 push r17 2c678: cf 93 push r28 2c67a: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 2c67c: e1 e0 ldi r30, 0x01 ; 1 2c67e: f1 e0 ldi r31, 0x01 ; 1 2c680: 80 81 ld r24, Z 2c682: 8e 7f andi r24, 0xFE ; 254 2c684: 80 83 st Z, r24 PORTH |= 0x01; 2c686: e2 e0 ldi r30, 0x02 ; 2 2c688: f1 e0 ldi r31, 0x01 ; 1 2c68a: 80 81 ld r24, Z 2c68c: 81 60 ori r24, 0x01 ; 1 2c68e: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 2c690: ef ea ldi r30, 0xAF ; 175 2c692: fd e0 ldi r31, 0x0D ; 13 2c694: 90 e1 ldi r25, 0x10 ; 16 2c696: 90 83 st Z, r25 ptr[1] = 0; 2c698: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 2c69a: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 2c69c: e0 ed ldi r30, 0xD0 ; 208 2c69e: f0 e0 ldi r31, 0x00 ; 0 2c6a0: 80 81 ld r24, Z 2c6a2: 82 60 ori r24, 0x02 ; 2 2c6a4: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 2c6a6: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 2c6aa: e1 ed ldi r30, 0xD1 ; 209 2c6ac: f0 e0 ldi r31, 0x00 ; 0 2c6ae: 88 e1 ldi r24, 0x18 ; 24 2c6b0: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 2c6b2: 80 81 ld r24, Z 2c6b4: 80 68 ori r24, 0x80 ; 128 2c6b6: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 2c6b8: e7 e0 ldi r30, 0x07 ; 7 2c6ba: f2 e1 ldi r31, 0x12 ; 18 2c6bc: 8b eb ldi r24, 0xBB ; 187 2c6be: 97 ef ldi r25, 0xF7 ; 247 2c6c0: 91 87 std Z+9, r25 ; 0x09 2c6c2: 80 87 std Z+8, r24 ; 0x08 2c6c4: 83 ea ldi r24, 0xA3 ; 163 2c6c6: 97 ef ldi r25, 0xF7 ; 247 2c6c8: 93 87 std Z+11, r25 ; 0x0b 2c6ca: 82 87 std Z+10, r24 ; 0x0a 2c6cc: 13 e0 ldi r17, 0x03 ; 3 2c6ce: 13 83 std Z+3, r17 ; 0x03 2c6d0: 15 86 std Z+13, r1 ; 0x0d 2c6d2: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c6d4: 80 e0 ldi r24, 0x00 ; 0 2c6d6: 0f 94 fe 62 call 0x2c5fc ; 0x2c5fc mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 2c6da: 83 e6 ldi r24, 0x63 ; 99 2c6dc: 0f 94 50 41 call 0x282a0 ; 0x282a0 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2c6e0: 85 e8 ldi r24, 0x85 ; 133 2c6e2: 9c e9 ldi r25, 0x9C ; 156 2c6e4: 0e 94 de 72 call 0xe5bc ; 0xe5bc retryAttempts = MAX_RETRIES; 2c6e8: c5 e2 ldi r28, 0x25 ; 37 2c6ea: d2 e1 ldi r29, 0x12 ; 18 2c6ec: 10 93 79 12 sts 0x1279, r17 ; 0x801279 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2c6f0: 8a e0 ldi r24, 0x0A ; 10 2c6f2: 9e e9 ldi r25, 0x9E ; 158 2c6f4: 0e 94 de 72 call 0xe5bc ; 0xe5bc /// @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; } 2c6f8: 8a e0 ldi r24, 0x0A ; 10 2c6fa: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 2c6fc: 82 e0 ldi r24, 0x02 ; 2 2c6fe: 80 93 94 12 sts 0x1294, r24 ; 0x801294 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2c702: 81 e0 ldi r24, 0x01 ; 1 2c704: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 2c706: 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; 2c708: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2c70a: 86 e0 ldi r24, 0x06 ; 6 2c70c: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 2c70e: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 2c710: df 91 pop r29 2c712: cf 91 pop r28 2c714: 1f 91 pop r17 2c716: 0d 94 1a 63 jmp 0x2c634 ; 0x2c634 0002c71a : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 2c71a: cf 93 push r28 2c71c: df 93 push r29 2c71e: 00 d0 rcall .+0 ; 0x2c720 2c720: 1f 92 push r1 2c722: 1f 92 push r1 2c724: cd b7 in r28, 0x3d ; 61 2c726: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 2c728: 40 e0 ldi r20, 0x00 ; 0 2c72a: 61 e5 ldi r22, 0x51 ; 81 2c72c: ce 01 movw r24, r28 2c72e: 01 96 adiw r24, 0x01 ; 1 2c730: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c734: 49 81 ldd r20, Y+1 ; 0x01 2c736: 5a 81 ldd r21, Y+2 ; 0x02 2c738: 6b 81 ldd r22, Y+3 ; 0x03 2c73a: 7c 81 ldd r23, Y+4 ; 0x04 2c73c: 8d 81 ldd r24, Y+5 ; 0x05 2c73e: 0f 94 c0 3b call 0x27780 ; 0x27780 scopeState = ScopeState::QuerySent; 2c742: 84 e0 ldi r24, 0x04 ; 4 2c744: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c748: 0f 90 pop r0 2c74a: 0f 90 pop r0 2c74c: 0f 90 pop r0 2c74e: 0f 90 pop r0 2c750: 0f 90 pop r0 2c752: df 91 pop r29 2c754: cf 91 pop r28 2c756: 08 95 ret 0002c758 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 2c758: cf 93 push r28 2c75a: df 93 push r29 2c75c: 00 d0 rcall .+0 ; 0x2c75e 2c75e: 1f 92 push r1 2c760: 1f 92 push r1 2c762: cd b7 in r28, 0x3d ; 61 2c764: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 2c766: 0f 94 d7 87 call 0x30fae ; 0x30fae 2c76a: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2c76e: 48 2f mov r20, r24 2c770: 66 e6 ldi r22, 0x66 ; 102 2c772: ce 01 movw r24, r28 2c774: 01 96 adiw r24, 0x01 ; 1 2c776: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c77a: 49 81 ldd r20, Y+1 ; 0x01 2c77c: 5a 81 ldd r21, Y+2 ; 0x02 2c77e: 6b 81 ldd r22, Y+3 ; 0x03 2c780: 7c 81 ldd r23, Y+4 ; 0x04 2c782: 8d 81 ldd r24, Y+5 ; 0x05 2c784: 0f 94 c0 3b call 0x27780 ; 0x27780 scopeState = ScopeState::FilamentSensorStateSent; 2c788: 86 e0 ldi r24, 0x06 ; 6 2c78a: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c78e: 0f 90 pop r0 2c790: 0f 90 pop r0 2c792: 0f 90 pop r0 2c794: 0f 90 pop r0 2c796: 0f 90 pop r0 2c798: df 91 pop r29 2c79a: cf 91 pop r28 2c79c: 08 95 ret 0002c79e : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 2c79e: cf 93 push r28 2c7a0: df 93 push r29 2c7a2: 00 d0 rcall .+0 ; 0x2c7a4 2c7a4: 1f 92 push r1 2c7a6: 1f 92 push r1 2c7a8: cd b7 in r28, 0x3d ; 61 2c7aa: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 2c7ac: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2c7b0: 85 34 cpi r24, 0x45 ; 69 2c7b2: f1 f0 breq .+60 ; 0x2c7f0 2c7b4: 20 f4 brcc .+8 ; 0x2c7be 2c7b6: 82 34 cpi r24, 0x42 ; 66 2c7b8: 51 f1 breq .+84 ; 0x2c80e } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 2c7ba: 85 e0 ldi r24, 0x05 ; 5 2c7bc: 11 c0 rjmp .+34 ; 0x2c7e0 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 2c7be: 86 34 cpi r24, 0x46 ; 70 2c7c0: 71 f1 breq .+92 ; 0x2c81e 2c7c2: 80 35 cpi r24, 0x50 ; 80 2c7c4: d1 f7 brne .-12 ; 0x2c7ba case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 2c7c6: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c7ca: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2c7ce: 81 e0 ldi r24, 0x01 ; 1 2c7d0: 90 e0 ldi r25, 0x00 ; 0 2c7d2: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c7d6: 80 93 65 12 sts 0x1265, r24 ; 0x801265 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 2c7da: 0f 94 ac 63 call 0x2c758 ; 0x2c758 return Processing; 2c7de: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 2c7e0: 0f 90 pop r0 2c7e2: 0f 90 pop r0 2c7e4: 0f 90 pop r0 2c7e6: 0f 90 pop r0 2c7e8: 0f 90 pop r0 2c7ea: df 91 pop r29 2c7ec: cf 91 pop r28 2c7ee: 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; 2c7f0: 8c e0 ldi r24, 0x0C ; 12 2c7f2: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2c7f6: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c7fa: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2c7fe: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c802: 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(); 2c806: 0f 94 ac 63 call 0x2c758 ; 0x2c758 return CommandError; 2c80a: 87 e0 ldi r24, 0x07 ; 7 2c80c: e9 cf rjmp .-46 ; 0x2c7e0 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); 2c80e: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c812: 80 93 68 12 sts 0x1268, r24 ; 0x801268 SendAndUpdateFilamentSensor(); 2c816: 0f 94 ac 63 call 0x2c758 ; 0x2c758 return ButtonPushed; 2c81a: 8b e0 ldi r24, 0x0B ; 11 2c81c: e1 cf rjmp .-62 ; 0x2c7e0 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) { 2c81e: 90 91 2a 12 lds r25, 0x122A ; 0x80122a 2c822: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2c826: 98 13 cpse r25, r24 2c828: 22 c0 rjmp .+68 ; 0x2c86e 2c82a: 90 91 2b 12 lds r25, 0x122B ; 0x80122b 2c82e: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2c832: 98 13 cpse r25, r24 2c834: 1c c0 rjmp .+56 ; 0x2c86e progressCode = ProgressCode::OK; 2c836: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::OK; 2c83a: 81 e0 ldi r24, 0x01 ; 1 2c83c: 90 e0 ldi r25, 0x00 ; 0 2c83e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c842: 80 93 65 12 sts 0x1265, r24 ; 0x801265 scopeState = ScopeState::Ready; 2c846: 82 e8 ldi r24, 0x82 ; 130 2c848: 80 93 28 12 sts 0x1228, r24 ; 0x801228 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 2c84c: 40 e0 ldi r20, 0x00 ; 0 2c84e: 60 e0 ldi r22, 0x00 ; 0 2c850: ce 01 movw r24, r28 2c852: 01 96 adiw r24, 0x01 ; 1 2c854: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c858: 85 e0 ldi r24, 0x05 ; 5 2c85a: fe 01 movw r30, r28 2c85c: 31 96 adiw r30, 0x01 ; 1 2c85e: aa e2 ldi r26, 0x2A ; 42 2c860: b2 e1 ldi r27, 0x12 ; 18 2c862: 01 90 ld r0, Z+ 2c864: 0d 92 st X+, r0 2c866: 8a 95 dec r24 2c868: e1 f7 brne .-8 ; 0x2c862 2c86a: 82 e0 ldi r24, 0x02 ; 2 2c86c: b9 cf rjmp .-142 ; 0x2c7e0 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 2c86e: 83 e0 ldi r24, 0x03 ; 3 2c870: b7 cf rjmp .-146 ; 0x2c7e0 0002c872 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 2c872: 1f 93 push r17 2c874: cf 93 push r28 2c876: df 93 push r29 2c878: 00 d0 rcall .+0 ; 0x2c87a 2c87a: 1f 92 push r1 2c87c: 1f 92 push r1 2c87e: cd b7 in r28, 0x3d ; 61 2c880: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 2c882: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 2c886: 81 11 cpse r24, r1 2c888: 2a c0 rjmp .+84 ; 0x2c8de auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 2c88a: 10 91 8f 12 lds r17, 0x128F ; 0x80128f 2c88e: 1f 3f cpi r17, 0xFF ; 255 2c890: 91 f5 brne .+100 ; 0x2c8f6 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 2c892: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c896: 81 11 cpse r24, r1 2c898: 60 c0 rjmp .+192 ; 0x2c95a 2c89a: 1f 3f cpi r17, 0xFF ; 255 2c89c: b9 f0 breq .+46 ; 0x2c8cc inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 2c89e: 81 e0 ldi r24, 0x01 ; 1 2c8a0: 90 e0 ldi r25, 0x00 ; 0 2c8a2: 90 93 26 12 sts 0x1226, r25 ; 0x801226 2c8a6: 80 93 25 12 sts 0x1225, r24 ; 0x801225 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 2c8aa: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 2c8ae: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c lastErrorSource = ErrorSource::ErrorSourceNone; 2c8b2: 8f ef ldi r24, 0xFF ; 255 2c8b4: 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) { 2c8b8: 13 30 cpi r17, 0x03 ; 3 2c8ba: 09 f4 brne .+2 ; 0x2c8be 2c8bc: 82 c0 rjmp .+260 ; 0x2c9c2 2c8be: f8 f0 brcs .+62 ; 0x2c8fe 2c8c0: 16 30 cpi r17, 0x06 ; 6 2c8c2: 08 f4 brcc .+2 ; 0x2c8c6 2c8c4: 7b c0 rjmp .+246 ; 0x2c9bc 2c8c6: 17 30 cpi r17, 0x07 ; 7 2c8c8: 09 f4 brne .+2 ; 0x2c8cc 2c8ca: 7f c0 rjmp .+254 ; 0x2c9ca // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 2c8cc: 0f 90 pop r0 2c8ce: 0f 90 pop r0 2c8d0: 0f 90 pop r0 2c8d2: 0f 90 pop r0 2c8d4: 0f 90 pop r0 2c8d6: df 91 pop r29 2c8d8: cf 91 pop r28 2c8da: 1f 91 pop r17 2c8dc: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 2c8de: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c8e2: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c8e6: 0f 94 64 8a call 0x314c8 ; 0x314c8 2c8ea: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 2c8ec: 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) { 2c8f0: 8f 3f cpi r24, 0xFF ; 255 2c8f2: 79 f6 brne .-98 ; 0x2c892 2c8f4: ca cf rjmp .-108 ; 0x2c88a btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 2c8f6: 8f ef ldi r24, 0xFF ; 255 2c8f8: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f 2c8fc: ca cf rjmp .-108 ; 0x2c892 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 2c8fe: 8e e6 ldi r24, 0x6E ; 110 2c900: 9c e9 ldi r25, 0x9C ; 156 2c902: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 2c906: 81 2f mov r24, r17 2c908: 90 e0 ldi r25, 0x00 ; 0 2c90a: 0f 94 48 41 call 0x28290 ; 0x28290 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 2c90e: 0f 94 07 6a call 0x2d40e ; 0x2d40e if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 2c912: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c916: 81 30 cpi r24, 0x01 ; 1 2c918: 89 f4 brne .+34 ; 0x2c93c ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 2c91a: 87 e6 ldi r24, 0x67 ; 103 2c91c: 9c e9 ldi r25, 0x9C ; 156 2c91e: 0f 94 c7 87 call 0x30f8e ; 0x30f8e void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 2c922: 41 2f mov r20, r17 2c924: 62 e4 ldi r22, 0x42 ; 66 2c926: ce 01 movw r24, r28 2c928: 01 96 adiw r24, 0x01 ; 1 2c92a: 0f 94 94 87 call 0x30f28 ; 0x30f28 2c92e: 49 81 ldd r20, Y+1 ; 0x01 2c930: 5a 81 ldd r21, Y+2 ; 0x02 2c932: 6b 81 ldd r22, Y+3 ; 0x03 2c934: 7c 81 ldd r23, Y+4 ; 0x04 2c936: 8d 81 ldd r24, Y+5 ; 0x05 2c938: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 } // 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) { 2c93c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c940: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c944: 84 30 cpi r24, 0x04 ; 4 2c946: 20 e8 ldi r18, 0x80 ; 128 2c948: 92 07 cpc r25, r18 2c94a: 21 f0 breq .+8 ; 0x2c954 2c94c: 89 30 cpi r24, 0x09 ; 9 2c94e: 90 48 sbci r25, 0x80 ; 128 2c950: 09 f0 breq .+2 ; 0x2c954 2c952: bc cf rjmp .-136 ; 0x2c8cc case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 2c954: 0f 94 93 3e call 0x27d26 ; 0x27d26 2c958: b9 cf rjmp .-142 ; 0x2c8cc // 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) { 2c95a: 19 30 cpi r17, 0x09 ; 9 2c95c: 08 f0 brcs .+2 ; 0x2c960 2c95e: b6 cf rjmp .-148 ; 0x2c8cc 2c960: e1 2f mov r30, r17 2c962: f0 e0 ldi r31, 0x00 ; 0 2c964: 88 27 eor r24, r24 2c966: e8 54 subi r30, 0x48 ; 72 2c968: fb 49 sbci r31, 0x9B ; 155 2c96a: 8e 4f sbci r24, 0xFE ; 254 2c96c: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 2c970: 5b 37 cpi r21, 0x7B ; 123 2c972: 5b 37 cpi r21, 0x7B ; 123 2c974: 5b 37 cpi r21, 0x7B ; 123 2c976: c9 38 cpi r28, 0x89 ; 137 2c978: ff 36 cpi r31, 0x6F ; 111 2c97a: ff 36 cpi r31, 0x6F ; 111 2c97c: 0d 38 cpi r16, 0x8D ; 141 2c97e: bf 38 cpi r27, 0x8F ; 143 2c980: 19 37 cpi r17, 0x79 ; 121 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 2c982: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c986: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c98a: 87 38 cpi r24, 0x87 ; 135 2c98c: 20 e8 ldi r18, 0x80 ; 128 2c98e: 92 07 cpc r25, r18 2c990: 21 f0 breq .+8 ; 0x2c99a 2c992: 87 30 cpi r24, 0x07 ; 7 2c994: 91 48 sbci r25, 0x81 ; 129 2c996: 09 f0 breq .+2 ; 0x2c99a 2c998: 99 cf rjmp .-206 ; 0x2c8cc // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2c99a: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2c99e: 84 30 cpi r24, 0x04 ; 4 2c9a0: 21 f4 brne .+8 ; 0x2c9aa ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 2c9a2: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2c9a6: 81 11 cpse r24, r1 2c9a8: 91 cf rjmp .-222 ; 0x2c8cc // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 2c9aa: 81 e0 ldi r24, 0x01 ; 1 2c9ac: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> menu_submenu(tuneIdlerStallguardThresholdMenu); 2c9b0: 60 e0 ldi r22, 0x00 ; 0 2c9b2: 8b e1 ldi r24, 0x1B ; 27 2c9b4: 98 e3 ldi r25, 0x38 ; 56 2c9b6: 0f 94 ca 94 call 0x32994 ; 0x32994 2c9ba: 88 cf rjmp .-240 ; 0x2c8cc } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 2c9bc: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2c9c0: 85 cf rjmp .-246 ; 0x2c8cc break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c9c2: 80 e0 ldi r24, 0x00 ; 0 2c9c4: 0f 94 fe 62 call 0x2c5fc ; 0x2c5fc 2c9c8: 81 cf rjmp .-254 ; 0x2c8cc StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2c9ca: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2c9ce: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2c9d2: 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); 2c9d6: 60 e0 ldi r22, 0x00 ; 0 2c9d8: 8c ea ldi r24, 0xAC ; 172 2c9da: 9c e0 ldi r25, 0x0C ; 12 2c9dc: 0f 94 a1 a0 call 0x34142 ; 0x34142 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 2c9e0: 0f 94 36 41 call 0x2826c ; 0x2826c 2c9e4: 73 cf rjmp .-282 ; 0x2c8cc 0002c9e6 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 2c9e6: 4f 92 push r4 2c9e8: 5f 92 push r5 2c9ea: 6f 92 push r6 2c9ec: 7f 92 push r7 2c9ee: 8f 92 push r8 2c9f0: 9f 92 push r9 2c9f2: af 92 push r10 2c9f4: bf 92 push r11 2c9f6: cf 92 push r12 2c9f8: df 92 push r13 2c9fa: ef 92 push r14 2c9fc: ff 92 push r15 2c9fe: 0f 93 push r16 2ca00: 1f 93 push r17 2ca02: cf 93 push r28 2ca04: df 93 push r29 2ca06: cd b7 in r28, 0x3d ; 61 2ca08: de b7 in r29, 0x3e ; 62 2ca0a: a0 97 sbiw r28, 0x20 ; 32 2ca0c: 0f b6 in r0, 0x3f ; 63 2ca0e: f8 94 cli 2ca10: de bf out 0x3e, r29 ; 62 2ca12: 0f be out 0x3f, r0 ; 63 2ca14: cd bf out 0x3d, r28 ; 61 2ca16: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 2ca18: 0f 94 39 64 call 0x2c872 ; 0x2c872 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 2ca1c: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2ca20: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 2ca22: 0f 94 4f 62 call 0x2c49e ; 0x2c49e 2ca26: 90 91 28 12 lds r25, 0x1228 ; 0x801228 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 2ca2a: 97 ff sbrs r25, 7 2ca2c: 7d c0 rjmp .+250 ; 0x2cb28 // we are waiting for something switch (currentScope) { 2ca2e: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2ca32: 82 30 cpi r24, 0x02 ; 2 2ca34: b1 f0 breq .+44 ; 0x2ca62 2ca36: 08 f4 brcc .+2 ; 0x2ca3a 2ca38: 75 c0 rjmp .+234 ; 0x2cb24 2ca3a: 83 30 cpi r24, 0x03 ; 3 2ca3c: e1 f1 breq .+120 ; 0x2cab6 2ca3e: 84 30 cpi r24, 0x04 ; 4 2ca40: 09 f4 brne .+2 ; 0x2ca44 2ca42: 54 c0 rjmp .+168 ; 0x2caec 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 2ca44: 0f 94 4f 62 call 0x2c49e ; 0x2c49e 2ca48: 81 11 cpse r24, r1 2ca4a: 6b c3 rjmp .+1750 ; 0x2d122 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 2ca4c: 82 e0 ldi r24, 0x02 ; 2 2ca4e: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2ca52: 83 e0 ldi r24, 0x03 ; 3 2ca54: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2ca58: 82 e8 ldi r24, 0x82 ; 130 2ca5a: 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()) { 2ca5e: 12 e0 ldi r17, 0x02 ; 2 2ca60: db c2 rjmp .+1462 ; 0x2d018 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2ca62: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2ca66: ab 01 movw r20, r22 2ca68: bc 01 movw r22, r24 2ca6a: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2ca6e: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2ca72: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2ca76: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2ca7a: 88 51 subi r24, 0x18 ; 24 2ca7c: 9c 4f sbci r25, 0xFC ; 252 2ca7e: af 4f sbci r26, 0xFF ; 255 2ca80: 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 2ca82: 48 17 cp r20, r24 2ca84: 59 07 cpc r21, r25 2ca86: 6a 07 cpc r22, r26 2ca88: 7b 07 cpc r23, r27 2ca8a: 08 f4 brcc .+2 ; 0x2ca8e 2ca8c: 4b c0 rjmp .+150 ; 0x2cb24 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 2ca8e: 87 e0 ldi r24, 0x07 ; 7 2ca90: 92 e1 ldi r25, 0x12 ; 18 2ca92: 0f 94 a9 9e call 0x33d52 ; 0x33d52 while (uart->read() != -1) 2ca96: 01 96 adiw r24, 0x01 ; 1 2ca98: d1 f7 brne .-12 ; 0x2ca8e initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2ca9a: 81 e0 ldi r24, 0x01 ; 1 2ca9c: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2caa0: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2caa4: 10 92 49 12 sts 0x1249, r1 ; 0x801249 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2caa8: 86 e0 ldi r24, 0x06 ; 6 2caaa: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2caae: 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); 2cab0: 0f 94 1a 63 call 0x2c634 ; 0x2c634 2cab4: 37 c0 rjmp .+110 ; 0x2cb24 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 2cab6: 92 38 cpi r25, 0x82 ; 130 2cab8: 29 f6 brne .-118 ; 0x2ca44 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2caba: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2cabe: ab 01 movw r20, r22 2cac0: bc 01 movw r22, r24 2cac2: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cac6: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2caca: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cace: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cad2: 88 51 subi r24, 0x18 ; 24 2cad4: 9c 4f sbci r25, 0xFC ; 252 2cad6: af 4f sbci r26, 0xFF ; 255 2cad8: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 2cada: 48 17 cp r20, r24 2cadc: 59 07 cpc r21, r25 2cade: 6a 07 cpc r22, r26 2cae0: 7b 07 cpc r23, r27 2cae2: 08 f4 brcc .+2 ; 0x2cae6 2cae4: af cf rjmp .-162 ; 0x2ca44 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 2cae6: 0f 94 8d 63 call 0x2c71a ; 0x2c71a 2caea: 1c c0 rjmp .+56 ; 0x2cb24 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2caec: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2caf0: ab 01 movw r20, r22 2caf2: bc 01 movw r22, r24 2caf4: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2caf8: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cafc: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cb00: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cb04: 88 51 subi r24, 0x18 ; 24 2cb06: 9c 4f sbci r25, 0xFC ; 252 2cb08: af 4f sbci r26, 0xFF ; 255 2cb0a: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 2cb0c: 48 17 cp r20, r24 2cb0e: 59 07 cpc r21, r25 2cb10: 6a 07 cpc r22, r26 2cb12: 7b 07 cpc r23, r27 2cb14: 40 f7 brcc .-48 ; 0x2cae6 }; 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(); 2cb16: 0f 94 d7 87 call 0x30fae ; 0x30fae if (fs != lastFSensor) { 2cb1a: 90 91 69 12 lds r25, 0x1269 ; 0x801269 2cb1e: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 2cb20: 0f 94 ac 63 call 0x2c758 ; 0x2c758 // 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; 2cb24: 10 e0 ldi r17, 0x00 ; 0 2cb26: 78 c2 rjmp .+1264 ; 0x2d018 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 2cb28: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 2cb2a: d1 2c mov r13, r1 2cb2c: 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; 2cb2e: 99 24 eor r9, r9 2cb30: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cb32: 55 e0 ldi r21, 0x05 ; 5 2cb34: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2cb36: 63 e0 ldi r22, 0x03 ; 3 2cb38: 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; 2cb3a: 74 e0 ldi r23, 0x04 ; 4 2cb3c: 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; 2cb3e: e2 e0 ldi r30, 0x02 ; 2 2cb40: 6e 2e mov r6, r30 2cb42: 66 c0 rjmp .+204 ; 0x2cc10 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cb44: 23 30 cpi r18, 0x03 ; 3 2cb46: 09 f4 brne .+2 ; 0x2cb4a 2cb48: e0 c0 rjmp .+448 ; 0x2cd0a 2cb4a: 24 30 cpi r18, 0x04 ; 4 2cb4c: 09 f0 breq .+2 ; 0x2cb50 2cb4e: 83 c0 rjmp .+262 ; 0x2cc56 } 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'); 2cb50: 20 ed ldi r18, 0xD0 ; 208 2cb52: 28 0f add r18, r24 2cb54: 2a 30 cpi r18, 0x0A ; 10 2cb56: 08 f4 brcc .+2 ; 0x2cb5a 2cb58: f8 c0 rjmp .+496 ; 0x2cd4a 2cb5a: 2f e9 ldi r18, 0x9F ; 159 2cb5c: 28 0f add r18, r24 2cb5e: 26 30 cpi r18, 0x06 ; 6 2cb60: 08 f4 brcc .+2 ; 0x2cb64 2cb62: f3 c0 rjmp .+486 ; 0x2cd4a ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cb64: 8a 30 cpi r24, 0x0A ; 10 2cb66: 09 f0 breq .+2 ; 0x2cb6a 2cb68: fa c0 rjmp .+500 ; 0x2cd5e 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()) { 2cb6a: 40 90 4e 12 lds r4, 0x124E ; 0x80124e 2cb6e: 8a e4 ldi r24, 0x4A ; 74 2cb70: 92 e1 ldi r25, 0x12 ; 18 2cb72: 0f 94 83 87 call 0x30f06 ; 0x30f06 2cb76: 48 12 cpse r4, r24 2cb78: b8 c0 rjmp .+368 ; 0x2ccea // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 2cb7a: 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; } 2cb7e: 88 e0 ldi r24, 0x08 ; 8 2cb80: ea e4 ldi r30, 0x4A ; 74 2cb82: f2 e1 ldi r31, 0x12 ; 18 2cb84: de 01 movw r26, r28 2cb86: 51 96 adiw r26, 0x11 ; 17 2cb88: 01 90 ld r0, Z+ 2cb8a: 0d 92 st X+, r0 2cb8c: 8a 95 dec r24 2cb8e: e1 f7 brne .-8 ; 0x2cb88 2cb90: 88 e0 ldi r24, 0x08 ; 8 2cb92: fe 01 movw r30, r28 2cb94: 71 96 adiw r30, 0x11 ; 17 2cb96: de 01 movw r26, r28 2cb98: 59 96 adiw r26, 0x19 ; 25 2cb9a: 01 90 ld r0, Z+ 2cb9c: 0d 92 st X+, r0 2cb9e: 8a 95 dec r24 2cba0: e1 f7 brne .-8 ; 0x2cb9a while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 2cba2: 88 e0 ldi r24, 0x08 ; 8 2cba4: fe 01 movw r30, r28 2cba6: 79 96 adiw r30, 0x19 ; 25 2cba8: aa e3 ldi r26, 0x3A ; 58 2cbaa: b2 e1 ldi r27, 0x12 ; 18 2cbac: 01 90 ld r0, Z+ 2cbae: 0d 92 st X+, r0 2cbb0: 8a 95 dec r24 2cbb2: e1 f7 brne .-8 ; 0x2cbac } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 2cbb4: 8c e3 ldi r24, 0x3C ; 60 2cbb6: 89 83 std Y+1, r24 ; 0x01 2cbb8: fe 01 movw r30, r28 2cbba: 32 96 adiw r30, 0x02 ; 2 2cbbc: a2 e5 ldi r26, 0x52 ; 82 2cbbe: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 2cbc0: 20 e0 ldi r18, 0x00 ; 0 2cbc2: cf 01 movw r24, r30 2cbc4: 52 16 cp r5, r18 2cbc6: 09 f4 brne .+2 ; 0x2cbca 2cbc8: cd c0 rjmp .+410 ; 0x2cd64 uint8_t b = lastReceivedBytes[i]; 2cbca: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 2cbcc: 40 ee ldi r20, 0xE0 ; 224 2cbce: 43 0f add r20, r19 2cbd0: 40 36 cpi r20, 0x60 ; 96 2cbd2: 08 f0 brcs .+2 ; 0x2cbd6 b = '.'; 2cbd4: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 2cbd6: 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) { 2cbd8: 2f 5f subi r18, 0xFF ; 255 2cbda: f4 cf rjmp .-24 ; 0x2cbc4 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cbdc: 8e 34 cpi r24, 0x4E ; 78 2cbde: 08 f0 brcs .+2 ; 0x2cbe2 2cbe0: 56 c0 rjmp .+172 ; 0x2cc8e 2cbe2: 8b 34 cpi r24, 0x4B ; 75 2cbe4: 08 f0 brcs .+2 ; 0x2cbe8 2cbe6: 46 c0 rjmp .+140 ; 0x2cc74 2cbe8: 82 34 cpi r24, 0x42 ; 66 2cbea: 09 f4 brne .+2 ; 0x2cbee 2cbec: 43 c0 rjmp .+134 ; 0x2cc74 2cbee: e0 f5 brcc .+120 ; 0x2cc68 2cbf0: 8a 30 cpi r24, 0x0A ; 10 2cbf2: 59 f0 breq .+22 ; 0x2cc0a 2cbf4: 8d 30 cpi r24, 0x0D ; 13 2cbf6: 49 f0 breq .+18 ; 0x2cc0a } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cbf8: 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') { 2cbfc: a1 10 cpse r10, r1 2cbfe: 05 c1 rjmp .+522 ; 0x2ce0a 2cc00: 1f 36 cpi r17, 0x6F ; 111 2cc02: 09 f0 breq .+2 ; 0x2cc06 2cc04: fe c3 rjmp .+2044 ; 0x2d402 ++ok; 2cc06: aa 24 eor r10, r10 2cc08: 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; 2cc0a: 4f ef ldi r20, 0xFF ; 255 2cc0c: c4 1a sub r12, r20 2cc0e: d4 0a sbc r13, r20 2cc10: 87 e0 ldi r24, 0x07 ; 7 2cc12: 92 e1 ldi r25, 0x12 ; 18 2cc14: 0f 94 a9 9e call 0x33d52 ; 0x33d52 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) { 2cc18: 97 fd sbrc r25, 7 2cc1a: 00 c1 rjmp .+512 ; 0x2ce1c ++bytesConsumed; RecordReceivedByte(c); 2cc1c: 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]; 2cc1e: 20 91 62 12 lds r18, 0x1262 ; 0x801262 2cc22: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 2cc24: f9 01 movw r30, r18 2cc26: eb 5d subi r30, 0xDB ; 219 2cc28: fd 4e sbci r31, 0xED ; 237 2cc2a: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 2cc2c: 79 01 movw r14, r18 2cc2e: ef ef ldi r30, 0xFF ; 255 2cc30: ee 1a sub r14, r30 2cc32: fe 0a sbc r15, r30 2cc34: ff e0 ldi r31, 0x0F ; 15 2cc36: ef 22 and r14, r31 2cc38: ff 24 eor r15, r15 2cc3a: 5e 2c mov r5, r14 2cc3c: e0 92 62 12 sts 0x1262, r14 ; 0x801262 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cc40: 20 91 49 12 lds r18, 0x1249 ; 0x801249 2cc44: 22 30 cpi r18, 0x02 ; 2 2cc46: 09 f4 brne .+2 ; 0x2cc4a 2cc48: 48 c0 rjmp .+144 ; 0x2ccda 2cc4a: 08 f0 brcs .+2 ; 0x2cc4e 2cc4c: 7b cf rjmp .-266 ; 0x2cb44 2cc4e: 22 23 and r18, r18 2cc50: 29 f2 breq .-118 ; 0x2cbdc 2cc52: 21 30 cpi r18, 0x01 ; 1 2cc54: 51 f1 breq .+84 ; 0x2ccaa ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cc56: 1a 30 cpi r17, 0x0A ; 10 2cc58: 09 f4 brne .+2 ; 0x2cc5c 2cc5a: 8f cf rjmp .-226 ; 0x2cb7a 2cc5c: 1d 30 cpi r17, 0x0D ; 13 2cc5e: 09 f4 brne .+2 ; 0x2cc62 2cc60: 8c cf rjmp .-232 ; 0x2cb7a default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cc62: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cc66: ca cf rjmp .-108 ; 0x2cbfc } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cc68: 85 34 cpi r24, 0x45 ; 69 2cc6a: 30 f2 brcs .-116 ; 0x2cbf8 2cc6c: 87 34 cpi r24, 0x47 ; 71 2cc6e: 10 f0 brcs .+4 ; 0x2cc74 2cc70: 88 34 cpi r24, 0x48 ; 72 2cc72: 11 f6 brne .-124 ; 0x2cbf8 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 2cc74: 80 93 4a 12 sts 0x124A, r24 ; 0x80124a responseMsg.request.value = 0; 2cc78: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b responseMsg.request.value2 = 0; 2cc7c: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2cc80: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c responseMsg.request.crc8 = 0; 2cc84: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e rspState = ResponseStates::RequestValue; 2cc88: 90 92 49 12 sts 0x1249, r9 ; 0x801249 2cc8c: be cf rjmp .-132 ; 0x2cc0a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cc8e: 89 35 cpi r24, 0x59 ; 89 2cc90: 40 f4 brcc .+16 ; 0x2cca2 2cc92: 87 35 cpi r24, 0x57 ; 87 2cc94: 78 f7 brcc .-34 ; 0x2cc74 2cc96: 20 eb ldi r18, 0xB0 ; 176 2cc98: 28 0f add r18, r24 2cc9a: 26 30 cpi r18, 0x06 ; 6 2cc9c: 08 f0 brcs .+2 ; 0x2cca0 2cc9e: ac cf rjmp .-168 ; 0x2cbf8 2cca0: e9 cf rjmp .-46 ; 0x2cc74 2cca2: 86 36 cpi r24, 0x66 ; 102 2cca4: 09 f0 breq .+2 ; 0x2cca8 2cca6: a8 cf rjmp .-176 ; 0x2cbf8 2cca8: e5 cf rjmp .-54 ; 0x2cc74 } 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'); 2ccaa: 20 ed ldi r18, 0xD0 ; 208 2ccac: 28 0f add r18, r24 2ccae: 2a 30 cpi r18, 0x0A ; 10 2ccb0: 50 f0 brcs .+20 ; 0x2ccc6 2ccb2: 2f e9 ldi r18, 0x9F ; 159 2ccb4: 28 0f add r18, r24 2ccb6: 26 30 cpi r18, 0x06 ; 6 2ccb8: 30 f0 brcs .+12 ; 0x2ccc6 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 2ccba: 80 32 cpi r24, 0x20 ; 32 2ccbc: 09 f0 breq .+2 ; 0x2ccc0 2ccbe: 9c cf rjmp .-200 ; 0x2cbf8 rspState = ResponseStates::ParamCode; 2ccc0: 60 92 49 12 sts 0x1249, r6 ; 0x801249 2ccc4: a2 cf rjmp .-188 ; 0x2cc0a return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 2ccc6: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 2ccca: 90 91 4b 12 lds r25, 0x124B ; 0x80124b 2ccce: 92 95 swap r25 2ccd0: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 2ccd2: 89 0f add r24, r25 2ccd4: 80 93 4b 12 sts 0x124B, r24 ; 0x80124b 2ccd8: 98 cf rjmp .-208 ; 0x2cc0a } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2ccda: 87 34 cpi r24, 0x47 ; 71 2ccdc: 48 f4 brcc .+18 ; 0x2ccf0 2ccde: 85 34 cpi r24, 0x45 ; 69 2cce0: 58 f4 brcc .+22 ; 0x2ccf8 2cce2: 2f eb ldi r18, 0xBF ; 191 2cce4: 28 0f add r18, r24 2cce6: 22 30 cpi r18, 0x02 ; 2 2cce8: 38 f0 brcs .+14 ; 0x2ccf8 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2ccea: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2ccee: 84 cf rjmp .-248 ; 0x2cbf8 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2ccf0: 80 35 cpi r24, 0x50 ; 80 2ccf2: 11 f0 breq .+4 ; 0x2ccf8 2ccf4: 82 35 cpi r24, 0x52 ; 82 2ccf6: c9 f7 brne .-14 ; 0x2ccea case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2ccf8: 80 92 49 12 sts 0x1249, r8 ; 0x801249 responseMsg.paramCode = (ResponseMsgParamCodes)c; 2ccfc: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f responseMsg.paramValue = 0; 2cd00: 10 92 51 12 sts 0x1251, r1 ; 0x801251 2cd04: 10 92 50 12 sts 0x1250, r1 ; 0x801250 2cd08: 80 cf rjmp .-256 ; 0x2cc0a 2cd0a: 20 ed ldi r18, 0xD0 ; 208 2cd0c: 28 0f add r18, r24 2cd0e: 2a 30 cpi r18, 0x0A ; 10 2cd10: 48 f0 brcs .+18 ; 0x2cd24 2cd12: 2f e9 ldi r18, 0x9F ; 159 2cd14: 28 0f add r18, r24 2cd16: 26 30 cpi r18, 0x06 ; 6 2cd18: 28 f0 brcs .+10 ; 0x2cd24 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 2cd1a: 8a 32 cpi r24, 0x2A ; 42 2cd1c: 31 f7 brne .-52 ; 0x2ccea rspState = ResponseStates::CRC; 2cd1e: 70 92 49 12 sts 0x1249, r7 ; 0x801249 2cd22: 73 cf rjmp .-282 ; 0x2cc0a return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 2cd24: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 2cd28: 20 91 50 12 lds r18, 0x1250 ; 0x801250 2cd2c: 30 91 51 12 lds r19, 0x1251 ; 0x801251 2cd30: 44 e0 ldi r20, 0x04 ; 4 2cd32: 22 0f add r18, r18 2cd34: 33 1f adc r19, r19 2cd36: 4a 95 dec r20 2cd38: e1 f7 brne .-8 ; 0x2cd32 responseMsg.paramValue += Char2Nibble(c); 2cd3a: 82 0f add r24, r18 2cd3c: 93 2f mov r25, r19 2cd3e: 91 1d adc r25, r1 2cd40: 90 93 51 12 sts 0x1251, r25 ; 0x801251 2cd44: 80 93 50 12 sts 0x1250, r24 ; 0x801250 2cd48: 60 cf rjmp .-320 ; 0x2cc0a return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 2cd4a: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 2cd4e: 90 91 4e 12 lds r25, 0x124E ; 0x80124e 2cd52: 92 95 swap r25 2cd54: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 2cd56: 89 0f add r24, r25 2cd58: 80 93 4e 12 sts 0x124E, r24 ; 0x80124e 2cd5c: 56 cf rjmp .-340 ; 0x2cc0a ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cd5e: 8d 30 cpi r24, 0x0D ; 13 2cd60: 21 f6 brne .-120 ; 0x2ccea 2cd62: 03 cf rjmp .-506 ; 0x2cb6a if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 2cd64: e8 0e add r14, r24 2cd66: f9 1e adc r15, r25 2cd68: f7 01 movw r30, r14 2cd6a: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 2cd6c: 10 92 62 12 sts 0x1262, r1 ; 0x801262 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 2cd70: 87 e7 ldi r24, 0x77 ; 119 2cd72: 9e e9 ldi r25, 0x9E ; 158 2cd74: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2cd78: 81 e7 ldi r24, 0x71 ; 113 2cd7a: 9e e9 ldi r25, 0x9E ; 158 2cd7c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2cd80: ce 01 movw r24, r28 2cd82: 01 96 adiw r24, 0x01 ; 1 2cd84: 0f 94 9e 99 call 0x3333c ; 0x3333c 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 2cd88: 0f 94 ba 3a call 0x27574 ; 0x27574 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 2cd8c: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cd90: 81 30 cpi r24, 0x01 ; 1 2cd92: 09 f4 brne .+2 ; 0x2cd96 2cd94: 74 c0 rjmp .+232 ; 0x2ce7e 2cd96: 08 f4 brcc .+2 ; 0x2cd9a 2cd98: c5 ce rjmp .-630 ; 0x2cb24 2cd9a: 83 30 cpi r24, 0x03 ; 3 2cd9c: 09 f4 brne .+2 ; 0x2cda0 2cd9e: d1 c0 rjmp .+418 ; 0x2cf42 2cda0: 84 30 cpi r24, 0x04 ; 4 2cda2: 09 f0 breq .+2 ; 0x2cda6 2cda4: 4f ce rjmp .-866 ; 0x2ca44 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2cda6: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cdaa: 86 30 cpi r24, 0x06 ; 6 2cdac: 09 f4 brne .+2 ; 0x2cdb0 2cdae: 6c c1 rjmp .+728 ; 0x2d088 2cdb0: 08 f0 brcs .+2 ; 0x2cdb4 2cdb2: 93 c1 rjmp .+806 ; 0x2d0da 2cdb4: 84 30 cpi r24, 0x04 ; 4 2cdb6: 09 f4 brne .+2 ; 0x2cdba 2cdb8: 09 c1 rjmp .+530 ; 0x2cfcc 2cdba: 85 30 cpi r24, 0x05 ; 5 2cdbc: 09 f0 breq .+2 ; 0x2cdc0 2cdbe: cc c0 rjmp .+408 ; 0x2cf58 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 2cdc0: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cdc4: 81 34 cpi r24, 0x41 ; 65 2cdc6: 09 f4 brne .+2 ; 0x2cdca 2cdc8: 96 c1 rjmp .+812 ; 0x2d0f6 2cdca: 82 35 cpi r24, 0x52 ; 82 2cdcc: 09 f0 breq .+2 ; 0x2cdd0 2cdce: c4 c0 rjmp .+392 ; 0x2cf58 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 2cdd0: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::PROTOCOL_ERROR; 2cdd4: 8d e2 ldi r24, 0x2D ; 45 2cdd6: 90 e8 ldi r25, 0x80 ; 128 2cdd8: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2cddc: 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")); 2cde0: 87 ed ldi r24, 0xD7 ; 215 2cde2: 9b e9 ldi r25, 0x9B ; 155 2cde4: 0f 94 d7 3a call 0x275ae ; 0x275ae void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2cde8: 85 e0 ldi r24, 0x05 ; 5 2cdea: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2cdee: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2cdf2: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2cdf6: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2cdfa: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2cdfe: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2ce02: 0f 94 c0 3b call 0x27780 ; 0x27780 2ce06: 16 e0 ldi r17, 0x06 ; 6 2ce08: 07 c1 rjmp .+526 ; 0x2d018 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') { 2ce0a: 1b 36 cpi r17, 0x6B ; 107 2ce0c: 09 f0 breq .+2 ; 0x2ce10 2ce0e: f9 c2 rjmp .+1522 ; 0x2d402 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")); 2ce10: 88 eb ldi r24, 0xB8 ; 184 2ce12: 9b e9 ldi r25, 0x9B ; 155 2ce14: 0f 94 d7 3a call 0x275ae ; 0x275ae 2ce18: 18 e0 ldi r17, 0x08 ; 8 2ce1a: fe c0 rjmp .+508 ; 0x2d018 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 2ce1c: cd 28 or r12, r13 2ce1e: 19 f0 breq .+6 ; 0x2ce26 RecordUARTActivity(); // something has happened on the UART, update the timeout record 2ce20: 0f 94 ba 3a call 0x27574 ; 0x27574 2ce24: 7f ce rjmp .-770 ; 0x2cb24 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2ce26: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2ce2a: ab 01 movw r20, r22 2ce2c: bc 01 movw r22, r24 2ce2e: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2ce32: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2ce36: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2ce3a: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2ce3e: 80 53 subi r24, 0x30 ; 48 2ce40: 98 4f sbci r25, 0xF8 ; 248 2ce42: af 4f sbci r26, 0xFF ; 255 2ce44: 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) { 2ce46: 48 17 cp r20, r24 2ce48: 59 07 cpc r21, r25 2ce4a: 6a 07 cpc r22, r26 2ce4c: 7b 07 cpc r23, r27 2ce4e: 08 f4 brcc .+2 ; 0x2ce52 2ce50: 69 ce rjmp .-814 ; 0x2cb24 2ce52: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2ce56: 88 23 and r24, r24 2ce58: 09 f4 brne .+2 ; 0x2ce5c 2ce5a: 64 ce rjmp .-824 ; 0x2cb24 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 2ce5c: 10 92 49 12 sts 0x1249, r1 ; 0x801249 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2ce60: 81 e0 ldi r24, 0x01 ; 1 2ce62: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2ce66: 80 93 27 12 sts 0x1227, r24 ; 0x801227 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2ce6a: 86 e0 ldi r24, 0x06 ; 6 2ce6c: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2ce70: 80 e0 ldi r24, 0x00 ; 0 2ce72: 0f 94 1a 63 call 0x2c634 ; 0x2c634 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2ce76: 64 e0 ldi r22, 0x04 ; 4 2ce78: 80 e9 ldi r24, 0x90 ; 144 2ce7a: 9b e9 ldi r25, 0x9B ; 155 2ce7c: 79 c0 rjmp .+242 ; 0x2cf70 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 2ce7e: 10 91 28 12 lds r17, 0x1228 ; 0x801228 2ce82: 13 30 cpi r17, 0x03 ; 3 2ce84: b1 f1 breq .+108 ; 0x2cef2 2ce86: 60 f0 brcs .+24 ; 0x2cea0 2ce88: 16 30 cpi r17, 0x06 ; 6 2ce8a: 09 f4 brne .+2 ; 0x2ce8e 2ce8c: 50 c0 rjmp .+160 ; 0x2cf2e 2ce8e: 19 30 cpi r17, 0x09 ; 9 2ce90: 09 f0 breq .+2 ; 0x2ce94 2ce92: be cf rjmp .-132 ; 0x2ce10 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 2ce94: 0f 94 ea 3c call 0x279d4 ; 0x279d4 2ce98: 88 23 and r24, r24 2ce9a: 09 f4 brne .+2 ; 0x2ce9e 2ce9c: 43 ce rjmp .-890 ; 0x2cb24 2ce9e: 40 ce rjmp .-896 ; 0x2cb20 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 2cea0: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cea4: 83 35 cpi r24, 0x53 ; 83 2cea6: 21 f4 brne .+8 ; 0x2ceb0 2cea8: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2ceac: 18 17 cp r17, r24 2ceae: 11 f0 breq .+4 ; 0x2ceb4 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 2ceb0: 81 2f mov r24, r17 2ceb2: fe cd rjmp .-1028 ; 0x2cab0 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; 2ceb4: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2ceb8: e1 2f mov r30, r17 2ceba: f0 e0 ldi r31, 0x00 ; 0 2cebc: df 01 movw r26, r30 2cebe: ac 58 subi r26, 0x8C ; 140 2cec0: bd 4e sbci r27, 0xED ; 237 2cec2: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 2cec4: eb 54 subi r30, 0x4B ; 75 2cec6: f4 46 sbci r31, 0x64 ; 100 2cec8: e4 91 lpm r30, Z 2ceca: 8e 17 cp r24, r30 2cecc: 41 f0 breq .+16 ; 0x2cede if (--retries == 0) { 2cece: 80 91 29 12 lds r24, 0x1229 ; 0x801229 2ced2: 81 50 subi r24, 0x01 ; 1 2ced4: 80 93 29 12 sts 0x1229, r24 ; 0x801229 2ced8: 81 11 cpse r24, r1 2ceda: ea cf rjmp .-44 ; 0x2ceb0 2cedc: 99 cf rjmp .-206 ; 0x2ce10 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cede: 8a e0 ldi r24, 0x0A ; 10 2cee0: 9e e9 ldi r25, 0x9E ; 158 2cee2: 0e 94 de 72 call 0xe5bc ; 0xe5bc /// @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; } 2cee6: 8a e0 ldi r24, 0x0A ; 10 2cee8: 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); 2ceec: 81 e0 ldi r24, 0x01 ; 1 2ceee: 81 0f add r24, r17 2cef0: df cd rjmp .-1090 ; 0x2cab0 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) { 2cef2: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cef6: 83 35 cpi r24, 0x53 ; 83 2cef8: 21 f4 brne .+8 ; 0x2cf02 2cefa: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cefe: 83 30 cpi r24, 0x03 ; 3 2cf00: 11 f0 breq .+4 ; 0x2cf06 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 2cf02: 83 e0 ldi r24, 0x03 ; 3 2cf04: d5 cd rjmp .-1110 ; 0x2cab0 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 2cf06: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cf0a: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2cf0e: 90 93 78 12 sts 0x1278, r25 ; 0x801278 2cf12: 80 93 77 12 sts 0x1277, r24 ; 0x801277 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 2cf16: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cf1a: e8 e0 ldi r30, 0x08 ; 8 2cf1c: fe e9 ldi r31, 0x9E ; 158 2cf1e: 84 91 lpm r24, Z 2cf20: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2cf24: 70 e0 ldi r23, 0x00 ; 0 2cf26: 49 e0 ldi r20, 0x09 ; 9 2cf28: 0f 94 2b 3c call 0x27856 ; 0x27856 2cf2c: fb cd rjmp .-1034 ; 0x2cb24 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 2cf2e: 82 e0 ldi r24, 0x02 ; 2 2cf30: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2cf34: 83 e0 ldi r24, 0x03 ; 3 2cf36: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2cf3a: 82 e8 ldi r24, 0x82 ; 130 2cf3c: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2cf40: d2 cd rjmp .-1116 ; 0x2cae6 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2cf42: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cf46: 88 30 cpi r24, 0x08 ; 8 2cf48: 09 f4 brne .+2 ; 0x2cf4c 2cf4a: b7 c0 rjmp .+366 ; 0x2d0ba 2cf4c: a8 f4 brcc .+42 ; 0x2cf78 2cf4e: 84 30 cpi r24, 0x04 ; 4 2cf50: d9 f0 breq .+54 ; 0x2cf88 2cf52: 87 30 cpi r24, 0x07 ; 7 2cf54: 09 f4 brne .+2 ; 0x2cf58 2cf56: ae c0 rjmp .+348 ; 0x2d0b4 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 2cf58: 81 e0 ldi r24, 0x01 ; 1 2cf5a: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::DelayedRestart; 2cf5e: 82 e0 ldi r24, 0x02 ; 2 2cf60: 80 93 27 12 sts 0x1227, r24 ; 0x801227 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 2cf64: 83 e8 ldi r24, 0x83 ; 131 2cf66: 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); 2cf6a: 65 e0 ldi r22, 0x05 ; 5 2cf6c: 86 ea ldi r24, 0xA6 ; 166 2cf6e: 9b e9 ldi r25, 0x9B ; 155 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2cf70: 0f 94 48 3b call 0x27690 ; 0x27690 2cf74: 18 2f mov r17, r24 2cf76: 50 c0 rjmp .+160 ; 0x2d018 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2cf78: 8a 30 cpi r24, 0x0A ; 10 2cf7a: 09 f4 brne .+2 ; 0x2cf7e 2cf7c: a7 c0 rjmp .+334 ; 0x2d0cc 2cf7e: 60 f3 brcs .-40 ; 0x2cf58 2cf80: 8d 30 cpi r24, 0x0D ; 13 2cf82: 08 f4 brcc .+2 ; 0x2cf86 2cf84: 5f cd rjmp .-1346 ; 0x2ca44 2cf86: e8 cf rjmp .-48 ; 0x2cf58 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) { 2cf88: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cf8c: 8e 34 cpi r24, 0x4E ; 78 2cf8e: 60 f5 brcc .+88 ; 0x2cfe8 2cf90: 8b 34 cpi r24, 0x4B ; 75 2cf92: 10 f4 brcc .+4 ; 0x2cf98 2cf94: 85 34 cpi r24, 0x45 ; 69 2cf96: 01 f7 brne .-64 ; 0x2cf58 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 2cf98: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cf9c: 86 34 cpi r24, 0x46 ; 70 2cf9e: 09 f4 brne .+2 ; 0x2cfa2 2cfa0: 73 c0 rjmp .+230 ; 0x2d088 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 2cfa2: 84 e0 ldi r24, 0x04 ; 4 2cfa4: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2cfa8: 85 e0 ldi r24, 0x05 ; 5 2cfaa: ea e3 ldi r30, 0x3A ; 58 2cfac: f2 e1 ldi r31, 0x12 ; 18 2cfae: de 01 movw r26, r28 2cfb0: 11 96 adiw r26, 0x01 ; 1 2cfb2: 01 90 ld r0, Z+ 2cfb4: 0d 92 st X+, r0 2cfb6: 8a 95 dec r24 2cfb8: e1 f7 brne .-8 ; 0x2cfb2 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2cfba: 85 e0 ldi r24, 0x05 ; 5 2cfbc: fe 01 movw r30, r28 2cfbe: 31 96 adiw r30, 0x01 ; 1 2cfc0: aa e2 ldi r26, 0x2A ; 42 2cfc2: b2 e1 ldi r27, 0x12 ; 18 2cfc4: 01 90 ld r0, Z+ 2cfc6: 0d 92 st X+, r0 2cfc8: 8a 95 dec r24 2cfca: e1 f7 brne .-8 ; 0x2cfc4 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 2cfcc: 0f 94 cf 63 call 0x2c79e ; 0x2c79e 2cfd0: 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) { 2cfd2: 85 30 cpi r24, 0x05 ; 5 2cfd4: 09 f2 breq .-126 ; 0x2cf58 2cfd6: 08 f0 brcs .+2 ; 0x2cfda 2cfd8: 9c c0 rjmp .+312 ; 0x2d112 2cfda: 82 30 cpi r24, 0x02 ; 2 2cfdc: 09 f4 brne .+2 ; 0x2cfe0 2cfde: 32 cd rjmp .-1436 ; 0x2ca44 2cfe0: 84 30 cpi r24, 0x04 ; 4 2cfe2: 09 f4 brne .+2 ; 0x2cfe6 2cfe4: 3b cf rjmp .-394 ; 0x2ce5c 2cfe6: 18 c0 rjmp .+48 ; 0x2d018 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) { 2cfe8: 84 35 cpi r24, 0x54 ; 84 2cfea: 08 f4 brcc .+2 ; 0x2cfee 2cfec: b5 cf rjmp .-150 ; 0x2cf58 2cfee: 86 35 cpi r24, 0x56 ; 86 2cff0: 98 f2 brcs .-90 ; 0x2cf98 2cff2: 88 35 cpi r24, 0x58 ; 88 2cff4: 09 f0 breq .+2 ; 0x2cff8 2cff6: b0 cf rjmp .-160 ; 0x2cf58 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) { 2cff8: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cffc: 86 34 cpi r24, 0x46 ; 70 2cffe: 89 f1 breq .+98 ; 0x2d062 2d000: 80 35 cpi r24, 0x50 ; 80 2d002: c1 f1 breq .+112 ; 0x2d074 2d004: 82 34 cpi r24, 0x42 ; 66 2d006: 09 f0 breq .+2 ; 0x2d00a 2d008: 42 c0 rjmp .+132 ; 0x2d08e 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); 2d00a: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d00e: 80 93 68 12 sts 0x1268, r24 ; 0x801268 StartReading8bitRegisters(); 2d012: 0f 94 0f 62 call 0x2c41e ; 0x2c41e return ButtonPushed; 2d016: 1b e0 ldi r17, 0x0B ; 11 2d018: 80 91 25 12 lds r24, 0x1225 ; 0x801225 2d01c: 90 91 26 12 lds r25, 0x1226 ; 0x801226 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 2d020: 81 30 cpi r24, 0x01 ; 1 2d022: 91 05 cpc r25, r1 2d024: 09 f0 breq .+2 ; 0x2d028 2d026: f0 c1 rjmp .+992 ; 0x2d408 const StepStatus ss = logic.Step(); switch (ss) { 2d028: 12 30 cpi r17, 0x02 ; 2 2d02a: 09 f4 brne .+2 ; 0x2d02e 2d02c: 90 c0 rjmp .+288 ; 0x2d14e 2d02e: 08 f0 brcs .+2 ; 0x2d032 2d030: 7d c0 rjmp .+250 ; 0x2d12c 2d032: 11 23 and r17, r17 2d034: 09 f4 brne .+2 ; 0x2d038 2d036: 1a c1 rjmp .+564 ; 0x2d26c case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d038: 00 23 and r16, r16 2d03a: 09 f4 brne .+2 ; 0x2d03e 2d03c: e6 c0 rjmp .+460 ; 0x2d20a switch (ss) { 2d03e: 17 30 cpi r17, 0x07 ; 7 2d040: 09 f4 brne .+2 ; 0x2d044 2d042: c6 c1 rjmp .+908 ; 0x2d3d0 2d044: 08 f0 brcs .+2 ; 0x2d048 2d046: ba c1 rjmp .+884 ; 0x2d3bc 2d048: 14 30 cpi r17, 0x04 ; 4 2d04a: 09 f4 brne .+2 ; 0x2d04e 2d04c: c9 c1 rjmp .+914 ; 0x2d3e0 2d04e: 15 30 cpi r17, 0x05 ; 5 2d050: 09 f0 breq .+2 ; 0x2d054 2d052: db c0 rjmp .+438 ; 0x2d20a state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 2d054: 82 e0 ldi r24, 0x02 ; 2 2d056: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 2d05a: 60 e0 ldi r22, 0x00 ; 0 2d05c: 8d e2 ldi r24, 0x2D ; 45 2d05e: 90 e8 ldi r25, 0x80 ; 128 2d060: bc c1 rjmp .+888 ; 0x2d3da // 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) { 2d062: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d066: 88 23 and r24, r24 2d068: 29 f0 breq .+10 ; 0x2d074 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2d06a: 82 e8 ldi r24, 0x82 ; 130 2d06c: 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; 2d070: 13 e0 ldi r17, 0x03 ; 3 2d072: d2 cf rjmp .-92 ; 0x2d018 } [[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); 2d074: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d078: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2d07c: 81 e0 ldi r24, 0x01 ; 1 2d07e: 90 e0 ldi r25, 0x00 ; 0 2d080: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d084: 80 93 65 12 sts 0x1265, r24 ; 0x801265 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 2d088: 0f 94 0f 62 call 0x2c41e ; 0x2c41e 2d08c: 4b cd rjmp .-1386 ; 0x2cb24 // 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; 2d08e: 8c e0 ldi r24, 0x0C ; 12 2d090: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2d094: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d098: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2d09c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d0a0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 StartReading8bitRegisters(); // continue Idle state without restarting the communication 2d0a4: 0f 94 0f 62 call 0x2c41e ; 0x2c41e // @@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")); 2d0a8: 89 ec ldi r24, 0xC9 ; 201 2d0aa: 9b e9 ldi r25, 0x9B ; 155 2d0ac: 0f 94 d7 3a call 0x275ae ; 0x275ae 2d0b0: 17 e0 ldi r17, 0x07 ; 7 2d0b2: b2 cf rjmp .-156 ; 0x2d018 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 2d0b4: 0f 94 33 62 call 0x2c466 ; 0x2c466 2d0b8: 35 cd rjmp .-1430 ; 0x2cb24 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 2d0ba: 82 e8 ldi r24, 0x82 ; 130 2d0bc: 0f 94 17 62 call 0x2c42e ; 0x2c42e 2d0c0: 80 93 28 12 sts 0x1228, r24 ; 0x801228 return scopeState == ScopeState::Ready ? Finished : Processing; 2d0c4: 82 38 cpi r24, 0x82 ; 130 2d0c6: 09 f0 breq .+2 ; 0x2d0ca 2d0c8: 2d cd rjmp .-1446 ; 0x2cb24 2d0ca: bc cc rjmp .-1672 ; 0x2ca44 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d0cc: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d0d0: 81 34 cpi r24, 0x41 ; 65 2d0d2: d1 f6 brne .-76 ; 0x2d088 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d0d4: 0f 94 c5 3a call 0x2758a ; 0x2758a 2d0d8: d7 cf rjmp .-82 ; 0x2d088 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2d0da: 88 30 cpi r24, 0x08 ; 8 2d0dc: b1 f0 breq .+44 ; 0x2d10a 2d0de: 50 f3 brcs .-44 ; 0x2d0b4 2d0e0: 8a 30 cpi r24, 0x0A ; 10 2d0e2: 09 f0 breq .+2 ; 0x2d0e6 2d0e4: 39 cf rjmp .-398 ; 0x2cf58 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d0e6: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d0ea: 81 34 cpi r24, 0x41 ; 65 2d0ec: 09 f0 breq .+2 ; 0x2d0f0 2d0ee: 18 cd rjmp .-1488 ; 0x2cb20 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d0f0: 0f 94 c5 3a call 0x2758a ; 0x2758a 2d0f4: 15 cd rjmp .-1494 ; 0x2cb20 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; 2d0f6: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::RUNNING; 2d0fa: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2d0fe: 10 92 65 12 sts 0x1265, r1 ; 0x801265 scopeState = ScopeState::Wait; 2d102: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 2d104: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2d108: 0d cd rjmp .-1510 ; 0x2cb24 2d10a: 81 e8 ldi r24, 0x81 ; 129 2d10c: 0f 94 17 62 call 0x2c42e ; 0x2c42e 2d110: f9 cf rjmp .-14 ; 0x2d104 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 2d112: 87 30 cpi r24, 0x07 ; 7 2d114: 49 f2 breq .-110 ; 0x2d0a8 2d116: 08 f4 brcc .+2 ; 0x2d11a 2d118: 63 ce rjmp .-826 ; 0x2cde0 2d11a: 88 30 cpi r24, 0x08 ; 8 2d11c: 09 f4 brne .+2 ; 0x2d120 2d11e: 78 ce rjmp .-784 ; 0x2ce10 2d120: 7b cf rjmp .-266 ; 0x2d018 // 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()) { 2d122: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2d126: 87 fd sbrc r24, 7 2d128: 9a cc rjmp .-1740 ; 0x2ca5e 2d12a: fc cc rjmp .-1544 ; 0x2cb24 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 2d12c: 13 30 cpi r17, 0x03 ; 3 2d12e: 09 f4 brne .+2 ; 0x2d132 2d130: 6c c0 rjmp .+216 ; 0x2d20a 2d132: 1b 30 cpi r17, 0x0B ; 11 2d134: 09 f0 breq .+2 ; 0x2d138 2d136: 80 cf rjmp .-256 ; 0x2d038 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 2d138: 80 91 68 12 lds r24, 0x1268 ; 0x801268 2d13c: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f LogEchoEvent_P(PSTR("MMU Button pushed")); 2d140: 88 ee ldi r24, 0xE8 ; 232 2d142: 9b e9 ldi r25, 0x9B ; 155 2d144: 0f 94 c7 87 call 0x30f8e ; 0x30f8e CheckUserInput(); // Process the button immediately 2d148: 0f 94 39 64 call 0x2c872 ; 0x2c872 2d14c: 5e c0 rjmp .+188 ; 0x2d20a CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 2d14e: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d152: 81 11 cpse r24, r1 2d154: 5a c0 rjmp .+180 ; 0x2d20a 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() 2d156: 0e 94 53 61 call 0xc2a6 ; 0xc2a6 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 2d15a: 88 23 and r24, r24 2d15c: 09 f4 brne .+2 ; 0x2d160 2d15e: 55 c0 rjmp .+170 ; 0x2d20a } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 2d160: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.491> 2d164: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.491+0x1> 2d168: 88 35 cpi r24, 0x58 ; 88 2d16a: 92 40 sbci r25, 0x02 ; 2 2d16c: 09 f4 brne .+2 ; 0x2d170 2d16e: 4d c0 rjmp .+154 ; 0x2d20a && !saved_printing 2d170: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d174: 81 11 cpse r24, r1 2d176: 49 c0 rjmp .+146 ; 0x2d20a && !mesh_bed_leveling_flag 2d178: 80 91 06 12 lds r24, 0x1206 ; 0x801206 2d17c: 81 11 cpse r24, r1 2d17e: 45 c0 rjmp .+138 ; 0x2d20a && !homing_flag 2d180: 80 91 05 12 lds r24, 0x1205 ; 0x801205 2d184: 81 11 cpse r24, r1 2d186: 41 c0 rjmp .+130 ; 0x2d20a bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 2d188: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2d18c: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2d190: 98 17 cp r25, r24 2d192: d9 f1 breq .+118 ; 0x2d20a { uint8_t block_index = block_buffer_tail; 2d194: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } #endif bool e_active() { unsigned char e_active = 0; 2d198: 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++; 2d19a: 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) 2d19c: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2d1a0: 38 17 cp r19, r24 2d1a2: 89 f0 breq .+34 ; 0x2d1c6 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 2d1a4: 28 9f mul r18, r24 2d1a6: f0 01 movw r30, r0 2d1a8: 11 24 eor r1, r1 2d1aa: e8 53 subi r30, 0x38 ; 56 2d1ac: f9 4f sbci r31, 0xF9 ; 249 2d1ae: 44 85 ldd r20, Z+12 ; 0x0c 2d1b0: 55 85 ldd r21, Z+13 ; 0x0d 2d1b2: 66 85 ldd r22, Z+14 ; 0x0e 2d1b4: 77 85 ldd r23, Z+15 ; 0x0f 2d1b6: 45 2b or r20, r21 2d1b8: 46 2b or r20, r22 2d1ba: 47 2b or r20, r23 2d1bc: 09 f0 breq .+2 ; 0x2d1c0 2d1be: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 2d1c0: 8f 5f subi r24, 0xFF ; 255 2d1c2: 8f 70 andi r24, 0x0F ; 15 2d1c4: eb cf rjmp .-42 ; 0x2d19c && e_active(); 2d1c6: 99 23 and r25, r25 2d1c8: 01 f1 breq .+64 ; 0x2d20a SERIAL_ECHOLNPGM("FINDA filament runout!"); 2d1ca: 89 e7 ldi r24, 0x79 ; 121 2d1cc: 9b e9 ldi r25, 0x9B ; 155 2d1ce: 0e 94 de 72 call 0xe5bc ; 0xe5bc //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 2d1d2: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d1d6: 81 11 cpse r24, r1 2d1d8: 05 c0 rjmp .+10 ; 0x2d1e4 2d1da: 60 e0 ldi r22, 0x00 ; 0 2d1dc: 70 e0 ldi r23, 0x00 ; 0 2d1de: cb 01 movw r24, r22 2d1e0: 0f 94 8f 41 call 0x2831e ; 0x2831e marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 2d1e4: 60 e0 ldi r22, 0x00 ; 0 2d1e6: 70 e0 ldi r23, 0x00 ; 0 2d1e8: cb 01 movw r24, r22 2d1ea: 0e 94 cb 61 call 0xc396 ; 0xc396 2d1ee: 86 ed ldi r24, 0xD6 ; 214 2d1f0: 9e e0 ldi r25, 0x0E ; 14 2d1f2: 0f 94 7d a0 call 0x340fa ; 0x340fa 2d1f6: 81 30 cpi r24, 0x01 ; 1 2d1f8: 21 f4 brne .+8 ; 0x2d202 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 2d1fa: 0f 94 30 41 call 0x28260 ; 0x28260 2d1fe: 8f 3f cpi r24, 0xFF ; 255 2d200: 91 f5 brne .+100 ; 0x2d266 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 2d202: 8f e1 ldi r24, 0x1F ; 31 2d204: 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 2d206: 0f 94 f5 42 call 0x285ea ; 0x285ea break; } } } if (logic.Running()) { 2d20a: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2d20e: 82 30 cpi r24, 0x02 ; 2 2d210: 19 f4 brne .+6 ; 0x2d218 state = xState::Active; 2d212: 81 e0 ldi r24, 0x01 ; 1 2d214: 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 2d218: 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) { 2d21c: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> 2d220: 88 23 and r24, r24 2d222: 51 f0 breq .+20 ; 0x2d238 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2d224: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 2d228: 81 11 cpse r24, r1 2d22a: 06 c0 rjmp .+12 ; 0x2d238 2d22c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2d230: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2d234: 0f 94 2a 89 call 0x31254 ; 0x31254 CheckErrorScreenUserInput(); } 2d238: a0 96 adiw r28, 0x20 ; 32 2d23a: 0f b6 in r0, 0x3f ; 63 2d23c: f8 94 cli 2d23e: de bf out 0x3e, r29 ; 62 2d240: 0f be out 0x3f, r0 ; 63 2d242: cd bf out 0x3d, r28 ; 61 2d244: df 91 pop r29 2d246: cf 91 pop r28 2d248: 1f 91 pop r17 2d24a: 0f 91 pop r16 2d24c: ff 90 pop r15 2d24e: ef 90 pop r14 2d250: df 90 pop r13 2d252: cf 90 pop r12 2d254: bf 90 pop r11 2d256: af 90 pop r10 2d258: 9f 90 pop r9 2d25a: 8f 90 pop r8 2d25c: 7f 90 pop r7 2d25e: 6f 90 pop r6 2d260: 5f 90 pop r5 2d262: 4f 90 pop r4 2d264: 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 2d266: 8f e6 ldi r24, 0x6F ; 111 2d268: 9b e9 ldi r25, 0x9B ; 155 2d26a: cd cf rjmp .-102 ; 0x2d206 2d26c: 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) { 2d270: 80 91 8b 12 lds r24, 0x128B ; 0x80128b 2d274: 08 17 cp r16, r24 2d276: 09 f4 brne .+2 ; 0x2d27a 2d278: 49 c0 rjmp .+146 ; 0x2d30c // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2d27a: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d27e: 84 30 cpi r24, 0x04 ; 4 2d280: b9 f4 brne .+46 ; 0x2d2b0 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 2d282: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d286: 88 23 and r24, r24 2d288: 99 f0 breq .+38 ; 0x2d2b0 custom_message_type = CustomMsg::MMUProgress; 2d28a: 89 e0 ldi r24, 0x09 ; 9 2d28c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d290: e5 e3 ldi r30, 0x35 ; 53 2d292: 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])) 2d294: 0e 31 cpi r16, 0x1E ; 30 2d296: 30 f4 brcc .+12 ; 0x2d2a4 2d298: e0 2f mov r30, r16 2d29a: f0 e0 ldi r31, 0x00 ; 0 2d29c: ee 0f add r30, r30 2d29e: ff 1f adc r31, r31 2d2a0: eb 5c subi r30, 0xCB ; 203 2d2a2: f4 46 sbci r31, 0x64 ; 100 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d2a4: 85 91 lpm r24, Z+ 2d2a6: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2d2a8: 0e 94 3c 6d call 0xda78 ; 0xda78 2d2ac: 0e 94 5f e6 call 0x1ccbe ; 0x1ccbe 2d2b0: e5 e3 ldi r30, 0x35 ; 53 2d2b2: 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])) 2d2b4: 0e 31 cpi r16, 0x1E ; 30 2d2b6: 30 f4 brcc .+12 ; 0x2d2c4 2d2b8: e0 2f mov r30, r16 2d2ba: f0 e0 ldi r31, 0x00 ; 0 2d2bc: ee 0f add r30, r30 2d2be: ff 1f adc r31, r31 2d2c0: eb 5c subi r30, 0xCB ; 203 2d2c2: f4 46 sbci r31, 0x64 ; 100 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d2c4: 85 91 lpm r24, Z+ 2d2c6: 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))); 2d2c8: 02 96 adiw r24, 0x02 ; 2 2d2ca: 0f 94 c7 87 call 0x30f8e ; 0x30f8e } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 2d2ce: 00 93 8b 12 sts 0x128B, r16 ; 0x80128b switch (pc) { 2d2d2: 03 30 cpi r16, 0x03 ; 3 2d2d4: 49 f0 breq .+18 ; 0x2d2e8 2d2d6: 0c 31 cpi r16, 0x1C ; 28 2d2d8: 09 f0 breq .+2 ; 0x2d2dc 2d2da: 97 cf rjmp .-210 ; 0x2d20a 2d2dc: 0f 94 14 22 call 0x24428 ; 0x24428 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 2d2e0: 81 e0 ldi r24, 0x01 ; 1 2d2e2: 80 93 96 12 sts 0x1296, r24 ; 0x801296 2d2e6: 91 cf rjmp .-222 ; 0x2d20a 2d2e8: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d2ec: 84 30 cpi r24, 0x04 ; 4 2d2ee: 31 f4 brne .+12 ; 0x2d2fc ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 2d2f0: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d2f4: 84 55 subi r24, 0x54 ; 84 2d2f6: 82 30 cpi r24, 0x02 ; 2 2d2f8: 08 f4 brcc .+2 ; 0x2d2fc 2d2fa: 87 cf rjmp .-242 ; 0x2d20a 2d2fc: 0f 94 14 22 call 0x24428 ; 0x24428 // 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; 2d300: 81 e0 ldi r24, 0x01 ; 1 2d302: 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(); 2d306: 0f 94 93 3e call 0x27d26 ; 0x27d26 2d30a: 7f cf rjmp .-258 ; 0x2d20a 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) { 2d30c: 03 30 cpi r16, 0x03 ; 3 2d30e: 71 f1 breq .+92 ; 0x2d36c 2d310: 0c 31 cpi r16, 0x1C ; 28 2d312: 09 f0 breq .+2 ; 0x2d316 2d314: 7a cf rjmp .-268 ; 0x2d20a unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 2d316: 80 91 96 12 lds r24, 0x1296 ; 0x801296 2d31a: 88 23 and r24, r24 2d31c: 09 f4 brne .+2 ; 0x2d320 2d31e: 75 cf rjmp .-278 ; 0x2d20a switch (WhereIsFilament()) { 2d320: 0f 94 d7 87 call 0x30fae ; 0x30fae 2d324: 88 23 and r24, r24 2d326: b1 f1 breq .+108 ; 0x2d394 2d328: 81 30 cpi r24, 0x01 ; 1 2d32a: 09 f0 breq .+2 ; 0x2d32e 2d32c: 6e cf rjmp .-292 ; 0x2d20a case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 2d32e: 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(); 2d332: 0f 94 8b 86 call 0x30d16 ; 0x30d16 // 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; 2d336: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 2d33a: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d33e: 70 e0 ldi r23, 0x00 ; 0 2d340: 90 e0 ldi r25, 0x00 ; 0 2d342: 80 e0 ldi r24, 0x00 ; 0 2d344: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2d348: 6b 01 movw r12, r22 2d34a: 7c 01 movw r14, r24 2d34c: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2d350: 70 e0 ldi r23, 0x00 ; 0 2d352: 6e 5f subi r22, 0xFE ; 254 2d354: 7f 4f sbci r23, 0xFF ; 255 2d356: 07 2e mov r0, r23 2d358: 00 0c add r0, r0 2d35a: 88 0b sbc r24, r24 2d35c: 99 0b sbc r25, r25 2d35e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2d362: a7 01 movw r20, r14 2d364: 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()); 2d366: 0f 94 a3 87 call 0x30f46 ; 0x30f46 2d36a: 4f cf rjmp .-354 ; 0x2d20a } 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 2d36c: 80 91 97 12 lds r24, 0x1297 ; 0x801297 2d370: 88 23 and r24, r24 2d372: 09 f4 brne .+2 ; 0x2d376 2d374: 4a cf rjmp .-364 ; 0x2d20a 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); 2d376: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d37a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d37e: 98 13 cpse r25, r24 2d380: 44 cf rjmp .-376 ; 0x2d20a switch (WhereIsFilament()) { 2d382: 0f 94 d7 87 call 0x30fae ; 0x30fae 2d386: 81 50 subi r24, 0x01 ; 1 2d388: 83 30 cpi r24, 0x03 ; 3 2d38a: 08 f4 brcc .+2 ; 0x2d38e 2d38c: bc cf rjmp .-136 ; 0x2d306 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; 2d38e: 10 92 97 12 sts 0x1297, r1 ; 0x801297 2d392: 3b cf rjmp .-394 ; 0x2d20a 2d394: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d398: 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 2d39c: 98 13 cpse r25, r24 2d39e: 35 cf rjmp .-406 ; 0x2d20a // 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()); 2d3a0: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d3a4: 70 e0 ldi r23, 0x00 ; 0 2d3a6: 90 e0 ldi r25, 0x00 ; 0 2d3a8: 80 e0 ldi r24, 0x00 ; 0 2d3aa: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2d3ae: 9b 01 movw r18, r22 2d3b0: ac 01 movw r20, r24 2d3b2: 60 e0 ldi r22, 0x00 ; 0 2d3b4: 70 e0 ldi r23, 0x00 ; 0 2d3b6: 8f ea ldi r24, 0xAF ; 175 2d3b8: 93 e4 ldi r25, 0x43 ; 67 2d3ba: d5 cf rjmp .-86 ; 0x2d366 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 2d3bc: 18 30 cpi r17, 0x08 ; 8 2d3be: b9 f0 breq .+46 ; 0x2d3ee 2d3c0: 19 30 cpi r17, 0x09 ; 9 2d3c2: 09 f0 breq .+2 ; 0x2d3c6 2d3c4: 22 cf rjmp .-444 ; 0x2d20a StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 2d3c6: 60 e0 ldi r22, 0x00 ; 0 2d3c8: 0f 94 48 4f call 0x29e90 ; 0x29e90 2d3cc: 19 e0 ldi r17, 0x09 ; 9 2d3ce: 1d cf rjmp .-454 ; 0x2d20a default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 2d3d0: 61 e0 ldi r22, 0x01 ; 1 2d3d2: 80 91 65 12 lds r24, 0x1265 ; 0x801265 2d3d6: 90 91 66 12 lds r25, 0x1266 ; 0x801266 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d3da: 0f 94 48 4f call 0x29e90 ; 0x29e90 2d3de: 15 cf rjmp .-470 ; 0x2d20a case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 2d3e0: 82 e0 ldi r24, 0x02 ; 2 2d3e2: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 2d3e6: 60 e0 ldi r22, 0x00 ; 0 2d3e8: 8e e2 ldi r24, 0x2E ; 46 2d3ea: 90 e8 ldi r25, 0x80 ; 128 2d3ec: f6 cf rjmp .-20 ; 0x2d3da StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2d3ee: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2d3f2: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2d3f6: 10 92 27 12 sts 0x1227, r1 ; 0x801227 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d3fa: 60 e0 ldi r22, 0x00 ; 0 2d3fc: 8c e2 ldi r24, 0x2C ; 44 2d3fe: 90 e8 ldi r25, 0x80 ; 128 2d400: ec cf rjmp .-40 ; 0x2d3da break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 2d402: 0f 94 ba 3a call 0x27574 ; 0x27574 2d406: a8 cd rjmp .-1200 ; 0x2cf58 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d408: 00 23 and r16, r16 2d40a: 01 f3 breq .-64 ; 0x2d3cc 2d40c: dc cf rjmp .-72 ; 0x2d3c6 0002d40e : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 2d40e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d412: 82 ff sbrs r24, 2 2d414: 07 c0 rjmp .+14 ; 0x2d424 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 2d416: 8b 7f andi r24, 0xFB ; 251 2d418: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 2d41c: 86 ed ldi r24, 0xD6 ; 214 2d41e: 9c e9 ldi r25, 0x9C ; 156 2d420: 0f 94 c7 87 call 0x30f8e ; 0x30f8e } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 2d424: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d428: 81 ff sbrs r24, 1 2d42a: 52 c0 rjmp .+164 ; 0x2d4d0 2d42c: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d430: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d434: 89 2b or r24, r25 2d436: 09 f4 brne .+2 ; 0x2d43a 2d438: 4b c0 rjmp .+150 ; 0x2d4d0 LogEchoEvent_P(PSTR("Resuming Temp")); 2d43a: 88 ec ldi r24, 0xC8 ; 200 2d43c: 9c e9 ldi r25, 0x9C ; 156 2d43e: 0f 94 c7 87 call 0x30f8e ; 0x30f8e // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 2d442: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d446: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d44a: 0f 94 48 41 call 0x28290 ; 0x28290 mmu_print_saved &= ~(SavedState::Cooldown); 2d44e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d452: 8d 7f andi r24, 0xFD ; 253 2d454: 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; 2d458: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d45c: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d460: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 2d464: 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)); 2d468: 87 ed ldi r24, 0xD7 ; 215 2d46a: 9a e5 ldi r25, 0x5A ; 90 2d46c: 0e 94 3c 6d call 0xda78 ; 0xda78 2d470: 0f 94 92 0a call 0x21524 ; 0x21524 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)); 2d474: 48 e9 ldi r20, 0x98 ; 152 2d476: 5c e9 ldi r21, 0x9C ; 156 2d478: 62 e0 ldi r22, 0x02 ; 2 2d47a: 80 e0 ldi r24, 0x00 ; 0 2d47c: 0e 94 1a 6a call 0xd434 ; 0xd434 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2d480: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2d484: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2d488: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2d48c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2d490: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2d494: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 2d498: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 2d49c: c9 01 movw r24, r18 2d49e: 86 1b sub r24, r22 2d4a0: 97 0b sbc r25, r23 2d4a2: 06 97 sbiw r24, 0x06 ; 6 2d4a4: 6c f0 brlt .+26 ; 0x2d4c0 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 2d4a6: 81 e0 ldi r24, 0x01 ; 1 2d4a8: 0e 94 8c 7a call 0xf518 ; 0xf518 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); 2d4ac: 80 e0 ldi r24, 0x00 ; 0 2d4ae: 0f 94 f3 64 call 0x2c9e6 ; 0x2c9e6 ReportErrorHookDynamicRender(); 2d4b2: 0f 94 00 87 call 0x30e00 ; 0x30e00 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2d4b6: 84 e6 ldi r24, 0x64 ; 100 2d4b8: 90 e0 ldi r25, 0x00 ; 0 2d4ba: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 2d4be: e0 cf rjmp .-64 ; 0x2d480 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 2d4c0: 0f 94 d6 86 call 0x30dac ; 0x30dac LogEchoEvent_P(PSTR("Hotend temperature reached")); 2d4c4: 8d ea ldi r24, 0xAD ; 173 2d4c6: 9c e9 ldi r25, 0x9C ; 156 2d4c8: 0f 94 c7 87 call 0x30f8e ; 0x30f8e void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 2d4cc: 0c 94 39 6a jmp 0xd472 ; 0xd472 ScreenClear(); } } 2d4d0: 08 95 ret 0002d4d2 : /// 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) { 2d4d2: 0f 93 push r16 2d4d4: 1f 93 push r17 2d4d6: cf 93 push r28 2d4d8: df 93 push r29 2d4da: 00 d0 rcall .+0 ; 0x2d4dc 2d4dc: 1f 92 push r1 2d4de: 1f 92 push r1 2d4e0: cd b7 in r28, 0x3d ; 61 2d4e2: de b7 in r29, 0x3e ; 62 2d4e4: 18 2f mov r17, r24 2d4e6: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 2d4e8: 10 92 95 12 sts 0x1295, r1 ; 0x801295 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 2d4ec: 83 e0 ldi r24, 0x03 ; 3 2d4ee: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 2d4f2: 19 82 std Y+1, r1 ; 0x01 2d4f4: 1a 82 std Y+2, r1 ; 0x02 2d4f6: 1b 82 std Y+3, r1 ; 0x03 2d4f8: 1c 82 std Y+4, r1 ; 0x04 2d4fa: 1d 82 std Y+5, r1 ; 0x05 2d4fc: 90 e0 ldi r25, 0x00 ; 0 2d4fe: 80 e0 ldi r24, 0x00 ; 0 2d500: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 // - 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) { 2d504: 90 91 95 12 lds r25, 0x1295 ; 0x801295 2d508: 89 81 ldd r24, Y+1 ; 0x01 2d50a: 92 ff sbrs r25, 2 2d50c: 37 c0 rjmp .+110 ; 0x2d57c if (!nozzleTimeout.running()) { 2d50e: 81 11 cpse r24, r1 2d510: 1e c0 rjmp .+60 ; 0x2d54e nozzleTimeout.start(); 2d512: ce 01 movw r24, r28 2d514: 01 96 adiw r24, 0x01 ; 1 2d516: 0f 94 73 11 call 0x222e6 ; 0x222e6 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 2d51a: 8a ea ldi r24, 0xAA ; 170 2d51c: 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")); 2d51e: 0f 94 c7 87 call 0x30f8e ; 0x30f8e } switch (logicStepLastStatus) { 2d522: e0 91 93 12 lds r30, 0x1293 ; 0x801293 2d526: e2 50 subi r30, 0x02 ; 2 2d528: ea 30 cpi r30, 0x0A ; 10 2d52a: 40 f7 brcc .-48 ; 0x2d4fc 2d52c: f0 e0 ldi r31, 0x00 ; 0 2d52e: 88 27 eor r24, r24 2d530: e3 56 subi r30, 0x63 ; 99 2d532: f5 49 sbci r31, 0x95 ; 149 2d534: 8e 4f sbci r24, 0xFE ; 254 2d536: 0d 94 8d a1 jmp 0x3431a ; 0x3431a <__tablejump2__> 2d53a: 6d 38 cpi r22, 0x8D ; 141 2d53c: a3 37 cpi r26, 0x73 ; 115 2d53e: b7 37 cpi r27, 0x77 ; 119 2d540: b7 37 cpi r27, 0x77 ; 119 2d542: b9 38 cpi r27, 0x89 ; 137 2d544: b7 37 cpi r27, 0x77 ; 119 2d546: d1 37 cpi r29, 0x71 ; 113 2d548: 69 38 cpi r22, 0x89 ; 137 2d54a: 3b 38 cpi r19, 0x8B ; 139 2d54c: b7 37 cpi r27, 0x77 ; 119 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. 2d54e: 40 e4 ldi r20, 0x40 ; 64 2d550: 57 e7 ldi r21, 0x77 ; 119 2d552: 6b e1 ldi r22, 0x1B ; 27 2d554: 70 e0 ldi r23, 0x00 ; 0 2d556: ce 01 movw r24, r28 2d558: 01 96 adiw r24, 0x01 ; 1 2d55a: 0f 94 b4 0f call 0x21f68 ; 0x21f68 ::expired(unsigned long)> 2d55e: 88 23 and r24, r24 2d560: 01 f3 breq .-64 ; 0x2d522 mmu_print_saved &= ~(SavedState::CooldownPending); 2d562: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d566: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 2d568: 82 60 ori r24, 0x02 ; 2 2d56a: 80 93 95 12 sts 0x1295, r24 ; 0x801295 2d56e: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2d572: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 2d576: 8a e9 ldi r24, 0x9A ; 154 2d578: 9a e9 ldi r25, 0x9A ; 154 2d57a: d1 cf rjmp .-94 ; 0x2d51e } } else if (nozzleTimeout.running()) { 2d57c: 88 23 and r24, r24 2d57e: 89 f2 breq .-94 ; 0x2d522 2d580: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d582: 84 e8 ldi r24, 0x84 ; 132 2d584: 9a e9 ldi r25, 0x9A ; 154 2d586: cb cf rjmp .-106 ; 0x2d51e 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(); 2d588: 0f 94 07 6a call 0x2d40e ; 0x2d40e ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 2d58c: 0f 94 b9 3e call 0x27d72 ; 0x27d72 if (!TuneMenuEntered()) { 2d590: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> 2d594: 81 11 cpse r24, r1 2d596: 07 c0 rjmp .+14 ; 0x2d5a6 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2d598: 85 e8 ldi r24, 0x85 ; 133 2d59a: 9c e9 ldi r25, 0x9C ; 156 2d59c: 0e 94 de 72 call 0xe5bc ; 0xe5bc retryAttempts = MAX_RETRIES; 2d5a0: 83 e0 ldi r24, 0x03 ; 3 2d5a2: 80 93 79 12 sts 0x1279, r24 ; 0x801279 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d5a6: 0f 94 14 22 call 0x24428 ; 0x24428 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; 2d5aa: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 2d5ac: 0f 90 pop r0 2d5ae: 0f 90 pop r0 2d5b0: 0f 90 pop r0 2d5b2: 0f 90 pop r0 2d5b4: 0f 90 pop r0 2d5b6: df 91 pop r29 2d5b8: cf 91 pop r28 2d5ba: 1f 91 pop r17 2d5bc: 0f 91 pop r16 2d5be: 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(); 2d5c0: 0f 94 39 64 call 0x2c872 ; 0x2c872 2d5c4: f2 cf rjmp .-28 ; 0x2d5aa break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 2d5c6: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 2d5ca: 81 11 cpse r24, r1 2d5cc: 97 cf rjmp .-210 ; 0x2d4fc // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 2d5ce: 81 2f mov r24, r17 2d5d0: 0f 94 03 3f call 0x27e06 ; 0x27e06 SaveHotendTemp(turn_off_nozzle); 2d5d4: 80 2f mov r24, r16 2d5d6: 0f 94 9d 3e call 0x27d3a ; 0x27d3a CheckUserInput(); 2d5da: 0f 94 39 64 call 0x2c872 ; 0x2c872 2d5de: 8e cf rjmp .-228 ; 0x2d4fc } 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(); 2d5e0: 0f 94 07 6a call 0x2d40e ; 0x2d40e ResumeUnpark(); 2d5e4: 0f 94 b9 3e call 0x27d72 ; 0x27d72 2d5e8: 89 cf rjmp .-238 ; 0x2d4fc } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 2d5ea: 80 e0 ldi r24, 0x00 ; 0 2d5ec: df cf rjmp .-66 ; 0x2d5ac 0002d5ee : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 2d5ee: cf 93 push r28 2d5f0: df 93 push r29 2d5f2: 00 d0 rcall .+0 ; 0x2d5f4 2d5f4: 1f 92 push r1 2d5f6: 1f 92 push r1 2d5f8: cd b7 in r28, 0x3d ; 61 2d5fa: 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; 2d5fc: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2d600: 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)); 2d604: 62 e1 ldi r22, 0x12 ; 18 2d606: 84 ef ldi r24, 0xF4 ; 244 2d608: 99 e9 ldi r25, 0x99 ; 153 2d60a: 0f 94 2c 54 call 0x2a858 ; 0x2a858 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(); 2d60e: 0f 94 a1 87 call 0x30f42 ; 0x30f42 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 2d612: 40 e0 ldi r20, 0x00 ; 0 2d614: 65 e5 ldi r22, 0x55 ; 85 2d616: ce 01 movw r24, r28 2d618: 01 96 adiw r24, 0x01 ; 1 2d61a: 0f 94 94 87 call 0x30f28 ; 0x30f28 2d61e: 49 81 ldd r20, Y+1 ; 0x01 2d620: 5a 81 ldd r21, Y+2 ; 0x02 2d622: 6b 81 ldd r22, Y+3 ; 0x03 2d624: 7c 81 ldd r23, Y+4 ; 0x04 2d626: 8d 81 ldd r24, Y+5 ; 0x05 2d628: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 logic.UnloadFilament(); if (manage_response(false, true)) { 2d62c: 61 e0 ldi r22, 0x01 ; 1 2d62e: 80 e0 ldi r24, 0x00 ; 0 2d630: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 2d634: 81 11 cpse r24, r1 2d636: 03 c0 rjmp .+6 ; 0x2d63e break; } IncrementMMUFails(); 2d638: 0f 94 f8 86 call 0x30df0 ; 0x30df0 2d63c: e8 cf rjmp .-48 ; 0x2d60e 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); 2d63e: 83 e0 ldi r24, 0x03 ; 3 2d640: 0f 94 71 2c call 0x258e2 ; 0x258e2 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 2d644: 83 e6 ldi r24, 0x63 ; 99 2d646: 0f 94 50 41 call 0x282a0 ; 0x282a0 tool_change_extruder = MMU2_NO_TOOL; 2d64a: 83 e6 ldi r24, 0x63 ; 99 2d64c: 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(); } 2d650: 84 e8 ldi r24, 0x84 ; 132 2d652: 96 e1 ldi r25, 0x16 ; 22 2d654: 0e 94 7b 6e call 0xdcf6 ; 0xdcf6 } 2d658: 0f 90 pop r0 2d65a: 0f 90 pop r0 2d65c: 0f 90 pop r0 2d65e: 0f 90 pop r0 2d660: 0f 90 pop r0 2d662: df 91 pop r29 2d664: cf 91 pop r28 2d666: 08 95 ret 0002d668 : bool MMU2::unload() { 2d668: cf 93 push r28 if (!WaitForMMUReady()) { 2d66a: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 2d66e: c8 2f mov r28, r24 2d670: 88 23 and r24, r24 2d672: 79 f0 breq .+30 ; 0x2d692 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 2d674: 88 ec ldi r24, 0xC8 ; 200 2d676: 90 e0 ldi r25, 0x00 ; 0 2d678: 0f 94 20 8b call 0x31640 ; 0x31640 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]> 2d67c: 82 e0 ldi r24, 0x02 ; 2 2d67e: 0f 94 71 2c call 0x258e2 ; 0x258e2 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d682: 0f 94 21 54 call 0x2a842 ; 0x2a842 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 2d686: 0f 94 f7 6a call 0x2d5ee ; 0x2d5ee explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d68a: 0f 94 4a 54 call 0x2a894 ; 0x2a894 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 2d68e: 0f 94 d6 86 call 0x30dac ; 0x30dac return true; } 2d692: 8c 2f mov r24, r28 2d694: cf 91 pop r28 2d696: 08 95 ret 0002d698 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 2d698: 0f 93 push r16 2d69a: 1f 93 push r17 2d69c: cf 93 push r28 2d69e: df 93 push r29 2d6a0: 00 d0 rcall .+0 ; 0x2d6a2 2d6a2: 1f 92 push r1 2d6a4: 1f 92 push r1 2d6a6: cd b7 in r28, 0x3d ; 61 2d6a8: de b7 in r29, 0x3e ; 62 2d6aa: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 2d6ac: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 2d6b0: 18 2f mov r17, r24 2d6b2: 88 23 and r24, r24 2d6b4: 49 f1 breq .+82 ; 0x2d708 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 2d6b6: 84 ec ldi r24, 0xC4 ; 196 2d6b8: 9a e5 ldi r25, 0x5A ; 90 2d6ba: 0e 94 3c 6d call 0xda78 ; 0xda78 2d6be: 60 2f mov r22, r16 2d6c0: 0f 94 d9 86 call 0x30db2 ; 0x30db2 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d6c4: 0f 94 21 54 call 0x2a842 ; 0x2a842 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 2d6c8: 0f 94 a1 87 call 0x30f42 ; 0x30f42 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 2d6cc: 40 2f mov r20, r16 2d6ce: 6c e4 ldi r22, 0x4C ; 76 2d6d0: ce 01 movw r24, r28 2d6d2: 01 96 adiw r24, 0x01 ; 1 2d6d4: 0f 94 94 87 call 0x30f28 ; 0x30f28 2d6d8: 49 81 ldd r20, Y+1 ; 0x01 2d6da: 5a 81 ldd r21, Y+2 ; 0x02 2d6dc: 6b 81 ldd r22, Y+3 ; 0x03 2d6de: 7c 81 ldd r23, Y+4 ; 0x04 2d6e0: 8d 81 ldd r24, Y+5 ; 0x05 2d6e2: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 logic.LoadFilament(slot); if (manage_response(false, false)) { 2d6e6: 60 e0 ldi r22, 0x00 ; 0 2d6e8: 80 e0 ldi r24, 0x00 ; 0 2d6ea: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 2d6ee: 18 2f mov r17, r24 2d6f0: 81 11 cpse r24, r1 2d6f2: 03 c0 rjmp .+6 ; 0x2d6fa break; } IncrementMMUFails(); 2d6f4: 0f 94 f8 86 call 0x30df0 ; 0x30df0 2d6f8: e7 cf rjmp .-50 ; 0x2d6c8 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); 2d6fa: 83 e0 ldi r24, 0x03 ; 3 2d6fc: 0f 94 71 2c call 0x258e2 ; 0x258e2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d700: 0f 94 4a 54 call 0x2a894 ; 0x2a894 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d704: 0f 94 d6 86 call 0x30dac ; 0x30dac return true; } 2d708: 81 2f mov r24, r17 2d70a: 0f 90 pop r0 2d70c: 0f 90 pop r0 2d70e: 0f 90 pop r0 2d710: 0f 90 pop r0 2d712: 0f 90 pop r0 2d714: df 91 pop r29 2d716: cf 91 pop r28 2d718: 1f 91 pop r17 2d71a: 0f 91 pop r16 2d71c: 08 95 ret 0002d71e : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 2d71e: ff 92 push r15 2d720: 0f 93 push r16 2d722: 1f 93 push r17 2d724: cf 93 push r28 2d726: df 93 push r29 2d728: 00 d0 rcall .+0 ; 0x2d72a 2d72a: 1f 92 push r1 2d72c: 1f 92 push r1 2d72e: cd b7 in r28, 0x3d ; 61 2d730: de b7 in r29, 0x3e ; 62 2d732: 08 2f mov r16, r24 2d734: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 2d736: 0f 94 55 54 call 0x2a8aa ; 0x2a8aa 2d73a: 18 2f mov r17, r24 2d73c: 88 23 and r24, r24 2d73e: b1 f1 breq .+108 ; 0x2d7ac return false; } if (enableFullScreenMsg) { 2d740: ff 20 and r15, r15 2d742: 39 f0 breq .+14 ; 0x2d752 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 2d744: 83 eb ldi r24, 0xB3 ; 179 2d746: 9a e5 ldi r25, 0x5A ; 90 2d748: 0e 94 3c 6d call 0xda78 ; 0xda78 2d74c: 60 2f mov r22, r16 2d74e: 0f 94 d9 86 call 0x30db2 ; 0x30db2 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 2d752: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d756: 81 11 cpse r24, r1 unload(); 2d758: 0f 94 34 6b call 0x2d668 ; 0x2d668 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d75c: 0f 94 21 54 call 0x2a842 ; 0x2a842 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 2d760: 0f 94 a1 87 call 0x30f42 ; 0x30f42 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 2d764: 40 2f mov r20, r16 2d766: 65 e4 ldi r22, 0x45 ; 69 2d768: ce 01 movw r24, r28 2d76a: 01 96 adiw r24, 0x01 ; 1 2d76c: 0f 94 94 87 call 0x30f28 ; 0x30f28 2d770: 49 81 ldd r20, Y+1 ; 0x01 2d772: 5a 81 ldd r21, Y+2 ; 0x02 2d774: 6b 81 ldd r22, Y+3 ; 0x03 2d776: 7c 81 ldd r23, Y+4 ; 0x04 2d778: 8d 81 ldd r24, Y+5 ; 0x05 2d77a: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 logic.EjectFilament(slot); if (manage_response(false, true)) { 2d77e: 61 e0 ldi r22, 0x01 ; 1 2d780: 80 e0 ldi r24, 0x00 ; 0 2d782: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 2d786: 18 2f mov r17, r24 2d788: 81 11 cpse r24, r1 2d78a: 03 c0 rjmp .+6 ; 0x2d792 break; } IncrementMMUFails(); 2d78c: 0f 94 f8 86 call 0x30df0 ; 0x30df0 2d790: e7 cf rjmp .-50 ; 0x2d760 } SetCurrentTool(MMU2_NO_TOOL); 2d792: 83 e6 ldi r24, 0x63 ; 99 2d794: 0f 94 50 41 call 0x282a0 ; 0x282a0 tool_change_extruder = MMU2_NO_TOOL; 2d798: 83 e6 ldi r24, 0x63 ; 99 2d79a: 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); 2d79e: 83 e0 ldi r24, 0x03 ; 3 2d7a0: 0f 94 71 2c call 0x258e2 ; 0x258e2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d7a4: 0f 94 4a 54 call 0x2a894 ; 0x2a894 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 2d7a8: 0f 94 d6 86 call 0x30dac ; 0x30dac return true; } 2d7ac: 81 2f mov r24, r17 2d7ae: 0f 90 pop r0 2d7b0: 0f 90 pop r0 2d7b2: 0f 90 pop r0 2d7b4: 0f 90 pop r0 2d7b6: 0f 90 pop r0 2d7b8: df 91 pop r29 2d7ba: cf 91 pop r28 2d7bc: 1f 91 pop r17 2d7be: 0f 91 pop r16 2d7c0: ff 90 pop r15 2d7c2: 08 95 ret 0002d7c4 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 2d7c4: 1f 93 push r17 2d7c6: cf 93 push r28 2d7c8: df 93 push r29 2d7ca: 00 d0 rcall .+0 ; 0x2d7cc 2d7cc: 1f 92 push r1 2d7ce: 1f 92 push r1 2d7d0: cd b7 in r28, 0x3d ; 61 2d7d2: de b7 in r29, 0x3e ; 62 2d7d4: 18 2f mov r17, r24 for (;;) { Disable_E0(); 2d7d6: 0f 94 a1 87 call 0x30f42 ; 0x30f42 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 2d7da: 41 2f mov r20, r17 2d7dc: 6b e4 ldi r22, 0x4B ; 75 2d7de: ce 01 movw r24, r28 2d7e0: 01 96 adiw r24, 0x01 ; 1 2d7e2: 0f 94 94 87 call 0x30f28 ; 0x30f28 2d7e6: 49 81 ldd r20, Y+1 ; 0x01 2d7e8: 5a 81 ldd r21, Y+2 ; 0x02 2d7ea: 6b 81 ldd r22, Y+3 ; 0x03 2d7ec: 7c 81 ldd r23, Y+4 ; 0x04 2d7ee: 8d 81 ldd r24, Y+5 ; 0x05 2d7f0: 0f 94 d4 62 call 0x2c5a8 ; 0x2c5a8 logic.CutFilament(slot); if (manage_response(false, true)) { 2d7f4: 61 e0 ldi r22, 0x01 ; 1 2d7f6: 80 e0 ldi r24, 0x00 ; 0 2d7f8: 0f 94 69 6a call 0x2d4d2 ; 0x2d4d2 2d7fc: 81 11 cpse r24, r1 2d7fe: 03 c0 rjmp .+6 ; 0x2d806 break; } IncrementMMUFails(); 2d800: 0f 94 f8 86 call 0x30df0 ; 0x30df0 2d804: e8 cf rjmp .-48 ; 0x2d7d6 } } 2d806: 0f 90 pop r0 2d808: 0f 90 pop r0 2d80a: 0f 90 pop r0 2d80c: 0f 90 pop r0 2d80e: 0f 90 pop r0 2d810: df 91 pop r29 2d812: cf 91 pop r28 2d814: 1f 91 pop r17 2d816: 08 95 ret 0002d818 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 2d818: cf 93 push r28 2d81a: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 2d81c: 84 ea ldi r24, 0xA4 ; 164 2d81e: 9a e5 ldi r25, 0x5A ; 90 2d820: 0e 94 3c 6d call 0xda78 ; 0xda78 2d824: 6c 2f mov r22, r28 2d826: 0f 94 d9 86 call 0x30db2 ; 0x30db2 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 2d82a: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d82e: 81 11 cpse r24, r1 unload(); 2d830: 0f 94 34 6b call 0x2d668 ; 0x2d668 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d834: 0f 94 21 54 call 0x2a842 ; 0x2a842 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 2d838: 8c 2f mov r24, r28 2d83a: 0f 94 e2 6b call 0x2d7c4 ; 0x2d7c4 SetCurrentTool(MMU2_NO_TOOL); 2d83e: 83 e6 ldi r24, 0x63 ; 99 2d840: 0f 94 50 41 call 0x282a0 ; 0x282a0 tool_change_extruder = MMU2_NO_TOOL; 2d844: 83 e6 ldi r24, 0x63 ; 99 2d846: 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); 2d84a: 83 e0 ldi r24, 0x03 ; 3 2d84c: 0f 94 71 2c call 0x258e2 ; 0x258e2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d850: 0f 94 4a 54 call 0x2a894 ; 0x2a894 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d854: 0f 94 d6 86 call 0x30dac ; 0x30dac return true; } 2d858: 81 e0 ldi r24, 0x01 ; 1 2d85a: cf 91 pop r28 2d85c: 08 95 ret 0002d85e : /// 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; 2d85e: 86 27 eor r24, r22 2d860: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2d862: 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) { 2d864: 38 2f mov r19, r24 2d866: 88 0f add r24, r24 2d868: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 2d86a: 82 27 eor r24, r18 2d86c: 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++) { 2d86e: d1 f7 brne .-12 ; 0x2d864 } else { data <<= 1U; } } return data; } 2d870: 08 95 ret 0002d872 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 2d872: 8f e0 ldi r24, 0x0F ; 15 2d874: 90 ea ldi r25, 0xA0 ; 160 2d876: 0c 94 e5 70 jmp 0xe1ca ; 0xe1ca 0002d87a : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 2d87a: cf 93 push r28 2d87c: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 2d87e: 89 e0 ldi r24, 0x09 ; 9 2d880: 90 ea ldi r25, 0xA0 ; 160 2d882: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 2d886: 8c 2f mov r24, r28 2d888: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d88c: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 2d88e: cf 91 pop r28 2d890: 0c 94 cc 70 jmp 0xe198 ; 0xe198 0002d894 : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 2d894: cf 93 push r28 2d896: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 2d898: 82 ed ldi r24, 0xD2 ; 210 2d89a: 9f e9 ldi r25, 0x9F ; 159 2d89c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 2d8a0: 8c 2f mov r24, r28 2d8a2: 0e 94 cc 70 call 0xe198 ; 0xe198 2d8a6: 8d e5 ldi r24, 0x5D ; 93 2d8a8: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 2d8ac: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 2d8ae: 0d 94 39 6c jmp 0x2d872 ; 0x2d872 0002d8b2 : // 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) { 2d8b2: 2f 92 push r2 2d8b4: 3f 92 push r3 2d8b6: 4f 92 push r4 2d8b8: 5f 92 push r5 2d8ba: 6f 92 push r6 2d8bc: 7f 92 push r7 2d8be: 8f 92 push r8 2d8c0: 9f 92 push r9 2d8c2: af 92 push r10 2d8c4: bf 92 push r11 2d8c6: cf 92 push r12 2d8c8: df 92 push r13 2d8ca: ef 92 push r14 2d8cc: ff 92 push r15 2d8ce: 0f 93 push r16 2d8d0: 1f 93 push r17 2d8d2: cf 93 push r28 2d8d4: df 93 push r29 2d8d6: cd b7 in r28, 0x3d ; 61 2d8d8: de b7 in r29, 0x3e ; 62 2d8da: a1 97 sbiw r28, 0x21 ; 33 2d8dc: 0f b6 in r0, 0x3f ; 63 2d8de: f8 94 cli 2d8e0: de bf out 0x3e, r29 ; 62 2d8e2: 0f be out 0x3f, r0 ; 63 2d8e4: cd bf out 0x3d, r28 ; 61 2d8e6: 1c 01 movw r2, r24 2d8e8: 48 01 movw r8, r16 2d8ea: 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) 2d8ec: fc 01 movw r30, r24 2d8ee: e8 5b subi r30, 0xB8 ; 184 2d8f0: ff 4f sbci r31, 0xFF ; 255 2d8f2: c0 80 ld r12, Z 2d8f4: d1 80 ldd r13, Z+1 ; 0x01 2d8f6: e2 80 ldd r14, Z+2 ; 0x02 2d8f8: f3 80 ldd r15, Z+3 ; 0x03 2d8fa: 9a 01 movw r18, r20 2d8fc: ab 01 movw r20, r22 2d8fe: c7 01 movw r24, r14 2d900: b6 01 movw r22, r12 2d902: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2d906: 0f 94 83 a2 call 0x34506 ; 0x34506 2d90a: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2d90e: 8b 01 movw r16, r22 2d910: 8d 83 std Y+5, r24 ; 0x05 2d912: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 2d914: a5 01 movw r20, r10 2d916: 94 01 movw r18, r8 2d918: c7 01 movw r24, r14 2d91a: b6 01 movw r22, r12 2d91c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2d920: 0f 94 83 a2 call 0x34506 ; 0x34506 2d924: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2d928: 36 2f mov r19, r22 2d92a: 27 2f mov r18, r23 2d92c: a8 01 movw r20, r16 2d92e: 6d 81 ldd r22, Y+5 ; 0x05 2d930: 79 81 ldd r23, Y+1 ; 0x01 2d932: 48 37 cpi r20, 0x78 ; 120 2d934: 51 05 cpc r21, r1 2d936: 61 05 cpc r22, r1 2d938: 71 05 cpc r23, r1 2d93a: 20 f4 brcc .+8 ; 0x2d944 2d93c: 48 e7 ldi r20, 0x78 ; 120 2d93e: 50 e0 ldi r21, 0x00 ; 0 2d940: 60 e0 ldi r22, 0x00 ; 0 2d942: 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) 2d944: d1 01 movw r26, r2 2d946: d6 96 adiw r26, 0x36 ; 54 2d948: 8d 90 ld r8, X+ 2d94a: 9d 90 ld r9, X+ 2d94c: ad 90 ld r10, X+ 2d94e: bc 90 ld r11, X 2d950: d9 97 sbiw r26, 0x39 ; 57 2d952: 8f 8a std Y+23, r8 ; 0x17 2d954: 98 8e std Y+24, r9 ; 0x18 2d956: a9 8e std Y+25, r10 ; 0x19 2d958: ba 8e std Y+26, r11 ; 0x1a 2d95a: 48 15 cp r20, r8 2d95c: 59 05 cpc r21, r9 2d95e: 6a 05 cpc r22, r10 2d960: 7b 05 cpc r23, r11 2d962: 20 f4 brcc .+8 ; 0x2d96c 2d964: 4f 8b std Y+23, r20 ; 0x17 2d966: 58 8f std Y+24, r21 ; 0x18 2d968: 69 8f std Y+25, r22 ; 0x19 2d96a: 7a 8f std Y+26, r23 ; 0x1a 2d96c: 43 2f mov r20, r19 2d96e: 52 2f mov r21, r18 2d970: bc 01 movw r22, r24 2d972: 48 37 cpi r20, 0x78 ; 120 2d974: 51 05 cpc r21, r1 2d976: 61 05 cpc r22, r1 2d978: 71 05 cpc r23, r1 2d97a: 20 f4 brcc .+8 ; 0x2d984 2d97c: 48 e7 ldi r20, 0x78 ; 120 2d97e: 50 e0 ldi r21, 0x00 ; 0 2d980: 60 e0 ldi r22, 0x00 ; 0 2d982: 70 e0 ldi r23, 0x00 ; 0 2d984: 18 2d mov r17, r8 2d986: 09 2d mov r16, r9 2d988: a9 a2 std Y+33, r10 ; 0x21 2d98a: b8 a2 std Y+32, r11 ; 0x20 2d98c: 48 15 cp r20, r8 2d98e: 59 05 cpc r21, r9 2d990: 6a 05 cpc r22, r10 2d992: 7b 05 cpc r23, r11 2d994: 20 f4 brcc .+8 ; 0x2d99e 2d996: 14 2f mov r17, r20 2d998: 05 2f mov r16, r21 2d99a: 69 a3 std Y+33, r22 ; 0x21 2d99c: 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; 2d99e: f1 01 movw r30, r2 2d9a0: ee 5b subi r30, 0xBE ; 190 2d9a2: ff 4f sbci r31, 0xFF ; 255 2d9a4: c0 80 ld r12, Z 2d9a6: d1 80 ldd r13, Z+1 ; 0x01 2d9a8: e2 80 ldd r14, Z+2 ; 0x02 2d9aa: f3 80 ldd r15, Z+3 ; 0x03 2d9ac: cd 82 std Y+5, r12 ; 0x05 2d9ae: de 82 std Y+6, r13 ; 0x06 2d9b0: ef 82 std Y+7, r14 ; 0x07 2d9b2: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 2d9b4: cd 28 or r12, r13 2d9b6: ce 28 or r12, r14 2d9b8: cf 28 or r12, r15 2d9ba: 41 f4 brne .+16 ; 0x2d9cc // Don't allow zero acceleration. acceleration = 1; 2d9bc: c1 2c mov r12, r1 2d9be: d1 2c mov r13, r1 2d9c0: 76 01 movw r14, r12 2d9c2: c3 94 inc r12 2d9c4: cd 82 std Y+5, r12 ; 0x05 2d9c6: de 82 std Y+6, r13 ; 0x06 2d9c8: ef 82 std Y+7, r14 ; 0x07 2d9ca: 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; 2d9cc: 2f 89 ldd r18, Y+23 ; 0x17 2d9ce: 38 8d ldd r19, Y+24 ; 0x18 2d9d0: 49 8d ldd r20, Y+25 ; 0x19 2d9d2: 5a 8d ldd r21, Y+26 ; 0x1a 2d9d4: b9 01 movw r22, r18 2d9d6: ca 01 movw r24, r20 2d9d8: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 2d9dc: 6d 87 std Y+13, r22 ; 0x0d 2d9de: 7e 87 std Y+14, r23 ; 0x0e 2d9e0: 8f 87 std Y+15, r24 ; 0x0f 2d9e2: 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; 2d9e4: a5 01 movw r20, r10 2d9e6: 94 01 movw r18, r8 2d9e8: c5 01 movw r24, r10 2d9ea: b4 01 movw r22, r8 2d9ec: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 2d9f0: 2b 01 movw r4, r22 2d9f2: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 2d9f4: 21 2f mov r18, r17 2d9f6: 30 2f mov r19, r16 2d9f8: 49 a1 ldd r20, Y+33 ; 0x21 2d9fa: 58 a1 ldd r21, Y+32 ; 0x20 2d9fc: 61 2f mov r22, r17 2d9fe: 70 2f mov r23, r16 2da00: ca 01 movw r24, r20 2da02: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 2da06: 69 8b std Y+17, r22 ; 0x11 2da08: 7a 8b std Y+18, r23 ; 0x12 2da0a: 8b 8b std Y+19, r24 ; 0x13 2da0c: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 2da0e: cd 80 ldd r12, Y+5 ; 0x05 2da10: de 80 ldd r13, Y+6 ; 0x06 2da12: ef 80 ldd r14, Y+7 ; 0x07 2da14: f8 84 ldd r15, Y+8 ; 0x08 2da16: cc 0c add r12, r12 2da18: dd 1c adc r13, r13 2da1a: ee 1c adc r14, r14 2da1c: ff 1c adc r15, r15 2da1e: c9 86 std Y+9, r12 ; 0x09 2da20: da 86 std Y+10, r13 ; 0x0a 2da22: eb 86 std Y+11, r14 ; 0x0b 2da24: 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; 2da26: c3 01 movw r24, r6 2da28: b2 01 movw r22, r4 2da2a: 61 50 subi r22, 0x01 ; 1 2da2c: 71 09 sbc r23, r1 2da2e: 81 09 sbc r24, r1 2da30: 91 09 sbc r25, r1 2da32: cd 84 ldd r12, Y+13 ; 0x0d 2da34: de 84 ldd r13, Y+14 ; 0x0e 2da36: ef 84 ldd r14, Y+15 ; 0x0f 2da38: f8 88 ldd r15, Y+16 ; 0x10 2da3a: 6c 19 sub r22, r12 2da3c: 7d 09 sbc r23, r13 2da3e: 8e 09 sbc r24, r14 2da40: 9f 09 sbc r25, r15 2da42: c9 84 ldd r12, Y+9 ; 0x09 2da44: da 84 ldd r13, Y+10 ; 0x0a 2da46: eb 84 ldd r14, Y+11 ; 0x0b 2da48: fc 84 ldd r15, Y+12 ; 0x0c 2da4a: 6c 0d add r22, r12 2da4c: 7d 1d adc r23, r13 2da4e: 8e 1d adc r24, r14 2da50: 9f 1d adc r25, r15 2da52: a7 01 movw r20, r14 2da54: 96 01 movw r18, r12 2da56: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 2da5a: 69 01 movw r12, r18 2da5c: 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; 2da5e: c3 01 movw r24, r6 2da60: b2 01 movw r22, r4 2da62: 29 89 ldd r18, Y+17 ; 0x11 2da64: 3a 89 ldd r19, Y+18 ; 0x12 2da66: 4b 89 ldd r20, Y+19 ; 0x13 2da68: 5c 89 ldd r21, Y+20 ; 0x14 2da6a: 62 1b sub r22, r18 2da6c: 73 0b sbc r23, r19 2da6e: 84 0b sbc r24, r20 2da70: 95 0b sbc r25, r21 2da72: 29 85 ldd r18, Y+9 ; 0x09 2da74: 3a 85 ldd r19, Y+10 ; 0x0a 2da76: 4b 85 ldd r20, Y+11 ; 0x0b 2da78: 5c 85 ldd r21, Y+12 ; 0x0c 2da7a: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 2da7e: 29 01 movw r4, r18 2da80: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 2da82: d7 01 movw r26, r14 2da84: c6 01 movw r24, r12 2da86: 84 0d add r24, r4 2da88: 95 1d adc r25, r5 2da8a: a6 1d adc r26, r6 2da8c: b7 1d adc r27, r7 2da8e: 8c 8f std Y+28, r24 ; 0x1c 2da90: 9d 8f std Y+29, r25 ; 0x1d 2da92: ae 8f std Y+30, r26 ; 0x1e 2da94: 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) { 2da96: f1 01 movw r30, r2 2da98: e4 5b subi r30, 0xB4 ; 180 2da9a: ff 4f sbci r31, 0xFF ; 255 2da9c: 90 81 ld r25, Z 2da9e: 9b 8f std Y+27, r25 ; 0x1b 2daa0: 99 23 and r25, r25 2daa2: 09 f4 brne .+2 ; 0x2daa6 2daa4: 8d c0 rjmp .+282 ; 0x2dbc0 final_adv_steps = final_rate * block->adv_comp; 2daa6: 61 2f mov r22, r17 2daa8: 70 2f mov r23, r16 2daaa: 89 a1 ldd r24, Y+33 ; 0x21 2daac: 98 a1 ldd r25, Y+32 ; 0x20 2daae: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2dab2: f1 01 movw r30, r2 2dab4: ec 5a subi r30, 0xAC ; 172 2dab6: ff 4f sbci r31, 0xFF ; 255 2dab8: 20 81 ld r18, Z 2daba: 31 81 ldd r19, Z+1 ; 0x01 2dabc: 42 81 ldd r20, Z+2 ; 0x02 2dabe: 53 81 ldd r21, Z+3 ; 0x03 2dac0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2dac4: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2dac8: 6d 8b std Y+21, r22 ; 0x15 2daca: 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) { 2dacc: d1 01 movw r26, r2 2dace: 50 96 adiw r26, 0x10 ; 16 2dad0: 2d 91 ld r18, X+ 2dad2: 3d 91 ld r19, X+ 2dad4: 4d 91 ld r20, X+ 2dad6: 5c 91 ld r21, X 2dad8: 53 97 sbiw r26, 0x13 ; 19 2dada: 29 83 std Y+1, r18 ; 0x01 2dadc: 3a 83 std Y+2, r19 ; 0x02 2dade: 4b 83 std Y+3, r20 ; 0x03 2dae0: 5c 83 std Y+4, r21 ; 0x04 2dae2: 8c 8d ldd r24, Y+28 ; 0x1c 2dae4: 9d 8d ldd r25, Y+29 ; 0x1d 2dae6: ae 8d ldd r26, Y+30 ; 0x1e 2dae8: bf 8d ldd r27, Y+31 ; 0x1f 2daea: 82 17 cp r24, r18 2daec: 93 07 cpc r25, r19 2daee: a4 07 cpc r26, r20 2daf0: b5 07 cpc r27, r21 2daf2: 08 f0 brcs .+2 ; 0x2daf6 2daf4: 68 c0 rjmp .+208 ; 0x2dbc6 plateau_steps = block->step_event_count.wide - accel_decel_steps; 2daf6: 29 01 movw r4, r18 2daf8: 3a 01 movw r6, r20 2dafa: 48 1a sub r4, r24 2dafc: 59 0a sbc r5, r25 2dafe: 6a 0a sbc r6, r26 2db00: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 2db02: 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; 2db04: 40 e0 ldi r20, 0x00 ; 0 2db06: 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) 2db08: 99 23 and r25, r25 2db0a: 89 f0 breq .+34 ; 0x2db2e max_adv_steps = block->nominal_rate * block->adv_comp; 2db0c: c5 01 movw r24, r10 2db0e: b4 01 movw r22, r8 2db10: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2db14: f1 01 movw r30, r2 2db16: ec 5a subi r30, 0xAC ; 172 2db18: ff 4f sbci r31, 0xFF ; 255 2db1a: 20 81 ld r18, Z 2db1c: 31 81 ldd r19, Z+1 ; 0x01 2db1e: 42 81 ldd r20, Z+2 ; 0x02 2db20: 53 81 ldd r21, Z+3 ; 0x03 2db22: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2db26: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2db2a: 46 2f mov r20, r22 2db2c: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 2db2e: 3f b7 in r19, 0x3f ; 63 2db30: 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. 2db32: f1 01 movw r30, r2 2db34: e9 5b subi r30, 0xB9 ; 185 2db36: ff 4f sbci r31, 0xFF ; 255 2db38: 20 81 ld r18, Z 2db3a: 21 11 cpse r18, r1 2db3c: 27 c0 rjmp .+78 ; 0x2db8c block->accelerate_until = accelerate_steps; 2db3e: d1 01 movw r26, r2 2db40: 59 96 adiw r26, 0x19 ; 25 2db42: cd 92 st X+, r12 2db44: dd 92 st X+, r13 2db46: ed 92 st X+, r14 2db48: fc 92 st X, r15 2db4a: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 2db4c: c4 0c add r12, r4 2db4e: d5 1c adc r13, r5 2db50: e6 1c adc r14, r6 2db52: f7 1c adc r15, r7 2db54: f1 01 movw r30, r2 2db56: c5 8e std Z+29, r12 ; 0x1d 2db58: d6 8e std Z+30, r13 ; 0x1e 2db5a: e7 8e std Z+31, r14 ; 0x1f 2db5c: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 2db5e: cf 88 ldd r12, Y+23 ; 0x17 2db60: c2 ae std Z+58, r12 ; 0x3a 2db62: d8 8c ldd r13, Y+24 ; 0x18 2db64: d3 ae std Z+59, r13 ; 0x3b 2db66: e9 8c ldd r14, Y+25 ; 0x19 2db68: e4 ae std Z+60, r14 ; 0x3c 2db6a: fa 8c ldd r15, Y+26 ; 0x1a 2db6c: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 2db6e: fe 96 adiw r30, 0x3e ; 62 2db70: 10 83 st Z, r17 2db72: 01 83 std Z+1, r16 ; 0x01 2db74: c9 a0 ldd r12, Y+33 ; 0x21 2db76: c2 82 std Z+2, r12 ; 0x02 2db78: d8 a0 ldd r13, Y+32 ; 0x20 2db7a: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 2db7c: 73 96 adiw r30, 0x13 ; 19 2db7e: ed 88 ldd r14, Y+21 ; 0x15 2db80: e0 82 st Z, r14 2db82: fe 88 ldd r15, Y+22 ; 0x16 2db84: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 2db86: 32 97 sbiw r30, 0x02 ; 2 2db88: 40 83 st Z, r20 2db8a: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 2db8c: 3f bf out 0x3f, r19 ; 63 } 2db8e: a1 96 adiw r28, 0x21 ; 33 2db90: 0f b6 in r0, 0x3f ; 63 2db92: f8 94 cli 2db94: de bf out 0x3e, r29 ; 62 2db96: 0f be out 0x3f, r0 ; 63 2db98: cd bf out 0x3d, r28 ; 61 2db9a: df 91 pop r29 2db9c: cf 91 pop r28 2db9e: 1f 91 pop r17 2dba0: 0f 91 pop r16 2dba2: ff 90 pop r15 2dba4: ef 90 pop r14 2dba6: df 90 pop r13 2dba8: cf 90 pop r12 2dbaa: bf 90 pop r11 2dbac: af 90 pop r10 2dbae: 9f 90 pop r9 2dbb0: 8f 90 pop r8 2dbb2: 7f 90 pop r7 2dbb4: 6f 90 pop r6 2dbb6: 5f 90 pop r5 2dbb8: 4f 90 pop r4 2dbba: 3f 90 pop r3 2dbbc: 2f 90 pop r2 2dbbe: 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; 2dbc0: 1d 8a std Y+21, r1 ; 0x15 2dbc2: 1e 8a std Y+22, r1 ; 0x16 2dbc4: 83 cf rjmp .-250 ; 0x2dacc #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; 2dbc6: 2d 81 ldd r18, Y+5 ; 0x05 2dbc8: 3e 81 ldd r19, Y+6 ; 0x06 2dbca: 4f 81 ldd r20, Y+7 ; 0x07 2dbcc: 58 85 ldd r21, Y+8 ; 0x08 2dbce: 82 e0 ldi r24, 0x02 ; 2 2dbd0: 22 0f add r18, r18 2dbd2: 33 1f adc r19, r19 2dbd4: 44 1f adc r20, r20 2dbd6: 55 1f adc r21, r21 2dbd8: 8a 95 dec r24 2dbda: d1 f7 brne .-12 ; 0x2dbd0 2dbdc: 89 81 ldd r24, Y+1 ; 0x01 2dbde: 9a 81 ldd r25, Y+2 ; 0x02 2dbe0: ab 81 ldd r26, Y+3 ; 0x03 2dbe2: bc 81 ldd r27, Y+4 ; 0x04 2dbe4: 81 70 andi r24, 0x01 ; 1 2dbe6: 99 27 eor r25, r25 2dbe8: aa 27 eor r26, r26 2dbea: bb 27 eor r27, r27 2dbec: 8d 83 std Y+5, r24 ; 0x05 2dbee: 9e 83 std Y+6, r25 ; 0x06 2dbf0: af 83 std Y+7, r26 ; 0x07 2dbf2: b8 87 std Y+8, r27 ; 0x08 2dbf4: 89 80 ldd r8, Y+1 ; 0x01 2dbf6: 9a 80 ldd r9, Y+2 ; 0x02 2dbf8: ab 80 ldd r10, Y+3 ; 0x03 2dbfa: bc 80 ldd r11, Y+4 ; 0x04 2dbfc: b6 94 lsr r11 2dbfe: a7 94 ror r10 2dc00: 97 94 ror r9 2dc02: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 2dc04: cd 84 ldd r12, Y+13 ; 0x0d 2dc06: de 84 ldd r13, Y+14 ; 0x0e 2dc08: ef 84 ldd r14, Y+15 ; 0x0f 2dc0a: f8 88 ldd r15, Y+16 ; 0x10 2dc0c: 89 89 ldd r24, Y+17 ; 0x11 2dc0e: 9a 89 ldd r25, Y+18 ; 0x12 2dc10: ab 89 ldd r26, Y+19 ; 0x13 2dc12: bc 89 ldd r27, Y+20 ; 0x14 2dc14: 8c 15 cp r24, r12 2dc16: 9d 05 cpc r25, r13 2dc18: ae 05 cpc r26, r14 2dc1a: bf 05 cpc r27, r15 2dc1c: 08 f4 brcc .+2 ; 0x2dc20 2dc1e: 6f c0 rjmp .+222 ; 0x2dcfe // 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; 2dc20: 6c 01 movw r12, r24 2dc22: 7d 01 movw r14, r26 2dc24: 91 e0 ldi r25, 0x01 ; 1 2dc26: c9 1a sub r12, r25 2dc28: d1 08 sbc r13, r1 2dc2a: e1 08 sbc r14, r1 2dc2c: f1 08 sbc r15, r1 2dc2e: 8d 85 ldd r24, Y+13 ; 0x0d 2dc30: 9e 85 ldd r25, Y+14 ; 0x0e 2dc32: af 85 ldd r26, Y+15 ; 0x0f 2dc34: b8 89 ldd r27, Y+16 ; 0x10 2dc36: c8 1a sub r12, r24 2dc38: d9 0a sbc r13, r25 2dc3a: ea 0a sbc r14, r26 2dc3c: fb 0a sbc r15, r27 2dc3e: c7 01 movw r24, r14 2dc40: b6 01 movw r22, r12 2dc42: 62 0f add r22, r18 2dc44: 73 1f adc r23, r19 2dc46: 84 1f adc r24, r20 2dc48: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 2dc4a: cd 80 ldd r12, Y+5 ; 0x05 2dc4c: de 80 ldd r13, Y+6 ; 0x06 2dc4e: ef 80 ldd r14, Y+7 ; 0x07 2dc50: f8 84 ldd r15, Y+8 ; 0x08 2dc52: cd 28 or r12, r13 2dc54: ce 28 or r12, r14 2dc56: cf 28 or r12, r15 2dc58: 41 f0 breq .+16 ; 0x2dc6a accelerate_steps += acceleration_x2; 2dc5a: c9 84 ldd r12, Y+9 ; 0x09 2dc5c: da 84 ldd r13, Y+10 ; 0x0a 2dc5e: eb 84 ldd r14, Y+11 ; 0x0b 2dc60: fc 84 ldd r15, Y+12 ; 0x0c 2dc62: 6c 0d add r22, r12 2dc64: 7d 1d adc r23, r13 2dc66: 8e 1d adc r24, r14 2dc68: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 2dc6a: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 2dc6e: 75 01 movw r14, r10 2dc70: 64 01 movw r12, r8 2dc72: c2 0e add r12, r18 2dc74: d3 1e adc r13, r19 2dc76: e4 1e adc r14, r20 2dc78: f5 1e adc r15, r21 2dc7a: 29 81 ldd r18, Y+1 ; 0x01 2dc7c: 3a 81 ldd r19, Y+2 ; 0x02 2dc7e: 4b 81 ldd r20, Y+3 ; 0x03 2dc80: 5c 81 ldd r21, Y+4 ; 0x04 2dc82: 2c 15 cp r18, r12 2dc84: 3d 05 cpc r19, r13 2dc86: 4e 05 cpc r20, r14 2dc88: 5f 05 cpc r21, r15 2dc8a: 10 f4 brcc .+4 ; 0x2dc90 2dc8c: 69 01 movw r12, r18 2dc8e: 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) { 2dc90: 2b 8d ldd r18, Y+27 ; 0x1b 2dc92: 22 23 and r18, r18 2dc94: 09 f4 brne .+2 ; 0x2dc98 2dc96: 69 c0 rjmp .+210 ; 0x2dd6a if(!accelerate_steps || !decelerate_steps) { 2dc98: c1 14 cp r12, r1 2dc9a: d1 04 cpc r13, r1 2dc9c: e1 04 cpc r14, r1 2dc9e: f1 04 cpc r15, r1 2dca0: 09 f4 brne .+2 ; 0x2dca4 2dca2: 66 c0 rjmp .+204 ; 0x2dd70 // 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; 2dca4: 4d 89 ldd r20, Y+21 ; 0x15 2dca6: 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) { 2dca8: 41 14 cp r4, r1 2dcaa: 51 04 cpc r5, r1 2dcac: 61 04 cpc r6, r1 2dcae: 71 04 cpc r7, r1 2dcb0: 09 f4 brne .+2 ; 0x2dcb4 2dcb2: 3d cf rjmp .-390 ; 0x2db2e // 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); 2dcb4: a7 01 movw r20, r14 2dcb6: 96 01 movw r18, r12 2dcb8: 69 85 ldd r22, Y+9 ; 0x09 2dcba: 7a 85 ldd r23, Y+10 ; 0x0a 2dcbc: 8b 85 ldd r24, Y+11 ; 0x0b 2dcbe: 9c 85 ldd r25, Y+12 ; 0x0c 2dcc0: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 2dcc4: 2d 85 ldd r18, Y+13 ; 0x0d 2dcc6: 3e 85 ldd r19, Y+14 ; 0x0e 2dcc8: 4f 85 ldd r20, Y+15 ; 0x0f 2dcca: 58 89 ldd r21, Y+16 ; 0x10 2dccc: 62 0f add r22, r18 2dcce: 73 1f adc r23, r19 2dcd0: 84 1f adc r24, r20 2dcd2: 95 1f adc r25, r21 2dcd4: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2dcd8: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 max_adv_steps = max_rate * block->adv_comp; 2dcdc: f1 01 movw r30, r2 2dcde: ec 5a subi r30, 0xAC ; 172 2dce0: ff 4f sbci r31, 0xFF ; 255 2dce2: 20 81 ld r18, Z 2dce4: 31 81 ldd r19, Z+1 ; 0x01 2dce6: 42 81 ldd r20, Z+2 ; 0x02 2dce8: 53 81 ldd r21, Z+3 ; 0x03 2dcea: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2dcee: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2dcf2: 46 2f mov r20, r22 2dcf4: 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; 2dcf6: 41 2c mov r4, r1 2dcf8: 51 2c mov r5, r1 2dcfa: 32 01 movw r6, r4 2dcfc: 18 cf rjmp .-464 ; 0x2db2e 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; 2dcfe: 6d 85 ldd r22, Y+13 ; 0x0d 2dd00: 7e 85 ldd r23, Y+14 ; 0x0e 2dd02: 8f 85 ldd r24, Y+15 ; 0x0f 2dd04: 98 89 ldd r25, Y+16 ; 0x10 2dd06: c9 88 ldd r12, Y+17 ; 0x11 2dd08: da 88 ldd r13, Y+18 ; 0x12 2dd0a: eb 88 ldd r14, Y+19 ; 0x13 2dd0c: fc 88 ldd r15, Y+20 ; 0x14 2dd0e: 6c 19 sub r22, r12 2dd10: 7d 09 sbc r23, r13 2dd12: 8e 09 sbc r24, r14 2dd14: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 2dd16: cd 80 ldd r12, Y+5 ; 0x05 2dd18: de 80 ldd r13, Y+6 ; 0x06 2dd1a: ef 80 ldd r14, Y+7 ; 0x07 2dd1c: f8 84 ldd r15, Y+8 ; 0x08 2dd1e: cd 28 or r12, r13 2dd20: ce 28 or r12, r14 2dd22: cf 28 or r12, r15 2dd24: 41 f0 breq .+16 ; 0x2dd36 decelerate_steps += acceleration_x2; 2dd26: c9 84 ldd r12, Y+9 ; 0x09 2dd28: da 84 ldd r13, Y+10 ; 0x0a 2dd2a: eb 84 ldd r14, Y+11 ; 0x0b 2dd2c: fc 84 ldd r15, Y+12 ; 0x0c 2dd2e: 6c 0d add r22, r12 2dd30: 7d 1d adc r23, r13 2dd32: 8e 1d adc r24, r14 2dd34: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 2dd36: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 2dd3a: 82 0e add r8, r18 2dd3c: 93 1e adc r9, r19 2dd3e: a4 1e adc r10, r20 2dd40: b5 1e adc r11, r21 2dd42: 49 80 ldd r4, Y+1 ; 0x01 2dd44: 5a 80 ldd r5, Y+2 ; 0x02 2dd46: 6b 80 ldd r6, Y+3 ; 0x03 2dd48: 7c 80 ldd r7, Y+4 ; 0x04 2dd4a: 84 14 cp r8, r4 2dd4c: 95 04 cpc r9, r5 2dd4e: a6 04 cpc r10, r6 2dd50: b7 04 cpc r11, r7 2dd52: 10 f4 brcc .+4 ; 0x2dd58 2dd54: 24 01 movw r4, r8 2dd56: 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; 2dd58: c9 80 ldd r12, Y+1 ; 0x01 2dd5a: da 80 ldd r13, Y+2 ; 0x02 2dd5c: eb 80 ldd r14, Y+3 ; 0x03 2dd5e: fc 80 ldd r15, Y+4 ; 0x04 2dd60: c4 18 sub r12, r4 2dd62: d5 08 sbc r13, r5 2dd64: e6 08 sbc r14, r6 2dd66: f7 08 sbc r15, r7 2dd68: 93 cf rjmp .-218 ; 0x2dc90 // 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; 2dd6a: 40 e0 ldi r20, 0x00 ; 0 2dd6c: 80 e0 ldi r24, 0x00 ; 0 2dd6e: c3 cf rjmp .-122 ; 0x2dcf6 #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; 2dd70: 4d 89 ldd r20, Y+21 ; 0x15 2dd72: 8e 89 ldd r24, Y+22 ; 0x16 2dd74: c0 cf rjmp .-128 ; 0x2dcf6 0002dd76 : /// @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) { 2dd76: 0f 93 push r16 2dd78: 1f 93 push r17 2dd7a: cf 93 push r28 2dd7c: df 93 push r29 2dd7e: eb 01 movw r28, r22 2dd80: 14 2f mov r17, r20 2dd82: 05 2f mov r16, r21 lcd_putc(chr); 2dd84: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_puts_P(str); 2dd88: ce 01 movw r24, r28 2dd8a: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 lcd_putc(':'); 2dd8e: 8a e3 ldi r24, 0x3A ; 58 2dd90: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 2dd94: ce 01 movw r24, r28 2dd96: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 2dd9a: 9e e0 ldi r25, 0x0E ; 14 2dd9c: 98 1b sub r25, r24 2dd9e: 89 2f mov r24, r25 2dda0: 0e 94 fc 69 call 0xd3f8 ; 0xd3f8 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 2dda4: 0f 93 push r16 2dda6: 1f 93 push r17 2dda8: 84 e9 ldi r24, 0x94 ; 148 2ddaa: 9e e9 ldi r25, 0x9E ; 158 2ddac: 9f 93 push r25 2ddae: 8f 93 push r24 2ddb0: 0e 94 df 69 call 0xd3be ; 0xd3be 2ddb4: 0f 90 pop r0 2ddb6: 0f 90 pop r0 2ddb8: 0f 90 pop r0 2ddba: 0f 90 pop r0 } 2ddbc: df 91 pop r29 2ddbe: cf 91 pop r28 2ddc0: 1f 91 pop r17 2ddc2: 0f 91 pop r16 2ddc4: 08 95 ret 0002ddc6 : * \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) { 2ddc6: 0f 93 push r16 2ddc8: 1f 93 push r17 2ddca: cf 93 push r28 2ddcc: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2ddce: fc 01 movw r30, r24 2ddd0: 23 81 ldd r18, Z+3 ; 0x03 2ddd2: 22 23 and r18, r18 2ddd4: 31 f0 breq .+12 ; 0x2dde2 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2ddd6: 80 e0 ldi r24, 0x00 ; 0 } 2ddd8: df 91 pop r29 2ddda: cf 91 pop r28 2dddc: 1f 91 pop r17 2ddde: 0f 91 pop r16 2dde0: 08 95 ret 2dde2: 8b 01 movw r16, r22 2dde4: ec 01 movw r28, r24 2dde6: fb 01 movw r30, r22 2dde8: 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)) { 2ddea: 80 31 cpi r24, 0x10 ; 16 2ddec: 39 f5 brne .+78 ; 0x2de3c type_ = FAT_FILE_TYPE_ROOT_FIXED; 2ddee: 82 e0 ldi r24, 0x02 ; 2 2ddf0: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2ddf2: 1d 8a std Y+21, r1 ; 0x15 2ddf4: 1e 8a std Y+22, r1 ; 0x16 2ddf6: 1f 8a std Y+23, r1 ; 0x17 2ddf8: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2ddfa: 80 8d ldd r24, Z+24 ; 0x18 2ddfc: 91 8d ldd r25, Z+25 ; 0x19 2ddfe: b0 e0 ldi r27, 0x00 ; 0 2de00: a0 e0 ldi r26, 0x00 ; 0 2de02: 25 e0 ldi r18, 0x05 ; 5 2de04: 88 0f add r24, r24 2de06: 99 1f adc r25, r25 2de08: aa 1f adc r26, r26 2de0a: bb 1f adc r27, r27 2de0c: 2a 95 dec r18 2de0e: d1 f7 brne .-12 ; 0x2de04 2de10: 89 8b std Y+17, r24 ; 0x11 2de12: 9a 8b std Y+18, r25 ; 0x12 2de14: ab 8b std Y+19, r26 ; 0x13 2de16: 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; 2de18: 1a 8f std Y+26, r17 ; 0x1a 2de1a: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2de1c: 81 e0 ldi r24, 0x01 ; 1 2de1e: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2de20: 1c 82 std Y+4, r1 ; 0x04 2de22: 1d 82 std Y+5, r1 ; 0x05 2de24: 1e 82 std Y+6, r1 ; 0x06 2de26: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2de28: 18 86 std Y+8, r1 ; 0x08 2de2a: 19 86 std Y+9, r1 ; 0x09 2de2c: 1a 86 std Y+10, r1 ; 0x0a 2de2e: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2de30: 1c 86 std Y+12, r1 ; 0x0c 2de32: 1d 86 std Y+13, r1 ; 0x0d 2de34: 1e 86 std Y+14, r1 ; 0x0e 2de36: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2de38: 18 8a std Y+16, r1 ; 0x10 2de3a: ce cf rjmp .-100 ; 0x2ddd8 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) { 2de3c: 80 32 cpi r24, 0x20 ; 32 2de3e: 59 f6 brne .-106 ; 0x2ddd6 type_ = FAT_FILE_TYPE_ROOT32; 2de40: 83 e0 ldi r24, 0x03 ; 3 2de42: 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_;} 2de44: 42 8d ldd r20, Z+26 ; 0x1a 2de46: 53 8d ldd r21, Z+27 ; 0x1b 2de48: 64 8d ldd r22, Z+28 ; 0x1c 2de4a: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2de4c: 4d 8b std Y+21, r20 ; 0x15 2de4e: 5e 8b std Y+22, r21 ; 0x16 2de50: 6f 8b std Y+23, r22 ; 0x17 2de52: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2de54: 9e 01 movw r18, r28 2de56: 2f 5e subi r18, 0xEF ; 239 2de58: 3f 4f sbci r19, 0xFF ; 255 2de5a: c8 01 movw r24, r16 2de5c: 0f 94 5b 37 call 0x26eb6 ; 0x26eb6 2de60: 81 11 cpse r24, r1 2de62: da cf rjmp .-76 ; 0x2de18 2de64: b8 cf rjmp .-144 ; 0x2ddd6 0002de66 : * * \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() { 2de66: cf 93 push r28 2de68: df 93 push r29 2de6a: ec 01 movw r28, r24 bool rtn = sync(); 2de6c: 0f 94 a6 38 call 0x2714c ; 0x2714c type_ = FAT_FILE_TYPE_CLOSED; 2de70: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2de72: df 91 pop r29 2de74: cf 91 pop r28 2de76: 08 95 ret 0002de78 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2de78: cf 93 push r28 2de7a: df 93 push r29 2de7c: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2de7e: 46 2f mov r20, r22 2de80: 41 70 andi r20, 0x01 ; 1 2de82: 6c 85 ldd r22, Y+12 ; 0x0c 2de84: 7d 85 ldd r23, Y+13 ; 0x0d 2de86: 8e 85 ldd r24, Y+14 ; 0x0e 2de88: 9f 85 ldd r25, Y+15 ; 0x0f 2de8a: 0f 94 09 36 call 0x26c12 ; 0x26c12 2de8e: 88 23 and r24, r24 2de90: 51 f0 breq .+20 ; 0x2dea6 return vol_->cache()->dir + dirIndex_; 2de92: 88 89 ldd r24, Y+16 ; 0x10 2de94: 20 e2 ldi r18, 0x20 ; 32 2de96: 82 9f mul r24, r18 2de98: c0 01 movw r24, r0 2de9a: 11 24 eor r1, r1 2de9c: 87 52 subi r24, 0x27 ; 39 2de9e: 92 4f sbci r25, 0xF2 ; 242 fail: return 0; } 2dea0: df 91 pop r29 2dea2: cf 91 pop r28 2dea4: 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; 2dea6: 90 e0 ldi r25, 0x00 ; 0 2dea8: 80 e0 ldi r24, 0x00 ; 0 2deaa: fa cf rjmp .-12 ; 0x2dea0 0002deac : * \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) { 2deac: cf 93 push r28 2deae: df 93 push r29 2deb0: eb 01 movw r28, r22 2deb2: fc 01 movw r30, r24 2deb4: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2deb6: 21 11 cpse r18, r1 2deb8: 04 c0 rjmp .+8 ; 0x2dec2 2deba: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2debc: df 91 pop r29 2debe: cf 91 pop r28 2dec0: 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; 2dec2: 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()) { 2dec4: 22 30 cpi r18, 0x02 ; 2 2dec6: 28 f4 brcc .+10 ; 0x2ded2 name[0] = '/'; 2dec8: 8f e2 ldi r24, 0x2F ; 47 2deca: 88 83 st Y, r24 name[1] = '\0'; 2decc: 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; 2dece: 81 e0 ldi r24, 0x01 ; 1 2ded0: f5 cf rjmp .-22 ; 0x2debc name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2ded2: 60 e0 ldi r22, 0x00 ; 0 2ded4: 0f 94 3c 6f call 0x2de78 ; 0x2de78 if (!p) return false; 2ded8: 00 97 sbiw r24, 0x00 ; 0 2deda: 79 f3 breq .-34 ; 0x2deba 2dedc: 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; 2dede: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2dee0: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2dee2: 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; 2dee4: 2d 91 ld r18, X+ 2dee6: 20 32 cpi r18, 0x20 ; 32 2dee8: 99 f0 breq .+38 ; 0x2df10 if (i == 8) name[j++] = '.'; 2deea: 88 30 cpi r24, 0x08 ; 8 2deec: 31 f4 brne .+12 ; 0x2defa 2deee: 9e 01 movw r18, r28 2def0: 26 0f add r18, r22 2def2: 31 1d adc r19, r1 2def4: f9 01 movw r30, r18 2def6: 90 83 st Z, r25 2def8: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2defa: 9e 01 movw r18, r28 2defc: 26 0f add r18, r22 2defe: 31 1d adc r19, r1 2df00: ad 01 movw r20, r26 2df02: 41 50 subi r20, 0x01 ; 1 2df04: 51 09 sbc r21, r1 2df06: fa 01 movw r30, r20 2df08: 40 81 ld r20, Z 2df0a: f9 01 movw r30, r18 2df0c: 40 83 st Z, r20 2df0e: 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++) { 2df10: 8f 5f subi r24, 0xFF ; 255 2df12: 8b 30 cpi r24, 0x0B ; 11 2df14: 39 f7 brne .-50 ; 0x2dee4 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2df16: fe 01 movw r30, r28 2df18: e6 0f add r30, r22 2df1a: f1 1d adc r31, r1 2df1c: 10 82 st Z, r1 2df1e: d7 cf rjmp .-82 ; 0x2dece 0002df20 : 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() { 2df20: 3f 92 push r3 2df22: 4f 92 push r4 2df24: 5f 92 push r5 2df26: 6f 92 push r6 2df28: 7f 92 push r7 2df2a: 8f 92 push r8 2df2c: 9f 92 push r9 2df2e: af 92 push r10 2df30: bf 92 push r11 2df32: cf 92 push r12 2df34: df 92 push r13 2df36: ef 92 push r14 2df38: ff 92 push r15 2df3a: 0f 93 push r16 2df3c: 1f 93 push r17 2df3e: cf 93 push r28 2df40: df 93 push r29 2df42: cd b7 in r28, 0x3d ; 61 2df44: de b7 in r29, 0x3e ; 62 2df46: 2c 97 sbiw r28, 0x0c ; 12 2df48: 0f b6 in r0, 0x3f ; 63 2df4a: f8 94 cli 2df4c: de bf out 0x3e, r29 ; 62 2df4e: 0f be out 0x3f, r0 ; 63 2df50: cd bf out 0x3d, r28 ; 61 2df52: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2df54: dc 01 movw r26, r24 2df56: 59 96 adiw r26, 0x19 ; 25 2df58: 8d 90 ld r8, X+ 2df5a: 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; 2df5c: f4 01 movw r30, r8 2df5e: 81 85 ldd r24, Z+9 ; 0x09 2df60: 92 85 ldd r25, Z+10 ; 0x0a 2df62: a3 85 ldd r26, Z+11 ; 0x0b 2df64: b4 85 ldd r27, Z+12 ; 0x0c 2df66: 9c 01 movw r18, r24 2df68: ad 01 movw r20, r26 2df6a: 2f 5f subi r18, 0xFF ; 255 2df6c: 3f 4f sbci r19, 0xFF ; 255 2df6e: 4f 4f sbci r20, 0xFF ; 255 2df70: 5f 4f sbci r21, 0xFF ; 255 2df72: 29 87 std Y+9, r18 ; 0x09 2df74: 3a 87 std Y+10, r19 ; 0x0a 2df76: 4b 87 std Y+11, r20 ; 0x0b 2df78: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2df7a: d5 01 movw r26, r10 2df7c: 14 96 adiw r26, 0x04 ; 4 2df7e: 4d 90 ld r4, X+ 2df80: 5d 90 ld r5, X+ 2df82: 6d 90 ld r6, X+ 2df84: 7c 90 ld r7, X 2df86: 17 97 sbiw r26, 0x07 ; 7 2df88: 41 14 cp r4, r1 2df8a: 51 04 cpc r5, r1 2df8c: 61 04 cpc r6, r1 2df8e: 71 04 cpc r7, r1 2df90: 09 f4 brne .+2 ; 0x2df94 2df92: 59 c0 rjmp .+178 ; 0x2e046 // try to make file contiguous bgnCluster = *curCluster + 1; 2df94: bf ef ldi r27, 0xFF ; 255 2df96: 4b 1a sub r4, r27 2df98: 5b 0a sbc r5, r27 2df9a: 6b 0a sbc r6, r27 2df9c: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2df9e: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2dfa0: 73 01 movw r14, r6 2dfa2: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2dfa4: 1d 82 std Y+5, r1 ; 0x05 2dfa6: 1e 82 std Y+6, r1 ; 0x06 2dfa8: 1f 82 std Y+7, r1 ; 0x07 2dfaa: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2dfac: f4 01 movw r30, r8 2dfae: 81 85 ldd r24, Z+9 ; 0x09 2dfb0: 92 85 ldd r25, Z+10 ; 0x0a 2dfb2: a3 85 ldd r26, Z+11 ; 0x0b 2dfb4: b4 85 ldd r27, Z+12 ; 0x0c 2dfb6: 2d 81 ldd r18, Y+5 ; 0x05 2dfb8: 3e 81 ldd r19, Y+6 ; 0x06 2dfba: 4f 81 ldd r20, Y+7 ; 0x07 2dfbc: 58 85 ldd r21, Y+8 ; 0x08 2dfbe: 28 17 cp r18, r24 2dfc0: 39 07 cpc r19, r25 2dfc2: 4a 07 cpc r20, r26 2dfc4: 5b 07 cpc r21, r27 2dfc6: 08 f0 brcs .+2 ; 0x2dfca 2dfc8: 56 c0 rjmp .+172 ; 0x2e076 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2dfca: 89 85 ldd r24, Y+9 ; 0x09 2dfcc: 9a 85 ldd r25, Y+10 ; 0x0a 2dfce: ab 85 ldd r26, Y+11 ; 0x0b 2dfd0: bc 85 ldd r27, Y+12 ; 0x0c 2dfd2: 8c 15 cp r24, r12 2dfd4: 9d 05 cpc r25, r13 2dfd6: ae 05 cpc r26, r14 2dfd8: bf 05 cpc r27, r15 2dfda: 50 f4 brcc .+20 ; 0x2dff0 bgnCluster = endCluster = 2; 2dfdc: 82 e0 ldi r24, 0x02 ; 2 2dfde: c8 2e mov r12, r24 2dfe0: d1 2c mov r13, r1 2dfe2: e1 2c mov r14, r1 2dfe4: f1 2c mov r15, r1 2dfe6: 92 e0 ldi r25, 0x02 ; 2 2dfe8: 49 2e mov r4, r25 2dfea: 51 2c mov r5, r1 2dfec: 61 2c mov r6, r1 2dfee: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2dff0: 9e 01 movw r18, r28 2dff2: 2f 5f subi r18, 0xFF ; 255 2dff4: 3f 4f sbci r19, 0xFF ; 255 2dff6: b7 01 movw r22, r14 2dff8: a6 01 movw r20, r12 2dffa: c4 01 movw r24, r8 2dffc: 0f 94 d8 36 call 0x26db0 ; 0x26db0 2e000: 88 23 and r24, r24 2e002: c9 f1 breq .+114 ; 0x2e076 if (f != 0) { 2e004: 89 81 ldd r24, Y+1 ; 0x01 2e006: 9a 81 ldd r25, Y+2 ; 0x02 2e008: ab 81 ldd r26, Y+3 ; 0x03 2e00a: bc 81 ldd r27, Y+4 ; 0x04 2e00c: 89 2b or r24, r25 2e00e: 8a 2b or r24, r26 2e010: 8b 2b or r24, r27 2e012: 01 f1 breq .+64 ; 0x2e054 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2e014: 26 01 movw r4, r12 2e016: 37 01 movw r6, r14 2e018: 9f ef ldi r25, 0xFF ; 255 2e01a: 49 1a sub r4, r25 2e01c: 59 0a sbc r5, r25 2e01e: 69 0a sbc r6, r25 2e020: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2e022: 2d 81 ldd r18, Y+5 ; 0x05 2e024: 3e 81 ldd r19, Y+6 ; 0x06 2e026: 4f 81 ldd r20, Y+7 ; 0x07 2e028: 58 85 ldd r21, Y+8 ; 0x08 2e02a: 2f 5f subi r18, 0xFF ; 255 2e02c: 3f 4f sbci r19, 0xFF ; 255 2e02e: 4f 4f sbci r20, 0xFF ; 255 2e030: 5f 4f sbci r21, 0xFF ; 255 2e032: 2d 83 std Y+5, r18 ; 0x05 2e034: 3e 83 std Y+6, r19 ; 0x06 2e036: 4f 83 std Y+7, r20 ; 0x07 2e038: 58 87 std Y+8, r21 ; 0x08 2e03a: 3f ef ldi r19, 0xFF ; 255 2e03c: c3 1a sub r12, r19 2e03e: d3 0a sbc r13, r19 2e040: e3 0a sbc r14, r19 2e042: f3 0a sbc r15, r19 2e044: b3 cf rjmp .-154 ; 0x2dfac // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2e046: 40 80 ld r4, Z 2e048: 51 80 ldd r5, Z+1 ; 0x01 2e04a: 62 80 ldd r6, Z+2 ; 0x02 2e04c: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2e04e: 33 24 eor r3, r3 2e050: 33 94 inc r3 2e052: a6 cf rjmp .-180 ; 0x2dfa0 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) { 2e054: c4 14 cp r12, r4 2e056: d5 04 cpc r13, r5 2e058: e6 04 cpc r14, r6 2e05a: f7 04 cpc r15, r7 2e05c: 11 f7 brne .-60 ; 0x2e022 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); 2e05e: 0f ef ldi r16, 0xFF ; 255 2e060: 1f ef ldi r17, 0xFF ; 255 2e062: 2f ef ldi r18, 0xFF ; 255 2e064: 3f e0 ldi r19, 0x0F ; 15 2e066: b7 01 movw r22, r14 2e068: a6 01 movw r20, r12 2e06a: c4 01 movw r24, r8 2e06c: 0f 94 46 36 call 0x26c8c ; 0x26c8c 2e070: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2e072: 81 11 cpse r24, r1 2e074: 1a c0 rjmp .+52 ; 0x2e0aa flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2e076: 71 2c mov r7, r1 } 2e078: 87 2d mov r24, r7 2e07a: 2c 96 adiw r28, 0x0c ; 12 2e07c: 0f b6 in r0, 0x3f ; 63 2e07e: f8 94 cli 2e080: de bf out 0x3e, r29 ; 62 2e082: 0f be out 0x3f, r0 ; 63 2e084: cd bf out 0x3d, r28 ; 61 2e086: df 91 pop r29 2e088: cf 91 pop r28 2e08a: 1f 91 pop r17 2e08c: 0f 91 pop r16 2e08e: ff 90 pop r15 2e090: ef 90 pop r14 2e092: df 90 pop r13 2e094: cf 90 pop r12 2e096: bf 90 pop r11 2e098: af 90 pop r10 2e09a: 9f 90 pop r9 2e09c: 8f 90 pop r8 2e09e: 7f 90 pop r7 2e0a0: 6f 90 pop r6 2e0a2: 5f 90 pop r5 2e0a4: 4f 90 pop r4 2e0a6: 3f 90 pop r3 2e0a8: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2e0aa: f5 01 movw r30, r10 2e0ac: 44 81 ldd r20, Z+4 ; 0x04 2e0ae: 55 81 ldd r21, Z+5 ; 0x05 2e0b0: 66 81 ldd r22, Z+6 ; 0x06 2e0b2: 77 81 ldd r23, Z+7 ; 0x07 2e0b4: 41 15 cp r20, r1 2e0b6: 51 05 cpc r21, r1 2e0b8: 61 05 cpc r22, r1 2e0ba: 71 05 cpc r23, r1 2e0bc: 39 f0 breq .+14 ; 0x2e0cc // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2e0be: 97 01 movw r18, r14 2e0c0: 86 01 movw r16, r12 2e0c2: c4 01 movw r24, r8 2e0c4: 0f 94 46 36 call 0x26c8c ; 0x26c8c 2e0c8: 88 23 and r24, r24 2e0ca: a9 f2 breq .-86 ; 0x2e076 } // return first cluster number to caller *curCluster = bgnCluster; 2e0cc: d5 01 movw r26, r10 2e0ce: 14 96 adiw r26, 0x04 ; 4 2e0d0: cd 92 st X+, r12 2e0d2: dd 92 st X+, r13 2e0d4: ed 92 st X+, r14 2e0d6: fc 92 st X, r15 2e0d8: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2e0da: 33 20 and r3, r3 2e0dc: 51 f0 breq .+20 ; 0x2e0f2 2e0de: d7 01 movw r26, r14 2e0e0: c6 01 movw r24, r12 2e0e2: 01 96 adiw r24, 0x01 ; 1 2e0e4: a1 1d adc r26, r1 2e0e6: b1 1d adc r27, r1 2e0e8: f4 01 movw r30, r8 2e0ea: 80 83 st Z, r24 2e0ec: 91 83 std Z+1, r25 ; 0x01 2e0ee: a2 83 std Z+2, r26 ; 0x02 2e0f0: 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) { 2e0f2: f5 01 movw r30, r10 2e0f4: 85 89 ldd r24, Z+21 ; 0x15 2e0f6: 96 89 ldd r25, Z+22 ; 0x16 2e0f8: a7 89 ldd r26, Z+23 ; 0x17 2e0fa: b0 8d ldd r27, Z+24 ; 0x18 2e0fc: 89 2b or r24, r25 2e0fe: 8a 2b or r24, r26 2e100: 8b 2b or r24, r27 2e102: 09 f0 breq .+2 ; 0x2e106 2e104: b9 cf rjmp .-142 ; 0x2e078 firstCluster_ = curCluster_; 2e106: c5 8a std Z+21, r12 ; 0x15 2e108: d6 8a std Z+22, r13 ; 0x16 2e10a: e7 8a std Z+23, r14 ; 0x17 2e10c: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2e10e: 81 81 ldd r24, Z+1 ; 0x01 2e110: 80 68 ori r24, 0x80 ; 128 2e112: 81 83 std Z+1, r24 ; 0x01 2e114: b1 cf rjmp .-158 ; 0x2e078 0002e116 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2e116: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e118: 0d b4 in r0, 0x2d ; 45 2e11a: 07 fe sbrs r0, 7 2e11c: fd cf rjmp .-6 ; 0x2e118 } 2e11e: 08 95 ret 0002e120 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2e120: 8f ef ldi r24, 0xFF ; 255 2e122: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e124: 0d b4 in r0, 0x2d ; 45 2e126: 07 fe sbrs r0, 7 2e128: fd cf rjmp .-6 ; 0x2e124 return SPDR; 2e12a: 8e b5 in r24, 0x2e ; 46 } 2e12c: 08 95 ret 0002e12e : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2e12e: 8f 92 push r8 2e130: 9f 92 push r9 2e132: af 92 push r10 2e134: bf 92 push r11 2e136: ef 92 push r14 2e138: ff 92 push r15 2e13a: 0f 93 push r16 2e13c: 1f 93 push r17 2e13e: cf 93 push r28 2e140: 7c 01 movw r14, r24 2e142: c6 2f mov r28, r22 2e144: 49 01 movw r8, r18 2e146: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2e148: fc 01 movw r30, r24 2e14a: 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); 2e14c: 89 2f mov r24, r25 2e14e: 80 6a ori r24, 0xA0 ; 160 2e150: 86 95 lsr r24 2e152: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e154: 90 fd sbrc r25, 0 2e156: 03 c0 rjmp .+6 ; 0x2e15e 2e158: 81 e0 ldi r24, 0x01 ; 1 2e15a: 96 30 cpi r25, 0x06 ; 6 2e15c: 09 f4 brne .+2 ; 0x2e160 2e15e: 80 e0 ldi r24, 0x00 ; 0 2e160: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2e162: 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); 2e164: 8c e2 ldi r24, 0x2C ; 44 2e166: 91 e0 ldi r25, 0x01 ; 1 2e168: 0f 94 67 41 call 0x282ce ; 0x282ce // send command spiSend(cmd | 0x40); 2e16c: 8c 2f mov r24, r28 2e16e: 80 64 ori r24, 0x40 ; 64 2e170: 0f 94 8b 70 call 0x2e116 ; 0x2e116 2e174: 08 e1 ldi r16, 0x18 ; 24 2e176: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2e178: d5 01 movw r26, r10 2e17a: c4 01 movw r24, r8 2e17c: 00 2e mov r0, r16 2e17e: 04 c0 rjmp .+8 ; 0x2e188 2e180: b6 95 lsr r27 2e182: a7 95 ror r26 2e184: 97 95 ror r25 2e186: 87 95 ror r24 2e188: 0a 94 dec r0 2e18a: d2 f7 brpl .-12 ; 0x2e180 2e18c: 0f 94 8b 70 call 0x2e116 ; 0x2e116 2e190: 08 50 subi r16, 0x08 ; 8 2e192: 11 09 sbc r17, r1 2e194: 08 3f cpi r16, 0xF8 ; 248 2e196: ff ef ldi r31, 0xFF ; 255 2e198: 1f 07 cpc r17, r31 2e19a: 71 f7 brne .-36 ; 0x2e178 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2e19c: 85 e9 ldi r24, 0x95 ; 149 2e19e: cc 23 and r28, r28 2e1a0: 21 f0 breq .+8 ; 0x2e1aa if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2e1a2: 87 e8 ldi r24, 0x87 ; 135 2e1a4: c8 30 cpi r28, 0x08 ; 8 2e1a6: 09 f0 breq .+2 ; 0x2e1aa // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e1a8: 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); 2e1aa: 0f 94 8b 70 call 0x2e116 ; 0x2e116 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2e1ae: cc 30 cpi r28, 0x0C ; 12 2e1b0: 11 f4 brne .+4 ; 0x2e1b6 2e1b2: 0f 94 90 70 call 0x2e120 ; 0x2e120 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e1b6: 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 */ } 2e1b8: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e1bc: f7 01 movw r30, r14 2e1be: 82 83 std Z+2, r24 ; 0x02 2e1c0: 87 ff sbrs r24, 7 2e1c2: 04 c0 rjmp .+8 ; 0x2e1cc 2e1c4: cf 3f cpi r28, 0xFF ; 255 2e1c6: 11 f0 breq .+4 ; 0x2e1cc 2e1c8: cf 5f subi r28, 0xFF ; 255 2e1ca: f6 cf rjmp .-20 ; 0x2e1b8 return status_; } 2e1cc: cf 91 pop r28 2e1ce: 1f 91 pop r17 2e1d0: 0f 91 pop r16 2e1d2: ff 90 pop r15 2e1d4: ef 90 pop r14 2e1d6: bf 90 pop r11 2e1d8: af 90 pop r10 2e1da: 9f 90 pop r9 2e1dc: 8f 90 pop r8 2e1de: 08 95 ret 0002e1e0 : * \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) { 2e1e0: 0f 93 push r16 2e1e2: 1f 93 push r17 2e1e4: cf 93 push r28 2e1e6: df 93 push r29 2e1e8: ec 01 movw r28, r24 2e1ea: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2e1ec: 8b 81 ldd r24, Y+3 ; 0x03 2e1ee: 83 30 cpi r24, 0x03 ; 3 2e1f0: 39 f0 breq .+14 ; 0x2e200 2e1f2: 89 e0 ldi r24, 0x09 ; 9 2e1f4: 44 0f add r20, r20 2e1f6: 55 1f adc r21, r21 2e1f8: 66 1f adc r22, r22 2e1fa: 77 1f adc r23, r23 2e1fc: 8a 95 dec r24 2e1fe: d1 f7 brne .-12 ; 0x2e1f4 if (cardCommand(CMD24, blockNumber)) { 2e200: 9a 01 movw r18, r20 2e202: ab 01 movw r20, r22 2e204: 68 e1 ldi r22, 0x18 ; 24 2e206: ce 01 movw r24, r28 2e208: 0f 94 97 70 call 0x2e12e ; 0x2e12e 2e20c: 88 23 and r24, r24 2e20e: 19 f0 breq .+6 ; 0x2e216 2e210: 86 e0 ldi r24, 0x06 ; 6 2e212: 88 83 st Y, r24 2e214: 39 c0 rjmp .+114 ; 0x2e288 } //------------------------------------------------------------------------------ /** 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; 2e216: 8e ef ldi r24, 0xFE ; 254 2e218: 8e bd out 0x2e, r24 ; 46 2e21a: f8 01 movw r30, r16 2e21c: c8 01 movw r24, r16 2e21e: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e220: 0d b4 in r0, 0x2d ; 45 2e222: 07 fe sbrs r0, 7 2e224: fd cf rjmp .-6 ; 0x2e220 SPDR = buf[i]; 2e226: 20 81 ld r18, Z 2e228: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e22a: 0d b4 in r0, 0x2d ; 45 2e22c: 07 fe sbrs r0, 7 2e22e: fd cf rjmp .-6 ; 0x2e22a SPDR = buf[i + 1]; 2e230: 21 81 ldd r18, Z+1 ; 0x01 2e232: 2e bd out 0x2e, r18 ; 46 2e234: 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) { 2e236: e8 17 cp r30, r24 2e238: f9 07 cpc r31, r25 2e23a: 91 f7 brne .-28 ; 0x2e220 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 */ } 2e23c: 0d b4 in r0, 0x2d ; 45 2e23e: 07 fe sbrs r0, 7 2e240: fd cf rjmp .-6 ; 0x2e23c //------------------------------------------------------------------------------ // 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 2e242: 8f ef ldi r24, 0xFF ; 255 2e244: 0f 94 8b 70 call 0x2e116 ; 0x2e116 spiSend(0xff); // dummy crc 2e248: 8f ef ldi r24, 0xFF ; 255 2e24a: 0f 94 8b 70 call 0x2e116 ; 0x2e116 status_ = spiRec(); 2e24e: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e252: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2e254: 8f 71 andi r24, 0x1F ; 31 2e256: 85 30 cpi r24, 0x05 ; 5 2e258: 99 f4 brne .+38 ; 0x2e280 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2e25a: 88 e5 ldi r24, 0x58 ; 88 2e25c: 92 e0 ldi r25, 0x02 ; 2 2e25e: 0f 94 67 41 call 0x282ce ; 0x282ce 2e262: 18 2f mov r17, r24 2e264: 87 e1 ldi r24, 0x17 ; 23 2e266: 11 23 and r17, r17 2e268: a1 f2 breq .-88 ; 0x2e212 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2e26a: 20 e0 ldi r18, 0x00 ; 0 2e26c: 30 e0 ldi r19, 0x00 ; 0 2e26e: a9 01 movw r20, r18 2e270: 6d e0 ldi r22, 0x0D ; 13 2e272: ce 01 movw r24, r28 2e274: 0f 94 97 70 call 0x2e12e ; 0x2e12e 2e278: 88 23 and r24, r24 2e27a: 51 f0 breq .+20 ; 0x2e290 2e27c: 86 e1 ldi r24, 0x16 ; 22 2e27e: c9 cf rjmp .-110 ; 0x2e212 2e280: 83 e1 ldi r24, 0x13 ; 19 2e282: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2e284: 0f 94 65 41 call 0x282ca ; 0x282ca } chipSelectHigh(); return true; fail: chipSelectHigh(); 2e288: 0f 94 65 41 call 0x282ca ; 0x282ca return false; 2e28c: 10 e0 ldi r17, 0x00 ; 0 2e28e: 06 c0 rjmp .+12 ; 0x2e29c 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()) { 2e290: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e294: 81 11 cpse r24, r1 2e296: f2 cf rjmp .-28 ; 0x2e27c error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2e298: 0f 94 65 41 call 0x282ca ; 0x282ca return true; fail: chipSelectHigh(); return false; } 2e29c: 81 2f mov r24, r17 2e29e: df 91 pop r29 2e2a0: cf 91 pop r28 2e2a2: 1f 91 pop r17 2e2a4: 0f 91 pop r16 2e2a6: 08 95 ret 0002e2a8 : * \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) { 2e2a8: 2f 92 push r2 2e2aa: 3f 92 push r3 2e2ac: 4f 92 push r4 2e2ae: 5f 92 push r5 2e2b0: 6f 92 push r6 2e2b2: 7f 92 push r7 2e2b4: 8f 92 push r8 2e2b6: 9f 92 push r9 2e2b8: af 92 push r10 2e2ba: bf 92 push r11 2e2bc: cf 92 push r12 2e2be: df 92 push r13 2e2c0: ef 92 push r14 2e2c2: ff 92 push r15 2e2c4: 0f 93 push r16 2e2c6: 1f 93 push r17 2e2c8: cf 93 push r28 2e2ca: df 93 push r29 2e2cc: ec 01 movw r28, r24 2e2ce: 2a 01 movw r4, r20 2e2d0: 3b 01 movw r6, r22 2e2d2: 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; 2e2d4: 8b 81 ldd r24, Y+3 ; 0x03 2e2d6: 83 30 cpi r24, 0x03 ; 3 2e2d8: 39 f0 breq .+14 ; 0x2e2e8 2e2da: 69 e0 ldi r22, 0x09 ; 9 2e2dc: 44 0c add r4, r4 2e2de: 55 1c adc r5, r5 2e2e0: 66 1c adc r6, r6 2e2e2: 77 1c adc r7, r7 2e2e4: 6a 95 dec r22 2e2e6: d1 f7 brne .-12 ; 0x2e2dc retry2: 2e2e8: 43 e0 ldi r20, 0x03 ; 3 2e2ea: 94 2e mov r9, r20 2e2ec: 56 01 movw r10, r12 2e2ee: 81 e0 ldi r24, 0x01 ; 1 2e2f0: a8 1a sub r10, r24 2e2f2: 8e ef ldi r24, 0xFE ; 254 2e2f4: b8 0a sbc r11, r24 2e2f6: 16 01 movw r2, r12 2e2f8: ee ef ldi r30, 0xFE ; 254 2e2fa: 3e 1a sub r3, r30 2e2fc: 54 e0 ldi r21, 0x04 ; 4 2e2fe: 85 2e mov r8, r21 retryCnt --; 2e300: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2e302: a3 01 movw r20, r6 2e304: 92 01 movw r18, r4 2e306: 61 e1 ldi r22, 0x11 ; 17 2e308: ce 01 movw r24, r28 2e30a: 0f 94 97 70 call 0x2e12e ; 0x2e12e 2e30e: 88 23 and r24, r24 2e310: 79 f0 breq .+30 ; 0x2e330 2e312: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2e314: 99 20 and r9, r9 2e316: 09 f4 brne .+2 ; 0x2e31a 2e318: 7a c0 rjmp .+244 ; 0x2e40e if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2e31a: 0f 94 65 41 call 0x282ca ; 0x282ca cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2e31e: 20 e0 ldi r18, 0x00 ; 0 2e320: 30 e0 ldi r19, 0x00 ; 0 2e322: a9 01 movw r20, r18 2e324: 6c e0 ldi r22, 0x0C ; 12 2e326: ce 01 movw r24, r28 2e328: 0f 94 97 70 call 0x2e12e ; 0x2e12e errorCode_ = 0; 2e32c: 18 82 st Y, r1 2e32e: e8 cf rjmp .-48 ; 0x2e300 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2e330: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2e334: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2e336: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e33a: 8a 83 std Y+2, r24 ; 0x02 2e33c: 8f 3f cpi r24, 0xFF ; 255 2e33e: 91 f4 brne .+36 ; 0x2e364 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2e340: 0f 94 46 0f call 0x21e8c ; 0x21e8c 2e344: 60 1b sub r22, r16 2e346: 71 0b sbc r23, r17 2e348: 6d 32 cpi r22, 0x2D ; 45 2e34a: 71 40 sbci r23, 0x01 ; 1 2e34c: a0 f3 brcs .-24 ; 0x2e336 2e34e: 81 e1 ldi r24, 0x11 ; 17 2e350: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2e352: 0f 94 65 41 call 0x282ca ; 0x282ca // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e356: 8c 81 ldd r24, Y+4 ; 0x04 2e358: 88 23 and r24, r24 2e35a: e1 f2 breq .-72 ; 0x2e314 spiSend(0XFF); 2e35c: 8f ef ldi r24, 0xFF ; 255 2e35e: 0f 94 8b 70 call 0x2e116 ; 0x2e116 2e362: d8 cf rjmp .-80 ; 0x2e314 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2e364: 8e 3f cpi r24, 0xFE ; 254 2e366: 11 f0 breq .+4 ; 0x2e36c 2e368: 8f e0 ldi r24, 0x0F ; 15 2e36a: f2 cf rjmp .-28 ; 0x2e350 //------------------------------------------------------------------------------ /** 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; 2e36c: 8f ef ldi r24, 0xFF ; 255 2e36e: 8e bd out 0x2e, r24 ; 46 2e370: d6 01 movw r26, r12 2e372: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e374: 0d b4 in r0, 0x2d ; 45 2e376: 07 fe sbrs r0, 7 2e378: fd cf rjmp .-6 ; 0x2e374 buf[i] = SPDR; 2e37a: 9e b5 in r25, 0x2e ; 46 2e37c: 91 93 st Z+, r25 SPDR = 0XFF; 2e37e: 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++) { 2e380: ea 15 cp r30, r10 2e382: fb 05 cpc r31, r11 2e384: b9 f7 brne .-18 ; 0x2e374 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e386: 0d b4 in r0, 0x2d ; 45 2e388: 07 fe sbrs r0, 7 2e38a: fd cf rjmp .-6 ; 0x2e386 buf[nbyte] = SPDR; 2e38c: 8e b5 in r24, 0x2e ; 46 2e38e: f5 01 movw r30, r10 2e390: 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; 2e392: f1 2c mov r15, r1 2e394: 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); 2e396: 8d 91 ld r24, X+ 2e398: ef 2d mov r30, r15 2e39a: ff 27 eor r31, r31 2e39c: e8 27 eor r30, r24 2e39e: ee 0f add r30, r30 2e3a0: ff 1f adc r31, r31 2e3a2: e8 58 subi r30, 0x88 ; 136 2e3a4: ff 45 sbci r31, 0x5F ; 95 2e3a6: 85 91 lpm r24, Z+ 2e3a8: 94 91 lpm r25, Z 2e3aa: fe 2c mov r15, r14 2e3ac: ee 24 eor r14, r14 2e3ae: e8 26 eor r14, r24 2e3b0: 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++) { 2e3b2: 2a 16 cp r2, r26 2e3b4: 3b 06 cpc r3, r27 2e3b6: 79 f7 brne .-34 ; 0x2e396 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2e3b8: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e3bc: 08 2f mov r16, r24 2e3be: 10 e0 ldi r17, 0x00 ; 0 2e3c0: 10 2f mov r17, r16 2e3c2: 00 27 eor r16, r16 recvCrc |= spiRec(); 2e3c4: 0f 94 90 70 call 0x2e120 ; 0x2e120 2e3c8: 08 2b or r16, r24 if (calcCrc != recvCrc) 2e3ca: 0e 15 cp r16, r14 2e3cc: 1f 05 cpc r17, r15 2e3ce: 19 f0 breq .+6 ; 0x2e3d6 2e3d0: f0 e2 ldi r31, 0x20 ; 32 2e3d2: f8 83 st Y, r31 2e3d4: be cf rjmp .-132 ; 0x2e352 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2e3d6: 0f 94 65 41 call 0x282ca ; 0x282ca // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e3da: cc 81 ldd r28, Y+4 ; 0x04 2e3dc: cc 23 and r28, r28 2e3de: d9 f0 breq .+54 ; 0x2e416 spiSend(0XFF); 2e3e0: 8f ef ldi r24, 0xFF ; 255 2e3e2: 0f 94 8b 70 call 0x2e116 ; 0x2e116 #endif fail: chipSelectHigh(); return false; } 2e3e6: 8c 2f mov r24, r28 2e3e8: df 91 pop r29 2e3ea: cf 91 pop r28 2e3ec: 1f 91 pop r17 2e3ee: 0f 91 pop r16 2e3f0: ff 90 pop r15 2e3f2: ef 90 pop r14 2e3f4: df 90 pop r13 2e3f6: cf 90 pop r12 2e3f8: bf 90 pop r11 2e3fa: af 90 pop r10 2e3fc: 9f 90 pop r9 2e3fe: 8f 90 pop r8 2e400: 7f 90 pop r7 2e402: 6f 90 pop r6 2e404: 5f 90 pop r5 2e406: 4f 90 pop r4 2e408: 3f 90 pop r3 2e40a: 2f 90 pop r2 2e40c: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2e40e: 0f 94 65 41 call 0x282ca ; 0x282ca return false; 2e412: c0 e0 ldi r28, 0x00 ; 0 2e414: e8 cf rjmp .-48 ; 0x2e3e6 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2e416: c1 e0 ldi r28, 0x01 ; 1 2e418: e6 cf rjmp .-52 ; 0x2e3e6 0002e41a : * 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) { 2e41a: 2f 92 push r2 2e41c: 3f 92 push r3 2e41e: 4f 92 push r4 2e420: 5f 92 push r5 2e422: 6f 92 push r6 2e424: 7f 92 push r7 2e426: 8f 92 push r8 2e428: 9f 92 push r9 2e42a: af 92 push r10 2e42c: bf 92 push r11 2e42e: cf 92 push r12 2e430: df 92 push r13 2e432: ef 92 push r14 2e434: ff 92 push r15 2e436: 0f 93 push r16 2e438: 1f 93 push r17 2e43a: cf 93 push r28 2e43c: df 93 push r29 2e43e: 00 d0 rcall .+0 ; 0x2e440 2e440: 1f 92 push r1 2e442: cd b7 in r28, 0x3d ; 61 2e444: de b7 in r29, 0x3e ; 62 2e446: 9c 83 std Y+4, r25 ; 0x04 2e448: 8b 83 std Y+3, r24 ; 0x03 2e44a: 4b 01 movw r8, r22 2e44c: 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; 2e44e: dc 01 movw r26, r24 2e450: 13 96 adiw r26, 0x03 ; 3 2e452: 8c 91 ld r24, X 2e454: 81 11 cpse r24, r1 2e456: 19 c0 rjmp .+50 ; 0x2e48a toRead -= n; } return nbyte; fail: return -1; 2e458: 8f ef ldi r24, 0xFF ; 255 2e45a: 9f ef ldi r25, 0xFF ; 255 } 2e45c: 0f 90 pop r0 2e45e: 0f 90 pop r0 2e460: 0f 90 pop r0 2e462: 0f 90 pop r0 2e464: df 91 pop r29 2e466: cf 91 pop r28 2e468: 1f 91 pop r17 2e46a: 0f 91 pop r16 2e46c: ff 90 pop r15 2e46e: ef 90 pop r14 2e470: df 90 pop r13 2e472: cf 90 pop r12 2e474: bf 90 pop r11 2e476: af 90 pop r10 2e478: 9f 90 pop r9 2e47a: 8f 90 pop r8 2e47c: 7f 90 pop r7 2e47e: 6f 90 pop r6 2e480: 5f 90 pop r5 2e482: 4f 90 pop r4 2e484: 3f 90 pop r3 2e486: 2f 90 pop r2 2e488: 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; 2e48a: eb 81 ldd r30, Y+3 ; 0x03 2e48c: fc 81 ldd r31, Y+4 ; 0x04 2e48e: 81 81 ldd r24, Z+1 ; 0x01 2e490: 80 ff sbrs r24, 0 2e492: e2 cf rjmp .-60 ; 0x2e458 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2e494: 01 89 ldd r16, Z+17 ; 0x11 2e496: 12 89 ldd r17, Z+18 ; 0x12 2e498: 23 89 ldd r18, Z+19 ; 0x13 2e49a: 34 89 ldd r19, Z+20 ; 0x14 2e49c: 40 85 ldd r20, Z+8 ; 0x08 2e49e: 51 85 ldd r21, Z+9 ; 0x09 2e4a0: 62 85 ldd r22, Z+10 ; 0x0a 2e4a2: 73 85 ldd r23, Z+11 ; 0x0b 2e4a4: c7 01 movw r24, r14 2e4a6: b0 e0 ldi r27, 0x00 ; 0 2e4a8: a0 e0 ldi r26, 0x00 ; 0 2e4aa: 28 01 movw r4, r16 2e4ac: 39 01 movw r6, r18 2e4ae: 44 1a sub r4, r20 2e4b0: 55 0a sbc r5, r21 2e4b2: 66 0a sbc r6, r22 2e4b4: 77 0a sbc r7, r23 2e4b6: 84 15 cp r24, r4 2e4b8: 95 05 cpc r25, r5 2e4ba: a6 05 cpc r26, r6 2e4bc: b7 05 cpc r27, r7 2e4be: 18 f0 brcs .+6 ; 0x2e4c6 nbyte = fileSize_ - curPosition_; 2e4c0: 78 01 movw r14, r16 2e4c2: e4 1a sub r14, r20 2e4c4: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2e4c6: 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; 2e4c8: 8b 81 ldd r24, Y+3 ; 0x03 2e4ca: 9c 81 ldd r25, Y+4 ; 0x04 2e4cc: 04 96 adiw r24, 0x04 ; 4 2e4ce: 9a 83 std Y+2, r25 ; 0x02 2e4d0: 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; 2e4d2: 61 2c mov r6, r1 2e4d4: 32 e0 ldi r19, 0x02 ; 2 2e4d6: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2e4d8: c1 14 cp r12, r1 2e4da: d1 04 cpc r13, r1 2e4dc: 09 f4 brne .+2 ; 0x2e4e0 2e4de: b7 c0 rjmp .+366 ; 0x2e64e offset = curPosition_ & 0X1FF; // offset in block 2e4e0: ab 81 ldd r26, Y+3 ; 0x03 2e4e2: bc 81 ldd r27, Y+4 ; 0x04 2e4e4: 18 96 adiw r26, 0x08 ; 8 2e4e6: 4d 91 ld r20, X+ 2e4e8: 5d 91 ld r21, X+ 2e4ea: 6d 91 ld r22, X+ 2e4ec: 7c 91 ld r23, X 2e4ee: 1b 97 sbiw r26, 0x0b ; 11 2e4f0: 5a 01 movw r10, r20 2e4f2: b1 e0 ldi r27, 0x01 ; 1 2e4f4: bb 22 and r11, r27 2e4f6: eb 81 ldd r30, Y+3 ; 0x03 2e4f8: fc 81 ldd r31, Y+4 ; 0x04 2e4fa: 81 8d ldd r24, Z+25 ; 0x19 2e4fc: 92 8d ldd r25, Z+26 ; 0x1a 2e4fe: 1a 01 movw r2, r20 2e500: 2b 01 movw r4, r22 2e502: 29 e0 ldi r18, 0x09 ; 9 2e504: 56 94 lsr r5 2e506: 47 94 ror r4 2e508: 37 94 ror r3 2e50a: 27 94 ror r2 2e50c: 2a 95 dec r18 2e50e: d1 f7 brne .-12 ; 0x2e504 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2e510: 23 81 ldd r18, Z+3 ; 0x03 2e512: 22 30 cpi r18, 0x02 ; 2 2e514: 91 f5 brne .+100 ; 0x2e57a block = vol_->rootDirStart() + (curPosition_ >> 9); 2e516: dc 01 movw r26, r24 2e518: 5a 96 adiw r26, 0x1a ; 26 2e51a: 6d 91 ld r22, X+ 2e51c: 7d 91 ld r23, X+ 2e51e: 8d 91 ld r24, X+ 2e520: 9c 91 ld r25, X 2e522: 5d 97 sbiw r26, 0x1d ; 29 2e524: 62 0d add r22, r2 2e526: 73 1d adc r23, r3 2e528: 84 1d adc r24, r4 2e52a: 95 1d adc r25, r5 2e52c: 83 01 movw r16, r6 2e52e: 0a 19 sub r16, r10 2e530: 1b 09 sbc r17, r11 2e532: c0 16 cp r12, r16 2e534: d1 06 cpc r13, r17 2e536: 08 f4 brcc .+2 ; 0x2e53a 2e538: 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()) { 2e53a: 01 15 cp r16, r1 2e53c: b2 e0 ldi r27, 0x02 ; 2 2e53e: 1b 07 cpc r17, r27 2e540: 71 f4 brne .+28 ; 0x2e55e 2e542: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 2e546: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 2e54a: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 2e54e: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 2e552: 62 17 cp r22, r18 2e554: 73 07 cpc r23, r19 2e556: 84 07 cpc r24, r20 2e558: 95 07 cpc r25, r21 2e55a: 09 f0 breq .+2 ; 0x2e55e 2e55c: 59 c0 rjmp .+178 ; 0x2e610 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; 2e55e: 40 e0 ldi r20, 0x00 ; 0 2e560: 0f 94 09 36 call 0x26c12 ; 0x26c12 2e564: 88 23 and r24, r24 2e566: 09 f4 brne .+2 ; 0x2e56a 2e568: 77 cf rjmp .-274 ; 0x2e458 uint8_t* src = vol_->cache()->data + offset; 2e56a: b5 01 movw r22, r10 2e56c: 67 52 subi r22, 0x27 ; 39 2e56e: 72 4f sbci r23, 0xF2 ; 242 memcpy(dst, src, n); 2e570: a8 01 movw r20, r16 2e572: c4 01 movw r24, r8 2e574: 0f 94 a6 a6 call 0x34d4c ; 0x34d4c 2e578: 57 c0 rjmp .+174 ; 0x2e628 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);} 2e57a: fc 01 movw r30, r24 2e57c: 14 81 ldd r17, Z+4 ; 0x04 2e57e: 11 50 subi r17, 0x01 ; 1 2e580: 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) { 2e582: a1 14 cp r10, r1 2e584: b1 04 cpc r11, r1 2e586: 81 f4 brne .+32 ; 0x2e5a8 2e588: 11 11 cpse r17, r1 2e58a: 0e c0 rjmp .+28 ; 0x2e5a8 // start of new cluster if (curPosition_ == 0) { 2e58c: 45 2b or r20, r21 2e58e: 46 2b or r20, r22 2e590: 47 2b or r20, r23 2e592: 79 f5 brne .+94 ; 0x2e5f2 // use first cluster in file curCluster_ = firstCluster_; 2e594: eb 81 ldd r30, Y+3 ; 0x03 2e596: fc 81 ldd r31, Y+4 ; 0x04 2e598: 85 89 ldd r24, Z+21 ; 0x15 2e59a: 96 89 ldd r25, Z+22 ; 0x16 2e59c: a7 89 ldd r26, Z+23 ; 0x17 2e59e: b0 8d ldd r27, Z+24 ; 0x18 2e5a0: 84 83 std Z+4, r24 ; 0x04 2e5a2: 95 83 std Z+5, r25 ; 0x05 2e5a4: a6 83 std Z+6, r26 ; 0x06 2e5a6: 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; 2e5a8: ab 81 ldd r26, Y+3 ; 0x03 2e5aa: bc 81 ldd r27, Y+4 ; 0x04 2e5ac: 59 96 adiw r26, 0x19 ; 25 2e5ae: ed 91 ld r30, X+ 2e5b0: fc 91 ld r31, X 2e5b2: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2e5b4: 14 96 adiw r26, 0x04 ; 4 2e5b6: 6d 91 ld r22, X+ 2e5b8: 7d 91 ld r23, X+ 2e5ba: 8d 91 ld r24, X+ 2e5bc: 9c 91 ld r25, X 2e5be: 17 97 sbiw r26, 0x07 ; 7 2e5c0: 62 50 subi r22, 0x02 ; 2 2e5c2: 71 09 sbc r23, r1 2e5c4: 81 09 sbc r24, r1 2e5c6: 91 09 sbc r25, r1 2e5c8: 25 85 ldd r18, Z+13 ; 0x0d 2e5ca: 04 c0 rjmp .+8 ; 0x2e5d4 2e5cc: 66 0f add r22, r22 2e5ce: 77 1f adc r23, r23 2e5d0: 88 1f adc r24, r24 2e5d2: 99 1f adc r25, r25 2e5d4: 2a 95 dec r18 2e5d6: d2 f7 brpl .-12 ; 0x2e5cc 2e5d8: 26 85 ldd r18, Z+14 ; 0x0e 2e5da: 37 85 ldd r19, Z+15 ; 0x0f 2e5dc: 40 89 ldd r20, Z+16 ; 0x10 2e5de: 51 89 ldd r21, Z+17 ; 0x11 2e5e0: 62 0f add r22, r18 2e5e2: 73 1f adc r23, r19 2e5e4: 84 1f adc r24, r20 2e5e6: 95 1f adc r25, r21 2e5e8: 61 0f add r22, r17 2e5ea: 71 1d adc r23, r1 2e5ec: 81 1d adc r24, r1 2e5ee: 91 1d adc r25, r1 2e5f0: 9d cf rjmp .-198 ; 0x2e52c if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2e5f2: ab 81 ldd r26, Y+3 ; 0x03 2e5f4: bc 81 ldd r27, Y+4 ; 0x04 2e5f6: 14 96 adiw r26, 0x04 ; 4 2e5f8: 4d 91 ld r20, X+ 2e5fa: 5d 91 ld r21, X+ 2e5fc: 6d 91 ld r22, X+ 2e5fe: 7c 91 ld r23, X 2e600: 17 97 sbiw r26, 0x07 ; 7 2e602: 29 81 ldd r18, Y+1 ; 0x01 2e604: 3a 81 ldd r19, Y+2 ; 0x02 2e606: 0f 94 d8 36 call 0x26db0 ; 0x26db0 2e60a: 81 11 cpse r24, r1 2e60c: cd cf rjmp .-102 ; 0x2e5a8 2e60e: 24 cf rjmp .-440 ; 0x2e458 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);} 2e610: 94 01 movw r18, r8 2e612: ab 01 movw r20, r22 2e614: bc 01 movw r22, r24 2e616: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e61a: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e61e: 0f 94 54 71 call 0x2e2a8 ; 0x2e2a8 // 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; 2e622: 88 23 and r24, r24 2e624: 09 f4 brne .+2 ; 0x2e628 2e626: 18 cf rjmp .-464 ; 0x2e458 // 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; 2e628: 80 0e add r8, r16 2e62a: 91 1e adc r9, r17 curPosition_ += n; 2e62c: eb 81 ldd r30, Y+3 ; 0x03 2e62e: fc 81 ldd r31, Y+4 ; 0x04 2e630: 80 85 ldd r24, Z+8 ; 0x08 2e632: 91 85 ldd r25, Z+9 ; 0x09 2e634: a2 85 ldd r26, Z+10 ; 0x0a 2e636: b3 85 ldd r27, Z+11 ; 0x0b 2e638: 80 0f add r24, r16 2e63a: 91 1f adc r25, r17 2e63c: a1 1d adc r26, r1 2e63e: b1 1d adc r27, r1 2e640: 80 87 std Z+8, r24 ; 0x08 2e642: 91 87 std Z+9, r25 ; 0x09 2e644: a2 87 std Z+10, r26 ; 0x0a 2e646: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2e648: c0 1a sub r12, r16 2e64a: d1 0a sbc r13, r17 2e64c: 45 cf rjmp .-374 ; 0x2e4d8 } return nbyte; 2e64e: c7 01 movw r24, r14 2e650: 05 cf rjmp .-502 ; 0x2e45c 0002e652 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e652: 4f 92 push r4 2e654: 5f 92 push r5 2e656: 6f 92 push r6 2e658: 7f 92 push r7 2e65a: af 92 push r10 2e65c: bf 92 push r11 2e65e: cf 92 push r12 2e660: df 92 push r13 2e662: ef 92 push r14 2e664: ff 92 push r15 2e666: 0f 93 push r16 2e668: 1f 93 push r17 2e66a: cf 93 push r28 2e66c: df 93 push r29 2e66e: 1f 92 push r1 2e670: cd b7 in r28, 0x3d ; 61 2e672: de b7 in r29, 0x3e ; 62 2e674: 8c 01 movw r16, r24 2e676: 7b 01 movw r14, r22 2e678: 5a 01 movw r10, r20 2e67a: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2e67c: db 01 movw r26, r22 2e67e: 59 96 adiw r26, 0x19 ; 25 2e680: 8d 91 ld r24, X+ 2e682: 9c 91 ld r25, X 2e684: f8 01 movw r30, r16 2e686: 92 8f std Z+26, r25 ; 0x1a 2e688: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2e68a: cb 01 movw r24, r22 2e68c: 0e 94 c1 70 call 0xe182 ; 0xe182 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2e690: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2e692: f7 01 movw r30, r14 2e694: 80 85 ldd r24, Z+8 ; 0x08 2e696: 91 85 ldd r25, Z+9 ; 0x09 2e698: a2 85 ldd r26, Z+10 ; 0x0a 2e69a: b3 85 ldd r27, Z+11 ; 0x0b 2e69c: 41 89 ldd r20, Z+17 ; 0x11 2e69e: 52 89 ldd r21, Z+18 ; 0x12 2e6a0: 63 89 ldd r22, Z+19 ; 0x13 2e6a2: 74 89 ldd r23, Z+20 ; 0x14 2e6a4: 84 17 cp r24, r20 2e6a6: 95 07 cpc r25, r21 2e6a8: a6 07 cpc r26, r22 2e6aa: b7 07 cpc r27, r23 2e6ac: 08 f0 brcs .+2 ; 0x2e6b0 2e6ae: 52 c0 rjmp .+164 ; 0x2e754 index = 0XF & (dirFile->curPosition_ >> 5); 2e6b0: 55 e0 ldi r21, 0x05 ; 5 2e6b2: b6 95 lsr r27 2e6b4: a7 95 ror r26 2e6b6: 97 95 ror r25 2e6b8: 87 95 ror r24 2e6ba: 5a 95 dec r21 2e6bc: d1 f7 brne .-12 ; 0x2e6b2 2e6be: f8 2f mov r31, r24 2e6c0: ff 70 andi r31, 0x0F ; 15 2e6c2: 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; 2e6c4: d7 01 movw r26, r14 2e6c6: 13 96 adiw r26, 0x03 ; 3 2e6c8: 8c 91 ld r24, X 2e6ca: 82 30 cpi r24, 0x02 ; 2 2e6cc: 10 f4 brcc .+4 ; 0x2e6d2 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2e6ce: 80 e0 ldi r24, 0x00 ; 0 2e6d0: db c0 rjmp .+438 ; 0x2e888 * \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; 2e6d2: 41 e0 ldi r20, 0x01 ; 1 2e6d4: 50 e0 ldi r21, 0x00 ; 0 2e6d6: be 01 movw r22, r28 2e6d8: 6f 5f subi r22, 0xFF ; 255 2e6da: 7f 4f sbci r23, 0xFF ; 255 2e6dc: c7 01 movw r24, r14 2e6de: 0f 94 0d 72 call 0x2e41a ; 0x2e41a 2e6e2: 01 97 sbiw r24, 0x01 ; 1 2e6e4: a1 f7 brne .-24 ; 0x2e6ce // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2e6e6: f7 01 movw r30, r14 2e6e8: 80 85 ldd r24, Z+8 ; 0x08 2e6ea: 91 85 ldd r25, Z+9 ; 0x09 2e6ec: a2 85 ldd r26, Z+10 ; 0x0a 2e6ee: b3 85 ldd r27, Z+11 ; 0x0b 2e6f0: 4f 96 adiw r24, 0x1f ; 31 2e6f2: a1 1d adc r26, r1 2e6f4: b1 1d adc r27, r1 2e6f6: 80 87 std Z+8, r24 ; 0x08 2e6f8: 91 87 std Z+9, r25 ; 0x09 2e6fa: a2 87 std Z+10, r26 ; 0x0a 2e6fc: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2e6fe: f0 e2 ldi r31, 0x20 ; 32 2e700: df 9e mul r13, r31 2e702: b0 01 movw r22, r0 2e704: 11 24 eor r1, r1 2e706: 67 52 subi r22, 0x27 ; 39 2e708: 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; 2e70a: 61 15 cp r22, r1 2e70c: 71 05 cpc r23, r1 2e70e: f9 f2 breq .-66 ; 0x2e6ce if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2e710: db 01 movw r26, r22 2e712: 8c 91 ld r24, X 2e714: 88 23 and r24, r24 2e716: 41 f0 breq .+16 ; 0x2e728 2e718: 85 3e cpi r24, 0xE5 ; 229 2e71a: 09 f0 breq .+2 ; 0x2e71e 2e71c: 4c c0 rjmp .+152 ; 0x2e7b6 // remember first empty slot if (!emptyFound) { 2e71e: 77 20 and r7, r7 2e720: 29 f0 breq .+10 ; 0x2e72c return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e722: 77 24 eor r7, r7 2e724: 73 94 inc r7 2e726: b5 cf rjmp .-150 ; 0x2e692 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) { 2e728: 71 10 cpse r7, r1 2e72a: 0e c0 rjmp .+28 ; 0x2e748 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2e72c: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2e730: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2e734: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2e738: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2e73c: f8 01 movw r30, r16 2e73e: 84 87 std Z+12, r24 ; 0x0c 2e740: 95 87 std Z+13, r25 ; 0x0d 2e742: a6 87 std Z+14, r26 ; 0x0e 2e744: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2e746: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2e748: db 01 movw r26, r22 2e74a: 8c 91 ld r24, X 2e74c: 81 11 cpse r24, r1 2e74e: e9 cf rjmp .-46 ; 0x2e722 2e750: 77 24 eor r7, r7 2e752: 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; 2e754: 8c 2d mov r24, r12 2e756: 82 74 andi r24, 0x42 ; 66 2e758: 82 34 cpi r24, 0x42 ; 66 2e75a: 09 f0 breq .+2 ; 0x2e75e 2e75c: b8 cf rjmp .-144 ; 0x2e6ce if (emptyFound) { 2e75e: 77 20 and r7, r7 2e760: 09 f4 brne .+2 ; 0x2e764 2e762: a2 c0 rjmp .+324 ; 0x2e8a8 index = dirIndex_; 2e764: f8 01 movw r30, r16 2e766: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2e768: 61 e0 ldi r22, 0x01 ; 1 2e76a: c8 01 movw r24, r16 2e76c: 0f 94 3c 6f call 0x2de78 ; 0x2de78 if (!p) goto fail; 2e770: 00 97 sbiw r24, 0x00 ; 0 2e772: 09 f4 brne .+2 ; 0x2e776 2e774: ac cf rjmp .-168 ; 0x2e6ce // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2e776: 20 e2 ldi r18, 0x20 ; 32 2e778: dc 01 movw r26, r24 2e77a: 1d 92 st X+, r1 2e77c: 2a 95 dec r18 2e77e: e9 f7 brne .-6 ; 0x2e77a memcpy(p->name, dname, 11); 2e780: 2b e0 ldi r18, 0x0B ; 11 2e782: f5 01 movw r30, r10 2e784: dc 01 movw r26, r24 2e786: 01 90 ld r0, Z+ 2e788: 0d 92 st X+, r0 2e78a: 2a 95 dec r18 2e78c: e1 f7 brne .-8 ; 0x2e786 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2e78e: 21 e2 ldi r18, 0x21 ; 33 2e790: 38 e2 ldi r19, 0x28 ; 40 2e792: fc 01 movw r30, r24 2e794: 31 8b std Z+17, r19 ; 0x11 2e796: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2e798: 40 e0 ldi r20, 0x00 ; 0 2e79a: 58 e0 ldi r21, 0x08 ; 8 2e79c: 57 87 std Z+15, r21 ; 0x0f 2e79e: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2e7a0: 33 8b std Z+19, r19 ; 0x13 2e7a2: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2e7a4: 31 8f std Z+25, r19 ; 0x19 2e7a6: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2e7a8: 57 8b std Z+23, r21 ; 0x17 2e7aa: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2e7ac: 0f 94 ca 35 call 0x26b94 ; 0x26b94 2e7b0: 81 11 cpse r24, r1 2e7b2: 09 c0 rjmp .+18 ; 0x2e7c6 2e7b4: 8c cf rjmp .-232 ; 0x2e6ce dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2e7b6: 4b e0 ldi r20, 0x0B ; 11 2e7b8: 50 e0 ldi r21, 0x00 ; 0 2e7ba: c5 01 movw r24, r10 2e7bc: 0f 94 99 a6 call 0x34d32 ; 0x34d32 2e7c0: 89 2b or r24, r25 2e7c2: 09 f0 breq .+2 ; 0x2e7c6 2e7c4: 66 cf rjmp .-308 ; 0x2e692 } //------------------------------------------------------------------------------ // 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]; 2e7c6: f0 e2 ldi r31, 0x20 ; 32 2e7c8: df 9e mul r13, r31 2e7ca: d0 01 movw r26, r0 2e7cc: 11 24 eor r1, r1 2e7ce: 9d 01 movw r18, r26 2e7d0: 27 52 subi r18, 0x27 ; 39 2e7d2: 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)) { 2e7d4: f9 01 movw r30, r18 2e7d6: 83 85 ldd r24, Z+11 ; 0x0b 2e7d8: 81 71 andi r24, 0x11 ; 17 2e7da: 21 f0 breq .+8 ; 0x2e7e4 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2e7dc: 8c 2d mov r24, r12 2e7de: 82 71 andi r24, 0x12 ; 18 2e7e0: 09 f0 breq .+2 ; 0x2e7e4 2e7e2: fc c0 rjmp .+504 ; 0x2e9dc } //------------------------------------------------------------------------------ // 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]; 2e7e4: f8 01 movw r30, r16 2e7e6: 81 8d ldd r24, Z+25 ; 0x19 2e7e8: 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(); 2e7ea: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 2e7ee: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 2e7f2: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 2e7f6: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 2e7fa: 44 87 std Z+12, r20 ; 0x0c 2e7fc: 55 87 std Z+13, r21 ; 0x0d 2e7fe: 66 87 std Z+14, r22 ; 0x0e 2e800: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2e802: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2e804: fd 01 movw r30, r26 2e806: e7 52 subi r30, 0x27 ; 39 2e808: f2 4f sbci r31, 0xF2 ; 242 2e80a: 44 88 ldd r4, Z+20 ; 0x14 2e80c: 55 88 ldd r5, Z+21 ; 0x15 2e80e: 71 2c mov r7, r1 2e810: 61 2c mov r6, r1 2e812: 32 01 movw r6, r4 2e814: 55 24 eor r5, r5 2e816: 44 24 eor r4, r4 2e818: d8 01 movw r26, r16 2e81a: 55 96 adiw r26, 0x15 ; 21 2e81c: 4d 92 st X+, r4 2e81e: 5d 92 st X+, r5 2e820: 6d 92 st X+, r6 2e822: 7c 92 st X, r7 2e824: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2e826: 42 8d ldd r20, Z+26 ; 0x1a 2e828: 53 8d ldd r21, Z+27 ; 0x1b 2e82a: 70 e0 ldi r23, 0x00 ; 0 2e82c: 60 e0 ldi r22, 0x00 ; 0 2e82e: 44 29 or r20, r4 2e830: 55 29 or r21, r5 2e832: 66 29 or r22, r6 2e834: 77 29 or r23, r7 2e836: 55 96 adiw r26, 0x15 ; 21 2e838: 4d 93 st X+, r20 2e83a: 5d 93 st X+, r21 2e83c: 6d 93 st X+, r22 2e83e: 7c 93 st X, r23 2e840: 58 97 sbiw r26, 0x18 ; 24 2e842: d9 01 movw r26, r18 2e844: 1b 96 adiw r26, 0x0b ; 11 2e846: 2c 91 ld r18, X 2e848: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2e84a: 09 f0 breq .+2 ; 0x2e84e 2e84c: b9 c0 rjmp .+370 ; 0x2e9c0 fileSize_ = p->fileSize; 2e84e: 84 8d ldd r24, Z+28 ; 0x1c 2e850: 95 8d ldd r25, Z+29 ; 0x1d 2e852: a6 8d ldd r26, Z+30 ; 0x1e 2e854: b7 8d ldd r27, Z+31 ; 0x1f 2e856: f8 01 movw r30, r16 2e858: 81 8b std Z+17, r24 ; 0x11 2e85a: 92 8b std Z+18, r25 ; 0x12 2e85c: a3 8b std Z+19, r26 ; 0x13 2e85e: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2e860: 81 e0 ldi r24, 0x01 ; 1 2e862: 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; 2e864: 8c 2d mov r24, r12 2e866: 8f 70 andi r24, 0x0F ; 15 2e868: f8 01 movw r30, r16 2e86a: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2e86c: 14 82 std Z+4, r1 ; 0x04 2e86e: 15 82 std Z+5, r1 ; 0x05 2e870: 16 82 std Z+6, r1 ; 0x06 2e872: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2e874: 10 86 std Z+8, r1 ; 0x08 2e876: 11 86 std Z+9, r1 ; 0x09 2e878: 12 86 std Z+10, r1 ; 0x0a 2e87a: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2e87c: 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; 2e87e: c4 fe sbrs r12, 4 2e880: 03 c0 rjmp .+6 ; 0x2e888 2e882: c8 01 movw r24, r16 2e884: 0f 94 75 44 call 0x288ea ; 0x288ea // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2e888: 0f 90 pop r0 2e88a: df 91 pop r29 2e88c: cf 91 pop r28 2e88e: 1f 91 pop r17 2e890: 0f 91 pop r16 2e892: ff 90 pop r15 2e894: ef 90 pop r14 2e896: df 90 pop r13 2e898: cf 90 pop r12 2e89a: bf 90 pop r11 2e89c: af 90 pop r10 2e89e: 7f 90 pop r7 2e8a0: 6f 90 pop r6 2e8a2: 5f 90 pop r5 2e8a4: 4f 90 pop r4 2e8a6: 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; 2e8a8: d7 01 movw r26, r14 2e8aa: 13 96 adiw r26, 0x03 ; 3 2e8ac: 8c 91 ld r24, X 2e8ae: 13 97 sbiw r26, 0x03 ; 3 2e8b0: 82 30 cpi r24, 0x02 ; 2 2e8b2: 09 f4 brne .+2 ; 0x2e8b6 2e8b4: 0c cf rjmp .-488 ; 0x2e6ce // 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; 2e8b6: 51 96 adiw r26, 0x11 ; 17 2e8b8: 8d 91 ld r24, X+ 2e8ba: 9d 91 ld r25, X+ 2e8bc: 0d 90 ld r0, X+ 2e8be: bc 91 ld r27, X 2e8c0: a0 2d mov r26, r0 2e8c2: 80 3e cpi r24, 0xE0 ; 224 2e8c4: 9f 4f sbci r25, 0xFF ; 255 2e8c6: af 41 sbci r26, 0x1F ; 31 2e8c8: b1 05 cpc r27, r1 2e8ca: 08 f0 brcs .+2 ; 0x2e8ce 2e8cc: 00 cf rjmp .-512 ; 0x2e6ce if (!addCluster()) goto fail; 2e8ce: c7 01 movw r24, r14 2e8d0: 0f 94 90 6f call 0x2df20 ; 0x2df20 2e8d4: 88 23 and r24, r24 2e8d6: 09 f4 brne .+2 ; 0x2e8da 2e8d8: fa ce rjmp .-524 ; 0x2e6ce if (!vol_->cacheFlush()) goto fail; 2e8da: 0f 94 ca 35 call 0x26b94 ; 0x26b94 2e8de: 88 23 and r24, r24 2e8e0: 09 f4 brne .+2 ; 0x2e8e4 2e8e2: f5 ce rjmp .-534 ; 0x2e6ce block = vol_->clusterStartBlock(curCluster_); 2e8e4: d7 01 movw r26, r14 2e8e6: 59 96 adiw r26, 0x19 ; 25 2e8e8: ed 91 ld r30, X+ 2e8ea: fc 91 ld r31, X 2e8ec: 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_);} 2e8ee: 14 96 adiw r26, 0x04 ; 4 2e8f0: 4d 90 ld r4, X+ 2e8f2: 5d 90 ld r5, X+ 2e8f4: 6d 90 ld r6, X+ 2e8f6: 7c 90 ld r7, X 2e8f8: 17 97 sbiw r26, 0x07 ; 7 2e8fa: b2 e0 ldi r27, 0x02 ; 2 2e8fc: 4b 1a sub r4, r27 2e8fe: 51 08 sbc r5, r1 2e900: 61 08 sbc r6, r1 2e902: 71 08 sbc r7, r1 2e904: 85 85 ldd r24, Z+13 ; 0x0d 2e906: 04 c0 rjmp .+8 ; 0x2e910 2e908: 44 0c add r4, r4 2e90a: 55 1c adc r5, r5 2e90c: 66 1c adc r6, r6 2e90e: 77 1c adc r7, r7 2e910: 8a 95 dec r24 2e912: d2 f7 brpl .-12 ; 0x2e908 2e914: 86 85 ldd r24, Z+14 ; 0x0e 2e916: 97 85 ldd r25, Z+15 ; 0x0f 2e918: a0 89 ldd r26, Z+16 ; 0x10 2e91a: b1 89 ldd r27, Z+17 ; 0x11 2e91c: 48 0e add r4, r24 2e91e: 59 1e adc r5, r25 2e920: 6a 1e adc r6, r26 2e922: 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; 2e924: 81 e0 ldi r24, 0x01 ; 1 2e926: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2e92a: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2e92e: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2e932: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2e936: 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); 2e93a: e9 ed ldi r30, 0xD9 ; 217 2e93c: fd e0 ldi r31, 0x0D ; 13 2e93e: 80 e0 ldi r24, 0x00 ; 0 2e940: 92 e0 ldi r25, 0x02 ; 2 2e942: df 01 movw r26, r30 2e944: 9c 01 movw r18, r24 2e946: 1d 92 st X+, r1 2e948: 21 50 subi r18, 0x01 ; 1 2e94a: 30 40 sbci r19, 0x00 ; 0 2e94c: e1 f7 brne .-8 ; 0x2e946 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e94e: dd 24 eor r13, r13 2e950: d3 94 inc r13 2e952: d7 01 movw r26, r14 2e954: 59 96 adiw r26, 0x19 ; 25 2e956: ed 91 ld r30, X+ 2e958: fc 91 ld r31, X 2e95a: 84 81 ldd r24, Z+4 ; 0x04 2e95c: d8 16 cp r13, r24 2e95e: 98 f4 brcc .+38 ; 0x2e986 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); 2e960: 29 ed ldi r18, 0xD9 ; 217 2e962: 3d e0 ldi r19, 0x0D ; 13 2e964: b3 01 movw r22, r6 2e966: a2 01 movw r20, r4 2e968: 4d 0d add r20, r13 2e96a: 51 1d adc r21, r1 2e96c: 61 1d adc r22, r1 2e96e: 71 1d adc r23, r1 2e970: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e974: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e978: 0f 94 f0 70 call 0x2e1e0 ; 0x2e1e0 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2e97c: 88 23 and r24, r24 2e97e: 09 f4 brne .+2 ; 0x2e982 2e980: a6 ce rjmp .-692 ; 0x2e6ce // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e982: d3 94 inc r13 2e984: e6 cf rjmp .-52 ; 0x2e952 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2e986: 25 85 ldd r18, Z+13 ; 0x0d 2e988: 80 e0 ldi r24, 0x00 ; 0 2e98a: 92 e0 ldi r25, 0x02 ; 2 2e98c: a0 e0 ldi r26, 0x00 ; 0 2e98e: b0 e0 ldi r27, 0x00 ; 0 2e990: 04 c0 rjmp .+8 ; 0x2e99a 2e992: 88 0f add r24, r24 2e994: 99 1f adc r25, r25 2e996: aa 1f adc r26, r26 2e998: bb 1f adc r27, r27 2e99a: 2a 95 dec r18 2e99c: d2 f7 brpl .-12 ; 0x2e992 2e99e: f7 01 movw r30, r14 2e9a0: 41 89 ldd r20, Z+17 ; 0x11 2e9a2: 52 89 ldd r21, Z+18 ; 0x12 2e9a4: 63 89 ldd r22, Z+19 ; 0x13 2e9a6: 74 89 ldd r23, Z+20 ; 0x14 2e9a8: 84 0f add r24, r20 2e9aa: 95 1f adc r25, r21 2e9ac: a6 1f adc r26, r22 2e9ae: b7 1f adc r27, r23 2e9b0: 81 8b std Z+17, r24 ; 0x11 2e9b2: 92 8b std Z+18, r25 ; 0x12 2e9b4: a3 8b std Z+19, r26 ; 0x13 2e9b6: 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; 2e9b8: 89 ed ldi r24, 0xD9 ; 217 2e9ba: 9d e0 ldi r25, 0x0D ; 13 index = 0; 2e9bc: d1 2c mov r13, r1 2e9be: db ce rjmp .-586 ; 0x2e776 // 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)) { 2e9c0: 20 31 cpi r18, 0x10 ; 16 2e9c2: 61 f4 brne .+24 ; 0x2e9dc if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2e9c4: 98 01 movw r18, r16 2e9c6: 2f 5e subi r18, 0xEF ; 239 2e9c8: 3f 4f sbci r19, 0xFF ; 255 2e9ca: 0f 94 5b 37 call 0x26eb6 ; 0x26eb6 2e9ce: 88 23 and r24, r24 2e9d0: 29 f0 breq .+10 ; 0x2e9dc type_ = FAT_FILE_TYPE_SUBDIR; 2e9d2: 84 e0 ldi r24, 0x04 ; 4 2e9d4: d8 01 movw r26, r16 2e9d6: 13 96 adiw r26, 0x03 ; 3 2e9d8: 8c 93 st X, r24 2e9da: 44 cf rjmp .-376 ; 0x2e864 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2e9dc: d8 01 movw r26, r16 2e9de: 13 96 adiw r26, 0x03 ; 3 2e9e0: 1c 92 st X, r1 2e9e2: 75 ce rjmp .-790 ; 0x2e6ce 0002e9e4 : } #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; } 2e9e4: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb 2e9e8: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc 2e9ec: bc 01 movw r22, r24 2e9ee: c9 01 movw r24, r18 2e9f0: 8f 51 subi r24, 0x1F ; 31 2e9f2: 90 4f sbci r25, 0xF0 ; 240 2e9f4: 0f 94 84 9e call 0x33d08 ; 0x33d08 2e9f8: 9c 01 movw r18, r24 2e9fa: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 2e9fe: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2ea02: 81 e0 ldi r24, 0x01 ; 1 2ea04: 23 2b or r18, r19 2ea06: 09 f4 brne .+2 ; 0x2ea0a 2ea08: 80 e0 ldi r24, 0x00 ; 0 2ea0a: 08 95 ret 0002ea0c : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2ea0c: 60 91 a8 0d lds r22, 0x0DA8 ; 0x800da8 uint8_t _block_buffer_tail = block_buffer_tail; 2ea10: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 uint16_t sdlen = 0; 2ea14: 30 e0 ldi r19, 0x00 ; 0 2ea16: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2ea18: 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) 2ea1a: 96 17 cp r25, r22 2ea1c: 61 f0 breq .+24 ; 0x2ea36 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2ea1e: 89 9f mul r24, r25 2ea20: f0 01 movw r30, r0 2ea22: 11 24 eor r1, r1 2ea24: ec 5c subi r30, 0xCC ; 204 2ea26: f8 4f sbci r31, 0xF8 ; 248 2ea28: 40 81 ld r20, Z 2ea2a: 51 81 ldd r21, Z+1 ; 0x01 2ea2c: 24 0f add r18, r20 2ea2e: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2ea30: 9f 5f subi r25, 0xFF ; 255 2ea32: 9f 70 andi r25, 0x0F ; 15 2ea34: f2 cf rjmp .-28 ; 0x2ea1a } return sdlen; } 2ea36: c9 01 movw r24, r18 2ea38: 08 95 ret 0002ea3a : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2ea3a: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2ea3e: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 2ea42: 32 17 cp r19, r18 2ea44: 91 f0 breq .+36 ; 0x2ea6a // 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; 2ea46: 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) 2ea4a: e1 11 cpse r30, r1 2ea4c: 01 c0 rjmp .+2 ; 0x2ea50 block_index = BLOCK_BUFFER_SIZE; 2ea4e: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2ea50: 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; 2ea52: 2e e6 ldi r18, 0x6E ; 110 2ea54: e2 9f mul r30, r18 2ea56: f0 01 movw r30, r0 2ea58: 11 24 eor r1, r1 2ea5a: ec 5c subi r30, 0xCC ; 204 2ea5c: f8 4f sbci r31, 0xF8 ; 248 2ea5e: 20 81 ld r18, Z 2ea60: 31 81 ldd r19, Z+1 ; 0x01 2ea62: 82 0f add r24, r18 2ea64: 93 1f adc r25, r19 2ea66: 91 83 std Z+1, r25 ; 0x01 2ea68: 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. } } 2ea6a: 08 95 ret 0002ea6c : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2ea6c: cf 92 push r12 2ea6e: df 92 push r13 2ea70: ef 92 push r14 2ea72: ff 92 push r15 2ea74: 0f 93 push r16 2ea76: 1f 93 push r17 2ea78: cf 93 push r28 2ea7a: df 93 push r29 2ea7c: 06 e3 ldi r16, 0x36 ; 54 2ea7e: 14 e0 ldi r17, 0x04 ; 4 2ea80: c5 ee ldi r28, 0xE5 ; 229 2ea82: d6 e1 ldi r29, 0x16 ; 22 2ea84: 85 ef ldi r24, 0xF5 ; 245 2ea86: c8 2e mov r12, r24 2ea88: 86 e1 ldi r24, 0x16 ; 22 2ea8a: d8 2e mov r13, r24 2ea8c: 78 01 movw r14, r16 2ea8e: 0c 5f subi r16, 0xFC ; 252 2ea90: 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]; 2ea92: f7 01 movw r30, r14 2ea94: 60 a1 ldd r22, Z+32 ; 0x20 2ea96: 71 a1 ldd r23, Z+33 ; 0x21 2ea98: 82 a1 ldd r24, Z+34 ; 0x22 2ea9a: 93 a1 ldd r25, Z+35 ; 0x23 2ea9c: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2eaa0: f7 01 movw r30, r14 2eaa2: 20 81 ld r18, Z 2eaa4: 31 81 ldd r19, Z+1 ; 0x01 2eaa6: 42 81 ldd r20, Z+2 ; 0x02 2eaa8: 53 81 ldd r21, Z+3 ; 0x03 2eaaa: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2eaae: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2eab2: 69 93 st Y+, r22 2eab4: 79 93 st Y+, r23 2eab6: 89 93 st Y+, r24 2eab8: 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++) 2eaba: cc 16 cp r12, r28 2eabc: dd 06 cpc r13, r29 2eabe: 31 f7 brne .-52 ; 0x2ea8c max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2eac0: df 91 pop r29 2eac2: cf 91 pop r28 2eac4: 1f 91 pop r17 2eac6: 0f 91 pop r16 2eac8: ff 90 pop r15 2eaca: ef 90 pop r14 2eacc: df 90 pop r13 2eace: cf 90 pop r12 2ead0: 08 95 ret 0002ead2 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2ead2: fc 01 movw r30, r24 2ead4: 40 81 ld r20, Z 2ead6: 51 81 ldd r21, Z+1 ; 0x01 2ead8: 62 81 ldd r22, Z+2 ; 0x02 2eada: 73 81 ldd r23, Z+3 ; 0x03 2eadc: 40 93 10 04 sts 0x0410, r20 ; 0x800410 2eae0: 50 93 11 04 sts 0x0411, r21 ; 0x800411 2eae4: 60 93 12 04 sts 0x0412, r22 ; 0x800412 2eae8: 70 93 13 04 sts 0x0413, r23 ; 0x800413 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2eaec: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2eaf0: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2eaf4: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2eaf8: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2eafc: 60 81 ld r22, Z 2eafe: 71 81 ldd r23, Z+1 ; 0x01 2eb00: 82 81 ldd r24, Z+2 ; 0x02 2eb02: 93 81 ldd r25, Z+3 ; 0x03 2eb04: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2eb08: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2eb0c: e6 ea ldi r30, 0xA6 ; 166 2eb0e: f6 e0 ldi r31, 0x06 ; 6 2eb10: 64 87 std Z+12, r22 ; 0x0c 2eb12: 75 87 std Z+13, r23 ; 0x0d 2eb14: 86 87 std Z+14, r24 ; 0x0e 2eb16: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2eb18: 8f b7 in r24, 0x3f ; 63 2eb1a: f8 94 cli count_position[E_AXIS] = e; 2eb1c: 44 85 ldd r20, Z+12 ; 0x0c 2eb1e: 55 85 ldd r21, Z+13 ; 0x0d 2eb20: 66 85 ldd r22, Z+14 ; 0x0e 2eb22: 77 85 ldd r23, Z+15 ; 0x0f 2eb24: 40 93 c2 06 sts 0x06C2, r20 ; 0x8006c2 2eb28: 50 93 c3 06 sts 0x06C3, r21 ; 0x8006c3 2eb2c: 60 93 c4 06 sts 0x06C4, r22 ; 0x8006c4 2eb30: 70 93 c5 06 sts 0x06C5, r23 ; 0x8006c5 CRITICAL_SECTION_END; 2eb34: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2eb36: 08 95 ret 0002eb38 : // 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; 2eb38: fc 01 movw r30, r24 2eb3a: 40 81 ld r20, Z 2eb3c: 51 81 ldd r21, Z+1 ; 0x01 2eb3e: 62 81 ldd r22, Z+2 ; 0x02 2eb40: 73 81 ldd r23, Z+3 ; 0x03 2eb42: 40 93 0c 04 sts 0x040C, r20 ; 0x80040c 2eb46: 50 93 0d 04 sts 0x040D, r21 ; 0x80040d 2eb4a: 60 93 0e 04 sts 0x040E, r22 ; 0x80040e 2eb4e: 70 93 0f 04 sts 0x040F, r23 ; 0x80040f #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2eb52: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2eb56: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2eb5a: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2eb5e: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2eb62: 60 81 ld r22, Z 2eb64: 71 81 ldd r23, Z+1 ; 0x01 2eb66: 82 81 ldd r24, Z+2 ; 0x02 2eb68: 93 81 ldd r25, Z+3 ; 0x03 2eb6a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2eb6e: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2eb72: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 2eb76: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 2eb7a: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 2eb7e: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 st_set_position(position); 2eb82: 0d 94 14 54 jmp 0x2a828 ; 0x2a828 0002eb86 : // 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) { 2eb86: 2f 92 push r2 2eb88: 3f 92 push r3 2eb8a: 4f 92 push r4 2eb8c: 5f 92 push r5 2eb8e: 6f 92 push r6 2eb90: 7f 92 push r7 2eb92: 8f 92 push r8 2eb94: 9f 92 push r9 2eb96: af 92 push r10 2eb98: bf 92 push r11 2eb9a: cf 92 push r12 2eb9c: df 92 push r13 2eb9e: ef 92 push r14 2eba0: ff 92 push r15 2eba2: 0f 93 push r16 2eba4: 1f 93 push r17 2eba6: cf 93 push r28 2eba8: df 93 push r29 2ebaa: cd b7 in r28, 0x3d ; 61 2ebac: de b7 in r29, 0x3e ; 62 2ebae: c4 58 subi r28, 0x84 ; 132 2ebb0: d1 09 sbc r29, r1 2ebb2: 0f b6 in r0, 0x3f ; 63 2ebb4: f8 94 cli 2ebb6: de bf out 0x3e, r29 ; 62 2ebb8: 0f be out 0x3f, r0 ; 63 2ebba: cd bf out 0x3d, r28 ; 61 2ebbc: 69 a3 std Y+33, r22 ; 0x21 2ebbe: 7a a3 std Y+34, r23 ; 0x22 2ebc0: 8b a3 std Y+35, r24 ; 0x23 2ebc2: 9c a3 std Y+36, r25 ; 0x24 2ebc4: 2d a3 std Y+37, r18 ; 0x25 2ebc6: 3e a3 std Y+38, r19 ; 0x26 2ebc8: 4f a3 std Y+39, r20 ; 0x27 2ebca: 58 a7 std Y+40, r21 ; 0x28 2ebcc: a7 96 adiw r28, 0x27 ; 39 2ebce: ec ae std Y+60, r14 ; 0x3c 2ebd0: fd ae std Y+61, r15 ; 0x3d 2ebd2: 0e af std Y+62, r16 ; 0x3e 2ebd4: 1f af std Y+63, r17 ; 0x3f 2ebd6: a7 97 sbiw r28, 0x27 ; 39 2ebd8: a9 96 adiw r28, 0x29 ; 41 2ebda: df ae std Y+63, r13 ; 0x3f 2ebdc: ce ae std Y+62, r12 ; 0x3e 2ebde: a9 97 sbiw r28, 0x29 ; 41 2ebe0: 89 ae std Y+57, r8 ; 0x39 2ebe2: 99 aa std Y+49, r9 ; 0x31 2ebe4: ad ae std Y+61, r10 ; 0x3d 2ebe6: bd aa std Y+53, r11 ; 0x35 2ebe8: c6 56 subi r28, 0x66 ; 102 2ebea: df 4f sbci r29, 0xFF ; 255 2ebec: 08 81 ld r16, Y 2ebee: 19 81 ldd r17, Y+1 ; 0x01 2ebf0: ca 59 subi r28, 0x9A ; 154 2ebf2: 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); 2ebf4: 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) 2ebf8: 8f 5f subi r24, 0xFF ; 255 2ebfa: a0 96 adiw r28, 0x20 ; 32 2ebfc: 8f af std Y+63, r24 ; 0x3f 2ebfe: a0 97 sbiw r28, 0x20 ; 32 2ec00: 80 31 cpi r24, 0x10 ; 16 2ec02: 19 f4 brne .+6 ; 0x2ec0a block_index = 0; 2ec04: a0 96 adiw r28, 0x20 ; 32 2ec06: 1f ae std Y+63, r1 ; 0x3f 2ec08: 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) { 2ec0a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2ec0e: a0 96 adiw r28, 0x20 ; 32 2ec10: 2f ad ldd r18, Y+63 ; 0x3f 2ec12: a0 97 sbiw r28, 0x20 ; 32 2ec14: 82 13 cpse r24, r18 2ec16: 0f c0 rjmp .+30 ; 0x2ec36 do { manage_heater(); 2ec18: 0f 94 f7 31 call 0x263ee ; 0x263ee // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2ec1c: 80 e0 ldi r24, 0x00 ; 0 2ec1e: 0e 94 8c 7a call 0xf518 ; 0xf518 lcd_update(0); 2ec22: 80 e0 ldi r24, 0x00 ; 0 2ec24: 0e 94 cd 69 call 0xd39a ; 0xd39a } while (block_buffer_tail == next_buffer_head); 2ec28: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2ec2c: a0 96 adiw r28, 0x20 ; 32 2ec2e: 3f ad ldd r19, Y+63 ; 0x3f 2ec30: a0 97 sbiw r28, 0x20 ; 32 2ec32: 83 17 cp r24, r19 2ec34: 89 f3 breq .-30 ; 0x2ec18 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 2ec36: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 2ec3a: a1 96 adiw r28, 0x21 ; 33 2ec3c: 4f af std Y+63, r20 ; 0x3f 2ec3e: a1 97 sbiw r28, 0x21 ; 33 2ec40: 44 23 and r20, r20 2ec42: 11 f1 breq .+68 ; 0x2ec88 // avoid planning the block early if aborted SERIAL_ECHO_START; 2ec44: 87 e7 ldi r24, 0x77 ; 119 2ec46: 9e e9 ldi r25, 0x9E ; 158 2ec48: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n("Move aborted")); 2ec4c: 8b e1 ldi r24, 0x1B ; 27 2ec4e: 9d e6 ldi r25, 0x6D ; 109 2ec50: 0e 94 de 72 call 0xe5bc ; 0xe5bc // 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(); } 2ec54: cc 57 subi r28, 0x7C ; 124 2ec56: df 4f sbci r29, 0xFF ; 255 2ec58: 0f b6 in r0, 0x3f ; 63 2ec5a: f8 94 cli 2ec5c: de bf out 0x3e, r29 ; 62 2ec5e: 0f be out 0x3f, r0 ; 63 2ec60: cd bf out 0x3d, r28 ; 61 2ec62: df 91 pop r29 2ec64: cf 91 pop r28 2ec66: 1f 91 pop r17 2ec68: 0f 91 pop r16 2ec6a: ff 90 pop r15 2ec6c: ef 90 pop r14 2ec6e: df 90 pop r13 2ec70: cf 90 pop r12 2ec72: bf 90 pop r11 2ec74: af 90 pop r10 2ec76: 9f 90 pop r9 2ec78: 8f 90 pop r8 2ec7a: 7f 90 pop r7 2ec7c: 6f 90 pop r6 2ec7e: 5f 90 pop r5 2ec80: 4f 90 pop r4 2ec82: 3f 90 pop r3 2ec84: 2f 90 pop r2 2ec86: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 2ec88: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2ec8c: 29 2e mov r2, r25 2ec8e: 31 2c mov r3, r1 2ec90: 8e e6 ldi r24, 0x6E ; 110 2ec92: 98 9f mul r25, r24 2ec94: d0 01 movw r26, r0 2ec96: 11 24 eor r1, r1 2ec98: a3 96 adiw r28, 0x23 ; 35 2ec9a: bf af std Y+63, r27 ; 0x3f 2ec9c: ae af std Y+62, r26 ; 0x3e 2ec9e: 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; 2eca0: cd 01 movw r24, r26 2eca2: 88 53 subi r24, 0x38 ; 56 2eca4: 99 4f sbci r25, 0xF9 ; 249 2eca6: fc 01 movw r30, r24 2eca8: e9 5b subi r30, 0xB9 ; 185 2ecaa: ff 4f sbci r31, 0xFF ; 255 2ecac: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 2ecae: 84 59 subi r24, 0x94 ; 148 2ecb0: 9f 4f sbci r25, 0xFF ; 255 2ecb2: fc 01 movw r30, r24 2ecb4: 11 82 std Z+1, r1 ; 0x01 2ecb6: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 2ecb8: 01 15 cp r16, r1 2ecba: 11 05 cpc r17, r1 2ecbc: 11 f4 brne .+4 ; 0x2ecc2 2ecbe: 0d 94 b0 80 jmp 0x30160 ; 0x30160 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 2ecc2: 80 e1 ldi r24, 0x10 ; 16 2ecc4: f8 01 movw r30, r16 2ecc6: a0 5e subi r26, 0xE0 ; 224 2ecc8: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 2ecca: 01 90 ld r0, Z+ 2eccc: 0d 92 st X+, r0 2ecce: 8a 95 dec r24 2ecd0: e1 f7 brne .-8 ; 0x2ecca // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 2ecd2: 8e e6 ldi r24, 0x6E ; 110 2ecd4: 82 9d mul r24, r2 2ecd6: 80 01 movw r16, r0 2ecd8: 83 9d mul r24, r3 2ecda: 10 0d add r17, r0 2ecdc: 11 24 eor r1, r1 2ecde: 08 53 subi r16, 0x38 ; 56 2ece0: 19 4f sbci r17, 0xF9 ; 249 2ece2: f8 01 movw r30, r16 2ece4: e8 59 subi r30, 0x98 ; 152 2ece6: ff 4f sbci r31, 0xFF ; 255 2ece8: c4 56 subi r28, 0x64 ; 100 2ecea: df 4f sbci r29, 0xFF ; 255 2ecec: 88 81 ld r24, Y 2ecee: 99 81 ldd r25, Y+1 ; 0x01 2ecf0: cc 59 subi r28, 0x9C ; 156 2ecf2: d0 40 sbci r29, 0x00 ; 0 2ecf4: 91 83 std Z+1, r25 ; 0x01 2ecf6: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 2ecf8: 06 59 subi r16, 0x96 ; 150 2ecfa: 1f 4f sbci r17, 0xFF ; 255 2ecfc: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2ed00: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2ed04: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2ed08: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2ed0c: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2ed10: d8 01 movw r26, r16 2ed12: 6d 93 st X+, r22 2ed14: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 2ed16: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> 2ed1a: 88 23 and r24, r24 2ed1c: a9 f0 breq .+42 ; 0x2ed48 { position[E_AXIS] = 0; 2ed1e: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 2ed22: 10 92 b3 06 sts 0x06B3, r1 ; 0x8006b3 2ed26: 10 92 b4 06 sts 0x06B4, r1 ; 0x8006b4 2ed2a: 10 92 b5 06 sts 0x06B5, r1 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 2ed2e: 10 92 10 04 sts 0x0410, r1 ; 0x800410 2ed32: 10 92 11 04 sts 0x0411, r1 ; 0x800411 2ed36: 10 92 12 04 sts 0x0412, r1 ; 0x800412 2ed3a: 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; 2ed3e: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = true; 2ed42: 81 e0 ldi r24, 0x01 ; 1 2ed44: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } // Apply the machine correction matrix. world2machine(x, y); 2ed48: be 01 movw r22, r28 2ed4a: 6b 5d subi r22, 0xDB ; 219 2ed4c: 7f 4f sbci r23, 0xFF ; 255 2ed4e: ce 01 movw r24, r28 2ed50: 81 96 adiw r24, 0x21 ; 33 2ed52: 0e 94 89 63 call 0xc712 ; 0xc712 // 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]); 2ed56: c9 a0 ldd r12, Y+33 ; 0x21 2ed58: da a0 ldd r13, Y+34 ; 0x22 2ed5a: eb a0 ldd r14, Y+35 ; 0x23 2ed5c: fc a0 ldd r15, Y+36 ; 0x24 2ed5e: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2ed62: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2ed66: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2ed6a: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2ed6e: c7 01 movw r24, r14 2ed70: b6 01 movw r22, r12 2ed72: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ed76: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2ed7a: c3 58 subi r28, 0x83 ; 131 2ed7c: df 4f sbci r29, 0xFF ; 255 2ed7e: 68 83 st Y, r22 2ed80: 79 83 std Y+1, r23 ; 0x01 2ed82: 8a 83 std Y+2, r24 ; 0x02 2ed84: 9b 83 std Y+3, r25 ; 0x03 2ed86: cd 57 subi r28, 0x7D ; 125 2ed88: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2ed8a: 8d a0 ldd r8, Y+37 ; 0x25 2ed8c: 9e a0 ldd r9, Y+38 ; 0x26 2ed8e: af a0 ldd r10, Y+39 ; 0x27 2ed90: b8 a4 ldd r11, Y+40 ; 0x28 2ed92: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2ed96: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2ed9a: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2ed9e: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2eda2: c5 01 movw r24, r10 2eda4: b4 01 movw r22, r8 2eda6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2edaa: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2edae: cf 57 subi r28, 0x7F ; 127 2edb0: df 4f sbci r29, 0xFF ; 255 2edb2: 68 83 st Y, r22 2edb4: 79 83 std Y+1, r23 ; 0x01 2edb6: 8a 83 std Y+2, r24 ; 0x02 2edb8: 9b 83 std Y+3, r25 ; 0x03 2edba: c1 58 subi r28, 0x81 ; 129 2edbc: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 2edbe: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 2edc2: 88 23 and r24, r24 2edc4: 11 f4 brne .+4 ; 0x2edca 2edc6: 0d 94 b7 80 jmp 0x3016e ; 0x3016e target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 2edca: a5 01 movw r20, r10 2edcc: 94 01 movw r18, r8 2edce: c7 01 movw r24, r14 2edd0: b6 01 movw r22, r12 2edd2: 0f 94 a9 60 call 0x2c152 ; 0x2c152 2edd6: a7 96 adiw r28, 0x27 ; 39 2edd8: 2c ad ldd r18, Y+60 ; 0x3c 2edda: 3d ad ldd r19, Y+61 ; 0x3d 2eddc: 4e ad ldd r20, Y+62 ; 0x3e 2edde: 5f ad ldd r21, Y+63 ; 0x3f 2ede0: a7 97 sbiw r28, 0x27 ; 39 2ede2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2ede6: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2edea: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2edee: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2edf2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2edf6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2edfa: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2edfe: e5 96 adiw r28, 0x35 ; 53 2ee00: 6c af std Y+60, r22 ; 0x3c 2ee02: 7d af std Y+61, r23 ; 0x3d 2ee04: 8e af std Y+62, r24 ; 0x3e 2ee06: 9f af std Y+63, r25 ; 0x3f 2ee08: 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]); 2ee0a: a9 96 adiw r28, 0x29 ; 41 2ee0c: ee ad ldd r30, Y+62 ; 0x3e 2ee0e: ff ad ldd r31, Y+63 ; 0x3f 2ee10: a9 97 sbiw r28, 0x29 ; 41 2ee12: 80 80 ld r8, Z 2ee14: 91 80 ldd r9, Z+1 ; 0x01 2ee16: a2 80 ldd r10, Z+2 ; 0x02 2ee18: b3 80 ldd r11, Z+3 ; 0x03 2ee1a: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2ee1e: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2ee22: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2ee26: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2ee2a: c5 01 movw r24, r10 2ee2c: b4 01 movw r22, r8 2ee2e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ee32: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2ee36: ad 96 adiw r28, 0x2d ; 45 2ee38: 6c af std Y+60, r22 ; 0x3c 2ee3a: 7d af std Y+61, r23 ; 0x3d 2ee3c: 8e af std Y+62, r24 ; 0x3e 2ee3e: 9f af std Y+63, r25 ; 0x3f 2ee40: 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]; 2ee42: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2ee46: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2ee4a: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2ee4e: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2ee52: ad 96 adiw r28, 0x2d ; 45 2ee54: 4c ac ldd r4, Y+60 ; 0x3c 2ee56: 5d ac ldd r5, Y+61 ; 0x3d 2ee58: 6e ac ldd r6, Y+62 ; 0x3e 2ee5a: 7f ac ldd r7, Y+63 ; 0x3f 2ee5c: ad 97 sbiw r28, 0x2d ; 45 2ee5e: 48 1a sub r4, r24 2ee60: 59 0a sbc r5, r25 2ee62: 6a 0a sbc r6, r26 2ee64: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 2ee66: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 2ee6a: 90 91 a7 06 lds r25, 0x06A7 ; 0x8006a7 2ee6e: a0 91 a8 06 lds r26, 0x06A8 ; 0x8006a8 2ee72: b0 91 a9 06 lds r27, 0x06A9 ; 0x8006a9 2ee76: c3 58 subi r28, 0x83 ; 131 2ee78: df 4f sbci r29, 0xFF ; 255 2ee7a: c8 80 ld r12, Y 2ee7c: d9 80 ldd r13, Y+1 ; 0x01 2ee7e: ea 80 ldd r14, Y+2 ; 0x02 2ee80: fb 80 ldd r15, Y+3 ; 0x03 2ee82: cd 57 subi r28, 0x7D ; 125 2ee84: d0 40 sbci r29, 0x00 ; 0 2ee86: c8 1a sub r12, r24 2ee88: d9 0a sbc r13, r25 2ee8a: ea 0a sbc r14, r26 2ee8c: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 2ee8e: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 2ee92: 90 91 ab 06 lds r25, 0x06AB ; 0x8006ab 2ee96: a0 91 ac 06 lds r26, 0x06AC ; 0x8006ac 2ee9a: b0 91 ad 06 lds r27, 0x06AD ; 0x8006ad 2ee9e: cf 57 subi r28, 0x7F ; 127 2eea0: df 4f sbci r29, 0xFF ; 255 2eea2: 28 81 ld r18, Y 2eea4: 39 81 ldd r19, Y+1 ; 0x01 2eea6: 4a 81 ldd r20, Y+2 ; 0x02 2eea8: 5b 81 ldd r21, Y+3 ; 0x03 2eeaa: c1 58 subi r28, 0x81 ; 129 2eeac: d0 40 sbci r29, 0x00 ; 0 2eeae: 28 1b sub r18, r24 2eeb0: 39 0b sbc r19, r25 2eeb2: 4a 0b sbc r20, r26 2eeb4: 5b 0b sbc r21, r27 2eeb6: 29 a7 std Y+41, r18 ; 0x29 2eeb8: 3a a7 std Y+42, r19 ; 0x2a 2eeba: 4b a7 std Y+43, r20 ; 0x2b 2eebc: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 2eebe: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 2eec2: 90 91 af 06 lds r25, 0x06AF ; 0x8006af 2eec6: a0 91 b0 06 lds r26, 0x06B0 ; 0x8006b0 2eeca: b0 91 b1 06 lds r27, 0x06B1 ; 0x8006b1 2eece: e5 96 adiw r28, 0x35 ; 53 2eed0: 2c ad ldd r18, Y+60 ; 0x3c 2eed2: 3d ad ldd r19, Y+61 ; 0x3d 2eed4: 4e ad ldd r20, Y+62 ; 0x3e 2eed6: 5f ad ldd r21, Y+63 ; 0x3f 2eed8: e5 97 sbiw r28, 0x35 ; 53 2eeda: 28 1b sub r18, r24 2eedc: 39 0b sbc r19, r25 2eede: 4a 0b sbc r20, r26 2eee0: 5b 0b sbc r21, r27 2eee2: 2d a7 std Y+45, r18 ; 0x2d 2eee4: 3e a7 std Y+46, r19 ; 0x2e 2eee6: 4f a7 std Y+47, r20 ; 0x2f 2eee8: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 2eeea: 41 14 cp r4, r1 2eeec: 51 04 cpc r5, r1 2eeee: 61 04 cpc r6, r1 2eef0: 71 04 cpc r7, r1 2eef2: 09 f4 brne .+2 ; 0x2eef6 2eef4: 80 c0 rjmp .+256 ; 0x2eff6 { if((int)degHotend(active_extruder) 2eefa: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2eefe: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2ef02: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2ef06: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 2ef0a: 20 91 57 02 lds r18, 0x0257 ; 0x800257 2ef0e: 30 91 58 02 lds r19, 0x0258 ; 0x800258 2ef12: 62 17 cp r22, r18 2ef14: 73 07 cpc r23, r19 2ef16: 0c f5 brge .+66 ; 0x2ef5a { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2ef18: ad 96 adiw r28, 0x2d ; 45 2ef1a: 8c ad ldd r24, Y+60 ; 0x3c 2ef1c: 9d ad ldd r25, Y+61 ; 0x3d 2ef1e: ae ad ldd r26, Y+62 ; 0x3e 2ef20: bf ad ldd r27, Y+63 ; 0x3f 2ef22: ad 97 sbiw r28, 0x2d ; 45 2ef24: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 2ef28: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 2ef2c: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 2ef30: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2ef34: 80 92 10 04 sts 0x0410, r8 ; 0x800410 2ef38: 90 92 11 04 sts 0x0411, r9 ; 0x800411 2ef3c: a0 92 12 04 sts 0x0412, r10 ; 0x800412 2ef40: b0 92 13 04 sts 0x0413, r11 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2ef44: 87 e7 ldi r24, 0x77 ; 119 2ef46: 9e e9 ldi r25, 0x9E ; 158 2ef48: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2ef4c: 81 e0 ldi r24, 0x01 ; 1 2ef4e: 9d e6 ldi r25, 0x6D ; 109 2ef50: 0e 94 de 72 call 0xe5bc ; 0xe5bc { 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 2ef54: 41 2c mov r4, r1 2ef56: 51 2c mov r5, r1 2ef58: 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) 2ef5a: c3 01 movw r24, r6 2ef5c: b2 01 movw r22, r4 2ef5e: 77 fe sbrs r7, 7 2ef60: 07 c0 rjmp .+14 ; 0x2ef70 2ef62: 66 27 eor r22, r22 2ef64: 77 27 eor r23, r23 2ef66: cb 01 movw r24, r22 2ef68: 64 19 sub r22, r4 2ef6a: 75 09 sbc r23, r5 2ef6c: 86 09 sbc r24, r6 2ef6e: 97 09 sbc r25, r7 2ef70: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2ef74: 4b 01 movw r8, r22 2ef76: 5c 01 movw r10, r24 2ef78: 20 e0 ldi r18, 0x00 ; 0 2ef7a: 30 e0 ldi r19, 0x00 ; 0 2ef7c: 48 ee ldi r20, 0xE8 ; 232 2ef7e: 53 e4 ldi r21, 0x43 ; 67 2ef80: 60 91 42 04 lds r22, 0x0442 ; 0x800442 2ef84: 70 91 43 04 lds r23, 0x0443 ; 0x800443 2ef88: 80 91 44 04 lds r24, 0x0444 ; 0x800444 2ef8c: 90 91 45 04 lds r25, 0x0445 ; 0x800445 2ef90: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2ef94: 9b 01 movw r18, r22 2ef96: ac 01 movw r20, r24 2ef98: c5 01 movw r24, r10 2ef9a: b4 01 movw r22, r8 2ef9c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2efa0: 18 16 cp r1, r24 2efa2: 4c f5 brge .+82 ; 0x2eff6 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2efa4: ad 96 adiw r28, 0x2d ; 45 2efa6: 2c ad ldd r18, Y+60 ; 0x3c 2efa8: 3d ad ldd r19, Y+61 ; 0x3d 2efaa: 4e ad ldd r20, Y+62 ; 0x3e 2efac: 5f ad ldd r21, Y+63 ; 0x3f 2efae: ad 97 sbiw r28, 0x2d ; 45 2efb0: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2efb4: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2efb8: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2efbc: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2efc0: a9 96 adiw r28, 0x29 ; 41 2efc2: ee ad ldd r30, Y+62 ; 0x3e 2efc4: ff ad ldd r31, Y+63 ; 0x3f 2efc6: a9 97 sbiw r28, 0x29 ; 41 2efc8: 80 81 ld r24, Z 2efca: 91 81 ldd r25, Z+1 ; 0x01 2efcc: a2 81 ldd r26, Z+2 ; 0x02 2efce: b3 81 ldd r27, Z+3 ; 0x03 2efd0: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2efd4: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2efd8: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2efdc: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2efe0: 87 e7 ldi r24, 0x77 ; 119 2efe2: 9e e9 ldi r25, 0x9E ; 158 2efe4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 2efe8: 83 ee ldi r24, 0xE3 ; 227 2efea: 9c e6 ldi r25, 0x6C ; 108 2efec: 0e 94 de 72 call 0xe5bc ; 0xe5bc { 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 2eff0: 41 2c mov r4, r1 2eff2: 51 2c mov r5, r1 2eff4: 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); 2eff6: 8e e6 ldi r24, 0x6E ; 110 2eff8: 82 9d mul r24, r2 2effa: f0 01 movw r30, r0 2effc: 83 9d mul r24, r3 2effe: f0 0d add r31, r0 2f000: 11 24 eor r1, r1 2f002: e8 53 subi r30, 0x38 ; 56 2f004: f9 4f sbci r31, 0xF9 ; 249 2f006: d7 01 movw r26, r14 2f008: c6 01 movw r24, r12 2f00a: f7 fe sbrs r15, 7 2f00c: 07 c0 rjmp .+14 ; 0x2f01c 2f00e: 88 27 eor r24, r24 2f010: 99 27 eor r25, r25 2f012: dc 01 movw r26, r24 2f014: 8c 19 sub r24, r12 2f016: 9d 09 sbc r25, r13 2f018: ae 09 sbc r26, r14 2f01a: bf 09 sbc r27, r15 2f01c: 80 83 st Z, r24 2f01e: 91 83 std Z+1, r25 ; 0x01 2f020: a2 83 std Z+2, r26 ; 0x02 2f022: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 2f024: 8e e6 ldi r24, 0x6E ; 110 2f026: 82 9d mul r24, r2 2f028: f0 01 movw r30, r0 2f02a: 83 9d mul r24, r3 2f02c: f0 0d add r31, r0 2f02e: 11 24 eor r1, r1 2f030: e8 53 subi r30, 0x38 ; 56 2f032: f9 4f sbci r31, 0xF9 ; 249 2f034: 89 a5 ldd r24, Y+41 ; 0x29 2f036: 9a a5 ldd r25, Y+42 ; 0x2a 2f038: ab a5 ldd r26, Y+43 ; 0x2b 2f03a: bc a5 ldd r27, Y+44 ; 0x2c 2f03c: b7 ff sbrs r27, 7 2f03e: 07 c0 rjmp .+14 ; 0x2f04e 2f040: b0 95 com r27 2f042: a0 95 com r26 2f044: 90 95 com r25 2f046: 81 95 neg r24 2f048: 9f 4f sbci r25, 0xFF ; 255 2f04a: af 4f sbci r26, 0xFF ; 255 2f04c: bf 4f sbci r27, 0xFF ; 255 2f04e: 84 83 std Z+4, r24 ; 0x04 2f050: 95 83 std Z+5, r25 ; 0x05 2f052: a6 83 std Z+6, r26 ; 0x06 2f054: 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); 2f056: 8e e6 ldi r24, 0x6E ; 110 2f058: 82 9d mul r24, r2 2f05a: f0 01 movw r30, r0 2f05c: 83 9d mul r24, r3 2f05e: f0 0d add r31, r0 2f060: 11 24 eor r1, r1 2f062: e8 53 subi r30, 0x38 ; 56 2f064: f9 4f sbci r31, 0xF9 ; 249 2f066: 8d a5 ldd r24, Y+45 ; 0x2d 2f068: 9e a5 ldd r25, Y+46 ; 0x2e 2f06a: af a5 ldd r26, Y+47 ; 0x2f 2f06c: b8 a9 ldd r27, Y+48 ; 0x30 2f06e: b7 ff sbrs r27, 7 2f070: 07 c0 rjmp .+14 ; 0x2f080 2f072: b0 95 com r27 2f074: a0 95 com r26 2f076: 90 95 com r25 2f078: 81 95 neg r24 2f07a: 9f 4f sbci r25, 0xFF ; 255 2f07c: af 4f sbci r26, 0xFF ; 255 2f07e: bf 4f sbci r27, 0xFF ; 255 2f080: 80 87 std Z+8, r24 ; 0x08 2f082: 91 87 std Z+9, r25 ; 0x09 2f084: a2 87 std Z+10, r26 ; 0x0a 2f086: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 2f088: b3 01 movw r22, r6 2f08a: a2 01 movw r20, r4 2f08c: 77 fe sbrs r7, 7 2f08e: 07 c0 rjmp .+14 ; 0x2f09e 2f090: 44 27 eor r20, r20 2f092: 55 27 eor r21, r21 2f094: ba 01 movw r22, r20 2f096: 44 19 sub r20, r4 2f098: 55 09 sbc r21, r5 2f09a: 66 09 sbc r22, r6 2f09c: 77 09 sbc r23, r7 2f09e: 8e e6 ldi r24, 0x6E ; 110 2f0a0: 82 9d mul r24, r2 2f0a2: f0 01 movw r30, r0 2f0a4: 83 9d mul r24, r3 2f0a6: f0 0d add r31, r0 2f0a8: 11 24 eor r1, r1 2f0aa: e8 53 subi r30, 0x38 ; 56 2f0ac: f9 4f sbci r31, 0xF9 ; 249 2f0ae: 44 87 std Z+12, r20 ; 0x0c 2f0b0: 55 87 std Z+13, r21 ; 0x0d 2f0b2: 66 87 std Z+14, r22 ; 0x0e 2f0b4: 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))); 2f0b6: 00 81 ld r16, Z 2f0b8: 11 81 ldd r17, Z+1 ; 0x01 2f0ba: 22 81 ldd r18, Z+2 ; 0x02 2f0bc: 33 81 ldd r19, Z+3 ; 0x03 2f0be: 84 81 ldd r24, Z+4 ; 0x04 2f0c0: 95 81 ldd r25, Z+5 ; 0x05 2f0c2: a6 81 ldd r26, Z+6 ; 0x06 2f0c4: b7 81 ldd r27, Z+7 ; 0x07 2f0c6: 80 17 cp r24, r16 2f0c8: 91 07 cpc r25, r17 2f0ca: a2 07 cpc r26, r18 2f0cc: b3 07 cpc r27, r19 2f0ce: 14 f4 brge .+4 ; 0x2f0d4 2f0d0: d9 01 movw r26, r18 2f0d2: c8 01 movw r24, r16 2f0d4: ee e6 ldi r30, 0x6E ; 110 2f0d6: be 2e mov r11, r30 2f0d8: b2 9c mul r11, r2 2f0da: f0 01 movw r30, r0 2f0dc: b3 9c mul r11, r3 2f0de: f0 0d add r31, r0 2f0e0: 11 24 eor r1, r1 2f0e2: e8 53 subi r30, 0x38 ; 56 2f0e4: f9 4f sbci r31, 0xF9 ; 249 2f0e6: 80 84 ldd r8, Z+8 ; 0x08 2f0e8: 91 84 ldd r9, Z+9 ; 0x09 2f0ea: a2 84 ldd r10, Z+10 ; 0x0a 2f0ec: b3 84 ldd r11, Z+11 ; 0x0b 2f0ee: 88 15 cp r24, r8 2f0f0: 99 05 cpc r25, r9 2f0f2: aa 05 cpc r26, r10 2f0f4: bb 05 cpc r27, r11 2f0f6: 14 f4 brge .+4 ; 0x2f0fc 2f0f8: d5 01 movw r26, r10 2f0fa: c4 01 movw r24, r8 2f0fc: 84 17 cp r24, r20 2f0fe: 95 07 cpc r25, r21 2f100: a6 07 cpc r26, r22 2f102: b7 07 cpc r27, r23 2f104: 14 f4 brge .+4 ; 0x2f10a 2f106: db 01 movw r26, r22 2f108: ca 01 movw r24, r20 2f10a: 4e e6 ldi r20, 0x6E ; 110 2f10c: 42 9d mul r20, r2 2f10e: f0 01 movw r30, r0 2f110: 43 9d mul r20, r3 2f112: f0 0d add r31, r0 2f114: 11 24 eor r1, r1 2f116: e8 53 subi r30, 0x38 ; 56 2f118: f9 4f sbci r31, 0xF9 ; 249 2f11a: 80 8b std Z+16, r24 ; 0x10 2f11c: 91 8b std Z+17, r25 ; 0x11 2f11e: a2 8b std Z+18, r26 ; 0x12 2f120: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 2f122: 06 97 sbiw r24, 0x06 ; 6 2f124: a1 05 cpc r26, r1 2f126: b1 05 cpc r27, r1 2f128: 0c f4 brge .+2 ; 0x2f12c 2f12a: 94 cd rjmp .-1240 ; 0x2ec54 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 2f12c: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 2f130: df 01 movw r26, r30 2f132: aa 5b subi r26, 0xBA ; 186 2f134: bf 4f sbci r27, 0xFF ; 255 2f136: 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); 2f138: f7 fe sbrs r15, 7 2f13a: 02 c0 rjmp .+4 ; 0x2f140 2f13c: 0d 94 c7 80 jmp 0x3018e ; 0x3018e } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 2f140: 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); 2f142: 89 a5 ldd r24, Y+41 ; 0x29 2f144: 9a a5 ldd r25, Y+42 ; 0x2a 2f146: ab a5 ldd r26, Y+43 ; 0x2b 2f148: bc a5 ldd r27, Y+44 ; 0x2c 2f14a: b7 ff sbrs r27, 7 2f14c: 0b c0 rjmp .+22 ; 0x2f164 2f14e: 8e e6 ldi r24, 0x6E ; 110 2f150: 82 9d mul r24, r2 2f152: f0 01 movw r30, r0 2f154: 83 9d mul r24, r3 2f156: f0 0d add r31, r0 2f158: 11 24 eor r1, r1 2f15a: e8 53 subi r30, 0x38 ; 56 2f15c: f9 4f sbci r31, 0xF9 ; 249 2f15e: 80 8d ldd r24, Z+24 ; 0x18 2f160: 82 60 ori r24, 0x02 ; 2 2f162: 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); 2f164: 8d a5 ldd r24, Y+45 ; 0x2d 2f166: 9e a5 ldd r25, Y+46 ; 0x2e 2f168: af a5 ldd r26, Y+47 ; 0x2f 2f16a: b8 a9 ldd r27, Y+48 ; 0x30 2f16c: b7 ff sbrs r27, 7 2f16e: 0b c0 rjmp .+22 ; 0x2f186 2f170: 8e e6 ldi r24, 0x6E ; 110 2f172: 82 9d mul r24, r2 2f174: f0 01 movw r30, r0 2f176: 83 9d mul r24, r3 2f178: f0 0d add r31, r0 2f17a: 11 24 eor r1, r1 2f17c: e8 53 subi r30, 0x38 ; 56 2f17e: f9 4f sbci r31, 0xF9 ; 249 2f180: 80 8d ldd r24, Z+24 ; 0x18 2f182: 84 60 ori r24, 0x04 ; 4 2f184: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 2f186: 77 fe sbrs r7, 7 2f188: 0b c0 rjmp .+22 ; 0x2f1a0 2f18a: 8e e6 ldi r24, 0x6E ; 110 2f18c: 82 9d mul r24, r2 2f18e: f0 01 movw r30, r0 2f190: 83 9d mul r24, r3 2f192: f0 0d add r31, r0 2f194: 11 24 eor r1, r1 2f196: e8 53 subi r30, 0x38 ; 56 2f198: f9 4f sbci r31, 0xF9 ; 249 2f19a: 80 8d ldd r24, Z+24 ; 0x18 2f19c: 88 60 ori r24, 0x08 ; 8 2f19e: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 2f1a0: 01 2b or r16, r17 2f1a2: 02 2b or r16, r18 2f1a4: 03 2b or r16, r19 2f1a6: 09 f0 breq .+2 ; 0x2f1aa 2f1a8: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 2f1aa: 8e e6 ldi r24, 0x6E ; 110 2f1ac: 82 9d mul r24, r2 2f1ae: f0 01 movw r30, r0 2f1b0: 83 9d mul r24, r3 2f1b2: f0 0d add r31, r0 2f1b4: 11 24 eor r1, r1 2f1b6: e8 53 subi r30, 0x38 ; 56 2f1b8: f9 4f sbci r31, 0xF9 ; 249 2f1ba: 84 81 ldd r24, Z+4 ; 0x04 2f1bc: 95 81 ldd r25, Z+5 ; 0x05 2f1be: a6 81 ldd r26, Z+6 ; 0x06 2f1c0: b7 81 ldd r27, Z+7 ; 0x07 2f1c2: 89 2b or r24, r25 2f1c4: 8a 2b or r24, r26 2f1c6: 8b 2b or r24, r27 2f1c8: 09 f0 breq .+2 ; 0x2f1cc 2f1ca: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 2f1cc: 8e e6 ldi r24, 0x6E ; 110 2f1ce: 82 9d mul r24, r2 2f1d0: f0 01 movw r30, r0 2f1d2: 83 9d mul r24, r3 2f1d4: f0 0d add r31, r0 2f1d6: 11 24 eor r1, r1 2f1d8: e8 53 subi r30, 0x38 ; 56 2f1da: f9 4f sbci r31, 0xF9 ; 249 2f1dc: 80 85 ldd r24, Z+8 ; 0x08 2f1de: 91 85 ldd r25, Z+9 ; 0x09 2f1e0: a2 85 ldd r26, Z+10 ; 0x0a 2f1e2: b3 85 ldd r27, Z+11 ; 0x0b 2f1e4: 89 2b or r24, r25 2f1e6: 8a 2b or r24, r26 2f1e8: 8b 2b or r24, r27 2f1ea: 09 f0 breq .+2 ; 0x2f1ee 2f1ec: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 2f1ee: 8e e6 ldi r24, 0x6E ; 110 2f1f0: 82 9d mul r24, r2 2f1f2: f0 01 movw r30, r0 2f1f4: 83 9d mul r24, r3 2f1f6: f0 0d add r31, r0 2f1f8: 11 24 eor r1, r1 2f1fa: e8 53 subi r30, 0x38 ; 56 2f1fc: f9 4f sbci r31, 0xF9 ; 249 2f1fe: 84 85 ldd r24, Z+12 ; 0x0c 2f200: 95 85 ldd r25, Z+13 ; 0x0d 2f202: a6 85 ldd r26, Z+14 ; 0x0e 2f204: b7 85 ldd r27, Z+15 ; 0x0f 2f206: 89 2b or r24, r25 2f208: 8a 2b or r24, r26 2f20a: 8b 2b or r24, r27 2f20c: 09 f0 breq .+2 ; 0x2f210 2f20e: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 2f210: 8e e6 ldi r24, 0x6E ; 110 2f212: 82 9d mul r24, r2 2f214: f0 01 movw r30, r0 2f216: 83 9d mul r24, r3 2f218: f0 0d add r31, r0 2f21a: 11 24 eor r1, r1 2f21c: e8 53 subi r30, 0x38 ; 56 2f21e: f9 4f sbci r31, 0xF9 ; 249 2f220: 24 85 ldd r18, Z+12 ; 0x0c 2f222: 35 85 ldd r19, Z+13 ; 0x0d 2f224: 46 85 ldd r20, Z+14 ; 0x0e 2f226: 57 85 ldd r21, Z+15 ; 0x0f 2f228: 2a 96 adiw r28, 0x0a ; 10 2f22a: 2c af std Y+60, r18 ; 0x3c 2f22c: 3d af std Y+61, r19 ; 0x3d 2f22e: 4e af std Y+62, r20 ; 0x3e 2f230: 5f af std Y+63, r21 ; 0x3f 2f232: 2a 97 sbiw r28, 0x0a ; 10 2f234: 23 2b or r18, r19 2f236: 24 2b or r18, r20 2f238: 25 2b or r18, r21 2f23a: 09 f0 breq .+2 ; 0x2f23e 2f23c: ac c7 rjmp .+3928 ; 0x30196 { if(feed_rate 2f242: b0 90 73 04 lds r11, 0x0473 ; 0x800473 2f246: 00 91 74 04 lds r16, 0x0474 ; 0x800474 2f24a: 10 91 75 04 lds r17, 0x0475 ; 0x800475 } else { if(feed_rate 2f25e: 18 16 cp r1, r24 2f260: 24 f4 brge .+8 ; 0x2f26a 2f262: a9 ae std Y+57, r10 ; 0x39 2f264: b9 aa std Y+49, r11 ; 0x31 2f266: 0d af std Y+61, r16 ; 0x3d 2f268: 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]; 2f26a: c7 01 movw r24, r14 2f26c: b6 01 movw r22, r12 2f26e: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2f272: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2f276: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2f27a: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2f27e: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2f282: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f286: 4b 01 movw r8, r22 2f288: 5c 01 movw r10, r24 2f28a: 89 82 std Y+1, r8 ; 0x01 2f28c: 9a 82 std Y+2, r9 ; 0x02 2f28e: ab 82 std Y+3, r10 ; 0x03 2f290: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 2f292: 69 a5 ldd r22, Y+41 ; 0x29 2f294: 7a a5 ldd r23, Y+42 ; 0x2a 2f296: 8b a5 ldd r24, Y+43 ; 0x2b 2f298: 9c a5 ldd r25, Y+44 ; 0x2c 2f29a: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2f29e: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2f2a2: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2f2a6: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2f2aa: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2f2ae: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f2b2: 6b 01 movw r12, r22 2f2b4: 7c 01 movw r14, r24 2f2b6: cd 82 std Y+5, r12 ; 0x05 2f2b8: de 82 std Y+6, r13 ; 0x06 2f2ba: ef 82 std Y+7, r14 ; 0x07 2f2bc: 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]; 2f2be: 6d a5 ldd r22, Y+45 ; 0x2d 2f2c0: 7e a5 ldd r23, Y+46 ; 0x2e 2f2c2: 8f a5 ldd r24, Y+47 ; 0x2f 2f2c4: 98 a9 ldd r25, Y+48 ; 0x30 2f2c6: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2f2ca: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2f2ce: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2f2d2: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2f2d6: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2f2da: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f2de: 22 96 adiw r28, 0x02 ; 2 2f2e0: 6c af std Y+60, r22 ; 0x3c 2f2e2: 7d af std Y+61, r23 ; 0x3d 2f2e4: 8e af std Y+62, r24 ; 0x3e 2f2e6: 9f af std Y+63, r25 ; 0x3f 2f2e8: 22 97 sbiw r28, 0x02 ; 2 2f2ea: 69 87 std Y+9, r22 ; 0x09 2f2ec: 7a 87 std Y+10, r23 ; 0x0a 2f2ee: 8b 87 std Y+11, r24 ; 0x0b 2f2f0: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 2f2f2: c3 01 movw r24, r6 2f2f4: b2 01 movw r22, r4 2f2f6: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 2f2fa: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2f2fe: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2f302: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2f306: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2f30a: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f30e: 26 96 adiw r28, 0x06 ; 6 2f310: 6c af std Y+60, r22 ; 0x3c 2f312: 7d af std Y+61, r23 ; 0x3d 2f314: 8e af std Y+62, r24 ; 0x3e 2f316: 9f af std Y+63, r25 ; 0x3f 2f318: 26 97 sbiw r28, 0x06 ; 6 2f31a: 6d 87 std Y+13, r22 ; 0x0d 2f31c: 7e 87 std Y+14, r23 ; 0x0e 2f31e: 8f 87 std Y+15, r24 ; 0x0f 2f320: 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 ) 2f322: 8e e6 ldi r24, 0x6E ; 110 2f324: 82 9d mul r24, r2 2f326: f0 01 movw r30, r0 2f328: 83 9d mul r24, r3 2f32a: f0 0d add r31, r0 2f32c: 11 24 eor r1, r1 2f32e: e8 53 subi r30, 0x38 ; 56 2f330: f9 4f sbci r31, 0xF9 ; 249 2f332: 80 81 ld r24, Z 2f334: 91 81 ldd r25, Z+1 ; 0x01 2f336: a2 81 ldd r26, Z+2 ; 0x02 2f338: b3 81 ldd r27, Z+3 ; 0x03 2f33a: 2e 96 adiw r28, 0x0e ; 14 2f33c: 8c af std Y+60, r24 ; 0x3c 2f33e: 9d af std Y+61, r25 ; 0x3d 2f340: ae af std Y+62, r26 ; 0x3e 2f342: bf af std Y+63, r27 ; 0x3f 2f344: 2e 97 sbiw r28, 0x0e ; 14 2f346: 06 97 sbiw r24, 0x06 ; 6 2f348: a1 05 cpc r26, r1 2f34a: b1 05 cpc r27, r1 2f34c: 0c f0 brlt .+2 ; 0x2f350 2f34e: 2c c7 rjmp .+3672 ; 0x301a8 2f350: 84 81 ldd r24, Z+4 ; 0x04 2f352: 95 81 ldd r25, Z+5 ; 0x05 2f354: a6 81 ldd r26, Z+6 ; 0x06 2f356: b7 81 ldd r27, Z+7 ; 0x07 2f358: 06 97 sbiw r24, 0x06 ; 6 2f35a: a1 05 cpc r26, r1 2f35c: b1 05 cpc r27, r1 2f35e: 0c f0 brlt .+2 ; 0x2f362 2f360: 23 c7 rjmp .+3654 ; 0x301a8 2f362: 80 85 ldd r24, Z+8 ; 0x08 2f364: 91 85 ldd r25, Z+9 ; 0x09 2f366: a2 85 ldd r26, Z+10 ; 0x0a 2f368: b3 85 ldd r27, Z+11 ; 0x0b 2f36a: 06 97 sbiw r24, 0x06 ; 6 2f36c: a1 05 cpc r26, r1 2f36e: b1 05 cpc r27, r1 2f370: 0c f0 brlt .+2 ; 0x2f374 2f372: 1a c7 rjmp .+3636 ; 0x301a8 { block->millimeters = fabs(delta_mm[E_AXIS]); 2f374: 26 96 adiw r28, 0x06 ; 6 2f376: 8c ad ldd r24, Y+60 ; 0x3c 2f378: 9d ad ldd r25, Y+61 ; 0x3d 2f37a: ae ad ldd r26, Y+62 ; 0x3e 2f37c: bf ad ldd r27, Y+63 ; 0x3f 2f37e: 26 97 sbiw r28, 0x06 ; 6 2f380: bf 77 andi r27, 0x7F ; 127 2f382: 85 a7 std Z+45, r24 ; 0x2d 2f384: 96 a7 std Z+46, r25 ; 0x2e 2f386: a7 a7 std Z+47, r26 ; 0x2f 2f388: 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 2f38a: 8e e6 ldi r24, 0x6E ; 110 2f38c: 82 9d mul r24, r2 2f38e: f0 01 movw r30, r0 2f390: 83 9d mul r24, r3 2f392: f0 0d add r31, r0 2f394: 11 24 eor r1, r1 2f396: e8 53 subi r30, 0x38 ; 56 2f398: f9 4f sbci r31, 0xF9 ; 249 2f39a: 45 a4 ldd r4, Z+45 ; 0x2d 2f39c: 56 a4 ldd r5, Z+46 ; 0x2e 2f39e: 67 a4 ldd r6, Z+47 ; 0x2f 2f3a0: 70 a8 ldd r7, Z+48 ; 0x30 2f3a2: a3 01 movw r20, r6 2f3a4: 92 01 movw r18, r4 2f3a6: 60 e0 ldi r22, 0x00 ; 0 2f3a8: 70 e0 ldi r23, 0x00 ; 0 2f3aa: 80 e8 ldi r24, 0x80 ; 128 2f3ac: 9f e3 ldi r25, 0x3F ; 63 2f3ae: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 2f3b2: 29 ad ldd r18, Y+57 ; 0x39 2f3b4: 39 a9 ldd r19, Y+49 ; 0x31 2f3b6: 4d ad ldd r20, Y+61 ; 0x3d 2f3b8: 5d a9 ldd r21, Y+53 ; 0x35 2f3ba: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f3be: 6b 01 movw r12, r22 2f3c0: 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); 2f3c2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2f3c6: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2f3ca: 89 1b sub r24, r25 2f3cc: 8f 70 andi r24, 0x0F ; 15 2f3ce: 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)) { 2f3d0: 82 50 subi r24, 0x02 ; 2 2f3d2: 86 30 cpi r24, 0x06 ; 6 2f3d4: 08 f0 brcs .+2 ; 0x2f3d8 2f3d6: 40 c0 rjmp .+128 ; 0x2f458 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 2f3d8: a7 01 movw r20, r14 2f3da: 96 01 movw r18, r12 2f3dc: 60 e0 ldi r22, 0x00 ; 0 2f3de: 74 e2 ldi r23, 0x24 ; 36 2f3e0: 84 e7 ldi r24, 0x74 ; 116 2f3e2: 99 e4 ldi r25, 0x49 ; 73 2f3e4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f3e8: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 2f3ec: 4b 01 movw r8, r22 2f3ee: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 2f3f0: 80 91 76 04 lds r24, 0x0476 ; 0x800476 2f3f4: 90 91 77 04 lds r25, 0x0477 ; 0x800477 2f3f8: a0 91 78 04 lds r26, 0x0478 ; 0x800478 2f3fc: b0 91 79 04 lds r27, 0x0479 ; 0x800479 2f400: 88 16 cp r8, r24 2f402: 99 06 cpc r9, r25 2f404: aa 06 cpc r10, r26 2f406: bb 06 cpc r11, r27 2f408: 38 f5 brcc .+78 ; 0x2f458 // 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)); 2f40a: bc 01 movw r22, r24 2f40c: cd 01 movw r24, r26 2f40e: 68 19 sub r22, r8 2f410: 79 09 sbc r23, r9 2f412: 8a 09 sbc r24, r10 2f414: 9b 09 sbc r25, r11 2f416: 66 0f add r22, r22 2f418: 77 1f adc r23, r23 2f41a: 88 1f adc r24, r24 2f41c: 99 1f adc r25, r25 2f41e: ad ad ldd r26, Y+61 ; 0x3d 2f420: 2a 2f mov r18, r26 2f422: 30 e0 ldi r19, 0x00 ; 0 2f424: 50 e0 ldi r21, 0x00 ; 0 2f426: 40 e0 ldi r20, 0x00 ; 0 2f428: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 2f42c: ca 01 movw r24, r20 2f42e: b9 01 movw r22, r18 2f430: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2f434: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 2f438: 68 0d add r22, r8 2f43a: 79 1d adc r23, r9 2f43c: 8a 1d adc r24, r10 2f43e: 9b 1d adc r25, r11 2f440: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2f444: 9b 01 movw r18, r22 2f446: ac 01 movw r20, r24 2f448: 60 e0 ldi r22, 0x00 ; 0 2f44a: 74 e2 ldi r23, 0x24 ; 36 2f44c: 84 e7 ldi r24, 0x74 ; 116 2f44e: 99 e4 ldi r25, 0x49 ; 73 2f450: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f454: 6b 01 movw r12, r22 2f456: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 2f458: a3 01 movw r20, r6 2f45a: 92 01 movw r18, r4 2f45c: c7 01 movw r24, r14 2f45e: b6 01 movw r22, r12 2f460: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f464: 6d ab std Y+53, r22 ; 0x35 2f466: 7e ab std Y+54, r23 ; 0x36 2f468: 8f ab std Y+55, r24 ; 0x37 2f46a: 98 af std Y+56, r25 ; 0x38 2f46c: 8e e6 ldi r24, 0x6E ; 110 2f46e: 82 9d mul r24, r2 2f470: 80 01 movw r16, r0 2f472: 83 9d mul r24, r3 2f474: 10 0d add r17, r0 2f476: 11 24 eor r1, r1 2f478: 08 53 subi r16, 0x38 ; 56 2f47a: 19 4f sbci r17, 0xF9 ; 249 2f47c: 2d a9 ldd r18, Y+53 ; 0x35 2f47e: 3e a9 ldd r19, Y+54 ; 0x36 2f480: 4f a9 ldd r20, Y+55 ; 0x37 2f482: 58 ad ldd r21, Y+56 ; 0x38 2f484: d8 01 movw r26, r16 2f486: 91 96 adiw r26, 0x21 ; 33 2f488: 2d 93 st X+, r18 2f48a: 3d 93 st X+, r19 2f48c: 4d 93 st X+, r20 2f48e: 5c 93 st X, r21 2f490: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 2f492: 50 96 adiw r26, 0x10 ; 16 2f494: 6d 91 ld r22, X+ 2f496: 7d 91 ld r23, X+ 2f498: 8d 91 ld r24, X+ 2f49a: 9c 91 ld r25, X 2f49c: 53 97 sbiw r26, 0x13 ; 19 2f49e: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2f4a2: 69 af std Y+57, r22 ; 0x39 2f4a4: 7a af std Y+58, r23 ; 0x3a 2f4a6: 8b af std Y+59, r24 ; 0x3b 2f4a8: 9c af std Y+60, r25 ; 0x3c 2f4aa: 9b 01 movw r18, r22 2f4ac: ac 01 movw r20, r24 2f4ae: c7 01 movw r24, r14 2f4b0: b6 01 movw r22, r12 2f4b2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f4b6: 0f 94 83 a2 call 0x34506 ; 0x34506 2f4ba: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2f4be: 62 96 adiw r28, 0x12 ; 18 2f4c0: 6c af std Y+60, r22 ; 0x3c 2f4c2: 7d af std Y+61, r23 ; 0x3d 2f4c4: 8e af std Y+62, r24 ; 0x3e 2f4c6: 9f af std Y+63, r25 ; 0x3f 2f4c8: 62 97 sbiw r28, 0x12 ; 18 2f4ca: f8 01 movw r30, r16 2f4cc: 66 ab std Z+54, r22 ; 0x36 2f4ce: 77 ab std Z+55, r23 ; 0x37 2f4d0: 80 af std Z+56, r24 ; 0x38 2f4d2: 91 af std Z+57, r25 ; 0x39 2f4d4: 9e 01 movw r18, r28 2f4d6: 2f 5f subi r18, 0xFF ; 255 2f4d8: 3f 4f sbci r19, 0xFF ; 255 2f4da: 3a ab std Y+50, r19 ; 0x32 2f4dc: 29 ab std Y+49, r18 ; 0x31 2f4de: ae 01 movw r20, r28 2f4e0: 4f 5e subi r20, 0xEF ; 239 2f4e2: 5f 4f sbci r21, 0xFF ; 255 2f4e4: 6e 96 adiw r28, 0x1e ; 30 2f4e6: 5f af std Y+63, r21 ; 0x3f 2f4e8: 4e af std Y+62, r20 ; 0x3e 2f4ea: 6e 97 sbiw r28, 0x1e ; 30 2f4ec: 86 e4 ldi r24, 0x46 ; 70 2f4ee: 94 e0 ldi r25, 0x04 ; 4 2f4f0: 68 96 adiw r28, 0x18 ; 24 2f4f2: 9f af std Y+63, r25 ; 0x3f 2f4f4: 8e af std Y+62, r24 ; 0x3e 2f4f6: 68 97 sbiw r28, 0x18 ; 24 2f4f8: 6c 96 adiw r28, 0x1c ; 28 2f4fa: 5f af std Y+63, r21 ; 0x3f 2f4fc: 4e af std Y+62, r20 ; 0x3e 2f4fe: 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 2f500: 19 a6 std Y+41, r1 ; 0x29 2f502: 1d a6 std Y+45, r1 ; 0x2d 2f504: 00 e8 ldi r16, 0x80 ; 128 2f506: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 2f508: a9 a9 ldd r26, Y+49 ; 0x31 2f50a: ba a9 ldd r27, Y+50 ; 0x32 2f50c: 2d 91 ld r18, X+ 2f50e: 3d 91 ld r19, X+ 2f510: 4d 91 ld r20, X+ 2f512: 5d 91 ld r21, X+ 2f514: ba ab std Y+50, r27 ; 0x32 2f516: a9 ab std Y+49, r26 ; 0x31 2f518: c7 01 movw r24, r14 2f51a: b6 01 movw r22, r12 2f51c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f520: 6c 96 adiw r28, 0x1c ; 28 2f522: ee ad ldd r30, Y+62 ; 0x3e 2f524: ff ad ldd r31, Y+63 ; 0x3f 2f526: 6c 97 sbiw r28, 0x1c ; 28 2f528: 61 93 st Z+, r22 2f52a: 71 93 st Z+, r23 2f52c: 81 93 st Z+, r24 2f52e: 91 93 st Z+, r25 2f530: 6c 96 adiw r28, 0x1c ; 28 2f532: ff af std Y+63, r31 ; 0x3f 2f534: ee af std Y+62, r30 ; 0x3e 2f536: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 2f538: 4b 01 movw r8, r22 2f53a: 5c 01 movw r10, r24 2f53c: e8 94 clt 2f53e: b7 f8 bld r11, 7 2f540: 68 96 adiw r28, 0x18 ; 24 2f542: ae ad ldd r26, Y+62 ; 0x3e 2f544: bf ad ldd r27, Y+63 ; 0x3f 2f546: 68 97 sbiw r28, 0x18 ; 24 2f548: 2d 91 ld r18, X+ 2f54a: 3d 91 ld r19, X+ 2f54c: 4d 91 ld r20, X+ 2f54e: 5d 91 ld r21, X+ 2f550: 68 96 adiw r28, 0x18 ; 24 2f552: bf af std Y+63, r27 ; 0x3f 2f554: ae af std Y+62, r26 ; 0x3e 2f556: 68 97 sbiw r28, 0x18 ; 24 2f558: 66 96 adiw r28, 0x16 ; 22 2f55a: 2c af std Y+60, r18 ; 0x3c 2f55c: 3d af std Y+61, r19 ; 0x3d 2f55e: 4e af std Y+62, r20 ; 0x3e 2f560: 5f af std Y+63, r21 ; 0x3f 2f562: 66 97 sbiw r28, 0x16 ; 22 2f564: c5 01 movw r24, r10 2f566: b4 01 movw r22, r8 2f568: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2f56c: 18 16 cp r1, r24 2f56e: b4 f4 brge .+44 ; 0x2f59c { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 2f570: a5 01 movw r20, r10 2f572: 94 01 movw r18, r8 2f574: 66 96 adiw r28, 0x16 ; 22 2f576: 6c ad ldd r22, Y+60 ; 0x3c 2f578: 7d ad ldd r23, Y+61 ; 0x3d 2f57a: 8e ad ldd r24, Y+62 ; 0x3e 2f57c: 9f ad ldd r25, Y+63 ; 0x3f 2f57e: 66 97 sbiw r28, 0x16 ; 22 2f580: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f584: 4b 01 movw r8, r22 2f586: 5c 01 movw r10, r24 2f588: 29 a5 ldd r18, Y+41 ; 0x29 2f58a: 3d a5 ldd r19, Y+45 ; 0x2d 2f58c: a8 01 movw r20, r16 2f58e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2f592: 18 16 cp r1, r24 2f594: 1c f0 brlt .+6 ; 0x2f59c 2f596: 89 a6 std Y+41, r8 ; 0x29 2f598: 9d a6 std Y+45, r9 ; 0x2d 2f59a: 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++) 2f59c: 6e 96 adiw r28, 0x1e ; 30 2f59e: ee ad ldd r30, Y+62 ; 0x3e 2f5a0: ff ad ldd r31, Y+63 ; 0x3f 2f5a2: 6e 97 sbiw r28, 0x1e ; 30 2f5a4: 29 a9 ldd r18, Y+49 ; 0x31 2f5a6: 3a a9 ldd r19, Y+50 ; 0x32 2f5a8: e2 17 cp r30, r18 2f5aa: f3 07 cpc r31, r19 2f5ac: 09 f0 breq .+2 ; 0x2f5b0 2f5ae: ac cf rjmp .-168 ; 0x2f508 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 2f5b0: 20 e0 ldi r18, 0x00 ; 0 2f5b2: 30 e0 ldi r19, 0x00 ; 0 2f5b4: 40 e8 ldi r20, 0x80 ; 128 2f5b6: 5f e3 ldi r21, 0x3F ; 63 2f5b8: 69 a5 ldd r22, Y+41 ; 0x29 2f5ba: 7d a5 ldd r23, Y+45 ; 0x2d 2f5bc: c8 01 movw r24, r16 2f5be: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2f5c2: 87 ff sbrs r24, 7 2f5c4: 50 c0 rjmp .+160 ; 0x2f666 2f5c6: 6e 96 adiw r28, 0x1e ; 30 2f5c8: ae ac ldd r10, Y+62 ; 0x3e 2f5ca: bf ac ldd r11, Y+63 ; 0x3f 2f5cc: 6e 97 sbiw r28, 0x1e ; 30 2f5ce: 30 e1 ldi r19, 0x10 ; 16 2f5d0: a3 0e add r10, r19 2f5d2: b1 1c adc r11, r1 2f5d4: 6e 96 adiw r28, 0x1e ; 30 2f5d6: ce ac ldd r12, Y+62 ; 0x3e 2f5d8: df ac ldd r13, Y+63 ; 0x3f 2f5da: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 2f5dc: d6 01 movw r26, r12 2f5de: 6d 91 ld r22, X+ 2f5e0: 7d 91 ld r23, X+ 2f5e2: 8d 91 ld r24, X+ 2f5e4: 9d 91 ld r25, X+ 2f5e6: 6d 01 movw r12, r26 2f5e8: 7d 01 movw r14, r26 2f5ea: b4 e0 ldi r27, 0x04 ; 4 2f5ec: eb 1a sub r14, r27 2f5ee: f1 08 sbc r15, r1 2f5f0: 29 a5 ldd r18, Y+41 ; 0x29 2f5f2: 3d a5 ldd r19, Y+45 ; 0x2d 2f5f4: a8 01 movw r20, r16 2f5f6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f5fa: f7 01 movw r30, r14 2f5fc: 60 83 st Z, r22 2f5fe: 71 83 std Z+1, r23 ; 0x01 2f600: 82 83 std Z+2, r24 ; 0x02 2f602: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 2f604: ac 14 cp r10, r12 2f606: bd 04 cpc r11, r13 2f608: 49 f7 brne .-46 ; 0x2f5dc { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 2f60a: 2e e6 ldi r18, 0x6E ; 110 2f60c: 22 9d mul r18, r2 2f60e: c0 01 movw r24, r0 2f610: 23 9d mul r18, r3 2f612: 90 0d add r25, r0 2f614: 11 24 eor r1, r1 2f616: 9c 01 movw r18, r24 2f618: 28 53 subi r18, 0x38 ; 56 2f61a: 39 4f sbci r19, 0xF9 ; 249 2f61c: 79 01 movw r14, r18 2f61e: 29 a5 ldd r18, Y+41 ; 0x29 2f620: 3d a5 ldd r19, Y+45 ; 0x2d 2f622: a8 01 movw r20, r16 2f624: 6d a9 ldd r22, Y+53 ; 0x35 2f626: 7e a9 ldd r23, Y+54 ; 0x36 2f628: 8f a9 ldd r24, Y+55 ; 0x37 2f62a: 98 ad ldd r25, Y+56 ; 0x38 2f62c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f630: d7 01 movw r26, r14 2f632: 91 96 adiw r26, 0x21 ; 33 2f634: 6d 93 st X+, r22 2f636: 7d 93 st X+, r23 2f638: 8d 93 st X+, r24 2f63a: 9c 93 st X, r25 2f63c: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 2f63e: 62 96 adiw r28, 0x12 ; 18 2f640: 6c ad ldd r22, Y+60 ; 0x3c 2f642: 7d ad ldd r23, Y+61 ; 0x3d 2f644: 8e ad ldd r24, Y+62 ; 0x3e 2f646: 9f ad ldd r25, Y+63 ; 0x3f 2f648: 62 97 sbiw r28, 0x12 ; 18 2f64a: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2f64e: 29 a5 ldd r18, Y+41 ; 0x29 2f650: 3d a5 ldd r19, Y+45 ; 0x2d 2f652: a8 01 movw r20, r16 2f654: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f658: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2f65c: f7 01 movw r30, r14 2f65e: 66 ab std Z+54, r22 ; 0x36 2f660: 77 ab std Z+55, r23 ; 0x37 2f662: 80 af std Z+56, r24 ; 0x38 2f664: 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; 2f666: a3 01 movw r20, r6 2f668: 92 01 movw r18, r4 2f66a: 69 ad ldd r22, Y+57 ; 0x39 2f66c: 7a ad ldd r23, Y+58 ; 0x3a 2f66e: 8b ad ldd r24, Y+59 ; 0x3b 2f670: 9c ad ldd r25, Y+60 ; 0x3c 2f672: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f676: 69 a7 std Y+41, r22 ; 0x29 2f678: 7a a7 std Y+42, r23 ; 0x2a 2f67a: 8b a7 std Y+43, r24 ; 0x2b 2f67c: 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) 2f67e: 2e 96 adiw r28, 0x0e ; 14 2f680: 2c ad ldd r18, Y+60 ; 0x3c 2f682: 3d ad ldd r19, Y+61 ; 0x3d 2f684: 4e ad ldd r20, Y+62 ; 0x3e 2f686: 5f ad ldd r21, Y+63 ; 0x3f 2f688: 2e 97 sbiw r28, 0x0e ; 14 2f68a: 23 2b or r18, r19 2f68c: 24 2b or r18, r20 2f68e: 25 2b or r18, r21 2f690: 09 f0 breq .+2 ; 0x2f694 2f692: b9 c5 rjmp .+2930 ; 0x30206 2f694: 8e e6 ldi r24, 0x6E ; 110 2f696: 82 9d mul r24, r2 2f698: 80 01 movw r16, r0 2f69a: 83 9d mul r24, r3 2f69c: 10 0d add r17, r0 2f69e: 11 24 eor r1, r1 2f6a0: 08 53 subi r16, 0x38 ; 56 2f6a2: 19 4f sbci r17, 0xF9 ; 249 2f6a4: f8 01 movw r30, r16 2f6a6: 84 81 ldd r24, Z+4 ; 0x04 2f6a8: 95 81 ldd r25, Z+5 ; 0x05 2f6aa: a6 81 ldd r26, Z+6 ; 0x06 2f6ac: b7 81 ldd r27, Z+7 ; 0x07 2f6ae: 89 2b or r24, r25 2f6b0: 8a 2b or r24, r26 2f6b2: 8b 2b or r24, r27 2f6b4: 09 f0 breq .+2 ; 0x2f6b8 2f6b6: a7 c5 rjmp .+2894 ; 0x30206 2f6b8: 80 85 ldd r24, Z+8 ; 0x08 2f6ba: 91 85 ldd r25, Z+9 ; 0x09 2f6bc: a2 85 ldd r26, Z+10 ; 0x0a 2f6be: b3 85 ldd r27, Z+11 ; 0x0b 2f6c0: 89 2b or r24, r25 2f6c2: 8a 2b or r24, r26 2f6c4: 8b 2b or r24, r27 2f6c6: 09 f0 breq .+2 ; 0x2f6ca 2f6c8: 9e c5 rjmp .+2876 ; 0x30206 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 2f6ca: 20 91 6a 04 lds r18, 0x046A ; 0x80046a 2f6ce: 30 91 6b 04 lds r19, 0x046B ; 0x80046b 2f6d2: 40 91 6c 04 lds r20, 0x046C ; 0x80046c 2f6d6: 50 91 6d 04 lds r21, 0x046D ; 0x80046d 2f6da: 69 a5 ldd r22, Y+41 ; 0x29 2f6dc: 7a a5 ldd r23, Y+42 ; 0x2a 2f6de: 8b a5 ldd r24, Y+43 ; 0x2b 2f6e0: 9c a5 ldd r25, Y+44 ; 0x2c 2f6e2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f6e6: 0f 94 83 a2 call 0x34506 ; 0x34506 2f6ea: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2f6ee: 2b 01 movw r4, r22 2f6f0: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 2f6f2: f8 01 movw r30, r16 2f6f4: e4 5b subi r30, 0xB4 ; 180 2f6f6: ff 4f sbci r31, 0xFF ; 255 2f6f8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 2f6fa: 6a 96 adiw r28, 0x1a ; 26 2f6fc: 1c ae std Y+60, r1 ; 0x3c 2f6fe: 1d ae std Y+61, r1 ; 0x3d 2f700: 1e ae std Y+62, r1 ; 0x3e 2f702: 1f ae std Y+63, r1 ; 0x3f 2f704: 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; 2f706: 8e e6 ldi r24, 0x6E ; 110 2f708: 82 9d mul r24, r2 2f70a: 80 01 movw r16, r0 2f70c: 83 9d mul r24, r3 2f70e: 10 0d add r17, r0 2f710: 11 24 eor r1, r1 2f712: 08 53 subi r16, 0x38 ; 56 2f714: 19 4f sbci r17, 0xF9 ; 249 2f716: f8 01 movw r30, r16 2f718: ee 5b subi r30, 0xBE ; 190 2f71a: ff 4f sbci r31, 0xFF ; 255 2f71c: 40 82 st Z, r4 2f71e: 51 82 std Z+1, r5 ; 0x01 2f720: 62 82 std Z+2, r6 ; 0x02 2f722: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 2f724: c3 01 movw r24, r6 2f726: b2 01 movw r22, r4 2f728: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2f72c: 6b 01 movw r12, r22 2f72e: 7c 01 movw r14, r24 2f730: 29 a5 ldd r18, Y+41 ; 0x29 2f732: 3a a5 ldd r19, Y+42 ; 0x2a 2f734: 4b a5 ldd r20, Y+43 ; 0x2b 2f736: 5c a5 ldd r21, Y+44 ; 0x2c 2f738: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f73c: e1 96 adiw r28, 0x31 ; 49 2f73e: 6c af std Y+60, r22 ; 0x3c 2f740: 7d af std Y+61, r23 ; 0x3d 2f742: 8e af std Y+62, r24 ; 0x3e 2f744: 9f af std Y+63, r25 ; 0x3f 2f746: e1 97 sbiw r28, 0x31 ; 49 2f748: f8 01 movw r30, r16 2f74a: 61 ab std Z+49, r22 ; 0x31 2f74c: 72 ab std Z+50, r23 ; 0x32 2f74e: 83 ab std Z+51, r24 ; 0x33 2f750: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 2f752: 2d eb ldi r18, 0xBD ; 189 2f754: 37 e3 ldi r19, 0x37 ; 55 2f756: 46 e0 ldi r20, 0x06 ; 6 2f758: 51 e4 ldi r21, 0x41 ; 65 2f75a: c7 01 movw r24, r14 2f75c: b6 01 movw r22, r12 2f75e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f762: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2f766: d8 01 movw r26, r16 2f768: 54 96 adiw r26, 0x14 ; 20 2f76a: 6d 93 st X+, r22 2f76c: 7d 93 st X+, r23 2f76e: 8d 93 st X+, r24 2f770: 9c 93 st X, r25 2f772: 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; 2f774: 91 96 adiw r26, 0x21 ; 33 2f776: bc 91 ld r27, X 2f778: 27 96 adiw r28, 0x07 ; 7 2f77a: bf af std Y+63, r27 ; 0x3f 2f77c: 27 97 sbiw r28, 0x07 ; 7 2f77e: f8 01 movw r30, r16 2f780: f2 a1 ldd r31, Z+34 ; 0x22 2f782: 2b 96 adiw r28, 0x0b ; 11 2f784: ff af std Y+63, r31 ; 0x3f 2f786: 2b 97 sbiw r28, 0x0b ; 11 2f788: d8 01 movw r26, r16 2f78a: 93 96 adiw r26, 0x23 ; 35 2f78c: bc 91 ld r27, X 2f78e: 2f 96 adiw r28, 0x0f ; 15 2f790: bf af std Y+63, r27 ; 0x3f 2f792: 2f 97 sbiw r28, 0x0f ; 15 2f794: f8 01 movw r30, r16 2f796: f4 a1 ldd r31, Z+36 ; 0x24 2f798: 63 96 adiw r28, 0x13 ; 19 2f79a: ff af std Y+63, r31 ; 0x3f 2f79c: 63 97 sbiw r28, 0x13 ; 19 2f79e: 2a e7 ldi r18, 0x7A ; 122 2f7a0: 34 e0 ldi r19, 0x04 ; 4 2f7a2: ed 96 adiw r28, 0x3d ; 61 2f7a4: 3f af std Y+63, r19 ; 0x3f 2f7a6: 2e af std Y+62, r18 ; 0x3e 2f7a8: ed 97 sbiw r28, 0x3d ; 61 2f7aa: 6e 96 adiw r28, 0x1e ; 30 2f7ac: 4e ac ldd r4, Y+62 ; 0x3e 2f7ae: 5f ac ldd r5, Y+63 ; 0x3f 2f7b0: 6e 97 sbiw r28, 0x1e ; 30 2f7b2: 30 e1 ldi r19, 0x10 ; 16 2f7b4: 43 0e add r4, r19 2f7b6: 51 1c adc r5, r1 2f7b8: 0a e7 ldi r16, 0x7A ; 122 2f7ba: 14 e0 ldi r17, 0x04 ; 4 2f7bc: 6e 96 adiw r28, 0x1e ; 30 2f7be: 6e ac ldd r6, Y+62 ; 0x3e 2f7c0: 7f ac ldd r7, Y+63 ; 0x3f 2f7c2: 6e 97 sbiw r28, 0x1e ; 30 2f7c4: 27 96 adiw r28, 0x07 ; 7 2f7c6: 4f ad ldd r20, Y+63 ; 0x3f 2f7c8: 27 97 sbiw r28, 0x07 ; 7 2f7ca: 49 a7 std Y+41, r20 ; 0x29 2f7cc: 2b 96 adiw r28, 0x0b ; 11 2f7ce: 5f ad ldd r21, Y+63 ; 0x3f 2f7d0: 2b 97 sbiw r28, 0x0b ; 11 2f7d2: 5d a7 std Y+45, r21 ; 0x2d 2f7d4: b9 af std Y+57, r27 ; 0x39 2f7d6: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 2f7d8: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 2f7da: d3 01 movw r26, r6 2f7dc: 8d 90 ld r8, X+ 2f7de: 9d 90 ld r9, X+ 2f7e0: ad 90 ld r10, X+ 2f7e2: bd 90 ld r11, X+ 2f7e4: 3d 01 movw r6, r26 2f7e6: e8 94 clt 2f7e8: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 2f7ea: f8 01 movw r30, r16 2f7ec: c1 90 ld r12, Z+ 2f7ee: d1 90 ld r13, Z+ 2f7f0: e1 90 ld r14, Z+ 2f7f2: f1 90 ld r15, Z+ 2f7f4: 8f 01 movw r16, r30 2f7f6: a5 01 movw r20, r10 2f7f8: 94 01 movw r18, r8 2f7fa: c7 01 movw r24, r14 2f7fc: b6 01 movw r22, r12 2f7fe: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2f802: 87 ff sbrs r24, 7 2f804: 3a c0 rjmp .+116 ; 0x2f87a // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 2f806: fd a9 ldd r31, Y+53 ; 0x35 2f808: ff 23 and r31, r31 2f80a: 09 f4 brne .+2 ; 0x2f80e 2f80c: 7e c6 rjmp .+3324 ; 0x3050a // 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; 2f80e: 29 a5 ldd r18, Y+41 ; 0x29 2f810: 3d a5 ldd r19, Y+45 ; 0x2d 2f812: 49 ad ldd r20, Y+57 ; 0x39 2f814: 59 a9 ldd r21, Y+49 ; 0x31 2f816: c5 01 movw r24, r10 2f818: b4 01 movw r22, r8 2f81a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f81e: 4b 01 movw r8, r22 2f820: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 2f822: a7 01 movw r20, r14 2f824: 96 01 movw r18, r12 2f826: 27 96 adiw r28, 0x07 ; 7 2f828: 6f ad ldd r22, Y+63 ; 0x3f 2f82a: 27 97 sbiw r28, 0x07 ; 7 2f82c: 2b 96 adiw r28, 0x0b ; 11 2f82e: 7f ad ldd r23, Y+63 ; 0x3f 2f830: 2b 97 sbiw r28, 0x0b ; 11 2f832: 2f 96 adiw r28, 0x0f ; 15 2f834: 8f ad ldd r24, Y+63 ; 0x3f 2f836: 2f 97 sbiw r28, 0x0f ; 15 2f838: 63 96 adiw r28, 0x13 ; 19 2f83a: 9f ad ldd r25, Y+63 ; 0x3f 2f83c: 63 97 sbiw r28, 0x13 ; 19 2f83e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f842: 6b 01 movw r12, r22 2f844: 7c 01 movw r14, r24 if (jerk > mjerk) { 2f846: ac 01 movw r20, r24 2f848: 9b 01 movw r18, r22 2f84a: c5 01 movw r24, r10 2f84c: b4 01 movw r22, r8 2f84e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2f852: 18 16 cp r1, r24 2f854: 94 f4 brge .+36 ; 0x2f87a safe_speed *= mjerk / jerk; 2f856: a5 01 movw r20, r10 2f858: 94 01 movw r18, r8 2f85a: c7 01 movw r24, r14 2f85c: b6 01 movw r22, r12 2f85e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f862: 9b 01 movw r18, r22 2f864: ac 01 movw r20, r24 2f866: 69 a5 ldd r22, Y+41 ; 0x29 2f868: 7d a5 ldd r23, Y+45 ; 0x2d 2f86a: 89 ad ldd r24, Y+57 ; 0x39 2f86c: 99 a9 ldd r25, Y+49 ; 0x31 2f86e: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f872: 69 a7 std Y+41, r22 ; 0x29 2f874: 7d a7 std Y+45, r23 ; 0x2d 2f876: 89 af std Y+57, r24 ; 0x39 2f878: 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) { 2f87a: 46 14 cp r4, r6 2f87c: 57 04 cpc r5, r7 2f87e: 09 f0 breq .+2 ; 0x2f882 2f880: ac cf rjmp .-168 ; 0x2f7da } } } // Reset the block flag. block->flag = 0; 2f882: 8e e6 ldi r24, 0x6E ; 110 2f884: 82 9d mul r24, r2 2f886: f0 01 movw r30, r0 2f888: 83 9d mul r24, r3 2f88a: f0 0d add r31, r0 2f88c: 11 24 eor r1, r1 2f88e: e8 53 subi r30, 0x38 ; 56 2f890: f9 4f sbci r31, 0xF9 ; 249 2f892: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 2f894: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> 2f898: 88 23 and r24, r24 2f89a: 21 f0 breq .+8 ; 0x2f8a4 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 2f89c: 80 e1 ldi r24, 0x10 ; 16 2f89e: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 2f8a0: 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) { 2f8a4: 3d ad ldd r19, Y+61 ; 0x3d 2f8a6: 32 30 cpi r19, 0x02 ; 2 2f8a8: 08 f4 brcc .+2 ; 0x2f8ac 2f8aa: 8f c6 rjmp .+3358 ; 0x305ca 2f8ac: 40 91 f0 03 lds r20, 0x03F0 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 2f8b0: 6b 96 adiw r28, 0x1b ; 27 2f8b2: 4f af std Y+63, r20 ; 0x3f 2f8b4: 6b 97 sbiw r28, 0x1b ; 27 2f8b6: 50 91 f1 03 lds r21, 0x03F1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 2f8ba: 6f 96 adiw r28, 0x1f ; 31 2f8bc: 5f af std Y+63, r21 ; 0x3f 2f8be: 6f 97 sbiw r28, 0x1f ; 31 2f8c0: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 2f8c4: 10 91 f3 03 lds r17, 0x03F3 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> 2f8c8: 27 e1 ldi r18, 0x17 ; 23 2f8ca: 37 eb ldi r19, 0xB7 ; 183 2f8cc: 41 ed ldi r20, 0xD1 ; 209 2f8ce: 58 e3 ldi r21, 0x38 ; 56 2f8d0: 6b 96 adiw r28, 0x1b ; 27 2f8d2: 6f ad ldd r22, Y+63 ; 0x3f 2f8d4: 6b 97 sbiw r28, 0x1b ; 27 2f8d6: 6f 96 adiw r28, 0x1f ; 31 2f8d8: 7f ad ldd r23, Y+63 ; 0x3f 2f8da: 6f 97 sbiw r28, 0x1f ; 31 2f8dc: c8 01 movw r24, r16 2f8de: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2f8e2: 18 16 cp r1, r24 2f8e4: 0c f0 brlt .+2 ; 0x2f8e8 2f8e6: 71 c6 rjmp .+3298 ; 0x305ca // 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); 2f8e8: 6b 96 adiw r28, 0x1b ; 27 2f8ea: 2f ad ldd r18, Y+63 ; 0x3f 2f8ec: 6b 97 sbiw r28, 0x1b ; 27 2f8ee: 6f 96 adiw r28, 0x1f ; 31 2f8f0: 3f ad ldd r19, Y+63 ; 0x3f 2f8f2: 6f 97 sbiw r28, 0x1f ; 31 2f8f4: a8 01 movw r20, r16 2f8f6: 27 96 adiw r28, 0x07 ; 7 2f8f8: 6f ad ldd r22, Y+63 ; 0x3f 2f8fa: 27 97 sbiw r28, 0x07 ; 7 2f8fc: 2b 96 adiw r28, 0x0b ; 11 2f8fe: 7f ad ldd r23, Y+63 ; 0x3f 2f900: 2b 97 sbiw r28, 0x0b ; 11 2f902: 2f 96 adiw r28, 0x0f ; 15 2f904: 8f ad ldd r24, Y+63 ; 0x3f 2f906: 2f 97 sbiw r28, 0x0f ; 15 2f908: 63 96 adiw r28, 0x13 ; 19 2f90a: 9f ad ldd r25, Y+63 ; 0x3f 2f90c: 63 97 sbiw r28, 0x13 ; 19 2f90e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2f912: 87 ff sbrs r24, 7 2f914: 01 c6 rjmp .+3074 ; 0x30518 2f916: 6b 96 adiw r28, 0x1b ; 27 2f918: 2f ad ldd r18, Y+63 ; 0x3f 2f91a: 6b 97 sbiw r28, 0x1b ; 27 2f91c: 6f 96 adiw r28, 0x1f ; 31 2f91e: 3f ad ldd r19, Y+63 ; 0x3f 2f920: 6f 97 sbiw r28, 0x1f ; 31 2f922: a8 01 movw r20, r16 2f924: 27 96 adiw r28, 0x07 ; 7 2f926: 6f ad ldd r22, Y+63 ; 0x3f 2f928: 27 97 sbiw r28, 0x07 ; 7 2f92a: 2b 96 adiw r28, 0x0b ; 11 2f92c: 7f ad ldd r23, Y+63 ; 0x3f 2f92e: 2b 97 sbiw r28, 0x0b ; 11 2f930: 2f 96 adiw r28, 0x0f ; 15 2f932: 8f ad ldd r24, Y+63 ; 0x3f 2f934: 2f 97 sbiw r28, 0x0f ; 15 2f936: 63 96 adiw r28, 0x13 ; 19 2f938: 9f ad ldd r25, Y+63 ; 0x3f 2f93a: 63 97 sbiw r28, 0x13 ; 19 2f93c: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2f940: eb 96 adiw r28, 0x3b ; 59 2f942: 6c af std Y+60, r22 ; 0x3c 2f944: 7d af std Y+61, r23 ; 0x3d 2f946: 8e af std Y+62, r24 ; 0x3e 2f948: 9f af std Y+63, r25 ; 0x3f 2f94a: 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; 2f94c: 27 96 adiw r28, 0x07 ; 7 2f94e: 8f ad ldd r24, Y+63 ; 0x3f 2f950: 27 97 sbiw r28, 0x07 ; 7 2f952: 8d af std Y+61, r24 ; 0x3d 2f954: 2b 96 adiw r28, 0x0b ; 11 2f956: 9f ad ldd r25, Y+63 ; 0x3f 2f958: 2b 97 sbiw r28, 0x0b ; 11 2f95a: 9d ab std Y+53, r25 ; 0x35 2f95c: 2f 96 adiw r28, 0x0f ; 15 2f95e: af ad ldd r26, Y+63 ; 0x3f 2f960: 2f 97 sbiw r28, 0x0f ; 15 2f962: ae af std Y+62, r26 ; 0x3e 2f964: 63 96 adiw r28, 0x13 ; 19 2f966: bf ad ldd r27, Y+63 ; 0x3f 2f968: 63 97 sbiw r28, 0x13 ; 19 2f96a: 23 96 adiw r28, 0x03 ; 3 2f96c: bf af std Y+63, r27 ; 0x3f 2f96e: 23 97 sbiw r28, 0x03 ; 3 2f970: 24 ef ldi r18, 0xF4 ; 244 2f972: 33 e0 ldi r19, 0x03 ; 3 2f974: e7 96 adiw r28, 0x37 ; 55 2f976: 3f af std Y+63, r19 ; 0x3f 2f978: 2e af std Y+62, r18 ; 0x3e 2f97a: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 2f97c: 41 2c mov r4, r1 2f97e: 51 2c mov r5, r1 2f980: 30 e8 ldi r19, 0x80 ; 128 2f982: 63 2e mov r6, r19 2f984: 3f e3 ldi r19, 0x3F ; 63 2f986: 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]; 2f988: e7 96 adiw r28, 0x37 ; 55 2f98a: ae ad ldd r26, Y+62 ; 0x3e 2f98c: bf ad ldd r27, Y+63 ; 0x3f 2f98e: e7 97 sbiw r28, 0x37 ; 55 2f990: 8d 90 ld r8, X+ 2f992: 9d 90 ld r9, X+ 2f994: ad 90 ld r10, X+ 2f996: bd 90 ld r11, X+ 2f998: e7 96 adiw r28, 0x37 ; 55 2f99a: bf af std Y+63, r27 ; 0x3f 2f99c: ae af std Y+62, r26 ; 0x3e 2f99e: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 2f9a0: 6e 96 adiw r28, 0x1e ; 30 2f9a2: ee ad ldd r30, Y+62 ; 0x3e 2f9a4: ff ad ldd r31, Y+63 ; 0x3f 2f9a6: 6e 97 sbiw r28, 0x1e ; 30 2f9a8: c1 90 ld r12, Z+ 2f9aa: d1 90 ld r13, Z+ 2f9ac: e1 90 ld r14, Z+ 2f9ae: f1 90 ld r15, Z+ 2f9b0: 6e 96 adiw r28, 0x1e ; 30 2f9b2: ff af std Y+63, r31 ; 0x3f 2f9b4: ee af std Y+62, r30 ; 0x3e 2f9b6: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 2f9b8: 6b 96 adiw r28, 0x1b ; 27 2f9ba: 2f ad ldd r18, Y+63 ; 0x3f 2f9bc: 6b 97 sbiw r28, 0x1b ; 27 2f9be: 6f 96 adiw r28, 0x1f ; 31 2f9c0: 3f ad ldd r19, Y+63 ; 0x3f 2f9c2: 6f 97 sbiw r28, 0x1f ; 31 2f9c4: a8 01 movw r20, r16 2f9c6: 27 96 adiw r28, 0x07 ; 7 2f9c8: 6f ad ldd r22, Y+63 ; 0x3f 2f9ca: 27 97 sbiw r28, 0x07 ; 7 2f9cc: 2b 96 adiw r28, 0x0b ; 11 2f9ce: 7f ad ldd r23, Y+63 ; 0x3f 2f9d0: 2b 97 sbiw r28, 0x0b ; 11 2f9d2: 2f 96 adiw r28, 0x0f ; 15 2f9d4: 8f ad ldd r24, Y+63 ; 0x3f 2f9d6: 2f 97 sbiw r28, 0x0f ; 15 2f9d8: 63 96 adiw r28, 0x13 ; 19 2f9da: 9f ad ldd r25, Y+63 ; 0x3f 2f9dc: 63 97 sbiw r28, 0x13 ; 19 2f9de: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2f9e2: 87 ff sbrs r24, 7 2f9e4: 0c c0 rjmp .+24 ; 0x2f9fe v_exit *= smaller_speed_factor; 2f9e6: eb 96 adiw r28, 0x3b ; 59 2f9e8: 2c ad ldd r18, Y+60 ; 0x3c 2f9ea: 3d ad ldd r19, Y+61 ; 0x3d 2f9ec: 4e ad ldd r20, Y+62 ; 0x3e 2f9ee: 5f ad ldd r21, Y+63 ; 0x3f 2f9f0: eb 97 sbiw r28, 0x3b ; 59 2f9f2: c5 01 movw r24, r10 2f9f4: b4 01 movw r22, r8 2f9f6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2f9fa: 4b 01 movw r8, r22 2f9fc: 5c 01 movw r10, r24 if (limited) { 2f9fe: a1 96 adiw r28, 0x21 ; 33 2fa00: ff ad ldd r31, Y+63 ; 0x3f 2fa02: a1 97 sbiw r28, 0x21 ; 33 2fa04: ff 23 and r31, r31 2fa06: 81 f0 breq .+32 ; 0x2fa28 v_exit *= v_factor; 2fa08: a3 01 movw r20, r6 2fa0a: 92 01 movw r18, r4 2fa0c: c5 01 movw r24, r10 2fa0e: b4 01 movw r22, r8 2fa10: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fa14: 4b 01 movw r8, r22 2fa16: 5c 01 movw r10, r24 v_entry *= v_factor; 2fa18: a3 01 movw r20, r6 2fa1a: 92 01 movw r18, r4 2fa1c: c7 01 movw r24, r14 2fa1e: b6 01 movw r22, r12 2fa20: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fa24: 6b 01 movw r12, r22 2fa26: 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) ? 2fa28: a7 01 movw r20, r14 2fa2a: 96 01 movw r18, r12 2fa2c: c5 01 movw r24, r10 2fa2e: b4 01 movw r22, r8 2fa30: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 2fa34: 20 e0 ldi r18, 0x00 ; 0 2fa36: 30 e0 ldi r19, 0x00 ; 0 2fa38: 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) ? 2fa3a: 18 16 cp r1, r24 2fa3c: 0c f0 brlt .+2 ; 0x2fa40 2fa3e: a3 c5 rjmp .+2886 ; 0x30586 ((v_entry > 0.f || v_exit < 0.f) ? 2fa40: c7 01 movw r24, r14 2fa42: b6 01 movw r22, r12 2fa44: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fa48: 18 16 cp r1, r24 2fa4a: 4c f0 brlt .+18 ; 0x2fa5e 2fa4c: 20 e0 ldi r18, 0x00 ; 0 2fa4e: 30 e0 ldi r19, 0x00 ; 0 2fa50: a9 01 movw r20, r18 2fa52: c5 01 movw r24, r10 2fa54: b4 01 movw r22, r8 2fa56: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2fa5a: 87 ff sbrs r24, 7 2fa5c: 85 c5 rjmp .+2826 ; 0x30568 2fa5e: a7 01 movw r20, r14 2fa60: 96 01 movw r18, r12 2fa62: c5 01 movw r24, r10 2fa64: 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) ? 2fa66: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2fa6a: 6b 01 movw r12, r22 2fa6c: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 2fa6e: ed 96 adiw r28, 0x3d ; 61 2fa70: ae ad ldd r26, Y+62 ; 0x3e 2fa72: bf ad ldd r27, Y+63 ; 0x3f 2fa74: ed 97 sbiw r28, 0x3d ; 61 2fa76: 8d 90 ld r8, X+ 2fa78: 9d 90 ld r9, X+ 2fa7a: ad 90 ld r10, X+ 2fa7c: bd 90 ld r11, X+ 2fa7e: ed 96 adiw r28, 0x3d ; 61 2fa80: bf af std Y+63, r27 ; 0x3f 2fa82: ae af std Y+62, r26 ; 0x3e 2fa84: ed 97 sbiw r28, 0x3d ; 61 2fa86: a5 01 movw r20, r10 2fa88: 94 01 movw r18, r8 2fa8a: c7 01 movw r24, r14 2fa8c: b6 01 movw r22, r12 2fa8e: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fa92: 18 16 cp r1, r24 2fa94: 94 f4 brge .+36 ; 0x2faba v_factor *= cs.max_jerk[axis] / jerk; 2fa96: a7 01 movw r20, r14 2fa98: 96 01 movw r18, r12 2fa9a: c5 01 movw r24, r10 2fa9c: b4 01 movw r22, r8 2fa9e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2faa2: 9b 01 movw r18, r22 2faa4: ac 01 movw r20, r24 2faa6: c3 01 movw r24, r6 2faa8: b2 01 movw r22, r4 2faaa: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2faae: 2b 01 movw r4, r22 2fab0: 3c 01 movw r6, r24 limited = true; 2fab2: b1 e0 ldi r27, 0x01 ; 1 2fab4: a1 96 adiw r28, 0x21 ; 33 2fab6: bf af std Y+63, r27 ; 0x3f 2fab8: 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) { 2faba: e4 e0 ldi r30, 0x04 ; 4 2fabc: f4 e0 ldi r31, 0x04 ; 4 2fabe: e7 96 adiw r28, 0x37 ; 55 2fac0: 2e ad ldd r18, Y+62 ; 0x3e 2fac2: 3f ad ldd r19, Y+63 ; 0x3f 2fac4: e7 97 sbiw r28, 0x37 ; 55 2fac6: e2 17 cp r30, r18 2fac8: f3 07 cpc r31, r19 2faca: 09 f0 breq .+2 ; 0x2face 2facc: 5d cf rjmp .-326 ; 0x2f988 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 2face: a1 96 adiw r28, 0x21 ; 33 2fad0: 3f ad ldd r19, Y+63 ; 0x3f 2fad2: a1 97 sbiw r28, 0x21 ; 33 2fad4: 33 23 and r19, r19 2fad6: 81 f0 breq .+32 ; 0x2faf8 vmax_junction *= v_factor; 2fad8: a3 01 movw r20, r6 2fada: 92 01 movw r18, r4 2fadc: 6d ad ldd r22, Y+61 ; 0x3d 2fade: 7d a9 ldd r23, Y+53 ; 0x35 2fae0: 8e ad ldd r24, Y+62 ; 0x3e 2fae2: 23 96 adiw r28, 0x03 ; 3 2fae4: 9f ad ldd r25, Y+63 ; 0x3f 2fae6: 23 97 sbiw r28, 0x03 ; 3 2fae8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2faec: 6d af std Y+61, r22 ; 0x3d 2faee: 7d ab std Y+53, r23 ; 0x35 2faf0: 8e af std Y+62, r24 ; 0x3e 2faf2: 23 96 adiw r28, 0x03 ; 3 2faf4: 9f af std Y+63, r25 ; 0x3f 2faf6: 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; 2faf8: 24 ea ldi r18, 0xA4 ; 164 2fafa: 30 e7 ldi r19, 0x70 ; 112 2fafc: 4d e7 ldi r20, 0x7D ; 125 2fafe: 5f e3 ldi r21, 0x3F ; 63 2fb00: 6d ad ldd r22, Y+61 ; 0x3d 2fb02: 7d a9 ldd r23, Y+53 ; 0x35 2fb04: 8e ad ldd r24, Y+62 ; 0x3e 2fb06: 23 96 adiw r28, 0x03 ; 3 2fb08: 9f ad ldd r25, Y+63 ; 0x3f 2fb0a: 23 97 sbiw r28, 0x03 ; 3 2fb0c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fb10: 6b 01 movw r12, r22 2fb12: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 2fb14: ac 01 movw r20, r24 2fb16: 9b 01 movw r18, r22 2fb18: 60 91 dd 16 lds r22, 0x16DD ; 0x8016dd 2fb1c: 70 91 de 16 lds r23, 0x16DE ; 0x8016de 2fb20: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2fb24: 90 91 e0 16 lds r25, 0x16E0 ; 0x8016e0 2fb28: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fb2c: 18 16 cp r1, r24 2fb2e: fc f4 brge .+62 ; 0x2fb6e 2fb30: 29 a5 ldd r18, Y+41 ; 0x29 2fb32: 3d a5 ldd r19, Y+45 ; 0x2d 2fb34: 49 ad ldd r20, Y+57 ; 0x39 2fb36: 59 a9 ldd r21, Y+49 ; 0x31 2fb38: c7 01 movw r24, r14 2fb3a: b6 01 movw r22, r12 2fb3c: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2fb40: 87 ff sbrs r24, 7 2fb42: 15 c0 rjmp .+42 ; 0x2fb6e // 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; 2fb44: 8e e6 ldi r24, 0x6E ; 110 2fb46: 82 9d mul r24, r2 2fb48: f0 01 movw r30, r0 2fb4a: 83 9d mul r24, r3 2fb4c: f0 0d add r31, r0 2fb4e: 11 24 eor r1, r1 2fb50: e8 53 subi r30, 0x38 ; 56 2fb52: f9 4f sbci r31, 0xF9 ; 249 2fb54: 85 a9 ldd r24, Z+53 ; 0x35 2fb56: 84 60 ori r24, 0x04 ; 4 2fb58: 85 ab std Z+53, r24 ; 0x35 2fb5a: 49 a5 ldd r20, Y+41 ; 0x29 2fb5c: 4d af std Y+61, r20 ; 0x3d 2fb5e: 5d a5 ldd r21, Y+45 ; 0x2d 2fb60: 5d ab std Y+53, r21 ; 0x35 2fb62: 89 ad ldd r24, Y+57 ; 0x39 2fb64: 8e af std Y+62, r24 ; 0x3e 2fb66: 99 a9 ldd r25, Y+49 ; 0x31 2fb68: 23 96 adiw r28, 0x03 ; 3 2fb6a: 9f af std Y+63, r25 ; 0x3f 2fb6c: 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; 2fb6e: 8e e6 ldi r24, 0x6E ; 110 2fb70: 82 9d mul r24, r2 2fb72: 80 01 movw r16, r0 2fb74: 83 9d mul r24, r3 2fb76: 10 0d add r17, r0 2fb78: 11 24 eor r1, r1 2fb7a: 08 53 subi r16, 0x38 ; 56 2fb7c: 19 4f sbci r17, 0xF9 ; 249 2fb7e: 8d ad ldd r24, Y+61 ; 0x3d 2fb80: 9d a9 ldd r25, Y+53 ; 0x35 2fb82: ae ad ldd r26, Y+62 ; 0x3e 2fb84: 23 96 adiw r28, 0x03 ; 3 2fb86: bf ad ldd r27, Y+63 ; 0x3f 2fb88: 23 97 sbiw r28, 0x03 ; 3 2fb8a: f8 01 movw r30, r16 2fb8c: 81 a7 std Z+41, r24 ; 0x29 2fb8e: 92 a7 std Z+42, r25 ; 0x2a 2fb90: a3 a7 std Z+43, r26 ; 0x2b 2fb92: 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); 2fb94: 29 a5 ldd r18, Y+41 ; 0x29 2fb96: 3d a5 ldd r19, Y+45 ; 0x2d 2fb98: 49 ad ldd r20, Y+57 ; 0x39 2fb9a: 59 a9 ldd r21, Y+49 ; 0x31 2fb9c: 69 a5 ldd r22, Y+41 ; 0x29 2fb9e: 7d a5 ldd r23, Y+45 ; 0x2d 2fba0: 89 ad ldd r24, Y+57 ; 0x39 2fba2: 99 a9 ldd r25, Y+49 ; 0x31 2fba4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fba8: 6b 01 movw r12, r22 2fbaa: 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); 2fbac: e1 96 adiw r28, 0x31 ; 49 2fbae: 6c ad ldd r22, Y+60 ; 0x3c 2fbb0: 7d ad ldd r23, Y+61 ; 0x3d 2fbb2: 8e ad ldd r24, Y+62 ; 0x3e 2fbb4: 9f ad ldd r25, Y+63 ; 0x3f 2fbb6: e1 97 sbiw r28, 0x31 ; 49 2fbb8: 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); 2fbba: 9b 01 movw r18, r22 2fbbc: ac 01 movw r20, r24 2fbbe: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 2fbc2: d8 01 movw r26, r16 2fbc4: 9d 96 adiw r26, 0x2d ; 45 2fbc6: 2d 91 ld r18, X+ 2fbc8: 3d 91 ld r19, X+ 2fbca: 4d 91 ld r20, X+ 2fbcc: 5c 91 ld r21, X 2fbce: d0 97 sbiw r26, 0x30 ; 48 2fbd0: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fbd4: 9b 01 movw r18, r22 2fbd6: ac 01 movw r20, r24 2fbd8: c7 01 movw r24, r14 2fbda: b6 01 movw r22, r12 2fbdc: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 2fbe0: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 2fbe4: d6 2e mov r13, r22 2fbe6: e7 2e mov r14, r23 2fbe8: 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); 2fbea: 2d ad ldd r18, Y+61 ; 0x3d 2fbec: 3d a9 ldd r19, Y+53 ; 0x35 2fbee: 4e ad ldd r20, Y+62 ; 0x3e 2fbf0: 23 96 adiw r28, 0x03 ; 3 2fbf2: 5f ad ldd r21, Y+63 ; 0x3f 2fbf4: 23 97 sbiw r28, 0x03 ; 3 2fbf6: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fbfa: 18 16 cp r1, r24 2fbfc: 34 f0 brlt .+12 ; 0x2fc0a 2fbfe: dd ae std Y+61, r13 ; 0x3d 2fc00: ed aa std Y+53, r14 ; 0x35 2fc02: 0e af std Y+62, r16 ; 0x3e 2fc04: 23 96 adiw r28, 0x03 ; 3 2fc06: 1f af std Y+63, r17 ; 0x3f 2fc08: 23 97 sbiw r28, 0x03 ; 3 2fc0a: 8e e6 ldi r24, 0x6E ; 110 2fc0c: 82 9d mul r24, r2 2fc0e: f0 01 movw r30, r0 2fc10: 83 9d mul r24, r3 2fc12: f0 0d add r31, r0 2fc14: 11 24 eor r1, r1 2fc16: e8 53 subi r30, 0x38 ; 56 2fc18: f9 4f sbci r31, 0xF9 ; 249 2fc1a: 8d ad ldd r24, Y+61 ; 0x3d 2fc1c: 9d a9 ldd r25, Y+53 ; 0x35 2fc1e: ae ad ldd r26, Y+62 ; 0x3e 2fc20: 23 96 adiw r28, 0x03 ; 3 2fc22: bf ad ldd r27, Y+63 ; 0x3f 2fc24: 23 97 sbiw r28, 0x03 ; 3 2fc26: 85 a3 std Z+37, r24 ; 0x25 2fc28: 96 a3 std Z+38, r25 ; 0x26 2fc2a: a7 a3 std Z+39, r26 ; 0x27 2fc2c: 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; 2fc2e: f5 a8 ldd r15, Z+53 ; 0x35 2fc30: 2d 2d mov r18, r13 2fc32: 3e 2d mov r19, r14 2fc34: a8 01 movw r20, r16 2fc36: 27 96 adiw r28, 0x07 ; 7 2fc38: 6f ad ldd r22, Y+63 ; 0x3f 2fc3a: 27 97 sbiw r28, 0x07 ; 7 2fc3c: 2b 96 adiw r28, 0x0b ; 11 2fc3e: 7f ad ldd r23, Y+63 ; 0x3f 2fc40: 2b 97 sbiw r28, 0x0b ; 11 2fc42: 2f 96 adiw r28, 0x0f ; 15 2fc44: 8f ad ldd r24, Y+63 ; 0x3f 2fc46: 2f 97 sbiw r28, 0x0f ; 15 2fc48: 63 96 adiw r28, 0x13 ; 19 2fc4a: 9f ad ldd r25, Y+63 ; 0x3f 2fc4c: 63 97 sbiw r28, 0x13 ; 19 2fc4e: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 2fc52: 18 16 cp r1, r24 2fc54: 0c f4 brge .+2 ; 0x2fc58 2fc56: cf c4 rjmp .+2462 ; 0x305f6 2fc58: 83 e0 ldi r24, 0x03 ; 3 2fc5a: 9e e6 ldi r25, 0x6E ; 110 2fc5c: 92 9d mul r25, r2 2fc5e: 80 01 movw r16, r0 2fc60: 93 9d mul r25, r3 2fc62: 10 0d add r17, r0 2fc64: 11 24 eor r1, r1 2fc66: 08 53 subi r16, 0x38 ; 56 2fc68: 19 4f sbci r17, 0xF9 ; 249 2fc6a: f8 2a or r15, r24 2fc6c: f8 01 movw r30, r16 2fc6e: 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[] 2fc70: 80 e1 ldi r24, 0x10 ; 16 2fc72: fe 01 movw r30, r28 2fc74: 71 96 adiw r30, 0x11 ; 17 2fc76: a4 ef ldi r26, 0xF4 ; 244 2fc78: b3 e0 ldi r27, 0x03 ; 3 2fc7a: 01 90 ld r0, Z+ 2fc7c: 0d 92 st X+, r0 2fc7e: 8a 95 dec r24 2fc80: e1 f7 brne .-8 ; 0x2fc7a previous_nominal_speed = block->nominal_speed; 2fc82: 27 96 adiw r28, 0x07 ; 7 2fc84: 8f ad ldd r24, Y+63 ; 0x3f 2fc86: 27 97 sbiw r28, 0x07 ; 7 2fc88: 2b 96 adiw r28, 0x0b ; 11 2fc8a: 9f ad ldd r25, Y+63 ; 0x3f 2fc8c: 2b 97 sbiw r28, 0x0b ; 11 2fc8e: 2f 96 adiw r28, 0x0f ; 15 2fc90: af ad ldd r26, Y+63 ; 0x3f 2fc92: 2f 97 sbiw r28, 0x0f ; 15 2fc94: 63 96 adiw r28, 0x13 ; 19 2fc96: bf ad ldd r27, Y+63 ; 0x3f 2fc98: 63 97 sbiw r28, 0x13 ; 19 2fc9a: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 2fc9e: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 2fca2: a0 93 f2 03 sts 0x03F2, r26 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 2fca6: b0 93 f3 03 sts 0x03F3, r27 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> previous_safe_speed = safe_speed; 2fcaa: 89 a5 ldd r24, Y+41 ; 0x29 2fcac: 9d a5 ldd r25, Y+45 ; 0x2d 2fcae: a9 ad ldd r26, Y+57 ; 0x39 2fcb0: b9 a9 ldd r27, Y+49 ; 0x31 2fcb2: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 2fcb6: 90 93 de 16 sts 0x16DE, r25 ; 0x8016de 2fcba: a0 93 df 16 sts 0x16DF, r26 ; 0x8016df 2fcbe: 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; 2fcc2: d8 01 movw r26, r16 2fcc4: d6 96 adiw r26, 0x36 ; 54 2fcc6: 6d 91 ld r22, X+ 2fcc8: 7d 91 ld r23, X+ 2fcca: 8d 91 ld r24, X+ 2fccc: 9c 91 ld r25, X 2fcce: d9 97 sbiw r26, 0x39 ; 57 2fcd0: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 2fcd4: 27 96 adiw r28, 0x07 ; 7 2fcd6: 2f ad ldd r18, Y+63 ; 0x3f 2fcd8: 27 97 sbiw r28, 0x07 ; 7 2fcda: 2b 96 adiw r28, 0x0b ; 11 2fcdc: 3f ad ldd r19, Y+63 ; 0x3f 2fcde: 2b 97 sbiw r28, 0x0b ; 11 2fce0: 2f 96 adiw r28, 0x0f ; 15 2fce2: 4f ad ldd r20, Y+63 ; 0x3f 2fce4: 2f 97 sbiw r28, 0x0f ; 15 2fce6: 63 96 adiw r28, 0x13 ; 19 2fce8: 5f ad ldd r21, Y+63 ; 0x3f 2fcea: 63 97 sbiw r28, 0x13 ; 19 2fcec: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2fcf0: 2b 01 movw r4, r22 2fcf2: 3c 01 movw r6, r24 2fcf4: f8 01 movw r30, r16 2fcf6: e8 5b subi r30, 0xB8 ; 184 2fcf8: ff 4f sbci r31, 0xFF ; 255 2fcfa: 40 82 st Z, r4 2fcfc: 51 82 std Z+1, r5 ; 0x01 2fcfe: 62 82 std Z+2, r6 ; 0x02 2fd00: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 2fd02: 34 96 adiw r30, 0x04 ; 4 2fd04: 80 81 ld r24, Z 2fd06: 88 23 and r24, r24 2fd08: 09 f4 brne .+2 ; 0x2fd0c 2fd0a: 89 c0 rjmp .+274 ; 0x2fe1e // 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)) 2fd0c: 20 91 e1 16 lds r18, 0x16E1 ; 0x8016e1 2fd10: 30 91 e2 16 lds r19, 0x16E2 ; 0x8016e2 2fd14: 40 91 e3 16 lds r20, 0x16E3 ; 0x8016e3 2fd18: 50 91 e4 16 lds r21, 0x16E4 ; 0x8016e4 2fd1c: 6a 96 adiw r28, 0x1a ; 26 2fd1e: 6c ad ldd r22, Y+60 ; 0x3c 2fd20: 7d ad ldd r23, Y+61 ; 0x3d 2fd22: 8e ad ldd r24, Y+62 ; 0x3e 2fd24: 9f ad ldd r25, Y+63 ; 0x3f 2fd26: 6a 97 sbiw r28, 0x1a ; 26 2fd28: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fd2c: 4b 01 movw r8, r22 2fd2e: 5c 01 movw r10, r24 2fd30: c0 90 42 04 lds r12, 0x0442 ; 0x800442 2fd34: d0 90 43 04 lds r13, 0x0443 ; 0x800443 2fd38: e0 90 44 04 lds r14, 0x0444 ; 0x800444 2fd3c: f0 90 45 04 lds r15, 0x0445 ; 0x800445 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fd40: 0c 5a subi r16, 0xAC ; 172 2fd42: 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)) 2fd44: a7 01 movw r20, r14 2fd46: 96 01 movw r18, r12 2fd48: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fd4c: a3 01 movw r20, r6 2fd4e: 92 01 movw r18, r4 2fd50: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2fd54: f8 01 movw r30, r16 2fd56: 60 83 st Z, r22 2fd58: 71 83 std Z+1, r23 ; 0x01 2fd5a: 82 83 std Z+2, r24 ; 0x02 2fd5c: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 2fd5e: 20 e0 ldi r18, 0x00 ; 0 2fd60: 30 e0 ldi r19, 0x00 ; 0 2fd62: a9 01 movw r20, r18 2fd64: 6a 96 adiw r28, 0x1a ; 26 2fd66: 6c ad ldd r22, Y+60 ; 0x3c 2fd68: 7d ad ldd r23, Y+61 ; 0x3d 2fd6a: 8e ad ldd r24, Y+62 ; 0x3e 2fd6c: 9f ad ldd r25, Y+63 ; 0x3f 2fd6e: 6a 97 sbiw r28, 0x1a ; 26 2fd70: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fd74: 18 16 cp r1, r24 2fd76: 0c f0 brlt .+2 ; 0x2fd7a 2fd78: 40 c4 rjmp .+2176 ; 0x305fa advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 2fd7a: a5 01 movw r20, r10 2fd7c: 94 01 movw r18, r8 2fd7e: e1 96 adiw r28, 0x31 ; 49 2fd80: 6c ad ldd r22, Y+60 ; 0x3c 2fd82: 7d ad ldd r23, Y+61 ; 0x3d 2fd84: 8e ad ldd r24, Y+62 ; 0x3e 2fd86: 9f ad ldd r25, Y+63 ; 0x3f 2fd88: e1 97 sbiw r28, 0x31 ; 49 2fd8a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fd8e: a7 01 movw r20, r14 2fd90: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 2fd92: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fd96: 6b 01 movw r12, r22 2fd98: 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; 2fd9a: 20 e0 ldi r18, 0x00 ; 0 2fd9c: 30 e4 ldi r19, 0x40 ; 64 2fd9e: 4c e1 ldi r20, 0x1C ; 28 2fda0: 57 e4 ldi r21, 0x47 ; 71 2fda2: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fda6: 18 16 cp r1, r24 2fda8: 3c f4 brge .+14 ; 0x2fdb8 2fdaa: c1 2c mov r12, r1 2fdac: 20 e4 ldi r18, 0x40 ; 64 2fdae: d2 2e mov r13, r18 2fdb0: 2c e1 ldi r18, 0x1C ; 28 2fdb2: e2 2e mov r14, r18 2fdb4: 27 e4 ldi r18, 0x47 ; 71 2fdb6: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 2fdb8: a7 01 movw r20, r14 2fdba: 96 01 movw r18, r12 2fdbc: 60 e0 ldi r22, 0x00 ; 0 2fdbe: 74 e2 ldi r23, 0x24 ; 36 2fdc0: 84 ef ldi r24, 0xF4 ; 244 2fdc2: 99 e4 ldi r25, 0x49 ; 73 2fdc4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 2fdc8: 4b 01 movw r8, r22 2fdca: 5c 01 movw r10, r24 if (advance_speed > 20000) { 2fdcc: 20 e0 ldi r18, 0x00 ; 0 2fdce: 30 e4 ldi r19, 0x40 ; 64 2fdd0: 4c e9 ldi r20, 0x9C ; 156 2fdd2: 56 e4 ldi r21, 0x46 ; 70 2fdd4: c7 01 movw r24, r14 2fdd6: b6 01 movw r22, r12 2fdd8: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 2fddc: 18 16 cp r1, r24 2fdde: 0c f0 brlt .+2 ; 0x2fde2 2fde0: 17 c4 rjmp .+2094 ; 0x30610 block->advance_rate = advance_rate * 4; 2fde2: 8e e6 ldi r24, 0x6E ; 110 2fde4: 82 9d mul r24, r2 2fde6: 80 01 movw r16, r0 2fde8: 83 9d mul r24, r3 2fdea: 10 0d add r17, r0 2fdec: 11 24 eor r1, r1 2fdee: 08 53 subi r16, 0x38 ; 56 2fdf0: 19 4f sbci r17, 0xF9 ; 249 2fdf2: 78 01 movw r14, r16 2fdf4: fd e4 ldi r31, 0x4D ; 77 2fdf6: ef 0e add r14, r31 2fdf8: f1 1c adc r15, r1 2fdfa: 20 e0 ldi r18, 0x00 ; 0 2fdfc: 30 e0 ldi r19, 0x00 ; 0 2fdfe: 40 e8 ldi r20, 0x80 ; 128 2fe00: 50 e4 ldi r21, 0x40 ; 64 2fe02: c5 01 movw r24, r10 2fe04: b4 01 movw r22, r8 2fe06: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 2fe0a: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 2fe0e: d7 01 movw r26, r14 2fe10: 6d 93 st X+, r22 2fe12: 7c 93 st X, r23 block->advance_step_loops = 4; 2fe14: f8 01 movw r30, r16 2fe16: ed 5a subi r30, 0xAD ; 173 2fe18: ff 4f sbci r31, 0xFF ; 255 2fe1a: 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; 2fe1c: 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); 2fe1e: 09 a5 ldd r16, Y+41 ; 0x29 2fe20: 1d a5 ldd r17, Y+45 ; 0x2d 2fe22: 29 ad ldd r18, Y+57 ; 0x39 2fe24: 39 a9 ldd r19, Y+49 ; 0x31 2fe26: 4d ad ldd r20, Y+61 ; 0x3d 2fe28: 5d a9 ldd r21, Y+53 ; 0x35 2fe2a: 6e ad ldd r22, Y+62 ; 0x3e 2fe2c: 23 96 adiw r28, 0x03 ; 3 2fe2e: 7f ad ldd r23, Y+63 ; 0x3f 2fe30: 23 97 sbiw r28, 0x03 ; 3 2fe32: a3 96 adiw r28, 0x23 ; 35 2fe34: 8e ad ldd r24, Y+62 ; 0x3e 2fe36: 9f ad ldd r25, Y+63 ; 0x3f 2fe38: a3 97 sbiw r28, 0x23 ; 35 2fe3a: 88 53 subi r24, 0x38 ; 56 2fe3c: 99 4f sbci r25, 0xF9 ; 249 2fe3e: 0f 94 59 6c call 0x2d8b2 ; 0x2d8b2 if (block->step_event_count.wide <= 32767) 2fe42: 8e e6 ldi r24, 0x6E ; 110 2fe44: 82 9d mul r24, r2 2fe46: f0 01 movw r30, r0 2fe48: 83 9d mul r24, r3 2fe4a: f0 0d add r31, r0 2fe4c: 11 24 eor r1, r1 2fe4e: e8 53 subi r30, 0x38 ; 56 2fe50: f9 4f sbci r31, 0xF9 ; 249 2fe52: 80 89 ldd r24, Z+16 ; 0x10 2fe54: 91 89 ldd r25, Z+17 ; 0x11 2fe56: a2 89 ldd r26, Z+18 ; 0x12 2fe58: b3 89 ldd r27, Z+19 ; 0x13 2fe5a: 81 15 cp r24, r1 2fe5c: 90 48 sbci r25, 0x80 ; 128 2fe5e: a1 05 cpc r26, r1 2fe60: b1 05 cpc r27, r1 2fe62: 18 f4 brcc .+6 ; 0x2fe6a block->flag |= BLOCK_FLAG_DDA_LOWRES; 2fe64: 85 a9 ldd r24, Z+53 ; 0x35 2fe66: 88 60 ori r24, 0x08 ; 8 2fe68: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2fe6a: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2fe6c: 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; 2fe6e: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 2fe72: 91 11 cpse r25, r1 2fe74: 93 c4 rjmp .+2342 ; 0x3079c block_buffer_head = next_buffer_head; 2fe76: a0 96 adiw r28, 0x20 ; 32 2fe78: 3f ad ldd r19, Y+63 ; 0x3f 2fe7a: a0 97 sbiw r28, 0x20 ; 32 2fe7c: 30 93 a8 0d sts 0x0DA8, r19 ; 0x800da8 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2fe80: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 2fe82: c3 58 subi r28, 0x83 ; 131 2fe84: df 4f sbci r29, 0xFF ; 255 2fe86: 88 81 ld r24, Y 2fe88: 99 81 ldd r25, Y+1 ; 0x01 2fe8a: aa 81 ldd r26, Y+2 ; 0x02 2fe8c: bb 81 ldd r27, Y+3 ; 0x03 2fe8e: cd 57 subi r28, 0x7D ; 125 2fe90: d0 40 sbci r29, 0x00 ; 0 2fe92: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 2fe96: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 2fe9a: a0 93 a8 06 sts 0x06A8, r26 ; 0x8006a8 2fe9e: b0 93 a9 06 sts 0x06A9, r27 ; 0x8006a9 2fea2: cf 57 subi r28, 0x7F ; 127 2fea4: df 4f sbci r29, 0xFF ; 255 2fea6: 28 81 ld r18, Y 2fea8: 39 81 ldd r19, Y+1 ; 0x01 2feaa: 4a 81 ldd r20, Y+2 ; 0x02 2feac: 5b 81 ldd r21, Y+3 ; 0x03 2feae: c1 58 subi r28, 0x81 ; 129 2feb0: d0 40 sbci r29, 0x00 ; 0 2feb2: 20 93 aa 06 sts 0x06AA, r18 ; 0x8006aa 2feb6: 30 93 ab 06 sts 0x06AB, r19 ; 0x8006ab 2feba: 40 93 ac 06 sts 0x06AC, r20 ; 0x8006ac 2febe: 50 93 ad 06 sts 0x06AD, r21 ; 0x8006ad 2fec2: e5 96 adiw r28, 0x35 ; 53 2fec4: 8c ad ldd r24, Y+60 ; 0x3c 2fec6: 9d ad ldd r25, Y+61 ; 0x3d 2fec8: ae ad ldd r26, Y+62 ; 0x3e 2feca: bf ad ldd r27, Y+63 ; 0x3f 2fecc: e5 97 sbiw r28, 0x35 ; 53 2fece: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 2fed2: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af 2fed6: a0 93 b0 06 sts 0x06B0, r26 ; 0x8006b0 2feda: b0 93 b1 06 sts 0x06B1, r27 ; 0x8006b1 2fede: ad 96 adiw r28, 0x2d ; 45 2fee0: 2c ad ldd r18, Y+60 ; 0x3c 2fee2: 3d ad ldd r19, Y+61 ; 0x3d 2fee4: 4e ad ldd r20, Y+62 ; 0x3e 2fee6: 5f ad ldd r21, Y+63 ; 0x3f 2fee8: ad 97 sbiw r28, 0x2d ; 45 2feea: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2feee: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2fef2: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2fef6: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 2fefa: 89 a1 ldd r24, Y+33 ; 0x21 2fefc: 9a a1 ldd r25, Y+34 ; 0x22 2fefe: ab a1 ldd r26, Y+35 ; 0x23 2ff00: bc a1 ldd r27, Y+36 ; 0x24 2ff02: 80 93 04 04 sts 0x0404, r24 ; 0x800404 2ff06: 90 93 05 04 sts 0x0405, r25 ; 0x800405 2ff0a: a0 93 06 04 sts 0x0406, r26 ; 0x800406 2ff0e: b0 93 07 04 sts 0x0407, r27 ; 0x800407 position_float[Y_AXIS] = y; 2ff12: 8d a1 ldd r24, Y+37 ; 0x25 2ff14: 9e a1 ldd r25, Y+38 ; 0x26 2ff16: af a1 ldd r26, Y+39 ; 0x27 2ff18: b8 a5 ldd r27, Y+40 ; 0x28 2ff1a: 80 93 08 04 sts 0x0408, r24 ; 0x800408 2ff1e: 90 93 09 04 sts 0x0409, r25 ; 0x800409 2ff22: a0 93 0a 04 sts 0x040A, r26 ; 0x80040a 2ff26: b0 93 0b 04 sts 0x040B, r27 ; 0x80040b position_float[Z_AXIS] = z; 2ff2a: a7 96 adiw r28, 0x27 ; 39 2ff2c: 8c ad ldd r24, Y+60 ; 0x3c 2ff2e: 9d ad ldd r25, Y+61 ; 0x3d 2ff30: ae ad ldd r26, Y+62 ; 0x3e 2ff32: bf ad ldd r27, Y+63 ; 0x3f 2ff34: a7 97 sbiw r28, 0x27 ; 39 2ff36: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c 2ff3a: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 2ff3e: a0 93 0e 04 sts 0x040E, r26 ; 0x80040e 2ff42: b0 93 0f 04 sts 0x040F, r27 ; 0x80040f position_float[E_AXIS] = e; 2ff46: a9 96 adiw r28, 0x29 ; 41 2ff48: ee ad ldd r30, Y+62 ; 0x3e 2ff4a: ff ad ldd r31, Y+63 ; 0x3f 2ff4c: a9 97 sbiw r28, 0x29 ; 41 2ff4e: 80 81 ld r24, Z 2ff50: 91 81 ldd r25, Z+1 ; 0x01 2ff52: a2 81 ldd r26, Z+2 ; 0x02 2ff54: b3 81 ldd r27, Z+3 ; 0x03 2ff56: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2ff5a: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2ff5e: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2ff62: 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; 2ff66: 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); 2ff6a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2ff6e: 8f 19 sub r24, r15 2ff70: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 2ff72: 83 30 cpi r24, 0x03 ; 3 2ff74: 40 f1 brcs .+80 ; 0x2ffc6 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 2ff76: 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) 2ff7a: 11 11 cpse r17, r1 2ff7c: 01 c0 rjmp .+2 ; 0x2ff80 block_index = BLOCK_BUFFER_SIZE; 2ff7e: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2ff80: 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; 2ff82: fe e6 ldi r31, 0x6E ; 110 2ff84: 1f 9f mul r17, r31 2ff86: c0 01 movw r24, r0 2ff88: 11 24 eor r1, r1 2ff8a: 9c 01 movw r18, r24 2ff8c: 28 53 subi r18, 0x38 ; 56 2ff8e: 39 4f sbci r19, 0xF9 ; 249 2ff90: 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) 2ff92: 11 11 cpse r17, r1 2ff94: 01 c0 rjmp .+2 ; 0x2ff98 block_index = BLOCK_BUFFER_SIZE; 2ff96: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2ff98: 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)); 2ff9a: 3e e6 ldi r19, 0x6E ; 110 2ff9c: 13 9f mul r17, r19 2ff9e: c0 01 movw r24, r0 2ffa0: 11 24 eor r1, r1 2ffa2: ac 01 movw r20, r24 2ffa4: 48 53 subi r20, 0x38 ; 56 2ffa6: 59 4f sbci r21, 0xF9 ; 249 2ffa8: 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)); 2ffaa: 9e e6 ldi r25, 0x6E ; 110 2ffac: 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) { 2ffae: f1 16 cp r15, r17 2ffb0: 69 f0 breq .+26 ; 0x2ffcc if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 2ffb2: d6 01 movw r26, r12 2ffb4: d5 96 adiw r26, 0x35 ; 53 2ffb6: 0c 91 ld r16, X 2ffb8: 02 ff sbrs r16, 2 2ffba: 7e c3 rjmp .+1788 ; 0x306b8 // 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); 2ffbc: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2ffc0: 81 1b sub r24, r17 2ffc2: 8f 70 andi r24, 0x0F ; 15 2ffc4: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 2ffc6: 82 30 cpi r24, 0x02 ; 2 2ffc8: 08 f4 brcc .+2 ; 0x2ffcc 2ffca: a3 c0 rjmp .+326 ; 0x30112 // 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; 2ffcc: 3e e6 ldi r19, 0x6E ; 110 2ffce: f3 9e mul r15, r19 2ffd0: c0 01 movw r24, r0 2ffd2: 11 24 eor r1, r1 2ffd4: ac 01 movw r20, r24 2ffd6: 48 53 subi r20, 0x38 ; 56 2ffd8: 59 4f sbci r21, 0xF9 ; 249 2ffda: 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) 2ffdc: f3 94 inc r15 2ffde: 50 e1 ldi r21, 0x10 ; 16 2ffe0: f5 12 cpse r15, r21 2ffe2: 01 c0 rjmp .+2 ; 0x2ffe6 block_index = 0; 2ffe4: 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)); 2ffe6: ae e6 ldi r26, 0x6E ; 110 2ffe8: fa 9e mul r15, r26 2ffea: c0 01 movw r24, r0 2ffec: 11 24 eor r1, r1 2ffee: fc 01 movw r30, r24 2fff0: e8 53 subi r30, 0x38 ; 56 2fff2: f9 4f sbci r31, 0xF9 ; 249 2fff4: 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)); 2fff6: 8e e6 ldi r24, 0x6E ; 110 2fff8: 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) { 2fffa: d5 01 movw r26, r10 2fffc: d5 96 adiw r26, 0x35 ; 53 2fffe: 8c 91 ld r24, X 30000: d5 97 sbiw r26, 0x35 ; 53 30002: 81 fd sbrc r24, 1 30004: 5a c0 rjmp .+180 ; 0x300ba 30006: 95 96 adiw r26, 0x25 ; 37 30008: 4d 90 ld r4, X+ 3000a: 5d 90 ld r5, X+ 3000c: 6d 90 ld r6, X+ 3000e: 7c 90 ld r7, X 30010: 98 97 sbiw r26, 0x28 ; 40 30012: f6 01 movw r30, r12 30014: 95 a0 ldd r9, Z+37 ; 0x25 30016: e6 a0 ldd r14, Z+38 ; 0x26 30018: 07 a1 ldd r16, Z+39 ; 0x27 3001a: 10 a5 ldd r17, Z+40 ; 0x28 3001c: 29 2d mov r18, r9 3001e: 3e 2d mov r19, r14 30020: a8 01 movw r20, r16 30022: c3 01 movw r24, r6 30024: b2 01 movw r22, r4 30026: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3002a: 87 ff sbrs r24, 7 3002c: 46 c0 rjmp .+140 ; 0x300ba // 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); 3002e: a3 01 movw r20, r6 30030: 92 01 movw r18, r4 30032: c3 01 movw r24, r6 30034: b2 01 movw r22, r4 30036: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3003a: 2b 01 movw r4, r22 3003c: 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)); 3003e: d5 01 movw r26, r10 30040: d1 96 adiw r26, 0x31 ; 49 30042: 6d 91 ld r22, X+ 30044: 7d 91 ld r23, X+ 30046: 8d 91 ld r24, X+ 30048: 9c 91 ld r25, X 3004a: d4 97 sbiw r26, 0x34 ; 52 3004c: 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); 3004e: 9b 01 movw r18, r22 30050: ac 01 movw r20, r24 30052: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30056: f5 01 movw r30, r10 30058: 25 a5 ldd r18, Z+45 ; 0x2d 3005a: 36 a5 ldd r19, Z+46 ; 0x2e 3005c: 47 a5 ldd r20, Z+47 ; 0x2f 3005e: 50 a9 ldd r21, Z+48 ; 0x30 30060: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30064: 9b 01 movw r18, r22 30066: ac 01 movw r20, r24 30068: c3 01 movw r24, r6 3006a: b2 01 movw r22, r4 3006c: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30070: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 30074: 2b 01 movw r4, r22 30076: 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)); 30078: 9b 01 movw r18, r22 3007a: ac 01 movw r20, r24 3007c: 69 2d mov r22, r9 3007e: 7e 2d mov r23, r14 30080: c8 01 movw r24, r16 30082: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 30086: 87 ff sbrs r24, 7 30088: 03 c0 rjmp .+6 ; 0x30090 3008a: 49 2c mov r4, r9 3008c: 5e 2c mov r5, r14 3008e: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 30090: 92 01 movw r18, r4 30092: a3 01 movw r20, r6 30094: 69 2d mov r22, r9 30096: 7e 2d mov r23, r14 30098: c8 01 movw r24, r16 3009a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3009e: 88 23 and r24, r24 300a0: 61 f0 breq .+24 ; 0x300ba 300a2: d6 01 movw r26, r12 300a4: d5 96 adiw r26, 0x35 ; 53 300a6: 2c 91 ld r18, X current->entry_speed = entry_speed; 300a8: c2 01 movw r24, r4 300aa: d3 01 movw r26, r6 300ac: f6 01 movw r30, r12 300ae: 85 a3 std Z+37, r24 ; 0x25 300b0: 96 a3 std Z+38, r25 ; 0x26 300b2: a7 a3 std Z+39, r26 ; 0x27 300b4: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 300b6: 21 60 ori r18, 0x01 ; 1 300b8: 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) { 300ba: d5 01 movw r26, r10 300bc: d5 96 adiw r26, 0x35 ; 53 300be: 8c 91 ld r24, X 300c0: d5 97 sbiw r26, 0x35 ; 53 300c2: f6 01 movw r30, r12 300c4: 95 a9 ldd r25, Z+53 ; 0x35 300c6: 89 2b or r24, r25 300c8: 80 ff sbrs r24, 0 300ca: 14 c0 rjmp .+40 ; 0x300f4 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 300cc: 05 a1 ldd r16, Z+37 ; 0x25 300ce: 16 a1 ldd r17, Z+38 ; 0x26 300d0: 27 a1 ldd r18, Z+39 ; 0x27 300d2: 30 a5 ldd r19, Z+40 ; 0x28 300d4: 95 96 adiw r26, 0x25 ; 37 300d6: 4d 91 ld r20, X+ 300d8: 5d 91 ld r21, X+ 300da: 6d 91 ld r22, X+ 300dc: 7c 91 ld r23, X 300de: 98 97 sbiw r26, 0x28 ; 40 300e0: c5 01 movw r24, r10 300e2: 0f 94 59 6c call 0x2d8b2 ; 0x2d8b2 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 300e6: d5 01 movw r26, r10 300e8: d5 96 adiw r26, 0x35 ; 53 300ea: 8c 91 ld r24, X 300ec: d5 97 sbiw r26, 0x35 ; 53 300ee: 8e 7f andi r24, 0xFE ; 254 300f0: d5 96 adiw r26, 0x35 ; 53 300f2: 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) 300f4: f3 94 inc r15 300f6: b0 e1 ldi r27, 0x10 ; 16 300f8: fb 12 cpse r15, r27 300fa: 01 c0 rjmp .+2 ; 0x300fe block_index = 0; 300fc: 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)); 300fe: f8 9c mul r15, r8 30100: c0 01 movw r24, r0 30102: 11 24 eor r1, r1 30104: 88 53 subi r24, 0x38 ; 56 30106: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 30108: 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; 3010c: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 3010e: f2 12 cpse r15, r18 30110: 43 c3 rjmp .+1670 ; 0x30798 } // 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); 30112: 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) 30116: 81 11 cpse r24, r1 30118: 01 c0 rjmp .+2 ; 0x3011c block_index = BLOCK_BUFFER_SIZE; 3011a: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 3011c: 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); 3011e: ee e6 ldi r30, 0x6E ; 110 30120: 8e 9f mul r24, r30 30122: c0 01 movw r24, r0 30124: 11 24 eor r1, r1 30126: 9c 01 movw r18, r24 30128: 28 53 subi r18, 0x38 ; 56 3012a: 39 4f sbci r19, 0xF9 ; 249 3012c: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 3012e: d9 01 movw r26, r18 30130: 95 96 adiw r26, 0x25 ; 37 30132: 4d 91 ld r20, X+ 30134: 5d 91 ld r21, X+ 30136: 6d 91 ld r22, X+ 30138: 7c 91 ld r23, X 3013a: 98 97 sbiw r26, 0x28 ; 40 3013c: 09 a5 ldd r16, Y+41 ; 0x29 3013e: 1d a5 ldd r17, Y+45 ; 0x2d 30140: 29 ad ldd r18, Y+57 ; 0x39 30142: 39 a9 ldd r19, Y+49 ; 0x31 30144: c7 01 movw r24, r14 30146: 0f 94 59 6c call 0x2d8b2 ; 0x2d8b2 current->flag &= ~BLOCK_FLAG_RECALCULATE; 3014a: f7 01 movw r30, r14 3014c: 85 a9 ldd r24, Z+53 ; 0x35 3014e: 8e 7f andi r24, 0xFE ; 254 30150: 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(); 30152: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30156: 82 60 ori r24, 0x02 ; 2 30158: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3015c: 0d 94 2a 76 jmp 0x2ec54 ; 0x2ec54 // 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)); 30160: a0 5e subi r26, 0xE0 ; 224 30162: b8 4f sbci r27, 0xF8 ; 248 30164: 80 e1 ldi r24, 0x10 ; 16 30166: e5 ef ldi r30, 0xF5 ; 245 30168: f1 e1 ldi r31, 0x11 ; 17 3016a: 0d 94 65 76 jmp 0x2ecca ; 0x2ecca 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]); 3016e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30172: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 30176: 40 91 40 04 lds r20, 0x0440 ; 0x800440 3017a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 3017e: a7 96 adiw r28, 0x27 ; 39 30180: 6c ad ldd r22, Y+60 ; 0x3c 30182: 7d ad ldd r23, Y+61 ; 0x3d 30184: 8e ad ldd r24, Y+62 ; 0x3e 30186: 9f ad ldd r25, Y+63 ; 0x3f 30188: a7 97 sbiw r28, 0x27 ; 39 3018a: 0d 94 fb 76 jmp 0x2edf6 ; 0x2edf6 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); 3018e: 81 e0 ldi r24, 0x01 ; 1 30190: 80 8f std Z+24, r24 ; 0x18 30192: 0d 94 a1 78 jmp 0x2f142 ; 0x2f142 { if(feed_rate 3019a: b0 90 6f 04 lds r11, 0x046F ; 0x80046f 3019e: 00 91 70 04 lds r16, 0x0470 ; 0x800470 301a2: 10 91 71 04 lds r17, 0x0471 ; 0x800471 301a6: 53 c8 rjmp .-3930 ; 0x2f24e 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])); 301a8: c5 01 movw r24, r10 301aa: b4 01 movw r22, r8 301ac: 0f 94 46 9b call 0x3368c ; 0x3368c 301b0: 4b 01 movw r8, r22 301b2: 5c 01 movw r10, r24 301b4: c7 01 movw r24, r14 301b6: b6 01 movw r22, r12 301b8: 0f 94 46 9b call 0x3368c ; 0x3368c 301bc: 9b 01 movw r18, r22 301be: ac 01 movw r20, r24 301c0: c5 01 movw r24, r10 301c2: b4 01 movw r22, r8 301c4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 301c8: 6b 01 movw r12, r22 301ca: 7c 01 movw r14, r24 301cc: 22 96 adiw r28, 0x02 ; 2 301ce: 6c ad ldd r22, Y+60 ; 0x3c 301d0: 7d ad ldd r23, Y+61 ; 0x3d 301d2: 8e ad ldd r24, Y+62 ; 0x3e 301d4: 9f ad ldd r25, Y+63 ; 0x3f 301d6: 22 97 sbiw r28, 0x02 ; 2 301d8: 0f 94 46 9b call 0x3368c ; 0x3368c 301dc: 9b 01 movw r18, r22 301de: ac 01 movw r20, r24 301e0: c7 01 movw r24, r14 301e2: b6 01 movw r22, r12 301e4: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 301e8: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 301ec: 2e e6 ldi r18, 0x6E ; 110 301ee: 22 9d mul r18, r2 301f0: f0 01 movw r30, r0 301f2: 23 9d mul r18, r3 301f4: f0 0d add r31, r0 301f6: 11 24 eor r1, r1 301f8: e8 53 subi r30, 0x38 ; 56 301fa: f9 4f sbci r31, 0xF9 ; 249 301fc: 65 a7 std Z+45, r22 ; 0x2d 301fe: 76 a7 std Z+46, r23 ; 0x2e 30200: 87 a7 std Z+47, r24 ; 0x2f 30202: 90 ab std Z+48, r25 ; 0x30 30204: c2 c8 rjmp .-3708 ; 0x2f38a 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 30206: 2a 96 adiw r28, 0x0a ; 10 30208: 2c ad ldd r18, Y+60 ; 0x3c 3020a: 3d ad ldd r19, Y+61 ; 0x3d 3020c: 4e ad ldd r20, Y+62 ; 0x3e 3020e: 5f ad ldd r21, Y+63 ; 0x3f 30210: 2a 97 sbiw r28, 0x0a ; 10 30212: 23 2b or r18, r19 30214: 24 2b or r18, r20 30216: 25 2b or r18, r21 30218: 09 f4 brne .+2 ; 0x3021c 3021a: 0e c1 rjmp .+540 ; 0x30438 3021c: 60 91 66 04 lds r22, 0x0466 ; 0x800466 30220: 70 91 67 04 lds r23, 0x0467 ; 0x800467 30224: 80 91 68 04 lds r24, 0x0468 ; 0x800468 30228: 90 91 69 04 lds r25, 0x0469 ; 0x800469 3022c: 29 a5 ldd r18, Y+41 ; 0x29 3022e: 3a a5 ldd r19, Y+42 ; 0x2a 30230: 4b a5 ldd r20, Y+43 ; 0x2b 30232: 5c a5 ldd r21, Y+44 ; 0x2c 30234: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30238: 0f 94 83 a2 call 0x34506 ; 0x34506 3023c: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 30240: 2b 01 movw r4, r22 30242: 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 30244: 80 91 e1 16 lds r24, 0x16E1 ; 0x8016e1 30248: 90 91 e2 16 lds r25, 0x16E2 ; 0x8016e2 3024c: a0 91 e3 16 lds r26, 0x16E3 ; 0x8016e3 30250: b0 91 e4 16 lds r27, 0x16E4 ; 0x8016e4 30254: 8d a7 std Y+45, r24 ; 0x2d 30256: 9e a7 std Y+46, r25 ; 0x2e 30258: af a7 std Y+47, r26 ; 0x2f 3025a: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 3025c: 20 e0 ldi r18, 0x00 ; 0 3025e: 30 e0 ldi r19, 0x00 ; 0 30260: a9 01 movw r20, r18 30262: bc 01 movw r22, r24 30264: cd 01 movw r24, r26 30266: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 3026a: 18 16 cp r1, r24 3026c: 0c f0 brlt .+2 ; 0x30270 3026e: ed c0 rjmp .+474 ; 0x3044a * 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 30270: 20 e0 ldi r18, 0x00 ; 0 30272: 30 e0 ldi r19, 0x00 ; 0 30274: a9 01 movw r20, r18 30276: 26 96 adiw r28, 0x06 ; 6 30278: 6c ad ldd r22, Y+60 ; 0x3c 3027a: 7d ad ldd r23, Y+61 ; 0x3d 3027c: 8e ad ldd r24, Y+62 ; 0x3e 3027e: 9f ad ldd r25, Y+63 ; 0x3f 30280: 26 97 sbiw r28, 0x06 ; 6 30282: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 30286: 87 fd sbrc r24, 7 30288: e0 c0 rjmp .+448 ; 0x3044a && fabs(delta_mm[Z_AXIS]) < 0.5; 3028a: 22 96 adiw r28, 0x02 ; 2 3028c: 6c ad ldd r22, Y+60 ; 0x3c 3028e: 7d ad ldd r23, Y+61 ; 0x3d 30290: 8e ad ldd r24, Y+62 ; 0x3e 30292: 9f ad ldd r25, Y+63 ; 0x3f 30294: 22 97 sbiw r28, 0x02 ; 2 30296: 9f 77 andi r25, 0x7F ; 127 30298: 20 e0 ldi r18, 0x00 ; 0 3029a: 30 e0 ldi r19, 0x00 ; 0 3029c: 40 e0 ldi r20, 0x00 ; 0 3029e: 5f e3 ldi r21, 0x3F ; 63 302a0: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 302a4: 87 ff sbrs r24, 7 302a6: d1 c0 rjmp .+418 ; 0x3044a * * 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 302a8: 8e e6 ldi r24, 0x6E ; 110 302aa: 82 9d mul r24, r2 302ac: 80 01 movw r16, r0 302ae: 83 9d mul r24, r3 302b0: 10 0d add r17, r0 302b2: 11 24 eor r1, r1 302b4: 0c 5e subi r16, 0xEC ; 236 302b6: 18 4f sbci r17, 0xF8 ; 248 302b8: 81 e0 ldi r24, 0x01 ; 1 302ba: d8 01 movw r26, r16 302bc: 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]) 302be: 20 91 04 04 lds r18, 0x0404 ; 0x800404 302c2: 30 91 05 04 lds r19, 0x0405 ; 0x800405 302c6: 40 91 06 04 lds r20, 0x0406 ; 0x800406 302ca: 50 91 07 04 lds r21, 0x0407 ; 0x800407 302ce: 69 a1 ldd r22, Y+33 ; 0x21 302d0: 7a a1 ldd r23, Y+34 ; 0x22 302d2: 8b a1 ldd r24, Y+35 ; 0x23 302d4: 9c a1 ldd r25, Y+36 ; 0x24 302d6: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 302da: 69 ab std Y+49, r22 ; 0x31 302dc: 7a ab std Y+50, r23 ; 0x32 302de: 8b ab std Y+51, r24 ; 0x33 302e0: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 302e2: 20 91 08 04 lds r18, 0x0408 ; 0x800408 302e6: 30 91 09 04 lds r19, 0x0409 ; 0x800409 302ea: 40 91 0a 04 lds r20, 0x040A ; 0x80040a 302ee: 50 91 0b 04 lds r21, 0x040B ; 0x80040b 302f2: 6d a1 ldd r22, Y+37 ; 0x25 302f4: 7e a1 ldd r23, Y+38 ; 0x26 302f6: 8f a1 ldd r24, Y+39 ; 0x27 302f8: 98 a5 ldd r25, Y+40 ; 0x28 302fa: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 302fe: 4b 01 movw r8, r22 30300: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 30302: 20 91 0c 04 lds r18, 0x040C ; 0x80040c 30306: 30 91 0d 04 lds r19, 0x040D ; 0x80040d 3030a: 40 91 0e 04 lds r20, 0x040E ; 0x80040e 3030e: 50 91 0f 04 lds r21, 0x040F ; 0x80040f 30312: a7 96 adiw r28, 0x27 ; 39 30314: 6c ad ldd r22, Y+60 ; 0x3c 30316: 7d ad ldd r23, Y+61 ; 0x3d 30318: 8e ad ldd r24, Y+62 ; 0x3e 3031a: 9f ad ldd r25, Y+63 ; 0x3f 3031c: a7 97 sbiw r28, 0x27 ; 39 3031e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30322: 6b 01 movw r12, r22 30324: 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]) 30326: 29 a9 ldd r18, Y+49 ; 0x31 30328: 3a a9 ldd r19, Y+50 ; 0x32 3032a: 4b a9 ldd r20, Y+51 ; 0x33 3032c: 5c a9 ldd r21, Y+52 ; 0x34 3032e: ca 01 movw r24, r20 30330: b9 01 movw r22, r18 30332: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30336: 69 ab std Y+49, r22 ; 0x31 30338: 7a ab std Y+50, r23 ; 0x32 3033a: 8b ab std Y+51, r24 ; 0x33 3033c: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 3033e: a5 01 movw r20, r10 30340: 94 01 movw r18, r8 30342: c5 01 movw r24, r10 30344: b4 01 movw r22, r8 30346: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3034a: 9b 01 movw r18, r22 3034c: ac 01 movw r20, r24 3034e: 69 a9 ldd r22, Y+49 ; 0x31 30350: 7a a9 ldd r23, Y+50 ; 0x32 30352: 8b a9 ldd r24, Y+51 ; 0x33 30354: 9c a9 ldd r25, Y+52 ; 0x34 30356: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 3035a: 4b 01 movw r8, r22 3035c: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 3035e: a7 01 movw r20, r14 30360: 96 01 movw r18, r12 30362: c7 01 movw r24, r14 30364: b6 01 movw r22, r12 30366: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3036a: 9b 01 movw r18, r22 3036c: ac 01 movw r20, r24 3036e: c5 01 movw r24, r10 30370: b4 01 movw r22, r8 30372: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__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]) 30376: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 3037a: 6b 01 movw r12, r22 3037c: 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]); 3037e: 20 91 10 04 lds r18, 0x0410 ; 0x800410 30382: 30 91 11 04 lds r19, 0x0411 ; 0x800411 30386: 40 91 12 04 lds r20, 0x0412 ; 0x800412 3038a: 50 91 13 04 lds r21, 0x0413 ; 0x800413 3038e: a9 96 adiw r28, 0x29 ; 41 30390: ee ad ldd r30, Y+62 ; 0x3e 30392: ff ad ldd r31, Y+63 ; 0x3f 30394: a9 97 sbiw r28, 0x29 ; 41 30396: 60 81 ld r22, Z 30398: 71 81 ldd r23, Z+1 ; 0x01 3039a: 82 81 ldd r24, Z+2 ; 0x02 3039c: 93 81 ldd r25, Z+3 ; 0x03 3039e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__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; 303a2: a7 01 movw r20, r14 303a4: 96 01 movw r18, r12 303a6: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 303aa: 6a 96 adiw r28, 0x1a ; 26 303ac: 6c af std Y+60, r22 ; 0x3c 303ae: 7d af std Y+61, r23 ; 0x3d 303b0: 8e af std Y+62, r24 ; 0x3e 303b2: 9f af std Y+63, r25 ; 0x3f 303b4: 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) 303b6: 20 e0 ldi r18, 0x00 ; 0 303b8: 30 e0 ldi r19, 0x00 ; 0 303ba: 40 e4 ldi r20, 0x40 ; 64 303bc: 50 e4 ldi r21, 0x40 ; 64 303be: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 303c2: 18 16 cp r1, r24 303c4: 0c f4 brge .+2 ; 0x303c8 303c6: 9e c0 rjmp .+316 ; 0x30504 block->use_advance_lead = false; else if (e_D_ratio > 0) { 303c8: 20 e0 ldi r18, 0x00 ; 0 303ca: 30 e0 ldi r19, 0x00 ; 0 303cc: a9 01 movw r20, r18 303ce: 6a 96 adiw r28, 0x1a ; 26 303d0: 6c ad ldd r22, Y+60 ; 0x3c 303d2: 7d ad ldd r23, Y+61 ; 0x3d 303d4: 8e ad ldd r24, Y+62 ; 0x3e 303d6: 9f ad ldd r25, Y+63 ; 0x3f 303d8: 6a 97 sbiw r28, 0x1a ; 26 303da: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 303de: 18 16 cp r1, r24 303e0: 0c f0 brlt .+2 ; 0x303e4 303e2: 42 c0 rjmp .+132 ; 0x30468 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 303e4: 6a 96 adiw r28, 0x1a ; 26 303e6: 2c ad ldd r18, Y+60 ; 0x3c 303e8: 3d ad ldd r19, Y+61 ; 0x3d 303ea: 4e ad ldd r20, Y+62 ; 0x3e 303ec: 5f ad ldd r21, Y+63 ; 0x3f 303ee: 6a 97 sbiw r28, 0x1a ; 26 303f0: 6d a5 ldd r22, Y+45 ; 0x2d 303f2: 7e a5 ldd r23, Y+46 ; 0x2e 303f4: 8f a5 ldd r24, Y+47 ; 0x2f 303f6: 98 a9 ldd r25, Y+48 ; 0x30 303f8: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 303fc: 9b 01 movw r18, r22 303fe: ac 01 movw r20, r24 30400: 60 91 86 04 lds r22, 0x0486 ; 0x800486 30404: 70 91 87 04 lds r23, 0x0487 ; 0x800487 30408: 80 91 88 04 lds r24, 0x0488 ; 0x800488 3040c: 90 91 89 04 lds r25, 0x0489 ; 0x800489 30410: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 30414: 29 a5 ldd r18, Y+41 ; 0x29 30416: 3a a5 ldd r19, Y+42 ; 0x2a 30418: 4b a5 ldd r20, Y+43 ; 0x2b 3041a: 5c a5 ldd r21, Y+44 ; 0x2c 3041c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30420: 0f 94 83 a2 call 0x34506 ; 0x34506 30424: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 30428: 64 15 cp r22, r4 3042a: 75 05 cpc r23, r5 3042c: 86 05 cpc r24, r6 3042e: 97 05 cpc r25, r7 30430: d8 f4 brcc .+54 ; 0x30468 30432: 2b 01 movw r4, r22 30434: 3c 01 movw r6, r24 30436: 18 c0 rjmp .+48 ; 0x30468 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 30438: 60 91 f2 04 lds r22, 0x04F2 ; 0x8004f2 3043c: 70 91 f3 04 lds r23, 0x04F3 ; 0x8004f3 30440: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 30444: 90 91 f5 04 lds r25, 0x04F5 ; 0x8004f5 30448: f1 ce rjmp .-542 ; 0x3022c * * 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 3044a: 8e e6 ldi r24, 0x6E ; 110 3044c: 82 9d mul r24, r2 3044e: f0 01 movw r30, r0 30450: 83 9d mul r24, r3 30452: f0 0d add r31, r0 30454: 11 24 eor r1, r1 30456: ec 5e subi r30, 0xEC ; 236 30458: f8 4f sbci r31, 0xF8 ; 248 3045a: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 3045c: 6a 96 adiw r28, 0x1a ; 26 3045e: 1c ae std Y+60, r1 ; 0x3c 30460: 1d ae std Y+61, r1 ; 0x3d 30462: 1e ae std Y+62, r1 ; 0x3e 30464: 1f ae std Y+63, r1 ; 0x3f 30466: 6a 97 sbiw r28, 0x1a ; 26 30468: 10 e0 ldi r17, 0x00 ; 0 3046a: 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) 3046c: a3 96 adiw r28, 0x23 ; 35 3046e: ee ad ldd r30, Y+62 ; 0x3e 30470: ff ad ldd r31, Y+63 ; 0x3f 30472: a3 97 sbiw r28, 0x23 ; 35 30474: e0 0f add r30, r16 30476: f1 1f adc r31, r17 30478: e8 53 subi r30, 0x38 ; 56 3047a: f9 4f sbci r31, 0xF9 ; 249 3047c: c0 80 ld r12, Z 3047e: d1 80 ldd r13, Z+1 ; 0x01 30480: e2 80 ldd r14, Z+2 ; 0x02 30482: f3 80 ldd r15, Z+3 ; 0x03 30484: c1 14 cp r12, r1 30486: d1 04 cpc r13, r1 30488: e1 04 cpc r14, r1 3048a: f1 04 cpc r15, r1 3048c: a1 f1 breq .+104 ; 0x304f6 3048e: f8 01 movw r30, r16 30490: eb 51 subi r30, 0x1B ; 27 30492: f9 4e sbci r31, 0xE9 ; 233 30494: 60 81 ld r22, Z 30496: 71 81 ldd r23, Z+1 ; 0x01 30498: 82 81 ldd r24, Z+2 ; 0x02 3049a: 93 81 ldd r25, Z+3 ; 0x03 3049c: 64 15 cp r22, r4 3049e: 75 05 cpc r23, r5 304a0: 86 05 cpc r24, r6 304a2: 97 05 cpc r25, r7 304a4: 40 f5 brcc .+80 ; 0x304f6 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 304a6: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 304aa: 29 ad ldd r18, Y+57 ; 0x39 304ac: 3a ad ldd r19, Y+58 ; 0x3a 304ae: 4b ad ldd r20, Y+59 ; 0x3b 304b0: 5c ad ldd r21, Y+60 ; 0x3c 304b2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 304b6: 4b 01 movw r8, r22 304b8: 5c 01 movw r10, r24 304ba: c7 01 movw r24, r14 304bc: b6 01 movw r22, r12 304be: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 304c2: 9b 01 movw r18, r22 304c4: ac 01 movw r20, r24 304c6: c5 01 movw r24, r10 304c8: b4 01 movw r22, r8 304ca: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 304ce: 6b 01 movw r12, r22 304d0: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 304d2: c3 01 movw r24, r6 304d4: b2 01 movw r22, r4 304d6: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 304da: 9b 01 movw r18, r22 304dc: ac 01 movw r20, r24 304de: c7 01 movw r24, r14 304e0: b6 01 movw r22, r12 304e2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 304e6: 87 ff sbrs r24, 7 304e8: 06 c0 rjmp .+12 ; 0x304f6 304ea: c7 01 movw r24, r14 304ec: b6 01 movw r22, r12 304ee: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 304f2: 2b 01 movw r4, r22 304f4: 3c 01 movw r6, r24 304f6: 0c 5f subi r16, 0xFC ; 252 304f8: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 304fa: 00 31 cpi r16, 0x10 ; 16 304fc: 11 05 cpc r17, r1 304fe: 09 f0 breq .+2 ; 0x30502 30500: b5 cf rjmp .-150 ; 0x3046c 30502: 01 c9 rjmp .-3582 ; 0x2f706 // 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; 30504: d8 01 movw r26, r16 30506: 1c 92 st X, r1 30508: af cf rjmp .-162 ; 0x30468 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 3050a: c9 a6 std Y+41, r12 ; 0x29 3050c: dd a6 std Y+45, r13 ; 0x2d 3050e: e9 ae std Y+57, r14 ; 0x39 30510: f9 aa std Y+49, r15 ; 0x31 limited = true; 30512: 21 e0 ldi r18, 0x01 ; 1 30514: 2d ab std Y+53, r18 ; 0x35 30516: b1 c9 rjmp .-3230 ; 0x2f87a // 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); 30518: 27 96 adiw r28, 0x07 ; 7 3051a: 2f ad ldd r18, Y+63 ; 0x3f 3051c: 27 97 sbiw r28, 0x07 ; 7 3051e: 2b 96 adiw r28, 0x0b ; 11 30520: 3f ad ldd r19, Y+63 ; 0x3f 30522: 2b 97 sbiw r28, 0x0b ; 11 30524: 2f 96 adiw r28, 0x0f ; 15 30526: 4f ad ldd r20, Y+63 ; 0x3f 30528: 2f 97 sbiw r28, 0x0f ; 15 3052a: 63 96 adiw r28, 0x13 ; 19 3052c: 5f ad ldd r21, Y+63 ; 0x3f 3052e: 63 97 sbiw r28, 0x13 ; 19 30530: 6b 96 adiw r28, 0x1b ; 27 30532: 6f ad ldd r22, Y+63 ; 0x3f 30534: 6b 97 sbiw r28, 0x1b ; 27 30536: 6f 96 adiw r28, 0x1f ; 31 30538: 7f ad ldd r23, Y+63 ; 0x3f 3053a: 6f 97 sbiw r28, 0x1f ; 31 3053c: c8 01 movw r24, r16 3053e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 30542: eb 96 adiw r28, 0x3b ; 59 30544: 6c af std Y+60, r22 ; 0x3c 30546: 7d af std Y+61, r23 ; 0x3d 30548: 8e af std Y+62, r24 ; 0x3e 3054a: 9f af std Y+63, r25 ; 0x3f 3054c: 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; 3054e: 6b 96 adiw r28, 0x1b ; 27 30550: ef ad ldd r30, Y+63 ; 0x3f 30552: 6b 97 sbiw r28, 0x1b ; 27 30554: ed af std Y+61, r30 ; 0x3d 30556: 6f 96 adiw r28, 0x1f ; 31 30558: ff ad ldd r31, Y+63 ; 0x3f 3055a: 6f 97 sbiw r28, 0x1f ; 31 3055c: fd ab std Y+53, r31 ; 0x35 3055e: 0e af std Y+62, r16 ; 0x3e 30560: 23 96 adiw r28, 0x03 ; 3 30562: 1f af std Y+63, r17 ; 0x3f 30564: 23 97 sbiw r28, 0x03 ; 3 30566: 04 ca rjmp .-3064 ; 0x2f970 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 30568: f7 fa bst r15, 7 3056a: f0 94 com r15 3056c: f7 f8 bld r15, 7 3056e: f0 94 com r15 30570: a5 01 movw r20, r10 30572: 94 01 movw r18, r8 30574: c7 01 movw r24, r14 30576: b6 01 movw r22, r12 30578: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3057c: 87 ff sbrs r24, 7 3057e: 77 ca rjmp .-2834 ; 0x2fa6e // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 30580: 75 01 movw r14, r10 30582: 64 01 movw r12, r8 30584: 74 ca rjmp .-2840 ; 0x2fa6e // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 30586: c7 01 movw r24, r14 30588: b6 01 movw r22, r12 3058a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3058e: 87 fd sbrc r24, 7 30590: 09 c0 rjmp .+18 ; 0x305a4 30592: 20 e0 ldi r18, 0x00 ; 0 30594: 30 e0 ldi r19, 0x00 ; 0 30596: a9 01 movw r20, r18 30598: c5 01 movw r24, r10 3059a: b4 01 movw r22, r8 3059c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 305a0: 18 16 cp r1, r24 305a2: 2c f4 brge .+10 ; 0x305ae 305a4: a5 01 movw r20, r10 305a6: 94 01 movw r18, r8 305a8: c7 01 movw r24, r14 305aa: b6 01 movw r22, r12 305ac: 5c ca rjmp .-2888 ; 0x2fa66 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 305ae: b7 fa bst r11, 7 305b0: b0 94 com r11 305b2: b7 f8 bld r11, 7 305b4: b0 94 com r11 305b6: a7 01 movw r20, r14 305b8: 96 01 movw r18, r12 305ba: c5 01 movw r24, r10 305bc: b4 01 movw r22, r8 305be: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 305c2: 18 16 cp r1, r24 305c4: 0c f0 brlt .+2 ; 0x305c8 305c6: 53 ca rjmp .-2906 ; 0x2fa6e 305c8: db cf rjmp .-74 ; 0x30580 // 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; 305ca: 8e e6 ldi r24, 0x6E ; 110 305cc: 82 9d mul r24, r2 305ce: f0 01 movw r30, r0 305d0: 83 9d mul r24, r3 305d2: f0 0d add r31, r0 305d4: 11 24 eor r1, r1 305d6: e8 53 subi r30, 0x38 ; 56 305d8: f9 4f sbci r31, 0xF9 ; 249 305da: 85 a9 ldd r24, Z+53 ; 0x35 305dc: 84 60 ori r24, 0x04 ; 4 305de: 85 ab std Z+53, r24 ; 0x35 305e0: a9 a5 ldd r26, Y+41 ; 0x29 305e2: ad af std Y+61, r26 ; 0x3d 305e4: bd a5 ldd r27, Y+45 ; 0x2d 305e6: bd ab std Y+53, r27 ; 0x35 305e8: e9 ad ldd r30, Y+57 ; 0x39 305ea: ee af std Y+62, r30 ; 0x3e 305ec: f9 a9 ldd r31, Y+49 ; 0x31 305ee: 23 96 adiw r28, 0x03 ; 3 305f0: ff af std Y+63, r31 ; 0x3f 305f2: 23 97 sbiw r28, 0x03 ; 3 305f4: bc ca rjmp .-2696 ; 0x2fb6e // 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; 305f6: 81 e0 ldi r24, 0x01 ; 1 305f8: 30 cb rjmp .-2464 ; 0x2fc5a 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]; 305fa: 20 91 86 04 lds r18, 0x0486 ; 0x800486 305fe: 30 91 87 04 lds r19, 0x0487 ; 0x800487 30602: 40 91 88 04 lds r20, 0x0488 ; 0x800488 30606: 50 91 89 04 lds r21, 0x0489 ; 0x800489 3060a: c7 01 movw r24, r14 3060c: b6 01 movw r22, r12 3060e: c1 cb rjmp .-2174 ; 0x2fd92 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) { 30610: 20 e0 ldi r18, 0x00 ; 0 30612: 30 e4 ldi r19, 0x40 ; 64 30614: 4c e1 ldi r20, 0x1C ; 28 30616: 56 e4 ldi r21, 0x46 ; 70 30618: c7 01 movw r24, r14 3061a: b6 01 movw r22, r12 3061c: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 30620: 18 16 cp r1, r24 30622: d4 f4 brge .+52 ; 0x30658 block->advance_rate = advance_rate * 2; 30624: 8e e6 ldi r24, 0x6E ; 110 30626: 82 9d mul r24, r2 30628: 80 01 movw r16, r0 3062a: 83 9d mul r24, r3 3062c: 10 0d add r17, r0 3062e: 11 24 eor r1, r1 30630: 08 53 subi r16, 0x38 ; 56 30632: 19 4f sbci r17, 0xF9 ; 249 30634: 78 01 movw r14, r16 30636: bd e4 ldi r27, 0x4D ; 77 30638: eb 0e add r14, r27 3063a: f1 1c adc r15, r1 3063c: a5 01 movw r20, r10 3063e: 94 01 movw r18, r8 30640: c5 01 movw r24, r10 30642: b4 01 movw r22, r8 30644: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30648: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 3064c: f7 01 movw r30, r14 3064e: 71 83 std Z+1, r23 ; 0x01 30650: 60 83 st Z, r22 block->advance_step_loops = 2; 30652: 36 96 adiw r30, 0x06 ; 6 30654: 82 e0 ldi r24, 0x02 ; 2 30656: e2 cb rjmp .-2108 ; 0x2fe1c } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 30658: 20 e0 ldi r18, 0x00 ; 0 3065a: 3f ef ldi r19, 0xFF ; 255 3065c: 4f e7 ldi r20, 0x7F ; 127 3065e: 57 e4 ldi r21, 0x47 ; 71 30660: c5 01 movw r24, r10 30662: b4 01 movw r22, r8 30664: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 30668: 87 ff sbrs r24, 7 3066a: 19 c0 rjmp .+50 ; 0x3069e block->advance_rate = advance_rate; 3066c: 8e e6 ldi r24, 0x6E ; 110 3066e: 82 9d mul r24, r2 30670: 80 01 movw r16, r0 30672: 83 9d mul r24, r3 30674: 10 0d add r17, r0 30676: 11 24 eor r1, r1 30678: 0b 5e subi r16, 0xEB ; 235 3067a: 18 4f sbci r17, 0xF8 ; 248 3067c: c5 01 movw r24, r10 3067e: b4 01 movw r22, r8 30680: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 30684: d8 01 movw r26, r16 30686: 6d 93 st X+, r22 30688: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 3068a: 8e e6 ldi r24, 0x6E ; 110 3068c: 82 9d mul r24, r2 3068e: f0 01 movw r30, r0 30690: 83 9d mul r24, r3 30692: f0 0d add r31, r0 30694: 11 24 eor r1, r1 30696: e5 5e subi r30, 0xE5 ; 229 30698: f8 4f sbci r31, 0xF8 ; 248 3069a: 81 e0 ldi r24, 0x01 ; 1 3069c: bf cb rjmp .-2178 ; 0x2fe1c { // 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; 3069e: 8e e6 ldi r24, 0x6E ; 110 306a0: 82 9d mul r24, r2 306a2: f0 01 movw r30, r0 306a4: 83 9d mul r24, r3 306a6: f0 0d add r31, r0 306a8: 11 24 eor r1, r1 306aa: eb 5e subi r30, 0xEB ; 235 306ac: f8 4f sbci r31, 0xF8 ; 248 306ae: 8f ef ldi r24, 0xFF ; 255 306b0: 9f ef ldi r25, 0xFF ; 255 306b2: 91 83 std Z+1, r25 ; 0x01 306b4: 80 83 st Z, r24 306b6: e9 cf rjmp .-46 ; 0x3068a 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) { 306b8: f6 01 movw r30, r12 306ba: 71 a4 ldd r7, Z+41 ; 0x29 306bc: 82 a4 ldd r8, Z+42 ; 0x2a 306be: 93 a4 ldd r9, Z+43 ; 0x2b 306c0: e4 a4 ldd r14, Z+44 ; 0x2c 306c2: 27 2d mov r18, r7 306c4: 38 2d mov r19, r8 306c6: 49 2d mov r20, r9 306c8: 5e 2d mov r21, r14 306ca: 65 a1 ldd r22, Z+37 ; 0x25 306cc: 76 a1 ldd r23, Z+38 ; 0x26 306ce: 87 a1 ldd r24, Z+39 ; 0x27 306d0: 90 a5 ldd r25, Z+40 ; 0x28 306d2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 306d6: 88 23 and r24, r24 306d8: 09 f4 brne .+2 ; 0x306dc 306da: 51 c0 rjmp .+162 ; 0x3077e // 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) ? 306dc: 01 fd sbrc r16, 1 306de: 44 c0 rjmp .+136 ; 0x30768 306e0: d5 01 movw r26, r10 306e2: 95 96 adiw r26, 0x25 ; 37 306e4: 2d 90 ld r2, X+ 306e6: 3d 90 ld r3, X+ 306e8: 4d 90 ld r4, X+ 306ea: 5c 90 ld r5, X 306ec: 98 97 sbiw r26, 0x28 ; 40 306ee: a2 01 movw r20, r4 306f0: 91 01 movw r18, r2 306f2: 67 2d mov r22, r7 306f4: 78 2d mov r23, r8 306f6: 89 2d mov r24, r9 306f8: 9e 2d mov r25, r14 306fa: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 306fe: 18 16 cp r1, r24 30700: 9c f5 brge .+102 ; 0x30768 // 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); 30702: a2 01 movw r20, r4 30704: 91 01 movw r18, r2 30706: c2 01 movw r24, r4 30708: b1 01 movw r22, r2 3070a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3070e: 1b 01 movw r2, r22 30710: 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)); 30712: f6 01 movw r30, r12 30714: 61 a9 ldd r22, Z+49 ; 0x31 30716: 72 a9 ldd r23, Z+50 ; 0x32 30718: 83 a9 ldd r24, Z+51 ; 0x33 3071a: 94 a9 ldd r25, Z+52 ; 0x34 3071c: 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); 3071e: 9b 01 movw r18, r22 30720: ac 01 movw r20, r24 30722: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30726: d6 01 movw r26, r12 30728: 9d 96 adiw r26, 0x2d ; 45 3072a: 2d 91 ld r18, X+ 3072c: 3d 91 ld r19, X+ 3072e: 4d 91 ld r20, X+ 30730: 5c 91 ld r21, X 30732: d0 97 sbiw r26, 0x30 ; 48 30734: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30738: 9b 01 movw r18, r22 3073a: ac 01 movw r20, r24 3073c: c2 01 movw r24, r4 3073e: b1 01 movw r22, r2 30740: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30744: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 30748: 2b 01 movw r4, r22 3074a: 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)); 3074c: 9b 01 movw r18, r22 3074e: ac 01 movw r20, r24 30750: 67 2d mov r22, r7 30752: 78 2d mov r23, r8 30754: 89 2d mov r24, r9 30756: 9e 2d mov r25, r14 30758: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3075c: 87 fd sbrc r24, 7 3075e: 04 c0 rjmp .+8 ; 0x30768 30760: 74 2c mov r7, r4 30762: 85 2c mov r8, r5 30764: 9a 2c mov r9, r10 30766: 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) ? 30768: 87 2d mov r24, r7 3076a: 98 2d mov r25, r8 3076c: a9 2d mov r26, r9 3076e: be 2d mov r27, r14 30770: f6 01 movw r30, r12 30772: 85 a3 std Z+37, r24 ; 0x25 30774: 96 a3 std Z+38, r25 ; 0x26 30776: a7 a3 std Z+39, r26 ; 0x27 30778: 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; 3077a: 01 60 ori r16, 0x01 ; 1 3077c: 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) 3077e: 11 11 cpse r17, r1 30780: 01 c0 rjmp .+2 ; 0x30784 block_index = BLOCK_BUFFER_SIZE; 30782: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 30784: 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)); 30786: 16 9d mul r17, r6 30788: c0 01 movw r24, r0 3078a: 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; 3078c: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 3078e: 9c 01 movw r18, r24 30790: 28 53 subi r18, 0x38 ; 56 30792: 39 4f sbci r19, 0xF9 ; 249 30794: 69 01 movw r12, r18 30796: 0b cc rjmp .-2026 ; 0x2ffae 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)); 30798: 6c 01 movw r12, r24 3079a: 2f cc rjmp .-1954 ; 0x2fffa 3079c: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 3079e: 0d 94 2a 76 jmp 0x2ec54 ; 0x2ec54 000307a2 : 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(){ 307a2: 4f 92 push r4 307a4: 5f 92 push r5 307a6: 6f 92 push r6 307a8: 7f 92 push r7 307aa: 8f 92 push r8 307ac: 9f 92 push r9 307ae: af 92 push r10 307b0: bf 92 push r11 307b2: cf 92 push r12 307b4: df 92 push r13 307b6: ef 92 push r14 307b8: ff 92 push r15 307ba: cf 93 push r28 307bc: df 93 push r29 307be: cd b7 in r28, 0x3d ; 61 307c0: de b7 in r29, 0x3e ; 62 307c2: 2c 97 sbiw r28, 0x0c ; 12 307c4: 0f b6 in r0, 0x3f ; 63 307c6: f8 94 cli 307c8: de bf out 0x3e, r29 ; 62 307ca: 0f be out 0x3f, r0 ; 63 307cc: 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]); 307ce: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 307d2: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 307d6: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 307da: f0 90 00 12 lds r15, 0x1200 ; 0x801200 307de: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 307e2: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa 307e6: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb 307ea: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc 307ee: 40 91 f5 11 lds r20, 0x11F5 ; 0x8011f5 307f2: 50 91 f6 11 lds r21, 0x11F6 ; 0x8011f6 307f6: 60 91 f7 11 lds r22, 0x11F7 ; 0x8011f7 307fa: 70 91 f8 11 lds r23, 0x11F8 ; 0x8011f8 307fe: 4d 83 std Y+5, r20 ; 0x05 30800: 5e 83 std Y+6, r21 ; 0x06 30802: 6f 83 std Y+7, r22 ; 0x07 30804: 78 87 std Y+8, r23 ; 0x08 30806: 89 83 std Y+1, r24 ; 0x01 30808: 9a 83 std Y+2, r25 ; 0x02 3080a: ab 83 std Y+3, r26 ; 0x03 3080c: 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); 3080e: be 01 movw r22, r28 30810: 6f 5f subi r22, 0xFF ; 255 30812: 7f 4f sbci r23, 0xFF ; 255 30814: ce 01 movw r24, r28 30816: 05 96 adiw r24, 0x05 ; 5 30818: 0e 94 89 63 call 0xc712 ; 0xc712 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 3081c: 4d 80 ldd r4, Y+5 ; 0x05 3081e: 5e 80 ldd r5, Y+6 ; 0x06 30820: 6f 80 ldd r6, Y+7 ; 0x07 30822: 78 84 ldd r7, Y+8 ; 0x08 30824: 20 91 36 04 lds r18, 0x0436 ; 0x800436 30828: 30 91 37 04 lds r19, 0x0437 ; 0x800437 3082c: 40 91 38 04 lds r20, 0x0438 ; 0x800438 30830: 50 91 39 04 lds r21, 0x0439 ; 0x800439 30834: c3 01 movw r24, r6 30836: b2 01 movw r22, r4 30838: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3083c: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 30840: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30844: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30848: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 3084c: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 30850: 89 80 ldd r8, Y+1 ; 0x01 30852: 9a 80 ldd r9, Y+2 ; 0x02 30854: ab 80 ldd r10, Y+3 ; 0x03 30856: bc 80 ldd r11, Y+4 ; 0x04 30858: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 3085c: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 30860: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 30864: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 30868: c5 01 movw r24, r10 3086a: b4 01 movw r22, r8 3086c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30870: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 30874: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30878: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 3087c: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 30880: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 30884: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30888: 88 23 and r24, r24 3088a: 09 f4 brne .+2 ; 0x3088e 3088c: 8c c0 rjmp .+280 ; 0x309a6 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 3088e: a5 01 movw r20, r10 30890: 94 01 movw r18, r8 30892: c3 01 movw r24, r6 30894: b2 01 movw r22, r4 30896: 0f 94 a9 60 call 0x2c152 ; 0x2c152 3089a: 9b 01 movw r18, r22 3089c: ac 01 movw r20, r24 3089e: c7 01 movw r24, r14 308a0: b6 01 movw r22, r12 308a2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 308a6: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 308aa: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 308ae: 40 91 40 04 lds r20, 0x0440 ; 0x800440 308b2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 308b6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__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 ? 308ba: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 308be: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 308c2: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 308c6: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 308ca: 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]); 308ce: 80 91 01 12 lds r24, 0x1201 ; 0x801201 308d2: 90 91 02 12 lds r25, 0x1202 ; 0x801202 308d6: a0 91 03 12 lds r26, 0x1203 ; 0x801203 308da: b0 91 04 12 lds r27, 0x1204 ; 0x801204 308de: 89 87 std Y+9, r24 ; 0x09 308e0: 9a 87 std Y+10, r25 ; 0x0a 308e2: ab 87 std Y+11, r26 ; 0x0b 308e4: bc 87 std Y+12, r27 ; 0x0c 308e6: 20 91 42 04 lds r18, 0x0442 ; 0x800442 308ea: 30 91 43 04 lds r19, 0x0443 ; 0x800443 308ee: 40 91 44 04 lds r20, 0x0444 ; 0x800444 308f2: 50 91 45 04 lds r21, 0x0445 ; 0x800445 308f6: bc 01 movw r22, r24 308f8: cd 01 movw r24, r26 308fa: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 308fe: 0f 94 e2 a4 call 0x349c4 ; 0x349c4 30902: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30906: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 3090a: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 3090e: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 30912: 40 92 04 04 sts 0x0404, r4 ; 0x800404 30916: 50 92 05 04 sts 0x0405, r5 ; 0x800405 3091a: 60 92 06 04 sts 0x0406, r6 ; 0x800406 3091e: 70 92 07 04 sts 0x0407, r7 ; 0x800407 position_float[Y_AXIS] = y; 30922: 80 92 08 04 sts 0x0408, r8 ; 0x800408 30926: 90 92 09 04 sts 0x0409, r9 ; 0x800409 3092a: a0 92 0a 04 sts 0x040A, r10 ; 0x80040a 3092e: b0 92 0b 04 sts 0x040B, r11 ; 0x80040b position_float[Z_AXIS] = z; 30932: c0 92 0c 04 sts 0x040C, r12 ; 0x80040c 30936: d0 92 0d 04 sts 0x040D, r13 ; 0x80040d 3093a: e0 92 0e 04 sts 0x040E, r14 ; 0x80040e 3093e: f0 92 0f 04 sts 0x040F, r15 ; 0x80040f position_float[E_AXIS] = e; 30942: 89 85 ldd r24, Y+9 ; 0x09 30944: 9a 85 ldd r25, Y+10 ; 0x0a 30946: ab 85 ldd r26, Y+11 ; 0x0b 30948: bc 85 ldd r27, Y+12 ; 0x0c 3094a: 80 93 10 04 sts 0x0410, r24 ; 0x800410 3094e: 90 93 11 04 sts 0x0411, r25 ; 0x800411 30952: a0 93 12 04 sts 0x0412, r26 ; 0x800412 30956: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif st_set_position(position); 3095a: 0f 94 14 54 call 0x2a828 ; 0x2a828 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 3095e: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 30962: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 30966: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 3096a: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3096e: e4 ef ldi r30, 0xF4 ; 244 30970: f3 e0 ldi r31, 0x03 ; 3 30972: 80 e1 ldi r24, 0x10 ; 16 30974: df 01 movw r26, r30 30976: 1d 92 st X+, r1 30978: 8a 95 dec r24 3097a: e9 f7 brne .-6 ; 0x30976 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]); } 3097c: 2c 96 adiw r28, 0x0c ; 12 3097e: 0f b6 in r0, 0x3f ; 63 30980: f8 94 cli 30982: de bf out 0x3e, r29 ; 62 30984: 0f be out 0x3f, r0 ; 63 30986: cd bf out 0x3d, r28 ; 61 30988: df 91 pop r29 3098a: cf 91 pop r28 3098c: ff 90 pop r15 3098e: ef 90 pop r14 30990: df 90 pop r13 30992: cf 90 pop r12 30994: bf 90 pop r11 30996: af 90 pop r10 30998: 9f 90 pop r9 3099a: 8f 90 pop r8 3099c: 7f 90 pop r7 3099e: 6f 90 pop r6 309a0: 5f 90 pop r5 309a2: 4f 90 pop r4 309a4: 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]); 309a6: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 309aa: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 309ae: 40 91 40 04 lds r20, 0x0440 ; 0x800440 309b2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 309b6: c7 01 movw r24, r14 309b8: b6 01 movw r22, r12 309ba: 7d cf rjmp .-262 ; 0x308b6 000309bc : 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) { 309bc: 8f 92 push r8 309be: 9f 92 push r9 309c0: af 92 push r10 309c2: bf 92 push r11 309c4: cf 92 push r12 309c6: df 92 push r13 309c8: ef 92 push r14 309ca: ff 92 push r15 309cc: 0f 93 push r16 309ce: 1f 93 push r17 309d0: 4b 01 movw r8, r22 309d2: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 309d4: e3 e9 ldi r30, 0x93 ; 147 309d6: f6 e0 ldi r31, 0x06 ; 6 309d8: e0 84 ldd r14, Z+8 ; 0x08 309da: f1 84 ldd r15, Z+9 ; 0x09 309dc: 02 85 ldd r16, Z+10 ; 0x0a 309de: 13 85 ldd r17, Z+11 ; 0x0b 309e0: 24 81 ldd r18, Z+4 ; 0x04 309e2: 35 81 ldd r19, Z+5 ; 0x05 309e4: 46 81 ldd r20, Z+6 ; 0x06 309e6: 57 81 ldd r21, Z+7 ; 0x07 309e8: 60 81 ld r22, Z 309ea: 71 81 ldd r23, Z+1 ; 0x01 309ec: 82 81 ldd r24, Z+2 ; 0x02 309ee: 93 81 ldd r25, Z+3 ; 0x03 309f0: 1f 92 push r1 309f2: 1f 92 push r1 309f4: 1f 92 push r1 309f6: 1f 92 push r1 309f8: ef e9 ldi r30, 0x9F ; 159 309fa: ce 2e mov r12, r30 309fc: e6 e0 ldi r30, 0x06 ; 6 309fe: de 2e mov r13, r30 30a00: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 30a04: 0f 90 pop r0 30a06: 0f 90 pop r0 30a08: 0f 90 pop r0 30a0a: 0f 90 pop r0 } 30a0c: 1f 91 pop r17 30a0e: 0f 91 pop r16 30a10: ff 90 pop r15 30a12: ef 90 pop r14 30a14: df 90 pop r13 30a16: cf 90 pop r12 30a18: bf 90 pop r11 30a1a: af 90 pop r10 30a1c: 9f 90 pop r9 30a1e: 8f 90 pop r8 30a20: 08 95 ret 00030a22 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 30a22: 8f 92 push r8 30a24: 9f 92 push r9 30a26: af 92 push r10 30a28: bf 92 push r11 30a2a: cf 92 push r12 30a2c: df 92 push r13 30a2e: ef 92 push r14 30a30: ff 92 push r15 30a32: 0f 93 push r16 30a34: 1f 93 push r17 30a36: 4b 01 movw r8, r22 30a38: 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); 30a3a: e5 ef ldi r30, 0xF5 ; 245 30a3c: f1 e1 ldi r31, 0x11 ; 17 30a3e: e0 84 ldd r14, Z+8 ; 0x08 30a40: f1 84 ldd r15, Z+9 ; 0x09 30a42: 02 85 ldd r16, Z+10 ; 0x0a 30a44: 13 85 ldd r17, Z+11 ; 0x0b 30a46: 24 81 ldd r18, Z+4 ; 0x04 30a48: 35 81 ldd r19, Z+5 ; 0x05 30a4a: 46 81 ldd r20, Z+6 ; 0x06 30a4c: 57 81 ldd r21, Z+7 ; 0x07 30a4e: 60 81 ld r22, Z 30a50: 71 81 ldd r23, Z+1 ; 0x01 30a52: 82 81 ldd r24, Z+2 ; 0x02 30a54: 93 81 ldd r25, Z+3 ; 0x03 30a56: 1f 92 push r1 30a58: 1f 92 push r1 30a5a: 1f 92 push r1 30a5c: 1f 92 push r1 30a5e: e1 e0 ldi r30, 0x01 ; 1 30a60: ce 2e mov r12, r30 30a62: e2 e1 ldi r30, 0x12 ; 18 30a64: de 2e mov r13, r30 30a66: 0f 94 c3 75 call 0x2eb86 ; 0x2eb86 30a6a: 0f 90 pop r0 30a6c: 0f 90 pop r0 30a6e: 0f 90 pop r0 30a70: 0f 90 pop r0 } 30a72: 1f 91 pop r17 30a74: 0f 91 pop r16 30a76: ff 90 pop r15 30a78: ef 90 pop r14 30a7a: df 90 pop r13 30a7c: cf 90 pop r12 30a7e: bf 90 pop r11 30a80: af 90 pop r10 30a82: 9f 90 pop r9 30a84: 8f 90 pop r8 30a86: 08 95 ret 00030a88 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 30a88: 4f 92 push r4 30a8a: 5f 92 push r5 30a8c: 6f 92 push r6 30a8e: 7f 92 push r7 30a90: 8f 92 push r8 30a92: 9f 92 push r9 30a94: af 92 push r10 30a96: bf 92 push r11 30a98: cf 92 push r12 30a9a: df 92 push r13 30a9c: ef 92 push r14 30a9e: ff 92 push r15 30aa0: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 30aa2: 80 e0 ldi r24, 0x00 ; 0 30aa4: 0f 94 f2 21 call 0x243e4 ; 0x243e4 30aa8: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30aac: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30ab0: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 30ab4: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = st_get_position(Y_AXIS); 30ab8: 81 e0 ldi r24, 0x01 ; 1 30aba: 0f 94 f2 21 call 0x243e4 ; 0x243e4 30abe: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30ac2: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 30ac6: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 30aca: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad position[Z_AXIS] = st_get_position(Z_AXIS); 30ace: 82 e0 ldi r24, 0x02 ; 2 30ad0: 0f 94 f2 21 call 0x243e4 ; 0x243e4 30ad4: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30ad8: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30adc: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30ae0: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 position[E_AXIS] = st_get_position(E_AXIS); 30ae4: 83 e0 ldi r24, 0x03 ; 3 30ae6: 0f 94 f2 21 call 0x243e4 ; 0x243e4 30aea: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30aee: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 30af2: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 30af6: 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); 30afa: 80 e0 ldi r24, 0x00 ; 0 30afc: 0f 94 00 22 call 0x24400 ; 0x24400 30b00: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30b04: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30b08: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30b0c: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 30b10: 81 e0 ldi r24, 0x01 ; 1 30b12: 0f 94 00 22 call 0x24400 ; 0x24400 30b16: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30b1a: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30b1e: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30b22: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 30b26: 82 e0 ldi r24, 0x02 ; 2 30b28: 0f 94 00 22 call 0x24400 ; 0x24400 30b2c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30b30: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30b34: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30b38: 90 93 00 12 sts 0x1200, r25 ; 0x801200 current_position[E_AXIS] = st_get_position_mm(E_AXIS); 30b3c: 83 e0 ldi r24, 0x03 ; 3 30b3e: 0f 94 00 22 call 0x24400 ; 0x24400 30b42: 60 93 01 12 sts 0x1201, r22 ; 0x801201 30b46: 70 93 02 12 sts 0x1202, r23 ; 0x801202 30b4a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 30b4e: 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) { 30b52: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30b56: 88 23 and r24, r24 30b58: 31 f1 breq .+76 ; 0x30ba6 #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]); 30b5a: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 30b5e: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa 30b62: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb 30b66: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc 30b6a: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30b6e: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30b72: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30b76: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30b7a: 0f 94 a9 60 call 0x2c152 ; 0x2c152 30b7e: 9b 01 movw r18, r22 30b80: ac 01 movw r20, r24 30b82: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 30b86: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 30b8a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 30b8e: 90 91 00 12 lds r25, 0x1200 ; 0x801200 30b92: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30b96: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30b9a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30b9e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30ba2: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 30ba6: c0 91 dc 16 lds r28, 0x16DC ; 0x8016dc 30baa: cc 23 and r28, r28 30bac: 09 f4 brne .+2 ; 0x30bb0 30bae: 9a c0 rjmp .+308 ; 0x30ce4 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 30bb0: c0 ff sbrs r28, 0 30bb2: 34 c0 rjmp .+104 ; 0x30c1c // Then add the offset. x -= world2machine_shift[0]; 30bb4: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 30bb8: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 30bbc: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 30bc0: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 30bc4: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30bc8: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30bcc: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30bd0: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30bd4: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30bd8: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30bdc: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30be0: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30be4: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y -= world2machine_shift[1]; 30be8: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 30bec: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 30bf0: 40 91 da 16 lds r20, 0x16DA ; 0x8016da 30bf4: 50 91 db 16 lds r21, 0x16DB ; 0x8016db 30bf8: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 30bfc: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 30c00: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 30c04: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 30c08: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 30c0c: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30c10: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30c14: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30c18: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 30c1c: c1 ff sbrs r28, 1 30c1e: 62 c0 rjmp .+196 ; 0x30ce4 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 30c20: 80 90 f5 11 lds r8, 0x11F5 ; 0x8011f5 30c24: 90 90 f6 11 lds r9, 0x11F6 ; 0x8011f6 30c28: a0 90 f7 11 lds r10, 0x11F7 ; 0x8011f7 30c2c: b0 90 f8 11 lds r11, 0x11F8 ; 0x8011f8 30c30: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 30c34: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 30c38: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 30c3c: 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; 30c40: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc 30c44: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd 30c48: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce 30c4c: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf 30c50: c5 01 movw r24, r10 30c52: b4 01 movw r22, r8 30c54: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30c58: 2b 01 movw r4, r22 30c5a: 3c 01 movw r6, r24 30c5c: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 30c60: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 30c64: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 30c68: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 30c6c: c7 01 movw r24, r14 30c6e: b6 01 movw r22, r12 30c70: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30c74: 9b 01 movw r18, r22 30c76: ac 01 movw r20, r24 30c78: c3 01 movw r24, r6 30c7a: b2 01 movw r22, r4 30c7c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30c80: 2b 01 movw r4, r22 30c82: 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; 30c84: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 30c88: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 30c8c: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 30c90: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 30c94: c5 01 movw r24, r10 30c96: b4 01 movw r22, r8 30c98: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30c9c: 4b 01 movw r8, r22 30c9e: 5c 01 movw r10, r24 30ca0: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 30ca4: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 30ca8: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca 30cac: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb 30cb0: c7 01 movw r24, r14 30cb2: b6 01 movw r22, r12 30cb4: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 30cb8: 9b 01 movw r18, r22 30cba: ac 01 movw r20, r24 30cbc: c5 01 movw r24, r10 30cbe: b4 01 movw r22, r8 30cc0: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 30cc4: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30cc8: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30ccc: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30cd0: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y = out_y; 30cd4: 40 92 f9 11 sts 0x11F9, r4 ; 0x8011f9 30cd8: 50 92 fa 11 sts 0x11FA, r5 ; 0x8011fa 30cdc: 60 92 fb 11 sts 0x11FB, r6 ; 0x8011fb 30ce0: 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(); 30ce4: 0e 94 c1 61 call 0xc382 ; 0xc382 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 30ce8: 80 e1 ldi r24, 0x10 ; 16 30cea: e5 ef ldi r30, 0xF5 ; 245 30cec: f1 e1 ldi r31, 0x11 ; 17 30cee: a4 e0 ldi r26, 0x04 ; 4 30cf0: b4 e0 ldi r27, 0x04 ; 4 30cf2: 01 90 ld r0, Z+ 30cf4: 0d 92 st X+, r0 30cf6: 8a 95 dec r24 30cf8: e1 f7 brne .-8 ; 0x30cf2 #endif } 30cfa: cf 91 pop r28 30cfc: ff 90 pop r15 30cfe: ef 90 pop r14 30d00: df 90 pop r13 30d02: cf 90 pop r12 30d04: bf 90 pop r11 30d06: af 90 pop r10 30d08: 9f 90 pop r9 30d0a: 8f 90 pop r8 30d0c: 7f 90 pop r7 30d0e: 6f 90 pop r6 30d10: 5f 90 pop r5 30d12: 4f 90 pop r4 30d14: 08 95 ret 00030d16 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 30d16: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30d1a: 8d 7f andi r24, 0xFD ; 253 30d1c: 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(); 30d20: 0f 94 44 85 call 0x30a88 ; 0x30a88 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 30d24: 81 e0 ldi r24, 0x01 ; 1 30d26: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 30d2a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30d2e: 8d 7f andi r24, 0xFD ; 253 30d30: 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); 30d34: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30d38: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (blocks_queued()) plan_discard_current_block(); 30d3c: 98 17 cp r25, r24 30d3e: 69 f0 breq .+26 ; 0x30d5a 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) { 30d40: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30d44: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30d48: 98 17 cp r25, r24 30d4a: a1 f3 breq .-24 ; 0x30d34 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 30d4c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30d50: 8f 5f subi r24, 0xFF ; 255 30d52: 8f 70 andi r24, 0x0F ; 15 30d54: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 30d58: ed cf rjmp .-38 ; 0x30d34 current_block = NULL; 30d5a: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 30d5e: 10 92 e4 11 sts 0x11E4, r1 ; 0x8011e4 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 30d62: 8f ef ldi r24, 0xFF ; 255 30d64: 9f ef ldi r25, 0xFF ; 255 30d66: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.434+0x1> 30d6a: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.434> current_adv_steps = 0; 30d6e: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.436+0x1> 30d72: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.436> #endif st_reset_timer(); 30d76: 0f 94 20 22 call 0x24440 ; 0x24440 ENABLE_STEPPER_DRIVER_INTERRUPT(); 30d7a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30d7e: 82 60 ori r24, 0x02 ; 2 30d80: 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; 30d84: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.448> 30d88: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.448+0x1> 30d8c: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.448+0x2> 30d90: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.448+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 30d94: e4 ef ldi r30, 0xF4 ; 244 30d96: f3 e0 ldi r31, 0x03 ; 3 30d98: 80 e1 ldi r24, 0x10 ; 16 30d9a: df 01 movw r26, r30 30d9c: 1d 92 st X+, r1 30d9e: 8a 95 dec r24 30da0: e9 f7 brne .-6 ; 0x30d9c // Reset position sync requests plan_reset_next_e_queue = false; 30da2: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.446> plan_reset_next_e_sched = false; 30da6: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.447> } 30daa: 08 95 ret 00030dac : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 30dac: 81 e0 ldi r24, 0x01 ; 1 30dae: 0c 94 4b 6a jmp 0xd496 ; 0xd496 00030db2 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 30db2: 0f 93 push r16 30db4: 1f 93 push r17 30db6: cf 93 push r28 30db8: 8c 01 movw r16, r24 30dba: c6 2f mov r28, r22 lcd_update_enable(false); 30dbc: 80 e0 ldi r24, 0x00 ; 0 30dbe: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 30dc2: 0e 94 39 6a call 0xd472 ; 0xd472 lcd_puts_at_P(0, 1, pgmS); 30dc6: a8 01 movw r20, r16 30dc8: 61 e0 ldi r22, 0x01 ; 1 30dca: 80 e0 ldi r24, 0x00 ; 0 30dcc: 0e 94 1a 6a call 0xd434 ; 0xd434 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 30dd0: 80 e2 ldi r24, 0x20 ; 32 30dd2: 0e 94 b5 6a call 0xd56a ; 0xd56a lcd_print(' '); lcd_print(slot + 1); 30dd6: 6c 2f mov r22, r28 30dd8: 70 e0 ldi r23, 0x00 ; 0 30dda: 6f 5f subi r22, 0xFF ; 255 30ddc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 30dde: 07 2e mov r0, r23 30de0: 00 0c add r0, r0 30de2: 88 0b sbc r24, r24 30de4: 99 0b sbc r25, r25 } 30de6: cf 91 pop r28 30de8: 1f 91 pop r17 30dea: 0f 91 pop r16 30dec: 0c 94 bf 6b jmp 0xd77e ; 0xd77e 00030df0 : 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); 30df0: 82 ed ldi r24, 0xD2 ; 210 30df2: 9e e0 ldi r25, 0x0E ; 14 30df4: 0e 94 97 6f call 0xdf2e ; 0xdf2e eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 30df8: 83 ed ldi r24, 0xD3 ; 211 30dfa: 9e e0 ldi r25, 0x0E ; 14 30dfc: 0c 94 8a 6f jmp 0xdf14 ; 0xdf14 00030e00 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 30e00: 41 e0 ldi r20, 0x01 ; 1 30e02: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 30e06: 81 11 cpse r24, r1 30e08: 01 c0 rjmp .+2 ; 0x30e0c 30e0a: 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'); 30e0c: 40 5d subi r20, 0xD0 ; 208 30e0e: 62 e0 ldi r22, 0x02 ; 2 30e10: 83 e0 ldi r24, 0x03 ; 3 30e12: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 30e16: 0e 94 f7 c3 call 0x187ee ; 0x187ee 30e1a: 40 e3 ldi r20, 0x30 ; 48 30e1c: 48 0f add r20, r24 30e1e: 62 e0 ldi r22, 0x02 ; 2 30e20: 88 e0 ldi r24, 0x08 ; 8 30e22: 0e 94 26 6a call 0xd44c ; 0xd44c // print active/changing filament slot lcd_set_cursor(10, 2); 30e26: 62 e0 ldi r22, 0x02 ; 2 30e28: 8a e0 ldi r24, 0x0A ; 10 30e2a: 0e 94 06 6a call 0xd40c ; 0xd40c lcdui_print_extruder(); 30e2e: 0f 94 c6 0c call 0x2198c ; 0x2198c // Print active extruder temperature lcd_set_cursor(16, 2); 30e32: 62 e0 ldi r22, 0x02 ; 2 30e34: 80 e1 ldi r24, 0x10 ; 16 30e36: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 30e3a: 20 e0 ldi r18, 0x00 ; 0 30e3c: 30 e0 ldi r19, 0x00 ; 0 30e3e: 40 e0 ldi r20, 0x00 ; 0 30e40: 5f e3 ldi r21, 0x3F ; 63 30e42: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 30e46: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 30e4a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 30e4e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 30e52: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30e56: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> 30e5a: 7f 93 push r23 30e5c: 6f 93 push r22 30e5e: 80 ec ldi r24, 0xC0 ; 192 30e60: 9e e9 ldi r25, 0x9E ; 158 30e62: 9f 93 push r25 30e64: 8f 93 push r24 30e66: 0e 94 df 69 call 0xd3be ; 0xd3be 30e6a: 0f 90 pop r0 30e6c: 0f 90 pop r0 30e6e: 0f 90 pop r0 30e70: 0f 90 pop r0 } 30e72: 08 95 ret 00030e74 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 30e74: 8a 30 cpi r24, 0x0A ; 10 30e76: 20 f0 brcs .+8 ; 0x30e80 30e78: 80 31 cpi r24, 0x10 ; 16 30e7a: 20 f4 brcc .+8 ; 0x30e84 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 30e7c: 89 5a subi r24, 0xA9 ; 169 30e7e: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 30e80: 80 5d subi r24, 0xD0 ; 208 30e82: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 30e84: 80 e0 ldi r24, 0x00 ; 0 } } 30e86: 08 95 ret 00030e88 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 30e88: 0f 93 push r16 30e8a: 1f 93 push r17 30e8c: cf 93 push r28 30e8e: df 93 push r29 30e90: 08 2f mov r16, r24 30e92: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 30e94: 90 e0 ldi r25, 0x00 ; 0 30e96: 24 e0 ldi r18, 0x04 ; 4 30e98: 95 95 asr r25 30e9a: 87 95 ror r24 30e9c: 2a 95 dec r18 30e9e: e1 f7 brne .-8 ; 0x30e98 uint8_t charsOut = 1; 30ea0: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 30ea2: 00 97 sbiw r24, 0x00 ; 0 30ea4: 21 f0 breq .+8 ; 0x30eae *dst = Nibble2Char(v); 30ea6: 0f 94 3a 87 call 0x30e74 ; 0x30e74 30eaa: 89 93 st Y+, r24 ++dst; charsOut = 2; 30eac: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 30eae: 80 2f mov r24, r16 30eb0: 8f 70 andi r24, 0x0F ; 15 30eb2: 0f 94 3a 87 call 0x30e74 ; 0x30e74 30eb6: 88 83 st Y, r24 return charsOut; } 30eb8: 81 2f mov r24, r17 30eba: df 91 pop r29 30ebc: cf 91 pop r28 30ebe: 1f 91 pop r17 30ec0: 0f 91 pop r16 30ec2: 08 95 ret 00030ec4 : } 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) { 30ec4: 80 33 cpi r24, 0x30 ; 48 30ec6: 30 f0 brcs .+12 ; 0x30ed4 30ec8: 8a 33 cpi r24, 0x3A ; 58 30eca: 30 f0 brcs .+12 ; 0x30ed8 30ecc: 9f e9 ldi r25, 0x9F ; 159 30ece: 98 0f add r25, r24 30ed0: 96 30 cpi r25, 0x06 ; 6 30ed2: 20 f0 brcs .+8 ; 0x30edc case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 30ed4: 80 e0 ldi r24, 0x00 ; 0 } } 30ed6: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 30ed8: 80 53 subi r24, 0x30 ; 48 30eda: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 30edc: 87 55 subi r24, 0x57 ; 87 30ede: 08 95 ret 00030ee0 : /// 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 { 30ee0: cf 93 push r28 30ee2: df 93 push r29 30ee4: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 30ee6: 68 81 ld r22, Y 30ee8: 80 e0 ldi r24, 0x00 ; 0 30eea: 0f 94 2f 6c call 0x2d85e ; 0x2d85e crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 30eee: 69 81 ldd r22, Y+1 ; 0x01 30ef0: 0f 94 2f 6c call 0x2d85e ; 0x2d85e crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 30ef4: 6a 81 ldd r22, Y+2 ; 0x02 30ef6: 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]); 30ef8: 0f 94 2f 6c call 0x2d85e ; 0x2d85e 30efc: 6c 2f mov r22, r28 return crc; } 30efe: df 91 pop r29 30f00: cf 91 pop r28 30f02: 0d 94 2f 6c jmp 0x2d85e ; 0x2d85e 00030f06 : 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 { 30f06: cf 93 push r28 30f08: df 93 push r29 30f0a: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 30f0c: 0f 94 70 87 call 0x30ee0 ; 0x30ee0 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 30f10: 6d 81 ldd r22, Y+5 ; 0x05 30f12: 0f 94 2f 6c call 0x2d85e ; 0x2d85e crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 30f16: 6e 81 ldd r22, Y+6 ; 0x06 30f18: cf 81 ldd r28, Y+7 ; 0x07 30f1a: 0f 94 2f 6c call 0x2d85e ; 0x2d85e 30f1e: 6c 2f mov r22, r28 return crc; } 30f20: df 91 pop r29 30f22: cf 91 pop r28 30f24: 0d 94 2f 6c jmp 0x2d85e ; 0x2d85e 00030f28 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 30f28: cf 93 push r28 30f2a: df 93 push r29 30f2c: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 30f2e: 68 83 st Y, r22 30f30: 49 83 std Y+1, r20 ; 0x01 30f32: 1b 82 std Y+3, r1 ; 0x03 30f34: 1a 82 std Y+2, r1 ; 0x02 30f36: 0f 94 70 87 call 0x30ee0 ; 0x30ee0 30f3a: 8c 83 std Y+4, r24 ; 0x04 } 30f3c: df 91 pop r29 30f3e: cf 91 pop r28 30f40: 08 95 ret 00030f42 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 30f42: 14 9a sbi 0x02, 4 ; 2 } 30f44: 08 95 ret 00030f46 : 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) { 30f46: cf 92 push r12 30f48: df 92 push r13 30f4a: ef 92 push r14 30f4c: ff 92 push r15 30f4e: cf 93 push r28 30f50: df 93 push r29 30f52: 69 01 movw r12, r18 30f54: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 30f56: c5 ef ldi r28, 0xF5 ; 245 30f58: d1 e1 ldi r29, 0x11 ; 17 30f5a: 9b 01 movw r18, r22 30f5c: ac 01 movw r20, r24 30f5e: 6c 85 ldd r22, Y+12 ; 0x0c 30f60: 7d 85 ldd r23, Y+13 ; 0x0d 30f62: 8e 85 ldd r24, Y+14 ; 0x0e 30f64: 9f 85 ldd r25, Y+15 ; 0x0f 30f66: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 30f6a: 6c 87 std Y+12, r22 ; 0x0c 30f6c: 7d 87 std Y+13, r23 ; 0x0d 30f6e: 8e 87 std Y+14, r24 ; 0x0e 30f70: 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); 30f72: c7 01 movw r24, r14 30f74: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 30f76: df 91 pop r29 30f78: cf 91 pop r28 30f7a: ff 90 pop r15 30f7c: ef 90 pop r14 30f7e: df 90 pop r13 30f80: 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); 30f82: 0d 94 11 85 jmp 0x30a22 ; 0x30a22 00030f86 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 30f86: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 30f8a: 0d 94 14 22 jmp 0x24428 ; 0x24428 00030f8e : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 30f8e: cf 93 push r28 30f90: df 93 push r29 30f92: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 30f94: 87 e7 ldi r24, 0x77 ; 119 30f96: 9e e9 ldi r25, 0x9E ; 158 30f98: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_MMU2(); 30f9c: 8a eb ldi r24, 0xBA ; 186 30f9e: 9e e9 ldi r25, 0x9E ; 158 30fa0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHOLNRPGM(msg); 30fa4: ce 01 movw r24, r28 } 30fa6: df 91 pop r29 30fa8: 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); 30faa: 0c 94 de 72 jmp 0xe5bc ; 0xe5bc 00030fae : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 30fae: 0c 94 f7 c3 jmp 0x187ee ; 0x187ee 00030fb2 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30fb2: 89 32 cpi r24, 0x29 ; 41 30fb4: 20 e8 ldi r18, 0x80 ; 128 30fb6: 92 07 cpc r25, r18 30fb8: 09 f4 brne .+2 ; 0x30fbc 30fba: 97 c0 rjmp .+302 ; 0x310ea 30fbc: 08 f0 brcs .+2 ; 0x30fc0 30fbe: 48 c0 rjmp .+144 ; 0x31050 30fc0: 86 30 cpi r24, 0x06 ; 6 30fc2: 60 e8 ldi r22, 0x80 ; 128 30fc4: 96 07 cpc r25, r22 30fc6: 09 f4 brne .+2 ; 0x30fca 30fc8: 9a c0 rjmp .+308 ; 0x310fe 30fca: 30 f5 brcc .+76 ; 0x31018 30fcc: 83 30 cpi r24, 0x03 ; 3 30fce: 40 e8 ldi r20, 0x80 ; 128 30fd0: 94 07 cpc r25, r20 30fd2: 09 f4 brne .+2 ; 0x30fd6 30fd4: 80 c0 rjmp .+256 ; 0x310d6 30fd6: a8 f4 brcc .+42 ; 0x31002 30fd8: 81 30 cpi r24, 0x01 ; 1 30fda: 20 e8 ldi r18, 0x80 ; 128 30fdc: 92 07 cpc r25, r18 30fde: 09 f4 brne .+2 ; 0x30fe2 30fe0: 17 c1 rjmp .+558 ; 0x31210 30fe2: 82 30 cpi r24, 0x02 ; 2 30fe4: 40 e8 ldi r20, 0x80 ; 128 30fe6: 94 07 cpc r25, r20 30fe8: 09 f4 brne .+2 ; 0x30fec 30fea: 73 c0 rjmp .+230 ; 0x310d2 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); 30fec: 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)) { 30fee: 86 ff sbrs r24, 6 30ff0: 8e c0 rjmp .+284 ; 0x3110e static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); 30ff2: 22 27 eor r18, r18 30ff4: 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) { 30ff6: 21 15 cp r18, r1 30ff8: 32 4c sbci r19, 0xC2 ; 194 30ffa: 09 f0 breq .+2 ; 0x30ffe 30ffc: 9e c0 rjmp .+316 ; 0x3113a return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 30ffe: 8e e1 ldi r24, 0x1E ; 30 31000: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31002: 84 30 cpi r24, 0x04 ; 4 31004: 60 e8 ldi r22, 0x80 ; 128 31006: 96 07 cpc r25, r22 31008: 09 f4 brne .+2 ; 0x3100c 3100a: 67 c0 rjmp .+206 ; 0x310da 3100c: 85 30 cpi r24, 0x05 ; 5 3100e: 20 e8 ldi r18, 0x80 ; 128 31010: 92 07 cpc r25, r18 31012: 61 f7 brne .-40 ; 0x30fec 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); 31014: 84 e2 ldi r24, 0x24 ; 36 31016: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31018: 8a 30 cpi r24, 0x0A ; 10 3101a: 40 e8 ldi r20, 0x80 ; 128 3101c: 94 07 cpc r25, r20 3101e: 09 f4 brne .+2 ; 0x31022 31020: 5e c0 rjmp .+188 ; 0x310de 31022: 58 f4 brcc .+22 ; 0x3103a 31024: 88 30 cpi r24, 0x08 ; 8 31026: 20 e8 ldi r18, 0x80 ; 128 31028: 92 07 cpc r25, r18 3102a: 09 f4 brne .+2 ; 0x3102e 3102c: 6e c0 rjmp .+220 ; 0x3110a 3102e: 89 30 cpi r24, 0x09 ; 9 31030: 40 e8 ldi r20, 0x80 ; 128 31032: 94 07 cpc r25, r20 31034: d9 f6 brne .-74 ; 0x30fec 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); 31036: 85 e0 ldi r24, 0x05 ; 5 31038: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3103a: 8c 30 cpi r24, 0x0C ; 12 3103c: 60 e8 ldi r22, 0x80 ; 128 3103e: 96 07 cpc r25, r22 31040: 09 f4 brne .+2 ; 0x31044 31042: 51 c0 rjmp .+162 ; 0x310e6 31044: 8d 30 cpi r24, 0x0D ; 13 31046: 20 e8 ldi r18, 0x80 ; 128 31048: 92 07 cpc r25, r18 3104a: 81 f6 brne .-96 ; 0x30fec 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); 3104c: 81 e2 ldi r24, 0x21 ; 33 3104e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31050: 8f 32 cpi r24, 0x2F ; 47 31052: 40 e8 ldi r20, 0x80 ; 128 31054: 94 07 cpc r25, r20 31056: 09 f4 brne .+2 ; 0x3105a 31058: 56 c0 rjmp .+172 ; 0x31106 3105a: e0 f4 brcc .+56 ; 0x31094 3105c: 8c 32 cpi r24, 0x2C ; 44 3105e: 20 e8 ldi r18, 0x80 ; 128 31060: 92 07 cpc r25, r18 31062: 09 f4 brne .+2 ; 0x31066 31064: 4e c0 rjmp .+156 ; 0x31102 31066: 58 f4 brcc .+22 ; 0x3107e 31068: 8a 32 cpi r24, 0x2A ; 42 3106a: 60 e8 ldi r22, 0x80 ; 128 3106c: 96 07 cpc r25, r22 3106e: c9 f1 breq .+114 ; 0x310e2 31070: 8b 32 cpi r24, 0x2B ; 43 31072: 20 e8 ldi r18, 0x80 ; 128 31074: 92 07 cpc r25, r18 31076: 09 f0 breq .+2 ; 0x3107a 31078: b9 cf rjmp .-142 ; 0x30fec 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); 3107a: 86 e2 ldi r24, 0x26 ; 38 3107c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3107e: 8d 32 cpi r24, 0x2D ; 45 31080: 40 e8 ldi r20, 0x80 ; 128 31082: 94 07 cpc r25, r20 31084: d1 f1 breq .+116 ; 0x310fa 31086: 8e 32 cpi r24, 0x2E ; 46 31088: 60 e8 ldi r22, 0x80 ; 128 3108a: 96 07 cpc r25, r22 3108c: 09 f0 breq .+2 ; 0x31090 3108e: ae cf rjmp .-164 ; 0x30fec 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); 31090: 82 e2 ldi r24, 0x22 ; 34 31092: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31094: 87 38 cpi r24, 0x87 ; 135 31096: 20 e8 ldi r18, 0x80 ; 128 31098: 92 07 cpc r25, r18 3109a: 49 f1 breq .+82 ; 0x310ee 3109c: 58 f4 brcc .+22 ; 0x310b4 3109e: 87 34 cpi r24, 0x47 ; 71 310a0: 60 e8 ldi r22, 0x80 ; 128 310a2: 96 07 cpc r25, r22 310a4: 29 f0 breq .+10 ; 0x310b0 310a6: 8b 34 cpi r24, 0x4B ; 75 310a8: 20 e8 ldi r18, 0x80 ; 128 310aa: 92 07 cpc r25, r18 310ac: 09 f0 breq .+2 ; 0x310b0 310ae: 9e cf rjmp .-196 ; 0x30fec 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); 310b0: 84 e0 ldi r24, 0x04 ; 4 310b2: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 310b4: 87 30 cpi r24, 0x07 ; 7 310b6: 41 e8 ldi r20, 0x81 ; 129 310b8: 94 07 cpc r25, r20 310ba: d9 f0 breq .+54 ; 0x310f2 310bc: 8b 30 cpi r24, 0x0B ; 11 310be: 61 e8 ldi r22, 0x81 ; 129 310c0: 96 07 cpc r25, r22 310c2: c9 f0 breq .+50 ; 0x310f6 310c4: 8b 38 cpi r24, 0x8B ; 139 310c6: 20 e8 ldi r18, 0x80 ; 128 310c8: 92 07 cpc r25, r18 310ca: 09 f0 breq .+2 ; 0x310ce 310cc: 8f cf rjmp .-226 ; 0x30fec 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); 310ce: 89 e0 ldi r24, 0x09 ; 9 310d0: 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); 310d2: 81 e0 ldi r24, 0x01 ; 1 310d4: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 310d6: 82 e0 ldi r24, 0x02 ; 2 310d8: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 310da: 83 e0 ldi r24, 0x03 ; 3 310dc: 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); 310de: 86 e0 ldi r24, 0x06 ; 6 310e0: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 310e2: 87 e0 ldi r24, 0x07 ; 7 310e4: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 310e6: 8a e2 ldi r24, 0x2A ; 42 310e8: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 310ea: 8b e2 ldi r24, 0x2B ; 43 310ec: 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); 310ee: 88 e0 ldi r24, 0x08 ; 8 310f0: 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); 310f2: 8a e0 ldi r24, 0x0A ; 10 310f4: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 310f6: 8b e0 ldi r24, 0x0B ; 11 310f8: 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); 310fa: 83 e2 ldi r24, 0x23 ; 35 310fc: 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); 310fe: 85 e2 ldi r24, 0x25 ; 37 31100: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 31102: 87 e2 ldi r24, 0x27 ; 39 31104: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 31106: 88 e2 ldi r24, 0x28 ; 40 31108: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 3110a: 89 e2 ldi r24, 0x29 ; 41 3110c: 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)) { 3110e: 87 ff sbrs r24, 7 31110: 07 c0 rjmp .+14 ; 0x31120 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); 31112: 22 27 eor r18, r18 31114: 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) { 31116: 21 15 cp r18, r1 31118: 32 4c sbci r19, 0xC2 ; 194 3111a: a1 f5 brne .+104 ; 0x31184 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 3111c: 8f e1 ldi r24, 0x1F ; 31 3111e: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 31120: 22 27 eor r18, r18 31122: 31 70 andi r19, 0x01 ; 1 31124: 90 ff sbrs r25, 0 31126: 52 c0 rjmp .+164 ; 0x311cc 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); 31128: ac 01 movw r20, r24 3112a: 44 27 eor r20, r20 3112c: 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) { 3112e: 41 15 cp r20, r1 31130: 52 4c sbci r21, 0xC2 ; 194 31132: 09 f0 breq .+2 ; 0x31136 31134: 4b c0 rjmp .+150 ; 0x311cc return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 31136: 80 e2 ldi r24, 0x20 ; 32 31138: 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; 3113a: 9c 01 movw r18, r24 3113c: 22 27 eor r18, r18 3113e: 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)) { 31140: 23 2b or r18, r19 31142: 09 f0 breq .+2 ; 0x31146 31144: 67 c0 rjmp .+206 ; 0x31214 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; 31146: 9c 01 movw r18, r24 31148: 22 27 eor r18, r18 3114a: 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)) { 3114c: 23 2b or r18, r19 3114e: 09 f0 breq .+2 ; 0x31152 31150: 63 c0 rjmp .+198 ; 0x31218 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; 31152: 9c 01 movw r18, r24 31154: 22 27 eor r18, r18 31156: 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)) { 31158: 23 2b or r18, r19 3115a: 09 f0 breq .+2 ; 0x3115e 3115c: 5f c0 rjmp .+190 ; 0x3121c 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; 3115e: 9c 01 movw r18, r24 31160: 22 27 eor r18, r18 31162: 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)) { 31164: 23 2b or r18, r19 31166: 09 f0 breq .+2 ; 0x3116a 31168: 5b c0 rjmp .+182 ; 0x31220 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; 3116a: 9c 01 movw r18, r24 3116c: 22 27 eor r18, r18 3116e: 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)) { 31170: 23 2b or r18, r19 31172: 09 f0 breq .+2 ; 0x31176 31174: 57 c0 rjmp .+174 ; 0x31224 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31176: 88 27 eor r24, r24 31178: 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)) { 3117a: 89 2b or r24, r25 3117c: 09 f4 brne .+2 ; 0x31180 3117e: 68 c0 rjmp .+208 ; 0x31250 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 31180: 8f e0 ldi r24, 0x0F ; 15 31182: 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; 31184: 9c 01 movw r18, r24 31186: 22 27 eor r18, r18 31188: 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)) { 3118a: 23 2b or r18, r19 3118c: 09 f0 breq .+2 ; 0x31190 3118e: 4c c0 rjmp .+152 ; 0x31228 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; 31190: 9c 01 movw r18, r24 31192: 22 27 eor r18, r18 31194: 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)) { 31196: 23 2b or r18, r19 31198: 09 f0 breq .+2 ; 0x3119c 3119a: 48 c0 rjmp .+144 ; 0x3122c 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; 3119c: 9c 01 movw r18, r24 3119e: 22 27 eor r18, r18 311a0: 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)) { 311a2: 23 2b or r18, r19 311a4: 09 f0 breq .+2 ; 0x311a8 311a6: 44 c0 rjmp .+136 ; 0x31230 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; 311a8: 9c 01 movw r18, r24 311aa: 22 27 eor r18, r18 311ac: 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)) { 311ae: 23 2b or r18, r19 311b0: 09 f0 breq .+2 ; 0x311b4 311b2: 40 c0 rjmp .+128 ; 0x31234 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; 311b4: 9c 01 movw r18, r24 311b6: 22 27 eor r18, r18 311b8: 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)) { 311ba: 23 2b or r18, r19 311bc: e9 f5 brne .+122 ; 0x31238 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; 311be: 88 27 eor r24, r24 311c0: 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)) { 311c2: 89 2b or r24, r25 311c4: 09 f4 brne .+2 ; 0x311c8 311c6: 44 c0 rjmp .+136 ; 0x31250 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 311c8: 80 e1 ldi r24, 0x10 ; 16 311ca: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 311cc: 23 2b or r18, r19 311ce: 09 f4 brne .+2 ; 0x311d2 311d0: 3f c0 rjmp .+126 ; 0x31250 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 311d2: 9c 01 movw r18, r24 311d4: 22 27 eor r18, r18 311d6: 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)) { 311d8: 23 2b or r18, r19 311da: 81 f5 brne .+96 ; 0x3123c 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; 311dc: 9c 01 movw r18, r24 311de: 22 27 eor r18, r18 311e0: 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)) { 311e2: 23 2b or r18, r19 311e4: 69 f5 brne .+90 ; 0x31240 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; 311e6: 9c 01 movw r18, r24 311e8: 22 27 eor r18, r18 311ea: 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)) { 311ec: 23 2b or r18, r19 311ee: 51 f5 brne .+84 ; 0x31244 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 311f0: 9c 01 movw r18, r24 311f2: 22 27 eor r18, r18 311f4: 30 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)) { 311f6: 23 2b or r18, r19 311f8: 39 f5 brne .+78 ; 0x31248 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 311fa: 9c 01 movw r18, r24 311fc: 22 27 eor r18, r18 311fe: 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)) { 31200: 23 2b or r18, r19 31202: 21 f5 brne .+72 ; 0x3124c 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; 31204: 88 27 eor r24, r24 31206: 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)) { 31208: 89 2b or r24, r25 3120a: 11 f1 breq .+68 ; 0x31250 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 3120c: 81 e1 ldi r24, 0x11 ; 17 3120e: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 31210: 80 e0 ldi r24, 0x00 ; 0 31212: 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); 31214: 82 e1 ldi r24, 0x12 ; 18 31216: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 31218: 85 e1 ldi r24, 0x15 ; 21 3121a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 3121c: 88 e1 ldi r24, 0x18 ; 24 3121e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 31220: 8b e1 ldi r24, 0x1B ; 27 31222: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 31224: 8c e0 ldi r24, 0x0C ; 12 31226: 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); 31228: 83 e1 ldi r24, 0x13 ; 19 3122a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 3122c: 86 e1 ldi r24, 0x16 ; 22 3122e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 31230: 89 e1 ldi r24, 0x19 ; 25 31232: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 31234: 8c e1 ldi r24, 0x1C ; 28 31236: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 31238: 8d e0 ldi r24, 0x0D ; 13 3123a: 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); 3123c: 84 e1 ldi r24, 0x14 ; 20 3123e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 31240: 87 e1 ldi r24, 0x17 ; 23 31242: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 31244: 8a e1 ldi r24, 0x1A ; 26 31246: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 31248: 8d e1 ldi r24, 0x1D ; 29 3124a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 3124c: 8e e0 ldi r24, 0x0E ; 14 3124e: 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); 31250: 8c e2 ldi r24, 0x2C ; 44 } 31252: 08 95 ret 00031254 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 31254: cf 92 push r12 31256: df 92 push r13 31258: ef 92 push r14 3125a: ff 92 push r15 3125c: 0f 93 push r16 3125e: 1f 93 push r17 31260: cf 93 push r28 31262: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 31264: 20 91 65 12 lds r18, 0x1265 ; 0x801265 31268: 30 91 66 12 lds r19, 0x1266 ; 0x801266 3126c: 21 30 cpi r18, 0x01 ; 1 3126e: 31 05 cpc r19, r1 31270: 39 f4 brne .+14 ; 0x31280 31272: 20 91 8e 12 lds r18, 0x128E ; 0x80128e 31276: 21 30 cpi r18, 0x01 ; 1 31278: 19 f4 brne .+6 ; 0x31280 // 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; 3127a: 22 e0 ldi r18, 0x02 ; 2 3127c: 20 93 c3 16 sts 0x16C3, r18 ; 0x8016c3 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 31280: 0f 94 d9 87 call 0x30fb2 ; 0x30fb2 31284: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 31286: 80 91 c3 16 lds r24, 0x16C3 ; 0x8016c3 3128a: 81 30 cpi r24, 0x01 ; 1 3128c: 09 f4 brne .+2 ; 0x31290 3128e: 64 c0 rjmp .+200 ; 0x31358 31290: 60 f0 brcs .+24 ; 0x312aa 31292: 82 30 cpi r24, 0x02 ; 2 31294: 09 f4 brne .+2 ; 0x31298 31296: f4 c0 rjmp .+488 ; 0x31480 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 31298: df 91 pop r29 3129a: cf 91 pop r28 3129c: 1f 91 pop r17 3129e: 0f 91 pop r16 312a0: ff 90 pop r15 312a2: ef 90 pop r14 312a4: df 90 pop r13 312a6: cf 90 pop r12 312a8: 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); 312aa: 84 e0 ldi r24, 0x04 ; 4 312ac: 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); 312b0: 0d 2f mov r16, r29 312b2: 10 e0 ldi r17, 0x00 ; 0 312b4: f8 01 movw r30, r16 312b6: ec 5d subi r30, 0xDC ; 220 312b8: f0 46 sbci r31, 0x60 ; 96 312ba: 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); 312bc: fc 2e mov r15, r28 312be: f2 94 swap r15 312c0: 6f e0 ldi r22, 0x0F ; 15 312c2: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 312c4: 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); 312c6: 80 e0 ldi r24, 0x00 ; 0 312c8: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_clear(); 312cc: 0e 94 39 6a call 0xd472 ; 0xd472 // 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); 312d0: 00 0f add r16, r16 312d2: 11 1f adc r17, r17 312d4: f8 01 movw r30, r16 312d6: ef 5a subi r30, 0xAF ; 175 312d8: f0 46 sbci r31, 0x60 ; 96 312da: c5 90 lpm r12, Z+ 312dc: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 312de: 03 5f subi r16, 0xF3 ; 243 312e0: 13 46 sbci r17, 0x63 ; 99 312e2: f8 01 movw r30, r16 312e4: 85 91 lpm r24, Z+ 312e6: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 312e8: 0e 94 3c 6d call 0xda78 ; 0xda78 312ec: df 92 push r13 312ee: cf 92 push r12 312f0: 9f 93 push r25 312f2: 8f 93 push r24 312f4: 8d eb ldi r24, 0xBD ; 189 312f6: 9f e9 ldi r25, 0x9F ; 159 312f8: 9f 93 push r25 312fa: 8f 93 push r24 312fc: 0e 94 df 69 call 0xd3be ; 0xd3be 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)); 31300: 48 e9 ldi r20, 0x98 ; 152 31302: 5c e9 ldi r21, 0x9C ; 156 31304: 62 e0 ldi r22, 0x02 ; 2 31306: 80 e0 ldi r24, 0x00 ; 0 31308: 0e 94 1a 6a call 0xd434 ; 0xd434 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()); 3130c: 0f 90 pop r0 3130e: 0f 90 pop r0 31310: 0f 90 pop r0 31312: 0f 90 pop r0 31314: 0f 90 pop r0 31316: 0f 90 pop r0 31318: f1 10 cpse r15, r1 3131a: c6 c0 rjmp .+396 ; 0x314a8 3131c: 10 e0 ldi r17, 0x00 ; 0 3131e: 00 e0 ldi r16, 0x00 ; 0 31320: 42 e1 ldi r20, 0x12 ; 18 31322: e4 2e mov r14, r20 31324: 51 ee ldi r21, 0xE1 ; 225 31326: c5 2e mov r12, r21 31328: 5c e6 ldi r21, 0x6C ; 108 3132a: 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); 3132c: ec 2f mov r30, r28 3132e: f0 e0 ldi r31, 0x00 ; 0 31330: ee 0f add r30, r30 31332: ff 1f adc r31, r31 31334: e7 55 subi r30, 0x57 ; 87 31336: f0 46 sbci r31, 0x60 ; 96 31338: 85 91 lpm r24, Z+ 3133a: 94 91 lpm r25, Z 3133c: 0e 94 3c 6d call 0xda78 ; 0xda78 31340: bc 01 movw r22, r24 31342: 81 e0 ldi r24, 0x01 ; 1 31344: f1 10 cpse r15, r1 31346: 01 c0 rjmp .+2 ; 0x3134a 31348: 80 e0 ldi r24, 0x00 ; 0 3134a: 2e 2d mov r18, r14 3134c: a6 01 movw r20, r12 3134e: 0f 94 41 0a call 0x21482 ; 0x21482 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 31352: 81 e0 ldi r24, 0x01 ; 1 31354: 80 93 c3 16 sts 0x16C3, r24 ; 0x8016c3 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 31358: 81 e0 ldi r24, 0x01 ; 1 3135a: 80 93 c6 06 sts 0x06C6, r24 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> ReportErrorHookDynamicRender(); // Render dynamic characters 3135e: 0f 94 00 87 call 0x30e00 ; 0x30e00 sound_wait_for_user(); 31362: 0f 94 67 35 call 0x26ace ; 0x26ace 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); 31366: 0d 2f mov r16, r29 31368: 10 e0 ldi r17, 0x00 ; 0 3136a: f8 01 movw r30, r16 3136c: ec 5d subi r30, 0xDC ; 220 3136e: f0 46 sbci r31, 0x60 ; 96 31370: 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); 31372: dc 2f mov r29, r28 31374: d2 95 swap r29 31376: 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; 31378: 80 91 bb 16 lds r24, 0x16BB ; 0x8016bb 3137c: 81 11 cpse r24, r1 3137e: 09 c0 rjmp .+18 ; 0x31392 31380: 81 e0 ldi r24, 0x01 ; 1 31382: d1 11 cpse r29, r1 31384: 01 c0 rjmp .+2 ; 0x31388 31386: 80 e0 ldi r24, 0x00 ; 0 31388: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3138c: 81 e0 ldi r24, 0x01 ; 1 3138e: 80 93 bb 16 sts 0x16BB, r24 ; 0x8016bb static int8_t choice_selected = -1; if (reset_button_selection) { 31392: 80 91 b9 16 lds r24, 0x16B9 ; 0x8016b9 31396: 88 23 and r24, r24 31398: 41 f0 breq .+16 ; 0x313aa // 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; 3139a: 81 e0 ldi r24, 0x01 ; 1 3139c: d1 11 cpse r29, r1 3139e: 01 c0 rjmp .+2 ; 0x313a2 313a0: 80 e0 ldi r24, 0x00 ; 0 313a2: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba choice_selected = -1; reset_button_selection = 0; 313a6: 10 92 b9 16 sts 0x16B9, r1 ; 0x8016b9 } // Check if knob was rotated if (lcd_encoder) { 313aa: 20 91 06 05 lds r18, 0x0506 ; 0x800506 313ae: 30 91 07 05 lds r19, 0x0507 ; 0x800507 313b2: 21 15 cp r18, r1 313b4: 31 05 cpc r19, r1 313b6: b9 f1 breq .+110 ; 0x31426 313b8: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) { // third_choice is not nullptr, safe to dereference 313bc: dd 23 and r29, r29 313be: 61 f0 breq .+24 ; 0x313d8 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 313c0: 37 ff sbrs r19, 7 313c2: 06 c0 rjmp .+12 ; 0x313d0 313c4: 88 23 and r24, r24 313c6: 69 f0 breq .+26 ; 0x313e2 // Rotating knob counter clockwise current_selection--; 313c8: 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; 313ca: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 313ce: 09 c0 rjmp .+18 ; 0x313e2 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) { 313d0: 82 30 cpi r24, 0x02 ; 2 313d2: 39 f0 breq .+14 ; 0x313e2 // Rotating knob clockwise current_selection++; 313d4: 8f 5f subi r24, 0xFF ; 255 313d6: f9 cf rjmp .-14 ; 0x313ca } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 313d8: 37 ff sbrs r19, 7 313da: 41 c0 rjmp .+130 ; 0x3145e 313dc: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 313de: 10 92 ba 16 sts 0x16BA, r1 ; 0x8016ba //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 313e2: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 313e6: 4e e3 ldi r20, 0x3E ; 62 313e8: 81 11 cpse r24, r1 313ea: 40 e2 ldi r20, 0x20 ; 32 313ec: 63 e0 ldi r22, 0x03 ; 3 313ee: 80 e0 ldi r24, 0x00 ; 0 313f0: 0e 94 26 6a call 0xd44c ; 0xd44c 313f4: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) 313f8: dd 23 and r29, r29 313fa: b1 f1 breq .+108 ; 0x31468 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 313fc: 4e e3 ldi r20, 0x3E ; 62 313fe: 81 30 cpi r24, 0x01 ; 1 31400: 09 f0 breq .+2 ; 0x31404 31402: 40 e2 ldi r20, 0x20 ; 32 31404: 63 e0 ldi r22, 0x03 ; 3 31406: 89 e0 ldi r24, 0x09 ; 9 31408: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 3140c: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 31410: 82 30 cpi r24, 0x02 ; 2 31412: 61 f5 brne .+88 ; 0x3146c } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 31414: 4e e3 ldi r20, 0x3E ; 62 31416: 63 e0 ldi r22, 0x03 ; 3 31418: 82 e1 ldi r24, 0x12 ; 18 3141a: 0e 94 26 6a call 0xd44c ; 0xd44c } // Consume rotation event lcd_encoder = 0; 3141e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 31422: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 31426: 0e 94 23 6c call 0xd846 ; 0xd846 3142a: 88 23 and r24, r24 3142c: 09 f4 brne .+2 ; 0x31430 3142e: 34 cf rjmp .-408 ; 0x31298 choice_selected = current_selection; 31430: 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 31434: d1 11 cpse r29, r1 31436: 1c c0 rjmp .+56 ; 0x31470 31438: 81 30 cpi r24, 0x01 ; 1 3143a: 89 f5 brne .+98 ; 0x3149e 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); 3143c: f8 01 movw r30, r16 3143e: ee 0f add r30, r30 31440: ff 1f adc r31, r31 31442: e6 53 subi r30, 0x36 ; 54 31444: f1 46 sbci r31, 0x61 ; 97 31446: 85 91 lpm r24, Z+ 31448: 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))); 3144a: 0e 94 3c 6d call 0xda78 ; 0xda78 3144e: 0f 94 19 0b call 0x21632 ; 0x21632 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 31452: 81 e0 ldi r24, 0x01 ; 1 31454: 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; 31458: 10 92 c3 16 sts 0x16C3, r1 ; 0x8016c3 3145c: 1d cf rjmp .-454 ; 0x31298 } } 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) { 3145e: 81 30 cpi r24, 0x01 ; 1 31460: 09 f4 brne .+2 ; 0x31464 31462: bf cf rjmp .-130 ; 0x313e2 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 31464: 81 e0 ldi r24, 0x01 ; 1 31466: b1 cf rjmp .-158 ; 0x313ca { 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 ? '>': ' '); 31468: 81 30 cpi r24, 0x01 ; 1 3146a: a1 f2 breq .-88 ; 0x31414 3146c: 40 e2 ldi r20, 0x20 ; 32 3146e: d3 cf rjmp .-90 ; 0x31416 // 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 31470: 82 30 cpi r24, 0x02 ; 2 31472: 21 f3 breq .-56 ; 0x3143c { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 31474: 81 30 cpi r24, 0x01 ; 1 31476: 99 f4 brne .+38 ; 0x3149e return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 31478: 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; 3147c: 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); 31480: 81 e0 ldi r24, 0x01 ; 1 31482: 0e 94 4b 6a call 0xd496 ; 0xd496 lcd_return_to_status(); 31486: 0e 94 e9 fd call 0x1fbd2 ; 0x1fbd2 3148a: 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; 3148e: 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; 31492: 10 92 c6 06 sts 0x06C6, r1 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.450> KEEPALIVE_STATE(IN_HANDLER); 31496: 82 e0 ldi r24, 0x02 ; 2 31498: 80 93 78 02 sts 0x0278, r24 ; 0x800278 3149c: dd cf rjmp .-70 ; 0x31458 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); 3149e: cf 70 andi r28, 0x0F ; 15 314a0: 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; 314a4: 81 e0 ldi r24, 0x01 ; 1 314a6: ea cf rjmp .-44 ; 0x3147c 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); 314a8: ef 2d mov r30, r15 314aa: f0 e0 ldi r31, 0x00 ; 0 314ac: ee 0f add r30, r30 314ae: ff 1f adc r31, r31 314b0: e7 55 subi r30, 0x57 ; 87 314b2: f0 46 sbci r31, 0x60 ; 96 314b4: 85 91 lpm r24, Z+ 314b6: 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()); 314b8: 0e 94 3c 6d call 0xda78 ; 0xda78 314bc: 6c 01 movw r12, r24 314be: 01 ee ldi r16, 0xE1 ; 225 314c0: 1c e6 ldi r17, 0x6C ; 108 314c2: 99 e0 ldi r25, 0x09 ; 9 314c4: e9 2e mov r14, r25 314c6: 32 cf rjmp .-412 ; 0x3132c 000314c8 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 314c8: 0f 94 d9 87 call 0x30fb2 ; 0x30fb2 // 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); 314cc: e8 2f mov r30, r24 314ce: f0 e0 ldi r31, 0x00 ; 0 314d0: ee 0f add r30, r30 314d2: ff 1f adc r31, r31 314d4: ef 5a subi r30, 0xAF ; 175 314d6: f0 46 sbci r31, 0x60 ; 96 314d8: 25 91 lpm r18, Z+ 314da: 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) ) { 314dc: 23 33 cpi r18, 0x33 ; 51 314de: 81 e0 ldi r24, 0x01 ; 1 314e0: 38 07 cpc r19, r24 314e2: 08 f0 brcs .+2 ; 0x314e6 314e4: 41 c0 rjmp .+130 ; 0x31568 314e6: 2d 32 cpi r18, 0x2D ; 45 314e8: 81 e0 ldi r24, 0x01 ; 1 314ea: 38 07 cpc r19, r24 314ec: 78 f5 brcc .+94 ; 0x3154c 314ee: 2e 37 cpi r18, 0x7E ; 126 314f0: 31 05 cpc r19, r1 314f2: 09 f4 brne .+2 ; 0x314f6 314f4: 83 c0 rjmp .+262 ; 0x315fc 314f6: f0 f4 brcc .+60 ; 0x31534 314f8: 2c 36 cpi r18, 0x6C ; 108 314fa: 31 05 cpc r19, r1 314fc: 09 f4 brne .+2 ; 0x31500 314fe: 85 c0 rjmp .+266 ; 0x3160a 31500: 30 f4 brcc .+12 ; 0x3150e 31502: 25 36 cpi r18, 0x65 ; 101 31504: 31 05 cpc r19, r1 31506: 08 f0 brcs .+2 ; 0x3150a 31508: 79 c0 rjmp .+242 ; 0x315fc default: break; } return Buttons::NoButton; 3150a: 8f ef ldi r24, 0xFF ; 255 3150c: 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) ) { 3150e: 24 37 cpi r18, 0x74 ; 116 31510: 31 05 cpc r19, r1 31512: 09 f4 brne .+2 ; 0x31516 31514: 73 c0 rjmp .+230 ; 0x315fc 31516: 2d 37 cpi r18, 0x7D ; 125 31518: 31 05 cpc r19, r1 3151a: 19 f0 breq .+6 ; 0x31522 3151c: 23 37 cpi r18, 0x73 ; 115 3151e: 31 05 cpc r19, r1 31520: a1 f7 brne .-24 ; 0x3150a break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 31522: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 31526: 81 30 cpi r24, 0x01 ; 1 31528: 09 f4 brne .+2 ; 0x3152c 3152a: 6d c0 rjmp .+218 ; 0x31606 3152c: 87 30 cpi r24, 0x07 ; 7 3152e: 69 f7 brne .-38 ; 0x3150a // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 31530: 88 e0 ldi r24, 0x08 ; 8 31532: 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) ) { 31534: 23 3d cpi r18, 0xD3 ; 211 31536: 31 05 cpc r19, r1 31538: 09 f4 brne .+2 ; 0x3153c 3153a: 6e c0 rjmp .+220 ; 0x31618 3153c: 50 f4 brcc .+20 ; 0x31552 3153e: 29 3c cpi r18, 0xC9 ; 201 31540: 31 05 cpc r19, r1 31542: 09 f4 brne .+2 ; 0x31546 31544: 69 c0 rjmp .+210 ; 0x31618 31546: 2a 3c cpi r18, 0xCA ; 202 31548: 31 05 cpc r19, r1 3154a: f9 f6 brne .-66 ; 0x3150a 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) { 3154c: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 31550: 67 c0 rjmp .+206 ; 0x31620 // 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) ) { 31552: 2d 3d cpi r18, 0xDD ; 221 31554: 31 05 cpc r19, r1 31556: 09 f4 brne .+2 ; 0x3155a 31558: 5f c0 rjmp .+190 ; 0x31618 3155a: 2e 3d cpi r18, 0xDE ; 222 3155c: 31 05 cpc r19, r1 3155e: b1 f3 breq .-20 ; 0x3154c 31560: 24 3d cpi r18, 0xD4 ; 212 31562: 31 05 cpc r19, r1 31564: 91 f6 brne .-92 ; 0x3150a 31566: f2 cf rjmp .-28 ; 0x3154c 31568: 25 3f cpi r18, 0xF5 ; 245 3156a: 81 e0 ldi r24, 0x01 ; 1 3156c: 38 07 cpc r19, r24 3156e: 09 f4 brne .+2 ; 0x31572 31570: 5c c0 rjmp .+184 ; 0x3162a 31572: f8 f4 brcc .+62 ; 0x315b2 31574: 26 34 cpi r18, 0x46 ; 70 31576: 81 e0 ldi r24, 0x01 ; 1 31578: 38 07 cpc r19, r24 3157a: 58 f4 brcc .+22 ; 0x31592 3157c: 21 34 cpi r18, 0x41 ; 65 3157e: 81 e0 ldi r24, 0x01 ; 1 31580: 38 07 cpc r19, r24 31582: 20 f7 brcc .-56 ; 0x3154c 31584: 27 53 subi r18, 0x37 ; 55 31586: 31 40 sbci r19, 0x01 ; 1 31588: 25 30 cpi r18, 0x05 ; 5 3158a: 31 05 cpc r19, r1 3158c: 08 f0 brcs .+2 ; 0x31590 3158e: bd cf rjmp .-134 ; 0x3150a 31590: dd cf rjmp .-70 ; 0x3154c 31592: 21 59 subi r18, 0x91 ; 145 31594: 31 40 sbci r19, 0x01 ; 1 31596: 22 30 cpi r18, 0x02 ; 2 31598: 31 05 cpc r19, r1 3159a: 08 f0 brcs .+2 ; 0x3159e 3159c: b6 cf rjmp .-148 ; 0x3150a } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 3159e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 315a2: 83 30 cpi r24, 0x03 ; 3 315a4: 09 f4 brne .+2 ; 0x315a8 315a6: 3f c0 rjmp .+126 ; 0x31626 315a8: 89 30 cpi r24, 0x09 ; 9 315aa: 09 f0 breq .+2 ; 0x315ae 315ac: ae cf rjmp .-164 ; 0x3150a case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 315ae: 87 e0 ldi r24, 0x07 ; 7 315b0: 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) ) { 315b2: 29 3f cpi r18, 0xF9 ; 249 315b4: 81 e0 ldi r24, 0x01 ; 1 315b6: 38 07 cpc r19, r24 315b8: 49 f2 breq .-110 ; 0x3154c 315ba: 70 f4 brcc .+28 ; 0x315d8 315bc: 27 3f cpi r18, 0xF7 ; 247 315be: 81 e0 ldi r24, 0x01 ; 1 315c0: 38 07 cpc r19, r24 315c2: 21 f2 breq .-120 ; 0x3154c 315c4: 60 f7 brcc .-40 ; 0x3159e break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 315c6: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 315ca: 83 30 cpi r24, 0x03 ; 3 315cc: 61 f1 breq .+88 ; 0x31626 315ce: 88 30 cpi r24, 0x08 ; 8 315d0: 09 f0 breq .+2 ; 0x315d4 315d2: 9b cf rjmp .-202 ; 0x3150a case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 315d4: 86 e0 ldi r24, 0x06 ; 6 315d6: 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) ) { 315d8: 2b 3f cpi r18, 0xFB ; 251 315da: 81 e0 ldi r24, 0x01 ; 1 315dc: 38 07 cpc r19, r24 315de: a9 f0 breq .+42 ; 0x3160a 315e0: 68 f0 brcs .+26 ; 0x315fc 315e2: 2c 3f cpi r18, 0xFC ; 252 315e4: 31 40 sbci r19, 0x01 ; 1 315e6: 09 f0 breq .+2 ; 0x315ea 315e8: 90 cf rjmp .-224 ; 0x3150a default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 315ea: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 315ee: 85 30 cpi r24, 0x05 ; 5 315f0: 89 f0 breq .+34 ; 0x31614 315f2: 86 30 cpi r24, 0x06 ; 6 315f4: 09 f0 breq .+2 ; 0x315f8 315f6: 89 cf rjmp .-238 ; 0x3150a case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 315f8: 85 e0 ldi r24, 0x05 ; 5 315fa: 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) { 315fc: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 31600: 81 30 cpi r24, 0x01 ; 1 31602: 09 f0 breq .+2 ; 0x31606 31604: 82 cf rjmp .-252 ; 0x3150a 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; 31606: 81 e0 ldi r24, 0x01 ; 1 31608: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 3160a: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3160e: 82 30 cpi r24, 0x02 ; 2 31610: d1 f3 breq .-12 ; 0x31606 31612: 7b cf rjmp .-266 ; 0x3150a } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 31614: 84 e0 ldi r24, 0x04 ; 4 31616: 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) { 31618: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3161c: 82 30 cpi r24, 0x02 ; 2 3161e: 61 f0 breq .+24 ; 0x31638 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) { 31620: 83 30 cpi r24, 0x03 ; 3 31622: 09 f0 breq .+2 ; 0x31626 31624: 72 cf rjmp .-284 ; 0x3150a 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; 31626: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 31628: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 3162a: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.453> 3162e: 82 30 cpi r24, 0x02 ; 2 31630: 29 f0 breq .+10 ; 0x3163c 31632: 84 30 cpi r24, 0x04 ; 4 31634: 09 f0 breq .+2 ; 0x31638 31636: 69 cf rjmp .-302 ; 0x3150a 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; 31638: 82 e0 ldi r24, 0x02 ; 2 3163a: 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; 3163c: 80 e0 ldi r24, 0x00 ; 0 3163e: 08 95 ret 00031640 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 31640: cf 93 push r28 31642: df 93 push r29 31644: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 31646: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 3164a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 3164e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 31652: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 31656: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 3165a: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 3165e: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 31662: c9 01 movw r24, r18 31664: 86 1b sub r24, r22 31666: 97 0b sbc r25, r23 31668: 06 97 sbiw r24, 0x06 ; 6 3166a: 24 f0 brlt .+8 ; 0x31674 (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); 3166c: ce 01 movw r24, r28 3166e: 0e 94 d3 7c call 0xf9a6 ; 0xf9a6 31672: e9 cf rjmp .-46 ; 0x31646 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.354]+0x6> f(); safe_delay_keep_alive(delay); } } 31674: df 91 pop r29 31676: cf 91 pop r28 31678: 08 95 ret 0003167a : } //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) { 3167a: cf 93 push r28 3167c: df 93 push r29 3167e: 00 d0 rcall .+0 ; 0x31680 31680: 00 d0 rcall .+0 ; 0x31682 31682: 1f 92 push r1 31684: cd b7 in r28, 0x3d ; 61 31686: 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)) 31688: 87 30 cpi r24, 0x07 ; 7 3168a: 50 f5 brcc .+84 ; 0x316e0 3168c: 67 30 cpi r22, 0x07 ; 7 3168e: 40 f5 brcc .+80 ; 0x316e0 return false; uint8_t valid_points_mask[7] = { 31690: 97 e0 ldi r25, 0x07 ; 7 31692: ed eb ldi r30, 0xBD ; 189 31694: f2 e0 ldi r31, 0x02 ; 2 31696: de 01 movw r26, r28 31698: 11 96 adiw r26, 0x01 ; 1 3169a: 01 90 ld r0, Z+ 3169c: 0d 92 st X+, r0 3169e: 9a 95 dec r25 316a0: e1 f7 brne .-8 ; 0x3169a 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 316a2: 46 e0 ldi r20, 0x06 ; 6 316a4: 50 e0 ldi r21, 0x00 ; 0 316a6: fa 01 movw r30, r20 316a8: e6 1b sub r30, r22 316aa: f1 09 sbc r31, r1 316ac: 21 e0 ldi r18, 0x01 ; 1 316ae: 30 e0 ldi r19, 0x00 ; 0 316b0: 2c 0f add r18, r28 316b2: 3d 1f adc r19, r29 316b4: e2 0f add r30, r18 316b6: f3 1f adc r31, r19 316b8: 20 81 ld r18, Z 316ba: 30 e0 ldi r19, 0x00 ; 0 316bc: 48 1b sub r20, r24 316be: 51 09 sbc r21, r1 316c0: c9 01 movw r24, r18 316c2: 02 c0 rjmp .+4 ; 0x316c8 316c4: 95 95 asr r25 316c6: 87 95 ror r24 316c8: 4a 95 dec r20 316ca: e2 f7 brpl .-8 ; 0x316c4 316cc: 81 70 andi r24, 0x01 ; 1 } 316ce: 27 96 adiw r28, 0x07 ; 7 316d0: 0f b6 in r0, 0x3f ; 63 316d2: f8 94 cli 316d4: de bf out 0x3e, r29 ; 62 316d6: 0f be out 0x3f, r0 ; 63 316d8: cd bf out 0x3d, r28 ; 61 316da: df 91 pop r29 316dc: cf 91 pop r28 316de: 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; 316e0: 80 e0 ldi r24, 0x00 ; 0 316e2: f5 cf rjmp .-22 ; 0x316ce 000316e4 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 316e4: 0f 93 push r16 316e6: 1f 93 push r17 316e8: cf 93 push r28 316ea: df 93 push r29 316ec: 00 d0 rcall .+0 ; 0x316ee 316ee: 1f 92 push r1 316f0: cd b7 in r28, 0x3d ; 61 316f2: de b7 in r29, 0x3e ; 62 316f4: 9b 01 movw r18, r22 316f6: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 316f8: 05 ef ldi r16, 0xF5 ; 245 316fa: 11 e1 ldi r17, 0x11 ; 17 316fc: f8 01 movw r30, r16 316fe: 60 85 ldd r22, Z+8 ; 0x08 31700: 71 85 ldd r23, Z+9 ; 0x09 31702: 82 85 ldd r24, Z+10 ; 0x0a 31704: 93 85 ldd r25, Z+11 ; 0x0b 31706: 69 83 std Y+1, r22 ; 0x01 31708: 7a 83 std Y+2, r23 ; 0x02 3170a: 8b 83 std Y+3, r24 ; 0x03 3170c: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 3170e: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 31712: f8 01 movw r30, r16 31714: 60 87 std Z+8, r22 ; 0x08 31716: 71 87 std Z+9, r23 ; 0x09 31718: 82 87 std Z+10, r24 ; 0x0a 3171a: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 3171c: 65 e5 ldi r22, 0x55 ; 85 3171e: 75 e5 ldi r23, 0x55 ; 85 31720: 85 e5 ldi r24, 0x55 ; 85 31722: 91 e4 ldi r25, 0x41 ; 65 31724: 0f 94 11 85 call 0x30a22 ; 0x30a22 st_synchronize(); 31728: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[Z_AXIS] = curpos_z; 3172c: 89 81 ldd r24, Y+1 ; 0x01 3172e: 9a 81 ldd r25, Y+2 ; 0x02 31730: ab 81 ldd r26, Y+3 ; 0x03 31732: bc 81 ldd r27, Y+4 ; 0x04 31734: f8 01 movw r30, r16 31736: 80 87 std Z+8, r24 ; 0x08 31738: 91 87 std Z+9, r25 ; 0x09 3173a: a2 87 std Z+10, r26 ; 0x0a 3173c: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 3173e: ce 01 movw r24, r28 31740: 01 96 adiw r24, 0x01 ; 1 31742: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 } 31746: 0f 90 pop r0 31748: 0f 90 pop r0 3174a: 0f 90 pop r0 3174c: 0f 90 pop r0 3174e: df 91 pop r29 31750: cf 91 pop r28 31752: 1f 91 pop r17 31754: 0f 91 pop r16 31756: 08 95 ret 00031758 : 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])); 31758: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> 3175c: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 31760: 07 2e mov r0, r23 31762: 00 0c add r0, r0 31764: 88 0b sbc r24, r24 31766: 99 0b sbc r25, r25 31768: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 3176c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 31770: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 31774: 40 91 40 04 lds r20, 0x0440 ; 0x800440 31778: 50 91 41 04 lds r21, 0x0441 ; 0x800441 3177c: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 31780: 0f 94 72 8b call 0x316e4 ; 0x316e4 babystepLoadZ = 0; 31784: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.457+0x1> 31788: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.457> } 3178c: 08 95 ret 0003178e : return sampled; } void go_home_with_z_lift() { 3178e: cf 93 push r28 31790: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31792: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31796: c5 ef ldi r28, 0xF5 ; 245 31798: d1 e1 ldi r29, 0x11 ; 17 3179a: 80 e0 ldi r24, 0x00 ; 0 3179c: 90 e0 ldi r25, 0x00 ; 0 3179e: a0 ea ldi r26, 0xA0 ; 160 317a0: b0 e4 ldi r27, 0x40 ; 64 317a2: 88 87 std Y+8, r24 ; 0x08 317a4: 99 87 std Y+9, r25 ; 0x09 317a6: aa 87 std Y+10, r26 ; 0x0a 317a8: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 317aa: 65 e5 ldi r22, 0x55 ; 85 317ac: 75 e5 ldi r23, 0x55 ; 85 317ae: 85 e5 ldi r24, 0x55 ; 85 317b0: 91 e4 ldi r25, 0x41 ; 65 317b2: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 317b6: 8d ec ldi r24, 0xCD ; 205 317b8: 9c ec ldi r25, 0xCC ; 204 317ba: ac e4 ldi r26, 0x4C ; 76 317bc: be e3 ldi r27, 0x3E ; 62 317be: 88 83 st Y, r24 317c0: 99 83 std Y+1, r25 ; 0x01 317c2: aa 83 std Y+2, r26 ; 0x02 317c4: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 317c6: 83 e3 ldi r24, 0x33 ; 51 317c8: 93 e3 ldi r25, 0x33 ; 51 317ca: a3 e7 ldi r26, 0x73 ; 115 317cc: b0 ec ldi r27, 0xC0 ; 192 317ce: 8c 83 std Y+4, r24 ; 0x04 317d0: 9d 83 std Y+5, r25 ; 0x05 317d2: ae 83 std Y+6, r26 ; 0x06 317d4: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 317d6: 69 ef ldi r22, 0xF9 ; 249 317d8: 71 e1 ldi r23, 0x11 ; 17 317da: ce 01 movw r24, r28 317dc: 0e 94 31 64 call 0xc862 ; 0xc862 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 317e0: 60 e0 ldi r22, 0x00 ; 0 317e2: 70 e0 ldi r23, 0x00 ; 0 317e4: 86 e1 ldi r24, 0x16 ; 22 317e6: 93 e4 ldi r25, 0x43 ; 67 317e8: 0f 94 c3 87 call 0x30f86 ; 0x30f86 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 317ec: 8a e9 ldi r24, 0x9A ; 154 317ee: 99 e9 ldi r25, 0x99 ; 153 317f0: a9 e1 ldi r26, 0x19 ; 25 317f2: be e3 ldi r27, 0x3E ; 62 317f4: 88 87 std Y+8, r24 ; 0x08 317f6: 99 87 std Y+9, r25 ; 0x09 317f8: aa 87 std Y+10, r26 ; 0x0a 317fa: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 317fc: 65 e5 ldi r22, 0x55 ; 85 317fe: 75 e5 ldi r23, 0x55 ; 85 31800: 85 e5 ldi r24, 0x55 ; 85 31802: 91 e4 ldi r25, 0x41 ; 65 } 31804: df 91 pop r29 31806: 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); 31808: 0d 94 c3 87 jmp 0x30f86 ; 0x30f86 0003180c : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 3180c: 68 2f mov r22, r24 3180e: 70 e0 ldi r23, 0x00 ; 0 31810: 90 e0 ldi r25, 0x00 ; 0 31812: 80 e0 ldi r24, 0x00 ; 0 31814: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 31818: 20 e0 ldi r18, 0x00 ; 0 3181a: 30 e0 ldi r19, 0x00 ; 0 3181c: 48 e0 ldi r20, 0x08 ; 8 3181e: 52 e4 ldi r21, 0x42 ; 66 31820: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31824: 20 e0 ldi r18, 0x00 ; 0 31826: 30 e0 ldi r19, 0x00 ; 0 31828: 40 e8 ldi r20, 0x80 ; 128 3182a: 5f e3 ldi r21, 0x3F ; 63 3182c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> } 31830: 08 95 ret 00031832 : // 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() { 31832: 2f 92 push r2 31834: 3f 92 push r3 31836: 4f 92 push r4 31838: 5f 92 push r5 3183a: 6f 92 push r6 3183c: 7f 92 push r7 3183e: 8f 92 push r8 31840: 9f 92 push r9 31842: af 92 push r10 31844: bf 92 push r11 31846: cf 92 push r12 31848: df 92 push r13 3184a: ef 92 push r14 3184c: ff 92 push r15 3184e: 0f 93 push r16 31850: 1f 93 push r17 31852: cf 93 push r28 31854: df 93 push r29 31856: 00 d0 rcall .+0 ; 0x31858 31858: 00 d0 rcall .+0 ; 0x3185a 3185a: cd b7 in r28, 0x3d ; 61 3185c: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3185e: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.362> 31862: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 31864: 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); 31868: 80 e0 ldi r24, 0x00 ; 0 3186a: 0f 94 4c 2c call 0x25898 ; 0x25898 3186e: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31870: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31874: 89 e8 ldi r24, 0x89 ; 137 31876: 98 e4 ldi r25, 0x48 ; 72 31878: 0e 94 3c 6d call 0xda78 ; 0xda78 3187c: 0f 94 92 0a call 0x21524 ; 0x21524 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 31880: 4d ed ldi r20, 0xDD ; 221 31882: 5c e6 ldi r21, 0x6C ; 108 31884: 63 e0 ldi r22, 0x03 ; 3 31886: 80 e0 ldi r24, 0x00 ; 0 31888: 0e 94 1a 6a call 0xd434 ; 0xd434 3188c: 81 e0 ldi r24, 0x01 ; 1 3188e: 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; 31892: 80 e0 ldi r24, 0x00 ; 0 31894: 90 e0 ldi r25, 0x00 ; 0 31896: a0 ea ldi r26, 0xA0 ; 160 31898: b0 e4 ldi r27, 0x40 ; 64 3189a: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 3189e: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 318a2: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 318a6: b0 93 00 12 sts 0x1200, r27 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 318aa: 65 e5 ldi r22, 0x55 ; 85 318ac: 75 e5 ldi r23, 0x55 ; 85 318ae: 85 e5 ldi r24, 0x55 ; 85 318b0: 91 e4 ldi r25, 0x41 ; 65 318b2: 0f 94 c3 87 call 0x30f86 ; 0x30f86 318b6: 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; 318ba: 80 e0 ldi r24, 0x00 ; 0 318bc: 90 e0 ldi r25, 0x00 ; 0 318be: a0 e8 ldi r26, 0x80 ; 128 318c0: bf e3 ldi r27, 0x3F ; 63 318c2: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 318c6: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 318ca: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 318ce: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = BED_Y0; 318d2: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 318d6: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 318da: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 318de: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 318e2: 69 ef ldi r22, 0xF9 ; 249 318e4: 71 e1 ldi r23, 0x11 ; 17 318e6: 85 ef ldi r24, 0xF5 ; 245 318e8: 91 e1 ldi r25, 0x11 ; 17 318ea: 0e 94 31 64 call 0xc862 ; 0xc862 go_to_current(homing_feedrate[X_AXIS]/60); 318ee: 60 e0 ldi r22, 0x00 ; 0 318f0: 70 e0 ldi r23, 0x00 ; 0 318f2: 88 e4 ldi r24, 0x48 ; 72 318f4: 92 e4 ldi r25, 0x42 ; 66 318f6: 0f 94 c3 87 call 0x30f86 ; 0x30f86 set_destination_to_current(); 318fa: 0e 94 c1 61 call 0xc382 ; 0xc382 homeaxis(Z_AXIS); 318fe: 82 e0 ldi r24, 0x02 ; 2 31900: 0f 94 5d 54 call 0x2a8ba ; 0x2a8ba if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31904: 43 e0 ldi r20, 0x03 ; 3 31906: 60 e0 ldi r22, 0x00 ; 0 31908: 70 e0 ldi r23, 0x00 ; 0 3190a: 80 e2 ldi r24, 0x20 ; 32 3190c: 91 ec ldi r25, 0xC1 ; 193 3190e: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 31912: 81 11 cpse r24, r1 31914: 06 c0 rjmp .+12 ; 0x31922 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)); 31916: 89 ee ldi r24, 0xE9 ; 233 31918: 92 e6 ldi r25, 0x62 ; 98 3191a: 0e 94 3c 6d call 0xda78 ; 0xda78 3191e: 0e 94 6a 73 call 0xe6d4 ; 0xe6d4 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 31922: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31926: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 3192a: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 3192e: b0 91 00 12 lds r27, 0x1200 ; 0x801200 31932: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d 31936: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e 3193a: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f 3193e: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 31942: e2 e0 ldi r30, 0x02 ; 2 31944: f0 e0 ldi r31, 0x00 ; 0 31946: fa 83 std Y+2, r31 ; 0x02 31948: 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; 3194a: c1 2c mov r12, r1 3194c: d1 2c mov r13, r1 3194e: 30 ea ldi r19, 0xA0 ; 160 31950: e3 2e mov r14, r19 31952: 30 e4 ldi r19, 0x40 ; 64 31954: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31956: 43 e0 ldi r20, 0x03 ; 3 31958: 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 3195a: 52 e0 ldi r21, 0x02 ; 2 3195c: 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); 3195e: 05 eb ldi r16, 0xB5 ; 181 31960: 1e e9 ldi r17, 0x9E ; 158 31962: 67 e0 ldi r22, 0x07 ; 7 31964: 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(); 31966: 0e 94 54 60 call 0xc0a8 ; 0xc0a8 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 3196a: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 3196e: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 31972: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 31976: f0 92 00 12 sts 0x1200, r15 ; 0x801200 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: 0f 94 c3 87 call 0x30f86 ; 0x30f86 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31986: 29 81 ldd r18, Y+1 ; 0x01 31988: 21 50 subi r18, 0x01 ; 1 3198a: 82 2f mov r24, r18 3198c: 6b 2d mov r22, r11 3198e: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 31992: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 31994: 82 2f mov r24, r18 31996: 0f 94 38 a1 call 0x34270 ; 0x34270 <__divmodqi4> 3199a: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 3199c: 80 ff sbrs r24, 0 3199e: 03 c0 rjmp .+6 ; 0x319a6 319a0: f9 2d mov r31, r9 319a2: f8 19 sub r31, r8 319a4: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 319a6: 88 2d mov r24, r8 319a8: 88 0f add r24, r24 319aa: 88 0d add r24, r8 319ac: 0f 94 06 8c call 0x3180c ; 0x3180c 319b0: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 319b4: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 319b8: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 319bc: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = BED_Y(iy * 3); 319c0: 87 2d mov r24, r7 319c2: 88 0f add r24, r24 319c4: 87 0d add r24, r7 319c6: 0f 94 06 8c call 0x3180c ; 0x3180c 319ca: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 319ce: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 319d2: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 319d6: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 319da: 69 ef ldi r22, 0xF9 ; 249 319dc: 71 e1 ldi r23, 0x11 ; 17 319de: 85 ef ldi r24, 0xF5 ; 245 319e0: 91 e1 ldi r25, 0x11 ; 17 319e2: 0e 94 31 64 call 0xc862 ; 0xc862 go_to_current(homing_feedrate[X_AXIS]/60); 319e6: 60 e0 ldi r22, 0x00 ; 0 319e8: 70 e0 ldi r23, 0x00 ; 0 319ea: 88 e4 ldi r24, 0x48 ; 72 319ec: 92 e4 ldi r25, 0x42 ; 66 319ee: 0f 94 c3 87 call 0x30f86 ; 0x30f86 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 319f2: 63 e0 ldi r22, 0x03 ; 3 319f4: 80 e0 ldi r24, 0x00 ; 0 319f6: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_printf_P(PSTR("%d/9"),mesh_point+1); 319fa: 8a 81 ldd r24, Y+2 ; 0x02 319fc: 8f 93 push r24 319fe: 99 81 ldd r25, Y+1 ; 0x01 31a00: 9f 93 push r25 31a02: 1f 93 push r17 31a04: 0f 93 push r16 31a06: 0e 94 df 69 call 0xd3be ; 0xd3be #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31a0a: 43 e0 ldi r20, 0x03 ; 3 31a0c: 60 e0 ldi r22, 0x00 ; 0 31a0e: 70 e0 ldi r23, 0x00 ; 0 31a10: 80 e2 ldi r24, 0x20 ; 32 31a12: 91 ec ldi r25, 0xC1 ; 193 31a14: 0f 94 9c 56 call 0x2ad38 ; 0x2ad38 31a18: 58 2e mov r5, r24 31a1a: 0f 90 pop r0 31a1c: 0f 90 pop r0 31a1e: 0f 90 pop r0 31a20: 0f 90 pop r0 31a22: 88 23 and r24, r24 31a24: 09 f4 brne .+2 ; 0x31a28 31a26: 77 cf rjmp .-274 ; 0x31916 31a28: a7 9c mul r10, r7 31a2a: f0 01 movw r30, r0 31a2c: 11 24 eor r1, r1 31a2e: e8 0d add r30, r8 31a30: f1 1d adc r31, r1 31a32: ee 0f add r30, r30 31a34: ff 1f adc r31, r31 31a36: ee 0f add r30, r30 31a38: ff 1f adc r31, r31 31a3a: e4 56 subi r30, 0x64 ; 100 31a3c: fd 4e sbci r31, 0xED ; 237 31a3e: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31a42: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31a46: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 31a4a: b0 91 00 12 lds r27, 0x1200 ; 0x801200 31a4e: 81 83 std Z+1, r24 ; 0x01 31a50: 92 83 std Z+2, r25 ; 0x02 31a52: a3 83 std Z+3, r26 ; 0x03 31a54: b4 83 std Z+4, r27 ; 0x04 31a56: e9 81 ldd r30, Y+1 ; 0x01 31a58: fa 81 ldd r31, Y+2 ; 0x02 31a5a: 31 96 adiw r30, 0x01 ; 1 31a5c: fa 83 std Y+2, r31 ; 0x02 31a5e: 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) { 31a60: 3a 97 sbiw r30, 0x0a ; 10 31a62: 09 f0 breq .+2 ; 0x31a66 31a64: 80 cf rjmp .-256 ; 0x31966 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 31a66: 60 90 9d 12 lds r6, 0x129D ; 0x80129d 31a6a: 70 90 9e 12 lds r7, 0x129E ; 0x80129e 31a6e: 80 90 9f 12 lds r8, 0x129F ; 0x80129f 31a72: 90 90 a0 12 lds r9, 0x12A0 ; 0x8012a0 float zmax = zmin; 31a76: 46 2c mov r4, r6 31a78: a7 2c mov r10, r7 31a7a: b8 2c mov r11, r8 31a7c: 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]; 31a7e: 1e 82 std Y+6, r1 ; 0x06 31a80: 1d 82 std Y+5, r1 ; 0x05 31a82: 0c e9 ldi r16, 0x9C ; 156 31a84: 12 e1 ldi r17, 0x12 ; 18 31a86: 8d 81 ldd r24, Y+5 ; 0x05 31a88: 9e 81 ldd r25, Y+6 ; 0x06 31a8a: 83 56 subi r24, 0x63 ; 99 31a8c: 9d 4e sbci r25, 0xED ; 237 31a8e: 9a 83 std Y+2, r25 ; 0x02 31a90: 89 83 std Y+1, r24 ; 0x01 31a92: 93 e0 ldi r25, 0x03 ; 3 31a94: 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]); 31a96: e9 81 ldd r30, Y+1 ; 0x01 31a98: fa 81 ldd r31, Y+2 ; 0x02 31a9a: c1 90 ld r12, Z+ 31a9c: d1 90 ld r13, Z+ 31a9e: e1 90 ld r14, Z+ 31aa0: f1 90 ld r15, Z+ 31aa2: fa 83 std Y+2, r31 ; 0x02 31aa4: e9 83 std Y+1, r30 ; 0x01 31aa6: 93 01 movw r18, r6 31aa8: a4 01 movw r20, r8 31aaa: c7 01 movw r24, r14 31aac: b6 01 movw r22, r12 31aae: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 31ab2: 18 16 cp r1, r24 31ab4: 14 f0 brlt .+4 ; 0x31aba 31ab6: 36 01 movw r6, r12 31ab8: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 31aba: 24 2d mov r18, r4 31abc: 3a 2d mov r19, r10 31abe: 4b 2d mov r20, r11 31ac0: 52 2d mov r21, r2 31ac2: c7 01 movw r24, r14 31ac4: b6 01 movw r22, r12 31ac6: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31aca: 87 fd sbrc r24, 7 31acc: 04 c0 rjmp .+8 ; 0x31ad6 31ace: 4c 2c mov r4, r12 31ad0: ad 2c mov r10, r13 31ad2: be 2c mov r11, r14 31ad4: 2f 2c mov r2, r15 31ad6: 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) { 31ad8: 31 10 cpse r3, r1 31ada: dd cf rjmp .-70 ; 0x31a96 31adc: 8d 81 ldd r24, Y+5 ; 0x05 31ade: 9e 81 ldd r25, Y+6 ; 0x06 31ae0: 4c 96 adiw r24, 0x1c ; 28 31ae2: 9e 83 std Y+6, r25 ; 0x06 31ae4: 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) 31ae6: 84 35 cpi r24, 0x54 ; 84 31ae8: 91 05 cpc r25, r1 31aea: 59 f6 brne .-106 ; 0x31a82 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) { 31aec: 93 01 movw r18, r6 31aee: a4 01 movw r20, r8 31af0: 64 2d mov r22, r4 31af2: 7a 2d mov r23, r10 31af4: 8b 2d mov r24, r11 31af6: 92 2d mov r25, r2 31af8: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 31afc: 20 e0 ldi r18, 0x00 ; 0 31afe: 30 e0 ldi r19, 0x00 ; 0 31b00: 40 e4 ldi r20, 0x40 ; 64 31b02: 50 e4 ldi r21, 0x40 ; 64 31b04: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 31b08: 18 16 cp r1, r24 31b0a: 2c f5 brge .+74 ; 0x31b56 // 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!"); 31b0c: 88 e9 ldi r24, 0x98 ; 152 31b0e: 9e e9 ldi r25, 0x9E ; 158 31b10: 0e 94 de 72 call 0xe5bc ; 0xe5bc // 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; 31b14: 51 2c mov r5, r1 31b16: fc 81 ldd r31, Y+4 ; 0x04 31b18: 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); 31b1c: 8b 81 ldd r24, Y+3 ; 0x03 31b1e: 0f 94 4c 2c call 0x25898 ; 0x25898 #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 31b22: 85 2d mov r24, r5 31b24: 26 96 adiw r28, 0x06 ; 6 31b26: 0f b6 in r0, 0x3f ; 63 31b28: f8 94 cli 31b2a: de bf out 0x3e, r29 ; 62 31b2c: 0f be out 0x3f, r0 ; 63 31b2e: cd bf out 0x3d, r28 ; 61 31b30: df 91 pop r29 31b32: cf 91 pop r28 31b34: 1f 91 pop r17 31b36: 0f 91 pop r16 31b38: ff 90 pop r15 31b3a: ef 90 pop r14 31b3c: df 90 pop r13 31b3e: cf 90 pop r12 31b40: bf 90 pop r11 31b42: af 90 pop r10 31b44: 9f 90 pop r9 31b46: 8f 90 pop r8 31b48: 7f 90 pop r7 31b4a: 6f 90 pop r6 31b4c: 5f 90 pop r5 31b4e: 4f 90 pop r4 31b50: 3f 90 pop r3 31b52: 2f 90 pop r2 31b54: 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) 31b56: 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; 31b58: 85 ec ldi r24, 0xC5 ; 197 31b5a: e8 2e mov r14, r24 31b5c: 8f e0 ldi r24, 0x0F ; 15 31b5e: f8 2e mov r15, r24 31b60: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31b62: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 31b64: 9d 81 ldd r25, Y+5 ; 0x05 31b66: 91 11 cpse r25, r1 31b68: 03 c0 rjmp .+6 ; 0x31b70 31b6a: e9 81 ldd r30, Y+1 ; 0x01 31b6c: ee 23 and r30, r30 31b6e: 29 f1 breq .+74 ; 0x31bba continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 31b70: 20 91 9d 12 lds r18, 0x129D ; 0x80129d 31b74: 30 91 9e 12 lds r19, 0x129E ; 0x80129e 31b78: 40 91 9f 12 lds r20, 0x129F ; 0x80129f 31b7c: 50 91 a0 12 lds r21, 0x12A0 ; 0x8012a0 31b80: f6 01 movw r30, r12 31b82: 61 81 ldd r22, Z+1 ; 0x01 31b84: 72 81 ldd r23, Z+2 ; 0x02 31b86: 83 81 ldd r24, Z+3 ; 0x03 31b88: 94 81 ldd r25, Z+4 ; 0x04 31b8a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 31b8e: 20 e0 ldi r18, 0x00 ; 0 31b90: 30 e0 ldi r19, 0x00 ; 0 31b92: 48 ec ldi r20, 0xC8 ; 200 31b94: 52 e4 ldi r21, 0x42 ; 66 31b96: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31b9a: 20 e0 ldi r18, 0x00 ; 0 31b9c: 30 e0 ldi r19, 0x00 ; 0 31b9e: 40 e0 ldi r20, 0x00 ; 0 31ba0: 5f e3 ldi r21, 0x3F ; 63 31ba2: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 31ba6: 0f 94 4c a3 call 0x34698 ; 0x34698 31baa: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 31bae: c7 01 movw r24, r14 31bb0: 0f 94 bf a0 call 0x3417e ; 0x3417e SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 31bb4: f2 e0 ldi r31, 0x02 ; 2 31bb6: ef 0e add r14, r31 31bb8: f1 1c adc r15, r1 31bba: 84 e0 ldi r24, 0x04 ; 4 31bbc: c8 0e add r12, r24 31bbe: d1 1c adc r13, r1 31bc0: 9d 81 ldd r25, Y+5 ; 0x05 31bc2: 9f 5f subi r25, 0xFF ; 255 31bc4: 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) { 31bc6: 93 30 cpi r25, 0x03 ; 3 31bc8: 69 f6 brne .-102 ; 0x31b64 31bca: 04 5e subi r16, 0xE4 ; 228 31bcc: 1f 4f sbci r17, 0xFF ; 255 31bce: e9 81 ldd r30, Y+1 ; 0x01 31bd0: ef 5f subi r30, 0xFF ; 255 31bd2: 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) 31bd4: e3 30 cpi r30, 0x03 ; 3 31bd6: 21 f6 brne .-120 ; 0x31b60 #endif addr += 2; } } mbl.reset(); 31bd8: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 go_home_with_z_lift(); 31bdc: 0f 94 c7 8b call 0x3178e ; 0x3178e 31be0: 9a cf rjmp .-204 ; 0x31b16 00031be2 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 31be2: 82 e0 ldi r24, 0x02 ; 2 31be4: 0f 94 00 22 call 0x24400 ; 0x24400 31be8: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 31bec: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 31bf0: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 31bf4: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_z_position(current_position[Z_AXIS]); 31bf8: 8d ef ldi r24, 0xFD ; 253 31bfa: 91 e1 ldi r25, 0x11 ; 17 31bfc: 0d 94 9c 75 jmp 0x2eb38 ; 0x2eb38 00031c00 : * 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() { 31c00: 4f 92 push r4 31c02: 5f 92 push r5 31c04: 6f 92 push r6 31c06: 7f 92 push r7 31c08: 8f 92 push r8 31c0a: 9f 92 push r9 31c0c: af 92 push r10 31c0e: bf 92 push r11 31c10: cf 92 push r12 31c12: df 92 push r13 31c14: ef 92 push r14 31c16: ff 92 push r15 31c18: 0f 93 push r16 31c1a: 1f 93 push r17 31c1c: cf 93 push r28 31c1e: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 31c20: 05 ef ldi r16, 0xF5 ; 245 31c22: 11 e1 ldi r17, 0x11 ; 17 31c24: c4 ed ldi r28, 0xD4 ; 212 31c26: d6 e1 ldi r29, 0x16 ; 22 31c28: 28 81 ld r18, Y 31c2a: 39 81 ldd r19, Y+1 ; 0x01 31c2c: 4a 81 ldd r20, Y+2 ; 0x02 31c2e: 5b 81 ldd r21, Y+3 ; 0x03 31c30: f8 01 movw r30, r16 31c32: 60 81 ld r22, Z 31c34: 71 81 ldd r23, Z+1 ; 0x01 31c36: 82 81 ldd r24, Z+2 ; 0x02 31c38: 93 81 ldd r25, Z+3 ; 0x03 31c3a: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 31c3e: 4b 01 movw r8, r22 31c40: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 31c42: 2c 81 ldd r18, Y+4 ; 0x04 31c44: 3d 81 ldd r19, Y+5 ; 0x05 31c46: 4e 81 ldd r20, Y+6 ; 0x06 31c48: 5f 81 ldd r21, Y+7 ; 0x07 31c4a: f8 01 movw r30, r16 31c4c: 64 81 ldd r22, Z+4 ; 0x04 31c4e: 75 81 ldd r23, Z+5 ; 0x05 31c50: 86 81 ldd r24, Z+6 ; 0x06 31c52: 97 81 ldd r25, Z+7 ; 0x07 31c54: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 31c58: 6b 01 movw r12, r22 31c5a: 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; 31c5c: c4 ec ldi r28, 0xC4 ; 196 31c5e: d6 e1 ldi r29, 0x16 ; 22 31c60: 28 81 ld r18, Y 31c62: 39 81 ldd r19, Y+1 ; 0x01 31c64: 4a 81 ldd r20, Y+2 ; 0x02 31c66: 5b 81 ldd r21, Y+3 ; 0x03 31c68: c5 01 movw r24, r10 31c6a: b4 01 movw r22, r8 31c6c: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31c70: 2b 01 movw r4, r22 31c72: 3c 01 movw r6, r24 31c74: 2c 81 ldd r18, Y+4 ; 0x04 31c76: 3d 81 ldd r19, Y+5 ; 0x05 31c78: 4e 81 ldd r20, Y+6 ; 0x06 31c7a: 5f 81 ldd r21, Y+7 ; 0x07 31c7c: c7 01 movw r24, r14 31c7e: b6 01 movw r22, r12 31c80: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31c84: 9b 01 movw r18, r22 31c86: ac 01 movw r20, r24 31c88: c3 01 movw r24, r6 31c8a: b2 01 movw r22, r4 31c8c: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 31c90: f8 01 movw r30, r16 31c92: 60 83 st Z, r22 31c94: 71 83 std Z+1, r23 ; 0x01 31c96: 82 83 std Z+2, r24 ; 0x02 31c98: 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; 31c9a: 28 85 ldd r18, Y+8 ; 0x08 31c9c: 39 85 ldd r19, Y+9 ; 0x09 31c9e: 4a 85 ldd r20, Y+10 ; 0x0a 31ca0: 5b 85 ldd r21, Y+11 ; 0x0b 31ca2: c5 01 movw r24, r10 31ca4: b4 01 movw r22, r8 31ca6: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31caa: 4b 01 movw r8, r22 31cac: 5c 01 movw r10, r24 31cae: 2c 85 ldd r18, Y+12 ; 0x0c 31cb0: 3d 85 ldd r19, Y+13 ; 0x0d 31cb2: 4e 85 ldd r20, Y+14 ; 0x0e 31cb4: 5f 85 ldd r21, Y+15 ; 0x0f 31cb6: c7 01 movw r24, r14 31cb8: b6 01 movw r22, r12 31cba: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31cbe: 9b 01 movw r18, r22 31cc0: ac 01 movw r20, r24 31cc2: c5 01 movw r24, r10 31cc4: b4 01 movw r22, r8 31cc6: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 31cca: f8 01 movw r30, r16 31ccc: 64 83 std Z+4, r22 ; 0x04 31cce: 75 83 std Z+5, r23 ; 0x05 31cd0: 86 83 std Z+6, r24 ; 0x06 31cd2: 97 83 std Z+7, r25 ; 0x07 } 31cd4: df 91 pop r29 31cd6: cf 91 pop r28 31cd8: 1f 91 pop r17 31cda: 0f 91 pop r16 31cdc: ff 90 pop r15 31cde: ef 90 pop r14 31ce0: df 90 pop r13 31ce2: cf 90 pop r12 31ce4: bf 90 pop r11 31ce6: af 90 pop r10 31ce8: 9f 90 pop r9 31cea: 8f 90 pop r8 31cec: 7f 90 pop r7 31cee: 6f 90 pop r6 31cf0: 5f 90 pop r5 31cf2: 4f 90 pop r4 31cf4: 08 95 ret 00031cf6 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 31cf6: 4f 92 push r4 31cf8: 5f 92 push r5 31cfa: 6f 92 push r6 31cfc: 7f 92 push r7 31cfe: 8f 92 push r8 31d00: 9f 92 push r9 31d02: af 92 push r10 31d04: bf 92 push r11 31d06: cf 92 push r12 31d08: df 92 push r13 31d0a: ef 92 push r14 31d0c: ff 92 push r15 31d0e: 0f 93 push r16 31d10: 1f 93 push r17 31d12: cf 93 push r28 31d14: df 93 push r29 31d16: 00 d0 rcall .+0 ; 0x31d18 31d18: 00 d0 rcall .+0 ; 0x31d1a 31d1a: 1f 92 push r1 31d1c: 1f 92 push r1 31d1e: cd b7 in r28, 0x3d ; 61 31d20: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 31d22: dc 01 movw r26, r24 31d24: cd 90 ld r12, X+ 31d26: dd 90 ld r13, X+ 31d28: ed 90 ld r14, X+ 31d2a: fc 90 ld r15, X 31d2c: 13 97 sbiw r26, 0x03 ; 3 31d2e: c0 92 a9 16 sts 0x16A9, r12 ; 0x8016a9 31d32: d0 92 aa 16 sts 0x16AA, r13 ; 0x8016aa 31d36: e0 92 ab 16 sts 0x16AB, r14 ; 0x8016ab 31d3a: f0 92 ac 16 sts 0x16AC, r15 ; 0x8016ac world2machine_rotation_and_skew[1][0] = vec_x[1]; 31d3e: 14 96 adiw r26, 0x04 ; 4 31d40: 0d 91 ld r16, X+ 31d42: 1d 91 ld r17, X+ 31d44: 2d 91 ld r18, X+ 31d46: 3c 91 ld r19, X 31d48: 17 97 sbiw r26, 0x07 ; 7 31d4a: 09 83 std Y+1, r16 ; 0x01 31d4c: 1a 83 std Y+2, r17 ; 0x02 31d4e: 2b 83 std Y+3, r18 ; 0x03 31d50: 3c 83 std Y+4, r19 ; 0x04 31d52: 00 93 b1 16 sts 0x16B1, r16 ; 0x8016b1 31d56: 10 93 b2 16 sts 0x16B2, r17 ; 0x8016b2 31d5a: 20 93 b3 16 sts 0x16B3, r18 ; 0x8016b3 31d5e: 30 93 b4 16 sts 0x16B4, r19 ; 0x8016b4 world2machine_rotation_and_skew[0][1] = vec_y[0]; 31d62: db 01 movw r26, r22 31d64: 0d 91 ld r16, X+ 31d66: 1d 91 ld r17, X+ 31d68: 2d 91 ld r18, X+ 31d6a: 3c 91 ld r19, X 31d6c: 13 97 sbiw r26, 0x03 ; 3 31d6e: 0d 83 std Y+5, r16 ; 0x05 31d70: 1e 83 std Y+6, r17 ; 0x06 31d72: 2f 83 std Y+7, r18 ; 0x07 31d74: 38 87 std Y+8, r19 ; 0x08 31d76: 00 93 ad 16 sts 0x16AD, r16 ; 0x8016ad 31d7a: 10 93 ae 16 sts 0x16AE, r17 ; 0x8016ae 31d7e: 20 93 af 16 sts 0x16AF, r18 ; 0x8016af 31d82: 30 93 b0 16 sts 0x16B0, r19 ; 0x8016b0 world2machine_rotation_and_skew[1][1] = vec_y[1]; 31d86: 14 96 adiw r26, 0x04 ; 4 31d88: 4d 90 ld r4, X+ 31d8a: 5d 90 ld r5, X+ 31d8c: 6d 90 ld r6, X+ 31d8e: 7c 90 ld r7, X 31d90: 17 97 sbiw r26, 0x07 ; 7 31d92: 40 92 b5 16 sts 0x16B5, r4 ; 0x8016b5 31d96: 50 92 b6 16 sts 0x16B6, r5 ; 0x8016b6 31d9a: 60 92 b7 16 sts 0x16B7, r6 ; 0x8016b7 31d9e: 70 92 b8 16 sts 0x16B8, r7 ; 0x8016b8 world2machine_shift[0] = cntr[0]; 31da2: fa 01 movw r30, r20 31da4: 60 81 ld r22, Z 31da6: 71 81 ldd r23, Z+1 ; 0x01 31da8: 82 81 ldd r24, Z+2 ; 0x02 31daa: 93 81 ldd r25, Z+3 ; 0x03 31dac: 60 93 d4 16 sts 0x16D4, r22 ; 0x8016d4 31db0: 70 93 d5 16 sts 0x16D5, r23 ; 0x8016d5 31db4: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 31db8: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 world2machine_shift[1] = cntr[1]; 31dbc: 84 80 ldd r8, Z+4 ; 0x04 31dbe: 95 80 ldd r9, Z+5 ; 0x05 31dc0: a6 80 ldd r10, Z+6 ; 0x06 31dc2: b7 80 ldd r11, Z+7 ; 0x07 31dc4: 80 92 d8 16 sts 0x16D8, r8 ; 0x8016d8 31dc8: 90 92 d9 16 sts 0x16D9, r9 ; 0x8016d9 31dcc: a0 92 da 16 sts 0x16DA, r10 ; 0x8016da 31dd0: 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) 31dd4: 20 e0 ldi r18, 0x00 ; 0 31dd6: 30 e0 ldi r19, 0x00 ; 0 31dd8: a9 01 movw r20, r18 31dda: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31dde: 81 11 cpse r24, r1 31de0: aa c0 rjmp .+340 ; 0x31f36 31de2: 20 e0 ldi r18, 0x00 ; 0 31de4: 30 e0 ldi r19, 0x00 ; 0 31de6: a9 01 movw r20, r18 31de8: c5 01 movw r24, r10 31dea: b4 01 movw r22, r8 31dec: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31df0: 81 11 cpse r24, r1 31df2: a1 c0 rjmp .+322 ; 0x31f36 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; 31df4: 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 || 31df8: 20 e0 ldi r18, 0x00 ; 0 31dfa: 30 e0 ldi r19, 0x00 ; 0 31dfc: 40 e8 ldi r20, 0x80 ; 128 31dfe: 5f e3 ldi r21, 0x3F ; 63 31e00: c7 01 movw r24, r14 31e02: b6 01 movw r22, r12 31e04: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31e08: 81 11 cpse r24, r1 31e0a: 21 c0 rjmp .+66 ; 0x31e4e 31e0c: 20 e0 ldi r18, 0x00 ; 0 31e0e: 30 e0 ldi r19, 0x00 ; 0 31e10: a9 01 movw r20, r18 31e12: 6d 81 ldd r22, Y+5 ; 0x05 31e14: 7e 81 ldd r23, Y+6 ; 0x06 31e16: 8f 81 ldd r24, Y+7 ; 0x07 31e18: 98 85 ldd r25, Y+8 ; 0x08 31e1a: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31e1e: 81 11 cpse r24, r1 31e20: 16 c0 rjmp .+44 ; 0x31e4e 31e22: 20 e0 ldi r18, 0x00 ; 0 31e24: 30 e0 ldi r19, 0x00 ; 0 31e26: a9 01 movw r20, r18 31e28: 69 81 ldd r22, Y+1 ; 0x01 31e2a: 7a 81 ldd r23, Y+2 ; 0x02 31e2c: 8b 81 ldd r24, Y+3 ; 0x03 31e2e: 9c 81 ldd r25, Y+4 ; 0x04 31e30: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31e34: 81 11 cpse r24, r1 31e36: 0b c0 rjmp .+22 ; 0x31e4e world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 31e38: 20 e0 ldi r18, 0x00 ; 0 31e3a: 30 e0 ldi r19, 0x00 ; 0 31e3c: 40 e8 ldi r20, 0x80 ; 128 31e3e: 5f e3 ldi r21, 0x3F ; 63 31e40: c3 01 movw r24, r6 31e42: b2 01 movw r22, r4 31e44: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 31e48: 88 23 and r24, r24 31e4a: 09 f4 brne .+2 ; 0x31e4e 31e4c: 78 c0 rjmp .+240 ; 0x31f3e // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 31e4e: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31e52: 82 60 ori r24, 0x02 ; 2 31e54: 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]; 31e58: a3 01 movw r20, r6 31e5a: 92 01 movw r18, r4 31e5c: c7 01 movw r24, r14 31e5e: b6 01 movw r22, r12 31e60: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31e64: 4b 01 movw r8, r22 31e66: 5c 01 movw r10, r24 31e68: 2d 81 ldd r18, Y+5 ; 0x05 31e6a: 3e 81 ldd r19, Y+6 ; 0x06 31e6c: 4f 81 ldd r20, Y+7 ; 0x07 31e6e: 58 85 ldd r21, Y+8 ; 0x08 31e70: 69 81 ldd r22, Y+1 ; 0x01 31e72: 7a 81 ldd r23, Y+2 ; 0x02 31e74: 8b 81 ldd r24, Y+3 ; 0x03 31e76: 9c 81 ldd r25, Y+4 ; 0x04 31e78: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 31e7c: 9b 01 movw r18, r22 31e7e: ac 01 movw r20, r24 31e80: c5 01 movw r24, r10 31e82: b4 01 movw r22, r8 31e84: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 31e88: 4b 01 movw r8, r22 31e8a: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 31e8c: ac 01 movw r20, r24 31e8e: 9b 01 movw r18, r22 31e90: c3 01 movw r24, r6 31e92: b2 01 movw r22, r4 31e94: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 31e98: 60 93 c4 16 sts 0x16C4, r22 ; 0x8016c4 31e9c: 70 93 c5 16 sts 0x16C5, r23 ; 0x8016c5 31ea0: 80 93 c6 16 sts 0x16C6, r24 ; 0x8016c6 31ea4: 90 93 c7 16 sts 0x16C7, r25 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 31ea8: 6d 81 ldd r22, Y+5 ; 0x05 31eaa: 7e 81 ldd r23, Y+6 ; 0x06 31eac: 8f 81 ldd r24, Y+7 ; 0x07 31eae: 98 85 ldd r25, Y+8 ; 0x08 31eb0: 90 58 subi r25, 0x80 ; 128 31eb2: a5 01 movw r20, r10 31eb4: 94 01 movw r18, r8 31eb6: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 31eba: 60 93 c8 16 sts 0x16C8, r22 ; 0x8016c8 31ebe: 70 93 c9 16 sts 0x16C9, r23 ; 0x8016c9 31ec2: 80 93 ca 16 sts 0x16CA, r24 ; 0x8016ca 31ec6: 90 93 cb 16 sts 0x16CB, r25 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 31eca: 69 81 ldd r22, Y+1 ; 0x01 31ecc: 7a 81 ldd r23, Y+2 ; 0x02 31ece: 8b 81 ldd r24, Y+3 ; 0x03 31ed0: 9c 81 ldd r25, Y+4 ; 0x04 31ed2: 90 58 subi r25, 0x80 ; 128 31ed4: a5 01 movw r20, r10 31ed6: 94 01 movw r18, r8 31ed8: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 31edc: 60 93 cc 16 sts 0x16CC, r22 ; 0x8016cc 31ee0: 70 93 cd 16 sts 0x16CD, r23 ; 0x8016cd 31ee4: 80 93 ce 16 sts 0x16CE, r24 ; 0x8016ce 31ee8: 90 93 cf 16 sts 0x16CF, r25 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 31eec: a5 01 movw r20, r10 31eee: 94 01 movw r18, r8 31ef0: c7 01 movw r24, r14 31ef2: b6 01 movw r22, r12 31ef4: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__divsf3> 31ef8: 60 93 d0 16 sts 0x16D0, r22 ; 0x8016d0 31efc: 70 93 d1 16 sts 0x16D1, r23 ; 0x8016d1 31f00: 80 93 d2 16 sts 0x16D2, r24 ; 0x8016d2 31f04: 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; } } 31f08: 28 96 adiw r28, 0x08 ; 8 31f0a: 0f b6 in r0, 0x3f ; 63 31f0c: f8 94 cli 31f0e: de bf out 0x3e, r29 ; 62 31f10: 0f be out 0x3f, r0 ; 63 31f12: cd bf out 0x3d, r28 ; 61 31f14: df 91 pop r29 31f16: cf 91 pop r28 31f18: 1f 91 pop r17 31f1a: 0f 91 pop r16 31f1c: ff 90 pop r15 31f1e: ef 90 pop r14 31f20: df 90 pop r13 31f22: cf 90 pop r12 31f24: bf 90 pop r11 31f26: af 90 pop r10 31f28: 9f 90 pop r9 31f2a: 8f 90 pop r8 31f2c: 7f 90 pop r7 31f2e: 6f 90 pop r6 31f30: 5f 90 pop r5 31f32: 4f 90 pop r4 31f34: 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; 31f36: 81 e0 ldi r24, 0x01 ; 1 31f38: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc 31f3c: 5d cf rjmp .-326 ; 0x31df8 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; 31f3e: 80 e0 ldi r24, 0x00 ; 0 31f40: 90 e0 ldi r25, 0x00 ; 0 31f42: a0 e8 ldi r26, 0x80 ; 128 31f44: bf e3 ldi r27, 0x3F ; 63 31f46: 80 93 c4 16 sts 0x16C4, r24 ; 0x8016c4 31f4a: 90 93 c5 16 sts 0x16C5, r25 ; 0x8016c5 31f4e: a0 93 c6 16 sts 0x16C6, r26 ; 0x8016c6 31f52: b0 93 c7 16 sts 0x16C7, r27 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = 0.f; 31f56: 10 92 c8 16 sts 0x16C8, r1 ; 0x8016c8 31f5a: 10 92 c9 16 sts 0x16C9, r1 ; 0x8016c9 31f5e: 10 92 ca 16 sts 0x16CA, r1 ; 0x8016ca 31f62: 10 92 cb 16 sts 0x16CB, r1 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = 0.f; 31f66: 10 92 cc 16 sts 0x16CC, r1 ; 0x8016cc 31f6a: 10 92 cd 16 sts 0x16CD, r1 ; 0x8016cd 31f6e: 10 92 ce 16 sts 0x16CE, r1 ; 0x8016ce 31f72: 10 92 cf 16 sts 0x16CF, r1 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = 1.f; 31f76: 80 93 d0 16 sts 0x16D0, r24 ; 0x8016d0 31f7a: 90 93 d1 16 sts 0x16D1, r25 ; 0x8016d1 31f7e: a0 93 d2 16 sts 0x16D2, r26 ; 0x8016d2 31f82: b0 93 d3 16 sts 0x16D3, r27 ; 0x8016d3 31f86: c0 cf rjmp .-128 ; 0x31f08 00031f88 : * * 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() { 31f88: cf 93 push r28 31f8a: df 93 push r29 31f8c: cd b7 in r28, 0x3d ; 61 31f8e: de b7 in r29, 0x3e ; 62 31f90: 68 97 sbiw r28, 0x18 ; 24 31f92: 0f b6 in r0, 0x3f ; 63 31f94: f8 94 cli 31f96: de bf out 0x3e, r29 ; 62 31f98: 0f be out 0x3f, r0 ; 63 31f9a: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 31f9c: 80 e0 ldi r24, 0x00 ; 0 31f9e: 90 e0 ldi r25, 0x00 ; 0 31fa0: a0 e8 ldi r26, 0x80 ; 128 31fa2: bf e3 ldi r27, 0x3F ; 63 31fa4: 89 83 std Y+1, r24 ; 0x01 31fa6: 9a 83 std Y+2, r25 ; 0x02 31fa8: ab 83 std Y+3, r26 ; 0x03 31faa: bc 83 std Y+4, r27 ; 0x04 31fac: 1d 82 std Y+5, r1 ; 0x05 31fae: 1e 82 std Y+6, r1 ; 0x06 31fb0: 1f 82 std Y+7, r1 ; 0x07 31fb2: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 31fb4: 19 86 std Y+9, r1 ; 0x09 31fb6: 1a 86 std Y+10, r1 ; 0x0a 31fb8: 1b 86 std Y+11, r1 ; 0x0b 31fba: 1c 86 std Y+12, r1 ; 0x0c 31fbc: 8d 87 std Y+13, r24 ; 0x0d 31fbe: 9e 87 std Y+14, r25 ; 0x0e 31fc0: af 87 std Y+15, r26 ; 0x0f 31fc2: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 31fc4: 19 8a std Y+17, r1 ; 0x11 31fc6: 1a 8a std Y+18, r1 ; 0x12 31fc8: 1b 8a std Y+19, r1 ; 0x13 31fca: 1c 8a std Y+20, r1 ; 0x14 31fcc: 1d 8a std Y+21, r1 ; 0x15 31fce: 1e 8a std Y+22, r1 ; 0x16 31fd0: 1f 8a std Y+23, r1 ; 0x17 31fd2: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 31fd4: ae 01 movw r20, r28 31fd6: 4f 5e subi r20, 0xEF ; 239 31fd8: 5f 4f sbci r21, 0xFF ; 255 31fda: be 01 movw r22, r28 31fdc: 67 5f subi r22, 0xF7 ; 247 31fde: 7f 4f sbci r23, 0xFF ; 255 31fe0: ce 01 movw r24, r28 31fe2: 01 96 adiw r24, 0x01 ; 1 31fe4: 0f 94 7b 8e call 0x31cf6 ; 0x31cf6 } 31fe8: 68 96 adiw r28, 0x18 ; 24 31fea: 0f b6 in r0, 0x3f ; 63 31fec: f8 94 cli 31fee: de bf out 0x3e, r29 ; 62 31ff0: 0f be out 0x3f, r0 ; 63 31ff2: cd bf out 0x3d, r28 ; 61 31ff4: df 91 pop r29 31ff6: cf 91 pop r28 31ff8: 08 95 ret 00031ffa : * * 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) { 31ffa: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31ffe: 88 23 and r24, r24 32000: d1 f0 breq .+52 ; 0x32036 world2machine_reset(); 32002: 0f 94 c4 8f call 0x31f88 ; 0x31f88 st_synchronize(); 32006: 0f 94 14 22 call 0x24428 ; 0x24428 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 3200a: 80 e0 ldi r24, 0x00 ; 0 3200c: 0f 94 00 22 call 0x24400 ; 0x24400 32010: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 32014: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 32018: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 3201c: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 32020: 81 e0 ldi r24, 0x01 ; 1 32022: 0f 94 00 22 call 0x24400 ; 0x24400 32026: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 3202a: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 3202e: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 32032: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } } 32036: 08 95 ret 00032038 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 32038: 4f ef ldi r20, 0xFF ; 255 3203a: 5f ef ldi r21, 0xFF ; 255 3203c: ba 01 movw r22, r20 3203e: 85 ee ldi r24, 0xE5 ; 229 32040: 9f e0 ldi r25, 0x0F ; 15 32042: 0f 94 b3 a0 call 0x34166 ; 0x34166 32046: 4f ef ldi r20, 0xFF ; 255 32048: 5f ef ldi r21, 0xFF ; 255 3204a: ba 01 movw r22, r20 3204c: 89 ee ldi r24, 0xE9 ; 233 3204e: 9f e0 ldi r25, 0x0F ; 15 32050: 0f 94 b3 a0 call 0x34166 ; 0x34166 32054: 4f ef ldi r20, 0xFF ; 255 32056: 5f ef ldi r21, 0xFF ; 255 32058: ba 01 movw r22, r20 3205a: 8d ed ldi r24, 0xDD ; 221 3205c: 9f e0 ldi r25, 0x0F ; 15 3205e: 0f 94 b3 a0 call 0x34166 ; 0x34166 32062: 4f ef ldi r20, 0xFF ; 255 32064: 5f ef ldi r21, 0xFF ; 255 32066: ba 01 movw r22, r20 32068: 81 ee ldi r24, 0xE1 ; 225 3206a: 9f e0 ldi r25, 0x0F ; 15 3206c: 0f 94 b3 a0 call 0x34166 ; 0x34166 32070: 4f ef ldi r20, 0xFF ; 255 32072: 5f ef ldi r21, 0xFF ; 255 32074: ba 01 movw r22, r20 32076: 85 ed ldi r24, 0xD5 ; 213 32078: 9f e0 ldi r25, 0x0F ; 15 3207a: 0f 94 b3 a0 call 0x34166 ; 0x34166 3207e: 4f ef ldi r20, 0xFF ; 255 32080: 5f ef ldi r21, 0xFF ; 255 32082: ba 01 movw r22, r20 32084: 89 ed ldi r24, 0xD9 ; 217 32086: 9f e0 ldi r25, 0x0F ; 15 32088: 0f 94 b3 a0 call 0x34166 ; 0x34166 3208c: 4f ef ldi r20, 0xFF ; 255 3208e: 5f ef ldi r21, 0xFF ; 255 32090: ba 01 movw r22, r20 32092: 85 ec ldi r24, 0xC5 ; 197 32094: 9f e0 ldi r25, 0x0F ; 15 32096: 0f 94 b3 a0 call 0x34166 ; 0x34166 3209a: 4f ef ldi r20, 0xFF ; 255 3209c: 5f ef ldi r21, 0xFF ; 255 3209e: ba 01 movw r22, r20 320a0: 89 ec ldi r24, 0xC9 ; 201 320a2: 9f e0 ldi r25, 0x0F ; 15 320a4: 0f 94 b3 a0 call 0x34166 ; 0x34166 320a8: 4f ef ldi r20, 0xFF ; 255 320aa: 5f ef ldi r21, 0xFF ; 255 320ac: ba 01 movw r22, r20 320ae: 8d ec ldi r24, 0xCD ; 205 320b0: 9f e0 ldi r25, 0x0F ; 15 320b2: 0f 94 b3 a0 call 0x34166 ; 0x34166 320b6: 4f ef ldi r20, 0xFF ; 255 320b8: 5f ef ldi r21, 0xFF ; 255 320ba: ba 01 movw r22, r20 320bc: 81 ed ldi r24, 0xD1 ; 209 320be: 9f e0 ldi r25, 0x0F ; 15 320c0: 0d 94 b3 a0 jmp 0x34166 ; 0x34166 000320c4 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 320c4: 4f 92 push r4 320c6: 5f 92 push r5 320c8: 6f 92 push r6 320ca: 7f 92 push r7 320cc: 8f 92 push r8 320ce: 9f 92 push r9 320d0: af 92 push r10 320d2: bf 92 push r11 320d4: cf 92 push r12 320d6: df 92 push r13 320d8: ef 92 push r14 320da: ff 92 push r15 320dc: 1f 93 push r17 320de: cf 93 push r28 320e0: df 93 push r29 320e2: cd b7 in r28, 0x3d ; 61 320e4: de b7 in r29, 0x3e ; 62 320e6: a8 97 sbiw r28, 0x28 ; 40 320e8: 0f b6 in r0, 0x3f ; 63 320ea: f8 94 cli 320ec: de bf out 0x3e, r29 ; 62 320ee: 0f be out 0x3f, r0 ; 63 320f0: 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); 320f2: 48 e0 ldi r20, 0x08 ; 8 320f4: 50 e0 ldi r21, 0x00 ; 0 320f6: 6d ed ldi r22, 0xDD ; 221 320f8: 7f e0 ldi r23, 0x0F ; 15 320fa: ce 01 movw r24, r28 320fc: 01 96 adiw r24, 0x01 ; 1 320fe: 0f 94 6d a0 call 0x340da ; 0x340da eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 32102: 48 e0 ldi r20, 0x08 ; 8 32104: 50 e0 ldi r21, 0x00 ; 0 32106: 65 ed ldi r22, 0xD5 ; 213 32108: 7f e0 ldi r23, 0x0F ; 15 3210a: ce 01 movw r24, r28 3210c: 09 96 adiw r24, 0x09 ; 9 3210e: 0f 94 6d a0 call 0x340da ; 0x340da eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 32112: 48 e0 ldi r20, 0x08 ; 8 32114: 50 e0 ldi r21, 0x00 ; 0 32116: 65 ee ldi r22, 0xE5 ; 229 32118: 7f e0 ldi r23, 0x0F ; 15 3211a: ce 01 movw r24, r28 3211c: 41 96 adiw r24, 0x11 ; 17 3211e: 0f 94 6d a0 call 0x340da ; 0x340da } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 32122: 89 89 ldd r24, Y+17 ; 0x11 32124: 9a 89 ldd r25, Y+18 ; 0x12 32126: ab 89 ldd r26, Y+19 ; 0x13 32128: bc 89 ldd r27, Y+20 ; 0x14 3212a: 89 a3 std Y+33, r24 ; 0x21 3212c: 9a a3 std Y+34, r25 ; 0x22 3212e: ab a3 std Y+35, r26 ; 0x23 32130: bc a3 std Y+36, r27 ; 0x24 32132: 8f 3f cpi r24, 0xFF ; 255 32134: 9f 4f sbci r25, 0xFF ; 255 32136: af 4f sbci r26, 0xFF ; 255 32138: bf 4f sbci r27, 0xFF ; 255 3213a: 09 f4 brne .+2 ; 0x3213e 3213c: b1 c0 rjmp .+354 ; 0x322a0 3213e: 8d 89 ldd r24, Y+21 ; 0x15 32140: 9e 89 ldd r25, Y+22 ; 0x16 32142: af 89 ldd r26, Y+23 ; 0x17 32144: b8 8d ldd r27, Y+24 ; 0x18 32146: 8d a3 std Y+37, r24 ; 0x25 32148: 9e a3 std Y+38, r25 ; 0x26 3214a: af a3 std Y+39, r26 ; 0x27 3214c: b8 a7 std Y+40, r27 ; 0x28 3214e: 8f 3f cpi r24, 0xFF ; 255 32150: 9f 4f sbci r25, 0xFF ; 255 32152: af 4f sbci r26, 0xFF ; 255 32154: bf 4f sbci r27, 0xFF ; 255 32156: 09 f4 brne .+2 ; 0x3215a 32158: a3 c0 rjmp .+326 ; 0x322a0 3215a: 89 80 ldd r8, Y+1 ; 0x01 3215c: 9a 80 ldd r9, Y+2 ; 0x02 3215e: ab 80 ldd r10, Y+3 ; 0x03 32160: bc 80 ldd r11, Y+4 ; 0x04 32162: 8f ef ldi r24, 0xFF ; 255 32164: 88 16 cp r8, r24 32166: 98 06 cpc r9, r24 32168: a8 06 cpc r10, r24 3216a: b8 06 cpc r11, r24 3216c: 09 f4 brne .+2 ; 0x32170 3216e: 98 c0 rjmp .+304 ; 0x322a0 32170: 8d 81 ldd r24, Y+5 ; 0x05 32172: 9e 81 ldd r25, Y+6 ; 0x06 32174: af 81 ldd r26, Y+7 ; 0x07 32176: b8 85 ldd r27, Y+8 ; 0x08 32178: 89 8f std Y+25, r24 ; 0x19 3217a: 9a 8f std Y+26, r25 ; 0x1a 3217c: ab 8f std Y+27, r26 ; 0x1b 3217e: bc 8f std Y+28, r27 ; 0x1c 32180: 8f 3f cpi r24, 0xFF ; 255 32182: 9f 4f sbci r25, 0xFF ; 255 32184: af 4f sbci r26, 0xFF ; 255 32186: bf 4f sbci r27, 0xFF ; 255 32188: 09 f4 brne .+2 ; 0x3218c 3218a: 8a c0 rjmp .+276 ; 0x322a0 3218c: c9 84 ldd r12, Y+9 ; 0x09 3218e: da 84 ldd r13, Y+10 ; 0x0a 32190: eb 84 ldd r14, Y+11 ; 0x0b 32192: fc 84 ldd r15, Y+12 ; 0x0c 32194: 8f ef ldi r24, 0xFF ; 255 32196: c8 16 cp r12, r24 32198: d8 06 cpc r13, r24 3219a: e8 06 cpc r14, r24 3219c: f8 06 cpc r15, r24 3219e: 09 f4 brne .+2 ; 0x321a2 321a0: 7f c0 rjmp .+254 ; 0x322a0 321a2: 8d 85 ldd r24, Y+13 ; 0x0d 321a4: 9e 85 ldd r25, Y+14 ; 0x0e 321a6: af 85 ldd r26, Y+15 ; 0x0f 321a8: b8 89 ldd r27, Y+16 ; 0x10 321aa: 8d 8f std Y+29, r24 ; 0x1d 321ac: 9e 8f std Y+30, r25 ; 0x1e 321ae: af 8f std Y+31, r26 ; 0x1f 321b0: b8 a3 std Y+32, r27 ; 0x20 321b2: 8f 3f cpi r24, 0xFF ; 255 321b4: 9f 4f sbci r25, 0xFF ; 255 321b6: af 4f sbci r26, 0xFF ; 255 321b8: bf 4f sbci r27, 0xFF ; 255 321ba: 09 f4 brne .+2 ; 0x321be 321bc: 71 c0 rjmp .+226 ; 0x322a0 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 321be: 29 8d ldd r18, Y+25 ; 0x19 321c0: 3a 8d ldd r19, Y+26 ; 0x1a 321c2: 4b 8d ldd r20, Y+27 ; 0x1b 321c4: 5c 8d ldd r21, Y+28 ; 0x1c 321c6: c5 01 movw r24, r10 321c8: b4 01 movw r22, r8 321ca: 0f 94 41 a4 call 0x34882 ; 0x34882 321ce: 2b 01 movw r4, r22 321d0: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 321d2: 26 e6 ldi r18, 0x66 ; 102 321d4: 36 e6 ldi r19, 0x66 ; 102 321d6: 46 e6 ldi r20, 0x66 ; 102 321d8: 5f e3 ldi r21, 0x3F ; 63 321da: 0f 94 9a a2 call 0x34534 ; 0x34534 <__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; 321de: 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) 321e0: 87 fd sbrc r24, 7 321e2: 0b c0 rjmp .+22 ; 0x321fa 321e4: 2d ec ldi r18, 0xCD ; 205 321e6: 3c ec ldi r19, 0xCC ; 204 321e8: 4c e8 ldi r20, 0x8C ; 140 321ea: 5f e3 ldi r21, 0x3F ; 63 321ec: c3 01 movw r24, r6 321ee: b2 01 movw r22, r4 321f0: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 321f4: 18 16 cp r1, r24 321f6: 0c f0 brlt .+2 ; 0x321fa 321f8: 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]); 321fa: 2d 8d ldd r18, Y+29 ; 0x1d 321fc: 3e 8d ldd r19, Y+30 ; 0x1e 321fe: 4f 8d ldd r20, Y+31 ; 0x1f 32200: 58 a1 ldd r21, Y+32 ; 0x20 32202: c7 01 movw r24, r14 32204: b6 01 movw r22, r12 32206: 0f 94 41 a4 call 0x34882 ; 0x34882 3220a: 2b 01 movw r4, r22 3220c: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 3220e: 26 e6 ldi r18, 0x66 ; 102 32210: 36 e6 ldi r19, 0x66 ; 102 32212: 46 e6 ldi r20, 0x66 ; 102 32214: 5f e3 ldi r21, 0x3F ; 63 32216: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 3221a: 87 fd sbrc r24, 7 3221c: 7f c0 rjmp .+254 ; 0x3231c 3221e: 2d ec ldi r18, 0xCD ; 205 32220: 3c ec ldi r19, 0xCC ; 204 32222: 4c e8 ldi r20, 0x8C ; 140 32224: 5f e3 ldi r21, 0x3F ; 63 32226: c3 01 movw r24, r6 32228: b2 01 movw r22, r4 3222a: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 3222e: 18 16 cp r1, r24 32230: 0c f4 brge .+2 ; 0x32234 32232: 74 c0 rjmp .+232 ; 0x3231c 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]); 32234: 2d a1 ldd r18, Y+37 ; 0x25 32236: 3e a1 ldd r19, Y+38 ; 0x26 32238: 4f a1 ldd r20, Y+39 ; 0x27 3223a: 58 a5 ldd r21, Y+40 ; 0x28 3223c: 69 a1 ldd r22, Y+33 ; 0x21 3223e: 7a a1 ldd r23, Y+34 ; 0x22 32240: 8b a1 ldd r24, Y+35 ; 0x23 32242: 9c a1 ldd r25, Y+36 ; 0x24 32244: 0f 94 41 a4 call 0x34882 ; 0x34882 if (l > 15.f) 32248: 20 e0 ldi r18, 0x00 ; 0 3224a: 30 e0 ldi r19, 0x00 ; 0 3224c: 40 e7 ldi r20, 0x70 ; 112 3224e: 51 e4 ldi r21, 0x41 ; 65 32250: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 32254: 18 16 cp r1, r24 32256: 0c f4 brge .+2 ; 0x3225a #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 32258: 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]; 3225a: a5 01 movw r20, r10 3225c: 94 01 movw r18, r8 3225e: c7 01 movw r24, r14 32260: b6 01 movw r22, r12 32262: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 32266: 6b 01 movw r12, r22 32268: 7c 01 movw r14, r24 3226a: 2d 8d ldd r18, Y+29 ; 0x1d 3226c: 3e 8d ldd r19, Y+30 ; 0x1e 3226e: 4f 8d ldd r20, Y+31 ; 0x1f 32270: 58 a1 ldd r21, Y+32 ; 0x20 32272: 69 8d ldd r22, Y+25 ; 0x19 32274: 7a 8d ldd r23, Y+26 ; 0x1a 32276: 8b 8d ldd r24, Y+27 ; 0x1b 32278: 9c 8d ldd r25, Y+28 ; 0x1c 3227a: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3227e: 9b 01 movw r18, r22 32280: ac 01 movw r20, r24 32282: c7 01 movw r24, r14 32284: b6 01 movw r22, r12 32286: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> if (fabs(l) > 0.1f) 3228a: 9f 77 andi r25, 0x7F ; 127 3228c: 2d ec ldi r18, 0xCD ; 205 3228e: 3c ec ldi r19, 0xCC ; 204 32290: 4c ec ldi r20, 0xCC ; 204 32292: 5d e3 ldi r21, 0x3D ; 61 32294: 0f 94 2e a4 call 0x3485c ; 0x3485c <__gesf2> 32298: 18 16 cp r1, r24 3229a: 14 f0 brlt .+4 ; 0x322a0 #endif reset = true; } } if (reset) 3229c: 11 23 and r17, r17 3229e: f1 f0 breq .+60 ; 0x322dc { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 322a0: 0f 94 1c 90 call 0x32038 ; 0x32038 * @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; 322a4: 80 e0 ldi r24, 0x00 ; 0 322a6: 90 e0 ldi r25, 0x00 ; 0 322a8: a0 e8 ldi r26, 0x80 ; 128 322aa: bf e3 ldi r27, 0x3F ; 63 322ac: 89 83 std Y+1, r24 ; 0x01 322ae: 9a 83 std Y+2, r25 ; 0x02 322b0: ab 83 std Y+3, r26 ; 0x03 322b2: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 322b4: 1d 82 std Y+5, r1 ; 0x05 322b6: 1e 82 std Y+6, r1 ; 0x06 322b8: 1f 82 std Y+7, r1 ; 0x07 322ba: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 322bc: 19 86 std Y+9, r1 ; 0x09 322be: 1a 86 std Y+10, r1 ; 0x0a 322c0: 1b 86 std Y+11, r1 ; 0x0b 322c2: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 322c4: 8d 87 std Y+13, r24 ; 0x0d 322c6: 9e 87 std Y+14, r25 ; 0x0e 322c8: af 87 std Y+15, r26 ; 0x0f 322ca: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 322cc: 19 8a std Y+17, r1 ; 0x11 322ce: 1a 8a std Y+18, r1 ; 0x12 322d0: 1b 8a std Y+19, r1 ; 0x13 322d2: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 322d4: 1d 8a std Y+21, r1 ; 0x15 322d6: 1e 8a std Y+22, r1 ; 0x16 322d8: 1f 8a std Y+23, r1 ; 0x17 322da: 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); 322dc: ae 01 movw r20, r28 322de: 4f 5e subi r20, 0xEF ; 239 322e0: 5f 4f sbci r21, 0xFF ; 255 322e2: be 01 movw r22, r28 322e4: 67 5f subi r22, 0xF7 ; 247 322e6: 7f 4f sbci r23, 0xFF ; 255 322e8: ce 01 movw r24, r28 322ea: 01 96 adiw r24, 0x01 ; 1 322ec: 0f 94 7b 8e call 0x31cf6 ; 0x31cf6 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 322f0: a8 96 adiw r28, 0x28 ; 40 322f2: 0f b6 in r0, 0x3f ; 63 322f4: f8 94 cli 322f6: de bf out 0x3e, r29 ; 62 322f8: 0f be out 0x3f, r0 ; 63 322fa: cd bf out 0x3d, r28 ; 61 322fc: df 91 pop r29 322fe: cf 91 pop r28 32300: 1f 91 pop r17 32302: ff 90 pop r15 32304: ef 90 pop r14 32306: df 90 pop r13 32308: cf 90 pop r12 3230a: bf 90 pop r11 3230c: af 90 pop r10 3230e: 9f 90 pop r9 32310: 8f 90 pop r8 32312: 7f 90 pop r7 32314: 6f 90 pop r6 32316: 5f 90 pop r5 32318: 4f 90 pop r4 3231a: 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; 3231c: 11 e0 ldi r17, 0x01 ; 1 3231e: 8a cf rjmp .-236 ; 0x32234 00032320 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 32320: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 32322: 24 e1 ldi r18, 0x14 ; 20 32324: ac 01 movw r20, r24 32326: 24 9f mul r18, r20 32328: c0 01 movw r24, r0 3232a: 25 9f mul r18, r21 3232c: 90 0d add r25, r0 3232e: 11 24 eor r1, r1 32330: 60 91 a7 16 lds r22, 0x16A7 ; 0x8016a7 32334: 70 91 a8 16 lds r23, 0x16A8 ; 0x8016a8 32338: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 3233c: c6 2f mov r28, r22 3233e: 65 31 cpi r22, 0x15 ; 21 32340: 08 f0 brcs .+2 ; 0x32344 32342: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 32344: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32348: 8c 17 cp r24, r28 3234a: 48 f4 brcc .+18 ; 0x3235e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 3234c: 8f ef ldi r24, 0xFF ; 255 3234e: 0e 94 b5 6a call 0xd56a ; 0xd56a { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 32352: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32356: 8f 5f subi r24, 0xFF ; 255 32358: 80 93 a6 16 sts 0x16A6, r24 ; 0x8016a6 3235c: f3 cf rjmp .-26 ; 0x32344 } } 3235e: cf 91 pop r28 32360: 08 95 ret 00032362 : void menu_progressbar_finish(void) { progressbar_total = 1; 32362: 81 e0 ldi r24, 0x01 ; 1 32364: 90 e0 ldi r25, 0x00 ; 0 32366: 90 93 a8 16 sts 0x16A8, r25 ; 0x8016a8 3236a: 80 93 a7 16 sts 0x16A7, r24 ; 0x8016a7 menu_progressbar_update(1); 3236e: 0f 94 90 91 call 0x32320 ; 0x32320 _delay(300); 32372: 6c e2 ldi r22, 0x2C ; 44 32374: 71 e0 ldi r23, 0x01 ; 1 32376: 80 e0 ldi r24, 0x00 ; 0 32378: 90 e0 ldi r25, 0x00 ; 0 3237a: 0d 94 4d 0d jmp 0x21a9a ; 0x21a9a 0003237e : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 3237e: 0f 93 push r16 32380: 1f 93 push r17 32382: cf 93 push r28 32384: df 93 push r29 32386: 8c 01 movw r16, r24 32388: eb 01 movw r28, r22 lcd_clear(); 3238a: 0e 94 39 6a call 0xd472 ; 0xd472 progressbar_block_count = 0; 3238e: 10 92 a6 16 sts 0x16A6, r1 ; 0x8016a6 progressbar_total = total; 32392: 10 93 a8 16 sts 0x16A8, r17 ; 0x8016a8 32396: 00 93 a7 16 sts 0x16A7, r16 ; 0x8016a7 lcd_set_cursor(0, 1); 3239a: 61 e0 ldi r22, 0x01 ; 1 3239c: 80 e0 ldi r24, 0x00 ; 0 3239e: 0e 94 06 6a call 0xd40c ; 0xd40c lcd_print_pad_P(title, LCD_WIDTH); 323a2: 64 e1 ldi r22, 0x14 ; 20 323a4: ce 01 movw r24, r28 323a6: 0e 94 db 6b call 0xd7b6 ; 0xd7b6 lcd_set_cursor(0, 2); 323aa: 62 e0 ldi r22, 0x02 ; 2 323ac: 80 e0 ldi r24, 0x00 ; 0 } 323ae: df 91 pop r29 323b0: cf 91 pop r28 323b2: 1f 91 pop r17 323b4: 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); 323b6: 0c 94 06 6a jmp 0xd40c ; 0xd40c 000323ba : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 323ba: 80 91 31 04 lds r24, 0x0431 ; 0x800431 323be: 90 91 30 04 lds r25, 0x0430 ; 0x800430 323c2: 89 13 cpse r24, r25 323c4: 0b c0 rjmp .+22 ; 0x323dc 323c6: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 323ca: 99 23 and r25, r25 323cc: 39 f0 breq .+14 ; 0x323dc 323ce: 20 91 06 05 lds r18, 0x0506 ; 0x800506 323d2: 30 91 07 05 lds r19, 0x0507 ; 0x800507 323d6: 82 17 cp r24, r18 323d8: 13 06 cpc r1, r19 323da: 39 f0 breq .+14 ; 0x323ea 323dc: 81 e0 ldi r24, 0x01 ; 1 323de: 90 91 92 03 lds r25, 0x0392 ; 0x800392 323e2: 91 11 cpse r25, r1 323e4: 03 c0 rjmp .+6 ; 0x323ec 323e6: 80 e0 ldi r24, 0x00 ; 0 323e8: 08 95 ret 323ea: 81 e0 ldi r24, 0x01 ; 1 } 323ec: 08 95 ret 000323ee : //! @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) { 323ee: 0f 93 push r16 323f0: 1f 93 push r17 323f2: cf 93 push r28 323f4: df 93 push r29 323f6: 8c 01 movw r16, r24 323f8: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 323fa: 8b e5 ldi r24, 0x5B ; 91 323fc: 94 e4 ldi r25, 0x44 ; 68 323fe: 0e 94 3c 6d call 0xda78 ; 0xda78 32402: 9f 93 push r25 32404: 8f 93 push r24 32406: 8d e8 ldi r24, 0x8D ; 141 32408: 9e e9 ldi r25, 0x9E ; 158 3240a: 9f 93 push r25 3240c: 8f 93 push r24 3240e: df 93 push r29 32410: cf 93 push r28 32412: 0f 94 94 9f call 0x33f28 ; 0x33f28 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 32416: c8 0f add r28, r24 32418: d1 1d adc r29, r1 3241a: 47 e0 ldi r20, 0x07 ; 7 3241c: 50 e0 ldi r21, 0x00 ; 0 3241e: b8 01 movw r22, r16 32420: ce 01 movw r24, r28 32422: 0f 94 6d a0 call 0x340da ; 0x340da //index += 7; buffer.c[index + 7] = '\0'; 32426: 1f 82 std Y+7, r1 ; 0x07 32428: 0f 90 pop r0 3242a: 0f 90 pop r0 3242c: 0f 90 pop r0 3242e: 0f 90 pop r0 32430: 0f 90 pop r0 32432: 0f 90 pop r0 } 32434: df 91 pop r29 32436: cf 91 pop r28 32438: 1f 91 pop r17 3243a: 0f 91 pop r16 3243c: 08 95 ret 0003243e : 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)?'>':' '; 3243e: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32442: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32446: 90 91 07 05 lds r25, 0x0507 ; 0x800507 3244a: 28 17 cp r18, r24 3244c: 19 06 cpc r1, r25 3244e: 11 f0 breq .+4 ; 0x32454 32450: 80 e2 ldi r24, 0x20 ; 32 32452: 08 95 ret 32454: 8e e3 ldi r24, 0x3E ; 62 } 32456: 08 95 ret 00032458 : static void menu_draw_item_puts_P(char type_char, const char* str) { 32458: 0f 93 push r16 3245a: 1f 93 push r17 3245c: cf 93 push r28 3245e: c8 2f mov r28, r24 32460: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 32462: 0f 94 1f 92 call 0x3243e ; 0x3243e 32466: 48 2f mov r20, r24 32468: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3246c: 80 e0 ldi r24, 0x00 ; 0 3246e: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_print_pad_P(str, LCD_WIDTH - 2); 32472: 62 e1 ldi r22, 0x12 ; 18 32474: c8 01 movw r24, r16 32476: 0e 94 db 6b call 0xd7b6 ; 0xd7b6 lcd_putc(type_char); 3247a: 8c 2f mov r24, r28 } 3247c: cf 91 pop r28 3247e: 1f 91 pop r17 32480: 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); 32482: 0c 94 f5 69 jmp 0xd3ea ; 0xd3ea 00032486 : } } void menu_item_ret(void) { lcd_draw_update = 2; 32486: 82 e0 ldi r24, 0x02 ; 2 32488: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_item++; 3248c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32490: 8f 5f subi r24, 0xFF ; 255 32492: 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 32496: 84 e0 ldi r24, 0x04 ; 4 32498: 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 3249c: 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 324a0: 10 92 2f 04 sts 0x042F, r1 ; 0x80042f } 324a4: 08 95 ret 000324a6 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 324a6: cf 93 push r28 324a8: df 93 push r29 if (menu_item == menu_line) 324aa: 30 91 31 04 lds r19, 0x0431 ; 0x800431 324ae: 20 91 30 04 lds r18, 0x0430 ; 0x800430 324b2: 32 13 cpse r19, r18 324b4: 20 c0 rjmp .+64 ; 0x324f6 324b6: eb 01 movw r28, r22 324b8: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 324ba: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 324be: 88 23 and r24, r24 324c0: 19 f0 breq .+6 ; 0x324c8 324c2: 80 e2 ldi r24, 0x20 ; 32 324c4: 0f 94 2c 92 call 0x32458 ; 0x32458 if (menu_clicked && (lcd_encoder == menu_item)) 324c8: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 324cc: 88 23 and r24, r24 324ce: 99 f0 breq .+38 ; 0x324f6 324d0: 20 91 31 04 lds r18, 0x0431 ; 0x800431 324d4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 324d8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 324dc: 28 17 cp r18, r24 324de: 19 06 cpc r1, r25 324e0: 51 f4 brne .+20 ; 0x324f6 { if (str_gcode) enquecommand_P(str_gcode); 324e2: 20 97 sbiw r28, 0x00 ; 0 324e4: 21 f0 breq .+8 ; 0x324ee 324e6: 61 e0 ldi r22, 0x01 ; 1 324e8: ce 01 movw r24, r28 324ea: 0e 94 3a 7d call 0xfa74 ; 0xfa74 menu_item_ret(); return; } } menu_item++; } 324ee: df 91 pop r29 324f0: 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(); 324f2: 0d 94 43 92 jmp 0x32486 ; 0x32486 return; } } menu_item++; 324f6: 80 91 31 04 lds r24, 0x0431 ; 0x800431 324fa: 8f 5f subi r24, 0xFF ; 255 324fc: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32500: df 91 pop r29 32502: cf 91 pop r28 32504: 08 95 ret 00032506 : //! @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) { 32506: ef 92 push r14 32508: ff 92 push r15 3250a: 0f 93 push r16 3250c: 1f 93 push r17 3250e: cf 93 push r28 32510: df 93 push r29 if (menu_item == menu_line) 32512: 70 91 31 04 lds r23, 0x0431 ; 0x800431 32516: 30 91 30 04 lds r19, 0x0430 ; 0x800430 3251a: 73 13 cpse r23, r19 3251c: 3f c0 rjmp .+126 ; 0x3259c 3251e: 12 2f mov r17, r18 32520: ea 01 movw r28, r20 32522: 06 2f mov r16, r22 32524: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 32526: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3252a: 88 23 and r24, r24 3252c: d1 f0 breq .+52 ; 0x32562 } 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()); 3252e: 0f 94 1f 92 call 0x3243e ; 0x3243e 32532: 48 2f mov r20, r24 32534: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32538: 80 e0 ldi r24, 0x00 ; 0 3253a: 0e 94 26 6a call 0xd44c ; 0xd44c uint8_t len = lcd_print_pad_P(str, max_strlen); 3253e: 61 e1 ldi r22, 0x11 ; 17 32540: c7 01 movw r24, r14 32542: 0e 94 db 6b call 0xd7b6 ; 0xd7b6 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 32546: 40 2f mov r20, r16 32548: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3254c: 93 e1 ldi r25, 0x13 ; 19 3254e: 98 1b sub r25, r24 32550: 89 2f mov r24, r25 32552: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 32556: 40 e2 ldi r20, 0x20 ; 32 32558: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3255c: 83 e1 ldi r24, 0x13 ; 19 3255e: 0e 94 26 6a call 0xd44c ; 0xd44c 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)) 32562: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32566: 88 23 and r24, r24 32568: c9 f0 breq .+50 ; 0x3259c 3256a: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3256e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32572: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32576: 28 17 cp r18, r24 32578: 19 06 cpc r1, r25 3257a: 81 f4 brne .+32 ; 0x3259c { lcd_update_enabled = 0; 3257c: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(fn_par); 32580: 81 2f mov r24, r17 32582: fe 01 movw r30, r28 32584: 19 95 eicall lcd_update_enabled = 1; 32586: 81 e0 ldi r24, 0x01 ; 1 32588: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 3258c: df 91 pop r29 3258e: cf 91 pop r28 32590: 1f 91 pop r17 32592: 0f 91 pop r16 32594: ff 90 pop r15 32596: 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(); 32598: 0d 94 43 92 jmp 0x32486 ; 0x32486 return; } } menu_item++; 3259c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 325a0: 8f 5f subi r24, 0xFF ; 255 325a2: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 325a6: df 91 pop r29 325a8: cf 91 pop r28 325aa: 1f 91 pop r17 325ac: 0f 91 pop r16 325ae: ff 90 pop r15 325b0: ef 90 pop r14 325b2: 08 95 ret 000325b4 : 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) { 325b4: cf 93 push r28 325b6: df 93 push r29 if (menu_item == menu_line) 325b8: 30 91 31 04 lds r19, 0x0431 ; 0x800431 325bc: 20 91 30 04 lds r18, 0x0430 ; 0x800430 325c0: 32 13 cpse r19, r18 325c2: 21 c0 rjmp .+66 ; 0x32606 325c4: eb 01 movw r28, r22 325c6: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 325c8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 325cc: 88 23 and r24, r24 325ce: 19 f0 breq .+6 ; 0x325d6 325d0: 80 e2 ldi r24, 0x20 ; 32 325d2: 0f 94 2c 92 call 0x32458 ; 0x32458 if (menu_clicked && (lcd_encoder == menu_item)) 325d6: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 325da: 88 23 and r24, r24 325dc: a1 f0 breq .+40 ; 0x32606 325de: 20 91 31 04 lds r18, 0x0431 ; 0x800431 325e2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 325e6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 325ea: 28 17 cp r18, r24 325ec: 19 06 cpc r1, r25 325ee: 59 f4 brne .+22 ; 0x32606 { lcd_update_enabled = 0; 325f0: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 325f4: fe 01 movw r30, r28 325f6: 19 95 eicall lcd_update_enabled = 1; 325f8: 81 e0 ldi r24, 0x01 ; 1 325fa: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 325fe: df 91 pop r29 32600: 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(); 32602: 0d 94 43 92 jmp 0x32486 ; 0x32486 return; } } menu_item++; 32606: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3260a: 8f 5f subi r24, 0xFF ; 255 3260c: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32610: df 91 pop r29 32612: cf 91 pop r28 32614: 08 95 ret 00032616 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 32616: 30 91 31 04 lds r19, 0x0431 ; 0x800431 3261a: 20 91 30 04 lds r18, 0x0430 ; 0x800430 3261e: 32 13 cpse r19, r18 32620: 19 c0 rjmp .+50 ; 0x32654 32622: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32624: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32628: 88 23 and r24, r24 3262a: 19 f0 breq .+6 ; 0x32632 3262c: 80 e2 ldi r24, 0x20 ; 32 3262e: 0f 94 2c 92 call 0x32458 ; 0x32458 if (menu_clicked && (lcd_encoder == menu_item)) 32632: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32636: 88 23 and r24, r24 32638: 69 f0 breq .+26 ; 0x32654 3263a: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3263e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32642: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32646: 28 17 cp r18, r24 32648: 19 06 cpc r1, r25 3264a: 21 f4 brne .+8 ; 0x32654 { menu_item_ret(); 3264c: 0f 94 43 92 call 0x32486 ; 0x32486 return 1; 32650: 81 e0 ldi r24, 0x01 ; 1 32652: 08 95 ret } } menu_item++; 32654: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32658: 8f 5f subi r24, 0xFF ; 255 3265a: 80 93 31 04 sts 0x0431, r24 ; 0x800431 return 0; 3265e: 80 e0 ldi r24, 0x00 ; 0 } 32660: 08 95 ret 00032662 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 32662: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32666: 84 30 cpi r24, 0x04 ; 4 32668: 38 f5 brcc .+78 ; 0x326b8 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 3266a: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3266e: 90 e0 ldi r25, 0x00 ; 0 32670: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32674: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32678: 28 17 cp r18, r24 3267a: 39 07 cpc r19, r25 3267c: 44 f0 brlt .+16 ; 0x3268e { lcd_encoder = menu_item - 1; 3267e: 01 97 sbiw r24, 0x01 ; 1 32680: 90 93 07 05 sts 0x0507, r25 ; 0x800507 32684: 80 93 06 05 sts 0x0506, r24 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 32688: 87 e0 ldi r24, 0x07 ; 7 3268a: 0f 94 71 2c call 0x258e2 ; 0x258e2 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3268e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32692: 20 91 60 03 lds r18, 0x0360 ; 0x800360 32696: 30 e0 ldi r19, 0x00 ; 0 32698: 2d 5f subi r18, 0xFD ; 253 3269a: 3f 4f sbci r19, 0xFF ; 255 3269c: 82 17 cp r24, r18 3269e: 13 06 cpc r1, r19 326a0: 59 f0 breq .+22 ; 0x326b8 326a2: 54 f0 brlt .+20 ; 0x326b8 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 326a4: 9d ef ldi r25, 0xFD ; 253 326a6: 98 0f add r25, r24 326a8: 90 93 60 03 sts 0x0360, r25 ; 0x800360 menu_line = menu_top - 1; 326ac: 84 50 subi r24, 0x04 ; 4 326ae: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_row = -1; 326b2: 8f ef ldi r24, 0xFF ; 255 326b4: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e } } 326b8: 08 95 ret 000326ba : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 326ba: 80 91 06 05 lds r24, 0x0506 ; 0x800506 326be: 90 91 07 05 lds r25, 0x0507 ; 0x800507 326c2: 97 ff sbrs r25, 7 326c4: 07 c0 rjmp .+14 ; 0x326d4 { lcd_encoder = 0; 326c6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 326ca: 10 92 06 05 sts 0x0506, r1 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 326ce: 87 e0 ldi r24, 0x07 ; 7 326d0: 0f 94 71 2c call 0x258e2 ; 0x258e2 } if (lcd_encoder < menu_top) 326d4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 326d8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 326dc: 20 91 60 03 lds r18, 0x0360 ; 0x800360 326e0: 28 17 cp r18, r24 326e2: 19 06 cpc r1, r25 326e4: 19 f0 breq .+6 ; 0x326ec 326e6: 14 f0 brlt .+4 ; 0x326ec menu_top = lcd_encoder; 326e8: 80 93 60 03 sts 0x0360, r24 ; 0x800360 menu_line = menu_top; 326ec: 80 91 60 03 lds r24, 0x0360 ; 0x800360 326f0: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_clicked = lcd_clicked(); // Consume click event 326f4: 0e 94 23 6c call 0xd846 ; 0xd846 326f8: 80 93 2f 04 sts 0x042F, r24 ; 0x80042f } 326fc: 08 95 ret 000326fe : 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)); 326fe: e4 e6 ldi r30, 0x64 ; 100 32700: f3 e0 ldi r31, 0x03 ; 3 32702: 80 e2 ldi r24, 0x20 ; 32 32704: df 01 movw r26, r30 32706: 1d 92 st X+, r1 32708: 8a 95 dec r24 3270a: e9 f7 brne .-6 ; 0x32706 } 3270c: 08 95 ret 0003270e : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3270e: cf 93 push r28 CRITICAL_SECTION_START; 32710: 3f b7 in r19, 0x3f ; 63 32712: f8 94 cli if (menu_menu != menu) 32714: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 32718: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 3271c: e8 17 cp r30, r24 3271e: f9 07 cpc r31, r25 32720: c9 f0 breq .+50 ; 0x32754 32722: c4 2f mov r28, r20 { menu_menu = menu; 32724: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 32728: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 lcd_encoder = encoder; 3272c: 70 93 07 05 sts 0x0507, r23 ; 0x800507 32730: 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 32734: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_draw_update = 2; // Full LCD re-draw 32738: 82 e0 ldi r24, 0x02 ; 2 3273a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b CRITICAL_SECTION_END; 3273e: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 32740: 22 23 and r18, r18 32742: 19 f0 breq .+6 ; 0x3274a } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 32744: 80 e0 ldi r24, 0x00 ; 0 32746: 0f 94 71 2c call 0x258e2 ; 0x258e2 if (reset_menu_state) menu_data_reset(); 3274a: cc 23 and r28, r28 3274c: 21 f0 breq .+8 ; 0x32756 } else CRITICAL_SECTION_END; } 3274e: 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(); 32750: 0d 94 7f 93 jmp 0x326fe ; 0x326fe } else CRITICAL_SECTION_END; 32754: 3f bf out 0x3f, r19 ; 63 } 32756: cf 91 pop r28 32758: 08 95 ret 0003275a : 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) { 3275a: 7f 92 push r7 3275c: 8f 92 push r8 3275e: 9f 92 push r9 32760: af 92 push r10 32762: bf 92 push r11 32764: cf 92 push r12 32766: df 92 push r13 32768: ef 92 push r14 3276a: ff 92 push r15 3276c: 0f 93 push r16 3276e: 1f 93 push r17 32770: cf 93 push r28 32772: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 32774: e0 91 31 04 lds r30, 0x0431 ; 0x800431 32778: 50 91 30 04 lds r21, 0x0430 ; 0x800430 3277c: e5 13 cpse r30, r21 3277e: 73 c0 rjmp .+230 ; 0x32866 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 32780: fb 01 movw r30, r22 32782: 48 30 cpi r20, 0x08 ; 8 32784: 09 f0 breq .+2 ; 0x32788 32786: 6c c0 rjmp .+216 ; 0x32860 32788: c0 81 ld r28, Z 3278a: d0 e0 ldi r29, 0x00 ; 0 3278c: 49 01 movw r8, r18 3278e: 74 2e mov r7, r20 32790: 6b 01 movw r12, r22 32792: 5c 01 movw r10, r24 if (lcd_draw_update) 32794: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32798: 88 23 and r24, r24 3279a: 59 f0 breq .+22 ; 0x327b2 { lcd_set_cursor(0, menu_row); 3279c: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 327a0: 80 e0 ldi r24, 0x00 ; 0 327a2: 0e 94 06 6a call 0xd40c ; 0xd40c menu_draw_P(menu_selection_mark(), str, cur_val); 327a6: 0f 94 1f 92 call 0x3243e ; 0x3243e 327aa: ae 01 movw r20, r28 327ac: b5 01 movw r22, r10 327ae: 0f 94 bb 6e call 0x2dd76 ; 0x2dd76 } if (menu_clicked && (lcd_encoder == menu_item)) 327b2: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 327b6: 88 23 and r24, r24 327b8: 09 f4 brne .+2 ; 0x327bc 327ba: 55 c0 rjmp .+170 ; 0x32866 327bc: 90 91 31 04 lds r25, 0x0431 ; 0x800431 327c0: 20 91 06 05 lds r18, 0x0506 ; 0x800506 327c4: 30 91 07 05 lds r19, 0x0507 ; 0x800507 327c8: 92 17 cp r25, r18 327ca: 13 06 cpc r1, r19 327cc: 09 f0 breq .+2 ; 0x327d0 327ce: 4b c0 rjmp .+150 ; 0x32866 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 327d0: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 327d4: 87 30 cpi r24, 0x07 ; 7 327d6: d8 f4 brcc .+54 ; 0x3280e { menu_stack[menu_depth].menu = menu_menu; 327d8: 28 2f mov r18, r24 327da: 30 e0 ldi r19, 0x00 ; 0 327dc: f9 01 movw r30, r18 327de: ee 0f add r30, r30 327e0: ff 1f adc r31, r31 327e2: e2 0f add r30, r18 327e4: f3 1f adc r31, r19 327e6: ef 56 subi r30, 0x6F ; 111 327e8: f9 4e sbci r31, 0xE9 ; 233 327ea: 20 91 d0 03 lds r18, 0x03D0 ; 0x8003d0 327ee: 30 91 d1 03 lds r19, 0x03D1 ; 0x8003d1 327f2: 31 83 std Z+1, r19 ; 0x01 327f4: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 327f6: 8f 5f subi r24, 0xFF ; 255 327f8: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 327fc: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 327fe: 20 e0 ldi r18, 0x00 ; 0 32800: 40 e0 ldi r20, 0x00 ; 0 32802: 70 e0 ldi r23, 0x00 ; 0 32804: 60 e0 ldi r22, 0x00 ; 0 32806: 8f e7 ldi r24, 0x7F ; 127 32808: 98 e3 ldi r25, 0x38 ; 56 3280a: 0f 94 87 93 call 0x3270e ; 0x3270e 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; 3280e: b0 92 65 03 sts 0x0365, r11 ; 0x800365 32812: a0 92 64 03 sts 0x0364, r10 ; 0x800364 _md->editValuePtr = pval; 32816: d0 92 68 03 sts 0x0368, r13 ; 0x800368 3281a: c0 92 67 03 sts 0x0367, r12 ; 0x800367 _md->editValueBits = pbits; 3281e: 70 92 66 03 sts 0x0366, r7 ; 0x800366 _md->currentValue = cur_val; 32822: d0 93 6a 03 sts 0x036A, r29 ; 0x80036a 32826: c0 93 69 03 sts 0x0369, r28 ; 0x800369 _md->minEditValue = min_val; 3282a: 90 92 6c 03 sts 0x036C, r9 ; 0x80036c 3282e: 80 92 6b 03 sts 0x036B, r8 ; 0x80036b _md->maxEditValue = max_val; 32832: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e 32836: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d _md->minJumpValue = jmp_val; 3283a: f0 92 70 03 sts 0x0370, r15 ; 0x800370 3283e: e0 92 6f 03 sts 0x036F, r14 ; 0x80036f menu_item_ret(); return; } } menu_item++; } 32842: df 91 pop r29 32844: cf 91 pop r28 32846: 1f 91 pop r17 32848: 0f 91 pop r16 3284a: ff 90 pop r15 3284c: ef 90 pop r14 3284e: df 90 pop r13 32850: cf 90 pop r12 32852: bf 90 pop r11 32854: af 90 pop r10 32856: 9f 90 pop r9 32858: 8f 90 pop r8 3285a: 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(); 3285c: 0d 94 43 92 jmp 0x32486 ; 0x32486 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)); 32860: c0 81 ld r28, Z 32862: d1 81 ldd r29, Z+1 ; 0x01 32864: 93 cf rjmp .-218 ; 0x3278c _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 32866: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3286a: 8f 5f subi r24, 0xFF ; 255 3286c: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32870: df 91 pop r29 32872: cf 91 pop r28 32874: 1f 91 pop r17 32876: 0f 91 pop r16 32878: ff 90 pop r15 3287a: ef 90 pop r14 3287c: df 90 pop r13 3287e: cf 90 pop r12 32880: bf 90 pop r11 32882: af 90 pop r10 32884: 9f 90 pop r9 32886: 8f 90 pop r8 32888: 7f 90 pop r7 3288a: 08 95 ret 0003288c <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3288c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32890: 88 23 and r24, r24 32892: 09 f4 brne .+2 ; 0x32896 <_menu_edit_P()+0xa> 32894: 52 c0 rjmp .+164 ; 0x3293a <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 32896: 20 91 6f 03 lds r18, 0x036F ; 0x80036f 3289a: 30 91 70 03 lds r19, 0x0370 ; 0x800370 3289e: 80 91 6b 03 lds r24, 0x036B ; 0x80036b 328a2: 90 91 6c 03 lds r25, 0x036C ; 0x80036c 328a6: 21 15 cp r18, r1 328a8: 31 05 cpc r19, r1 328aa: d9 f0 breq .+54 ; 0x328e2 <_menu_edit_P()+0x56> 328ac: 40 91 06 05 lds r20, 0x0506 ; 0x800506 328b0: 50 91 07 05 lds r21, 0x0507 ; 0x800507 328b4: 41 15 cp r20, r1 328b6: 51 05 cpc r21, r1 328b8: a1 f0 breq .+40 ; 0x328e2 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 328ba: 7c f0 brlt .+30 ; 0x328da <_menu_edit_P()+0x4e> 328bc: 40 91 69 03 lds r20, 0x0369 ; 0x800369 328c0: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 328c4: 48 17 cp r20, r24 328c6: 59 07 cpc r21, r25 328c8: 41 f4 brne .+16 ; 0x328da <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 328ca: 30 93 6a 03 sts 0x036A, r19 ; 0x80036a 328ce: 20 93 69 03 sts 0x0369, r18 ; 0x800369 lcd_encoder = 0; 328d2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 328d6: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 328da: 10 92 70 03 sts 0x0370, r1 ; 0x800370 328de: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f } _md->currentValue += lcd_encoder; 328e2: 20 91 69 03 lds r18, 0x0369 ; 0x800369 328e6: 30 91 6a 03 lds r19, 0x036A ; 0x80036a 328ea: 40 91 06 05 lds r20, 0x0506 ; 0x800506 328ee: 50 91 07 05 lds r21, 0x0507 ; 0x800507 328f2: 24 0f add r18, r20 328f4: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 328f6: 10 92 07 05 sts 0x0507, r1 ; 0x800507 328fa: 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); 328fe: 28 17 cp r18, r24 32900: 39 07 cpc r19, r25 32902: 44 f0 brlt .+16 ; 0x32914 <_menu_edit_P()+0x88> 32904: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 32908: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 3290c: 28 17 cp r18, r24 3290e: 39 07 cpc r19, r25 32910: 0c f4 brge .+2 ; 0x32914 <_menu_edit_P()+0x88> 32912: c9 01 movw r24, r18 32914: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 32918: 80 93 69 03 sts 0x0369, r24 ; 0x800369 lcd_set_cursor(0, 1); 3291c: 61 e0 ldi r22, 0x01 ; 1 3291e: 80 e0 ldi r24, 0x00 ; 0 32920: 0e 94 06 6a call 0xd40c ; 0xd40c menu_draw_P(' ', _md->editLabel, _md->currentValue); 32924: 40 91 69 03 lds r20, 0x0369 ; 0x800369 32928: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 3292c: 60 91 64 03 lds r22, 0x0364 ; 0x800364 32930: 70 91 65 03 lds r23, 0x0365 ; 0x800365 32934: 80 e2 ldi r24, 0x20 ; 32 32936: 0f 94 bb 6e call 0x2dd76 ; 0x2dd76 } if (lcd_clicked()) 3293a: 0e 94 23 6c call 0xd846 ; 0xd846 3293e: 88 23 and r24, r24 32940: 41 f1 breq .+80 ; 0x32992 <_menu_edit_P()+0x106> 32942: e0 91 67 03 lds r30, 0x0367 ; 0x800367 32946: f0 91 68 03 lds r31, 0x0368 ; 0x800368 3294a: 80 91 69 03 lds r24, 0x0369 ; 0x800369 3294e: 90 91 6a 03 lds r25, 0x036A ; 0x80036a { if (_md->editValueBits == 8) 32952: 20 91 66 03 lds r18, 0x0366 ; 0x800366 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 32956: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 32958: 28 30 cpi r18, 0x08 ; 8 3295a: c9 f4 brne .+50 ; 0x3298e <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3295c: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32960: 88 23 and r24, r24 32962: b9 f0 breq .+46 ; 0x32992 <_menu_edit_P()+0x106> { menu_depth--; 32964: 81 50 subi r24, 0x01 ; 1 32966: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3296a: 90 e0 ldi r25, 0x00 ; 0 3296c: fc 01 movw r30, r24 3296e: ee 0f add r30, r30 32970: ff 1f adc r31, r31 32972: e8 0f add r30, r24 32974: f9 1f adc r31, r25 32976: ef 56 subi r30, 0x6F ; 111 32978: f9 4e sbci r31, 0xE9 ; 233 3297a: 62 81 ldd r22, Z+2 ; 0x02 3297c: 06 2e mov r0, r22 3297e: 00 0c add r0, r0 32980: 77 0b sbc r23, r23 32982: 20 e0 ldi r18, 0x00 ; 0 32984: 40 e0 ldi r20, 0x00 ; 0 32986: 80 81 ld r24, Z 32988: 91 81 ldd r25, Z+1 ; 0x01 3298a: 0d 94 87 93 jmp 0x3270e ; 0x3270e if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3298e: 91 83 std Z+1, r25 ; 0x01 32990: e5 cf rjmp .-54 ; 0x3295c <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 32992: 08 95 ret 00032994 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 32994: dc 01 movw r26, r24 32996: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 32998: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 3299c: 97 30 cpi r25, 0x07 ; 7 3299e: d8 f4 brcc .+54 ; 0x329d6 { menu_stack[menu_depth].menu = menu_menu; 329a0: 49 2f mov r20, r25 329a2: 50 e0 ldi r21, 0x00 ; 0 329a4: fa 01 movw r30, r20 329a6: ee 0f add r30, r30 329a8: ff 1f adc r31, r31 329aa: e4 0f add r30, r20 329ac: f5 1f adc r31, r21 329ae: ef 56 subi r30, 0x6F ; 111 329b0: f9 4e sbci r31, 0xE9 ; 233 329b2: 40 91 d0 03 lds r20, 0x03D0 ; 0x8003d0 329b6: 50 91 d1 03 lds r21, 0x03D1 ; 0x8003d1 329ba: 51 83 std Z+1, r21 ; 0x01 329bc: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 329be: 80 91 06 05 lds r24, 0x0506 ; 0x800506 329c2: 9f 5f subi r25, 0xFF ; 255 329c4: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 329c8: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 329ca: 41 e0 ldi r20, 0x01 ; 1 329cc: 70 e0 ldi r23, 0x00 ; 0 329ce: 60 e0 ldi r22, 0x00 ; 0 329d0: cd 01 movw r24, r26 329d2: 0d 94 87 93 jmp 0x3270e ; 0x3270e } } 329d6: 08 95 ret 000329d8 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 329d8: 8f 92 push r8 329da: 9f 92 push r9 329dc: af 92 push r10 329de: bf 92 push r11 329e0: cf 92 push r12 329e2: df 92 push r13 329e4: ef 92 push r14 329e6: ff 92 push r15 329e8: 0f 93 push r16 329ea: 1f 93 push r17 329ec: cf 93 push r28 329ee: df 93 push r29 if (menu_item == menu_line) 329f0: e0 91 31 04 lds r30, 0x0431 ; 0x800431 329f4: 30 91 30 04 lds r19, 0x0430 ; 0x800430 329f8: e3 13 cpse r30, r19 329fa: 73 c0 rjmp .+230 ; 0x32ae2 329fc: c2 2f mov r28, r18 329fe: 6a 01 movw r12, r20 32a00: 7b 01 movw r14, r22 32a02: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 32a04: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32a08: 88 23 and r24, r24 32a0a: a1 f1 breq .+104 ; 0x32a74 32a0c: 0f 94 1f 92 call 0x3243e ; 0x3243e 32a10: 01 e0 ldi r16, 0x01 ; 1 32a12: 8e 33 cpi r24, 0x3E ; 62 32a14: 09 f0 breq .+2 ; 0x32a18 32a16: 00 e0 ldi r16, 0x00 ; 0 32a18: 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; 32a1a: 80 2f mov r24, r16 32a1c: 82 70 andi r24, 0x02 ; 2 32a1e: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 32a20: e1 14 cp r14, r1 32a22: f1 04 cpc r15, r1 32a24: 09 f4 brne .+2 ; 0x32a28 32a26: 6f c0 rjmp .+222 ; 0x32b06 32a28: e7 01 movw r28, r14 32a2a: 90 e2 ldi r25, 0x20 ; 32 32a2c: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 32a2e: 88 20 and r8, r8 32a30: 09 f4 brne .+2 ; 0x32a34 32a32: 41 c0 rjmp .+130 ; 0x32ab6 32a34: ce 01 movw r24, r28 32a36: 0f 94 3b 9e call 0x33c76 ; 0x33c76 <__strlen_P> 32a3a: 14 e0 ldi r17, 0x04 ; 4 32a3c: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 32a3e: 4e e3 ldi r20, 0x3E ; 62 32a40: 00 ff sbrs r16, 0 32a42: 40 e2 ldi r20, 0x20 ; 32 32a44: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32a48: 80 e0 ldi r24, 0x00 ; 0 32a4a: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_print_pad_P(str, LCD_WIDTH - len); 32a4e: 64 e1 ldi r22, 0x14 ; 20 32a50: 61 1b sub r22, r17 32a52: c5 01 movw r24, r10 32a54: 0e 94 db 6b call 0xd7b6 ; 0xd7b6 lcd_putc('['); 32a58: 8b e5 ldi r24, 0x5B ; 91 32a5a: 0e 94 f5 69 call 0xd3ea ; 0xd3ea if (is_progmem) { lcd_puts_P(toggle); 32a5e: 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) 32a60: 88 20 and r8, r8 32a62: 89 f1 breq .+98 ; 0x32ac6 { lcd_puts_P(toggle); 32a64: 0e 94 f1 69 call 0xd3e2 ; 0xd3e2 } else { lcd_print(toggle); } lcd_putc(']'); 32a68: 8d e5 ldi r24, 0x5D ; 93 32a6a: 0e 94 f5 69 call 0xd3ea ; 0xd3ea lcd_putc(eol); 32a6e: 89 2d mov r24, r9 32a70: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 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)) 32a74: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32a78: 88 23 and r24, r24 32a7a: 99 f1 breq .+102 ; 0x32ae2 32a7c: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32a80: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32a84: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32a88: 28 17 cp r18, r24 32a8a: 19 06 cpc r1, r25 32a8c: 51 f5 brne .+84 ; 0x32ae2 { if (toggle == NULL) // print N/A warning message 32a8e: ef 28 or r14, r15 32a90: e9 f4 brne .+58 ; 0x32acc { menu_submenu(func); 32a92: 60 e0 ldi r22, 0x00 ; 0 32a94: c6 01 movw r24, r12 32a96: 0f 94 ca 94 call 0x32994 ; 0x32994 menu_item_ret(); return; } } menu_item++; } 32a9a: df 91 pop r29 32a9c: cf 91 pop r28 32a9e: 1f 91 pop r17 32aa0: 0f 91 pop r16 32aa2: ff 90 pop r15 32aa4: ef 90 pop r14 32aa6: df 90 pop r13 32aa8: cf 90 pop r12 32aaa: bf 90 pop r11 32aac: af 90 pop r10 32aae: 9f 90 pop r9 32ab0: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 32ab2: 0d 94 43 92 jmp 0x32486 ; 0x32486 //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)); 32ab6: fe 01 movw r30, r28 32ab8: 01 90 ld r0, Z+ 32aba: 00 20 and r0, r0 32abc: e9 f7 brne .-6 ; 0x32ab8 32abe: ec 1b sub r30, r28 32ac0: 13 e0 ldi r17, 0x03 ; 3 32ac2: 1e 0f add r17, r30 32ac4: bc cf rjmp .-136 ; 0x32a3e lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 32ac6: 0e 94 0d 6c call 0xd81a ; 0xd81a 32aca: ce cf rjmp .-100 ; 0x32a68 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 32acc: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 32ad0: c1 14 cp r12, r1 32ad2: d1 04 cpc r13, r1 32ad4: 11 f0 breq .+4 ; 0x32ada 32ad6: f6 01 movw r30, r12 32ad8: 19 95 eicall lcd_update_enabled = 1; 32ada: 81 e0 ldi r24, 0x01 ; 1 32adc: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 32ae0: dc cf rjmp .-72 ; 0x32a9a } menu_item_ret(); return; } } menu_item++; 32ae2: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32ae6: 8f 5f subi r24, 0xFF ; 255 32ae8: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32aec: df 91 pop r29 32aee: cf 91 pop r28 32af0: 1f 91 pop r17 32af2: 0f 91 pop r16 32af4: ff 90 pop r15 32af6: ef 90 pop r14 32af8: df 90 pop r13 32afa: cf 90 pop r12 32afc: bf 90 pop r11 32afe: af 90 pop r10 32b00: 9f 90 pop r9 32b02: 8f 90 pop r8 32b04: 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); 32b06: 8d ed ldi r24, 0xDD ; 221 32b08: 9d e3 ldi r25, 0x3D ; 61 32b0a: 0e 94 3c 6d call 0xda78 ; 0xda78 32b0e: 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] : ' '; 32b10: 8e e7 ldi r24, 0x7E ; 126 32b12: 98 2e mov r9, r24 32b14: 8c cf rjmp .-232 ; 0x32a2e 00032b16 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 32b16: 0f 93 push r16 32b18: 1f 93 push r17 32b1a: cf 93 push r28 32b1c: df 93 push r29 32b1e: cd b7 in r28, 0x3d ; 61 32b20: de b7 in r29, 0x3e ; 62 32b22: 63 97 sbiw r28, 0x13 ; 19 32b24: 0f b6 in r0, 0x3f ; 63 32b26: f8 94 cli 32b28: de bf out 0x3e, r29 ; 62 32b2a: 0f be out 0x3f, r0 ; 63 32b2c: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 32b2e: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32b32: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32b36: 32 13 cpse r19, r18 32b38: 38 c0 rjmp .+112 ; 0x32baa 32b3a: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 32b3c: 20 91 5b 02 lds r18, 0x025B ; 0x80025b 32b40: 22 23 and r18, r18 32b42: a9 f0 breq .+42 ; 0x32b6e static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 32b44: be 01 movw r22, r28 32b46: 6f 5f subi r22, 0xFF ; 255 32b48: 7f 4f sbci r23, 0xFF ; 255 32b4a: 0f 94 f7 91 call 0x323ee ; 0x323ee lcd_putc_at(0, menu_row, menu_selection_mark()); 32b4e: 0f 94 1f 92 call 0x3243e ; 0x3243e 32b52: 48 2f mov r20, r24 32b54: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32b58: 80 e0 ldi r24, 0x00 ; 0 32b5a: 0e 94 26 6a call 0xd44c ; 0xd44c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 32b5e: 62 e1 ldi r22, 0x12 ; 18 32b60: ce 01 movw r24, r28 32b62: 01 96 adiw r24, 0x01 ; 1 32b64: 0e 94 f5 6b call 0xd7ea ; 0xd7ea lcd_putc(type_char); 32b68: 8e e7 ldi r24, 0x7E ; 126 32b6a: 0e 94 f5 69 call 0xd3ea ; 0xd3ea 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)) 32b6e: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32b72: 88 23 and r24, r24 32b74: d1 f0 breq .+52 ; 0x32baa 32b76: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32b7a: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32b7e: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32b82: 28 17 cp r18, r24 32b84: 19 06 cpc r1, r25 32b86: 89 f4 brne .+34 ; 0x32baa 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); 32b88: 60 e0 ldi r22, 0x00 ; 0 32b8a: c8 01 movw r24, r16 32b8c: 0f 94 ca 94 call 0x32994 ; 0x32994 menu_item_ret(); 32b90: 0f 94 43 92 call 0x32486 ; 0x32486 menu_item_ret(); return; } } menu_item++; } 32b94: 63 96 adiw r28, 0x13 ; 19 32b96: 0f b6 in r0, 0x3f ; 63 32b98: f8 94 cli 32b9a: de bf out 0x3e, r29 ; 62 32b9c: 0f be out 0x3f, r0 ; 63 32b9e: cd bf out 0x3d, r28 ; 61 32ba0: df 91 pop r29 32ba2: cf 91 pop r28 32ba4: 1f 91 pop r17 32ba6: 0f 91 pop r16 32ba8: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 32baa: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32bae: 8f 5f subi r24, 0xFF ; 255 32bb0: 80 93 31 04 sts 0x0431, r24 ; 0x800431 32bb4: ef cf rjmp .-34 ; 0x32b94 00032bb6 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 32bb6: cf 93 push r28 32bb8: df 93 push r29 if (menu_item == menu_line) 32bba: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32bbe: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32bc2: 32 13 cpse r19, r18 32bc4: 1e c0 rjmp .+60 ; 0x32c02 32bc6: eb 01 movw r28, r22 32bc8: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 32bca: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32bce: 88 23 and r24, r24 32bd0: 19 f0 breq .+6 ; 0x32bd8 32bd2: 8e e7 ldi r24, 0x7E ; 126 32bd4: 0f 94 2c 92 call 0x32458 ; 0x32458 if (menu_clicked && (lcd_encoder == menu_item)) 32bd8: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32bdc: 88 23 and r24, r24 32bde: 89 f0 breq .+34 ; 0x32c02 32be0: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32be4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32be8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32bec: 28 17 cp r18, r24 32bee: 19 06 cpc r1, r25 32bf0: 41 f4 brne .+16 ; 0x32c02 { menu_submenu(submenu); 32bf2: 60 e0 ldi r22, 0x00 ; 0 32bf4: ce 01 movw r24, r28 32bf6: 0f 94 ca 94 call 0x32994 ; 0x32994 menu_item_ret(); return; } } menu_item++; } 32bfa: df 91 pop r29 32bfc: 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(); 32bfe: 0d 94 43 92 jmp 0x32486 ; 0x32486 return; } } menu_item++; 32c02: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32c06: 8f 5f subi r24, 0xFF ; 255 32c08: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32c0c: df 91 pop r29 32c0e: cf 91 pop r28 32c10: 08 95 ret 00032c12 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 32c12: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32c14: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32c18: 98 17 cp r25, r24 32c1a: a8 f4 brcc .+42 ; 0x32c46 32c1c: 89 1b sub r24, r25 32c1e: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 32c22: 90 e0 ldi r25, 0x00 ; 0 32c24: fc 01 movw r30, r24 32c26: ee 0f add r30, r30 32c28: ff 1f adc r31, r31 32c2a: e8 0f add r30, r24 32c2c: f9 1f adc r31, r25 32c2e: ef 56 subi r30, 0x6F ; 111 32c30: f9 4e sbci r31, 0xE9 ; 233 32c32: 62 81 ldd r22, Z+2 ; 0x02 32c34: 06 2e mov r0, r22 32c36: 00 0c add r0, r0 32c38: 77 0b sbc r23, r23 32c3a: 20 e0 ldi r18, 0x00 ; 0 32c3c: 41 e0 ldi r20, 0x01 ; 1 32c3e: 80 81 ld r24, Z 32c40: 91 81 ldd r25, Z+1 ; 0x01 32c42: 0d 94 87 93 jmp 0x3270e ; 0x3270e } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32c46: 80 e0 ldi r24, 0x00 ; 0 32c48: ea cf rjmp .-44 ; 0x32c1e 00032c4a : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 32c4a: 81 e0 ldi r24, 0x01 ; 1 32c4c: 0d 94 09 96 jmp 0x32c12 ; 0x32c12 00032c50 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 32c50: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32c54: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32c58: 32 13 cpse r19, r18 32c5a: 19 c0 rjmp .+50 ; 0x32c8e 32c5c: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 32c5e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32c62: 88 23 and r24, r24 32c64: 19 f0 breq .+6 ; 0x32c6c 32c66: 83 e8 ldi r24, 0x83 ; 131 32c68: 0f 94 2c 92 call 0x32458 ; 0x32458 if (menu_clicked && (lcd_encoder == menu_item)) 32c6c: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32c70: 88 23 and r24, r24 32c72: 69 f0 breq .+26 ; 0x32c8e 32c74: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32c78: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32c7c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32c80: 28 17 cp r18, r24 32c82: 19 06 cpc r1, r25 32c84: 21 f4 brne .+8 ; 0x32c8e { menu_back(); 32c86: 0f 94 25 96 call 0x32c4a ; 0x32c4a menu_item_ret(); 32c8a: 0d 94 43 92 jmp 0x32486 ; 0x32486 return; } } menu_item++; 32c8e: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32c92: 8f 5f subi r24, 0xFF ; 255 32c94: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32c98: 08 95 ret 00032c9a : }; 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() { 32c9a: ef 92 push r14 32c9c: ff 92 push r15 32c9e: 0f 93 push r16 32ca0: 1f 93 push r17 32ca2: cf 93 push r28 32ca4: df 93 push r29 32ca6: 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) 32caa: 80 91 71 03 lds r24, 0x0371 ; 0x800371 32cae: 81 11 cpse r24, r1 32cb0: 23 c0 rjmp .+70 ; 0x32cf8 { _md->status = 1; // Menu entered for the first time 32cb2: 81 e0 ldi r24, 0x01 ; 1 32cb4: 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; 32cb8: 81 e0 ldi r24, 0x01 ; 1 32cba: 90 e0 ldi r25, 0x00 ; 0 32cbc: 20 91 65 12 lds r18, 0x1265 ; 0x801265 32cc0: 30 91 66 12 lds r19, 0x1266 ; 0x801266 32cc4: 27 30 cpi r18, 0x07 ; 7 32cc6: 31 48 sbci r19, 0x81 ; 129 32cc8: 11 f0 breq .+4 ; 0x32cce 32cca: 90 e0 ldi r25, 0x00 ; 0 32ccc: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 32cce: bc 01 movw r22, r24 32cd0: 66 0f add r22, r22 32cd2: 77 1f adc r23, r23 32cd4: 68 0f add r22, r24 32cd6: 79 1f adc r23, r25 32cd8: 6c 53 subi r22, 0x3C ; 60 32cda: 71 46 sbci r23, 0x61 ; 97 32cdc: 43 e0 ldi r20, 0x03 ; 3 32cde: 50 e0 ldi r21, 0x00 ; 0 32ce0: 83 e7 ldi r24, 0x73 ; 115 32ce2: 93 e0 ldi r25, 0x03 ; 3 32ce4: 0f 94 17 9e call 0x33c2e ; 0x33c2e // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 32ce8: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32cec: 0e 94 4f f7 call 0x1ee9e ; 0x1ee9e _md->currentValue = mmu2.GetLastReadRegisterValue(); 32cf0: 80 91 90 12 lds r24, 0x1290 ; 0x801290 32cf4: 80 93 72 03 sts 0x0372, r24 ; 0x800372 } MENU_BEGIN(); 32cf8: 0f 94 5d 93 call 0x326ba ; 0x326ba 32cfc: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 32d00: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32d04: 84 30 cpi r24, 0x04 ; 4 32d06: e0 f5 brcc .+120 ; 0x32d80 32d08: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 32d0c: 0f 94 dd 91 call 0x323ba ; 0x323ba 32d10: 88 23 and r24, r24 32d12: 89 f0 breq .+34 ; 0x32d36 32d14: 60 91 72 03 lds r22, 0x0372 ; 0x800372 32d18: 70 e0 ldi r23, 0x00 ; 0 32d1a: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32d1e: 0e 94 9a bf call 0x17f34 ; 0x17f34 32d22: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.456> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32d26: df 91 pop r29 32d28: cf 91 pop r28 32d2a: 1f 91 pop r17 32d2c: 0f 91 pop r16 32d2e: ff 90 pop r15 32d30: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 32d32: 0c 94 e9 fd jmp 0x1fbd2 ; 0x1fbd2 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 32d36: 8a e4 ldi r24, 0x4A ; 74 32d38: 93 e6 ldi r25, 0x63 ; 99 32d3a: 0e 94 3c 6d call 0xda78 ; 0xda78 32d3e: 0f 94 28 96 call 0x32c50 ; 0x32c50 MENU_ITEM_EDIT_int3_P( 32d42: 00 91 75 03 lds r16, 0x0375 ; 0x800375 32d46: 10 e0 ldi r17, 0x00 ; 0 32d48: c0 91 74 03 lds r28, 0x0374 ; 0x800374 32d4c: d0 e0 ldi r29, 0x00 ; 0 32d4e: 8c e3 ldi r24, 0x3C ; 60 32d50: 93 e6 ldi r25, 0x63 ; 99 32d52: 0e 94 3c 6d call 0xda78 ; 0xda78 32d56: f1 2c mov r15, r1 32d58: e1 2c mov r14, r1 32d5a: 9e 01 movw r18, r28 32d5c: 48 e0 ldi r20, 0x08 ; 8 32d5e: 62 e7 ldi r22, 0x72 ; 114 32d60: 73 e0 ldi r23, 0x03 ; 3 32d62: 0f 94 ad 93 call 0x3275a ; 0x3275a _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 32d66: 0f 94 31 93 call 0x32662 ; 0x32662 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 32d6a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32d6e: 8f 5f subi r24, 0xFF ; 255 32d70: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 32d74: 80 91 30 04 lds r24, 0x0430 ; 0x800430 32d78: 8f 5f subi r24, 0xFF ; 255 32d7a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 32d7e: c0 cf rjmp .-128 ; 0x32d00 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32d80: df 91 pop r29 32d82: cf 91 pop r28 32d84: 1f 91 pop r17 32d86: 0f 91 pop r16 32d88: ff 90 pop r15 32d8a: ef 90 pop r14 32d8c: 08 95 ret 00032d8e : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 32d8e: 0e 94 23 6c call 0xd846 ; 0xd846 32d92: 81 11 cpse r24, r1 menu_back(); 32d94: 0d 94 25 96 jmp 0x32c4a ; 0x32c4a } 32d98: 08 95 ret 00032d9a : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 32d9a: 8f 92 push r8 32d9c: 9f 92 push r9 32d9e: af 92 push r10 32da0: bf 92 push r11 32da2: ef 92 push r14 32da4: ff 92 push r15 32da6: 0f 93 push r16 32da8: 1f 93 push r17 32daa: cf 93 push r28 32dac: df 93 push r29 32dae: cd b7 in r28, 0x3d ; 61 32db0: de b7 in r29, 0x3e ; 62 32db2: a0 97 sbiw r28, 0x20 ; 32 32db4: 0f b6 in r0, 0x3f ; 63 32db6: f8 94 cli 32db8: de bf out 0x3e, r29 ; 62 32dba: 0f be out 0x3f, r0 ; 63 32dbc: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 32dbe: 61 15 cp r22, r1 32dc0: 71 05 cpc r23, r1 32dc2: 81 05 cpc r24, r1 32dc4: 91 05 cpc r25, r1 32dc6: 99 f4 brne .+38 ; 0x32dee } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32dc8: 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)); } 32dca: a0 96 adiw r28, 0x20 ; 32 32dcc: 0f b6 in r0, 0x3f ; 63 32dce: f8 94 cli 32dd0: de bf out 0x3e, r29 ; 62 32dd2: 0f be out 0x3f, r0 ; 63 32dd4: cd bf out 0x3d, r28 ; 61 32dd6: df 91 pop r29 32dd8: cf 91 pop r28 32dda: 1f 91 pop r17 32ddc: 0f 91 pop r16 32dde: ff 90 pop r15 32de0: ef 90 pop r14 32de2: bf 90 pop r11 32de4: af 90 pop r10 32de6: 9f 90 pop r9 32de8: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32dea: 0c 94 cc 70 jmp 0xe198 ; 0xe198 // 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; 32dee: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32df0: 84 2e mov r8, r20 32df2: 91 2c mov r9, r1 32df4: b1 2c mov r11, r1 32df6: a1 2c mov r10, r1 32df8: 9e 01 movw r18, r28 32dfa: 2f 5f subi r18, 0xFF ; 255 32dfc: 3f 4f sbci r19, 0xFF ; 255 32dfe: 79 01 movw r14, r18 32e00: a5 01 movw r20, r10 32e02: 94 01 movw r18, r8 32e04: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 32e08: f7 01 movw r30, r14 32e0a: e0 0f add r30, r16 32e0c: f1 1d adc r31, r1 32e0e: 60 83 st Z, r22 n /= base; 32e10: b9 01 movw r22, r18 32e12: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32e14: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 32e16: 61 15 cp r22, r1 32e18: 71 05 cpc r23, r1 32e1a: 81 05 cpc r24, r1 32e1c: 91 05 cpc r25, r1 32e1e: 81 f7 brne .-32 ; 0x32e00 32e20: 0e 0d add r16, r14 32e22: 1f 2d mov r17, r15 32e24: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 32e26: e0 16 cp r14, r16 32e28: f1 06 cpc r15, r17 32e2a: 59 f0 breq .+22 ; 0x32e42 print((char) (buf[i - 1] < 10 ? 32e2c: f8 01 movw r30, r16 32e2e: 82 91 ld r24, -Z 32e30: 8f 01 movw r16, r30 32e32: 8a 30 cpi r24, 0x0A ; 10 32e34: 20 f4 brcc .+8 ; 0x32e3e '0' + buf[i - 1] : 32e36: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e38: 0e 94 cc 70 call 0xe198 ; 0xe198 32e3c: f4 cf rjmp .-24 ; 0x32e26 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 32e3e: 89 5c subi r24, 0xC9 ; 201 32e40: fb cf rjmp .-10 ; 0x32e38 } 32e42: a0 96 adiw r28, 0x20 ; 32 32e44: 0f b6 in r0, 0x3f ; 63 32e46: f8 94 cli 32e48: de bf out 0x3e, r29 ; 62 32e4a: 0f be out 0x3f, r0 ; 63 32e4c: cd bf out 0x3d, r28 ; 61 32e4e: df 91 pop r29 32e50: cf 91 pop r28 32e52: 1f 91 pop r17 32e54: 0f 91 pop r16 32e56: ff 90 pop r15 32e58: ef 90 pop r14 32e5a: bf 90 pop r11 32e5c: af 90 pop r10 32e5e: 9f 90 pop r9 32e60: 8f 90 pop r8 32e62: 08 95 ret 00032e64 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 32e64: 87 e1 ldi r24, 0x17 ; 23 32e66: 90 ea ldi r25, 0xA0 ; 160 32e68: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 32e6c: 85 ea ldi r24, 0xA5 ; 165 32e6e: 9d e0 ldi r25, 0x0D ; 13 32e70: 0f 94 8b a0 call 0x34116 ; 0x34116 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 32e74: bc 01 movw r22, r24 32e76: 90 e0 ldi r25, 0x00 ; 0 32e78: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32e7a: 4a e0 ldi r20, 0x0A ; 10 32e7c: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e80: 8d e5 ldi r24, 0x5D ; 93 32e82: 0c 94 cc 70 jmp 0xe198 ; 0xe198 00032e86 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 32e86: cf 92 push r12 32e88: df 92 push r13 32e8a: ef 92 push r14 32e8c: ff 92 push r15 32e8e: 6b 01 movw r12, r22 32e90: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 32e92: f7 fe sbrs r15, 7 32e94: 0b c0 rjmp .+22 ; 0x32eac } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e96: 8d e2 ldi r24, 0x2D ; 45 32e98: 0e 94 cc 70 call 0xe198 ; 0xe198 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 32e9c: f0 94 com r15 32e9e: e0 94 com r14 32ea0: d0 94 com r13 32ea2: c0 94 com r12 32ea4: c1 1c adc r12, r1 32ea6: d1 1c adc r13, r1 32ea8: e1 1c adc r14, r1 32eaa: f1 1c adc r15, r1 } printNumber(n, 10); 32eac: 4a e0 ldi r20, 0x0A ; 10 32eae: c7 01 movw r24, r14 32eb0: b6 01 movw r22, r12 } else { printNumber(n, base); } } 32eb2: ff 90 pop r15 32eb4: ef 90 pop r14 32eb6: df 90 pop r13 32eb8: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 32eba: 0d 94 cd 96 jmp 0x32d9a ; 0x32d9a 00032ebe : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 32ebe: cf 93 push r28 32ec0: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ec2: 8b e7 ldi r24, 0x7B ; 123 32ec4: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 32ec8: 8c 2f mov r24, r28 32eca: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 32ece: 0f 94 39 6c call 0x2d872 ; 0x2d872 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 32ed2: 83 e0 ldi r24, 0x03 ; 3 32ed4: 90 ea ldi r25, 0xA0 ; 160 32ed6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32eda: 60 91 84 06 lds r22, 0x0684 ; 0x800684 32ede: 70 91 85 06 lds r23, 0x0685 ; 0x800685 32ee2: 80 91 86 06 lds r24, 0x0686 ; 0x800686 32ee6: 90 91 87 06 lds r25, 0x0687 ; 0x800687 32eea: 4a e0 ldi r20, 0x0A ; 10 32eec: 0f 94 cd 96 call 0x32d9a ; 0x32d9a SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 32ef0: 8c ef ldi r24, 0xFC ; 252 32ef2: 9f e9 ldi r25, 0x9F ; 159 32ef4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 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;}; 32ef8: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 32efc: 88 23 and r24, r24 32efe: 09 f4 brne .+2 ; 0x32f02 32f00: 5e c0 rjmp .+188 ; 0x32fbe 32f02: 80 91 77 16 lds r24, 0x1677 ; 0x801677 32f06: 90 91 78 16 lds r25, 0x1678 ; 0x801678 32f0a: a0 91 79 16 lds r26, 0x1679 ; 0x801679 32f0e: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 32f12: 00 97 sbiw r24, 0x00 ; 0 32f14: a1 05 cpc r26, r1 32f16: b1 05 cpc r27, r1 32f18: 09 f4 brne .+2 ; 0x32f1c 32f1a: 51 c0 rjmp .+162 ; 0x32fbe 32f1c: bc 01 movw r22, r24 32f1e: cd 01 movw r24, r26 32f20: 6d 59 subi r22, 0x9D ; 157 32f22: 7f 4f sbci r23, 0xFF ; 255 32f24: 8f 4f sbci r24, 0xFF ; 255 32f26: 9f 4f sbci r25, 0xFF ; 255 32f28: 24 e6 ldi r18, 0x64 ; 100 32f2a: 30 e0 ldi r19, 0x00 ; 0 32f2c: 40 e0 ldi r20, 0x00 ; 0 32f2e: 50 e0 ldi r21, 0x00 ; 0 32f30: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 32f34: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 32f38: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 32f3c: 80 91 80 16 lds r24, 0x1680 ; 0x801680 32f40: 90 91 81 16 lds r25, 0x1681 ; 0x801681 32f44: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 32f48: 62 2f mov r22, r18 32f4a: 70 e0 ldi r23, 0x00 ; 0 32f4c: 90 e0 ldi r25, 0x00 ; 0 32f4e: 80 e0 ldi r24, 0x00 ; 0 32f50: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 32f54: 85 ef ldi r24, 0xF5 ; 245 32f56: 9f e9 ldi r25, 0x9F ; 159 32f58: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 32f5c: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 32f60: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 32f64: 07 2e mov r0, r23 32f66: 00 0c add r0, r0 32f68: 88 0b sbc r24, r24 32f6a: 99 0b sbc r25, r25 32f6c: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 32f70: 8e ee ldi r24, 0xEE ; 238 32f72: 9f e9 ldi r25, 0x9F ; 159 32f74: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 32f78: 80 91 81 13 lds r24, 0x1381 ; 0x801381 32f7c: 81 11 cpse r24, r1 32f7e: 21 c0 rjmp .+66 ; 0x32fc2 32f80: 8c e6 ldi r24, 0x6C ; 108 32f82: 93 e1 ldi r25, 0x13 ; 19 32f84: 0e 94 2e 7d call 0xfa5c ; 0xfa5c SERIAL_ECHOPGM("][TIM:"); 32f88: 87 ee ldi r24, 0xE7 ; 231 32f8a: 9f e9 ldi r25, 0x9F ; 159 32f8c: 0e 94 e5 70 call 0xe1ca ; 0xe1ca if (print_job_timer.isRunning()) { 32f90: 80 91 59 03 lds r24, 0x0359 ; 0x800359 32f94: 81 30 cpi r24, 0x01 ; 1 32f96: c1 f4 brne .+48 ; 0x32fc8 SERIAL_ECHO(print_job_timer.duration()); 32f98: 0f 94 38 1c call 0x23870 ; 0x23870 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32f9c: 4a e0 ldi r20, 0x0A ; 10 32f9e: 0f 94 cd 96 call 0x32d9a ; 0x32d9a } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 32fa2: 80 ee ldi r24, 0xE0 ; 224 32fa4: 9f e9 ldi r25, 0x9F ; 159 32fa6: 0e 94 e5 70 call 0xe1ca ; 0xe1ca SERIAL_ECHORPGM(FW_VERSION_STR_P()); 32faa: 89 ed ldi r24, 0xD9 ; 217 32fac: 9f e9 ldi r25, 0x9F ; 159 32fae: 0e 94 e5 70 call 0xe1ca ; 0xe1ca } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32fb2: 8d e5 ldi r24, 0x5D ; 93 32fb4: 0e 94 cc 70 call 0xe198 ; 0xe198 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 32fb8: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 32fba: 0d 94 32 97 jmp 0x32e64 ; 0x32e64 32fbe: 20 e0 ldi r18, 0x00 ; 0 32fc0: c3 cf rjmp .-122 ; 0x32f48 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); 32fc2: 81 e8 ldi r24, 0x81 ; 129 32fc4: 93 e1 ldi r25, 0x13 ; 19 32fc6: de cf rjmp .-68 ; 0x32f84 32fc8: 60 e0 ldi r22, 0x00 ; 0 32fca: 70 e0 ldi r23, 0x00 ; 0 32fcc: cb 01 movw r24, r22 32fce: 0f 94 43 97 call 0x32e86 ; 0x32e86 32fd2: e7 cf rjmp .-50 ; 0x32fa2 00032fd4 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 32fd4: 8f 92 push r8 32fd6: 9f 92 push r9 32fd8: af 92 push r10 32fda: bf 92 push r11 32fdc: cf 92 push r12 32fde: df 92 push r13 32fe0: ef 92 push r14 32fe2: ff 92 push r15 32fe4: cf 93 push r28 32fe6: 6b 01 movw r12, r22 32fe8: 7c 01 movw r14, r24 32fea: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 32fec: 20 e0 ldi r18, 0x00 ; 0 32fee: 30 e0 ldi r19, 0x00 ; 0 32ff0: a9 01 movw r20, r18 32ff2: 0f 94 9a a2 call 0x34534 ; 0x34534 <__cmpsf2> 32ff6: 87 ff sbrs r24, 7 32ff8: 07 c0 rjmp .+14 ; 0x33008 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ffa: 8d e2 ldi r24, 0x2D ; 45 32ffc: 0e 94 cc 70 call 0xe198 ; 0xe198 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 33000: f7 fa bst r15, 7 33002: f0 94 com r15 33004: f7 f8 bld r15, 7 33006: 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; 33016: 20 e0 ldi r18, 0x00 ; 0 33018: 30 e0 ldi r19, 0x00 ; 0 3301a: 40 e2 ldi r20, 0x20 ; 32 3301c: 51 e4 ldi r21, 0x41 ; 65 3301e: 0f 94 a4 a2 call 0x34548 ; 0x34548 <__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; 33026: 9b 01 movw r18, r22 33028: ac 01 movw r20, r24 3302a: c7 01 movw r24, r14 3302c: b6 01 movw r22, r12 3302e: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 33032: 6b 01 movw r12, r22 33034: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 33036: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 3303a: 4b 01 movw r8, r22 3303c: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3303e: 4a e0 ldi r20, 0x0A ; 10 33040: 0f 94 cd 96 call 0x32d9a ; 0x32d9a 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) 33044: cc 23 and r28, r28 33046: 91 f1 breq .+100 ; 0x330ac 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; 33048: c5 01 movw r24, r10 3304a: b4 01 movw r22, r8 3304c: 0f 94 09 9b call 0x33612 ; 0x33612 <__floatunsisf> 33050: 9b 01 movw r18, r22 33052: ac 01 movw r20, r24 33054: c7 01 movw r24, r14 33056: b6 01 movw r22, r12 33058: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 3305c: 6b 01 movw r12, r22 3305e: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33060: 8e e2 ldi r24, 0x2E ; 46 33062: 0e 94 cc 70 call 0xe198 ; 0xe198 // 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) 33066: c1 50 subi r28, 0x01 ; 1 33068: 08 f1 brcs .+66 ; 0x330ac { remainder *= 10.0; 3306a: 20 e0 ldi r18, 0x00 ; 0 3306c: 30 e0 ldi r19, 0x00 ; 0 3306e: 40 e2 ldi r20, 0x20 ; 32 33070: 51 e4 ldi r21, 0x41 ; 65 33072: c7 01 movw r24, r14 33074: b6 01 movw r22, r12 33076: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 3307a: 4b 01 movw r8, r22 3307c: 5c 01 movw r10, r24 int toPrint = int(remainder); 3307e: 0f 94 16 a3 call 0x3462c ; 0x3462c <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 33082: 6b 01 movw r12, r22 33084: 77 0f add r23, r23 33086: ee 08 sbc r14, r14 33088: ff 08 sbc r15, r15 3308a: c7 01 movw r24, r14 3308c: b6 01 movw r22, r12 3308e: 0f 94 43 97 call 0x32e86 ; 0x32e86 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 33092: c7 01 movw r24, r14 33094: b6 01 movw r22, r12 33096: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 3309a: 9b 01 movw r18, r22 3309c: ac 01 movw r20, r24 3309e: c5 01 movw r24, r10 330a0: b4 01 movw r22, r8 330a2: 0f 94 a4 a1 call 0x34348 ; 0x34348 <__subsf3> 330a6: 6b 01 movw r12, r22 330a8: 7c 01 movw r14, r24 330aa: dd cf rjmp .-70 ; 0x33066 } } 330ac: cf 91 pop r28 330ae: ff 90 pop r15 330b0: ef 90 pop r14 330b2: df 90 pop r13 330b4: cf 90 pop r12 330b6: bf 90 pop r11 330b8: af 90 pop r10 330ba: 9f 90 pop r9 330bc: 8f 90 pop r8 330be: 08 95 ret 000330c0 : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 330c0: 82 e3 ldi r24, 0x32 ; 50 330c2: 90 ea ldi r25, 0xA0 ; 160 330c4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 330c8: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 330cc: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 330d0: 07 2e mov r0, r23 330d2: 00 0c add r0, r0 330d4: 88 0b sbc r24, r24 330d6: 99 0b sbc r25, r25 330d8: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 330dc: 8b e2 ldi r24, 0x2B ; 43 330de: 90 ea ldi r25, 0xA0 ; 160 330e0: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 330e4: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 330e8: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 330ec: 07 2e mov r0, r23 330ee: 00 0c add r0, r0 330f0: 88 0b sbc r24, r24 330f2: 99 0b sbc r25, r25 330f4: 0f 94 43 97 call 0x32e86 ; 0x32e86 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 330f8: 84 e2 ldi r24, 0x24 ; 36 330fa: 90 ea ldi r25, 0xA0 ; 160 330fc: 0e 94 e5 70 call 0xe1ca ; 0xe1ca else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 33100: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 33104: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 33108: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 3310c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 33110: 42 e0 ldi r20, 0x02 ; 2 33112: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 33116: 8d e1 ldi r24, 0x1D ; 29 33118: 90 ea ldi r25, 0xA0 ; 160 3311a: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 3311e: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 33122: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 33126: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 3312a: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 3312e: 42 e0 ldi r20, 0x02 ; 2 33130: 0f 94 ea 97 call 0x32fd4 ; 0x32fd4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33134: 8d e5 ldi r24, 0x5D ; 93 33136: 0c 94 cc 70 jmp 0xe198 ; 0xe198 0003313a : 3313a: 8a e0 ldi r24, 0x0A ; 10 3313c: 0c 94 cc 70 jmp 0xe198 ; 0xe198 00033140 : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 33140: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 33142: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca 33146: 99 23 and r25, r25 33148: 09 f4 brne .+2 ; 0x3314c 3314a: f6 c0 rjmp .+492 ; 0x33338 3314c: c8 2f mov r28, r24 return; switch (_message) { 3314e: 87 30 cpi r24, 0x07 ; 7 33150: 09 f4 brne .+2 ; 0x33154 33152: be c0 rjmp .+380 ; 0x332d0 33154: 08 f0 brcs .+2 ; 0x33158 33156: 46 c0 rjmp .+140 ; 0x331e4 33158: 83 30 cpi r24, 0x03 ; 3 3315a: 09 f4 brne .+2 ; 0x3315e 3315c: ed c0 rjmp .+474 ; 0x33338 3315e: 80 f5 brcc .+96 ; 0x331c0 33160: 81 30 cpi r24, 0x01 ; 1 33162: 09 f4 brne .+2 ; 0x33166 33164: 88 c0 rjmp .+272 ; 0x33276 33166: 08 f4 brcc .+2 ; 0x3316a 33168: 60 c0 rjmp .+192 ; 0x3322a 3316a: 8b e7 ldi r24, 0x7B ; 123 3316c: 0e 94 cc 70 call 0xe198 ; 0xe198 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 33170: 83 e0 ldi r24, 0x03 ; 3 33172: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 33176: 0f 94 39 6c call 0x2d872 ; 0x2d872 3317a: 8d e7 ldi r24, 0x7D ; 125 3317c: 0e 94 cc 70 call 0xe198 ; 0xe198 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 33180: 0f 94 9d 98 call 0x3313a ; 0x3313a SERIAL_ECHOLN('}'); status_number = 3; 33184: c3 e0 ldi r28, 0x03 ; 3 33186: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.494> farm_timer = 1; 3318a: 81 e0 ldi r24, 0x01 ; 1 3318c: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 33190: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33194: 81 11 cpse r24, r1 33196: 05 c0 rjmp .+10 ; 0x331a2 33198: 80 91 62 03 lds r24, 0x0362 ; 0x800362 3319c: 88 23 and r24, r24 3319e: 09 f4 brne .+2 ; 0x331a2 331a0: 78 c0 rjmp .+240 ; 0x33292 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 331a2: 8b e7 ldi r24, 0x7B ; 123 331a4: 0e 94 cc 70 call 0xe198 ; 0xe198 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 331a8: 84 e0 ldi r24, 0x04 ; 4 331aa: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 331ae: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 4; 331b2: 84 e0 ldi r24, 0x04 ; 4 331b4: 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; 331b8: 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; 331ba: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 331be: 1e c0 rjmp .+60 ; 0x331fc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 331c0: 85 30 cpi r24, 0x05 ; 5 331c2: 09 f4 brne .+2 ; 0x331c6 331c4: 71 c0 rjmp .+226 ; 0x332a8 // 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:"); 331c6: 8a e6 ldi r24, 0x6A ; 106 331c8: 90 ea ldi r25, 0xA0 ; 160 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 331ca: c6 30 cpi r28, 0x06 ; 6 331cc: 08 f4 brcc .+2 ; 0x331d0 331ce: 6e c0 rjmp .+220 ; 0x332ac prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 331d0: 83 e5 ldi r24, 0x53 ; 83 331d2: 90 ea ldi r25, 0xA0 ; 160 331d4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca prusa_stat_farm_number(); 331d8: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 8; 331dc: 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; 331de: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 331e2: 74 c0 rjmp .+232 ; 0x332cc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 331e4: 86 31 cpi r24, 0x16 ; 22 331e6: 09 f4 brne .+2 ; 0x331ea 331e8: 9b c0 rjmp .+310 ; 0x33320 331ea: 70 f4 brcc .+28 ; 0x33208 331ec: 84 31 cpi r24, 0x14 ; 20 331ee: 09 f4 brne .+2 ; 0x331f2 331f0: 80 c0 rjmp .+256 ; 0x332f2 331f2: 08 f0 brcs .+2 ; 0x331f6 331f4: 89 c0 rjmp .+274 ; 0x33308 331f6: 88 30 cpi r24, 0x08 ; 8 331f8: 09 f4 brne .+2 ; 0x331fc 331fa: 72 c0 rjmp .+228 ; 0x332e0 331fc: 8d e7 ldi r24, 0x7D ; 125 331fe: 0e 94 cc 70 call 0xe198 ; 0xe198 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 33202: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 33204: 0d 94 9d 98 jmp 0x3313a ; 0x3313a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33208: 8b 35 cpi r24, 0x5B ; 91 3320a: 09 f4 brne .+2 ; 0x3320e 3320c: 91 c0 rjmp .+290 ; 0x33330 3320e: 30 f4 brcc .+12 ; 0x3321c prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 33210: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33212: ca 35 cpi r28, 0x5A ; 90 33214: 99 f7 brne .-26 ; 0x331fc break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 33216: 0f 94 4a 6c call 0x2d894 ; 0x2d894 3321a: f0 cf rjmp .-32 ; 0x331fc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 3321c: 8c 35 cpi r24, 0x5C ; 92 3321e: 09 f4 brne .+2 ; 0x33222 33220: 89 c0 rjmp .+274 ; 0x33334 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 33222: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33224: cd 35 cpi r28, 0x5D ; 93 33226: b9 f3 breq .-18 ; 0x33216 33228: e9 cf rjmp .-46 ; 0x331fc case 0: // default message if (busy_state == PAUSED_FOR_USER) { 3322a: 80 91 78 02 lds r24, 0x0278 ; 0x800278 3322e: 84 30 cpi r24, 0x04 ; 4 33230: 21 f4 brne .+8 ; 0x3323a prusa_statistics_case0(15); 33232: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 33234: 0f 94 5f 97 call 0x32ebe ; 0x32ebe 33238: e1 cf rjmp .-62 ; 0x331fc switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 3323a: 0e 94 48 61 call 0xc290 ; 0xc290 3323e: 88 23 and r24, r24 33240: 11 f0 breq .+4 ; 0x33246 prusa_statistics_case0(14); 33242: 8e e0 ldi r24, 0x0E ; 14 33244: f7 cf rjmp .-18 ; 0x33234 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 33246: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 3324a: 81 11 cpse r24, r1 3324c: 04 c0 rjmp .+8 ; 0x33256 3324e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 33252: 88 23 and r24, r24 33254: 11 f0 breq .+4 ; 0x3325a prusa_statistics_case0(4); 33256: 84 e0 ldi r24, 0x04 ; 4 33258: ed cf rjmp .-38 ; 0x33234 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3325a: 8b e7 ldi r24, 0x7B ; 123 3325c: 0e 94 cc 70 call 0xe198 ; 0xe198 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 33260: 81 e0 ldi r24, 0x01 ; 1 33262: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 33266: 0f 94 39 6c call 0x2d872 ; 0x2d872 prusa_stat_diameter(); 3326a: 0f 94 32 97 call 0x32e64 ; 0x32e64 status_number = 1; 3326e: 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; 33270: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 33274: c3 cf rjmp .-122 ; 0x331fc 33276: 8b e7 ldi r24, 0x7B ; 123 33278: 0e 94 cc 70 call 0xe198 ; 0xe198 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 3327c: 82 e0 ldi r24, 0x02 ; 2 3327e: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 33282: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 2; 33286: 82 e0 ldi r24, 0x02 ; 2 33288: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.494> farm_timer = 1; 3328c: c0 93 76 02 sts 0x0276, r28 ; 0x800276 <_ZL10farm_timer.lto_priv.445> 33290: b5 cf rjmp .-150 ; 0x331fc 33292: 8b e7 ldi r24, 0x7B ; 123 33294: 0e 94 cc 70 call 0xe198 ; 0xe198 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 33298: 83 e0 ldi r24, 0x03 ; 3 3329a: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 3329e: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 3; 332a2: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 332a6: 88 cf rjmp .-240 ; 0x331b8 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 332a8: 8c e5 ldi r24, 0x5C ; 92 332aa: 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:"); 332ac: 0e 94 e5 70 call 0xe1ca ; 0xe1ca 332b0: 60 e0 ldi r22, 0x00 ; 0 332b2: 70 e0 ldi r23, 0x00 ; 0 332b4: cb 01 movw r24, r22 332b6: 0f 94 43 97 call 0x32e86 ; 0x32e86 332ba: 8d e5 ldi r24, 0x5D ; 93 332bc: 0e 94 cc 70 call 0xe198 ; 0xe198 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 332c0: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 332c4: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 332c8: 0f 94 39 6c call 0x2d872 ; 0x2d872 farm_timer = 2; 332cc: 82 e0 ldi r24, 0x02 ; 2 332ce: 75 cf rjmp .-278 ; 0x331ba prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 332d0: 8a e4 ldi r24, 0x4A ; 74 332d2: 90 ea ldi r25, 0xA0 ; 160 332d4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca prusa_stat_farm_number(); 332d8: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 9; 332dc: 89 e0 ldi r24, 0x09 ; 9 332de: 7f cf rjmp .-258 ; 0x331de farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 332e0: 81 e4 ldi r24, 0x41 ; 65 332e2: 90 ea ldi r25, 0xA0 ; 160 332e4: 0e 94 e5 70 call 0xe1ca ; 0xe1ca prusa_stat_farm_number(); 332e8: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 0; 332ec: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 332f0: ed cf rjmp .-38 ; 0x332cc 332f2: 8b e7 ldi r24, 0x7B ; 123 332f4: 0e 94 cc 70 call 0xe198 ; 0xe198 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 332f8: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 332fc: 0f 94 3d 6c call 0x2d87a ; 0x2d87a prusa_stat_farm_number(); 33300: 0f 94 39 6c call 0x2d872 ; 0x2d872 farm_timer = 4; 33304: 84 e0 ldi r24, 0x04 ; 4 33306: 59 cf rjmp .-334 ; 0x331ba 33308: 8b e7 ldi r24, 0x7B ; 123 3330a: 0e 94 cc 70 call 0xe198 ; 0xe198 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 3330e: 0f 94 60 98 call 0x330c0 ; 0x330c0 prusa_stat_farm_number(); 33312: 0f 94 39 6c call 0x2d872 ; 0x2d872 prusa_stat_printerstatus(status_number); 33316: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.494> 3331a: 0f 94 3d 6c call 0x2d87a ; 0x2d87a 3331e: 6e cf rjmp .-292 ; 0x331fc break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 33320: 88 e3 ldi r24, 0x38 ; 56 33322: 90 ea ldi r25, 0xA0 ; 160 33324: 0e 94 e5 70 call 0xe1ca ; 0xe1ca prusa_stat_farm_number(); 33328: 0f 94 39 6c call 0x2d872 ; 0x2d872 status_number = 5; 3332c: 85 e0 ldi r24, 0x05 ; 5 3332e: a0 cf rjmp .-192 ; 0x33270 case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 33330: 82 e3 ldi r24, 0x32 ; 50 33332: 71 cf rjmp .-286 ; 0x33216 break; case 92: // Error - Min temp prusa_statistics_err('3'); 33334: 83 e3 ldi r24, 0x33 ; 51 33336: 6f cf rjmp .-290 ; 0x33216 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 33338: cf 91 pop r28 3333a: 08 95 ret 0003333c : 3333c: 0e 94 2e 7d call 0xfa5c ; 0xfa5c }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 33340: 0d 94 9d 98 jmp 0x3313a ; 0x3313a 00033344 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 33344: 1f 92 push r1 33346: 0f 92 push r0 33348: 0f b6 in r0, 0x3f ; 63 3334a: 0f 92 push r0 3334c: 11 24 eor r1, r1 3334e: 0b b6 in r0, 0x3b ; 59 33350: 0f 92 push r0 33352: 2f 93 push r18 33354: 3f 93 push r19 33356: 4f 93 push r20 33358: 6f 93 push r22 3335a: 7f 93 push r23 3335c: 8f 93 push r24 3335e: 9f 93 push r25 33360: ef 93 push r30 33362: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 33368: 84 ff sbrs r24, 4 3336a: 12 c0 rjmp .+36 ; 0x33390 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3336c: 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 } } 33370: ff 91 pop r31 33372: ef 91 pop r30 33374: 9f 91 pop r25 33376: 8f 91 pop r24 33378: 7f 91 pop r23 3337a: 6f 91 pop r22 3337c: 4f 91 pop r20 3337e: 3f 91 pop r19 33380: 2f 91 pop r18 33382: 0f 90 pop r0 33384: 0b be out 0x3b, r0 ; 59 33386: 0f 90 pop r0 33388: 0f be out 0x3f, r0 ; 63 3338a: 0f 90 pop r0 3338c: 1f 90 pop r1 3338e: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 33390: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 33394: 80 91 04 05 lds r24, 0x0504 ; 0x800504 33398: 81 30 cpi r24, 0x01 ; 1 3339a: 51 f7 brne .-44 ; 0x33370 <__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; 3339c: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 333a0: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 333a4: c9 01 movw r24, r18 333a6: 01 96 adiw r24, 0x01 ; 1 333a8: 8f 77 andi r24, 0x7F ; 127 333aa: 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) { 333ac: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 333b0: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 333b4: 86 17 cp r24, r22 333b6: 97 07 cpc r25, r23 333b8: d9 f2 breq .-74 ; 0x33370 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 333ba: 21 5d subi r18, 0xD1 ; 209 333bc: 3a 4f sbci r19, 0xFA ; 250 333be: f9 01 movw r30, r18 333c0: 40 83 st Z, r20 rx_buffer.head = i; 333c2: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 333c6: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 333ca: d2 cf rjmp .-92 ; 0x33370 <__vector_36+0x2c> 000333cc <__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) { 333cc: 1f 92 push r1 333ce: 0f 92 push r0 333d0: 0f b6 in r0, 0x3f ; 63 333d2: 0f 92 push r0 333d4: 11 24 eor r1, r1 333d6: 0b b6 in r0, 0x3b ; 59 333d8: 0f 92 push r0 333da: 2f 93 push r18 333dc: 3f 93 push r19 333de: 4f 93 push r20 333e0: 6f 93 push r22 333e2: 7f 93 push r23 333e4: 8f 93 push r24 333e6: 9f 93 push r25 333e8: ef 93 push r30 333ea: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 333f0: 84 ff sbrs r24, 4 333f2: 12 c0 rjmp .+36 ; 0x33418 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 333f4: 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 } } 333f8: ff 91 pop r31 333fa: ef 91 pop r30 333fc: 9f 91 pop r25 333fe: 8f 91 pop r24 33400: 7f 91 pop r23 33402: 6f 91 pop r22 33404: 4f 91 pop r20 33406: 3f 91 pop r19 33408: 2f 91 pop r18 3340a: 0f 90 pop r0 3340c: 0b be out 0x3b, r0 ; 59 3340e: 0f 90 pop r0 33410: 0f be out 0x3f, r0 ; 63 33412: 0f 90 pop r0 33414: 1f 90 pop r1 33416: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 33418: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3341c: 80 91 04 05 lds r24, 0x0504 ; 0x800504 33420: 81 11 cpse r24, r1 33422: ea cf rjmp .-44 ; 0x333f8 <__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; 33424: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 33428: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 3342c: c9 01 movw r24, r18 3342e: 01 96 adiw r24, 0x01 ; 1 33430: 8f 77 andi r24, 0x7F ; 127 33432: 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) { 33434: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 33438: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 3343c: 86 17 cp r24, r22 3343e: 97 07 cpc r25, r23 33440: d9 f2 breq .-74 ; 0x333f8 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 33442: 21 5d subi r18, 0xD1 ; 209 33444: 3a 4f sbci r19, 0xFA ; 250 33446: f9 01 movw r30, r18 33448: 40 83 st Z, r20 rx_buffer.head = i; 3344a: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 3344e: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 33452: d2 cf rjmp .-92 ; 0x333f8 <__vector_25+0x2c> 00033454 : * 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) { 33454: 2f 92 push r2 33456: 3f 92 push r3 33458: 4f 92 push r4 3345a: 5f 92 push r5 3345c: 6f 92 push r6 3345e: 7f 92 push r7 33460: 8f 92 push r8 33462: 9f 92 push r9 33464: af 92 push r10 33466: bf 92 push r11 33468: cf 92 push r12 3346a: df 92 push r13 3346c: ef 92 push r14 3346e: ff 92 push r15 33470: 0f 93 push r16 33472: 1f 93 push r17 33474: cf 93 push r28 33476: df 93 push r29 33478: cd b7 in r28, 0x3d ; 61 3347a: de b7 in r29, 0x3e ; 62 3347c: c2 54 subi r28, 0x42 ; 66 3347e: d1 09 sbc r29, r1 33480: 0f b6 in r0, 0x3f ; 63 33482: f8 94 cli 33484: de bf out 0x3e, r29 ; 62 33486: 0f be out 0x3f, r0 ; 63 33488: cd bf out 0x3d, r28 ; 61 3348a: 4c 01 movw r8, r24 3348c: 5b 01 movw r10, r22 3348e: 6a 01 movw r12, r20 33490: 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) {} 33492: 19 82 std Y+1, r1 ; 0x01 33494: 1c 82 std Y+4, r1 ; 0x04 33496: 1c 8e std Y+28, r1 ; 0x1c 33498: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3349a: 67 2b or r22, r23 3349c: 21 f5 brne .+72 ; 0x334e6 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3349e: 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; 334a0: ce 01 movw r24, r28 334a2: 4c 96 adiw r24, 0x1c ; 28 334a4: 0e 94 c6 70 call 0xe18c ; 0xe18c 334a8: ce 01 movw r24, r28 334aa: 01 96 adiw r24, 0x01 ; 1 334ac: 0e 94 c6 70 call 0xe18c ; 0xe18c } return open(parent, dname, oflag); fail: return false; } 334b0: 81 2f mov r24, r17 334b2: ce 5b subi r28, 0xBE ; 190 334b4: df 4f sbci r29, 0xFF ; 255 334b6: 0f b6 in r0, 0x3f ; 63 334b8: f8 94 cli 334ba: de bf out 0x3e, r29 ; 62 334bc: 0f be out 0x3f, r0 ; 63 334be: cd bf out 0x3d, r28 ; 61 334c0: df 91 pop r29 334c2: cf 91 pop r28 334c4: 1f 91 pop r17 334c6: 0f 91 pop r16 334c8: ff 90 pop r15 334ca: ef 90 pop r14 334cc: df 90 pop r13 334ce: cf 90 pop r12 334d0: bf 90 pop r11 334d2: af 90 pop r10 334d4: 9f 90 pop r9 334d6: 8f 90 pop r8 334d8: 7f 90 pop r7 334da: 6f 90 pop r6 334dc: 5f 90 pop r5 334de: 4f 90 pop r4 334e0: 3f 90 pop r3 334e2: 2f 90 pop r2 334e4: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 334e6: fc 01 movw r30, r24 334e8: 83 81 ldd r24, Z+3 ; 0x03 334ea: 81 11 cpse r24, r1 334ec: d8 cf rjmp .-80 ; 0x3349e if (*path == '/') { 334ee: fa 01 movw r30, r20 334f0: 80 81 ld r24, Z 334f2: 8f 32 cpi r24, 0x2F ; 47 334f4: c1 f4 brne .+48 ; 0x33526 334f6: ca 01 movw r24, r20 334f8: 6c 01 movw r12, r24 334fa: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 334fc: f6 01 movw r30, r12 334fe: 20 81 ld r18, Z 33500: 2f 32 cpi r18, 0x2F ; 47 33502: d1 f3 breq .-12 ; 0x334f8 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; 33504: f5 01 movw r30, r10 33506: 83 81 ldd r24, Z+3 ; 0x03 33508: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3350a: 82 30 cpi r24, 0x02 ; 2 3350c: 60 f0 brcs .+24 ; 0x33526 if (!dir2.openRoot(dirFile->vol_)) goto fail; 3350e: 61 8d ldd r22, Z+25 ; 0x19 33510: 72 8d ldd r23, Z+26 ; 0x1a 33512: ce 01 movw r24, r28 33514: 4c 96 adiw r24, 0x1c ; 28 33516: 0f 94 e3 6e call 0x2ddc6 ; 0x2ddc6 parent = &dir2; 3351a: 8e 01 movw r16, r28 3351c: 04 5e subi r16, 0xE4 ; 228 3351e: 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; 33520: 81 11 cpse r24, r1 33522: 02 c0 rjmp .+4 ; 0x33528 33524: bc cf rjmp .-136 ; 0x3349e // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 33526: 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; 33528: ce 01 movw r24, r28 3352a: 01 96 adiw r24, 0x01 ; 1 3352c: 7c 01 movw r14, r24 3352e: 3c 01 movw r6, r24 33530: 2e 01 movw r4, r28 33532: 9c e1 ldi r25, 0x1C ; 28 33534: 49 0e add r4, r25 33536: 51 1c adc r5, r1 33538: 23 96 adiw r28, 0x03 ; 3 3353a: ef ae std Y+63, r14 ; 0x3f 3353c: 23 97 sbiw r28, 0x03 ; 3 3353e: 2f 2c mov r2, r15 33540: fe 01 movw r30, r28 33542: f7 96 adiw r30, 0x37 ; 55 33544: cf 01 movw r24, r30 33546: 0b 96 adiw r24, 0x0b ; 11 33548: 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++] = ' '; 3354a: 20 e2 ldi r18, 0x20 ; 32 3354c: 21 93 st Z+, r18 3354e: e8 17 cp r30, r24 33550: f9 07 cpc r31, r25 33552: d9 f7 brne .-10 ; 0x3354a 33554: 96 01 movw r18, r12 i = 0; 33556: 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 33558: 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 != '/') { 3355a: d9 01 movw r26, r18 3355c: 8d 91 ld r24, X+ 3355e: 88 23 and r24, r24 33560: 49 f1 breq .+82 ; 0x335b4 33562: 8f 32 cpi r24, 0x2F ; 47 33564: 39 f1 breq .+78 ; 0x335b4 c = *str++; 33566: 28 2f mov r18, r24 if (c == '.') { 33568: 8e 32 cpi r24, 0x2E ; 46 3356a: 39 f4 brne .+14 ; 0x3357a if (n == 10) goto fail; // only one dot allowed 3356c: 6a 30 cpi r22, 0x0A ; 10 3356e: 09 f4 brne .+2 ; 0x33572 33570: 96 cf rjmp .-212 ; 0x3349e n = 10; // max index for full 8.3 name i = 8; // place for extension 33572: 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 33574: 6a e0 ldi r22, 0x0A ; 10 33576: 9d 01 movw r18, r26 33578: f0 cf rjmp .-32 ; 0x3355a 3357a: e8 e7 ldi r30, 0x78 ; 120 3357c: 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; 3357e: 34 91 lpm r19, Z 33580: 33 23 and r19, r19 33582: 21 f0 breq .+8 ; 0x3358c 33584: 31 96 adiw r30, 0x01 ; 1 33586: 83 13 cpse r24, r19 33588: fa cf rjmp .-12 ; 0x3357e 3358a: 89 cf rjmp .-238 ; 0x3349e // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3358c: 69 17 cp r22, r25 3358e: 08 f4 brcc .+2 ; 0x33592 33590: 86 cf rjmp .-244 ; 0x3349e 33592: 3f ed ldi r19, 0xDF ; 223 33594: 38 0f add r19, r24 33596: 3e 35 cpi r19, 0x5E ; 94 33598: 08 f0 brcs .+2 ; 0x3359c 3359a: 81 cf rjmp .-254 ; 0x3349e // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3359c: 3f e9 ldi r19, 0x9F ; 159 3359e: 38 0f add r19, r24 335a0: 3a 31 cpi r19, 0x1A ; 26 335a2: 10 f4 brcc .+4 ; 0x335a8 335a4: 20 ee ldi r18, 0xE0 ; 224 335a6: 28 0f add r18, r24 335a8: fa 01 movw r30, r20 335aa: e9 0f add r30, r25 335ac: f1 1d adc r31, r1 335ae: 20 83 st Z, r18 335b0: 9f 5f subi r25, 0xFF ; 255 335b2: e1 cf rjmp .-62 ; 0x33576 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 335b4: 8f a9 ldd r24, Y+55 ; 0x37 335b6: 80 32 cpi r24, 0x20 ; 32 335b8: 09 f4 brne .+2 ; 0x335bc 335ba: 71 cf rjmp .-286 ; 0x3349e 335bc: 69 01 movw r12, r18 while (*path == '/') path++; 335be: f9 01 movw r30, r18 335c0: 80 81 ld r24, Z 335c2: 2f 5f subi r18, 0xFF ; 255 335c4: 3f 4f sbci r19, 0xFF ; 255 335c6: 8f 32 cpi r24, 0x2F ; 47 335c8: c9 f3 breq .-14 ; 0x335bc if (!*path) break; 335ca: 88 23 and r24, r24 335cc: d9 f0 breq .+54 ; 0x33604 if (!sub->open(parent, dname, O_READ)) goto fail; 335ce: 21 e0 ldi r18, 0x01 ; 1 335d0: b8 01 movw r22, r16 335d2: c7 01 movw r24, r14 335d4: 0f 94 29 73 call 0x2e652 ; 0x2e652 335d8: 88 23 and r24, r24 335da: 09 f4 brne .+2 ; 0x335de 335dc: 60 cf rjmp .-320 ; 0x3349e if (parent != dirFile) parent->close(); 335de: 0a 15 cp r16, r10 335e0: 1b 05 cpc r17, r11 335e2: 19 f0 breq .+6 ; 0x335ea 335e4: c8 01 movw r24, r16 335e6: 0f 94 33 6f call 0x2de66 ; 0x2de66 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 335ea: 94 2d mov r25, r4 335ec: 85 2d mov r24, r5 335ee: 6e 14 cp r6, r14 335f0: 7f 04 cpc r7, r15 335f2: 21 f0 breq .+8 ; 0x335fc 335f4: 23 96 adiw r28, 0x03 ; 3 335f6: 9f ad ldd r25, Y+63 ; 0x3f 335f8: 23 97 sbiw r28, 0x03 ; 3 335fa: 82 2d mov r24, r2 335fc: 87 01 movw r16, r14 335fe: e9 2e mov r14, r25 33600: f8 2e mov r15, r24 33602: 9e cf rjmp .-196 ; 0x33540 } return open(parent, dname, oflag); 33604: 23 2d mov r18, r3 33606: b8 01 movw r22, r16 33608: c4 01 movw r24, r8 3360a: 0f 94 29 73 call 0x2e652 ; 0x2e652 3360e: 18 2f mov r17, r24 33610: 47 cf rjmp .-370 ; 0x334a0 00033612 <__floatunsisf>: 33612: e8 94 clt 33614: 09 c0 rjmp .+18 ; 0x33628 <__floatsisf+0x12> 00033616 <__floatsisf>: 33616: 97 fb bst r25, 7 33618: 3e f4 brtc .+14 ; 0x33628 <__floatsisf+0x12> 3361a: 90 95 com r25 3361c: 80 95 com r24 3361e: 70 95 com r23 33620: 61 95 neg r22 33622: 7f 4f sbci r23, 0xFF ; 255 33624: 8f 4f sbci r24, 0xFF ; 255 33626: 9f 4f sbci r25, 0xFF ; 255 33628: 99 23 and r25, r25 3362a: a9 f0 breq .+42 ; 0x33656 <__floatsisf+0x40> 3362c: f9 2f mov r31, r25 3362e: 96 e9 ldi r25, 0x96 ; 150 33630: bb 27 eor r27, r27 33632: 93 95 inc r25 33634: f6 95 lsr r31 33636: 87 95 ror r24 33638: 77 95 ror r23 3363a: 67 95 ror r22 3363c: b7 95 ror r27 3363e: f1 11 cpse r31, r1 33640: f8 cf rjmp .-16 ; 0x33632 <__floatsisf+0x1c> 33642: fa f4 brpl .+62 ; 0x33682 <__floatsisf+0x6c> 33644: bb 0f add r27, r27 33646: 11 f4 brne .+4 ; 0x3364c <__floatsisf+0x36> 33648: 60 ff sbrs r22, 0 3364a: 1b c0 rjmp .+54 ; 0x33682 <__floatsisf+0x6c> 3364c: 6f 5f subi r22, 0xFF ; 255 3364e: 7f 4f sbci r23, 0xFF ; 255 33650: 8f 4f sbci r24, 0xFF ; 255 33652: 9f 4f sbci r25, 0xFF ; 255 33654: 16 c0 rjmp .+44 ; 0x33682 <__floatsisf+0x6c> 33656: 88 23 and r24, r24 33658: 11 f0 breq .+4 ; 0x3365e <__floatsisf+0x48> 3365a: 96 e9 ldi r25, 0x96 ; 150 3365c: 11 c0 rjmp .+34 ; 0x33680 <__floatsisf+0x6a> 3365e: 77 23 and r23, r23 33660: 21 f0 breq .+8 ; 0x3366a <__floatsisf+0x54> 33662: 9e e8 ldi r25, 0x8E ; 142 33664: 87 2f mov r24, r23 33666: 76 2f mov r23, r22 33668: 05 c0 rjmp .+10 ; 0x33674 <__floatsisf+0x5e> 3366a: 66 23 and r22, r22 3366c: 71 f0 breq .+28 ; 0x3368a <__floatsisf+0x74> 3366e: 96 e8 ldi r25, 0x86 ; 134 33670: 86 2f mov r24, r22 33672: 70 e0 ldi r23, 0x00 ; 0 33674: 60 e0 ldi r22, 0x00 ; 0 33676: 2a f0 brmi .+10 ; 0x33682 <__floatsisf+0x6c> 33678: 9a 95 dec r25 3367a: 66 0f add r22, r22 3367c: 77 1f adc r23, r23 3367e: 88 1f adc r24, r24 33680: da f7 brpl .-10 ; 0x33678 <__floatsisf+0x62> 33682: 88 0f add r24, r24 33684: 96 95 lsr r25 33686: 87 95 ror r24 33688: 97 f9 bld r25, 7 3368a: 08 95 ret 0003368c : 3368c: 9b 01 movw r18, r22 3368e: ac 01 movw r20, r24 33690: 0d 94 4a 9b jmp 0x33694 ; 0x33694 <__mulsf3> 00033694 <__mulsf3>: 33694: 0f 94 5d 9b call 0x336ba ; 0x336ba <__mulsf3x> 33698: 0d 94 ce 9b jmp 0x3379c ; 0x3379c <__fp_round> 3369c: 0f 94 c0 9b call 0x33780 ; 0x33780 <__fp_pscA> 336a0: 38 f0 brcs .+14 ; 0x336b0 <__mulsf3+0x1c> 336a2: 0f 94 c7 9b call 0x3378e ; 0x3378e <__fp_pscB> 336a6: 20 f0 brcs .+8 ; 0x336b0 <__mulsf3+0x1c> 336a8: 95 23 and r25, r21 336aa: 11 f0 breq .+4 ; 0x336b0 <__mulsf3+0x1c> 336ac: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 336b0: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 336b4: 11 24 eor r1, r1 336b6: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 000336ba <__mulsf3x>: 336ba: 0f 94 df 9b call 0x337be ; 0x337be <__fp_split3> 336be: 70 f3 brcs .-36 ; 0x3369c <__mulsf3+0x8> 000336c0 <__mulsf3_pse>: 336c0: 95 9f mul r25, r21 336c2: c1 f3 breq .-16 ; 0x336b4 <__mulsf3+0x20> 336c4: 95 0f add r25, r21 336c6: 50 e0 ldi r21, 0x00 ; 0 336c8: 55 1f adc r21, r21 336ca: 62 9f mul r22, r18 336cc: f0 01 movw r30, r0 336ce: 72 9f mul r23, r18 336d0: bb 27 eor r27, r27 336d2: f0 0d add r31, r0 336d4: b1 1d adc r27, r1 336d6: 63 9f mul r22, r19 336d8: aa 27 eor r26, r26 336da: f0 0d add r31, r0 336dc: b1 1d adc r27, r1 336de: aa 1f adc r26, r26 336e0: 64 9f mul r22, r20 336e2: 66 27 eor r22, r22 336e4: b0 0d add r27, r0 336e6: a1 1d adc r26, r1 336e8: 66 1f adc r22, r22 336ea: 82 9f mul r24, r18 336ec: 22 27 eor r18, r18 336ee: b0 0d add r27, r0 336f0: a1 1d adc r26, r1 336f2: 62 1f adc r22, r18 336f4: 73 9f mul r23, r19 336f6: b0 0d add r27, r0 336f8: a1 1d adc r26, r1 336fa: 62 1f adc r22, r18 336fc: 83 9f mul r24, r19 336fe: a0 0d add r26, r0 33700: 61 1d adc r22, r1 33702: 22 1f adc r18, r18 33704: 74 9f mul r23, r20 33706: 33 27 eor r19, r19 33708: a0 0d add r26, r0 3370a: 61 1d adc r22, r1 3370c: 23 1f adc r18, r19 3370e: 84 9f mul r24, r20 33710: 60 0d add r22, r0 33712: 21 1d adc r18, r1 33714: 82 2f mov r24, r18 33716: 76 2f mov r23, r22 33718: 6a 2f mov r22, r26 3371a: 11 24 eor r1, r1 3371c: 9f 57 subi r25, 0x7F ; 127 3371e: 50 40 sbci r21, 0x00 ; 0 33720: 9a f0 brmi .+38 ; 0x33748 <__mulsf3_pse+0x88> 33722: f1 f0 breq .+60 ; 0x33760 <__mulsf3_pse+0xa0> 33724: 88 23 and r24, r24 33726: 4a f0 brmi .+18 ; 0x3373a <__mulsf3_pse+0x7a> 33728: ee 0f add r30, r30 3372a: ff 1f adc r31, r31 3372c: bb 1f adc r27, r27 3372e: 66 1f adc r22, r22 33730: 77 1f adc r23, r23 33732: 88 1f adc r24, r24 33734: 91 50 subi r25, 0x01 ; 1 33736: 50 40 sbci r21, 0x00 ; 0 33738: a9 f7 brne .-22 ; 0x33724 <__mulsf3_pse+0x64> 3373a: 9e 3f cpi r25, 0xFE ; 254 3373c: 51 05 cpc r21, r1 3373e: 80 f0 brcs .+32 ; 0x33760 <__mulsf3_pse+0xa0> 33740: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 33744: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 33748: 5f 3f cpi r21, 0xFF ; 255 3374a: e4 f3 brlt .-8 ; 0x33744 <__mulsf3_pse+0x84> 3374c: 98 3e cpi r25, 0xE8 ; 232 3374e: d4 f3 brlt .-12 ; 0x33744 <__mulsf3_pse+0x84> 33750: 86 95 lsr r24 33752: 77 95 ror r23 33754: 67 95 ror r22 33756: b7 95 ror r27 33758: f7 95 ror r31 3375a: e7 95 ror r30 3375c: 9f 5f subi r25, 0xFF ; 255 3375e: c1 f7 brne .-16 ; 0x33750 <__mulsf3_pse+0x90> 33760: fe 2b or r31, r30 33762: 88 0f add r24, r24 33764: 91 1d adc r25, r1 33766: 96 95 lsr r25 33768: 87 95 ror r24 3376a: 97 f9 bld r25, 7 3376c: 08 95 ret 0003376e <__fp_inf>: 3376e: 97 f9 bld r25, 7 33770: 9f 67 ori r25, 0x7F ; 127 33772: 80 e8 ldi r24, 0x80 ; 128 33774: 70 e0 ldi r23, 0x00 ; 0 33776: 60 e0 ldi r22, 0x00 ; 0 33778: 08 95 ret 0003377a <__fp_nan>: 3377a: 9f ef ldi r25, 0xFF ; 255 3377c: 80 ec ldi r24, 0xC0 ; 192 3377e: 08 95 ret 00033780 <__fp_pscA>: 33780: 00 24 eor r0, r0 33782: 0a 94 dec r0 33784: 16 16 cp r1, r22 33786: 17 06 cpc r1, r23 33788: 18 06 cpc r1, r24 3378a: 09 06 cpc r0, r25 3378c: 08 95 ret 0003378e <__fp_pscB>: 3378e: 00 24 eor r0, r0 33790: 0a 94 dec r0 33792: 12 16 cp r1, r18 33794: 13 06 cpc r1, r19 33796: 14 06 cpc r1, r20 33798: 05 06 cpc r0, r21 3379a: 08 95 ret 0003379c <__fp_round>: 3379c: 09 2e mov r0, r25 3379e: 03 94 inc r0 337a0: 00 0c add r0, r0 337a2: 11 f4 brne .+4 ; 0x337a8 <__fp_round+0xc> 337a4: 88 23 and r24, r24 337a6: 52 f0 brmi .+20 ; 0x337bc <__fp_round+0x20> 337a8: bb 0f add r27, r27 337aa: 40 f4 brcc .+16 ; 0x337bc <__fp_round+0x20> 337ac: bf 2b or r27, r31 337ae: 11 f4 brne .+4 ; 0x337b4 <__fp_round+0x18> 337b0: 60 ff sbrs r22, 0 337b2: 04 c0 rjmp .+8 ; 0x337bc <__fp_round+0x20> 337b4: 6f 5f subi r22, 0xFF ; 255 337b6: 7f 4f sbci r23, 0xFF ; 255 337b8: 8f 4f sbci r24, 0xFF ; 255 337ba: 9f 4f sbci r25, 0xFF ; 255 337bc: 08 95 ret 000337be <__fp_split3>: 337be: 57 fd sbrc r21, 7 337c0: 90 58 subi r25, 0x80 ; 128 337c2: 44 0f add r20, r20 337c4: 55 1f adc r21, r21 337c6: 59 f0 breq .+22 ; 0x337de <__fp_splitA+0x10> 337c8: 5f 3f cpi r21, 0xFF ; 255 337ca: 71 f0 breq .+28 ; 0x337e8 <__fp_splitA+0x1a> 337cc: 47 95 ror r20 000337ce <__fp_splitA>: 337ce: 88 0f add r24, r24 337d0: 97 fb bst r25, 7 337d2: 99 1f adc r25, r25 337d4: 61 f0 breq .+24 ; 0x337ee <__fp_splitA+0x20> 337d6: 9f 3f cpi r25, 0xFF ; 255 337d8: 79 f0 breq .+30 ; 0x337f8 <__fp_splitA+0x2a> 337da: 87 95 ror r24 337dc: 08 95 ret 337de: 12 16 cp r1, r18 337e0: 13 06 cpc r1, r19 337e2: 14 06 cpc r1, r20 337e4: 55 1f adc r21, r21 337e6: f2 cf rjmp .-28 ; 0x337cc <__fp_split3+0xe> 337e8: 46 95 lsr r20 337ea: f1 df rcall .-30 ; 0x337ce <__fp_splitA> 337ec: 08 c0 rjmp .+16 ; 0x337fe <__fp_splitA+0x30> 337ee: 16 16 cp r1, r22 337f0: 17 06 cpc r1, r23 337f2: 18 06 cpc r1, r24 337f4: 99 1f adc r25, r25 337f6: f1 cf rjmp .-30 ; 0x337da <__fp_splitA+0xc> 337f8: 86 95 lsr r24 337fa: 71 05 cpc r23, r1 337fc: 61 05 cpc r22, r1 337fe: 08 94 sec 33800: 08 95 ret 00033802 <__fp_zero>: 33802: e8 94 clt 00033804 <__fp_szero>: 33804: bb 27 eor r27, r27 33806: 66 27 eor r22, r22 33808: 77 27 eor r23, r23 3380a: cb 01 movw r24, r22 3380c: 97 f9 bld r25, 7 3380e: 08 95 ret 00033810 : 33810: 3f 92 push r3 33812: 4f 92 push r4 33814: 5f 92 push r5 33816: 6f 92 push r6 33818: 7f 92 push r7 3381a: 8f 92 push r8 3381c: 9f 92 push r9 3381e: af 92 push r10 33820: bf 92 push r11 33822: cf 92 push r12 33824: df 92 push r13 33826: ef 92 push r14 33828: ff 92 push r15 3382a: 0f 93 push r16 3382c: 1f 93 push r17 3382e: cf 93 push r28 33830: df 93 push r29 33832: 5c 01 movw r10, r24 33834: 6b 01 movw r12, r22 33836: 7a 01 movw r14, r20 33838: 61 15 cp r22, r1 3383a: 71 05 cpc r23, r1 3383c: 19 f0 breq .+6 ; 0x33844 3383e: fb 01 movw r30, r22 33840: 91 83 std Z+1, r25 ; 0x01 33842: 80 83 st Z, r24 33844: e1 14 cp r14, r1 33846: f1 04 cpc r15, r1 33848: 51 f0 breq .+20 ; 0x3385e 3384a: c7 01 movw r24, r14 3384c: 02 97 sbiw r24, 0x02 ; 2 3384e: 83 97 sbiw r24, 0x23 ; 35 33850: 30 f0 brcs .+12 ; 0x3385e 33852: 40 e0 ldi r20, 0x00 ; 0 33854: 30 e0 ldi r19, 0x00 ; 0 33856: 20 e0 ldi r18, 0x00 ; 0 33858: 90 e0 ldi r25, 0x00 ; 0 3385a: 6b c0 rjmp .+214 ; 0x33932 3385c: 5e 01 movw r10, r28 3385e: e5 01 movw r28, r10 33860: 21 96 adiw r28, 0x01 ; 1 33862: f5 01 movw r30, r10 33864: 10 81 ld r17, Z 33866: 81 2f mov r24, r17 33868: 90 e0 ldi r25, 0x00 ; 0 3386a: 0f 94 0e 9e call 0x33c1c ; 0x33c1c 3386e: 89 2b or r24, r25 33870: a9 f7 brne .-22 ; 0x3385c 33872: 1d 32 cpi r17, 0x2D ; 45 33874: 01 f5 brne .+64 ; 0x338b6 33876: 21 96 adiw r28, 0x01 ; 1 33878: f5 01 movw r30, r10 3387a: 11 81 ldd r17, Z+1 ; 0x01 3387c: 01 e0 ldi r16, 0x01 ; 1 3387e: e1 14 cp r14, r1 33880: f1 04 cpc r15, r1 33882: 09 f4 brne .+2 ; 0x33886 33884: e6 c0 rjmp .+460 ; 0x33a52 33886: f0 e1 ldi r31, 0x10 ; 16 33888: ef 16 cp r14, r31 3388a: f1 04 cpc r15, r1 3388c: 09 f0 breq .+2 ; 0x33890 3388e: 88 c0 rjmp .+272 ; 0x339a0 33890: 10 33 cpi r17, 0x30 ; 48 33892: 59 f4 brne .+22 ; 0x338aa 33894: 88 81 ld r24, Y 33896: 8f 7d andi r24, 0xDF ; 223 33898: 88 35 cpi r24, 0x58 ; 88 3389a: 09 f0 breq .+2 ; 0x3389e 3389c: 7c c0 rjmp .+248 ; 0x33996 3389e: 19 81 ldd r17, Y+1 ; 0x01 338a0: 22 96 adiw r28, 0x02 ; 2 338a2: 02 60 ori r16, 0x02 ; 2 338a4: f0 e1 ldi r31, 0x10 ; 16 338a6: ef 2e mov r14, r31 338a8: f1 2c mov r15, r1 338aa: 81 2c mov r8, r1 338ac: 91 2c mov r9, r1 338ae: a1 2c mov r10, r1 338b0: 88 e0 ldi r24, 0x08 ; 8 338b2: b8 2e mov r11, r24 338b4: 92 c0 rjmp .+292 ; 0x339da 338b6: 1b 32 cpi r17, 0x2B ; 43 338b8: 21 f4 brne .+8 ; 0x338c2 338ba: e5 01 movw r28, r10 338bc: 22 96 adiw r28, 0x02 ; 2 338be: f5 01 movw r30, r10 338c0: 11 81 ldd r17, Z+1 ; 0x01 338c2: 00 e0 ldi r16, 0x00 ; 0 338c4: dc cf rjmp .-72 ; 0x3387e 338c6: ea e0 ldi r30, 0x0A ; 10 338c8: ee 16 cp r14, r30 338ca: f1 04 cpc r15, r1 338cc: 09 f4 brne .+2 ; 0x338d0 338ce: c7 c0 rjmp .+398 ; 0x33a5e 338d0: f0 e1 ldi r31, 0x10 ; 16 338d2: ef 16 cp r14, r31 338d4: f1 04 cpc r15, r1 338d6: 09 f0 breq .+2 ; 0x338da 338d8: 73 c0 rjmp .+230 ; 0x339c0 338da: e7 cf rjmp .-50 ; 0x338aa 338dc: 78 e0 ldi r23, 0x08 ; 8 338de: e7 2e mov r14, r23 338e0: f1 2c mov r15, r1 338e2: 81 2c mov r8, r1 338e4: 91 2c mov r9, r1 338e6: a1 2c mov r10, r1 338e8: 60 e1 ldi r22, 0x10 ; 16 338ea: b6 2e mov r11, r22 338ec: 76 c0 rjmp .+236 ; 0x339da 338ee: 21 e0 ldi r18, 0x01 ; 1 338f0: ad c0 rjmp .+346 ; 0x33a4c 338f2: 30 2f mov r19, r16 338f4: 31 70 andi r19, 0x01 ; 1 338f6: c1 14 cp r12, r1 338f8: d1 04 cpc r13, r1 338fa: 31 f0 breq .+12 ; 0x33908 338fc: 22 23 and r18, r18 338fe: 71 f1 breq .+92 ; 0x3395c 33900: 21 97 sbiw r28, 0x01 ; 1 33902: f6 01 movw r30, r12 33904: d1 83 std Z+1, r29 ; 0x01 33906: c0 83 st Z, r28 33908: 27 ff sbrs r18, 7 3390a: 2e c0 rjmp .+92 ; 0x33968 3390c: 60 e0 ldi r22, 0x00 ; 0 3390e: 70 e0 ldi r23, 0x00 ; 0 33910: 80 e0 ldi r24, 0x00 ; 0 33912: 90 e8 ldi r25, 0x80 ; 128 33914: 31 11 cpse r19, r1 33916: 04 c0 rjmp .+8 ; 0x33920 33918: 6f ef ldi r22, 0xFF ; 255 3391a: 7f ef ldi r23, 0xFF ; 255 3391c: 8f ef ldi r24, 0xFF ; 255 3391e: 9f e7 ldi r25, 0x7F ; 127 33920: 22 e2 ldi r18, 0x22 ; 34 33922: 30 e0 ldi r19, 0x00 ; 0 33924: 30 93 f9 16 sts 0x16F9, r19 ; 0x8016f9 33928: 20 93 f8 16 sts 0x16F8, r18 ; 0x8016f8 3392c: 46 2f mov r20, r22 3392e: 37 2f mov r19, r23 33930: 28 2f mov r18, r24 33932: 64 2f mov r22, r20 33934: 73 2f mov r23, r19 33936: 82 2f mov r24, r18 33938: df 91 pop r29 3393a: cf 91 pop r28 3393c: 1f 91 pop r17 3393e: 0f 91 pop r16 33940: ff 90 pop r15 33942: ef 90 pop r14 33944: df 90 pop r13 33946: cf 90 pop r12 33948: bf 90 pop r11 3394a: af 90 pop r10 3394c: 9f 90 pop r9 3394e: 8f 90 pop r8 33950: 7f 90 pop r7 33952: 6f 90 pop r6 33954: 5f 90 pop r5 33956: 4f 90 pop r4 33958: 3f 90 pop r3 3395a: 08 95 ret 3395c: 01 ff sbrs r16, 1 3395e: 04 c0 rjmp .+8 ; 0x33968 33960: 22 97 sbiw r28, 0x02 ; 2 33962: f6 01 movw r30, r12 33964: d1 83 std Z+1, r29 ; 0x01 33966: c0 83 st Z, r28 33968: 33 23 and r19, r19 3396a: 41 f0 breq .+16 ; 0x3397c 3396c: 90 95 com r25 3396e: 80 95 com r24 33970: 70 95 com r23 33972: 61 95 neg r22 33974: 7f 4f sbci r23, 0xFF ; 255 33976: 8f 4f sbci r24, 0xFF ; 255 33978: 9f 4f sbci r25, 0xFF ; 255 3397a: d8 cf rjmp .-80 ; 0x3392c 3397c: 97 ff sbrs r25, 7 3397e: d6 cf rjmp .-84 ; 0x3392c 33980: 82 e2 ldi r24, 0x22 ; 34 33982: 90 e0 ldi r25, 0x00 ; 0 33984: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 33988: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 3398c: 6f ef ldi r22, 0xFF ; 255 3398e: 7f ef ldi r23, 0xFF ; 255 33990: 8f ef ldi r24, 0xFF ; 255 33992: 9f e7 ldi r25, 0x7F ; 127 33994: cb cf rjmp .-106 ; 0x3392c 33996: 10 e3 ldi r17, 0x30 ; 48 33998: e1 14 cp r14, r1 3399a: f1 04 cpc r15, r1 3399c: 09 f4 brne .+2 ; 0x339a0 3399e: 9e cf rjmp .-196 ; 0x338dc 339a0: 28 e0 ldi r18, 0x08 ; 8 339a2: e2 16 cp r14, r18 339a4: f1 04 cpc r15, r1 339a6: 09 f4 brne .+2 ; 0x339aa 339a8: 9c cf rjmp .-200 ; 0x338e2 339aa: 0c f0 brlt .+2 ; 0x339ae 339ac: 8c cf rjmp .-232 ; 0x338c6 339ae: 81 2c mov r8, r1 339b0: 91 2c mov r9, r1 339b2: a1 2c mov r10, r1 339b4: e0 e4 ldi r30, 0x40 ; 64 339b6: be 2e mov r11, r30 339b8: 82 e0 ldi r24, 0x02 ; 2 339ba: e8 16 cp r14, r24 339bc: f1 04 cpc r15, r1 339be: 69 f0 breq .+26 ; 0x339da 339c0: 60 e0 ldi r22, 0x00 ; 0 339c2: 70 e0 ldi r23, 0x00 ; 0 339c4: 80 e0 ldi r24, 0x00 ; 0 339c6: 90 e8 ldi r25, 0x80 ; 128 339c8: 97 01 movw r18, r14 339ca: 0f 2c mov r0, r15 339cc: 00 0c add r0, r0 339ce: 44 0b sbc r20, r20 339d0: 55 0b sbc r21, r21 339d2: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 339d6: 49 01 movw r8, r18 339d8: 5a 01 movw r10, r20 339da: 20 e0 ldi r18, 0x00 ; 0 339dc: 60 e0 ldi r22, 0x00 ; 0 339de: 70 e0 ldi r23, 0x00 ; 0 339e0: cb 01 movw r24, r22 339e2: 27 01 movw r4, r14 339e4: 0f 2c mov r0, r15 339e6: 00 0c add r0, r0 339e8: 66 08 sbc r6, r6 339ea: 77 08 sbc r7, r7 339ec: fe 01 movw r30, r28 339ee: 50 ed ldi r21, 0xD0 ; 208 339f0: 35 2e mov r3, r21 339f2: 31 0e add r3, r17 339f4: 39 e0 ldi r19, 0x09 ; 9 339f6: 33 15 cp r19, r3 339f8: 70 f4 brcc .+28 ; 0x33a16 339fa: 3f eb ldi r19, 0xBF ; 191 339fc: 31 0f add r19, r17 339fe: 49 ec ldi r20, 0xC9 ; 201 33a00: 34 2e mov r3, r20 33a02: 3a 31 cpi r19, 0x1A ; 26 33a04: 38 f0 brcs .+14 ; 0x33a14 33a06: 3f e9 ldi r19, 0x9F ; 159 33a08: 31 0f add r19, r17 33a0a: 3a 31 cpi r19, 0x1A ; 26 33a0c: 08 f0 brcs .+2 ; 0x33a10 33a0e: 71 cf rjmp .-286 ; 0x338f2 33a10: 39 ea ldi r19, 0xA9 ; 169 33a12: 33 2e mov r3, r19 33a14: 31 0e add r3, r17 33a16: 3e 14 cp r3, r14 33a18: 1f 04 cpc r1, r15 33a1a: 0c f0 brlt .+2 ; 0x33a1e 33a1c: 6a cf rjmp .-300 ; 0x338f2 33a1e: 27 fd sbrc r18, 7 33a20: 15 c0 rjmp .+42 ; 0x33a4c 33a22: 86 16 cp r8, r22 33a24: 97 06 cpc r9, r23 33a26: a8 06 cpc r10, r24 33a28: b9 06 cpc r11, r25 33a2a: 78 f0 brcs .+30 ; 0x33a4a 33a2c: a3 01 movw r20, r6 33a2e: 92 01 movw r18, r4 33a30: 0f 94 e0 a0 call 0x341c0 ; 0x341c0 <__mulsi3> 33a34: 63 0d add r22, r3 33a36: 71 1d adc r23, r1 33a38: 81 1d adc r24, r1 33a3a: 91 1d adc r25, r1 33a3c: 61 30 cpi r22, 0x01 ; 1 33a3e: 71 05 cpc r23, r1 33a40: 81 05 cpc r24, r1 33a42: 20 e8 ldi r18, 0x80 ; 128 33a44: 92 07 cpc r25, r18 33a46: 08 f4 brcc .+2 ; 0x33a4a 33a48: 52 cf rjmp .-348 ; 0x338ee 33a4a: 2f ef ldi r18, 0xFF ; 255 33a4c: 21 96 adiw r28, 0x01 ; 1 33a4e: 10 81 ld r17, Z 33a50: cd cf rjmp .-102 ; 0x339ec 33a52: 10 33 cpi r17, 0x30 ; 48 33a54: 09 f4 brne .+2 ; 0x33a58 33a56: 1e cf rjmp .-452 ; 0x33894 33a58: 2a e0 ldi r18, 0x0A ; 10 33a5a: e2 2e mov r14, r18 33a5c: f1 2c mov r15, r1 33a5e: 9c ec ldi r25, 0xCC ; 204 33a60: 89 2e mov r8, r25 33a62: 98 2c mov r9, r8 33a64: a8 2c mov r10, r8 33a66: 9c e0 ldi r25, 0x0C ; 12 33a68: b9 2e mov r11, r25 33a6a: b7 cf rjmp .-146 ; 0x339da 00033a6c <__ftoa_engine>: 33a6c: 28 30 cpi r18, 0x08 ; 8 33a6e: 08 f0 brcs .+2 ; 0x33a72 <__ftoa_engine+0x6> 33a70: 27 e0 ldi r18, 0x07 ; 7 33a72: 33 27 eor r19, r19 33a74: da 01 movw r26, r20 33a76: 99 0f add r25, r25 33a78: 31 1d adc r19, r1 33a7a: 87 fd sbrc r24, 7 33a7c: 91 60 ori r25, 0x01 ; 1 33a7e: 00 96 adiw r24, 0x00 ; 0 33a80: 61 05 cpc r22, r1 33a82: 71 05 cpc r23, r1 33a84: 39 f4 brne .+14 ; 0x33a94 <__ftoa_engine+0x28> 33a86: 32 60 ori r19, 0x02 ; 2 33a88: 2e 5f subi r18, 0xFE ; 254 33a8a: 3d 93 st X+, r19 33a8c: 30 e3 ldi r19, 0x30 ; 48 33a8e: 2a 95 dec r18 33a90: e1 f7 brne .-8 ; 0x33a8a <__ftoa_engine+0x1e> 33a92: 08 95 ret 33a94: 9f 3f cpi r25, 0xFF ; 255 33a96: 30 f0 brcs .+12 ; 0x33aa4 <__ftoa_engine+0x38> 33a98: 80 38 cpi r24, 0x80 ; 128 33a9a: 71 05 cpc r23, r1 33a9c: 61 05 cpc r22, r1 33a9e: 09 f0 breq .+2 ; 0x33aa2 <__ftoa_engine+0x36> 33aa0: 3c 5f subi r19, 0xFC ; 252 33aa2: 3c 5f subi r19, 0xFC ; 252 33aa4: 3d 93 st X+, r19 33aa6: 91 30 cpi r25, 0x01 ; 1 33aa8: 08 f0 brcs .+2 ; 0x33aac <__ftoa_engine+0x40> 33aaa: 80 68 ori r24, 0x80 ; 128 33aac: 91 1d adc r25, r1 33aae: df 93 push r29 33ab0: cf 93 push r28 33ab2: 1f 93 push r17 33ab4: 0f 93 push r16 33ab6: ff 92 push r15 33ab8: ef 92 push r14 33aba: 19 2f mov r17, r25 33abc: 98 7f andi r25, 0xF8 ; 248 33abe: 96 95 lsr r25 33ac0: e9 2f mov r30, r25 33ac2: 96 95 lsr r25 33ac4: 96 95 lsr r25 33ac6: e9 0f add r30, r25 33ac8: ff 27 eor r31, r31 33aca: e0 5b subi r30, 0xB0 ; 176 33acc: fd 48 sbci r31, 0x8D ; 141 33ace: 99 27 eor r25, r25 33ad0: 33 27 eor r19, r19 33ad2: ee 24 eor r14, r14 33ad4: ff 24 eor r15, r15 33ad6: a7 01 movw r20, r14 33ad8: e7 01 movw r28, r14 33ada: 05 90 lpm r0, Z+ 33adc: 08 94 sec 33ade: 07 94 ror r0 33ae0: 28 f4 brcc .+10 ; 0x33aec <__ftoa_engine+0x80> 33ae2: 36 0f add r19, r22 33ae4: e7 1e adc r14, r23 33ae6: f8 1e adc r15, r24 33ae8: 49 1f adc r20, r25 33aea: 51 1d adc r21, r1 33aec: 66 0f add r22, r22 33aee: 77 1f adc r23, r23 33af0: 88 1f adc r24, r24 33af2: 99 1f adc r25, r25 33af4: 06 94 lsr r0 33af6: a1 f7 brne .-24 ; 0x33ae0 <__ftoa_engine+0x74> 33af8: 05 90 lpm r0, Z+ 33afa: 07 94 ror r0 33afc: 28 f4 brcc .+10 ; 0x33b08 <__ftoa_engine+0x9c> 33afe: e7 0e add r14, r23 33b00: f8 1e adc r15, r24 33b02: 49 1f adc r20, r25 33b04: 56 1f adc r21, r22 33b06: c1 1d adc r28, r1 33b08: 77 0f add r23, r23 33b0a: 88 1f adc r24, r24 33b0c: 99 1f adc r25, r25 33b0e: 66 1f adc r22, r22 33b10: 06 94 lsr r0 33b12: a1 f7 brne .-24 ; 0x33afc <__ftoa_engine+0x90> 33b14: 05 90 lpm r0, Z+ 33b16: 07 94 ror r0 33b18: 28 f4 brcc .+10 ; 0x33b24 <__ftoa_engine+0xb8> 33b1a: f8 0e add r15, r24 33b1c: 49 1f adc r20, r25 33b1e: 56 1f adc r21, r22 33b20: c7 1f adc r28, r23 33b22: d1 1d adc r29, r1 33b24: 88 0f add r24, r24 33b26: 99 1f adc r25, r25 33b28: 66 1f adc r22, r22 33b2a: 77 1f adc r23, r23 33b2c: 06 94 lsr r0 33b2e: a1 f7 brne .-24 ; 0x33b18 <__ftoa_engine+0xac> 33b30: 05 90 lpm r0, Z+ 33b32: 07 94 ror r0 33b34: 20 f4 brcc .+8 ; 0x33b3e <__ftoa_engine+0xd2> 33b36: 49 0f add r20, r25 33b38: 56 1f adc r21, r22 33b3a: c7 1f adc r28, r23 33b3c: d8 1f adc r29, r24 33b3e: 99 0f add r25, r25 33b40: 66 1f adc r22, r22 33b42: 77 1f adc r23, r23 33b44: 88 1f adc r24, r24 33b46: 06 94 lsr r0 33b48: a9 f7 brne .-22 ; 0x33b34 <__ftoa_engine+0xc8> 33b4a: 84 91 lpm r24, Z 33b4c: 10 95 com r17 33b4e: 17 70 andi r17, 0x07 ; 7 33b50: 41 f0 breq .+16 ; 0x33b62 <__ftoa_engine+0xf6> 33b52: d6 95 lsr r29 33b54: c7 95 ror r28 33b56: 57 95 ror r21 33b58: 47 95 ror r20 33b5a: f7 94 ror r15 33b5c: e7 94 ror r14 33b5e: 1a 95 dec r17 33b60: c1 f7 brne .-16 ; 0x33b52 <__ftoa_engine+0xe6> 33b62: e6 ef ldi r30, 0xF6 ; 246 33b64: f1 e7 ldi r31, 0x71 ; 113 33b66: 68 94 set 33b68: 15 90 lpm r1, Z+ 33b6a: 15 91 lpm r17, Z+ 33b6c: 35 91 lpm r19, Z+ 33b6e: 65 91 lpm r22, Z+ 33b70: 95 91 lpm r25, Z+ 33b72: 05 90 lpm r0, Z+ 33b74: 7f e2 ldi r23, 0x2F ; 47 33b76: 73 95 inc r23 33b78: e1 18 sub r14, r1 33b7a: f1 0a sbc r15, r17 33b7c: 43 0b sbc r20, r19 33b7e: 56 0b sbc r21, r22 33b80: c9 0b sbc r28, r25 33b82: d0 09 sbc r29, r0 33b84: c0 f7 brcc .-16 ; 0x33b76 <__ftoa_engine+0x10a> 33b86: e1 0c add r14, r1 33b88: f1 1e adc r15, r17 33b8a: 43 1f adc r20, r19 33b8c: 56 1f adc r21, r22 33b8e: c9 1f adc r28, r25 33b90: d0 1d adc r29, r0 33b92: 7e f4 brtc .+30 ; 0x33bb2 <__ftoa_engine+0x146> 33b94: 70 33 cpi r23, 0x30 ; 48 33b96: 11 f4 brne .+4 ; 0x33b9c <__ftoa_engine+0x130> 33b98: 8a 95 dec r24 33b9a: e6 cf rjmp .-52 ; 0x33b68 <__ftoa_engine+0xfc> 33b9c: e8 94 clt 33b9e: 01 50 subi r16, 0x01 ; 1 33ba0: 30 f0 brcs .+12 ; 0x33bae <__ftoa_engine+0x142> 33ba2: 08 0f add r16, r24 33ba4: 0a f4 brpl .+2 ; 0x33ba8 <__ftoa_engine+0x13c> 33ba6: 00 27 eor r16, r16 33ba8: 02 17 cp r16, r18 33baa: 08 f4 brcc .+2 ; 0x33bae <__ftoa_engine+0x142> 33bac: 20 2f mov r18, r16 33bae: 23 95 inc r18 33bb0: 02 2f mov r16, r18 33bb2: 7a 33 cpi r23, 0x3A ; 58 33bb4: 28 f0 brcs .+10 ; 0x33bc0 <__ftoa_engine+0x154> 33bb6: 79 e3 ldi r23, 0x39 ; 57 33bb8: 7d 93 st X+, r23 33bba: 2a 95 dec r18 33bbc: e9 f7 brne .-6 ; 0x33bb8 <__ftoa_engine+0x14c> 33bbe: 10 c0 rjmp .+32 ; 0x33be0 <__ftoa_engine+0x174> 33bc0: 7d 93 st X+, r23 33bc2: 2a 95 dec r18 33bc4: 89 f6 brne .-94 ; 0x33b68 <__ftoa_engine+0xfc> 33bc6: 06 94 lsr r0 33bc8: 97 95 ror r25 33bca: 67 95 ror r22 33bcc: 37 95 ror r19 33bce: 17 95 ror r17 33bd0: 17 94 ror r1 33bd2: e1 18 sub r14, r1 33bd4: f1 0a sbc r15, r17 33bd6: 43 0b sbc r20, r19 33bd8: 56 0b sbc r21, r22 33bda: c9 0b sbc r28, r25 33bdc: d0 09 sbc r29, r0 33bde: 98 f0 brcs .+38 ; 0x33c06 <__ftoa_engine+0x19a> 33be0: 23 95 inc r18 33be2: 7e 91 ld r23, -X 33be4: 73 95 inc r23 33be6: 7a 33 cpi r23, 0x3A ; 58 33be8: 08 f0 brcs .+2 ; 0x33bec <__ftoa_engine+0x180> 33bea: 70 e3 ldi r23, 0x30 ; 48 33bec: 7c 93 st X, r23 33bee: 20 13 cpse r18, r16 33bf0: b8 f7 brcc .-18 ; 0x33be0 <__ftoa_engine+0x174> 33bf2: 7e 91 ld r23, -X 33bf4: 70 61 ori r23, 0x10 ; 16 33bf6: 7d 93 st X+, r23 33bf8: 30 f0 brcs .+12 ; 0x33c06 <__ftoa_engine+0x19a> 33bfa: 83 95 inc r24 33bfc: 71 e3 ldi r23, 0x31 ; 49 33bfe: 7d 93 st X+, r23 33c00: 70 e3 ldi r23, 0x30 ; 48 33c02: 2a 95 dec r18 33c04: e1 f7 brne .-8 ; 0x33bfe <__ftoa_engine+0x192> 33c06: 11 24 eor r1, r1 33c08: ef 90 pop r14 33c0a: ff 90 pop r15 33c0c: 0f 91 pop r16 33c0e: 1f 91 pop r17 33c10: cf 91 pop r28 33c12: df 91 pop r29 33c14: 99 27 eor r25, r25 33c16: 87 fd sbrc r24, 7 33c18: 90 95 com r25 33c1a: 08 95 ret 00033c1c : 33c1c: 91 11 cpse r25, r1 33c1e: 0d 94 6a a0 jmp 0x340d4 ; 0x340d4 <__ctype_isfalse> 33c22: 80 32 cpi r24, 0x20 ; 32 33c24: 19 f0 breq .+6 ; 0x33c2c 33c26: 89 50 subi r24, 0x09 ; 9 33c28: 85 50 subi r24, 0x05 ; 5 33c2a: c8 f7 brcc .-14 ; 0x33c1e 33c2c: 08 95 ret 00033c2e : 33c2e: fb 01 movw r30, r22 33c30: dc 01 movw r26, r24 33c32: 02 c0 rjmp .+4 ; 0x33c38 33c34: 05 90 lpm r0, Z+ 33c36: 0d 92 st X+, r0 33c38: 41 50 subi r20, 0x01 ; 1 33c3a: 50 40 sbci r21, 0x00 ; 0 33c3c: d8 f7 brcc .-10 ; 0x33c34 33c3e: 08 95 ret 00033c40 : 33c40: fb 01 movw r30, r22 33c42: dc 01 movw r26, r24 33c44: 0d 90 ld r0, X+ 33c46: 00 20 and r0, r0 33c48: e9 f7 brne .-6 ; 0x33c44 33c4a: 11 97 sbiw r26, 0x01 ; 1 33c4c: 05 90 lpm r0, Z+ 33c4e: 0d 92 st X+, r0 33c50: 00 20 and r0, r0 33c52: e1 f7 brne .-8 ; 0x33c4c 33c54: 08 95 ret 00033c56 : 33c56: fb 01 movw r30, r22 33c58: dc 01 movw r26, r24 33c5a: 8d 91 ld r24, X+ 33c5c: 05 90 lpm r0, Z+ 33c5e: 80 19 sub r24, r0 33c60: 01 10 cpse r0, r1 33c62: d9 f3 breq .-10 ; 0x33c5a 33c64: 99 0b sbc r25, r25 33c66: 08 95 ret 00033c68 : 33c68: fb 01 movw r30, r22 33c6a: dc 01 movw r26, r24 33c6c: 05 90 lpm r0, Z+ 33c6e: 0d 92 st X+, r0 33c70: 00 20 and r0, r0 33c72: e1 f7 brne .-8 ; 0x33c6c 33c74: 08 95 ret 00033c76 <__strlen_P>: 33c76: fc 01 movw r30, r24 33c78: 05 90 lpm r0, Z+ 33c7a: 00 20 and r0, r0 33c7c: e9 f7 brne .-6 ; 0x33c78 <__strlen_P+0x2> 33c7e: 80 95 com r24 33c80: 90 95 com r25 33c82: 8e 0f add r24, r30 33c84: 9f 1f adc r25, r31 33c86: 08 95 ret 00033c88 : 33c88: fb 01 movw r30, r22 33c8a: dc 01 movw r26, r24 33c8c: 41 50 subi r20, 0x01 ; 1 33c8e: 50 40 sbci r21, 0x00 ; 0 33c90: 88 f0 brcs .+34 ; 0x33cb4 33c92: 8d 91 ld r24, X+ 33c94: 81 34 cpi r24, 0x41 ; 65 33c96: 1c f0 brlt .+6 ; 0x33c9e 33c98: 8b 35 cpi r24, 0x5B ; 91 33c9a: 0c f4 brge .+2 ; 0x33c9e 33c9c: 80 5e subi r24, 0xE0 ; 224 33c9e: 65 91 lpm r22, Z+ 33ca0: 61 34 cpi r22, 0x41 ; 65 33ca2: 1c f0 brlt .+6 ; 0x33caa 33ca4: 6b 35 cpi r22, 0x5B ; 91 33ca6: 0c f4 brge .+2 ; 0x33caa 33ca8: 60 5e subi r22, 0xE0 ; 224 33caa: 86 1b sub r24, r22 33cac: 61 11 cpse r22, r1 33cae: 71 f3 breq .-36 ; 0x33c8c 33cb0: 99 0b sbc r25, r25 33cb2: 08 95 ret 33cb4: 88 1b sub r24, r24 33cb6: fc cf rjmp .-8 ; 0x33cb0 00033cb8 : 33cb8: fb 01 movw r30, r22 33cba: dc 01 movw r26, r24 33cbc: 41 50 subi r20, 0x01 ; 1 33cbe: 50 40 sbci r21, 0x00 ; 0 33cc0: 30 f0 brcs .+12 ; 0x33cce 33cc2: 8d 91 ld r24, X+ 33cc4: 05 90 lpm r0, Z+ 33cc6: 80 19 sub r24, r0 33cc8: 19 f4 brne .+6 ; 0x33cd0 33cca: 00 20 and r0, r0 33ccc: b9 f7 brne .-18 ; 0x33cbc 33cce: 88 1b sub r24, r24 33cd0: 99 0b sbc r25, r25 33cd2: 08 95 ret 00033cd4 : 33cd4: fb 01 movw r30, r22 33cd6: dc 01 movw r26, r24 33cd8: 41 50 subi r20, 0x01 ; 1 33cda: 50 40 sbci r21, 0x00 ; 0 33cdc: 48 f0 brcs .+18 ; 0x33cf0 33cde: 05 90 lpm r0, Z+ 33ce0: 0d 92 st X+, r0 33ce2: 00 20 and r0, r0 33ce4: c9 f7 brne .-14 ; 0x33cd8 33ce6: 01 c0 rjmp .+2 ; 0x33cea 33ce8: 1d 92 st X+, r1 33cea: 41 50 subi r20, 0x01 ; 1 33cec: 50 40 sbci r21, 0x00 ; 0 33cee: e0 f7 brcc .-8 ; 0x33ce8 33cf0: 08 95 ret 00033cf2 : 33cf2: fc 01 movw r30, r24 33cf4: 05 90 lpm r0, Z+ 33cf6: 61 50 subi r22, 0x01 ; 1 33cf8: 70 40 sbci r23, 0x00 ; 0 33cfa: 01 10 cpse r0, r1 33cfc: d8 f7 brcc .-10 ; 0x33cf4 33cfe: 80 95 com r24 33d00: 90 95 com r25 33d02: 8e 0f add r24, r30 33d04: 9f 1f adc r25, r31 33d06: 08 95 ret 00033d08 : 33d08: fb 01 movw r30, r22 33d0a: 55 91 lpm r21, Z+ 33d0c: 55 23 and r21, r21 33d0e: a9 f0 breq .+42 ; 0x33d3a 33d10: bf 01 movw r22, r30 33d12: dc 01 movw r26, r24 33d14: 4d 91 ld r20, X+ 33d16: 45 17 cp r20, r21 33d18: 41 11 cpse r20, r1 33d1a: e1 f7 brne .-8 ; 0x33d14 33d1c: 59 f4 brne .+22 ; 0x33d34 33d1e: cd 01 movw r24, r26 33d20: 05 90 lpm r0, Z+ 33d22: 00 20 and r0, r0 33d24: 49 f0 breq .+18 ; 0x33d38 33d26: 4d 91 ld r20, X+ 33d28: 40 15 cp r20, r0 33d2a: 41 11 cpse r20, r1 33d2c: c9 f3 breq .-14 ; 0x33d20 33d2e: fb 01 movw r30, r22 33d30: 41 11 cpse r20, r1 33d32: ef cf rjmp .-34 ; 0x33d12 33d34: 81 e0 ldi r24, 0x01 ; 1 33d36: 90 e0 ldi r25, 0x00 ; 0 33d38: 01 97 sbiw r24, 0x01 ; 1 33d3a: 08 95 ret 00033d3c : 33d3c: fc 01 movw r30, r24 33d3e: 61 50 subi r22, 0x01 ; 1 33d40: 70 40 sbci r23, 0x00 ; 0 33d42: 01 90 ld r0, Z+ 33d44: 01 10 cpse r0, r1 33d46: d8 f7 brcc .-10 ; 0x33d3e 33d48: 80 95 com r24 33d4a: 90 95 com r25 33d4c: 8e 0f add r24, r30 33d4e: 9f 1f adc r25, r31 33d50: 08 95 ret 00033d52 : 33d52: cf 93 push r28 33d54: df 93 push r29 33d56: ec 01 movw r28, r24 33d58: 2b 81 ldd r18, Y+3 ; 0x03 33d5a: 20 ff sbrs r18, 0 33d5c: 1a c0 rjmp .+52 ; 0x33d92 33d5e: 26 ff sbrs r18, 6 33d60: 0c c0 rjmp .+24 ; 0x33d7a 33d62: 2f 7b andi r18, 0xBF ; 191 33d64: 2b 83 std Y+3, r18 ; 0x03 33d66: 8e 81 ldd r24, Y+6 ; 0x06 33d68: 9f 81 ldd r25, Y+7 ; 0x07 33d6a: 01 96 adiw r24, 0x01 ; 1 33d6c: 9f 83 std Y+7, r25 ; 0x07 33d6e: 8e 83 std Y+6, r24 ; 0x06 33d70: 8a 81 ldd r24, Y+2 ; 0x02 33d72: 90 e0 ldi r25, 0x00 ; 0 33d74: df 91 pop r29 33d76: cf 91 pop r28 33d78: 08 95 ret 33d7a: 22 ff sbrs r18, 2 33d7c: 18 c0 rjmp .+48 ; 0x33dae 33d7e: e8 81 ld r30, Y 33d80: f9 81 ldd r31, Y+1 ; 0x01 33d82: 80 81 ld r24, Z 33d84: 08 2e mov r0, r24 33d86: 00 0c add r0, r0 33d88: 99 0b sbc r25, r25 33d8a: 00 97 sbiw r24, 0x00 ; 0 33d8c: 29 f4 brne .+10 ; 0x33d98 33d8e: 20 62 ori r18, 0x20 ; 32 33d90: 2b 83 std Y+3, r18 ; 0x03 33d92: 8f ef ldi r24, 0xFF ; 255 33d94: 9f ef ldi r25, 0xFF ; 255 33d96: ee cf rjmp .-36 ; 0x33d74 33d98: 31 96 adiw r30, 0x01 ; 1 33d9a: f9 83 std Y+1, r31 ; 0x01 33d9c: e8 83 st Y, r30 33d9e: 2e 81 ldd r18, Y+6 ; 0x06 33da0: 3f 81 ldd r19, Y+7 ; 0x07 33da2: 2f 5f subi r18, 0xFF ; 255 33da4: 3f 4f sbci r19, 0xFF ; 255 33da6: 3f 83 std Y+7, r19 ; 0x07 33da8: 2e 83 std Y+6, r18 ; 0x06 33daa: 99 27 eor r25, r25 33dac: e3 cf rjmp .-58 ; 0x33d74 33dae: ea 85 ldd r30, Y+10 ; 0x0a 33db0: fb 85 ldd r31, Y+11 ; 0x0b 33db2: 19 95 eicall 33db4: 97 ff sbrs r25, 7 33db6: f3 cf rjmp .-26 ; 0x33d9e 33db8: 2b 81 ldd r18, Y+3 ; 0x03 33dba: 01 96 adiw r24, 0x01 ; 1 33dbc: 21 f0 breq .+8 ; 0x33dc6 33dbe: 80 e2 ldi r24, 0x20 ; 32 33dc0: 82 2b or r24, r18 33dc2: 8b 83 std Y+3, r24 ; 0x03 33dc4: e6 cf rjmp .-52 ; 0x33d92 33dc6: 80 e1 ldi r24, 0x10 ; 16 33dc8: fb cf rjmp .-10 ; 0x33dc0 00033dca : 33dca: 0f 93 push r16 33dcc: 1f 93 push r17 33dce: cf 93 push r28 33dd0: df 93 push r29 33dd2: 18 2f mov r17, r24 33dd4: 09 2f mov r16, r25 33dd6: eb 01 movw r28, r22 33dd8: 8b 81 ldd r24, Y+3 ; 0x03 33dda: 81 fd sbrc r24, 1 33ddc: 09 c0 rjmp .+18 ; 0x33df0 33dde: 1f ef ldi r17, 0xFF ; 255 33de0: 0f ef ldi r16, 0xFF ; 255 33de2: 81 2f mov r24, r17 33de4: 90 2f mov r25, r16 33de6: df 91 pop r29 33de8: cf 91 pop r28 33dea: 1f 91 pop r17 33dec: 0f 91 pop r16 33dee: 08 95 ret 33df0: 82 ff sbrs r24, 2 33df2: 14 c0 rjmp .+40 ; 0x33e1c 33df4: 2e 81 ldd r18, Y+6 ; 0x06 33df6: 3f 81 ldd r19, Y+7 ; 0x07 33df8: 8c 81 ldd r24, Y+4 ; 0x04 33dfa: 9d 81 ldd r25, Y+5 ; 0x05 33dfc: 28 17 cp r18, r24 33dfe: 39 07 cpc r19, r25 33e00: 3c f4 brge .+14 ; 0x33e10 33e02: e8 81 ld r30, Y 33e04: f9 81 ldd r31, Y+1 ; 0x01 33e06: cf 01 movw r24, r30 33e08: 01 96 adiw r24, 0x01 ; 1 33e0a: 99 83 std Y+1, r25 ; 0x01 33e0c: 88 83 st Y, r24 33e0e: 10 83 st Z, r17 33e10: 8e 81 ldd r24, Y+6 ; 0x06 33e12: 9f 81 ldd r25, Y+7 ; 0x07 33e14: 01 96 adiw r24, 0x01 ; 1 33e16: 9f 83 std Y+7, r25 ; 0x07 33e18: 8e 83 std Y+6, r24 ; 0x06 33e1a: e3 cf rjmp .-58 ; 0x33de2 33e1c: e8 85 ldd r30, Y+8 ; 0x08 33e1e: f9 85 ldd r31, Y+9 ; 0x09 33e20: 81 2f mov r24, r17 33e22: 19 95 eicall 33e24: 89 2b or r24, r25 33e26: a1 f3 breq .-24 ; 0x33e10 33e28: da cf rjmp .-76 ; 0x33dde 00033e2a : 33e2a: ef 92 push r14 33e2c: ff 92 push r15 33e2e: 0f 93 push r16 33e30: 1f 93 push r17 33e32: cf 93 push r28 33e34: df 93 push r29 33e36: 8c 01 movw r16, r24 33e38: 7b 01 movw r14, r22 33e3a: db 01 movw r26, r22 33e3c: 13 96 adiw r26, 0x03 ; 3 33e3e: 8c 91 ld r24, X 33e40: d0 e0 ldi r29, 0x00 ; 0 33e42: c0 e0 ldi r28, 0x00 ; 0 33e44: 81 fd sbrc r24, 1 33e46: 0f c0 rjmp .+30 ; 0x33e66 33e48: cf ef ldi r28, 0xFF ; 255 33e4a: df ef ldi r29, 0xFF ; 255 33e4c: 10 c0 rjmp .+32 ; 0x33e6e 33e4e: d7 01 movw r26, r14 33e50: 18 96 adiw r26, 0x08 ; 8 33e52: ed 91 ld r30, X+ 33e54: fc 91 ld r31, X 33e56: b7 01 movw r22, r14 33e58: 19 95 eicall 33e5a: 89 2b or r24, r25 33e5c: 11 f0 breq .+4 ; 0x33e62 33e5e: cf ef ldi r28, 0xFF ; 255 33e60: df ef ldi r29, 0xFF ; 255 33e62: 0f 5f subi r16, 0xFF ; 255 33e64: 1f 4f sbci r17, 0xFF ; 255 33e66: f8 01 movw r30, r16 33e68: 84 91 lpm r24, Z 33e6a: 81 11 cpse r24, r1 33e6c: f0 cf rjmp .-32 ; 0x33e4e 33e6e: ce 01 movw r24, r28 33e70: df 91 pop r29 33e72: cf 91 pop r28 33e74: 1f 91 pop r17 33e76: 0f 91 pop r16 33e78: ff 90 pop r15 33e7a: ef 90 pop r14 33e7c: 08 95 ret 00033e7e : 33e7e: 0f 93 push r16 33e80: 1f 93 push r17 33e82: cf 93 push r28 33e84: df 93 push r29 33e86: cd b7 in r28, 0x3d ; 61 33e88: de b7 in r29, 0x3e ; 62 33e8a: ae 01 movw r20, r28 33e8c: 48 5f subi r20, 0xF8 ; 248 33e8e: 5f 4f sbci r21, 0xFF ; 255 33e90: da 01 movw r26, r20 33e92: 6d 91 ld r22, X+ 33e94: 7d 91 ld r23, X+ 33e96: ad 01 movw r20, r26 33e98: 0e ef ldi r16, 0xFE ; 254 33e9a: 16 e1 ldi r17, 0x16 ; 22 33e9c: f8 01 movw r30, r16 33e9e: 82 81 ldd r24, Z+2 ; 0x02 33ea0: 93 81 ldd r25, Z+3 ; 0x03 33ea2: dc 01 movw r26, r24 33ea4: 13 96 adiw r26, 0x03 ; 3 33ea6: 2c 91 ld r18, X 33ea8: 13 97 sbiw r26, 0x03 ; 3 33eaa: 28 60 ori r18, 0x08 ; 8 33eac: 13 96 adiw r26, 0x03 ; 3 33eae: 2c 93 st X, r18 33eb0: 0e 94 76 51 call 0xa2ec ; 0xa2ec 33eb4: d8 01 movw r26, r16 33eb6: 12 96 adiw r26, 0x02 ; 2 33eb8: ed 91 ld r30, X+ 33eba: fc 91 ld r31, X 33ebc: 23 81 ldd r18, Z+3 ; 0x03 33ebe: 27 7f andi r18, 0xF7 ; 247 33ec0: 23 83 std Z+3, r18 ; 0x03 33ec2: df 91 pop r29 33ec4: cf 91 pop r28 33ec6: 1f 91 pop r17 33ec8: 0f 91 pop r16 33eca: 08 95 ret 00033ecc : 33ecc: 0f 93 push r16 33ece: 1f 93 push r17 33ed0: cf 93 push r28 33ed2: df 93 push r29 33ed4: 8c 01 movw r16, r24 33ed6: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 33eda: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 33ede: 83 81 ldd r24, Z+3 ; 0x03 33ee0: d0 e0 ldi r29, 0x00 ; 0 33ee2: c0 e0 ldi r28, 0x00 ; 0 33ee4: 81 fd sbrc r24, 1 33ee6: 0a c0 rjmp .+20 ; 0x33efc 33ee8: cf ef ldi r28, 0xFF ; 255 33eea: df ef ldi r29, 0xFF ; 255 33eec: 17 c0 rjmp .+46 ; 0x33f1c 33eee: 19 95 eicall 33ef0: 89 2b or r24, r25 33ef2: 11 f0 breq .+4 ; 0x33ef8 33ef4: cf ef ldi r28, 0xFF ; 255 33ef6: df ef ldi r29, 0xFF ; 255 33ef8: 0f 5f subi r16, 0xFF ; 255 33efa: 1f 4f sbci r17, 0xFF ; 255 33efc: f8 01 movw r30, r16 33efe: 84 91 lpm r24, Z 33f00: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 33f04: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 33f08: db 01 movw r26, r22 33f0a: 18 96 adiw r26, 0x08 ; 8 33f0c: ed 91 ld r30, X+ 33f0e: fc 91 ld r31, X 33f10: 81 11 cpse r24, r1 33f12: ed cf rjmp .-38 ; 0x33eee 33f14: 8a e0 ldi r24, 0x0A ; 10 33f16: 19 95 eicall 33f18: 89 2b or r24, r25 33f1a: 31 f7 brne .-52 ; 0x33ee8 33f1c: ce 01 movw r24, r28 33f1e: df 91 pop r29 33f20: cf 91 pop r28 33f22: 1f 91 pop r17 33f24: 0f 91 pop r16 33f26: 08 95 ret 00033f28 : 33f28: 0f 93 push r16 33f2a: 1f 93 push r17 33f2c: cf 93 push r28 33f2e: df 93 push r29 33f30: cd b7 in r28, 0x3d ; 61 33f32: de b7 in r29, 0x3e ; 62 33f34: 2e 97 sbiw r28, 0x0e ; 14 33f36: 0f b6 in r0, 0x3f ; 63 33f38: f8 94 cli 33f3a: de bf out 0x3e, r29 ; 62 33f3c: 0f be out 0x3f, r0 ; 63 33f3e: cd bf out 0x3d, r28 ; 61 33f40: 0e 89 ldd r16, Y+22 ; 0x16 33f42: 1f 89 ldd r17, Y+23 ; 0x17 33f44: 8e e0 ldi r24, 0x0E ; 14 33f46: 8c 83 std Y+4, r24 ; 0x04 33f48: 1a 83 std Y+2, r17 ; 0x02 33f4a: 09 83 std Y+1, r16 ; 0x01 33f4c: 8f ef ldi r24, 0xFF ; 255 33f4e: 9f e7 ldi r25, 0x7F ; 127 33f50: 9e 83 std Y+6, r25 ; 0x06 33f52: 8d 83 std Y+5, r24 ; 0x05 33f54: ae 01 movw r20, r28 33f56: 46 5e subi r20, 0xE6 ; 230 33f58: 5f 4f sbci r21, 0xFF ; 255 33f5a: 68 8d ldd r22, Y+24 ; 0x18 33f5c: 79 8d ldd r23, Y+25 ; 0x19 33f5e: ce 01 movw r24, r28 33f60: 01 96 adiw r24, 0x01 ; 1 33f62: 0e 94 76 51 call 0xa2ec ; 0xa2ec 33f66: 2f 81 ldd r18, Y+7 ; 0x07 33f68: 38 85 ldd r19, Y+8 ; 0x08 33f6a: 02 0f add r16, r18 33f6c: 13 1f adc r17, r19 33f6e: f8 01 movw r30, r16 33f70: 10 82 st Z, r1 33f72: 2e 96 adiw r28, 0x0e ; 14 33f74: 0f b6 in r0, 0x3f ; 63 33f76: f8 94 cli 33f78: de bf out 0x3e, r29 ; 62 33f7a: 0f be out 0x3f, r0 ; 63 33f7c: cd bf out 0x3d, r28 ; 61 33f7e: df 91 pop r29 33f80: cf 91 pop r28 33f82: 1f 91 pop r17 33f84: 0f 91 pop r16 33f86: 08 95 ret 00033f88 : 33f88: cf 93 push r28 33f8a: df 93 push r29 33f8c: ec 01 movw r28, r24 33f8e: 8b 81 ldd r24, Y+3 ; 0x03 33f90: 88 60 ori r24, 0x08 ; 8 33f92: 8b 83 std Y+3, r24 ; 0x03 33f94: ce 01 movw r24, r28 33f96: 0e 94 76 51 call 0xa2ec ; 0xa2ec 33f9a: 2b 81 ldd r18, Y+3 ; 0x03 33f9c: 27 7f andi r18, 0xF7 ; 247 33f9e: 2b 83 std Y+3, r18 ; 0x03 33fa0: df 91 pop r29 33fa2: cf 91 pop r28 33fa4: 08 95 ret 00033fa6 : 33fa6: 0f 93 push r16 33fa8: 1f 93 push r17 33faa: cf 93 push r28 33fac: df 93 push r29 33fae: cd b7 in r28, 0x3d ; 61 33fb0: de b7 in r29, 0x3e ; 62 33fb2: 2e 97 sbiw r28, 0x0e ; 14 33fb4: 0f b6 in r0, 0x3f ; 63 33fb6: f8 94 cli 33fb8: de bf out 0x3e, r29 ; 62 33fba: 0f be out 0x3f, r0 ; 63 33fbc: cd bf out 0x3d, r28 ; 61 33fbe: 8c 01 movw r16, r24 33fc0: fa 01 movw r30, r20 33fc2: 8e e0 ldi r24, 0x0E ; 14 33fc4: 8c 83 std Y+4, r24 ; 0x04 33fc6: 1a 83 std Y+2, r17 ; 0x02 33fc8: 09 83 std Y+1, r16 ; 0x01 33fca: 77 ff sbrs r23, 7 33fcc: 02 c0 rjmp .+4 ; 0x33fd2 33fce: 60 e0 ldi r22, 0x00 ; 0 33fd0: 70 e8 ldi r23, 0x80 ; 128 33fd2: 61 50 subi r22, 0x01 ; 1 33fd4: 71 09 sbc r23, r1 33fd6: 7e 83 std Y+6, r23 ; 0x06 33fd8: 6d 83 std Y+5, r22 ; 0x05 33fda: a9 01 movw r20, r18 33fdc: bf 01 movw r22, r30 33fde: ce 01 movw r24, r28 33fe0: 01 96 adiw r24, 0x01 ; 1 33fe2: 0e 94 76 51 call 0xa2ec ; 0xa2ec 33fe6: 4d 81 ldd r20, Y+5 ; 0x05 33fe8: 5e 81 ldd r21, Y+6 ; 0x06 33fea: 57 fd sbrc r21, 7 33fec: 0a c0 rjmp .+20 ; 0x34002 33fee: 2f 81 ldd r18, Y+7 ; 0x07 33ff0: 38 85 ldd r19, Y+8 ; 0x08 33ff2: 42 17 cp r20, r18 33ff4: 53 07 cpc r21, r19 33ff6: 0c f4 brge .+2 ; 0x33ffa 33ff8: 9a 01 movw r18, r20 33ffa: 02 0f add r16, r18 33ffc: 13 1f adc r17, r19 33ffe: f8 01 movw r30, r16 34000: 10 82 st Z, r1 34002: 2e 96 adiw r28, 0x0e ; 14 34004: 0f b6 in r0, 0x3f ; 63 34006: f8 94 cli 34008: de bf out 0x3e, r29 ; 62 3400a: 0f be out 0x3f, r0 ; 63 3400c: cd bf out 0x3d, r28 ; 61 3400e: df 91 pop r29 34010: cf 91 pop r28 34012: 1f 91 pop r17 34014: 0f 91 pop r16 34016: 08 95 ret 00034018 <__ultoa_invert>: 34018: fa 01 movw r30, r20 3401a: aa 27 eor r26, r26 3401c: 28 30 cpi r18, 0x08 ; 8 3401e: 51 f1 breq .+84 ; 0x34074 <__ultoa_invert+0x5c> 34020: 20 31 cpi r18, 0x10 ; 16 34022: 81 f1 breq .+96 ; 0x34084 <__ultoa_invert+0x6c> 34024: e8 94 clt 34026: 6f 93 push r22 34028: 6e 7f andi r22, 0xFE ; 254 3402a: 6e 5f subi r22, 0xFE ; 254 3402c: 7f 4f sbci r23, 0xFF ; 255 3402e: 8f 4f sbci r24, 0xFF ; 255 34030: 9f 4f sbci r25, 0xFF ; 255 34032: af 4f sbci r26, 0xFF ; 255 34034: b1 e0 ldi r27, 0x01 ; 1 34036: 3e d0 rcall .+124 ; 0x340b4 <__ultoa_invert+0x9c> 34038: b4 e0 ldi r27, 0x04 ; 4 3403a: 3c d0 rcall .+120 ; 0x340b4 <__ultoa_invert+0x9c> 3403c: 67 0f add r22, r23 3403e: 78 1f adc r23, r24 34040: 89 1f adc r24, r25 34042: 9a 1f adc r25, r26 34044: a1 1d adc r26, r1 34046: 68 0f add r22, r24 34048: 79 1f adc r23, r25 3404a: 8a 1f adc r24, r26 3404c: 91 1d adc r25, r1 3404e: a1 1d adc r26, r1 34050: 6a 0f add r22, r26 34052: 71 1d adc r23, r1 34054: 81 1d adc r24, r1 34056: 91 1d adc r25, r1 34058: a1 1d adc r26, r1 3405a: 20 d0 rcall .+64 ; 0x3409c <__ultoa_invert+0x84> 3405c: 09 f4 brne .+2 ; 0x34060 <__ultoa_invert+0x48> 3405e: 68 94 set 34060: 3f 91 pop r19 34062: 2a e0 ldi r18, 0x0A ; 10 34064: 26 9f mul r18, r22 34066: 11 24 eor r1, r1 34068: 30 19 sub r19, r0 3406a: 30 5d subi r19, 0xD0 ; 208 3406c: 31 93 st Z+, r19 3406e: de f6 brtc .-74 ; 0x34026 <__ultoa_invert+0xe> 34070: cf 01 movw r24, r30 34072: 08 95 ret 34074: 46 2f mov r20, r22 34076: 47 70 andi r20, 0x07 ; 7 34078: 40 5d subi r20, 0xD0 ; 208 3407a: 41 93 st Z+, r20 3407c: b3 e0 ldi r27, 0x03 ; 3 3407e: 0f d0 rcall .+30 ; 0x3409e <__ultoa_invert+0x86> 34080: c9 f7 brne .-14 ; 0x34074 <__ultoa_invert+0x5c> 34082: f6 cf rjmp .-20 ; 0x34070 <__ultoa_invert+0x58> 34084: 46 2f mov r20, r22 34086: 4f 70 andi r20, 0x0F ; 15 34088: 40 5d subi r20, 0xD0 ; 208 3408a: 4a 33 cpi r20, 0x3A ; 58 3408c: 18 f0 brcs .+6 ; 0x34094 <__ultoa_invert+0x7c> 3408e: 49 5d subi r20, 0xD9 ; 217 34090: 31 fd sbrc r19, 1 34092: 40 52 subi r20, 0x20 ; 32 34094: 41 93 st Z+, r20 34096: 02 d0 rcall .+4 ; 0x3409c <__ultoa_invert+0x84> 34098: a9 f7 brne .-22 ; 0x34084 <__ultoa_invert+0x6c> 3409a: ea cf rjmp .-44 ; 0x34070 <__ultoa_invert+0x58> 3409c: b4 e0 ldi r27, 0x04 ; 4 3409e: a6 95 lsr r26 340a0: 97 95 ror r25 340a2: 87 95 ror r24 340a4: 77 95 ror r23 340a6: 67 95 ror r22 340a8: ba 95 dec r27 340aa: c9 f7 brne .-14 ; 0x3409e <__ultoa_invert+0x86> 340ac: 00 97 sbiw r24, 0x00 ; 0 340ae: 61 05 cpc r22, r1 340b0: 71 05 cpc r23, r1 340b2: 08 95 ret 340b4: 9b 01 movw r18, r22 340b6: ac 01 movw r20, r24 340b8: 0a 2e mov r0, r26 340ba: 06 94 lsr r0 340bc: 57 95 ror r21 340be: 47 95 ror r20 340c0: 37 95 ror r19 340c2: 27 95 ror r18 340c4: ba 95 dec r27 340c6: c9 f7 brne .-14 ; 0x340ba <__ultoa_invert+0xa2> 340c8: 62 0f add r22, r18 340ca: 73 1f adc r23, r19 340cc: 84 1f adc r24, r20 340ce: 95 1f adc r25, r21 340d0: a0 1d adc r26, r0 340d2: 08 95 ret 000340d4 <__ctype_isfalse>: 340d4: 99 27 eor r25, r25 340d6: 88 27 eor r24, r24 000340d8 <__ctype_istrue>: 340d8: 08 95 ret 000340da : 340da: dc 01 movw r26, r24 340dc: cb 01 movw r24, r22 000340de : 340de: fc 01 movw r30, r24 340e0: f9 99 sbic 0x1f, 1 ; 31 340e2: fe cf rjmp .-4 ; 0x340e0 340e4: 06 c0 rjmp .+12 ; 0x340f2 340e6: f2 bd out 0x22, r31 ; 34 340e8: e1 bd out 0x21, r30 ; 33 340ea: f8 9a sbi 0x1f, 0 ; 31 340ec: 31 96 adiw r30, 0x01 ; 1 340ee: 00 b4 in r0, 0x20 ; 32 340f0: 0d 92 st X+, r0 340f2: 41 50 subi r20, 0x01 ; 1 340f4: 50 40 sbci r21, 0x00 ; 0 340f6: b8 f7 brcc .-18 ; 0x340e6 340f8: 08 95 ret 000340fa : 340fa: f9 99 sbic 0x1f, 1 ; 31 340fc: fe cf rjmp .-4 ; 0x340fa 340fe: 92 bd out 0x22, r25 ; 34 34100: 81 bd out 0x21, r24 ; 33 34102: f8 9a sbi 0x1f, 0 ; 31 34104: 99 27 eor r25, r25 34106: 80 b5 in r24, 0x20 ; 32 34108: 08 95 ret 0003410a : 3410a: a6 e1 ldi r26, 0x16 ; 22 3410c: b0 e0 ldi r27, 0x00 ; 0 3410e: 44 e0 ldi r20, 0x04 ; 4 34110: 50 e0 ldi r21, 0x00 ; 0 34112: 0d 94 6f a0 jmp 0x340de ; 0x340de 00034116 : 34116: a8 e1 ldi r26, 0x18 ; 24 34118: b0 e0 ldi r27, 0x00 ; 0 3411a: 42 e0 ldi r20, 0x02 ; 2 3411c: 50 e0 ldi r21, 0x00 ; 0 3411e: 0d 94 6f a0 jmp 0x340de ; 0x340de 00034122 : 34122: dc 01 movw r26, r24 34124: a4 0f add r26, r20 34126: b5 1f adc r27, r21 34128: 41 50 subi r20, 0x01 ; 1 3412a: 50 40 sbci r21, 0x00 ; 0 3412c: 48 f0 brcs .+18 ; 0x34140 3412e: cb 01 movw r24, r22 34130: 84 0f add r24, r20 34132: 95 1f adc r25, r21 34134: 2e 91 ld r18, -X 34136: 0f 94 a2 a0 call 0x34144 ; 0x34144 3413a: 41 50 subi r20, 0x01 ; 1 3413c: 50 40 sbci r21, 0x00 ; 0 3413e: d0 f7 brcc .-12 ; 0x34134 34140: 08 95 ret 00034142 : 34142: 26 2f mov r18, r22 00034144 : 34144: f9 99 sbic 0x1f, 1 ; 31 34146: fe cf rjmp .-4 ; 0x34144 34148: 92 bd out 0x22, r25 ; 34 3414a: 81 bd out 0x21, r24 ; 33 3414c: f8 9a sbi 0x1f, 0 ; 31 3414e: 01 97 sbiw r24, 0x01 ; 1 34150: 00 b4 in r0, 0x20 ; 32 34152: 02 16 cp r0, r18 34154: 39 f0 breq .+14 ; 0x34164 34156: 1f ba out 0x1f, r1 ; 31 34158: 20 bd out 0x20, r18 ; 32 3415a: 0f b6 in r0, 0x3f ; 63 3415c: f8 94 cli 3415e: fa 9a sbi 0x1f, 2 ; 31 34160: f9 9a sbi 0x1f, 1 ; 31 34162: 0f be out 0x3f, r0 ; 63 34164: 08 95 ret 00034166 : 34166: 03 96 adiw r24, 0x03 ; 3 34168: 27 2f mov r18, r23 3416a: 0f 94 a2 a0 call 0x34144 ; 0x34144 3416e: 0f 94 a1 a0 call 0x34142 ; 0x34142 34172: 25 2f mov r18, r21 34174: 0f 94 a2 a0 call 0x34144 ; 0x34144 34178: 24 2f mov r18, r20 3417a: 0d 94 a2 a0 jmp 0x34144 ; 0x34144 0003417e : 3417e: 01 96 adiw r24, 0x01 ; 1 34180: 27 2f mov r18, r23 34182: 0f 94 a2 a0 call 0x34144 ; 0x34144 34186: 0d 94 a1 a0 jmp 0x34142 ; 0x34142 0003418a : 3418a: 26 2f mov r18, r22 0003418c : 3418c: f9 99 sbic 0x1f, 1 ; 31 3418e: fe cf rjmp .-4 ; 0x3418c 34190: 1f ba out 0x1f, r1 ; 31 34192: 92 bd out 0x22, r25 ; 34 34194: 81 bd out 0x21, r24 ; 33 34196: 20 bd out 0x20, r18 ; 32 34198: 0f b6 in r0, 0x3f ; 63 3419a: f8 94 cli 3419c: fa 9a sbi 0x1f, 2 ; 31 3419e: f9 9a sbi 0x1f, 1 ; 31 341a0: 0f be out 0x3f, r0 ; 63 341a2: 01 96 adiw r24, 0x01 ; 1 341a4: 08 95 ret 000341a6 : 341a6: 24 2f mov r18, r20 341a8: 0f 94 c6 a0 call 0x3418c ; 0x3418c 341ac: 25 2f mov r18, r21 341ae: 0f 94 c6 a0 call 0x3418c ; 0x3418c 341b2: 0d 94 db a0 jmp 0x341b6 ; 0x341b6 000341b6 : 341b6: 0f 94 c5 a0 call 0x3418a ; 0x3418a 341ba: 27 2f mov r18, r23 341bc: 0d 94 c6 a0 jmp 0x3418c ; 0x3418c 000341c0 <__mulsi3>: 341c0: db 01 movw r26, r22 341c2: 8f 93 push r24 341c4: 9f 93 push r25 341c6: 0f 94 12 a1 call 0x34224 ; 0x34224 <__muluhisi3> 341ca: bf 91 pop r27 341cc: af 91 pop r26 341ce: a2 9f mul r26, r18 341d0: 80 0d add r24, r0 341d2: 91 1d adc r25, r1 341d4: a3 9f mul r26, r19 341d6: 90 0d add r25, r0 341d8: b2 9f mul r27, r18 341da: 90 0d add r25, r0 341dc: 11 24 eor r1, r1 341de: 08 95 ret 000341e0 <__udivmodsi4>: 341e0: a1 e2 ldi r26, 0x21 ; 33 341e2: 1a 2e mov r1, r26 341e4: aa 1b sub r26, r26 341e6: bb 1b sub r27, r27 341e8: fd 01 movw r30, r26 341ea: 0d c0 rjmp .+26 ; 0x34206 <__udivmodsi4_ep> 000341ec <__udivmodsi4_loop>: 341ec: aa 1f adc r26, r26 341ee: bb 1f adc r27, r27 341f0: ee 1f adc r30, r30 341f2: ff 1f adc r31, r31 341f4: a2 17 cp r26, r18 341f6: b3 07 cpc r27, r19 341f8: e4 07 cpc r30, r20 341fa: f5 07 cpc r31, r21 341fc: 20 f0 brcs .+8 ; 0x34206 <__udivmodsi4_ep> 341fe: a2 1b sub r26, r18 34200: b3 0b sbc r27, r19 34202: e4 0b sbc r30, r20 34204: f5 0b sbc r31, r21 00034206 <__udivmodsi4_ep>: 34206: 66 1f adc r22, r22 34208: 77 1f adc r23, r23 3420a: 88 1f adc r24, r24 3420c: 99 1f adc r25, r25 3420e: 1a 94 dec r1 34210: 69 f7 brne .-38 ; 0x341ec <__udivmodsi4_loop> 34212: 60 95 com r22 34214: 70 95 com r23 34216: 80 95 com r24 34218: 90 95 com r25 3421a: 9b 01 movw r18, r22 3421c: ac 01 movw r20, r24 3421e: bd 01 movw r22, r26 34220: cf 01 movw r24, r30 34222: 08 95 ret 00034224 <__muluhisi3>: 34224: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 34228: a5 9f mul r26, r21 3422a: 90 0d add r25, r0 3422c: b4 9f mul r27, r20 3422e: 90 0d add r25, r0 34230: a4 9f mul r26, r20 34232: 80 0d add r24, r0 34234: 91 1d adc r25, r1 34236: 11 24 eor r1, r1 34238: 08 95 ret 0003423a <__umulhisi3>: 3423a: a2 9f mul r26, r18 3423c: b0 01 movw r22, r0 3423e: b3 9f mul r27, r19 34240: c0 01 movw r24, r0 34242: a3 9f mul r26, r19 34244: 70 0d add r23, r0 34246: 81 1d adc r24, r1 34248: 11 24 eor r1, r1 3424a: 91 1d adc r25, r1 3424c: b2 9f mul r27, r18 3424e: 70 0d add r23, r0 34250: 81 1d adc r24, r1 34252: 11 24 eor r1, r1 34254: 91 1d adc r25, r1 34256: 08 95 ret 00034258 <__udivmodqi4>: 34258: 99 1b sub r25, r25 3425a: 79 e0 ldi r23, 0x09 ; 9 3425c: 04 c0 rjmp .+8 ; 0x34266 <__udivmodqi4_ep> 0003425e <__udivmodqi4_loop>: 3425e: 99 1f adc r25, r25 34260: 96 17 cp r25, r22 34262: 08 f0 brcs .+2 ; 0x34266 <__udivmodqi4_ep> 34264: 96 1b sub r25, r22 00034266 <__udivmodqi4_ep>: 34266: 88 1f adc r24, r24 34268: 7a 95 dec r23 3426a: c9 f7 brne .-14 ; 0x3425e <__udivmodqi4_loop> 3426c: 80 95 com r24 3426e: 08 95 ret 00034270 <__divmodqi4>: 34270: 87 fb bst r24, 7 34272: 08 2e mov r0, r24 34274: 06 26 eor r0, r22 34276: 87 fd sbrc r24, 7 34278: 81 95 neg r24 3427a: 67 fd sbrc r22, 7 3427c: 61 95 neg r22 3427e: 0f 94 2c a1 call 0x34258 ; 0x34258 <__udivmodqi4> 34282: 0e f4 brtc .+2 ; 0x34286 <__divmodqi4_1> 34284: 91 95 neg r25 00034286 <__divmodqi4_1>: 34286: 07 fc sbrc r0, 7 34288: 81 95 neg r24 0003428a <__divmodqi4_exit>: 3428a: 08 95 ret 0003428c <__udivmodhi4>: 3428c: aa 1b sub r26, r26 3428e: bb 1b sub r27, r27 34290: 51 e1 ldi r21, 0x11 ; 17 34292: 07 c0 rjmp .+14 ; 0x342a2 <__udivmodhi4_ep> 00034294 <__udivmodhi4_loop>: 34294: aa 1f adc r26, r26 34296: bb 1f adc r27, r27 34298: a6 17 cp r26, r22 3429a: b7 07 cpc r27, r23 3429c: 10 f0 brcs .+4 ; 0x342a2 <__udivmodhi4_ep> 3429e: a6 1b sub r26, r22 342a0: b7 0b sbc r27, r23 000342a2 <__udivmodhi4_ep>: 342a2: 88 1f adc r24, r24 342a4: 99 1f adc r25, r25 342a6: 5a 95 dec r21 342a8: a9 f7 brne .-22 ; 0x34294 <__udivmodhi4_loop> 342aa: 80 95 com r24 342ac: 90 95 com r25 342ae: bc 01 movw r22, r24 342b0: cd 01 movw r24, r26 342b2: 08 95 ret 000342b4 <__divmodhi4>: 342b4: 97 fb bst r25, 7 342b6: 07 2e mov r0, r23 342b8: 16 f4 brtc .+4 ; 0x342be <__divmodhi4+0xa> 342ba: 00 94 com r0 342bc: 07 d0 rcall .+14 ; 0x342cc <__divmodhi4_neg1> 342be: 77 fd sbrc r23, 7 342c0: 09 d0 rcall .+18 ; 0x342d4 <__divmodhi4_neg2> 342c2: 0f 94 46 a1 call 0x3428c ; 0x3428c <__udivmodhi4> 342c6: 07 fc sbrc r0, 7 342c8: 05 d0 rcall .+10 ; 0x342d4 <__divmodhi4_neg2> 342ca: 3e f4 brtc .+14 ; 0x342da <__divmodhi4_exit> 000342cc <__divmodhi4_neg1>: 342cc: 90 95 com r25 342ce: 81 95 neg r24 342d0: 9f 4f sbci r25, 0xFF ; 255 342d2: 08 95 ret 000342d4 <__divmodhi4_neg2>: 342d4: 70 95 com r23 342d6: 61 95 neg r22 342d8: 7f 4f sbci r23, 0xFF ; 255 000342da <__divmodhi4_exit>: 342da: 08 95 ret 000342dc <__divmodsi4>: 342dc: 05 2e mov r0, r21 342de: 97 fb bst r25, 7 342e0: 1e f4 brtc .+6 ; 0x342e8 <__divmodsi4+0xc> 342e2: 00 94 com r0 342e4: 0f 94 85 a1 call 0x3430a ; 0x3430a <__negsi2> 342e8: 57 fd sbrc r21, 7 342ea: 07 d0 rcall .+14 ; 0x342fa <__divmodsi4_neg2> 342ec: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 <__udivmodsi4> 342f0: 07 fc sbrc r0, 7 342f2: 03 d0 rcall .+6 ; 0x342fa <__divmodsi4_neg2> 342f4: 4e f4 brtc .+18 ; 0x34308 <__divmodsi4_exit> 342f6: 0d 94 85 a1 jmp 0x3430a ; 0x3430a <__negsi2> 000342fa <__divmodsi4_neg2>: 342fa: 50 95 com r21 342fc: 40 95 com r20 342fe: 30 95 com r19 34300: 21 95 neg r18 34302: 3f 4f sbci r19, 0xFF ; 255 34304: 4f 4f sbci r20, 0xFF ; 255 34306: 5f 4f sbci r21, 0xFF ; 255 00034308 <__divmodsi4_exit>: 34308: 08 95 ret 0003430a <__negsi2>: 3430a: 90 95 com r25 3430c: 80 95 com r24 3430e: 70 95 com r23 34310: 61 95 neg r22 34312: 7f 4f sbci r23, 0xFF ; 255 34314: 8f 4f sbci r24, 0xFF ; 255 34316: 9f 4f sbci r25, 0xFF ; 255 34318: 08 95 ret 0003431a <__tablejump2__>: 3431a: ee 0f add r30, r30 3431c: ff 1f adc r31, r31 3431e: 88 1f adc r24, r24 34320: 8b bf out 0x3b, r24 ; 59 34322: 07 90 elpm r0, Z+ 34324: f6 91 elpm r31, Z 34326: e0 2d mov r30, r0 34328: 19 94 eijmp 0003432a <__mulhisi3>: 3432a: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 3432e: 33 23 and r19, r19 34330: 12 f4 brpl .+4 ; 0x34336 <__mulhisi3+0xc> 34332: 8a 1b sub r24, r26 34334: 9b 0b sbc r25, r27 34336: 0d 94 9f a1 jmp 0x3433e ; 0x3433e <__usmulhisi3_tail> 0003433a <__usmulhisi3>: 3433a: 0f 94 1d a1 call 0x3423a ; 0x3423a <__umulhisi3> 0003433e <__usmulhisi3_tail>: 3433e: b7 ff sbrs r27, 7 34340: 08 95 ret 34342: 82 1b sub r24, r18 34344: 93 0b sbc r25, r19 34346: 08 95 ret 00034348 <__subsf3>: 34348: 50 58 subi r21, 0x80 ; 128 0003434a <__addsf3>: 3434a: bb 27 eor r27, r27 3434c: aa 27 eor r26, r26 3434e: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34352: 0d 94 ce 9b jmp 0x3379c ; 0x3379c <__fp_round> 34356: 0f 94 c0 9b call 0x33780 ; 0x33780 <__fp_pscA> 3435a: 38 f0 brcs .+14 ; 0x3436a <__addsf3+0x20> 3435c: 0f 94 c7 9b call 0x3378e ; 0x3378e <__fp_pscB> 34360: 20 f0 brcs .+8 ; 0x3436a <__addsf3+0x20> 34362: 39 f4 brne .+14 ; 0x34372 <__addsf3+0x28> 34364: 9f 3f cpi r25, 0xFF ; 255 34366: 19 f4 brne .+6 ; 0x3436e <__addsf3+0x24> 34368: 26 f4 brtc .+8 ; 0x34372 <__addsf3+0x28> 3436a: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 3436e: 0e f4 brtc .+2 ; 0x34372 <__addsf3+0x28> 34370: e0 95 com r30 34372: e7 fb bst r30, 7 34374: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 00034378 <__addsf3x>: 34378: e9 2f mov r30, r25 3437a: 0f 94 df 9b call 0x337be ; 0x337be <__fp_split3> 3437e: 58 f3 brcs .-42 ; 0x34356 <__addsf3+0xc> 34380: ba 17 cp r27, r26 34382: 62 07 cpc r22, r18 34384: 73 07 cpc r23, r19 34386: 84 07 cpc r24, r20 34388: 95 07 cpc r25, r21 3438a: 20 f0 brcs .+8 ; 0x34394 <__addsf3x+0x1c> 3438c: 79 f4 brne .+30 ; 0x343ac <__addsf3x+0x34> 3438e: a6 f5 brtc .+104 ; 0x343f8 <__addsf3x+0x80> 34390: 0d 94 01 9c jmp 0x33802 ; 0x33802 <__fp_zero> 34394: 0e f4 brtc .+2 ; 0x34398 <__addsf3x+0x20> 34396: e0 95 com r30 34398: 0b 2e mov r0, r27 3439a: ba 2f mov r27, r26 3439c: a0 2d mov r26, r0 3439e: 0b 01 movw r0, r22 343a0: b9 01 movw r22, r18 343a2: 90 01 movw r18, r0 343a4: 0c 01 movw r0, r24 343a6: ca 01 movw r24, r20 343a8: a0 01 movw r20, r0 343aa: 11 24 eor r1, r1 343ac: ff 27 eor r31, r31 343ae: 59 1b sub r21, r25 343b0: 99 f0 breq .+38 ; 0x343d8 <__addsf3x+0x60> 343b2: 59 3f cpi r21, 0xF9 ; 249 343b4: 50 f4 brcc .+20 ; 0x343ca <__addsf3x+0x52> 343b6: 50 3e cpi r21, 0xE0 ; 224 343b8: 68 f1 brcs .+90 ; 0x34414 <__addsf3x+0x9c> 343ba: 1a 16 cp r1, r26 343bc: f0 40 sbci r31, 0x00 ; 0 343be: a2 2f mov r26, r18 343c0: 23 2f mov r18, r19 343c2: 34 2f mov r19, r20 343c4: 44 27 eor r20, r20 343c6: 58 5f subi r21, 0xF8 ; 248 343c8: f3 cf rjmp .-26 ; 0x343b0 <__addsf3x+0x38> 343ca: 46 95 lsr r20 343cc: 37 95 ror r19 343ce: 27 95 ror r18 343d0: a7 95 ror r26 343d2: f0 40 sbci r31, 0x00 ; 0 343d4: 53 95 inc r21 343d6: c9 f7 brne .-14 ; 0x343ca <__addsf3x+0x52> 343d8: 7e f4 brtc .+30 ; 0x343f8 <__addsf3x+0x80> 343da: 1f 16 cp r1, r31 343dc: ba 0b sbc r27, r26 343de: 62 0b sbc r22, r18 343e0: 73 0b sbc r23, r19 343e2: 84 0b sbc r24, r20 343e4: ba f0 brmi .+46 ; 0x34414 <__addsf3x+0x9c> 343e6: 91 50 subi r25, 0x01 ; 1 343e8: a1 f0 breq .+40 ; 0x34412 <__addsf3x+0x9a> 343ea: ff 0f add r31, r31 343ec: bb 1f adc r27, r27 343ee: 66 1f adc r22, r22 343f0: 77 1f adc r23, r23 343f2: 88 1f adc r24, r24 343f4: c2 f7 brpl .-16 ; 0x343e6 <__addsf3x+0x6e> 343f6: 0e c0 rjmp .+28 ; 0x34414 <__addsf3x+0x9c> 343f8: ba 0f add r27, r26 343fa: 62 1f adc r22, r18 343fc: 73 1f adc r23, r19 343fe: 84 1f adc r24, r20 34400: 48 f4 brcc .+18 ; 0x34414 <__addsf3x+0x9c> 34402: 87 95 ror r24 34404: 77 95 ror r23 34406: 67 95 ror r22 34408: b7 95 ror r27 3440a: f7 95 ror r31 3440c: 9e 3f cpi r25, 0xFE ; 254 3440e: 08 f0 brcs .+2 ; 0x34412 <__addsf3x+0x9a> 34410: b0 cf rjmp .-160 ; 0x34372 <__addsf3+0x28> 34412: 93 95 inc r25 34414: 88 0f add r24, r24 34416: 08 f0 brcs .+2 ; 0x3441a <__addsf3x+0xa2> 34418: 99 27 eor r25, r25 3441a: ee 0f add r30, r30 3441c: 97 95 ror r25 3441e: 87 95 ror r24 34420: 08 95 ret 34422: 0f 94 c0 9b call 0x33780 ; 0x33780 <__fp_pscA> 34426: 60 f0 brcs .+24 ; 0x34440 <__addsf3x+0xc8> 34428: 80 e8 ldi r24, 0x80 ; 128 3442a: 91 e0 ldi r25, 0x01 ; 1 3442c: 09 f4 brne .+2 ; 0x34430 <__addsf3x+0xb8> 3442e: 9e ef ldi r25, 0xFE ; 254 34430: 0f 94 c7 9b call 0x3378e ; 0x3378e <__fp_pscB> 34434: 28 f0 brcs .+10 ; 0x34440 <__addsf3x+0xc8> 34436: 40 e8 ldi r20, 0x80 ; 128 34438: 51 e0 ldi r21, 0x01 ; 1 3443a: 71 f4 brne .+28 ; 0x34458 3443c: 5e ef ldi r21, 0xFE ; 254 3443e: 0c c0 rjmp .+24 ; 0x34458 34440: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 34444: 0d 94 01 9c jmp 0x33802 ; 0x33802 <__fp_zero> 00034448 : 34448: e9 2f mov r30, r25 3444a: e0 78 andi r30, 0x80 ; 128 3444c: 0f 94 df 9b call 0x337be ; 0x337be <__fp_split3> 34450: 40 f3 brcs .-48 ; 0x34422 <__addsf3x+0xaa> 34452: 09 2e mov r0, r25 34454: 05 2a or r0, r21 34456: b1 f3 breq .-20 ; 0x34444 <__addsf3x+0xcc> 34458: 26 17 cp r18, r22 3445a: 37 07 cpc r19, r23 3445c: 48 07 cpc r20, r24 3445e: 59 07 cpc r21, r25 34460: 38 f0 brcs .+14 ; 0x34470 34462: 0e 2e mov r0, r30 34464: 07 f8 bld r0, 7 34466: e0 25 eor r30, r0 34468: 69 f0 breq .+26 ; 0x34484 3446a: e0 25 eor r30, r0 3446c: e0 64 ori r30, 0x40 ; 64 3446e: 0a c0 rjmp .+20 ; 0x34484 34470: ef 63 ori r30, 0x3F ; 63 34472: 07 f8 bld r0, 7 34474: 00 94 com r0 34476: 07 fa bst r0, 7 34478: db 01 movw r26, r22 3447a: b9 01 movw r22, r18 3447c: 9d 01 movw r18, r26 3447e: dc 01 movw r26, r24 34480: ca 01 movw r24, r20 34482: ad 01 movw r20, r26 34484: ef 93 push r30 34486: 0f 94 bb a2 call 0x34576 ; 0x34576 <__divsf3_pse> 3448a: 0f 94 ce 9b call 0x3379c ; 0x3379c <__fp_round> 3448e: 0f 94 54 a2 call 0x344a8 ; 0x344a8 34492: 5f 91 pop r21 34494: 55 23 and r21, r21 34496: 39 f0 breq .+14 ; 0x344a6 34498: 2b ed ldi r18, 0xDB ; 219 3449a: 3f e0 ldi r19, 0x0F ; 15 3449c: 49 e4 ldi r20, 0x49 ; 73 3449e: 50 fd sbrc r21, 0 344a0: 49 ec ldi r20, 0xC9 ; 201 344a2: 0d 94 a5 a1 jmp 0x3434a ; 0x3434a <__addsf3> 344a6: 08 95 ret 000344a8 : 344a8: df 93 push r29 344aa: dd 27 eor r29, r29 344ac: b9 2f mov r27, r25 344ae: bf 77 andi r27, 0x7F ; 127 344b0: 40 e8 ldi r20, 0x80 ; 128 344b2: 5f e3 ldi r21, 0x3F ; 63 344b4: 16 16 cp r1, r22 344b6: 17 06 cpc r1, r23 344b8: 48 07 cpc r20, r24 344ba: 5b 07 cpc r21, r27 344bc: 18 f4 brcc .+6 ; 0x344c4 344be: d9 2f mov r29, r25 344c0: 0f 94 a0 a4 call 0x34940 ; 0x34940 344c4: 9f 93 push r25 344c6: 8f 93 push r24 344c8: 7f 93 push r23 344ca: 6f 93 push r22 344cc: 0f 94 46 9b call 0x3368c ; 0x3368c 344d0: e8 e2 ldi r30, 0x28 ; 40 344d2: fd e6 ldi r31, 0x6D ; 109 344d4: 0f 94 b0 a3 call 0x34760 ; 0x34760 <__fp_powser> 344d8: 0f 94 ce 9b call 0x3379c ; 0x3379c <__fp_round> 344dc: 2f 91 pop r18 344de: 3f 91 pop r19 344e0: 4f 91 pop r20 344e2: 5f 91 pop r21 344e4: 0f 94 5d 9b call 0x336ba ; 0x336ba <__mulsf3x> 344e8: dd 23 and r29, r29 344ea: 51 f0 breq .+20 ; 0x34500 344ec: 90 58 subi r25, 0x80 ; 128 344ee: a2 ea ldi r26, 0xA2 ; 162 344f0: 2a ed ldi r18, 0xDA ; 218 344f2: 3f e0 ldi r19, 0x0F ; 15 344f4: 49 ec ldi r20, 0xC9 ; 201 344f6: 5f e3 ldi r21, 0x3F ; 63 344f8: d0 78 andi r29, 0x80 ; 128 344fa: 5d 27 eor r21, r29 344fc: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34500: df 91 pop r29 34502: 0d 94 ce 9b jmp 0x3379c ; 0x3379c <__fp_round> 00034506 : 34506: 0f 94 16 a4 call 0x3482c ; 0x3482c <__fp_trunc> 3450a: 90 f0 brcs .+36 ; 0x34530 3450c: 9f 37 cpi r25, 0x7F ; 127 3450e: 48 f4 brcc .+18 ; 0x34522 34510: 91 11 cpse r25, r1 34512: 16 f4 brtc .+4 ; 0x34518 34514: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 34518: 60 e0 ldi r22, 0x00 ; 0 3451a: 70 e0 ldi r23, 0x00 ; 0 3451c: 80 e8 ldi r24, 0x80 ; 128 3451e: 9f e3 ldi r25, 0x3F ; 63 34520: 08 95 ret 34522: 26 f0 brts .+8 ; 0x3452c 34524: 1b 16 cp r1, r27 34526: 61 1d adc r22, r1 34528: 71 1d adc r23, r1 3452a: 81 1d adc r24, r1 3452c: 0d 94 87 a3 jmp 0x3470e ; 0x3470e <__fp_mintl> 34530: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 00034534 <__cmpsf2>: 34534: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__fp_cmp> 34538: 08 f4 brcc .+2 ; 0x3453c <__cmpsf2+0x8> 3453a: 81 e0 ldi r24, 0x01 ; 1 3453c: 08 95 ret 0003453e : 3453e: 0f 94 d9 a3 call 0x347b2 ; 0x347b2 <__fp_rempio2> 34542: e3 95 inc r30 34544: 0d 94 02 a4 jmp 0x34804 ; 0x34804 <__fp_sinus> 00034548 <__divsf3>: 34548: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__divsf3x> 3454c: 0d 94 ce 9b jmp 0x3379c ; 0x3379c <__fp_round> 34550: 0f 94 c7 9b call 0x3378e ; 0x3378e <__fp_pscB> 34554: 58 f0 brcs .+22 ; 0x3456c <__divsf3+0x24> 34556: 0f 94 c0 9b call 0x33780 ; 0x33780 <__fp_pscA> 3455a: 40 f0 brcs .+16 ; 0x3456c <__divsf3+0x24> 3455c: 29 f4 brne .+10 ; 0x34568 <__divsf3+0x20> 3455e: 5f 3f cpi r21, 0xFF ; 255 34560: 29 f0 breq .+10 ; 0x3456c <__divsf3+0x24> 34562: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 34566: 51 11 cpse r21, r1 34568: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 3456c: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 00034570 <__divsf3x>: 34570: 0f 94 df 9b call 0x337be ; 0x337be <__fp_split3> 34574: 68 f3 brcs .-38 ; 0x34550 <__divsf3+0x8> 00034576 <__divsf3_pse>: 34576: 99 23 and r25, r25 34578: b1 f3 breq .-20 ; 0x34566 <__divsf3+0x1e> 3457a: 55 23 and r21, r21 3457c: 91 f3 breq .-28 ; 0x34562 <__divsf3+0x1a> 3457e: 95 1b sub r25, r21 34580: 55 0b sbc r21, r21 34582: bb 27 eor r27, r27 34584: aa 27 eor r26, r26 34586: 62 17 cp r22, r18 34588: 73 07 cpc r23, r19 3458a: 84 07 cpc r24, r20 3458c: 38 f0 brcs .+14 ; 0x3459c <__divsf3_pse+0x26> 3458e: 9f 5f subi r25, 0xFF ; 255 34590: 5f 4f sbci r21, 0xFF ; 255 34592: 22 0f add r18, r18 34594: 33 1f adc r19, r19 34596: 44 1f adc r20, r20 34598: aa 1f adc r26, r26 3459a: a9 f3 breq .-22 ; 0x34586 <__divsf3_pse+0x10> 3459c: 35 d0 rcall .+106 ; 0x34608 <__divsf3_pse+0x92> 3459e: 0e 2e mov r0, r30 345a0: 3a f0 brmi .+14 ; 0x345b0 <__divsf3_pse+0x3a> 345a2: e0 e8 ldi r30, 0x80 ; 128 345a4: 32 d0 rcall .+100 ; 0x3460a <__divsf3_pse+0x94> 345a6: 91 50 subi r25, 0x01 ; 1 345a8: 50 40 sbci r21, 0x00 ; 0 345aa: e6 95 lsr r30 345ac: 00 1c adc r0, r0 345ae: ca f7 brpl .-14 ; 0x345a2 <__divsf3_pse+0x2c> 345b0: 2b d0 rcall .+86 ; 0x34608 <__divsf3_pse+0x92> 345b2: fe 2f mov r31, r30 345b4: 29 d0 rcall .+82 ; 0x34608 <__divsf3_pse+0x92> 345b6: 66 0f add r22, r22 345b8: 77 1f adc r23, r23 345ba: 88 1f adc r24, r24 345bc: bb 1f adc r27, r27 345be: 26 17 cp r18, r22 345c0: 37 07 cpc r19, r23 345c2: 48 07 cpc r20, r24 345c4: ab 07 cpc r26, r27 345c6: b0 e8 ldi r27, 0x80 ; 128 345c8: 09 f0 breq .+2 ; 0x345cc <__divsf3_pse+0x56> 345ca: bb 0b sbc r27, r27 345cc: 80 2d mov r24, r0 345ce: bf 01 movw r22, r30 345d0: ff 27 eor r31, r31 345d2: 93 58 subi r25, 0x83 ; 131 345d4: 5f 4f sbci r21, 0xFF ; 255 345d6: 3a f0 brmi .+14 ; 0x345e6 <__divsf3_pse+0x70> 345d8: 9e 3f cpi r25, 0xFE ; 254 345da: 51 05 cpc r21, r1 345dc: 78 f0 brcs .+30 ; 0x345fc <__divsf3_pse+0x86> 345de: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 345e2: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 345e6: 5f 3f cpi r21, 0xFF ; 255 345e8: e4 f3 brlt .-8 ; 0x345e2 <__divsf3_pse+0x6c> 345ea: 98 3e cpi r25, 0xE8 ; 232 345ec: d4 f3 brlt .-12 ; 0x345e2 <__divsf3_pse+0x6c> 345ee: 86 95 lsr r24 345f0: 77 95 ror r23 345f2: 67 95 ror r22 345f4: b7 95 ror r27 345f6: f7 95 ror r31 345f8: 9f 5f subi r25, 0xFF ; 255 345fa: c9 f7 brne .-14 ; 0x345ee <__divsf3_pse+0x78> 345fc: 88 0f add r24, r24 345fe: 91 1d adc r25, r1 34600: 96 95 lsr r25 34602: 87 95 ror r24 34604: 97 f9 bld r25, 7 34606: 08 95 ret 34608: e1 e0 ldi r30, 0x01 ; 1 3460a: 66 0f add r22, r22 3460c: 77 1f adc r23, r23 3460e: 88 1f adc r24, r24 34610: bb 1f adc r27, r27 34612: 62 17 cp r22, r18 34614: 73 07 cpc r23, r19 34616: 84 07 cpc r24, r20 34618: ba 07 cpc r27, r26 3461a: 20 f0 brcs .+8 ; 0x34624 <__divsf3_pse+0xae> 3461c: 62 1b sub r22, r18 3461e: 73 0b sbc r23, r19 34620: 84 0b sbc r24, r20 34622: ba 0b sbc r27, r26 34624: ee 1f adc r30, r30 34626: 88 f7 brcc .-30 ; 0x3460a <__divsf3_pse+0x94> 34628: e0 95 com r30 3462a: 08 95 ret 0003462c <__fixsfsi>: 3462c: 0f 94 1d a3 call 0x3463a ; 0x3463a <__fixunssfsi> 34630: 68 94 set 34632: b1 11 cpse r27, r1 34634: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 34638: 08 95 ret 0003463a <__fixunssfsi>: 3463a: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 3463e: 88 f0 brcs .+34 ; 0x34662 <__fixunssfsi+0x28> 34640: 9f 57 subi r25, 0x7F ; 127 34642: 98 f0 brcs .+38 ; 0x3466a <__fixunssfsi+0x30> 34644: b9 2f mov r27, r25 34646: 99 27 eor r25, r25 34648: b7 51 subi r27, 0x17 ; 23 3464a: b0 f0 brcs .+44 ; 0x34678 <__fixunssfsi+0x3e> 3464c: e1 f0 breq .+56 ; 0x34686 <__fixunssfsi+0x4c> 3464e: 66 0f add r22, r22 34650: 77 1f adc r23, r23 34652: 88 1f adc r24, r24 34654: 99 1f adc r25, r25 34656: 1a f0 brmi .+6 ; 0x3465e <__fixunssfsi+0x24> 34658: ba 95 dec r27 3465a: c9 f7 brne .-14 ; 0x3464e <__fixunssfsi+0x14> 3465c: 14 c0 rjmp .+40 ; 0x34686 <__fixunssfsi+0x4c> 3465e: b1 30 cpi r27, 0x01 ; 1 34660: 91 f0 breq .+36 ; 0x34686 <__fixunssfsi+0x4c> 34662: 0f 94 01 9c call 0x33802 ; 0x33802 <__fp_zero> 34666: b1 e0 ldi r27, 0x01 ; 1 34668: 08 95 ret 3466a: 0d 94 01 9c jmp 0x33802 ; 0x33802 <__fp_zero> 3466e: 67 2f mov r22, r23 34670: 78 2f mov r23, r24 34672: 88 27 eor r24, r24 34674: b8 5f subi r27, 0xF8 ; 248 34676: 39 f0 breq .+14 ; 0x34686 <__fixunssfsi+0x4c> 34678: b9 3f cpi r27, 0xF9 ; 249 3467a: cc f3 brlt .-14 ; 0x3466e <__fixunssfsi+0x34> 3467c: 86 95 lsr r24 3467e: 77 95 ror r23 34680: 67 95 ror r22 34682: b3 95 inc r27 34684: d9 f7 brne .-10 ; 0x3467c <__fixunssfsi+0x42> 34686: 3e f4 brtc .+14 ; 0x34696 <__fixunssfsi+0x5c> 34688: 90 95 com r25 3468a: 80 95 com r24 3468c: 70 95 com r23 3468e: 61 95 neg r22 34690: 7f 4f sbci r23, 0xFF ; 255 34692: 8f 4f sbci r24, 0xFF ; 255 34694: 9f 4f sbci r25, 0xFF ; 255 34696: 08 95 ret 00034698 : 34698: 0f 94 16 a4 call 0x3482c ; 0x3482c <__fp_trunc> 3469c: 90 f0 brcs .+36 ; 0x346c2 3469e: 9f 37 cpi r25, 0x7F ; 127 346a0: 48 f4 brcc .+18 ; 0x346b4 346a2: 91 11 cpse r25, r1 346a4: 16 f0 brts .+4 ; 0x346aa 346a6: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 346aa: 60 e0 ldi r22, 0x00 ; 0 346ac: 70 e0 ldi r23, 0x00 ; 0 346ae: 80 e8 ldi r24, 0x80 ; 128 346b0: 9f eb ldi r25, 0xBF ; 191 346b2: 08 95 ret 346b4: 26 f4 brtc .+8 ; 0x346be 346b6: 1b 16 cp r1, r27 346b8: 61 1d adc r22, r1 346ba: 71 1d adc r23, r1 346bc: 81 1d adc r24, r1 346be: 0d 94 87 a3 jmp 0x3470e ; 0x3470e <__fp_mintl> 346c2: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 000346c6 <__fp_cmp>: 346c6: 99 0f add r25, r25 346c8: 00 08 sbc r0, r0 346ca: 55 0f add r21, r21 346cc: aa 0b sbc r26, r26 346ce: e0 e8 ldi r30, 0x80 ; 128 346d0: fe ef ldi r31, 0xFE ; 254 346d2: 16 16 cp r1, r22 346d4: 17 06 cpc r1, r23 346d6: e8 07 cpc r30, r24 346d8: f9 07 cpc r31, r25 346da: c0 f0 brcs .+48 ; 0x3470c <__fp_cmp+0x46> 346dc: 12 16 cp r1, r18 346de: 13 06 cpc r1, r19 346e0: e4 07 cpc r30, r20 346e2: f5 07 cpc r31, r21 346e4: 98 f0 brcs .+38 ; 0x3470c <__fp_cmp+0x46> 346e6: 62 1b sub r22, r18 346e8: 73 0b sbc r23, r19 346ea: 84 0b sbc r24, r20 346ec: 95 0b sbc r25, r21 346ee: 39 f4 brne .+14 ; 0x346fe <__fp_cmp+0x38> 346f0: 0a 26 eor r0, r26 346f2: 61 f0 breq .+24 ; 0x3470c <__fp_cmp+0x46> 346f4: 23 2b or r18, r19 346f6: 24 2b or r18, r20 346f8: 25 2b or r18, r21 346fa: 21 f4 brne .+8 ; 0x34704 <__fp_cmp+0x3e> 346fc: 08 95 ret 346fe: 0a 26 eor r0, r26 34700: 09 f4 brne .+2 ; 0x34704 <__fp_cmp+0x3e> 34702: a1 40 sbci r26, 0x01 ; 1 34704: a6 95 lsr r26 34706: 8f ef ldi r24, 0xFF ; 255 34708: 81 1d adc r24, r1 3470a: 81 1d adc r24, r1 3470c: 08 95 ret 0003470e <__fp_mintl>: 3470e: 88 23 and r24, r24 34710: 71 f4 brne .+28 ; 0x3472e <__fp_mintl+0x20> 34712: 77 23 and r23, r23 34714: 21 f0 breq .+8 ; 0x3471e <__fp_mintl+0x10> 34716: 98 50 subi r25, 0x08 ; 8 34718: 87 2b or r24, r23 3471a: 76 2f mov r23, r22 3471c: 07 c0 rjmp .+14 ; 0x3472c <__fp_mintl+0x1e> 3471e: 66 23 and r22, r22 34720: 11 f4 brne .+4 ; 0x34726 <__fp_mintl+0x18> 34722: 99 27 eor r25, r25 34724: 0d c0 rjmp .+26 ; 0x34740 <__fp_mintl+0x32> 34726: 90 51 subi r25, 0x10 ; 16 34728: 86 2b or r24, r22 3472a: 70 e0 ldi r23, 0x00 ; 0 3472c: 60 e0 ldi r22, 0x00 ; 0 3472e: 2a f0 brmi .+10 ; 0x3473a <__fp_mintl+0x2c> 34730: 9a 95 dec r25 34732: 66 0f add r22, r22 34734: 77 1f adc r23, r23 34736: 88 1f adc r24, r24 34738: da f7 brpl .-10 ; 0x34730 <__fp_mintl+0x22> 3473a: 88 0f add r24, r24 3473c: 96 95 lsr r25 3473e: 87 95 ror r24 34740: 97 f9 bld r25, 7 34742: 08 95 ret 00034744 <__fp_mpack>: 34744: 9f 3f cpi r25, 0xFF ; 255 34746: 31 f0 breq .+12 ; 0x34754 <__fp_mpack_finite+0xc> 00034748 <__fp_mpack_finite>: 34748: 91 50 subi r25, 0x01 ; 1 3474a: 20 f4 brcc .+8 ; 0x34754 <__fp_mpack_finite+0xc> 3474c: 87 95 ror r24 3474e: 77 95 ror r23 34750: 67 95 ror r22 34752: b7 95 ror r27 34754: 88 0f add r24, r24 34756: 91 1d adc r25, r1 34758: 96 95 lsr r25 3475a: 87 95 ror r24 3475c: 97 f9 bld r25, 7 3475e: 08 95 ret 00034760 <__fp_powser>: 34760: df 93 push r29 34762: cf 93 push r28 34764: 1f 93 push r17 34766: 0f 93 push r16 34768: ff 92 push r15 3476a: ef 92 push r14 3476c: df 92 push r13 3476e: 7b 01 movw r14, r22 34770: 8c 01 movw r16, r24 34772: 68 94 set 34774: 06 c0 rjmp .+12 ; 0x34782 <__fp_powser+0x22> 34776: da 2e mov r13, r26 34778: ef 01 movw r28, r30 3477a: 0f 94 5d 9b call 0x336ba ; 0x336ba <__mulsf3x> 3477e: fe 01 movw r30, r28 34780: e8 94 clt 34782: a5 91 lpm r26, Z+ 34784: 25 91 lpm r18, Z+ 34786: 35 91 lpm r19, Z+ 34788: 45 91 lpm r20, Z+ 3478a: 55 91 lpm r21, Z+ 3478c: a6 f3 brts .-24 ; 0x34776 <__fp_powser+0x16> 3478e: ef 01 movw r28, r30 34790: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34794: fe 01 movw r30, r28 34796: 97 01 movw r18, r14 34798: a8 01 movw r20, r16 3479a: da 94 dec r13 3479c: 69 f7 brne .-38 ; 0x34778 <__fp_powser+0x18> 3479e: df 90 pop r13 347a0: ef 90 pop r14 347a2: ff 90 pop r15 347a4: 0f 91 pop r16 347a6: 1f 91 pop r17 347a8: cf 91 pop r28 347aa: df 91 pop r29 347ac: 08 95 ret 347ae: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 000347b2 <__fp_rempio2>: 347b2: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 347b6: d8 f3 brcs .-10 ; 0x347ae <__fp_powser+0x4e> 347b8: e8 94 clt 347ba: e0 e0 ldi r30, 0x00 ; 0 347bc: bb 27 eor r27, r27 347be: 9f 57 subi r25, 0x7F ; 127 347c0: f0 f0 brcs .+60 ; 0x347fe <__fp_rempio2+0x4c> 347c2: 2a ed ldi r18, 0xDA ; 218 347c4: 3f e0 ldi r19, 0x0F ; 15 347c6: 49 ec ldi r20, 0xC9 ; 201 347c8: 06 c0 rjmp .+12 ; 0x347d6 <__fp_rempio2+0x24> 347ca: ee 0f add r30, r30 347cc: bb 0f add r27, r27 347ce: 66 1f adc r22, r22 347d0: 77 1f adc r23, r23 347d2: 88 1f adc r24, r24 347d4: 28 f0 brcs .+10 ; 0x347e0 <__fp_rempio2+0x2e> 347d6: b2 3a cpi r27, 0xA2 ; 162 347d8: 62 07 cpc r22, r18 347da: 73 07 cpc r23, r19 347dc: 84 07 cpc r24, r20 347de: 28 f0 brcs .+10 ; 0x347ea <__fp_rempio2+0x38> 347e0: b2 5a subi r27, 0xA2 ; 162 347e2: 62 0b sbc r22, r18 347e4: 73 0b sbc r23, r19 347e6: 84 0b sbc r24, r20 347e8: e3 95 inc r30 347ea: 9a 95 dec r25 347ec: 72 f7 brpl .-36 ; 0x347ca <__fp_rempio2+0x18> 347ee: 80 38 cpi r24, 0x80 ; 128 347f0: 30 f4 brcc .+12 ; 0x347fe <__fp_rempio2+0x4c> 347f2: 9a 95 dec r25 347f4: bb 0f add r27, r27 347f6: 66 1f adc r22, r22 347f8: 77 1f adc r23, r23 347fa: 88 1f adc r24, r24 347fc: d2 f7 brpl .-12 ; 0x347f2 <__fp_rempio2+0x40> 347fe: 90 48 sbci r25, 0x80 ; 128 34800: 0d 94 a4 a3 jmp 0x34748 ; 0x34748 <__fp_mpack_finite> 00034804 <__fp_sinus>: 34804: ef 93 push r30 34806: e0 ff sbrs r30, 0 34808: 07 c0 rjmp .+14 ; 0x34818 <__fp_sinus+0x14> 3480a: a2 ea ldi r26, 0xA2 ; 162 3480c: 2a ed ldi r18, 0xDA ; 218 3480e: 3f e0 ldi r19, 0x0F ; 15 34810: 49 ec ldi r20, 0xC9 ; 201 34812: 5f eb ldi r21, 0xBF ; 191 34814: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34818: 0f 94 ce 9b call 0x3379c ; 0x3379c <__fp_round> 3481c: 0f 90 pop r0 3481e: 03 94 inc r0 34820: 01 fc sbrc r0, 1 34822: 90 58 subi r25, 0x80 ; 128 34824: e5 e5 ldi r30, 0x55 ; 85 34826: fd e6 ldi r31, 0x6D ; 109 34828: 0d 94 f9 a5 jmp 0x34bf2 ; 0x34bf2 <__fp_powsodd> 0003482c <__fp_trunc>: 3482c: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 34830: a0 f0 brcs .+40 ; 0x3485a <__fp_trunc+0x2e> 34832: be e7 ldi r27, 0x7E ; 126 34834: b9 17 cp r27, r25 34836: 88 f4 brcc .+34 ; 0x3485a <__fp_trunc+0x2e> 34838: bb 27 eor r27, r27 3483a: 9f 38 cpi r25, 0x8F ; 143 3483c: 60 f4 brcc .+24 ; 0x34856 <__fp_trunc+0x2a> 3483e: 16 16 cp r1, r22 34840: b1 1d adc r27, r1 34842: 67 2f mov r22, r23 34844: 78 2f mov r23, r24 34846: 88 27 eor r24, r24 34848: 98 5f subi r25, 0xF8 ; 248 3484a: f7 cf rjmp .-18 ; 0x3483a <__fp_trunc+0xe> 3484c: 86 95 lsr r24 3484e: 77 95 ror r23 34850: 67 95 ror r22 34852: b1 1d adc r27, r1 34854: 93 95 inc r25 34856: 96 39 cpi r25, 0x96 ; 150 34858: c8 f3 brcs .-14 ; 0x3484c <__fp_trunc+0x20> 3485a: 08 95 ret 0003485c <__gesf2>: 3485c: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__fp_cmp> 34860: 08 f4 brcc .+2 ; 0x34864 <__gesf2+0x8> 34862: 8f ef ldi r24, 0xFF ; 255 34864: 08 95 ret 34866: 0f 94 c0 9b call 0x33780 ; 0x33780 <__fp_pscA> 3486a: 29 f0 breq .+10 ; 0x34876 <__gesf2+0x1a> 3486c: 0f 94 c7 9b call 0x3378e ; 0x3378e <__fp_pscB> 34870: 11 f0 breq .+4 ; 0x34876 <__gesf2+0x1a> 34872: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 34876: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 3487a: b9 01 movw r22, r18 3487c: ca 01 movw r24, r20 3487e: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 00034882 : 34882: 9f 77 andi r25, 0x7F ; 127 34884: 5f 77 andi r21, 0x7F ; 127 34886: 0f 94 df 9b call 0x337be ; 0x337be <__fp_split3> 3488a: 68 f3 brcs .-38 ; 0x34866 <__gesf2+0xa> 3488c: 99 23 and r25, r25 3488e: a9 f3 breq .-22 ; 0x3487a <__gesf2+0x1e> 34890: 55 23 and r21, r21 34892: a9 f3 breq .-22 ; 0x3487e <__gesf2+0x22> 34894: ff 27 eor r31, r31 34896: 95 17 cp r25, r21 34898: 58 f4 brcc .+22 ; 0x348b0 3489a: e5 2f mov r30, r21 3489c: e9 1b sub r30, r25 3489e: ed 30 cpi r30, 0x0D ; 13 348a0: 60 f7 brcc .-40 ; 0x3487a <__gesf2+0x1e> 348a2: 5e 3b cpi r21, 0xBE ; 190 348a4: 10 f0 brcs .+4 ; 0x348aa 348a6: f1 e4 ldi r31, 0x41 ; 65 348a8: 1c c0 rjmp .+56 ; 0x348e2 348aa: 90 34 cpi r25, 0x40 ; 64 348ac: e0 f4 brcc .+56 ; 0x348e6 348ae: 0a c0 rjmp .+20 ; 0x348c4 348b0: e9 2f mov r30, r25 348b2: e5 1b sub r30, r21 348b4: ed 30 cpi r30, 0x0D ; 13 348b6: 18 f7 brcc .-58 ; 0x3487e <__gesf2+0x22> 348b8: 9e 3b cpi r25, 0xBE ; 190 348ba: 10 f0 brcs .+4 ; 0x348c0 348bc: f1 e4 ldi r31, 0x41 ; 65 348be: 11 c0 rjmp .+34 ; 0x348e2 348c0: 50 34 cpi r21, 0x40 ; 64 348c2: 88 f4 brcc .+34 ; 0x348e6 348c4: f9 ea ldi r31, 0xA9 ; 169 348c6: 88 23 and r24, r24 348c8: 2a f0 brmi .+10 ; 0x348d4 348ca: 9a 95 dec r25 348cc: 66 0f add r22, r22 348ce: 77 1f adc r23, r23 348d0: 88 1f adc r24, r24 348d2: da f7 brpl .-10 ; 0x348ca 348d4: 44 23 and r20, r20 348d6: 2a f0 brmi .+10 ; 0x348e2 348d8: 5a 95 dec r21 348da: 22 0f add r18, r18 348dc: 33 1f adc r19, r19 348de: 44 1f adc r20, r20 348e0: da f7 brpl .-10 ; 0x348d8 348e2: 9f 1b sub r25, r31 348e4: 5f 1b sub r21, r31 348e6: ff 93 push r31 348e8: 1f 93 push r17 348ea: 0f 93 push r16 348ec: ff 92 push r15 348ee: ef 92 push r14 348f0: 79 01 movw r14, r18 348f2: 8a 01 movw r16, r20 348f4: bb 27 eor r27, r27 348f6: ab 2f mov r26, r27 348f8: 9b 01 movw r18, r22 348fa: ac 01 movw r20, r24 348fc: 0f 94 60 9b call 0x336c0 ; 0x336c0 <__mulsf3_pse> 34900: 97 01 movw r18, r14 34902: a8 01 movw r20, r16 34904: bf 93 push r27 34906: 7b 01 movw r14, r22 34908: 8c 01 movw r16, r24 3490a: aa 27 eor r26, r26 3490c: ba 2f mov r27, r26 3490e: b9 01 movw r22, r18 34910: ca 01 movw r24, r20 34912: 0f 94 60 9b call 0x336c0 ; 0x336c0 <__mulsf3_pse> 34916: af 91 pop r26 34918: 97 01 movw r18, r14 3491a: a8 01 movw r20, r16 3491c: ef 90 pop r14 3491e: ff 90 pop r15 34920: 0f 91 pop r16 34922: 1f 91 pop r17 34924: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34928: 0f 94 ce 9b call 0x3379c ; 0x3379c <__fp_round> 3492c: 0f 94 73 a5 call 0x34ae6 ; 0x34ae6 34930: 4f 91 pop r20 34932: 40 ff sbrs r20, 0 34934: 08 95 ret 34936: 55 27 eor r21, r21 34938: 47 fd sbrc r20, 7 3493a: 50 95 com r21 3493c: 0d 94 ac a4 jmp 0x34958 ; 0x34958 00034940 : 34940: 9b 01 movw r18, r22 34942: ac 01 movw r20, r24 34944: 60 e0 ldi r22, 0x00 ; 0 34946: 70 e0 ldi r23, 0x00 ; 0 34948: 80 e8 ldi r24, 0x80 ; 128 3494a: 9f e3 ldi r25, 0x3F ; 63 3494c: 0d 94 a4 a2 jmp 0x34548 ; 0x34548 <__divsf3> 34950: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 34954: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 00034958 : 34958: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 3495c: d8 f3 brcs .-10 ; 0x34954 3495e: 99 23 and r25, r25 34960: c9 f3 breq .-14 ; 0x34954 34962: 94 0f add r25, r20 34964: 51 1d adc r21, r1 34966: a3 f3 brvs .-24 ; 0x34950 34968: 91 50 subi r25, 0x01 ; 1 3496a: 50 40 sbci r21, 0x00 ; 0 3496c: 94 f0 brlt .+36 ; 0x34992 3496e: 59 f0 breq .+22 ; 0x34986 34970: 88 23 and r24, r24 34972: 32 f0 brmi .+12 ; 0x34980 34974: 66 0f add r22, r22 34976: 77 1f adc r23, r23 34978: 88 1f adc r24, r24 3497a: 91 50 subi r25, 0x01 ; 1 3497c: 50 40 sbci r21, 0x00 ; 0 3497e: c1 f7 brne .-16 ; 0x34970 34980: 9e 3f cpi r25, 0xFE ; 254 34982: 51 05 cpc r21, r1 34984: 2c f7 brge .-54 ; 0x34950 34986: 88 0f add r24, r24 34988: 91 1d adc r25, r1 3498a: 96 95 lsr r25 3498c: 87 95 ror r24 3498e: 97 f9 bld r25, 7 34990: 08 95 ret 34992: 5f 3f cpi r21, 0xFF ; 255 34994: ac f0 brlt .+42 ; 0x349c0 34996: 98 3e cpi r25, 0xE8 ; 232 34998: 9c f0 brlt .+38 ; 0x349c0 3499a: bb 27 eor r27, r27 3499c: 86 95 lsr r24 3499e: 77 95 ror r23 349a0: 67 95 ror r22 349a2: b7 95 ror r27 349a4: 08 f4 brcc .+2 ; 0x349a8 349a6: b1 60 ori r27, 0x01 ; 1 349a8: 93 95 inc r25 349aa: c1 f7 brne .-16 ; 0x3499c 349ac: bb 0f add r27, r27 349ae: 58 f7 brcc .-42 ; 0x34986 349b0: 11 f4 brne .+4 ; 0x349b6 349b2: 60 ff sbrs r22, 0 349b4: e8 cf rjmp .-48 ; 0x34986 349b6: 6f 5f subi r22, 0xFF ; 255 349b8: 7f 4f sbci r23, 0xFF ; 255 349ba: 8f 4f sbci r24, 0xFF ; 255 349bc: 9f 4f sbci r25, 0xFF ; 255 349be: e3 cf rjmp .-58 ; 0x34986 349c0: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 000349c4 : 349c4: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 349c8: 58 f1 brcs .+86 ; 0x34a20 349ca: 9e 57 subi r25, 0x7E ; 126 349cc: 60 f1 brcs .+88 ; 0x34a26 349ce: 98 51 subi r25, 0x18 ; 24 349d0: a0 f0 brcs .+40 ; 0x349fa 349d2: e9 f0 breq .+58 ; 0x34a0e 349d4: 98 30 cpi r25, 0x08 ; 8 349d6: 20 f5 brcc .+72 ; 0x34a20 349d8: 09 2e mov r0, r25 349da: 99 27 eor r25, r25 349dc: 66 0f add r22, r22 349de: 77 1f adc r23, r23 349e0: 88 1f adc r24, r24 349e2: 99 1f adc r25, r25 349e4: 0a 94 dec r0 349e6: d1 f7 brne .-12 ; 0x349dc 349e8: 12 c0 rjmp .+36 ; 0x34a0e 349ea: 06 2e mov r0, r22 349ec: 67 2f mov r22, r23 349ee: 78 2f mov r23, r24 349f0: 88 27 eor r24, r24 349f2: 98 5f subi r25, 0xF8 ; 248 349f4: 11 f4 brne .+4 ; 0x349fa 349f6: 00 0c add r0, r0 349f8: 07 c0 rjmp .+14 ; 0x34a08 349fa: 99 3f cpi r25, 0xF9 ; 249 349fc: b4 f3 brlt .-20 ; 0x349ea 349fe: 86 95 lsr r24 34a00: 77 95 ror r23 34a02: 67 95 ror r22 34a04: 93 95 inc r25 34a06: d9 f7 brne .-10 ; 0x349fe 34a08: 61 1d adc r22, r1 34a0a: 71 1d adc r23, r1 34a0c: 81 1d adc r24, r1 34a0e: 3e f4 brtc .+14 ; 0x34a1e 34a10: 90 95 com r25 34a12: 80 95 com r24 34a14: 70 95 com r23 34a16: 61 95 neg r22 34a18: 7f 4f sbci r23, 0xFF ; 255 34a1a: 8f 4f sbci r24, 0xFF ; 255 34a1c: 9f 4f sbci r25, 0xFF ; 255 34a1e: 08 95 ret 34a20: 68 94 set 34a22: 0d 94 02 9c jmp 0x33804 ; 0x33804 <__fp_szero> 34a26: 0d 94 01 9c jmp 0x33802 ; 0x33802 <__fp_zero> 00034a2a : 34a2a: fa 01 movw r30, r20 34a2c: ee 0f add r30, r30 34a2e: ff 1f adc r31, r31 34a30: 30 96 adiw r30, 0x00 ; 0 34a32: 21 05 cpc r18, r1 34a34: 31 05 cpc r19, r1 34a36: a1 f1 breq .+104 ; 0x34aa0 34a38: 61 15 cp r22, r1 34a3a: 71 05 cpc r23, r1 34a3c: 61 f4 brne .+24 ; 0x34a56 34a3e: 80 38 cpi r24, 0x80 ; 128 34a40: bf e3 ldi r27, 0x3F ; 63 34a42: 9b 07 cpc r25, r27 34a44: 49 f1 breq .+82 ; 0x34a98 34a46: 68 94 set 34a48: 90 38 cpi r25, 0x80 ; 128 34a4a: 81 05 cpc r24, r1 34a4c: 61 f0 breq .+24 ; 0x34a66 34a4e: 80 38 cpi r24, 0x80 ; 128 34a50: bf ef ldi r27, 0xFF ; 255 34a52: 9b 07 cpc r25, r27 34a54: 41 f0 breq .+16 ; 0x34a66 34a56: 99 23 and r25, r25 34a58: 4a f5 brpl .+82 ; 0x34aac 34a5a: ff 3f cpi r31, 0xFF ; 255 34a5c: e1 05 cpc r30, r1 34a5e: 31 05 cpc r19, r1 34a60: 21 05 cpc r18, r1 34a62: 19 f1 breq .+70 ; 0x34aaa 34a64: e8 94 clt 34a66: 08 94 sec 34a68: e7 95 ror r30 34a6a: d9 01 movw r26, r18 34a6c: aa 23 and r26, r26 34a6e: 29 f4 brne .+10 ; 0x34a7a 34a70: ab 2f mov r26, r27 34a72: be 2f mov r27, r30 34a74: f8 5f subi r31, 0xF8 ; 248 34a76: d0 f3 brcs .-12 ; 0x34a6c 34a78: 10 c0 rjmp .+32 ; 0x34a9a 34a7a: ff 5f subi r31, 0xFF ; 255 34a7c: 70 f4 brcc .+28 ; 0x34a9a 34a7e: a6 95 lsr r26 34a80: e0 f7 brcc .-8 ; 0x34a7a 34a82: f7 39 cpi r31, 0x97 ; 151 34a84: 50 f0 brcs .+20 ; 0x34a9a 34a86: 19 f0 breq .+6 ; 0x34a8e 34a88: ff 3a cpi r31, 0xAF ; 175 34a8a: 38 f4 brcc .+14 ; 0x34a9a 34a8c: 9f 77 andi r25, 0x7F ; 127 34a8e: 9f 93 push r25 34a90: 0d d0 rcall .+26 ; 0x34aac 34a92: 0f 90 pop r0 34a94: 07 fc sbrc r0, 7 34a96: 90 58 subi r25, 0x80 ; 128 34a98: 08 95 ret 34a9a: 46 f0 brts .+16 ; 0x34aac 34a9c: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 34aa0: 60 e0 ldi r22, 0x00 ; 0 34aa2: 70 e0 ldi r23, 0x00 ; 0 34aa4: 80 e8 ldi r24, 0x80 ; 128 34aa6: 9f e3 ldi r25, 0x3F ; 63 34aa8: 08 95 ret 34aaa: 4f e7 ldi r20, 0x7F ; 127 34aac: 9f 77 andi r25, 0x7F ; 127 34aae: 5f 93 push r21 34ab0: 4f 93 push r20 34ab2: 3f 93 push r19 34ab4: 2f 93 push r18 34ab6: 0f 94 15 a6 call 0x34c2a ; 0x34c2a 34aba: 2f 91 pop r18 34abc: 3f 91 pop r19 34abe: 4f 91 pop r20 34ac0: 5f 91 pop r21 34ac2: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 34ac6: 0d 94 c0 a5 jmp 0x34b80 ; 0x34b80 00034aca : 34aca: 9f 93 push r25 34acc: 0f 94 d9 a3 call 0x347b2 ; 0x347b2 <__fp_rempio2> 34ad0: 0f 90 pop r0 34ad2: 07 fc sbrc r0, 7 34ad4: ee 5f subi r30, 0xFE ; 254 34ad6: 0d 94 02 a4 jmp 0x34804 ; 0x34804 <__fp_sinus> 34ada: 19 f4 brne .+6 ; 0x34ae2 34adc: 16 f4 brtc .+4 ; 0x34ae2 34ade: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 34ae2: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 00034ae6 : 34ae6: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 34aea: b8 f3 brcs .-18 ; 0x34ada 34aec: 99 23 and r25, r25 34aee: c9 f3 breq .-14 ; 0x34ae2 34af0: b6 f3 brts .-20 ; 0x34ade 34af2: 9f 57 subi r25, 0x7F ; 127 34af4: 55 0b sbc r21, r21 34af6: 87 ff sbrs r24, 7 34af8: 0f 94 f2 a5 call 0x34be4 ; 0x34be4 <__fp_norm2> 34afc: 00 24 eor r0, r0 34afe: a0 e6 ldi r26, 0x60 ; 96 34b00: 40 ea ldi r20, 0xA0 ; 160 34b02: 90 01 movw r18, r0 34b04: 80 58 subi r24, 0x80 ; 128 34b06: 56 95 lsr r21 34b08: 97 95 ror r25 34b0a: 28 f4 brcc .+10 ; 0x34b16 34b0c: 80 5c subi r24, 0xC0 ; 192 34b0e: 66 0f add r22, r22 34b10: 77 1f adc r23, r23 34b12: 88 1f adc r24, r24 34b14: 20 f0 brcs .+8 ; 0x34b1e 34b16: 26 17 cp r18, r22 34b18: 37 07 cpc r19, r23 34b1a: 48 07 cpc r20, r24 34b1c: 30 f4 brcc .+12 ; 0x34b2a 34b1e: 62 1b sub r22, r18 34b20: 73 0b sbc r23, r19 34b22: 84 0b sbc r24, r20 34b24: 20 29 or r18, r0 34b26: 31 29 or r19, r1 34b28: 4a 2b or r20, r26 34b2a: a6 95 lsr r26 34b2c: 17 94 ror r1 34b2e: 07 94 ror r0 34b30: 20 25 eor r18, r0 34b32: 31 25 eor r19, r1 34b34: 4a 27 eor r20, r26 34b36: 58 f7 brcc .-42 ; 0x34b0e 34b38: 66 0f add r22, r22 34b3a: 77 1f adc r23, r23 34b3c: 88 1f adc r24, r24 34b3e: 20 f0 brcs .+8 ; 0x34b48 34b40: 26 17 cp r18, r22 34b42: 37 07 cpc r19, r23 34b44: 48 07 cpc r20, r24 34b46: 30 f4 brcc .+12 ; 0x34b54 34b48: 62 0b sbc r22, r18 34b4a: 73 0b sbc r23, r19 34b4c: 84 0b sbc r24, r20 34b4e: 20 0d add r18, r0 34b50: 31 1d adc r19, r1 34b52: 41 1d adc r20, r1 34b54: a0 95 com r26 34b56: 81 f7 brne .-32 ; 0x34b38 34b58: b9 01 movw r22, r18 34b5a: 84 2f mov r24, r20 34b5c: 91 58 subi r25, 0x81 ; 129 34b5e: 88 0f add r24, r24 34b60: 96 95 lsr r25 34b62: 87 95 ror r24 34b64: 08 95 ret 00034b66 <__unordsf2>: 34b66: 0f 94 63 a3 call 0x346c6 ; 0x346c6 <__fp_cmp> 34b6a: 88 0b sbc r24, r24 34b6c: 99 0b sbc r25, r25 34b6e: 08 95 ret 34b70: 29 f4 brne .+10 ; 0x34b7c <__unordsf2+0x16> 34b72: 16 f0 brts .+4 ; 0x34b78 <__unordsf2+0x12> 34b74: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 34b78: 0d 94 01 9c jmp 0x33802 ; 0x33802 <__fp_zero> 34b7c: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 00034b80 : 34b80: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 34b84: a8 f3 brcs .-22 ; 0x34b70 <__unordsf2+0xa> 34b86: 96 38 cpi r25, 0x86 ; 134 34b88: a0 f7 brcc .-24 ; 0x34b72 <__unordsf2+0xc> 34b8a: 07 f8 bld r0, 7 34b8c: 0f 92 push r0 34b8e: e8 94 clt 34b90: 2b e3 ldi r18, 0x3B ; 59 34b92: 3a ea ldi r19, 0xAA ; 170 34b94: 48 eb ldi r20, 0xB8 ; 184 34b96: 5f e7 ldi r21, 0x7F ; 127 34b98: 0f 94 60 9b call 0x336c0 ; 0x336c0 <__mulsf3_pse> 34b9c: 0f 92 push r0 34b9e: 0f 92 push r0 34ba0: 0f 92 push r0 34ba2: 4d b7 in r20, 0x3d ; 61 34ba4: 5e b7 in r21, 0x3e ; 62 34ba6: 0f 92 push r0 34ba8: 0f 94 5d a6 call 0x34cba ; 0x34cba 34bac: e3 e7 ldi r30, 0x73 ; 115 34bae: fd e6 ldi r31, 0x6D ; 109 34bb0: 0f 94 b0 a3 call 0x34760 ; 0x34760 <__fp_powser> 34bb4: 4f 91 pop r20 34bb6: 5f 91 pop r21 34bb8: ef 91 pop r30 34bba: ff 91 pop r31 34bbc: e5 95 asr r30 34bbe: ee 1f adc r30, r30 34bc0: ff 1f adc r31, r31 34bc2: 49 f0 breq .+18 ; 0x34bd6 34bc4: fe 57 subi r31, 0x7E ; 126 34bc6: e0 68 ori r30, 0x80 ; 128 34bc8: 44 27 eor r20, r20 34bca: ee 0f add r30, r30 34bcc: 44 1f adc r20, r20 34bce: fa 95 dec r31 34bd0: e1 f7 brne .-8 ; 0x34bca 34bd2: 41 95 neg r20 34bd4: 55 0b sbc r21, r21 34bd6: 0f 94 ac a4 call 0x34958 ; 0x34958 34bda: 0f 90 pop r0 34bdc: 07 fe sbrs r0, 7 34bde: 0d 94 a0 a4 jmp 0x34940 ; 0x34940 34be2: 08 95 ret 00034be4 <__fp_norm2>: 34be4: 91 50 subi r25, 0x01 ; 1 34be6: 50 40 sbci r21, 0x00 ; 0 34be8: 66 0f add r22, r22 34bea: 77 1f adc r23, r23 34bec: 88 1f adc r24, r24 34bee: d2 f7 brpl .-12 ; 0x34be4 <__fp_norm2> 34bf0: 08 95 ret 00034bf2 <__fp_powsodd>: 34bf2: 9f 93 push r25 34bf4: 8f 93 push r24 34bf6: 7f 93 push r23 34bf8: 6f 93 push r22 34bfa: ff 93 push r31 34bfc: ef 93 push r30 34bfe: 9b 01 movw r18, r22 34c00: ac 01 movw r20, r24 34c02: 0f 94 4a 9b call 0x33694 ; 0x33694 <__mulsf3> 34c06: ef 91 pop r30 34c08: ff 91 pop r31 34c0a: 0f 94 b0 a3 call 0x34760 ; 0x34760 <__fp_powser> 34c0e: 2f 91 pop r18 34c10: 3f 91 pop r19 34c12: 4f 91 pop r20 34c14: 5f 91 pop r21 34c16: 0d 94 4a 9b jmp 0x33694 ; 0x33694 <__mulsf3> 34c1a: 16 f0 brts .+4 ; 0x34c20 <__fp_powsodd+0x2e> 34c1c: 0d 94 a2 a3 jmp 0x34744 ; 0x34744 <__fp_mpack> 34c20: 0d 94 bd 9b jmp 0x3377a ; 0x3377a <__fp_nan> 34c24: 68 94 set 34c26: 0d 94 b7 9b jmp 0x3376e ; 0x3376e <__fp_inf> 00034c2a : 34c2a: 0f 94 e7 9b call 0x337ce ; 0x337ce <__fp_splitA> 34c2e: a8 f3 brcs .-22 ; 0x34c1a <__fp_powsodd+0x28> 34c30: 99 23 and r25, r25 34c32: c1 f3 breq .-16 ; 0x34c24 <__fp_powsodd+0x32> 34c34: ae f3 brts .-22 ; 0x34c20 <__fp_powsodd+0x2e> 34c36: df 93 push r29 34c38: cf 93 push r28 34c3a: 1f 93 push r17 34c3c: 0f 93 push r16 34c3e: ff 92 push r15 34c40: c9 2f mov r28, r25 34c42: dd 27 eor r29, r29 34c44: 88 23 and r24, r24 34c46: 2a f0 brmi .+10 ; 0x34c52 34c48: 21 97 sbiw r28, 0x01 ; 1 34c4a: 66 0f add r22, r22 34c4c: 77 1f adc r23, r23 34c4e: 88 1f adc r24, r24 34c50: da f7 brpl .-10 ; 0x34c48 34c52: 20 e0 ldi r18, 0x00 ; 0 34c54: 30 e0 ldi r19, 0x00 ; 0 34c56: 40 e8 ldi r20, 0x80 ; 128 34c58: 5f eb ldi r21, 0xBF ; 191 34c5a: 9f e3 ldi r25, 0x3F ; 63 34c5c: 88 39 cpi r24, 0x98 ; 152 34c5e: 20 f0 brcs .+8 ; 0x34c68 34c60: 80 3e cpi r24, 0xE0 ; 224 34c62: 38 f0 brcs .+14 ; 0x34c72 34c64: 21 96 adiw r28, 0x01 ; 1 34c66: 8f 77 andi r24, 0x7F ; 127 34c68: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 34c6c: eb e9 ldi r30, 0x9B ; 155 34c6e: fd e6 ldi r31, 0x6D ; 109 34c70: 04 c0 rjmp .+8 ; 0x34c7a 34c72: 0f 94 a5 a1 call 0x3434a ; 0x3434a <__addsf3> 34c76: e8 ec ldi r30, 0xC8 ; 200 34c78: fd e6 ldi r31, 0x6D ; 109 34c7a: 0f 94 b0 a3 call 0x34760 ; 0x34760 <__fp_powser> 34c7e: 8b 01 movw r16, r22 34c80: be 01 movw r22, r28 34c82: ec 01 movw r28, r24 34c84: fb 2e mov r15, r27 34c86: 6f 57 subi r22, 0x7F ; 127 34c88: 71 09 sbc r23, r1 34c8a: 75 95 asr r23 34c8c: 77 1f adc r23, r23 34c8e: 88 0b sbc r24, r24 34c90: 99 0b sbc r25, r25 34c92: 0f 94 0b 9b call 0x33616 ; 0x33616 <__floatsisf> 34c96: 28 e1 ldi r18, 0x18 ; 24 34c98: 32 e7 ldi r19, 0x72 ; 114 34c9a: 41 e3 ldi r20, 0x31 ; 49 34c9c: 5f e3 ldi r21, 0x3F ; 63 34c9e: 0f 94 5d 9b call 0x336ba ; 0x336ba <__mulsf3x> 34ca2: af 2d mov r26, r15 34ca4: 98 01 movw r18, r16 34ca6: ae 01 movw r20, r28 34ca8: ff 90 pop r15 34caa: 0f 91 pop r16 34cac: 1f 91 pop r17 34cae: cf 91 pop r28 34cb0: df 91 pop r29 34cb2: 0f 94 bc a1 call 0x34378 ; 0x34378 <__addsf3x> 34cb6: 0d 94 ce 9b jmp 0x3379c ; 0x3379c <__fp_round> 00034cba : 34cba: fa 01 movw r30, r20 34cbc: dc 01 movw r26, r24 34cbe: aa 0f add r26, r26 34cc0: bb 1f adc r27, r27 34cc2: 9b 01 movw r18, r22 34cc4: ac 01 movw r20, r24 34cc6: bf 57 subi r27, 0x7F ; 127 34cc8: 28 f4 brcc .+10 ; 0x34cd4 34cca: 22 27 eor r18, r18 34ccc: 33 27 eor r19, r19 34cce: 44 27 eor r20, r20 34cd0: 50 78 andi r21, 0x80 ; 128 34cd2: 20 c0 rjmp .+64 ; 0x34d14 34cd4: b7 51 subi r27, 0x17 ; 23 34cd6: 90 f4 brcc .+36 ; 0x34cfc 34cd8: ab 2f mov r26, r27 34cda: 00 24 eor r0, r0 34cdc: 46 95 lsr r20 34cde: 37 95 ror r19 34ce0: 27 95 ror r18 34ce2: 01 1c adc r0, r1 34ce4: a3 95 inc r26 34ce6: d2 f3 brmi .-12 ; 0x34cdc 34ce8: 00 20 and r0, r0 34cea: 71 f0 breq .+28 ; 0x34d08 34cec: 22 0f add r18, r18 34cee: 33 1f adc r19, r19 34cf0: 44 1f adc r20, r20 34cf2: b3 95 inc r27 34cf4: da f3 brmi .-10 ; 0x34cec 34cf6: 0e d0 rcall .+28 ; 0x34d14 34cf8: 0d 94 a4 a1 jmp 0x34348 ; 0x34348 <__subsf3> 34cfc: 61 30 cpi r22, 0x01 ; 1 34cfe: 71 05 cpc r23, r1 34d00: a0 e8 ldi r26, 0x80 ; 128 34d02: 8a 07 cpc r24, r26 34d04: b9 46 sbci r27, 0x69 ; 105 34d06: 30 f4 brcc .+12 ; 0x34d14 34d08: 9b 01 movw r18, r22 34d0a: ac 01 movw r20, r24 34d0c: 66 27 eor r22, r22 34d0e: 77 27 eor r23, r23 34d10: 88 27 eor r24, r24 34d12: 90 78 andi r25, 0x80 ; 128 34d14: 30 96 adiw r30, 0x00 ; 0 34d16: 21 f0 breq .+8 ; 0x34d20 34d18: 20 83 st Z, r18 34d1a: 31 83 std Z+1, r19 ; 0x01 34d1c: 42 83 std Z+2, r20 ; 0x02 34d1e: 53 83 std Z+3, r21 ; 0x03 34d20: 08 95 ret 00034d22 : 34d22: 91 11 cpse r25, r1 34d24: 08 95 ret 34d26: 81 54 subi r24, 0x41 ; 65 34d28: 8a 51 subi r24, 0x1A ; 26 34d2a: 08 f4 brcc .+2 ; 0x34d2e 34d2c: 80 5e subi r24, 0xE0 ; 224 34d2e: 85 5a subi r24, 0xA5 ; 165 34d30: 08 95 ret 00034d32 : 34d32: fb 01 movw r30, r22 34d34: dc 01 movw r26, r24 34d36: 04 c0 rjmp .+8 ; 0x34d40 34d38: 8d 91 ld r24, X+ 34d3a: 01 90 ld r0, Z+ 34d3c: 80 19 sub r24, r0 34d3e: 21 f4 brne .+8 ; 0x34d48 34d40: 41 50 subi r20, 0x01 ; 1 34d42: 50 40 sbci r21, 0x00 ; 0 34d44: c8 f7 brcc .-14 ; 0x34d38 34d46: 88 1b sub r24, r24 34d48: 99 0b sbc r25, r25 34d4a: 08 95 ret 00034d4c : 34d4c: fb 01 movw r30, r22 34d4e: dc 01 movw r26, r24 34d50: 02 c0 rjmp .+4 ; 0x34d56 34d52: 01 90 ld r0, Z+ 34d54: 0d 92 st X+, r0 34d56: 41 50 subi r20, 0x01 ; 1 34d58: 50 40 sbci r21, 0x00 ; 0 34d5a: d8 f7 brcc .-10 ; 0x34d52 34d5c: 08 95 ret 00034d5e : 34d5e: dc 01 movw r26, r24 34d60: 01 c0 rjmp .+2 ; 0x34d64 34d62: 6d 93 st X+, r22 34d64: 41 50 subi r20, 0x01 ; 1 34d66: 50 40 sbci r21, 0x00 ; 0 34d68: e0 f7 brcc .-8 ; 0x34d62 34d6a: 08 95 ret 00034d6c : 34d6c: fb 01 movw r30, r22 34d6e: dc 01 movw r26, r24 34d70: 8d 91 ld r24, X+ 34d72: 81 34 cpi r24, 0x41 ; 65 34d74: 1c f0 brlt .+6 ; 0x34d7c 34d76: 8b 35 cpi r24, 0x5B ; 91 34d78: 0c f4 brge .+2 ; 0x34d7c 34d7a: 80 5e subi r24, 0xE0 ; 224 34d7c: 61 91 ld r22, Z+ 34d7e: 61 34 cpi r22, 0x41 ; 65 34d80: 1c f0 brlt .+6 ; 0x34d88 34d82: 6b 35 cpi r22, 0x5B ; 91 34d84: 0c f4 brge .+2 ; 0x34d88 34d86: 60 5e subi r22, 0xE0 ; 224 34d88: 86 1b sub r24, r22 34d8a: 61 11 cpse r22, r1 34d8c: 89 f3 breq .-30 ; 0x34d70 34d8e: 99 0b sbc r25, r25 34d90: 08 95 ret 00034d92 : 34d92: fb 01 movw r30, r22 34d94: dc 01 movw r26, r24 34d96: 0d 90 ld r0, X+ 34d98: 00 20 and r0, r0 34d9a: e9 f7 brne .-6 ; 0x34d96 34d9c: 11 97 sbiw r26, 0x01 ; 1 34d9e: 01 90 ld r0, Z+ 34da0: 0d 92 st X+, r0 34da2: 00 20 and r0, r0 34da4: e1 f7 brne .-8 ; 0x34d9e 34da6: 08 95 ret 00034da8 : 34da8: fc 01 movw r30, r24 34daa: 81 91 ld r24, Z+ 34dac: 86 17 cp r24, r22 34dae: 21 f0 breq .+8 ; 0x34db8 34db0: 88 23 and r24, r24 34db2: d9 f7 brne .-10 ; 0x34daa 34db4: 99 27 eor r25, r25 34db6: 08 95 ret 34db8: 31 97 sbiw r30, 0x01 ; 1 34dba: cf 01 movw r24, r30 34dbc: 08 95 ret 00034dbe : 34dbe: fb 01 movw r30, r22 34dc0: dc 01 movw r26, r24 34dc2: 8d 91 ld r24, X+ 34dc4: 01 90 ld r0, Z+ 34dc6: 80 19 sub r24, r0 34dc8: 01 10 cpse r0, r1 34dca: d9 f3 breq .-10 ; 0x34dc2 34dcc: 99 0b sbc r25, r25 34dce: 08 95 ret 00034dd0 : 34dd0: fb 01 movw r30, r22 34dd2: dc 01 movw r26, r24 34dd4: 01 90 ld r0, Z+ 34dd6: 0d 92 st X+, r0 34dd8: 00 20 and r0, r0 34dda: e1 f7 brne .-8 ; 0x34dd4 34ddc: 08 95 ret 00034dde : 34dde: fb 01 movw r30, r22 34de0: dc 01 movw r26, r24 34de2: 41 50 subi r20, 0x01 ; 1 34de4: 50 40 sbci r21, 0x00 ; 0 34de6: 30 f0 brcs .+12 ; 0x34df4 34de8: 8d 91 ld r24, X+ 34dea: 01 90 ld r0, Z+ 34dec: 80 19 sub r24, r0 34dee: 19 f4 brne .+6 ; 0x34df6 34df0: 00 20 and r0, r0 34df2: b9 f7 brne .-18 ; 0x34de2 34df4: 88 1b sub r24, r24 34df6: 99 0b sbc r25, r25 34df8: 08 95 ret 00034dfa : 34dfa: fb 01 movw r30, r22 34dfc: dc 01 movw r26, r24 34dfe: 41 50 subi r20, 0x01 ; 1 34e00: 50 40 sbci r21, 0x00 ; 0 34e02: 48 f0 brcs .+18 ; 0x34e16 34e04: 01 90 ld r0, Z+ 34e06: 0d 92 st X+, r0 34e08: 00 20 and r0, r0 34e0a: c9 f7 brne .-14 ; 0x34dfe 34e0c: 01 c0 rjmp .+2 ; 0x34e10 34e0e: 1d 92 st X+, r1 34e10: 41 50 subi r20, 0x01 ; 1 34e12: 50 40 sbci r21, 0x00 ; 0 34e14: e0 f7 brcc .-8 ; 0x34e0e 34e16: 08 95 ret 00034e18 : 34e18: 0f 93 push r16 34e1a: 1f 93 push r17 34e1c: cf 93 push r28 34e1e: df 93 push r29 34e20: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 34e24: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 34e28: 23 81 ldd r18, Z+3 ; 0x03 34e2a: ec 01 movw r28, r24 34e2c: 10 e0 ldi r17, 0x00 ; 0 34e2e: 00 e0 ldi r16, 0x00 ; 0 34e30: 21 fd sbrc r18, 1 34e32: 08 c0 rjmp .+16 ; 0x34e44 34e34: 0f ef ldi r16, 0xFF ; 255 34e36: 1f ef ldi r17, 0xFF ; 255 34e38: 14 c0 rjmp .+40 ; 0x34e62 34e3a: 19 95 eicall 34e3c: 89 2b or r24, r25 34e3e: 11 f0 breq .+4 ; 0x34e44 34e40: 0f ef ldi r16, 0xFF ; 255 34e42: 1f ef ldi r17, 0xFF ; 255 34e44: 89 91 ld r24, Y+ 34e46: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 34e4a: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 34e4e: db 01 movw r26, r22 34e50: 18 96 adiw r26, 0x08 ; 8 34e52: ed 91 ld r30, X+ 34e54: fc 91 ld r31, X 34e56: 81 11 cpse r24, r1 34e58: f0 cf rjmp .-32 ; 0x34e3a 34e5a: 8a e0 ldi r24, 0x0A ; 10 34e5c: 19 95 eicall 34e5e: 89 2b or r24, r25 34e60: 49 f7 brne .-46 ; 0x34e34 34e62: c8 01 movw r24, r16 34e64: df 91 pop r29 34e66: cf 91 pop r28 34e68: 1f 91 pop r17 34e6a: 0f 91 pop r16 34e6c: 08 95 ret 00034e6e <__do_global_dtors>: 34e6e: 11 e5 ldi r17, 0x51 ; 81 34e70: c2 e4 ldi r28, 0x42 ; 66 34e72: d1 e5 ldi r29, 0x51 ; 81 34e74: 00 e0 ldi r16, 0x00 ; 0 34e76: 06 c0 rjmp .+12 ; 0x34e84 <__do_global_dtors+0x16> 34e78: 80 2f mov r24, r16 34e7a: fe 01 movw r30, r28 34e7c: 0f 94 8d a1 call 0x3431a ; 0x3431a <__tablejump2__> 34e80: 21 96 adiw r28, 0x01 ; 1 34e82: 01 1d adc r16, r1 34e84: c3 34 cpi r28, 0x43 ; 67 34e86: d1 07 cpc r29, r17 34e88: 80 e0 ldi r24, 0x00 ; 0 34e8a: 08 07 cpc r16, r24 34e8c: a9 f7 brne .-22 ; 0x34e78 <__do_global_dtors+0xa> 34e8e: f8 94 cli 00034e90 <__stop_program>: 34e90: ff cf rjmp .-2 ; 0x34e90 <__stop_program>